From da4c036ef3d6b03d02d32fbcc91e63ce6aceffa8 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 8 Jun 2023 14:00:39 +0000 Subject: [PATCH 001/204] Makefile: exclude extra binaries from spellcheck --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 69154512..ea54a10d 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,8 @@ CS_IGNORE_WORDS ?= iinclude,struc,fo,ue,od,ba,padd spellcheck: $(CODESPELL) -d -L $(CS_IGNORE_WORDS) \ -S "*.obj,*.o,*.a,*.so,*.lib,*~,*.so,*.so.*,*.d,imb-perf" \ - -S "imb-kat,imb-xvalid" \ + -S "imb-kat,imb-xvalid,imb-acvp,imb-fuzz-api,imb-fuzz-direct-api" \ + -S "imb-wycheproof" \ ./lib ./perf ./test README.md SECURITY.md CONTRIBUTING \ Makefile win_x64.mak ReleaseNotes.txt LICENSE $(CS_EXTRA_OPTS) -- GitLab From 4e7bf5d9fbc84a43e882534f70a8af1964f98269 Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Thu, 1 Jun 2023 17:06:02 +0100 Subject: [PATCH 002/204] test: Test vector cleanup --- test/kat-app/cmac_test.json.c | 712 ++++++++++++------------- test/kat-app/ghash_test.c | 6 +- test/kat-app/ghash_test.json.c | 42 +- test/kat-app/gmac_test.c | 21 +- test/kat-app/gmac_test.json.c | 90 ++-- test/kat-app/hmac_md5.json.c | 210 ++++---- test/kat-app/hmac_md5_test.c | 22 +- test/kat-app/hmac_sha1.json.c | 166 +++--- test/kat-app/hmac_sha1_test.c | 32 +- test/kat-app/hmac_sha224.json.c | 18 +- test/kat-app/hmac_sha256.json.c | 18 +- test/kat-app/hmac_sha256_sha512_test.c | 38 +- test/kat-app/hmac_sha384.json.c | 18 +- test/kat-app/hmac_sha512.json.c | 18 +- test/kat-app/poly1305_test.json.c | 268 +++++----- 15 files changed, 837 insertions(+), 842 deletions(-) diff --git a/test/kat-app/cmac_test.json.c b/test/kat-app/cmac_test.json.c index e0b8abba..5e10250f 100644 --- a/test/kat-app/cmac_test.json.c +++ b/test/kat-app/cmac_test.json.c @@ -29,365 +29,365 @@ #include "mac_test.h" const struct mac_test cmac_128_test_json[] = { - /* Vectors from https://tools.ietf.org/html/rfc4493 */ - {128, 128, 1, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 128, 2, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 128, 3, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 128, 4, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 120, 5, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 120, 6, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 120, 7, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 120, 8, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 96, 9, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 96, 10, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 96, 11, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 96, 12, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 32, 13, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 32, 14, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 32, 15, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 32, 16, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 128, 17, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdc\x87\xcd\xcf\x77\xa2\xf1\x82\x9e\x01\x2c\x4d\x31\xaf\x2f\x8b", 1, 64, - NULL, 0}, + /* Vectors from https://tools.ietf.org/html/rfc4493 */ + {128, 128, 1, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, + NULL, 0}, + {128, 128, 2, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, + NULL, 0}, + {128, 128, 3, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, + NULL, 0}, + {128, 128, 4, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, + NULL, 0}, + {128, 120, 5, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, + NULL, 0}, + {128, 120, 6, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, + NULL, 0}, + {128, 120, 7, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, + NULL, 0}, + {128, 120, 8, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, + NULL, 0}, + {128, 96, 9, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, + NULL, 0}, + {128, 96, 10, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, + NULL, 0}, + {128, 96, 11, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, + NULL, 0}, + {128, 96, 12, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, + NULL, 0}, + {128, 32, 13, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, + NULL, 0}, + {128, 32, 14, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, + NULL, 0}, + {128, 32, 15, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, + NULL, 0}, + {128, 32, 16, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, + NULL, 0}, + {128, 128, 17, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdc\x87\xcd\xcf\x77\xa2\xf1\x82\x9e\x01\x2c\x4d\x31\xaf\x2f\x8b", 1, 64, + NULL, 0}, {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} }; const struct mac_test cmac_256_test_json[] = { - /* Vectors from https://tools.ietf.org/html/rfc4493 */ - {256, 128, 1, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e\xfc\x6b\x55\x1f\x46\x67\xd9\x83", 1, 0, - NULL, 0}, - {256, 128, 2, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x28\xa7\x02\x3f\x45\x2e\x8f\x82\xbd\x4b\xf2\x8d\x8c\x37\xc3\x5c", 1, 128, - NULL, 0}, - {256, 128, 3, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x15\x67\x27\xdc\x08\x78\x94\x4a\x02\x3c\x1f\xe0\x3b\xad\x6d\x93", 1, 160, - NULL, 0}, - {256, 128, 4, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xe1\x99\x21\x90\x54\x9f\x6e\xd5\x69\x6a\x2c\x05\x6c\x31\x54\x10", 1, 512, - NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} - }; + /* Vectors from https://tools.ietf.org/html/rfc4493 */ + {256, 128, 1, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e\xfc\x6b\x55\x1f\x46\x67\xd9\x83", 1, 0, + NULL, 0}, + {256, 128, 2, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x28\xa7\x02\x3f\x45\x2e\x8f\x82\xbd\x4b\xf2\x8d\x8c\x37\xc3\x5c", 1, 128, + NULL, 0}, + {256, 128, 3, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x15\x67\x27\xdc\x08\x78\x94\x4a\x02\x3c\x1f\xe0\x3b\xad\x6d\x93", 1, 160, + NULL, 0}, + {256, 128, 4, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xe1\x99\x21\x90\x54\x9f\x6e\xd5\x69\x6a\x2c\x05\x6c\x31\x54\x10", 1, 512, + NULL, 0}, + {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + }; -const struct mac_test cmac_3gpp_test_json[] = { - /* Vectors from https://tools.ietf.org/html/rfc4493 */ - {128, 32, 1, - "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", - "\x38\xa6\xf0\x56\xc0\x00\x00\x00\x33\x32\x34\x62\x63\x39\x38\x40", - "\x11\x8c\x6e\xb8", 1, 122, NULL, 0}, - {128, 32, 2, - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x39\x8a\x59\xb4\xd4\x00\x00\x00\x48\x45\x83\xd5\xaf\xe0\x82\xae", - "\xb9\x37\x87\xe6", 1, 128, NULL, 0}, - {128, 32, 3, - "\x7e\x5e\x94\x43\x1e\x11\xd7\x38\x28\xd7\x39\xcc\x6c\xed\x45\x73", - "\x36\xaf\x61\x44\xc4\x00\x00\x00\xb3\xd3\xc9\x17\x0a\x4e\x16\x32\xf6\x0f" - "\x86\x10\x13\xd2\x2d\x84\xb7\x26\xb6\xa2\x78\xd8\x02\xd1\xee\xaf\x13\x21" - "\xba\x59\x29\xdc", - "\x1f\x60\xb0\x1d", 1, 318, NULL, 0}, - {128, 32, 4, - "\xd3\x41\x9b\xe8\x21\x08\x7a\xcd\x02\x12\x3a\x92\x48\x03\x33\x59", - "\xc7\x59\x0e\xa9\xb8\x00\x00\x00\xbb\xb0\x57\x03\x88\x09\x49\x6b\xcf\xf8" - "\x6d\x6f\xbc\x8c\xe5\xb1\x35\xa0\x6b\x16\x60\x54\xf2\xd5\x65\xbe\x8a\xce" - "\x75\xdc\x85\x1e\x0b\xcd\xd8\xf0\x71\x41\xc4\x95\x87\x2f\xb5\xd8\xc0\xc6" - "\x6a\x8b\x6d\xa5\x56\x66\x3e\x4e\x46\x12\x05\xd8\x45\x80\xbe\xe5\xbc\x7e", - "\x68\x46\xa2\xf0", 1, 575, NULL, 0}, - {128, 32, 5, - "\x83\xfd\x23\xa2\x44\xa7\x4c\xf3\x58\xda\x30\x19\xf1\x72\x26\x35", - "\x36\xaf\x61\x44\x7c\x00\x00\x00\x35\xc6\x87\x16\x63\x3c\x66\xfb\x75\x0c" - "\x26\x68\x65\xd5\x3c\x11\xea\x05\xb1\xe9\xfa\x49\xc8\x39\x8d\x48\xe1\xef" - "\xa5\x90\x9d\x39\x47\x90\x28\x37\xf5\xae\x96\xd5\xa0\x5b\xc8\xd6\x1c\xa8" - "\xdb\xef\x1b\x13\xa4\xb4\xab\xfe\x4f\xb1\x00\x60\x45\xb6\x74\xbb\x54\x72" - "\x93\x04\xc3\x82\xbe\x53\xa5\xaf\x05\x55\x61\x76\xf6\xea\xa2\xef\x1d\x05" - "\xe4\xb0\x83\x18\x1e\xe6\x74\xcd\xa5\xa4\x85\xf7\x4d\x7a", - "\xe6\x57\xe1\x82", 1, 832, NULL, 0}, - {128, 32, 6, - "\x68\x32\xa6\x5c\xff\x44\x73\x62\x1e\xbd\xd4\xba\x26\xa9\x21\xfe", - "\x36\xaf\x61\x44\xc0\x00\x00\x00\xd3\xc5\x38\x39\x62\x68\x20\x71\x77\x65" - "\x66\x76\x20\x32\x38\x37\x63\x62\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4" - "\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8" - "\xa6\xdc", - "\xf0\x66\x8c\x1e", 1, 447, NULL, 0}, - {128, 32, 7, - "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", - "\x78\x27\xfa\xb2\x2c\x00\x00\x00\x70\xde\xdf\x2d\xc4\x2c\x5c\xbd\x3a\x96" - "\xf8\xa0\xb1\x14\x18\xb3\x60\x8d\x57\x33\x60\x4a\x2c\xd3\x6a\xab\xc7\x0c" - "\xe3\x19\x3b\xb5\x15\x3b\xe2\xd3\xc0\x6d\xfd\xb2\xd1\x6e\x9c\x35\x71\x58" - "\xbe\x6a\x41\xd6\xb8\x61\xe4\x91\xdb\x3f\xbf\xeb\x51\x8e\xfc\xf0\x48\xd7" - "\xd5\x89\x53\x73\x0f\xf3\x0c\x9e\xc4\x70\xff\xcd\x66\x3d\xc3\x42\x01\xc3" - "\x6a\xdd\xc0\x11\x1c\x35\xb3\x8a\xfe\xe7\xcf\xdb\x58\x2e\x37\x31\xf8\xb4" - "\xba\xa8\xd1\xa8\x9c\x06\xe8\x11\x99\xa9\x71\x62\x27\xbe\x34\x4e\xfc\xb4" - "\x36\xdd\xd0\xf0\x96\xc0\x64\xc3\xb5\xe2\xc3\x99\x99\x3f\xc7\x73\x94\xf9" - "\xe0\x97\x20\xa8\x11\x85\x0e\xf2\x3b\x2e\xe0\x5d\x9e\x61\x73\x60\x9d\x86" - "\xe1\xc0\xc1\x8e\xa5\x1a\x01\x2a\x00\xbb\x41\x3b\x9c\xb8\x18\x8a\x70\x3c" - "\xd6\xba\xe3\x1c\xc6\x7b\x34\xb1\xb0\x00\x19\xe6\xa2\xb2\xa6\x90\xf0\x26" - "\x71\xfe\x7c\x9e\xf8\xde\xc0\x09\x4e\x53\x37\x63\x47\x8d\x58\xd2\xc5\xf5" - "\xb8\x27\xa0\x14\x8c\x59\x48\xa9\x69\x31\xac\xf8\x4f\x46\x5a\x64\xe6\x2c" - "\xe7\x40\x07\xe9\x91\xe3\x7e\xa8\x23\xfa\x0f\xb2\x19\x23\xb7\x99\x05\xb7" - "\x33\xb6\x31\xe6\xc7\xd6\x86\x0a\x38\x31\xac\x35\x1a\x9c\x73\x0c\x52\xff" - "\x72\xd9\xd3\x08\xee\xdb\xab\x21\xfd\xe1\x43\xa0\xea\x17\xe2\x3e\xdc\x1f" - "\x74\xcb\xb3\x63\x8a\x20\x33\xaa\xa1\x54\x64\xea\xa7\x33\x38\x5d\xbb\xeb" - "\x6f\xd7\x35\x09\xb8\x57\xe6\xa4\x19\xdc\xa1\xd8\x90\x7a\xf9\x77\xfb\xac" - "\x4d\xfa\x35\xec", - "\xf4\xcc\x8f\xa3", 1, 2622, NULL, 0}, - {128, 32, 8, - "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", - "\x29\x6f\x39\x3c\x5c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01" - "\x01\x01\x01\x01\x01\x01\xe0\x95\x80\x45\xf3\xa0\xbb\xa4\xe3\x96\x83\x46" - "\xf0\xa3\xb8\xa7\xc0\x2a\x01\x8a\xe6\x40\x76\x52\x26\xb9\x87\xc9\x13\xe6" - "\xcb\xf0\x83\x57\x00\x16\xcf\x83\xef\xbc\x61\xc0\x82\x51\x3e\x21\x56\x1a" - "\x42\x7c\x00\x9d\x28\xc2\x98\xef\xac\xe7\x8e\xd6\xd5\x6c\x2d\x45\x05\xad" - "\x03\x2e\x9c\x04\xdc\x60\xe7\x3a\x81\x69\x6d\xa6\x65\xc6\xc4\x86\x03\xa5" - "\x7b\x45\xab\x33\x22\x15\x85\xe6\x8e\xe3\x16\x91\x87\xfb\x02\x39\x52\x86" - "\x32\xdd\x65\x6c\x80\x7e\xa3\x24\x8b\x7b\x46\xd0\x02\xb2\xb5\xc7\x45\x8e" - "\xb8\x5b\x9c\xe9\x58\x79\xe0\x34\x08\x59\x05\x5e\x3b\x0a\xbb\xc3\xea\xce" - "\x87\x19\xca\xa8\x02\x65\xc9\x72\x05\xd5\xdc\x4b\xcc\x90\x2f\xe1\x83\x96" - "\x29\xed\x71\x32\x8a\x0f\x04\x49\xf5\x88\x55\x7e\x68\x98\x86\x0e\x04\x2a" - "\xec\xd8\x4b\x24\x04\xc2\x12\xc9\x22\x2d\xa5\xbf\x8a\x89\xef\x67\x97\x87" - "\x0c\xf5\x07\x71\xa6\x0f\x66\xa2\xee\x62\x85\x36\x57\xad\xdf\x04\xcd\xde" - "\x07\xfa\x41\x4e\x11\xf1\x2b\x4d\x81\xb9\xb4\xe8\xac\x53\x8e\xa3\x06\x66" - "\x68\x8d\x88\x1f\x6c\x34\x84\x21\x99\x2f\x31\xb9\x4f\x88\x06\xed\x8f\xcc" - "\xff\x4c\x91\x23\xb8\x96\x42\x52\x7a\xd6\x13\xb1\x09\xbf\x75\x16\x74\x85" - "\xf1\x26\x8b\xf8\x84\xb4\xcd\x23\xd2\x9a\x09\x34\x92\x57\x03\xd6\x34\x09" - "\x8f\x77\x67\xf1\xbe\x74\x91\xe7\x08\xa8\xbb\x94\x9a\x38\x73\x70\x8a\xef" - "\x4a\x36\x23\x9e\x50\xcc\x08\x23\x5c\xd5\xed\x6b\xbe\x57\x86\x68\xa1\x7b" - "\x58\xc1\x17\x1d\x0b\x90\xe8\x13\xa9\xe4\xf5\x8a\x89\xd7\x19\xb1\x10\x42" - "\xd6\x36\x0b\x1b\x0f\x52\xde\xb7\x30\xa5\x8d\x58\xfa\xf4\x63\x15\x95\x4b" - "\x0a\x87\x26\x91\x47\x59\x77\xdc\x88\xc0\xd7\x33\xfe\xff\x54\x60\x0a\x0c" - "\xc1\xd0\x30\x0a\xaa\xeb\x94\x57\x2c\x6e\x95\xb0\x1a\xe9\x0d\xe0\x4f\x1d" - "\xce\x47\xf8\x7e\x8f\xa7\xbe\xbf\x77\xe1\xdb\xc2\x0d\x6b\xa8\x5c\xb9\x14" - "\x3d\x51\x8b\x28\x5d\xfa\x04\xb6\x98\xbf\x0c\xf7\x81\x9f\x20\xfa\x7a\x28" - "\x8e\xb0\x70\x3d\x99\x5c\x59\x94\x0c\x7c\x66\xde\x57\xa9\xb7\x0f\x82\x37" - "\x9b\x70\xe2\x03\x1e\x45\x0f\xcf\xd2\x18\x13\x26\xfc\xd2\x8d\x88\x23\xba" - "\xaa\x80\xdf\x6e\x0f\x44\x35\x59\x64\x75\x39\xfd\x89\x07\xc0\xff\xd9\xd7" - "\x9c\x13\x0e\xd8\x1c\x9a\xfd\x9b\x7e\x84\x8c\x9f\xed\x38\x44\x3d\x5d\x38" - "\x0e\x53\xfb\xdb\x8a\xc8\xc3\xd3\xf0\x68\x76\x05\x4f\x12\x24\x61\x10\x7d" - "\xe9\x2f\xea\x09\xc6\xf6\x92\x3a\x18\x8d\x53\xaf\xe5\x4a\x10\xf6\x0e\x6e" - "\x9d\x5a\x03\xd9\x96\xb5\xfb\xc8\x20\xf8\xa6\x37\x11\x6a\x27\xad\x04\xb4" - "\x44\xa0\x93\x2d\xd6\x0f\xbd\x12\x67\x1c\x11\xe1\xc0\xec\x73\xe7\x89\x87" - "\x9f\xaa\x3d\x42\xc6\x4d\x20\xcd\x12\x52\x74\x2a\x37\x68\xc2\x5a\x90\x15" - "\x85\x88\x8e\xce\xe1\xe6\x12\xd9\x93\x6b\x40\x3b\x07\x75\x94\x9a\x66\xcd" - "\xfd\x99\xa2\x9b\x13\x45\xba\xa8\xd9\xd5\x40\x0c\x91\x02\x4b\x0a\x60\x73" - "\x63\xb0\x13\xce\x5d\xe9\xae\x86\x9d\x3b\x8d\x95\xb0\x57\x0b\x3c\x2d\x39" - "\x14\x22\xd3\x24\x50\xcb\xcf\xae\x96\x65\x22\x86\xe9\x6d\xec\x12\x14\xa9" - "\x34\x65\x27\x98\x0a\x81\x92\xea\xc1\xc3\x9a\x3a\xaf\x6f\x15\x35\x1d\xa6" - "\xbe\x76\x4d\xf8\x97\x72\xec\x04\x07\xd0\x6e\x44\x15\xbe\xfa\xe7\xc9\x25" - "\x80\xdf\x9b\xf5\x07\x49\x7c\x8f\x29\x95\x16\x0d\x4e\x21\x8d\xaa\xcb\x02" - "\x94\x4a\xbf\x83\x34\x0c\xe8\xbe\x16\x86\xa9\x60\xfa\xf9\x0e\x2d\x90\xc5" - "\x5c\xc6\x47\x5b\xab\xc3\x17\x1a\x80\xa3\x63\x17\x49\x54\x95\x5d\x71\x01" - "\xda\xb1\x6a\xe8\x17\x91\x67\xe2\x14\x44\xb4\x43\xa9\xea\xaa\x7c\x91\xde" - "\x36\xd1\x18\xc3\x9d\x38\x9f\x8d\xd4\x46\x9a\x84\x6c\x9a\x26\x2b\xf7\xfa" - "\x18\x48\x7a\x79\xe8\xde\x11\x69\x9e\x0b\x8f\xdf\x55\x7c\xb4\x87\x19\xd4" - "\x53\xba\x71\x30\x56\x10\x9b\x93\xa2\x18\xc8\x96\x75\xac\x19\x5f\xb4\xfb" - "\x06\x63\x9b\x37\x97\x14\x49\x55\xb3\xc9\x32\x7d\x1a\xec\x00\x3d\x42\xec" - "\xd0\xea\x98\xab\xf1\x9f\xfb\x4a\xf3\x56\x1a\x67\xe7\x7c\x35\xbf\x15\xc5" - "\x9c\x24\x12\xda\x88\x1d\xb0\x2b\x1b\xfb\xce\xbf\xac\x51\x52\xbc\x99\xbc" - "\x3f\x1d\x15\xf7\x71\x00\x1b\x70\x29\xfe\xdb\x02\x8f\x8b\x85\x2b\xc4\x40" - "\x7e\xb8\x3f\x89\x1c\x9c\xa7\x33\x25\x4f\xdd\x1e\x9e\xdb\x56\x91\x9c\xe9" - "\xfe\xa2\x1c\x17\x40\x72\x52\x1c\x18\x31\x9a\x54\xb5\xd4\xef\xbe\xbd\xdf" - "\x1d\x8b\x69\xb1\xcb\xf2\x5f\x48\x9f\xcc\x98\x13\x72\x54\x7c\xf4\x1d\x00" - "\x8e\xf0\xbc\xa1\x92\x6f\x93\x4b\x73\x5e\x09\x0b\x3b\x25\x1e\xb3\x3a\x36" - "\xf8\x2e\xd9\xb2\x9c\xf4\xcb\x94\x41\x88\xfa\x0e\x1e\x38\xdd\x77\x8f\x7d" - "\x1c\x9d\x98\x7b\x28\xd1\x32\xdf\xb9\x73\x1f\xa4\xf4\xb4\x16\x93\x5b\xe4" - "\x9d\xe3\x05\x16\xaf\x35\x78\x58\x1f\x2f\x13\xf5\x61\xc0\x66\x33\x61\x94" - "\x1e\xab\x24\x9a\x4b\xc1\x23\xf8\xd1\x5c\xd7\x11\xa9\x56\xa1\xbf\x20\xfe" - "\x6e\xb7\x8a\xea\x23\x73\x36\x1d\xa0\x42\x6c\x79\xa5\x30\xc3\xbb\x1d\xe0" - "\xc9\x97\x22\xef\x1f\xde\x39\xac\x2b\x00\xa0\xa8\xee\x7c\x80\x0a\x08\xbc" - "\x22\x64\xf8\x9f\x4e\xff\xe6\x27\xac\x2f\x05\x31\xfb\x55\x4f\x6d\x21\xd7" - "\x4c\x59\x0a\x70\xad\xfa\xa3\x90\xbd\xfb\xb3\xd6\x8e\x46\x21\x5c\xab\x18" - "\x7d\x23\x68\xd5\xa7\x1f\x5e\xbe\xc0\x81\xcd\x3b\x20\xc0\x82\xdb\xe4\xcd" - "\x2f\xac\xa2\x87\x73\x79\x5d\x6b\x0c\x10\x20\x4b\x65\x9a\x93\x9e\xf2\x9b" - "\xbe\x10\x88\x24\x36\x24\x42\x99\x27\xa7\xeb\x57\x6d\xd3\xa0\x0e\xa5\xe0" - "\x1a\xf5\xd4\x75\x83\xb2\x27\x2c\x0c\x16\x1a\x80\x65\x21\xa1\x6f\xf9\xb0" - "\xa7\x22\xc0\xcf\x26\xb0\x25\xd5\x83\x6e\x22\x58\xa4\xf7\xd4\x77\x3a\xc8" - "\x01\xe4\x26\x3b\xc2\x94\xf4\x3d\xef\x7f\xa8\x70\x3f\x3a\x41\x97\x46\x35" - "\x25\x88\x76\x52\xb0\xb2\xa4\xa2\xa7\xcf\x87\xf0\x09\x14\x87\x1e\x25\x03" - "\x91\x13\xc7\xe1\x61\x8d\xa3\x40\x64\xb5\x7a\x43\xc4\x63\x24\x9f\xb8\xd0" - "\x5e\x0f\x26\xf4\xa6\xd8\x49\x72\xe7\xa9\x05\x48\x24\x14\x5f\x91\x29\x5c" - "\xdb\xe3\x9a\x6f\x92\x0f\xac\xc6\x59\x71\x2b\x46\xa5\x4b\xa2\x95\xbb\xe6" - "\xa9\x01\x54\xe9\x1b\x33\x98\x5a\x2b\xcd\x42\x0a\xd5\xc6\x7e\xc9\xad\x8e" - "\xb7\xac\x68\x64\xdb\x27\x2a\x51\x6b\xc9\x4c\x28\x39\xb0\xa8\x16\x9a\x6b" - "\xf5\x8e\x1a\x0c\x2a\xda\x8c\x88\x3b\x7b\xf4\x97\xa4\x91\x71\x26\x8e\xd1" - "\x5d\xdd\x29\x69\x38\x4e\x7f\xf4\xbf\x4a\xab\x2e\xc9\xec\xc6\x52\x9c\xf6" - "\x29\xe2\xdf\x0f\x08\xa7\x7a\x65\xaf\xa1\x2a\xa9\xb5\x05\xdf\x8b\x28\x7e" - "\xf6\xcc\x91\x49\x3d\x1c\xaa\x39\x07\x6e\x28\xef\x1e\xa0\x28\xf5\x11\x8d" - "\xe6\x1a\xe0\x2b\xb6\xae\xfc\x33\x43\xa0\x50\x29\x2f\x19\x9f\x40\x18\x57" - "\xb2\xbe\xad\x5e\x6e\xe2\xa1\xf1\x91\x02\x2f\x92\x78\x01\x6f\x04\x77\x91" - "\xa9\xd1\x8d\xa7\xd2\xa6\xd2\x7f\x2e\x0e\x51\xc2\xf6\xea\x30\xe8\xac\x49" - "\xa0\x60\x4f\x4c\x13\x54\x2e\x85\xb6\x83\x81\xb9\xfd\xcf\xa0\xce\x4b\x2d" - "\x34\x13\x54\x85\x2d\x36\x02\x45\xc5\x36\xb6\x12\xaf\x71\xf3\xe7\x7c\x90" - "\x95\xae\x2d\xbd\xe5\x04\xb2\x65\x73\x3d\xab\xfe\x10\xa2\x0f\xc7\xd6\xd3" - "\x2c\x21\xcc\xc7\x2b\x8b\x34\x44\xae\x66\x3d\x65\x92\x2d\x17\xf8\x2c\xaa" - "\x2b\x86\x5c\xd8\x89\x13\xd2\x91\xa6\x58\x99\x02\x6e\xa1\x32\x84\x39\x72" - "\x3c\x19\x8c\x36\xb0\xc3\xc8\xd0\x85\xbf\xaf\x8a\x32\x0f\xde\x33\x4b\x4a" - "\x49\x19\xb4\x4c\x2b\x95\xf6\xe8\xec\xf7\x33\x93\xf7\xf0\xd2\xa4\x0e\x60" - "\xb1\xd4\x06\x52\x6b\x02\x2d\xdc\x33\x18\x10\xb1\xa5\xf7\xc3\x47\xbd\x53" - "\xed\x1f\x10\x5d\x6a\x0d\x30\xab\xa4\x77\xe1\x78\x88\x9a\xb2\xec\x55\xd5" - "\x58\xde\xab\x26\x30\x20\x43\x36\x96\x2b\x4d\xb5\xb6\x63\xb6\x90\x2b\x89" - "\xe8\x5b\x31\xbc\x6a\xf5\x0f\xc5\x0a\xcc\xb3\xfb\x9b\x57\xb6\x63\x29\x70" - "\x31\x37\x8d\xb4\x78\x96\xd7\xfb\xaf\x6c\x60\x0a\xdd\x2c\x67\xf9\x36\xdb" - "\x03\x79\x86\xdb\x85\x6e\xb4\x9c\xf2\xdb\x3f\x7d\xa6\xd2\x36\x50\xe4\x38" - "\xf1\x88\x40\x41\xb0\x13\x11\x9e\x4c\x2a\xe5\xaf\x37\xcc\xcd\xfb\x68\x66" - "\x07\x38\xb5\x8b\x3c\x59\xd1\xc0\x24\x84\x37\x47\x2a\xba\x1f\x35\xca\x1f" - "\xb9\x0c\xd7\x14\xaa\x9f\x63\x55\x34\xf4\x9e\x7c\x5b\xba\x81\xc2\xb6\xb3" - "\x6f\xde\xe2\x1c\xa2\x7e\x34\x7f\x79\x3d\x2c\xe9\x44\xed\xb2\x3c\x8c\x9b" - "\x91\x4b\xe1\x03\x35\xe3\x50\xfe\xb5\x07\x03\x94\xb7\xa4\xa1\x5c\x0c\xa1" - "\x20\x28\x35\x68\xb7\xbf\xc2\x54\xfe\x83\x8b\x13\x7a\x21\x47\xce\x7c\x11" - "\x3a\x3a\x4d\x65\x49\x9d\x9e\x86\xb8\x7d\xbc\xc7\xf0\x3b\xbd\x3a\x3a\xb1" - "\xaa\x24\x3e\xce\x5b\xa9\xbc\xf2\x5f\x82\x83\x6c\xfe\x47\x3b\x2d\x83\xe7" - "\xa7\x20\x1c\xd0\xb9\x6a\x72\x45\x1e\x86\x3f\x6c\x3b\xa6\x64\xa6\xd0\x73" - "\xd1\xf7\xb5\xed\x99\x08\x65\xd9\x78\xbd\x38\x15\xd0\x60\x94\xfc\x9a\x2a" - "\xba\x52\x21\xc2\x2d\x5a\xb9\x96\x38\x9e\x37\x21\xe3\xaf\x5f\x05\xbe\xdd" - "\xc2\x87\x5e\x0d\xfa\xeb\x39\x02\x1e\xe2\x7a\x41\x18\x7c\xbb\x45\xef\x40" - "\xc3\xe7\x3b\xc0\x39\x89\xf9\xa3\x0d\x12\xc5\x4b\xa7\xd2\x14\x1d\xa8\xa8" - "\x75\x49\x3e\x65\x77\x6e\xf3\x5f\x97\xde\xbc\x22\x86\xcc\x4a\xf9\xb4\x62" - "\x3e\xee\x90\x2f\x84\x0c\x52\xf1\xb8\xad\x65\x89\x39\xae\xf7\x1f\x3f\x72" - "\xb9\xec\x1d\xe2\x15\x88\xbd\x35\x48\x4e\xa4\x44\x36\x34\x3f\xf9\x5e\xad" - "\x6a\xb1\xd8\xaf\xb1\xb2\xa3\x03\xdf\x1b\x71\xe5\x3c\x4a\xea\x6b\x2e\x3e" - "\x93\x72\xbe\x0d\x1b\xc9\x97\x98\xb0\xce\x3c\xc1\x0d\x2a\x59\x6d\x56\x5d" - "\xba\x82\xf8\x8c\xe4\xcf\xf3\xb3\x3d\x5d\x24\xe9\xc0\x83\x11\x24\xbf\x1a" - "\xd5\x4b\x79\x25\x32\x98\x3d\xd6\xc3\xa8\xb7\xd0", - "\xeb\xd5\xcc\xb0", 1, 16512, NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + const struct mac_test cmac_3gpp_test_json[] = { + /* Vectors from https://tools.ietf.org/html/rfc4493 */ + {128, 32, 1, + "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x38\xa6\xf0\x56\xc0\x00\x00\x00\x33\x32\x34\x62\x63\x39\x38\x40", + "\x11\x8c\x6e\xb8", 1, 122, NULL, 0}, + {128, 32, 2, + "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xd4\x00\x00\x00\x48\x45\x83\xd5\xaf\xe0\x82\xae", + "\xb9\x37\x87\xe6", 1, 128, NULL, 0}, + {128, 32, 3, + "\x7e\x5e\x94\x43\x1e\x11\xd7\x38\x28\xd7\x39\xcc\x6c\xed\x45\x73", + "\x36\xaf\x61\x44\xc4\x00\x00\x00\xb3\xd3\xc9\x17\x0a\x4e\x16\x32\xf6\x0f" + "\x86\x10\x13\xd2\x2d\x84\xb7\x26\xb6\xa2\x78\xd8\x02\xd1\xee\xaf\x13\x21" + "\xba\x59\x29\xdc", + "\x1f\x60\xb0\x1d", 1, 318, NULL, 0}, + {128, 32, 4, + "\xd3\x41\x9b\xe8\x21\x08\x7a\xcd\x02\x12\x3a\x92\x48\x03\x33\x59", + "\xc7\x59\x0e\xa9\xb8\x00\x00\x00\xbb\xb0\x57\x03\x88\x09\x49\x6b\xcf\xf8" + "\x6d\x6f\xbc\x8c\xe5\xb1\x35\xa0\x6b\x16\x60\x54\xf2\xd5\x65\xbe\x8a\xce" + "\x75\xdc\x85\x1e\x0b\xcd\xd8\xf0\x71\x41\xc4\x95\x87\x2f\xb5\xd8\xc0\xc6" + "\x6a\x8b\x6d\xa5\x56\x66\x3e\x4e\x46\x12\x05\xd8\x45\x80\xbe\xe5\xbc\x7e", + "\x68\x46\xa2\xf0", 1, 575, NULL, 0}, + {128, 32, 5, + "\x83\xfd\x23\xa2\x44\xa7\x4c\xf3\x58\xda\x30\x19\xf1\x72\x26\x35", + "\x36\xaf\x61\x44\x7c\x00\x00\x00\x35\xc6\x87\x16\x63\x3c\x66\xfb\x75\x0c" + "\x26\x68\x65\xd5\x3c\x11\xea\x05\xb1\xe9\xfa\x49\xc8\x39\x8d\x48\xe1\xef" + "\xa5\x90\x9d\x39\x47\x90\x28\x37\xf5\xae\x96\xd5\xa0\x5b\xc8\xd6\x1c\xa8" + "\xdb\xef\x1b\x13\xa4\xb4\xab\xfe\x4f\xb1\x00\x60\x45\xb6\x74\xbb\x54\x72" + "\x93\x04\xc3\x82\xbe\x53\xa5\xaf\x05\x55\x61\x76\xf6\xea\xa2\xef\x1d\x05" + "\xe4\xb0\x83\x18\x1e\xe6\x74\xcd\xa5\xa4\x85\xf7\x4d\x7a", + "\xe6\x57\xe1\x82", 1, 832, NULL, 0}, + {128, 32, 6, + "\x68\x32\xa6\x5c\xff\x44\x73\x62\x1e\xbd\xd4\xba\x26\xa9\x21\xfe", + "\x36\xaf\x61\x44\xc0\x00\x00\x00\xd3\xc5\x38\x39\x62\x68\x20\x71\x77\x65" + "\x66\x76\x20\x32\x38\x37\x63\x62\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4" + "\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8" + "\xa6\xdc", + "\xf0\x66\x8c\x1e", 1, 447, NULL, 0}, + {128, 32, 7, + "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", + "\x78\x27\xfa\xb2\x2c\x00\x00\x00\x70\xde\xdf\x2d\xc4\x2c\x5c\xbd\x3a\x96" + "\xf8\xa0\xb1\x14\x18\xb3\x60\x8d\x57\x33\x60\x4a\x2c\xd3\x6a\xab\xc7\x0c" + "\xe3\x19\x3b\xb5\x15\x3b\xe2\xd3\xc0\x6d\xfd\xb2\xd1\x6e\x9c\x35\x71\x58" + "\xbe\x6a\x41\xd6\xb8\x61\xe4\x91\xdb\x3f\xbf\xeb\x51\x8e\xfc\xf0\x48\xd7" + "\xd5\x89\x53\x73\x0f\xf3\x0c\x9e\xc4\x70\xff\xcd\x66\x3d\xc3\x42\x01\xc3" + "\x6a\xdd\xc0\x11\x1c\x35\xb3\x8a\xfe\xe7\xcf\xdb\x58\x2e\x37\x31\xf8\xb4" + "\xba\xa8\xd1\xa8\x9c\x06\xe8\x11\x99\xa9\x71\x62\x27\xbe\x34\x4e\xfc\xb4" + "\x36\xdd\xd0\xf0\x96\xc0\x64\xc3\xb5\xe2\xc3\x99\x99\x3f\xc7\x73\x94\xf9" + "\xe0\x97\x20\xa8\x11\x85\x0e\xf2\x3b\x2e\xe0\x5d\x9e\x61\x73\x60\x9d\x86" + "\xe1\xc0\xc1\x8e\xa5\x1a\x01\x2a\x00\xbb\x41\x3b\x9c\xb8\x18\x8a\x70\x3c" + "\xd6\xba\xe3\x1c\xc6\x7b\x34\xb1\xb0\x00\x19\xe6\xa2\xb2\xa6\x90\xf0\x26" + "\x71\xfe\x7c\x9e\xf8\xde\xc0\x09\x4e\x53\x37\x63\x47\x8d\x58\xd2\xc5\xf5" + "\xb8\x27\xa0\x14\x8c\x59\x48\xa9\x69\x31\xac\xf8\x4f\x46\x5a\x64\xe6\x2c" + "\xe7\x40\x07\xe9\x91\xe3\x7e\xa8\x23\xfa\x0f\xb2\x19\x23\xb7\x99\x05\xb7" + "\x33\xb6\x31\xe6\xc7\xd6\x86\x0a\x38\x31\xac\x35\x1a\x9c\x73\x0c\x52\xff" + "\x72\xd9\xd3\x08\xee\xdb\xab\x21\xfd\xe1\x43\xa0\xea\x17\xe2\x3e\xdc\x1f" + "\x74\xcb\xb3\x63\x8a\x20\x33\xaa\xa1\x54\x64\xea\xa7\x33\x38\x5d\xbb\xeb" + "\x6f\xd7\x35\x09\xb8\x57\xe6\xa4\x19\xdc\xa1\xd8\x90\x7a\xf9\x77\xfb\xac" + "\x4d\xfa\x35\xec", + "\xf4\xcc\x8f\xa3", 1, 2622, NULL, 0}, + {128, 32, 8, + "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", + "\x29\x6f\x39\x3c\x5c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01" + "\x01\x01\x01\x01\x01\x01\xe0\x95\x80\x45\xf3\xa0\xbb\xa4\xe3\x96\x83\x46" + "\xf0\xa3\xb8\xa7\xc0\x2a\x01\x8a\xe6\x40\x76\x52\x26\xb9\x87\xc9\x13\xe6" + "\xcb\xf0\x83\x57\x00\x16\xcf\x83\xef\xbc\x61\xc0\x82\x51\x3e\x21\x56\x1a" + "\x42\x7c\x00\x9d\x28\xc2\x98\xef\xac\xe7\x8e\xd6\xd5\x6c\x2d\x45\x05\xad" + "\x03\x2e\x9c\x04\xdc\x60\xe7\x3a\x81\x69\x6d\xa6\x65\xc6\xc4\x86\x03\xa5" + "\x7b\x45\xab\x33\x22\x15\x85\xe6\x8e\xe3\x16\x91\x87\xfb\x02\x39\x52\x86" + "\x32\xdd\x65\x6c\x80\x7e\xa3\x24\x8b\x7b\x46\xd0\x02\xb2\xb5\xc7\x45\x8e" + "\xb8\x5b\x9c\xe9\x58\x79\xe0\x34\x08\x59\x05\x5e\x3b\x0a\xbb\xc3\xea\xce" + "\x87\x19\xca\xa8\x02\x65\xc9\x72\x05\xd5\xdc\x4b\xcc\x90\x2f\xe1\x83\x96" + "\x29\xed\x71\x32\x8a\x0f\x04\x49\xf5\x88\x55\x7e\x68\x98\x86\x0e\x04\x2a" + "\xec\xd8\x4b\x24\x04\xc2\x12\xc9\x22\x2d\xa5\xbf\x8a\x89\xef\x67\x97\x87" + "\x0c\xf5\x07\x71\xa6\x0f\x66\xa2\xee\x62\x85\x36\x57\xad\xdf\x04\xcd\xde" + "\x07\xfa\x41\x4e\x11\xf1\x2b\x4d\x81\xb9\xb4\xe8\xac\x53\x8e\xa3\x06\x66" + "\x68\x8d\x88\x1f\x6c\x34\x84\x21\x99\x2f\x31\xb9\x4f\x88\x06\xed\x8f\xcc" + "\xff\x4c\x91\x23\xb8\x96\x42\x52\x7a\xd6\x13\xb1\x09\xbf\x75\x16\x74\x85" + "\xf1\x26\x8b\xf8\x84\xb4\xcd\x23\xd2\x9a\x09\x34\x92\x57\x03\xd6\x34\x09" + "\x8f\x77\x67\xf1\xbe\x74\x91\xe7\x08\xa8\xbb\x94\x9a\x38\x73\x70\x8a\xef" + "\x4a\x36\x23\x9e\x50\xcc\x08\x23\x5c\xd5\xed\x6b\xbe\x57\x86\x68\xa1\x7b" + "\x58\xc1\x17\x1d\x0b\x90\xe8\x13\xa9\xe4\xf5\x8a\x89\xd7\x19\xb1\x10\x42" + "\xd6\x36\x0b\x1b\x0f\x52\xde\xb7\x30\xa5\x8d\x58\xfa\xf4\x63\x15\x95\x4b" + "\x0a\x87\x26\x91\x47\x59\x77\xdc\x88\xc0\xd7\x33\xfe\xff\x54\x60\x0a\x0c" + "\xc1\xd0\x30\x0a\xaa\xeb\x94\x57\x2c\x6e\x95\xb0\x1a\xe9\x0d\xe0\x4f\x1d" + "\xce\x47\xf8\x7e\x8f\xa7\xbe\xbf\x77\xe1\xdb\xc2\x0d\x6b\xa8\x5c\xb9\x14" + "\x3d\x51\x8b\x28\x5d\xfa\x04\xb6\x98\xbf\x0c\xf7\x81\x9f\x20\xfa\x7a\x28" + "\x8e\xb0\x70\x3d\x99\x5c\x59\x94\x0c\x7c\x66\xde\x57\xa9\xb7\x0f\x82\x37" + "\x9b\x70\xe2\x03\x1e\x45\x0f\xcf\xd2\x18\x13\x26\xfc\xd2\x8d\x88\x23\xba" + "\xaa\x80\xdf\x6e\x0f\x44\x35\x59\x64\x75\x39\xfd\x89\x07\xc0\xff\xd9\xd7" + "\x9c\x13\x0e\xd8\x1c\x9a\xfd\x9b\x7e\x84\x8c\x9f\xed\x38\x44\x3d\x5d\x38" + "\x0e\x53\xfb\xdb\x8a\xc8\xc3\xd3\xf0\x68\x76\x05\x4f\x12\x24\x61\x10\x7d" + "\xe9\x2f\xea\x09\xc6\xf6\x92\x3a\x18\x8d\x53\xaf\xe5\x4a\x10\xf6\x0e\x6e" + "\x9d\x5a\x03\xd9\x96\xb5\xfb\xc8\x20\xf8\xa6\x37\x11\x6a\x27\xad\x04\xb4" + "\x44\xa0\x93\x2d\xd6\x0f\xbd\x12\x67\x1c\x11\xe1\xc0\xec\x73\xe7\x89\x87" + "\x9f\xaa\x3d\x42\xc6\x4d\x20\xcd\x12\x52\x74\x2a\x37\x68\xc2\x5a\x90\x15" + "\x85\x88\x8e\xce\xe1\xe6\x12\xd9\x93\x6b\x40\x3b\x07\x75\x94\x9a\x66\xcd" + "\xfd\x99\xa2\x9b\x13\x45\xba\xa8\xd9\xd5\x40\x0c\x91\x02\x4b\x0a\x60\x73" + "\x63\xb0\x13\xce\x5d\xe9\xae\x86\x9d\x3b\x8d\x95\xb0\x57\x0b\x3c\x2d\x39" + "\x14\x22\xd3\x24\x50\xcb\xcf\xae\x96\x65\x22\x86\xe9\x6d\xec\x12\x14\xa9" + "\x34\x65\x27\x98\x0a\x81\x92\xea\xc1\xc3\x9a\x3a\xaf\x6f\x15\x35\x1d\xa6" + "\xbe\x76\x4d\xf8\x97\x72\xec\x04\x07\xd0\x6e\x44\x15\xbe\xfa\xe7\xc9\x25" + "\x80\xdf\x9b\xf5\x07\x49\x7c\x8f\x29\x95\x16\x0d\x4e\x21\x8d\xaa\xcb\x02" + "\x94\x4a\xbf\x83\x34\x0c\xe8\xbe\x16\x86\xa9\x60\xfa\xf9\x0e\x2d\x90\xc5" + "\x5c\xc6\x47\x5b\xab\xc3\x17\x1a\x80\xa3\x63\x17\x49\x54\x95\x5d\x71\x01" + "\xda\xb1\x6a\xe8\x17\x91\x67\xe2\x14\x44\xb4\x43\xa9\xea\xaa\x7c\x91\xde" + "\x36\xd1\x18\xc3\x9d\x38\x9f\x8d\xd4\x46\x9a\x84\x6c\x9a\x26\x2b\xf7\xfa" + "\x18\x48\x7a\x79\xe8\xde\x11\x69\x9e\x0b\x8f\xdf\x55\x7c\xb4\x87\x19\xd4" + "\x53\xba\x71\x30\x56\x10\x9b\x93\xa2\x18\xc8\x96\x75\xac\x19\x5f\xb4\xfb" + "\x06\x63\x9b\x37\x97\x14\x49\x55\xb3\xc9\x32\x7d\x1a\xec\x00\x3d\x42\xec" + "\xd0\xea\x98\xab\xf1\x9f\xfb\x4a\xf3\x56\x1a\x67\xe7\x7c\x35\xbf\x15\xc5" + "\x9c\x24\x12\xda\x88\x1d\xb0\x2b\x1b\xfb\xce\xbf\xac\x51\x52\xbc\x99\xbc" + "\x3f\x1d\x15\xf7\x71\x00\x1b\x70\x29\xfe\xdb\x02\x8f\x8b\x85\x2b\xc4\x40" + "\x7e\xb8\x3f\x89\x1c\x9c\xa7\x33\x25\x4f\xdd\x1e\x9e\xdb\x56\x91\x9c\xe9" + "\xfe\xa2\x1c\x17\x40\x72\x52\x1c\x18\x31\x9a\x54\xb5\xd4\xef\xbe\xbd\xdf" + "\x1d\x8b\x69\xb1\xcb\xf2\x5f\x48\x9f\xcc\x98\x13\x72\x54\x7c\xf4\x1d\x00" + "\x8e\xf0\xbc\xa1\x92\x6f\x93\x4b\x73\x5e\x09\x0b\x3b\x25\x1e\xb3\x3a\x36" + "\xf8\x2e\xd9\xb2\x9c\xf4\xcb\x94\x41\x88\xfa\x0e\x1e\x38\xdd\x77\x8f\x7d" + "\x1c\x9d\x98\x7b\x28\xd1\x32\xdf\xb9\x73\x1f\xa4\xf4\xb4\x16\x93\x5b\xe4" + "\x9d\xe3\x05\x16\xaf\x35\x78\x58\x1f\x2f\x13\xf5\x61\xc0\x66\x33\x61\x94" + "\x1e\xab\x24\x9a\x4b\xc1\x23\xf8\xd1\x5c\xd7\x11\xa9\x56\xa1\xbf\x20\xfe" + "\x6e\xb7\x8a\xea\x23\x73\x36\x1d\xa0\x42\x6c\x79\xa5\x30\xc3\xbb\x1d\xe0" + "\xc9\x97\x22\xef\x1f\xde\x39\xac\x2b\x00\xa0\xa8\xee\x7c\x80\x0a\x08\xbc" + "\x22\x64\xf8\x9f\x4e\xff\xe6\x27\xac\x2f\x05\x31\xfb\x55\x4f\x6d\x21\xd7" + "\x4c\x59\x0a\x70\xad\xfa\xa3\x90\xbd\xfb\xb3\xd6\x8e\x46\x21\x5c\xab\x18" + "\x7d\x23\x68\xd5\xa7\x1f\x5e\xbe\xc0\x81\xcd\x3b\x20\xc0\x82\xdb\xe4\xcd" + "\x2f\xac\xa2\x87\x73\x79\x5d\x6b\x0c\x10\x20\x4b\x65\x9a\x93\x9e\xf2\x9b" + "\xbe\x10\x88\x24\x36\x24\x42\x99\x27\xa7\xeb\x57\x6d\xd3\xa0\x0e\xa5\xe0" + "\x1a\xf5\xd4\x75\x83\xb2\x27\x2c\x0c\x16\x1a\x80\x65\x21\xa1\x6f\xf9\xb0" + "\xa7\x22\xc0\xcf\x26\xb0\x25\xd5\x83\x6e\x22\x58\xa4\xf7\xd4\x77\x3a\xc8" + "\x01\xe4\x26\x3b\xc2\x94\xf4\x3d\xef\x7f\xa8\x70\x3f\x3a\x41\x97\x46\x35" + "\x25\x88\x76\x52\xb0\xb2\xa4\xa2\xa7\xcf\x87\xf0\x09\x14\x87\x1e\x25\x03" + "\x91\x13\xc7\xe1\x61\x8d\xa3\x40\x64\xb5\x7a\x43\xc4\x63\x24\x9f\xb8\xd0" + "\x5e\x0f\x26\xf4\xa6\xd8\x49\x72\xe7\xa9\x05\x48\x24\x14\x5f\x91\x29\x5c" + "\xdb\xe3\x9a\x6f\x92\x0f\xac\xc6\x59\x71\x2b\x46\xa5\x4b\xa2\x95\xbb\xe6" + "\xa9\x01\x54\xe9\x1b\x33\x98\x5a\x2b\xcd\x42\x0a\xd5\xc6\x7e\xc9\xad\x8e" + "\xb7\xac\x68\x64\xdb\x27\x2a\x51\x6b\xc9\x4c\x28\x39\xb0\xa8\x16\x9a\x6b" + "\xf5\x8e\x1a\x0c\x2a\xda\x8c\x88\x3b\x7b\xf4\x97\xa4\x91\x71\x26\x8e\xd1" + "\x5d\xdd\x29\x69\x38\x4e\x7f\xf4\xbf\x4a\xab\x2e\xc9\xec\xc6\x52\x9c\xf6" + "\x29\xe2\xdf\x0f\x08\xa7\x7a\x65\xaf\xa1\x2a\xa9\xb5\x05\xdf\x8b\x28\x7e" + "\xf6\xcc\x91\x49\x3d\x1c\xaa\x39\x07\x6e\x28\xef\x1e\xa0\x28\xf5\x11\x8d" + "\xe6\x1a\xe0\x2b\xb6\xae\xfc\x33\x43\xa0\x50\x29\x2f\x19\x9f\x40\x18\x57" + "\xb2\xbe\xad\x5e\x6e\xe2\xa1\xf1\x91\x02\x2f\x92\x78\x01\x6f\x04\x77\x91" + "\xa9\xd1\x8d\xa7\xd2\xa6\xd2\x7f\x2e\x0e\x51\xc2\xf6\xea\x30\xe8\xac\x49" + "\xa0\x60\x4f\x4c\x13\x54\x2e\x85\xb6\x83\x81\xb9\xfd\xcf\xa0\xce\x4b\x2d" + "\x34\x13\x54\x85\x2d\x36\x02\x45\xc5\x36\xb6\x12\xaf\x71\xf3\xe7\x7c\x90" + "\x95\xae\x2d\xbd\xe5\x04\xb2\x65\x73\x3d\xab\xfe\x10\xa2\x0f\xc7\xd6\xd3" + "\x2c\x21\xcc\xc7\x2b\x8b\x34\x44\xae\x66\x3d\x65\x92\x2d\x17\xf8\x2c\xaa" + "\x2b\x86\x5c\xd8\x89\x13\xd2\x91\xa6\x58\x99\x02\x6e\xa1\x32\x84\x39\x72" + "\x3c\x19\x8c\x36\xb0\xc3\xc8\xd0\x85\xbf\xaf\x8a\x32\x0f\xde\x33\x4b\x4a" + "\x49\x19\xb4\x4c\x2b\x95\xf6\xe8\xec\xf7\x33\x93\xf7\xf0\xd2\xa4\x0e\x60" + "\xb1\xd4\x06\x52\x6b\x02\x2d\xdc\x33\x18\x10\xb1\xa5\xf7\xc3\x47\xbd\x53" + "\xed\x1f\x10\x5d\x6a\x0d\x30\xab\xa4\x77\xe1\x78\x88\x9a\xb2\xec\x55\xd5" + "\x58\xde\xab\x26\x30\x20\x43\x36\x96\x2b\x4d\xb5\xb6\x63\xb6\x90\x2b\x89" + "\xe8\x5b\x31\xbc\x6a\xf5\x0f\xc5\x0a\xcc\xb3\xfb\x9b\x57\xb6\x63\x29\x70" + "\x31\x37\x8d\xb4\x78\x96\xd7\xfb\xaf\x6c\x60\x0a\xdd\x2c\x67\xf9\x36\xdb" + "\x03\x79\x86\xdb\x85\x6e\xb4\x9c\xf2\xdb\x3f\x7d\xa6\xd2\x36\x50\xe4\x38" + "\xf1\x88\x40\x41\xb0\x13\x11\x9e\x4c\x2a\xe5\xaf\x37\xcc\xcd\xfb\x68\x66" + "\x07\x38\xb5\x8b\x3c\x59\xd1\xc0\x24\x84\x37\x47\x2a\xba\x1f\x35\xca\x1f" + "\xb9\x0c\xd7\x14\xaa\x9f\x63\x55\x34\xf4\x9e\x7c\x5b\xba\x81\xc2\xb6\xb3" + "\x6f\xde\xe2\x1c\xa2\x7e\x34\x7f\x79\x3d\x2c\xe9\x44\xed\xb2\x3c\x8c\x9b" + "\x91\x4b\xe1\x03\x35\xe3\x50\xfe\xb5\x07\x03\x94\xb7\xa4\xa1\x5c\x0c\xa1" + "\x20\x28\x35\x68\xb7\xbf\xc2\x54\xfe\x83\x8b\x13\x7a\x21\x47\xce\x7c\x11" + "\x3a\x3a\x4d\x65\x49\x9d\x9e\x86\xb8\x7d\xbc\xc7\xf0\x3b\xbd\x3a\x3a\xb1" + "\xaa\x24\x3e\xce\x5b\xa9\xbc\xf2\x5f\x82\x83\x6c\xfe\x47\x3b\x2d\x83\xe7" + "\xa7\x20\x1c\xd0\xb9\x6a\x72\x45\x1e\x86\x3f\x6c\x3b\xa6\x64\xa6\xd0\x73" + "\xd1\xf7\xb5\xed\x99\x08\x65\xd9\x78\xbd\x38\x15\xd0\x60\x94\xfc\x9a\x2a" + "\xba\x52\x21\xc2\x2d\x5a\xb9\x96\x38\x9e\x37\x21\xe3\xaf\x5f\x05\xbe\xdd" + "\xc2\x87\x5e\x0d\xfa\xeb\x39\x02\x1e\xe2\x7a\x41\x18\x7c\xbb\x45\xef\x40" + "\xc3\xe7\x3b\xc0\x39\x89\xf9\xa3\x0d\x12\xc5\x4b\xa7\xd2\x14\x1d\xa8\xa8" + "\x75\x49\x3e\x65\x77\x6e\xf3\x5f\x97\xde\xbc\x22\x86\xcc\x4a\xf9\xb4\x62" + "\x3e\xee\x90\x2f\x84\x0c\x52\xf1\xb8\xad\x65\x89\x39\xae\xf7\x1f\x3f\x72" + "\xb9\xec\x1d\xe2\x15\x88\xbd\x35\x48\x4e\xa4\x44\x36\x34\x3f\xf9\x5e\xad" + "\x6a\xb1\xd8\xaf\xb1\xb2\xa3\x03\xdf\x1b\x71\xe5\x3c\x4a\xea\x6b\x2e\x3e" + "\x93\x72\xbe\x0d\x1b\xc9\x97\x98\xb0\xce\x3c\xc1\x0d\x2a\x59\x6d\x56\x5d" + "\xba\x82\xf8\x8c\xe4\xcf\xf3\xb3\x3d\x5d\x24\xe9\xc0\x83\x11\x24\xbf\x1a" + "\xd5\x4b\x79\x25\x32\x98\x3d\xd6\xc3\xa8\xb7\xd0", + "\xeb\xd5\xcc\xb0", 1, 16512, NULL, 0}, + {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} }; diff --git a/test/kat-app/ghash_test.c b/test/kat-app/ghash_test.c index 1220f0ab..2185ce3a 100644 --- a/test/kat-app/ghash_test.c +++ b/test/kat-app/ghash_test.c @@ -89,7 +89,7 @@ int ghash_test(struct IMB_MGR *mb_mgr) if (!use_job_api) { IMB_GHASH(mb_mgr, &gdata_key, vec->msg, - (vec->msgSize / 8), T_test, vec->tagSize); + (vec->msgSize / 8), T_test, vec->tagSize / 8); } else { IMB_JOB *job = IMB_GET_NEXT_JOB(mb_mgr); @@ -107,7 +107,7 @@ int ghash_test(struct IMB_MGR *mb_mgr) job->msg_len_to_hash_in_bytes = (vec->msgSize / 8); job->hash_start_src_offset_in_bytes = UINT64_C(0); job->auth_tag_output = T_test; - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job = IMB_SUBMIT_JOB(mb_mgr); @@ -119,7 +119,7 @@ int ghash_test(struct IMB_MGR *mb_mgr) fprintf(stderr, "failed job, status:%d\n", job->status); } - if (check_data(T_test, vec->tag, vec->tagSize, "generated tag (T)")) + if (check_data(T_test, vec->tag, vec->tagSize / 8, "generated tag (T)")) test_suite_update(&ts, 0, 1); else test_suite_update(&ts, 1, 0); diff --git a/test/kat-app/ghash_test.json.c b/test/kat-app/ghash_test.json.c index bfaf87f9..f2fb634f 100644 --- a/test/kat-app/ghash_test.json.c +++ b/test/kat-app/ghash_test.json.c @@ -31,26 +31,26 @@ #include "mac_test.h" const struct mac_test ghash_test_json[] = { - {16, 16, 1, - "\xa1\xf6\x25\x8c\x87\x7d\x5f\xcd\x89\x64\x48\x45\x38\xbf\xc9\x2c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x9e\xe5\xa5\x1f\xbe\x28\xa1\x15\x3e\xf1\x96\xf5\x0b\xbf\x03\xca", 1, 128, - NULL, 0}, - {16, 12, 2, - "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\xb5\x40\xda\x44\xa3\x8c\x9c\x2b\x95\x8e\x4b\x0b", 1, 256, NULL, 0}, - {16, 16, 3, - "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", "\x05", - "\xe6\xce\x47\xb5\xfb\xf2\xef\x37\x51\xf1\x57\x53\xad\x56\x4f\xed", 1, 8, - NULL, 0}, - {16, 16, 4, - "\x1f\x0f\x8a\x3a\xca\x64\x2e\xde\xb1\xdf\x8a\x52\x9a\x29\x76\xee", - "\x9b\xb5\x92\x9f\xa7\xaa\x83\xfd\x0c\xd1\x83\x3a\x8e\xd5\x4d\xda\x6a\xaf" - "\xa1\xc7\xa1\x32\x3a\xd4\x92\x9a\x2c\x83\xc6\x27\x92\x59\x28\x90\x11\xde" - "\x19\x4e\xd5\x16\xef\x4f\x72\xeb\x79\x18\xd5\xb1\xc5\x22\x40\x14\x92\xa2", - "\x8b\xa5\x3f\x5f\xd7\x0e\x55\x7c\x30\xd4\xf2\xe1\x1a\x4f\xf8\xc7", 1, 432, - NULL, 0}, + {128, 128, 1, + "\xa1\xf6\x25\x8c\x87\x7d\x5f\xcd\x89\x64\x48\x45\x38\xbf\xc9\x2c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x9e\xe5\xa5\x1f\xbe\x28\xa1\x15\x3e\xf1\x96\xf5\x0b\xbf\x03\xca", 1, 128, + NULL, 0}, + {128, 96, 2, + "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\xb5\x40\xda\x44\xa3\x8c\x9c\x2b\x95\x8e\x4b\x0b", 1, 256, NULL, 0}, + {128, 128, 3, + "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", "\x05", + "\xe6\xce\x47\xb5\xfb\xf2\xef\x37\x51\xf1\x57\x53\xad\x56\x4f\xed", 1, 8, + NULL, 0}, + {128, 128, 4, + "\x1f\x0f\x8a\x3a\xca\x64\x2e\xde\xb1\xdf\x8a\x52\x9a\x29\x76\xee", + "\x9b\xb5\x92\x9f\xa7\xaa\x83\xfd\x0c\xd1\x83\x3a\x8e\xd5\x4d\xda\x6a\xaf" + "\xa1\xc7\xa1\x32\x3a\xd4\x92\x9a\x2c\x83\xc6\x27\x92\x59\x28\x90\x11\xde" + "\x19\x4e\xd5\x16\xef\x4f\x72\xeb\x79\x18\xd5\xb1\xc5\x22\x40\x14\x92\xa2", + "\x8b\xa5\x3f\x5f\xd7\x0e\x55\x7c\x30\xd4\xf2\xe1\x1a\x4f\xf8\xc7", 1, 432, + NULL, 0}, {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} }; diff --git a/test/kat-app/gmac_test.c b/test/kat-app/gmac_test.c index c582f25c..c2e7e08c 100644 --- a/test/kat-app/gmac_test.c +++ b/test/kat-app/gmac_test.c @@ -131,28 +131,28 @@ gmac_test_vector(IMB_MGR *mb_mgr, struct gcm_key_data key; struct gcm_context_data ctx; const uint8_t *iv = (const void *) vector->iv; - const uint64_t iv_len = vector->ivSize; + const uint64_t iv_len = vector->ivSize / 8; const uint64_t nb_segs = ((vector->msgSize / 8) / seg_size); const uint64_t last_partial_seg = ((vector->msgSize / 8) % seg_size); const uint8_t *in_ptr = (const void *) vector->msg; uint8_t T_test[16]; struct test_suite_context *ts = ts128; - if (vector->keySize == IMB_KEY_192_BYTES) + if ((vector->keySize / 8) == IMB_KEY_192_BYTES) ts = ts192; - if (vector->keySize == IMB_KEY_256_BYTES) + if ((vector->keySize / 8) == IMB_KEY_256_BYTES) ts = ts256; memset(&key, 0, sizeof(struct gcm_key_data)); if (job_api) { - aes_gmac_job(mb_mgr, (const void *) vector->key, &key, vector->keySize, in_ptr, - seg_size, iv, iv_len, T_test, vector->tagSize); + aes_gmac_job(mb_mgr, (const void *) vector->key, &key, vector->keySize / 8, in_ptr, + seg_size, iv, iv_len, T_test, vector->tagSize / 8); } else { uint8_t in_seg[MAX_SEG_SIZE]; uint32_t i; - switch (vector->keySize) { + switch (vector->keySize / 8) { case IMB_KEY_128_BYTES: IMB_AES128_GCM_PRE(mb_mgr, vector->key, &key); IMB_AES128_GMAC_INIT(mb_mgr, &key, &ctx, iv, iv_len); @@ -173,7 +173,7 @@ gmac_test_vector(IMB_MGR *mb_mgr, } IMB_AES128_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, - vector->tagSize); + vector->tagSize / 8); break; case IMB_KEY_192_BYTES: IMB_AES192_GCM_PRE(mb_mgr, vector->key, &key); @@ -195,7 +195,7 @@ gmac_test_vector(IMB_MGR *mb_mgr, } IMB_AES192_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, - vector->tagSize); + vector->tagSize / 8); break; case IMB_KEY_256_BYTES: default: @@ -218,12 +218,13 @@ gmac_test_vector(IMB_MGR *mb_mgr, } IMB_AES256_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, - vector->tagSize); + vector->tagSize / 8); break; } } - if (check_data(T_test, (const void *) vector->tag, vector->tagSize, "generated tag (T)")) + if (check_data(T_test, (const void *) vector->tag, + vector->tagSize / 8, "generated tag (T)")) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); diff --git a/test/kat-app/gmac_test.json.c b/test/kat-app/gmac_test.json.c index 921f086e..b413ff3f 100644 --- a/test/kat-app/gmac_test.json.c +++ b/test/kat-app/gmac_test.json.c @@ -31,48 +31,50 @@ #include "mac_test.h" const struct mac_test gmac_test_kat_json[] = { - /* Vectors from - http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf - */ - {16, 4, 1, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23" - "\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35" - "\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\xc5\x3a\xf9\xe8", 1, 512, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 12}, - {16, 16, 2, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" - "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" - "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" - "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" - "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c" - "\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" - "\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", - "\x4c\x0c\x4f\x47\x2d\x78\xf6\xd8\x03\x53\x20\x2f\x1a\xdf\x90\xd0", 1, - 1280, "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", 12}, - {24, 16, 3, - "\xaa\x74\x0a\xbf\xad\xcd\xa7\x79\x22\x0d\x3b\x40\x6c\x5d\x7e\xc0\x9a\x77" - "\xfe\x9d\x94\x10\x45\x39", - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" - "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" - "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" - "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" - "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", - "\xcf\x82\x80\x64\x02\x46\xf4\xfb\x33\xae\x1d\x90\xea\x48\x83\xdb", 1, 640, - "\xab\x22\x65\xb4\xc1\x68\x95\x55\x61\xf0\x43\x15", 12}, - {32, 16, 4, - "\xb5\x48\xe4\x93\x4f\x5c\x64\xd3\xc0\xf0\xb7\x8f\x7b\x4d\x88\x24\xaa\xc4" - "\x6b\x3c\x8d\x2c\xc3\x5e\xe4\xbf\xb2\x54\xe4\xfc\xba\xf7", - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" - "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" - "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" - "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01", - "\x77\x46\x0d\x6f\xb1\x87\xdb\xa9\x46\xad\xcd\xfb\xb7\xf9\x13\xa1", 1, 520, - "\x2e\xed\xe1\xdc\x64\x47\xc7\xaf\xc4\x41\x53\x58", 12}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + /* + * Vectors from + * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/ + * proposedmodes/gcm/gcm-revised-spec.pdf + */ + {128, 32, 1, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23" + "\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35" + "\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", + "\xc5\x3a\xf9\xe8", 1, 512, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96}, + {128, 128, 2, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" + "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" + "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" + "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" + "\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c" + "\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" + "\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", + "\x4c\x0c\x4f\x47\x2d\x78\xf6\xd8\x03\x53\x20\x2f\x1a\xdf\x90\xd0", 1, + 1280, "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", 96}, + {192, 128, 3, + "\xaa\x74\x0a\xbf\xad\xcd\xa7\x79\x22\x0d\x3b\x40\x6c\x5d\x7e\xc0\x9a\x77" + "\xfe\x9d\x94\x10\x45\x39", + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" + "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" + "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" + "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", + "\xcf\x82\x80\x64\x02\x46\xf4\xfb\x33\xae\x1d\x90\xea\x48\x83\xdb", 1, 640, + "\xab\x22\x65\xb4\xc1\x68\x95\x55\x61\xf0\x43\x15", 96}, + {256, 128, 4, + "\xb5\x48\xe4\x93\x4f\x5c\x64\xd3\xc0\xf0\xb7\x8f\x7b\x4d\x88\x24\xaa\xc4" + "\x6b\x3c\x8d\x2c\xc3\x5e\xe4\xbf\xb2\x54\xe4\xfc\xba\xf7", + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" + "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" + "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" + "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01", + "\x77\x46\x0d\x6f\xb1\x87\xdb\xa9\x46\xad\xcd\xfb\xb7\xf9\x13\xa1", 1, 520, + "\x2e\xed\xe1\xdc\x64\x47\xc7\xaf\xc4\x41\x53\x58", 96}, + {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} }; diff --git a/test/kat-app/hmac_md5.json.c b/test/kat-app/hmac_md5.json.c index a61daa57..18b60f5b 100644 --- a/test/kat-app/hmac_md5.json.c +++ b/test/kat-app/hmac_md5.json.c @@ -29,109 +29,109 @@ #include "mac_test.h" const struct mac_test hmac_md5_test_json[] = { - /* Vectors from https://tools.ietf.org/html/rfc2202 */ - {16, 16, 1, - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", - "\x48\x69\x20\x54\x68\x65\x72\x65", - "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d", 1, 64, - NULL, 0}, - {4, 16, 2, "\x4a\x65\x66\x65", - "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" - "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", - "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7\x38", 1, 224, - NULL, 0}, - {16, 16, 3, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", - "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6", 1, 400, - NULL, 0}, - {25, 16, 4, - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" - "\x13\x14\x15\x16\x17\x18\x19", - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", - "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47\x46\xff\xaa\x79", 1, 400, - NULL, 0}, - {16, 16, 5, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" - "\x6f\x6e", - "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95\x69\x0e\xfd\x4c", 1, 160, - NULL, 0}, - {80, 16, 6, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", - "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce\x61\xb9\xd0\xcd", 1, 432, - NULL, 0}, - {80, 16, 7, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" - "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" - "\x61", - "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e", 1, 584, - NULL, 0}, - {16, 12, 8, - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", - "\x48\x69\x20\x54\x68\x65\x72\x65", - "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8", 1, 64, NULL, 0}, - {4, 12, 9, "\x4a\x65\x66\x65", - "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" - "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", - "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31", 1, 224, NULL, 0}, - {16, 12, 10, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", - "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33", 1, 400, NULL, 0}, - {25, 12, 11, - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" - "\x13\x14\x15\x16\x17\x18\x19", - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", - "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47", 1, 400, NULL, 0}, - {16, 12, 12, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" - "\x6f\x6e", - "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95", 1, 160, NULL, 0}, - {80, 12, 13, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", - "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce", 1, 432, NULL, 0}, - {80, 12, 14, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" - "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" - "\x61", - "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62", 1, 584, NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + /* Vectors from https://tools.ietf.org/html/rfc2202 */ + {128, 128, 1, + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", + "\x48\x69\x20\x54\x68\x65\x72\x65", + "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d", 1, 64, + NULL, 0}, + {32, 128, 2, "\x4a\x65\x66\x65", + "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" + "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", + "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7\x38", 1, 224, + NULL, 0}, + {128, 128, 3, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", + "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6", 1, 400, + NULL, 0}, + {200, 128, 4, + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" + "\x13\x14\x15\x16\x17\x18\x19", + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47\x46\xff\xaa\x79", 1, 400, + NULL, 0}, + {128, 128, 5, + "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95\x69\x0e\xfd\x4c", 1, 160, + NULL, 0}, + {640, 128, 6, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", + "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce\x61\xb9\xd0\xcd", 1, 432, + NULL, 0}, + {640, 128, 7, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" + "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" + "\x61", + "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e", 1, 584, + NULL, 0}, + {128, 96, 8, + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", + "\x48\x69\x20\x54\x68\x65\x72\x65", + "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8", 1, 64, NULL, 0}, + {32, 96, 9, "\x4a\x65\x66\x65", + "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" + "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", + "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31", 1, 224, NULL, 0}, + {128, 96, 10, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", + "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33", 1, 400, NULL, 0}, + {200, 96, 11, + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" + "\x13\x14\x15\x16\x17\x18\x19", + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47", 1, 400, NULL, 0}, + {128, 96, 12, + "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95", 1, 160, NULL, 0}, + {640, 96, 13, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", + "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce", 1, 432, NULL, 0}, + {640, 96, 14, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" + "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" + "\x61", + "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62", 1, 584, NULL, 0}, + {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} }; diff --git a/test/kat-app/hmac_md5_test.c b/test/kat-app/hmac_md5_test.c index 1c78cf46..66c90240 100644 --- a/test/kat-app/hmac_md5_test.c +++ b/test/kat-app/hmac_md5_test.c @@ -52,11 +52,11 @@ hmac_md5_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + vec->tagSize], + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { printf("hash overwrite tail\n"); hexdump(stderr, "Target", - &auth[sizeof_padding + vec->tagSize], + &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding); return 0; } @@ -68,12 +68,12 @@ hmac_md5_job_ok(const struct mac_test *vec, } if (memcmp(vec->tag, &auth[sizeof_padding], - vec->tagSize)) { + vec->tagSize / 8)) { printf("hash mismatched\n"); hexdump(stderr, "Received", &auth[sizeof_padding], - vec->tagSize); + vec->tagSize / 8); hexdump(stderr, "Expected", vec->tag, - vec->tagSize); + vec->tagSize / 8); return 0; } return 1; @@ -101,7 +101,7 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { const size_t alloc_len = - vec->tagSize + (sizeof(padding) * 2); + (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -111,7 +111,7 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_MD5, vec->key, vec->keySize, + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_MD5, vec->key, vec->keySize / 8, ipad_hash, opad_hash); /* empty the manager */ @@ -127,7 +127,7 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, job->dst = NULL; job->key_len_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job->iv = NULL; job->iv_len_in_bytes = 0; job->src = (const void *) vec->msg; @@ -206,15 +206,15 @@ test_hmac_md5_std_vectors(struct IMB_MGR *mb_mgr, printf("RFC2202 Test Case %zu key_len:%zu " "data_len:%zu digest_len:%zu\n", v->tcId, - v->keySize, + v->keySize / 8, v->msgSize / 8, - v->tagSize); + v->tagSize / 8); #else printf("."); #endif } /* No functionality for keys larger than block size */ - if (v->keySize > IMB_MD5_BLOCK_SIZE) { + if ((v->keySize / 8) > IMB_MD5_BLOCK_SIZE) { #ifdef DEBUG if (!quiet_mode) printf("Skipped vector %zu, " diff --git a/test/kat-app/hmac_sha1.json.c b/test/kat-app/hmac_sha1.json.c index 2d757355..8c3e5407 100644 --- a/test/kat-app/hmac_sha1.json.c +++ b/test/kat-app/hmac_sha1.json.c @@ -31,91 +31,83 @@ const struct mac_test hmac_sha1_test_kat_json[] = { /* * Test vectors from https://tools.ietf.org/html/rfc2202 */ - { 20, 20, 1, - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b\x0b", - "\x48\x69\x20\x54\x68\x65\x72\x65", - "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1" - "\x46\xbe\x00", - 1, 64, NULL, 0 }, - { 4, 20, 2, "\x4a\x65\x66\x65", - "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66" - "\x6F\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", - "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25" - "\x9a\x7c\x79", - 1, 224, NULL, 0 }, - { 20, 20, 3, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa", - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", - "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63" - "\xf1\x75\xd3", - 1, 400, NULL, 0 }, - { 25, 20, 4, - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19", - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", - "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d" - "\x72\x35\xda", - 1, 400, NULL, 0 }, - { 20, 20, 5, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74" - "\x69\x6f\x6e", - "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a" - "\x9a\x5a\x04", - 1, 160, NULL, 0 }, - { 20, 12, 6, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74" - "\x69\x6f\x6e", - "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1", - 1, 160, NULL, 0 }, - { 80, 20, 7, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72" - "\x20\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20" - "\x4b\x65\x79\x20\x2d\x20\x48\x61\x73\x68\x20\x4b\x65\x79\x20\x46\x69" - "\x72\x73\x74", - "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed" - "\x40\x21\x12", - 1, 432, NULL, 0 }, - { 80, 20, 8, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72" - "\x20\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20" - "\x4b\x65\x79\x20\x61\x6e\x64\x20\x4c\x61\x72\x67\x65\x72\x20\x54\x68" - "\x61\x6e\x20\x4f\x6e\x65\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65" - "\x20\x44\x61\x74\x61", - "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb" - "\xff\x1a\x91", - 1, 584, NULL, 0 }, - /* - * Test vector from - * https://csrc.nist.gov/csrc/media/publications/fips/198/ - * archive/2002-03-06/documents/fips-198a.pdf - */ - { 49, 12, 9, - "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80" - "\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91" - "\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0", - "\x53\x61\x6d\x70\x6c\x65\x20\x23\x34", - "\x9e\xa8\x86\xef\xe2\x68\xdb\xec\xce\x42\x0c\x75", 1, 72, NULL, 0 }, - { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } + {160, 160, 1, + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" + "\x0b\x0b", + "\x48\x69\x20\x54\x68\x65\x72\x65", + "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46" + "\xbe\x00", + 1, 64, NULL, 0}, + {32, 160, 2, "\x4a\x65\x66\x65", + "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" + "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", + "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a" + "\x7c\x79", + 1, 224, NULL, 0}, + {160, 160, 3, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa", + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", + "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1" + "\x75\xd3", + 1, 400, NULL, 0}, + {200, 160, 4, + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" + "\x13\x14\x15\x16\x17\x18\x19", + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72" + "\x35\xda", + 1, 400, NULL, 0}, + {160, 160, 5, + "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" + "\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a" + "\x5a\x04", + 1, 160, NULL, 0}, + {160, 96, 6, + "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" + "\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1", 1, 160, NULL, 0}, + {640, 160, 7, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x4b\x65" + "\x79\x20\x2d\x20\x48\x61\x73\x68\x20\x4b\x65\x79\x20\x46\x69\x72\x73\x74", + "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40" + "\x21\x12", + 1, 432, NULL, 0}, + {640, 160, 8, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x4b\x65" + "\x79\x20\x61\x6e\x64\x20\x4c\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6e\x20" + "\x4f\x6e\x65\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x44\x61\x74" + "\x61", + "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff" + "\x1a\x91", + 1, 584, NULL, 0}, + /* Vectors from https://tools.ietf.org/html/rfc2202 */ + {392, 96, 9, + "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81" + "\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93" + "\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0", + "\x53\x61\x6d\x70\x6c\x65\x20\x23\x34", + "\x9e\xa8\x86\xef\xe2\x68\xdb\xec\xce\x42\x0c\x75", 1, 72, NULL, 0}, + {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} }; diff --git a/test/kat-app/hmac_sha1_test.c b/test/kat-app/hmac_sha1_test.c index 63c38a9e..130f3a39 100644 --- a/test/kat-app/hmac_sha1_test.c +++ b/test/kat-app/hmac_sha1_test.c @@ -54,11 +54,11 @@ hmac_sha1_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + vec->tagSize], + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { printf("hash overwrite tail\n"); hexdump(stderr, "Target", - &auth[sizeof_padding + vec->tagSize], + &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding); return 0; } @@ -70,12 +70,12 @@ hmac_sha1_job_ok(const struct mac_test *vec, } if (memcmp(vec->tag, &auth[sizeof_padding], - vec->tagSize)) { + vec->tagSize / 8)) { printf("hash mismatched\n"); hexdump(stderr, "Received", &auth[sizeof_padding], - vec->tagSize); + vec->tagSize / 8); hexdump(stderr, "Expected", vec->tag, - vec->tagSize); + vec->tagSize / 8); return 0; } return 1; @@ -104,7 +104,7 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { const size_t alloc_len = - vec->tagSize + (sizeof(padding) * 2); + (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -115,7 +115,7 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, } imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - vec->key, vec->keySize, ipad_hash, opad_hash); + vec->key, vec->keySize / 8, ipad_hash, opad_hash); for (i = 0; i < num_jobs; i++) { job = IMB_GET_NEXT_JOB(mb_mgr); @@ -126,7 +126,7 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, job->dst = NULL; job->key_len_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job->iv = NULL; job->iv_len_in_bytes = 0; job->src = (const void *) vec->msg; @@ -213,7 +213,7 @@ test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { const size_t alloc_len = - vec->tagSize + (sizeof(padding) * 2); + (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -224,7 +224,7 @@ test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, } imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - vec->key, vec->keySize, ipad_hash, opad_hash); + vec->key, vec->keySize / 8, ipad_hash, opad_hash); while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < num_jobs) IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); @@ -238,7 +238,7 @@ test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, job->dst = NULL; job->key_len_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job->iv = NULL; job->iv_len_in_bytes = 0; job->src = (const void *) vec->msg; @@ -330,7 +330,7 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { const size_t alloc_len = - vec->tagSize + (sizeof(padding) * 2); + (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -341,7 +341,7 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, } imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - vec->key, vec->keySize, ipad_hash, opad_hash); + vec->key, vec->keySize / 8, ipad_hash, opad_hash); for (i = 0; i < num_jobs; i++) { job = &jobs[i]; @@ -352,7 +352,7 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, job->dst = NULL; job->key_len_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job->iv = NULL; job->iv_len_in_bytes = 0; job->src = (const void *) vec->msg; @@ -433,9 +433,9 @@ test_hmac_sha1_std_vectors(struct IMB_MGR *mb_mgr, printf("RFC2202 Test Case %zu keySize:%zu " "msgSize:%zu tagSize:%zu\n", v->tcId, - v->keySize, + v->keySize / 8, v->msgSize / 8, - v->tagSize); + v->tagSize / 8); #else printf("."); #endif diff --git a/test/kat-app/hmac_sha224.json.c b/test/kat-app/hmac_sha224.json.c index a928651a..2fe6ec8e 100644 --- a/test/kat-app/hmac_sha224.json.c +++ b/test/kat-app/hmac_sha224.json.c @@ -25,24 +25,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -/* HMACSHA224, 0.8rc21 */ +/* HMACSHA224, RFC4231 */ #include "mac_test.h" const struct mac_test hmac_sha224_test_kat_json[] = { /* Vectors from https://tools.ietf.org/html/rfc4231 */ - { 20, 28, 1, + { 160, 224, 1, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" "\x0b\x0b\x0b", "\x48\x69\x20\x54\x68\x65\x72\x65", "\x89\x6f\xb1\x12\x8a\xbb\xdf\x19\x68\x32\x10\x7c\xd4\x9d\xf3\x3f\x47" "\xb4\xb1\x16\x99\x12\xba\x4f\x53\x68\x4b\x22", 1, 64, NULL, 0 }, - { 4, 28, 2, "\x4a\x65\x66\x65", + { 32, 224, 2, "\x4a\x65\x66\x65", "\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61\x20\x77\x61\x6e\x74\x20\x66" "\x6f\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f", "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f\x8b" "\xbe\xa2\xa3\x9e\x61\x48\x00\x8f\xd0\x5e\x44", 1, 224, NULL, 0 }, - { 20, 28, 3, + { 160, 224, 3, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa", "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" @@ -51,7 +51,7 @@ const struct mac_test hmac_sha224_test_kat_json[] = { "\x7f\xb3\xcb\x35\x88\xc6\xc1\xf6\xff\xa9\x69\x4d\x7d\x6a\xd2\x64\x93" "\x65\xb0\xc1\xf6\x5d\x69\xd1\xec\x83\x33\xea", 1, 400, NULL, 0 }, - { 25, 28, 4, + { 200, 224, 4, "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" "\x12\x13\x14\x15\x16\x17\x18\x19", "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" @@ -60,14 +60,14 @@ const struct mac_test hmac_sha224_test_kat_json[] = { "\x6c\x11\x50\x68\x74\x01\x3c\xac\x6a\x2a\xbc\x1b\xb3\x82\x62\x7c\xec" "\x6a\x90\xd8\x6e\xfc\x01\x2d\xe7\xaf\xec\x5a", 1, 400, NULL, 0 }, - { 20, 16, 5, + { 160, 128, 5, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" "\x0c\x0c\x0c", "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74" "\x69\x6f\x6e", "\x0e\x2a\xea\x68\xa9\x0c\x8d\x37\xc9\x88\xbc\xdb\x9f\xca\x6f\xa8", 1, 160, NULL, 0 }, - { 131, 28, 6, + { 1048, 224, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -83,7 +83,7 @@ const struct mac_test hmac_sha224_test_kat_json[] = { "\x95\xe9\xa0\xdb\x96\x20\x95\xad\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2\xd4" "\x99\xf1\x12\xf2\xd2\xb7\x27\x3f\xa6\x87\x0e", 1, 432, NULL, 0 }, - { 131, 28, 7, + { 1048, 224, 7, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -105,7 +105,7 @@ const struct mac_test hmac_sha224_test_kat_json[] = { "\x67\x70\xdb\x9c\x2b\x95\xc9\xf6\xf5\x65\xd1", 1, 1216, NULL, 0 }, /* Vectors from https://csrc.nist.gov/csrc/media/projects/ */ - { 64, 28, 8, + { 512, 224, 8, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" diff --git a/test/kat-app/hmac_sha256.json.c b/test/kat-app/hmac_sha256.json.c index 1fa1a90a..b485a552 100644 --- a/test/kat-app/hmac_sha256.json.c +++ b/test/kat-app/hmac_sha256.json.c @@ -25,24 +25,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -/* HMACSHA256, 0.8rc21 */ +/* HMACSHA256, RFC4231 */ #include "mac_test.h" const struct mac_test hmac_sha256_test_kat_json[] = { /* Vectors from https://tools.ietf.org/html/rfc4231 */ - { 20, 32, 1, + { 160, 256, 1, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" "\x0b\x0b\x0b", "\x48\x69\x20\x54\x68\x65\x72\x65", "\xb0\x34\x4c\x61\xd8\xdb\x38\x53\x5c\xa8\xaf\xce\xaf\x0b\xf1\x2b\x88" "\x1d\xc2\x00\xc9\x83\x3d\xa7\x26\xe9\x37\x6c\x2e\x32\xcf\xf7", 1, 64, NULL, 0 }, - { 4, 32, 2, "\x4a\x65\x66\x65", + { 32, 256, 2, "\x4a\x65\x66\x65", "\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61\x20\x77\x61\x6e\x74\x20\x66" "\x6f\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f", "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e\x6a\x04\x24\x26\x08\x95\x75\xc7\x5a" "\x00\x3f\x08\x9d\x27\x39\x83\x9d\xec\x58\xb9\x64\xec\x38\x43", 1, 224, NULL, 0 }, - { 20, 32, 3, + { 160, 256, 3, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa", "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" @@ -51,7 +51,7 @@ const struct mac_test hmac_sha256_test_kat_json[] = { "\x77\x3e\xa9\x1e\x36\x80\x0e\x46\x85\x4d\xb8\xeb\xd0\x91\x81\xa7\x29" "\x59\x09\x8b\x3e\xf8\xc1\x22\xd9\x63\x55\x14\xce\xd5\x65\xfe", 1, 400, NULL, 0 }, - { 25, 32, 4, + { 200, 256, 4, "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" "\x12\x13\x14\x15\x16\x17\x18\x19", "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" @@ -60,14 +60,14 @@ const struct mac_test hmac_sha256_test_kat_json[] = { "\x82\x55\x8a\x38\x9a\x44\x3c\x0e\xa4\xcc\x81\x98\x99\xf2\x08\x3a\x85" "\xf0\xfa\xa3\xe5\x78\xf8\x07\x7a\x2e\x3f\xf4\x67\x29\x66\x5b", 1, 400, NULL, 0 }, - { 20, 16, 5, + { 160, 128, 5, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" "\x0c\x0c\x0c", "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74" "\x69\x6f\x6e", "\xa3\xb6\x16\x74\x73\x10\x0e\xe0\x6e\x0c\x79\x6c\x29\x55\x55\x2b", 1, 160, NULL, 0 }, - { 131, 32, 6, + { 1048, 256, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -83,7 +83,7 @@ const struct mac_test hmac_sha256_test_kat_json[] = { "\x60\xe4\x31\x59\x1e\xe0\xb6\x7f\x0d\x8a\x26\xaa\xcb\xf5\xb7\x7f\x8e" "\x0b\xc6\x21\x37\x28\xc5\x14\x05\x46\x04\x0f\x0e\xe3\x7f\x54", 1, 432, NULL, 0 }, - { 131, 32, 7, + { 1048, 256, 7, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -105,7 +105,7 @@ const struct mac_test hmac_sha256_test_kat_json[] = { "\xdc\x63\x64\x4f\x07\x13\x93\x8a\x7f\x51\x53\x5c\x3a\x35\xe2", 1, 1216, NULL, 0 }, /* Vectors from https://csrc.nist.gov/csrc/media/projects/ */ - { 64, 32, 8, + { 512, 256, 8, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" diff --git a/test/kat-app/hmac_sha256_sha512_test.c b/test/kat-app/hmac_sha256_sha512_test.c index 44dbbbb7..dc28428e 100644 --- a/test/kat-app/hmac_sha256_sha512_test.c +++ b/test/kat-app/hmac_sha256_sha512_test.c @@ -73,11 +73,11 @@ hmac_shax_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + vec->tagSize], + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { printf("hash overwrite tail\n"); hexdump(stderr, "Target", - &auth[sizeof_padding + vec->tagSize], + &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding); return 0; } @@ -88,10 +88,10 @@ hmac_shax_job_ok(const struct mac_test *vec, return 0; } - if (memcmp(p_digest, &auth[sizeof_padding], vec->tagSize)) { + if (memcmp(p_digest, &auth[sizeof_padding], vec->tagSize / 8)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize); - hexdump(stderr, "Expected", p_digest, vec->tagSize); + hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); + hexdump(stderr, "Expected", p_digest, vec->tagSize / 8); return 0; } return 1; @@ -150,7 +150,7 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { const size_t alloc_len = - vec->tagSize + (sizeof(padding) * 2); + (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -160,7 +160,7 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, - vec->keySize, ipad_hash, opad_hash); + vec->keySize / 8, ipad_hash, opad_hash); /* empty the manager */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -175,7 +175,7 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, job->dst = NULL; job->key_len_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job->iv = NULL; job->iv_len_in_bytes = 0; job->src = (const void *) vec->msg; @@ -304,7 +304,7 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { const size_t alloc_len = - vec->tagSize + (sizeof(padding) * 2); + (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -315,7 +315,7 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, } imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, - vec->keySize, ipad_hash, opad_hash); + vec->keySize / 8, ipad_hash, opad_hash); while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < num_jobs) IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); @@ -329,7 +329,7 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, job->dst = NULL; job->key_len_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job->iv = NULL; job->iv_len_in_bytes = 0; job->src = (const void *) vec->msg; @@ -470,7 +470,7 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { const size_t alloc_len = - vec->tagSize + (sizeof(padding) * 2); + (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -481,7 +481,7 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, } imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, - vec->keySize, ipad_hash, opad_hash); + vec->keySize / 8, ipad_hash, opad_hash); for (i = 0; i < num_jobs; i++) { job = &jobs[i]; @@ -492,7 +492,7 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, job->dst = NULL; job->key_len_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->tagSize; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; job->iv = NULL; job->iv_len_in_bytes = 0; job->src = (const void *) vec->msg; @@ -605,7 +605,7 @@ test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, printf("RFC4231 Test Case %zu key_len:%zu " "data_len:%zu\n", v->tcId, - v->keySize, + v->keySize / 8, v->msgSize / 8); #else printf("."); @@ -613,10 +613,10 @@ test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, } /* @todo add truncation functionality to hmac_sha224 to hmac_sha 512*/ const int flag = - ((sha_type == 224 && v->tagSize != IMB_SHA224_DIGEST_SIZE_IN_BYTES) || - (sha_type == 256 && v->tagSize != IMB_SHA256_DIGEST_SIZE_IN_BYTES) || - (sha_type == 384 && v->tagSize != IMB_SHA384_DIGEST_SIZE_IN_BYTES) || - (sha_type == 512 && v->tagSize != IMB_SHA512_DIGEST_SIZE_IN_BYTES)); + ((sha_type == 224 && (v->tagSize / 8) != IMB_SHA224_DIGEST_SIZE_IN_BYTES) || + (sha_type == 256 && (v->tagSize / 8) != IMB_SHA256_DIGEST_SIZE_IN_BYTES) || + (sha_type == 384 && (v->tagSize / 8) != IMB_SHA384_DIGEST_SIZE_IN_BYTES) || + (sha_type == 512 && (v->tagSize / 8) != IMB_SHA512_DIGEST_SIZE_IN_BYTES)); if (flag) { #ifdef DEBUG diff --git a/test/kat-app/hmac_sha384.json.c b/test/kat-app/hmac_sha384.json.c index eb95f286..6cbb7360 100644 --- a/test/kat-app/hmac_sha384.json.c +++ b/test/kat-app/hmac_sha384.json.c @@ -25,11 +25,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -/* HMACSHA384, 0.8rc21 */ +/* HMACSHA384, RFC4231 */ #include "mac_test.h" const struct mac_test hmac_sha384_test_kat_json[] = { /* Vectors from https://tools.ietf.org/html/rfc4231 */ - { 20, 48, 1, + { 160, 384, 1, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" "\x0b\x0b\x0b", "\x48\x69\x20\x54\x68\x65\x72\x65", @@ -37,14 +37,14 @@ const struct mac_test hmac_sha384_test_kat_json[] = { "\xf9\xda\xdb\xe4\x10\x1e\xc6\x82\xaa\x03\x4c\x7c\xeb\xc5\x9c\xfa\xea" "\x9e\xa9\x07\x6e\xde\x7f\x4a\xf1\x52\xe8\xb2\xfa\x9c\xb6", 1, 64, NULL, 0 }, - { 4, 48, 2, "\x4a\x65\x66\x65", + { 32, 384, 2, "\x4a\x65\x66\x65", "\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61\x20\x77\x61\x6e\x74\x20\x66" "\x6f\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f", "\xaf\x45\xd2\xe3\x76\x48\x40\x31\x61\x7f\x78\xd2\xb5\x8a\x6b\x1b\x9c" "\x7e\xf4\x64\xf5\xa0\x1b\x47\xe4\x2e\xc3\x73\x63\x22\x44\x5e\x8e\x22" "\x40\xca\x5e\x69\xe2\xc7\x8b\x32\x39\xec\xfa\xb2\x16\x49", 1, 224, NULL, 0 }, - { 20, 48, 3, + { 160, 384, 3, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa", "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" @@ -54,7 +54,7 @@ const struct mac_test hmac_sha384_test_kat_json[] = { "\xa6\x35\xd9\x47\xac\x9f\xeb\xe8\x3e\xf4\xe5\x59\x66\x14\x4b\x2a\x5a" "\xb3\x9d\xc1\x38\x14\xb9\x4e\x3a\xb6\xe1\x01\xa3\x4f\x27", 1, 400, NULL, 0 }, - { 25, 48, 4, + { 200, 384, 4, "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" "\x12\x13\x14\x15\x16\x17\x18\x19", "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" @@ -64,13 +64,13 @@ const struct mac_test hmac_sha384_test_kat_json[] = { "\x99\x81\x48\x08\x50\x00\x9c\xc5\x57\x7c\x6e\x1f\x57\x3b\x4e\x68\x01" "\xdd\x23\xc4\xa7\xd6\x79\xcc\xf8\xa3\x86\xc6\x74\xcf\xfb", 1, 400, NULL, 0 }, - { 20, 16, 5, + { 160, 128, 5, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" "\x0c\x0c\x0c", "\x3a\xbf\x34\xc3\x50\x3b\x2a\x23\xa4\x6e\xfc\x61\x9b\xae\xf8\x97", "\xa3\xb6\x16\x74\x73\x10\x0e\xe0\x6e\x0c\x79\x6c\x29\x55\x55\x2b", 1, 128, NULL, 0 }, - { 131, 48, 6, + { 1048, 384, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -87,7 +87,7 @@ const struct mac_test hmac_sha384_test_kat_json[] = { "\x9e\xf1\x01\x2a\x2b\x58\x8f\x3c\xd1\x1f\x05\x03\x3a\xc4\xc6\x0c\x2e" "\xf6\xab\x40\x30\xfe\x82\x96\x24\x8d\xf1\x63\xf4\x49\x52", 1, 432, NULL, 0 }, - { 131, 48, 7, + { 1048, 384, 7, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -110,7 +110,7 @@ const struct mac_test hmac_sha384_test_kat_json[] = { "\xcc\x31\xe7\x99\x17\x6d\x38\x60\xe6\x11\x0c\x46\x52\x3e", 1, 1216, NULL, 0 }, /* Vectors from https://csrc.nist.gov/csrc/media/projects/ */ - { 64, 24, 8, + { 512, 192, 8, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" diff --git a/test/kat-app/hmac_sha512.json.c b/test/kat-app/hmac_sha512.json.c index e1722665..5f031df2 100644 --- a/test/kat-app/hmac_sha512.json.c +++ b/test/kat-app/hmac_sha512.json.c @@ -25,11 +25,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -/* HMACSHA512, 0.8rc21 */ +/* HMACSHA512, RFC4231 */ #include "mac_test.h" const struct mac_test hmac_sha512_test_kat_json[] = { /* Vectors from https://tools.ietf.org/html/rfc4231 */ - { 20, 64, 1, + { 160, 512, 1, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" "\x0b\x0b\x0b", "\x48\x69\x20\x54\x68\x65\x72\x65", @@ -38,7 +38,7 @@ const struct mac_test hmac_sha512_test_kat_json[] = { "\x33\xb7\xd6\xb8\xa7\x02\x03\x8b\x27\x4e\xae\xa3\xf4\xe4\xbe\x9d\x91" "\x4e\xeb\x61\xf1\x70\x2e\x69\x6c\x20\x3a\x12\x68\x54", 1, 64, NULL, 0 }, - { 4, 64, 2, "\x4a\x65\x66\x65", + { 32, 512, 2, "\x4a\x65\x66\x65", "\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61\x20\x77\x61\x6e\x74\x20\x66" "\x6f\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f", "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3\x87" @@ -46,7 +46,7 @@ const struct mac_test hmac_sha512_test_kat_json[] = { "\xbf\x75\xc0\x5a\x99\x4a\x6d\x03\x4f\x65\xf8\xf0\xe6\xfd\xca\xea\xb1" "\xa3\x4d\x4a\x6b\x4b\x63\x6e\x07\x0a\x38\xbc\xe7\x37", 1, 224, NULL, 0 }, - { 20, 64, 3, + { 160, 512, 3, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa", "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" @@ -57,7 +57,7 @@ const struct mac_test hmac_sha512_test_kat_json[] = { "\x84\x82\x79\xa7\x22\xc8\x06\xb4\x85\xa4\x7e\x67\xc8\x07\xb9\x46\xa3" "\x37\xbe\xe8\x94\x26\x74\x27\x88\x59\xe1\x32\x92\xfb", 1, 400, NULL, 0 }, - { 25, 64, 4, + { 200, 512, 4, "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" "\x12\x13\x14\x15\x16\x17\x18\x19", "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" @@ -68,13 +68,13 @@ const struct mac_test hmac_sha512_test_kat_json[] = { "\xa5\xc1\x1a\xa2\x5e\xb4\xd6\x79\x27\x5c\xc5\x78\x80\x63\xa5\xf1\x97" "\x41\x12\x0c\x4f\x2d\xe2\xad\xeb\xeb\x10\xa2\x98\xdd", 1, 400, NULL, 0 }, - { 20, 16, 5, + { 160, 16, 5, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" "\x0c\x0c\x0c", "\x3a\xbf\x34\xc3\x50\x3b\x2a\x23\xa4\x6e\xfc\x61\x9b\xae\xf8\x97", "\x41\x5f\xad\x62\x71\x58\x0a\x53\x1d\x41\x79\xbc\x89\x1d\x87\xa6", 1, 128, NULL, 0 }, - { 131, 64, 6, + { 1048, 512, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -92,7 +92,7 @@ const struct mac_test hmac_sha512_test_kat_json[] = { "\xd0\x37\xe0\x5f\x25\x98\xbd\x0f\xd2\x21\x5d\x6a\x1e\x52\x95\xe6\x4f" "\x73\xf6\x3f\x0a\xec\x8b\x91\x5a\x98\x5d\x78\x65\x98", 1, 432, NULL, 0 }, - { 131, 64, 7, + { 1048, 512, 7, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" @@ -116,7 +116,7 @@ const struct mac_test hmac_sha512_test_kat_json[] = { "\xfb\x6d\xe0\x44\x60\x65\xc9\x74\x40\xfa\x8c\x6a\x58", 1, 1216, NULL, 0 }, /* Vectors from https://csrc.nist.gov/csrc/media/projects/ */ - { 64, 32, 8, + { 512, 256, 8, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" diff --git a/test/kat-app/poly1305_test.json.c b/test/kat-app/poly1305_test.json.c index 1a479108..28e3f293 100644 --- a/test/kat-app/poly1305_test.json.c +++ b/test/kat-app/poly1305_test.json.c @@ -2,138 +2,138 @@ #include "mac_test.h" const struct mac_test poly1305_test_json[] = { - /* Vectors from https://tools.ietf.org/html/rfc7539 */ - {256, 128, 1, - "\x85\xd6\xbe\x78\x57\x55\x6d\x33\x7f\x44\x52\xfe\x42\xd5\x06\xa8\x01\x03" - "\x80\x8a\xfb\x0d\xb2\xfd\x4a\xbf\xf6\xaf\x41\x49\xf5\x1b", - "\x43\x72\x79\x70\x74\x6f\x67\x72\x61\x70\x68\x69\x63\x20\x46\x6f\x72\x75" - "\x6d\x20\x52\x65\x73\x65\x61\x72\x63\x68\x20\x47\x72\x6f\x75\x70", - "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9", 1, 272, - NULL, 0}, - {256, 128, 2, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 512, - NULL, 0}, - {256, 128, 3, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\xe5" - "\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", - "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" - "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" - "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" - "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" - "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" - "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" - "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" - "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" - "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" - "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" - "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" - "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" - "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" - "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" - "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" - "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" - "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" - "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" - "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" - "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", - "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", 1, - 3000, NULL, 0}, - {256, 128, 4, - "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" - "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" - "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" - "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" - "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" - "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" - "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" - "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" - "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" - "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" - "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" - "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" - "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" - "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" - "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" - "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" - "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" - "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" - "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" - "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", - "\xf3\x47\x7e\x7c\xd9\x54\x17\xaf\x89\xa6\xb8\x79\x4c\x31\x0c\xf0", 1, - 3000, NULL, 0}, - {256, 128, 5, - "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a\xf3\x33\x88\x86\x04\xf6\xb5\xf0\x47\x39" - "\x17\xc1\x40\x2b\x80\x09\x9d\xca\x5c\xbc\x20\x70\x75\xc0", - "\x27\x54\x77\x61\x73\x20\x62\x72\x69\x6c\x6c\x69\x67\x2c\x20\x61\x6e\x64" - "\x20\x74\x68\x65\x20\x73\x6c\x69\x74\x68\x79\x20\x74\x6f\x76\x65\x73\x0a" - "\x44\x69\x64\x20\x67\x79\x72\x65\x20\x61\x6e\x64\x20\x67\x69\x6d\x62\x6c" - "\x65\x20\x69\x6e\x20\x74\x68\x65\x20\x77\x61\x62\x65\x3a\x0a\x41\x6c\x6c" - "\x20\x6d\x69\x6d\x73\x79\x20\x77\x65\x72\x65\x20\x74\x68\x65\x20\x62\x6f" - "\x72\x6f\x67\x6f\x76\x65\x73\x2c\x0a\x41\x6e\x64\x20\x74\x68\x65\x20\x6d" - "\x6f\x6d\x65\x20\x72\x61\x74\x68\x73\x20\x6f\x75\x74\x67\x72\x61\x62\x65" - "\x2e", - "\x45\x41\x66\x9a\x7e\xaa\xee\x61\xe7\x08\xdc\x7c\xbc\xc5\xeb\x62", 1, - 1016, NULL, 0}, - {256, 128, 6, - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, - NULL, 0}, - {256, 128, 7, - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, - NULL, 0}, - {256, 128, 8, - "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\xff" - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x11\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, - NULL, 0}, - {256, 128, 9, - "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xfe" - "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x01\x01\x01\x01" - "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, - NULL, 0}, - {256, 128, 10, - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xfa\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, - NULL, 0}, - {256, 128, 11, - "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" - "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x14\x00\x00\x00\x00\x00\x00\x00\x55\x00\x00\x00\x00\x00\x00\x00", 1, 512, - NULL, 0}, - {256, 128, 12, - "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" - "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, - NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + /* Vectors from https://tools.ietf.org/html/rfc7539 */ + {256, 128, 1, + "\x85\xd6\xbe\x78\x57\x55\x6d\x33\x7f\x44\x52\xfe\x42\xd5\x06\xa8\x01\x03" + "\x80\x8a\xfb\x0d\xb2\xfd\x4a\xbf\xf6\xaf\x41\x49\xf5\x1b", + "\x43\x72\x79\x70\x74\x6f\x67\x72\x61\x70\x68\x69\x63\x20\x46\x6f\x72\x75" + "\x6d\x20\x52\x65\x73\x65\x61\x72\x63\x68\x20\x47\x72\x6f\x75\x70", + "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9", 1, 272, + NULL, 0}, + {256, 128, 2, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 512, + NULL, 0}, + {256, 128, 3, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\xe5" + "\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", + "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" + "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" + "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" + "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" + "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" + "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" + "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" + "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" + "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" + "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" + "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" + "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" + "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" + "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" + "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" + "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" + "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" + "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" + "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" + "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" + "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", + "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", 1, + 3000, NULL, 0}, + {256, 128, 4, + "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" + "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" + "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" + "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" + "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" + "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" + "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" + "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" + "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" + "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" + "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" + "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" + "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" + "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" + "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" + "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" + "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" + "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" + "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" + "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" + "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", + "\xf3\x47\x7e\x7c\xd9\x54\x17\xaf\x89\xa6\xb8\x79\x4c\x31\x0c\xf0", 1, + 3000, NULL, 0}, + {256, 128, 5, + "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a\xf3\x33\x88\x86\x04\xf6\xb5\xf0\x47\x39" + "\x17\xc1\x40\x2b\x80\x09\x9d\xca\x5c\xbc\x20\x70\x75\xc0", + "\x27\x54\x77\x61\x73\x20\x62\x72\x69\x6c\x6c\x69\x67\x2c\x20\x61\x6e\x64" + "\x20\x74\x68\x65\x20\x73\x6c\x69\x74\x68\x79\x20\x74\x6f\x76\x65\x73\x0a" + "\x44\x69\x64\x20\x67\x79\x72\x65\x20\x61\x6e\x64\x20\x67\x69\x6d\x62\x6c" + "\x65\x20\x69\x6e\x20\x74\x68\x65\x20\x77\x61\x62\x65\x3a\x0a\x41\x6c\x6c" + "\x20\x6d\x69\x6d\x73\x79\x20\x77\x65\x72\x65\x20\x74\x68\x65\x20\x62\x6f" + "\x72\x6f\x67\x6f\x76\x65\x73\x2c\x0a\x41\x6e\x64\x20\x74\x68\x65\x20\x6d" + "\x6f\x6d\x65\x20\x72\x61\x74\x68\x73\x20\x6f\x75\x74\x67\x72\x61\x62\x65" + "\x2e", + "\x45\x41\x66\x9a\x7e\xaa\xee\x61\xe7\x08\xdc\x7c\xbc\xc5\xeb\x62", 1, + 1016, NULL, 0}, + {256, 128, 6, + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + NULL, 0}, + {256, 128, 7, + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + NULL, 0}, + {256, 128, 8, + "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x11\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, + NULL, 0}, + {256, 128, 9, + "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xfe" + "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, + NULL, 0}, + {256, 128, 10, + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xfa\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, + NULL, 0}, + {256, 128, 11, + "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" + "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x14\x00\x00\x00\x00\x00\x00\x00\x55\x00\x00\x00\x00\x00\x00\x00", 1, 512, + NULL, 0}, + {256, 128, 12, + "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" + "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, + NULL, 0}, + {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} }; -- GitLab From 73644fcbf5f8f6bfac767f4d023cdd42457ea70e Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Wed, 14 Jun 2023 15:52:07 +0100 Subject: [PATCH 003/204] test: [CBCS] Unifying test vectors --- test/include/cipher_test.h | 46 + test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 2 +- test/kat-app/aes_cbcs_test.c | 3467 +---------------------------- test/kat-app/aes_cbcs_test.json.c | 1492 +++++++++++++ test/kat-app/win_x64.mak | 2 +- 6 files changed, 1571 insertions(+), 3439 deletions(-) create mode 100644 test/include/cipher_test.h create mode 100644 test/kat-app/aes_cbcs_test.json.c diff --git a/test/include/cipher_test.h b/test/include/cipher_test.h new file mode 100644 index 00000000..f6539032 --- /dev/null +++ b/test/include/cipher_test.h @@ -0,0 +1,46 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +#ifndef CIPHER_TEST_H +#define CIPHER_TEST_H + +#include +#include + +struct cipher_test { + size_t ivSize; /* bits */ + size_t keySize; /* bits */ + size_t tcId; + const char *key; + const char *iv; + const char *msg; + const char *ct; + int resultValid; + size_t msgSize; /* bits */ +}; + +#endif /* CIPHER_TEST_H */ diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index a96c2370..2a92e77f 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -97,6 +97,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/cmac_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/xcbc_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/sha_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbcs_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index af47ec8a..f8e5e792 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -40,7 +40,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ chacha20_poly1305_test.c null_test.c snow_v_test.c direct_api_param_test.c quic_ecb_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ - cmac_test.json.c xcbc_test.json.c sha_test.json.c gmac_test.c + cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/aes_cbcs_test.c b/test/kat-app/aes_cbcs_test.c index 4b5c5ded..3765b2d7 100644 --- a/test/kat-app/aes_cbcs_test.c +++ b/test/kat-app/aes_cbcs_test.c @@ -35,3402 +35,11 @@ #include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "cipher_test.h" int aes_cbcs_test(struct IMB_MGR *mb_mgr); -struct aes_vector { - const uint8_t *K; /* key */ - const uint8_t *IV; /* initialization vector */ - const uint8_t *P; /* plain text */ - uint64_t Plen; /* plain text length */ - const uint8_t *C; /* cipher text - same length as plain text */ - uint32_t Klen; /* key length */ -}; - -/* =================================================================== */ -/* =================================================================== */ - -/* - * AES Test vectors from - * http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf - * Modified to added 144 bytes of plaintext between each encrypted block - */ - -/* 128-bit */ -static const uint8_t K1[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P1[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t C1[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, - 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, - 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, - 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const uint8_t K2[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P2[] = { - 0xf7, 0xcd, 0x12, 0xfb, 0x4f, 0x8e, 0x50, 0xab, - 0x35, 0x8e, 0x56, 0xf9, 0x83, 0x53, 0x9a, 0x1a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfc, 0x47, 0x3c, 0x96, 0x01, 0xfe, 0x01, 0x87, - 0xd5, 0xde, 0x46, 0x24, 0x5c, 0x62, 0x8f, 0xba, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xba, 0x91, 0x17, 0x8d, 0xba, 0x5a, 0x79, 0xb1, - 0x57, 0x05, 0x4d, 0x08, 0xba, 0x1f, 0x30, 0xd3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x40, 0xe9, 0x37, 0xb0, 0xd6, 0x34, 0x87, - 0x33, 0xdd, 0xc0, 0x5b, 0x2d, 0x58, 0x1d, 0x2a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7b, 0xb6, 0xe3, 0xd0, 0xc8, 0xa0, 0x7a, 0x69, - 0xc8, 0x5d, 0x10, 0xa2, 0xc3, 0x39, 0xca, 0xaf, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0xdc, 0xc7, 0xcb, 0xff, 0x18, 0x7d, 0x51, - 0x06, 0x28, 0x28, 0x1f, 0x3a, 0x9c, 0x18, 0x7d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5b, 0xb5, 0xe9, 0x20, 0xc2, 0xae, 0x17, 0x7f, - 0xd1, 0x65, 0x7a, 0x75, 0xcf, 0x21, 0xa0, 0x1e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x1b, 0xf7, 0xe8, 0x62, 0x5f, 0xaf, 0x34, - 0x7f, 0xd8, 0x18, 0x4a, 0x94, 0xf2, 0x33, 0x90, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t C2[] = { - 0xf0, 0x8f, 0x91, 0x13, 0x11, 0x01, 0xdc, 0xbb, - 0xcd, 0xf9, 0x95, 0x92, 0xda, 0xbf, 0x2a, 0x86, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xea, 0x8d, 0xa6, 0x08, 0xc8, 0xb5, 0x65, 0x82, - 0x93, 0x43, 0xb7, 0x0e, 0x14, 0x36, 0xb4, 0xcf, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd8, 0x11, 0xab, 0x21, 0x5b, 0x64, 0xb8, 0xc5, - 0xee, 0x27, 0x93, 0x66, 0x59, 0xd9, 0x1d, 0xc9, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x84, 0x9d, 0x03, 0xbd, 0xab, 0xce, 0x6a, 0x14, - 0x76, 0x73, 0x17, 0xe3, 0xb3, 0xe5, 0x70, 0xe8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa2, 0xa8, 0xce, 0xb0, 0xf6, 0xc4, 0xc5, 0xb5, - 0x8e, 0x22, 0xef, 0x33, 0xdf, 0x18, 0x42, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x56, 0xc4, 0xb9, 0x7f, 0x60, 0x9e, 0x8b, 0x45, - 0xc1, 0xbf, 0xa7, 0xfa, 0x1b, 0x3e, 0x02, 0x5d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb3, 0x04, 0x93, 0x30, 0xf5, 0xff, 0x8e, 0xb6, - 0x0a, 0xfb, 0x41, 0xfe, 0x09, 0xa5, 0x90, 0xc7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x22, 0xab, 0xaa, 0x22, 0x89, 0xd8, 0x3c, 0x4e, - 0x46, 0x18, 0x93, 0xbf, 0x1a, 0xce, 0x77, 0x59, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const uint8_t K3[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV3[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P3[] = { - 0xdd, 0x14, 0xde, 0x30, 0xe0, 0xfd, 0x7b, 0x2a, - 0x94, 0x8e, 0x28, 0xa0, 0xf6, 0x93, 0x6e, 0xf5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x92, 0x65, 0x1d, 0x5e, 0x78, 0x2a, 0x9d, 0x39, - 0xfc, 0xb8, 0x6d, 0x8b, 0xa5, 0xf4, 0x4b, 0x21, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x4e, 0xe9, 0xeb, 0xd7, 0xa7, 0xa1, 0x59, - 0xdc, 0x4c, 0x5e, 0xcc, 0x83, 0xab, 0xd3, 0x45, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0x2c, 0x73, 0x23, 0xea, 0x45, 0xcb, 0x0c, - 0x12, 0x67, 0x28, 0xcd, 0xef, 0x4e, 0xca, 0xe2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1d, 0x92, 0x82, 0xd8, 0x0f, 0xa9, 0x36, 0x23, - 0x6d, 0x38, 0x68, 0xac, 0xa0, 0xeb, 0xdc, 0xcc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdf, 0xb8, 0x3a, 0x53, 0x04, 0x1a, 0x55, 0x27, - 0x8e, 0x22, 0x86, 0x8c, 0xbd, 0xdc, 0x6b, 0x12, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9c, 0x69, 0xd2, 0x7a, 0x4b, 0x52, 0x5d, 0x76, - 0x34, 0xb9, 0x5e, 0x30, 0x0a, 0x8d, 0x1e, 0xf1, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x27, 0xda, 0x5b, 0xb9, 0x5e, 0xbf, 0x65, 0x34, - 0x00, 0xb6, 0xd2, 0xb0, 0x89, 0x12, 0xb6, 0x35, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xae, 0x27, 0x7f, 0x11, 0xe9, 0xf9, 0x1c, 0x71, - 0xc9, 0x50, 0xfe, 0xd4, 0x76, 0x50, 0x95, 0xf7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe1, 0x1c, 0x14, 0xcd, 0x67, 0x0f, 0xf0, 0x6d, - 0xa2, 0x93, 0x7b, 0x2c, 0x8d, 0x83, 0x5c, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe4, 0x95, 0xf3, 0xa1, 0xfd, 0x00, 0x77, 0x68, - 0x41, 0xb4, 0xfb, 0x81, 0xf4, 0x61, 0x1a, 0x84, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5a, 0x53, 0xc3, 0xdc, 0xba, 0x0d, 0x67, 0x2e, - 0xcf, 0xf2, 0x30, 0xf5, 0x1d, 0xe9, 0xc4, 0x2c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xac, 0x1f, 0xa7, 0x9c, 0x64, 0xfd, 0x45, 0x30, - 0x1b, 0xa1, 0x3b, 0x3d, 0xc7, 0xf5, 0xf9, 0xbb, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xba, 0x99, 0xa4, 0x12, 0x6e, 0x4e, 0xea, 0x0b, - 0x29, 0x7f, 0xcd, 0x84, 0x64, 0x50, 0x40, 0xb7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6a, 0x24, 0x29, 0xa4, 0xa7, 0xa1, 0xef, 0xa9, - 0xcf, 0xdf, 0x09, 0xff, 0xaa, 0x17, 0x5d, 0x82, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x74, 0xf5, 0xae, 0xd0, 0xe9, 0xec, 0xad, 0x5e, - 0xa7, 0x84, 0xda, 0xe7, 0x33, 0x58, 0x7e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x45, 0x5f, 0xbb, 0x15, 0xa3, 0x65, 0x0e, 0xf5, - 0x7e, 0x27, 0xe7, 0x04, 0x52, 0x58, 0x81, 0xd0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xee, 0x8f, 0xaf, 0xe2, 0x3c, 0xbe, 0x08, 0x97, - 0x8a, 0x97, 0x12, 0xb0, 0x09, 0xfe, 0xa5, 0xeb, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd1, 0x9c, 0x30, 0xe8, 0x9a, 0x3f, 0xe0, 0x38, - 0x34, 0x2b, 0xad, 0xb7, 0xc4, 0xda, 0x54, 0xab, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x97, 0x9c, 0x46, 0x2b, 0x2c, 0x0b, 0xb3, 0x49, - 0xcd, 0x9d, 0x32, 0x38, 0x3c, 0x1a, 0x49, 0xdc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2f, 0xe7, 0xcd, 0x8a, 0xb0, 0x76, 0xcf, 0x30, - 0xea, 0x0b, 0xb0, 0xb7, 0x63, 0xed, 0xb2, 0x8c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x2c, 0xb7, 0x75, 0xa8, 0xf6, 0x63, 0xb6, - 0xcd, 0xb5, 0x63, 0xfb, 0x5f, 0x89, 0xae, 0x3d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x33, 0x73, 0xaf, 0xde, 0xcb, 0x37, 0x0a, 0x50, - 0x6f, 0xae, 0xf3, 0xa6, 0x79, 0x85, 0xdd, 0xc5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x24, 0xc5, 0x29, 0x23, 0x64, 0xef, 0x43, 0xd7, - 0xc4, 0xab, 0xd8, 0xb0, 0x84, 0x26, 0x6b, 0xe8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb1, 0x5d, 0xb5, 0x69, 0xfb, 0x97, 0x0e, 0x20, - 0xb3, 0xc1, 0x60, 0xad, 0x1a, 0xd2, 0xd6, 0x3a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x73, 0x08, 0xf0, 0x47, 0x5f, 0xcf, 0x15, 0xf7, - 0x7b, 0xf3, 0x69, 0x08, 0x5a, 0x6b, 0x9f, 0xc7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x12, 0xa1, 0xf0, 0xfb, 0x91, 0xc9, 0x07, 0x61, - 0x21, 0xa0, 0x30, 0x4c, 0x16, 0x81, 0xcd, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x61, 0xe8, 0x96, 0x91, 0x30, 0xdd, 0x0c, 0x0e, - 0x0b, 0xa1, 0x33, 0x95, 0x67, 0x99, 0xd6, 0x1e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1a, 0xb3, 0x12, 0xfd, 0xad, 0x46, 0x48, 0x87, - 0x5e, 0xe8, 0xd4, 0xf5, 0xac, 0xdf, 0xa7, 0x37, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb8, 0xa1, 0x62, 0x8c, 0xb8, 0xb6, 0xb0, 0x69, - 0x63, 0x29, 0x60, 0x64, 0x26, 0xc3, 0xf8, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x8e, 0x46, 0xa0, 0xc5, 0x45, 0x5c, 0x08, 0x2a, - 0xed, 0x29, 0x84, 0x11, 0xea, 0x59, 0xc0, 0x16, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe2, 0x04, 0x30, 0x63, 0x22, 0x87, 0xb6, 0xc7, - 0x81, 0xa6, 0x58, 0xc0, 0xb2, 0xb0, 0x7d, 0xbc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x16, 0x44, 0x6e, 0x5d, 0x6d, 0xce, 0x2a, 0xe0, - 0x20, 0x69, 0x35, 0xa1, 0x5d, 0x17, 0x48, 0x55, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x88, 0xfe, 0xde, 0x34, 0xe7, 0x18, 0xbf, 0x7e, - 0x0a, 0x1c, 0x32, 0x88, 0xab, 0xde, 0xe1, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x61, 0x09, 0x58, 0x96, 0xef, 0x16, 0x73, 0xac, - 0xc0, 0x5c, 0x15, 0xca, 0x9b, 0xea, 0x0e, 0x05, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x97, 0x88, 0x09, 0xc5, 0xd0, 0x95, 0x90, 0xae, - 0xa5, 0xb5, 0x28, 0xc6, 0x5a, 0x7b, 0xb3, 0xcc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xae, 0x57, 0x71, 0x83, 0x56, 0x57, 0xca, 0xe8, - 0x8b, 0x21, 0x0c, 0x37, 0x1d, 0xde, 0x85, 0xe2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1b, 0xa2, 0x38, 0xa0, 0xc5, 0xc7, 0x98, 0x7b, - 0xf9, 0x5e, 0x6a, 0x68, 0xb3, 0xed, 0x49, 0x5e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x46, 0xb9, 0xc9, 0xf6, 0x34, 0xa6, 0x0e, 0xac, - 0x90, 0x72, 0xcf, 0xf8, 0x5b, 0x48, 0x13, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7a, 0xce, 0xfd, 0x3c, 0x16, 0xff, 0xb5, 0xea, - 0xb2, 0x56, 0x47, 0xcc, 0x9f, 0xbc, 0xae, 0x4a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc8, 0xa5, 0x59, 0x57, 0x01, 0xd7, 0x9f, 0xd7, - 0xbf, 0x13, 0xb1, 0xbf, 0xb7, 0x9a, 0xa0, 0xa1, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc6, 0x66, 0x61, 0x96, 0xf2, 0xcd, 0x8c, 0xcb, - 0x3c, 0x67, 0xb5, 0xed, 0xb7, 0xa2, 0x54, 0x84, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0xcb, 0x7e, 0xb3, 0x97, 0x05, 0xcb, 0x8f, - 0xa9, 0xc6, 0x3c, 0xa2, 0xbd, 0xbf, 0x3a, 0xb8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x92, 0x08, 0x01, 0xea, 0xfd, 0x55, 0x2f, 0x27, - 0x2a, 0x82, 0x38, 0x26, 0x1d, 0x81, 0x19, 0x33, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x75, 0x3c, 0xa2, 0x13, 0x1e, 0x58, 0x9f, 0x0b, - 0x08, 0x5d, 0x7a, 0x2c, 0x9a, 0xd1, 0xa5, 0x4c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x41, 0xb4, 0x1d, 0xf8, 0x42, 0x08, 0x87, 0xdd, - 0x8e, 0xc9, 0x05, 0xd2, 0x8c, 0xba, 0x93, 0x28, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xbe, 0x4a, 0x14, 0x13, 0x2a, 0x58, 0xf0, 0x1c, - 0xac, 0xc1, 0xc4, 0x49, 0xbc, 0xe1, 0xda, 0xb6, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2d, 0x06, 0x98, 0x32, 0xea, 0xa3, 0x89, 0x11, - 0xca, 0x5f, 0x3e, 0xda, 0x24, 0xe2, 0xdb, 0x1e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xca, 0xf3, 0xc0, 0xc7, 0x64, 0xee, 0x4b, 0x3d, - 0xa2, 0xee, 0x69, 0xb0, 0x3f, 0x2c, 0xd5, 0x49, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xba, 0x2d, 0x45, 0x7d, 0xdd, 0xb0, 0x0d, 0xc5, - 0xe0, 0x57, 0x95, 0xbe, 0xf8, 0x4a, 0x11, 0x46, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4c, 0xbb, 0xdf, 0xa8, 0x5a, 0xf9, 0xff, 0x0e, - 0x31, 0xa9, 0x50, 0x5d, 0xc4, 0xb3, 0x3d, 0x09, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x46, 0x33, 0x39, 0x31, 0xd5, 0xb3, 0xe5, 0x91, - 0xcf, 0xca, 0x8a, 0xe0, 0xc2, 0x8e, 0xea, 0xbe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x54, 0x64, 0x78, 0x0c, 0x25, 0x1c, 0x17, 0xbc, - 0x49, 0xf9, 0xc0, 0x30, 0x5f, 0x08, 0x04, 0x9d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb5, 0xe4, 0xeb, 0x9e, 0xe5, 0x1e, 0x6d, 0xbc, - 0x7b, 0xe7, 0xf0, 0xd1, 0xa0, 0x01, 0x18, 0x51, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4f, 0x64, 0xc3, 0x9c, 0x70, 0x25, 0x4f, 0xed, - 0xc7, 0xbc, 0x19, 0x00, 0x09, 0x22, 0x97, 0x5d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6f, 0xe4, 0x47, 0x98, 0x05, 0xcd, 0xcc, 0xde, - 0xd5, 0xe3, 0xaf, 0xa3, 0xde, 0x69, 0x99, 0x2a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd1, 0x28, 0x4d, 0x7c, 0x89, 0xa0, 0xdb, 0xae, - 0xf9, 0xf1, 0x4a, 0x46, 0xdf, 0xbe, 0x1d, 0x37, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf2, 0xd5, 0x36, 0x4a, 0x54, 0xe8, 0xc4, 0xfb, - 0x57, 0x77, 0x09, 0x05, 0x31, 0x99, 0xaf, 0x9a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0xd1, 0x20, 0x93, 0x31, 0x89, 0xff, 0xed, - 0x0f, 0xf8, 0xed, 0xb3, 0xcf, 0x4c, 0x9a, 0x74, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xbb, 0x00, 0x36, 0x41, 0xd1, 0x13, 0x68, 0x73, - 0x78, 0x63, 0x42, 0xdd, 0x99, 0x15, 0x9a, 0xf4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe1, 0xad, 0x6d, 0xf6, 0x5e, 0xca, 0x20, 0x24, - 0xd7, 0x9d, 0x2f, 0x58, 0x97, 0xf7, 0xde, 0x31, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x51, 0xa3, 0x1c, 0xe2, 0x66, 0x24, 0x4b, 0xa1, - 0x56, 0x02, 0x32, 0xf4, 0x89, 0xf3, 0x86, 0x9a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x85, 0xda, 0x95, 0xa8, 0x7f, 0x6a, 0x77, 0x02, - 0x3a, 0xba, 0xe0, 0xbe, 0x34, 0x5c, 0x9a, 0x1a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t C3[] = { - 0xfb, 0x04, 0xe9, 0x1c, 0xc3, 0x56, 0x9c, 0xb0, - 0xba, 0xc4, 0x66, 0xa3, 0xba, 0x45, 0xac, 0xb8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd6, 0xd8, 0x95, 0x6c, 0x28, 0xd1, 0x51, 0x6d, - 0xaa, 0x8c, 0x2e, 0xf1, 0x34, 0xab, 0xeb, 0x66, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf9, 0x4e, 0x24, 0x61, 0x1d, 0x16, 0x99, 0xd5, - 0x10, 0x30, 0x42, 0x31, 0x68, 0x98, 0xc5, 0xdb, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x9f, 0x0a, 0x1a, 0x65, 0x7d, 0x03, 0x50, - 0xb8, 0x00, 0x0c, 0x40, 0x93, 0x6b, 0xa9, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x87, 0x01, 0x3c, 0xe9, 0xeb, 0x0e, 0x10, - 0x0f, 0x35, 0xbe, 0x9c, 0x6a, 0xfa, 0x00, 0xac, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x25, 0x77, 0x5d, 0x49, 0xde, 0xdc, 0xa1, 0x62, - 0xa7, 0xb7, 0x30, 0x75, 0x36, 0x32, 0x31, 0xab, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0xbb, 0x96, 0xba, 0x46, 0x32, 0x53, 0x8c, - 0x35, 0x7d, 0xa4, 0x21, 0xfa, 0x6a, 0xeb, 0x68, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe4, 0xa4, 0xbf, 0xac, 0x24, 0xbf, 0x59, 0x8e, - 0x98, 0xa6, 0x53, 0xca, 0xe3, 0x69, 0xdd, 0x47, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6e, 0x18, 0x94, 0xf0, 0x40, 0x03, 0x59, 0x93, - 0x96, 0xde, 0x57, 0x96, 0x00, 0xaf, 0x56, 0x88, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb5, 0x0d, 0x55, 0xbc, 0x24, 0xac, 0x11, 0xff, - 0x4d, 0x72, 0x82, 0xda, 0xf2, 0xee, 0xbc, 0x56, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x8a, 0x17, 0x24, 0x6b, 0x88, 0x7e, 0x9c, 0xdb, - 0x07, 0xdd, 0xd4, 0x12, 0x15, 0x4d, 0x9e, 0x1a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x12, 0x8d, 0x84, 0xdb, 0x17, 0x1a, 0x2f, - 0x7a, 0x3d, 0x4c, 0xbb, 0xc2, 0xb8, 0x73, 0xad, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x39, 0x13, 0xf8, 0x2e, 0xfc, 0xf9, 0x3b, 0x64, - 0x06, 0x9e, 0x78, 0x73, 0xff, 0x2b, 0x8c, 0x1b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4e, 0x21, 0x3e, 0x05, 0x4d, 0xee, 0x9d, 0x39, - 0x7c, 0x61, 0xe1, 0x18, 0x98, 0xe3, 0x50, 0x25, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf9, 0x48, 0x5e, 0x66, 0x9d, 0x41, 0xa2, 0x08, - 0x3f, 0x88, 0x28, 0x03, 0x68, 0x8a, 0xfc, 0xf4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7a, 0xf5, 0xcb, 0x7d, 0xeb, 0x9e, 0xb2, 0x22, - 0xbc, 0x1a, 0x94, 0x51, 0xa4, 0x7b, 0x9a, 0x2c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb3, 0x67, 0x60, 0x94, 0x06, 0x31, 0x80, 0xa0, - 0xf7, 0x7f, 0xe8, 0x47, 0x00, 0xab, 0x0b, 0x56, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x09, 0xa6, 0xa4, 0x77, 0x18, 0xa5, 0x30, 0x81, - 0xd9, 0x7e, 0x2d, 0x6a, 0x77, 0x34, 0x4e, 0xca, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x72, 0x0d, 0xb3, 0x31, 0x87, 0x9c, 0x98, 0xc9, - 0x48, 0x4c, 0xa0, 0x8d, 0xed, 0x9d, 0x7b, 0x9e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb4, 0xfe, 0x05, 0x7f, 0x93, 0x56, 0xa8, 0x2b, - 0x07, 0x0b, 0xc5, 0x52, 0x96, 0xd5, 0x6a, 0xe4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf6, 0x38, 0x79, 0x67, 0xd6, 0xfe, 0x8c, 0x0b, - 0x33, 0xe0, 0xe8, 0x15, 0xe7, 0x70, 0x3e, 0xca, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa7, 0x6a, 0xbb, 0x81, 0xf7, 0x94, 0x7f, 0x17, - 0xd6, 0x66, 0x96, 0xbf, 0x1c, 0x8f, 0x71, 0xb6, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9c, 0x5c, 0xe2, 0x61, 0x47, 0x7b, 0x6e, 0xa2, - 0x87, 0x17, 0x55, 0x08, 0x1d, 0x10, 0xb1, 0x34, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x21, 0x16, 0x70, 0x3d, 0x0d, 0x93, 0x68, - 0x5e, 0x46, 0x22, 0x45, 0x00, 0xdb, 0xf0, 0x9b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa1, 0x1f, 0xc7, 0x5b, 0x17, 0xe1, 0x95, 0x07, - 0x57, 0xe5, 0xae, 0x5a, 0x6d, 0x10, 0x83, 0xc4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0x0d, 0xf5, 0x73, 0xd3, 0xeb, 0x52, 0x29, - 0x33, 0x4f, 0xb0, 0xe7, 0x5c, 0xf6, 0xdb, 0xb5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x21, 0x6f, 0x35, 0x9a, 0x43, 0x9c, 0x86, 0xeb, - 0x11, 0x95, 0x91, 0x10, 0xa3, 0xbd, 0xe2, 0xe4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x69, 0xac, 0xb1, 0x50, 0xd4, 0xf1, 0x68, 0xe6, - 0x65, 0xb1, 0x96, 0xda, 0xfb, 0xf0, 0x13, 0x06, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa4, 0x63, 0xb6, 0xdb, 0x79, 0x2b, 0x3a, 0xc9, - 0x98, 0x7a, 0x2c, 0x37, 0xf9, 0x4f, 0xa6, 0x93, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9d, 0x3b, 0xb3, 0x06, 0x63, 0xe2, 0xf6, 0x92, - 0x07, 0xe2, 0x82, 0xfd, 0xb5, 0x08, 0x9b, 0x79, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x79, 0x78, 0x3b, 0xee, 0x28, 0x54, 0x81, 0x5d, - 0x7a, 0xa3, 0x81, 0x93, 0xa9, 0xc2, 0x59, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb3, 0xc5, 0xcd, 0x89, 0xa2, 0x31, 0xc2, 0xf0, - 0x84, 0x8c, 0x2e, 0x0a, 0xa4, 0x2f, 0x9c, 0xf2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x54, 0x56, 0xec, 0x75, 0x39, 0xd7, 0x92, 0x53, - 0x60, 0x58, 0xf8, 0x81, 0x84, 0x0c, 0x99, 0xc4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6f, 0x88, 0xf8, 0x6e, 0x6d, 0xd6, 0x08, 0x47, - 0x6a, 0xa4, 0x79, 0xbc, 0xeb, 0x1e, 0x67, 0xd7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdf, 0x0c, 0x52, 0xdc, 0x74, 0x40, 0x39, 0x17, - 0xdc, 0xd9, 0x13, 0x72, 0x58, 0xc5, 0x30, 0xda, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xad, 0x76, 0xa9, 0x9a, 0xad, 0xed, 0xfb, 0x4b, - 0x4e, 0x60, 0xde, 0xc9, 0x18, 0xa0, 0x77, 0x50, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x54, 0xfa, 0x00, 0xd6, 0xa9, 0x52, 0xfe, 0x67, - 0x3e, 0xe9, 0xdf, 0x46, 0x14, 0x6c, 0xfb, 0x50, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd6, 0x21, 0xf6, 0xe5, 0xf7, 0x99, 0x38, 0xad, - 0x65, 0xa5, 0x6c, 0x4e, 0x21, 0x31, 0x77, 0x7a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdc, 0x6f, 0x5d, 0xb5, 0x7f, 0x63, 0xf4, 0xa8, - 0xee, 0x0d, 0x68, 0x10, 0xde, 0x5b, 0x45, 0x4b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0xd8, 0x55, 0x04, 0x15, 0x6e, 0xc6, 0xb7, - 0xc1, 0x30, 0x29, 0x6a, 0x6c, 0x26, 0xe8, 0x41, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x53, 0xb9, 0x82, 0x67, 0x5b, 0xfe, 0xa9, 0x5f, - 0x0b, 0xf8, 0x38, 0xf8, 0xbe, 0x3c, 0x26, 0xf2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x83, 0x94, 0xd6, 0x45, 0x64, 0x1f, 0x17, 0x20, - 0x4d, 0xae, 0x4a, 0x15, 0x27, 0x7d, 0x7f, 0x3b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x71, 0x3c, 0x3a, 0xc3, 0x56, 0x1b, 0xe5, 0xbd, - 0x34, 0x4b, 0x3f, 0x88, 0x3e, 0xcc, 0x98, 0xb5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5e, 0x8b, 0xab, 0x18, 0x98, 0xf0, 0xef, 0x1b, - 0x78, 0x15, 0xb7, 0x4a, 0x1f, 0xe3, 0x45, 0xc7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x31, 0x34, 0x5a, 0x7b, 0x6e, 0xb8, 0xea, 0xfe, - 0xaf, 0x34, 0x32, 0x45, 0xfa, 0x3e, 0x75, 0x8a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x3f, 0xed, 0xe5, 0xfe, 0x66, 0x15, 0xc7, - 0xbe, 0xd9, 0xc7, 0x27, 0x3c, 0x26, 0x66, 0x2d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa1, 0x0b, 0xb9, 0x1e, 0x17, 0x44, 0xd3, 0x4b, - 0xe6, 0x30, 0x85, 0x9e, 0x29, 0x3d, 0xa9, 0x35, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xca, 0x61, 0xea, 0x22, 0x76, 0xdb, 0xce, 0x82, - 0xfe, 0x8b, 0xac, 0xd3, 0x09, 0x90, 0xad, 0xf2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x42, 0x45, 0x8b, 0xbd, 0xad, 0x34, 0x56, 0x67, - 0x3a, 0x81, 0x3d, 0x95, 0x37, 0x72, 0xe6, 0xcc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0xe7, 0x09, 0x84, 0x99, 0x8b, 0x1a, 0x68, - 0x5f, 0x4e, 0x00, 0x14, 0x3e, 0x94, 0xa7, 0x15, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xab, 0xdd, 0x01, 0x2f, 0x9d, 0x57, 0xce, 0x24, - 0x40, 0x97, 0x5e, 0x62, 0x7c, 0x4f, 0xe7, 0x1d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x53, 0x79, 0x05, 0x52, 0x5d, 0xc9, 0xc6, 0xe0, - 0x47, 0xc1, 0xb5, 0x7f, 0x47, 0x28, 0x7d, 0x0b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa8, 0x51, 0x27, 0xb9, 0x21, 0x97, 0x2d, 0x5b, - 0x03, 0x94, 0x30, 0x63, 0xa5, 0x02, 0x04, 0xf0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x53, 0x53, 0x23, 0xfa, 0x81, 0xd1, 0x31, 0x3b, - 0x63, 0x5d, 0x61, 0x3b, 0x44, 0x19, 0xb2, 0x24, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x15, 0x79, 0x54, 0xb0, 0x57, 0x8c, 0x17, 0x0d, - 0x36, 0xad, 0xa3, 0x08, 0x71, 0x60, 0x85, 0xc9, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5e, 0x7b, 0x55, 0x85, 0x8a, 0x90, 0x0b, 0x2c, - 0x2b, 0x9a, 0x5d, 0xb6, 0x0e, 0xb6, 0xa6, 0x1d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb1, 0xf5, 0xe1, 0xae, 0xf9, 0x94, 0xb6, 0x3d, - 0xd0, 0xad, 0x5b, 0xa7, 0x3a, 0x66, 0xd0, 0x31, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x45, 0xcc, 0xb7, 0x7f, 0xce, 0x0f, 0x07, 0x2e, - 0x64, 0x11, 0xe0, 0xcd, 0xac, 0xdb, 0x75, 0xb1, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5a, 0x4a, 0x5b, 0x15, 0x6a, 0xe2, 0x28, 0x8c, - 0x6d, 0xe5, 0x5a, 0x82, 0x62, 0xeb, 0xfc, 0xf5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9b, 0x67, 0xa0, 0x79, 0x75, 0x24, 0x2e, 0xd4, - 0x3b, 0x53, 0xd4, 0xec, 0x6b, 0x0f, 0x43, 0x22, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe3, 0xc3, 0x75, 0x83, 0x2d, 0x64, 0x5f, 0x8a, - 0x79, 0x49, 0x5f, 0x1a, 0x81, 0xeb, 0xd5, 0x47, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0xe7, 0xa8, 0x14, 0xd9, 0xcc, 0xb0, 0xa4, - 0xea, 0xfc, 0x12, 0x23, 0xb3, 0x1b, 0x7a, 0xac, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x6a, 0x86, 0x4c, 0x4b, 0x91, 0x13, 0xa3, - 0x52, 0x51, 0x69, 0xc8, 0xff, 0x52, 0x8f, 0x44, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* truncated vector 1 to test various buffer lengths */ - -/* Single encrypted block with trailing plaintext */ -static const uint8_t K4[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV4[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P4[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t C4[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 2 encrypted blocks with 8 trailing PT blocks */ -static const uint8_t K5[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV5[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P5[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t C5[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, - 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* Custom 5 block vector with no trailing PT */ -static const uint8_t K6[] = { - 0x5A, 0x2B, 0x4F, 0x1F, 0x4B, 0xAB, 0x08, 0xEA, - 0xAC, 0x78, 0xF7, 0x4B, 0xCA, 0x3B, 0x4F, 0xA9 -}; -static const uint8_t IV6[] = { - 0x84, 0x38, 0x02, 0x6B, 0x5E, 0xB6, 0xC5, 0xB5, - 0x8A, 0x9A, 0xF0, 0x20, 0x95, 0x7A, 0x46, 0x10 -}; -static const uint8_t P6[] = { - 0x0D, 0xBC, 0xE9, 0x8C, 0x31, 0x07, 0x59, 0x65, - 0x66, 0xCB, 0x4F, 0xA0, 0x5D, 0x6C, 0xF9, 0x63, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0xDA, 0xB3, 0x61, 0x42, 0xA6, 0x1F, 0x38, - 0x49, 0xA1, 0x55, 0x9B, 0xE1, 0xF6, 0xEE, 0xD9, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xCB, 0xD1, 0x42, 0x10, 0x13, 0x24, 0x80, 0xA7, - 0xA1, 0xD9, 0xEB, 0xFE, 0x3A, 0xD7, 0xEF, 0x48, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2E, 0x81, 0x48, 0x53, 0xEA, 0x35, 0x0C, 0x1A, - 0x29, 0xDD, 0xC3, 0xED, 0xC4, 0x71, 0x55, 0x97, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x29, 0x3B, 0xB9, 0x7A, 0x94, 0x26, 0xBA, 0x3A, - 0xA6, 0x64, 0x66, 0x1A, 0x11, 0x32, 0xB7, 0x6E -}; -static const uint8_t C6[] = { - 0xE5, 0xB9, 0xDB, 0x9D, 0x79, 0x53, 0x98, 0x92, - 0x56, 0x9A, 0x90, 0xD2, 0xEA, 0xC2, 0x37, 0xB9, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x39, 0xA2, 0x61, 0x08, 0xC4, 0x15, 0x47, 0x41, - 0x18, 0xF5, 0x73, 0x56, 0xEE, 0x36, 0x6F, 0xCC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7C, 0xE0, 0x4F, 0x0B, 0xCE, 0x32, 0xCF, 0x58, - 0x88, 0x95, 0x87, 0x8A, 0xF8, 0x00, 0xD3, 0x3D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xB0, 0xD3, 0x51, 0x1C, 0x1E, 0x58, 0x65, - 0x2D, 0x7C, 0x94, 0x70, 0xCF, 0x32, 0x0F, 0xB7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9F, 0x53, 0x3A, 0x47, 0x3B, 0x4D, 0x99, 0xEB, - 0x86, 0xD2, 0xCF, 0x6A, 0x6C, 0x50, 0x42, 0xE5 -}; - -/* Custom single block vector with no additional PT */ -static const uint8_t K7[] = { - 0x5A, 0x2B, 0x4F, 0x1F, 0x4B, 0xAB, 0x08, 0xEA, - 0xAC, 0x78, 0xF7, 0x4B, 0xCA, 0x3B, 0x4F, 0xA9 -}; -static const uint8_t IV7[] = { - 0x84, 0x38, 0x02, 0x6B, 0x5E, 0xB6, 0xC5, 0xB5, - 0x8A, 0x9A, 0xF0, 0x20, 0x95, 0x7A, 0x46, 0x10 -}; -static const uint8_t P7[] = { - 0xB2, 0x4C, 0x2D, 0x5C, 0xAF, 0x35, 0xCE, 0x96, - 0x76, 0xDE, 0x0F, 0xC7, 0x77, 0x87, 0x1F, 0x7D -}; -static const uint8_t C7[] = { - 0x15, 0xDA, 0xB3, 0xCF, 0x2D, 0xF2, 0x62, 0x0F, - 0x53, 0x66, 0xC8, 0x2E, 0x3B, 0x25, 0xA2, 0xD7 -}; - - -static const struct aes_vector aes_cbcs_1_9_vectors[] = { - {K1, IV1, P1, sizeof(P1), C1, sizeof(K1)}, - {K2, IV2, P2, sizeof(P2), C2, sizeof(K2)}, - {K3, IV3, P3, sizeof(P3), C3, sizeof(K3)}, - {K4, IV4, P4, sizeof(P4), C4, sizeof(K4)}, - {K5, IV5, P5, sizeof(P5), C5, sizeof(K5)}, - {K6, IV6, P6, sizeof(P6), C6, sizeof(K6)}, - {K7, IV7, P7, sizeof(P7), C7, sizeof(K7)}, -}; - -/* =================================================================== */ -/* =================================================================== */ +extern const struct cipher_test aes_cbcs_test_json[]; static int aes_job_ok(const struct IMB_JOB *job, @@ -3478,12 +87,12 @@ test_aes_many(struct IMB_MGR *mb_mgr, const void *iv, const uint8_t *in_text, const uint8_t *out_text, - const unsigned text_len, + const size_t text_len, const int dir, const int order, const IMB_CIPHER_MODE cipher, const int in_place, - const int key_len, + const size_t key_len, const int num_jobs) { struct IMB_JOB *job; @@ -3581,7 +190,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, if (job != NULL) { jobs_rx++; if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len, + sizeof(padding), (unsigned) text_len, (uint8_t *)&last_cipher_block, next_ivs[(uint64_t)job->user_data2])) goto end; @@ -3596,7 +205,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len, + sizeof(padding), (unsigned) text_len, (uint8_t *)&last_cipher_block, next_ivs[(uint64_t)job->user_data2])) goto end; @@ -3634,77 +243,64 @@ end_alloc: static void test_aes_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, - const int vec_cnt, - const struct aes_vector *vec_tab, const char *banner, const IMB_CIPHER_MODE cipher, const int num_jobs) { - int vect; + const struct cipher_test *v = aes_cbcs_test_json; DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_cnt; vect++) { + printf("AES-CBC Test (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector key_len:%d\n", - vect + 1, vec_cnt, - (int) vec_tab[vect].Klen); + printf("AES-CBC Test Case %zu key_len:%zu\n", + v->tcId, v->keySize); #else printf("."); #endif } - - IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, v->key, enc_keys, dec_keys); if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, + (const void *) v->iv, (const void *) v->msg, + (const void *) v->ct, v->msgSize / 8, IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt\n", vect + 1); + cipher, 0, v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, + (const void *) v->iv, (const void *) v->ct, + (const void *) v->msg, v->msgSize / 8, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt\n", vect + 1); + cipher, 0, v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, + (const void *) v->iv, (const void *) v->msg, + (const void *) v->ct, v->msgSize / 8, IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt in-place\n", vect + 1); + cipher, 1, v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, + (const void *) v->iv, (const void *) v->ct, + (const void *) v->msg, v->msgSize / 8, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt in-place\n", vect + 1); + cipher, 1, v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -3726,11 +322,8 @@ aes_cbcs_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx, "AES-CBCS-128"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_aes_vectors(mb_mgr, &ctx, - DIM(aes_cbcs_1_9_vectors), - aes_cbcs_1_9_vectors, - "AES CBC-S 1-9 test vectors", - IMB_CIPHER_CBCS_1_9, num_jobs_tab[i]); + test_aes_vectors(mb_mgr, &ctx, IMB_CIPHER_CBCS_1_9, + num_jobs_tab[i]); errors = test_suite_end(&ctx); return errors; diff --git a/test/kat-app/aes_cbcs_test.json.c b/test/kat-app/aes_cbcs_test.json.c new file mode 100644 index 00000000..8cea96d6 --- /dev/null +++ b/test/kat-app/aes_cbcs_test.json.c @@ -0,0 +1,1492 @@ +/* AES-CBC */ +#include "cipher_test.h" +const struct cipher_test aes_cbcs_test_json[] = { + /* + * Vectors from http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf + */ + {128, 128, 1, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x86" + "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\xbe\xd6\xb8" + "\xe3\xc1\x74\x3b\x71\x16\xe6\x9e\x22\x22\x95\x16\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf1\xca\xa1\x68\x1f" + "\xac\x09\x12\x0e\xca\x30\x75\x86\xe1\xa7\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 5120}, + {128, 128, 2, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x47" + "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x91\x17\x8d" + "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x40\xe9\x37\xb0\xd6" + "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" + "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" + "\x28\x1f\x3a\x9c\x18\x7d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" + "\xcf\x21\xa0\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" + "\x33\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00", + "\xf0\x8f\x91\x13\x11\x01\xdc\xbb\xcd\xf9\x95\x92\xda\xbf\x2a\x86\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xea\x8d" + "\xa6\x08\xc8\xb5\x65\x82\x93\x43\xb7\x0e\x14\x36\xb4\xcf\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\x11\xab\x21" + "\x5b\x64\xb8\xc5\xee\x27\x93\x66\x59\xd9\x1d\xc9\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x84\x9d\x03\xbd\xab\xce" + "\x6a\x14\x76\x73\x17\xe3\xb3\xe5\x70\xe8\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xa8\xce\xb0\xf6\xc4\xc5\xb5" + "\x8e\x22\xef\x33\xdf\x18\x42\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x56\xc4\xb9\x7f\x60\x9e\x8b\x45\xc1\xbf" + "\xa7\xfa\x1b\x3e\x02\x5d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xb3\x04\x93\x30\xf5\xff\x8e\xb6\x0a\xfb\x41\xfe" + "\x09\xa5\x90\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x22\xab\xaa\x22\x89\xd8\x3c\x4e\x46\x18\x93\xbf\x1a\xce" + "\x77\x59\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00", + 1, 10240}, + {128, 128, 3, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x65" + "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\x4e\xe9\xeb" + "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\x2c\x73\x23\xea\x45" + "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x92\x82\xd8\x0f\xa9\x36\x23" + "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" + "\x86\x8c\xbd\xdc\x6b\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" + "\x0a\x8d\x1e\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" + "\xb6\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x95" + "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5a\x53\xc3\xdc" + "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\x1f\xa7\x9c\x64\xfd" + "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x99\xa4\x12\x6e\x4e\xea\x0b" + "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" + "\x09\xff\xaa\x17\x5d\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" + "\x33\x58\x7e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" + "\x81\xd0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x97\x9c" + "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\xe7\xcd\x8a" + "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc9\x2c\xb7\x75\xa8\xf6" + "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x33\x73\xaf\xde\xcb\x37\x0a\x50" + "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" + "\xd8\xb0\x84\x26\x6b\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" + "\x1a\xd2\xd6\x3a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" + "\x9f\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\xb3" + "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\xa1\x62\x8c" + "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x46\xa0\xc5\x45\x5c" + "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe2\x04\x30\x63\x22\x87\xb6\xc7" + "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" + "\x35\xa1\x5d\x17\x48\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" + "\xab\xde\xe1\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" + "\x0e\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\xa2" + "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\xb9\xc9\xf6" + "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7a\xce\xfd\x3c\x16\xff" + "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" + "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" + "\xb5\xed\xb7\xa2\x54\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" + "\xbd\xbf\x3a\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" + "\x19\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x4a" + "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x06\x98\x32" + "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\xf3\xc0\xc7\x64\xee" + "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" + "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" + "\x50\x5d\xc4\xb3\x3d\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" + "\xc2\x8e\xea\xbe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" + "\x04\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6f\xe4" + "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x28\x4d\x7c" + "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf2\xd5\x36\x4a\x54\xe8" + "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\xd1\x20\x93\x31\x89\xff\xed" + "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" + "\x42\xdd\x99\x15\x9a\xf4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" + "\x97\xf7\xde\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" + "\x86\x9a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfb\x04\xe9\x1c\xc3\x56\x9c\xb0\xba\xc4\x66\xa3\xba\x45\xac\xb8\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd6\xd8" + "\x95\x6c\x28\xd1\x51\x6d\xaa\x8c\x2e\xf1\x34\xab\xeb\x66\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x4e\x24\x61" + "\x1d\x16\x99\xd5\x10\x30\x42\x31\x68\x98\xc5\xdb\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x9f\x0a\x1a\x65\x7d" + "\x03\x50\xb8\x00\x0c\x40\x93\x6b\xa9\x1f\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x87\x01\x3c\xe9\xeb\x0e\x10" + "\x0f\x35\xbe\x9c\x6a\xfa\x00\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x25\x77\x5d\x49\xde\xdc\xa1\x62\xa7\xb7" + "\x30\x75\x36\x32\x31\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x40\xbb\x96\xba\x46\x32\x53\x8c\x35\x7d\xa4\x21" + "\xfa\x6a\xeb\x68\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xe4\xa4\xbf\xac\x24\xbf\x59\x8e\x98\xa6\x53\xca\xe3\x69" + "\xdd\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x6e\x18\x94\xf0\x40\x03\x59\x93\x96\xde\x57\x96\x00\xaf\x56\x88" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xb5\x0d\x55\xbc\x24\xac\x11\xff\x4d\x72\x82\xda\xf2\xee\xbc\x56\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8a\x17" + "\x24\x6b\x88\x7e\x9c\xdb\x07\xdd\xd4\x12\x15\x4d\x9e\x1a\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x57\x12\x8d\x84" + "\xdb\x17\x1a\x2f\x7a\x3d\x4c\xbb\xc2\xb8\x73\xad\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\x13\xf8\x2e\xfc\xf9" + "\x3b\x64\x06\x9e\x78\x73\xff\x2b\x8c\x1b\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4e\x21\x3e\x05\x4d\xee\x9d\x39" + "\x7c\x61\xe1\x18\x98\xe3\x50\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x48\x5e\x66\x9d\x41\xa2\x08\x3f\x88" + "\x28\x03\x68\x8a\xfc\xf4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x7a\xf5\xcb\x7d\xeb\x9e\xb2\x22\xbc\x1a\x94\x51" + "\xa4\x7b\x9a\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xb3\x67\x60\x94\x06\x31\x80\xa0\xf7\x7f\xe8\x47\x00\xab" + "\x0b\x56\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x09\xa6\xa4\x77\x18\xa5\x30\x81\xd9\x7e\x2d\x6a\x77\x34\x4e\xca" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x72\x0d\xb3\x31\x87\x9c\x98\xc9\x48\x4c\xa0\x8d\xed\x9d\x7b\x9e\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\xfe" + "\x05\x7f\x93\x56\xa8\x2b\x07\x0b\xc5\x52\x96\xd5\x6a\xe4\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x38\x79\x67" + "\xd6\xfe\x8c\x0b\x33\xe0\xe8\x15\xe7\x70\x3e\xca\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa7\x6a\xbb\x81\xf7\x94" + "\x7f\x17\xd6\x66\x96\xbf\x1c\x8f\x71\xb6\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x5c\xe2\x61\x47\x7b\x6e\xa2" + "\x87\x17\x55\x08\x1d\x10\xb1\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x21\x16\x70\x3d\x0d\x93\x68\x5e\x46" + "\x22\x45\x00\xdb\xf0\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xa1\x1f\xc7\x5b\x17\xe1\x95\x07\x57\xe5\xae\x5a" + "\x6d\x10\x83\xc4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x1c\x0d\xf5\x73\xd3\xeb\x52\x29\x33\x4f\xb0\xe7\x5c\xf6" + "\xdb\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x21\x6f\x35\x9a\x43\x9c\x86\xeb\x11\x95\x91\x10\xa3\xbd\xe2\xe4" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x69\xac\xb1\x50\xd4\xf1\x68\xe6\x65\xb1\x96\xda\xfb\xf0\x13\x06\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x63" + "\xb6\xdb\x79\x2b\x3a\xc9\x98\x7a\x2c\x37\xf9\x4f\xa6\x93\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x3b\xb3\x06" + "\x63\xe2\xf6\x92\x07\xe2\x82\xfd\xb5\x08\x9b\x79\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x79\x78\x3b\xee\x28\x54" + "\x81\x5d\x7a\xa3\x81\x93\xa9\xc2\x59\x3f\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb3\xc5\xcd\x89\xa2\x31\xc2\xf0" + "\x84\x8c\x2e\x0a\xa4\x2f\x9c\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x54\x56\xec\x75\x39\xd7\x92\x53\x60\x58" + "\xf8\x81\x84\x0c\x99\xc4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x6f\x88\xf8\x6e\x6d\xd6\x08\x47\x6a\xa4\x79\xbc" + "\xeb\x1e\x67\xd7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xdf\x0c\x52\xdc\x74\x40\x39\x17\xdc\xd9\x13\x72\x58\xc5" + "\x30\xda\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xad\x76\xa9\x9a\xad\xed\xfb\x4b\x4e\x60\xde\xc9\x18\xa0\x77\x50" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x54\xfa\x00\xd6\xa9\x52\xfe\x67\x3e\xe9\xdf\x46\x14\x6c\xfb\x50\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd6\x21" + "\xf6\xe5\xf7\x99\x38\xad\x65\xa5\x6c\x4e\x21\x31\x77\x7a\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdc\x6f\x5d\xb5" + "\x7f\x63\xf4\xa8\xee\x0d\x68\x10\xde\x5b\x45\x4b\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xd8\x55\x04\x15\x6e" + "\xc6\xb7\xc1\x30\x29\x6a\x6c\x26\xe8\x41\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\xb9\x82\x67\x5b\xfe\xa9\x5f" + "\x0b\xf8\x38\xf8\xbe\x3c\x26\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x83\x94\xd6\x45\x64\x1f\x17\x20\x4d\xae" + "\x4a\x15\x27\x7d\x7f\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x71\x3c\x3a\xc3\x56\x1b\xe5\xbd\x34\x4b\x3f\x88" + "\x3e\xcc\x98\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x5e\x8b\xab\x18\x98\xf0\xef\x1b\x78\x15\xb7\x4a\x1f\xe3" + "\x45\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x31\x34\x5a\x7b\x6e\xb8\xea\xfe\xaf\x34\x32\x45\xfa\x3e\x75\x8a" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x30\x3f\xed\xe5\xfe\x66\x15\xc7\xbe\xd9\xc7\x27\x3c\x26\x66\x2d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa1\x0b" + "\xb9\x1e\x17\x44\xd3\x4b\xe6\x30\x85\x9e\x29\x3d\xa9\x35\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\x61\xea\x22" + "\x76\xdb\xce\x82\xfe\x8b\xac\xd3\x09\x90\xad\xf2\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x42\x45\x8b\xbd\xad\x34" + "\x56\x67\x3a\x81\x3d\x95\x37\x72\xe6\xcc\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\xe7\x09\x84\x99\x8b\x1a\x68" + "\x5f\x4e\x00\x14\x3e\x94\xa7\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xab\xdd\x01\x2f\x9d\x57\xce\x24\x40\x97" + "\x5e\x62\x7c\x4f\xe7\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x53\x79\x05\x52\x5d\xc9\xc6\xe0\x47\xc1\xb5\x7f" + "\x47\x28\x7d\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xa8\x51\x27\xb9\x21\x97\x2d\x5b\x03\x94\x30\x63\xa5\x02" + "\x04\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x53\x53\x23\xfa\x81\xd1\x31\x3b\x63\x5d\x61\x3b\x44\x19\xb2\x24" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x15\x79\x54\xb0\x57\x8c\x17\x0d\x36\xad\xa3\x08\x71\x60\x85\xc9\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x7b" + "\x55\x85\x8a\x90\x0b\x2c\x2b\x9a\x5d\xb6\x0e\xb6\xa6\x1d\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb1\xf5\xe1\xae" + "\xf9\x94\xb6\x3d\xd0\xad\x5b\xa7\x3a\x66\xd0\x31\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\xcc\xb7\x7f\xce\x0f" + "\x07\x2e\x64\x11\xe0\xcd\xac\xdb\x75\xb1\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5a\x4a\x5b\x15\x6a\xe2\x28\x8c" + "\x6d\xe5\x5a\x82\x62\xeb\xfc\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x67\xa0\x79\x75\x24\x2e\xd4\x3b\x53" + "\xd4\xec\x6b\x0f\x43\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xe3\xc3\x75\x83\x2d\x64\x5f\x8a\x79\x49\x5f\x1a" + "\x81\xeb\xd5\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xc9\xe7\xa8\x14\xd9\xcc\xb0\xa4\xea\xfc\x12\x23\xb3\x1b" + "\x7a\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x0f\x6a\x86\x4c\x4b\x91\x13\xa3\x52\x51\x69\xc8\xff\x52\x8f\x44" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 80640}, + {128, 128, 4, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 640}, + {128, 128, 5, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x86" + "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 2432}, + {128, 128, 6, + "\x5a\x2b\x4f\x1f\x4b\xab\x08\xea\xac\x78\xf7\x4b\xca\x3b\x4f\xa9", + "\x84\x38\x02\x6b\x5e\xb6\xc5\xb5\x8a\x9a\xf0\x20\x95\x7a\x46\x10", + "\x0d\xbc\xe9\x8c\x31\x07\x59\x65\x66\xcb\x4f\xa0\x5d\x6c\xf9\x63\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xda" + "\xb3\x61\x42\xa6\x1f\x38\x49\xa1\x55\x9b\xe1\xf6\xee\xd9\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcb\xd1\x42\x10" + "\x13\x24\x80\xa7\xa1\xd9\xeb\xfe\x3a\xd7\xef\x48\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2e\x81\x48\x53\xea\x35" + "\x0c\x1a\x29\xdd\xc3\xed\xc4\x71\x55\x97\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x3b\xb9\x7a\x94\x26\xba\x3a" + "\xa6\x64\x66\x1a\x11\x32\xb7\x6e", + "\xe5\xb9\xdb\x9d\x79\x53\x98\x92\x56\x9a\x90\xd2\xea\xc2\x37\xb9\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\xa2" + "\x61\x08\xc4\x15\x47\x41\x18\xf5\x73\x56\xee\x36\x6f\xcc\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\xe0\x4f\x0b" + "\xce\x32\xcf\x58\x88\x95\x87\x8a\xf8\x00\xd3\x3d\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xb0\xd3\x51\x1c\x1e" + "\x58\x65\x2d\x7c\x94\x70\xcf\x32\x0f\xb7\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9f\x53\x3a\x47\x3b\x4d\x99\xeb" + "\x86\xd2\xcf\x6a\x6c\x50\x42\xe5", + 1, 5248}, + {128, 128, 7, + "\x5a\x2b\x4f\x1f\x4b\xab\x08\xea\xac\x78\xf7\x4b\xca\x3b\x4f\xa9", + "\x84\x38\x02\x6b\x5e\xb6\xc5\xb5\x8a\x9a\xf0\x20\x95\x7a\x46\x10", + "\xb2\x4c\x2d\x5c\xaf\x35\xce\x96\x76\xde\x0f\xc7\x77\x87\x1f\x7d", + "\x15\xda\xb3\xcf\x2d\xf2\x62\x0f\x53\x66\xc8\x2e\x3b\x25\xa2\xd7", + 1, 128}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 0fcedb30..d7c7a8b5 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cbcs_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 552a868eefc3ca740971ea6d9a3992719e0faaef Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Fri, 16 Jun 2023 10:31:11 +0100 Subject: [PATCH 004/204] test: [CBC] Unify test vectors --- test/kat-app/CMakeLists.txt | 2 + test/kat-app/Makefile | 3 +- test/kat-app/aes_cbc_test.c | 630 +++++++++++++++++++++++++ test/kat-app/aes_cbc_test.json.c | 269 +++++++++++ test/kat-app/aes_cbcs_test.c | 5 +- test/kat-app/aes_cbcs_test.json.c | 29 +- test/kat-app/aes_test.c | 741 ------------------------------ test/kat-app/main.c | 6 + test/kat-app/win_x64.mak | 2 +- 9 files changed, 940 insertions(+), 747 deletions(-) create mode 100644 test/kat-app/aes_cbc_test.c create mode 100644 test/kat-app/aes_cbc_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 2a92e77f..5703550e 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -85,6 +85,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/quic_ecb_test.c ${CMAKE_CURRENT_SOURCE_DIR}/gmac_test.c ${CMAKE_CURRENT_SOURCE_DIR}/ghash_test.c + ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.c ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha1.json.c ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha224.json.c ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256.json.c @@ -98,6 +99,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/xcbc_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/sha_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbcs_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index f8e5e792..d026aa5f 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -40,7 +40,8 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ chacha20_poly1305_test.c null_test.c snow_v_test.c direct_api_param_test.c quic_ecb_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ - cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c + cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c \ + aes_cbc_test.c aes_cbc_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/aes_cbc_test.c b/test/kat-app/aes_cbc_test.c new file mode 100644 index 00000000..562d80da --- /dev/null +++ b/test/kat-app/aes_cbc_test.c @@ -0,0 +1,630 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include +#include +#include +#include +#include + +#include + +#include "utils.h" +#include "cipher_test.h" + +#define MAX_BURST_JOBS 64 + +int cbc_test(struct IMB_MGR *mb_mgr); + +extern const struct cipher_test cbc_test_json[]; + +static int +aes_job_ok(const struct IMB_JOB *job, + const uint8_t *out_text, + const uint8_t *target, + const uint8_t *padding, + const size_t sizeof_padding, + const unsigned text_len) +{ + const int num = (const int)((uint64_t)job->user_data2); + + if (job->status != IMB_STATUS_COMPLETED) { + printf("%d error status:%d, job %d", + __LINE__, job->status, num); + return 0; + } + if (memcmp(out_text, target + sizeof_padding, + text_len)) { + printf("%d mismatched\n", num); + return 0; + } + if (memcmp(padding, target, sizeof_padding)) { + printf("%d overwrite head\n", num); + return 0; + } + if (memcmp(padding, + target + sizeof_padding + text_len, + sizeof_padding)) { + printf("%d overwrite tail\n", num); + return 0; + } + return 1; +} + +static int +test_aes_many(struct IMB_MGR *mb_mgr, + void *enc_keys, + void *dec_keys, + const void *iv, + const uint8_t *in_text, + const uint8_t *out_text, + const unsigned text_len, + const int dir, + const int order, + const IMB_CIPHER_MODE cipher, + const int in_place, + const int key_len, + const int num_jobs) +{ + struct IMB_JOB *job; + uint8_t padding[16]; + uint8_t **targets = malloc(num_jobs * sizeof(void *)); + int i, err, jobs_rx = 0, ret = -1; + + if (targets == NULL) + goto end_alloc; + + memset(targets, 0, num_jobs * sizeof(void *)); + memset(padding, -1, sizeof(padding)); + + for (i = 0; i < num_jobs; i++) { + targets[i] = malloc(text_len + (sizeof(padding) * 2)); + if (targets[i] == NULL) + goto end_alloc; + memset(targets[i], -1, text_len + (sizeof(padding) * 2)); + if (in_place) { + /* copy input text to the allocated buffer */ + memcpy(targets[i] + sizeof(padding), in_text, text_len); + } + } + + /* flush the scheduler */ + while (IMB_FLUSH_JOB(mb_mgr) != NULL) + ; + + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(mb_mgr); + job->cipher_direction = dir; + job->chain_order = order; + if (!in_place) { + job->dst = targets[i] + sizeof(padding); + job->src = in_text; + } else { + job->dst = targets[i] + sizeof(padding); + job->src = targets[i] + sizeof(padding); + } + job->cipher_mode = cipher; + job->enc_keys = enc_keys; + job->dec_keys = dec_keys; + job->key_len_in_bytes = key_len; + + job->iv = iv; + job->iv_len_in_bytes = 16; + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = text_len; + job->user_data = targets[i]; + job->user_data2 = (void *)((uint64_t)i); + + job->hash_alg = IMB_AUTH_NULL; + + job = IMB_SUBMIT_JOB(mb_mgr); + if (job == NULL) { + /* no job returned - check for error */ + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + } else { + /* got job back */ + jobs_rx++; + if (!aes_job_ok(job, out_text, job->user_data, padding, + sizeof(padding), text_len)) + goto end; + } + } + + while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + + jobs_rx++; + if (!aes_job_ok(job, out_text, job->user_data, padding, + sizeof(padding), text_len)) + goto end; + } + + if (jobs_rx != num_jobs) { + printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); + goto end; + } + ret = 0; + + end: + while (IMB_FLUSH_JOB(mb_mgr) != NULL) { + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + } + +end_alloc: + if (targets != NULL) { + for (i = 0; i < num_jobs; i++) + free(targets[i]); + free(targets); + } + + return ret; +} + +static int +test_aes_many_burst(struct IMB_MGR *mb_mgr, + void *enc_keys, + void *dec_keys, + const void *iv, + const uint8_t *in_text, + const uint8_t *out_text, + const unsigned text_len, + const int dir, + const int order, + const IMB_CIPHER_MODE cipher, + const int in_place, + const int key_len, + const int num_jobs) +{ + struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = {NULL}; + uint8_t padding[16]; + uint8_t **targets = malloc(num_jobs * sizeof(void *)); + int i, completed_jobs, jobs_rx = 0, ret = -1; + + if (targets == NULL) + goto end_alloc; + + memset(targets, 0, num_jobs * sizeof(void *)); + memset(padding, -1, sizeof(padding)); + + for (i = 0; i < num_jobs; i++) { + targets[i] = malloc(text_len + (sizeof(padding) * 2)); + if (targets[i] == NULL) + goto end_alloc; + memset(targets[i], -1, text_len + (sizeof(padding) * 2)); + if (in_place) { + /* copy input text to the allocated buffer */ + memcpy(targets[i] + sizeof(padding), in_text, text_len); + } + } + + while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < (uint32_t)num_jobs) + IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); + + for (i = 0; i < num_jobs; i++) { + job = jobs[i]; + + job->cipher_direction = dir; + job->chain_order = order; + job->key_len_in_bytes = key_len; + job->cipher_mode = cipher; + job->hash_alg = IMB_AUTH_NULL; + + if (!in_place) { + job->dst = targets[i] + sizeof(padding); + job->src = in_text; + } else { + job->dst = targets[i] + sizeof(padding); + job->src = targets[i] + sizeof(padding); + } + + job->enc_keys = enc_keys; + job->dec_keys = dec_keys; + job->iv = iv; + job->iv_len_in_bytes = 16; + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = text_len; + job->user_data = targets[i]; + job->user_data2 = (void *)((uint64_t)i); + + imb_set_session(mb_mgr, job); + } + + completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, jobs); + if (completed_jobs == 0) { + int err = imb_get_errno(mb_mgr); + + if (err != 0) { + printf("submit_burst error %d : '%s'\n", err, + imb_get_strerror(err)); + goto end; + } + } + +check_burst_jobs: + for (i = 0; i < completed_jobs; i++) { + job = jobs[i]; + + if (job->status != IMB_STATUS_COMPLETED) { + printf("job %d status not complete!\n", i+1); + goto end; + } + + if (!aes_job_ok(job, out_text, job->user_data, padding, + sizeof(padding), text_len)) + goto end; + jobs_rx++; + } + + if (jobs_rx != num_jobs) { + completed_jobs = IMB_FLUSH_BURST(mb_mgr, + num_jobs - completed_jobs, + jobs); + if (completed_jobs == 0) { + printf("Expected %d jobs, received %d\n", + num_jobs, jobs_rx); + goto end; + } + goto check_burst_jobs; + } + ret = 0; + + end: + + end_alloc: + if (targets != NULL) { + for (i = 0; i < num_jobs; i++) + free(targets[i]); + free(targets); + } + + return ret; +} + + +static int +test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, + void *enc_keys, + void *dec_keys, + const void *iv, + const uint8_t *in_text, + const uint8_t *out_text, + const unsigned text_len, + const int dir, + const IMB_CIPHER_MODE cipher, + const int in_place, + const int key_len, + const int num_jobs) +{ + struct IMB_JOB *job, jobs[MAX_BURST_JOBS]; + uint8_t padding[16]; + uint8_t **targets = malloc(num_jobs * sizeof(void *)); + int i, completed_jobs, jobs_rx = 0, ret = -1; + + if (targets == NULL) + goto end_alloc; + + memset(targets, 0, num_jobs * sizeof(void *)); + memset(padding, -1, sizeof(padding)); + + for (i = 0; i < num_jobs; i++) { + targets[i] = malloc(text_len + (sizeof(padding) * 2)); + if (targets[i] == NULL) + goto end_alloc; + memset(targets[i], -1, text_len + (sizeof(padding) * 2)); + if (in_place) { + /* copy input text to the allocated buffer */ + memcpy(targets[i] + sizeof(padding), in_text, text_len); + } + } + + for (i = 0; i < num_jobs; i++) { + job = &jobs[i]; + + /* only set fields for generic burst API */ + if (!in_place) { + job->dst = targets[i] + sizeof(padding); + job->src = in_text; + } else { + job->dst = targets[i] + sizeof(padding); + job->src = targets[i] + sizeof(padding); + } + + job->enc_keys = enc_keys; + job->dec_keys = dec_keys; + job->iv = iv; + job->iv_len_in_bytes = 16; + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = text_len; + job->user_data = targets[i]; + job->user_data2 = (void *)((uint64_t)i); + } + + completed_jobs = IMB_SUBMIT_CIPHER_BURST(mb_mgr, jobs, num_jobs, + cipher, dir, key_len); + if (completed_jobs != num_jobs) { + int err = imb_get_errno(mb_mgr); + + if (err != 0) { + printf("submit_burst error %d : '%s'\n", err, + imb_get_strerror(err)); + goto end; + } else { + printf("submit_burst error: not enough " + "jobs returned!\n"); + goto end; + } + } + + for (i = 0; i < num_jobs; i++) { + job = &jobs[i]; + + if (job->status != IMB_STATUS_COMPLETED) { + printf("job %d status not complete!\n", i+1); + goto end; + } + + if (!aes_job_ok(job, out_text, job->user_data, padding, + sizeof(padding), text_len)) + goto end; + jobs_rx++; + } + + if (jobs_rx != num_jobs) { + printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); + goto end; + } + ret = 0; + + end: + + end_alloc: + if (targets != NULL) { + for (i = 0; i < num_jobs; i++) + free(targets[i]); + free(targets); + } + + return ret; +} + +static void +test_cbc_vectors(struct IMB_MGR *mb_mgr, + struct test_suite_context *ctx128, + struct test_suite_context *ctx192, + struct test_suite_context *ctx256, + const IMB_CIPHER_MODE cipher, const int num_jobs) +{ + const struct cipher_test *v = cbc_test_json; + DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + + if (!quiet_mode) + printf("CBC Test (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { + struct test_suite_context *ctx; + + if (!quiet_mode) { +#ifdef DEBUG + printf("AES-CBC Test Case %zu key_len:%zu\n", + v->tcId, v->keySize); +#else + printf("."); +#endif + } + + switch (v->keySize / 8) { + case 16: + IMB_AES_KEYEXP_128(mb_mgr, v->key, enc_keys, + dec_keys); + ctx = ctx128; + break; + case 24: + IMB_AES_KEYEXP_192(mb_mgr, v->key, enc_keys, + dec_keys); + ctx = ctx192; + break; + case 32: + default: + IMB_AES_KEYEXP_256(mb_mgr, v->key, enc_keys, + dec_keys); + ctx = ctx256; + break; + } + + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, + cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, + cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt burst\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, + cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, + cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt burst\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, + cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, + cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt burst in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, + cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, + cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt burst in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, cipher, 0, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt cipher burst\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, cipher, 0, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt cipher burst\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, cipher, 1, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt cipher burst in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, cipher, 1, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt cipher burst in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + } + if (!quiet_mode) + printf("\n"); +} + +int +cbc_test(struct IMB_MGR *mb_mgr) +{ + const int num_jobs_tab[] = { + 1, 3, 4, 5, 7, 8, 9, 15, 16, 17, MAX_BURST_JOBS + }; + unsigned i; + int errors = 0; + struct test_suite_context ctx128; + struct test_suite_context ctx192; + struct test_suite_context ctx256; + + test_suite_start(&ctx128, "AES-CBC-128"); + test_suite_start(&ctx192, "AES-CBC-192"); + test_suite_start(&ctx256, "AES-CBC-256"); + for (i = 0; i < DIM(num_jobs_tab); i++) + test_cbc_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, + IMB_CIPHER_CBC, + num_jobs_tab[i]); + errors += test_suite_end(&ctx128); + errors += test_suite_end(&ctx192); + errors += test_suite_end(&ctx256); + + return errors; +} diff --git a/test/kat-app/aes_cbc_test.json.c b/test/kat-app/aes_cbc_test.json.c new file mode 100644 index 00000000..90d56f6b --- /dev/null +++ b/test/kat-app/aes_cbc_test.json.c @@ -0,0 +1,269 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* CBC */ +#include "cipher_test.h" +const struct cipher_test cbc_test_json[] = { + /* Vectors from http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ + {128, 128, 1, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x50\x86" + "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x73\xbe\xd6\xb8" + "\xe3\xc1\x74\x3b\x71\x16\xe6\x9e\x22\x22\x95\x16\x3f\xf1\xca\xa1\x68\x1f" + "\xac\x09\x12\x0e\xca\x30\x75\x86\xe1\xa7", + 1, 512}, + {128, 192, 2, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d\x71\x78\x18\x3a\x9f\xa0\x71\xe8\xb4\xd9" + "\xad\xa9\xad\x7d\xed\xf4\xe5\xe7\x38\x76\x3f\x69\x14\x5a\x57\x1b\x24\x20" + "\x12\xfb\x7a\xe0\x7f\xa9\xba\xac\x3d\xf1\x02\xe0\x08\xb0\xe2\x79\x88\x59" + "\x88\x81\xd9\x20\xa9\xe6\x4f\x56\x15\xcd", + 1, 512}, + {128, 256, 3, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6\x9c\xfc" + "\x4e\x96\x7e\xdb\x80\x8d\x67\x9f\x77\x7b\xc6\x70\x2c\x7d\x39\xf2\x33\x69" + "\xa9\xd9\xba\xcf\xa5\x30\xe2\x63\x04\x23\x14\x61\xb2\xeb\x05\xe2\xc3\x9b" + "\xe9\xfc\xda\x6c\x19\x07\x8c\x6a\x9d\x1b", + 1, 512}, + {128, 128, 4, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\xfc\x47" + "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\xba\x91\x17\x8d" + "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x80\x40\xe9\x37\xb0\xd6" + "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" + "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" + "\x28\x1f\x3a\x9c\x18\x7d\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" + "\xcf\x21\xa0\x1e\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" + "\x33\x90", + "\xf0\x8f\x91\x13\x11\x01\xdc\xbb\xcd\xf9\x95\x92\xda\xbf\x2a\x86\xea\x8d" + "\xa6\x08\xc8\xb5\x65\x82\x93\x43\xb7\x0e\x14\x36\xb4\xcf\xd8\x11\xab\x21" + "\x5b\x64\xb8\xc5\xee\x27\x93\x66\x59\xd9\x1d\xc9\x84\x9d\x03\xbd\xab\xce" + "\x6a\x14\x76\x73\x17\xe3\xb3\xe5\x70\xe8\xa2\xa8\xce\xb0\xf6\xc4\xc5\xb5" + "\x8e\x22\xef\x33\xdf\x18\x42\x40\x56\xc4\xb9\x7f\x60\x9e\x8b\x45\xc1\xbf" + "\xa7\xfa\x1b\x3e\x02\x5d\xb3\x04\x93\x30\xf5\xff\x8e\xb6\x0a\xfb\x41\xfe" + "\x09\xa5\x90\xc7\x22\xab\xaa\x22\x89\xd8\x3c\x4e\x46\x18\x93\xbf\x1a\xce" + "\x77\x59", + 1, 1024}, + {128, 192, 5, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x19\x08\xa3\x58\x17\x14\x70\x5a\xb8\xab\x4f\x5f\xa4\x25\x2b\xec\xb6\x74" + "\x0b\x9d\x56\x3b\xaf\xa3\xa4\x2d\x3e\x1f\x18\x84\x3b\x4f\x48\xd9\xa3\xfe" + "\x59\x1e\x80\x67\x44\x35\x26\x00\x78\xda\x68\xfa\x61\x9c\xd8\x8e\x5c\xc1" + "\xff\xeb\x9c\x7d\xe7\xa9\x38\xeb\x66\xf8\x6a\x46\x71\x51\x02\xba\x8d\x70" + "\x55\x5b\x60\xc6\x4c\xae\xda\x2e\x17\xbb\x65\xef\x60\x85\x9e\x77\xe5\x83" + "\xef\x30\x08\x3a\xba\x80\x28\xc0\xa1\x93\x4c\x2a\x0b\xe1\xcb\xd0\xac\x72" + "\x72\x1d\x96\x76\x0e\xc0\xec\x7d\x84\xfd\xee\x08\xa1\x11\x20\x0d\x59\x5c" + "\x06\x3f\xa3\xf1\xd7\xa3\x1d\x29\xc3\xaa\x05\x2b\x74\x8c\x73\x60\x65\x43" + "\x76\xd4\xd7\x7b\x5f\x40\xf4\x77\xe1\xcc\x85\x37\x1c\xd8\xda\x91\xf0\x40" + "\xb2\x43\x2d\x87\x51\xd0\xce\x27\xa6\x60\xac\x67\xea\x8b\xae\x46\x2e\x78" + "\x06\x09\x8a\x82\xb0\x0d\x57\x56\x82\xfe\x89\xd2", + "\xfa\x88\xb3\x4e\x7f\x3e\x78\x4d\xfd\xb3\x38\xee\xb0\xdd\x0d\xf5\xeb\x24" + "\xe6\x70\xd8\xac\xd7\xfa\x41\x67\x2e\x2d\x7e\x9b\x26\xac\xf1\x0f\x1f\x47" + "\x6d\xff\x46\xd1\x1a\xeb\xe9\x3c\x1b\x9d\x55\x86\xde\xee\x3d\xd8\x12\x05" + "\x12\x9d\xff\x23\x97\x57\xb0\xdc\x7b\x7a\xdf\xba\x7f\x69\x85\xdf\xa9\xfd" + "\x3e\xa7\x36\x26\x30\xdd\x07\x0f\x89\x0b\x27\x9c\x23\xa1\xfa\x7d\x4e\x64" + "\x50\x07\x86\x13\x98\xee\x05\xc6\x6c\xd9\xd1\xe8\xb2\x6b\xe6\x73\x06\x39" + "\xbb\x72\x74\xa3\xc2\x1a\x40\xcd\xec\x40\x8f\x44\xf8\x86\xff\x7e\xb7\xea" + "\xda\xb0\x5c\x25\xdf\x3f\x54\xda\xca\xea\x76\xe5\xec\xbb\x21\xd3\x86\x8d" + "\x8a\x57\xf0\x31\x9f\x56\xa3\x1b\xf9\x55\xe6\xa6\xde\xb7\x74\xcc\x2b\x17" + "\x9a\xe3\x1b\x74\x0d\x2b\x99\xcd\x64\xe1\x7b\x7e\x1c\xcd\x9b\x23\x02\x7d" + "\x86\x52\xfd\x14\x2d\xbb\x75\x3d\xa3\x3b\xc1\xe0", + 1, 1536}, + {128, 256, 6, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x0b\xe5\x48\xa6\xa1\xbc\xac\x81\x80\x06\x5f\xae\x1e\x3f\x55\x73\x6d\x36" + "\x7f\x57\x3d\xa4\x4a\x6b\xb6\x65\x2f\xb7\xe8\x85\x47\xe2\x41\x42\xc2\x4e" + "\x58\xf1\xde\x42\x9f\x15\x4c\xaf\xea\x04\x20\xd0\x1a\x19\x36\x74\x71\x12" + "\x72\x1b\xdb\x18\xf9\x0b\xb3\xf3\x63\xd4\x62\x52\x8b\x63\x0f\x6b\x4d\xb9" + "\x70\xd6\x91\xa0\x43\x3f\x46\xfe\x43\xbb\xb8\xdc\x5e\xdb\xd4\x1f\xf0\x17" + "\x94\x25\xee\x55\x67\xbf\x4d\xda\x9d\xe7\x4b\xc6\x7a\xcf\x8f\xd7\xbb\x29" + "\x6e\x26\xd4\xc3\x08\x9b\x67\x15\xe9\x2d\x9f\x2d\x3c\x76\x26\xd3\xda\xfe" + "\x6e\x73\x9d\x09\x60\x4b\x35\x60\xdb\x77\xb6\xc0\x45\x91\xf9\x14\x8a\x7a" + "\xdd\xe2\xf1\xdf\x8f\x12\x4f\xd7\x75\xd6\x9a\x17\xda\x76\x88\xf0\xfa\x44" + "\x27\xbe\x61\xaf\x55\x9f\xc7\xf0\x76\x77\xde\xca\xd1\x47\x51\x55\xb1\xbf" + "\xfa\x1e\xca\x28\x17\x70\xf3\xb5\xd4\x32\x47\x04\xe0\x92\xd8\xa5\x03\x69" + "\x46\x99\x7f\x1e\x3f\xb2\x93\x36\xa3\x88\x75\x07\x68\xb8\x33\xce\x17\x3f" + "\x5c\xb7\x1e\x93\x38\xc5\x1d\x79\x86\x7c\x9d\x9e\x2f\x69\x38\x0f\x97\x5c" + "\x67\xbf\xa0\x8d\x37\x0b\xd3\xb1\x04\x87\x1d\x74\xfe\x30\xfb\xd0\x22\x92" + "\xf9\xf3\x23\xc9", + "\x16\x60\x36\xd9\xcf\xe8\xd6\x07\x81\xdf\x28\x0a\x40\x44\x61\x45\x83\x28" + "\xd5\x1b\xf7\x55\x54\x35\xd3\x43\x73\x0e\x7a\xc3\x83\xb1\xc9\xbd\x22\x70" + "\xf0\xde\x8f\x92\x5e\xe1\x56\xd3\x4d\x01\x64\xfa\xe9\x83\x35\x60\x80\x70" + "\xf5\xb5\x13\x76\xd3\x88\xbb\x7f\x2d\x0a\x31\x04\xb4\x77\x47\x91\x3f\xe4" + "\xa9\x9a\x19\xbe\xfb\xd6\x70\xae\xb1\xea\xd5\x03\xd6\xb5\xca\x76\x5e\x0d" + "\x21\x31\x87\xf3\xb2\x2e\xe2\xbc\x71\xb5\x8b\x7e\xa6\x09\x78\x6e\x76\xe6" + "\x61\xdf\x86\xe6\x8d\x2f\x12\x43\x99\xf9\xf1\x86\xf1\x55\xfd\x35\xcd\xe8" + "\x92\x4e\x87\x33\x77\x62\x64\xaa\x60\x07\x33\x08\x45\xf5\xd6\xb0\x9c\xf4" + "\xba\xda\x17\x74\x74\x23\x54\x9c\x7e\x86\x57\x83\x3d\xda\xc3\xe1\x02\x90" + "\xe3\x69\x80\x7a\x5b\x47\xf5\xea\x83\x1a\xc6\x1a\xaa\x53\x66\xfe\xe6\xbd" + "\x72\x9b\x8b\x96\xdb\x94\xa9\x5b\xc3\x40\x6a\xcd\xf4\x78\x14\x29\x7b\x8f" + "\x26\xb0\x89\xbd\x03\x55\x33\x46\x4c\x96\x2a\x58\x69\x7c\x9b\xdf\xba\xb8" + "\x75\x5b\xbc\x4b\x19\xd3\x9d\xee\xfd\x17\x2f\x14\xea\xd9\x32\xd2\xaa\xaf" + "\x09\xce\x81\xca\x7f\xc1\x50\x5d\x13\x3a\x91\x27\x16\x97\x57\x1f\x5d\xc5" + "\x2e\x56\xc2\xca", + 1, 2048}, + {128, 128, 7, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x92\x65" + "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\xdd\x4e\xe9\xeb" + "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\xfe\x2c\x73\x23\xea\x45" + "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x1d\x92\x82\xd8\x0f\xa9\x36\x23" + "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" + "\x86\x8c\xbd\xdc\x6b\x12\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" + "\x0a\x8d\x1e\xf1\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" + "\xb6\x35\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" + "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\xe4\x95" + "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x5a\x53\xc3\xdc" + "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\xac\x1f\xa7\x9c\x64\xfd" + "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\xba\x99\xa4\x12\x6e\x4e\xea\x0b" + "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" + "\x09\xff\xaa\x17\x5d\x82\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" + "\x33\x58\x7e\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" + "\x81\xd0\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" + "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x97\x9c" + "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x2f\xe7\xcd\x8a" + "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\xc9\x2c\xb7\x75\xa8\xf6" + "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x33\x73\xaf\xde\xcb\x37\x0a\x50" + "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" + "\xd8\xb0\x84\x26\x6b\xe8\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" + "\x1a\xd2\xd6\x3a\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" + "\x9f\xc7\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" + "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x1a\xb3" + "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\xb8\xa1\x62\x8c" + "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x8e\x46\xa0\xc5\x45\x5c" + "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\xe2\x04\x30\x63\x22\x87\xb6\xc7" + "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" + "\x35\xa1\x5d\x17\x48\x55\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" + "\xab\xde\xe1\x02\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" + "\x0e\x05\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" + "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x1b\xa2" + "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x46\xb9\xc9\xf6" + "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x7a\xce\xfd\x3c\x16\xff" + "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" + "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" + "\xb5\xed\xb7\xa2\x54\x84\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" + "\xbd\xbf\x3a\xb8\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" + "\x19\x33\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" + "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\xbe\x4a" + "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x2d\x06\x98\x32" + "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\xca\xf3\xc0\xc7\x64\xee" + "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" + "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" + "\x50\x5d\xc4\xb3\x3d\x09\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" + "\xc2\x8e\xea\xbe\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" + "\x04\x9d\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" + "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x6f\xe4" + "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\xd1\x28\x4d\x7c" + "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\xf2\xd5\x36\x4a\x54\xe8" + "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x17\xd1\x20\x93\x31\x89\xff\xed" + "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" + "\x42\xdd\x99\x15\x9a\xf4\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" + "\x97\xf7\xde\x31\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" + "\x86\x9a\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a", + "\xfb\x04\xe9\x1c\xc3\x56\x9c\xb0\xba\xc4\x66\xa3\xba\x45\xac\xb8\xd6\xd8" + "\x95\x6c\x28\xd1\x51\x6d\xaa\x8c\x2e\xf1\x34\xab\xeb\x66\xf9\x4e\x24\x61" + "\x1d\x16\x99\xd5\x10\x30\x42\x31\x68\x98\xc5\xdb\x0c\x9f\x0a\x1a\x65\x7d" + "\x03\x50\xb8\x00\x0c\x40\x93\x6b\xa9\x1f\x28\x87\x01\x3c\xe9\xeb\x0e\x10" + "\x0f\x35\xbe\x9c\x6a\xfa\x00\xac\x25\x77\x5d\x49\xde\xdc\xa1\x62\xa7\xb7" + "\x30\x75\x36\x32\x31\xab\x40\xbb\x96\xba\x46\x32\x53\x8c\x35\x7d\xa4\x21" + "\xfa\x6a\xeb\x68\xe4\xa4\xbf\xac\x24\xbf\x59\x8e\x98\xa6\x53\xca\xe3\x69" + "\xdd\x47\x6e\x18\x94\xf0\x40\x03\x59\x93\x96\xde\x57\x96\x00\xaf\x56\x88" + "\xb5\x0d\x55\xbc\x24\xac\x11\xff\x4d\x72\x82\xda\xf2\xee\xbc\x56\x8a\x17" + "\x24\x6b\x88\x7e\x9c\xdb\x07\xdd\xd4\x12\x15\x4d\x9e\x1a\x57\x12\x8d\x84" + "\xdb\x17\x1a\x2f\x7a\x3d\x4c\xbb\xc2\xb8\x73\xad\x39\x13\xf8\x2e\xfc\xf9" + "\x3b\x64\x06\x9e\x78\x73\xff\x2b\x8c\x1b\x4e\x21\x3e\x05\x4d\xee\x9d\x39" + "\x7c\x61\xe1\x18\x98\xe3\x50\x25\xf9\x48\x5e\x66\x9d\x41\xa2\x08\x3f\x88" + "\x28\x03\x68\x8a\xfc\xf4\x7a\xf5\xcb\x7d\xeb\x9e\xb2\x22\xbc\x1a\x94\x51" + "\xa4\x7b\x9a\x2c\xb3\x67\x60\x94\x06\x31\x80\xa0\xf7\x7f\xe8\x47\x00\xab" + "\x0b\x56\x09\xa6\xa4\x77\x18\xa5\x30\x81\xd9\x7e\x2d\x6a\x77\x34\x4e\xca" + "\x72\x0d\xb3\x31\x87\x9c\x98\xc9\x48\x4c\xa0\x8d\xed\x9d\x7b\x9e\xb4\xfe" + "\x05\x7f\x93\x56\xa8\x2b\x07\x0b\xc5\x52\x96\xd5\x6a\xe4\xf6\x38\x79\x67" + "\xd6\xfe\x8c\x0b\x33\xe0\xe8\x15\xe7\x70\x3e\xca\xa7\x6a\xbb\x81\xf7\x94" + "\x7f\x17\xd6\x66\x96\xbf\x1c\x8f\x71\xb6\x9c\x5c\xe2\x61\x47\x7b\x6e\xa2" + "\x87\x17\x55\x08\x1d\x10\xb1\x34\x3c\x21\x16\x70\x3d\x0d\x93\x68\x5e\x46" + "\x22\x45\x00\xdb\xf0\x9b\xa1\x1f\xc7\x5b\x17\xe1\x95\x07\x57\xe5\xae\x5a" + "\x6d\x10\x83\xc4\x1c\x0d\xf5\x73\xd3\xeb\x52\x29\x33\x4f\xb0\xe7\x5c\xf6" + "\xdb\xb5\x21\x6f\x35\x9a\x43\x9c\x86\xeb\x11\x95\x91\x10\xa3\xbd\xe2\xe4" + "\x69\xac\xb1\x50\xd4\xf1\x68\xe6\x65\xb1\x96\xda\xfb\xf0\x13\x06\xa4\x63" + "\xb6\xdb\x79\x2b\x3a\xc9\x98\x7a\x2c\x37\xf9\x4f\xa6\x93\x9d\x3b\xb3\x06" + "\x63\xe2\xf6\x92\x07\xe2\x82\xfd\xb5\x08\x9b\x79\x79\x78\x3b\xee\x28\x54" + "\x81\x5d\x7a\xa3\x81\x93\xa9\xc2\x59\x3f\xb3\xc5\xcd\x89\xa2\x31\xc2\xf0" + "\x84\x8c\x2e\x0a\xa4\x2f\x9c\xf2\x54\x56\xec\x75\x39\xd7\x92\x53\x60\x58" + "\xf8\x81\x84\x0c\x99\xc4\x6f\x88\xf8\x6e\x6d\xd6\x08\x47\x6a\xa4\x79\xbc" + "\xeb\x1e\x67\xd7\xdf\x0c\x52\xdc\x74\x40\x39\x17\xdc\xd9\x13\x72\x58\xc5" + "\x30\xda\xad\x76\xa9\x9a\xad\xed\xfb\x4b\x4e\x60\xde\xc9\x18\xa0\x77\x50" + "\x54\xfa\x00\xd6\xa9\x52\xfe\x67\x3e\xe9\xdf\x46\x14\x6c\xfb\x50\xd6\x21" + "\xf6\xe5\xf7\x99\x38\xad\x65\xa5\x6c\x4e\x21\x31\x77\x7a\xdc\x6f\x5d\xb5" + "\x7f\x63\xf4\xa8\xee\x0d\x68\x10\xde\x5b\x45\x4b\x03\xd8\x55\x04\x15\x6e" + "\xc6\xb7\xc1\x30\x29\x6a\x6c\x26\xe8\x41\x53\xb9\x82\x67\x5b\xfe\xa9\x5f" + "\x0b\xf8\x38\xf8\xbe\x3c\x26\xf2\x83\x94\xd6\x45\x64\x1f\x17\x20\x4d\xae" + "\x4a\x15\x27\x7d\x7f\x3b\x71\x3c\x3a\xc3\x56\x1b\xe5\xbd\x34\x4b\x3f\x88" + "\x3e\xcc\x98\xb5\x5e\x8b\xab\x18\x98\xf0\xef\x1b\x78\x15\xb7\x4a\x1f\xe3" + "\x45\xc7\x31\x34\x5a\x7b\x6e\xb8\xea\xfe\xaf\x34\x32\x45\xfa\x3e\x75\x8a" + "\x30\x3f\xed\xe5\xfe\x66\x15\xc7\xbe\xd9\xc7\x27\x3c\x26\x66\x2d\xa1\x0b" + "\xb9\x1e\x17\x44\xd3\x4b\xe6\x30\x85\x9e\x29\x3d\xa9\x35\xca\x61\xea\x22" + "\x76\xdb\xce\x82\xfe\x8b\xac\xd3\x09\x90\xad\xf2\x42\x45\x8b\xbd\xad\x34" + "\x56\x67\x3a\x81\x3d\x95\x37\x72\xe6\xcc\x20\xe7\x09\x84\x99\x8b\x1a\x68" + "\x5f\x4e\x00\x14\x3e\x94\xa7\x15\xab\xdd\x01\x2f\x9d\x57\xce\x24\x40\x97" + "\x5e\x62\x7c\x4f\xe7\x1d\x53\x79\x05\x52\x5d\xc9\xc6\xe0\x47\xc1\xb5\x7f" + "\x47\x28\x7d\x0b\xa8\x51\x27\xb9\x21\x97\x2d\x5b\x03\x94\x30\x63\xa5\x02" + "\x04\xf0\x53\x53\x23\xfa\x81\xd1\x31\x3b\x63\x5d\x61\x3b\x44\x19\xb2\x24" + "\x15\x79\x54\xb0\x57\x8c\x17\x0d\x36\xad\xa3\x08\x71\x60\x85\xc9\x5e\x7b" + "\x55\x85\x8a\x90\x0b\x2c\x2b\x9a\x5d\xb6\x0e\xb6\xa6\x1d\xb1\xf5\xe1\xae" + "\xf9\x94\xb6\x3d\xd0\xad\x5b\xa7\x3a\x66\xd0\x31\x45\xcc\xb7\x7f\xce\x0f" + "\x07\x2e\x64\x11\xe0\xcd\xac\xdb\x75\xb1\x5a\x4a\x5b\x15\x6a\xe2\x28\x8c" + "\x6d\xe5\x5a\x82\x62\xeb\xfc\xf5\x9b\x67\xa0\x79\x75\x24\x2e\xd4\x3b\x53" + "\xd4\xec\x6b\x0f\x43\x22\xe3\xc3\x75\x83\x2d\x64\x5f\x8a\x79\x49\x5f\x1a" + "\x81\xeb\xd5\x47\xc9\xe7\xa8\x14\xd9\xcc\xb0\xa4\xea\xfc\x12\x23\xb3\x1b" + "\x7a\xac\x0f\x6a\x86\x4c\x4b\x91\x13\xa3\x52\x51\x69\xc8\xff\x52\x8f\x44", + 1, 8064}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; diff --git a/test/kat-app/aes_cbcs_test.c b/test/kat-app/aes_cbcs_test.c index 3765b2d7..be489c47 100644 --- a/test/kat-app/aes_cbcs_test.c +++ b/test/kat-app/aes_cbcs_test.c @@ -33,7 +33,6 @@ #include -#include "gcm_ctr_vectors_test.h" #include "utils.h" #include "cipher_test.h" @@ -250,11 +249,11 @@ test_aes_vectors(struct IMB_MGR *mb_mgr, DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); if (!quiet_mode) - printf("AES-CBC Test (N jobs = %d):\n", num_jobs); + printf("AES-CBCS Test (N jobs = %d):\n", num_jobs); for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("AES-CBC Test Case %zu key_len:%zu\n", + printf("AES-CBCS Test Case %zu key_len:%zu\n", v->tcId, v->keySize); #else printf("."); diff --git a/test/kat-app/aes_cbcs_test.json.c b/test/kat-app/aes_cbcs_test.json.c index 8cea96d6..49a0f773 100644 --- a/test/kat-app/aes_cbcs_test.json.c +++ b/test/kat-app/aes_cbcs_test.json.c @@ -1,4 +1,31 @@ -/* AES-CBC */ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* AES-CBCS */ #include "cipher_test.h" const struct cipher_test aes_cbcs_test_json[] = { /* diff --git a/test/kat-app/aes_test.c b/test/kat-app/aes_test.c index 6b4cc390..7dba1bdc 100644 --- a/test/kat-app/aes_test.c +++ b/test/kat-app/aes_test.c @@ -33,7 +33,6 @@ #include -#include "gcm_ctr_vectors_test.h" #include "utils.h" #define MAX_BURST_JOBS 64 @@ -57,569 +56,6 @@ struct aes_vector { * http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ -/* 128-bit */ -static const uint8_t K1[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P1[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t C1[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, - 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, - 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, - 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, - 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, - 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 -}; - -/* 192-bit */ -static const uint8_t K2[] = { - 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, - 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, - 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b -}; -static const uint8_t IV2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P2[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t C2[] = { - 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d, - 0x71, 0x78, 0x18, 0x3a, 0x9f, 0xa0, 0x71, 0xe8, - 0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4, - 0xe5, 0xe7, 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a, - 0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, 0xe0, - 0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0, - 0x08, 0xb0, 0xe2, 0x79, 0x88, 0x59, 0x88, 0x81, - 0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd -}; - -/* 256-bit */ -static const uint8_t K3[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; -static const uint8_t IV3[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P3[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t C3[] = { - 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, - 0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6, - 0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d, - 0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d, - 0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf, - 0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61, - 0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc, - 0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b -}; - -/* Extra AES test vectors */ - -/* 128-bit */ -static const uint8_t K4[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV4[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P4[] = { - 0xf7, 0xcd, 0x12, 0xfb, 0x4f, 0x8e, 0x50, 0xab, - 0x35, 0x8e, 0x56, 0xf9, 0x83, 0x53, 0x9a, 0x1a, - 0xfc, 0x47, 0x3c, 0x96, 0x01, 0xfe, 0x01, 0x87, - 0xd5, 0xde, 0x46, 0x24, 0x5c, 0x62, 0x8f, 0xba, - 0xba, 0x91, 0x17, 0x8d, 0xba, 0x5a, 0x79, 0xb1, - 0x57, 0x05, 0x4d, 0x08, 0xba, 0x1f, 0x30, 0xd3, - 0x80, 0x40, 0xe9, 0x37, 0xb0, 0xd6, 0x34, 0x87, - 0x33, 0xdd, 0xc0, 0x5b, 0x2d, 0x58, 0x1d, 0x2a, - 0x7b, 0xb6, 0xe3, 0xd0, 0xc8, 0xa0, 0x7a, 0x69, - 0xc8, 0x5d, 0x10, 0xa2, 0xc3, 0x39, 0xca, 0xaf, - 0x40, 0xdc, 0xc7, 0xcb, 0xff, 0x18, 0x7d, 0x51, - 0x06, 0x28, 0x28, 0x1f, 0x3a, 0x9c, 0x18, 0x7d, - 0x5b, 0xb5, 0xe9, 0x20, 0xc2, 0xae, 0x17, 0x7f, - 0xd1, 0x65, 0x7a, 0x75, 0xcf, 0x21, 0xa0, 0x1e, - 0x17, 0x1b, 0xf7, 0xe8, 0x62, 0x5f, 0xaf, 0x34, - 0x7f, 0xd8, 0x18, 0x4a, 0x94, 0xf2, 0x33, 0x90 -}; -static const uint8_t C4[] = { - 0xf0, 0x8f, 0x91, 0x13, 0x11, 0x01, 0xdc, 0xbb, - 0xcd, 0xf9, 0x95, 0x92, 0xda, 0xbf, 0x2a, 0x86, - 0xea, 0x8d, 0xa6, 0x08, 0xc8, 0xb5, 0x65, 0x82, - 0x93, 0x43, 0xb7, 0x0e, 0x14, 0x36, 0xb4, 0xcf, - 0xd8, 0x11, 0xab, 0x21, 0x5b, 0x64, 0xb8, 0xc5, - 0xee, 0x27, 0x93, 0x66, 0x59, 0xd9, 0x1d, 0xc9, - 0x84, 0x9d, 0x03, 0xbd, 0xab, 0xce, 0x6a, 0x14, - 0x76, 0x73, 0x17, 0xe3, 0xb3, 0xe5, 0x70, 0xe8, - 0xa2, 0xa8, 0xce, 0xb0, 0xf6, 0xc4, 0xc5, 0xb5, - 0x8e, 0x22, 0xef, 0x33, 0xdf, 0x18, 0x42, 0x40, - 0x56, 0xc4, 0xb9, 0x7f, 0x60, 0x9e, 0x8b, 0x45, - 0xc1, 0xbf, 0xa7, 0xfa, 0x1b, 0x3e, 0x02, 0x5d, - 0xb3, 0x04, 0x93, 0x30, 0xf5, 0xff, 0x8e, 0xb6, - 0x0a, 0xfb, 0x41, 0xfe, 0x09, 0xa5, 0x90, 0xc7, - 0x22, 0xab, 0xaa, 0x22, 0x89, 0xd8, 0x3c, 0x4e, - 0x46, 0x18, 0x93, 0xbf, 0x1a, 0xce, 0x77, 0x59 -}; - -/* 192-bit */ -static const uint8_t K5[] = { - 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, - 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, - 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b -}; -static const uint8_t IV5[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P5[] = { - 0x19, 0x08, 0xa3, 0x58, 0x17, 0x14, 0x70, 0x5a, - 0xb8, 0xab, 0x4f, 0x5f, 0xa4, 0x25, 0x2b, 0xec, - 0xb6, 0x74, 0x0b, 0x9d, 0x56, 0x3b, 0xaf, 0xa3, - 0xa4, 0x2d, 0x3e, 0x1f, 0x18, 0x84, 0x3b, 0x4f, - 0x48, 0xd9, 0xa3, 0xfe, 0x59, 0x1e, 0x80, 0x67, - 0x44, 0x35, 0x26, 0x00, 0x78, 0xda, 0x68, 0xfa, - 0x61, 0x9c, 0xd8, 0x8e, 0x5c, 0xc1, 0xff, 0xeb, - 0x9c, 0x7d, 0xe7, 0xa9, 0x38, 0xeb, 0x66, 0xf8, - 0x6a, 0x46, 0x71, 0x51, 0x02, 0xba, 0x8d, 0x70, - 0x55, 0x5b, 0x60, 0xc6, 0x4c, 0xae, 0xda, 0x2e, - 0x17, 0xbb, 0x65, 0xef, 0x60, 0x85, 0x9e, 0x77, - 0xe5, 0x83, 0xef, 0x30, 0x08, 0x3a, 0xba, 0x80, - 0x28, 0xc0, 0xa1, 0x93, 0x4c, 0x2a, 0x0b, 0xe1, - 0xcb, 0xd0, 0xac, 0x72, 0x72, 0x1d, 0x96, 0x76, - 0x0e, 0xc0, 0xec, 0x7d, 0x84, 0xfd, 0xee, 0x08, - 0xa1, 0x11, 0x20, 0x0d, 0x59, 0x5c, 0x06, 0x3f, - 0xa3, 0xf1, 0xd7, 0xa3, 0x1d, 0x29, 0xc3, 0xaa, - 0x05, 0x2b, 0x74, 0x8c, 0x73, 0x60, 0x65, 0x43, - 0x76, 0xd4, 0xd7, 0x7b, 0x5f, 0x40, 0xf4, 0x77, - 0xe1, 0xcc, 0x85, 0x37, 0x1c, 0xd8, 0xda, 0x91, - 0xf0, 0x40, 0xb2, 0x43, 0x2d, 0x87, 0x51, 0xd0, - 0xce, 0x27, 0xa6, 0x60, 0xac, 0x67, 0xea, 0x8b, - 0xae, 0x46, 0x2e, 0x78, 0x06, 0x09, 0x8a, 0x82, - 0xb0, 0x0d, 0x57, 0x56, 0x82, 0xfe, 0x89, 0xd2 -}; -static const uint8_t C5[] = { - 0xfa, 0x88, 0xb3, 0x4e, 0x7f, 0x3e, 0x78, 0x4d, - 0xfd, 0xb3, 0x38, 0xee, 0xb0, 0xdd, 0x0d, 0xf5, - 0xeb, 0x24, 0xe6, 0x70, 0xd8, 0xac, 0xd7, 0xfa, - 0x41, 0x67, 0x2e, 0x2d, 0x7e, 0x9b, 0x26, 0xac, - 0xf1, 0x0f, 0x1f, 0x47, 0x6d, 0xff, 0x46, 0xd1, - 0x1a, 0xeb, 0xe9, 0x3c, 0x1b, 0x9d, 0x55, 0x86, - 0xde, 0xee, 0x3d, 0xd8, 0x12, 0x05, 0x12, 0x9d, - 0xff, 0x23, 0x97, 0x57, 0xb0, 0xdc, 0x7b, 0x7a, - 0xdf, 0xba, 0x7f, 0x69, 0x85, 0xdf, 0xa9, 0xfd, - 0x3e, 0xa7, 0x36, 0x26, 0x30, 0xdd, 0x07, 0x0f, - 0x89, 0x0b, 0x27, 0x9c, 0x23, 0xa1, 0xfa, 0x7d, - 0x4e, 0x64, 0x50, 0x07, 0x86, 0x13, 0x98, 0xee, - 0x05, 0xc6, 0x6c, 0xd9, 0xd1, 0xe8, 0xb2, 0x6b, - 0xe6, 0x73, 0x06, 0x39, 0xbb, 0x72, 0x74, 0xa3, - 0xc2, 0x1a, 0x40, 0xcd, 0xec, 0x40, 0x8f, 0x44, - 0xf8, 0x86, 0xff, 0x7e, 0xb7, 0xea, 0xda, 0xb0, - 0x5c, 0x25, 0xdf, 0x3f, 0x54, 0xda, 0xca, 0xea, - 0x76, 0xe5, 0xec, 0xbb, 0x21, 0xd3, 0x86, 0x8d, - 0x8a, 0x57, 0xf0, 0x31, 0x9f, 0x56, 0xa3, 0x1b, - 0xf9, 0x55, 0xe6, 0xa6, 0xde, 0xb7, 0x74, 0xcc, - 0x2b, 0x17, 0x9a, 0xe3, 0x1b, 0x74, 0x0d, 0x2b, - 0x99, 0xcd, 0x64, 0xe1, 0x7b, 0x7e, 0x1c, 0xcd, - 0x9b, 0x23, 0x02, 0x7d, 0x86, 0x52, 0xfd, 0x14, - 0x2d, 0xbb, 0x75, 0x3d, 0xa3, 0x3b, 0xc1, 0xe0 -}; - -/* 256-bit */ -static const uint8_t K6[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; -static const uint8_t IV6[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P6[] = { - 0x0b, 0xe5, 0x48, 0xa6, 0xa1, 0xbc, 0xac, 0x81, - 0x80, 0x06, 0x5f, 0xae, 0x1e, 0x3f, 0x55, 0x73, - 0x6d, 0x36, 0x7f, 0x57, 0x3d, 0xa4, 0x4a, 0x6b, - 0xb6, 0x65, 0x2f, 0xb7, 0xe8, 0x85, 0x47, 0xe2, - 0x41, 0x42, 0xc2, 0x4e, 0x58, 0xf1, 0xde, 0x42, - 0x9f, 0x15, 0x4c, 0xaf, 0xea, 0x04, 0x20, 0xd0, - 0x1a, 0x19, 0x36, 0x74, 0x71, 0x12, 0x72, 0x1b, - 0xdb, 0x18, 0xf9, 0x0b, 0xb3, 0xf3, 0x63, 0xd4, - 0x62, 0x52, 0x8b, 0x63, 0x0f, 0x6b, 0x4d, 0xb9, - 0x70, 0xd6, 0x91, 0xa0, 0x43, 0x3f, 0x46, 0xfe, - 0x43, 0xbb, 0xb8, 0xdc, 0x5e, 0xdb, 0xd4, 0x1f, - 0xf0, 0x17, 0x94, 0x25, 0xee, 0x55, 0x67, 0xbf, - 0x4d, 0xda, 0x9d, 0xe7, 0x4b, 0xc6, 0x7a, 0xcf, - 0x8f, 0xd7, 0xbb, 0x29, 0x6e, 0x26, 0xd4, 0xc3, - 0x08, 0x9b, 0x67, 0x15, 0xe9, 0x2d, 0x9f, 0x2d, - 0x3c, 0x76, 0x26, 0xd3, 0xda, 0xfe, 0x6e, 0x73, - 0x9d, 0x09, 0x60, 0x4b, 0x35, 0x60, 0xdb, 0x77, - 0xb6, 0xc0, 0x45, 0x91, 0xf9, 0x14, 0x8a, 0x7a, - 0xdd, 0xe2, 0xf1, 0xdf, 0x8f, 0x12, 0x4f, 0xd7, - 0x75, 0xd6, 0x9a, 0x17, 0xda, 0x76, 0x88, 0xf0, - 0xfa, 0x44, 0x27, 0xbe, 0x61, 0xaf, 0x55, 0x9f, - 0xc7, 0xf0, 0x76, 0x77, 0xde, 0xca, 0xd1, 0x47, - 0x51, 0x55, 0xb1, 0xbf, 0xfa, 0x1e, 0xca, 0x28, - 0x17, 0x70, 0xf3, 0xb5, 0xd4, 0x32, 0x47, 0x04, - 0xe0, 0x92, 0xd8, 0xa5, 0x03, 0x69, 0x46, 0x99, - 0x7f, 0x1e, 0x3f, 0xb2, 0x93, 0x36, 0xa3, 0x88, - 0x75, 0x07, 0x68, 0xb8, 0x33, 0xce, 0x17, 0x3f, - 0x5c, 0xb7, 0x1e, 0x93, 0x38, 0xc5, 0x1d, 0x79, - 0x86, 0x7c, 0x9d, 0x9e, 0x2f, 0x69, 0x38, 0x0f, - 0x97, 0x5c, 0x67, 0xbf, 0xa0, 0x8d, 0x37, 0x0b, - 0xd3, 0xb1, 0x04, 0x87, 0x1d, 0x74, 0xfe, 0x30, - 0xfb, 0xd0, 0x22, 0x92, 0xf9, 0xf3, 0x23, 0xc9 -}; -static const uint8_t C6[] = { - 0x16, 0x60, 0x36, 0xd9, 0xcf, 0xe8, 0xd6, 0x07, - 0x81, 0xdf, 0x28, 0x0a, 0x40, 0x44, 0x61, 0x45, - 0x83, 0x28, 0xd5, 0x1b, 0xf7, 0x55, 0x54, 0x35, - 0xd3, 0x43, 0x73, 0x0e, 0x7a, 0xc3, 0x83, 0xb1, - 0xc9, 0xbd, 0x22, 0x70, 0xf0, 0xde, 0x8f, 0x92, - 0x5e, 0xe1, 0x56, 0xd3, 0x4d, 0x01, 0x64, 0xfa, - 0xe9, 0x83, 0x35, 0x60, 0x80, 0x70, 0xf5, 0xb5, - 0x13, 0x76, 0xd3, 0x88, 0xbb, 0x7f, 0x2d, 0x0a, - 0x31, 0x04, 0xb4, 0x77, 0x47, 0x91, 0x3f, 0xe4, - 0xa9, 0x9a, 0x19, 0xbe, 0xfb, 0xd6, 0x70, 0xae, - 0xb1, 0xea, 0xd5, 0x03, 0xd6, 0xb5, 0xca, 0x76, - 0x5e, 0x0d, 0x21, 0x31, 0x87, 0xf3, 0xb2, 0x2e, - 0xe2, 0xbc, 0x71, 0xb5, 0x8b, 0x7e, 0xa6, 0x09, - 0x78, 0x6e, 0x76, 0xe6, 0x61, 0xdf, 0x86, 0xe6, - 0x8d, 0x2f, 0x12, 0x43, 0x99, 0xf9, 0xf1, 0x86, - 0xf1, 0x55, 0xfd, 0x35, 0xcd, 0xe8, 0x92, 0x4e, - 0x87, 0x33, 0x77, 0x62, 0x64, 0xaa, 0x60, 0x07, - 0x33, 0x08, 0x45, 0xf5, 0xd6, 0xb0, 0x9c, 0xf4, - 0xba, 0xda, 0x17, 0x74, 0x74, 0x23, 0x54, 0x9c, - 0x7e, 0x86, 0x57, 0x83, 0x3d, 0xda, 0xc3, 0xe1, - 0x02, 0x90, 0xe3, 0x69, 0x80, 0x7a, 0x5b, 0x47, - 0xf5, 0xea, 0x83, 0x1a, 0xc6, 0x1a, 0xaa, 0x53, - 0x66, 0xfe, 0xe6, 0xbd, 0x72, 0x9b, 0x8b, 0x96, - 0xdb, 0x94, 0xa9, 0x5b, 0xc3, 0x40, 0x6a, 0xcd, - 0xf4, 0x78, 0x14, 0x29, 0x7b, 0x8f, 0x26, 0xb0, - 0x89, 0xbd, 0x03, 0x55, 0x33, 0x46, 0x4c, 0x96, - 0x2a, 0x58, 0x69, 0x7c, 0x9b, 0xdf, 0xba, 0xb8, - 0x75, 0x5b, 0xbc, 0x4b, 0x19, 0xd3, 0x9d, 0xee, - 0xfd, 0x17, 0x2f, 0x14, 0xea, 0xd9, 0x32, 0xd2, - 0xaa, 0xaf, 0x09, 0xce, 0x81, 0xca, 0x7f, 0xc1, - 0x50, 0x5d, 0x13, 0x3a, 0x91, 0x27, 0x16, 0x97, - 0x57, 0x1f, 0x5d, 0xc5, 0x2e, 0x56, 0xc2, 0xca -}; - -/* 128-bit */ -static const uint8_t K7[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV7[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P7[] = { - 0xdd, 0x14, 0xde, 0x30, 0xe0, 0xfd, 0x7b, 0x2a, - 0x94, 0x8e, 0x28, 0xa0, 0xf6, 0x93, 0x6e, 0xf5, - 0x92, 0x65, 0x1d, 0x5e, 0x78, 0x2a, 0x9d, 0x39, - 0xfc, 0xb8, 0x6d, 0x8b, 0xa5, 0xf4, 0x4b, 0x21, - 0xdd, 0x4e, 0xe9, 0xeb, 0xd7, 0xa7, 0xa1, 0x59, - 0xdc, 0x4c, 0x5e, 0xcc, 0x83, 0xab, 0xd3, 0x45, - 0xfe, 0x2c, 0x73, 0x23, 0xea, 0x45, 0xcb, 0x0c, - 0x12, 0x67, 0x28, 0xcd, 0xef, 0x4e, 0xca, 0xe2, - 0x1d, 0x92, 0x82, 0xd8, 0x0f, 0xa9, 0x36, 0x23, - 0x6d, 0x38, 0x68, 0xac, 0xa0, 0xeb, 0xdc, 0xcc, - 0xdf, 0xb8, 0x3a, 0x53, 0x04, 0x1a, 0x55, 0x27, - 0x8e, 0x22, 0x86, 0x8c, 0xbd, 0xdc, 0x6b, 0x12, - 0x9c, 0x69, 0xd2, 0x7a, 0x4b, 0x52, 0x5d, 0x76, - 0x34, 0xb9, 0x5e, 0x30, 0x0a, 0x8d, 0x1e, 0xf1, - 0x27, 0xda, 0x5b, 0xb9, 0x5e, 0xbf, 0x65, 0x34, - 0x00, 0xb6, 0xd2, 0xb0, 0x89, 0x12, 0xb6, 0x35, - 0xae, 0x27, 0x7f, 0x11, 0xe9, 0xf9, 0x1c, 0x71, - 0xc9, 0x50, 0xfe, 0xd4, 0x76, 0x50, 0x95, 0xf7, - 0xe1, 0x1c, 0x14, 0xcd, 0x67, 0x0f, 0xf0, 0x6d, - 0xa2, 0x93, 0x7b, 0x2c, 0x8d, 0x83, 0x5c, 0xff, - 0xe4, 0x95, 0xf3, 0xa1, 0xfd, 0x00, 0x77, 0x68, - 0x41, 0xb4, 0xfb, 0x81, 0xf4, 0x61, 0x1a, 0x84, - 0x5a, 0x53, 0xc3, 0xdc, 0xba, 0x0d, 0x67, 0x2e, - 0xcf, 0xf2, 0x30, 0xf5, 0x1d, 0xe9, 0xc4, 0x2c, - 0xac, 0x1f, 0xa7, 0x9c, 0x64, 0xfd, 0x45, 0x30, - 0x1b, 0xa1, 0x3b, 0x3d, 0xc7, 0xf5, 0xf9, 0xbb, - 0xba, 0x99, 0xa4, 0x12, 0x6e, 0x4e, 0xea, 0x0b, - 0x29, 0x7f, 0xcd, 0x84, 0x64, 0x50, 0x40, 0xb7, - 0x6a, 0x24, 0x29, 0xa4, 0xa7, 0xa1, 0xef, 0xa9, - 0xcf, 0xdf, 0x09, 0xff, 0xaa, 0x17, 0x5d, 0x82, - 0x74, 0xf5, 0xae, 0xd0, 0xe9, 0xec, 0xad, 0x5e, - 0xa7, 0x84, 0xda, 0xe7, 0x33, 0x58, 0x7e, 0x00, - 0x45, 0x5f, 0xbb, 0x15, 0xa3, 0x65, 0x0e, 0xf5, - 0x7e, 0x27, 0xe7, 0x04, 0x52, 0x58, 0x81, 0xd0, - 0xee, 0x8f, 0xaf, 0xe2, 0x3c, 0xbe, 0x08, 0x97, - 0x8a, 0x97, 0x12, 0xb0, 0x09, 0xfe, 0xa5, 0xeb, - 0xd1, 0x9c, 0x30, 0xe8, 0x9a, 0x3f, 0xe0, 0x38, - 0x34, 0x2b, 0xad, 0xb7, 0xc4, 0xda, 0x54, 0xab, - 0x97, 0x9c, 0x46, 0x2b, 0x2c, 0x0b, 0xb3, 0x49, - 0xcd, 0x9d, 0x32, 0x38, 0x3c, 0x1a, 0x49, 0xdc, - 0x2f, 0xe7, 0xcd, 0x8a, 0xb0, 0x76, 0xcf, 0x30, - 0xea, 0x0b, 0xb0, 0xb7, 0x63, 0xed, 0xb2, 0x8c, - 0xc9, 0x2c, 0xb7, 0x75, 0xa8, 0xf6, 0x63, 0xb6, - 0xcd, 0xb5, 0x63, 0xfb, 0x5f, 0x89, 0xae, 0x3d, - 0x33, 0x73, 0xaf, 0xde, 0xcb, 0x37, 0x0a, 0x50, - 0x6f, 0xae, 0xf3, 0xa6, 0x79, 0x85, 0xdd, 0xc5, - 0x24, 0xc5, 0x29, 0x23, 0x64, 0xef, 0x43, 0xd7, - 0xc4, 0xab, 0xd8, 0xb0, 0x84, 0x26, 0x6b, 0xe8, - 0xb1, 0x5d, 0xb5, 0x69, 0xfb, 0x97, 0x0e, 0x20, - 0xb3, 0xc1, 0x60, 0xad, 0x1a, 0xd2, 0xd6, 0x3a, - 0x73, 0x08, 0xf0, 0x47, 0x5f, 0xcf, 0x15, 0xf7, - 0x7b, 0xf3, 0x69, 0x08, 0x5a, 0x6b, 0x9f, 0xc7, - 0x12, 0xa1, 0xf0, 0xfb, 0x91, 0xc9, 0x07, 0x61, - 0x21, 0xa0, 0x30, 0x4c, 0x16, 0x81, 0xcd, 0x3c, - 0x61, 0xe8, 0x96, 0x91, 0x30, 0xdd, 0x0c, 0x0e, - 0x0b, 0xa1, 0x33, 0x95, 0x67, 0x99, 0xd6, 0x1e, - 0x1a, 0xb3, 0x12, 0xfd, 0xad, 0x46, 0x48, 0x87, - 0x5e, 0xe8, 0xd4, 0xf5, 0xac, 0xdf, 0xa7, 0x37, - 0xb8, 0xa1, 0x62, 0x8c, 0xb8, 0xb6, 0xb0, 0x69, - 0x63, 0x29, 0x60, 0x64, 0x26, 0xc3, 0xf8, 0x18, - 0x8e, 0x46, 0xa0, 0xc5, 0x45, 0x5c, 0x08, 0x2a, - 0xed, 0x29, 0x84, 0x11, 0xea, 0x59, 0xc0, 0x16, - 0xe2, 0x04, 0x30, 0x63, 0x22, 0x87, 0xb6, 0xc7, - 0x81, 0xa6, 0x58, 0xc0, 0xb2, 0xb0, 0x7d, 0xbc, - 0x16, 0x44, 0x6e, 0x5d, 0x6d, 0xce, 0x2a, 0xe0, - 0x20, 0x69, 0x35, 0xa1, 0x5d, 0x17, 0x48, 0x55, - 0x88, 0xfe, 0xde, 0x34, 0xe7, 0x18, 0xbf, 0x7e, - 0x0a, 0x1c, 0x32, 0x88, 0xab, 0xde, 0xe1, 0x02, - 0x61, 0x09, 0x58, 0x96, 0xef, 0x16, 0x73, 0xac, - 0xc0, 0x5c, 0x15, 0xca, 0x9b, 0xea, 0x0e, 0x05, - 0x97, 0x88, 0x09, 0xc5, 0xd0, 0x95, 0x90, 0xae, - 0xa5, 0xb5, 0x28, 0xc6, 0x5a, 0x7b, 0xb3, 0xcc, - 0xae, 0x57, 0x71, 0x83, 0x56, 0x57, 0xca, 0xe8, - 0x8b, 0x21, 0x0c, 0x37, 0x1d, 0xde, 0x85, 0xe2, - 0x1b, 0xa2, 0x38, 0xa0, 0xc5, 0xc7, 0x98, 0x7b, - 0xf9, 0x5e, 0x6a, 0x68, 0xb3, 0xed, 0x49, 0x5e, - 0x46, 0xb9, 0xc9, 0xf6, 0x34, 0xa6, 0x0e, 0xac, - 0x90, 0x72, 0xcf, 0xf8, 0x5b, 0x48, 0x13, 0x40, - 0x7a, 0xce, 0xfd, 0x3c, 0x16, 0xff, 0xb5, 0xea, - 0xb2, 0x56, 0x47, 0xcc, 0x9f, 0xbc, 0xae, 0x4a, - 0xc8, 0xa5, 0x59, 0x57, 0x01, 0xd7, 0x9f, 0xd7, - 0xbf, 0x13, 0xb1, 0xbf, 0xb7, 0x9a, 0xa0, 0xa1, - 0xc6, 0x66, 0x61, 0x96, 0xf2, 0xcd, 0x8c, 0xcb, - 0x3c, 0x67, 0xb5, 0xed, 0xb7, 0xa2, 0x54, 0x84, - 0x3c, 0xcb, 0x7e, 0xb3, 0x97, 0x05, 0xcb, 0x8f, - 0xa9, 0xc6, 0x3c, 0xa2, 0xbd, 0xbf, 0x3a, 0xb8, - 0x92, 0x08, 0x01, 0xea, 0xfd, 0x55, 0x2f, 0x27, - 0x2a, 0x82, 0x38, 0x26, 0x1d, 0x81, 0x19, 0x33, - 0x75, 0x3c, 0xa2, 0x13, 0x1e, 0x58, 0x9f, 0x0b, - 0x08, 0x5d, 0x7a, 0x2c, 0x9a, 0xd1, 0xa5, 0x4c, - 0x41, 0xb4, 0x1d, 0xf8, 0x42, 0x08, 0x87, 0xdd, - 0x8e, 0xc9, 0x05, 0xd2, 0x8c, 0xba, 0x93, 0x28, - 0xbe, 0x4a, 0x14, 0x13, 0x2a, 0x58, 0xf0, 0x1c, - 0xac, 0xc1, 0xc4, 0x49, 0xbc, 0xe1, 0xda, 0xb6, - 0x2d, 0x06, 0x98, 0x32, 0xea, 0xa3, 0x89, 0x11, - 0xca, 0x5f, 0x3e, 0xda, 0x24, 0xe2, 0xdb, 0x1e, - 0xca, 0xf3, 0xc0, 0xc7, 0x64, 0xee, 0x4b, 0x3d, - 0xa2, 0xee, 0x69, 0xb0, 0x3f, 0x2c, 0xd5, 0x49, - 0xba, 0x2d, 0x45, 0x7d, 0xdd, 0xb0, 0x0d, 0xc5, - 0xe0, 0x57, 0x95, 0xbe, 0xf8, 0x4a, 0x11, 0x46, - 0x4c, 0xbb, 0xdf, 0xa8, 0x5a, 0xf9, 0xff, 0x0e, - 0x31, 0xa9, 0x50, 0x5d, 0xc4, 0xb3, 0x3d, 0x09, - 0x46, 0x33, 0x39, 0x31, 0xd5, 0xb3, 0xe5, 0x91, - 0xcf, 0xca, 0x8a, 0xe0, 0xc2, 0x8e, 0xea, 0xbe, - 0x54, 0x64, 0x78, 0x0c, 0x25, 0x1c, 0x17, 0xbc, - 0x49, 0xf9, 0xc0, 0x30, 0x5f, 0x08, 0x04, 0x9d, - 0xb5, 0xe4, 0xeb, 0x9e, 0xe5, 0x1e, 0x6d, 0xbc, - 0x7b, 0xe7, 0xf0, 0xd1, 0xa0, 0x01, 0x18, 0x51, - 0x4f, 0x64, 0xc3, 0x9c, 0x70, 0x25, 0x4f, 0xed, - 0xc7, 0xbc, 0x19, 0x00, 0x09, 0x22, 0x97, 0x5d, - 0x6f, 0xe4, 0x47, 0x98, 0x05, 0xcd, 0xcc, 0xde, - 0xd5, 0xe3, 0xaf, 0xa3, 0xde, 0x69, 0x99, 0x2a, - 0xd1, 0x28, 0x4d, 0x7c, 0x89, 0xa0, 0xdb, 0xae, - 0xf9, 0xf1, 0x4a, 0x46, 0xdf, 0xbe, 0x1d, 0x37, - 0xf2, 0xd5, 0x36, 0x4a, 0x54, 0xe8, 0xc4, 0xfb, - 0x57, 0x77, 0x09, 0x05, 0x31, 0x99, 0xaf, 0x9a, - 0x17, 0xd1, 0x20, 0x93, 0x31, 0x89, 0xff, 0xed, - 0x0f, 0xf8, 0xed, 0xb3, 0xcf, 0x4c, 0x9a, 0x74, - 0xbb, 0x00, 0x36, 0x41, 0xd1, 0x13, 0x68, 0x73, - 0x78, 0x63, 0x42, 0xdd, 0x99, 0x15, 0x9a, 0xf4, - 0xe1, 0xad, 0x6d, 0xf6, 0x5e, 0xca, 0x20, 0x24, - 0xd7, 0x9d, 0x2f, 0x58, 0x97, 0xf7, 0xde, 0x31, - 0x51, 0xa3, 0x1c, 0xe2, 0x66, 0x24, 0x4b, 0xa1, - 0x56, 0x02, 0x32, 0xf4, 0x89, 0xf3, 0x86, 0x9a, - 0x85, 0xda, 0x95, 0xa8, 0x7f, 0x6a, 0x77, 0x02, - 0x3a, 0xba, 0xe0, 0xbe, 0x34, 0x5c, 0x9a, 0x1a -}; -static const uint8_t C7[] = { - 0xfb, 0x04, 0xe9, 0x1c, 0xc3, 0x56, 0x9c, 0xb0, - 0xba, 0xc4, 0x66, 0xa3, 0xba, 0x45, 0xac, 0xb8, - 0xd6, 0xd8, 0x95, 0x6c, 0x28, 0xd1, 0x51, 0x6d, - 0xaa, 0x8c, 0x2e, 0xf1, 0x34, 0xab, 0xeb, 0x66, - 0xf9, 0x4e, 0x24, 0x61, 0x1d, 0x16, 0x99, 0xd5, - 0x10, 0x30, 0x42, 0x31, 0x68, 0x98, 0xc5, 0xdb, - 0x0c, 0x9f, 0x0a, 0x1a, 0x65, 0x7d, 0x03, 0x50, - 0xb8, 0x00, 0x0c, 0x40, 0x93, 0x6b, 0xa9, 0x1f, - 0x28, 0x87, 0x01, 0x3c, 0xe9, 0xeb, 0x0e, 0x10, - 0x0f, 0x35, 0xbe, 0x9c, 0x6a, 0xfa, 0x00, 0xac, - 0x25, 0x77, 0x5d, 0x49, 0xde, 0xdc, 0xa1, 0x62, - 0xa7, 0xb7, 0x30, 0x75, 0x36, 0x32, 0x31, 0xab, - 0x40, 0xbb, 0x96, 0xba, 0x46, 0x32, 0x53, 0x8c, - 0x35, 0x7d, 0xa4, 0x21, 0xfa, 0x6a, 0xeb, 0x68, - 0xe4, 0xa4, 0xbf, 0xac, 0x24, 0xbf, 0x59, 0x8e, - 0x98, 0xa6, 0x53, 0xca, 0xe3, 0x69, 0xdd, 0x47, - 0x6e, 0x18, 0x94, 0xf0, 0x40, 0x03, 0x59, 0x93, - 0x96, 0xde, 0x57, 0x96, 0x00, 0xaf, 0x56, 0x88, - 0xb5, 0x0d, 0x55, 0xbc, 0x24, 0xac, 0x11, 0xff, - 0x4d, 0x72, 0x82, 0xda, 0xf2, 0xee, 0xbc, 0x56, - 0x8a, 0x17, 0x24, 0x6b, 0x88, 0x7e, 0x9c, 0xdb, - 0x07, 0xdd, 0xd4, 0x12, 0x15, 0x4d, 0x9e, 0x1a, - 0x57, 0x12, 0x8d, 0x84, 0xdb, 0x17, 0x1a, 0x2f, - 0x7a, 0x3d, 0x4c, 0xbb, 0xc2, 0xb8, 0x73, 0xad, - 0x39, 0x13, 0xf8, 0x2e, 0xfc, 0xf9, 0x3b, 0x64, - 0x06, 0x9e, 0x78, 0x73, 0xff, 0x2b, 0x8c, 0x1b, - 0x4e, 0x21, 0x3e, 0x05, 0x4d, 0xee, 0x9d, 0x39, - 0x7c, 0x61, 0xe1, 0x18, 0x98, 0xe3, 0x50, 0x25, - 0xf9, 0x48, 0x5e, 0x66, 0x9d, 0x41, 0xa2, 0x08, - 0x3f, 0x88, 0x28, 0x03, 0x68, 0x8a, 0xfc, 0xf4, - 0x7a, 0xf5, 0xcb, 0x7d, 0xeb, 0x9e, 0xb2, 0x22, - 0xbc, 0x1a, 0x94, 0x51, 0xa4, 0x7b, 0x9a, 0x2c, - 0xb3, 0x67, 0x60, 0x94, 0x06, 0x31, 0x80, 0xa0, - 0xf7, 0x7f, 0xe8, 0x47, 0x00, 0xab, 0x0b, 0x56, - 0x09, 0xa6, 0xa4, 0x77, 0x18, 0xa5, 0x30, 0x81, - 0xd9, 0x7e, 0x2d, 0x6a, 0x77, 0x34, 0x4e, 0xca, - 0x72, 0x0d, 0xb3, 0x31, 0x87, 0x9c, 0x98, 0xc9, - 0x48, 0x4c, 0xa0, 0x8d, 0xed, 0x9d, 0x7b, 0x9e, - 0xb4, 0xfe, 0x05, 0x7f, 0x93, 0x56, 0xa8, 0x2b, - 0x07, 0x0b, 0xc5, 0x52, 0x96, 0xd5, 0x6a, 0xe4, - 0xf6, 0x38, 0x79, 0x67, 0xd6, 0xfe, 0x8c, 0x0b, - 0x33, 0xe0, 0xe8, 0x15, 0xe7, 0x70, 0x3e, 0xca, - 0xa7, 0x6a, 0xbb, 0x81, 0xf7, 0x94, 0x7f, 0x17, - 0xd6, 0x66, 0x96, 0xbf, 0x1c, 0x8f, 0x71, 0xb6, - 0x9c, 0x5c, 0xe2, 0x61, 0x47, 0x7b, 0x6e, 0xa2, - 0x87, 0x17, 0x55, 0x08, 0x1d, 0x10, 0xb1, 0x34, - 0x3c, 0x21, 0x16, 0x70, 0x3d, 0x0d, 0x93, 0x68, - 0x5e, 0x46, 0x22, 0x45, 0x00, 0xdb, 0xf0, 0x9b, - 0xa1, 0x1f, 0xc7, 0x5b, 0x17, 0xe1, 0x95, 0x07, - 0x57, 0xe5, 0xae, 0x5a, 0x6d, 0x10, 0x83, 0xc4, - 0x1c, 0x0d, 0xf5, 0x73, 0xd3, 0xeb, 0x52, 0x29, - 0x33, 0x4f, 0xb0, 0xe7, 0x5c, 0xf6, 0xdb, 0xb5, - 0x21, 0x6f, 0x35, 0x9a, 0x43, 0x9c, 0x86, 0xeb, - 0x11, 0x95, 0x91, 0x10, 0xa3, 0xbd, 0xe2, 0xe4, - 0x69, 0xac, 0xb1, 0x50, 0xd4, 0xf1, 0x68, 0xe6, - 0x65, 0xb1, 0x96, 0xda, 0xfb, 0xf0, 0x13, 0x06, - 0xa4, 0x63, 0xb6, 0xdb, 0x79, 0x2b, 0x3a, 0xc9, - 0x98, 0x7a, 0x2c, 0x37, 0xf9, 0x4f, 0xa6, 0x93, - 0x9d, 0x3b, 0xb3, 0x06, 0x63, 0xe2, 0xf6, 0x92, - 0x07, 0xe2, 0x82, 0xfd, 0xb5, 0x08, 0x9b, 0x79, - 0x79, 0x78, 0x3b, 0xee, 0x28, 0x54, 0x81, 0x5d, - 0x7a, 0xa3, 0x81, 0x93, 0xa9, 0xc2, 0x59, 0x3f, - 0xb3, 0xc5, 0xcd, 0x89, 0xa2, 0x31, 0xc2, 0xf0, - 0x84, 0x8c, 0x2e, 0x0a, 0xa4, 0x2f, 0x9c, 0xf2, - 0x54, 0x56, 0xec, 0x75, 0x39, 0xd7, 0x92, 0x53, - 0x60, 0x58, 0xf8, 0x81, 0x84, 0x0c, 0x99, 0xc4, - 0x6f, 0x88, 0xf8, 0x6e, 0x6d, 0xd6, 0x08, 0x47, - 0x6a, 0xa4, 0x79, 0xbc, 0xeb, 0x1e, 0x67, 0xd7, - 0xdf, 0x0c, 0x52, 0xdc, 0x74, 0x40, 0x39, 0x17, - 0xdc, 0xd9, 0x13, 0x72, 0x58, 0xc5, 0x30, 0xda, - 0xad, 0x76, 0xa9, 0x9a, 0xad, 0xed, 0xfb, 0x4b, - 0x4e, 0x60, 0xde, 0xc9, 0x18, 0xa0, 0x77, 0x50, - 0x54, 0xfa, 0x00, 0xd6, 0xa9, 0x52, 0xfe, 0x67, - 0x3e, 0xe9, 0xdf, 0x46, 0x14, 0x6c, 0xfb, 0x50, - 0xd6, 0x21, 0xf6, 0xe5, 0xf7, 0x99, 0x38, 0xad, - 0x65, 0xa5, 0x6c, 0x4e, 0x21, 0x31, 0x77, 0x7a, - 0xdc, 0x6f, 0x5d, 0xb5, 0x7f, 0x63, 0xf4, 0xa8, - 0xee, 0x0d, 0x68, 0x10, 0xde, 0x5b, 0x45, 0x4b, - 0x03, 0xd8, 0x55, 0x04, 0x15, 0x6e, 0xc6, 0xb7, - 0xc1, 0x30, 0x29, 0x6a, 0x6c, 0x26, 0xe8, 0x41, - 0x53, 0xb9, 0x82, 0x67, 0x5b, 0xfe, 0xa9, 0x5f, - 0x0b, 0xf8, 0x38, 0xf8, 0xbe, 0x3c, 0x26, 0xf2, - 0x83, 0x94, 0xd6, 0x45, 0x64, 0x1f, 0x17, 0x20, - 0x4d, 0xae, 0x4a, 0x15, 0x27, 0x7d, 0x7f, 0x3b, - 0x71, 0x3c, 0x3a, 0xc3, 0x56, 0x1b, 0xe5, 0xbd, - 0x34, 0x4b, 0x3f, 0x88, 0x3e, 0xcc, 0x98, 0xb5, - 0x5e, 0x8b, 0xab, 0x18, 0x98, 0xf0, 0xef, 0x1b, - 0x78, 0x15, 0xb7, 0x4a, 0x1f, 0xe3, 0x45, 0xc7, - 0x31, 0x34, 0x5a, 0x7b, 0x6e, 0xb8, 0xea, 0xfe, - 0xaf, 0x34, 0x32, 0x45, 0xfa, 0x3e, 0x75, 0x8a, - 0x30, 0x3f, 0xed, 0xe5, 0xfe, 0x66, 0x15, 0xc7, - 0xbe, 0xd9, 0xc7, 0x27, 0x3c, 0x26, 0x66, 0x2d, - 0xa1, 0x0b, 0xb9, 0x1e, 0x17, 0x44, 0xd3, 0x4b, - 0xe6, 0x30, 0x85, 0x9e, 0x29, 0x3d, 0xa9, 0x35, - 0xca, 0x61, 0xea, 0x22, 0x76, 0xdb, 0xce, 0x82, - 0xfe, 0x8b, 0xac, 0xd3, 0x09, 0x90, 0xad, 0xf2, - 0x42, 0x45, 0x8b, 0xbd, 0xad, 0x34, 0x56, 0x67, - 0x3a, 0x81, 0x3d, 0x95, 0x37, 0x72, 0xe6, 0xcc, - 0x20, 0xe7, 0x09, 0x84, 0x99, 0x8b, 0x1a, 0x68, - 0x5f, 0x4e, 0x00, 0x14, 0x3e, 0x94, 0xa7, 0x15, - 0xab, 0xdd, 0x01, 0x2f, 0x9d, 0x57, 0xce, 0x24, - 0x40, 0x97, 0x5e, 0x62, 0x7c, 0x4f, 0xe7, 0x1d, - 0x53, 0x79, 0x05, 0x52, 0x5d, 0xc9, 0xc6, 0xe0, - 0x47, 0xc1, 0xb5, 0x7f, 0x47, 0x28, 0x7d, 0x0b, - 0xa8, 0x51, 0x27, 0xb9, 0x21, 0x97, 0x2d, 0x5b, - 0x03, 0x94, 0x30, 0x63, 0xa5, 0x02, 0x04, 0xf0, - 0x53, 0x53, 0x23, 0xfa, 0x81, 0xd1, 0x31, 0x3b, - 0x63, 0x5d, 0x61, 0x3b, 0x44, 0x19, 0xb2, 0x24, - 0x15, 0x79, 0x54, 0xb0, 0x57, 0x8c, 0x17, 0x0d, - 0x36, 0xad, 0xa3, 0x08, 0x71, 0x60, 0x85, 0xc9, - 0x5e, 0x7b, 0x55, 0x85, 0x8a, 0x90, 0x0b, 0x2c, - 0x2b, 0x9a, 0x5d, 0xb6, 0x0e, 0xb6, 0xa6, 0x1d, - 0xb1, 0xf5, 0xe1, 0xae, 0xf9, 0x94, 0xb6, 0x3d, - 0xd0, 0xad, 0x5b, 0xa7, 0x3a, 0x66, 0xd0, 0x31, - 0x45, 0xcc, 0xb7, 0x7f, 0xce, 0x0f, 0x07, 0x2e, - 0x64, 0x11, 0xe0, 0xcd, 0xac, 0xdb, 0x75, 0xb1, - 0x5a, 0x4a, 0x5b, 0x15, 0x6a, 0xe2, 0x28, 0x8c, - 0x6d, 0xe5, 0x5a, 0x82, 0x62, 0xeb, 0xfc, 0xf5, - 0x9b, 0x67, 0xa0, 0x79, 0x75, 0x24, 0x2e, 0xd4, - 0x3b, 0x53, 0xd4, 0xec, 0x6b, 0x0f, 0x43, 0x22, - 0xe3, 0xc3, 0x75, 0x83, 0x2d, 0x64, 0x5f, 0x8a, - 0x79, 0x49, 0x5f, 0x1a, 0x81, 0xeb, 0xd5, 0x47, - 0xc9, 0xe7, 0xa8, 0x14, 0xd9, 0xcc, 0xb0, 0xa4, - 0xea, 0xfc, 0x12, 0x23, 0xb3, 0x1b, 0x7a, 0xac, - 0x0f, 0x6a, 0x86, 0x4c, 0x4b, 0x91, 0x13, 0xa3, - 0x52, 0x51, 0x69, 0xc8, 0xff, 0x52, 0x8f, 0x44 -}; - -static const struct aes_vector aes_vectors[] = { - {K1, IV1, P1, sizeof(P1), C1, sizeof(K1)}, - {K2, IV2, P2, sizeof(P2), C2, sizeof(K2)}, - {K3, IV3, P3, sizeof(P3), C3, sizeof(K3)}, - {K4, IV4, P4, sizeof(P4), C4, sizeof(K4)}, - {K5, IV5, P5, sizeof(P5), C5, sizeof(K5)}, - {K6, IV6, P6, sizeof(P6), C6, sizeof(K6)}, - {K7, IV7, P7, sizeof(P7), C7, sizeof(K7)}, -}; - -/* =================================================================== */ -/* =================================================================== */ - /* DOCSIS: AES-128 CFB */ static const uint8_t DK1[] = { 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab, @@ -2199,112 +1635,6 @@ check_burst_jobs: return ret; } -static int -test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const unsigned text_len, - const int dir, - const IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) -{ - struct IMB_JOB *job, jobs[MAX_BURST_JOBS]; - uint8_t padding[16]; - uint8_t **targets = malloc(num_jobs * sizeof(void *)); - int i, completed_jobs, jobs_rx = 0, ret = -1; - - if (targets == NULL) - goto end_alloc; - - memset(targets, 0, num_jobs * sizeof(void *)); - memset(padding, -1, sizeof(padding)); - - for (i = 0; i < num_jobs; i++) { - targets[i] = malloc(text_len + (sizeof(padding) * 2)); - if (targets[i] == NULL) - goto end_alloc; - memset(targets[i], -1, text_len + (sizeof(padding) * 2)); - if (in_place) { - /* copy input text to the allocated buffer */ - memcpy(targets[i] + sizeof(padding), in_text, text_len); - } - } - - for (i = 0; i < num_jobs; i++) { - job = &jobs[i]; - - /* only set fields for generic burst API */ - if (!in_place) { - job->dst = targets[i] + sizeof(padding); - job->src = in_text; - } else { - job->dst = targets[i] + sizeof(padding); - job->src = targets[i] + sizeof(padding); - } - - job->enc_keys = enc_keys; - job->dec_keys = dec_keys; - job->iv = iv; - job->iv_len_in_bytes = 16; - job->cipher_start_src_offset_in_bytes = 0; - job->msg_len_to_cipher_in_bytes = text_len; - job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); - } - - completed_jobs = IMB_SUBMIT_CIPHER_BURST(mb_mgr, jobs, num_jobs, - cipher, dir, key_len); - if (completed_jobs != num_jobs) { - int err = imb_get_errno(mb_mgr); - - if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); - goto end; - } else { - printf("submit_burst error: not enough " - "jobs returned!\n"); - goto end; - } - } - - for (i = 0; i < num_jobs; i++) { - job = &jobs[i]; - - if (job->status != IMB_STATUS_COMPLETED) { - printf("job %d status not complete!\n", i+1); - goto end; - } - - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) - goto end; - jobs_rx++; - } - - if (jobs_rx != num_jobs) { - printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); - goto end; - } - ret = 0; - - end: - - end_alloc: - if (targets != NULL) { - for (i = 0; i < num_jobs; i++) - free(targets[i]); - free(targets); - } - - return ret; -} - static void test_aes_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, @@ -2455,63 +1785,6 @@ test_aes_vectors(struct IMB_MGR *mb_mgr, } else { test_suite_update(ctx, 1, 0); } - - /** - * Test cipher only burst API - * Currently only AES-CBC supported - */ - if (cipher != IMB_CIPHER_CBC) - continue; - - if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt cipher burst\n", vect + 1); - test_suite_update(ctx, 0, 1); - } else { - test_suite_update(ctx, 1, 0); - } - - if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt cipher burst\n", vect + 1); - test_suite_update(ctx, 0, 1); - } else { - test_suite_update(ctx, 1, 0); - } - - if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt cipher burst " - "in-place\n", vect + 1); - test_suite_update(ctx, 0, 1); - } else { - test_suite_update(ctx, 1, 0); - } - - if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt cipher " - "burst in-place\n", vect + 1); - test_suite_update(ctx, 0, 1); - } else { - test_suite_update(ctx, 1, 0); - } } if (!quiet_mode) printf("\n"); @@ -2906,20 +2179,6 @@ aes_test(struct IMB_MGR *mb_mgr) struct test_suite_context ctx192; struct test_suite_context ctx256; - test_suite_start(&ctx128, "AES-CBC-128"); - test_suite_start(&ctx192, "AES-CBC-192"); - test_suite_start(&ctx256, "AES-CBC-256"); - for (i = 0; i < DIM(num_jobs_tab); i++) - test_aes_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, - DIM(aes_vectors), - aes_vectors, - "AES-CBC standard test vectors", - IMB_CIPHER_CBC, - num_jobs_tab[i]); - errors += test_suite_end(&ctx128); - errors += test_suite_end(&ctx192); - errors += test_suite_end(&ctx256); - test_suite_start(&ctx128, "DOCSIS-SEC-128"); test_suite_start(&ctx256, "DOCSIS-SEC-256"); for (i = 0; i < DIM(num_jobs_tab); i++) diff --git a/test/kat-app/main.c b/test/kat-app/main.c index a5b4d3dd..4b39f78f 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -65,6 +65,7 @@ extern int direct_api_param_test(struct IMB_MGR *mb_mgr); extern int quic_ecb_test(struct IMB_MGR *mb_mgr); extern int gmac_test(struct IMB_MGR *mb_mgr); extern int ghash_test(struct IMB_MGR *mb_mgr); +extern int cbc_test(struct IMB_MGR *mb_mg); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); @@ -96,6 +97,11 @@ struct imb_test tests[] = { .fn = do_test, .enabled = 1 }, + { + .str = "CBC", + .fn = cbc_test, + .enabled = 1 + }, { .str = "CTR", .fn = ctr_test, diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index d7c7a8b5..51295071 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cbcs_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 5bed740e48ea56f77224efe17483be3b53206b62 Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Tue, 20 Jun 2023 09:50:17 +0100 Subject: [PATCH 005/204] test: [CFB] Unify test vectors --- test/kat-app/CMakeLists.txt | 2 + test/kat-app/Makefile | 4 +- test/kat-app/aes_cfb_test.c | 179 +++++++++++++++ test/kat-app/aes_cfb_test.json.c | 114 ++++++++++ test/kat-app/aes_test.c | 367 ------------------------------- test/kat-app/main.c | 6 + test/kat-app/win_x64.mak | 2 +- 7 files changed, 304 insertions(+), 370 deletions(-) create mode 100644 test/kat-app/aes_cfb_test.c create mode 100644 test/kat-app/aes_cfb_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 5703550e..ee6427cb 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -86,6 +86,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/gmac_test.c ${CMAKE_CURRENT_SOURCE_DIR}/ghash_test.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.c + ${CMAKE_CURRENT_SOURCE_DIR}/aes_cfb_test.c ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha1.json.c ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha224.json.c ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256.json.c @@ -100,6 +101,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/sha_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbcs_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/aes_cfb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index d026aa5f..47b323cd 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -40,8 +40,8 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ chacha20_poly1305_test.c null_test.c snow_v_test.c direct_api_param_test.c quic_ecb_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ - cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c \ - aes_cbc_test.c aes_cbc_test.json.c + cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ + aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/aes_cfb_test.c b/test/kat-app/aes_cfb_test.c new file mode 100644 index 00000000..30758e07 --- /dev/null +++ b/test/kat-app/aes_cfb_test.c @@ -0,0 +1,179 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include +#include +#include +#include +#include + +#include + +#include "utils.h" +#include "cipher_test.h" + +#define MAX_BURST_JOBS 64 + + +int cfb_test(struct IMB_MGR *mb_mgr); + +extern const struct cipher_test cfb_test_json[]; + +static int +cfb_validate_ok(const uint8_t *output, const uint8_t *in_text, + const size_t plen, const uint32_t klen, + const unsigned i, const unsigned is_enc, + const int in_place) +{ + if (memcmp(output, in_text, plen) != 0) { + printf("\nAES-CFB%s standard test vector %u %s (%s): fail\n", + (klen == 16) ? "128" : "256", + i + 1, (is_enc) ? "encrypt" : "decrypt", + (in_place) ? "in-place" : "out-of-place"); + return 0; + } + +#ifdef DEBUG + if (!quiet_mode) { + printf("Standard test vector %u %s %s\n", i + 1, + (in_place) ? "in-place" : "out-of-place", + (is_enc) ? "encrypt" : "decrypt"); + } +#endif + return 1; +} + +static int +cfb_validate(struct IMB_MGR *mb_mgr, const struct cipher_test *p_vec) +{ + uint8_t output1[16]; + uint8_t output2[16]; + const uint32_t kLength = (unsigned) p_vec->keySize / 8; + DECLARE_ALIGNED(uint32_t keys_enc[15*4], 16); + DECLARE_ALIGNED(uint32_t keys_dec[15*4], 16); + + if (kLength == 16) + IMB_AES_KEYEXP_128(mb_mgr, p_vec->key, keys_enc, keys_dec); + else + IMB_AES_KEYEXP_256(mb_mgr, p_vec->key, keys_enc, keys_dec); + /* Out of place */ + + /* encrypt test */ + if (kLength == 16) + IMB_AES128_CFB_ONE(mb_mgr, output1, (const void *) p_vec->msg, + p_vec->iv, keys_enc, p_vec->msgSize / 8); + else + IMB_AES256_CFB_ONE(mb_mgr, output1, (const void *) p_vec->msg, + p_vec->iv, keys_enc, p_vec->msgSize / 8); + if (!cfb_validate_ok(output1, (const void *) p_vec->ct, p_vec->msgSize / 8, + (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 1, 0)) + return 0; + + /* decrypt test */ + if (kLength == 16) + IMB_AES128_CFB_ONE(mb_mgr, output2, output1, p_vec->iv, + keys_enc, p_vec->msgSize / 8); + else + IMB_AES256_CFB_ONE(mb_mgr, output2, output1, p_vec->iv, + keys_enc, p_vec->msgSize / 8); + if (!cfb_validate_ok(output2, (const void *) p_vec->msg, p_vec->msgSize / 8, + (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 0, 0)) + return 0; + /* In place */ + + /* encrypt test */ + memcpy(output1, (const void *) p_vec->msg, p_vec->msgSize / 8); + if (kLength == 16) + IMB_AES128_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, + keys_enc, p_vec->msgSize / 8); + else + IMB_AES256_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, + keys_enc, p_vec->msgSize / 8); + if (!cfb_validate_ok(output1, (const void *) p_vec->ct, p_vec->msgSize / 8, + (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 1, 1)) + return 0; + + /* decrypt test */ + memcpy(output1, (const void *) p_vec->ct, p_vec->msgSize / 8); + if (kLength == 16) + IMB_AES128_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, + keys_enc, p_vec->msgSize / 8); + else + IMB_AES256_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, + keys_enc, p_vec->msgSize / 8); + if (!cfb_validate_ok(output1, (const void *) p_vec->msg, p_vec->msgSize / 8, + (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 0, 1)) + return 0; + return 1; +} + +static void +cfb_test_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, + struct test_suite_context *ctx256) +{ + const struct cipher_test *v = cfb_test_json; + + for (; v->msg != NULL; v++) { + struct test_suite_context *ctx; + + if (!quiet_mode) { +#ifdef DEBUG + printf("AES-CFB Test Case %zu key_len:%zu\n", + v->tcId, v->keySize); +#else + printf("."); +#endif + } + + if (v->keySize == 128) + ctx = ctx128; + else + ctx = ctx256; + if (!cfb_validate(mb_mgr, v)) + test_suite_update(ctx, 0, 1); + else + test_suite_update(ctx, 1, 0); + } + if (!quiet_mode) + printf("\n"); +} + +int +cfb_test(struct IMB_MGR *mb_mgr) +{ + int errors = 0; + struct test_suite_context ctx128; + struct test_suite_context ctx256; + + test_suite_start(&ctx128, "AES-CFB-128"); + test_suite_start(&ctx256, "AES-CFB-256"); + cfb_test_vectors(mb_mgr, &ctx128, &ctx256); + errors += test_suite_end(&ctx128); + errors += test_suite_end(&ctx256); + + return errors; +} diff --git a/test/kat-app/aes_cfb_test.json.c b/test/kat-app/aes_cfb_test.json.c new file mode 100644 index 00000000..20dcfd66 --- /dev/null +++ b/test/kat-app/aes_cfb_test.json.c @@ -0,0 +1,114 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* CFB */ +#include "cipher_test.h" +const struct cipher_test cfb_test_json[] = { + /* Vectors from CM-SP-SECv3.1-I06-160602 section I.10.2 */ + {128, 128, 1, + "\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef", + "\x12\x34\x56\x78\x90\xab\xcd\xef\x12\x34\x56\x78\x90\xab\xcd\xef", + "\x4e\x6f\x77\x20\x69\x73\x20\x74\x68\x65\x20\x74\x69\x6d\x65\x20", + "\x43\xbc\x0a\xd0\xfc\x8d\x93\xff\x80\xe0\xbf\xf1\x41\xfc\x67\x08", 1, + 128}, + {128, 128, 2, + "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", + "\x9d\xd1\x67\x4b\xba\x61\x10\x1b\x56\x75\x64\x74\x36\x4f\x10\x1d", + "\xd2\xd1\x9f", "\x44\xd4\x73", 1, 24}, + /* Vectors from + * https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf + */ + {128, 128, 3, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", + "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20\x33\x34\x49\xf8\xe8\x3c\xfb\x4a", 1, + 128}, + {128, 128, 4, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20\x33\x34\x49\xf8\xe8\x3c\xfb\x4a", + "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", + "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", 1, + 128}, + {128, 128, 5, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", + "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef", + "\x26\x75\x1f\x67\xa3\xcb\xb1\x40\xb1\x80\x8c\xf1\x87\xa4\xf4\xdf", 1, + 128}, + {128, 128, 6, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x26\x75\x1f\x67\xa3\xcb\xb1\x40\xb1\x80\x8c\xf1\x87\xa4\xf4\xdf", + "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xc0\x4b\x05\x35\x7c\x5d\x1c\x0e\xea\xc4\xc6\x6f\x9f\xf7\xf2\xe6", 1, + 128}, + {128, 128, 7, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96", "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20", 1, + 64}, + {128, 128, 8, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", + "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11", "\x26\x75\x1f\x67\xa3\xcb\xb1\x40", 1, + 64}, + {128, 256, 9, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", + "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", 1, + 128}, + {128, 256, 10, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", + "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", + "\x39\xff\xed\x14\x3b\x28\xb1\xc8\x32\x11\x3c\x63\x31\xe5\x40\x7b", 1, + 128}, + {128, 256, 11, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x39\xff\xed\x14\x3b\x28\xb1\xc8\x32\x11\x3c\x63\x31\xe5\x40\x7b", + "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef", + "\xdf\x10\x13\x24\x15\xe5\x4b\x92\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9", 1, + 128}, + {128, 256, 12, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xdf\x10\x13\x24\x15\xe5\x4b\x92\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9", + "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x75\xa3\x85\x74\x1a\xb9\xce\xf8\x20\x31\x62\x3d\x55\xb1\xe4\x71", 1, + 128}, + {128, 256, 13, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", + "\xae\x2d\x8a\x57\x1e\x03\xac\x9c", "\x39\xff\xed\x14\x3b\x28\xb1\xc8", 1, + 64}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; diff --git a/test/kat-app/aes_test.c b/test/kat-app/aes_test.c index 7dba1bdc..e60bb0c7 100644 --- a/test/kat-app/aes_test.c +++ b/test/kat-app/aes_test.c @@ -315,230 +315,6 @@ static const struct aes_vector docsis_vectors[] = { {DK6, DIV6, DP6, sizeof(DP6), DC6, sizeof(DK6)}, }; -/* =================================================================== */ -/* =================================================================== */ -/* Test vectors from CM-SP-SECv3.1-I06-160602 section I.10.2 */ - -static const uint8_t CFBK1[] = { - 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, - 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef -}; -static const uint8_t CFBIV1[] = { - 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, - 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef -}; -static const uint8_t CFBP1[] = { - 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 -}; -static const uint8_t CFBC1[] = { - 0x43, 0xbc, 0x0a, 0xd0, 0xfc, 0x8d, 0x93, 0xff, - 0x80, 0xe0, 0xbf, 0xf1, 0x41, 0xfc, 0x67, 0x08 -}; - -static const uint8_t CFBK2[] = { - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab, - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab -}; -static const uint8_t CFBIV2[] = { - 0x9d, 0xd1, 0x67, 0x4b, 0xba, 0x61, 0x10, 0x1b, - 0x56, 0x75, 0x64, 0x74, 0x36, 0x4f, 0x10, 0x1d -}; -static const uint8_t CFBP2[] = { - 0xd2, 0xd1, 0x9f -}; -static const uint8_t CFBC2[] = { - 0x44, 0xd4, 0x73 -}; - -/* =================================================================== */ -/* =================================================================== */ - -/* - * Test vectors from - * https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf - */ - -/* 128-Bit */ -static const uint8_t CFBK3[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t CFBIV3[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t CFBP3[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a -}; -static const uint8_t CFBC3[] = { - 0x3b, 0x3f, 0xd9, 0x2e, 0xb7, 0x2d, 0xad, 0x20, - 0x33, 0x34, 0x49, 0xf8, 0xe8, 0x3c, 0xfb, 0x4a -}; - -static const uint8_t CFBK4[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t CFBIV4[] = { - 0x3b, 0x3f, 0xd9, 0x2e, 0xb7, 0x2d, 0xad, 0x20, - 0x33, 0x34, 0x49, 0xf8, 0xe8, 0x3c, 0xfb, 0x4a -}; -static const uint8_t CFBP4[] = { - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51 -}; -static const uint8_t CFBC4[] = { - 0xc8, 0xa6, 0x45, 0x37, 0xa0, 0xb3, 0xa9, 0x3f, - 0xcd, 0xe3, 0xcd, 0xad, 0x9f, 0x1c, 0xe5, 0x8b -}; - -static const uint8_t CFBK5[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t CFBIV5[] = { - 0xc8, 0xa6, 0x45, 0x37, 0xa0, 0xb3, 0xa9, 0x3f, - 0xcd, 0xe3, 0xcd, 0xad, 0x9f, 0x1c, 0xe5, 0x8b -}; -static const uint8_t CFBP5[] = { - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef -}; -static const uint8_t CFBC5[] = { - 0x26, 0x75, 0x1f, 0x67, 0xa3, 0xcb, 0xb1, 0x40, - 0xb1, 0x80, 0x8c, 0xf1, 0x87, 0xa4, 0xf4, 0xdf -}; - -static const uint8_t CFBK6[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t CFBIV6[] = { - 0x26, 0x75, 0x1f, 0x67, 0xa3, 0xcb, 0xb1, 0x40, - 0xb1, 0x80, 0x8c, 0xf1, 0x87, 0xa4, 0xf4, 0xdf -}; -static const uint8_t CFBP6[] = { - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t CFBC6[] = { - 0xc0, 0x4b, 0x05, 0x35, 0x7c, 0x5d, 0x1c, 0x0e, - 0xea, 0xc4, 0xc6, 0x6f, 0x9f, 0xf7, 0xf2, 0xe6 -}; - -static const uint8_t CFBK7[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t CFBIV7[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t CFBP7[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96 -}; -static const uint8_t CFBC7[] = { - 0x3b, 0x3f, 0xd9, 0x2e, 0xb7, 0x2d, 0xad, 0x20 -}; -static const uint8_t CFBK8[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t CFBIV8[] = { - 0xc8, 0xa6, 0x45, 0x37, 0xa0, 0xb3, 0xa9, 0x3f, - 0xcd, 0xe3, 0xcd, 0xad, 0x9f, 0x1c, 0xe5, 0x8b -}; -static const uint8_t CFBP8[] = { - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11 -}; -static const uint8_t CFBC8[] = { - 0x26, 0x75, 0x1f, 0x67, 0xa3, 0xcb, 0xb1, 0x40 -}; - -/* 256-Bit */ -static const uint8_t CFBK9[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; -static const uint8_t CFBIV9[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t CFBP9[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a -}; -static const uint8_t CFBC9[] = { - 0xdc, 0x7e, 0x84, 0xbf, 0xda, 0x79, 0x16, 0x4b, - 0x7e, 0xcd, 0x84, 0x86, 0x98, 0x5d, 0x38, 0x60 -}; -static const uint8_t CFBIV10[] = { - 0xdc, 0x7e, 0x84, 0xbf, 0xda, 0x79, 0x16, 0x4b, - 0x7e, 0xcd, 0x84, 0x86, 0x98, 0x5d, 0x38, 0x60 -}; -static const uint8_t CFBP10[] = { - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51 -}; -static const uint8_t CFBC10[] = { - 0x39, 0xff, 0xed, 0x14, 0x3b, 0x28, 0xb1, 0xc8, - 0x32, 0x11, 0x3c, 0x63, 0x31, 0xe5, 0x40, 0x7b -}; -static const uint8_t CFBIV11[] = { - 0x39, 0xff, 0xed, 0x14, 0x3b, 0x28, 0xb1, 0xc8, - 0x32, 0x11, 0x3c, 0x63, 0x31, 0xe5, 0x40, 0x7b -}; -static const uint8_t CFBP11[] = { - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef -}; -static const uint8_t CFBC11[] = { - 0xdf, 0x10, 0x13, 0x24, 0x15, 0xe5, 0x4b, 0x92, - 0xa1, 0x3e, 0xd0, 0xa8, 0x26, 0x7a, 0xe2, 0xf9 -}; -static const uint8_t CFBIV12[] = { - 0xdf, 0x10, 0x13, 0x24, 0x15, 0xe5, 0x4b, 0x92, - 0xa1, 0x3e, 0xd0, 0xa8, 0x26, 0x7a, 0xe2, 0xf9 -}; -static const uint8_t CFBP12[] = { - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t CFBC12[] = { - 0x75, 0xa3, 0x85, 0x74, 0x1a, 0xb9, 0xce, 0xf8, - 0x20, 0x31, 0x62, 0x3d, 0x55, 0xb1, 0xe4, 0x71 -}; -static const uint8_t CFBIV13[] = { - 0xdc, 0x7e, 0x84, 0xbf, 0xda, 0x79, 0x16, 0x4b, - 0x7e, 0xcd, 0x84, 0x86, 0x98, 0x5d, 0x38, 0x60 -}; -static const uint8_t CFBP13[] = { - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c -}; -static const uint8_t CFBC13[] = { - 0x39, 0xff, 0xed, 0x14, 0x3b, 0x28, 0xb1, 0xc8 -}; - -static struct aes_vector aes_cfb_tab[] = { - {CFBK1, CFBIV1, CFBP1, sizeof(CFBP1), CFBC1, sizeof(CFBK1)}, - {CFBK2, CFBIV2, CFBP2, sizeof(CFBP2), CFBC2, sizeof(CFBK2)}, - {CFBK3, CFBIV3, CFBP3, sizeof(CFBP3), CFBC3, sizeof(CFBK3)}, - {CFBK4, CFBIV4, CFBP4, sizeof(CFBP4), CFBC4, sizeof(CFBK4)}, - {CFBK5, CFBIV5, CFBP5, sizeof(CFBP5), CFBC5, sizeof(CFBK5)}, - {CFBK6, CFBIV6, CFBP6, sizeof(CFBP6), CFBC6, sizeof(CFBK6)}, - {CFBK7, CFBIV7, CFBP7, sizeof(CFBP7), CFBC7, sizeof(CFBK7)}, - {CFBK8, CFBIV8, CFBP8, sizeof(CFBP8), CFBC8, sizeof(CFBK8)}, - {CFBK9, CFBIV9, CFBP9, sizeof(CFBP9), CFBC9, sizeof(CFBK9)}, - {CFBK9, CFBIV10, CFBP10, sizeof(CFBP10), CFBC10, sizeof(CFBK9)}, - {CFBK9, CFBIV11, CFBP11, sizeof(CFBP11), CFBC11, sizeof(CFBK9)}, - {CFBK9, CFBIV12, CFBP12, sizeof(CFBP12), CFBC12, sizeof(CFBK9)}, - {CFBK9, CFBIV13, CFBP13, sizeof(CFBP13), CFBC13, sizeof(CFBK9)}, -}; - /* =================================================================== */ /* =================================================================== */ /* DOCSIS with CRC: AES CBC + CFB + CRC32 */ @@ -2032,141 +1808,6 @@ test_docrc_vectors(struct IMB_MGR *mb_mgr, printf("\n"); } -static int -cfb_validate_ok(const uint8_t *output, const uint8_t *in_text, - const size_t plen, const uint32_t klen, - const unsigned i, const unsigned is_enc, - const int in_place) -{ - if (memcmp(output, in_text, plen) != 0) { - printf("\nAES-CFB%s standard test vector %u %s (%s): fail\n", - (klen == 16) ? "128" : "256", - i + 1, (is_enc) ? "encrypt" : "decrypt", - (in_place) ? "in-place" : "out-of-place"); - return 0; - } - -#ifdef DEBUG - if (!quiet_mode) { - printf("Standard test vector %u %s %s\n", i + 1, - (in_place) ? "in-place" : "out-of-place", - (is_enc) ? "encrypt" : "decrypt"); - } -#endif - return 1; -} - -static int -cfb_validate(struct IMB_MGR *mb_mgr, - const struct aes_vector *p_vec, - const unsigned i) -{ - uint8_t output1[16]; - uint8_t output2[16]; - const uint32_t kLength = p_vec->Klen; - DECLARE_ALIGNED(uint32_t keys_enc[15*4], 16); - DECLARE_ALIGNED(uint32_t keys_dec[15*4], 16); - - if (kLength == 16) - IMB_AES_KEYEXP_128(mb_mgr, p_vec->K, - keys_enc, keys_dec); - else - IMB_AES_KEYEXP_256(mb_mgr, p_vec->K, - keys_enc, keys_dec); - /* Out of place */ - - /* encrypt test */ - if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output1, p_vec->P, - p_vec->IV, keys_enc, - p_vec->Plen); - else - IMB_AES256_CFB_ONE(mb_mgr, output1, p_vec->P, - p_vec->IV, keys_enc, - p_vec->Plen); - if (!cfb_validate_ok(output1, p_vec->C, - p_vec->Plen, p_vec->Klen, i, 1, 0)) - return 0; - - /* decrypt test */ - if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output2, output1, - p_vec->IV, keys_enc, - p_vec->Plen); - else - IMB_AES256_CFB_ONE(mb_mgr, output2, output1, - p_vec->IV, keys_enc, - p_vec->Plen); - if (!cfb_validate_ok(output2, p_vec->P, - p_vec->Plen, p_vec->Klen, i, 0, 0)) - return 0; - /* In place */ - - /* encrypt test */ - memcpy(output1, p_vec->P, p_vec->Plen); - if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output1, output1, - p_vec->IV, keys_enc, - p_vec->Plen); - else - IMB_AES256_CFB_ONE(mb_mgr, output1, output1, - p_vec->IV, keys_enc, - p_vec->Plen); - if (!cfb_validate_ok(output1, p_vec->C, - p_vec->Plen, p_vec->Klen, i, 1, 1)) - return 0; - - /* decrypt test */ - memcpy(output1, p_vec->C, p_vec->Plen); - if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output1, output1, - p_vec->IV, keys_enc, - p_vec->Plen); - else - IMB_AES256_CFB_ONE(mb_mgr, output1, output1, - p_vec->IV, keys_enc, - p_vec->Plen); - if (!cfb_validate_ok(output1, p_vec->P, - p_vec->Plen, p_vec->Klen, i, 0, 1)) - return 0; - return 1; -} - -static void -cfb_test_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, - struct test_suite_context *ctx256, const int num_jobs) -{ - unsigned vect; - - if (!quiet_mode) - printf("AES-CFB test vectors (N jobs = %d):\n", num_jobs); - for (vect = 0; vect < DIM(aes_cfb_tab); vect++) { - struct test_suite_context *ctx; - - if (!quiet_mode) { -#ifdef DEBUG - printf("[%d/%lu] Standard %s-bit vector\n", - vect + 1, - (unsigned long) DIM(aes_cfb_tab), - (aes_cfb_tab[vect].Klen == 16) ? "128" : "256"); -#else - printf("."); -#endif - } - - if (aes_cfb_tab[vect].Klen == 16) - ctx = ctx128; - else - ctx = ctx256; - if (!cfb_validate(mb_mgr, &aes_cfb_tab[vect], vect)) - test_suite_update(ctx, 0, 1); - else - test_suite_update(ctx, 1, 0); - } - if (!quiet_mode) - printf("\n"); -} - int aes_test(struct IMB_MGR *mb_mgr) { @@ -2191,14 +1832,6 @@ aes_test(struct IMB_MGR *mb_mgr) errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx256); - test_suite_start(&ctx128, "AES-CFB-128"); - test_suite_start(&ctx256, "AES-CFB-256"); - for (i = 0; i < DIM(num_jobs_tab); i++) - cfb_test_vectors(mb_mgr, &ctx128, &ctx256, num_jobs_tab[i]); - errors += test_suite_end(&ctx128); - errors += test_suite_end(&ctx256); - - test_suite_start(&ctx128, "DOCSIS-SEC-128-CRC32"); test_suite_start(&ctx256, "DOCSIS-SEC-256-CRC32"); for (i = 0; i < DIM(num_jobs_tab); i++) diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 4b39f78f..9236aca9 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -66,6 +66,7 @@ extern int quic_ecb_test(struct IMB_MGR *mb_mgr); extern int gmac_test(struct IMB_MGR *mb_mgr); extern int ghash_test(struct IMB_MGR *mb_mgr); extern int cbc_test(struct IMB_MGR *mb_mg); +extern int cfb_test(struct IMB_MGR *mb_mg); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); @@ -102,6 +103,11 @@ struct imb_test tests[] = { .fn = cbc_test, .enabled = 1 }, + { + .str = "CFB", + .fn = cfb_test, + .enabled = 1 + }, { .str = "CTR", .fn = ctr_test, diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 51295071..e7597469 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 4cca6c4e109609e839ebdeb22e1cf6fdc1c741b2 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 21 Jun 2023 11:23:36 +0100 Subject: [PATCH 006/204] lib: fix maximum tag length --- lib/ipsec-mb.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 6c22e366..121acb37 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -610,10 +610,9 @@ struct chacha20_poly1305_context_data { }; /** - * Authenticated Tag Length in bytes. - * Valid values are 16 (most likely), 12 or 8. + * Maximum Authenticated Tag Length in bytes. */ -#define IMB_MAX_TAG_LEN (16) +#define IMB_MAX_TAG_LEN (64) /** * IV data is limited to 16 bytes as follows: -- GitLab From 3f6746d3123b1719301a14ae19956cc8cd78b88e Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 21 Jun 2023 11:24:01 +0100 Subject: [PATCH 007/204] lib: add CCM AAD maximum size --- lib/include/mb_mgr_job_check.h | 2 +- lib/ipsec-mb.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 343af13a..5fddc0f5 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -1093,7 +1093,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); return 1; } - if (job->u.CCM.aad_len_in_bytes > 46) { + if (job->u.CCM.aad_len_in_bytes > IMB_CCM_AAD_MAX_SIZE) { /* 3 x AES_BLOCK - 2 bytes for AAD len */ imb_set_errno(state, IMB_ERR_JOB_AAD_LEN); return 1; diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 121acb37..c47929d1 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -632,6 +632,7 @@ struct chacha20_poly1305_context_data { #define IMB_GCM_ENC_KEY_LEN 16 #define IMB_GCM_KEY_SETS (15) /**< exp key + 14 exp round keys*/ +#define IMB_CCM_AAD_MAX_SIZE (46) /* Maximum CCM AAD size */ /** * @brief holds intermediate key data needed to improve performance * -- GitLab From 97e433d1c359564a612ba3d52ef422c3be3a01c1 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 16 Jun 2023 12:05:49 +0100 Subject: [PATCH 008/204] perf: rename variables --- perf/ipsec_perf.c | 188 ++++++++++++++++++++++------------------------ 1 file changed, 89 insertions(+), 99 deletions(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index b9673e76..270bc79d 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -214,8 +214,8 @@ struct params_s { IMB_CIPHER_DIRECTION cipher_dir; enum test_cipher_mode_e cipher_mode; enum test_hash_alg_e hash_alg; - uint32_t aes_key_size; - uint32_t size_aes; + uint32_t key_size; + uint32_t job_size; uint64_t aad_size; uint32_t num_sizes; uint32_t core; @@ -224,7 +224,7 @@ struct params_s { struct custom_job_params { enum test_cipher_mode_e cipher_mode; enum test_hash_alg_e hash_alg; - uint32_t aes_key_size; + uint32_t key_size; IMB_CIPHER_DIRECTION cipher_dir; }; @@ -254,84 +254,74 @@ const struct str_value_mapping arch_str_map[] = { { .name = "AARCH64", const struct str_value_mapping cipher_algo_str_map[] = { #ifndef __aarch64__ { .name = "aes-cbc-128", - .values.job_params = { .cipher_mode = TEST_CBC, .aes_key_size = IMB_KEY_128_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CBC, .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-cbc-192", - .values.job_params = { .cipher_mode = TEST_CBC, .aes_key_size = IMB_KEY_192_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CBC, .key_size = IMB_KEY_192_BYTES } }, { .name = "aes-cbc-256", - .values.job_params = { .cipher_mode = TEST_CBC, .aes_key_size = IMB_KEY_256_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CBC, .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-ctr-128", - .values.job_params = { .cipher_mode = TEST_CNTR, .aes_key_size = IMB_KEY_128_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR, .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-ctr-192", - .values.job_params = { .cipher_mode = TEST_CNTR, .aes_key_size = IMB_KEY_192_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR, .key_size = IMB_KEY_192_BYTES } }, { .name = "aes-ctr-256", - .values.job_params = { .cipher_mode = TEST_CNTR, .aes_key_size = IMB_KEY_256_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR, .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-ctr8-128", - .values.job_params = { .cipher_mode = TEST_CNTR8, .aes_key_size = IMB_KEY_128_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR8, .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-ctr8-192", - .values.job_params = { .cipher_mode = TEST_CNTR8, .aes_key_size = IMB_KEY_192_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR8, .key_size = IMB_KEY_192_BYTES } }, { .name = "aes-ctr8-256", - .values.job_params = { .cipher_mode = TEST_CNTR8, .aes_key_size = IMB_KEY_256_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR8, .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-ctr-bit-128", - .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN, - .aes_key_size = IMB_KEY_128_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN, .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-ctr-bit-192", - .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN, - .aes_key_size = IMB_KEY_192_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN, .key_size = IMB_KEY_192_BYTES } }, { .name = "aes-ctr-bit-256", - .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN, - .aes_key_size = IMB_KEY_256_BYTES } }, + .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN, .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-ctr-bit4-128", .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN4, - .aes_key_size = IMB_KEY_128_BYTES } }, + .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-ctr-bit4-192", .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN4, - .aes_key_size = IMB_KEY_192_BYTES } }, + .key_size = IMB_KEY_192_BYTES } }, { .name = "aes-ctr-bit4-256", .values.job_params = { .cipher_mode = TEST_CNTR_BITLEN4, - .aes_key_size = IMB_KEY_256_BYTES } }, + .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-ecb-128", - .values.job_params = { .cipher_mode = TEST_ECB, .aes_key_size = IMB_KEY_128_BYTES } }, + .values.job_params = { .cipher_mode = TEST_ECB, .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-ecb-192", - .values.job_params = { .cipher_mode = TEST_ECB, .aes_key_size = IMB_KEY_192_BYTES } }, + .values.job_params = { .cipher_mode = TEST_ECB, .key_size = IMB_KEY_192_BYTES } }, { .name = "aes-ecb-256", - .values.job_params = { .cipher_mode = TEST_ECB, .aes_key_size = IMB_KEY_256_BYTES } }, + .values.job_params = { .cipher_mode = TEST_ECB, .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-docsis-128", - .values.job_params = { .cipher_mode = TEST_AESDOCSIS, - .aes_key_size = IMB_KEY_128_BYTES } }, + .values.job_params = { .cipher_mode = TEST_AESDOCSIS, .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-docsis8-128", - .values.job_params = { .cipher_mode = TEST_AESDOCSIS8, - .aes_key_size = IMB_KEY_128_BYTES } }, + .values.job_params = { .cipher_mode = TEST_AESDOCSIS8, .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-docsis-256", - .values.job_params = { .cipher_mode = TEST_AESDOCSIS, - .aes_key_size = IMB_KEY_256_BYTES } }, + .values.job_params = { .cipher_mode = TEST_AESDOCSIS, .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-docsis8-256", - .values.job_params = { .cipher_mode = TEST_AESDOCSIS8, - .aes_key_size = IMB_KEY_256_BYTES } }, + .values.job_params = { .cipher_mode = TEST_AESDOCSIS8, .key_size = IMB_KEY_256_BYTES } }, { .name = "des-docsis", - .values.job_params = { .cipher_mode = TEST_DESDOCSIS, .aes_key_size = 8 } }, + .values.job_params = { .cipher_mode = TEST_DESDOCSIS, .key_size = 8 } }, { .name = "des-docsis4", - .values.job_params = { .cipher_mode = TEST_DESDOCSIS4, .aes_key_size = 8 } }, - { .name = "des-cbc", .values.job_params = { .cipher_mode = TEST_DES, .aes_key_size = 8 } }, - { .name = "3des-cbc", - .values.job_params = { .cipher_mode = TEST_3DES, .aes_key_size = 8 } }, + .values.job_params = { .cipher_mode = TEST_DESDOCSIS4, .key_size = 8 } }, + { .name = "des-cbc", .values.job_params = { .cipher_mode = TEST_DES, .key_size = 8 } }, + { .name = "3des-cbc", .values.job_params = { .cipher_mode = TEST_3DES, .key_size = 8 } }, #endif /* __aarch64__ */ { .name = "zuc-eea3", - .values.job_params = { .cipher_mode = TEST_ZUC_EEA3, .aes_key_size = 16 } }, + .values.job_params = { .cipher_mode = TEST_ZUC_EEA3, .key_size = 16 } }, { .name = "zuc-eea3-256", - .values.job_params = { .cipher_mode = TEST_ZUC_EEA3, .aes_key_size = 32 } }, + .values.job_params = { .cipher_mode = TEST_ZUC_EEA3, .key_size = 32 } }, { .name = "snow3g-uea2", - .values.job_params = { .cipher_mode = TEST_SNOW3G_UEA2, .aes_key_size = 16 } }, + .values.job_params = { .cipher_mode = TEST_SNOW3G_UEA2, .key_size = 16 } }, #ifndef __aarch64__ { .name = "kasumi-uea1", - .values.job_params = { .cipher_mode = TEST_KASUMI_UEA1, .aes_key_size = 16 } }, + .values.job_params = { .cipher_mode = TEST_KASUMI_UEA1, .key_size = 16 } }, { .name = "aes-cbcs-1-9", - .values.job_params = { .cipher_mode = TEST_CBCS_1_9, .aes_key_size = 16 } }, + .values.job_params = { .cipher_mode = TEST_CBCS_1_9, .key_size = 16 } }, { .name = "chacha20", - .values.job_params = { .cipher_mode = TEST_CHACHA20, .aes_key_size = 32 } }, - { .name = "snow-v", - .values.job_params = { .cipher_mode = TEST_SNOW_V, .aes_key_size = 32 } }, - { .name = "null", - .values.job_params = { .cipher_mode = TEST_NULL_CIPHER, .aes_key_size = 0 } } + .values.job_params = { .cipher_mode = TEST_CHACHA20, .key_size = 32 } }, + { .name = "snow-v", .values.job_params = { .cipher_mode = TEST_SNOW_V, .key_size = 32 } }, + { .name = "null", .values.job_params = { .cipher_mode = TEST_NULL_CIPHER, .key_size = 0 } } #endif /* __aarch64__ */ }; @@ -571,54 +561,54 @@ const struct str_value_mapping aead_algo_str_map[] = { { .name = "aes-gcm-128", .values.job_params = { .cipher_mode = TEST_GCM, .hash_alg = TEST_HASH_GCM, - .aes_key_size = IMB_KEY_128_BYTES } }, + .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-gcm-192", .values.job_params = { .cipher_mode = TEST_GCM, .hash_alg = TEST_HASH_GCM, - .aes_key_size = IMB_KEY_192_BYTES } }, + .key_size = IMB_KEY_192_BYTES } }, { .name = "aes-gcm-256", .values.job_params = { .cipher_mode = TEST_GCM, .hash_alg = TEST_HASH_GCM, - .aes_key_size = IMB_KEY_256_BYTES } }, + .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-ccm-128", .values.job_params = { .cipher_mode = TEST_CCM, .hash_alg = TEST_HASH_CCM, - .aes_key_size = IMB_KEY_128_BYTES } }, + .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-ccm-256", .values.job_params = { .cipher_mode = TEST_CCM, .hash_alg = TEST_HASH_CCM, - .aes_key_size = IMB_KEY_256_BYTES } }, + .key_size = IMB_KEY_256_BYTES } }, { .name = "pon-128", .values.job_params = { .cipher_mode = TEST_PON_CNTR, .hash_alg = TEST_PON_CRC_BIP, - .aes_key_size = IMB_KEY_128_BYTES } }, + .key_size = IMB_KEY_128_BYTES } }, { .name = "pon-128-no-ctr", .values.job_params = { .cipher_mode = TEST_PON_NO_CNTR, .hash_alg = TEST_PON_CRC_BIP, - .aes_key_size = 0 } }, + .key_size = 0 } }, { .name = "chacha20-poly1305", .values.job_params = { .cipher_mode = TEST_AEAD_CHACHA20, .hash_alg = TEST_AEAD_POLY1305, - .aes_key_size = IMB_KEY_256_BYTES } }, + .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-docsis-128-crc32", .values.job_params = { .cipher_mode = TEST_AESDOCSIS, .hash_alg = TEST_DOCSIS_CRC32, - .aes_key_size = IMB_KEY_128_BYTES } }, + .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-docsis8-128-crc32", .values.job_params = { .cipher_mode = TEST_AESDOCSIS8, .hash_alg = TEST_DOCSIS_CRC32, - .aes_key_size = IMB_KEY_128_BYTES } }, + .key_size = IMB_KEY_128_BYTES } }, { .name = "aes-docsis-256-crc32", .values.job_params = { .cipher_mode = TEST_AESDOCSIS, .hash_alg = TEST_DOCSIS_CRC32, - .aes_key_size = IMB_KEY_256_BYTES } }, + .key_size = IMB_KEY_256_BYTES } }, { .name = "aes-docsis8-256-crc32", .values.job_params = { .cipher_mode = TEST_AESDOCSIS8, .hash_alg = TEST_DOCSIS_CRC32, - .aes_key_size = IMB_KEY_256_BYTES } }, + .key_size = IMB_KEY_256_BYTES } }, { .name = "snow-v-aead", .values.job_params = { .cipher_mode = TEST_SNOW_V_AEAD, - .aes_key_size = 32, + .key_size = 32, .hash_alg = TEST_AUTH_SNOW_V_AEAD } }, #endif /* __aarch64__ */ }; @@ -728,7 +718,7 @@ uint64_t snow_v_aad_size = DEFAULT_SNOW_V_AEAD_AAD_SIZE; struct custom_job_params custom_job_params = { .cipher_mode = TEST_NULL_CIPHER, .hash_alg = TEST_NULL_HASH, - .aes_key_size = 0, + .key_size = 0, .cipher_dir = IMB_DIR_ENCRYPT }; #ifndef __aarch64__ @@ -1464,7 +1454,7 @@ set_size_lists(uint32_t *cipher_size_list, uint32_t *hash_size_list, uint64_t *x if (imix_list_count != 0) job_size = job_size_imix_list[i]; else - job_size = params->size_aes; + job_size = params->job_size; if ((params->cipher_mode == TEST_AESDOCSIS8) || (params->cipher_mode == TEST_CNTR8)) cipher_size_list[i] = job_size + 8; @@ -1954,10 +1944,10 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 /* Translating enum to the API's one */ job_template.cipher_mode = translate_cipher_mode(params->cipher_mode); - job_template.key_len_in_bytes = params->aes_key_size; + job_template.key_len_in_bytes = params->key_size; if (job_template.cipher_mode == IMB_CIPHER_GCM || job_template.cipher_mode == IMB_CIPHER_GCM_SGL) { - switch (params->aes_key_size) { + switch (params->key_size) { case IMB_KEY_128_BYTES: IMB_AES128_GCM_PRE(mb_mgr, gcm_key, &gdata_key); break; @@ -1986,7 +1976,7 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 job_template.key_len_in_bytes = 24; job_template.iv_len_in_bytes = 8; } else if (job_template.cipher_mode == IMB_CIPHER_ZUC_EEA3) { - if (params->aes_key_size == 16) { + if (params->key_size == 16) { job_template.key_len_in_bytes = 16; job_template.iv_len_in_bytes = 16; } else { @@ -2450,7 +2440,7 @@ do_test_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, u if (segment_size != 0) use_gcm_sgl_api = 1; - key = (uint8_t *) malloc(sizeof(uint8_t) * params->aes_key_size); + key = (uint8_t *) malloc(sizeof(uint8_t) * params->key_size); if (!key) { fprintf(stderr, "Could not malloc key\n"); free_mem(&p_buffer, &p_keys); @@ -2464,9 +2454,9 @@ do_test_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, u free_mem(&p_buffer, &p_keys); exit(EXIT_FAILURE); } - memset(key, 0, params->aes_key_size); + memset(key, 0, params->key_size); - switch (params->aes_key_size) { + switch (params->key_size) { case IMB_KEY_128_BYTES: IMB_AES128_GCM_PRE(mb_mgr, key, &gdata_key); break; @@ -2487,33 +2477,33 @@ do_test_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, u #endif time = __rdtscp(&aux); - if (params->aes_key_size == IMB_KEY_128_BYTES) { + if (params->key_size == IMB_KEY_128_BYTES) { if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm128_init, mb_mgr->gcm128_enc_update, mb_mgr->gcm128_enc_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->size_aes, aad, params->aad_size, + p_buffer, params->job_size, aad, params->aad_size, num_iter); else run_gcm(mb_mgr->gcm128_enc, &gdata_key, &gdata_ctx, p_buffer, - params->size_aes, aad, params->aad_size, num_iter); - } else if (params->aes_key_size == IMB_KEY_192_BYTES) { + params->job_size, aad, params->aad_size, num_iter); + } else if (params->key_size == IMB_KEY_192_BYTES) { if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm192_init, mb_mgr->gcm192_enc_update, mb_mgr->gcm192_enc_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->size_aes, aad, params->aad_size, + p_buffer, params->job_size, aad, params->aad_size, num_iter); else run_gcm(mb_mgr->gcm192_enc, &gdata_key, &gdata_ctx, p_buffer, - params->size_aes, aad, params->aad_size, num_iter); + params->job_size, aad, params->aad_size, num_iter); } else { /* 256 */ if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm256_init, mb_mgr->gcm256_enc_update, mb_mgr->gcm256_enc_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->size_aes, aad, params->aad_size, + p_buffer, params->job_size, aad, params->aad_size, num_iter); else run_gcm(mb_mgr->gcm256_enc, &gdata_key, &gdata_ctx, p_buffer, - params->size_aes, aad, params->aad_size, num_iter); + params->job_size, aad, params->aad_size, num_iter); } #ifndef _WIN32 if (use_unhalted_cycles) @@ -2529,33 +2519,33 @@ do_test_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, u #endif time = __rdtscp(&aux); - if (params->aes_key_size == IMB_KEY_128_BYTES) { + if (params->key_size == IMB_KEY_128_BYTES) { if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm128_init, mb_mgr->gcm128_dec_update, mb_mgr->gcm128_dec_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->size_aes, aad, params->aad_size, + p_buffer, params->job_size, aad, params->aad_size, num_iter); else run_gcm(mb_mgr->gcm128_dec, &gdata_key, &gdata_ctx, p_buffer, - params->size_aes, aad, params->aad_size, num_iter); - } else if (params->aes_key_size == IMB_KEY_192_BYTES) { + params->job_size, aad, params->aad_size, num_iter); + } else if (params->key_size == IMB_KEY_192_BYTES) { if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm192_init, mb_mgr->gcm192_dec_update, mb_mgr->gcm192_dec_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->size_aes, aad, params->aad_size, + p_buffer, params->job_size, aad, params->aad_size, num_iter); else run_gcm(mb_mgr->gcm192_dec, &gdata_key, &gdata_ctx, p_buffer, - params->size_aes, aad, params->aad_size, num_iter); + params->job_size, aad, params->aad_size, num_iter); } else { /* 256 */ if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm256_init, mb_mgr->gcm256_dec_update, mb_mgr->gcm256_dec_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->size_aes, aad, params->aad_size, + p_buffer, params->job_size, aad, params->aad_size, num_iter); else run_gcm(mb_mgr->gcm256_dec, &gdata_key, &gdata_ctx, p_buffer, - params->size_aes, aad, params->aad_size, num_iter); + params->job_size, aad, params->aad_size, num_iter); } #ifndef _WIN32 if (use_unhalted_cycles) @@ -2599,11 +2589,11 @@ do_test_chacha_poly(struct params_s *params, const uint32_t num_iter, IMB_MGR *m } if (segment_size != 0) { - num_segs = params->size_aes / segment_size; - final_seg_sz = params->size_aes % segment_size; + num_segs = params->job_size / segment_size; + final_seg_sz = params->job_size % segment_size; } else { num_segs = 0; - final_seg_sz = params->size_aes; + final_seg_sz = params->job_size; } #ifndef _WIN32 @@ -2701,7 +2691,7 @@ do_test_ghash(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, } else { for (i = 0; i < num_iter; i++) { uint8_t *pb = get_dst_buffer(index, p_buffer); - const uint32_t buf_size = params->size_aes; + const uint32_t buf_size = params->job_size; IMB_GHASH(mb_mgr, &gdata_key, pb, buf_size, auth_tag, sizeof(auth_tag)); index = get_next_index(index); @@ -2766,16 +2756,16 @@ process_variant(IMB_MGR *mgr, const enum arch_type_e arch, struct params_s *para uint32_t sizes = params->num_sizes; uint64_t *times = &variant_ptr->avg_times[run]; uint32_t sz; - uint32_t size_aes; + uint32_t job_size; if (imix_list_count != 0) sizes = 1; for (sz = 0; sz < sizes; sz++) { if (job_size_count == 0) - size_aes = job_sizes[RANGE_MIN] + (sz * job_sizes[RANGE_STEP]); + job_size = job_sizes[RANGE_MIN] + (sz * job_sizes[RANGE_STEP]); else - size_aes = job_size_list[sz]; + job_size = job_size_list[sz]; uint32_t num_iter; @@ -2796,16 +2786,16 @@ process_variant(IMB_MGR *mgr, const enum arch_type_e arch, struct params_s *para * If job size == 0, check AAD size * (only allowed for GCM/CCM) */ - if (size_aes == 0 && params->aad_size != 0) + if (job_size == 0 && params->aad_size != 0) num_iter = (iter_scale >= (uint32_t) params->aad_size) ? (iter_scale / (uint32_t) params->aad_size) : 1; - else if (size_aes != 0) - num_iter = (iter_scale >= size_aes) ? (iter_scale / size_aes) : 1; + else if (job_size != 0) + num_iter = (iter_scale >= job_size) ? (iter_scale / job_size) : 1; else num_iter = iter_scale; - params->size_aes = size_aes; + params->job_size = job_size; #ifndef __aarch64__ if (params->cipher_mode == TEST_GCM && (!use_job_api)) { if (job_iter == 0) @@ -2962,7 +2952,7 @@ print_times(struct variant_s *variant_list, struct params_s *params, const uint3 printf("KEY_SIZE"); for (col = 0; col < total_variants; col++) { par = variant_list[col].params; - printf("\tAES-%u", par.aes_key_size * 8); + printf("\tAES-%u", par.key_size * 8); } printf("\n"); } @@ -3124,7 +3114,7 @@ run_tests(void *arg) prog_bar_init(total_variants); params.cipher_dir = custom_job_params.cipher_dir; - params.aes_key_size = custom_job_params.aes_key_size; + params.key_size = custom_job_params.key_size; params.cipher_mode = custom_job_params.cipher_mode; params.hash_alg = custom_job_params.hash_alg; @@ -3794,7 +3784,7 @@ main(int argc, char *argv[]) return EXIT_FAILURE; custom_job_params.cipher_mode = values->job_params.cipher_mode; - custom_job_params.aes_key_size = values->job_params.aes_key_size; + custom_job_params.key_size = values->job_params.key_size; cipher_algo_set = 1; i++; } else if (strcmp(argv[i], "--cipher-dir") == 0) { @@ -3822,7 +3812,7 @@ main(int argc, char *argv[]) return EXIT_FAILURE; custom_job_params.cipher_mode = values->job_params.cipher_mode; - custom_job_params.aes_key_size = values->job_params.aes_key_size; + custom_job_params.key_size = values->job_params.key_size; custom_job_params.hash_alg = values->job_params.hash_alg; aead_algo_set = 1; i++; -- GitLab From 76b5e276045192f547f12166c4336fc01903b070 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 16 Jun 2023 12:10:51 +0100 Subject: [PATCH 009/204] perf: remove AES from key size in output --- perf/ipsec_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 270bc79d..b4ddac00 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -2952,7 +2952,7 @@ print_times(struct variant_s *variant_list, struct params_s *params, const uint3 printf("KEY_SIZE"); for (col = 0; col < total_variants; col++) { par = variant_list[col].params; - printf("\tAES-%u", par.key_size * 8); + printf("\t%u", par.key_size * 8); } printf("\n"); } -- GitLab From afcba36515ffaa238fb48e96af901833838665e3 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 21 Jun 2023 11:45:08 +0100 Subject: [PATCH 010/204] perf: unify AAD size to be used for all AEAD algorithms --- perf/ipsec_perf.c | 122 ++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 68 deletions(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index b4ddac00..e9a6c349 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -216,7 +216,6 @@ struct params_s { enum test_hash_alg_e hash_alg; uint32_t key_size; uint32_t job_size; - uint64_t aad_size; uint32_t num_sizes; uint32_t core; }; @@ -711,10 +710,7 @@ uint32_t max_job_size = 0; uint32_t job_iter = 0; uint32_t tag_size = 0; -uint64_t gcm_aad_size = DEFAULT_GCM_AAD_SIZE; -uint64_t ccm_aad_size = DEFAULT_CCM_AAD_SIZE; -uint64_t chacha_poly_aad_size = DEFAULT_CHACHA_POLY_AAD_SIZE; -uint64_t snow_v_aad_size = DEFAULT_SNOW_V_AEAD_AAD_SIZE; +uint64_t aad_size = AAD_SIZE_MAX + 1; struct custom_job_params custom_job_params = { .cipher_mode = TEST_NULL_CIPHER, .hash_alg = TEST_NULL_HASH, @@ -1961,12 +1957,12 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 } job_template.enc_keys = &gdata_key; job_template.dec_keys = &gdata_key; - job_template.u.GCM.aad_len_in_bytes = params->aad_size; + job_template.u.GCM.aad_len_in_bytes = aad_size; job_template.iv_len_in_bytes = 12; } else if (job_template.cipher_mode == IMB_CIPHER_CCM) { job_template.hash_start_src_offset_in_bytes = 0; job_template.cipher_start_src_offset_in_bytes = 0; - job_template.u.CCM.aad_len_in_bytes = params->aad_size; + job_template.u.CCM.aad_len_in_bytes = aad_size; job_template.iv_len_in_bytes = 13; } else if (job_template.cipher_mode == IMB_CIPHER_DES || job_template.cipher_mode == IMB_CIPHER_DOCSIS_DES) { @@ -2011,7 +2007,7 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 job_template.cipher_start_src_offset_in_bytes = 0; job_template.enc_keys = k1_expanded; job_template.dec_keys = k1_expanded; - job_template.u.CHACHA20_POLY1305.aad_len_in_bytes = params->aad_size; + job_template.u.CHACHA20_POLY1305.aad_len_in_bytes = aad_size; job_template.iv_len_in_bytes = 12; } else if (job_template.cipher_mode == IMB_CIPHER_SNOW_V) job_template.iv_len_in_bytes = 16; @@ -2019,7 +2015,7 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 job_template.hash_alg == IMB_AUTH_SNOW_V_AEAD) { job_template.key_len_in_bytes = 32; job_template.iv_len_in_bytes = 16; - job_template.u.SNOW_V_AEAD.aad_len_in_bytes = params->aad_size; + job_template.u.SNOW_V_AEAD.aad_len_in_bytes = aad_size; } #define TIMEOUT_MS 100 /*< max time for one packet size to be tested for */ @@ -2355,7 +2351,7 @@ static void run_gcm_sgl(aes_gcm_init_t init, aes_gcm_enc_dec_update_t update, aes_gcm_enc_dec_finalize_t finalize, struct gcm_key_data *gdata_key, struct gcm_context_data *gdata_ctx, uint8_t *p_buffer, uint32_t buf_size, - const void *aad, const uint64_t aad_size, const uint32_t num_iter) + const void *aad, const uint32_t num_iter) { uint32_t i; static uint32_t index = 0; @@ -2404,7 +2400,7 @@ run_gcm_sgl(aes_gcm_init_t init, aes_gcm_enc_dec_update_t update, static void run_gcm(aes_gcm_enc_dec_t enc_dec, struct gcm_key_data *gdata_key, struct gcm_context_data *gdata_ctx, uint8_t *p_buffer, uint32_t buf_size, const void *aad, - const uint64_t aad_size, const uint32_t num_iter) + const uint32_t num_iter) { uint32_t i; uint32_t index = 0; @@ -2447,7 +2443,7 @@ do_test_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, u exit(EXIT_FAILURE); } - aad = (uint8_t *) malloc(sizeof(uint8_t) * params->aad_size); + aad = (uint8_t *) malloc(sizeof(uint8_t) * aad_size); if (!aad) { free(key); fprintf(stderr, "Could not malloc AAD\n"); @@ -2481,29 +2477,26 @@ do_test_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, u if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm128_init, mb_mgr->gcm128_enc_update, mb_mgr->gcm128_enc_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->job_size, aad, params->aad_size, - num_iter); + p_buffer, params->job_size, aad, num_iter); else run_gcm(mb_mgr->gcm128_enc, &gdata_key, &gdata_ctx, p_buffer, - params->job_size, aad, params->aad_size, num_iter); + params->job_size, aad, num_iter); } else if (params->key_size == IMB_KEY_192_BYTES) { if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm192_init, mb_mgr->gcm192_enc_update, mb_mgr->gcm192_enc_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->job_size, aad, params->aad_size, - num_iter); + p_buffer, params->job_size, aad, num_iter); else run_gcm(mb_mgr->gcm192_enc, &gdata_key, &gdata_ctx, p_buffer, - params->job_size, aad, params->aad_size, num_iter); + params->job_size, aad, num_iter); } else { /* 256 */ if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm256_init, mb_mgr->gcm256_enc_update, mb_mgr->gcm256_enc_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->job_size, aad, params->aad_size, - num_iter); + p_buffer, params->job_size, aad, num_iter); else run_gcm(mb_mgr->gcm256_enc, &gdata_key, &gdata_ctx, p_buffer, - params->job_size, aad, params->aad_size, num_iter); + params->job_size, aad, num_iter); } #ifndef _WIN32 if (use_unhalted_cycles) @@ -2523,29 +2516,26 @@ do_test_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *mb_mgr, u if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm128_init, mb_mgr->gcm128_dec_update, mb_mgr->gcm128_dec_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->job_size, aad, params->aad_size, - num_iter); + p_buffer, params->job_size, aad, num_iter); else run_gcm(mb_mgr->gcm128_dec, &gdata_key, &gdata_ctx, p_buffer, - params->job_size, aad, params->aad_size, num_iter); + params->job_size, aad, num_iter); } else if (params->key_size == IMB_KEY_192_BYTES) { if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm192_init, mb_mgr->gcm192_dec_update, mb_mgr->gcm192_dec_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->job_size, aad, params->aad_size, - num_iter); + p_buffer, params->job_size, aad, num_iter); else run_gcm(mb_mgr->gcm192_dec, &gdata_key, &gdata_ctx, p_buffer, - params->job_size, aad, params->aad_size, num_iter); + params->job_size, aad, num_iter); } else { /* 256 */ if (use_gcm_sgl_api) run_gcm_sgl(mb_mgr->gcm256_init, mb_mgr->gcm256_dec_update, mb_mgr->gcm256_dec_finalize, &gdata_key, &gdata_ctx, - p_buffer, params->job_size, aad, params->aad_size, - num_iter); + p_buffer, params->job_size, aad, num_iter); else run_gcm(mb_mgr->gcm256_dec, &gdata_key, &gdata_ctx, p_buffer, - params->job_size, aad, params->aad_size, num_iter); + params->job_size, aad, num_iter); } #ifndef _WIN32 if (use_unhalted_cycles) @@ -2581,7 +2571,7 @@ do_test_chacha_poly(struct params_s *params, const uint32_t num_iter, IMB_MGR *m uint32_t final_seg_sz; unsigned i, j; - aad = (uint8_t *) malloc(sizeof(uint8_t) * params->aad_size); + aad = (uint8_t *) malloc(sizeof(uint8_t) * aad_size); if (!aad) { fprintf(stderr, "Could not malloc AAD\n"); free_mem(&p_buffer, &p_keys); @@ -2618,7 +2608,7 @@ do_test_chacha_poly(struct params_s *params, const uint32_t num_iter, IMB_MGR *m } } - IMB_CHACHA20_POLY1305_INIT(mb_mgr, key, &chacha_ctx, iv, aad, params->aad_size); + IMB_CHACHA20_POLY1305_INIT(mb_mgr, key, &chacha_ctx, iv, aad, aad_size); if (params->cipher_dir == IMB_DIR_ENCRYPT) { for (j = 0; j < num_segs; j++) @@ -2769,26 +2759,13 @@ process_variant(IMB_MGR *mgr, const enum arch_type_e arch, struct params_s *para uint32_t num_iter; - params->aad_size = 0; - if (params->cipher_mode == TEST_GCM) - params->aad_size = gcm_aad_size; - - if (params->cipher_mode == TEST_CCM) - params->aad_size = ccm_aad_size; - - if (params->cipher_mode == TEST_AEAD_CHACHA20) - params->aad_size = chacha_poly_aad_size; - - if (params->cipher_mode == TEST_SNOW_V_AEAD) - params->aad_size = snow_v_aad_size; - /* * If job size == 0, check AAD size - * (only allowed for GCM/CCM) + * (only allowed for GCM/CCM/CHACHA_POLY1305/SNOW_V_AEAD) */ - if (job_size == 0 && params->aad_size != 0) - num_iter = (iter_scale >= (uint32_t) params->aad_size) - ? (iter_scale / (uint32_t) params->aad_size) + if (job_size == 0 && aad_size != 0) + num_iter = (iter_scale >= (uint32_t) aad_size) + ? (iter_scale / (uint32_t) aad_size) : 1; else if (job_size != 0) num_iter = (iter_scale >= job_size) ? (iter_scale / job_size) : 1; @@ -3836,17 +3813,14 @@ main(int argc, char *argv[]) } i++; } else if (strcmp(argv[i], "--aad-size") == 0) { - /* Get AAD size for both GCM and CCM */ - i = get_next_num_arg((const char *const *) argv, i, argc, &gcm_aad_size, - sizeof(gcm_aad_size)); - if (gcm_aad_size > AAD_SIZE_MAX) { + /* Get AAD size for both GCM, CCM, CHACHA20-POLY1305 and SNOW-V-AEAD */ + i = get_next_num_arg((const char *const *) argv, i, argc, &aad_size, + sizeof(aad_size)); + if (aad_size > AAD_SIZE_MAX) { fprintf(stderr, "Invalid AAD size %u (max %d)!\n", - (unsigned) gcm_aad_size, AAD_SIZE_MAX); + (unsigned) aad_size, AAD_SIZE_MAX); return EXIT_FAILURE; } - ccm_aad_size = gcm_aad_size; - chacha_poly_aad_size = gcm_aad_size; - snow_v_aad_size = gcm_aad_size; } else if (strcmp(argv[i], "--job-iter") == 0) { i = get_next_num_arg((const char *const *) argv, i, argc, &job_iter, sizeof(job_iter)); @@ -3969,13 +3943,6 @@ main(int argc, char *argv[]) return EXIT_FAILURE; } - if (custom_job_params.cipher_mode == TEST_CCM) { - if (ccm_aad_size > CCM_AAD_SIZE_MAX) { - fprintf(stderr, "AAD cannot be higher than %d in CCM\n", CCM_AAD_SIZE_MAX); - return EXIT_FAILURE; - } - } - srand(ITER_SCALE_LONG + ITER_SCALE_SHORT + ITER_SCALE_SMOKE); if ((imix_list_count != 0)) { @@ -4121,11 +4088,30 @@ main(int argc, char *argv[]) fprintf(stderr, "\n"); } - if (custom_job_params.cipher_mode == TEST_GCM) - fprintf(stderr, "GCM AAD = %" PRIu64 "\n", gcm_aad_size); + /* If AAD size is not set from command line, set default value */ + if (aad_size == AAD_SIZE_MAX + 1) { + if (custom_job_params.cipher_mode == TEST_GCM) + aad_size = DEFAULT_GCM_AAD_SIZE; + else if (custom_job_params.cipher_mode == TEST_CCM) + aad_size = DEFAULT_CCM_AAD_SIZE; + else if (custom_job_params.cipher_mode == TEST_AEAD_CHACHA20) + aad_size = DEFAULT_CHACHA_POLY_AAD_SIZE; + else if (custom_job_params.cipher_mode == TEST_SNOW_V_AEAD) + aad_size = DEFAULT_SNOW_V_AEAD_AAD_SIZE; + else + aad_size = 0; + } + + if (custom_job_params.cipher_mode == TEST_CCM) { + if (aad_size > IMB_CCM_AAD_MAX_SIZE) { + fprintf(stderr, "AAD cannot be higher than %d in CCM\n", + IMB_CCM_AAD_MAX_SIZE); + return EXIT_FAILURE; + } + } - if (custom_job_params.cipher_mode == TEST_CCM) - fprintf(stderr, "CCM AAD = %" PRIu64 "\n", ccm_aad_size); + if (aad_size != 0) + fprintf(stderr, "AAD size = %" PRIu64 "\n", aad_size); #ifndef __aarch64__ if (archs[ARCH_SSE]) { -- GitLab From e7aaf1b2f7f9137ce59345b93aa9986b2c2feb4b Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 21 Jun 2023 14:28:45 +0100 Subject: [PATCH 011/204] perf: refactor API testing --- perf/ipsec_perf.c | 78 ++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index e9a6c349..2249c673 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -722,7 +722,7 @@ uint8_t archs[NUM_ARCHS] = { 1, 1, 1, 1 }; /* uses all function sets */ #else uint8_t archs[NUM_ARCHS] = { 1, 1 }; /* uses all function sets */ #endif -int use_job_api = 0; + int use_gcm_sgl_api = 0; int use_unhalted_cycles = 0; /* read unhalted cycles instead of tsc */ uint64_t rd_cycles_cost = 0; /* cost of reading unhalted cycles */ @@ -751,11 +751,12 @@ typedef enum { TEST_API_BURST, TEST_API_CIPHER_BURST, TEST_API_HASH_BURST, + TEST_API_DIRECT, TEST_API_NUMOF } TEST_API; const char *str_api_list[TEST_API_NUMOF] = { "single job", "burst", "cipher-only burst", - "hash-only burst" }; + "hash-only burst", "direct" }; static TEST_API test_api = TEST_API_JOB; /* test job API by default */ static uint32_t burst_size = 0; /* num jobs to pass to burst API */ @@ -2772,34 +2773,26 @@ process_variant(IMB_MGR *mgr, const enum arch_type_e arch, struct params_s *para else num_iter = iter_scale; + if (job_iter != 0) + num_iter = job_iter; + params->job_size = job_size; #ifndef __aarch64__ - if (params->cipher_mode == TEST_GCM && (!use_job_api)) { - if (job_iter == 0) - *times = do_test_gcm(params, 2 * num_iter, mgr, p_buffer, p_keys); - else - *times = do_test_gcm(params, job_iter, mgr, p_buffer, p_keys); - } else if (params->cipher_mode == TEST_AEAD_CHACHA20 && (!use_job_api)) { - if (job_iter == 0) - *times = do_test_chacha_poly(params, 2 * num_iter, mgr, p_buffer, + if (test_api == TEST_API_DIRECT) { + if (params->cipher_mode == TEST_GCM) + *times = do_test_gcm(params, num_iter, mgr, p_buffer, p_keys); + else if (params->cipher_mode == TEST_AEAD_CHACHA20) + *times = do_test_chacha_poly(params, num_iter, mgr, p_buffer, p_keys); - else - *times = do_test_chacha_poly(params, job_iter, mgr, p_buffer, - p_keys); - } else if (params->hash_alg == TEST_AUTH_GHASH && (!use_job_api)) { - if (job_iter == 0) - *times = do_test_ghash(params, 2 * num_iter, mgr, p_buffer, p_keys); - else - *times = do_test_ghash(params, job_iter, mgr, p_buffer, p_keys); - } else { -#endif - if (job_iter == 0) - *times = do_test(mgr, params, num_iter, p_buffer, p_keys); - else - *times = do_test(mgr, params, job_iter, p_buffer, p_keys); -#ifndef __aarch64__ - } + else if (params->hash_alg == TEST_AUTH_GHASH) + *times = do_test_ghash(params, num_iter, mgr, p_buffer, p_keys); + else { + fprintf(stderr, "Algorithm not supported with direct API\n"); + exit(EXIT_FAILURE); + } + } else #endif + *times = do_test(mgr, params, num_iter, p_buffer, p_keys); times += NUM_RUNS; } @@ -3221,9 +3214,9 @@ usage(void) "--gfni-on: use Galois Field extensions, default: auto-detect\n" "--gfni-off: don't use Galois Field extensions\n" #endif - "--force-job-api: use JOB API" + "--job-api: use JOB API" #ifndef __aarch64__ - " (direct API used for GCM/GHASH/CHACHA20_POLY1305 API by default)\n" + "--direct-api: use direct API when available\n" "--gcm-sgl-api: use direct SGL API for GCM perf tests" " (direct GCM API is default)\n" #endif @@ -3728,8 +3721,10 @@ main(int argc, char *argv[]) flags &= (~IMB_FLAG_GFNI_OFF); } else if (strcmp(argv[i], "--gfni-off") == 0) { flags |= IMB_FLAG_GFNI_OFF; - } else if (strcmp(argv[i], "--force-job-api") == 0) { - use_job_api = 1; + } else if (strcmp(argv[i], "--job-api") == 0) { + test_api = TEST_API_JOB; + } else if (strcmp(argv[i], "--direct-api") == 0) { + test_api = TEST_API_DIRECT; } else if (strcmp(argv[i], "--gcm-sgl-api") == 0) { use_gcm_sgl_api = 1; } else if (strcmp(argv[i], "--quick") == 0) { @@ -3922,6 +3917,12 @@ main(int argc, char *argv[]) return EXIT_FAILURE; } + if (test_api == TEST_API_DIRECT && ((custom_job_params.cipher_mode != TEST_GCM) && + (custom_job_params.cipher_mode != TEST_AEAD_CHACHA20) && + (custom_job_params.hash_alg != TEST_AUTH_GHASH))) { + fprintf(stderr, "Unsupported direct API algorithm selected\n"); + return EXIT_FAILURE; + } if (aead_algo_set == 0 && cipher_algo_set == 0 && hash_algo_set == 0 && quic_api_test == 0) { fprintf(stderr, "No cipher, hash or " @@ -4078,15 +4079,11 @@ main(int argc, char *argv[]) "Library version: %s\n", sha_size_incr, buffer_offset, IMB_VERSION_STR, imb_get_version_str()); - if (!use_job_api) - fprintf(stderr, "API type: direct\n"); - else { - fprintf(stderr, "API type: %s", str_api_list[test_api]); - if (test_api != TEST_API_JOB) - fprintf(stderr, " (burst size = %u)\n", burst_size); - else - fprintf(stderr, "\n"); - } + fprintf(stderr, "API type: %s", str_api_list[test_api]); + if (test_api != TEST_API_JOB && test_api != TEST_API_DIRECT) + fprintf(stderr, " (burst size = %u)\n", burst_size); + else + fprintf(stderr, "\n"); /* If AAD size is not set from command line, set default value */ if (aad_size == AAD_SIZE_MAX + 1) { @@ -4110,9 +4107,6 @@ main(int argc, char *argv[]) } } - if (aad_size != 0) - fprintf(stderr, "AAD size = %" PRIu64 "\n", aad_size); - #ifndef __aarch64__ if (archs[ARCH_SSE]) { IMB_MGR *p_mgr = alloc_mb_mgr(flags); -- GitLab From 88329397da154fd29c5b85e9dbe723749eb1d080 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 21 Jun 2023 14:29:45 +0100 Subject: [PATCH 012/204] perf: set burst API by default --- perf/ipsec_perf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 2249c673..957b1ebe 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -758,9 +758,9 @@ typedef enum { const char *str_api_list[TEST_API_NUMOF] = { "single job", "burst", "cipher-only burst", "hash-only burst", "direct" }; -static TEST_API test_api = TEST_API_JOB; /* test job API by default */ -static uint32_t burst_size = 0; /* num jobs to pass to burst API */ -static uint32_t segment_size = 0; /* segment size to test SGL (0 = no SGL) */ +static TEST_API test_api = TEST_API_BURST; /* test burst API by default */ +static uint32_t burst_size = 0; /* num jobs to pass to burst API */ +static uint32_t segment_size = 0; /* segment size to test SGL (0 = no SGL) */ static volatile int timebox_on = 1; /* flag to stop the test loop */ static int use_timebox = 1; /* time-box feature on/off flag */ @@ -3256,7 +3256,7 @@ usage(void) "--plot: Adjust text output for direct use with plot output\n" "--no-time-box: disables 100ms watchdog timer on " "an algorithm@packet-size performance test\n" - "--burst-api: use burst API for perf tests\n" + "--burst-api: use burst API for perf tests (default)\n" "--cipher-burst-api: use cipher-only burst API for perf tests\n" "--hash-burst-api: use hash-only burst API for perf tests\n" "--burst-size: number of jobs to submit per burst\n" -- GitLab From 6eefda6b4a84cfc39f71b22ca4d13ec6c30d2e24 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 12 Jun 2023 11:39:30 +0100 Subject: [PATCH 013/204] perf: remove checkpatch setting from Makefile --- perf/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/perf/Makefile b/perf/Makefile index 9aea0b71..6162274b 100644 --- a/perf/Makefile +++ b/perf/Makefile @@ -114,7 +114,6 @@ OBJECTS := $(SOURCES:%.c=%.o) $(ASM_SOURCES:%.S=%.o) DEPFILES := $(OBJECTS:%.o=%.d) endif # aarch64 -CHECKPATCH ?= checkpatch.pl CPPCHECK ?= cppcheck .PHONY: all clean style cppcheck -- GitLab From 57559afcbbe4062c864cf777e5da6a8e355f55fa Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Fri, 9 Jun 2023 13:48:25 +0100 Subject: [PATCH 014/204] sse: [aes-cbc] workaround load block issue in case of false store-forward condition - perform all plain text loads before doing stores - without the workaround, on Intel Atom(R) processors, performance penalty may be observed in NOT 4-byte aligned address and an in-place operation --- lib/include/aes_cbc_enc_x8_sse.inc | 373 ++++++++++++++++++ lib/sse_t3/aes128_cbc_enc_x8_sse.asm | 474 +---------------------- lib/sse_t3/aes128_cbc_mac_x8_sse.asm | 15 +- lib/sse_t3/aes192_cbc_enc_x8_sse.asm | 477 +---------------------- lib/sse_t3/aes256_cbc_enc_x8_sse.asm | 548 +-------------------------- lib/sse_t3/aes256_cbc_mac_x8_sse.asm | 15 +- 6 files changed, 412 insertions(+), 1490 deletions(-) create mode 100644 lib/include/aes_cbc_enc_x8_sse.inc diff --git a/lib/include/aes_cbc_enc_x8_sse.inc b/lib/include/aes_cbc_enc_x8_sse.inc new file mode 100644 index 00000000..87085047 --- /dev/null +++ b/lib/include/aes_cbc_enc_x8_sse.inc @@ -0,0 +1,373 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +;; macro to do a AES-CBC, AES-CBC-MAC and AES-XCBC +;; - multi-buffer implementation +;; - 8 buffers at a time + +%use smartalign + +%include "include/os.inc" +%include "include/mb_mgr_datastruct.inc" +%include "include/clear_regs.inc" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; struct AES_ARGS { +;; void* in[8]; +;; void* out[8]; +;; UINT128* keys[8]; +;; UINT128 IV[8]; +;; } +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; void aes_cbc_enc_128_x8(AES_ARGS *args, UINT64 len); +;; arg 1: ARG : addr of AES_ARGS structure +;; arg 2: LEN : len (in units of bytes) + +struc STACK_CBC +_len: resq 1 +_gpr_rbp: resq 1 +endstruc + +struc STACK_MAC +;; first fields need to match smaller CBC frame +_len_mac: resq 1 +_gpr_rbp_mac: resq 1 +;; MAC specific fields follow from here +_gpr_rbx: resq 1 +_gpr_r12: resq 1 +_gpr_r13: resq 1 +_gpr_r14: resq 1 +_gpr_r15: resq 1 +%ifndef LINUX +_gpr_rsi: resq 1 +_gpr_rdi: resq 1 +%endif +endstruc + +%define LEN_AREA rsp + _len + +%ifdef LINUX +%define arg1 rdi +%define arg2 rsi +%define arg3 rcx +%define arg4 rdx +%else +%define arg1 rcx +%define arg2 rdx +%define arg3 rdi +%define arg4 rsi +%endif + +%define ARG arg1 +%define LEN arg2 + +%define IDX rax +%define TMP rbx + +%define KEYS0 arg3 +%define KEYS1 arg4 +%define KEYS2 rbp +%define KEYS3 r8 +%define KEYS4 r9 +%define KEYS5 r10 +%define KEYS6 r11 +%define KEYS7 r12 + +%define IN0 r13 +%define IN2 r14 +%define IN4 r15 +%define IN6 LEN + +%define XDATA0 xmm0 +%define XDATA1 xmm1 +%define XDATA2 xmm2 +%define XDATA3 xmm3 +%define XDATA4 xmm4 +%define XDATA5 xmm5 +%define XDATA6 xmm6 +%define XDATA7 xmm7 + +%define XTMP0 xmm8 +%define XTMP1 xmm9 +%define XTMP2 xmm10 +%define XTMP3 xmm11 +%define XTMP4 xmm12 +%define XTMP5 xmm13 +%define XTMP6 xmm14 +%define XTMP7 xmm15 + +%macro AES_CBC_X8 6-7 +%define %%MODE %1 ;; [in] CBC_XCBC_MAC or CBC +%define %%NROUNDS %2 ;; [in] number of AES rounds (9 - AES128, 11 - AES192, AES256 - 13) +%define %%OFFSET %3 ;; [in] numeric constant index increment +%define %%ARG_IV %4 ;; [in] pointer to array with IV pointers +%define %%ARG_KEYS %5 ;; [in] pointer to array with expanded key pointers +%define %%ARG_IN %6 ;; [in] pointer to array with input pointers (plain text) +%define %%ARG_OUT %7 ;; [in] pointer to array with destination pointers (cipher text) + +%ifidn %%MODE, CBC_XCBC_MAC + sub rsp, STACK_MAC_size +%else + sub rsp, STACK_CBC_size +%endif + mov [rsp + _gpr_rbp], rbp +%ifidn %%MODE, CBC_XCBC_MAC + mov [rsp + _gpr_rbx], rbx + mov [rsp + _gpr_r12], r12 + mov [rsp + _gpr_r13], r13 + mov [rsp + _gpr_r14], r14 + mov [rsp + _gpr_r15], r15 +%ifndef LINUX + mov [rsp + _gpr_rsi], rsi + mov [rsp + _gpr_rdi], rdi +%endif +%endif + + xor IDX, IDX + mov [LEN_AREA], LEN + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + mov IN0, [%%ARG_IN + 8*0] + mov IN2, [%%ARG_IN + 8*2] + mov IN4, [%%ARG_IN + 8*4] + mov IN6, [%%ARG_IN + 8*6] + + movdqa XDATA0, [%%ARG_IV + 16*0] ; load IV + movdqa XDATA1, [%%ARG_IV + 16*1] ; load IV + movdqa XDATA2, [%%ARG_IV + 16*2] ; load IV + movdqa XDATA3, [%%ARG_IV + 16*3] ; load IV + movdqa XDATA4, [%%ARG_IV + 16*4] ; load IV + movdqa XDATA5, [%%ARG_IV + 16*5] ; load IV + movdqa XDATA6, [%%ARG_IV + 16*6] ; load IV + movdqa XDATA7, [%%ARG_IV + 16*7] ; load IV + + mov KEYS0, [%%ARG_KEYS + 8*0] + mov KEYS1, [%%ARG_KEYS + 8*1] + mov KEYS2, [%%ARG_KEYS + 8*2] + mov KEYS3, [%%ARG_KEYS + 8*3] + mov KEYS4, [%%ARG_KEYS + 8*4] + mov KEYS5, [%%ARG_KEYS + 8*5] + mov KEYS6, [%%ARG_KEYS + 8*6] + mov KEYS7, [%%ARG_KEYS + 8*7] + + ; load next block of plain text + mov TMP, [%%ARG_IN + 8*1] + movdqu XTMP0, [IN0 + IDX] + movdqu XTMP1, [TMP + IDX] + mov TMP, [%%ARG_IN + 8*3] + movdqu XTMP2, [IN2 + IDX] + movdqu XTMP3, [TMP + IDX] + mov TMP, [%%ARG_IN + 8*5] + movdqu XTMP4, [IN4 + IDX] + movdqu XTMP5, [TMP + IDX] + mov TMP, [%%ARG_IN + 8*7] + movdqu XTMP6, [IN6 + IDX] + movdqu XTMP7, [TMP + IDX] + +align 32 +%%_main_loop: + ;; 0. ARK + pxor XDATA0, [KEYS0 + 16*0] + pxor XDATA1, [KEYS1 + 16*0] + pxor XDATA2, [KEYS2 + 16*0] + pxor XDATA3, [KEYS3 + 16*0] + pxor XDATA4, [KEYS4 + 16*0] + pxor XDATA5, [KEYS5 + 16*0] + pxor XDATA6, [KEYS6 + 16*0] + pxor XDATA7, [KEYS7 + 16*0] + + pxor XDATA0, XTMP0 + pxor XDATA1, XTMP1 + pxor XDATA2, XTMP2 + pxor XDATA3, XTMP3 + pxor XDATA4, XTMP4 + pxor XDATA5, XTMP5 + pxor XDATA6, XTMP6 + pxor XDATA7, XTMP7 + + ;; 1 to 9/11/13 ENC rounds +%assign j 1 +%rep %%NROUNDS + aesenc XDATA0, [KEYS0 + 16*j] + aesenc XDATA1, [KEYS1 + 16*j] + aesenc XDATA2, [KEYS2 + 16*j] + aesenc XDATA3, [KEYS3 + 16*j] + aesenc XDATA4, [KEYS4 + 16*j] + aesenc XDATA5, [KEYS5 + 16*j] + aesenc XDATA6, [KEYS6 + 16*j] + aesenc XDATA7, [KEYS7 + 16*j] +%assign j (j + 1) +%endrep + + ;; 10/12/14 (LAST) ENC round + aesenclast XDATA0, [KEYS0 + 16*j] + aesenclast XDATA1, [KEYS1 + 16*j] + aesenclast XDATA2, [KEYS2 + 16*j] + aesenclast XDATA3, [KEYS3 + 16*j] + aesenclast XDATA4, [KEYS4 + 16*j] + aesenclast XDATA5, [KEYS5 + 16*j] + aesenclast XDATA6, [KEYS6 + 16*j] + aesenclast XDATA7, [KEYS7 + 16*j] + + add IDX, %%OFFSET + cmp [LEN_AREA], IDX + jna %%_exit_main_loop + + ;; first load the next blocks into XTMP + mov TMP, [%%ARG_IN + 8*1] + movdqu XTMP0, [IN0 + IDX] + movdqu XTMP1, [TMP + IDX] + mov TMP, [%%ARG_IN + 8*3] + movdqu XTMP2, [IN2 + IDX] + movdqu XTMP3, [TMP + IDX] + mov TMP, [%%ARG_IN + 8*5] + movdqu XTMP4, [IN4 + IDX] + movdqu XTMP5, [TMP + IDX] + mov TMP, [%%ARG_IN + 8*7] + movdqu XTMP6, [IN6 + IDX] + movdqu XTMP7, [TMP + IDX] + +%ifnidn %%MODE, CBC_XCBC_MAC + sub IDX, %%OFFSET + + ;; no ciphertext write back for CBC-MAC + mov TMP, [%%ARG_OUT + 8*0] + movdqu [TMP + IDX], XDATA0 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*1] + movdqu [TMP + IDX], XDATA1 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*2] + movdqu [TMP + IDX], XDATA2 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*3] + movdqu [TMP + IDX], XDATA3 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*4] + movdqu [TMP + IDX], XDATA4 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*5] + movdqu [TMP + IDX], XDATA5 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*6] + movdqu [TMP + IDX], XDATA6 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*7] + movdqu [TMP + IDX], XDATA7 ; write back ciphertext + + add IDX, %%OFFSET +%endif + jmp %%_main_loop + +align 32 +%%_exit_main_loop: + +%ifnidn %%MODE, CBC_XCBC_MAC + ;; no ciphertext write back for CBC-MAC + sub IDX, %%OFFSET + mov TMP, [%%ARG_OUT + 8*0] + movdqu [TMP + IDX], XDATA0 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*1] + movdqu [TMP + IDX], XDATA1 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*2] + movdqu [TMP + IDX], XDATA2 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*3] + movdqu [TMP + IDX], XDATA3 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*4] + movdqu [TMP + IDX], XDATA4 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*5] + movdqu [TMP + IDX], XDATA5 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*6] + movdqu [TMP + IDX], XDATA6 ; write back ciphertext + mov TMP, [%%ARG_OUT + 8*7] + movdqu [TMP + IDX], XDATA7 ; write back ciphertext + add IDX, %%OFFSET +%endif + + ;; update IV for AES-CBC / store digest for CBC-MAC + movdqa [%%ARG_IV + 16*0], XDATA0 + movdqa [%%ARG_IV + 16*1], XDATA1 + movdqa [%%ARG_IV + 16*2], XDATA2 + movdqa [%%ARG_IV + 16*3], XDATA3 + movdqa [%%ARG_IV + 16*4], XDATA4 + movdqa [%%ARG_IV + 16*5], XDATA5 + movdqa [%%ARG_IV + 16*6], XDATA6 + movdqa [%%ARG_IV + 16*7], XDATA7 + + ;; update IN and OUT + movd xmm8, [LEN_AREA] + pshufd xmm8, xmm8, 0x44 + movdqa xmm1, xmm8 + movdqa xmm2, xmm8 + movdqa xmm3, xmm8 + movdqa xmm4, xmm8 + paddq xmm1, [%%ARG_IN + 16*0] + paddq xmm2, [%%ARG_IN + 16*1] + paddq xmm3, [%%ARG_IN + 16*2] + paddq xmm4, [%%ARG_IN + 16*3] + movdqa [%%ARG_IN + 16*0], xmm1 + movdqa [%%ARG_IN + 16*1], xmm2 + movdqa [%%ARG_IN + 16*2], xmm3 + movdqa [%%ARG_IN + 16*3], xmm4 +%ifnidn %%MODE, CBC_XCBC_MAC + movdqa xmm5, xmm8 + movdqa xmm6, xmm8 + movdqa xmm7, xmm8 + paddq xmm5, [%%ARG_OUT + 16*0] + paddq xmm6, [%%ARG_OUT + 16*1] + paddq xmm7, [%%ARG_OUT + 16*2] + paddq xmm8, [%%ARG_OUT + 16*3] + movdqa [%%ARG_OUT + 16*0], xmm5 + movdqa [%%ARG_OUT + 16*1], xmm6 + movdqa [%%ARG_OUT + 16*2], xmm7 + movdqa [%%ARG_OUT + 16*3], xmm8 +%endif + + ;; XMMs are saved at a higher level + mov rbp, [rsp + _gpr_rbp] +%ifidn %%MODE, CBC_XCBC_MAC + mov rbx, [rsp + _gpr_rbx] + mov r12, [rsp + _gpr_r12] + mov r13, [rsp + _gpr_r13] + mov r14, [rsp + _gpr_r14] + mov r15, [rsp + _gpr_r15] +%ifndef LINUX + mov rsi, [rsp + _gpr_rsi] + mov rdi, [rsp + _gpr_rdi] +%endif +%endif + +%ifidn %%MODE, CBC_XCBC_MAC + add rsp, STACK_MAC_size +%else + add rsp, STACK_CBC_size +%endif + +%ifdef SAFE_DATA +%ifidn %%MODE, CBC_XCBC_MAC + clear_all_xmms_sse_asm +%else + clear_xmms_sse XTMP0, XTMP1, XTMP2, XTMP3, XTMP4, XTMP5, XTMP6, XTMP7 +%endif +%endif ;; SAFE_DATA + +%endmacro + diff --git a/lib/sse_t3/aes128_cbc_enc_x8_sse.asm b/lib/sse_t3/aes128_cbc_enc_x8_sse.asm index 374af500..c76580ee 100644 --- a/lib/sse_t3/aes128_cbc_enc_x8_sse.asm +++ b/lib/sse_t3/aes128_cbc_enc_x8_sse.asm @@ -25,480 +25,16 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -;;; Routine to do a 128 bit CBC AES encryption / CBC-MAC digest computation -;;; processes 8 buffers at a time, single data structure as input -;;; Updates In and Out pointers at end +;; AES-CBC-128 -%include "include/os.inc" -%include "include/mb_mgr_datastruct.inc" -%include "include/clear_regs.inc" - -%macro PXOR2 2 - movdqu XTMP, %2 - pxor %1, XTMP -%endm - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; struct AES_ARGS { -;; void* in[8]; -;; void* out[8]; -;; UINT128* keys[8]; -;; UINT128 IV[8]; -;; } -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; void aes_cbc_enc_128_x8(AES_ARGS *args, UINT64 len); -;; arg 1: ARG : addr of AES_ARGS structure -;; arg 2: LEN : len (in units of bytes) - -struc STACK -_gpr_save: resq 8 -_len: resq 1 -endstruc - -%define GPR_SAVE_AREA rsp + _gpr_save -%define LEN_AREA rsp + _len - -%ifdef LINUX -%define arg1 rdi -%define arg2 rsi -%define arg3 rcx -%define arg4 rdx -%else -%define arg1 rcx -%define arg2 rdx -%define arg3 rdi -%define arg4 rsi -%endif - -%define ARG arg1 -%define LEN arg2 - -%define IDX rax -%define TMP rbx - -%define KEYS0 arg3 -%define KEYS1 arg4 -%define KEYS2 rbp -%define KEYS3 r8 -%define KEYS4 r9 -%define KEYS5 r10 -%define KEYS6 r11 -%define KEYS7 r12 - -%define IN0 r13 -%define IN2 r14 -%define IN4 r15 -%define IN6 LEN - -%define XDATA0 xmm0 -%define XDATA1 xmm1 -%define XDATA2 xmm2 -%define XDATA3 xmm3 -%define XDATA4 xmm4 -%define XDATA5 xmm5 -%define XDATA6 xmm6 -%define XDATA7 xmm7 - -%define XKEY0_3 xmm8 -%define XKEY1_4 xmm9 -%define XKEY2_5 xmm10 -%define XKEY3_6 xmm11 -%define XKEY4_7 xmm12 -%define XKEY5_8 xmm13 -%define XKEY6_9 xmm14 -%define XTMP xmm15 +%include "include/aes_cbc_enc_x8_sse.inc" mksection .text -align 32 -%ifdef CBC_MAC -MKGLOBAL(aes128_cbc_mac_x8_sse,function,internal) -aes128_cbc_mac_x8_sse: -%else +align 64 MKGLOBAL(aes_cbc_enc_128_x8_sse,function,internal) aes_cbc_enc_128_x8_sse: -%endif - sub rsp, STACK_size - mov [GPR_SAVE_AREA + 8*0], rbp -%ifdef CBC_MAC - mov [GPR_SAVE_AREA + 8*1], rbx - mov [GPR_SAVE_AREA + 8*2], r12 - mov [GPR_SAVE_AREA + 8*3], r13 - mov [GPR_SAVE_AREA + 8*4], r14 - mov [GPR_SAVE_AREA + 8*5], r15 -%ifndef LINUX - mov [GPR_SAVE_AREA + 8*6], rsi - mov [GPR_SAVE_AREA + 8*7], rdi -%endif -%endif - - mov IDX, 16 - mov [LEN_AREA], LEN - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - mov IN0, [ARG + _aesarg_in + 8*0] - mov IN2, [ARG + _aesarg_in + 8*2] - mov IN4, [ARG + _aesarg_in + 8*4] - mov IN6, [ARG + _aesarg_in + 8*6] - - mov TMP, [ARG + _aesarg_in + 8*1] - movdqu XDATA0, [IN0] ; load first block of plain text - movdqu XDATA1, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*3] - movdqu XDATA2, [IN2] ; load first block of plain text - movdqu XDATA3, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*5] - movdqu XDATA4, [IN4] ; load first block of plain text - movdqu XDATA5, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*7] - movdqu XDATA6, [IN6] ; load first block of plain text - movdqu XDATA7, [TMP] ; load first block of plain text - - pxor XDATA0, [ARG + _aesarg_IV + 16*0] ; plaintext XOR IV - pxor XDATA1, [ARG + _aesarg_IV + 16*1] ; plaintext XOR IV - pxor XDATA2, [ARG + _aesarg_IV + 16*2] ; plaintext XOR IV - pxor XDATA3, [ARG + _aesarg_IV + 16*3] ; plaintext XOR IV - pxor XDATA4, [ARG + _aesarg_IV + 16*4] ; plaintext XOR IV - pxor XDATA5, [ARG + _aesarg_IV + 16*5] ; plaintext XOR IV - pxor XDATA6, [ARG + _aesarg_IV + 16*6] ; plaintext XOR IV - pxor XDATA7, [ARG + _aesarg_IV + 16*7] ; plaintext XOR IV - - mov KEYS0, [ARG + _aesarg_keys + 8*0] - mov KEYS1, [ARG + _aesarg_keys + 8*1] - mov KEYS2, [ARG + _aesarg_keys + 8*2] - mov KEYS3, [ARG + _aesarg_keys + 8*3] - mov KEYS4, [ARG + _aesarg_keys + 8*4] - mov KEYS5, [ARG + _aesarg_keys + 8*5] - mov KEYS6, [ARG + _aesarg_keys + 8*6] - mov KEYS7, [ARG + _aesarg_keys + 8*7] - - pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK - pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK - pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK - pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK - pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK - pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK - pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK - pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK - - aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC - aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC - aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC - aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC - aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC - aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC - aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC - aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC - - movdqa XKEY0_3, [KEYS0 + 16*3] ; load round 3 key - - aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC - aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC - aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC - aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC - aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC - aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC - aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC - aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC - - movdqa XKEY1_4, [KEYS1 + 16*4] ; load round 4 key - - aesenc XDATA0, XKEY0_3 ; 3. ENC - aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC - aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC - aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC - aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC - aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC - aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC - aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC - - aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC - movdqa XKEY2_5, [KEYS2 + 16*5] ; load round 5 key - aesenc XDATA1, XKEY1_4 ; 4. ENC - aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC - aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC - aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC - aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC - aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC - aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC - - aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC - aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC - movdqa XKEY3_6, [KEYS3 + 16*6] ; load round 6 key - aesenc XDATA2, XKEY2_5 ; 5. ENC - aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC - aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC - aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC - aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC - aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC - - aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC - aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC - aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC - movdqa XKEY4_7, [KEYS4 + 16*7] ; load round 7 key - aesenc XDATA3, XKEY3_6 ; 6. ENC - aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC - aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC - aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC - aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC - - aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC - aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC - aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC - aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC - movdqa XKEY5_8, [KEYS5 + 16*8] ; load round 8 key - aesenc XDATA4, XKEY4_7 ; 7. ENC - aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC - aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC - aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC - - aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC - aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC - aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC - aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC - aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC - movdqa XKEY6_9, [KEYS6 + 16*9] ; load round 9 key - aesenc XDATA5, XKEY5_8 ; 8. ENC - aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC - aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC - - aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC - aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC - aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC - aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC - aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC - aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC - mov TMP, [ARG + _aesarg_out + 8*0] - aesenc XDATA6, XKEY6_9 ; 9. ENC - aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC - - aesenclast XDATA0, [KEYS0 + 16*10] ; 10. ENC - aesenclast XDATA1, [KEYS1 + 16*10] ; 10. ENC - aesenclast XDATA2, [KEYS2 + 16*10] ; 10. ENC - aesenclast XDATA3, [KEYS3 + 16*10] ; 10. ENC - aesenclast XDATA4, [KEYS4 + 16*10] ; 10. ENC - aesenclast XDATA5, [KEYS5 + 16*10] ; 10. ENC - aesenclast XDATA6, [KEYS6 + 16*10] ; 10. ENC - aesenclast XDATA7, [KEYS7 + 16*10] ; 10. ENC - -%ifndef CBC_MAC - movdqu [TMP], XDATA0 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*1] - movdqu [TMP], XDATA1 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*2] - movdqu [TMP], XDATA2 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*3] - movdqu [TMP], XDATA3 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*4] - movdqu [TMP], XDATA4 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*5] - movdqu [TMP], XDATA5 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*6] - movdqu [TMP], XDATA6 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*7] - movdqu [TMP], XDATA7 ; write back ciphertext -%endif - cmp [LEN_AREA], IDX - je done - -main_loop: - mov TMP, [ARG + _aesarg_in + 8*1] - PXOR2 XDATA0, [IN0 + IDX] ; load next block of plain text - PXOR2 XDATA1, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*3] - PXOR2 XDATA2, [IN2 + IDX] ; load next block of plain text - PXOR2 XDATA3, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*5] - PXOR2 XDATA4, [IN4 + IDX] ; load next block of plain text - PXOR2 XDATA5, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*7] - PXOR2 XDATA6, [IN6 + IDX] ; load next block of plain text - PXOR2 XDATA7, [TMP + IDX] ; load next block of plain text - - pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK - pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK - pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK - pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK - pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK - pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK - pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK - pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK - - aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC - aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC - aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC - aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC - aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC - aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC - aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC - aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC - - aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC - aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC - aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC - aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC - aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC - aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC - aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC - aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC - - aesenc XDATA0, XKEY0_3 ; 3. ENC - aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC - aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC - aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC - aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC - aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC - aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC - aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC - - aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC - aesenc XDATA1, XKEY1_4 ; 4. ENC - aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC - aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC - aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC - aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC - aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC - aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC - - aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC - aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC - aesenc XDATA2, XKEY2_5 ; 5. ENC - aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC - aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC - aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC - aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC - aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC - - aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC - aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC - aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC - aesenc XDATA3, XKEY3_6 ; 6. ENC - aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC - aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC - aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC - aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC - - aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC - aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC - aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC - aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC - aesenc XDATA4, XKEY4_7 ; 7. ENC - aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC - aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC - aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC - - aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC - aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC - aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC - aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC - aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC - aesenc XDATA5, XKEY5_8 ; 8. ENC - aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC - aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC - - aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC - aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC - aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC - aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC - aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC - aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC - mov TMP, [ARG + _aesarg_out + 8*0] - aesenc XDATA6, XKEY6_9 ; 9. ENC - aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC - - aesenclast XDATA0, [KEYS0 + 16*10] ; 10. ENC - aesenclast XDATA1, [KEYS1 + 16*10] ; 10. ENC - aesenclast XDATA2, [KEYS2 + 16*10] ; 10. ENC - aesenclast XDATA3, [KEYS3 + 16*10] ; 10. ENC - aesenclast XDATA4, [KEYS4 + 16*10] ; 10. ENC - aesenclast XDATA5, [KEYS5 + 16*10] ; 10. ENC - aesenclast XDATA6, [KEYS6 + 16*10] ; 10. ENC - aesenclast XDATA7, [KEYS7 + 16*10] ; 10. ENC - -%ifndef CBC_MAC - ;; no ciphertext write back for CBC-MAC - movdqu [TMP + IDX], XDATA0 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*1] - movdqu [TMP + IDX], XDATA1 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*2] - movdqu [TMP + IDX], XDATA2 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*3] - movdqu [TMP + IDX], XDATA3 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*4] - movdqu [TMP + IDX], XDATA4 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*5] - movdqu [TMP + IDX], XDATA5 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*6] - movdqu [TMP + IDX], XDATA6 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*7] - movdqu [TMP + IDX], XDATA7 ; write back ciphertext -%endif - add IDX, 16 - cmp [LEN_AREA], IDX - jne main_loop - -done: - ;; update IV for AES128-CBC / store digest for CBC-MAC - movdqa [ARG + _aesarg_IV + 16*0], XDATA0 - movdqa [ARG + _aesarg_IV + 16*1], XDATA1 - movdqa [ARG + _aesarg_IV + 16*2], XDATA2 - movdqa [ARG + _aesarg_IV + 16*3], XDATA3 - movdqa [ARG + _aesarg_IV + 16*4], XDATA4 - movdqa [ARG + _aesarg_IV + 16*5], XDATA5 - movdqa [ARG + _aesarg_IV + 16*6], XDATA6 - movdqa [ARG + _aesarg_IV + 16*7], XDATA7 - - ;; update IN and OUT - movd xmm0, [LEN_AREA] - pshufd xmm0, xmm0, 0x44 - movdqa xmm1, xmm0 - paddq xmm1, [ARG + _aesarg_in + 16*0] - movdqa xmm2, xmm0 - paddq xmm2, [ARG + _aesarg_in + 16*1] - movdqa xmm3, xmm0 - paddq xmm3, [ARG + _aesarg_in + 16*2] - movdqa xmm4, xmm0 - paddq xmm4, [ARG + _aesarg_in + 16*3] - movdqa [ARG + _aesarg_in + 16*0], xmm1 - movdqa [ARG + _aesarg_in + 16*1], xmm2 - movdqa [ARG + _aesarg_in + 16*2], xmm3 - movdqa [ARG + _aesarg_in + 16*3], xmm4 -%ifndef CBC_MAC - movdqa xmm5, xmm0 - paddq xmm5, [ARG + _aesarg_out + 16*0] - movdqa xmm6, xmm0 - paddq xmm6, [ARG + _aesarg_out + 16*1] - movdqa xmm7, xmm0 - paddq xmm7, [ARG + _aesarg_out + 16*2] - movdqa xmm8, xmm0 - paddq xmm8, [ARG + _aesarg_out + 16*3] - movdqa [ARG + _aesarg_out + 16*0], xmm5 - movdqa [ARG + _aesarg_out + 16*1], xmm6 - movdqa [ARG + _aesarg_out + 16*2], xmm7 - movdqa [ARG + _aesarg_out + 16*3], xmm8 -%endif - - ;; XMMs are saved at a higher level - mov rbp, [GPR_SAVE_AREA + 8*0] -%ifdef CBC_MAC - mov rbx, [GPR_SAVE_AREA + 8*1] - mov r12, [GPR_SAVE_AREA + 8*2] - mov r13, [GPR_SAVE_AREA + 8*3] - mov r14, [GPR_SAVE_AREA + 8*4] - mov r15, [GPR_SAVE_AREA + 8*5] -%ifndef LINUX - mov rsi, [GPR_SAVE_AREA + 8*6] - mov rdi, [GPR_SAVE_AREA + 8*7] -%endif -%endif - - add rsp, STACK_size - -%ifdef SAFE_DATA - clear_all_xmms_sse_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_X8 CBC, 9, 16, {arg1 + _aesarg_IV}, {arg1 + _aesarg_keys}, {arg1 + _aesarg_in}, {arg1 + _aesarg_out} + ret mksection stack-noexec diff --git a/lib/sse_t3/aes128_cbc_mac_x8_sse.asm b/lib/sse_t3/aes128_cbc_mac_x8_sse.asm index 9f09c1b9..9c426bd2 100644 --- a/lib/sse_t3/aes128_cbc_mac_x8_sse.asm +++ b/lib/sse_t3/aes128_cbc_mac_x8_sse.asm @@ -25,7 +25,16 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -;;; Routine to compute CBC-MAC based on 128 bit CBC AES encryptionk code +;; AES-CMAC-128 -%define CBC_MAC -%include "sse_t3/aes128_cbc_enc_x8_sse.asm" +%include "include/aes_cbc_enc_x8_sse.inc" + +mksection .text + +align 64 +MKGLOBAL(aes128_cbc_mac_x8_sse,function,internal) +aes128_cbc_mac_x8_sse: + AES_CBC_X8 CBC_XCBC_MAC, 9, 16, {arg1 + _aesarg_IV}, {arg1 + _aesarg_keys}, {arg1 + _aesarg_in} + ret + +mksection stack-noexec diff --git a/lib/sse_t3/aes192_cbc_enc_x8_sse.asm b/lib/sse_t3/aes192_cbc_enc_x8_sse.asm index a630b176..ac44c657 100644 --- a/lib/sse_t3/aes192_cbc_enc_x8_sse.asm +++ b/lib/sse_t3/aes192_cbc_enc_x8_sse.asm @@ -25,483 +25,16 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -;;; routine to do a 192 bit CBC AES encrypt +;; AES-CBC-192 -;; clobbers all registers except for ARG1 and rbp - -%include "include/os.inc" -%include "include/mb_mgr_datastruct.inc" -%include "include/clear_regs.inc" - -%macro PXOR2 2 - movdqu XTMP, %2 - pxor %1, XTMP -%endm - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; struct AES_ARGS { -;; void* in[8]; -;; void* out[8]; -;; UINT128* keys[8]; -;; UINT128 IV[8]; -;; } -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; void aes_cbc_enc_192_x8(AES_ARGS *args, UINT64 len); -;; arg 1: ARG : addr of AES_ARGS structure -;; arg 2: LEN : len (in units of bytes) - -struc STACK -_gpr_save: resq 1 -_len: resq 1 -endstruc - -%define GPR_SAVE_AREA rsp + _gpr_save -%define LEN_AREA rsp + _len - -%ifdef LINUX -%define ARG rdi -%define LEN rsi -%define REG3 rcx -%define REG4 rdx -%else -%define ARG rcx -%define LEN rdx -%define REG3 rsi -%define REG4 rdi -%endif - -%define IDX rax -%define TMP rbx - -%define KEYS0 REG3 -%define KEYS1 REG4 -%define KEYS2 rbp -%define KEYS3 r8 -%define KEYS4 r9 -%define KEYS5 r10 -%define KEYS6 r11 -%define KEYS7 r12 - -%define IN0 r13 -%define IN2 r14 -%define IN4 r15 -%define IN6 LEN - -%define XDATA0 xmm0 -%define XDATA1 xmm1 -%define XDATA2 xmm2 -%define XDATA3 xmm3 -%define XDATA4 xmm4 -%define XDATA5 xmm5 -%define XDATA6 xmm6 -%define XDATA7 xmm7 - -%define XKEY0_3 xmm8 -%define XKEY1_4 xmm9 -%define XKEY2_5 xmm10 -%define XKEY3_6 xmm11 -%define XKEY4_7 xmm12 -%define XKEY5_8 xmm13 -%define XKEY6_9 xmm14 -%define XTMP xmm15 +%include "include/aes_cbc_enc_x8_sse.inc" mksection .text -align 32 - +align 64 MKGLOBAL(aes_cbc_enc_192_x8_sse,function,internal) aes_cbc_enc_192_x8_sse: - - sub rsp, STACK_size - mov [GPR_SAVE_AREA + 8*0], rbp - - mov IDX, 16 - mov [LEN_AREA], LEN - - mov IN0, [ARG + _aesarg_in + 8*0] - mov IN2, [ARG + _aesarg_in + 8*2] - mov IN4, [ARG + _aesarg_in + 8*4] - mov IN6, [ARG + _aesarg_in + 8*6] - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - mov TMP, [ARG + _aesarg_in + 8*1] - movdqu XDATA0, [IN0] ; load first block of plain text - movdqu XDATA1, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*3] - movdqu XDATA2, [IN2] ; load first block of plain text - movdqu XDATA3, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*5] - movdqu XDATA4, [IN4] ; load first block of plain text - movdqu XDATA5, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*7] - movdqu XDATA6, [IN6] ; load first block of plain text - movdqu XDATA7, [TMP] ; load first block of plain text - - pxor XDATA0, [ARG + _aesarg_IV + 16*0] ; plaintext XOR IV - pxor XDATA1, [ARG + _aesarg_IV + 16*1] ; plaintext XOR IV - pxor XDATA2, [ARG + _aesarg_IV + 16*2] ; plaintext XOR IV - pxor XDATA3, [ARG + _aesarg_IV + 16*3] ; plaintext XOR IV - pxor XDATA4, [ARG + _aesarg_IV + 16*4] ; plaintext XOR IV - pxor XDATA5, [ARG + _aesarg_IV + 16*5] ; plaintext XOR IV - pxor XDATA6, [ARG + _aesarg_IV + 16*6] ; plaintext XOR IV - pxor XDATA7, [ARG + _aesarg_IV + 16*7] ; plaintext XOR IV - - mov KEYS0, [ARG + _aesarg_keys + 8*0] - mov KEYS1, [ARG + _aesarg_keys + 8*1] - mov KEYS2, [ARG + _aesarg_keys + 8*2] - mov KEYS3, [ARG + _aesarg_keys + 8*3] - mov KEYS4, [ARG + _aesarg_keys + 8*4] - mov KEYS5, [ARG + _aesarg_keys + 8*5] - mov KEYS6, [ARG + _aesarg_keys + 8*6] - mov KEYS7, [ARG + _aesarg_keys + 8*7] - - pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK - pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK - pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK - pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK - pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK - pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK - pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK - pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK - - aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC - aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC - aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC - aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC - aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC - aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC - aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC - aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC - - movdqa XKEY0_3, [KEYS0 + 16*3] ; load round 3 key - - aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC - aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC - aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC - aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC - aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC - aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC - aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC - aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC - - movdqa XKEY1_4, [KEYS1 + 16*4] ; load round 4 key - - aesenc XDATA0, XKEY0_3 ; 3. ENC - aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC - aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC - aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC - aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC - aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC - aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC - aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC - - aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC - movdqa XKEY2_5, [KEYS2 + 16*5] ; load round 5 key - aesenc XDATA1, XKEY1_4 ; 4. ENC - aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC - aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC - aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC - aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC - aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC - aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC - - aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC - aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC - movdqa XKEY3_6, [KEYS3 + 16*6] ; load round 6 key - aesenc XDATA2, XKEY2_5 ; 5. ENC - aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC - aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC - aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC - aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC - aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC - - aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC - aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC - aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC - movdqa XKEY4_7, [KEYS4 + 16*7] ; load round 7 key - aesenc XDATA3, XKEY3_6 ; 6. ENC - aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC - aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC - aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC - aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC - - aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC - aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC - aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC - aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC - movdqa XKEY5_8, [KEYS5 + 16*8] ; load round 8 key - aesenc XDATA4, XKEY4_7 ; 7. ENC - aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC - aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC - aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC - - aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC - aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC - aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC - aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC - aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC - movdqa XKEY6_9, [KEYS6 + 16*9] ; load round 9 key - aesenc XDATA5, XKEY5_8 ; 8. ENC - aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC - aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC - - aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC - aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC - aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC - aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC - aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC - aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC - mov TMP, [ARG + _aesarg_out + 8*0] - aesenc XDATA6, XKEY6_9 ; 9. ENC - aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC - - aesenc XDATA0, [KEYS0 + 16*10] ; 10. ENC - aesenc XDATA1, [KEYS1 + 16*10] ; 10. ENC - aesenc XDATA2, [KEYS2 + 16*10] ; 10. ENC - aesenc XDATA3, [KEYS3 + 16*10] ; 10. ENC - aesenc XDATA4, [KEYS4 + 16*10] ; 10. ENC - aesenc XDATA5, [KEYS5 + 16*10] ; 10. ENC - aesenc XDATA6, [KEYS6 + 16*10] ; 10. ENC - aesenc XDATA7, [KEYS7 + 16*10] ; 10. ENC - - aesenc XDATA0, [KEYS0 + 16*11] ; 11. ENC - aesenc XDATA1, [KEYS1 + 16*11] ; 11. ENC - aesenc XDATA2, [KEYS2 + 16*11] ; 11. ENC - aesenc XDATA3, [KEYS3 + 16*11] ; 11. ENC - aesenc XDATA4, [KEYS4 + 16*11] ; 11. ENC - aesenc XDATA5, [KEYS5 + 16*11] ; 11. ENC - aesenc XDATA6, [KEYS6 + 16*11] ; 11. ENC - aesenc XDATA7, [KEYS7 + 16*11] ; 11. ENC - - aesenclast XDATA0, [KEYS0 + 16*12] ; 12. ENC - aesenclast XDATA1, [KEYS1 + 16*12] ; 12. ENC - aesenclast XDATA2, [KEYS2 + 16*12] ; 12. ENC - aesenclast XDATA3, [KEYS3 + 16*12] ; 12. ENC - aesenclast XDATA4, [KEYS4 + 16*12] ; 12. ENC - aesenclast XDATA5, [KEYS5 + 16*12] ; 12. ENC - aesenclast XDATA6, [KEYS6 + 16*12] ; 12. ENC - aesenclast XDATA7, [KEYS7 + 16*12] ; 12. ENC - - movdqu [TMP], XDATA0 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*1] - movdqu [TMP], XDATA1 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*2] - movdqu [TMP], XDATA2 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*3] - movdqu [TMP], XDATA3 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*4] - movdqu [TMP], XDATA4 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*5] - movdqu [TMP], XDATA5 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*6] - movdqu [TMP], XDATA6 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*7] - movdqu [TMP], XDATA7 ; write back ciphertext - - cmp [LEN_AREA], IDX - je done - -main_loop: - mov TMP, [ARG + _aesarg_in + 8*1] - PXOR2 XDATA0, [IN0 + IDX] ; load next block of plain text - PXOR2 XDATA1, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*3] - PXOR2 XDATA2, [IN2 + IDX] ; load next block of plain text - PXOR2 XDATA3, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*5] - PXOR2 XDATA4, [IN4 + IDX] ; load next block of plain text - PXOR2 XDATA5, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*7] - PXOR2 XDATA6, [IN6 + IDX] ; load next block of plain text - PXOR2 XDATA7, [TMP + IDX] ; load next block of plain text - - pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK - pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK - pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK - pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK - pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK - pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK - pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK - pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK - - aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC - aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC - aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC - aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC - aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC - aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC - aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC - aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC - - aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC - aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC - aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC - aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC - aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC - aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC - aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC - aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC - - aesenc XDATA0, XKEY0_3 ; 3. ENC - aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC - aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC - aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC - aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC - aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC - aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC - aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC - - aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC - aesenc XDATA1, XKEY1_4 ; 4. ENC - aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC - aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC - aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC - aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC - aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC - aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC - - aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC - aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC - aesenc XDATA2, XKEY2_5 ; 5. ENC - aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC - aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC - aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC - aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC - aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC - - aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC - aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC - aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC - aesenc XDATA3, XKEY3_6 ; 6. ENC - aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC - aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC - aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC - aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC - - aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC - aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC - aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC - aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC - aesenc XDATA4, XKEY4_7 ; 7. ENC - aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC - aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC - aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC - - aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC - aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC - aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC - aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC - aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC - aesenc XDATA5, XKEY5_8 ; 8. ENC - aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC - aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC - - aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC - aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC - aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC - aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC - aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC - aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC - mov TMP, [ARG + _aesarg_out + 8*0] - aesenc XDATA6, XKEY6_9 ; 9. ENC - aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC - - aesenc XDATA0, [KEYS0 + 16*10] ; 10. ENC - aesenc XDATA1, [KEYS1 + 16*10] ; 10. ENC - aesenc XDATA2, [KEYS2 + 16*10] ; 10. ENC - aesenc XDATA3, [KEYS3 + 16*10] ; 10. ENC - aesenc XDATA4, [KEYS4 + 16*10] ; 10. ENC - aesenc XDATA5, [KEYS5 + 16*10] ; 10. ENC - aesenc XDATA6, [KEYS6 + 16*10] ; 10. ENC - aesenc XDATA7, [KEYS7 + 16*10] ; 10. ENC - - aesenc XDATA0, [KEYS0 + 16*11] ; 11. ENC - aesenc XDATA1, [KEYS1 + 16*11] ; 11. ENC - aesenc XDATA2, [KEYS2 + 16*11] ; 11. ENC - aesenc XDATA3, [KEYS3 + 16*11] ; 11. ENC - aesenc XDATA4, [KEYS4 + 16*11] ; 11. ENC - aesenc XDATA5, [KEYS5 + 16*11] ; 11. ENC - aesenc XDATA6, [KEYS6 + 16*11] ; 11. ENC - aesenc XDATA7, [KEYS7 + 16*11] ; 11. ENC - - aesenclast XDATA0, [KEYS0 + 16*12] ; 12. ENC - aesenclast XDATA1, [KEYS1 + 16*12] ; 12. ENC - aesenclast XDATA2, [KEYS2 + 16*12] ; 12. ENC - aesenclast XDATA3, [KEYS3 + 16*12] ; 12. ENC - aesenclast XDATA4, [KEYS4 + 16*12] ; 12. ENC - aesenclast XDATA5, [KEYS5 + 16*12] ; 12. ENC - aesenclast XDATA6, [KEYS6 + 16*12] ; 12. ENC - aesenclast XDATA7, [KEYS7 + 16*12] ; 12. ENC - - movdqu [TMP + IDX], XDATA0 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*1] - movdqu [TMP + IDX], XDATA1 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*2] - movdqu [TMP + IDX], XDATA2 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*3] - movdqu [TMP + IDX], XDATA3 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*4] - movdqu [TMP + IDX], XDATA4 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*5] - movdqu [TMP + IDX], XDATA5 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*6] - movdqu [TMP + IDX], XDATA6 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*7] - movdqu [TMP + IDX], XDATA7 ; write back ciphertext - - add IDX, 16 - cmp [LEN_AREA], IDX - jne main_loop - -done: - ;; update IV - movdqa [ARG + _aesarg_IV + 16*0], XDATA0 - movdqa [ARG + _aesarg_IV + 16*1], XDATA1 - movdqa [ARG + _aesarg_IV + 16*2], XDATA2 - movdqa [ARG + _aesarg_IV + 16*3], XDATA3 - movdqa [ARG + _aesarg_IV + 16*4], XDATA4 - movdqa [ARG + _aesarg_IV + 16*5], XDATA5 - movdqa [ARG + _aesarg_IV + 16*6], XDATA6 - movdqa [ARG + _aesarg_IV + 16*7], XDATA7 - - ;; update IN and OUT - movd xmm0, [LEN_AREA] - pshufd xmm0, xmm0, 0x44 - movdqa xmm1, xmm0 - paddq xmm1, [ARG + _aesarg_in + 16*0] - movdqa xmm2, xmm0 - paddq xmm2, [ARG + _aesarg_in + 16*1] - movdqa xmm3, xmm0 - paddq xmm3, [ARG + _aesarg_in + 16*2] - movdqa xmm4, xmm0 - paddq xmm4, [ARG + _aesarg_in + 16*3] - movdqa [ARG + _aesarg_in + 16*0], xmm1 - movdqa [ARG + _aesarg_in + 16*1], xmm2 - movdqa [ARG + _aesarg_in + 16*2], xmm3 - movdqa [ARG + _aesarg_in + 16*3], xmm4 - movdqa xmm5, xmm0 - paddq xmm5, [ARG + _aesarg_out + 16*0] - movdqa xmm6, xmm0 - paddq xmm6, [ARG + _aesarg_out + 16*1] - movdqa xmm7, xmm0 - paddq xmm7, [ARG + _aesarg_out + 16*2] - movdqa xmm8, xmm0 - paddq xmm8, [ARG + _aesarg_out + 16*3] - movdqa [ARG + _aesarg_out + 16*0], xmm5 - movdqa [ARG + _aesarg_out + 16*1], xmm6 - movdqa [ARG + _aesarg_out + 16*2], xmm7 - movdqa [ARG + _aesarg_out + 16*3], xmm8 - -;; XMMs are saved at a higher level - mov rbp, [GPR_SAVE_AREA + 8*0] - - add rsp, STACK_size - -%ifdef SAFE_DATA - clear_all_xmms_sse_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_X8 CBC, 11, 16, {arg1 + _aesarg_IV}, {arg1 + _aesarg_keys}, {arg1 + _aesarg_in}, {arg1 + _aesarg_out} + ret mksection stack-noexec diff --git a/lib/sse_t3/aes256_cbc_enc_x8_sse.asm b/lib/sse_t3/aes256_cbc_enc_x8_sse.asm index 964798e6..4633706c 100644 --- a/lib/sse_t3/aes256_cbc_enc_x8_sse.asm +++ b/lib/sse_t3/aes256_cbc_enc_x8_sse.asm @@ -25,554 +25,16 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -;;; routine to do a 256 bit CBC AES encrypt +;; AES-CBC-256 -;; clobbers all registers except for ARG1 and rbp - -%include "include/os.inc" -%include "include/mb_mgr_datastruct.inc" -%include "include/clear_regs.inc" - -%macro PXOR2 2 - movdqu XTMP, %2 - pxor %1, XTMP -%endm - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; struct AES_ARGS { -;; void* in[8]; -;; void* out[8]; -;; UINT128* keys[8]; -;; UINT128 IV[8]; -;; } -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; void aes_cbc_enc_256_x8(AES_ARGS *args, UINT64 len); -;; arg 1: ARG : addr of AES_ARGS structure -;; arg 2: LEN : len (in units of bytes) - -struc STACK -_gpr_save: resq 8 -_len: resq 1 -endstruc - -%define GPR_SAVE_AREA rsp + _gpr_save -%define LEN_AREA rsp + _len - -%ifdef LINUX -%define ARG rdi -%define LEN rsi -%define REG3 rcx -%define REG4 rdx -%else -%define ARG rcx -%define LEN rdx -%define REG3 rsi -%define REG4 rdi -%endif - -%define IDX rax -%define TMP rbx - -%define KEYS0 REG3 -%define KEYS1 REG4 -%define KEYS2 rbp -%define KEYS3 r8 -%define KEYS4 r9 -%define KEYS5 r10 -%define KEYS6 r11 -%define KEYS7 r12 - -%define IN0 r13 -%define IN2 r14 -%define IN4 r15 -%define IN6 LEN - -%define XDATA0 xmm0 -%define XDATA1 xmm1 -%define XDATA2 xmm2 -%define XDATA3 xmm3 -%define XDATA4 xmm4 -%define XDATA5 xmm5 -%define XDATA6 xmm6 -%define XDATA7 xmm7 - -%define XKEY0_3 xmm8 -%define XKEY1_4 xmm9 -%define XKEY2_5 xmm10 -%define XKEY3_6 xmm11 -%define XKEY4_7 xmm12 -%define XKEY5_8 xmm13 -%define XKEY6_9 xmm14 -%define XTMP xmm15 +%include "include/aes_cbc_enc_x8_sse.inc" mksection .text -align 32 - -%ifdef CBC_MAC -MKGLOBAL(aes256_cbc_mac_x8_sse,function,internal) -aes256_cbc_mac_x8_sse: -%else +align 64 MKGLOBAL(aes_cbc_enc_256_x8_sse,function,internal) aes_cbc_enc_256_x8_sse: -%endif - sub rsp, STACK_size - mov [GPR_SAVE_AREA + 8*0], rbp -%ifdef CBC_MAC - mov [GPR_SAVE_AREA + 8*1], rbx - mov [GPR_SAVE_AREA + 8*2], r12 - mov [GPR_SAVE_AREA + 8*3], r13 - mov [GPR_SAVE_AREA + 8*4], r14 - mov [GPR_SAVE_AREA + 8*5], r15 -%ifndef LINUX - mov [GPR_SAVE_AREA + 8*6], rsi - mov [GPR_SAVE_AREA + 8*7], rdi -%endif -%endif - - mov IDX, 16 - mov [LEN_AREA], LEN - - mov IN0, [ARG + _aesarg_in + 8*0] - mov IN2, [ARG + _aesarg_in + 8*2] - mov IN4, [ARG + _aesarg_in + 8*4] - mov IN6, [ARG + _aesarg_in + 8*6] - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - mov TMP, [ARG + _aesarg_in + 8*1] - movdqu XDATA0, [IN0] ; load first block of plain text - movdqu XDATA1, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*3] - movdqu XDATA2, [IN2] ; load first block of plain text - movdqu XDATA3, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*5] - movdqu XDATA4, [IN4] ; load first block of plain text - movdqu XDATA5, [TMP] ; load first block of plain text - mov TMP, [ARG + _aesarg_in + 8*7] - movdqu XDATA6, [IN6] ; load first block of plain text - movdqu XDATA7, [TMP] ; load first block of plain text - - pxor XDATA0, [ARG + _aesarg_IV + 16*0] ; plaintext XOR IV - pxor XDATA1, [ARG + _aesarg_IV + 16*1] ; plaintext XOR IV - pxor XDATA2, [ARG + _aesarg_IV + 16*2] ; plaintext XOR IV - pxor XDATA3, [ARG + _aesarg_IV + 16*3] ; plaintext XOR IV - pxor XDATA4, [ARG + _aesarg_IV + 16*4] ; plaintext XOR IV - pxor XDATA5, [ARG + _aesarg_IV + 16*5] ; plaintext XOR IV - pxor XDATA6, [ARG + _aesarg_IV + 16*6] ; plaintext XOR IV - pxor XDATA7, [ARG + _aesarg_IV + 16*7] ; plaintext XOR IV - - mov KEYS0, [ARG + _aesarg_keys + 8*0] - mov KEYS1, [ARG + _aesarg_keys + 8*1] - mov KEYS2, [ARG + _aesarg_keys + 8*2] - mov KEYS3, [ARG + _aesarg_keys + 8*3] - mov KEYS4, [ARG + _aesarg_keys + 8*4] - mov KEYS5, [ARG + _aesarg_keys + 8*5] - mov KEYS6, [ARG + _aesarg_keys + 8*6] - mov KEYS7, [ARG + _aesarg_keys + 8*7] - - pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK - pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK - pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK - pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK - pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK - pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK - pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK - pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK - - aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC - aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC - aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC - aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC - aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC - aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC - aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC - aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC - - movdqa XKEY0_3, [KEYS0 + 16*3] ; load round 3 key - - aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC - aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC - aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC - aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC - aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC - aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC - aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC - aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC - - movdqa XKEY1_4, [KEYS1 + 16*4] ; load round 4 key - - aesenc XDATA0, XKEY0_3 ; 3. ENC - aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC - aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC - aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC - aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC - aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC - aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC - aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC - - aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC - movdqa XKEY2_5, [KEYS2 + 16*5] ; load round 5 key - aesenc XDATA1, XKEY1_4 ; 4. ENC - aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC - aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC - aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC - aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC - aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC - aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC - - aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC - aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC - movdqa XKEY3_6, [KEYS3 + 16*6] ; load round 6 key - aesenc XDATA2, XKEY2_5 ; 5. ENC - aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC - aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC - aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC - aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC - aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC - - aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC - aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC - aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC - movdqa XKEY4_7, [KEYS4 + 16*7] ; load round 7 key - aesenc XDATA3, XKEY3_6 ; 6. ENC - aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC - aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC - aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC - aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC - - aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC - aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC - aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC - aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC - movdqa XKEY5_8, [KEYS5 + 16*8] ; load round 8 key - aesenc XDATA4, XKEY4_7 ; 7. ENC - aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC - aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC - aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC - - aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC - aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC - aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC - aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC - aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC - movdqa XKEY6_9, [KEYS6 + 16*9] ; load round 9 key - aesenc XDATA5, XKEY5_8 ; 8. ENC - aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC - aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC - - aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC - aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC - aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC - aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC - aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC - aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC -%ifndef CBC_MAC - mov TMP, [ARG + _aesarg_out + 8*0] -%endif - aesenc XDATA6, XKEY6_9 ; 9. ENC - aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC - - aesenc XDATA0, [KEYS0 + 16*10] ; 10. ENC - aesenc XDATA1, [KEYS1 + 16*10] ; 10. ENC - aesenc XDATA2, [KEYS2 + 16*10] ; 10. ENC - aesenc XDATA3, [KEYS3 + 16*10] ; 10. ENC - aesenc XDATA4, [KEYS4 + 16*10] ; 10. ENC - aesenc XDATA5, [KEYS5 + 16*10] ; 10. ENC - aesenc XDATA6, [KEYS6 + 16*10] ; 10. ENC - aesenc XDATA7, [KEYS7 + 16*10] ; 10. ENC - - aesenc XDATA0, [KEYS0 + 16*11] ; 11. ENC - aesenc XDATA1, [KEYS1 + 16*11] ; 11. ENC - aesenc XDATA2, [KEYS2 + 16*11] ; 11. ENC - aesenc XDATA3, [KEYS3 + 16*11] ; 11. ENC - aesenc XDATA4, [KEYS4 + 16*11] ; 11. ENC - aesenc XDATA5, [KEYS5 + 16*11] ; 11. ENC - aesenc XDATA6, [KEYS6 + 16*11] ; 11. ENC - aesenc XDATA7, [KEYS7 + 16*11] ; 11. ENC - - aesenc XDATA0, [KEYS0 + 16*12] ; 12. ENC - aesenc XDATA1, [KEYS1 + 16*12] ; 12. ENC - aesenc XDATA2, [KEYS2 + 16*12] ; 12. ENC - aesenc XDATA3, [KEYS3 + 16*12] ; 12. ENC - aesenc XDATA4, [KEYS4 + 16*12] ; 12. ENC - aesenc XDATA5, [KEYS5 + 16*12] ; 12. ENC - aesenc XDATA6, [KEYS6 + 16*12] ; 12. ENC - aesenc XDATA7, [KEYS7 + 16*12] ; 12. ENC - - aesenc XDATA0, [KEYS0 + 16*13] ; 13. ENC - aesenc XDATA1, [KEYS1 + 16*13] ; 13. ENC - aesenc XDATA2, [KEYS2 + 16*13] ; 13. ENC - aesenc XDATA3, [KEYS3 + 16*13] ; 13. ENC - aesenc XDATA4, [KEYS4 + 16*13] ; 13. ENC - aesenc XDATA5, [KEYS5 + 16*13] ; 13. ENC - aesenc XDATA6, [KEYS6 + 16*13] ; 13. ENC - aesenc XDATA7, [KEYS7 + 16*13] ; 13. ENC - - aesenclast XDATA0, [KEYS0 + 16*14] ; 14. ENC - aesenclast XDATA1, [KEYS1 + 16*14] ; 14. ENC - aesenclast XDATA2, [KEYS2 + 16*14] ; 14. ENC - aesenclast XDATA3, [KEYS3 + 16*14] ; 14. ENC - aesenclast XDATA4, [KEYS4 + 16*14] ; 14. ENC - aesenclast XDATA5, [KEYS5 + 16*14] ; 14. ENC - aesenclast XDATA6, [KEYS6 + 16*14] ; 14. ENC - aesenclast XDATA7, [KEYS7 + 16*14] ; 14. ENC - -%ifndef CBC_MAC - movdqu [TMP], XDATA0 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*1] - movdqu [TMP], XDATA1 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*2] - movdqu [TMP], XDATA2 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*3] - movdqu [TMP], XDATA3 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*4] - movdqu [TMP], XDATA4 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*5] - movdqu [TMP], XDATA5 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*6] - movdqu [TMP], XDATA6 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*7] - movdqu [TMP], XDATA7 ; write back ciphertext -%endif - cmp [LEN_AREA], IDX - je done - -main_loop: - mov TMP, [ARG + _aesarg_in + 8*1] - PXOR2 XDATA0, [IN0 + IDX] ; load next block of plain text - PXOR2 XDATA1, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*3] - PXOR2 XDATA2, [IN2 + IDX] ; load next block of plain text - PXOR2 XDATA3, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*5] - PXOR2 XDATA4, [IN4 + IDX] ; load next block of plain text - PXOR2 XDATA5, [TMP + IDX] ; load next block of plain text - mov TMP, [ARG + _aesarg_in + 8*7] - PXOR2 XDATA6, [IN6 + IDX] ; load next block of plain text - PXOR2 XDATA7, [TMP + IDX] ; load next block of plain text - - pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK - pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK - pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK - pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK - pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK - pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK - pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK - pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK - - aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC - aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC - aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC - aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC - aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC - aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC - aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC - aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC - - aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC - aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC - aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC - aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC - aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC - aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC - aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC - aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC - - aesenc XDATA0, XKEY0_3 ; 3. ENC - aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC - aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC - aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC - aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC - aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC - aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC - aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC - - aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC - aesenc XDATA1, XKEY1_4 ; 4. ENC - aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC - aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC - aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC - aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC - aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC - aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC - - aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC - aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC - aesenc XDATA2, XKEY2_5 ; 5. ENC - aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC - aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC - aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC - aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC - aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC - - aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC - aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC - aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC - aesenc XDATA3, XKEY3_6 ; 6. ENC - aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC - aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC - aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC - aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC - - aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC - aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC - aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC - aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC - aesenc XDATA4, XKEY4_7 ; 7. ENC - aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC - aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC - aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC - - aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC - aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC - aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC - aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC - aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC - aesenc XDATA5, XKEY5_8 ; 8. ENC - aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC - aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC - - aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC - aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC - aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC - aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC - aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC - aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC -%ifndef CBC_MAC - mov TMP, [ARG + _aesarg_out + 8*0] -%endif - aesenc XDATA6, XKEY6_9 ; 9. ENC - aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC - - aesenc XDATA0, [KEYS0 + 16*10] ; 10. ENC - aesenc XDATA1, [KEYS1 + 16*10] ; 10. ENC - aesenc XDATA2, [KEYS2 + 16*10] ; 10. ENC - aesenc XDATA3, [KEYS3 + 16*10] ; 10. ENC - aesenc XDATA4, [KEYS4 + 16*10] ; 10. ENC - aesenc XDATA5, [KEYS5 + 16*10] ; 10. ENC - aesenc XDATA6, [KEYS6 + 16*10] ; 10. ENC - aesenc XDATA7, [KEYS7 + 16*10] ; 10. ENC - - aesenc XDATA0, [KEYS0 + 16*11] ; 11. ENC - aesenc XDATA1, [KEYS1 + 16*11] ; 11. ENC - aesenc XDATA2, [KEYS2 + 16*11] ; 11. ENC - aesenc XDATA3, [KEYS3 + 16*11] ; 11. ENC - aesenc XDATA4, [KEYS4 + 16*11] ; 11. ENC - aesenc XDATA5, [KEYS5 + 16*11] ; 11. ENC - aesenc XDATA6, [KEYS6 + 16*11] ; 11. ENC - aesenc XDATA7, [KEYS7 + 16*11] ; 11. ENC - - aesenc XDATA0, [KEYS0 + 16*12] ; 12. ENC - aesenc XDATA1, [KEYS1 + 16*12] ; 12. ENC - aesenc XDATA2, [KEYS2 + 16*12] ; 12. ENC - aesenc XDATA3, [KEYS3 + 16*12] ; 12. ENC - aesenc XDATA4, [KEYS4 + 16*12] ; 12. ENC - aesenc XDATA5, [KEYS5 + 16*12] ; 12. ENC - aesenc XDATA6, [KEYS6 + 16*12] ; 12. ENC - aesenc XDATA7, [KEYS7 + 16*12] ; 12. ENC - - aesenc XDATA0, [KEYS0 + 16*13] ; 13. ENC - aesenc XDATA1, [KEYS1 + 16*13] ; 13. ENC - aesenc XDATA2, [KEYS2 + 16*13] ; 13. ENC - aesenc XDATA3, [KEYS3 + 16*13] ; 13. ENC - aesenc XDATA4, [KEYS4 + 16*13] ; 13. ENC - aesenc XDATA5, [KEYS5 + 16*13] ; 13. ENC - aesenc XDATA6, [KEYS6 + 16*13] ; 13. ENC - aesenc XDATA7, [KEYS7 + 16*13] ; 13. ENC - - aesenclast XDATA0, [KEYS0 + 16*14] ; 14. ENC - aesenclast XDATA1, [KEYS1 + 16*14] ; 14. ENC - aesenclast XDATA2, [KEYS2 + 16*14] ; 14. ENC - aesenclast XDATA3, [KEYS3 + 16*14] ; 14. ENC - aesenclast XDATA4, [KEYS4 + 16*14] ; 14. ENC - aesenclast XDATA5, [KEYS5 + 16*14] ; 14. ENC - aesenclast XDATA6, [KEYS6 + 16*14] ; 14. ENC - aesenclast XDATA7, [KEYS7 + 16*14] ; 14. ENC - -%ifndef CBC_MAC - movdqu [TMP + IDX], XDATA0 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*1] - movdqu [TMP + IDX], XDATA1 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*2] - movdqu [TMP + IDX], XDATA2 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*3] - movdqu [TMP + IDX], XDATA3 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*4] - movdqu [TMP + IDX], XDATA4 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*5] - movdqu [TMP + IDX], XDATA5 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*6] - movdqu [TMP + IDX], XDATA6 ; write back ciphertext - mov TMP, [ARG + _aesarg_out + 8*7] - movdqu [TMP + IDX], XDATA7 ; write back ciphertext -%endif - add IDX, 16 - cmp [LEN_AREA], IDX - jne main_loop - -done: - ;; update IV - movdqa [ARG + _aesarg_IV + 16*0], XDATA0 - movdqa [ARG + _aesarg_IV + 16*1], XDATA1 - movdqa [ARG + _aesarg_IV + 16*2], XDATA2 - movdqa [ARG + _aesarg_IV + 16*3], XDATA3 - movdqa [ARG + _aesarg_IV + 16*4], XDATA4 - movdqa [ARG + _aesarg_IV + 16*5], XDATA5 - movdqa [ARG + _aesarg_IV + 16*6], XDATA6 - movdqa [ARG + _aesarg_IV + 16*7], XDATA7 - - ;; update IN and OUT - movd xmm0, [LEN_AREA] - pshufd xmm0, xmm0, 0x44 - movdqa xmm1, xmm0 - paddq xmm1, [ARG + _aesarg_in + 16*0] - movdqa xmm2, xmm0 - paddq xmm2, [ARG + _aesarg_in + 16*1] - movdqa xmm3, xmm0 - paddq xmm3, [ARG + _aesarg_in + 16*2] - movdqa xmm4, xmm0 - paddq xmm4, [ARG + _aesarg_in + 16*3] - movdqa [ARG + _aesarg_in + 16*0], xmm1 - movdqa [ARG + _aesarg_in + 16*1], xmm2 - movdqa [ARG + _aesarg_in + 16*2], xmm3 - movdqa [ARG + _aesarg_in + 16*3], xmm4 - -%ifndef CBC_MAC - movdqa xmm5, xmm0 - paddq xmm5, [ARG + _aesarg_out + 16*0] - movdqa xmm6, xmm0 - paddq xmm6, [ARG + _aesarg_out + 16*1] - movdqa xmm7, xmm0 - paddq xmm7, [ARG + _aesarg_out + 16*2] - movdqa xmm8, xmm0 - paddq xmm8, [ARG + _aesarg_out + 16*3] - movdqa [ARG + _aesarg_out + 16*0], xmm5 - movdqa [ARG + _aesarg_out + 16*1], xmm6 - movdqa [ARG + _aesarg_out + 16*2], xmm7 - movdqa [ARG + _aesarg_out + 16*3], xmm8 -%endif - -;; XMMs are saved at a higher level - mov rbp, [GPR_SAVE_AREA + 8*0] -%ifdef CBC_MAC - mov rbx, [GPR_SAVE_AREA + 8*1] - mov r12, [GPR_SAVE_AREA + 8*2] - mov r13, [GPR_SAVE_AREA + 8*3] - mov r14, [GPR_SAVE_AREA + 8*4] - mov r15, [GPR_SAVE_AREA + 8*5] -%ifndef LINUX - mov rsi, [GPR_SAVE_AREA + 8*6] - mov rdi, [GPR_SAVE_AREA + 8*7] -%endif -%endif - - add rsp, STACK_size - -%ifdef SAFE_DATA - clear_all_xmms_sse_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_X8 CBC, 13, 16, {arg1 + _aesarg_IV}, {arg1 + _aesarg_keys}, {arg1 + _aesarg_in}, {arg1 + _aesarg_out} + ret mksection stack-noexec diff --git a/lib/sse_t3/aes256_cbc_mac_x8_sse.asm b/lib/sse_t3/aes256_cbc_mac_x8_sse.asm index 289e4081..43bebe72 100644 --- a/lib/sse_t3/aes256_cbc_mac_x8_sse.asm +++ b/lib/sse_t3/aes256_cbc_mac_x8_sse.asm @@ -25,7 +25,16 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -;;; Routine to compute CBC-MAC based on 256 bit CBC AES encryption code +;; AES-CMAC-256 -%define CBC_MAC -%include "sse_t3/aes256_cbc_enc_x8_sse.asm" +%include "include/aes_cbc_enc_x8_sse.inc" + +mksection .text + +align 64 +MKGLOBAL(aes256_cbc_mac_x8_sse,function,internal) +aes256_cbc_mac_x8_sse: + AES_CBC_X8 CBC_XCBC_MAC, 13, 16, {arg1 + _aesarg_IV}, {arg1 + _aesarg_keys}, {arg1 + _aesarg_in} + ret + +mksection stack-noexec -- GitLab From df7b41af78700e8ea81f5ee2531c3363ed8c865d Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Fri, 9 Jun 2023 17:09:14 +0100 Subject: [PATCH 015/204] sse: [aes-cbc] unify AES-CBC decrypt code --- lib/include/aes_cbc_dec_by8_sse.inc | 302 ++++++++++++++++++++++ lib/sse_t3/aes128_cbc_dec_by8_sse.asm | 297 ++-------------------- lib/sse_t3/aes192_cbc_dec_by8_sse.asm | 317 ++---------------------- lib/sse_t3/aes256_cbc_dec_by8_sse.asm | 344 ++------------------------ 4 files changed, 361 insertions(+), 899 deletions(-) create mode 100644 lib/include/aes_cbc_dec_by8_sse.inc diff --git a/lib/include/aes_cbc_dec_by8_sse.inc b/lib/include/aes_cbc_dec_by8_sse.inc new file mode 100644 index 00000000..23d8afca --- /dev/null +++ b/lib/include/aes_cbc_dec_by8_sse.inc @@ -0,0 +1,302 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +;; macro to do a AES-CBC +;; - single-buffer implementation +;; - 8 blocks at a time + +%use smartalign + +%include "include/os.inc" +%include "include/mb_mgr_datastruct.inc" +%include "include/clear_regs.inc" +%include "include/reg_sizes.inc" + +%define CONCAT(a,b) a %+ b + +%define xdata0 xmm0 +%define xdata1 xmm1 +%define xdata2 xmm2 +%define xdata3 xmm3 +%define xdata4 xmm4 +%define xdata5 xmm5 +%define xdata6 xmm6 +%define xdata7 xmm7 + +%define xiv0 xmm8 +%define xiv1 xmm9 +%define xiv2 xmm10 +%define xiv3 xmm11 +%define xiv4 xmm12 +%define xiv5 xmm13 +%define xiv6 xmm14 + +%define xkeytmp xmm15 + +struc STACK +_IV: resq 2 +_IV_new: resq 2 +_rsp_save: resq 1 +endstruc + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DO_AES_DEC num_in_par load_keys +;; - it increments p_in and p_out +;; - ZF (zero-flag) gets updated +;; - ZF means this is the end of the message + +%macro DO_AES_DEC 6-7 +%define %%p_in %1 ;; [in/out] GP register with input pointer +%define %%p_out %2 ;; [in/out] GP register with output pointer +%define %%p_keys %3 ;; [in] GP register with pointer to AES round keys +%define %%by %4 ;; [in] numeric value; number of blocks to process (1 to 8) +%define %%num_rounds %5 ;; [in] numeric - number fo aesdec rounds (ark / declast not included) +%define %%length %6 ;; [in/out] GP register with message length +%define %%type %7 ;; [in] "main" or "last" selector of 8 block invocation + + ;; load cipher text +%assign i 0 +%rep %%by +%if !((%%by == 8) && (i == 0)) + movdqu CONCAT(xdata,i), [%%p_in + (i * 16)] +%endif +%if i == (%%by - 1) + movdqa [rsp + _IV_new], CONCAT(xdata,i) +%else + movdqa CONCAT(xiv,i), CONCAT(xdata,i) +%endif +%assign i (i + 1) +%endrep + + ;; ARK +%assign i 0 + movdqa xkeytmp, [%%p_keys + (0 * 16)] +%rep %%by + pxor CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep + + ;; AESDEC rounds +%assign round 1 +%rep %%num_rounds + movdqa xkeytmp, [%%p_keys + (round * 16)] +%assign i 0 +%rep %%by + aesdec CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep +%assign round (round + 1) +%endrep ;; round + + ;; AESDEC last +%assign i 0 + movdqa xkeytmp, [%%p_keys + (round * 16)] +%rep %%by + aesdeclast CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep + + ;; XOR IV + pxor xdata0, [rsp + _IV] +%assign i 1 +%assign j 0 +%if (%%by > 1) +%rep (%%by - 1) + pxor CONCAT(xdata,i), CONCAT(xiv,j) +%assign i (i + 1) +%assign j (j + 1) +%endrep +%endif + + ;; prepare IV for the next round + movdqa xkeytmp, [rsp + _IV_new] + movdqa [rsp + _IV], xkeytmp + + ;; store plain text blocks + + ;; - do only (%%by - 1) stores first +%assign i 0 +%rep %%by - 1 + movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%assign i (i + 1) +%endrep + +%if %%by < 8 + ;; 1 to 7 block case: + ;; - check if message length is more than %%by blocks + ;; yes: load 1st block for the next round and then store the last block of this round + ;; no: store the last block of this round + + cmp %%length, %%by * 16 + jbe %%_just_finish_stores + ;; load 1st block of data in the next round + movdqu xkeytmp, [%%p_in + (%%by * 16)] + movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) + movdqa xdata0, xkeytmp + jmp %%_update_pointers + +%%_just_finish_stores: + movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) + +%else + ;; 8 block case + ;; - two cases: main (main 8 block loop) and last (last 8 blocks) + +%ifidni %%type, main + ;; - MAIN: load 1st block for the next round and then store 8 blocks of this round + movdqu xdata0, [%%p_in + (%%by * 16)] + movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif + +%ifidni %%type, last + ;; LAST: store all 8 blocks + movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif +%endif + +%%_update_pointers: + add %%p_in, (16 * %%by) + add %%p_out, (16 * %%by) + +%if %%by < 8 + and %%length, ~(7 * 16) +%else + sub %%length, 8 * 16 +%endif + ;; Z-Flag gets updated + ;; - ZF means this is the end of the message +%endmacro + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%macro AES_CBC_DEC 7 +%define %%p_in %1 ;; [in/out] gp register; cipher text pointer +%define %%p_IV %2 ;; [in] gp register; IV pointer +%define %%p_keys %3 ;; [in] gp register; expanded keys pointer +%define %%p_out %4 ;; [in/out] gp registerl plain text pointer +%define %%length %5 ;; [in/clobbered] gp register; message length in bytes +%define %%tmp %6 ;; [clobbered] gp register +%define %%num_rounds %7 ;; [in] numeric value; number of AES rounds (excluding ARK and last round) + ;; create stack frame + mov %%tmp, rsp + sub rsp, STACK_size + and rsp, -16 + mov [rsp + _rsp_save], %%tmp + + ;; load IV and put it on the stack frame + movdqu xmm0, [%%p_IV] + movdqa [rsp + _IV], xmm0 + + ;; process 1 to 7 blocks first + mov DWORD(%%tmp), DWORD(%%length) + and DWORD(%%tmp), (7 * 16) + jz %%_eq0 + + ;; 1 <= %%tmp <= 7 + cmp DWORD(%%tmp), 4 * 16 + jg %%_gt4 + je %%_eq4 +%%_lt4: + cmp DWORD(%%tmp), 2 * 16 + jg %%_eq3 + je %%_eq2 +%%_eq1: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 1, %%num_rounds, %%length + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq2: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 2, %%num_rounds, %%length + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq3: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 3, %%num_rounds, %%length + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq4: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 4, %%num_rounds, %%length + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_gt4: + cmp DWORD(%%tmp), 6 * 16 + jg %%_eq7 + je %%_eq6 +%%_eq5: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 5, %%num_rounds, %%length + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq6: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 6, %%num_rounds, %%length + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq7: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 7, %%num_rounds, %%length + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq0: + movdqu xdata0, [%%p_in] + +align 32 +%%_main_loop: + cmp %%length, 2 * (8 * 16) + jb %%_the_last_8_blocks + ;; %%length is a multiple of 8 blocks (length = N x 8 x 16-bytes, where N = 2, 3, ..) + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 8, %%num_rounds, %%length, main + jmp %%_main_loop + +align 32 +%%_the_last_8_blocks: + ;; %%length is 8 blocks (8 x 16-bytes) + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 8, %%num_rounds, %%length, last + +align 32 +%%_do_return: +%ifdef SAFE_DATA + clear_all_xmms_sse_asm +%endif ;; SAFE_DATA + + ;; restore the stack pointer + ;; - IV is cipher text, no need to clear it from the stack + mov rsp, [rsp + _rsp_save] + +%endmacro + diff --git a/lib/sse_t3/aes128_cbc_dec_by8_sse.asm b/lib/sse_t3/aes128_cbc_dec_by8_sse.asm index d9ca933e..7ddf5d4f 100644 --- a/lib/sse_t3/aes128_cbc_dec_by8_sse.asm +++ b/lib/sse_t3/aes128_cbc_dec_by8_sse.asm @@ -25,300 +25,39 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -; routine to do AES cbc decrypt on 16n bytes doing AES by 8 +;; AES-CBC-128 -; XMM registers are clobbered. Saving/restoring must be done at a higher level - -; void aes_cbc_dec_128_by8_sse(void *in, -; UINT128 *IV, -; UINT128 keys[11], -; void *out, -; UINT64 len_bytes); -; ; arg 1: IN: pointer to input (cipher text) ; arg 2: IV: pointer to IV ; arg 3: KEYS: pointer to keys ; arg 4: OUT: pointer to output (plain text) ; arg 5: LEN: length in bytes (multiple of 16) -; -%include "include/os.inc" -%include "include/clear_regs.inc" - -%ifndef AES_CBC_DEC_128 -%define AES_CBC_DEC_128 aes_cbc_dec_128_by8_sse -%endif - -%define CONCAT(a,b) a %+ b -%define MOVDQ movdqu - -%define xdata0 xmm0 -%define xdata1 xmm1 -%define xdata2 xmm2 -%define xdata3 xmm3 -%define xdata4 xmm4 -%define xdata5 xmm5 -%define xdata6 xmm6 -%define xdata7 xmm7 -%define xIV xmm8 -%define xkey0 xmm9 -%define xkey2 xmm10 -%define xkey4 xmm11 -%define xkey6 xmm12 -%define xkey8 xmm13 -%define xkey10 xmm14 -%define xkeytmp xmm15 %ifdef LINUX -%define p_in rdi -%define p_IV rsi -%define p_keys rdx -%define p_out rcx -%define num_bytes r8 +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 %else -%define p_in rcx -%define p_IV rdx -%define p_keys r8 -%define p_out r9 -%define num_bytes rax -%endif - -%define tmp r10 - -%macro do_aes_load 1 - do_aes %1, 1 -%endmacro - -%macro do_aes_noload 1 - do_aes %1, 0 -%endmacro - -; do_aes num_in_par load_keys -; This increments p_in, but not p_out -%macro do_aes 2 -%define %%by %1 -%define %%load_keys %2 - -%if (%%load_keys) - movdqa xkey0, [p_keys + 0*16] -%endif - -%assign i 0 -%rep %%by - MOVDQ CONCAT(xdata,i), [p_in + i*16] -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey2, [p_keys + 2*16] -%endif -%assign i 0 -%rep %%by - pxor CONCAT(xdata,i), xkey0 -%assign i (i+1) -%endrep - - add p_in, 16*%%by - - movdqa xkeytmp, [p_keys + 1*16] -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey4, [p_keys + 4*16] -%endif -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey2 -%assign i (i+1) -%endrep - - movdqa xkeytmp, [p_keys + 3*16] -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey6, [p_keys + 6*16] -%endif -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey4 -%assign i (i+1) -%endrep - - movdqa xkeytmp, [p_keys + 5*16] -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey8, [p_keys + 8*16] +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%define arg5 rax %endif -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey6 -%assign i (i+1) -%endrep - movdqa xkeytmp, [p_keys + 7*16] -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey10, [p_keys + 10*16] -%endif -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey8 -%assign i (i+1) -%endrep - - movdqa xkeytmp, [p_keys + 9*16] -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%assign i 0 -%rep %%by - aesdeclast CONCAT(xdata,i), xkey10 -%assign i (i+1) -%endrep - - pxor xdata0, xIV -%assign i 1 -%if (%%by > 1) -%rep (%%by - 1) - MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - pxor CONCAT(xdata,i), xIV -%assign i (i+1) -%endrep -%endif - MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - -%assign i 0 -%rep %%by - MOVDQ [p_out + i*16], CONCAT(xdata,i) -%assign i (i+1) -%endrep -%endmacro - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%include "include/aes_cbc_dec_by8_sse.inc" mksection .text -;; AES_CBC_DEC_128(void *in, void *IV, void *keys, void *out, UINT64 num_bytes) -align 32 -MKGLOBAL(AES_CBC_DEC_128,function,internal) -AES_CBC_DEC_128: +align 64 +MKGLOBAL(aes_cbc_dec_128_by8_sse,function,internal) +aes_cbc_dec_128_by8_sse: %ifndef LINUX - mov num_bytes, [rsp + 8*5] + mov arg5, [rsp + 5*8] %endif - movdqu xIV, [p_IV] - - mov tmp, num_bytes - and tmp, 7*16 - jz mult_of_8_blks - - ; 1 <= tmp <= 7 - cmp tmp, 4*16 - jg gt4 - je eq4 - -lt4: - cmp tmp, 2*16 - jg eq3 - je eq2 -eq1: - do_aes_load 1 - add p_out, 1*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq2: - do_aes_load 2 - add p_out, 2*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq3: - do_aes_load 3 - add p_out, 3*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq4: - do_aes_load 4 - add p_out, 4*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -gt4: - cmp tmp, 6*16 - jg eq7 - je eq6 - -eq5: - do_aes_load 5 - add p_out, 5*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq6: - do_aes_load 6 - add p_out, 6*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq7: - do_aes_load 7 - add p_out, 7*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -mult_of_8_blks: - movdqa xkey0, [p_keys + 0*16] - movdqa xkey2, [p_keys + 2*16] - movdqa xkey4, [p_keys + 4*16] - movdqa xkey6, [p_keys + 6*16] - movdqa xkey8, [p_keys + 8*16] - movdqa xkey10, [p_keys + 10*16] - -main_loop2: - -main_loop3: - ; num_bytes is a multiple of 8 and >0 - do_aes_noload 8 - add p_out, 8*16 - sub num_bytes, 8*16 - jne main_loop3 - -do_return2: - -%ifdef SAFE_DATA - clear_all_xmms_sse_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_DEC arg1, arg2, arg3, arg4, arg5, r10, 9 + ret mksection stack-noexec diff --git a/lib/sse_t3/aes192_cbc_dec_by8_sse.asm b/lib/sse_t3/aes192_cbc_dec_by8_sse.asm index cba77374..edf1a8bd 100644 --- a/lib/sse_t3/aes192_cbc_dec_by8_sse.asm +++ b/lib/sse_t3/aes192_cbc_dec_by8_sse.asm @@ -25,320 +25,39 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -; routine to do AES cbc decrypt on 16n bytes doing AES by 8 +;; AES-CBC-192 -; XMM registers are clobbered. Saving/restoring must be done at a higher level - -; void aes_cbc_dec_192_by8_sse(void *in, -; UINT128 *IV, -; UINT128 keys[13], // +1 over key length -; void *out, -; UINT64 len_bytes); -; ; arg 1: IN: pointer to input (cipher text) ; arg 2: IV: pointer to IV ; arg 3: KEYS: pointer to keys ; arg 4: OUT: pointer to output (plain text) ; arg 5: LEN: length in bytes (multiple of 16) -; -%include "include/os.inc" -%include "include/clear_regs.inc" - -%ifndef AES_CBC_DEC_192 -%define AES_CBC_DEC_192 aes_cbc_dec_192_by8_sse -%endif - -%define CONCAT(a,b) a %+ b -%define MOVDQ movdqu - -%define xdata0 xmm0 -%define xdata1 xmm1 -%define xdata2 xmm2 -%define xdata3 xmm3 -%define xdata4 xmm4 -%define xdata5 xmm5 -%define xdata6 xmm6 -%define xdata7 xmm7 -%define xIV xmm8 -%define xkey0 xmm9 -%define xkey3 xmm10 -%define xkey6 xmm11 -%define xkey9 xmm12 -%define xkey12 xmm13 -%define xkeyA xmm14 -%define xkeyB xmm15 %ifdef LINUX -%define p_in rdi -%define p_IV rsi -%define p_keys rdx -%define p_out rcx -%define num_bytes r8 +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 %else -%define p_in rcx -%define p_IV rdx -%define p_keys r8 -%define p_out r9 -%define num_bytes rax -%endif - -%define tmp r10 - -%macro do_aes_load 1 - do_aes %1, 1 -%endmacro - -%macro do_aes_noload 1 - do_aes %1, 0 -%endmacro - -; do_aes num_in_par load_keys -; This increments p_in, but not p_out -%macro do_aes 2 -%define %%by %1 -%define %%load_keys %2 - -%if (%%load_keys) - movdqa xkey0, [p_keys + 0*16] -%endif - -%assign i 0 -%rep %%by - MOVDQ CONCAT(xdata,i), [p_in + i*16] -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 1*16] - -%assign i 0 -%rep %%by - pxor CONCAT(xdata,i), xkey0 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 2*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - - add p_in, 16*%%by - -%if (%%load_keys) - movdqa xkey3, [p_keys + 3*16] +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%define arg5 rax %endif -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 4*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey3 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 5*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey6, [p_keys + 6*16] -%endif - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 7*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey6 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 8*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey9, [p_keys + 9*16] -%endif - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 10*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey9 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 11*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey12, [p_keys + 12*16] -%endif - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - -%assign i 0 -%rep %%by - aesdeclast CONCAT(xdata,i), xkey12 -%assign i (i+1) -%endrep - - pxor xdata0, xIV -%assign i 1 -%if (%%by > 1) -%rep (%%by - 1) - MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - pxor CONCAT(xdata,i), xIV -%assign i (i+1) -%endrep -%endif - MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - -%assign i 0 -%rep %%by - MOVDQ [p_out + i*16], CONCAT(xdata,i) -%assign i (i+1) -%endrep -%endmacro - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%include "include/aes_cbc_dec_by8_sse.inc" mksection .text -align 32 -;; AES_CBC_DEC_192(void *in, void *IV, void *keys, void *out, UINT64 num_bytes) -MKGLOBAL(AES_CBC_DEC_192,function,internal) -AES_CBC_DEC_192: +align 64 +MKGLOBAL(aes_cbc_dec_192_by8_sse,function,internal) +aes_cbc_dec_192_by8_sse: %ifndef LINUX - mov num_bytes, [rsp + 8*5] + mov arg5, [rsp + 5*8] %endif - movdqu xIV, [p_IV] - - mov tmp, num_bytes - and tmp, 7*16 - jz mult_of_8_blks - - ; 1 <= tmp <= 7 - cmp tmp, 4*16 - jg gt4 - je eq4 - -lt4: - cmp tmp, 2*16 - jg eq3 - je eq2 -eq1: - do_aes_load 1 - add p_out, 1*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq2: - do_aes_load 2 - add p_out, 2*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq3: - do_aes_load 3 - add p_out, 3*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq4: - do_aes_load 4 - add p_out, 4*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -gt4: - cmp tmp, 6*16 - jg eq7 - je eq6 - -eq5: - do_aes_load 5 - add p_out, 5*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq6: - do_aes_load 6 - add p_out, 6*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq7: - do_aes_load 7 - add p_out, 7*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -mult_of_8_blks: - movdqa xkey0, [p_keys + 0*16] - movdqa xkey3, [p_keys + 3*16] - movdqa xkey6, [p_keys + 6*16] - movdqa xkey9, [p_keys + 9*16] - movdqa xkey12, [p_keys + 12*16] - -main_loop2: - ; num_bytes is a multiple of 8 and >0 - do_aes_noload 8 - add p_out, 8*16 - sub num_bytes, 8*16 - jne main_loop2 - -do_return2: -%ifdef SAFE_DATA - clear_all_xmms_sse_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_DEC arg1, arg2, arg3, arg4, arg5, r10, 11 + ret mksection stack-noexec diff --git a/lib/sse_t3/aes256_cbc_dec_by8_sse.asm b/lib/sse_t3/aes256_cbc_dec_by8_sse.asm index cee35d22..d082797f 100644 --- a/lib/sse_t3/aes256_cbc_dec_by8_sse.asm +++ b/lib/sse_t3/aes256_cbc_dec_by8_sse.asm @@ -25,337 +25,39 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -; routine to do AES cbc decrypt on 16n bytes doing AES by 8 +;; AES-CBC-256 -; XMM registers are clobbered. Saving/restoring must be done at a higher level - -; void aes_cbc_dec_256_by8_sse(void *in, -; UINT128 *IV, -; UINT128 keys[15], -; void *out, -; UINT64 len_bytes); -; -; arg 1: rcx: pointer to input (cipher text) -; arg 2: rdx: pointer to IV -; arg 3: r8: pointer to keys -; arg 4: r9: pointer to output (plain text) -; arg 5: sp: length in bytes (multiple of 16) -; - -%include "include/os.inc" -%include "include/clear_regs.inc" - -%ifndef AES_CBC_DEC_256 -%define AES_CBC_DEC_256 aes_cbc_dec_256_by8_sse -%endif - -%define CONCAT(a,b) a %+ b -%define MOVDQ movdqu - -%define xdata0 xmm0 -%define xdata1 xmm1 -%define xdata2 xmm2 -%define xdata3 xmm3 -%define xdata4 xmm4 -%define xdata5 xmm5 -%define xdata6 xmm6 -%define xdata7 xmm7 -%define xIV xmm8 -%define xkey0 xmm9 -%define xkey3 xmm10 -%define xkey6 xmm11 -%define xkey9 xmm12 -%define xkey12 xmm13 -%define xkeyA xmm14 -%define xkeyB xmm15 +; arg 1: IN: pointer to input (cipher text) +; arg 2: IV: pointer to IV +; arg 3: KEYS: pointer to keys +; arg 4: OUT: pointer to output (plain text) +; arg 5: LEN: length in bytes (multiple of 16) %ifdef LINUX -%define p_in rdi -%define p_IV rsi -%define p_keys rdx -%define p_out rcx -%define num_bytes r8 +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 %else -%define p_in rcx -%define p_IV rdx -%define p_keys r8 -%define p_out r9 -%define num_bytes rax -%endif - -%define tmp r10 - -%macro do_aes_load 1 - do_aes %1, 1 -%endmacro - -%macro do_aes_noload 1 - do_aes %1, 0 -%endmacro - -; do_aes num_in_par load_keys -; This increments p_in, but not p_out -%macro do_aes 2 -%define %%by %1 -%define %%load_keys %2 - -%if (%%load_keys) - movdqa xkey0, [p_keys + 0*16] -%endif - -%assign i 0 -%rep %%by - MOVDQ CONCAT(xdata,i), [p_in + i*16] -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 1*16] - -%assign i 0 -%rep %%by - pxor CONCAT(xdata,i), xkey0 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 2*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - - add p_in, 16*%%by - -%if (%%load_keys) - movdqa xkey3, [p_keys + 3*16] -%endif - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 4*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey3 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 5*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey6, [p_keys + 6*16] -%endif - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 7*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey6 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 8*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey9, [p_keys + 9*16] -%endif - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 10*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey9 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 11*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - movdqa xkey12, [p_keys + 12*16] -%endif - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - movdqa xkeyA, [p_keys + 13*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkey12 -%assign i (i+1) -%endrep - - movdqa xkeyB, [p_keys + 14*16] - -%assign i 0 -%rep %%by - aesdec CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%assign i 0 -%rep %%by - aesdeclast CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - pxor xdata0, xIV -%assign i 1 -%if (%%by > 1) -%rep (%%by - 1) - MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - pxor CONCAT(xdata,i), xIV -%assign i (i+1) -%endrep +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%define arg5 rax %endif - MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - -%assign i 0 -%rep %%by - MOVDQ [p_out + i*16], CONCAT(xdata,i) -%assign i (i+1) -%endrep -%endmacro -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%include "include/aes_cbc_dec_by8_sse.inc" mksection .text -align 32 -;; AES_CBC_DEC_256(void *in, void *IV, void *keys, void *out, UINT64 num_bytes) -MKGLOBAL(AES_CBC_DEC_256,function,internal) -AES_CBC_DEC_256: +align 64 +MKGLOBAL(aes_cbc_dec_256_by8_sse,function,internal) +aes_cbc_dec_256_by8_sse: %ifndef LINUX - mov num_bytes, [rsp + 8*5] + mov arg5, [rsp + 5*8] %endif - movdqu xIV, [p_IV] - - mov tmp, num_bytes - and tmp, 7*16 - jz mult_of_8_blks - - ; 1 <= tmp <= 7 - cmp tmp, 4*16 - jg gt4 - je eq4 - -lt4: - cmp tmp, 2*16 - jg eq3 - je eq2 -eq1: - do_aes_load 1 - add p_out, 1*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq2: - do_aes_load 2 - add p_out, 2*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq3: - do_aes_load 3 - add p_out, 3*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq4: - do_aes_load 4 - add p_out, 4*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -gt4: - cmp tmp, 6*16 - jg eq7 - je eq6 - -eq5: - do_aes_load 5 - add p_out, 5*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq6: - do_aes_load 6 - add p_out, 6*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq7: - do_aes_load 7 - add p_out, 7*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -mult_of_8_blks: - movdqa xkey0, [p_keys + 0*16] - movdqa xkey3, [p_keys + 3*16] - movdqa xkey6, [p_keys + 6*16] - movdqa xkey9, [p_keys + 9*16] - movdqa xkey12, [p_keys + 12*16] - -main_loop2: - ; num_bytes is a multiple of 8 and >0 - do_aes_noload 8 - add p_out, 8*16 - sub num_bytes, 8*16 - jne main_loop2 - -do_return2: -%ifdef SAFE_DATA - clear_all_xmms_sse_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_DEC arg1, arg2, arg3, arg4, arg5, r10, 13 + ret mksection stack-noexec -- GitLab From d9978f2556eac97fc4d0e21dce32e72ba3d9e299 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 12 Jun 2023 17:01:42 +0100 Subject: [PATCH 016/204] sse: [aes-cbc] optimize number of cleared SIMD registers for decrypt direction and safe data --- lib/include/aes_cbc_dec_by8_sse.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/include/aes_cbc_dec_by8_sse.inc b/lib/include/aes_cbc_dec_by8_sse.inc index 23d8afca..ea64b718 100644 --- a/lib/include/aes_cbc_dec_by8_sse.inc +++ b/lib/include/aes_cbc_dec_by8_sse.inc @@ -291,7 +291,7 @@ align 32 align 32 %%_do_return: %ifdef SAFE_DATA - clear_all_xmms_sse_asm + clear_xmms_sse xdata0, xdata1, xdata2, xdata3, xdata4, xdata5, xdata6, xdata7, xkeytmp %endif ;; SAFE_DATA ;; restore the stack pointer -- GitLab From b29a59e797d3f5326c54b03a4248fb9716a7d8d1 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 12 Jun 2023 18:17:44 +0100 Subject: [PATCH 017/204] sse: [aes-cbc] optimize decrypt direction and messages shorter than 8 blocks --- lib/include/aes_cbc_dec_by8_sse.inc | 110 +++++++++++++++++++++++++--- 1 file changed, 98 insertions(+), 12 deletions(-) diff --git a/lib/include/aes_cbc_dec_by8_sse.inc b/lib/include/aes_cbc_dec_by8_sse.inc index ea64b718..05681af0 100644 --- a/lib/include/aes_cbc_dec_by8_sse.inc +++ b/lib/include/aes_cbc_dec_by8_sse.inc @@ -69,7 +69,7 @@ endstruc ;; - ZF (zero-flag) gets updated ;; - ZF means this is the end of the message -%macro DO_AES_DEC 6-7 +%macro DO_AES_DEC 7 %define %%p_in %1 ;; [in/out] GP register with input pointer %define %%p_out %2 ;; [in/out] GP register with output pointer %define %%p_keys %3 ;; [in] GP register with pointer to AES round keys @@ -77,6 +77,21 @@ endstruc %define %%num_rounds %5 ;; [in] numeric - number fo aesdec rounds (ark / declast not included) %define %%length %6 ;; [in/out] GP register with message length %define %%type %7 ;; [in] "main" or "last" selector of 8 block invocation + ;; "short" or "start" selector for < 8 blocks + +%assign is_1_to_7_short_or_8_last 0 + +%if %%by < 8 +%ifidni %%type, short +%assign is_1_to_7_short_or_8_last 1 +%endif +%endif + +%if %%by == 8 +%ifidni %%type, last +%assign is_1_to_7_short_or_8_last 1 +%endif +%endif ;; load cipher text %assign i 0 @@ -132,9 +147,11 @@ endstruc %endrep %endif +%if is_1_to_7_short_or_8_last == 0 ;; prepare IV for the next round movdqa xkeytmp, [rsp + _IV_new] movdqa [rsp + _IV], xkeytmp +%endif ;; store plain text blocks @@ -147,6 +164,7 @@ endstruc %if %%by < 8 ;; 1 to 7 block case: +%ifidni %%type, start ;; - check if message length is more than %%by blocks ;; yes: load 1st block for the next round and then store the last block of this round ;; no: store the last block of this round @@ -160,7 +178,13 @@ endstruc jmp %%_update_pointers %%_just_finish_stores: - movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) + movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif + +%ifidni %%type, short + ;; short message - just store + movdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif %else ;; 8 block case @@ -179,6 +203,8 @@ endstruc %endif %%_update_pointers: + +%if is_1_to_7_short_or_8_last == 0 add %%p_in, (16 * %%by) add %%p_out, (16 * %%by) @@ -189,6 +215,8 @@ endstruc %endif ;; Z-Flag gets updated ;; - ZF means this is the end of the message +%endif + %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -213,6 +241,64 @@ endstruc movdqu xmm0, [%%p_IV] movdqa [rsp + _IV], xmm0 + cmp %%length, 8 * 16 + jae %%_longer_than_8_blocks + + ;; process 1 to 7 blocks first + mov DWORD(%%tmp), DWORD(%%length) + and DWORD(%%tmp), (7 * 16) + + ;; 1 <= %%tmp <= 7 + cmp DWORD(%%tmp), 4 * 16 + ja %%_sgt4 + je %%_seq4 +%%_slt4: + cmp DWORD(%%tmp), 2 * 16 + ja %%_seq3 + je %%_seq2 +%%_seq1: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 1, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq2: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 2, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq3: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 3, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq4: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 4, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_sgt4: + cmp DWORD(%%tmp), 6 * 16 + ja %%_seq7 + je %%_seq6 +%%_seq5: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 5, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq6: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 6, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq7: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 7, %%num_rounds, %%length, short + jmp %%_do_return + + ;; ===================================================================== + ;; message longer than 8 blocks + +align 32 +%%_longer_than_8_blocks: ;; process 1 to 7 blocks first mov DWORD(%%tmp), DWORD(%%length) and DWORD(%%tmp), (7 * 16) @@ -220,54 +306,54 @@ endstruc ;; 1 <= %%tmp <= 7 cmp DWORD(%%tmp), 4 * 16 - jg %%_gt4 + ja %%_gt4 je %%_eq4 %%_lt4: cmp DWORD(%%tmp), 2 * 16 - jg %%_eq3 + ja %%_eq3 je %%_eq2 %%_eq1: - DO_AES_DEC %%p_in, %%p_out, %%p_keys, 1, %%num_rounds, %%length + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 1, %%num_rounds, %%length, start jz %%_do_return jmp %%_main_loop align 32 %%_eq2: - DO_AES_DEC %%p_in, %%p_out, %%p_keys, 2, %%num_rounds, %%length + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 2, %%num_rounds, %%length, start jz %%_do_return jmp %%_main_loop align 32 %%_eq3: - DO_AES_DEC %%p_in, %%p_out, %%p_keys, 3, %%num_rounds, %%length + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 3, %%num_rounds, %%length, start jz %%_do_return jmp %%_main_loop align 32 %%_eq4: - DO_AES_DEC %%p_in, %%p_out, %%p_keys, 4, %%num_rounds, %%length + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 4, %%num_rounds, %%length, start jz %%_do_return jmp %%_main_loop align 32 %%_gt4: cmp DWORD(%%tmp), 6 * 16 - jg %%_eq7 + ja %%_eq7 je %%_eq6 %%_eq5: - DO_AES_DEC %%p_in, %%p_out, %%p_keys, 5, %%num_rounds, %%length + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 5, %%num_rounds, %%length, start jz %%_do_return jmp %%_main_loop align 32 %%_eq6: - DO_AES_DEC %%p_in, %%p_out, %%p_keys, 6, %%num_rounds, %%length + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 6, %%num_rounds, %%length, start jz %%_do_return jmp %%_main_loop align 32 %%_eq7: - DO_AES_DEC %%p_in, %%p_out, %%p_keys, 7, %%num_rounds, %%length + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 7, %%num_rounds, %%length, start jz %%_do_return jmp %%_main_loop -- GitLab From 2a5b30151b940457407f133a28fc67ab0953aa10 Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Thu, 22 Jun 2023 10:05:52 +0100 Subject: [PATCH 018/204] test: [CTR] Unify test vectors --- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 2 +- test/kat-app/ctr_test.c | 1604 ++------------------------- test/kat-app/ctr_test.json.c | 432 ++++++++ test/kat-app/gcm_ctr_vectors_test.h | 1 - test/kat-app/main.c | 1 + test/kat-app/win_x64.mak | 2 +- 7 files changed, 547 insertions(+), 1496 deletions(-) create mode 100644 test/kat-app/ctr_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index ee6427cb..16b8d5f5 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -102,6 +102,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbcs_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cfb_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/ctr_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 47b323cd..a5f769eb 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -41,7 +41,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ - aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c + aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/ctr_test.c b/test/kat-app/ctr_test.c index 3252e7f8..72dd09f2 100644 --- a/test/kat-app/ctr_test.c +++ b/test/kat-app/ctr_test.c @@ -31,1317 +31,17 @@ #include #include -#include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "cipher_test.h" #define MAX_CTR_JOBS 32 #define BYTE_ROUND_UP(x) ((x + 7) / 8) -/* - * Test Vector from - * https://tools.ietf.org/html/rfc3686 - * - */ -/* - Test Vector #1: Encrypting 16 octets using AES-CTR with 128-bit key - AES Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E - AES-CTR IV : 00 00 00 00 00 00 00 00 - Nonce : 00 00 00 30 - Plaintext String : 'Single block msg' - Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 - Counter Block (1): 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 01 - Key Stream (1): B7 60 33 28 DB C2 93 1B 41 0E 16 C8 06 7E 62 DF - Ciphertext : E4 09 5D 4F B7 A7 B3 79 2D 61 75 A3 26 13 11 B8 -*/ -static const uint8_t K1_CTR[] = { - 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC, - 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E, -}; -static const uint8_t IV1_CTR[] = { - 0x00, 0x00, 0x00, 0x30, /* nonce */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t P1_CTR[] = { - 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62, - 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67, -}; -static const uint8_t C1_CTR[] = { - 0xE4, 0x09, 0x5D, 0x4F, 0xB7, 0xA7, 0xB3, 0x79, - 0x2D, 0x61, 0x75, 0xA3, 0x26, 0x13, 0x11, 0xB8, -}; -static const uint8_t T1_CTR[] = { 0 }; -static const uint8_t A1_CTR[] = { 0 }; -#define A1_CTR_len 0 - -/* - Test Vector #2: Encrypting 32 octets using AES-CTR with 128-bit key - AES Key : 7E 24 06 78 17 FA E0 D7 43 D6 CE 1F 32 53 91 63 - AES-CTR IV : C0 54 3B 59 DA 48 D9 0B - Nonce : 00 6C B6 DB - Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - : 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - Counter Block (1): 00 6C B6 DB C0 54 3B 59 DA 48 D9 0B 00 00 00 01 - Key Stream (1): 51 05 A3 05 12 8F 74 DE 71 04 4B E5 82 D7 DD 87 - Counter Block (2): 00 6C B6 DB C0 54 3B 59 DA 48 D9 0B 00 00 00 02 - Key Stream (2): FB 3F 0C EF 52 CF 41 DF E4 FF 2A C4 8D 5C A0 37 - Ciphertext : 51 04 A1 06 16 8A 72 D9 79 0D 41 EE 8E DA D3 88 - : EB 2E 1E FC 46 DA 57 C8 FC E6 30 DF 91 41 BE 28 -*/ -static const uint8_t K2_CTR[] = { - 0x7E, 0x24, 0x06, 0x78, 0x17, 0xFA, 0xE0, 0xD7, - 0x43, 0xD6, 0xCE, 0x1F, 0x32, 0x53, 0x91, 0x63, -}; -static const uint8_t IV2_CTR[] = { - 0x00, 0x6C, 0xB6, 0xDB, /* nonce */ - 0xC0, 0x54, 0x3B, 0x59, 0xDA, 0x48, 0xD9, 0x0B, -}; -static const uint8_t P2_CTR[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, -}; -static const uint8_t C2_CTR[] = { - 0x51, 0x04, 0xA1, 0x06, 0x16, 0x8A, 0x72, 0xD9, - 0x79, 0x0D, 0x41, 0xEE, 0x8E, 0xDA, 0xD3, 0x88, - 0xEB, 0x2E, 0x1E, 0xFC, 0x46, 0xDA, 0x57, 0xC8, - 0xFC, 0xE6, 0x30, 0xDF, 0x91, 0x41, 0xBE, 0x28, -}; -static const uint8_t T2_CTR[] = { 0 }; -static const uint8_t A2_CTR[] = { 0 }; -#define A2_CTR_len 0 - -/* - Test Vector #3: Encrypting 36 octets using AES-CTR with 128-bit key - AES Key : 76 91 BE 03 5E 50 20 A8 AC 6E 61 85 29 F9 A0 DC - AES-CTR IV : 27 77 7F 3F 4A 17 86 F0 - Nonce : 00 E0 01 7B - Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - : 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - : 20 21 22 23 - Counter Block (1): 00 E0 01 7B 27 77 7F 3F 4A 17 86 F0 00 00 00 01 - Key Stream (1): C1 CE 4A AB 9B 2A FB DE C7 4F 58 E2 E3 D6 7C D8 - Counter Block (2): 00 E0 01 7B 27 77 7F 3F 4A 17 86 F0 00 00 00 02 - Key Stream (2): 55 51 B6 38 CA 78 6E 21 CD 83 46 F1 B2 EE 0E 4C - Counter Block (3): 00 E0 01 7B 27 77 7F 3F 4A 17 86 F0 00 00 00 03 - Key Stream (3): 05 93 25 0C 17 55 36 00 A6 3D FE CF 56 23 87 E9 - Ciphertext : C1 CF 48 A8 9F 2F FD D9 CF 46 52 E9 EF DB 72 D7 - : 45 40 A4 2B DE 6D 78 36 D5 9A 5C EA AE F3 10 53 - : 25 B2 07 2F -*/ -static const uint8_t K3_CTR[] = { - 0x76, 0x91, 0xBE, 0x03, 0x5E, 0x50, 0x20, 0xA8, - 0xAC, 0x6E, 0x61, 0x85, 0x29, 0xF9, 0xA0, 0xDC, -}; -static const uint8_t IV3_CTR[] = { - 0x00, 0xE0, 0x01, 0x7B, /* nonce */ - 0x27, 0x77, 0x7F, 0x3F, 0x4A, 0x17, 0x86, 0xF0, -}; -static const uint8_t P3_CTR[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t C3_CTR[] = { - 0xC1, 0xCF, 0x48, 0xA8, 0x9F, 0x2F, 0xFD, 0xD9, - 0xCF, 0x46, 0x52, 0xE9, 0xEF, 0xDB, 0x72, 0xD7, - 0x45, 0x40, 0xA4, 0x2B, 0xDE, 0x6D, 0x78, 0x36, - 0xD5, 0x9A, 0x5C, 0xEA, 0xAE, 0xF3, 0x10, 0x53, - 0x25, 0xB2, 0x07, 0x2F, -}; -static const uint8_t T3_CTR[] = { 0 }; -static const uint8_t A3_CTR[] = { 0 }; -#define A3_CTR_len 0 - -/* - Test Vector #4: Encrypting 16 octets using AES-CTR with 192-bit key - AES Key : 16 AF 5B 14 5F C9 F5 79 C1 75 F9 3E 3B FB 0E ED - : 86 3D 06 CC FD B7 85 15 - AES-CTR IV : 36 73 3C 14 7D 6D 93 CB - Nonce : 00 00 00 48 - Plaintext String : 'Single block msg' - Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 - Counter Block (1): 00 00 00 48 36 73 3C 14 7D 6D 93 CB 00 00 00 01 - Key Stream (1): 18 3C 56 28 8E 3C E9 AA 22 16 56 CB 23 A6 9A 4F - Ciphertext : 4B 55 38 4F E2 59 C9 C8 4E 79 35 A0 03 CB E9 28 -*/ -static const uint8_t K4_CTR[] = { - 0x16, 0xAF, 0x5B, 0x14, 0x5F, 0xC9, 0xF5, 0x79, - 0xC1, 0x75, 0xF9, 0x3E, 0x3B, 0xFB, 0x0E, 0xED, - 0x86, 0x3D, 0x06, 0xCC, 0xFD, 0xB7, 0x85, 0x15, -}; -static const uint8_t IV4_CTR[] = { - 0x00, 0x00, 0x00, 0x48, /* nonce */ - 0x36, 0x73, 0x3C, 0x14, 0x7D, 0x6D, 0x93, 0xCB, -}; -static const uint8_t P4_CTR[] = { - 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62, - 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67, -}; -static const uint8_t C4_CTR[] = { - 0x4B, 0x55, 0x38, 0x4F, 0xE2, 0x59, 0xC9, 0xC8, - 0x4E, 0x79, 0x35, 0xA0, 0x03, 0xCB, 0xE9, 0x28, -}; -static const uint8_t T4_CTR[] = { 0 }; -static const uint8_t A4_CTR[] = { 0 }; -#define A4_CTR_len 0 - -/* - Test Vector #5: Encrypting 32 octets using AES-CTR with 192-bit key - AES Key : 7C 5C B2 40 1B 3D C3 3C 19 E7 34 08 19 E0 F6 9C - : 67 8C 3D B8 E6 F6 A9 1A - AES-CTR IV : 02 0C 6E AD C2 CB 50 0D - Nonce : 00 96 B0 3B - Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - : 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - Counter Block (1): 00 96 B0 3B 02 0C 6E AD C2 CB 50 0D 00 00 00 01 - Key Stream (1): 45 33 41 FF 64 9E 25 35 76 D6 A0 F1 7D 3C C3 90 - Counter Block (2): 00 96 B0 3B 02 0C 6E AD C2 CB 50 0D 00 00 00 02 - Key Stream (2): 94 81 62 0F 4E C1 B1 8B E4 06 FA E4 5E E9 E5 1F - Ciphertext : 45 32 43 FC 60 9B 23 32 7E DF AA FA 71 31 CD 9F - : 84 90 70 1C 5A D4 A7 9C FC 1F E0 FF 42 F4 FB 00 -*/ -static const uint8_t K5_CTR[] = { - 0x7C, 0x5C, 0xB2, 0x40, 0x1B, 0x3D, 0xC3, 0x3C, - 0x19, 0xE7, 0x34, 0x08, 0x19, 0xE0, 0xF6, 0x9C, - 0x67, 0x8C, 0x3D, 0xB8, 0xE6, 0xF6, 0xA9, 0x1A, -}; -static const uint8_t IV5_CTR[] = { - 0x00, 0x96, 0xB0, 0x3B, /* nonce */ - 0x02, 0x0C, 0x6E, 0xAD, 0xC2, 0xCB, 0x50, 0x0D, -}; -static const uint8_t P5_CTR[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, -}; -static const uint8_t C5_CTR[] = { - 0x45, 0x32, 0x43, 0xFC, 0x60, 0x9B, 0x23, 0x32, - 0x7E, 0xDF, 0xAA, 0xFA, 0x71, 0x31, 0xCD, 0x9F, - 0x84, 0x90, 0x70, 0x1C, 0x5A, 0xD4, 0xA7, 0x9C, - 0xFC, 0x1F, 0xE0, 0xFF, 0x42, 0xF4, 0xFB, 0x00, -}; -static const uint8_t T5_CTR[] = { 0 }; -static const uint8_t A5_CTR[] = { 0 }; -#define A5_CTR_len 0 - -/* - Test Vector #6: Encrypting 36 octets using AES-CTR with 192-bit key - AES Key : 02 BF 39 1E E8 EC B1 59 B9 59 61 7B 09 65 27 9B - : F5 9B 60 A7 86 D3 E0 FE - AES-CTR IV : 5C BD 60 27 8D CC 09 12 - Nonce : 00 07 BD FD - Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - : 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - : 20 21 22 23 - Counter Block (1): 00 07 BD FD 5C BD 60 27 8D CC 09 12 00 00 00 01 - Key Stream (1): 96 88 3D C6 5A 59 74 28 5C 02 77 DA D1 FA E9 57 - Counter Block (2): 00 07 BD FD 5C BD 60 27 8D CC 09 12 00 00 00 02 - Key Stream (2): C2 99 AE 86 D2 84 73 9F 5D 2F D2 0A 7A 32 3F 97 - Counter Block (3): 00 07 BD FD 5C BD 60 27 8D CC 09 12 00 00 00 03 - Key Stream (3): 8B CF 2B 16 39 99 B2 26 15 B4 9C D4 FE 57 39 98 - Ciphertext : 96 89 3F C5 5E 5C 72 2F 54 0B 7D D1 DD F7 E7 58 - : D2 88 BC 95 C6 91 65 88 45 36 C8 11 66 2F 21 88 - : AB EE 09 35 -*/ -static const uint8_t K6_CTR[] = { - 0x02, 0xBF, 0x39, 0x1E, 0xE8, 0xEC, 0xB1, 0x59, - 0xB9, 0x59, 0x61, 0x7B, 0x09, 0x65, 0x27, 0x9B, - 0xF5, 0x9B, 0x60, 0xA7, 0x86, 0xD3, 0xE0, 0xFE, -}; -static const uint8_t IV6_CTR[] = { - 0x00, 0x07, 0xBD, 0xFD, /* nonce */ - 0x5C, 0xBD, 0x60, 0x27, 0x8D, 0xCC, 0x09, 0x12, -}; -static const uint8_t P6_CTR[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t C6_CTR[] = { - 0x96, 0x89, 0x3F, 0xC5, 0x5E, 0x5C, 0x72, 0x2F, - 0x54, 0x0B, 0x7D, 0xD1, 0xDD, 0xF7, 0xE7, 0x58, - 0xD2, 0x88, 0xBC, 0x95, 0xC6, 0x91, 0x65, 0x88, - 0x45, 0x36, 0xC8, 0x11, 0x66, 0x2F, 0x21, 0x88, - 0xAB, 0xEE, 0x09, 0x35, -}; -static const uint8_t T6_CTR[] = { 0 }; -static const uint8_t A6_CTR[] = { 0 }; -#define A6_CTR_len 0 - -/* - Test Vector #7: Encrypting 16 octets using AES-CTR with 256-bit key - AES Key : 77 6B EF F2 85 1D B0 6F 4C 8A 05 42 C8 69 6F 6C - : 6A 81 AF 1E EC 96 B4 D3 7F C1 D6 89 E6 C1 C1 04 - AES-CTR IV : DB 56 72 C9 7A A8 F0 B2 - Nonce : 00 00 00 60 - Plaintext String : 'Single block msg' - Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 67 - Counter Block (1): 00 00 00 60 DB 56 72 C9 7A A8 F0 B2 00 00 00 01 - Key Stream (1): 47 33 BE 7A D3 E7 6E A5 3A 67 00 B7 51 8E 93 A7 - Ciphertext : 14 5A D0 1D BF 82 4E C7 56 08 63 DC 71 E3 E0 C0 -*/ -static const uint8_t K7_CTR[] = { - 0x77, 0x6B, 0xEF, 0xF2, 0x85, 0x1D, 0xB0, 0x6F, - 0x4C, 0x8A, 0x05, 0x42, 0xC8, 0x69, 0x6F, 0x6C, - 0x6A, 0x81, 0xAF, 0x1E, 0xEC, 0x96, 0xB4, 0xD3, - 0x7F, 0xC1, 0xD6, 0x89, 0xE6, 0xC1, 0xC1, 0x04, -}; -static const uint8_t IV7_CTR[] = { - 0x00, 0x00, 0x00, 0x60, /* nonce */ - 0xDB, 0x56, 0x72, 0xC9, 0x7A, 0xA8, 0xF0, 0xB2, -}; -static const uint8_t P7_CTR[] = { - 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62, - 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67, -}; -static const uint8_t C7_CTR[] = { - 0x14, 0x5A, 0xD0, 0x1D, 0xBF, 0x82, 0x4E, 0xC7, - 0x56, 0x08, 0x63, 0xDC, 0x71, 0xE3, 0xE0, 0xC0, -}; -static const uint8_t T7_CTR[] = { 0 }; -static const uint8_t A7_CTR[] = { 0 }; -#define A7_CTR_len 0 - -/* - Test Vector #8: Encrypting 32 octets using AES-CTR with 256-bit key - AES Key : F6 D6 6D 6B D5 2D 59 BB 07 96 36 58 79 EF F8 86 - : C6 6D D5 1A 5B 6A 99 74 4B 50 59 0C 87 A2 38 84 - AES-CTR IV : C1 58 5E F1 5A 43 D8 75 - Nonce : 00 FA AC 24 - Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - : 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - Counter block (1): 00 FA AC 24 C1 58 5E F1 5A 43 D8 75 00 00 00 01 - Key stream (1): F0 5F 21 18 3C 91 67 2B 41 E7 0A 00 8C 43 BC A6 - Counter block (2): 00 FA AC 24 C1 58 5E F1 5A 43 D8 75 00 00 00 02 - Key stream (2): A8 21 79 43 9B 96 8B 7D 4D 29 99 06 8F 59 B1 03 - Ciphertext : F0 5E 23 1B 38 94 61 2C 49 EE 00 0B 80 4E B2 A9 - : B8 30 6B 50 8F 83 9D 6A 55 30 83 1D 93 44 AF 1C -*/ -static const uint8_t K8_CTR[] = { - 0xF6, 0xD6, 0x6D, 0x6B, 0xD5, 0x2D, 0x59, 0xBB, - 0x07, 0x96, 0x36, 0x58, 0x79, 0xEF, 0xF8, 0x86, - 0xC6, 0x6D, 0xD5, 0x1A, 0x5B, 0x6A, 0x99, 0x74, - 0x4B, 0x50, 0x59, 0x0C, 0x87, 0xA2, 0x38, 0x84, -}; -static const uint8_t IV8_CTR[] = { - 0x00, 0xFA, 0xAC, 0x24, /* nonce */ - 0xC1, 0x58, 0x5E, 0xF1, 0x5A, 0x43, 0xD8, 0x75, -}; -static const uint8_t P8_CTR[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, -}; -static const uint8_t C8_CTR[] = { - 0xF0, 0x5E, 0x23, 0x1B, 0x38, 0x94, 0x61, 0x2C, - 0x49, 0xEE, 0x00, 0x0B, 0x80, 0x4E, 0xB2, 0xA9, - 0xB8, 0x30, 0x6B, 0x50, 0x8F, 0x83, 0x9D, 0x6A, - 0x55, 0x30, 0x83, 0x1D, 0x93, 0x44, 0xAF, 0x1C, -}; -static const uint8_t T8_CTR[] = { 0 }; -static const uint8_t A8_CTR[] = { 0 }; -#define A8_CTR_len 0 - -/* - Test Vector #9: Encrypting 36 octets using AES-CTR with 256-bit key - AES Key : FF 7A 61 7C E6 91 48 E4 F1 72 6E 2F 43 58 1D E2 - : AA 62 D9 F8 05 53 2E DF F1 EE D6 87 FB 54 15 3D - AES-CTR IV : 51 A5 1D 70 A1 C1 11 48 - Nonce : 00 1C C5 B7 - Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - : 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - : 20 21 22 23 - Counter block (1): 00 1C C5 B7 51 A5 1D 70 A1 C1 11 48 00 00 00 01 - Key stream (1): EB 6D 50 81 19 0E BD F0 C6 7C 9E 4D 26 C7 41 A5 - Counter block (2): 00 1C C5 B7 51 A5 1D 70 A1 C1 11 48 00 00 00 02 - Key stream (2): A4 16 CD 95 71 7C EB 10 EC 95 DA AE 9F CB 19 00 - Counter block (3): 00 1C C5 B7 51 A5 1D 70 A1 C1 11 48 00 00 00 03 - Key stream (3): 3E E1 C4 9B C6 B9 CA 21 3F 6E E2 71 D0 A9 33 39 - Ciphertext : EB 6C 52 82 1D 0B BB F7 CE 75 94 46 2A CA 4F AA - : B4 07 DF 86 65 69 FD 07 F4 8C C0 B5 83 D6 07 1F - : 1E C0 E6 B8 -*/ -static const uint8_t K9_CTR[] = { - 0xFF, 0x7A, 0x61, 0x7C, 0xE6, 0x91, 0x48, 0xE4, - 0xF1, 0x72, 0x6E, 0x2F, 0x43, 0x58, 0x1D, 0xE2, - 0xAA, 0x62, 0xD9, 0xF8, 0x05, 0x53, 0x2E, 0xDF, - 0xF1, 0xEE, 0xD6, 0x87, 0xFB, 0x54, 0x15, 0x3D, -}; -static const uint8_t IV9_CTR[] = { - 0x00, 0x1C, 0xC5, 0xB7, /* nonce */ - 0x51, 0xA5, 0x1D, 0x70, 0xA1, 0xC1, 0x11, 0x48, -}; -static const uint8_t P9_CTR[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t C9_CTR[] = { - 0xEB, 0x6C, 0x52, 0x82, 0x1D, 0x0B, 0xBB, 0xF7, - 0xCE, 0x75, 0x94, 0x46, 0x2A, 0xCA, 0x4F, 0xAA, - 0xB4, 0x07, 0xDF, 0x86, 0x65, 0x69, 0xFD, 0x07, - 0xF4, 0x8C, 0xC0, 0xB5, 0x83, 0xD6, 0x07, 0x1F, - 0x1E, 0xC0, 0xE6, 0xB8, -}; -static const uint8_t T9_CTR[] = { 0 }; -static const uint8_t A9_CTR[] = { 0 }; -#define A9_CTR_len 0 - -/* - Test Vector #10: Encrypting 128 octets using AES-CTR with 128-bit key - AES Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E - AES-CTR IV : 00 00 00 00 00 00 00 00 - Nonce : 00 00 00 30 - Plaintext String : 'Full 8 blocks' -*/ -static const uint8_t K10_CTR[] = { - 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC, - 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E, -}; -static const uint8_t IV10_CTR[] = { - 0x00, 0x00, 0x00, 0x30, /* nonce */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t P10_CTR[] = { - 0xA8, 0x63, 0x44, 0xF8, 0x36, 0x59, 0x2F, 0xF2, - 0xDA, 0xDD, 0x17, 0xCE, 0xFE, 0x2A, 0xF2, 0xA2, - 0x35, 0x87, 0x34, 0x0F, 0x35, 0xFC, 0xD8, 0xF2, - 0x57, 0xA1, 0xCB, 0x19, 0x0C, 0x33, 0x14, 0xE1, - 0x23, 0xEB, 0xC0, 0x88, 0x82, 0x05, 0x5F, 0x01, - 0x5D, 0xFC, 0x53, 0x08, 0xDB, 0x34, 0x8E, 0x94, - 0xE4, 0xA8, 0x26, 0x7F, 0xBC, 0xB7, 0x8B, 0xE1, - 0x58, 0x2F, 0x2C, 0x91, 0xCD, 0x5B, 0x4A, 0xAA, - 0x7A, 0xBA, 0x5F, 0xD2, 0x9B, 0xF8, 0x7D, 0xEA, - 0x76, 0xB6, 0x64, 0xB3, 0x29, 0xD3, 0x02, 0x19, - 0xA0, 0xDC, 0xE9, 0xB8, 0x90, 0x51, 0xA8, 0xDE, - 0x2E, 0xA1, 0xB7, 0x7E, 0x51, 0x0D, 0x34, 0xB3, - 0xED, 0xE7, 0x5E, 0xB8, 0x8A, 0xE9, 0xFE, 0x89, - 0xF8, 0x0B, 0x85, 0x09, 0x76, 0x08, 0x78, 0x0D, - 0x27, 0x59, 0x8E, 0x14, 0x43, 0x46, 0xA0, 0x91, - 0xEE, 0xAA, 0xFF, 0x74, 0x8D, 0xBC, 0x98, 0xB9 -}; - -static const uint8_t C10_CTR[] = { - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A -}; - -static const uint8_t T10_CTR[] = { 0 }; -static const uint8_t A10_CTR[] = { 0 }; -#define A10_CTR_len 0 - -/* - Test Vector #11: Encrypting 136 octets using AES-CTR with 128-bit key - AES Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E - AES-CTR IV : 00 00 00 00 00 00 00 00 - Nonce : 00 00 00 30 - Plaintext String : 'Full 8 blocks + extra partial block' -*/ -static const uint8_t K11_CTR[] = { - 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC, - 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E, -}; -static const uint8_t IV11_CTR[] = { - 0x00, 0x00, 0x00, 0x30, /* nonce */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t P11_CTR[] = { - 0xA8, 0x63, 0x44, 0xF8, 0x36, 0x59, 0x2F, 0xF2, - 0xDA, 0xDD, 0x17, 0xCE, 0xFE, 0x2A, 0xF2, 0xA2, - 0x35, 0x87, 0x34, 0x0F, 0x35, 0xFC, 0xD8, 0xF2, - 0x57, 0xA1, 0xCB, 0x19, 0x0C, 0x33, 0x14, 0xE1, - 0x23, 0xEB, 0xC0, 0x88, 0x82, 0x05, 0x5F, 0x01, - 0x5D, 0xFC, 0x53, 0x08, 0xDB, 0x34, 0x8E, 0x94, - 0xE4, 0xA8, 0x26, 0x7F, 0xBC, 0xB7, 0x8B, 0xE1, - 0x58, 0x2F, 0x2C, 0x91, 0xCD, 0x5B, 0x4A, 0xAA, - 0x7A, 0xBA, 0x5F, 0xD2, 0x9B, 0xF8, 0x7D, 0xEA, - 0x76, 0xB6, 0x64, 0xB3, 0x29, 0xD3, 0x02, 0x19, - 0xA0, 0xDC, 0xE9, 0xB8, 0x90, 0x51, 0xA8, 0xDE, - 0x2E, 0xA1, 0xB7, 0x7E, 0x51, 0x0D, 0x34, 0xB3, - 0xED, 0xE7, 0x5E, 0xB8, 0x8A, 0xE9, 0xFE, 0x89, - 0xF8, 0x0B, 0x85, 0x09, 0x76, 0x08, 0x78, 0x0D, - 0x27, 0x59, 0x8E, 0x14, 0x43, 0x46, 0xA0, 0x91, - 0xEE, 0xAA, 0xFF, 0x74, 0x8D, 0xBC, 0x98, 0xB9, - 0x12, 0xAD, 0x82, 0xDF, 0x2F, 0xF8, 0x9C, 0xE0 -}; - -static const uint8_t C11_CTR[] = { - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A, - 0x7A, 0x13, 0xB4, 0x40, 0x69, 0x9B, 0x58, 0x16 -}; -static const uint8_t T11_CTR[] = { 0 }; -static const uint8_t A11_CTR[] = { 0 }; -#define A11_CTR_len 0 - -/* - Test Vector #12: Encrypting 256 octets using AES-CTR with 128-bit key - AES Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E - AES-CTR IV : 00 00 00 00 00 00 00 00 - Nonce : 00 00 00 30 - Plaintext String : 'Full 2x8 blocks' -*/ -static const uint8_t K12_CTR[] = { - 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC, - 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E, -}; -static const uint8_t IV12_CTR[] = { - 0x00, 0x00, 0x00, 0x30, /* nonce */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t P12_CTR[] = { - 0xA8, 0x63, 0x44, 0xF8, 0x36, 0x59, 0x2F, 0xF2, - 0xDA, 0xDD, 0x17, 0xCE, 0xFE, 0x2A, 0xF2, 0xA2, - 0x35, 0x87, 0x34, 0x0F, 0x35, 0xFC, 0xD8, 0xF2, - 0x57, 0xA1, 0xCB, 0x19, 0x0C, 0x33, 0x14, 0xE1, - 0x23, 0xEB, 0xC0, 0x88, 0x82, 0x05, 0x5F, 0x01, - 0x5D, 0xFC, 0x53, 0x08, 0xDB, 0x34, 0x8E, 0x94, - 0xE4, 0xA8, 0x26, 0x7F, 0xBC, 0xB7, 0x8B, 0xE1, - 0x58, 0x2F, 0x2C, 0x91, 0xCD, 0x5B, 0x4A, 0xAA, - 0x7A, 0xBA, 0x5F, 0xD2, 0x9B, 0xF8, 0x7D, 0xEA, - 0x76, 0xB6, 0x64, 0xB3, 0x29, 0xD3, 0x02, 0x19, - 0xA0, 0xDC, 0xE9, 0xB8, 0x90, 0x51, 0xA8, 0xDE, - 0x2E, 0xA1, 0xB7, 0x7E, 0x51, 0x0D, 0x34, 0xB3, - 0xED, 0xE7, 0x5E, 0xB8, 0x8A, 0xE9, 0xFE, 0x89, - 0xF8, 0x0B, 0x85, 0x09, 0x76, 0x08, 0x78, 0x0D, - 0x27, 0x59, 0x8E, 0x14, 0x43, 0x46, 0xA0, 0x91, - 0xEE, 0xAA, 0xFF, 0x74, 0x8D, 0xBC, 0x98, 0xB9, - 0x77, 0xBD, 0x41, 0x4F, 0xAB, 0xF8, 0x78, 0x1F, - 0xED, 0x2B, 0x14, 0x89, 0xB5, 0x7B, 0x61, 0x5E, - 0x88, 0x35, 0x46, 0x0F, 0x83, 0x5B, 0xC6, 0xE6, - 0x61, 0x1D, 0xD8, 0x5E, 0xD3, 0xC3, 0xC6, 0xE8, - 0xFB, 0x8E, 0x59, 0xDB, 0x31, 0x17, 0xF8, 0xCD, - 0xC1, 0xD4, 0x2D, 0xEF, 0xD8, 0x25, 0x9E, 0x88, - 0x10, 0x58, 0xF2, 0xA6, 0x84, 0x4F, 0xA1, 0x32, - 0x5F, 0x0E, 0xA2, 0x14, 0xF7, 0x03, 0x85, 0x06, - 0x94, 0x4F, 0x83, 0x87, 0x04, 0x97, 0x5A, 0x8D, - 0x9A, 0x73, 0x36, 0x2A, 0xE0, 0x6D, 0xA9, 0x1F, - 0xBC, 0x2F, 0xD2, 0x9E, 0xD1, 0x7D, 0x2C, 0x89, - 0x1F, 0xE1, 0xA0, 0x8F, 0x5D, 0x3E, 0xAB, 0x9E, - 0x79, 0x1A, 0x76, 0xC3, 0x0A, 0xC8, 0xCF, 0xCB, - 0x35, 0x63, 0xD9, 0x46, 0x87, 0xAF, 0x74, 0x24, - 0x47, 0xBA, 0x60, 0xAB, 0x33, 0x5D, 0xA8, 0xDE, - 0xFE, 0x1B, 0xC5, 0x3F, 0xAC, 0xD9, 0xAD, 0x94 -}; - -static const uint8_t C12_CTR[] = { - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A, - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A, -}; -static const uint8_t T12_CTR[] = { 0 }; -static const uint8_t A12_CTR[] = { 0 }; -#define A12_CTR_len 0 - -/* - Test Vector #13: Encrypting 300 octets using AES-CTR with 128-bit key - AES Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E - AES-CTR IV : 00 00 00 00 00 00 00 00 - Nonce : 00 00 00 30 - Plaintext String : 'Full 2x8 blocks + 44B (2 full blocks and partial block)' -*/ -static const uint8_t K13_CTR[] = { - 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC, - 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E, -}; -static const uint8_t IV13_CTR[] = { - 0x00, 0x00, 0x00, 0x30, /* nonce */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t P13_CTR[] = { - 0xA8, 0x63, 0x44, 0xF8, 0x36, 0x59, 0x2F, 0xF2, - 0xDA, 0xDD, 0x17, 0xCE, 0xFE, 0x2A, 0xF2, 0xA2, - 0x35, 0x87, 0x34, 0x0F, 0x35, 0xFC, 0xD8, 0xF2, - 0x57, 0xA1, 0xCB, 0x19, 0x0C, 0x33, 0x14, 0xE1, - 0x23, 0xEB, 0xC0, 0x88, 0x82, 0x05, 0x5F, 0x01, - 0x5D, 0xFC, 0x53, 0x08, 0xDB, 0x34, 0x8E, 0x94, - 0xE4, 0xA8, 0x26, 0x7F, 0xBC, 0xB7, 0x8B, 0xE1, - 0x58, 0x2F, 0x2C, 0x91, 0xCD, 0x5B, 0x4A, 0xAA, - 0x7A, 0xBA, 0x5F, 0xD2, 0x9B, 0xF8, 0x7D, 0xEA, - 0x76, 0xB6, 0x64, 0xB3, 0x29, 0xD3, 0x02, 0x19, - 0xA0, 0xDC, 0xE9, 0xB8, 0x90, 0x51, 0xA8, 0xDE, - 0x2E, 0xA1, 0xB7, 0x7E, 0x51, 0x0D, 0x34, 0xB3, - 0xED, 0xE7, 0x5E, 0xB8, 0x8A, 0xE9, 0xFE, 0x89, - 0xF8, 0x0B, 0x85, 0x09, 0x76, 0x08, 0x78, 0x0D, - 0x27, 0x59, 0x8E, 0x14, 0x43, 0x46, 0xA0, 0x91, - 0xEE, 0xAA, 0xFF, 0x74, 0x8D, 0xBC, 0x98, 0xB9, - 0x77, 0xBD, 0x41, 0x4F, 0xAB, 0xF8, 0x78, 0x1F, - 0xED, 0x2B, 0x14, 0x89, 0xB5, 0x7B, 0x61, 0x5E, - 0x88, 0x35, 0x46, 0x0F, 0x83, 0x5B, 0xC6, 0xE6, - 0x61, 0x1D, 0xD8, 0x5E, 0xD3, 0xC3, 0xC6, 0xE8, - 0xFB, 0x8E, 0x59, 0xDB, 0x31, 0x17, 0xF8, 0xCD, - 0xC1, 0xD4, 0x2D, 0xEF, 0xD8, 0x25, 0x9E, 0x88, - 0x10, 0x58, 0xF2, 0xA6, 0x84, 0x4F, 0xA1, 0x32, - 0x5F, 0x0E, 0xA2, 0x14, 0xF7, 0x03, 0x85, 0x06, - 0x94, 0x4F, 0x83, 0x87, 0x04, 0x97, 0x5A, 0x8D, - 0x9A, 0x73, 0x36, 0x2A, 0xE0, 0x6D, 0xA9, 0x1F, - 0xBC, 0x2F, 0xD2, 0x9E, 0xD1, 0x7D, 0x2C, 0x89, - 0x1F, 0xE1, 0xA0, 0x8F, 0x5D, 0x3E, 0xAB, 0x9E, - 0x79, 0x1A, 0x76, 0xC3, 0x0A, 0xC8, 0xCF, 0xCB, - 0x35, 0x63, 0xD9, 0x46, 0x87, 0xAF, 0x74, 0x24, - 0x47, 0xBA, 0x60, 0xAB, 0x33, 0x5D, 0xA8, 0xDE, - 0xFE, 0x1B, 0xC5, 0x3F, 0xAC, 0xD9, 0xAD, 0x94, - 0x66, 0xb8, 0x3f, 0x3a, 0x21, 0x9f, 0xd0, 0x43, - 0x46, 0xdd, 0x65, 0x8b, 0x44, 0x99, 0x66, 0x91, - 0x64, 0xe2, 0x69, 0x6f, 0xbb, 0x85, 0x8c, 0xcc, - 0x7f, 0xea, 0x96, 0xd1, 0x5e, 0xb4, 0x7c, 0xd0, - 0xab, 0x02, 0x8d, 0xa3, 0x59, 0x3b, 0x8c, 0xd5, - 0xd0, 0xe7, 0xb4, 0xc4 -}; - -static const uint8_t C13_CTR[] = { - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A, - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A, - 0xED, 0x52, 0x55, 0xB9, 0x76, 0x6C, 0x5E, 0x6E, - 0x76, 0x97, 0x00, 0xC7, 0xEB, 0xFE, 0xEC, 0x10, - 0x94, 0x2C, 0xA9, 0xAF, 0x9B, 0x09, 0x19, 0xB3, - 0x17, 0x29, 0x96, 0xBA, 0x8E, 0xAC, 0x3D, 0x0A, - 0x9B, 0x70, 0x54, 0x0F, 0x1E, 0xD4, 0xE8, 0x13, - 0xE6, 0x8F, 0xAD, 0xFD - -}; -static const uint8_t T13_CTR[] = { 0 }; -static const uint8_t A13_CTR[] = { 0 }; -#define A13_CTR_len 0 - -/* - Test Vector #14: Encrypting 384 octets using AES-CTR with 128-bit key - AES Key : AE 68 52 F8 12 10 67 CC 4B F7 A5 76 55 77 F3 9E - AES-CTR IV : 00 00 00 00 00 00 00 00 - Nonce : 00 00 00 30 - Plaintext String : 'Full 3x8 blocks' -*/ -static const uint8_t K14_CTR[] = { - 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC, - 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E, -}; -static const uint8_t IV14_CTR[] = { - 0x00, 0x00, 0x00, 0x30, /* nonce */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const uint8_t P14_CTR[] = { - 0xA8, 0x63, 0x44, 0xF8, 0x36, 0x59, 0x2F, 0xF2, - 0xDA, 0xDD, 0x17, 0xCE, 0xFE, 0x2A, 0xF2, 0xA2, - 0x35, 0x87, 0x34, 0x0F, 0x35, 0xFC, 0xD8, 0xF2, - 0x57, 0xA1, 0xCB, 0x19, 0x0C, 0x33, 0x14, 0xE1, - 0x23, 0xEB, 0xC0, 0x88, 0x82, 0x05, 0x5F, 0x01, - 0x5D, 0xFC, 0x53, 0x08, 0xDB, 0x34, 0x8E, 0x94, - 0xE4, 0xA8, 0x26, 0x7F, 0xBC, 0xB7, 0x8B, 0xE1, - 0x58, 0x2F, 0x2C, 0x91, 0xCD, 0x5B, 0x4A, 0xAA, - 0x7A, 0xBA, 0x5F, 0xD2, 0x9B, 0xF8, 0x7D, 0xEA, - 0x76, 0xB6, 0x64, 0xB3, 0x29, 0xD3, 0x02, 0x19, - 0xA0, 0xDC, 0xE9, 0xB8, 0x90, 0x51, 0xA8, 0xDE, - 0x2E, 0xA1, 0xB7, 0x7E, 0x51, 0x0D, 0x34, 0xB3, - 0xED, 0xE7, 0x5E, 0xB8, 0x8A, 0xE9, 0xFE, 0x89, - 0xF8, 0x0B, 0x85, 0x09, 0x76, 0x08, 0x78, 0x0D, - 0x27, 0x59, 0x8E, 0x14, 0x43, 0x46, 0xA0, 0x91, - 0xEE, 0xAA, 0xFF, 0x74, 0x8D, 0xBC, 0x98, 0xB9, - 0x77, 0xBD, 0x41, 0x4F, 0xAB, 0xF8, 0x78, 0x1F, - 0xED, 0x2B, 0x14, 0x89, 0xB5, 0x7B, 0x61, 0x5E, - 0x88, 0x35, 0x46, 0x0F, 0x83, 0x5B, 0xC6, 0xE6, - 0x61, 0x1D, 0xD8, 0x5E, 0xD3, 0xC3, 0xC6, 0xE8, - 0xFB, 0x8E, 0x59, 0xDB, 0x31, 0x17, 0xF8, 0xCD, - 0xC1, 0xD4, 0x2D, 0xEF, 0xD8, 0x25, 0x9E, 0x88, - 0x10, 0x58, 0xF2, 0xA6, 0x84, 0x4F, 0xA1, 0x32, - 0x5F, 0x0E, 0xA2, 0x14, 0xF7, 0x03, 0x85, 0x06, - 0x94, 0x4F, 0x83, 0x87, 0x04, 0x97, 0x5A, 0x8D, - 0x9A, 0x73, 0x36, 0x2A, 0xE0, 0x6D, 0xA9, 0x1F, - 0xBC, 0x2F, 0xD2, 0x9E, 0xD1, 0x7D, 0x2C, 0x89, - 0x1F, 0xE1, 0xA0, 0x8F, 0x5D, 0x3E, 0xAB, 0x9E, - 0x79, 0x1A, 0x76, 0xC3, 0x0A, 0xC8, 0xCF, 0xCB, - 0x35, 0x63, 0xD9, 0x46, 0x87, 0xAF, 0x74, 0x24, - 0x47, 0xBA, 0x60, 0xAB, 0x33, 0x5D, 0xA8, 0xDE, - 0xFE, 0x1B, 0xC5, 0x3F, 0xAC, 0xD9, 0xAD, 0x94, - 0x66, 0xb8, 0x3f, 0x3a, 0x21, 0x9f, 0xd0, 0x43, - 0x46, 0xdd, 0x65, 0x8b, 0x44, 0x99, 0x66, 0x91, - 0x64, 0xe2, 0x69, 0x6f, 0xbb, 0x85, 0x8c, 0xcc, - 0x7f, 0xea, 0x96, 0xd1, 0x5e, 0xb4, 0x7c, 0xd0, - 0xab, 0x02, 0x8d, 0xa3, 0x59, 0x3b, 0x8c, 0xd5, - 0xd0, 0xe7, 0xb4, 0xc4, 0x90, 0x41, 0x9f, 0x78, - 0x4e, 0x82, 0x9e, 0xe4, 0x1b, 0x97, 0xa9, 0xa4, - 0x7b, 0x48, 0xad, 0x56, 0xc0, 0xe4, 0x86, 0x52, - 0xfc, 0xad, 0x93, 0x0b, 0x7d, 0x38, 0xce, 0x73, - 0x64, 0xbd, 0xf7, 0x00, 0x7b, 0xe6, 0x46, 0x03, - 0x2f, 0x4b, 0x75, 0x9f, 0x3a, 0x2d, 0x32, 0x42, - 0xfe, 0x80, 0x74, 0x89, 0x27, 0x34, 0xce, 0x5e, - 0xbf, 0xbe, 0x07, 0x50, 0x91, 0x08, 0x27, 0x2b, - 0x32, 0x77, 0xa7, 0xff, 0x83, 0xb1, 0xab, 0xc8, - 0x98, 0xbe, 0xac, 0x33, 0x7c, 0x47, 0x19, 0x33, - 0x6f, 0x4d, 0xbe, 0x3e, 0xdc, 0xe0, 0x87, 0xfb -}; - -static const uint8_t C14_CTR[] = { - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A, - 0x1F, 0x03, 0x77, 0xD0, 0xED, 0x9B, 0xBC, 0xE9, - 0x9B, 0xD3, 0x01, 0x06, 0xF8, 0x54, 0x90, 0x7D, - 0x67, 0x6F, 0x19, 0xD7, 0x0B, 0xF3, 0x92, 0x8D, - 0x60, 0xC0, 0x18, 0x5A, 0x24, 0xC1, 0xD7, 0x60, - 0x82, 0x9C, 0x22, 0x37, 0x45, 0xE3, 0x9D, 0xA6, - 0x76, 0x37, 0xE1, 0x7A, 0x13, 0xB4, 0x40, 0x63, - 0xF4, 0xD8, 0xDE, 0x41, 0x64, 0xFC, 0xE2, 0x42, - 0x2E, 0x3F, 0xEA, 0xE1, 0x28, 0x06, 0xA5, 0xAC, - 0x6A, 0xC1, 0x58, 0x0C, 0x84, 0xFF, 0x9B, 0x6A, - 0xE5, 0xBE, 0x4E, 0x8C, 0x4C, 0xE9, 0x97, 0xD5, - 0x24, 0x30, 0x1B, 0x19, 0xDF, 0x87, 0x56, 0x85, - 0x31, 0x56, 0x5A, 0xDE, 0xE0, 0x6E, 0xC0, 0x1C, - 0xCB, 0x51, 0x5B, 0x6E, 0xAC, 0xF5, 0xB0, 0x60, - 0x60, 0x2F, 0x62, 0x0A, 0xEA, 0x62, 0x51, 0x2E, - 0x5B, 0x1B, 0x99, 0x51, 0x3B, 0xAC, 0xE9, 0xC5, - 0x59, 0x7D, 0x0E, 0xB6, 0x51, 0x6C, 0x16, 0x7A, - 0xED, 0x52, 0x55, 0xB9, 0x76, 0x6C, 0x5E, 0x6E, - 0x76, 0x97, 0x00, 0xC7, 0xEB, 0xFE, 0xEC, 0x10, - 0x94, 0x2C, 0xA9, 0xAF, 0x9B, 0x09, 0x19, 0xB3, - 0x17, 0x29, 0x96, 0xBA, 0x8E, 0xAC, 0x3D, 0x0A, - 0x9B, 0x70, 0x54, 0x0F, 0x1E, 0xD4, 0xE8, 0x13, - 0xE6, 0x8F, 0xAD, 0xFD, 0xFD, 0x13, 0xCF, 0xD5, - 0x94, 0x06, 0xA0, 0x24, 0x79, 0xC0, 0xF8, 0x05, - 0x3D, 0x19, 0xEB, 0x96, 0xDA, 0x31, 0xAE, 0xF5, - 0x4D, 0x82, 0x2C, 0x23, 0x03, 0x9A, 0x43, 0x85, - 0x94, 0x36, 0x30, 0xE8, 0x0A, 0x9B, 0x1F, 0x05, - 0x6E, 0x4B, 0xA5, 0x98, 0x78, 0xBE, 0x73, 0x0D, - 0x8C, 0x60, 0x55, 0x88, 0xD6, 0xA3, 0x80, 0x13, - 0x19, 0xDB, 0xF8, 0xCD, 0xA7, 0xDC, 0x28, 0x4C, - 0x09, 0xAF, 0xFE, 0x88, 0x77, 0xE1, 0x6E, 0x12, - 0x57, 0x5A, 0xA8, 0xC6, 0x38, 0xCF, 0xF5, 0x0D, - 0x42, 0x2C, 0x67, 0xB3, 0x22, 0x6F, 0x3D, 0x7D -}; -static const uint8_t T14_CTR[] = { 0 }; -static const uint8_t A14_CTR[] = { 0 }; -#define A14_CTR_len 0 - -static const uint8_t K15_CTR[] = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C -}; -static const uint8_t IV15_CTR[] = { - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, - 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF -}; -static const uint8_t P15_CTR[] = { - 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, - 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A, - 0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03, 0xAC, 0x9C, - 0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51, - 0x30, 0xC8, 0x1C, 0x46, 0xA3, 0x5C, 0xE4, 0x11, - 0xE5, 0xFB, 0xC1, 0x19, 0x1A, 0x0A, 0x52, 0xEF, - 0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17, - 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10 -}; - -static const uint8_t C15_CTR[] = { - 0x87, 0x4D, 0x61, 0x91, 0xB6, 0x20, 0xE3, 0x26, - 0x1B, 0xEF, 0x68, 0x64, 0x99, 0x0D, 0xB6, 0xCE, - 0x98, 0x06, 0xF6, 0x6B, 0x79, 0x70, 0xFD, 0xFF, - 0x86, 0x17, 0x18, 0x7B, 0xB9, 0xFF, 0xFD, 0xFF, - 0x5A, 0xE4, 0xDF, 0x3E, 0xDB, 0xD5, 0xD3, 0x5E, - 0x5B, 0x4F, 0x09, 0x02, 0x0D, 0xB0, 0x3E, 0xAB, - 0x1E, 0x03, 0x1D, 0xDA, 0x2F, 0xBE, 0x03, 0xD1, - 0x79, 0x21, 0x70, 0xA0, 0xF3, 0x00, 0x9C, 0xEE -}; - -static const uint8_t T15_CTR[] = { 0 }; -static const uint8_t A15_CTR[] = { 0 }; -#define A15_CTR_len 0 - -#define bit_vector(N) \ - {K##N, (KBITS(K##N)), IV##N, sizeof(IV##N), A##N, A##N##_len, \ - P##N, P##N##_len, C##N, T##N, sizeof(T##N)} - -static const uint8_t K1_CTR_BIT[] = { - 0xd3, 0xc5, 0xd5, 0x92, 0x32, 0x7f, 0xb1, 0x1c, - 0x40, 0x35, 0xc6, 0x68, 0x0a, 0xf8, 0xc6, 0xd1 - -}; -static const uint8_t IV1_CTR_BIT[] = { - 0x39, 0x8a, 0x59, 0xb4, 0xac, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* Last 3 bits (not to be ciphered) set to 1, since - * the output buffer is set to all 0xff */ -static const uint8_t P1_CTR_BIT[] = { - 0x98, 0x1b, 0xa6, 0x82, 0x4c, 0x1b, 0xfb, 0x1a, - 0xb4, 0x85, 0x47, 0x20, 0x29, 0xb7, 0x1d, 0x80, - 0x8c, 0xe3, 0x3e, 0x2c, 0xc3, 0xc0, 0xb5, 0xfc, - 0x1f, 0x3d, 0xe8, 0xa6, 0xdc, 0x66, 0xb1, 0xf7 -}; - -static const uint8_t C1_CTR_BIT[] = { - 0xe9, 0xfe, 0xd8, 0xa6, 0x3d, 0x15, 0x53, 0x04, - 0xd7, 0x1d, 0xf2, 0x0b, 0xf3, 0xe8, 0x22, 0x14, - 0xb2, 0x0e, 0xd7, 0xda, 0xd2, 0xf2, 0x33, 0xdc, - 0x3c, 0x22, 0xd7, 0xbd, 0xee, 0xed, 0x8e, 0x7f -}; - -static const uint8_t T1_CTR_BIT[] = { 0 }; -static const uint8_t A1_CTR_BIT[] = { 0 }; -#define A1_CTR_BIT_len 0 -#define P1_CTR_BIT_len 253 - -static const uint8_t K2_CTR_BIT[] = { - 0x2b, 0xd6, 0x45, 0x9f, 0x82, 0xc4, 0x40, 0xe0, - 0x95, 0x2c, 0x49, 0x10, 0x48, 0x05, 0xff, 0x48 -}; - -static const uint8_t IV2_CTR_BIT[] = { - 0xc6, 0x75, 0xa6, 0x4b, 0x64, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* Last 2 bits (not to be ciphered) set to 1, since - * the output buffer is set to all 0xff */ -static const uint8_t P2_CTR_BIT[] = { - 0x7e, 0xc6, 0x12, 0x72, 0x74, 0x3b, 0xf1, 0x61, - 0x47, 0x26, 0x44, 0x6a, 0x6c, 0x38, 0xce, 0xd1, - 0x66, 0xf6, 0xca, 0x76, 0xeb, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6c, 0xef, 0x13, 0x0f, 0x92, - 0x92, 0x2b, 0x03, 0x45, 0x0d, 0x3a, 0x99, 0x75, - 0xe5, 0xbd, 0x2e, 0xa0, 0xeb, 0x55, 0xad, 0x8e, - 0x1b, 0x19, 0x9e, 0x3e, 0xc4, 0x31, 0x60, 0x20, - 0xe9, 0xa1, 0xb2, 0x85, 0xe7, 0x62, 0x79, 0x53, - 0x59, 0xb7, 0xbd, 0xfd, 0x39, 0xbe, 0xf4, 0xb2, - 0x48, 0x45, 0x83, 0xd5, 0xaf, 0xe0, 0x82, 0xae, - 0xe6, 0x38, 0xbf, 0x5f, 0xd5, 0xa6, 0x06, 0x19, - 0x39, 0x01, 0xa0, 0x8f, 0x4a, 0xb4, 0x1a, 0xab, - 0x9b, 0x13, 0x48, 0x83 -}; - -static const uint8_t C2_CTR_BIT[] = { - 0x59, 0x61, 0x60, 0x53, 0x53, 0xc6, 0x4b, 0xdc, - 0xa1, 0x5b, 0x19, 0x5e, 0x28, 0x85, 0x53, 0xa9, - 0x10, 0x63, 0x25, 0x06, 0xd6, 0x20, 0x0a, 0xa7, - 0x90, 0xc4, 0xc8, 0x06, 0xc9, 0x99, 0x04, 0xcf, - 0x24, 0x45, 0xcc, 0x50, 0xbb, 0x1c, 0xf1, 0x68, - 0xa4, 0x96, 0x73, 0x73, 0x4e, 0x08, 0x1b, 0x57, - 0xe3, 0x24, 0xce, 0x52, 0x59, 0xc0, 0xe7, 0x8d, - 0x4c, 0xd9, 0x7b, 0x87, 0x09, 0x76, 0x50, 0x3c, - 0x09, 0x43, 0xf2, 0xcb, 0x5a, 0xe8, 0xf0, 0x52, - 0xc7, 0xb7, 0xd3, 0x92, 0x23, 0x95, 0x87, 0xb8, - 0x95, 0x60, 0x86, 0xbc, 0xab, 0x18, 0x83, 0x60, - 0x42, 0xe2, 0xe6, 0xce, 0x42, 0x43, 0x2a, 0x17, - 0x10, 0x5c, 0x53, 0xd3 -}; - -static const uint8_t T2_CTR_BIT[] = { 0 }; -static const uint8_t A2_CTR_BIT[] = { 0 }; -#define A2_CTR_BIT_len 0 -#define P2_CTR_BIT_len 798 - -static const uint8_t K3_CTR_BIT[] = { - 0x0a, 0x8b, 0x6b, 0xd8, 0xd9, 0xb0, 0x8b, 0x08, - 0xd6, 0x4e, 0x32, 0xd1, 0x81, 0x77, 0x77, 0xfb -}; - -static const uint8_t IV3_CTR_BIT[] = { - 0x54, 0x4d, 0x49, 0xcd, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* Last 2 bits (not to be ciphered) set to 1, since - * the output buffer is set to all 0xff */ -static const uint8_t P3_CTR_BIT[] = { - 0xfd, 0x40, 0xa4, 0x1d, 0x37, 0x0a, 0x1f, 0x65, - 0x74, 0x50, 0x95, 0x68, 0x7d, 0x47, 0xba, 0x1d, - 0x36, 0xd2, 0x34, 0x9e, 0x23, 0xf6, 0x44, 0x39, - 0x2c, 0x8e, 0xa9, 0xc4, 0x9d, 0x40, 0xc1, 0x32, - 0x71, 0xaf, 0xf2, 0x64, 0xd0, 0xf2, 0x4b -}; - -static const uint8_t C3_CTR_BIT[] = { - 0x75, 0x75, 0x0d, 0x37, 0xb4, 0xbb, 0xa2, 0xa4, - 0xde, 0xdb, 0x34, 0x23, 0x5b, 0xd6, 0x8c, 0x66, - 0x45, 0xac, 0xda, 0xac, 0xa4, 0x81, 0x38, 0xa3, - 0xb0, 0xc4, 0x71, 0xe2, 0xa7, 0x04, 0x1a, 0x57, - 0x64, 0x23, 0xd2, 0x92, 0x72, 0x87, 0xf3 -}; - -static const uint8_t T3_CTR_BIT[] = { 0 }; -static const uint8_t A3_CTR_BIT[] = { 0 }; -#define A3_CTR_BIT_len 0 -#define P3_CTR_BIT_len 310 - -static const uint8_t K4_CTR_BIT[] = { - 0xaa, 0x1f, 0x95, 0xae, 0xa5, 0x33, 0xbc, 0xb3, - 0x2e, 0xb6, 0x3b, 0xf5, 0x2d, 0x8f, 0x83, 0x1a -}; - -static const uint8_t IV4_CTR_BIT[] = { - 0x72, 0xd8, 0xc6, 0x71, 0x84, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* Last 2 bits (not to be ciphered) set to 1, since - * the output buffer is set to all 0xff */ -static const uint8_t P4_CTR_BIT[] = { - 0xfb, 0x1b, 0x96, 0xc5, 0xc8, 0xba, 0xdf, 0xb2, - 0xe8, 0xe8, 0xed, 0xfd, 0xe7, 0x8e, 0x57, 0xf2, - 0xad, 0x81, 0xe7, 0x41, 0x03, 0xfc, 0x43, 0x0a, - 0x53, 0x4d, 0xcc, 0x37, 0xaf, 0xce, 0xc7, 0x0e, - 0x15, 0x17, 0xbb, 0x06, 0xf2, 0x72, 0x19, 0xda, - 0xe4, 0x90, 0x22, 0xdd, 0xc4, 0x7a, 0x06, 0x8d, - 0xe4, 0xc9, 0x49, 0x6a, 0x95, 0x1a, 0x6b, 0x09, - 0xed, 0xbd, 0xc8, 0x64, 0xc7, 0xad, 0xbd, 0x74, - 0x0a, 0xc5, 0x0c, 0x02, 0x2f, 0x30, 0x82, 0xba, - 0xfd, 0x22, 0xd7, 0x81, 0x97, 0xc5, 0xd5, 0x08, - 0xb9, 0x77, 0xbc, 0xa1, 0x3f, 0x32, 0xe6, 0x52, - 0xe7, 0x4b, 0xa7, 0x28, 0x57, 0x60, 0x77, 0xce, - 0x62, 0x8c, 0x53, 0x5e, 0x87, 0xdc, 0x60, 0x77, - 0xba, 0x07, 0xd2, 0x90, 0x68, 0x59, 0x0c, 0x8c, - 0xb5, 0xf1, 0x08, 0x8e, 0x08, 0x2c, 0xfa, 0x0e, - 0xc9, 0x61, 0x30, 0x2d, 0x69, 0xcf, 0x3d, 0x47 -}; - -static const uint8_t C4_CTR_BIT[] = { - 0xdf, 0xb4, 0x40, 0xac, 0xb3, 0x77, 0x35, 0x49, - 0xef, 0xc0, 0x46, 0x28, 0xae, 0xb8, 0xd8, 0x15, - 0x62, 0x75, 0x23, 0x0b, 0xdc, 0x69, 0x0d, 0x94, - 0xb0, 0x0d, 0x8d, 0x95, 0xf2, 0x8c, 0x4b, 0x56, - 0x30, 0x7f, 0x60, 0xf4, 0xca, 0x55, 0xeb, 0xa6, - 0x61, 0xeb, 0xba, 0x72, 0xac, 0x80, 0x8f, 0xa8, - 0xc4, 0x9e, 0x26, 0x78, 0x8e, 0xd0, 0x4a, 0x5d, - 0x60, 0x6c, 0xb4, 0x18, 0xde, 0x74, 0x87, 0x8b, - 0x9a, 0x22, 0xf8, 0xef, 0x29, 0x59, 0x0b, 0xc4, - 0xeb, 0x57, 0xc9, 0xfa, 0xf7, 0xc4, 0x15, 0x24, - 0xa8, 0x85, 0xb8, 0x97, 0x9c, 0x42, 0x3f, 0x2f, - 0x8f, 0x8e, 0x05, 0x92, 0xa9, 0x87, 0x92, 0x01, - 0xbe, 0x7f, 0xf9, 0x77, 0x7a, 0x16, 0x2a, 0xb8, - 0x10, 0xfe, 0xb3, 0x24, 0xba, 0x74, 0xc4, 0xc1, - 0x56, 0xe0, 0x4d, 0x39, 0x09, 0x72, 0x09, 0x65, - 0x3a, 0xc3, 0x3e, 0x5a, 0x5f, 0x2d, 0x88, 0x67 -}; - -static const uint8_t T4_CTR_BIT[] = { 0 }; -static const uint8_t A4_CTR_BIT[] = { 0 }; -#define A4_CTR_BIT_len 0 -#define P4_CTR_BIT_len 1022 - -static const uint8_t K5_CTR_BIT[] = { - 0x96, 0x18, 0xae, 0x46, 0x89, 0x1f, 0x86, 0x57, - 0x8e, 0xeb, 0xe9, 0x0e, 0xf7, 0xa1, 0x20, 0x2e -}; - -static const uint8_t IV5_CTR_BIT[] = { - 0xc6, 0x75, 0xa6, 0x4b, 0x64, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* Last 3 bits (not to be ciphered) set to 1, since - * the output buffer is set to all 0xff */ -static const uint8_t P5_CTR_BIT[] = { - 0x8d, 0xaa, 0x17, 0xb1, 0xae, 0x05, 0x05, 0x29, - 0xc6, 0x82, 0x7f, 0x28, 0xc0, 0xef, 0x6a, 0x12, - 0x42, 0xe9, 0x3f, 0x8b, 0x31, 0x4f, 0xb1, 0x8a, - 0x77, 0xf7, 0x90, 0xae, 0x04, 0x9f, 0xed, 0xd6, - 0x12, 0x26, 0x7f, 0xec, 0xae, 0xfc, 0x45, 0x01, - 0x74, 0xd7, 0x6d, 0x9f, 0x9a, 0xa7, 0x75, 0x5a, - 0x30, 0xcd, 0x90, 0xa9, 0xa5, 0x87, 0x4b, 0xf4, - 0x8e, 0xaf, 0x70, 0xee, 0xa3, 0xa6, 0x2a, 0x25, - 0x0a, 0x8b, 0x6b, 0xd8, 0xd9, 0xb0, 0x8b, 0x08, - 0xd6, 0x4e, 0x32, 0xd1, 0x81, 0x77, 0x77, 0xfb, - 0x54, 0x4d, 0x49, 0xcd, 0x49, 0x72, 0x0e, 0x21, - 0x9d, 0xbf, 0x8b, 0xbe, 0xd3, 0x39, 0x04, 0xe1, - 0xfd, 0x40, 0xa4, 0x1d, 0x37, 0x0a, 0x1f, 0x65, - 0x74, 0x50, 0x95, 0x68, 0x7d, 0x47, 0xba, 0x1d, - 0x36, 0xd2, 0x34, 0x9e, 0x23, 0xf6, 0x44, 0x39, - 0x2c, 0x8e, 0xa9, 0xc4, 0x9d, 0x40, 0xc1, 0x32, - 0x71, 0xaf, 0xf2, 0x64, 0xd0, 0xf2, 0x48, 0x41, - 0xd6, 0x46, 0x5f, 0x09, 0x96, 0xff, 0x84, 0xe6, - 0x5f, 0xc5, 0x17, 0xc5, 0x3e, 0xfc, 0x33, 0x63, - 0xc3, 0x84, 0x92, 0xaf -}; - -static const uint8_t C5_CTR_BIT[] = { - 0x91, 0x9c, 0x8c, 0x33, 0xd6, 0x67, 0x89, 0x70, - 0x3d, 0x05, 0xa0, 0xd7, 0xce, 0x82, 0xa2, 0xae, - 0xac, 0x4e, 0xe7, 0x6c, 0x0f, 0x4d, 0xa0, 0x50, - 0x33, 0x5e, 0x8a, 0x84, 0xe7, 0x89, 0x7b, 0xa5, - 0xdf, 0x2f, 0x36, 0xbd, 0x51, 0x3e, 0x3d, 0x0c, - 0x85, 0x78, 0xc7, 0xa0, 0xfc, 0xf0, 0x43, 0xe0, - 0x3a, 0xa3, 0xa3, 0x9f, 0xba, 0xad, 0x7d, 0x15, - 0xbe, 0x07, 0x4f, 0xaa, 0x5d, 0x90, 0x29, 0xf7, - 0x1f, 0xb4, 0x57, 0xb6, 0x47, 0x83, 0x47, 0x14, - 0xb0, 0xe1, 0x8f, 0x11, 0x7f, 0xca, 0x10, 0x67, - 0x79, 0x45, 0x09, 0x6c, 0x8c, 0x5f, 0x32, 0x6b, - 0xa8, 0xd6, 0x09, 0x5e, 0xb2, 0x9c, 0x3e, 0x36, - 0xcf, 0x24, 0x5d, 0x16, 0x22, 0xaa, 0xfe, 0x92, - 0x1f, 0x75, 0x66, 0xc4, 0xf5, 0xd6, 0x44, 0xf2, - 0xf1, 0xfc, 0x0e, 0xc6, 0x84, 0xdd, 0xb2, 0x13, - 0x49, 0x74, 0x76, 0x22, 0xe2, 0x09, 0x29, 0x5d, - 0x27, 0xff, 0x3f, 0x95, 0x62, 0x33, 0x71, 0xd4, - 0x9b, 0x14, 0x7c, 0x0a, 0xf4, 0x86, 0x17, 0x1f, - 0x22, 0xcd, 0x04, 0xb1, 0xcb, 0xeb, 0x26, 0x58, - 0x22, 0x3e, 0x69, 0x3f -}; - -static const uint8_t T5_CTR_BIT[] = { 0 }; -static const uint8_t A5_CTR_BIT[] = { 0 }; -#define A5_CTR_BIT_len 0 -#define P5_CTR_BIT_len 1245 - -static const uint8_t K6_CTR_BIT[] = { - 0x54, 0xf4, 0xe2, 0xe0, 0x4c, 0x83, 0x78, 0x6e, - 0xec, 0x8f, 0xb5, 0xab, 0xe8, 0xe3, 0x65, 0x66 - -}; -static const uint8_t IV6_CTR_BIT[] = { - 0xac, 0xa4, 0xf5, 0x0f, 0x58, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* Last 3 bits (not to be ciphered) set to 1, since - * the output buffer is set to all 0xff */ -static const uint8_t P6_CTR_BIT[] = { - 0x40, 0x98, 0x1b, 0xa6, 0x82, 0x4c, 0x1b, 0xfb, - 0x42, 0x86, 0xb2, 0x99, 0x78, 0x3d, 0xaf, 0x44, - 0x2c, 0x09, 0x9f, 0x7a, 0xb0, 0xf5, 0x8d, 0x5c, - 0x8e, 0x46, 0xb1, 0x04, 0xf0, 0x8f, 0x01, 0xb4, - 0x1a, 0xb4, 0x85, 0x47, 0x20, 0x29, 0xb7, 0x1d, - 0x36, 0xbd, 0x1a, 0x3d, 0x90, 0xdc, 0x3a, 0x41, - 0xb4, 0x6d, 0x51, 0x67, 0x2a, 0xc4, 0xc9, 0x66, - 0x3a, 0x2b, 0xe0, 0x63, 0xda, 0x4b, 0xc8, 0xd2, - 0x80, 0x8c, 0xe3, 0x3e, 0x2c, 0xcc, 0xbf, 0xc6, - 0x34, 0xe1, 0xb2, 0x59, 0x06, 0x08, 0x76, 0xa0, - 0xfb, 0xb5, 0xa4, 0x37, 0xeb, 0xcc, 0x8d, 0x31, - 0xc1, 0x9e, 0x44, 0x54, 0x31, 0x87, 0x45, 0xe3, - 0xfa, 0x16, 0xbb, 0x11, 0xad, 0xae, 0x24, 0x88, - 0x79, 0xfe, 0x52, 0xdb, 0x25, 0x43, 0xe5, 0x3c, - 0xf4, 0x45, 0xd3, 0xd8, 0x28, 0xce, 0x0b, 0xf5, - 0xc5, 0x60, 0x59, 0x3d, 0x97, 0x27, 0x8a, 0x59, - 0x76, 0x2d, 0xd0, 0xc2, 0xc9, 0xcd, 0x68, 0xd4, - 0x49, 0x6a, 0x79, 0x25, 0x08, 0x61, 0x40, 0x14, - 0xb1, 0x3b, 0x6a, 0xa5, 0x11, 0x28, 0xc1, 0x8c, - 0xd6, 0xa9, 0x0b, 0x87, 0x97, 0x8c, 0x2f, 0xf1, - 0xca, 0xbe, 0x7d, 0x9f, 0x89, 0x8a, 0x41, 0x1b, - 0xfd, 0xb8, 0x4f, 0x68, 0xf6, 0x72, 0x7b, 0x14, - 0x99, 0xcd, 0xd3, 0x0d, 0xf0, 0x44, 0x3a, 0xb4, - 0xa6, 0x66, 0x53, 0x33, 0x0b, 0xcb, 0xa1, 0x10, - 0x5e, 0x4c, 0xec, 0x03, 0x4c, 0x73, 0xe6, 0x05, - 0xb4, 0x31, 0x0e, 0xaa, 0xad, 0xcf, 0xd5, 0xb0, - 0xca, 0x27, 0xff, 0xd8, 0x9d, 0x14, 0x4d, 0xf4, - 0x79, 0x27, 0x59, 0x42, 0x7c, 0x9c, 0xc1, 0xf8, - 0xcd, 0x8c, 0x87, 0x20, 0x23, 0x64, 0xb8, 0xa6, - 0x87, 0x95, 0x4c, 0xb0, 0x5a, 0x8d, 0x4e, 0x2d, - 0x99, 0xe7, 0x3d, 0xb1, 0x60, 0xde, 0xb1, 0x80, - 0xad, 0x08, 0x41, 0xe9, 0x67, 0x41, 0xa5, 0xd5, - 0x9f, 0xe4, 0x18, 0x9f, 0x15, 0x42, 0x00, 0x26, - 0xfe, 0x4c, 0xd1, 0x21, 0x04, 0x93, 0x2f, 0xb3, - 0x8f, 0x73, 0x53, 0x40, 0x43, 0x8a, 0xaf, 0x7e, - 0xca, 0x6f, 0xd5, 0xcf, 0xd3, 0xa1, 0x95, 0xce, - 0x5a, 0xbe, 0x65, 0x27, 0x2a, 0xf6, 0x07, 0xad, - 0xa1, 0xbe, 0x65, 0xa6, 0xb4, 0xc9, 0xc0, 0x69, - 0x32, 0x34, 0x09, 0x2c, 0x4d, 0x01, 0x8f, 0x17, - 0x56, 0xc6, 0xdb, 0x9d, 0xc8, 0xa6, 0xd8, 0x0b, - 0x88, 0x81, 0x38, 0x61, 0x6b, 0x68, 0x12, 0x62, - 0xf9, 0x54, 0xd0, 0xe7, 0x71, 0x17, 0x48, 0x78, - 0x0d, 0x92, 0x29, 0x1d, 0x86, 0x29, 0x99, 0x72, - 0xdb, 0x74, 0x1c, 0xfa, 0x4f, 0x37, 0xb8, 0xb5, - 0x6c, 0xdb, 0x18, 0xa7, 0xca, 0x82, 0x18, 0xe8, - 0x6e, 0x4b, 0x4b, 0x71, 0x6a, 0x4d, 0x04, 0x37, - 0x1f, 0xbe, 0xc2, 0x62, 0xfc, 0x5a, 0xd0, 0xb3, - 0x81, 0x9b, 0x18, 0x7b, 0x97, 0xe5, 0x5b, 0x1a, - 0x4d, 0x7c, 0x19, 0xee, 0x24, 0xc8, 0xb4, 0xd7, - 0x72, 0x3c, 0xfe, 0xdf, 0x04, 0x5b, 0x8a, 0xca, - 0xe4, 0x86, 0x95, 0x17, 0xd8, 0x0e, 0x50, 0x61, - 0x5d, 0x90, 0x35, 0xd5, 0xd9, 0xc5, 0xa4, 0x0a, - 0xf6, 0x02, 0x28, 0x0b, 0x54, 0x25, 0x97, 0xb0, - 0xcb, 0x18, 0x61, 0x9e, 0xeb, 0x35, 0x92, 0x57, - 0x59, 0xd1, 0x95, 0xe1, 0x00, 0xe8, 0xe4, 0xaa, - 0x0c, 0x38, 0xa3, 0xc2, 0xab, 0xe0, 0xf3, 0xd8, - 0xff, 0x04, 0xf3, 0xc3, 0x3c, 0x29, 0x50, 0x69, - 0xc2, 0x36, 0x94, 0xb5, 0xbb, 0xea, 0xcd, 0xd5, - 0x42, 0xe2, 0x8e, 0x8a, 0x94, 0xed, 0xb9, 0x11, - 0x9f, 0x41, 0x2d, 0x05, 0x4b, 0xe1, 0xfa, 0x72, - 0x00, 0xb0, 0x97 -}; - -static const uint8_t C6_CTR_BIT[] = { - 0x5c, 0xb7, 0x2c, 0x6e, 0xdc, 0x87, 0x8f, 0x15, - 0x66, 0xe1, 0x02, 0x53, 0xaf, 0xc3, 0x64, 0xc9, - 0xfa, 0x54, 0x0d, 0x91, 0x4d, 0xb9, 0x4c, 0xbe, - 0xe2, 0x75, 0xd0, 0x91, 0x7c, 0xa6, 0xaf, 0x0d, - 0x77, 0xac, 0xb4, 0xef, 0x3b, 0xbe, 0x1a, 0x72, - 0x2b, 0x2e, 0xf5, 0xbd, 0x1d, 0x4b, 0x8e, 0x2a, - 0xa5, 0x02, 0x4e, 0xc1, 0x38, 0x8a, 0x20, 0x1e, - 0x7b, 0xce, 0x79, 0x20, 0xae, 0xc6, 0x15, 0x89, - 0x5f, 0x76, 0x3a, 0x55, 0x64, 0xdc, 0xc4, 0xc4, - 0x82, 0xa2, 0xee, 0x1d, 0x8b, 0xfe, 0xcc, 0x44, - 0x98, 0xec, 0xa8, 0x3f, 0xbb, 0x75, 0xf9, 0xab, - 0x53, 0x0e, 0x0d, 0xaf, 0xbe, 0xde, 0x2f, 0xa5, - 0x89, 0x5b, 0x82, 0x99, 0x1b, 0x62, 0x77, 0xc5, - 0x29, 0xe0, 0xf2, 0x52, 0x9d, 0x7f, 0x79, 0x60, - 0x6b, 0xe9, 0x67, 0x06, 0x29, 0x6d, 0xed, 0xfa, - 0x9d, 0x74, 0x12, 0xb6, 0x16, 0x95, 0x8c, 0xb5, - 0x63, 0xc6, 0x78, 0xc0, 0x28, 0x25, 0xc3, 0x0d, - 0x0a, 0xee, 0x77, 0xc4, 0xc1, 0x46, 0xd2, 0x76, - 0x54, 0x12, 0x42, 0x1a, 0x80, 0x8d, 0x13, 0xce, - 0xc8, 0x19, 0x69, 0x4c, 0x75, 0xad, 0x57, 0x2e, - 0x9b, 0x97, 0x3d, 0x94, 0x8b, 0x81, 0xa9, 0x33, - 0x7c, 0x3b, 0x2a, 0x17, 0x19, 0x2e, 0x22, 0xc2, - 0x06, 0x9f, 0x7e, 0xd1, 0x16, 0x2a, 0xf4, 0x4c, - 0xde, 0xa8, 0x17, 0x60, 0x36, 0x65, 0xe8, 0x07, - 0xce, 0x40, 0xc8, 0xe0, 0xdd, 0x9d, 0x63, 0x94, - 0xdc, 0x6e, 0x31, 0x15, 0x3f, 0xe1, 0x95, 0x5c, - 0x47, 0xaf, 0xb5, 0x1f, 0x26, 0x17, 0xee, 0x0c, - 0x5e, 0x3b, 0x8e, 0xf1, 0xad, 0x75, 0x74, 0xed, - 0x34, 0x3e, 0xdc, 0x27, 0x43, 0xcc, 0x94, 0xc9, - 0x90, 0xe1, 0xf1, 0xfd, 0x26, 0x42, 0x53, 0xc1, - 0x78, 0xde, 0xa7, 0x39, 0xc0, 0xbe, 0xfe, 0xeb, - 0xcd, 0x9f, 0x9b, 0x76, 0xd4, 0x9c, 0x10, 0x15, - 0xc9, 0xfe, 0xcf, 0x50, 0xe5, 0x3b, 0x8b, 0x52, - 0x04, 0xdb, 0xcd, 0x3e, 0xed, 0x86, 0x38, 0x55, - 0xda, 0xbc, 0xdc, 0xc9, 0x4b, 0x31, 0xe3, 0x18, - 0x02, 0x15, 0x68, 0x85, 0x5c, 0x8b, 0x9e, 0x52, - 0xa9, 0x81, 0x95, 0x7a, 0x11, 0x28, 0x27, 0xf9, - 0x78, 0xba, 0x96, 0x0f, 0x14, 0x47, 0x91, 0x1b, - 0x31, 0x7b, 0x55, 0x11, 0xfb, 0xcc, 0x7f, 0xb1, - 0x3a, 0xc1, 0x53, 0xdb, 0x74, 0x25, 0x11, 0x17, - 0xe4, 0x86, 0x1e, 0xb9, 0xe8, 0x3b, 0xff, 0xff, - 0xc4, 0xeb, 0x77, 0x55, 0x57, 0x90, 0x38, 0xe5, - 0x79, 0x24, 0xb1, 0xf7, 0x8b, 0x3e, 0x1a, 0xd9, - 0x0b, 0xab, 0x2a, 0x07, 0x87, 0x1b, 0x72, 0xdb, - 0x5e, 0xef, 0x96, 0xc3, 0x34, 0x04, 0x49, 0x66, - 0xdb, 0x0c, 0x37, 0xca, 0xfd, 0x1a, 0x89, 0xe5, - 0x64, 0x6a, 0x35, 0x80, 0xeb, 0x64, 0x65, 0xf1, - 0x21, 0xdc, 0xe9, 0xcb, 0x88, 0xd8, 0x5b, 0x96, - 0xcf, 0x23, 0xcc, 0xcc, 0xd4, 0x28, 0x07, 0x67, - 0xbe, 0xe8, 0xee, 0xb2, 0x3d, 0x86, 0x52, 0x46, - 0x1d, 0xb6, 0x49, 0x31, 0x03, 0x00, 0x3b, 0xaf, - 0x89, 0xf5, 0xe1, 0x82, 0x61, 0xea, 0x43, 0xc8, - 0x4a, 0x92, 0xeb, 0xff, 0xff, 0xe4, 0x90, 0x9d, - 0xc4, 0x6c, 0x51, 0x92, 0xf8, 0x25, 0xf7, 0x70, - 0x60, 0x0b, 0x96, 0x02, 0xc5, 0x57, 0xb5, 0xf8, - 0xb4, 0x31, 0xa7, 0x9d, 0x45, 0x97, 0x7d, 0xd9, - 0xc4, 0x1b, 0x86, 0x3d, 0xa9, 0xe1, 0x42, 0xe9, - 0x00, 0x20, 0xcf, 0xd0, 0x74, 0xd6, 0x92, 0x7b, - 0x7a, 0xb3, 0xb6, 0x72, 0x5d, 0x1a, 0x6f, 0x3f, - 0x98, 0xb9, 0xc9, 0xda, 0xa8, 0x98, 0x2a, 0xff, - 0x06, 0x78, 0x2f -}; - -static const uint8_t T6_CTR_BIT[] = { 0 }; -static const uint8_t A6_CTR_BIT[] = { 0 }; -#define A6_CTR_BIT_len 0 -#define P6_CTR_BIT_len 3861 - -/* - Test Vector #7: Encrypting 35 octets + 4 bits using AES-CTR with 192-bit key - AES Key : 02 BF 39 1E E8 EC B1 59 B9 59 61 7B 09 65 27 9B - : F5 9B 60 A7 86 D3 E0 FE - AES-CTR IV : 5C BD 60 27 8D CC 09 12 - Nonce : 00 07 BD FD - Plaintext : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - : 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - : 20 21 22 23 - Ciphertext : 96 89 3F C5 5E 5C 72 2F 54 0B 7D D1 DD F7 E7 58 - : D2 88 BC 95 C6 91 65 88 45 36 C8 11 66 2F 21 88 - : AB EE 09 35 -*/ -static const uint8_t K7_CTR_BIT[] = { - 0x02, 0xBF, 0x39, 0x1E, 0xE8, 0xEC, 0xB1, 0x59, - 0xB9, 0x59, 0x61, 0x7B, 0x09, 0x65, 0x27, 0x9B, - 0xF5, 0x9B, 0x60, 0xA7, 0x86, 0xD3, 0xE0, 0xFE, -}; -static const uint8_t IV7_CTR_BIT[] = { - 0x00, 0x07, 0xBD, 0xFD, /* nonce */ - 0x5C, 0xBD, 0x60, 0x27, 0x8D, 0xCC, 0x09, 0x12, - 0x00, 0x00, 0x00, 0x01 -}; -static const uint8_t P7_CTR_BIT[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x2F /* 0x23 */ -}; -static const uint8_t C7_CTR_BIT[] = { - 0x96, 0x89, 0x3F, 0xC5, 0x5E, 0x5C, 0x72, 0x2F, - 0x54, 0x0B, 0x7D, 0xD1, 0xDD, 0xF7, 0xE7, 0x58, - 0xD2, 0x88, 0xBC, 0x95, 0xC6, 0x91, 0x65, 0x88, - 0x45, 0x36, 0xC8, 0x11, 0x66, 0x2F, 0x21, 0x88, - 0xAB, 0xEE, 0x09, 0x3F /* 0x35, */ -}; -static const uint8_t T7_CTR_BIT[] = { 0 }; -static const uint8_t A7_CTR_BIT[] = { 0 }; -#define A7_CTR_BIT_len 0 -#define P7_CTR_BIT_len ((sizeof(P7_CTR_BIT) * 8) - 4) - -/* - Test Vector #8: Encrypting 15 octets + 4 bits using AES-CTR with 256-bit key - AES Key : 77 6B EF F2 85 1D B0 6F 4C 8A 05 42 C8 69 6F 6C - : 6A 81 AF 1E EC 96 B4 D3 7F C1 D6 89 E6 C1 C1 04 - AES-CTR IV : DB 56 72 C9 7A A8 F0 B2 - Nonce : 00 00 00 60 - Plaintext String : 'Single block msg' - Plaintext : 53 69 6E 67 6C 65 20 62 6C 6F 63 6B 20 6D 73 6F - Ciphertext : 14 5A D0 1D BF 82 4E C7 56 08 63 DC 71 E3 E0 CF -*/ -static const uint8_t K8_CTR_BIT[] = { - 0x77, 0x6B, 0xEF, 0xF2, 0x85, 0x1D, 0xB0, 0x6F, - 0x4C, 0x8A, 0x05, 0x42, 0xC8, 0x69, 0x6F, 0x6C, - 0x6A, 0x81, 0xAF, 0x1E, 0xEC, 0x96, 0xB4, 0xD3, - 0x7F, 0xC1, 0xD6, 0x89, 0xE6, 0xC1, 0xC1, 0x04, -}; -static const uint8_t IV8_CTR_BIT[] = { - 0x00, 0x00, 0x00, 0x60, /* nonce */ - 0xDB, 0x56, 0x72, 0xC9, 0x7A, 0xA8, 0xF0, 0xB2, - 0x00, 0x00, 0x00, 0x01 -}; -static const uint8_t P8_CTR_BIT[] = { - 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62, - 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x6F -}; -static const uint8_t C8_CTR_BIT[] = { - 0x14, 0x5A, 0xD0, 0x1D, 0xBF, 0x82, 0x4E, 0xC7, - 0x56, 0x08, 0x63, 0xDC, 0x71, 0xE3, 0xE0, 0xCF -}; -static const uint8_t T8_CTR_BIT[] = { 0 }; -static const uint8_t A8_CTR_BIT[] = { 0 }; -#define A8_CTR_BIT_len 0 -#define P8_CTR_BIT_len ((sizeof(P8_CTR_BIT) * 8) - 4) - -static const struct gcm_ctr_vector ctr_vectors[] = { - /* - * field order {K, Klen, IV, IVlen, A, Alen, P, Plen, C, T, Tlen}; - * original vector does not have a valid sub hash key - */ - vector(1_CTR), - vector(2_CTR), - vector(3_CTR), - vector(4_CTR), - vector(5_CTR), - vector(6_CTR), - vector(7_CTR), - vector(8_CTR), - vector(9_CTR), - vector(10_CTR), - vector(11_CTR), - vector(12_CTR), - vector(13_CTR), - vector(14_CTR), - vector(15_CTR) -}; - -static const struct gcm_ctr_vector ctr_bit_vectors[] = { - bit_vector(1_CTR_BIT), - bit_vector(2_CTR_BIT), - bit_vector(3_CTR_BIT), - bit_vector(4_CTR_BIT), - bit_vector(5_CTR_BIT), - bit_vector(6_CTR_BIT), - bit_vector(7_CTR_BIT), - bit_vector(8_CTR_BIT) -}; + +int ctr_test(struct IMB_MGR *); + +extern const struct cipher_test ctr_test_json[]; +extern const struct cipher_test ctr_bit_test_json[]; static int test_ctr(struct IMB_MGR *mb_mgr, @@ -1364,7 +64,7 @@ test_ctr(struct IMB_MGR *mb_mgr, /* Get number of bytes (in case algo is CNTR_BITLEN) */ if (alg == IMB_CIPHER_CNTR) - text_byte_len = text_len; + text_byte_len = text_len / 8; else text_byte_len = BYTE_ROUND_UP(text_len); @@ -1472,7 +172,7 @@ test_ctr_burst(struct IMB_MGR *mb_mgr, /* Get number of bytes (in case algo is CNTR_BITLEN) */ if (alg == IMB_CIPHER_CNTR) - text_byte_len = text_len; + text_byte_len = text_len / 8; else text_byte_len = BYTE_ROUND_UP(text_len); @@ -1600,7 +300,7 @@ test_ctr_cipher_burst(struct IMB_MGR *mb_mgr, /* Get number of bytes (in case algo is CNTR_BITLEN) */ if (alg == IMB_CIPHER_CNTR) - text_byte_len = text_len; + text_byte_len = text_len / 8; else text_byte_len = BYTE_ROUND_UP(text_len); @@ -1706,87 +406,68 @@ test_ctr_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, struct test_suite_context *ctx192, struct test_suite_context *ctx256, - const struct gcm_ctr_vector *vectors, - const uint32_t vectors_cnt, const IMB_CIPHER_MODE alg) + const struct cipher_test *v, + const IMB_CIPHER_MODE alg) { - uint32_t vect; DECLARE_ALIGNED(uint32_t expkey[4*15], 16); DECLARE_ALIGNED(uint32_t dust[4*15], 16); printf("AES-CTR standard test vectors:\n"); - for (vect = 0; vect < vectors_cnt; vect++) { + for (; v->msg != NULL; v++) { struct test_suite_context *ctx; if (!quiet_mode) { #ifdef DEBUG if (alg == IMB_CIPHER_CNTR) - printf("Standard vector %u/%u Keylen:%d " - "IVlen:%d PTLen:%d\n", - vect, vectors_cnt - 1, - (int) vectors[vect].Klen, - (int) vectors[vect].IVlen, - (int) vectors[vect].Plen); + printf("Standard vector %zu KeySize:%zu IVSize:%zu MsgSize:%zu\n", + v->tcId, v->keySize, v->ivSize / 8, v->msgSize / 8); else - printf("Bit vector %u/%u Keylen:%d " - "IVlen:%d PTLen:%d\n", - vect, vectors_cnt - 1, - (int) vectors[vect].Klen, - (int) vectors[vect].IVlen, - (int) vectors[vect].Plen); + printf("Bit vector %zu KeySize:%zu IVSize:%zu MsgSize:%zu\n", + v->tcId, v->keySize, v->ivSize / 8, v->msgSize); #else printf("."); #endif } - switch (vectors[vect].Klen) { + switch (v->keySize / 8) { case IMB_KEY_128_BYTES: - IMB_AES_KEYEXP_128(mb_mgr, vectors[vect].K, - expkey, dust); + IMB_AES_KEYEXP_128(mb_mgr, v->key, expkey, dust); ctx = ctx128; break; case IMB_KEY_192_BYTES: - IMB_AES_KEYEXP_192(mb_mgr, vectors[vect].K, - expkey, dust); + IMB_AES_KEYEXP_192(mb_mgr, v->key, expkey, dust); ctx = ctx192; break; case IMB_KEY_256_BYTES: - IMB_AES_KEYEXP_256(mb_mgr, vectors[vect].K, - expkey, dust); + IMB_AES_KEYEXP_256(mb_mgr, v->key, expkey, dust); ctx = ctx256; break; default: return; } - if (test_ctr(mb_mgr, - expkey, vectors[vect].Klen, - vectors[vect].IV, - (unsigned) vectors[vect].IVlen, - vectors[vect].P, vectors[vect].C, - (unsigned) vectors[vect].Plen, + if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, + (unsigned) v->ivSize / 8, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize, IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg)) { - printf("error #%u encrypt\n", vect + 1); + printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr(mb_mgr, - expkey, vectors[vect].Klen, - vectors[vect].IV, - (unsigned) vectors[vect].IVlen, - vectors[vect].C, vectors[vect].P, - (unsigned) vectors[vect].Plen, + if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, + (unsigned) v->ivSize / 8, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg)) { - printf("error #%u decrypt\n", vect + 1); + printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (vectors[vect].IVlen == 12 && alg == IMB_CIPHER_CNTR) { - /* IV in the table didn't - * include block counter (12 bytes). + if (v->ivSize / 8 == 12 && alg == IMB_CIPHER_CNTR) { + /* IV in the table didn't include block counter (12 bytes). * Let's encrypt & decrypt the same but * with 16 byte IV that includes block counter. */ @@ -1794,34 +475,28 @@ test_ctr_vectors(struct IMB_MGR *mb_mgr, const unsigned orig_iv_len = 12; uint8_t local_iv[16]; - memcpy(local_iv, vectors[vect].IV, orig_iv_len); + memcpy(local_iv, v->iv, orig_iv_len); /* 32-bit 0x1 in BE == 0x01000000 in LE */ local_iv[12] = 0x00; local_iv[13] = 0x00; local_iv[14] = 0x00; local_iv[15] = 0x01; - if (test_ctr(mb_mgr, - expkey, vectors[vect].Klen, - local_iv, new_iv_len, - vectors[vect].P, vectors[vect].C, - (unsigned) vectors[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - alg)) { - printf("error #%u encrypt\n", vect + 1); + if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, + local_iv, new_iv_len, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg)) { + printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr(mb_mgr, - expkey, vectors[vect].Klen, - local_iv, new_iv_len, - vectors[vect].C, vectors[vect].P, - (unsigned) vectors[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - alg)) { - printf("error #%u decrypt\n", vect + 1); + if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, + local_iv, new_iv_len, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg)) { + printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -1837,93 +512,74 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, struct test_suite_context *ctx192, struct test_suite_context *ctx256, - const struct gcm_ctr_vector *vectors, - const uint32_t vectors_cnt, const IMB_CIPHER_MODE alg, + const struct cipher_test *v, + const IMB_CIPHER_MODE alg, const uint32_t num_jobs) { - uint32_t vect; DECLARE_ALIGNED(uint32_t expkey[4*15], 16); DECLARE_ALIGNED(uint32_t dust[4*15], 16); if (!quiet_mode) printf("AES-CTR standard test vectors - Burst API (N jobs = %u):\n", num_jobs); - for (vect = 0; vect < vectors_cnt; vect++) { + for (; v->msg != NULL; v++) { struct test_suite_context *ctx; if (!quiet_mode) { #ifdef DEBUG if (alg == IMB_CIPHER_CNTR) - printf("Standard vector %u/%u Keylen:%d " - "IVlen:%d PTLen:%d (burst)\n", - vect, vectors_cnt - 1, - (int) vectors[vect].Klen, - (int) vectors[vect].IVlen, - (int) vectors[vect].Plen); + printf("Standard vector %zu KeySize:%zu IVSize:%zu MsgSize:%zu\n", + v->tcId, v->keySize, v->ivSize / 8, v->msgSize / 8); else - printf("Bit vector %u/%u Keylen:%d " - "IVlen:%d PTLen:%d (burst)\n", - vect, vectors_cnt - 1, - (int) vectors[vect].Klen, - (int) vectors[vect].IVlen, - (int) vectors[vect].Plen); + printf("Bit vector %zu KeySize:%zu IVSize:%zu MsgSize:%zu\n", + v->tcId, v->keySize, v->ivSize / 8, v->msgSize); #else printf("."); #endif } - switch (vectors[vect].Klen) { + switch (v->keySize / 8) { case IMB_KEY_128_BYTES: - IMB_AES_KEYEXP_128(mb_mgr, vectors[vect].K, - expkey, dust); + IMB_AES_KEYEXP_128(mb_mgr, v->key, expkey, dust); ctx = ctx128; break; case IMB_KEY_192_BYTES: - IMB_AES_KEYEXP_192(mb_mgr, vectors[vect].K, - expkey, dust); + IMB_AES_KEYEXP_192(mb_mgr, v->key, expkey, dust); ctx = ctx192; break; case IMB_KEY_256_BYTES: - IMB_AES_KEYEXP_256(mb_mgr, vectors[vect].K, - expkey, dust); + IMB_AES_KEYEXP_256(mb_mgr, v->key, expkey, dust); ctx = ctx256; break; default: return; } - if (test_ctr_burst(mb_mgr, - expkey, vectors[vect].Klen, - vectors[vect].IV, - (unsigned) vectors[vect].IVlen, - vectors[vect].P, vectors[vect].C, - (unsigned) vectors[vect].Plen, - IMB_DIR_ENCRYPT, - IMB_ORDER_CIPHER_HASH, alg, num_jobs)) { - printf("error #%u encrypt burst\n", vect + 1); + if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, + (unsigned) v->ivSize / 8, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, + num_jobs)) { + printf("error #%zu encrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr_burst(mb_mgr, - expkey, vectors[vect].Klen, - vectors[vect].IV, - (unsigned) vectors[vect].IVlen, - vectors[vect].C, vectors[vect].P, - (unsigned) vectors[vect].Plen, - IMB_DIR_DECRYPT, - IMB_ORDER_HASH_CIPHER, alg, num_jobs)) { - printf("error #%u decrypt burst\n", vect + 1); + if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, + (unsigned) v->ivSize / 8, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, + num_jobs)) { + printf("error #%zu decrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (vectors[vect].IVlen == 12 && + if (v->ivSize / 8 == 12 && alg == IMB_CIPHER_CNTR) { - /* IV in the table didn't - * include block counter (12 bytes). + /* IV in the table didn't include block counter (12 bytes). * Let's encrypt & decrypt the same but * with 16 byte IV that includes block counter. */ @@ -1931,38 +587,30 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, const unsigned orig_iv_len = 12; uint8_t local_iv[16]; - memcpy(local_iv, vectors[vect].IV, orig_iv_len); + memcpy(local_iv, v->iv, orig_iv_len); /* 32-bit 0x1 in BE == 0x01000000 in LE */ local_iv[12] = 0x00; local_iv[13] = 0x00; local_iv[14] = 0x00; local_iv[15] = 0x01; - if (test_ctr_burst(mb_mgr, - expkey, vectors[vect].Klen, - local_iv, new_iv_len, - vectors[vect].P, - vectors[vect].C, (unsigned) - vectors[vect].Plen, - IMB_DIR_ENCRYPT, - IMB_ORDER_CIPHER_HASH, - alg, num_jobs)) { - printf("error #%u encrypt burst\n", vect + 1); + if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, + local_iv, new_iv_len, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, + num_jobs)) { + printf("error #%zu encrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr_burst(mb_mgr, - expkey, vectors[vect].Klen, - local_iv, new_iv_len, - vectors[vect].C, - vectors[vect].P, (unsigned) - vectors[vect].Plen, - IMB_DIR_DECRYPT, - IMB_ORDER_HASH_CIPHER, - alg, num_jobs)) { - printf("error #%u decrypt burst\n", vect + 1); + if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, + local_iv, new_iv_len, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, + num_jobs)) { + printf("error #%zu decrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -1973,42 +621,31 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, if (alg == IMB_CIPHER_CNTR_BITLEN) continue; - if (test_ctr_cipher_burst(mb_mgr, - expkey, vectors[vect].Klen, - vectors[vect].IV, - (unsigned) vectors[vect].IVlen, - vectors[vect].P, vectors[vect].C, - (unsigned) vectors[vect].Plen, - IMB_DIR_ENCRYPT, - IMB_ORDER_CIPHER_HASH, alg, + if (test_ctr_cipher_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, + (unsigned) v->ivSize / 8, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, num_jobs)) { - printf("error #%u encrypt cipher-only burst\n", - vect + 1); + printf("error #%zu encrypt cipher-only burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr_cipher_burst(mb_mgr, - expkey, vectors[vect].Klen, - vectors[vect].IV, - (unsigned) vectors[vect].IVlen, - vectors[vect].C, vectors[vect].P, - (unsigned) vectors[vect].Plen, - IMB_DIR_DECRYPT, - IMB_ORDER_HASH_CIPHER, alg, + if (test_ctr_cipher_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, + (unsigned) v->ivSize / 8, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, num_jobs)) { - printf("error #%u decrypt cipher-only burst\n", - vect + 1); + printf("error #%zu decrypt cipher-only burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (vectors[vect].IVlen == 12 && + if (v->ivSize / 8 == 12 && alg == IMB_CIPHER_CNTR) { - /* IV in the table didn't - * include block counter (12 bytes). + /* IV in the table didn't include block counter (12 bytes). * Let's encrypt & decrypt the same but * with 16 byte IV that includes block counter. */ @@ -2016,40 +653,30 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, const unsigned orig_iv_len = 12; uint8_t local_iv[16]; - memcpy(local_iv, vectors[vect].IV, orig_iv_len); + memcpy(local_iv, v->iv, orig_iv_len); /* 32-bit 0x1 in BE == 0x01000000 in LE */ local_iv[12] = 0x00; local_iv[13] = 0x00; local_iv[14] = 0x00; local_iv[15] = 0x01; - if (test_ctr_cipher_burst(mb_mgr, - expkey, vectors[vect].Klen, - local_iv, new_iv_len, - vectors[vect].P, - vectors[vect].C, (unsigned) - vectors[vect].Plen, - IMB_DIR_ENCRYPT, - IMB_ORDER_CIPHER_HASH, - alg, num_jobs)) { - printf("error #%u encrypt cipher-only burst\n", - vect + 1); + if (test_ctr_cipher_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, + local_iv, new_iv_len, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, + num_jobs)) { + printf("error #%zu encrypt cipher-only burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr_cipher_burst(mb_mgr, - expkey, vectors[vect].Klen, - local_iv, new_iv_len, - vectors[vect].C, - vectors[vect].P, (unsigned) - vectors[vect].Plen, - IMB_DIR_DECRYPT, - IMB_ORDER_HASH_CIPHER, - alg, num_jobs)) { - printf("error #%u decrypt cipher-only burst\n", - vect + 1); + if (test_ctr_cipher_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, + local_iv, new_iv_len, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, + num_jobs)) { + printf("error #%zu decrypt cipher-only burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -2068,22 +695,16 @@ ctr_test(struct IMB_MGR *mb_mgr) struct test_suite_context ctx128; struct test_suite_context ctx192; struct test_suite_context ctx256; - const uint32_t ctr_vec_cnt = DIM(ctr_vectors); - const uint32_t ctr_bit_vec_cnt = DIM(ctr_bit_vectors); /* Standard CTR vectors */ test_suite_start(&ctx128, "AES-CTR-128"); test_suite_start(&ctx192, "AES-CTR-192"); test_suite_start(&ctx256, "AES-CTR-256"); - test_ctr_vectors(mb_mgr, - &ctx128, &ctx192, &ctx256, - ctr_vectors, ctr_vec_cnt, - IMB_CIPHER_CNTR); + test_ctr_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, + ctr_test_json, IMB_CIPHER_CNTR); for (i = 1; i <= MAX_CTR_JOBS; i++) - test_ctr_vectors_burst(mb_mgr, - &ctx128, &ctx192, &ctx256, - ctr_vectors, ctr_vec_cnt, - IMB_CIPHER_CNTR, i); + test_ctr_vectors_burst(mb_mgr, &ctx128, &ctx192, &ctx256, + ctr_test_json, IMB_CIPHER_CNTR, i); errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx192); errors += test_suite_end(&ctx256); @@ -2093,13 +714,10 @@ ctr_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx192, "AES-CTR-192-BIT-LENGTH"); test_suite_start(&ctx256, "AES-CTR-256-BIT-LENGTH"); test_ctr_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, - ctr_bit_vectors, ctr_bit_vec_cnt, - IMB_CIPHER_CNTR_BITLEN); + ctr_bit_test_json, IMB_CIPHER_CNTR_BITLEN); for (i = 1; i <= MAX_CTR_JOBS; i++) - test_ctr_vectors_burst(mb_mgr, - &ctx128, &ctx192, &ctx256, - ctr_bit_vectors, ctr_bit_vec_cnt, - IMB_CIPHER_CNTR_BITLEN, i); + test_ctr_vectors_burst(mb_mgr, &ctx128, &ctx192, &ctx256, + ctr_bit_test_json, IMB_CIPHER_CNTR_BITLEN, i); errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx192); errors += test_suite_end(&ctx256); diff --git a/test/kat-app/ctr_test.json.c b/test/kat-app/ctr_test.json.c new file mode 100644 index 00000000..db47594e --- /dev/null +++ b/test/kat-app/ctr_test.json.c @@ -0,0 +1,432 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* CTR, RFC3686 */ +#include "cipher_test.h" +const struct cipher_test ctr_test_json[] = { + /* Vectors from https://tools.ietf.org/html/rfc3686 */ + {96, 128, 1, + "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", + "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79\x2d\x61\x75\xa3\x26\x13\x11\xb8", 1, + 128}, + {96, 128, 2, + "\x7e\x24\x06\x78\x17\xfa\xe0\xd7\x43\xd6\xce\x1f\x32\x53\x91\x63", + "\x00\x6c\xb6\xdb\xc0\x54\x3b\x59\xda\x48\xd9\x0b", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x51\x04\xa1\x06\x16\x8a\x72\xd9\x79\x0d\x41\xee\x8e\xda\xd3\x88\xeb\x2e" + "\x1e\xfc\x46\xda\x57\xc8\xfc\xe6\x30\xdf\x91\x41\xbe\x28", + 1, 256}, + {96, 128, 3, + "\x76\x91\xbe\x03\x5e\x50\x20\xa8\xac\x6e\x61\x85\x29\xf9\xa0\xdc", + "\x00\xe0\x01\x7b\x27\x77\x7f\x3f\x4a\x17\x86\xf0", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", + "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9\xcf\x46\x52\xe9\xef\xdb\x72\xd7\x45\x40" + "\xa4\x2b\xde\x6d\x78\x36\xd5\x9a\x5c\xea\xae\xf3\x10\x53\x25\xb2\x07\x2f", + 1, 288}, + {96, 192, 4, + "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed\x86\x3d" + "\x06\xcc\xfd\xb7\x85\x15", + "\x00\x00\x00\x48\x36\x73\x3c\x14\x7d\x6d\x93\xcb", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", + "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8\x4e\x79\x35\xa0\x03\xcb\xe9\x28", 1, + 128}, + {96, 192, 5, + "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c\x19\xe7\x34\x08\x19\xe0\xf6\x9c\x67\x8c" + "\x3d\xb8\xe6\xf6\xa9\x1a", + "\x00\x96\xb0\x3b\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x45\x32\x43\xfc\x60\x9b\x23\x32\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f\x84\x90" + "\x70\x1c\x5a\xd4\xa7\x9c\xfc\x1f\xe0\xff\x42\xf4\xfb\x00", + 1, 256}, + {96, 192, 6, + "\x02\xbf\x39\x1e\xe8\xec\xb1\x59\xb9\x59\x61\x7b\x09\x65\x27\x9b\xf5\x9b" + "\x60\xa7\x86\xd3\xe0\xfe", + "\x00\x07\xbd\xfd\x5c\xbd\x60\x27\x8d\xcc\x09\x12", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", + "\x96\x89\x3f\xc5\x5e\x5c\x72\x2f\x54\x0b\x7d\xd1\xdd\xf7\xe7\x58\xd2\x88" + "\xbc\x95\xc6\x91\x65\x88\x45\x36\xc8\x11\x66\x2f\x21\x88\xab\xee\x09\x35", + 1, 288}, + {96, 256, 7, + "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f\x4c\x8a\x05\x42\xc8\x69\x6f\x6c\x6a\x81" + "\xaf\x1e\xec\x96\xb4\xd3\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04", + "\x00\x00\x00\x60\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", + "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7\x56\x08\x63\xdc\x71\xe3\xe0\xc0", 1, + 128}, + {96, 256, 8, + "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb\x07\x96\x36\x58\x79\xef\xf8\x86\xc6\x6d" + "\xd5\x1a\x5b\x6a\x99\x74\x4b\x50\x59\x0c\x87\xa2\x38\x84", + "\x00\xfa\xac\x24\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\xf0\x5e\x23\x1b\x38\x94\x61\x2c\x49\xee\x00\x0b\x80\x4e\xb2\xa9\xb8\x30" + "\x6b\x50\x8f\x83\x9d\x6a\x55\x30\x83\x1d\x93\x44\xaf\x1c", + 1, 256}, + {96, 256, 9, + "\xff\x7a\x61\x7c\xe6\x91\x48\xe4\xf1\x72\x6e\x2f\x43\x58\x1d\xe2\xaa\x62" + "\xd9\xf8\x05\x53\x2e\xdf\xf1\xee\xd6\x87\xfb\x54\x15\x3d", + "\x00\x1c\xc5\xb7\x51\xa5\x1d\x70\xa1\xc1\x11\x48", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", + "\xeb\x6c\x52\x82\x1d\x0b\xbb\xf7\xce\x75\x94\x46\x2a\xca\x4f\xaa\xb4\x07" + "\xdf\x86\x65\x69\xfd\x07\xf4\x8c\xc0\xb5\x83\xd6\x07\x1f\x1e\xc0\xe6\xb8", + 1, 288}, + {96, 128, 10, + "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a", + 1, 1024}, + {96, 128, 11, + "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x12\xad\x82\xdf\x2f\xf8\x9c\xe0", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x7a\x13\xb4\x40\x69\x9b\x58\x16", + 1, 1088}, + {96, 128, 12, + "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" + "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" + "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" + "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" + "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" + "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" + "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" + "\xac\xd9\xad\x94", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" + "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" + "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" + "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" + "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" + "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" + "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" + "\x51\x6c\x16\x7a", + 1, 2048}, + {96, 128, 13, + "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" + "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" + "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" + "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" + "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" + "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" + "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" + "\xac\xd9\xad\x94\x66\xb8\x3f\x3a\x21\x9f\xd0\x43\x46\xdd\x65\x8b\x44\x99" + "\x66\x91\x64\xe2\x69\x6f\xbb\x85\x8c\xcc\x7f\xea\x96\xd1\x5e\xb4\x7c\xd0" + "\xab\x02\x8d\xa3\x59\x3b\x8c\xd5\xd0\xe7\xb4\xc4", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" + "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" + "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" + "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" + "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" + "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" + "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" + "\x51\x6c\x16\x7a\xed\x52\x55\xb9\x76\x6c\x5e\x6e\x76\x97\x00\xc7\xeb\xfe" + "\xec\x10\x94\x2c\xa9\xaf\x9b\x09\x19\xb3\x17\x29\x96\xba\x8e\xac\x3d\x0a" + "\x9b\x70\x54\x0f\x1e\xd4\xe8\x13\xe6\x8f\xad\xfd", + 1, 2400}, + {96, 128, 14, + "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" + "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" + "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" + "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" + "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" + "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" + "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" + "\xac\xd9\xad\x94\x66\xb8\x3f\x3a\x21\x9f\xd0\x43\x46\xdd\x65\x8b\x44\x99" + "\x66\x91\x64\xe2\x69\x6f\xbb\x85\x8c\xcc\x7f\xea\x96\xd1\x5e\xb4\x7c\xd0" + "\xab\x02\x8d\xa3\x59\x3b\x8c\xd5\xd0\xe7\xb4\xc4\x90\x41\x9f\x78\x4e\x82" + "\x9e\xe4\x1b\x97\xa9\xa4\x7b\x48\xad\x56\xc0\xe4\x86\x52\xfc\xad\x93\x0b" + "\x7d\x38\xce\x73\x64\xbd\xf7\x00\x7b\xe6\x46\x03\x2f\x4b\x75\x9f\x3a\x2d" + "\x32\x42\xfe\x80\x74\x89\x27\x34\xce\x5e\xbf\xbe\x07\x50\x91\x08\x27\x2b" + "\x32\x77\xa7\xff\x83\xb1\xab\xc8\x98\xbe\xac\x33\x7c\x47\x19\x33\x6f\x4d" + "\xbe\x3e\xdc\xe0\x87\xfb", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" + "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" + "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" + "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" + "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" + "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" + "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" + "\x51\x6c\x16\x7a\xed\x52\x55\xb9\x76\x6c\x5e\x6e\x76\x97\x00\xc7\xeb\xfe" + "\xec\x10\x94\x2c\xa9\xaf\x9b\x09\x19\xb3\x17\x29\x96\xba\x8e\xac\x3d\x0a" + "\x9b\x70\x54\x0f\x1e\xd4\xe8\x13\xe6\x8f\xad\xfd\xfd\x13\xcf\xd5\x94\x06" + "\xa0\x24\x79\xc0\xf8\x05\x3d\x19\xeb\x96\xda\x31\xae\xf5\x4d\x82\x2c\x23" + "\x03\x9a\x43\x85\x94\x36\x30\xe8\x0a\x9b\x1f\x05\x6e\x4b\xa5\x98\x78\xbe" + "\x73\x0d\x8c\x60\x55\x88\xd6\xa3\x80\x13\x19\xdb\xf8\xcd\xa7\xdc\x28\x4c" + "\x09\xaf\xfe\x88\x77\xe1\x6e\x12\x57\x5a\xa8\xc6\x38\xcf\xf5\x0d\x42\x2c" + "\x67\xb3\x22\x6f\x3d\x7d", + 1, 3072}, + {128, 128, 15, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x87\x4d\x61\x91\xb6\x20\xe3\x26\x1b\xef\x68\x64\x99\x0d\xb6\xce\x98\x06" + "\xf6\x6b\x79\x70\xfd\xff\x86\x17\x18\x7b\xb9\xff\xfd\xff\x5a\xe4\xdf\x3e" + "\xdb\xd5\xd3\x5e\x5b\x4f\x09\x02\x0d\xb0\x3e\xab\x1e\x03\x1d\xda\x2f\xbe" + "\x03\xd1\x79\x21\x70\xa0\xf3\x00\x9c\xee", + 1, 512}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; + + const struct cipher_test ctr_bit_test_json[] = { + /* Vectors from https://tools.ietf.org/html/rfc3686 */ + {128, 128, 1, + "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf7", + "\xe9\xfe\xd8\xa6\x3d\x15\x53\x04\xd7\x1d\xf2\x0b\xf3\xe8\x22\x14\xb2\x0e" + "\xd7\xda\xd2\xf2\x33\xdc\x3c\x22\xd7\xbd\xee\xed\x8e\x7f", + 1, 253}, + {128, 128, 2, + "\x2b\xd6\x45\x9f\x82\xc4\x40\xe0\x95\x2c\x49\x10\x48\x05\xff\x48", + "\xc6\x75\xa6\x4b\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" + "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" + "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" + "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" + "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" + "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x83", + "\x59\x61\x60\x53\x53\xc6\x4b\xdc\xa1\x5b\x19\x5e\x28\x85\x53\xa9\x10\x63" + "\x25\x06\xd6\x20\x0a\xa7\x90\xc4\xc8\x06\xc9\x99\x04\xcf\x24\x45\xcc\x50" + "\xbb\x1c\xf1\x68\xa4\x96\x73\x73\x4e\x08\x1b\x57\xe3\x24\xce\x52\x59\xc0" + "\xe7\x8d\x4c\xd9\x7b\x87\x09\x76\x50\x3c\x09\x43\xf2\xcb\x5a\xe8\xf0\x52" + "\xc7\xb7\xd3\x92\x23\x95\x87\xb8\x95\x60\x86\xbc\xab\x18\x83\x60\x42\xe2" + "\xe6\xce\x42\x43\x2a\x17\x10\x5c\x53\xd3", + 1, 798}, + {128, 128, 3, + "\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08\xd6\x4e\x32\xd1\x81\x77\x77\xfb", + "\x54\x4d\x49\xcd\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68\x7d\x47\xba\x1d\x36\xd2" + "\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40\xc1\x32\x71\xaf\xf2\x64" + "\xd0\xf2\x4b", + "\x75\x75\x0d\x37\xb4\xbb\xa2\xa4\xde\xdb\x34\x23\x5b\xd6\x8c\x66\x45\xac" + "\xda\xac\xa4\x81\x38\xa3\xb0\xc4\x71\xe2\xa7\x04\x1a\x57\x64\x23\xd2\x92" + "\x72\x87\xf3", + 1, 310}, + {128, 128, 4, + "\xaa\x1f\x95\xae\xa5\x33\xbc\xb3\x2e\xb6\x3b\xf5\x2d\x8f\x83\x1a", + "\x72\xd8\xc6\x71\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfb\x1b\x96\xc5\xc8\xba\xdf\xb2\xe8\xe8\xed\xfd\xe7\x8e\x57\xf2\xad\x81" + "\xe7\x41\x03\xfc\x43\x0a\x53\x4d\xcc\x37\xaf\xce\xc7\x0e\x15\x17\xbb\x06" + "\xf2\x72\x19\xda\xe4\x90\x22\xdd\xc4\x7a\x06\x8d\xe4\xc9\x49\x6a\x95\x1a" + "\x6b\x09\xed\xbd\xc8\x64\xc7\xad\xbd\x74\x0a\xc5\x0c\x02\x2f\x30\x82\xba" + "\xfd\x22\xd7\x81\x97\xc5\xd5\x08\xb9\x77\xbc\xa1\x3f\x32\xe6\x52\xe7\x4b" + "\xa7\x28\x57\x60\x77\xce\x62\x8c\x53\x5e\x87\xdc\x60\x77\xba\x07\xd2\x90" + "\x68\x59\x0c\x8c\xb5\xf1\x08\x8e\x08\x2c\xfa\x0e\xc9\x61\x30\x2d\x69\xcf" + "\x3d\x47", + "\xdf\xb4\x40\xac\xb3\x77\x35\x49\xef\xc0\x46\x28\xae\xb8\xd8\x15\x62\x75" + "\x23\x0b\xdc\x69\x0d\x94\xb0\x0d\x8d\x95\xf2\x8c\x4b\x56\x30\x7f\x60\xf4" + "\xca\x55\xeb\xa6\x61\xeb\xba\x72\xac\x80\x8f\xa8\xc4\x9e\x26\x78\x8e\xd0" + "\x4a\x5d\x60\x6c\xb4\x18\xde\x74\x87\x8b\x9a\x22\xf8\xef\x29\x59\x0b\xc4" + "\xeb\x57\xc9\xfa\xf7\xc4\x15\x24\xa8\x85\xb8\x97\x9c\x42\x3f\x2f\x8f\x8e" + "\x05\x92\xa9\x87\x92\x01\xbe\x7f\xf9\x77\x7a\x16\x2a\xb8\x10\xfe\xb3\x24" + "\xba\x74\xc4\xc1\x56\xe0\x4d\x39\x09\x72\x09\x65\x3a\xc3\x3e\x5a\x5f\x2d" + "\x88\x67", + 1, 1022}, + {128, 128, 5, + "\x96\x18\xae\x46\x89\x1f\x86\x57\x8e\xeb\xe9\x0e\xf7\xa1\x20\x2e", + "\xc6\x75\xa6\x4b\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x8d\xaa\x17\xb1\xae\x05\x05\x29\xc6\x82\x7f\x28\xc0\xef\x6a\x12\x42\xe9" + "\x3f\x8b\x31\x4f\xb1\x8a\x77\xf7\x90\xae\x04\x9f\xed\xd6\x12\x26\x7f\xec" + "\xae\xfc\x45\x01\x74\xd7\x6d\x9f\x9a\xa7\x75\x5a\x30\xcd\x90\xa9\xa5\x87" + "\x4b\xf4\x8e\xaf\x70\xee\xa3\xa6\x2a\x25\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08" + "\xd6\x4e\x32\xd1\x81\x77\x77\xfb\x54\x4d\x49\xcd\x49\x72\x0e\x21\x9d\xbf" + "\x8b\xbe\xd3\x39\x04\xe1\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68" + "\x7d\x47\xba\x1d\x36\xd2\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40" + "\xc1\x32\x71\xaf\xf2\x64\xd0\xf2\x48\x41\xd6\x46\x5f\x09\x96\xff\x84\xe6" + "\x5f\xc5\x17\xc5\x3e\xfc\x33\x63\xc3\x84\x92\xaf", + "\x91\x9c\x8c\x33\xd6\x67\x89\x70\x3d\x05\xa0\xd7\xce\x82\xa2\xae\xac\x4e" + "\xe7\x6c\x0f\x4d\xa0\x50\x33\x5e\x8a\x84\xe7\x89\x7b\xa5\xdf\x2f\x36\xbd" + "\x51\x3e\x3d\x0c\x85\x78\xc7\xa0\xfc\xf0\x43\xe0\x3a\xa3\xa3\x9f\xba\xad" + "\x7d\x15\xbe\x07\x4f\xaa\x5d\x90\x29\xf7\x1f\xb4\x57\xb6\x47\x83\x47\x14" + "\xb0\xe1\x8f\x11\x7f\xca\x10\x67\x79\x45\x09\x6c\x8c\x5f\x32\x6b\xa8\xd6" + "\x09\x5e\xb2\x9c\x3e\x36\xcf\x24\x5d\x16\x22\xaa\xfe\x92\x1f\x75\x66\xc4" + "\xf5\xd6\x44\xf2\xf1\xfc\x0e\xc6\x84\xdd\xb2\x13\x49\x74\x76\x22\xe2\x09" + "\x29\x5d\x27\xff\x3f\x95\x62\x33\x71\xd4\x9b\x14\x7c\x0a\xf4\x86\x17\x1f" + "\x22\xcd\x04\xb1\xcb\xeb\x26\x58\x22\x3e\x69\x3f", + 1, 1245}, + {128, 128, 6, + "\x54\xf4\xe2\xe0\x4c\x83\x78\x6e\xec\x8f\xb5\xab\xe8\xe3\x65\x66", + "\xac\xa4\xf5\x0f\x58\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" + "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" + "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" + "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" + "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" + "\x44\x54\x31\x87\x45\xe3\xfa\x16\xbb\x11\xad\xae\x24\x88\x79\xfe\x52\xdb" + "\x25\x43\xe5\x3c\xf4\x45\xd3\xd8\x28\xce\x0b\xf5\xc5\x60\x59\x3d\x97\x27" + "\x8a\x59\x76\x2d\xd0\xc2\xc9\xcd\x68\xd4\x49\x6a\x79\x25\x08\x61\x40\x14" + "\xb1\x3b\x6a\xa5\x11\x28\xc1\x8c\xd6\xa9\x0b\x87\x97\x8c\x2f\xf1\xca\xbe" + "\x7d\x9f\x89\x8a\x41\x1b\xfd\xb8\x4f\x68\xf6\x72\x7b\x14\x99\xcd\xd3\x0d" + "\xf0\x44\x3a\xb4\xa6\x66\x53\x33\x0b\xcb\xa1\x10\x5e\x4c\xec\x03\x4c\x73" + "\xe6\x05\xb4\x31\x0e\xaa\xad\xcf\xd5\xb0\xca\x27\xff\xd8\x9d\x14\x4d\xf4" + "\x79\x27\x59\x42\x7c\x9c\xc1\xf8\xcd\x8c\x87\x20\x23\x64\xb8\xa6\x87\x95" + "\x4c\xb0\x5a\x8d\x4e\x2d\x99\xe7\x3d\xb1\x60\xde\xb1\x80\xad\x08\x41\xe9" + "\x67\x41\xa5\xd5\x9f\xe4\x18\x9f\x15\x42\x00\x26\xfe\x4c\xd1\x21\x04\x93" + "\x2f\xb3\x8f\x73\x53\x40\x43\x8a\xaf\x7e\xca\x6f\xd5\xcf\xd3\xa1\x95\xce" + "\x5a\xbe\x65\x27\x2a\xf6\x07\xad\xa1\xbe\x65\xa6\xb4\xc9\xc0\x69\x32\x34" + "\x09\x2c\x4d\x01\x8f\x17\x56\xc6\xdb\x9d\xc8\xa6\xd8\x0b\x88\x81\x38\x61" + "\x6b\x68\x12\x62\xf9\x54\xd0\xe7\x71\x17\x48\x78\x0d\x92\x29\x1d\x86\x29" + "\x99\x72\xdb\x74\x1c\xfa\x4f\x37\xb8\xb5\x6c\xdb\x18\xa7\xca\x82\x18\xe8" + "\x6e\x4b\x4b\x71\x6a\x4d\x04\x37\x1f\xbe\xc2\x62\xfc\x5a\xd0\xb3\x81\x9b" + "\x18\x7b\x97\xe5\x5b\x1a\x4d\x7c\x19\xee\x24\xc8\xb4\xd7\x72\x3c\xfe\xdf" + "\x04\x5b\x8a\xca\xe4\x86\x95\x17\xd8\x0e\x50\x61\x5d\x90\x35\xd5\xd9\xc5" + "\xa4\x0a\xf6\x02\x28\x0b\x54\x25\x97\xb0\xcb\x18\x61\x9e\xeb\x35\x92\x57" + "\x59\xd1\x95\xe1\x00\xe8\xe4\xaa\x0c\x38\xa3\xc2\xab\xe0\xf3\xd8\xff\x04" + "\xf3\xc3\x3c\x29\x50\x69\xc2\x36\x94\xb5\xbb\xea\xcd\xd5\x42\xe2\x8e\x8a" + "\x94\xed\xb9\x11\x9f\x41\x2d\x05\x4b\xe1\xfa\x72\x00\xb0\x97", + "\x5c\xb7\x2c\x6e\xdc\x87\x8f\x15\x66\xe1\x02\x53\xaf\xc3\x64\xc9\xfa\x54" + "\x0d\x91\x4d\xb9\x4c\xbe\xe2\x75\xd0\x91\x7c\xa6\xaf\x0d\x77\xac\xb4\xef" + "\x3b\xbe\x1a\x72\x2b\x2e\xf5\xbd\x1d\x4b\x8e\x2a\xa5\x02\x4e\xc1\x38\x8a" + "\x20\x1e\x7b\xce\x79\x20\xae\xc6\x15\x89\x5f\x76\x3a\x55\x64\xdc\xc4\xc4" + "\x82\xa2\xee\x1d\x8b\xfe\xcc\x44\x98\xec\xa8\x3f\xbb\x75\xf9\xab\x53\x0e" + "\x0d\xaf\xbe\xde\x2f\xa5\x89\x5b\x82\x99\x1b\x62\x77\xc5\x29\xe0\xf2\x52" + "\x9d\x7f\x79\x60\x6b\xe9\x67\x06\x29\x6d\xed\xfa\x9d\x74\x12\xb6\x16\x95" + "\x8c\xb5\x63\xc6\x78\xc0\x28\x25\xc3\x0d\x0a\xee\x77\xc4\xc1\x46\xd2\x76" + "\x54\x12\x42\x1a\x80\x8d\x13\xce\xc8\x19\x69\x4c\x75\xad\x57\x2e\x9b\x97" + "\x3d\x94\x8b\x81\xa9\x33\x7c\x3b\x2a\x17\x19\x2e\x22\xc2\x06\x9f\x7e\xd1" + "\x16\x2a\xf4\x4c\xde\xa8\x17\x60\x36\x65\xe8\x07\xce\x40\xc8\xe0\xdd\x9d" + "\x63\x94\xdc\x6e\x31\x15\x3f\xe1\x95\x5c\x47\xaf\xb5\x1f\x26\x17\xee\x0c" + "\x5e\x3b\x8e\xf1\xad\x75\x74\xed\x34\x3e\xdc\x27\x43\xcc\x94\xc9\x90\xe1" + "\xf1\xfd\x26\x42\x53\xc1\x78\xde\xa7\x39\xc0\xbe\xfe\xeb\xcd\x9f\x9b\x76" + "\xd4\x9c\x10\x15\xc9\xfe\xcf\x50\xe5\x3b\x8b\x52\x04\xdb\xcd\x3e\xed\x86" + "\x38\x55\xda\xbc\xdc\xc9\x4b\x31\xe3\x18\x02\x15\x68\x85\x5c\x8b\x9e\x52" + "\xa9\x81\x95\x7a\x11\x28\x27\xf9\x78\xba\x96\x0f\x14\x47\x91\x1b\x31\x7b" + "\x55\x11\xfb\xcc\x7f\xb1\x3a\xc1\x53\xdb\x74\x25\x11\x17\xe4\x86\x1e\xb9" + "\xe8\x3b\xff\xff\xc4\xeb\x77\x55\x57\x90\x38\xe5\x79\x24\xb1\xf7\x8b\x3e" + "\x1a\xd9\x0b\xab\x2a\x07\x87\x1b\x72\xdb\x5e\xef\x96\xc3\x34\x04\x49\x66" + "\xdb\x0c\x37\xca\xfd\x1a\x89\xe5\x64\x6a\x35\x80\xeb\x64\x65\xf1\x21\xdc" + "\xe9\xcb\x88\xd8\x5b\x96\xcf\x23\xcc\xcc\xd4\x28\x07\x67\xbe\xe8\xee\xb2" + "\x3d\x86\x52\x46\x1d\xb6\x49\x31\x03\x00\x3b\xaf\x89\xf5\xe1\x82\x61\xea" + "\x43\xc8\x4a\x92\xeb\xff\xff\xe4\x90\x9d\xc4\x6c\x51\x92\xf8\x25\xf7\x70" + "\x60\x0b\x96\x02\xc5\x57\xb5\xf8\xb4\x31\xa7\x9d\x45\x97\x7d\xd9\xc4\x1b" + "\x86\x3d\xa9\xe1\x42\xe9\x00\x20\xcf\xd0\x74\xd6\x92\x7b\x7a\xb3\xb6\x72" + "\x5d\x1a\x6f\x3f\x98\xb9\xc9\xda\xa8\x98\x2a\xff\x06\x78\x2f", + 1, 3861}, + {128, 192, 7, + "\x02\xbf\x39\x1e\xe8\xec\xb1\x59\xb9\x59\x61\x7b\x09\x65\x27\x9b\xf5\x9b" + "\x60\xa7\x86\xd3\xe0\xfe", + "\x00\x07\xbd\xfd\x5c\xbd\x60\x27\x8d\xcc\x09\x12\x00\x00\x00\x01", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x2f", + "\x96\x89\x3f\xc5\x5e\x5c\x72\x2f\x54\x0b\x7d\xd1\xdd\xf7\xe7\x58\xd2\x88" + "\xbc\x95\xc6\x91\x65\x88\x45\x36\xc8\x11\x66\x2f\x21\x88\xab\xee\x09\x3f", + 1, 284}, + {128, 256, 8, + "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f\x4c\x8a\x05\x42\xc8\x69\x6f\x6c\x6a\x81" + "\xaf\x1e\xec\x96\xb4\xd3\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04", + "\x00\x00\x00\x60\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2\x00\x00\x00\x01", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x6f", + "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7\x56\x08\x63\xdc\x71\xe3\xe0\xcf", 1, + 124}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; diff --git a/test/kat-app/gcm_ctr_vectors_test.h b/test/kat-app/gcm_ctr_vectors_test.h index 3739618e..fca04308 100644 --- a/test/kat-app/gcm_ctr_vectors_test.h +++ b/test/kat-app/gcm_ctr_vectors_test.h @@ -70,6 +70,5 @@ struct gcm_ctr_vector { struct MB_MGR; extern int gcm_test(IMB_MGR *p_mgr); -int ctr_test(struct IMB_MGR *); #endif /* GCM_CTR_VECTORS_TEST_H_ */ diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 9236aca9..81a79e0b 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -67,6 +67,7 @@ extern int gmac_test(struct IMB_MGR *mb_mgr); extern int ghash_test(struct IMB_MGR *mb_mgr); extern int cbc_test(struct IMB_MGR *mb_mg); extern int cfb_test(struct IMB_MGR *mb_mg); +extern int ctr_test(struct IMB_MGR *mb_mg); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index e7597469..f4490b58 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ctr_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From d8b654725212f49cf5aed7a27619e0a04d87c467 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 20 Jun 2023 14:44:14 +0100 Subject: [PATCH 019/204] avx: [aes-cbc] unify AES-CBC decrypt code and workaround false load block condition - create template aes-cbc decrypt module for all three key sizes - create template aes-cbcs-1-9 decrypt module, it doesn't aes-cbc workaround and packing all functionalities into one module reduces its readability --- lib/avx_t1/aes128_cbc_dec_by8_avx.asm | 317 ++--------------- lib/avx_t1/aes128_cbcs_1_9_dec_by8_avx.asm | 45 ++- lib/avx_t1/aes192_cbc_dec_by8_avx.asm | 306 ++-------------- lib/avx_t1/aes256_cbc_dec_by8_avx.asm | 322 ++--------------- lib/include/aes_cbc_dec_by8_avx.inc | 386 +++++++++++++++++++++ lib/include/aes_cbcs_dec_by8_avx.inc | 275 +++++++++++++++ 6 files changed, 764 insertions(+), 887 deletions(-) create mode 100644 lib/include/aes_cbc_dec_by8_avx.inc create mode 100644 lib/include/aes_cbcs_dec_by8_avx.inc diff --git a/lib/avx_t1/aes128_cbc_dec_by8_avx.asm b/lib/avx_t1/aes128_cbc_dec_by8_avx.asm index 93ab4b06..d7387eaf 100644 --- a/lib/avx_t1/aes128_cbc_dec_by8_avx.asm +++ b/lib/avx_t1/aes128_cbc_dec_by8_avx.asm @@ -25,310 +25,39 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -; routine to do AES128 CBC decrypt "by8" +;; AES-CBC-128 decrypt by8 -;; clobbers xmm0-15 - -%include "include/os.inc" -%include "include/clear_regs.inc" - -%define CONCAT(a,b) a %+ b -%define VMOVDQ vmovdqu - -%define xdata0 xmm0 -%define xdata1 xmm1 -%define xdata2 xmm2 -%define xdata3 xmm3 -%define xdata4 xmm4 -%define xdata5 xmm5 -%define xdata6 xmm6 -%define xdata7 xmm7 -%define xIV xmm8 -%define xkey0 xmm9 -%define xkey2 xmm10 -%define xkey4 xmm11 -%define xkey6 xmm12 -%define xkey8 xmm13 -%define xkey10 xmm14 -%define xkeytmp xmm15 +; arg 1: IN: pointer to input (cipher text) +; arg 2: IV: pointer to IV +; arg 3: KEYS: pointer to keys +; arg 4: OUT: pointer to output (plain text) +; arg 5: LEN: length in bytes (multiple of 16) %ifdef LINUX -%define p_in rdi -%define p_IV rsi -%define p_keys rdx -%define p_out rcx -%define len r8 -%define next_iv r9 +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 %else -%define p_in rcx -%define p_IV rdx -%define p_keys r8 -%define p_out r9 -%define next_iv r11 -%endif - -%define num_bytes rax -%define tmp r10 -%define tmp2 r11 - -%macro do_aes_load 1 - do_aes %1, 1 -%endmacro - -%macro do_aes_noload 1 - do_aes %1, 0 -%endmacro - -; do_aes num_in_par load_keys -; This increments p_in, but not p_out -%macro do_aes 2 -%define %%by %1 -%define %%load_keys %2 - -%if (%%load_keys) - vmovdqa xkey0, [p_keys + 0*16] +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%define arg5 rax %endif -%assign i 0 -%rep %%by - VMOVDQ CONCAT(xdata,i), [p_in + i*OFFSET] -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey2, [p_keys + 2*16] -%endif -%assign i 0 -%rep %%by - vpxor CONCAT(xdata,i), CONCAT(xdata,i), xkey0 -%assign i (i+1) -%endrep - - add p_in, OFFSET*%%by - - vmovdqa xkeytmp, [p_keys + 1*16] -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey4, [p_keys + 4*16] -%endif -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey2 -%assign i (i+1) -%endrep - - vmovdqa xkeytmp, [p_keys + 3*16] -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey6, [p_keys + 6*16] -%endif -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey4 -%assign i (i+1) -%endrep - - vmovdqa xkeytmp, [p_keys + 5*16] -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey8, [p_keys + 8*16] -%endif -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey6 -%assign i (i+1) -%endrep - - vmovdqa xkeytmp, [p_keys + 7*16] -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey10, [p_keys + 10*16] -%endif -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey8 -%assign i (i+1) -%endrep - - vmovdqa xkeytmp, [p_keys + 9*16] -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp -%assign i (i+1) -%endrep - -%assign i 0 -%rep %%by - vaesdeclast CONCAT(xdata,i), CONCAT(xdata,i), xkey10 -%assign i (i+1) -%endrep - - vpxor xdata0, xdata0, xIV -%assign i 1 -%if (%%by > 1) -%rep (%%by - 1) - VMOVDQ xIV, [p_in + (i-1)*OFFSET - OFFSET*%%by] - vpxor CONCAT(xdata,i), CONCAT(xdata,i), xIV -%assign i (i+1) -%endrep -%endif - VMOVDQ xIV, [p_in + (i-1)*OFFSET - OFFSET*%%by] - -%assign i 0 -%rep %%by - VMOVDQ [p_out + i*OFFSET], CONCAT(xdata,i) -%assign i (i+1) -%endrep -%endmacro - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%include "include/aes_cbc_dec_by8_avx.inc" mksection .text -%ifndef AES_CBC_DEC_128_X8 -;; aes_cbc_dec_128_avx(void *in, void *IV, void *keys, void *out, UINT64 num_bytes) -%define AES_CBC_DEC_128_X8 aes_cbc_dec_128_avx -%define OFFSET 16 -%endif - -MKGLOBAL(AES_CBC_DEC_128_X8,function,internal) -AES_CBC_DEC_128_X8: -%ifndef LINUX - mov num_bytes, [rsp + 8*5] -%else - mov num_bytes, len -%endif - - vmovdqu xIV, [p_IV] - -%ifdef CBCS - ;; convert CBCS length to standard number of CBC blocks - ;; ((num_bytes + 9 blocks) / 160) = num blocks to decrypt - mov tmp2, rdx - xor rdx, rdx ;; store and zero rdx for div - add num_bytes, 9*16 - mov tmp, 160 - div tmp ;; divide by 160 - shl num_bytes, 4 ;; multiply by 16 to get num bytes - mov rdx, tmp2 -%endif - - mov tmp, num_bytes - and tmp, 7*16 - jz mult_of_8_blks - - ; 1 <= tmp <= 7 - cmp tmp, 4*16 - jg gt4 - je eq4 - -lt4: - cmp tmp, 2*16 - jg eq3 - je eq2 -eq1: - do_aes_load 1 - add p_out, 1*OFFSET - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq2: - do_aes_load 2 - add p_out, 2*OFFSET - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq3: - do_aes_load 3 - add p_out, 3*OFFSET - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq4: - do_aes_load 4 - add p_out, 4*OFFSET - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -gt4: - cmp tmp, 6*16 - jg eq7 - je eq6 - -eq5: - do_aes_load 5 - add p_out, 5*OFFSET - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq6: - do_aes_load 6 - add p_out, 6*OFFSET - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq7: - do_aes_load 7 - add p_out, 7*OFFSET - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -mult_of_8_blks: - vmovdqa xkey0, [p_keys + 0*16] - vmovdqa xkey2, [p_keys + 2*16] - vmovdqa xkey4, [p_keys + 4*16] - vmovdqa xkey6, [p_keys + 6*16] - vmovdqa xkey8, [p_keys + 8*16] - vmovdqa xkey10, [p_keys + 10*16] - -main_loop2: - ; num_bytes is a multiple of 8 and >0 - do_aes_noload 8 - add p_out, 8*OFFSET - sub num_bytes, 8*16 - jne main_loop2 - -do_return2: -%ifdef CBCS +align 64 +MKGLOBAL(aes_cbc_dec_128_avx,function,internal) +aes_cbc_dec_128_avx: %ifndef LINUX - mov next_iv, [rsp + 8*6] -%endif - ;; store last cipher block as next iv - vmovdqu [next_iv], xIV + mov arg5, [rsp + 5*8] %endif -%ifdef SAFE_DATA - clear_all_xmms_avx_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_DEC arg1, arg2, arg3, arg4, arg5, r10, 9 + ret mksection stack-noexec diff --git a/lib/avx_t1/aes128_cbcs_1_9_dec_by8_avx.asm b/lib/avx_t1/aes128_cbcs_1_9_dec_by8_avx.asm index be8a60ad..6e932b8d 100644 --- a/lib/avx_t1/aes128_cbcs_1_9_dec_by8_avx.asm +++ b/lib/avx_t1/aes128_cbcs_1_9_dec_by8_avx.asm @@ -25,12 +25,43 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -%ifndef AES_CBC_DEC_128_X8 -;; aes_cbcs_1_9_dec_128_avx(void *in, void *IV, void *keys, void *out, -;; UINT64 num_bytes, void *next_iv) -%define AES_CBC_DEC_128_X8 aes_cbcs_1_9_dec_128_avx -%define OFFSET 160 -%define CBCS +;; AES-CBCS-128_1-9 decrypt by8 + +; arg 1: IN: pointer to input (cipher text) +; arg 2: IV: pointer to IV +; arg 3: KEYS: pointer to keys +; arg 4: OUT: pointer to output (plain text) +; arg 5: LEN: length in bytes (multiple of 16) +; arg 6: NEXT_IV: pointer to buffer for IV + +%ifdef LINUX +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 +%define arg6 r9 +%else +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%define arg5 rax +%define arg6 r11 +%endif + +%include "include/aes_cbcs_dec_by8_avx.inc" + +mksection .text + +align 64 +MKGLOBAL(aes_cbcs_1_9_dec_128_avx,function,internal) +aes_cbcs_1_9_dec_128_avx: +%ifndef LINUX + mov arg5, [rsp + 5*8] + mov arg6, [rsp + 6*8] %endif + AES_CBCS_DEC arg1, arg2, arg3, arg4, arg5, r10, 9, 160, arg6 + ret -%include "avx_t1/aes128_cbc_dec_by8_avx.asm" +mksection stack-noexec diff --git a/lib/avx_t1/aes192_cbc_dec_by8_avx.asm b/lib/avx_t1/aes192_cbc_dec_by8_avx.asm index 276eb9fd..3e821135 100644 --- a/lib/avx_t1/aes192_cbc_dec_by8_avx.asm +++ b/lib/avx_t1/aes192_cbc_dec_by8_avx.asm @@ -25,303 +25,39 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -; routine to do AES192 CBC decrypt "by8" +; AES-CBC-192 decrypt by8 -; XMM registers are clobbered. Saving/restoring must be done at a higher level -%include "include/os.inc" -%include "include/clear_regs.inc" - -%define CONCAT(a,b) a %+ b -%define VMOVDQ vmovdqu - -%define xdata0 xmm0 -%define xdata1 xmm1 -%define xdata2 xmm2 -%define xdata3 xmm3 -%define xdata4 xmm4 -%define xdata5 xmm5 -%define xdata6 xmm6 -%define xdata7 xmm7 -%define xIV xmm8 -%define xkey0 xmm9 -%define xkey3 xmm10 -%define xkey6 xmm11 -%define xkey9 xmm12 -%define xkey12 xmm13 -%define xkeyA xmm14 -%define xkeyB xmm15 +; arg 1: IN: pointer to input (cipher text) +; arg 2: IV: pointer to IV +; arg 3: KEYS: pointer to keys +; arg 4: OUT: pointer to output (plain text) +; arg 5: LEN: length in bytes (multiple of 16) %ifdef LINUX -%define p_in rdi -%define p_IV rsi -%define p_keys rdx -%define p_out rcx -%define num_bytes r8 +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 %else -%define p_in rcx -%define p_IV rdx -%define p_keys r8 -%define p_out r9 -%define num_bytes rax -%endif - -%define tmp r10 - -%macro do_aes_load 1 - do_aes %1, 1 -%endmacro - -%macro do_aes_noload 1 - do_aes %1, 0 -%endmacro - -; do_aes num_in_par load_keys -; This increments p_in, but not p_out -%macro do_aes 2 -%define %%by %1 -%define %%load_keys %2 - -%if (%%load_keys) - vmovdqa xkey0, [p_keys + 0*16] +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%define arg5 rax %endif -%assign i 0 -%rep %%by - VMOVDQ CONCAT(xdata,i), [p_in + i*16] -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 1*16] - -%assign i 0 -%rep %%by - vpxor CONCAT(xdata,i), CONCAT(xdata,i), xkey0 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 2*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - - add p_in, 16*%%by - -%if (%%load_keys) - vmovdqa xkey3, [p_keys + 3*16] -%endif - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 4*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey3 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 5*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey6, [p_keys + 6*16] -%endif - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 7*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey6 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 8*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey9, [p_keys + 9*16] -%endif - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 10*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey9 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 11*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey12, [p_keys + 12*16] -%endif - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - -%assign i 0 -%rep %%by - vaesdeclast CONCAT(xdata,i), CONCAT(xdata,i), xkey12 -%assign i (i+1) -%endrep - - vpxor xdata0, xdata0, xIV -%assign i 1 -%if (%%by > 1) -%rep (%%by - 1) - VMOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - vpxor CONCAT(xdata,i), CONCAT(xdata,i), xIV -%assign i (i+1) -%endrep -%endif - VMOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - -%assign i 0 -%rep %%by - VMOVDQ [p_out + i*16], CONCAT(xdata,i) -%assign i (i+1) -%endrep -%endmacro - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%include "include/aes_cbc_dec_by8_avx.inc" mksection .text -;; aes_cbc_dec_192_avx(void *in, void *IV, void *keys, void *out, UINT64 num_bytes) +align 64 MKGLOBAL(aes_cbc_dec_192_avx,function,internal) aes_cbc_dec_192_avx: %ifndef LINUX - mov num_bytes, [rsp + 8*5] + mov arg5, [rsp + 5*8] %endif - - vmovdqu xIV, [p_IV] - - mov tmp, num_bytes - and tmp, 7*16 - jz mult_of_8_blks - - ; 1 <= tmp <= 7 - cmp tmp, 4*16 - jg gt4 - je eq4 - -lt4: - cmp tmp, 2*16 - jg eq3 - je eq2 -eq1: - do_aes_load 1 - add p_out, 1*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq2: - do_aes_load 2 - add p_out, 2*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq3: - do_aes_load 3 - add p_out, 3*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq4: - do_aes_load 4 - add p_out, 4*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -gt4: - cmp tmp, 6*16 - jg eq7 - je eq6 - -eq5: - do_aes_load 5 - add p_out, 5*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq6: - do_aes_load 6 - add p_out, 6*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq7: - do_aes_load 7 - add p_out, 7*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -mult_of_8_blks: - vmovdqa xkey0, [p_keys + 0*16] - vmovdqa xkey3, [p_keys + 3*16] - vmovdqa xkey6, [p_keys + 6*16] - vmovdqa xkey9, [p_keys + 9*16] - vmovdqa xkey12, [p_keys + 12*16] - -main_loop2: - ; num_bytes is a multiple of 8 and >0 - do_aes_noload 8 - add p_out, 8*16 - sub num_bytes, 8*16 - jne main_loop2 - -do_return2: -%ifdef SAFE_DATA - clear_all_xmms_avx_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_DEC arg1, arg2, arg3, arg4, arg5, r10, 11 + ret mksection stack-noexec diff --git a/lib/avx_t1/aes256_cbc_dec_by8_avx.asm b/lib/avx_t1/aes256_cbc_dec_by8_avx.asm index 78b80f6b..c84f0eb4 100644 --- a/lib/avx_t1/aes256_cbc_dec_by8_avx.asm +++ b/lib/avx_t1/aes256_cbc_dec_by8_avx.asm @@ -25,319 +25,39 @@ ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; -; routine to do AES256 CBC decrypt "by8" +; AES-CBC-256 decrypt by8 -; XMM registers are clobbered. Saving/restoring must be done at a higher level -%include "include/os.inc" -%include "include/clear_regs.inc" - -%define CONCAT(a,b) a %+ b -%define VMOVDQ vmovdqu - -%define xdata0 xmm0 -%define xdata1 xmm1 -%define xdata2 xmm2 -%define xdata3 xmm3 -%define xdata4 xmm4 -%define xdata5 xmm5 -%define xdata6 xmm6 -%define xdata7 xmm7 -%define xIV xmm8 -%define xkey0 xmm9 -%define xkey3 xmm10 -%define xkey6 xmm11 -%define xkey9 xmm12 -%define xkey12 xmm13 -%define xkeyA xmm14 -%define xkeyB xmm15 +; arg 1: IN: pointer to input (cipher text) +; arg 2: IV: pointer to IV +; arg 3: KEYS: pointer to keys +; arg 4: OUT: pointer to output (plain text) +; arg 5: LEN: length in bytes (multiple of 16) %ifdef LINUX -%define p_in rdi -%define p_IV rsi -%define p_keys rdx -%define p_out rcx -%define num_bytes r8 +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 %else -%define p_in rcx -%define p_IV rdx -%define p_keys r8 -%define p_out r9 -%define num_bytes rax -%endif - -%define tmp r10 - -%macro do_aes_load 1 - do_aes %1, 1 -%endmacro - -%macro do_aes_noload 1 - do_aes %1, 0 -%endmacro - -; do_aes num_in_par load_keys -; This increments p_in, but not p_out -%macro do_aes 2 -%define %%by %1 -%define %%load_keys %2 - -%if (%%load_keys) - vmovdqa xkey0, [p_keys + 0*16] -%endif - -%assign i 0 -%rep %%by - VMOVDQ CONCAT(xdata,i), [p_in + i*16] -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 1*16] - -%assign i 0 -%rep %%by - vpxor CONCAT(xdata,i), CONCAT(xdata,i), xkey0 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 2*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - - add p_in, 16*%%by - -%if (%%load_keys) - vmovdqa xkey3, [p_keys + 3*16] +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%define arg5 rax %endif -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 4*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey3 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 5*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey6, [p_keys + 6*16] -%endif - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 7*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey6 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 8*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey9, [p_keys + 9*16] -%endif - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 10*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey9 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 11*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%if (%%load_keys) - vmovdqa xkey12, [p_keys + 12*16] -%endif - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vmovdqa xkeyA, [p_keys + 13*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkey12 -%assign i (i+1) -%endrep - - vmovdqa xkeyB, [p_keys + 14*16] - -%assign i 0 -%rep %%by - vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeyA -%assign i (i+1) -%endrep - -%assign i 0 -%rep %%by - vaesdeclast CONCAT(xdata,i), CONCAT(xdata,i), xkeyB -%assign i (i+1) -%endrep - - vpxor xdata0, xdata0, xIV -%assign i 1 -%if (%%by > 1) -%rep (%%by - 1) - VMOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - vpxor CONCAT(xdata,i), CONCAT(xdata,i), xIV -%assign i (i+1) -%endrep -%endif - VMOVDQ xIV, [p_in + (i-1)*16 - 16*%%by] - -%assign i 0 -%rep %%by - VMOVDQ [p_out + i*16], CONCAT(xdata,i) -%assign i (i+1) -%endrep -%endmacro - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%include "include/aes_cbc_dec_by8_avx.inc" mksection .text -;; aes_cbc_dec_256_avx(void *in, void *IV, void *keys, void *out, UINT64 num_bytes) +align 64 MKGLOBAL(aes_cbc_dec_256_avx,function,internal) aes_cbc_dec_256_avx: %ifndef LINUX - mov num_bytes, [rsp + 8*5] + mov arg5, [rsp + 5*8] %endif - - vmovdqu xIV, [p_IV] - - mov tmp, num_bytes - and tmp, 7*16 - jz mult_of_8_blks - - ; 1 <= tmp <= 7 - cmp tmp, 4*16 - jg gt4 - je eq4 - -lt4: - cmp tmp, 2*16 - jg eq3 - je eq2 -eq1: - do_aes_load 1 - add p_out, 1*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq2: - do_aes_load 2 - add p_out, 2*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq3: - do_aes_load 3 - add p_out, 3*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq4: - do_aes_load 4 - add p_out, 4*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -gt4: - cmp tmp, 6*16 - jg eq7 - je eq6 - -eq5: - do_aes_load 5 - add p_out, 5*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq6: - do_aes_load 6 - add p_out, 6*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -eq7: - do_aes_load 7 - add p_out, 7*16 - and num_bytes, ~7*16 - jz do_return2 - jmp main_loop2 - -mult_of_8_blks: - vmovdqa xkey0, [p_keys + 0*16] - vmovdqa xkey3, [p_keys + 3*16] - vmovdqa xkey6, [p_keys + 6*16] - vmovdqa xkey9, [p_keys + 9*16] - vmovdqa xkey12, [p_keys + 12*16] - -main_loop2: - ; num_bytes is a multiple of 8 and >0 - do_aes_noload 8 - add p_out, 8*16 - sub num_bytes, 8*16 - jne main_loop2 - -do_return2: -%ifdef SAFE_DATA - clear_all_xmms_avx_asm -%endif ;; SAFE_DATA - - ret + AES_CBC_DEC arg1, arg2, arg3, arg4, arg5, r10, 13 + ret mksection stack-noexec diff --git a/lib/include/aes_cbc_dec_by8_avx.inc b/lib/include/aes_cbc_dec_by8_avx.inc new file mode 100644 index 00000000..de8123e8 --- /dev/null +++ b/lib/include/aes_cbc_dec_by8_avx.inc @@ -0,0 +1,386 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +;; macro to do a AES-CBC decryption +;; - single-buffer implementation +;; - 8 blocks at a time + +%use smartalign + +%include "include/os.inc" +%include "include/mb_mgr_datastruct.inc" +%include "include/clear_regs.inc" +%include "include/reg_sizes.inc" + +%define CONCAT(a,b) a %+ b + +%define xdata0 xmm0 +%define xdata1 xmm1 +%define xdata2 xmm2 +%define xdata3 xmm3 +%define xdata4 xmm4 +%define xdata5 xmm5 +%define xdata6 xmm6 +%define xdata7 xmm7 + +%define xiv0 xmm8 +%define xiv1 xmm9 +%define xiv2 xmm10 +%define xiv3 xmm11 +%define xiv4 xmm12 +%define xiv5 xmm13 +%define xiv6 xmm14 + +%define xkeytmp xmm15 + +struc STACK +_IV: resq 2 +_IV_new: resq 2 +_rsp_save: resq 1 +endstruc + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DO_AES_DEC num_in_par load_keys +;; - it increments p_in and p_out +;; - ZF (zero-flag) gets updated +;; - ZF means this is the end of the message + +%macro DO_AES_DEC 7 +%define %%p_in %1 ;; [in/out] GP register with input pointer +%define %%p_out %2 ;; [in/out] GP register with output pointer +%define %%p_keys %3 ;; [in] GP register with pointer to AES round keys +%define %%by %4 ;; [in] numeric value; number of blocks to process (1 to 8) +%define %%num_rounds %5 ;; [in] numeric - number fo aesdec rounds (ark / declast not included) +%define %%length %6 ;; [in/out] GP register with message length +%define %%type %7 ;; [in] "main" or "last" selector of 8 block invocation + ;; "short" or "start" selector for < 8 blocks + +%assign is_1_to_7_short_or_8_last 0 + +%if %%by < 8 +%ifidni %%type, short +%assign is_1_to_7_short_or_8_last 1 +%endif +%endif + +%if %%by == 8 +%ifidni %%type, last +%assign is_1_to_7_short_or_8_last 1 +%endif +%endif + + ;; load cipher text +%assign i 0 +%rep %%by + +%if !((%%by == 8) && (i == 0)) + vmovdqu CONCAT(xdata,i), [%%p_in + (i * 16)] +%endif + +%if i == (%%by - 1) + vmovdqa [rsp + _IV_new], CONCAT(xdata,i) +%else + vmovdqa CONCAT(xiv,i), CONCAT(xdata,i) +%endif +%assign i (i + 1) +%endrep + + ;; ARK +%assign i 0 + vmovdqa xkeytmp, [%%p_keys + (0 * 16)] +%rep %%by + vpxor CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep + + ;; AESDEC rounds +%assign round 1 +%rep %%num_rounds + vmovdqa xkeytmp, [%%p_keys + (round * 16)] +%assign i 0 +%rep %%by + vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep +%assign round (round + 1) +%endrep ;; round + + ;; AESDEC last +%assign i 0 + vmovdqa xkeytmp, [%%p_keys + (round * 16)] +%rep %%by + vaesdeclast CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep + + ;; XOR IV + vpxor xdata0, xdata0, [rsp + _IV] +%assign i 1 +%assign j 0 +%if (%%by > 1) +%rep (%%by - 1) + vpxor CONCAT(xdata,i), CONCAT(xdata,i), CONCAT(xiv,j) +%assign i (i + 1) +%assign j (j + 1) +%endrep +%endif + +%if is_1_to_7_short_or_8_last == 0 + ;; prepare IV for the next round + vmovdqa xkeytmp, [rsp + _IV_new] + vmovdqa [rsp + _IV], xkeytmp +%endif + + ;; store plain text blocks + + ;; - do only (%%by - 1) stores first +%assign i 0 +%rep %%by - 1 + vmovdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%assign i (i + 1) +%endrep + +%if %%by < 8 + ;; 1 to 7 block case: +%ifidni %%type, start + ;; - check if message length is more than %%by blocks + ;; yes: load 1st block for the next round and then store the last block of this round + ;; no: store the last block of this round + + cmp %%length, %%by * 16 + jbe %%_just_finish_stores + ;; load 1st block of data in the next round + vmovdqu xkeytmp, [%%p_in + (%%by * 16)] + vmovdqu [%%p_out + (i * 16)], CONCAT(xdata,i) + vmovdqa xdata0, xkeytmp + jmp %%_update_pointers + +%%_just_finish_stores: + vmovdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif + +%ifidni %%type, short + ;; short message - just store + vmovdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif + +%else + ;; 8 block case + ;; - two cases: main (main 8 block loop) and last (last 8 blocks) + +%ifidni %%type, main + ;; - MAIN: load 1st block for the next round and then store 8 blocks of this round + vmovdqu xdata0, [%%p_in + (%%by * 16)] + vmovdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif + +%ifidni %%type, last + ;; LAST: store all 8 blocks + vmovdqu [%%p_out + (i * 16)], CONCAT(xdata,i) +%endif +%endif ;; %%by + +%%_update_pointers: + +%if is_1_to_7_short_or_8_last == 0 + add %%p_in, (16 * %%by) + add %%p_out, (16 * %%by) + + sub %%length, %%by * 16 + ;; Z-Flag gets updated + ;; - ZF means this is the end of the message +%endif + +%endmacro + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%macro AES_CBC_DEC 7 +%define %%p_in %1 ;; [in/out] gp register; cipher text pointer +%define %%p_IV %2 ;; [in] gp register; IV pointer +%define %%p_keys %3 ;; [in] gp register; expanded keys pointer +%define %%p_out %4 ;; [in/out] gp registerl plain text pointer +%define %%length %5 ;; [in/clobbered] gp register; message length in bytes +%define %%tmp %6 ;; [clobbered] gp register +%define %%num_rounds %7 ;; [in] numeric value; number of AES rounds (excluding ARK and last round) + + mov %%tmp, rsp + sub rsp, STACK_size + and rsp, -16 + mov [rsp + _rsp_save], %%tmp + + ;; load IV and put it on the stack frame + vmovdqu xmm0, [%%p_IV] + vmovdqa [rsp + _IV], xmm0 + + cmp %%length, 8 * 16 + jae %%_longer_than_8_blocks + + ;; process 1 to 7 blocks first + mov DWORD(%%tmp), DWORD(%%length) + shr DWORD(%%tmp), 4 + and DWORD(%%tmp), 7 + + ;; 1 <= %%tmp <= 7 + cmp DWORD(%%tmp), 4 + ja %%_sgt4 + je %%_seq4 +%%_slt4: + cmp DWORD(%%tmp), 2 + ja %%_seq3 + je %%_seq2 +%%_seq1: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 1, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq2: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 2, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq3: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 3, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq4: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 4, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_sgt4: + cmp DWORD(%%tmp), 6 + ja %%_seq7 + je %%_seq6 +%%_seq5: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 5, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq6: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 6, %%num_rounds, %%length, short + jmp %%_do_return + +align 32 +%%_seq7: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 7, %%num_rounds, %%length, short + jmp %%_do_return + + ;; ===================================================================== + ;; message longer than 8 blocks + +align 32 +%%_longer_than_8_blocks: + ;; process 1 to 7 blocks first + mov DWORD(%%tmp), DWORD(%%length) + shr DWORD(%%tmp), 4 + and DWORD(%%tmp), 7 + jz %%_eq0 + + ;; 1 <= %%tmp <= 7 + cmp DWORD(%%tmp), 4 + ja %%_gt4 + je %%_eq4 +%%_lt4: + cmp DWORD(%%tmp), 2 + ja %%_eq3 + je %%_eq2 +%%_eq1: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 1, %%num_rounds, %%length, start + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq2: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 2, %%num_rounds, %%length, start + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq3: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 3, %%num_rounds, %%length, start + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq4: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 4, %%num_rounds, %%length, start + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_gt4: + cmp DWORD(%%tmp), 6 + ja %%_eq7 + je %%_eq6 +%%_eq5: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 5, %%num_rounds, %%length, start + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq6: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 6, %%num_rounds, %%length, start + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq7: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 7, %%num_rounds, %%length, start + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq0: + vmovdqu xdata0, [%%p_in] + +align 32 +%%_main_loop: + cmp %%length, 2 * (8 * 16) + jb %%_the_last_8_blocks + ;; %%length is a multiple of 8 blocks (length = N x 8 x 16-bytes, where N = 2, 3, ..) + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 8, %%num_rounds, %%length, main + jmp %%_main_loop + +align 32 +%%_the_last_8_blocks: + ;; %%length is 8 blocks (8 x 16-bytes) + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 8, %%num_rounds, %%length, last + +align 32 +%%_do_return: +%ifdef SAFE_DATA + clear_xmms_avx xdata0, xdata1, xdata2, xdata3, xdata4, xdata5, xdata6, xdata7, xkeytmp +%endif ;; SAFE_DATA + + ;; restore the stack pointer + ;; - IV is cipher text, no need to clear it from the stack + mov rsp, [rsp + _rsp_save] +%endmacro diff --git a/lib/include/aes_cbcs_dec_by8_avx.inc b/lib/include/aes_cbcs_dec_by8_avx.inc new file mode 100644 index 00000000..d09f1d27 --- /dev/null +++ b/lib/include/aes_cbcs_dec_by8_avx.inc @@ -0,0 +1,275 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +;; macro to do a AES-CBCS decryption +;; - single-buffer implementation +;; - 8 blocks at a time + +%use smartalign + +%include "include/os.inc" +%include "include/mb_mgr_datastruct.inc" +%include "include/clear_regs.inc" +%include "include/reg_sizes.inc" + +%define CONCAT(a,b) a %+ b + +%define xdata0 xmm0 +%define xdata1 xmm1 +%define xdata2 xmm2 +%define xdata3 xmm3 +%define xdata4 xmm4 +%define xdata5 xmm5 +%define xdata6 xmm6 +%define xdata7 xmm7 + +%define xiv0 xmm8 +%define xiv1 xmm9 +%define xiv2 xmm10 +%define xiv3 xmm11 +%define xiv4 xmm12 +%define xiv5 xmm13 +%define xiv6 xmm14 + +%define xkeytmp xmm15 + +struc STACK +_IV: resq 2 +_IV_new: resq 2 +_rdx: resq 1 +_rsp_save: resq 1 +endstruc + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DO_AES_DEC num_in_par load_keys +;; - it increments p_in and p_out +;; - ZF (zero-flag) gets updated +;; - ZF means this is the end of the message + +%macro DO_AES_DEC 7 +%define %%p_in %1 ;; [in/out] GP register with input pointer +%define %%p_out %2 ;; [in/out] GP register with output pointer +%define %%p_keys %3 ;; [in] GP register with pointer to AES round keys +%define %%by %4 ;; [in] numeric value; number of blocks to process (1 to 8) +%define %%num_rounds %5 ;; [in] numeric - number fo aesdec rounds (ark / declast not included) +%define %%length %6 ;; [in/out] GP register with message length (in blocks) +%define %%step %7 ;; [in] numeric value; distance to next block for decrypt (16 default) + + + ;; load cipher text +%assign i 0 +%rep %%by + vmovdqu CONCAT(xdata,i), [%%p_in + (i * %%step)] +%if i == (%%by - 1) + vmovdqa [rsp + _IV_new], CONCAT(xdata,i) +%else + vmovdqa CONCAT(xiv,i), CONCAT(xdata,i) +%endif +%assign i (i + 1) +%endrep + + ;; ARK +%assign i 0 + vmovdqa xkeytmp, [%%p_keys + (0 * 16)] +%rep %%by + vpxor CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep + + ;; AESDEC rounds +%assign round 1 +%rep %%num_rounds + vmovdqa xkeytmp, [%%p_keys + (round * 16)] +%assign i 0 +%rep %%by + vaesdec CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep +%assign round (round + 1) +%endrep ;; round + + ;; AESDEC last +%assign i 0 + vmovdqa xkeytmp, [%%p_keys + (round * 16)] +%rep %%by + vaesdeclast CONCAT(xdata,i), CONCAT(xdata,i), xkeytmp +%assign i (i + 1) +%endrep + + ;; XOR IV + vpxor xdata0, xdata0, [rsp + _IV] +%assign i 1 +%assign j 0 +%if (%%by > 1) +%rep (%%by - 1) + vpxor CONCAT(xdata,i), CONCAT(xdata,i), CONCAT(xiv,j) +%assign i (i + 1) +%assign j (j + 1) +%endrep +%endif + + ;; prepare IV for the next round + vmovdqa xkeytmp, [rsp + _IV_new] + vmovdqa [rsp + _IV], xkeytmp + + ;; store plain text blocks +%assign i 0 +%rep %%by + vmovdqu [%%p_out + (i * %%step)], CONCAT(xdata,i) +%assign i (i + 1) +%endrep + + ;; update pointers + add %%p_in, (%%step * %%by) + add %%p_out, (%%step * %%by) + + sub %%length, %%by + ;; Z-Flag gets updated + ;; - ZF means this is the end of the message + +%endmacro + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%macro AES_CBCS_DEC 9 +%define %%p_in %1 ;; [in/out] gp register; cipher text pointer +%define %%p_IV %2 ;; [in] gp register; IV pointer +%define %%p_keys %3 ;; [in] gp register; expanded keys pointer +%define %%p_out %4 ;; [in/out] gp registerl plain text pointer +%define %%length %5 ;; [in/clobbered] gp register; message length in bytes +%define %%tmp %6 ;; [clobbered] gp register +%define %%num_rounds %7 ;; [in] numeric value; number of AES rounds (excluding ARK and last round) +%define %%step %8 ;; [in] numeric value; distance to next block for decrypt (16 default) +%define %%p_next_IV %9 ;; [in/out] GP register; pointer to store next IV (used only if %%step > 16) + + mov %%tmp, rsp + sub rsp, STACK_size + and rsp, -16 + mov [rsp + _rsp_save], %%tmp + + ;; load IV and put it on the stack frame + vmovdqu xmm0, [%%p_IV] + vmovdqa [rsp + _IV], xmm0 + + ;; convert length into number of blocks + mov [rsp + _rdx], rdx + xor rdx, rdx +%ifdef LINUX + lea rax, [%%length + (%%step - 16)] ;; round up the length +%else + ;; %%length is RAX + add rax, (%%step - 16) ;; round up the length +%endif + mov DWORD(%%tmp), %%step + div %%tmp + ;; %%length = RAX = length in AES blocks +%ifdef LINUX + mov %%length, rax +%else + ;; %%length is RAX +%endif + mov rdx, [rsp + _rdx] + + ;; process 1 to 7 blocks first + mov %%tmp, %%length + and DWORD(%%tmp), 7 + jz %%_main_loop + + ;; 1 <= %%tmp <= 7 + cmp DWORD(%%tmp), 4 + ja %%_gt4 + je %%_eq4 +%%_lt4: + cmp DWORD(%%tmp), 2 + ja %%_eq3 + je %%_eq2 +%%_eq1: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 1, %%num_rounds, %%length, %%step + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq2: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 2, %%num_rounds, %%length, %%step + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq3: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 3, %%num_rounds, %%length, %%step + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq4: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 4, %%num_rounds, %%length, %%step + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_gt4: + cmp DWORD(%%tmp), 6 + ja %%_eq7 + je %%_eq6 +%%_eq5: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 5, %%num_rounds, %%length, %%step + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq6: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 6, %%num_rounds, %%length, %%step + jz %%_do_return + jmp %%_main_loop + +align 32 +%%_eq7: + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 7, %%num_rounds, %%length, %%step + jz %%_do_return + +align 32 +%%_main_loop: + ;; %%length is a multiple of 8 blocks + DO_AES_DEC %%p_in, %%p_out, %%p_keys, 8, %%num_rounds, %%length, %%step + jnz %%_main_loop + +align 32 +%%_do_return: + vmovdqa xdata0, [rsp + _IV] + vmovdqa [%%p_next_IV], xdata0 + +%ifdef SAFE_DATA + clear_xmms_avx xdata0, xdata1, xdata2, xdata3, xdata4, xdata5, xdata6, xdata7, xkeytmp +%endif ;; SAFE_DATA + + ;; restore the stack pointer + ;; - IV is cipher text, no need to clear it from the stack + mov rsp, [rsp + _rsp_save] + +%endmacro -- GitLab From badee40ba2bf1d47e90ffad5e6c58601b2f2d68d Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Fri, 23 Jun 2023 11:05:55 +0100 Subject: [PATCH 020/204] test: [AES] Remove unsupported 192-bit key test --- test/kat-app/aes_test.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/kat-app/aes_test.c b/test/kat-app/aes_test.c index e60bb0c7..f327c894 100644 --- a/test/kat-app/aes_test.c +++ b/test/kat-app/aes_test.c @@ -1414,7 +1414,6 @@ check_burst_jobs: static void test_aes_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, - struct test_suite_context *ctx192, struct test_suite_context *ctx256, const int vec_cnt, const struct aes_vector *vec_tab, const char *banner, @@ -1445,11 +1444,6 @@ test_aes_vectors(struct IMB_MGR *mb_mgr, dec_keys); ctx = ctx128; break; - case 24: - IMB_AES_KEYEXP_192(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); - ctx = ctx192; - break; case 32: default: IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].K, enc_keys, @@ -1817,13 +1811,12 @@ aes_test(struct IMB_MGR *mb_mgr) unsigned i; int errors = 0; struct test_suite_context ctx128; - struct test_suite_context ctx192; struct test_suite_context ctx256; test_suite_start(&ctx128, "DOCSIS-SEC-128"); test_suite_start(&ctx256, "DOCSIS-SEC-256"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_aes_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, + test_aes_vectors(mb_mgr, &ctx128, &ctx256, DIM(docsis_vectors), docsis_vectors, "AES-DOCSIS standard test vectors", -- GitLab From 2d4551cf9fcdf3b8422c10581c9c9ad1439637c4 Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Thu, 22 Jun 2023 16:36:30 +0100 Subject: [PATCH 021/204] test: [ECB] Unify test vectors --- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 2 +- test/kat-app/ecb_test.c | 619 ++--------------------------------- test/kat-app/ecb_test.json.c | 265 +++++++++++++++ test/kat-app/win_x64.mak | 2 +- 5 files changed, 303 insertions(+), 586 deletions(-) create mode 100644 test/kat-app/ecb_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 16b8d5f5..3c445a8b 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -103,6 +103,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cfb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/ctr_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/ecb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index a5f769eb..a0b7d85f 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -41,7 +41,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ - aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c + aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c ecb_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/ecb_test.c b/test/kat-app/ecb_test.c index bf516026..2c0a1d2d 100644 --- a/test/kat-app/ecb_test.c +++ b/test/kat-app/ecb_test.c @@ -33,551 +33,12 @@ #include -#include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "cipher_test.h" int ecb_test(struct IMB_MGR *mb_mgr); -struct ecb_vector { - const uint8_t *K; /* key */ - const uint8_t *P; /* plain text */ - uint64_t Plen; /* plain text length */ - const uint8_t *C; /* cipher text - same length as plain text */ - uint32_t Klen; /* key length */ -}; - -/* 128-bit */ -static const uint8_t K1[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t P1[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t C1[] = { - 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60, - 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97, - 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d, - 0xe7, 0x85, 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf, - 0x43, 0xb1, 0xcd, 0x7f, 0x59, 0x8e, 0xce, 0x23, - 0x88, 0x1b, 0x00, 0xe3, 0xed, 0x03, 0x06, 0x88, - 0x7b, 0x0c, 0x78, 0x5e, 0x27, 0xe8, 0xad, 0x3f, - 0x82, 0x23, 0x20, 0x71, 0x04, 0x72, 0x5d, 0xd4 -}; - -/* 192-bit */ -static const uint8_t K2[] = { - 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, - 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, - 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b -}; -static const uint8_t P2[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t C2[] = { - 0xbd, 0x33, 0x4f, 0x1d, 0x6e, 0x45, 0xf2, 0x5f, - 0xf7, 0x12, 0xa2, 0x14, 0x57, 0x1f, 0xa5, 0xcc, - 0x97, 0x41, 0x04, 0x84, 0x6d, 0x0a, 0xd3, 0xad, - 0x77, 0x34, 0xec, 0xb3, 0xec, 0xee, 0x4e, 0xef, - 0xef, 0x7a, 0xfd, 0x22, 0x70, 0xe2, 0xe6, 0x0a, - 0xdc, 0xe0, 0xba, 0x2f, 0xac, 0xe6, 0x44, 0x4e, - 0x9a, 0x4b, 0x41, 0xba, 0x73, 0x8d, 0x6c, 0x72, - 0xfb, 0x16, 0x69, 0x16, 0x03, 0xc1, 0x8e, 0x0e -}; - -/* 256-bit */ -static const uint8_t K3[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; -static const uint8_t P3[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t C3[] = { - 0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c, - 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8, - 0x59, 0x1c, 0xcb, 0x10, 0xd4, 0x10, 0xed, 0x26, - 0xdc, 0x5b, 0xa7, 0x4a, 0x31, 0x36, 0x28, 0x70, - 0xb6, 0xed, 0x21, 0xb9, 0x9c, 0xa6, 0xf4, 0xf9, - 0xf1, 0x53, 0xe7, 0xb1, 0xbe, 0xaf, 0xed, 0x1d, - 0x23, 0x30, 0x4b, 0x7a, 0x39, 0xf9, 0xf3, 0xff, - 0x06, 0x7d, 0x8d, 0x8f, 0x9e, 0x24, 0xec, 0xc7 -}; - - -/* Extra AES test vectors */ - -/* 128-bit */ -static const uint8_t K4[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t P4[] = { - 0xf7, 0xcd, 0x12, 0xfb, 0x4f, 0x8e, 0x50, 0xab, - 0x35, 0x8e, 0x56, 0xf9, 0x83, 0x53, 0x9a, 0x1a, - 0xfc, 0x47, 0x3c, 0x96, 0x01, 0xfe, 0x01, 0x87, - 0xd5, 0xde, 0x46, 0x24, 0x5c, 0x62, 0x8f, 0xba, - 0xba, 0x91, 0x17, 0x8d, 0xba, 0x5a, 0x79, 0xb1, - 0x57, 0x05, 0x4d, 0x08, 0xba, 0x1f, 0x30, 0xd3, - 0x80, 0x40, 0xe9, 0x37, 0xb0, 0xd6, 0x34, 0x87, - 0x33, 0xdd, 0xc0, 0x5b, 0x2d, 0x58, 0x1d, 0x2a, - 0x7b, 0xb6, 0xe3, 0xd0, 0xc8, 0xa0, 0x7a, 0x69, - 0xc8, 0x5d, 0x10, 0xa2, 0xc3, 0x39, 0xca, 0xaf, - 0x40, 0xdc, 0xc7, 0xcb, 0xff, 0x18, 0x7d, 0x51, - 0x06, 0x28, 0x28, 0x1f, 0x3a, 0x9c, 0x18, 0x7d, - 0x5b, 0xb5, 0xe9, 0x20, 0xc2, 0xae, 0x17, 0x7f, - 0xd1, 0x65, 0x7a, 0x75, 0xcf, 0x21, 0xa0, 0x1e, - 0x17, 0x1b, 0xf7, 0xe8, 0x62, 0x5f, 0xaf, 0x34, - 0x7f, 0xd8, 0x18, 0x4a, 0x94, 0xf2, 0x33, 0x90 -}; -static const uint8_t C4[] = { - 0x48, 0xa0, 0xe8, 0x0a, 0x89, 0x99, 0xab, 0xb5, - 0x66, 0x6d, 0x68, 0x23, 0x43, 0x40, 0x1f, 0x26, - 0xac, 0x52, 0xc4, 0x7b, 0x09, 0x0a, 0x8f, 0xc0, - 0x38, 0x00, 0xf5, 0x48, 0x3a, 0xfd, 0xcd, 0x7e, - 0x21, 0xe7, 0xf8, 0xf6, 0xc2, 0xa7, 0x4c, 0x1c, - 0x6e, 0x83, 0x57, 0xf4, 0xa4, 0xb0, 0xc0, 0x5f, - 0x36, 0x73, 0x22, 0xff, 0x33, 0x44, 0xab, 0xeb, - 0x96, 0xa8, 0xe0, 0x37, 0x65, 0x81, 0x6b, 0x82, - 0x89, 0xcd, 0xcc, 0xac, 0x33, 0x18, 0x7d, 0x43, - 0x0e, 0x79, 0x53, 0x30, 0x21, 0x4c, 0x95, 0x18, - 0xb6, 0xc9, 0xea, 0x5c, 0x6f, 0xa1, 0x10, 0xa3, - 0x51, 0x0e, 0x67, 0x8c, 0x1c, 0x9d, 0xf1, 0x57, - 0xeb, 0xf6, 0xad, 0x4f, 0xf2, 0x55, 0xe8, 0x11, - 0x6f, 0xaa, 0x4d, 0xe5, 0x18, 0x3d, 0xc3, 0x14, - 0xf9, 0x40, 0xfa, 0x86, 0x9d, 0xaf, 0xff, 0xfc, - 0x78, 0xba, 0xbe, 0x61, 0xf8, 0xd1, 0x00, 0x8d -}; - -/* 192-bit */ -static const uint8_t K5[] = { - 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, - 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, - 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b -}; -static const uint8_t P5[] = { - 0x19, 0x08, 0xa3, 0x58, 0x17, 0x14, 0x70, 0x5a, - 0xb8, 0xab, 0x4f, 0x5f, 0xa4, 0x25, 0x2b, 0xec, - 0xb6, 0x74, 0x0b, 0x9d, 0x56, 0x3b, 0xaf, 0xa3, - 0xa4, 0x2d, 0x3e, 0x1f, 0x18, 0x84, 0x3b, 0x4f, - 0x48, 0xd9, 0xa3, 0xfe, 0x59, 0x1e, 0x80, 0x67, - 0x44, 0x35, 0x26, 0x00, 0x78, 0xda, 0x68, 0xfa, - 0x61, 0x9c, 0xd8, 0x8e, 0x5c, 0xc1, 0xff, 0xeb, - 0x9c, 0x7d, 0xe7, 0xa9, 0x38, 0xeb, 0x66, 0xf8, - 0x6a, 0x46, 0x71, 0x51, 0x02, 0xba, 0x8d, 0x70, - 0x55, 0x5b, 0x60, 0xc6, 0x4c, 0xae, 0xda, 0x2e, - 0x17, 0xbb, 0x65, 0xef, 0x60, 0x85, 0x9e, 0x77, - 0xe5, 0x83, 0xef, 0x30, 0x08, 0x3a, 0xba, 0x80, - 0x28, 0xc0, 0xa1, 0x93, 0x4c, 0x2a, 0x0b, 0xe1, - 0xcb, 0xd0, 0xac, 0x72, 0x72, 0x1d, 0x96, 0x76, - 0x0e, 0xc0, 0xec, 0x7d, 0x84, 0xfd, 0xee, 0x08, - 0xa1, 0x11, 0x20, 0x0d, 0x59, 0x5c, 0x06, 0x3f, - 0xa3, 0xf1, 0xd7, 0xa3, 0x1d, 0x29, 0xc3, 0xaa, - 0x05, 0x2b, 0x74, 0x8c, 0x73, 0x60, 0x65, 0x43, - 0x76, 0xd4, 0xd7, 0x7b, 0x5f, 0x40, 0xf4, 0x77, - 0xe1, 0xcc, 0x85, 0x37, 0x1c, 0xd8, 0xda, 0x91, - 0xf0, 0x40, 0xb2, 0x43, 0x2d, 0x87, 0x51, 0xd0, - 0xce, 0x27, 0xa6, 0x60, 0xac, 0x67, 0xea, 0x8b, - 0xae, 0x46, 0x2e, 0x78, 0x06, 0x09, 0x8a, 0x82, - 0xb0, 0x0d, 0x57, 0x56, 0x82, 0xfe, 0x89, 0xd2 -}; -static const uint8_t C5[] = { - 0xcc, 0xe2, 0x3f, 0xc3, 0x12, 0x41, 0x31, 0x63, - 0x03, 0x3a, 0x3c, 0xfe, 0x76, 0x55, 0xd2, 0x26, - 0xf0, 0xc9, 0xb5, 0xc6, 0xf0, 0x1e, 0xc3, 0x72, - 0xfb, 0x64, 0x94, 0x7d, 0xf1, 0x5e, 0x2a, 0x9e, - 0x0d, 0x9a, 0x7a, 0xe0, 0xbc, 0x7b, 0xa6, 0x65, - 0x41, 0xc0, 0xa0, 0x9d, 0xb1, 0xb1, 0x09, 0x99, - 0x6e, 0xe7, 0x25, 0x5e, 0x64, 0x2b, 0x74, 0xfa, - 0xa1, 0x9a, 0x03, 0x33, 0x88, 0x81, 0x27, 0x48, - 0xdd, 0x53, 0x77, 0x0b, 0xef, 0xd9, 0x2f, 0xfa, - 0xc8, 0x50, 0x0e, 0x08, 0xa1, 0x45, 0x12, 0x82, - 0x2b, 0xfb, 0x85, 0x5a, 0x39, 0x8c, 0x71, 0x32, - 0x59, 0x27, 0x37, 0x53, 0xce, 0x3e, 0xae, 0x00, - 0x45, 0x53, 0xfd, 0xaf, 0xa5, 0xd1, 0x1a, 0xe9, - 0xa4, 0x1b, 0xe3, 0x99, 0xde, 0xcd, 0x03, 0x36, - 0x6b, 0x72, 0x43, 0x76, 0x04, 0xa8, 0xf9, 0x83, - 0xef, 0x9e, 0x57, 0x75, 0x36, 0x0e, 0x99, 0xe1, - 0x79, 0x2b, 0x2b, 0x96, 0x01, 0x10, 0xb8, 0xf6, - 0x4a, 0xa6, 0x13, 0xab, 0x7f, 0x55, 0x60, 0xf0, - 0xc9, 0x5c, 0x81, 0xa7, 0x96, 0x99, 0xb4, 0x55, - 0x41, 0x48, 0xf1, 0xd4, 0xa1, 0xb4, 0x76, 0xb5, - 0x35, 0xe1, 0x02, 0x8e, 0x09, 0xb2, 0x6c, 0x11, - 0x3f, 0xfb, 0x04, 0x47, 0x98, 0xab, 0x9b, 0x55, - 0xc3, 0xa9, 0x2a, 0x64, 0x32, 0x5a, 0x69, 0x96, - 0x28, 0x8c, 0x5b, 0xe3, 0xb2, 0x60, 0x82, 0xec -}; - -/* 256-bit */ -static const uint8_t K6[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; -static const uint8_t P6[] = { - 0x0b, 0xe5, 0x48, 0xa6, 0xa1, 0xbc, 0xac, 0x81, - 0x80, 0x06, 0x5f, 0xae, 0x1e, 0x3f, 0x55, 0x73, - 0x6d, 0x36, 0x7f, 0x57, 0x3d, 0xa4, 0x4a, 0x6b, - 0xb6, 0x65, 0x2f, 0xb7, 0xe8, 0x85, 0x47, 0xe2, - 0x41, 0x42, 0xc2, 0x4e, 0x58, 0xf1, 0xde, 0x42, - 0x9f, 0x15, 0x4c, 0xaf, 0xea, 0x04, 0x20, 0xd0, - 0x1a, 0x19, 0x36, 0x74, 0x71, 0x12, 0x72, 0x1b, - 0xdb, 0x18, 0xf9, 0x0b, 0xb3, 0xf3, 0x63, 0xd4, - 0x62, 0x52, 0x8b, 0x63, 0x0f, 0x6b, 0x4d, 0xb9, - 0x70, 0xd6, 0x91, 0xa0, 0x43, 0x3f, 0x46, 0xfe, - 0x43, 0xbb, 0xb8, 0xdc, 0x5e, 0xdb, 0xd4, 0x1f, - 0xf0, 0x17, 0x94, 0x25, 0xee, 0x55, 0x67, 0xbf, - 0x4d, 0xda, 0x9d, 0xe7, 0x4b, 0xc6, 0x7a, 0xcf, - 0x8f, 0xd7, 0xbb, 0x29, 0x6e, 0x26, 0xd4, 0xc3, - 0x08, 0x9b, 0x67, 0x15, 0xe9, 0x2d, 0x9f, 0x2d, - 0x3c, 0x76, 0x26, 0xd3, 0xda, 0xfe, 0x6e, 0x73, - 0x9d, 0x09, 0x60, 0x4b, 0x35, 0x60, 0xdb, 0x77, - 0xb6, 0xc0, 0x45, 0x91, 0xf9, 0x14, 0x8a, 0x7a, - 0xdd, 0xe2, 0xf1, 0xdf, 0x8f, 0x12, 0x4f, 0xd7, - 0x75, 0xd6, 0x9a, 0x17, 0xda, 0x76, 0x88, 0xf0, - 0xfa, 0x44, 0x27, 0xbe, 0x61, 0xaf, 0x55, 0x9f, - 0xc7, 0xf0, 0x76, 0x77, 0xde, 0xca, 0xd1, 0x47, - 0x51, 0x55, 0xb1, 0xbf, 0xfa, 0x1e, 0xca, 0x28, - 0x17, 0x70, 0xf3, 0xb5, 0xd4, 0x32, 0x47, 0x04, - 0xe0, 0x92, 0xd8, 0xa5, 0x03, 0x69, 0x46, 0x99, - 0x7f, 0x1e, 0x3f, 0xb2, 0x93, 0x36, 0xa3, 0x88, - 0x75, 0x07, 0x68, 0xb8, 0x33, 0xce, 0x17, 0x3f, - 0x5c, 0xb7, 0x1e, 0x93, 0x38, 0xc5, 0x1d, 0x79, - 0x86, 0x7c, 0x9d, 0x9e, 0x2f, 0x69, 0x38, 0x0f, - 0x97, 0x5c, 0x67, 0xbf, 0xa0, 0x8d, 0x37, 0x0b, - 0xd3, 0xb1, 0x04, 0x87, 0x1d, 0x74, 0xfe, 0x30, - 0xfb, 0xd0, 0x22, 0x92, 0xf9, 0xf3, 0x23, 0xc9 -}; -static const uint8_t C6[] = { - 0x4b, 0xc0, 0x1f, 0x80, 0xf5, 0xc7, 0xe8, 0xf5, - 0xc9, 0xd0, 0x3c, 0x86, 0x50, 0x78, 0x21, 0xce, - 0x01, 0xec, 0x91, 0x00, 0xc9, 0xf8, 0x73, 0x43, - 0x2f, 0x73, 0x8a, 0x6d, 0xee, 0xed, 0x2d, 0x40, - 0x17, 0x16, 0x93, 0x15, 0xac, 0xed, 0x28, 0x61, - 0xb0, 0x0f, 0xa2, 0xe1, 0xd3, 0x80, 0x51, 0xdf, - 0x73, 0xce, 0x48, 0x4c, 0x1c, 0xc1, 0x8b, 0xc9, - 0x9e, 0x5c, 0x48, 0x07, 0xa0, 0xf6, 0x29, 0xf8, - 0x63, 0x87, 0xe4, 0xe7, 0x8b, 0xf8, 0xcf, 0x58, - 0xda, 0x57, 0x62, 0x11, 0x2e, 0x6e, 0x91, 0x7e, - 0xc7, 0x73, 0xdb, 0x27, 0x3c, 0x64, 0x72, 0x52, - 0xe3, 0x27, 0x84, 0x1f, 0x73, 0x3f, 0xf4, 0x94, - 0xd2, 0xdd, 0x93, 0x33, 0x65, 0x91, 0x98, 0x89, - 0x13, 0xa9, 0x2b, 0x0d, 0x6f, 0x56, 0x51, 0x15, - 0x07, 0xc6, 0xa7, 0x36, 0x8f, 0x0c, 0xd6, 0xc2, - 0x07, 0x06, 0x65, 0x7a, 0xf8, 0x94, 0xa6, 0x75, - 0x48, 0x4c, 0xcc, 0xa5, 0xa9, 0x91, 0x04, 0x2f, - 0x7b, 0x89, 0x46, 0xd2, 0x87, 0xcb, 0xd6, 0x1b, - 0xf3, 0x1e, 0xa7, 0xe5, 0x09, 0xcf, 0x75, 0x05, - 0x9f, 0xc9, 0xac, 0xcc, 0x61, 0x15, 0x2d, 0x2e, - 0x2c, 0x0a, 0x57, 0x4d, 0x33, 0x17, 0x6b, 0x22, - 0x9e, 0x92, 0xc5, 0x81, 0xce, 0x9d, 0x52, 0x68, - 0x7d, 0x98, 0xe1, 0x23, 0x70, 0xc5, 0x19, 0x3e, - 0x91, 0xfc, 0xc6, 0xd7, 0x67, 0x5f, 0xbb, 0x57, - 0x20, 0x96, 0x3f, 0x1f, 0x9f, 0x64, 0xe9, 0xb1, - 0x51, 0xfd, 0x8c, 0xc1, 0x0f, 0x50, 0xbe, 0x43, - 0x5f, 0x90, 0xb4, 0xd1, 0xb6, 0x41, 0x7c, 0x37, - 0x92, 0x71, 0xda, 0x9d, 0xfd, 0xee, 0x69, 0x8c, - 0x24, 0x18, 0xe8, 0x81, 0x60, 0xe2, 0x89, 0x33, - 0x42, 0xd4, 0x1b, 0x6a, 0xcb, 0x4a, 0x5b, 0x00, - 0x01, 0x4f, 0x11, 0x47, 0x0f, 0x57, 0xb0, 0x90, - 0xf0, 0xed, 0xb0, 0x34, 0x2e, 0x9f, 0x81, 0x6c -}; - -/* 128-bit */ -static const uint8_t K7[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t P7[] = { - 0xdd, 0x14, 0xde, 0x30, 0xe0, 0xfd, 0x7b, 0x2a, - 0x94, 0x8e, 0x28, 0xa0, 0xf6, 0x93, 0x6e, 0xf5, - 0x92, 0x65, 0x1d, 0x5e, 0x78, 0x2a, 0x9d, 0x39, - 0xfc, 0xb8, 0x6d, 0x8b, 0xa5, 0xf4, 0x4b, 0x21, - 0xdd, 0x4e, 0xe9, 0xeb, 0xd7, 0xa7, 0xa1, 0x59, - 0xdc, 0x4c, 0x5e, 0xcc, 0x83, 0xab, 0xd3, 0x45, - 0xfe, 0x2c, 0x73, 0x23, 0xea, 0x45, 0xcb, 0x0c, - 0x12, 0x67, 0x28, 0xcd, 0xef, 0x4e, 0xca, 0xe2, - 0x1d, 0x92, 0x82, 0xd8, 0x0f, 0xa9, 0x36, 0x23, - 0x6d, 0x38, 0x68, 0xac, 0xa0, 0xeb, 0xdc, 0xcc, - 0xdf, 0xb8, 0x3a, 0x53, 0x04, 0x1a, 0x55, 0x27, - 0x8e, 0x22, 0x86, 0x8c, 0xbd, 0xdc, 0x6b, 0x12, - 0x9c, 0x69, 0xd2, 0x7a, 0x4b, 0x52, 0x5d, 0x76, - 0x34, 0xb9, 0x5e, 0x30, 0x0a, 0x8d, 0x1e, 0xf1, - 0x27, 0xda, 0x5b, 0xb9, 0x5e, 0xbf, 0x65, 0x34, - 0x00, 0xb6, 0xd2, 0xb0, 0x89, 0x12, 0xb6, 0x35, - 0xae, 0x27, 0x7f, 0x11, 0xe9, 0xf9, 0x1c, 0x71, - 0xc9, 0x50, 0xfe, 0xd4, 0x76, 0x50, 0x95, 0xf7, - 0xe1, 0x1c, 0x14, 0xcd, 0x67, 0x0f, 0xf0, 0x6d, - 0xa2, 0x93, 0x7b, 0x2c, 0x8d, 0x83, 0x5c, 0xff, - 0xe4, 0x95, 0xf3, 0xa1, 0xfd, 0x00, 0x77, 0x68, - 0x41, 0xb4, 0xfb, 0x81, 0xf4, 0x61, 0x1a, 0x84, - 0x5a, 0x53, 0xc3, 0xdc, 0xba, 0x0d, 0x67, 0x2e, - 0xcf, 0xf2, 0x30, 0xf5, 0x1d, 0xe9, 0xc4, 0x2c, - 0xac, 0x1f, 0xa7, 0x9c, 0x64, 0xfd, 0x45, 0x30, - 0x1b, 0xa1, 0x3b, 0x3d, 0xc7, 0xf5, 0xf9, 0xbb, - 0xba, 0x99, 0xa4, 0x12, 0x6e, 0x4e, 0xea, 0x0b, - 0x29, 0x7f, 0xcd, 0x84, 0x64, 0x50, 0x40, 0xb7, - 0x6a, 0x24, 0x29, 0xa4, 0xa7, 0xa1, 0xef, 0xa9, - 0xcf, 0xdf, 0x09, 0xff, 0xaa, 0x17, 0x5d, 0x82, - 0x74, 0xf5, 0xae, 0xd0, 0xe9, 0xec, 0xad, 0x5e, - 0xa7, 0x84, 0xda, 0xe7, 0x33, 0x58, 0x7e, 0x00, - 0x45, 0x5f, 0xbb, 0x15, 0xa3, 0x65, 0x0e, 0xf5, - 0x7e, 0x27, 0xe7, 0x04, 0x52, 0x58, 0x81, 0xd0, - 0xee, 0x8f, 0xaf, 0xe2, 0x3c, 0xbe, 0x08, 0x97, - 0x8a, 0x97, 0x12, 0xb0, 0x09, 0xfe, 0xa5, 0xeb, - 0xd1, 0x9c, 0x30, 0xe8, 0x9a, 0x3f, 0xe0, 0x38, - 0x34, 0x2b, 0xad, 0xb7, 0xc4, 0xda, 0x54, 0xab, - 0x97, 0x9c, 0x46, 0x2b, 0x2c, 0x0b, 0xb3, 0x49, - 0xcd, 0x9d, 0x32, 0x38, 0x3c, 0x1a, 0x49, 0xdc, - 0x2f, 0xe7, 0xcd, 0x8a, 0xb0, 0x76, 0xcf, 0x30, - 0xea, 0x0b, 0xb0, 0xb7, 0x63, 0xed, 0xb2, 0x8c, - 0xc9, 0x2c, 0xb7, 0x75, 0xa8, 0xf6, 0x63, 0xb6, - 0xcd, 0xb5, 0x63, 0xfb, 0x5f, 0x89, 0xae, 0x3d, - 0x33, 0x73, 0xaf, 0xde, 0xcb, 0x37, 0x0a, 0x50, - 0x6f, 0xae, 0xf3, 0xa6, 0x79, 0x85, 0xdd, 0xc5, - 0x24, 0xc5, 0x29, 0x23, 0x64, 0xef, 0x43, 0xd7, - 0xc4, 0xab, 0xd8, 0xb0, 0x84, 0x26, 0x6b, 0xe8, - 0xb1, 0x5d, 0xb5, 0x69, 0xfb, 0x97, 0x0e, 0x20, - 0xb3, 0xc1, 0x60, 0xad, 0x1a, 0xd2, 0xd6, 0x3a, - 0x73, 0x08, 0xf0, 0x47, 0x5f, 0xcf, 0x15, 0xf7, - 0x7b, 0xf3, 0x69, 0x08, 0x5a, 0x6b, 0x9f, 0xc7, - 0x12, 0xa1, 0xf0, 0xfb, 0x91, 0xc9, 0x07, 0x61, - 0x21, 0xa0, 0x30, 0x4c, 0x16, 0x81, 0xcd, 0x3c, - 0x61, 0xe8, 0x96, 0x91, 0x30, 0xdd, 0x0c, 0x0e, - 0x0b, 0xa1, 0x33, 0x95, 0x67, 0x99, 0xd6, 0x1e, - 0x1a, 0xb3, 0x12, 0xfd, 0xad, 0x46, 0x48, 0x87, - 0x5e, 0xe8, 0xd4, 0xf5, 0xac, 0xdf, 0xa7, 0x37, - 0xb8, 0xa1, 0x62, 0x8c, 0xb8, 0xb6, 0xb0, 0x69, - 0x63, 0x29, 0x60, 0x64, 0x26, 0xc3, 0xf8, 0x18, - 0x8e, 0x46, 0xa0, 0xc5, 0x45, 0x5c, 0x08, 0x2a, - 0xed, 0x29, 0x84, 0x11, 0xea, 0x59, 0xc0, 0x16, - 0xe2, 0x04, 0x30, 0x63, 0x22, 0x87, 0xb6, 0xc7, - 0x81, 0xa6, 0x58, 0xc0, 0xb2, 0xb0, 0x7d, 0xbc, - 0x16, 0x44, 0x6e, 0x5d, 0x6d, 0xce, 0x2a, 0xe0, - 0x20, 0x69, 0x35, 0xa1, 0x5d, 0x17, 0x48, 0x55, - 0x88, 0xfe, 0xde, 0x34, 0xe7, 0x18, 0xbf, 0x7e, - 0x0a, 0x1c, 0x32, 0x88, 0xab, 0xde, 0xe1, 0x02, - 0x61, 0x09, 0x58, 0x96, 0xef, 0x16, 0x73, 0xac, - 0xc0, 0x5c, 0x15, 0xca, 0x9b, 0xea, 0x0e, 0x05, - 0x97, 0x88, 0x09, 0xc5, 0xd0, 0x95, 0x90, 0xae, - 0xa5, 0xb5, 0x28, 0xc6, 0x5a, 0x7b, 0xb3, 0xcc, - 0xae, 0x57, 0x71, 0x83, 0x56, 0x57, 0xca, 0xe8, - 0x8b, 0x21, 0x0c, 0x37, 0x1d, 0xde, 0x85, 0xe2, - 0x1b, 0xa2, 0x38, 0xa0, 0xc5, 0xc7, 0x98, 0x7b, - 0xf9, 0x5e, 0x6a, 0x68, 0xb3, 0xed, 0x49, 0x5e, - 0x46, 0xb9, 0xc9, 0xf6, 0x34, 0xa6, 0x0e, 0xac, - 0x90, 0x72, 0xcf, 0xf8, 0x5b, 0x48, 0x13, 0x40, - 0x7a, 0xce, 0xfd, 0x3c, 0x16, 0xff, 0xb5, 0xea, - 0xb2, 0x56, 0x47, 0xcc, 0x9f, 0xbc, 0xae, 0x4a, - 0xc8, 0xa5, 0x59, 0x57, 0x01, 0xd7, 0x9f, 0xd7, - 0xbf, 0x13, 0xb1, 0xbf, 0xb7, 0x9a, 0xa0, 0xa1, - 0xc6, 0x66, 0x61, 0x96, 0xf2, 0xcd, 0x8c, 0xcb, - 0x3c, 0x67, 0xb5, 0xed, 0xb7, 0xa2, 0x54, 0x84, - 0x3c, 0xcb, 0x7e, 0xb3, 0x97, 0x05, 0xcb, 0x8f, - 0xa9, 0xc6, 0x3c, 0xa2, 0xbd, 0xbf, 0x3a, 0xb8, - 0x92, 0x08, 0x01, 0xea, 0xfd, 0x55, 0x2f, 0x27, - 0x2a, 0x82, 0x38, 0x26, 0x1d, 0x81, 0x19, 0x33, - 0x75, 0x3c, 0xa2, 0x13, 0x1e, 0x58, 0x9f, 0x0b, - 0x08, 0x5d, 0x7a, 0x2c, 0x9a, 0xd1, 0xa5, 0x4c, - 0x41, 0xb4, 0x1d, 0xf8, 0x42, 0x08, 0x87, 0xdd, - 0x8e, 0xc9, 0x05, 0xd2, 0x8c, 0xba, 0x93, 0x28, - 0xbe, 0x4a, 0x14, 0x13, 0x2a, 0x58, 0xf0, 0x1c, - 0xac, 0xc1, 0xc4, 0x49, 0xbc, 0xe1, 0xda, 0xb6, - 0x2d, 0x06, 0x98, 0x32, 0xea, 0xa3, 0x89, 0x11, - 0xca, 0x5f, 0x3e, 0xda, 0x24, 0xe2, 0xdb, 0x1e, - 0xca, 0xf3, 0xc0, 0xc7, 0x64, 0xee, 0x4b, 0x3d, - 0xa2, 0xee, 0x69, 0xb0, 0x3f, 0x2c, 0xd5, 0x49, - 0xba, 0x2d, 0x45, 0x7d, 0xdd, 0xb0, 0x0d, 0xc5, - 0xe0, 0x57, 0x95, 0xbe, 0xf8, 0x4a, 0x11, 0x46, - 0x4c, 0xbb, 0xdf, 0xa8, 0x5a, 0xf9, 0xff, 0x0e, - 0x31, 0xa9, 0x50, 0x5d, 0xc4, 0xb3, 0x3d, 0x09, - 0x46, 0x33, 0x39, 0x31, 0xd5, 0xb3, 0xe5, 0x91, - 0xcf, 0xca, 0x8a, 0xe0, 0xc2, 0x8e, 0xea, 0xbe, - 0x54, 0x64, 0x78, 0x0c, 0x25, 0x1c, 0x17, 0xbc, - 0x49, 0xf9, 0xc0, 0x30, 0x5f, 0x08, 0x04, 0x9d, - 0xb5, 0xe4, 0xeb, 0x9e, 0xe5, 0x1e, 0x6d, 0xbc, - 0x7b, 0xe7, 0xf0, 0xd1, 0xa0, 0x01, 0x18, 0x51, - 0x4f, 0x64, 0xc3, 0x9c, 0x70, 0x25, 0x4f, 0xed, - 0xc7, 0xbc, 0x19, 0x00, 0x09, 0x22, 0x97, 0x5d, - 0x6f, 0xe4, 0x47, 0x98, 0x05, 0xcd, 0xcc, 0xde, - 0xd5, 0xe3, 0xaf, 0xa3, 0xde, 0x69, 0x99, 0x2a, - 0xd1, 0x28, 0x4d, 0x7c, 0x89, 0xa0, 0xdb, 0xae, - 0xf9, 0xf1, 0x4a, 0x46, 0xdf, 0xbe, 0x1d, 0x37, - 0xf2, 0xd5, 0x36, 0x4a, 0x54, 0xe8, 0xc4, 0xfb, - 0x57, 0x77, 0x09, 0x05, 0x31, 0x99, 0xaf, 0x9a, - 0x17, 0xd1, 0x20, 0x93, 0x31, 0x89, 0xff, 0xed, - 0x0f, 0xf8, 0xed, 0xb3, 0xcf, 0x4c, 0x9a, 0x74, - 0xbb, 0x00, 0x36, 0x41, 0xd1, 0x13, 0x68, 0x73, - 0x78, 0x63, 0x42, 0xdd, 0x99, 0x15, 0x9a, 0xf4, - 0xe1, 0xad, 0x6d, 0xf6, 0x5e, 0xca, 0x20, 0x24, - 0xd7, 0x9d, 0x2f, 0x58, 0x97, 0xf7, 0xde, 0x31, - 0x51, 0xa3, 0x1c, 0xe2, 0x66, 0x24, 0x4b, 0xa1, - 0x56, 0x02, 0x32, 0xf4, 0x89, 0xf3, 0x86, 0x9a, - 0x85, 0xda, 0x95, 0xa8, 0x7f, 0x6a, 0x77, 0x02, - 0x3a, 0xba, 0xe0, 0xbe, 0x34, 0x5c, 0x9a, 0x1a -}; -static const uint8_t C7[] = { - 0x62, 0xa1, 0xcc, 0x1e, 0x1b, 0xc3, 0xb1, 0x11, - 0xb5, 0x11, 0x4c, 0x37, 0xbf, 0xd0, 0x0c, 0xef, - 0x36, 0x9f, 0x99, 0x49, 0x38, 0xc2, 0x62, 0xbd, - 0x3e, 0x03, 0xd1, 0x02, 0xa2, 0x18, 0xdc, 0x58, - 0x9c, 0x01, 0x99, 0xd8, 0x47, 0xeb, 0x27, 0xce, - 0x76, 0x84, 0xa5, 0xab, 0xb7, 0x9b, 0xbb, 0x98, - 0xc9, 0x84, 0x02, 0x6e, 0x32, 0x65, 0xc9, 0xcb, - 0xca, 0xc7, 0xa5, 0x95, 0x11, 0xcc, 0x0a, 0x9d, - 0x5e, 0xea, 0xba, 0x59, 0xef, 0x25, 0xc0, 0x2d, - 0x8b, 0xa2, 0xec, 0x2f, 0x34, 0xea, 0x7c, 0xef, - 0xee, 0x2a, 0x57, 0x80, 0xc4, 0xca, 0x5e, 0x08, - 0x8c, 0x12, 0x13, 0x39, 0xd1, 0xc7, 0x96, 0x93, - 0x41, 0x22, 0x97, 0x1c, 0x7d, 0xe0, 0x47, 0xab, - 0xfa, 0xd7, 0xc6, 0x38, 0x5a, 0x39, 0xdb, 0x4c, - 0xd4, 0x6d, 0x50, 0x2b, 0x8f, 0xb1, 0x92, 0x06, - 0x01, 0xbf, 0xdc, 0x14, 0x5c, 0x32, 0xee, 0xb0, - 0x6a, 0x36, 0xe8, 0xe9, 0xf3, 0x12, 0x9f, 0x1f, - 0x00, 0xe5, 0x25, 0x3b, 0x52, 0x74, 0xba, 0x50, - 0x17, 0x81, 0x60, 0x5c, 0x15, 0xec, 0x4d, 0xb0, - 0x6a, 0xa1, 0xdd, 0xb4, 0xa2, 0x71, 0x01, 0xb8, - 0x8b, 0x59, 0x93, 0x58, 0x23, 0xd6, 0x38, 0xbf, - 0x49, 0x94, 0xb7, 0x6e, 0x22, 0x75, 0x68, 0x1f, - 0x15, 0x2c, 0xc4, 0x46, 0x44, 0x35, 0xc8, 0x7a, - 0x40, 0x2e, 0x55, 0x3f, 0x67, 0x4d, 0x12, 0x21, - 0xf6, 0xb1, 0x20, 0x47, 0x4f, 0x35, 0xe4, 0x96, - 0xf9, 0xa2, 0xdc, 0x4c, 0xe3, 0xa2, 0x13, 0x41, - 0xed, 0x6d, 0x86, 0x80, 0x23, 0xe5, 0x2a, 0xd1, - 0xa0, 0x69, 0x8f, 0x7e, 0x22, 0x3f, 0xf1, 0x65, - 0x9f, 0xd7, 0x86, 0xa8, 0x78, 0x57, 0x49, 0x74, - 0x91, 0x52, 0x91, 0xe7, 0x1e, 0xe2, 0x14, 0xe9, - 0x88, 0xe1, 0x67, 0x12, 0x3d, 0x0a, 0x22, 0x31, - 0x56, 0x2e, 0x36, 0xd4, 0x45, 0xc9, 0x9b, 0x7b, - 0x09, 0x53, 0x55, 0x36, 0xed, 0xa3, 0xc2, 0x22, - 0xac, 0x00, 0x5e, 0x57, 0xc8, 0x40, 0x65, 0xd2, - 0x62, 0x61, 0x35, 0xf2, 0xe8, 0x4f, 0xb3, 0x9d, - 0x2c, 0xb2, 0x12, 0x5e, 0x15, 0x47, 0xd6, 0x1c, - 0x99, 0x80, 0xe0, 0x1c, 0x09, 0x28, 0xa0, 0x7e, - 0x6c, 0x96, 0xc9, 0x62, 0x33, 0xd3, 0xbe, 0x53, - 0x16, 0xa0, 0xf2, 0xa9, 0x42, 0x1c, 0x81, 0xa3, - 0x35, 0x9b, 0x93, 0x9e, 0xc6, 0xc0, 0x83, 0x03, - 0xb7, 0x39, 0x66, 0xc9, 0x86, 0xf8, 0x8d, 0xc0, - 0xe2, 0x88, 0xb4, 0x1f, 0x5d, 0x15, 0x80, 0x60, - 0x2d, 0x53, 0x1d, 0x60, 0x07, 0xbc, 0x72, 0x11, - 0xd0, 0x0e, 0xcb, 0x70, 0x9c, 0xa0, 0x48, 0x56, - 0x21, 0x5f, 0x18, 0xdd, 0xa3, 0x1d, 0xdb, 0xe0, - 0x41, 0x0c, 0x9e, 0xb9, 0xa2, 0x7e, 0x32, 0xb3, - 0x3e, 0x91, 0x9d, 0xf2, 0xa6, 0x0d, 0x8c, 0xea, - 0xae, 0x44, 0xb2, 0x0f, 0x11, 0x35, 0x27, 0x2e, - 0xb6, 0x3d, 0xe9, 0x63, 0x86, 0x2e, 0x81, 0xdc, - 0xfa, 0xb4, 0x52, 0x1d, 0x9c, 0xd5, 0x44, 0x95, - 0xc8, 0xd0, 0x66, 0x8a, 0xbd, 0xf6, 0xd1, 0xff, - 0xeb, 0x82, 0x68, 0x58, 0x7b, 0xec, 0x0e, 0x92, - 0x0e, 0x48, 0xd6, 0xff, 0x8d, 0xac, 0xc1, 0x41, - 0x84, 0x9e, 0x56, 0x54, 0xf9, 0xb5, 0x1c, 0xb0, - 0x9f, 0xde, 0xfe, 0x14, 0x42, 0x0d, 0x22, 0x12, - 0xf2, 0x7d, 0x7b, 0xc3, 0x2e, 0x72, 0x27, 0x76, - 0x12, 0xdf, 0x57, 0x2f, 0x97, 0x82, 0x9b, 0xcf, - 0x75, 0x1a, 0x4a, 0x0c, 0xad, 0x29, 0x56, 0x4c, - 0x74, 0xaf, 0x95, 0x03, 0xff, 0x9f, 0x9d, 0xc3, - 0x2e, 0x9c, 0x1a, 0x42, 0x75, 0xe1, 0x59, 0xc9, - 0x05, 0x12, 0x6c, 0xea, 0x2b, 0x2f, 0x89, 0xfc, - 0xa4, 0x73, 0xc8, 0xdc, 0xf6, 0xd5, 0x50, 0x19, - 0x22, 0x80, 0xbc, 0x08, 0x48, 0xb4, 0x45, 0x47, - 0x25, 0x01, 0xa9, 0x55, 0x7b, 0x66, 0xbd, 0x84, - 0x0f, 0x16, 0xfa, 0x44, 0x23, 0x51, 0x6f, 0xed, - 0x35, 0x0e, 0x88, 0x4d, 0xda, 0xe8, 0x27, 0x94, - 0xbd, 0x68, 0x46, 0x28, 0x79, 0x8c, 0x03, 0x03, - 0xf0, 0x81, 0xac, 0xbc, 0xc2, 0xdd, 0xa8, 0x98, - 0xdf, 0xe3, 0x1c, 0x1c, 0x4b, 0x43, 0x9e, 0x7b, - 0x26, 0x3c, 0xe9, 0xff, 0x3b, 0xee, 0x35, 0xe6, - 0x2a, 0xcf, 0xdc, 0x17, 0x85, 0x99, 0x9e, 0x88, - 0x5c, 0x38, 0x4c, 0x56, 0x4a, 0x06, 0xeb, 0x28, - 0xf7, 0xb5, 0x97, 0x04, 0xd4, 0x05, 0x85, 0xee, - 0x90, 0xd7, 0xe2, 0x10, 0x8a, 0x86, 0xb2, 0x3f, - 0xbf, 0x3f, 0x6a, 0xe6, 0xeb, 0xc1, 0x42, 0x97, - 0xcb, 0x30, 0x41, 0x44, 0x79, 0x44, 0x7e, 0x1e, - 0x3e, 0x55, 0xe5, 0xc8, 0xd5, 0xec, 0x64, 0x3d, - 0x09, 0x69, 0xea, 0xdb, 0xe5, 0x08, 0x33, 0x00, - 0x79, 0x1b, 0x31, 0xf2, 0x3d, 0xbd, 0x73, 0xe6, - 0x0e, 0xc1, 0xb9, 0x45, 0xbf, 0xa5, 0x52, 0x5a, - 0xcd, 0x71, 0x7a, 0x2e, 0x20, 0x1e, 0xbf, 0xff, - 0x42, 0x0a, 0x6a, 0x1b, 0xa4, 0xad, 0x79, 0x3d, - 0x34, 0x54, 0x73, 0xe2, 0xd6, 0x6f, 0xb0, 0xcc, - 0xc0, 0x8a, 0x56, 0x3d, 0x4d, 0x90, 0x35, 0xe3, - 0x4b, 0xcc, 0x40, 0x40, 0xbc, 0xcf, 0x93, 0xa0, - 0xbd, 0x5c, 0xed, 0x22, 0x57, 0x92, 0x5c, 0x8d, - 0xfb, 0x67, 0x9e, 0xab, 0x40, 0xc9, 0xed, 0x7c, - 0xa1, 0xb6, 0x36, 0xb2, 0xcb, 0xbc, 0xf2, 0x1a, - 0x46, 0x6c, 0x1f, 0xb3, 0xe4, 0xf6, 0x4c, 0x7a, - 0x10, 0x81, 0x16, 0x93, 0x77, 0xa3, 0xa1, 0x07, - 0xec, 0xc8, 0x01, 0x76, 0xf8, 0xe3, 0xe6, 0xae, - 0xaf, 0x90, 0x98, 0x3a, 0xbd, 0x7d, 0x28, 0x57, - 0xb4, 0xc5, 0xfe, 0x13, 0xab, 0x6c, 0x77, 0xc1, - 0xc3, 0x47, 0x1d, 0x34, 0x2f, 0xdd, 0xe1, 0x7b, - 0x8b, 0x65, 0xc4, 0xe3, 0x45, 0xda, 0x6e, 0xba, - 0x37, 0xb1, 0x37, 0xbf, 0x63, 0x1d, 0x39, 0x77, - 0xf0, 0xa8, 0xf8, 0xda, 0x91, 0xd3, 0x27, 0xb9, - 0x29, 0x70, 0xf7, 0xae, 0x11, 0x6d, 0x8a, 0x8f, - 0x2f, 0x3a, 0xe1, 0xb8, 0x9b, 0xb5, 0x2a, 0xa8, - 0x7b, 0x86, 0x49, 0xca, 0x0c, 0x95, 0x17, 0x1e, - 0xaf, 0x9c, 0x52, 0x6b, 0x68, 0xae, 0xe3, 0xc3, - 0xc9, 0x8c, 0x89, 0x4b, 0xf2, 0xfb, 0xb1, 0xae, - 0x2f, 0x80, 0xf9, 0xa3, 0xf4, 0x10, 0x09, 0x36, - 0x81, 0x27, 0x06, 0x6d, 0xe9, 0x79, 0x8e, 0xa4, - 0x8e, 0x12, 0xfa, 0x03, 0x8e, 0x69, 0x4c, 0x7e, - 0xc5, 0x10, 0xd5, 0x00, 0x64, 0x87, 0xf8, 0x10, - 0x8a, 0x8e, 0x96, 0x9e, 0xc8, 0xac, 0x42, 0x75, - 0x97, 0x6d, 0x62, 0x3f, 0xa3, 0x29, 0x11, 0xd2, - 0x73, 0xd3, 0x95, 0xef, 0xb4, 0x64, 0xa4, 0x37, - 0x09, 0x15, 0x42, 0x7f, 0xc4, 0x46, 0x8b, 0x80, - 0xa8, 0xd9, 0x2a, 0xfc, 0x38, 0x8f, 0xf9, 0xc1, - 0xc5, 0x95, 0xad, 0x62, 0xc9, 0x6c, 0x60, 0x0b, - 0x30, 0x04, 0x8c, 0x88, 0xb5, 0x0b, 0x73, 0x23, - 0xa4, 0xe0, 0xb7, 0x6e, 0x4c, 0x78, 0xe5, 0x0a, - 0xfb, 0xe1, 0xc4, 0xeb, 0x1a, 0xb4, 0xd8, 0x3c, - 0x06, 0xb0, 0x00, 0x23, 0x86, 0xb0, 0xb4, 0x9d, - 0x33, 0xe4, 0x21, 0xca, 0xf2, 0xad, 0x14, 0x07, - 0x82, 0x25, 0xde, 0x85, 0xe4, 0x58, 0x56, 0x93, - 0x09, 0x3a, 0xeb, 0xde, 0x46, 0x77, 0x76, 0xa2, - 0x35, 0x39, 0xd0, 0xf6, 0x10, 0x81, 0x73, 0x3f, - 0x22, 0x3b, 0xeb, 0xca, 0x00, 0x19, 0x38, 0x89, - 0x26, 0x29, 0x7d, 0x6f, 0x70, 0xa6, 0xbb, 0x52, - 0x58, 0xb1, 0x0a, 0x85, 0xe9, 0x0b, 0x74, 0x2f, - 0x08, 0xe8, 0xa4, 0x4d, 0xa1, 0xcf, 0xf2, 0x75, - 0xed, 0x05, 0xae, 0x7f, 0x10, 0xb1, 0x71, 0x26, - 0xc5, 0xc7, 0xdc, 0xb0, 0x2d, 0x26, 0xf1, 0xb4 -}; - -static const struct ecb_vector ecb_vectors[] = { - {K1, P1, sizeof(P1), C1, sizeof(K1)}, - {K2, P2, sizeof(P2), C2, sizeof(K2)}, - {K3, P3, sizeof(P3), C3, sizeof(K3)}, - {K4, P4, sizeof(P4), C4, sizeof(K4)}, - {K5, P5, sizeof(P5), C5, sizeof(K5)}, - {K6, P6, sizeof(P6), C6, sizeof(K6)}, - {K7, P7, sizeof(P7), C7, sizeof(K7)}, -}; +extern const struct cipher_test ecb_test_json[]; static int ecb_job_ok(const struct IMB_JOB *job, @@ -705,90 +166,82 @@ test_ecb_many(struct IMB_MGR *mb_mgr, } static void -test_ecb_vectors(struct IMB_MGR *mb_mgr, const int vec_cnt, - const struct ecb_vector *vec_tab, const char *banner, - const IMB_CIPHER_MODE cipher, const int num_jobs, +test_ecb_vectors(struct IMB_MGR *mb_mgr, + const IMB_CIPHER_MODE cipher, + const int num_jobs, struct test_suite_context *ts128, struct test_suite_context *ts192, struct test_suite_context *ts256) { - int vect; + const struct cipher_test *v = ecb_test_json; DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_cnt; vect++) { + printf("AES-ECB standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { struct test_suite_context *ctx = NULL; if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector key_len:%d\n", - vect + 1, vec_cnt, - (int) vec_tab[vect].Klen); + printf("Standard vector %zu key_len:%zu\n", + v->tcId, v->keySize / 8); #else printf("."); #endif } - switch (vec_tab[vect].Klen) { + switch (v->keySize / 8) { case 16: - IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, v->key, enc_keys, dec_keys); ctx = ts128; break; case 24: - IMB_AES_KEYEXP_192(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_192(mb_mgr, v->key, enc_keys, dec_keys); ctx = ts192; break; case 32: default: - IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_256(mb_mgr, v->key, enc_keys, dec_keys); ctx = ts256; break; } - if (test_ecb_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt\n", vect + 1); + if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ecb_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt\n", vect + 1); + if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ecb_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt in-place\n", vect + 1); + if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ecb_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt in-place\n", vect + 1); + if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1, + (unsigned) v->keySize / 8, num_jobs)) { + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -813,9 +266,7 @@ ecb_test(struct IMB_MGR *mb_mgr) test_suite_start(&ts256, "AES-ECB-256"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_ecb_vectors(mb_mgr, DIM(ecb_vectors), ecb_vectors, - "AES-ECB standard test vectors", - IMB_CIPHER_ECB, num_jobs_tab[i], + test_ecb_vectors(mb_mgr, IMB_CIPHER_ECB, num_jobs_tab[i], &ts128, &ts192, &ts256); errors = test_suite_end(&ts128); diff --git a/test/kat-app/ecb_test.json.c b/test/kat-app/ecb_test.json.c new file mode 100644 index 00000000..411d5be1 --- /dev/null +++ b/test/kat-app/ecb_test.json.c @@ -0,0 +1,265 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* ECB */ +#include "cipher_test.h" +const struct cipher_test ecb_test_json[] = { + {0, 128, 1, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60\xa8\x9e\xca\xf3\x24\x66\xef\x97\xf5\xd3" + "\xd5\x85\x03\xb9\x69\x9d\xe7\x85\x89\x5a\x96\xfd\xba\xaf\x43\xb1\xcd\x7f" + "\x59\x8e\xce\x23\x88\x1b\x00\xe3\xed\x03\x06\x88\x7b\x0c\x78\x5e\x27\xe8" + "\xad\x3f\x82\x23\x20\x71\x04\x72\x5d\xd4", + 1, 512}, + {0, 192, 2, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + NULL, + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbd\x33\x4f\x1d\x6e\x45\xf2\x5f\xf7\x12\xa2\x14\x57\x1f\xa5\xcc\x97\x41" + "\x04\x84\x6d\x0a\xd3\xad\x77\x34\xec\xb3\xec\xee\x4e\xef\xef\x7a\xfd\x22" + "\x70\xe2\xe6\x0a\xdc\xe0\xba\x2f\xac\xe6\x44\x4e\x9a\x4b\x41\xba\x73\x8d" + "\x6c\x72\xfb\x16\x69\x16\x03\xc1\x8e\x0e", + 1, 512}, + {0, 256, 3, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + NULL, + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xf3\xee\xd1\xbd\xb5\xd2\xa0\x3c\x06\x4b\x5a\x7e\x3d\xb1\x81\xf8\x59\x1c" + "\xcb\x10\xd4\x10\xed\x26\xdc\x5b\xa7\x4a\x31\x36\x28\x70\xb6\xed\x21\xb9" + "\x9c\xa6\xf4\xf9\xf1\x53\xe7\xb1\xbe\xaf\xed\x1d\x23\x30\x4b\x7a\x39\xf9" + "\xf3\xff\x06\x7d\x8d\x8f\x9e\x24\xec\xc7", + 1, 512}, + {0, 128, 4, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, + "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\xfc\x47" + "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\xba\x91\x17\x8d" + "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x80\x40\xe9\x37\xb0\xd6" + "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" + "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" + "\x28\x1f\x3a\x9c\x18\x7d\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" + "\xcf\x21\xa0\x1e\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" + "\x33\x90", + "\x48\xa0\xe8\x0a\x89\x99\xab\xb5\x66\x6d\x68\x23\x43\x40\x1f\x26\xac\x52" + "\xc4\x7b\x09\x0a\x8f\xc0\x38\x00\xf5\x48\x3a\xfd\xcd\x7e\x21\xe7\xf8\xf6" + "\xc2\xa7\x4c\x1c\x6e\x83\x57\xf4\xa4\xb0\xc0\x5f\x36\x73\x22\xff\x33\x44" + "\xab\xeb\x96\xa8\xe0\x37\x65\x81\x6b\x82\x89\xcd\xcc\xac\x33\x18\x7d\x43" + "\x0e\x79\x53\x30\x21\x4c\x95\x18\xb6\xc9\xea\x5c\x6f\xa1\x10\xa3\x51\x0e" + "\x67\x8c\x1c\x9d\xf1\x57\xeb\xf6\xad\x4f\xf2\x55\xe8\x11\x6f\xaa\x4d\xe5" + "\x18\x3d\xc3\x14\xf9\x40\xfa\x86\x9d\xaf\xff\xfc\x78\xba\xbe\x61\xf8\xd1" + "\x00\x8d", + 1, 1024}, + {0, 192, 5, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + NULL, + "\x19\x08\xa3\x58\x17\x14\x70\x5a\xb8\xab\x4f\x5f\xa4\x25\x2b\xec\xb6\x74" + "\x0b\x9d\x56\x3b\xaf\xa3\xa4\x2d\x3e\x1f\x18\x84\x3b\x4f\x48\xd9\xa3\xfe" + "\x59\x1e\x80\x67\x44\x35\x26\x00\x78\xda\x68\xfa\x61\x9c\xd8\x8e\x5c\xc1" + "\xff\xeb\x9c\x7d\xe7\xa9\x38\xeb\x66\xf8\x6a\x46\x71\x51\x02\xba\x8d\x70" + "\x55\x5b\x60\xc6\x4c\xae\xda\x2e\x17\xbb\x65\xef\x60\x85\x9e\x77\xe5\x83" + "\xef\x30\x08\x3a\xba\x80\x28\xc0\xa1\x93\x4c\x2a\x0b\xe1\xcb\xd0\xac\x72" + "\x72\x1d\x96\x76\x0e\xc0\xec\x7d\x84\xfd\xee\x08\xa1\x11\x20\x0d\x59\x5c" + "\x06\x3f\xa3\xf1\xd7\xa3\x1d\x29\xc3\xaa\x05\x2b\x74\x8c\x73\x60\x65\x43" + "\x76\xd4\xd7\x7b\x5f\x40\xf4\x77\xe1\xcc\x85\x37\x1c\xd8\xda\x91\xf0\x40" + "\xb2\x43\x2d\x87\x51\xd0\xce\x27\xa6\x60\xac\x67\xea\x8b\xae\x46\x2e\x78" + "\x06\x09\x8a\x82\xb0\x0d\x57\x56\x82\xfe\x89\xd2", + "\xcc\xe2\x3f\xc3\x12\x41\x31\x63\x03\x3a\x3c\xfe\x76\x55\xd2\x26\xf0\xc9" + "\xb5\xc6\xf0\x1e\xc3\x72\xfb\x64\x94\x7d\xf1\x5e\x2a\x9e\x0d\x9a\x7a\xe0" + "\xbc\x7b\xa6\x65\x41\xc0\xa0\x9d\xb1\xb1\x09\x99\x6e\xe7\x25\x5e\x64\x2b" + "\x74\xfa\xa1\x9a\x03\x33\x88\x81\x27\x48\xdd\x53\x77\x0b\xef\xd9\x2f\xfa" + "\xc8\x50\x0e\x08\xa1\x45\x12\x82\x2b\xfb\x85\x5a\x39\x8c\x71\x32\x59\x27" + "\x37\x53\xce\x3e\xae\x00\x45\x53\xfd\xaf\xa5\xd1\x1a\xe9\xa4\x1b\xe3\x99" + "\xde\xcd\x03\x36\x6b\x72\x43\x76\x04\xa8\xf9\x83\xef\x9e\x57\x75\x36\x0e" + "\x99\xe1\x79\x2b\x2b\x96\x01\x10\xb8\xf6\x4a\xa6\x13\xab\x7f\x55\x60\xf0" + "\xc9\x5c\x81\xa7\x96\x99\xb4\x55\x41\x48\xf1\xd4\xa1\xb4\x76\xb5\x35\xe1" + "\x02\x8e\x09\xb2\x6c\x11\x3f\xfb\x04\x47\x98\xab\x9b\x55\xc3\xa9\x2a\x64" + "\x32\x5a\x69\x96\x28\x8c\x5b\xe3\xb2\x60\x82\xec", + 1, 1536}, + {0, 256, 6, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + NULL, + "\x0b\xe5\x48\xa6\xa1\xbc\xac\x81\x80\x06\x5f\xae\x1e\x3f\x55\x73\x6d\x36" + "\x7f\x57\x3d\xa4\x4a\x6b\xb6\x65\x2f\xb7\xe8\x85\x47\xe2\x41\x42\xc2\x4e" + "\x58\xf1\xde\x42\x9f\x15\x4c\xaf\xea\x04\x20\xd0\x1a\x19\x36\x74\x71\x12" + "\x72\x1b\xdb\x18\xf9\x0b\xb3\xf3\x63\xd4\x62\x52\x8b\x63\x0f\x6b\x4d\xb9" + "\x70\xd6\x91\xa0\x43\x3f\x46\xfe\x43\xbb\xb8\xdc\x5e\xdb\xd4\x1f\xf0\x17" + "\x94\x25\xee\x55\x67\xbf\x4d\xda\x9d\xe7\x4b\xc6\x7a\xcf\x8f\xd7\xbb\x29" + "\x6e\x26\xd4\xc3\x08\x9b\x67\x15\xe9\x2d\x9f\x2d\x3c\x76\x26\xd3\xda\xfe" + "\x6e\x73\x9d\x09\x60\x4b\x35\x60\xdb\x77\xb6\xc0\x45\x91\xf9\x14\x8a\x7a" + "\xdd\xe2\xf1\xdf\x8f\x12\x4f\xd7\x75\xd6\x9a\x17\xda\x76\x88\xf0\xfa\x44" + "\x27\xbe\x61\xaf\x55\x9f\xc7\xf0\x76\x77\xde\xca\xd1\x47\x51\x55\xb1\xbf" + "\xfa\x1e\xca\x28\x17\x70\xf3\xb5\xd4\x32\x47\x04\xe0\x92\xd8\xa5\x03\x69" + "\x46\x99\x7f\x1e\x3f\xb2\x93\x36\xa3\x88\x75\x07\x68\xb8\x33\xce\x17\x3f" + "\x5c\xb7\x1e\x93\x38\xc5\x1d\x79\x86\x7c\x9d\x9e\x2f\x69\x38\x0f\x97\x5c" + "\x67\xbf\xa0\x8d\x37\x0b\xd3\xb1\x04\x87\x1d\x74\xfe\x30\xfb\xd0\x22\x92" + "\xf9\xf3\x23\xc9", + "\x4b\xc0\x1f\x80\xf5\xc7\xe8\xf5\xc9\xd0\x3c\x86\x50\x78\x21\xce\x01\xec" + "\x91\x00\xc9\xf8\x73\x43\x2f\x73\x8a\x6d\xee\xed\x2d\x40\x17\x16\x93\x15" + "\xac\xed\x28\x61\xb0\x0f\xa2\xe1\xd3\x80\x51\xdf\x73\xce\x48\x4c\x1c\xc1" + "\x8b\xc9\x9e\x5c\x48\x07\xa0\xf6\x29\xf8\x63\x87\xe4\xe7\x8b\xf8\xcf\x58" + "\xda\x57\x62\x11\x2e\x6e\x91\x7e\xc7\x73\xdb\x27\x3c\x64\x72\x52\xe3\x27" + "\x84\x1f\x73\x3f\xf4\x94\xd2\xdd\x93\x33\x65\x91\x98\x89\x13\xa9\x2b\x0d" + "\x6f\x56\x51\x15\x07\xc6\xa7\x36\x8f\x0c\xd6\xc2\x07\x06\x65\x7a\xf8\x94" + "\xa6\x75\x48\x4c\xcc\xa5\xa9\x91\x04\x2f\x7b\x89\x46\xd2\x87\xcb\xd6\x1b" + "\xf3\x1e\xa7\xe5\x09\xcf\x75\x05\x9f\xc9\xac\xcc\x61\x15\x2d\x2e\x2c\x0a" + "\x57\x4d\x33\x17\x6b\x22\x9e\x92\xc5\x81\xce\x9d\x52\x68\x7d\x98\xe1\x23" + "\x70\xc5\x19\x3e\x91\xfc\xc6\xd7\x67\x5f\xbb\x57\x20\x96\x3f\x1f\x9f\x64" + "\xe9\xb1\x51\xfd\x8c\xc1\x0f\x50\xbe\x43\x5f\x90\xb4\xd1\xb6\x41\x7c\x37" + "\x92\x71\xda\x9d\xfd\xee\x69\x8c\x24\x18\xe8\x81\x60\xe2\x89\x33\x42\xd4" + "\x1b\x6a\xcb\x4a\x5b\x00\x01\x4f\x11\x47\x0f\x57\xb0\x90\xf0\xed\xb0\x34" + "\x2e\x9f\x81\x6c", + 1, 2048}, + {0, 128, 7, + "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, + "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x92\x65" + "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\xdd\x4e\xe9\xeb" + "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\xfe\x2c\x73\x23\xea\x45" + "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x1d\x92\x82\xd8\x0f\xa9\x36\x23" + "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" + "\x86\x8c\xbd\xdc\x6b\x12\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" + "\x0a\x8d\x1e\xf1\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" + "\xb6\x35\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" + "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\xe4\x95" + "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x5a\x53\xc3\xdc" + "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\xac\x1f\xa7\x9c\x64\xfd" + "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\xba\x99\xa4\x12\x6e\x4e\xea\x0b" + "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" + "\x09\xff\xaa\x17\x5d\x82\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" + "\x33\x58\x7e\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" + "\x81\xd0\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" + "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x97\x9c" + "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x2f\xe7\xcd\x8a" + "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\xc9\x2c\xb7\x75\xa8\xf6" + "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x33\x73\xaf\xde\xcb\x37\x0a\x50" + "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" + "\xd8\xb0\x84\x26\x6b\xe8\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" + "\x1a\xd2\xd6\x3a\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" + "\x9f\xc7\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" + "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x1a\xb3" + "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\xb8\xa1\x62\x8c" + "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x8e\x46\xa0\xc5\x45\x5c" + "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\xe2\x04\x30\x63\x22\x87\xb6\xc7" + "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" + "\x35\xa1\x5d\x17\x48\x55\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" + "\xab\xde\xe1\x02\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" + "\x0e\x05\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" + "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x1b\xa2" + "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x46\xb9\xc9\xf6" + "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x7a\xce\xfd\x3c\x16\xff" + "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" + "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" + "\xb5\xed\xb7\xa2\x54\x84\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" + "\xbd\xbf\x3a\xb8\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" + "\x19\x33\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" + "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\xbe\x4a" + "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x2d\x06\x98\x32" + "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\xca\xf3\xc0\xc7\x64\xee" + "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" + "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" + "\x50\x5d\xc4\xb3\x3d\x09\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" + "\xc2\x8e\xea\xbe\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" + "\x04\x9d\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" + "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x6f\xe4" + "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\xd1\x28\x4d\x7c" + "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\xf2\xd5\x36\x4a\x54\xe8" + "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x17\xd1\x20\x93\x31\x89\xff\xed" + "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" + "\x42\xdd\x99\x15\x9a\xf4\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" + "\x97\xf7\xde\x31\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" + "\x86\x9a\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a", + "\x62\xa1\xcc\x1e\x1b\xc3\xb1\x11\xb5\x11\x4c\x37\xbf\xd0\x0c\xef\x36\x9f" + "\x99\x49\x38\xc2\x62\xbd\x3e\x03\xd1\x02\xa2\x18\xdc\x58\x9c\x01\x99\xd8" + "\x47\xeb\x27\xce\x76\x84\xa5\xab\xb7\x9b\xbb\x98\xc9\x84\x02\x6e\x32\x65" + "\xc9\xcb\xca\xc7\xa5\x95\x11\xcc\x0a\x9d\x5e\xea\xba\x59\xef\x25\xc0\x2d" + "\x8b\xa2\xec\x2f\x34\xea\x7c\xef\xee\x2a\x57\x80\xc4\xca\x5e\x08\x8c\x12" + "\x13\x39\xd1\xc7\x96\x93\x41\x22\x97\x1c\x7d\xe0\x47\xab\xfa\xd7\xc6\x38" + "\x5a\x39\xdb\x4c\xd4\x6d\x50\x2b\x8f\xb1\x92\x06\x01\xbf\xdc\x14\x5c\x32" + "\xee\xb0\x6a\x36\xe8\xe9\xf3\x12\x9f\x1f\x00\xe5\x25\x3b\x52\x74\xba\x50" + "\x17\x81\x60\x5c\x15\xec\x4d\xb0\x6a\xa1\xdd\xb4\xa2\x71\x01\xb8\x8b\x59" + "\x93\x58\x23\xd6\x38\xbf\x49\x94\xb7\x6e\x22\x75\x68\x1f\x15\x2c\xc4\x46" + "\x44\x35\xc8\x7a\x40\x2e\x55\x3f\x67\x4d\x12\x21\xf6\xb1\x20\x47\x4f\x35" + "\xe4\x96\xf9\xa2\xdc\x4c\xe3\xa2\x13\x41\xed\x6d\x86\x80\x23\xe5\x2a\xd1" + "\xa0\x69\x8f\x7e\x22\x3f\xf1\x65\x9f\xd7\x86\xa8\x78\x57\x49\x74\x91\x52" + "\x91\xe7\x1e\xe2\x14\xe9\x88\xe1\x67\x12\x3d\x0a\x22\x31\x56\x2e\x36\xd4" + "\x45\xc9\x9b\x7b\x09\x53\x55\x36\xed\xa3\xc2\x22\xac\x00\x5e\x57\xc8\x40" + "\x65\xd2\x62\x61\x35\xf2\xe8\x4f\xb3\x9d\x2c\xb2\x12\x5e\x15\x47\xd6\x1c" + "\x99\x80\xe0\x1c\x09\x28\xa0\x7e\x6c\x96\xc9\x62\x33\xd3\xbe\x53\x16\xa0" + "\xf2\xa9\x42\x1c\x81\xa3\x35\x9b\x93\x9e\xc6\xc0\x83\x03\xb7\x39\x66\xc9" + "\x86\xf8\x8d\xc0\xe2\x88\xb4\x1f\x5d\x15\x80\x60\x2d\x53\x1d\x60\x07\xbc" + "\x72\x11\xd0\x0e\xcb\x70\x9c\xa0\x48\x56\x21\x5f\x18\xdd\xa3\x1d\xdb\xe0" + "\x41\x0c\x9e\xb9\xa2\x7e\x32\xb3\x3e\x91\x9d\xf2\xa6\x0d\x8c\xea\xae\x44" + "\xb2\x0f\x11\x35\x27\x2e\xb6\x3d\xe9\x63\x86\x2e\x81\xdc\xfa\xb4\x52\x1d" + "\x9c\xd5\x44\x95\xc8\xd0\x66\x8a\xbd\xf6\xd1\xff\xeb\x82\x68\x58\x7b\xec" + "\x0e\x92\x0e\x48\xd6\xff\x8d\xac\xc1\x41\x84\x9e\x56\x54\xf9\xb5\x1c\xb0" + "\x9f\xde\xfe\x14\x42\x0d\x22\x12\xf2\x7d\x7b\xc3\x2e\x72\x27\x76\x12\xdf" + "\x57\x2f\x97\x82\x9b\xcf\x75\x1a\x4a\x0c\xad\x29\x56\x4c\x74\xaf\x95\x03" + "\xff\x9f\x9d\xc3\x2e\x9c\x1a\x42\x75\xe1\x59\xc9\x05\x12\x6c\xea\x2b\x2f" + "\x89\xfc\xa4\x73\xc8\xdc\xf6\xd5\x50\x19\x22\x80\xbc\x08\x48\xb4\x45\x47" + "\x25\x01\xa9\x55\x7b\x66\xbd\x84\x0f\x16\xfa\x44\x23\x51\x6f\xed\x35\x0e" + "\x88\x4d\xda\xe8\x27\x94\xbd\x68\x46\x28\x79\x8c\x03\x03\xf0\x81\xac\xbc" + "\xc2\xdd\xa8\x98\xdf\xe3\x1c\x1c\x4b\x43\x9e\x7b\x26\x3c\xe9\xff\x3b\xee" + "\x35\xe6\x2a\xcf\xdc\x17\x85\x99\x9e\x88\x5c\x38\x4c\x56\x4a\x06\xeb\x28" + "\xf7\xb5\x97\x04\xd4\x05\x85\xee\x90\xd7\xe2\x10\x8a\x86\xb2\x3f\xbf\x3f" + "\x6a\xe6\xeb\xc1\x42\x97\xcb\x30\x41\x44\x79\x44\x7e\x1e\x3e\x55\xe5\xc8" + "\xd5\xec\x64\x3d\x09\x69\xea\xdb\xe5\x08\x33\x00\x79\x1b\x31\xf2\x3d\xbd" + "\x73\xe6\x0e\xc1\xb9\x45\xbf\xa5\x52\x5a\xcd\x71\x7a\x2e\x20\x1e\xbf\xff" + "\x42\x0a\x6a\x1b\xa4\xad\x79\x3d\x34\x54\x73\xe2\xd6\x6f\xb0\xcc\xc0\x8a" + "\x56\x3d\x4d\x90\x35\xe3\x4b\xcc\x40\x40\xbc\xcf\x93\xa0\xbd\x5c\xed\x22" + "\x57\x92\x5c\x8d\xfb\x67\x9e\xab\x40\xc9\xed\x7c\xa1\xb6\x36\xb2\xcb\xbc" + "\xf2\x1a\x46\x6c\x1f\xb3\xe4\xf6\x4c\x7a\x10\x81\x16\x93\x77\xa3\xa1\x07" + "\xec\xc8\x01\x76\xf8\xe3\xe6\xae\xaf\x90\x98\x3a\xbd\x7d\x28\x57\xb4\xc5" + "\xfe\x13\xab\x6c\x77\xc1\xc3\x47\x1d\x34\x2f\xdd\xe1\x7b\x8b\x65\xc4\xe3" + "\x45\xda\x6e\xba\x37\xb1\x37\xbf\x63\x1d\x39\x77\xf0\xa8\xf8\xda\x91\xd3" + "\x27\xb9\x29\x70\xf7\xae\x11\x6d\x8a\x8f\x2f\x3a\xe1\xb8\x9b\xb5\x2a\xa8" + "\x7b\x86\x49\xca\x0c\x95\x17\x1e\xaf\x9c\x52\x6b\x68\xae\xe3\xc3\xc9\x8c" + "\x89\x4b\xf2\xfb\xb1\xae\x2f\x80\xf9\xa3\xf4\x10\x09\x36\x81\x27\x06\x6d" + "\xe9\x79\x8e\xa4\x8e\x12\xfa\x03\x8e\x69\x4c\x7e\xc5\x10\xd5\x00\x64\x87" + "\xf8\x10\x8a\x8e\x96\x9e\xc8\xac\x42\x75\x97\x6d\x62\x3f\xa3\x29\x11\xd2" + "\x73\xd3\x95\xef\xb4\x64\xa4\x37\x09\x15\x42\x7f\xc4\x46\x8b\x80\xa8\xd9" + "\x2a\xfc\x38\x8f\xf9\xc1\xc5\x95\xad\x62\xc9\x6c\x60\x0b\x30\x04\x8c\x88" + "\xb5\x0b\x73\x23\xa4\xe0\xb7\x6e\x4c\x78\xe5\x0a\xfb\xe1\xc4\xeb\x1a\xb4" + "\xd8\x3c\x06\xb0\x00\x23\x86\xb0\xb4\x9d\x33\xe4\x21\xca\xf2\xad\x14\x07" + "\x82\x25\xde\x85\xe4\x58\x56\x93\x09\x3a\xeb\xde\x46\x77\x76\xa2\x35\x39" + "\xd0\xf6\x10\x81\x73\x3f\x22\x3b\xeb\xca\x00\x19\x38\x89\x26\x29\x7d\x6f" + "\x70\xa6\xbb\x52\x58\xb1\x0a\x85\xe9\x0b\x74\x2f\x08\xe8\xa4\x4d\xa1\xcf" + "\xf2\x75\xed\x05\xae\x7f\x10\xb1\x71\x26\xc5\xc7\xdc\xb0\x2d\x26\xf1\xb4", + 1, 8064}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index f4490b58..90d4f143 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ctr_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 7d3462125630a0fa871333aa3f9dc42f7f550d7a Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Fri, 23 Jun 2023 13:49:58 +0100 Subject: [PATCH 022/204] test: [CHACHA20] Unify test vectors --- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 3 +- test/kat-app/chacha_test.c | 255 ++++---------------------------- test/kat-app/chacha_test.json.c | 98 ++++++++++++ test/kat-app/win_x64.mak | 2 +- 5 files changed, 132 insertions(+), 227 deletions(-) create mode 100644 test/kat-app/chacha_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 3c445a8b..0f2d1114 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -104,6 +104,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/aes_cfb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/ctr_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/ecb_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/chacha_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index a0b7d85f..9c288a25 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -41,7 +41,8 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ - aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c ecb_test.json.c + aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c ecb_test.json.c \ + chacha_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/chacha_test.c b/test/kat-app/chacha_test.c index 36b709fa..c7d384cc 100644 --- a/test/kat-app/chacha_test.c +++ b/test/kat-app/chacha_test.c @@ -34,182 +34,11 @@ #include #include "utils.h" +#include "cipher_test.h" int chacha_test(struct IMB_MGR *mb_mgr); -struct chacha_vector { - const uint8_t *K; /* key */ - const uint8_t *IV; /* initialization vector */ - const uint8_t *P; /* plain text */ - uint64_t Plen; /* plain text length */ - const uint8_t *C; /* cipher text - same length as plain text */ - uint32_t Klen; /* key length */ -}; - -/* =================================================================== */ -/* =================================================================== */ - -static const uint8_t K1[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 -}; -static const uint8_t IV1[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02 -}; -static const uint8_t P1[] = { - 0x41, 0x6e, 0x79, 0x20, 0x73, 0x75, 0x62, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, - 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x49, 0x45, - 0x54, 0x46, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, - 0x64, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, - 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x72, - 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, - 0x20, 0x61, 0x6e, 0x20, 0x49, 0x45, 0x54, 0x46, - 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x2d, 0x44, 0x72, 0x61, 0x66, 0x74, 0x20, - 0x6f, 0x72, 0x20, 0x52, 0x46, 0x43, 0x20, 0x61, - 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x20, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x77, 0x69, - 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x49, - 0x45, 0x54, 0x46, 0x20, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x79, 0x20, 0x69, 0x73, 0x20, - 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, - 0x65, 0x64, 0x20, 0x61, 0x6e, 0x20, 0x22, 0x49, - 0x45, 0x54, 0x46, 0x20, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x2e, 0x20, 0x53, 0x75, 0x63, 0x68, 0x20, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x64, 0x65, 0x20, 0x6f, 0x72, 0x61, 0x6c, 0x20, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x49, 0x45, - 0x54, 0x46, 0x20, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x61, 0x73, 0x20, - 0x77, 0x65, 0x6c, 0x6c, 0x20, 0x61, 0x73, 0x20, - 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x6f, 0x6e, 0x69, 0x63, 0x20, 0x63, - 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x61, - 0x64, 0x65, 0x20, 0x61, 0x74, 0x20, 0x61, 0x6e, - 0x79, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x6f, - 0x72, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2c, - 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, - 0x72, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f -}; -static const uint8_t C1[] = { - 0xa3, 0xfb, 0xf0, 0x7d, 0xf3, 0xfa, 0x2f, 0xde, - 0x4f, 0x37, 0x6c, 0xa2, 0x3e, 0x82, 0x73, 0x70, - 0x41, 0x60, 0x5d, 0x9f, 0x4f, 0x4f, 0x57, 0xbd, - 0x8c, 0xff, 0x2c, 0x1d, 0x4b, 0x79, 0x55, 0xec, - 0x2a, 0x97, 0x94, 0x8b, 0xd3, 0x72, 0x29, 0x15, - 0xc8, 0xf3, 0xd3, 0x37, 0xf7, 0xd3, 0x70, 0x05, - 0x0e, 0x9e, 0x96, 0xd6, 0x47, 0xb7, 0xc3, 0x9f, - 0x56, 0xe0, 0x31, 0xca, 0x5e, 0xb6, 0x25, 0x0d, - 0x40, 0x42, 0xe0, 0x27, 0x85, 0xec, 0xec, 0xfa, - 0x4b, 0x4b, 0xb5, 0xe8, 0xea, 0xd0, 0x44, 0x0e, - 0x20, 0xb6, 0xe8, 0xdb, 0x09, 0xd8, 0x81, 0xa7, - 0xc6, 0x13, 0x2f, 0x42, 0x0e, 0x52, 0x79, 0x50, - 0x42, 0xbd, 0xfa, 0x77, 0x73, 0xd8, 0xa9, 0x05, - 0x14, 0x47, 0xb3, 0x29, 0x1c, 0xe1, 0x41, 0x1c, - 0x68, 0x04, 0x65, 0x55, 0x2a, 0xa6, 0xc4, 0x05, - 0xb7, 0x76, 0x4d, 0x5e, 0x87, 0xbe, 0xa8, 0x5a, - 0xd0, 0x0f, 0x84, 0x49, 0xed, 0x8f, 0x72, 0xd0, - 0xd6, 0x62, 0xab, 0x05, 0x26, 0x91, 0xca, 0x66, - 0x42, 0x4b, 0xc8, 0x6d, 0x2d, 0xf8, 0x0e, 0xa4, - 0x1f, 0x43, 0xab, 0xf9, 0x37, 0xd3, 0x25, 0x9d, - 0xc4, 0xb2, 0xd0, 0xdf, 0xb4, 0x8a, 0x6c, 0x91, - 0x39, 0xdd, 0xd7, 0xf7, 0x69, 0x66, 0xe9, 0x28, - 0xe6, 0x35, 0x55, 0x3b, 0xa7, 0x6c, 0x5c, 0x87, - 0x9d, 0x7b, 0x35, 0xd4, 0x9e, 0xb2, 0xe6, 0x2b, - 0x08, 0x71, 0xcd, 0xac, 0x63, 0x89, 0x39, 0xe2, - 0x5e, 0x8a, 0x1e, 0x0e, 0xf9, 0xd5, 0x28, 0x0f, - 0xa8, 0xca, 0x32, 0x8b, 0x35, 0x1c, 0x3c, 0x76, - 0x59, 0x89, 0xcb, 0xcf, 0x3d, 0xaa, 0x8b, 0x6c, - 0xcc, 0x3a, 0xaf, 0x9f, 0x39, 0x79, 0xc9, 0x2b, - 0x37, 0x20, 0xfc, 0x88, 0xdc, 0x95, 0xed, 0x84, - 0xa1, 0xbe, 0x05, 0x9c, 0x64, 0x99, 0xb9, 0xfd, - 0xa2, 0x36, 0xe7, 0xe8, 0x18, 0xb0, 0x4b, 0x0b, - 0xc3, 0x9c, 0x1e, 0x87, 0x6b, 0x19, 0x3b, 0xfe, - 0x55, 0x69, 0x75, 0x3f, 0x88, 0x12, 0x8c, 0xc0, - 0x8a, 0xaa, 0x9b, 0x63, 0xd1, 0xa1, 0x6f, 0x80, - 0xef, 0x25, 0x54, 0xd7, 0x18, 0x9c, 0x41, 0x1f, - 0x58, 0x69, 0xca, 0x52, 0xc5, 0xb8, 0x3f, 0xa3, - 0x6f, 0xf2, 0x16, 0xb9, 0xc1, 0xd3, 0x00, 0x62, - 0xbe, 0xbc, 0xfd, 0x2d, 0xc5, 0xbc, 0xe0, 0x91, - 0x19, 0x34, 0xfd, 0xa7, 0x9a, 0x86, 0xf6, 0xe6, - 0x98, 0xce, 0xd7, 0x59, 0xc3, 0xff, 0x9b, 0x64, - 0x77, 0x33, 0x8f, 0x3d, 0xa4, 0xf9, 0xcd, 0x85, - 0x14, 0xea, 0x99, 0x82, 0xcc, 0xaf, 0xb3, 0x41, - 0xb2, 0x38, 0x4d, 0xd9, 0x02, 0xf3, 0xd1, 0xab, - 0x7a, 0xc6, 0x1d, 0xd2, 0x9c, 0x6f, 0x21, 0xba, - 0x5b, 0x86, 0x2f, 0x37, 0x30, 0xe3, 0x7c, 0xfd, - 0xc4, 0xfd, 0x80, 0x6c, 0x22, 0xf2, 0x21 -}; - -static const uint8_t K2[] = { - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f -}; - -static const uint8_t IV2[] = { - 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, - 0x44, 0x45, 0x46, 0x47 -}; - -static const uint8_t P2[] = { - 0x4c, 0x61, 0x64, 0x69, 0x65, 0x73, 0x20, 0x61, - 0x6e, 0x64, 0x20, 0x47, 0x65, 0x6e, 0x74, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x20, 0x6f, 0x66, 0x20, 0x27, 0x39, 0x39, - 0x3a, 0x20, 0x49, 0x66, 0x20, 0x49, 0x20, 0x63, - 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x66, 0x66, - 0x65, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6f, - 0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20, - 0x74, 0x69, 0x70, 0x20, 0x66, 0x6f, 0x72, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x74, 0x75, - 0x72, 0x65, 0x2c, 0x20, 0x73, 0x75, 0x6e, 0x73, - 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x77, 0x6f, - 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x69, - 0x74, 0x2e -}; - -static const uint8_t C2[] = { - 0xd3, 0x1a, 0x8d, 0x34, 0x64, 0x8e, 0x60, 0xdb, - 0x7b, 0x86, 0xaf, 0xbc, 0x53, 0xef, 0x7e, 0xc2, - 0xa4, 0xad, 0xed, 0x51, 0x29, 0x6e, 0x08, 0xfe, - 0xa9, 0xe2, 0xb5, 0xa7, 0x36, 0xee, 0x62, 0xd6, - 0x3d, 0xbe, 0xa4, 0x5e, 0x8c, 0xa9, 0x67, 0x12, - 0x82, 0xfa, 0xfb, 0x69, 0xda, 0x92, 0x72, 0x8b, - 0x1a, 0x71, 0xde, 0x0a, 0x9e, 0x06, 0x0b, 0x29, - 0x05, 0xd6, 0xa5, 0xb6, 0x7e, 0xcd, 0x3b, 0x36, - 0x92, 0xdd, 0xbd, 0x7f, 0x2d, 0x77, 0x8b, 0x8c, - 0x98, 0x03, 0xae, 0xe3, 0x28, 0x09, 0x1b, 0x58, - 0xfa, 0xb3, 0x24, 0xe4, 0xfa, 0xd6, 0x75, 0x94, - 0x55, 0x85, 0x80, 0x8b, 0x48, 0x31, 0xd7, 0xbc, - 0x3f, 0xf4, 0xde, 0xf0, 0x8e, 0x4b, 0x7a, 0x9d, - 0xe5, 0x76, 0xd2, 0x65, 0x86, 0xce, 0xc6, 0x4b, - 0x61, 0x16 -}; - -static const struct chacha_vector chacha_vectors[] = { - {K1, IV1, P1, sizeof(P1), C1, sizeof(K1)}, - {K2, IV2, P2, sizeof(P2), C2, sizeof(K2)}, -}; +extern const struct cipher_test chacha_test_json[]; static int chacha_job_ok(const struct IMB_JOB *job, @@ -246,8 +75,8 @@ chacha_job_ok(const struct IMB_JOB *job, static int test_chacha_many(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, + const void *enc_keys, + const void *dec_keys, const void *iv, const uint8_t *in_text, const uint8_t *out_text, @@ -349,77 +178,57 @@ end_alloc: static void test_chacha_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, - const int vec_cnt, - const struct chacha_vector *vec_tab, const char *banner, const IMB_CIPHER_MODE cipher, const int num_jobs) { - int vect; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + const struct cipher_test *v = chacha_test_json; if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_cnt; vect++) { + printf("CHACHA20 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector key_len:%d\n", - vect + 1, vec_cnt, - (int) vec_tab[vect].Klen); + printf("%zu Standard vector key_len:%zu\n", + v->tcId, v->keySize / 8); #else printf("."); #endif } - memcpy(enc_keys, vec_tab[vect].K, vec_tab[vect].Klen); - memcpy(dec_keys, vec_tab[vect].K, vec_tab[vect].Klen); - - if (test_chacha_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt\n", vect + 1); + if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, + cipher, 0, IMB_KEY_256_BYTES, num_jobs)) { + printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_chacha_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt\n", vect + 1); + if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, + cipher, 0, IMB_KEY_256_BYTES, num_jobs)) { + printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_chacha_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d encrypt in-place\n", vect + 1); + if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, + cipher, 1, IMB_KEY_256_BYTES, num_jobs)) { + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_chacha_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { - printf("error #%d decrypt in-place\n", vect + 1); + if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, + cipher, 1, IMB_KEY_256_BYTES, num_jobs)) { + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -441,11 +250,7 @@ chacha_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx, "CHACHA20-256"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_chacha_vectors(mb_mgr, &ctx, - DIM(chacha_vectors), - chacha_vectors, - "CHACHA20 standard test vectors", - IMB_CIPHER_CHACHA20, num_jobs_tab[i]); + test_chacha_vectors(mb_mgr, &ctx, IMB_CIPHER_CHACHA20, num_jobs_tab[i]); errors = test_suite_end(&ctx); return errors; diff --git a/test/kat-app/chacha_test.json.c b/test/kat-app/chacha_test.json.c new file mode 100644 index 00000000..06e7d32d --- /dev/null +++ b/test/kat-app/chacha_test.json.c @@ -0,0 +1,98 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* CHACHA20 */ +#include "cipher_test.h" +const struct cipher_test chacha_test_json[] = { + {96, 256, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", + "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" + "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" + "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" + "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" + "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" + "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" + "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" + "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" + "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" + "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" + "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" + "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" + "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" + "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" + "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" + "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" + "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" + "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" + "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" + "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" + "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", + "\xa3\xfb\xf0\x7d\xf3\xfa\x2f\xde\x4f\x37\x6c\xa2\x3e\x82\x73\x70\x41\x60" + "\x5d\x9f\x4f\x4f\x57\xbd\x8c\xff\x2c\x1d\x4b\x79\x55\xec\x2a\x97\x94\x8b" + "\xd3\x72\x29\x15\xc8\xf3\xd3\x37\xf7\xd3\x70\x05\x0e\x9e\x96\xd6\x47\xb7" + "\xc3\x9f\x56\xe0\x31\xca\x5e\xb6\x25\x0d\x40\x42\xe0\x27\x85\xec\xec\xfa" + "\x4b\x4b\xb5\xe8\xea\xd0\x44\x0e\x20\xb6\xe8\xdb\x09\xd8\x81\xa7\xc6\x13" + "\x2f\x42\x0e\x52\x79\x50\x42\xbd\xfa\x77\x73\xd8\xa9\x05\x14\x47\xb3\x29" + "\x1c\xe1\x41\x1c\x68\x04\x65\x55\x2a\xa6\xc4\x05\xb7\x76\x4d\x5e\x87\xbe" + "\xa8\x5a\xd0\x0f\x84\x49\xed\x8f\x72\xd0\xd6\x62\xab\x05\x26\x91\xca\x66" + "\x42\x4b\xc8\x6d\x2d\xf8\x0e\xa4\x1f\x43\xab\xf9\x37\xd3\x25\x9d\xc4\xb2" + "\xd0\xdf\xb4\x8a\x6c\x91\x39\xdd\xd7\xf7\x69\x66\xe9\x28\xe6\x35\x55\x3b" + "\xa7\x6c\x5c\x87\x9d\x7b\x35\xd4\x9e\xb2\xe6\x2b\x08\x71\xcd\xac\x63\x89" + "\x39\xe2\x5e\x8a\x1e\x0e\xf9\xd5\x28\x0f\xa8\xca\x32\x8b\x35\x1c\x3c\x76" + "\x59\x89\xcb\xcf\x3d\xaa\x8b\x6c\xcc\x3a\xaf\x9f\x39\x79\xc9\x2b\x37\x20" + "\xfc\x88\xdc\x95\xed\x84\xa1\xbe\x05\x9c\x64\x99\xb9\xfd\xa2\x36\xe7\xe8" + "\x18\xb0\x4b\x0b\xc3\x9c\x1e\x87\x6b\x19\x3b\xfe\x55\x69\x75\x3f\x88\x12" + "\x8c\xc0\x8a\xaa\x9b\x63\xd1\xa1\x6f\x80\xef\x25\x54\xd7\x18\x9c\x41\x1f" + "\x58\x69\xca\x52\xc5\xb8\x3f\xa3\x6f\xf2\x16\xb9\xc1\xd3\x00\x62\xbe\xbc" + "\xfd\x2d\xc5\xbc\xe0\x91\x19\x34\xfd\xa7\x9a\x86\xf6\xe6\x98\xce\xd7\x59" + "\xc3\xff\x9b\x64\x77\x33\x8f\x3d\xa4\xf9\xcd\x85\x14\xea\x99\x82\xcc\xaf" + "\xb3\x41\xb2\x38\x4d\xd9\x02\xf3\xd1\xab\x7a\xc6\x1d\xd2\x9c\x6f\x21\xba" + "\x5b\x86\x2f\x37\x30\xe3\x7c\xfd\xc4\xfd\x80\x6c\x22\xf2\x21", + 1, 3000}, + {96, 256, 2, + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91" + "\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", + "\x07\x00\x00\x00\x40\x41\x42\x43\x44\x45\x46\x47", + "\x4c\x61\x64\x69\x65\x73\x20\x61\x6e\x64\x20\x47\x65\x6e\x74\x6c\x65\x6d" + "\x65\x6e\x20\x6f\x66\x20\x74\x68\x65\x20\x63\x6c\x61\x73\x73\x20\x6f\x66" + "\x20\x27\x39\x39\x3a\x20\x49\x66\x20\x49\x20\x63\x6f\x75\x6c\x64\x20\x6f" + "\x66\x66\x65\x72\x20\x79\x6f\x75\x20\x6f\x6e\x6c\x79\x20\x6f\x6e\x65\x20" + "\x74\x69\x70\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x66\x75\x74\x75\x72\x65" + "\x2c\x20\x73\x75\x6e\x73\x63\x72\x65\x65\x6e\x20\x77\x6f\x75\x6c\x64\x20" + "\x62\x65\x20\x69\x74\x2e", + "\xd3\x1a\x8d\x34\x64\x8e\x60\xdb\x7b\x86\xaf\xbc\x53\xef\x7e\xc2\xa4\xad" + "\xed\x51\x29\x6e\x08\xfe\xa9\xe2\xb5\xa7\x36\xee\x62\xd6\x3d\xbe\xa4\x5e" + "\x8c\xa9\x67\x12\x82\xfa\xfb\x69\xda\x92\x72\x8b\x1a\x71\xde\x0a\x9e\x06" + "\x0b\x29\x05\xd6\xa5\xb6\x7e\xcd\x3b\x36\x92\xdd\xbd\x7f\x2d\x77\x8b\x8c" + "\x98\x03\xae\xe3\x28\x09\x1b\x58\xfa\xb3\x24\xe4\xfa\xd6\x75\x94\x55\x85" + "\x80\x8b\x48\x31\xd7\xbc\x3f\xf4\xde\xf0\x8e\x4b\x7a\x9d\xe5\x76\xd2\x65" + "\x86\xce\xc6\x4b\x61\x16", + 1, 912}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 90d4f143..0152ad2a 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From cb762199c4b0554c17d518830ace83f1fd2d00f7 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 8 Jun 2023 15:34:20 +0100 Subject: [PATCH 023/204] lib: [QUIC] add CHACHA20-POLY1305 QUIC API --- ReleaseNotes.txt | 8 +- lib/Makefile | 1 + lib/ipsec-mb.h | 32 +++++++ lib/libIPSec_MB.def | 1 + lib/win_x64.mak | 1 + lib/x86_64/quic_chacha20_poly1305.c | 143 ++++++++++++++++++++++++++++ 6 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 lib/x86_64/quic_chacha20_poly1305.c diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 7350d2a2..508deea9 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,6 +1,12 @@ ======================================================================== Release Notes for Intel(R) Multi-Buffer Crypto for IPsec Library +Unreleased +======================================================================= + +Library +- QUIC CHACHA20-POLY1305 API added. + v1.4 June 2023 ======================================================================== @@ -12,7 +18,7 @@ Library - Optimized GHASH component in AVX512 VAES (type2) AES-GCM implementation. - Implemented a workaround for false load-block condition in SSE and AVX2 AES-GCM implementations. - Removed AVX AES-GCM implementation, its API symbols map to the SSE implementation. -- QUIC header protection API added. +- QUIC AES-ECB header protection API added. - QUIC AES-GCM-128/256 AEAD API added. - Removed v0.53 (and older) compatibility symbol mapping (NO_COMPAT_IMB_API_053 not defined). - ZUC AVX2-GFNI implementation added. diff --git a/lib/Makefile b/lib/Makefile index b54518d9..924c524a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -428,6 +428,7 @@ c_lib_objs := \ self_test.o \ quic_aes_gcm.o \ quic_hp_aes_ecb.o \ + quic_chacha20_poly1305.o \ hmac_ipad_opad.o \ cipher_suite_id.o diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index c47929d1..0df928be 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -3978,6 +3978,38 @@ imb_quic_hp_aes_ecb(IMB_MGR *state, const uint64_t num_packets, const IMB_KEY_SIZE_BYTES key_size); +/** + * @brief Batch of CHACHA20-POLY1305 encrypt/decrypt operations with the same key + * + * @note If used out of place then AAD needs to be copied by the caller. + * + * @param [in] state pointer to IMB_MGR + * @param [in] key pointer to key + * @param [in] cipher_dir cipher direction (IMB_DIR_ENCRYPT / DECRYPT) + * @param [out] dst_ptr_array array with destination pointers + * @param [in] src_ptr_array array with source pointers + * @param [in] len_array array with message lengths in bytes + * @param [in] iv_ptr_array array with IV pointers + * @param [in] aad_ptr_array array with AAD pointers + * @param [in] aad_len AAD length in bytes + * @param [out] tag_ptr_array array with authentication TAG pointers + * @param [in] tag_len authentication TAG length in bytes + * @param [in] num_packets number of packets in this batch + */ +IMB_DLL_EXPORT void +imb_quic_chacha20_poly1305(IMB_MGR *state, + const void *key, + const IMB_CIPHER_DIRECTION cipher_dir, + void *dst_ptr_array[], + const void * const src_ptr_array[], + const uint64_t len_array[], + const void * const iv_ptr_array[], + const void * const aad_ptr_array[], + const uint64_t aad_len, + void *tag_ptr_array[], + const uint64_t tag_len, + const uint64_t num_packets); + /** * @brief Sets up suite_id and session_id fields for selected cipher suite in * provided \a job structure diff --git a/lib/libIPSec_MB.def b/lib/libIPSec_MB.def index 97a31cdb..d32d2db1 100644 --- a/lib/libIPSec_MB.def +++ b/lib/libIPSec_MB.def @@ -710,3 +710,4 @@ EXPORTS sha224_one_block_sse_shani @684 sha256_sse_shani @685 sha256_one_block_sse_shani @686 + imb_quic_chacha20_poly1305 @687 diff --git a/lib/win_x64.mak b/lib/win_x64.mak index f21b8e54..6a0a26e3 100644 --- a/lib/win_x64.mak +++ b/lib/win_x64.mak @@ -364,6 +364,7 @@ lib_objs1 = \ $(OBJ_DIR)\self_test.obj \ $(OBJ_DIR)\quic_aes_gcm.obj \ $(OBJ_DIR)\quic_hp_aes_ecb.obj \ + $(OBJ_DIR)\quic_chacha20_poly1305.obj \ $(OBJ_DIR)\hmac_ipad_opad.obj \ $(OBJ_DIR)\cipher_suite_id.obj diff --git a/lib/x86_64/quic_chacha20_poly1305.c b/lib/x86_64/quic_chacha20_poly1305.c new file mode 100644 index 00000000..fbeaebf1 --- /dev/null +++ b/lib/x86_64/quic_chacha20_poly1305.c @@ -0,0 +1,143 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +#include "ipsec-mb.h" +#include "include/error.h" + +IMB_DLL_EXPORT void +imb_quic_chacha20_poly1305(IMB_MGR *state, + const void *key, + const IMB_CIPHER_DIRECTION cipher_dir, + void *dst_ptr_array[], + const void * const src_ptr_array[], + const uint64_t len_array[], + const void * const iv_ptr_array[], + const void * const aad_ptr_array[], + const uint64_t aad_len, + void *tag_ptr_array[], + const uint64_t tag_len, + const uint64_t num_packets) +{ + /** + * @note it can be out of place operation + * but AAD needs to be copied by the caller + */ + struct chacha20_poly1305_context_data ctx; + uint64_t n; + +#ifdef SAFE_PARAM + if (state == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_MBMGR); + return; + } + if (key == NULL) { + imb_set_errno(state, IMB_ERR_NULL_KEY); + return; + } + if (dst_ptr_array == NULL) { + imb_set_errno(state, IMB_ERR_NULL_DST); + return; + } + if (src_ptr_array == NULL) { + imb_set_errno(state, IMB_ERR_NULL_SRC); + return; + } + if (iv_ptr_array == NULL) { + imb_set_errno(state, IMB_ERR_NULL_IV); + return; + } + if (aad_ptr_array == NULL) { + imb_set_errno(state, IMB_ERR_NULL_AAD); + return; + } + if (tag_ptr_array == NULL) { + imb_set_errno(state, IMB_ERR_NULL_AUTH); + return; + } + for (n = 0; n < num_packets; n++) { + if (dst_ptr_array[n] == NULL && len_array[n] != 0) { + imb_set_errno(state, IMB_ERR_NULL_DST); + return; + } + if (src_ptr_array[n] == NULL && len_array[n] != 0) { + imb_set_errno(state, IMB_ERR_NULL_SRC); + return; + } + if (iv_ptr_array[n] == NULL) { + imb_set_errno(state, IMB_ERR_NULL_IV); + return; + } + if (aad_ptr_array[n] == NULL && aad_len != 0) { + imb_set_errno(state, IMB_ERR_NULL_AAD); + return; + } + if (tag_ptr_array[n] == NULL) { + imb_set_errno(state, IMB_ERR_NULL_AUTH); + return; + } + } + switch (cipher_dir) { + case IMB_DIR_ENCRYPT: + case IMB_DIR_DECRYPT: + break; + default: + imb_set_errno(state, IMB_ERR_JOB_CIPH_DIR); + return; + } +#endif /* SAFE_PARAM */ + + if (cipher_dir == IMB_DIR_ENCRYPT) { + for (n = 0; n < num_packets; n++) { + IMB_CHACHA20_POLY1305_INIT(state, key, &ctx, + iv_ptr_array[n], + aad_ptr_array[n], + aad_len); + IMB_CHACHA20_POLY1305_ENC_UPDATE(state, key, &ctx, + dst_ptr_array[n], + src_ptr_array[n], + len_array[n]); + IMB_CHACHA20_POLY1305_ENC_FINALIZE(state, &ctx, + tag_ptr_array[n], + tag_len); + } + } else /* decrypt direction */ { + for (n = 0; n < num_packets; n++) { + IMB_CHACHA20_POLY1305_INIT(state, key, &ctx, + iv_ptr_array[n], + aad_ptr_array[n], + aad_len); + IMB_CHACHA20_POLY1305_DEC_UPDATE(state, key, &ctx, + dst_ptr_array[n], + src_ptr_array[n], + len_array[n]); + IMB_CHACHA20_POLY1305_DEC_FINALIZE(state, &ctx, + tag_ptr_array[n], + tag_len); + } + } +} + -- GitLab From 8641b267b6e2316a66f9a878f9c8e1d0abecd72a Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 14 Jun 2023 11:44:56 +0100 Subject: [PATCH 024/204] lib: [QUIC] use chacha20-poly1305 job API internally --- lib/avx2_t1/mb_mgr_avx2_t1.c | 2 ++ lib/avx2_t2/mb_mgr_avx2_t2.c | 2 ++ lib/avx2_t3/mb_mgr_avx2_t3.c | 2 ++ lib/avx512_t1/mb_mgr_avx512_t1.c | 2 ++ lib/avx512_t2/mb_mgr_avx512_t2.c | 1 + lib/avx_t1/mb_mgr_avx_t1.c | 2 ++ lib/avx_t2/mb_mgr_avx_t2.c | 2 ++ lib/ipsec-mb.h | 4 +++ lib/no-aesni/mb_mgr_sse_no_aesni.c | 2 ++ lib/sse_t1/mb_mgr_sse_t1.c | 2 ++ lib/sse_t2/mb_mgr_sse_t2.c | 2 ++ lib/sse_t3/mb_mgr_sse_t3.c | 2 ++ lib/x86_64/quic_chacha20_poly1305.c | 50 ++++++++++++----------------- 13 files changed, 46 insertions(+), 29 deletions(-) diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index 6bdcbcf6..90e51078 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -484,6 +484,8 @@ init_mb_mgr_avx2_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index 63cd1325..a86c1d24 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -485,6 +485,8 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index d17a6241..e031e23f 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -492,6 +492,8 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx512_t1/mb_mgr_avx512_t1.c b/lib/avx512_t1/mb_mgr_avx512_t1.c index c5db36d2..f11bc0da 100644 --- a/lib/avx512_t1/mb_mgr_avx512_t1.c +++ b/lib/avx512_t1/mb_mgr_avx512_t1.c @@ -597,6 +597,8 @@ init_mb_mgr_avx512_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; } #include "mb_mgr_code.h" diff --git a/lib/avx512_t2/mb_mgr_avx512_t2.c b/lib/avx512_t2/mb_mgr_avx512_t2.c index 3d2e5fb6..2aef92e9 100644 --- a/lib/avx512_t2/mb_mgr_avx512_t2.c +++ b/lib/avx512_t2/mb_mgr_avx512_t2.c @@ -613,6 +613,7 @@ init_mb_mgr_avx512_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_vaes_avx512; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_vaes_avx512; + state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; } #include "mb_mgr_code.h" diff --git a/lib/avx_t1/mb_mgr_avx_t1.c b/lib/avx_t1/mb_mgr_avx_t1.c index 05de2dc5..c9a7f075 100644 --- a/lib/avx_t1/mb_mgr_avx_t1.c +++ b/lib/avx_t1/mb_mgr_avx_t1.c @@ -483,6 +483,8 @@ init_mb_mgr_avx_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; } #include "mb_mgr_code.h" diff --git a/lib/avx_t2/mb_mgr_avx_t2.c b/lib/avx_t2/mb_mgr_avx_t2.c index 0e9f32ba..aa0b826e 100644 --- a/lib/avx_t2/mb_mgr_avx_t2.c +++ b/lib/avx_t2/mb_mgr_avx_t2.c @@ -486,6 +486,8 @@ init_mb_mgr_avx_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; } #include "mb_mgr_code.h" diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 0df928be..98d33f47 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -945,6 +945,8 @@ typedef uint32_t (*crc32_fn_t)(const void *, const uint64_t); typedef void (*aes_ecb_quic_t)(const void *, const void *, void *out, uint64_t); +typedef IMB_JOB * (*chacha20_poly1305_quic_t)(struct IMB_MGR *, IMB_JOB *); + /* Multi-buffer manager flags passed to alloc_mb_mgr() */ #define IMB_FLAG_SHANI_OFF (1ULL << 0) /**< disable use of SHANI extension */ @@ -1176,6 +1178,8 @@ typedef struct IMB_MGR { void (*set_suite_id)(struct IMB_MGR *, IMB_JOB *); + chacha20_poly1305_quic_t chacha20_poly1305_quic; + /* in-order scheduler fields */ int earliest_job; /**< byte offset, -1 if none */ int next_job; /**< byte offset */ diff --git a/lib/no-aesni/mb_mgr_sse_no_aesni.c b/lib/no-aesni/mb_mgr_sse_no_aesni.c index 48ff9111..a55eee67 100644 --- a/lib/no-aesni/mb_mgr_sse_no_aesni.c +++ b/lib/no-aesni/mb_mgr_sse_no_aesni.c @@ -471,6 +471,8 @@ init_mb_mgr_sse_no_aesni_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse_no_aesni; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse_no_aesni; + state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; + state->set_suite_id = SET_SUITE_ID_FN; } diff --git a/lib/sse_t1/mb_mgr_sse_t1.c b/lib/sse_t1/mb_mgr_sse_t1.c index bbab72d2..fb96eb6f 100644 --- a/lib/sse_t1/mb_mgr_sse_t1.c +++ b/lib/sse_t1/mb_mgr_sse_t1.c @@ -491,6 +491,8 @@ init_mb_mgr_sse_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t2/mb_mgr_sse_t2.c b/lib/sse_t2/mb_mgr_sse_t2.c index 03e69e6b..b52aeb8a 100644 --- a/lib/sse_t2/mb_mgr_sse_t2.c +++ b/lib/sse_t2/mb_mgr_sse_t2.c @@ -489,6 +489,8 @@ init_mb_mgr_sse_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t3/mb_mgr_sse_t3.c b/lib/sse_t3/mb_mgr_sse_t3.c index 50ef1465..72d03812 100644 --- a/lib/sse_t3/mb_mgr_sse_t3.c +++ b/lib/sse_t3/mb_mgr_sse_t3.c @@ -490,6 +490,8 @@ init_mb_mgr_sse_t3_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; + + state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; } #include "mb_mgr_code.h" diff --git a/lib/x86_64/quic_chacha20_poly1305.c b/lib/x86_64/quic_chacha20_poly1305.c index fbeaebf1..f1b89259 100644 --- a/lib/x86_64/quic_chacha20_poly1305.c +++ b/lib/x86_64/quic_chacha20_poly1305.c @@ -27,6 +27,7 @@ #include "ipsec-mb.h" #include "include/error.h" +#include "include/chacha20_poly1305.h" IMB_DLL_EXPORT void imb_quic_chacha20_poly1305(IMB_MGR *state, @@ -46,7 +47,6 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, * @note it can be out of place operation * but AAD needs to be copied by the caller */ - struct chacha20_poly1305_context_data ctx; uint64_t n; #ifdef SAFE_PARAM @@ -110,34 +110,26 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, } #endif /* SAFE_PARAM */ - if (cipher_dir == IMB_DIR_ENCRYPT) { - for (n = 0; n < num_packets; n++) { - IMB_CHACHA20_POLY1305_INIT(state, key, &ctx, - iv_ptr_array[n], - aad_ptr_array[n], - aad_len); - IMB_CHACHA20_POLY1305_ENC_UPDATE(state, key, &ctx, - dst_ptr_array[n], - src_ptr_array[n], - len_array[n]); - IMB_CHACHA20_POLY1305_ENC_FINALIZE(state, &ctx, - tag_ptr_array[n], - tag_len); - } - } else /* decrypt direction */ { - for (n = 0; n < num_packets; n++) { - IMB_CHACHA20_POLY1305_INIT(state, key, &ctx, - iv_ptr_array[n], - aad_ptr_array[n], - aad_len); - IMB_CHACHA20_POLY1305_DEC_UPDATE(state, key, &ctx, - dst_ptr_array[n], - src_ptr_array[n], - len_array[n]); - IMB_CHACHA20_POLY1305_DEC_FINALIZE(state, &ctx, - tag_ptr_array[n], - tag_len); - } + IMB_JOB job; + + job.key_len_in_bytes = 32; + job.enc_keys = key; + job.iv_len_in_bytes = 12; + job.cipher_start_src_offset_in_bytes = 0; + job.hash_start_src_offset_in_bytes = 0; + job.auth_tag_output_len_in_bytes = tag_len; + job.u.CHACHA20_POLY1305.aad_len_in_bytes = aad_len; + + job.cipher_direction = cipher_dir; + for (n = 0; n < num_packets; n++) { + job.src = src_ptr_array[n]; + job.dst = dst_ptr_array[n]; + job.iv = iv_ptr_array[n]; + job.msg_len_to_cipher_in_bytes = len_array[n]; + job.msg_len_to_hash_in_bytes = len_array[n]; + job.auth_tag_output = tag_ptr_array[n]; + job.u.CHACHA20_POLY1305.aad = aad_ptr_array[n]; + state->chacha20_poly1305_quic(state, &job); } } -- GitLab From d435a3a6aca08ce57d6da2697e7003c8c7e33832 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 14 Jun 2023 20:42:34 +0100 Subject: [PATCH 025/204] test: [QUIC] add CHACHA20-POLY1305 tests --- ReleaseNotes.txt | 3 + test/kat-app/chacha20_poly1305_test.c | 157 +++++++++++++++++++------- 2 files changed, 118 insertions(+), 42 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 508deea9..08080c2a 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -7,6 +7,9 @@ Unreleased Library - QUIC CHACHA20-POLY1305 API added. +Test Applications +- QUIC CHACHA20-POLY1305 tests added. + v1.4 June 2023 ======================================================================== diff --git a/test/kat-app/chacha20_poly1305_test.c b/test/kat-app/chacha20_poly1305_test.c index d89afad3..1955fa5f 100644 --- a/test/kat-app/chacha20_poly1305_test.c +++ b/test/kat-app/chacha20_poly1305_test.c @@ -86,18 +86,18 @@ static const uint8_t aad_vec0[] = { 0xc4, 0xc5, 0xc6, 0xc7 }; -static const uint8_t key_vec0[32] = { +static const uint8_t key_vec0[KEY_SZ] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f }; -static const uint8_t iv_vec0[12] = { +static const uint8_t iv_vec0[IV_SZ] = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, }; -static const uint8_t tag_vec0[16] = { +static const uint8_t tag_vec0[DIGEST_SZ] = { 0x1a, 0xe1, 0x0b, 0x59, 0x4f, 0x09, 0xe2, 0x6a, 0x7e, 0x90, 0x2e, 0xcb, 0xd0, 0x60, 0x06, 0x91 }; @@ -105,7 +105,7 @@ static const uint8_t tag_vec0[16] = { /* A.5. ChaCha20-Poly1305 AEAD Decryption */ -static const uint8_t key_vec1[32] = { +static const uint8_t key_vec1[KEY_SZ] = { 0x1c, 0x92, 0x40, 0xa5, 0xeb, 0x55, 0xd3, 0x8a, 0xf3, 0x33, 0x88, 0x86, 0x04, 0xf6, 0xb5, 0xf0, 0x47, 0x39, 0x17, 0xc1, 0x40, 0x2b, 0x80, 0x09, @@ -149,7 +149,7 @@ static const uint8_t cipher_vec1[] = { 0x9b }; -static const uint8_t iv_vec1[12] = { +static const uint8_t iv_vec1[IV_SZ] = { 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; @@ -159,7 +159,7 @@ static const uint8_t aad_vec1[] = { 0x00, 0x00, 0x4e, 0x91 }; -static const uint8_t tag_vec1[16] = { +static const uint8_t tag_vec1[DIGEST_SZ] = { 0xee, 0xad, 0x9d, 0x67, 0x89, 0x0c, 0xbb, 0x22, 0x39, 0x23, 0x36, 0xfe, 0xa1, 0x85, 0x1f, 0x38 }; @@ -201,14 +201,14 @@ static const uint8_t plain_vec1[] = { 0x9d }; -static const uint8_t key_vec2[] = { +static const uint8_t key_vec2[KEY_SZ] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x66, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f }; -static const uint8_t iv_vec2[] = { +static const uint8_t iv_vec2[IV_SZ] = { 0x01, 0x02, 0x04, 0x08, 0x0b, 0x0d, 0x0f, 0x10, 0x10, 0x11, 0x12, 0x13 }; @@ -218,7 +218,7 @@ static const uint8_t aad_vec2[] = { 0x10, 0x12, 0x14, 0x16 }; -static const uint8_t tag_vec2[] = { +static const uint8_t tag_vec2[DIGEST_SZ] = { 0x32, 0x08, 0x45, 0xB8, 0x85, 0xDD, 0xB5, 0x81, 0x74, 0x36, 0xE3, 0x11, 0x3F, 0x51, 0x6D, 0xBF }; @@ -246,24 +246,14 @@ struct aead_vector { }; static int -aead_job_ok(struct IMB_MGR *mb_mgr, - const struct aead_vector *vec, - const struct IMB_JOB *job, +aead_ok(const struct aead_vector *vec, + const size_t auth_len, + const uint8_t *out_text, + const IMB_CIPHER_DIRECTION cipher_dir, const uint8_t *auth, const uint8_t *padding, const size_t sizeof_padding) { - const size_t auth_len = job->auth_tag_output_len_in_bytes; - const uint8_t *out_text = (const uint8_t *) job->dst; - - if (job->status != IMB_STATUS_COMPLETED) { - const int errcode = imb_get_errno(mb_mgr); - - printf("Error!: job status %d, errno %d => %s\n", - job->status, errcode, imb_get_strerror(errcode)); - return 0; - } - /* hash checks */ if (memcmp(padding, &auth[sizeof_padding + auth_len], sizeof_padding)) { @@ -286,17 +276,17 @@ aead_job_ok(struct IMB_MGR *mb_mgr, return 0; } - if (job->cipher_direction == IMB_DIR_ENCRYPT) { - if (memcmp(vec->cipher, job->dst, vec->msg_len)) { + if (cipher_dir == IMB_DIR_ENCRYPT) { + if (memcmp(vec->cipher, out_text, vec->msg_len)) { printf("cipher text mismatched\n"); - hexdump(stderr, "Received", job->dst, vec->msg_len); + hexdump(stderr, "Received", out_text, vec->msg_len); hexdump(stderr, "Expected", vec->cipher, vec->msg_len); return 0; } } else { - if (memcmp(vec->plain, job->dst, vec->msg_len)) { + if (memcmp(vec->plain, out_text, vec->msg_len)) { printf("plain text mismatched\n"); - hexdump(stderr, "Received", job->dst, vec->msg_len); + hexdump(stderr, "Received", out_text, vec->msg_len); hexdump(stderr, "Expected", vec->plain, vec->msg_len); return 0; } @@ -340,13 +330,13 @@ test_aead(struct IMB_MGR *mb_mgr, memset(targets, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - auths[i] = malloc(16 + (sizeof(padding) * 2)); + auths[i] = malloc(DIGEST_SZ + (sizeof(padding) * 2)); if (auths[i] == NULL) { fprintf(stderr, "Can't allocate buffer memory\n"); goto end; } - memset(auths[i], -1, 16 + (sizeof(padding) * 2)); + memset(auths[i], -1, DIGEST_SZ + (sizeof(padding) * 2)); } for (i = 0; i < num_jobs; i++) { @@ -367,6 +357,64 @@ test_aead(struct IMB_MGR *mb_mgr, } } + /* QUIC API */ + const void *src_ptr_array[IMB_MAX_JOBS]; + void *dst_ptr_array[IMB_MAX_JOBS]; + const void *aad_ptr_array[IMB_MAX_JOBS]; + void *tag_ptr_array[IMB_MAX_JOBS]; + const void *iv_ptr_array[IMB_MAX_JOBS]; + uint64_t len_array[IMB_MAX_JOBS]; + + for (i = 0; i < num_jobs; i++) { + if (in_place) + src_ptr_array[i] = targets[i] + sizeof(padding); + else + if (dir == IMB_DIR_ENCRYPT) + src_ptr_array[i] = vec->plain; + else + src_ptr_array[i] = vec->cipher; + + dst_ptr_array[i] = targets[i] + sizeof(padding); + + aad_ptr_array[i] = vec->aad; + iv_ptr_array[i] = vec->iv; + tag_ptr_array[i] = auths[i] + sizeof(padding); + len_array[i] = vec->msg_len; + } + + imb_quic_chacha20_poly1305(mb_mgr, + vec->key, + dir, + dst_ptr_array, + src_ptr_array, + len_array, + iv_ptr_array, + aad_ptr_array, + vec->aad_len, + tag_ptr_array, + DIGEST_SZ, + num_jobs); + + for (i = 0; i < num_jobs; i++) { + if (!aead_ok(vec, DIGEST_SZ, dst_ptr_array[i], dir, auths[i], + padding, sizeof(padding))) + goto end; + } + + /* Reset the source buffers */ + for (i = 0; i < num_jobs; i++) { + memset(targets[i], -1, vec->msg_len + (sizeof(padding) * 2)); + + if (in_place) { + if (dir == IMB_DIR_ENCRYPT) + memcpy(targets[i] + sizeof(padding), + vec->plain, vec->msg_len); + else + memcpy(targets[i] + sizeof(padding), + vec->cipher, vec->msg_len); + } + } + while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -381,7 +429,7 @@ test_aead(struct IMB_MGR *mb_mgr, job->hash_alg = IMB_AUTH_CHACHA20_POLY1305; job->enc_keys = vec->key; job->dec_keys = vec->key; - job->key_len_in_bytes = 32; + job->key_len_in_bytes = KEY_SZ; job->u.CHACHA20_POLY1305.aad = vec->aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aad_len; @@ -396,22 +444,31 @@ test_aead(struct IMB_MGR *mb_mgr, job->dst = targets[i] + sizeof(padding); job->iv = vec->iv; - job->iv_len_in_bytes = 12; + job->iv_len_in_bytes = IV_SZ; job->msg_len_to_cipher_in_bytes = vec->msg_len; job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_hash_in_bytes = vec->msg_len; job->hash_start_src_offset_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = 16; + job->auth_tag_output_len_in_bytes = DIGEST_SZ; job->user_data = auths[i]; job = IMB_SUBMIT_JOB(mb_mgr); if (job) { jobs_rx++; - if (!aead_job_ok(mb_mgr, vec, job, job->user_data, - padding, sizeof(padding))) + if (job->status != IMB_STATUS_COMPLETED) { + const int errcode = imb_get_errno(mb_mgr); + + printf("Error!: job status %d, errno %d => %s\n", + job->status, errcode, imb_get_strerror(errcode)); + goto end; + } + + if (!aead_ok(vec, job->auth_tag_output_len_in_bytes, + job->dst, dir, job->user_data, + padding, sizeof(padding))) goto end; } else { int err = imb_get_errno(mb_mgr); @@ -427,7 +484,15 @@ test_aead(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!aead_job_ok(mb_mgr, vec, job, job->user_data, + if (job->status != IMB_STATUS_COMPLETED) { + const int errcode = imb_get_errno(mb_mgr); + + printf("Error!: job status %d, errno %d => %s\n", + job->status, errcode, imb_get_strerror(errcode)); + goto end; + } + + if (!aead_ok(vec, job->auth_tag_output_len_in_bytes, job->dst, dir, job->user_data, padding, sizeof(padding))) goto end; } @@ -450,7 +515,7 @@ test_aead(struct IMB_MGR *mb_mgr, /* reset buffers */ for (i = 0; i < num_jobs; i++) { - memset(auths[i], -1, 16 + (sizeof(padding) * 2)); + memset(auths[i], -1, DIGEST_SZ + (sizeof(padding) * 2)); memset(targets[i], -1, vec->msg_len + (sizeof(padding) * 2)); if (in_place) { @@ -477,7 +542,7 @@ test_aead(struct IMB_MGR *mb_mgr, job->hash_alg = IMB_AUTH_CHACHA20_POLY1305; job->enc_keys = vec->key; job->dec_keys = vec->key; - job->key_len_in_bytes = 32; + job->key_len_in_bytes = KEY_SZ; job->u.CHACHA20_POLY1305.aad = vec->aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aad_len; @@ -492,14 +557,14 @@ test_aead(struct IMB_MGR *mb_mgr, job->dst = targets[i] + sizeof(padding); job->iv = vec->iv; - job->iv_len_in_bytes = 12; + job->iv_len_in_bytes = IV_SZ; job->msg_len_to_cipher_in_bytes = vec->msg_len; job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_hash_in_bytes = vec->msg_len; job->hash_start_src_offset_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = 16; + job->auth_tag_output_len_in_bytes = DIGEST_SZ; job->user_data = auths[i]; @@ -530,7 +595,15 @@ test_aead(struct IMB_MGR *mb_mgr, goto end; } - if (!aead_job_ok(mb_mgr, vec, job, job->user_data, + if (job->status != IMB_STATUS_COMPLETED) { + const int errcode = imb_get_errno(mb_mgr); + + printf("Error!: job status %d, errno %d => %s\n", + job->status, errcode, imb_get_strerror(errcode)); + goto end; + } + + if (!aead_ok(vec, job->auth_tag_output_len_in_bytes, job->dst, dir, job->user_data, padding, sizeof(padding))) goto end; jobs_rx++; @@ -1129,7 +1202,7 @@ test_sgl(struct IMB_MGR *mb_mgr, hexdump(stderr, "SGL output", segments[i], last_seg_sz); test_suite_update(ctx, 0, 1); } - if (memcmp(sgl_digest, linear_digest, 16) != 0) { + if (memcmp(sgl_digest, linear_digest, DIGEST_SZ) != 0) { printf("hash mismatched (segment size = %u)\n", seg_sz); hexdump(stderr, "Linear digest", -- GitLab From c02f01516317940930605f0a04d97e4d378fac11 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 8 Jun 2023 13:39:09 +0000 Subject: [PATCH 026/204] perf: [QUIC] add CHACHA20-POLY1305 QUIC benchmark --- perf/ipsec_perf.c | 66 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 957b1ebe..19357fc6 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -1534,6 +1534,67 @@ set_size_lists(uint32_t *cipher_size_list, uint32_t *hash_size_list, uint64_t *x #define TAG_LEN 16 #ifndef __aarch64__ +static void +bench_quic_chacha20_poly1305(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) +{ + void *out[MAX_K]; + const void *in[MAX_K]; + const void *iv[MAX_K]; + const void *aad[MAX_K]; + void *tag[MAX_K]; + uint64_t len[MAX_K]; + const uint8_t kp[32] = { 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03, 0xaa, 0x55, 0x11, + 0x44, 0x01, 0x02, 0x00, 0x03, 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, + 0x00, 0x03, 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03 }; + const uint64_t pkt_size = 16384; + const int K = MAX_K; + uint32_t aux; + uint64_t n; + int i; + + printf("QUIC-API CHACHA20-POLY1305 test start...\n" + " packet-size: %lu\n" + " number of packets : %d\n" + " iterations: %lu\n", + (unsigned long) pkt_size, K, (unsigned long) n_max); + + for (n = 0, i = 0; i < K; i++) { + iv[i] = &blob[n]; + n += IV_LEN; + + aad[i] = &blob[n]; + n += AAD_LEN; + + in[i] = &blob[n]; + n += pkt_size; + + out[i] = &blob[n]; + n += pkt_size; + + tag[i] = &blob[n]; + n += TAG_LEN; + + len[i] = pkt_size; + } + + const uint64_t tsc_start = __rdtscp(&aux); + + for (n = 0; n < n_max; n++) { + imb_quic_chacha20_poly1305(p_mgr, kp, IMB_DIR_ENCRYPT, (void **) out, + (const void *const *) in, len, (const void *const *) iv, + (const void *const *) &aad, AAD_LEN, (void **) tag, + TAG_LEN, K); + } + + const uint64_t tsc_end = __rdtscp(&aux); + const uint64_t cpi = (tsc_end - tsc_start) / n_max; + const uint64_t cpp = cpi / (uint64_t) K; + + printf("QUIC-API CHACHA20-POLY1305 cycles/iteration = %lu, " + "cycles/packet = %lu\n", + (unsigned long) cpi, (unsigned long) cpp); +} + static void bench_quic_aes_gcm(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) { @@ -1543,8 +1604,8 @@ bench_quic_aes_gcm(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) const void *aad[MAX_K]; void *tag[MAX_K]; uint64_t len[MAX_K]; - const uint8_t kp[16] = { 0xaa, 055, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03, - 0xaa, 055, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03 }; + const uint8_t kp[16] = { 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03, + 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03 }; struct gcm_key_data key; const uint64_t pkt_size = 16384; const int K = MAX_K; @@ -1692,6 +1753,7 @@ quic_main(IMB_MGR *p_mgr) bench_quic_aes_ecb_hp(p_mgr, n_max, blob_ptr); bench_quic_aes_gcm(p_mgr, n_max, blob_ptr); + bench_quic_chacha20_poly1305(p_mgr, n_max, blob_ptr); } free(blob_ptr); } -- GitLab From 5eb72b5a78ad7070b19bed9aa57ce0a200407127 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 22 Jun 2023 12:14:27 +0100 Subject: [PATCH 027/204] perf: [QUIC] refactor QUIC test Performance tests for QUIC API can be launched now per algorithm (using --aead-algo aes-gcm-128, --aead-algo chacha20-poly1305 or --cipher-algo aes-ecb-128, alongside --quic-api), enabling benchmarking of various packet sizes (except for AES-ECB, which is fixed to 16 bytes) and iterations, like any other algorithm. --- ReleaseNotes.txt | 4 + perf/ipsec_perf.c | 273 +++++++++++++++++++++++----------------------- 2 files changed, 141 insertions(+), 136 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 08080c2a..f96d5549 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -10,6 +10,10 @@ Library Test Applications - QUIC CHACHA20-POLY1305 tests added. +Performance Applications +- New parameter added to benchmark QUIC `--quic-api`. +- Burst API is benchmarked by default now. + v1.4 June 2023 ======================================================================== diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 19357fc6..041de77b 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -743,8 +743,6 @@ static uint32_t pb_mod = 0; static int silent_progress_bar = 0; static int plot_output_option = 0; -static int quic_api_test = 0; - /* API types */ typedef enum { TEST_API_JOB = 0, @@ -752,11 +750,12 @@ typedef enum { TEST_API_CIPHER_BURST, TEST_API_HASH_BURST, TEST_API_DIRECT, + TEST_API_QUIC, TEST_API_NUMOF } TEST_API; -const char *str_api_list[TEST_API_NUMOF] = { "single job", "burst", "cipher-only burst", - "hash-only burst", "direct" }; +const char *str_api_list[TEST_API_NUMOF] = { "single job", "burst", "cipher-only burst", + "hash-only burst", "direct", "QUIC" }; static TEST_API test_api = TEST_API_BURST; /* test burst API by default */ static uint32_t burst_size = 0; /* num jobs to pass to burst API */ @@ -1534,8 +1533,9 @@ set_size_lists(uint32_t *cipher_size_list, uint32_t *hash_size_list, uint64_t *x #define TAG_LEN 16 #ifndef __aarch64__ -static void -bench_quic_chacha20_poly1305(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) +static uint64_t +do_test_quic_chacha_poly(struct params_s *params, const uint32_t num_iter, IMB_MGR *p_mgr, + uint8_t *blob) { void *out[MAX_K]; const void *in[MAX_K]; @@ -1543,27 +1543,23 @@ bench_quic_chacha20_poly1305(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob const void *aad[MAX_K]; void *tag[MAX_K]; uint64_t len[MAX_K]; - const uint8_t kp[32] = { 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03, 0xaa, 0x55, 0x11, - 0x44, 0x01, 0x02, 0x00, 0x03, 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, - 0x00, 0x03, 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03 }; - const uint64_t pkt_size = 16384; - const int K = MAX_K; + const uint8_t kp[32]; + int K = MAX_K; + uint64_t time = 0; uint32_t aux; uint64_t n; int i; + const uint64_t pkt_size = params->job_size; - printf("QUIC-API CHACHA20-POLY1305 test start...\n" - " packet-size: %lu\n" - " number of packets : %d\n" - " iterations: %lu\n", - (unsigned long) pkt_size, K, (unsigned long) n_max); + if (burst_size != 0 && burst_size < MAX_K) + K = burst_size; for (n = 0, i = 0; i < K; i++) { iv[i] = &blob[n]; n += IV_LEN; aad[i] = &blob[n]; - n += AAD_LEN; + n += aad_size; in[i] = &blob[n]; n += pkt_size; @@ -1577,26 +1573,41 @@ bench_quic_chacha20_poly1305(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob len[i] = pkt_size; } - const uint64_t tsc_start = __rdtscp(&aux); + uint32_t full_num_iter = num_iter / K; + uint32_t last_iter = num_iter % K; - for (n = 0; n < n_max; n++) { - imb_quic_chacha20_poly1305(p_mgr, kp, IMB_DIR_ENCRYPT, (void **) out, +#ifndef _WIN32 + if (use_unhalted_cycles) + time = read_cycles(params->core); + else +#endif + time = __rdtscp(&aux); + + for (n = 0; n < full_num_iter; n++) + imb_quic_chacha20_poly1305(p_mgr, kp, params->cipher_dir, (void **) out, (const void *const *) in, len, (const void *const *) iv, - (const void *const *) &aad, AAD_LEN, (void **) tag, + (const void *const *) &aad, aad_size, (void **) tag, TAG_LEN, K); - } - const uint64_t tsc_end = __rdtscp(&aux); - const uint64_t cpi = (tsc_end - tsc_start) / n_max; - const uint64_t cpp = cpi / (uint64_t) K; + if (last_iter != 0) + imb_quic_chacha20_poly1305(p_mgr, kp, params->cipher_dir, (void **) out, + (const void *const *) in, len, (const void *const *) iv, + (const void *const *) &aad, aad_size, (void **) tag, + TAG_LEN, last_iter); + +#ifndef _WIN32 + if (use_unhalted_cycles) + time = (read_cycles(params->core) - rd_cycles_cost) - time; + else +#endif + time = __rdtscp(&aux) - time; - printf("QUIC-API CHACHA20-POLY1305 cycles/iteration = %lu, " - "cycles/packet = %lu\n", - (unsigned long) cpi, (unsigned long) cpp); + return time / num_iter; } -static void -bench_quic_aes_gcm(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) +static uint64_t +do_test_quic_aes_gcm(struct params_s *params, const uint32_t num_iter, IMB_MGR *p_mgr, + uint8_t *blob) { void *out[MAX_K]; const void *in[MAX_K]; @@ -1607,24 +1618,22 @@ bench_quic_aes_gcm(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) const uint8_t kp[16] = { 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03, 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03 }; struct gcm_key_data key; - const uint64_t pkt_size = 16384; - const int K = MAX_K; + int K = MAX_K; + uint64_t time = 0; uint32_t aux; uint64_t n; int i; + const uint64_t pkt_size = params->job_size; - printf("QUIC-API AES-GCM-128 test start...\n" - " packet-size: %lu\n" - " number of packets : %d\n" - " iterations: %lu\n", - (unsigned long) pkt_size, K, (unsigned long) n_max); + if (burst_size != 0 && burst_size < MAX_K) + K = burst_size; for (n = 0, i = 0; i < K; i++) { iv[i] = &blob[n]; n += IV_LEN; aad[i] = &blob[n]; - n += AAD_LEN; + n += aad_size; in[i] = &blob[n]; n += pkt_size; @@ -1640,38 +1649,56 @@ bench_quic_aes_gcm(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) IMB_AES128_GCM_PRE(p_mgr, kp, &key); - const uint64_t tsc_start = __rdtscp(&aux); + uint32_t full_num_iter = num_iter / K; + uint32_t last_iter = num_iter % K; + +#ifndef _WIN32 + if (use_unhalted_cycles) + time = read_cycles(params->core); + else +#endif + time = __rdtscp(&aux); - for (n = 0; n < n_max; n++) { - imb_quic_aes_gcm(p_mgr, &key, IMB_KEY_128_BYTES, IMB_DIR_ENCRYPT, (void **) out, + for (n = 0; n < full_num_iter; n++) + imb_quic_aes_gcm(p_mgr, &key, IMB_KEY_128_BYTES, params->cipher_dir, (void **) out, (const void *const *) in, len, (const void *const *) iv, - (const void *const *) &aad, AAD_LEN, (void **) tag, TAG_LEN, K); - } + (const void *const *) &aad, aad_size, (void **) tag, TAG_LEN, K); - const uint64_t tsc_end = __rdtscp(&aux); - const uint64_t cpi = (tsc_end - tsc_start) / n_max; - const uint64_t cpp = cpi / (uint64_t) K; + if (last_iter != 0) + imb_quic_aes_gcm(p_mgr, &key, IMB_KEY_128_BYTES, params->cipher_dir, (void **) out, + (const void *const *) in, len, (const void *const *) iv, + (const void *const *) &aad, aad_size, (void **) tag, TAG_LEN, + last_iter); +#ifndef _WIN32 + if (use_unhalted_cycles) + time = (read_cycles(params->core) - rd_cycles_cost) - time; + else +#endif + time = __rdtscp(&aux) - time; - printf("QUIC-API AES-GCM-128 cycles/iteration = %lu, " - "cycles/packet = %lu\n", - (unsigned long) cpi, (unsigned long) cpp); + return time / num_iter; } -static void -bench_quic_aes_ecb_hp(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) +static uint64_t +do_test_quic_aes_ecb_hp(struct params_s *params, const uint32_t num_iter, IMB_MGR *p_mgr, + uint8_t *blob) { void *out[MAX_K]; const void *in[MAX_K]; - const uint8_t kp[16] = { 0xaa, 055, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03, - 0xaa, 055, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03 }; + const uint8_t kp[16] = { 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03, + 0xaa, 0x55, 0x11, 0x44, 0x01, 0x02, 0x00, 0x03 }; DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); - const int K = MAX_K; - const uint64_t pkt_size = 16; + int K = MAX_K; + uint64_t time = 0; + const uint64_t pkt_size = 16; /* Fixed packet size for this API */ uint32_t aux; uint64_t n; int i; + if (burst_size != 0 && burst_size < MAX_K) + K = burst_size; + for (n = 0, i = 0; i < K; i++) { in[i] = &blob[n]; n += pkt_size; @@ -1680,82 +1707,33 @@ bench_quic_aes_ecb_hp(IMB_MGR *p_mgr, const uint64_t n_max, uint8_t *blob) n += pkt_size; } - printf("QUIC-API AES-ECB-128 test start...\n" - " packet-size: %lu\n" - " number of packets : %d\n" - " iterations: %lu\n", - (unsigned long) pkt_size, K, (unsigned long) n_max); - IMB_AES_KEYEXP_128(p_mgr, kp, enc_keys, dec_keys); - const uint64_t tsc_start = __rdtscp(&aux); + uint32_t full_num_iter = num_iter / K; + uint32_t last_iter = num_iter % K; + +#ifndef _WIN32 + if (use_unhalted_cycles) + time = read_cycles(params->core); + else +#endif + time = __rdtscp(&aux); - for (n = 0; n < n_max; n++) + for (n = 0; n < full_num_iter; n++) imb_quic_hp_aes_ecb(p_mgr, enc_keys, (void **) out, (const void *const *) in, K, IMB_KEY_128_BYTES); - const uint64_t tsc_end = __rdtscp(&aux); - const uint64_t cpi = (tsc_end - tsc_start) / n_max; - const uint64_t cpp = cpi / (uint64_t) K; - - printf("QUIC-API AES-ECB-128 cycles/iteration = %lu, " - "cycles/packet = %lu\n", - (unsigned long) cpi, (unsigned long) cpp); -} - -static void -quic_main(IMB_MGR *p_mgr) -{ - const size_t blob_sz = (AAD_LEN + IV_LEN + TAG_LEN + PKT_SIZE_MAX) * MAX_K * 2; - - uint8_t *blob_ptr = (uint8_t *) malloc(blob_sz); - - if (blob_ptr == NULL) { - printf("Error allocating QUIC-API test buffer!\n"); - exit(EXIT_FAILURE); - } - - memset(blob_ptr, 0xaa, blob_sz); - - enum arch_type_e arch; - - for (arch = ARCH_SSE; arch <= ARCH_AVX512; arch++) { - if (archs[arch] == 0) - continue; - - switch (arch) { - case ARCH_SSE: - printf("SSE\n"); - init_mb_mgr_sse(p_mgr); - break; - case ARCH_AVX: - printf("AVX\n"); - init_mb_mgr_avx(p_mgr); - break; - case ARCH_AVX2: - printf("AVX2\n"); - init_mb_mgr_avx2(p_mgr); - break; - default: /* ARCH_AV512 */ - printf("AVX512\n"); - init_mb_mgr_avx512(p_mgr); - break; - } - - if (imb_get_errno(p_mgr) != 0) { - printf("Error initializing MB_MGR! %s\n", - imb_get_strerror(imb_get_errno(p_mgr))); - free(blob_ptr); - exit(EXIT_FAILURE); - } - - const uint64_t n_max = 50000; + if (last_iter != 0) + imb_quic_hp_aes_ecb(p_mgr, enc_keys, (void **) out, (const void *const *) in, + last_iter, IMB_KEY_128_BYTES); +#ifndef _WIN32 + if (use_unhalted_cycles) + time = (read_cycles(params->core) - rd_cycles_cost) - time; + else +#endif + time = __rdtscp(&aux) - time; - bench_quic_aes_ecb_hp(p_mgr, n_max, blob_ptr); - bench_quic_aes_gcm(p_mgr, n_max, blob_ptr); - bench_quic_chacha20_poly1305(p_mgr, n_max, blob_ptr); - } - free(blob_ptr); + return time / num_iter; } #endif /* __aarch64__ */ @@ -2804,7 +2782,7 @@ mean_median(uint64_t *array, uint32_t size, uint8_t *p_buffer, imb_uint128_t *p_ static void process_variant(IMB_MGR *mgr, const enum arch_type_e arch, struct params_s *params, struct variant_s *variant_ptr, const uint32_t run, uint8_t *p_buffer, - imb_uint128_t *p_keys) + imb_uint128_t *p_keys, void *quic_blob) { uint32_t sizes = params->num_sizes; uint64_t *times = &variant_ptr->avg_times[run]; @@ -2852,6 +2830,17 @@ process_variant(IMB_MGR *mgr, const enum arch_type_e arch, struct params_s *para fprintf(stderr, "Algorithm not supported with direct API\n"); exit(EXIT_FAILURE); } + } else if (test_api == TEST_API_QUIC) { + if (params->cipher_mode == TEST_AEAD_CHACHA20) + *times = do_test_quic_chacha_poly(params, num_iter, mgr, quic_blob); + else if (params->cipher_mode == TEST_GCM) + *times = do_test_quic_aes_gcm(params, num_iter, mgr, quic_blob); + else if (params->cipher_mode == TEST_ECB) + *times = do_test_quic_aes_ecb_hp(params, num_iter, mgr, quic_blob); + else { + fprintf(stderr, "Algorithm not supported with QUIC API\n"); + exit(EXIT_FAILURE); + } } else #endif *times = do_test(mgr, params, num_iter, p_buffer, p_keys); @@ -3030,17 +3019,27 @@ run_tests(void *arg) const uint32_t step_size = job_sizes[RANGE_STEP]; uint8_t *buf = NULL; imb_uint128_t *keys = NULL; + const size_t quic_blob_sz = (AAD_LEN + IV_LEN + TAG_LEN + max_size) * MAX_K * 2; + uint8_t *quic_blob_ptr = NULL; p_mgr = info->p_mgr; #ifndef __aarch64__ - if (quic_api_test) { - quic_main(p_mgr); -#ifndef _WIN32 - return NULL; -#else - return; -#endif + memset(¶ms, 0, sizeof(params)); + + if (job_size_count == 0) + params.num_sizes = ((max_size - min_size) / step_size) + 1; + else + params.num_sizes = job_size_count; + + if (test_api == TEST_API_QUIC) { + quic_blob_ptr = (uint8_t *) malloc(quic_blob_sz); + if (quic_blob_ptr == NULL) { + printf("Error allocating QUIC-API test buffer!\n"); + exit(EXIT_FAILURE); + } + + memset(quic_blob_ptr, 0xaa, quic_blob_sz); } #endif /* __aarch64__ */ @@ -3195,7 +3194,8 @@ run_tests(void *arg) goto exit_failure; } - process_variant(p_mgr, arch, ¶ms, variant_ptr, run, buf, keys); + process_variant(p_mgr, arch, ¶ms, variant_ptr, run, buf, keys, + quic_blob_ptr); /* update and print progress bar */ if (info->print_info) @@ -3220,6 +3220,8 @@ exit: free(variant_list[i].avg_times); free(variant_list); } + if (test_api == TEST_API_QUIC) + free(quic_blob_ptr); free_mem(&buf, &keys); free_mb_mgr(p_mgr); #ifndef _WIN32 @@ -3934,7 +3936,7 @@ main(int argc, char *argv[]) } else if (strcmp(argv[i], "--no-time-box") == 0) { use_timebox = 0; } else if (strcmp(argv[i], "--quic-api") == 0) { - quic_api_test = 1; + test_api = TEST_API_QUIC; } else if (strcmp(argv[i], "--buffer-offset") == 0) { i = get_next_num_arg((const char *const *) argv, i, argc, &buffer_offset, sizeof(buffer_offset)); @@ -3985,8 +3987,7 @@ main(int argc, char *argv[]) fprintf(stderr, "Unsupported direct API algorithm selected\n"); return EXIT_FAILURE; } - if (aead_algo_set == 0 && cipher_algo_set == 0 && hash_algo_set == 0 && - quic_api_test == 0) { + if (aead_algo_set == 0 && cipher_algo_set == 0 && hash_algo_set == 0) { fprintf(stderr, "No cipher, hash or " "AEAD algorithms selected\n"); usage(); -- GitLab From f3bdafc7d81c425f23adc3c653555b45ac8bcb00 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 28 Jun 2023 15:02:49 +0100 Subject: [PATCH 028/204] cmake: fix cmake header installation - fixes #126 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d137577b..f9ab0776 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,8 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils.cmake") # get version from public header file -imb_get_version("${CMAKE_CURRENT_SOURCE_DIR}/lib/ipsec-mb.h") +set(IMB_HDR "${CMAKE_CURRENT_SOURCE_DIR}/lib/ipsec-mb.h") +imb_get_version(${IMB_HDR}) message(STATUS "Project Version: ${IPSEC_MB_VERSION_FULL}") cmake_minimum_required(VERSION 3.16) -- GitLab From e7a924a495a7d14b1451a5c21e5f1d01da9d84d6 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 28 Jun 2023 15:46:18 +0100 Subject: [PATCH 029/204] cmake: support LIB_INSTALL_DIR - fixes #125 Allow setting: - library install directory with -DLIB_INSTALL_DIR - header install directory with -DINCLUDE_INSTALL_DIR - man page install directory with -DMAN_INSTALL_DIR --- lib/cmake/unix.cmake | 26 +++++++++++++++++++++----- lib/cmake/windows.cmake | 8 ++++++-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/lib/cmake/unix.cmake b/lib/cmake/unix.cmake index f0fa9d8e..cc98ff89 100644 --- a/lib/cmake/unix.cmake +++ b/lib/cmake/unix.cmake @@ -112,11 +112,27 @@ set_target_properties(${LIB} PROPERTIES SOVERSION ${SO_MAJOR_VER}) # set install rules -set(CMAKE_INSTALL_PREFIX "/usr" - CACHE STRING "Set default installation directory" FORCE) -install(TARGETS ${LIB} DESTINATION lib) -install(FILES ${IMB_HDR} DESTINATION include) +if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr" + CACHE STRING "Set default installation directory" FORCE) +endif() +if(NOT LIB_INSTALL_DIR) + set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib") +endif() +if(NOT INCLUDE_INSTALL_DIR) + set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include") +endif() +if(NOT MAN_INSTALL_DIR) + set(MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man/man7") +endif() + +message(STATUS "LIB_INSTALL_DIR... ${LIB_INSTALL_DIR}") +message(STATUS "INCLUDE_INSTALL_DIR... ${INCLUDE_INSTALL_DIR}") +message(STATUS "MAN_INSTALL_DIR... ${MAN_INSTALL_DIR}") + +install(TARGETS ${LIB} DESTINATION ${LIB_INSTALL_DIR}) +install(FILES ${IMB_HDR} DESTINATION ${INCLUDE_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libipsec-mb.7 ${CMAKE_CURRENT_SOURCE_DIR}/libipsec-mb-dev.7 - DESTINATION man/man7) + DESTINATION ${MAN_INSTALL_DIR}) diff --git a/lib/cmake/windows.cmake b/lib/cmake/windows.cmake index 02d39a1d..ba54b4ee 100644 --- a/lib/cmake/windows.cmake +++ b/lib/cmake/windows.cmake @@ -93,8 +93,12 @@ endif() add_library(${LIB} ${SRC_FILES_ASM} ${SRC_FILES_C} ${SRC_DEF_FILE}) # set install rules -set(CMAKE_INSTALL_PREFIX "c:/Program Files" - CACHE STRING "Set default installation directory" FORCE) +if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "c:/Program Files" + CACHE STRING "Set default installation directory" FORCE) +endif() +message(STATUS "CMAKE_INSTALL_PREFIX... ${CMAKE_INSTALL_PREFIX}") + install(TARGETS ${LIB} DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}) install(FILES -- GitLab From d358ca9bd3fb3a74b6f13dd51aecc21eb74f1674 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Thu, 29 Jun 2023 11:58:49 +0100 Subject: [PATCH 030/204] docs: update README cmake installation --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index c02b50a0..99958b38 100644 --- a/README.md +++ b/README.md @@ -676,6 +676,13 @@ To uninstall the library run: If you want to change install location then define PREFIX: `sudo cmake --install . --prefix=` +Or set install directory variables during configuration: +``` +cmake -DLIB_INSTALL_DIR=/usr/lib64 -DINCLUDE_INSTALL_DIR=/usr/include .. +cmake --build . --parallel +sudo cmake --install . +``` + ### Windows (x64 only) First compile the library and then install from a command prompt in administrator mode: -- GitLab From 7ade3eeb1dd2dc5e87aff89a734a8b4d11a67556 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 30 Jun 2023 16:33:19 +0100 Subject: [PATCH 031/204] test: remove imb-kat.exe binary file -- GitLab From 884cbc7c046c754317d09b409f2277540c82b571 Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Tue, 27 Jun 2023 14:30:42 +0100 Subject: [PATCH 032/204] test: [DES] Unify test vectors --- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 4 +- test/kat-app/des_test.c | 421 +++++++---------------------------- test/kat-app/des_test.json.c | 104 +++++++++ test/kat-app/win_x64.mak | 2 +- 5 files changed, 185 insertions(+), 347 deletions(-) create mode 100644 test/kat-app/des_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 0f2d1114..8de9f962 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -105,6 +105,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/ctr_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/ecb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/chacha_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/des_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 9c288a25..6e1fe30d 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -41,8 +41,8 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ - aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c ecb_test.json.c \ - chacha_test.json.c + ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ + des_test.json.c chacha_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/des_test.c b/test/kat-app/des_test.c index c4f08bc6..96262d32 100644 --- a/test/kat-app/des_test.c +++ b/test/kat-app/des_test.c @@ -33,252 +33,15 @@ #include -#include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "cipher_test.h" int des_test(struct IMB_MGR *mb_mgr); -struct des_vector { - const uint8_t *K; /* key */ - const uint8_t *IV; /* initialization vector */ - const uint8_t *P; /* plain text */ - uint64_t Plen; /* plain text length */ - const uint8_t *C; /* cipher text - same length as plain text */ -}; - -struct des3_vector { - const uint8_t *K1; /* key */ - const uint8_t *K2; /* key */ - const uint8_t *K3; /* key */ - const uint8_t *IV; /* initialization vector */ - const uint8_t *P; /* plain text */ - uint64_t Plen; /* plain text length */ - const uint8_t *C; /* cipher text - same length as plain text */ -}; - -/* CM-SP-SECv3.1-I07-170111 I.7 */ -static const uint8_t K1[] = { - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab -}; -static const uint8_t IV1[] = { - 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a -}; -static const uint8_t P1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x88, 0x41, 0x65, 0x06 -}; -static const uint8_t C1[] = { - 0x0d, 0xda, 0x5a, 0xcb, 0xd0, 0x5e, 0x55, 0x67, - 0x9f, 0x04, 0xd1, 0xb6, 0x41, 0x3d, 0x4e, 0xed -}; - -static const uint8_t K2[] = { - 0x3b, 0x38, 0x98, 0x37, 0x15, 0x20, 0xf7, 0x5e -}; -static const uint8_t IV2[] = { - 0x02, 0xa8, 0x11, 0x77, 0x4d, 0xcd, 0xe1, 0x3b -}; -static const uint8_t P2[] = { - 0x05, 0xef, 0xf7, 0x00, 0xe9, 0xa1, 0x3a, 0xe5, - 0xca, 0x0b, 0xcb, 0xd0, 0x48, 0x47, 0x64, 0xbd, - 0x1f, 0x23, 0x1e, 0xa8, 0x1c, 0x7b, 0x64, 0xc5, - 0x14, 0x73, 0x5a, 0xc5, 0x5e, 0x4b, 0x79, 0x63, - 0x3b, 0x70, 0x64, 0x24, 0x11, 0x9e, 0x09, 0xdc, - 0xaa, 0xd4, 0xac, 0xf2, 0x1b, 0x10, 0xaf, 0x3b, - 0x33, 0xcd, 0xe3, 0x50, 0x48, 0x47, 0x15, 0x5c, - 0xbb, 0x6f, 0x22, 0x19, 0xba, 0x9b, 0x7d, 0xf5 - -}; -static const uint8_t C2[] = { - 0xf3, 0x31, 0x8d, 0x01, 0x19, 0x4d, 0xa8, 0x00, - 0xa4, 0x2c, 0x10, 0xb5, 0x33, 0xd6, 0xbc, 0x11, - 0x97, 0x59, 0x2d, 0xcc, 0x9b, 0x5d, 0x35, 0x9a, - 0xc3, 0x04, 0x5d, 0x07, 0x4c, 0x86, 0xbf, 0x72, - 0xe5, 0x1a, 0x72, 0x25, 0x82, 0x22, 0x54, 0x03, - 0xde, 0x8b, 0x7a, 0x58, 0x5c, 0x6c, 0x28, 0xdf, - 0x41, 0x0e, 0x38, 0xd6, 0x2a, 0x86, 0xe3, 0x4f, - 0xa2, 0x7c, 0x22, 0x39, 0x60, 0x06, 0x03, 0x6f -}; - -static struct des_vector vectors[] = { - {K1, IV1, P1, sizeof(P1), C1}, - {K2, IV2, P2, sizeof(P2), C2}, -}; - -/* CM-SP-SECv3.1-I07-170111 I.7 */ -static const uint8_t DK1[] = { - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab -}; -static const uint8_t DIV1[] = { - 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a -}; -static const uint8_t DP1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x88, 0x41, 0x65, 0x06 -}; -static const uint8_t DC1[] = { - 0x0d, 0xda, 0x5a, 0xcb, 0xd0, 0x5e, 0x55, 0x67, - 0x9f, 0x04, 0xd1, 0xb6, 0x41, 0x3d, 0x4e, 0xed -}; - -static const uint8_t DK2[] = { - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab -}; -static const uint8_t DIV2[] = { - 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a -}; -static const uint8_t DP2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x91, - 0xd2, 0xd1, 0x9f -}; -static const uint8_t DC2[] = { - 0x0d, 0xda, 0x5a, 0xcb, 0xd0, 0x5e, 0x55, 0x67, - 0x51, 0x47, 0x46, 0x86, 0x8a, 0x71, 0xe5, 0x77, - 0xef, 0xac, 0x88 -}; - -static const uint8_t DK3[] = { - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab -}; -static const uint8_t DIV3[] = { - 0x51, 0x47, 0x46, 0x86, 0x8a, 0x71, 0xe5, 0x77 -}; -static const uint8_t DP3[] = { - 0xd2, 0xd1, 0x9f -}; -static const uint8_t DC3[] = { - 0xef, 0xac, 0x88 -}; - - -static struct des_vector docsis_vectors[] = { - {DK1, DIV1, DP1, sizeof(DP1), DC1}, - {DK2, DIV2, DP2, sizeof(DP2), DC2}, - {DK3, DIV3, DP3, sizeof(DP3), DC3}, -}; - -static struct des_vector des_cfb_vectors[] = { - {DK3, DIV3, DP3, sizeof(DP3), DC3}, -}; - -/* 3DES vectors - 2x and 3x keys */ - -static const uint8_t D3K1_1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3K2_1[] = { - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; - -static const uint8_t D3K3_1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3IV_1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - - -static const uint8_t D3PT_1[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -static const uint8_t D3CT_1[] = { - 0xdf, 0x0b, 0x6c, 0x9c, 0x31, 0xcd, 0x0c, 0xe4 -}; - -#define D3PT_LEN_1 8 - -static const uint8_t D3K1_2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3K2_2[] = { - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; - -static const uint8_t D3K3_2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3IV_2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3PT_2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; - -static const uint8_t D3CT_2[] = { - 0xdd, 0xad, 0xa1, 0x61, 0xe8, 0xd7, 0x96, 0x73, - 0xed, 0x75, 0x32, 0xe5, 0x92, 0x23, 0xcd, 0x0d -}; - -#define D3PT_LEN_2 16 - -static const uint8_t D3K1_3[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3K2_3[] = { - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; - -static const uint8_t D3K3_3[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 -}; - -static const uint8_t D3IV_3[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3PT_3[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -static const uint8_t D3CT_3[] = { - 0x58, 0xed, 0x24, 0x8f, 0x77, 0xf6, 0xb1, 0x9e -}; - -#define D3PT_LEN_3 8 - -static const uint8_t D3K1_4[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3K2_4[] = { - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; - -static const uint8_t D3K3_4[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 -}; - -static const uint8_t D3IV_4[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; - -static const uint8_t D3PT_4[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; - -static const uint8_t D3CT_4[] = { - 0x89, 0x4b, 0xc3, 0x08, 0x54, 0x26, 0xa4, 0x41, - 0xf2, 0x7f, 0x73, 0xae, 0x26, 0xab, 0xbf, 0x74 -}; - -#define D3PT_LEN_4 16 - -static struct des3_vector des3_vectors[] = { - { D3K1_1, D3K2_1, D3K3_1, D3IV_1, D3PT_1, D3PT_LEN_1, D3CT_1 }, - { D3K1_2, D3K2_2, D3K3_2, D3IV_2, D3PT_2, D3PT_LEN_2, D3CT_2 }, - { D3K1_3, D3K2_3, D3K3_3, D3IV_3, D3PT_3, D3PT_LEN_3, D3CT_3 }, - { D3K1_4, D3K2_4, D3K3_4, D3IV_4, D3PT_4, D3PT_LEN_4, D3CT_4 }, -}; +extern const struct cipher_test des_test_json[]; +extern const struct cipher_test des_docsis_test_json[]; +extern const struct cipher_test des_cfb_test_json[]; +extern const struct cipher_test des3_test_json[]; static int test_des_many(struct IMB_MGR *mb_mgr, @@ -466,72 +229,58 @@ test_des(struct IMB_MGR *mb_mgr, static void test_des_vectors(struct IMB_MGR *mb_mgr, - const int vec_cnt, - const struct des_vector *vec_tab, + const struct cipher_test *v, const char *banner, const IMB_CIPHER_MODE cipher, struct test_suite_context *ctx) { - int vect; + uint64_t ks[16]; printf("%s:\n", banner); - for (vect = 0; vect < vec_cnt; vect++) { + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector %d/%d PTLen:%d\n", - vect + 1, vec_cnt, - (int) vec_tab[vect].Plen); + printf("Standard vector %zu PTLen:%zu\n", + v->tcId, v->msgSize / 8); #else printf("."); #endif } - des_key_schedule(ks, vec_tab[vect].K); + des_key_schedule(ks, v->key); - if (test_des(mb_mgr, ks, NULL, NULL, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0)) { - printf("error #%d encrypt\n", vect + 1); + if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0)) { + printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks, NULL, NULL, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0)) { - printf("error #%d decrypt\n", vect + 1); + if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0)) { + printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks, NULL, NULL, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1)) { - printf("error #%d encrypt in-place\n", vect + 1); + if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1)) { + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks, NULL, NULL, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1)) { - printf("error #%d decrypt in-place\n", vect + 1); + if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1)) { + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -543,74 +292,67 @@ test_des_vectors(struct IMB_MGR *mb_mgr, static void test_des3_vectors(struct IMB_MGR *mb_mgr, - const int vec_cnt, - const struct des3_vector *vec_tab, + const struct cipher_test *v, const char *banner, struct test_suite_context *ctx) { - int vect; uint64_t ks1[16]; uint64_t ks2[16]; uint64_t ks3[16]; printf("%s:\n", banner); - for (vect = 0; vect < vec_cnt; vect++) { + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector %d/%d PTLen:%d\n", - vect + 1, vec_cnt, - (int) vec_tab[vect].Plen); + printf("Standard vector %zu PTLen:%zu\n", + v->tcId, v->msgSize / 8); #else printf("."); #endif } - des_key_schedule(ks1, vec_tab[vect].K1); - des_key_schedule(ks2, vec_tab[vect].K2); - des_key_schedule(ks3, vec_tab[vect].K3); - - if (test_des(mb_mgr, ks1, ks2, ks3, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, + des_key_schedule(ks1, v->key); + des_key_schedule(ks2, v->key + 8); + des_key_schedule(ks3, v->key + 16); + + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, IMB_CIPHER_DES3, 0)) { - printf("error #%d encrypt\n", vect + 1); + printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks1, ks2, ks3, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, IMB_CIPHER_DES3, 0)) { - printf("error #%d decrypt\n", vect + 1); + printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks1, ks2, ks3, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, IMB_CIPHER_DES3, 1)) { - printf("error #%d encrypt in-place\n", vect + 1); + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks1, ks2, ks3, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, IMB_CIPHER_DES3, 1)) { - printf("error #%d decrypt in-place\n", vect + 1); + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -623,36 +365,32 @@ test_des3_vectors(struct IMB_MGR *mb_mgr, static int des_cfb_validate(struct test_suite_context *ctx) { - unsigned i; + const struct cipher_test *v = des_cfb_test_json; printf("DES-CFB standard test vectors:\n"); - for (i = 0; i < DIM(des_cfb_vectors); i++) { + for (; v->msg != NULL; v++) { uint8_t output1[8]; uint8_t output2[8]; uint64_t ks[16]; - des_key_schedule(ks, des_cfb_vectors[i].K); + des_key_schedule(ks, v->key); /* Out of place */ /* encrypt test */ - des_cfb_one(output1, des_cfb_vectors[i].P, - (const uint64_t *)des_cfb_vectors[i].IV, ks, - (int)des_cfb_vectors[i].Plen); - if (memcmp(output1, des_cfb_vectors[i].C, - des_cfb_vectors[i].Plen)) { - printf("DES-CFB enc (OOP) vector %d mismatched\n", i); + des_cfb_one(output1, (const void *) v->msg, (const uint64_t *) v->iv, + ks, (int) v->msgSize / 8); + if (memcmp(output1, (const void *) v->ct, v->msgSize / 8)) { + printf("DES-CFB enc (OOP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } /* decrypt test */ - des_cfb_one(output2, output1, - (const uint64_t *)des_cfb_vectors[i].IV, ks, - (int)des_cfb_vectors[i].Plen); - if (memcmp(output2, des_cfb_vectors[i].P, - des_cfb_vectors[i].Plen)) { - printf("DES-CFB dec (OOP) vector %d mismatched\n", i); + des_cfb_one(output2, (const void *) v->ct, (const uint64_t *) v->iv, + ks, (int) v->msgSize / 8); + if (memcmp(output2, (const void *) v->msg, v->msgSize / 8)) { + printf("DES-CFB dec (OOP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -661,25 +399,21 @@ des_cfb_validate(struct test_suite_context *ctx) /* In place */ /* encrypt test */ - memcpy(output1, des_cfb_vectors[i].P, des_cfb_vectors[i].Plen); - des_cfb_one(output1, output1, - (const uint64_t *)des_cfb_vectors[i].IV, ks, - (int)des_cfb_vectors[i].Plen); - if (memcmp(output1, des_cfb_vectors[i].C, - des_cfb_vectors[i].Plen)) { - printf("DES-CFB enc (OOP) vector %d mismatched\n", i); + memcpy(output1, (const void *) v->msg, v->msgSize / 8); + des_cfb_one(output2, output1, (const uint64_t *) v->iv, ks, + (int) v->msgSize / 8); + if (memcmp(output2, (const void *) v->ct, v->msgSize / 8)) { + printf("DES-CFB enc (IP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } /* decrypt test */ - memcpy(output1, des_cfb_vectors[i].C, des_cfb_vectors[i].Plen); - des_cfb_one(output1, output1, - (const uint64_t *)des_cfb_vectors[i].IV, ks, - (int)des_cfb_vectors[i].Plen); - if (memcmp(output1, des_cfb_vectors[i].P, - des_cfb_vectors[i].Plen)) { - printf("DES-CFB dec (OOP) vector %d mismatched\n", i); + memcpy(output1, (const void *) v->ct, v->msgSize / 8); + des_cfb_one(output2, output1, (const uint64_t *) v->iv, + ks, (int) v->msgSize / 8); + if (memcmp(output2, (const void *) v->msg, v->msgSize / 8)) { + printf("DES-CFB dec (IP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -698,13 +432,12 @@ des_test(struct IMB_MGR *mb_mgr) int errors; test_suite_start(&ctx, "DES-CBC-64"); - test_des_vectors(mb_mgr, DIM(vectors), vectors, - "DES standard test vectors", IMB_CIPHER_DES, &ctx); + test_des_vectors(mb_mgr, des_test_json, "DES standard test vectors", + IMB_CIPHER_DES, &ctx); errors = test_suite_end(&ctx); test_suite_start(&ctx, "DOCSIS-DES-64"); - test_des_vectors(mb_mgr, DIM(docsis_vectors), docsis_vectors, - "DOCSIS DES standard test vectors", + test_des_vectors(mb_mgr, des_docsis_test_json, "DOCSIS DES standard test vectors", IMB_CIPHER_DOCSIS_DES, &ctx); errors += test_suite_end(&ctx); @@ -713,10 +446,10 @@ des_test(struct IMB_MGR *mb_mgr) errors += test_suite_end(&ctx); test_suite_start(&ctx, "3DES-CBC-192"); - test_des_vectors(mb_mgr, DIM(vectors), vectors, + test_des_vectors(mb_mgr, des_test_json, "3DES (single key) standard test vectors", IMB_CIPHER_DES3, &ctx); - test_des3_vectors(mb_mgr, DIM(des3_vectors), des3_vectors, + test_des3_vectors(mb_mgr, des3_test_json, "3DES (multiple keys) test vectors", &ctx); errors += test_suite_end(&ctx); diff --git a/test/kat-app/des_test.json.c b/test/kat-app/des_test.json.c new file mode 100644 index 00000000..6501130d --- /dev/null +++ b/test/kat-app/des_test.json.c @@ -0,0 +1,104 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* DES */ +#include "cipher_test.h" + +const struct cipher_test des_test_json[] = { + /* CM-SP-SECv3.1-I07-170111 I.7 */ + {64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", + "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x88\x41\x65\x06", + "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x9f\x04\xd1\xb6\x41\x3d\x4e\xed", 1, + 128}, + {64, 64, 2, "\x3b\x38\x98\x37\x15\x20\xf7\x5e", + "\x02\xa8\x11\x77\x4d\xcd\xe1\x3b", + "\x05\xef\xf7\x00\xe9\xa1\x3a\xe5\xca\x0b\xcb\xd0\x48\x47\x64\xbd\x1f\x23" + "\x1e\xa8\x1c\x7b\x64\xc5\x14\x73\x5a\xc5\x5e\x4b\x79\x63\x3b\x70\x64\x24" + "\x11\x9e\x09\xdc\xaa\xd4\xac\xf2\x1b\x10\xaf\x3b\x33\xcd\xe3\x50\x48\x47" + "\x15\x5c\xbb\x6f\x22\x19\xba\x9b\x7d\xf5", + "\xf3\x31\x8d\x01\x19\x4d\xa8\x00\xa4\x2c\x10\xb5\x33\xd6\xbc\x11\x97\x59" + "\x2d\xcc\x9b\x5d\x35\x9a\xc3\x04\x5d\x07\x4c\x86\xbf\x72\xe5\x1a\x72\x25" + "\x82\x22\x54\x03\xde\x8b\x7a\x58\x5c\x6c\x28\xdf\x41\x0e\x38\xd6\x2a\x86" + "\xe3\x4f\xa2\x7c\x22\x39\x60\x06\x03\x6f", + 1, 512}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; + +const struct cipher_test des_docsis_test_json[] = { + /* CM-SP-SECv3.1-I07-170111 I.7 */ + {64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", + "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x88\x41\x65\x06", + "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x9f\x04\xd1\xb6\x41\x3d\x4e\xed", 1, + 128}, + {64, 64, 2, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", + "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x91\xd2\xd1" + "\x9f", + "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x51\x47\x46\x86\x8a\x71\xe5\x77\xef\xac" + "\x88", + 1, 152}, + {64, 64, 3, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", + "\x51\x47\x46\x86\x8a\x71\xe5\x77", "\xd2\xd1\x9f", "\xef\xac\x88", 1, 24}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; + +const struct cipher_test des_cfb_test_json[] = { + /* CM-SP-SECv3.1-I07-170111 I.7 */ + {64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", + "\x51\x47\x46\x86\x8a\x71\xe5\x77", "\xd2\xd1\x9f", "\xef\xac\x88", 1, 24}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; + +const struct cipher_test des3_test_json[] = { + {64, 192, 1, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x00\x01" + "\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07", "\x00\x00\x00\x00\x00\x00\x00\x00", + "\xdf\x0b\x6c\x9c\x31\xcd\x0c\xe4", 1, 64}, + {64, 192, 2, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x00\x01" + "\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xdd\xad\xa1\x61\xe8\xd7\x96\x73\xed\x75\x32\xe5\x92\x23\xcd\x0d", 1, + 128}, + {64, 192, 3, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17", + "\x00\x01\x02\x03\x04\x05\x06\x07", "\x00\x00\x00\x00\x00\x00\x00\x00", + "\x58\xed\x24\x8f\x77\xf6\xb1\x9e", 1, 64}, + {64, 192, 4, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17", + "\x00\x01\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x89\x4b\xc3\x08\x54\x26\xa4\x41\xf2\x7f\x73\xae\x26\xab\xbf\x74", 1, + 128}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 0152ad2a..714923a7 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From e726a6ebccedb19d1a3c3a96c85353f7d6487893 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 3 Jul 2023 10:13:22 +0100 Subject: [PATCH 033/204] workflows: add linux cmake build and verify --- .github/workflows/cmake_linux_makefile.yml | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/cmake_linux_makefile.yml diff --git a/.github/workflows/cmake_linux_makefile.yml b/.github/workflows/cmake_linux_makefile.yml new file mode 100644 index 00000000..59076f52 --- /dev/null +++ b/.github/workflows/cmake_linux_makefile.yml @@ -0,0 +1,64 @@ +name: CMake - Linux-Makefile + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + # Build and test release build + Release: + env: + BUILD_TYPE: Release + runs-on: ubuntu-latest + + steps: + - name: Install NASM + run: sudo apt-get install -y nasm + + - uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -j 5 -C ${{env.BUILD_TYPE}} + + - name: Install + working-directory: ${{github.workspace}}/build + run: sudo cmake --install . + + - name: Test installation + working-directory: ${{github.workspace}}/examples/burst-app + run: gcc main.c -lIPSec_MB + + Debug: + # Build and test debug build + env: + BUILD_TYPE: Debug + runs-on: ubuntu-latest + + steps: + - name: Install NASM + run: sudo apt-get install -y nasm + + - uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -j 5 -C ${{env.BUILD_TYPE}} -- GitLab From 994ee836e3c88e972946659c5df1d34adbf3438e Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 3 Jul 2023 10:17:13 +0100 Subject: [PATCH 034/204] workflows: add windows cmake build and verify --- .github/workflows/cmake_windows_msbuild.yml | 70 +++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/cmake_windows_msbuild.yml diff --git a/.github/workflows/cmake_windows_msbuild.yml b/.github/workflows/cmake_windows_msbuild.yml new file mode 100644 index 00000000..92a129c6 --- /dev/null +++ b/.github/workflows/cmake_windows_msbuild.yml @@ -0,0 +1,70 @@ +name: CMake - Windows-MSBuild + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + Release: + env: + BUILD_TYPE: Release + runs-on: windows-latest + + steps: + - uses: ilammy/setup-nasm@v1 + - uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup environment + run: | + New-Item -ItemType Directory -Path "$pwd\build" + New-Item -ItemType Directory -Path "$pwd\build\bin" + "BUILD_DIR=$pwd\build" >> $env:GITHUB_ENV + "BINARY_DIR=$pwd\build\bin" >> $env:GITHUB_ENV + $env:PATH += "$pwd\build\bin;" + + - name: Configure CMake + run: cmake -A x64 -DIMB_BIN_DIR=${{env.BINARY_DIR}} -B ${{env.BUILD_DIR}} + + - name: Build + run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} + + - name: Test + run: ctest -j 5 -C ${{env.BUILD_TYPE}} --test-dir ${{env.BUILD_DIR}} + + Debug: + env: + BUILD_TYPE: Debug + runs-on: windows-latest + + steps: + - uses: ilammy/setup-nasm@v1 + - uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup environment + run: | + New-Item -ItemType Directory -Path "$pwd\build" + New-Item -ItemType Directory -Path "$pwd\build\bin" + "BUILD_DIR=$pwd\build" >> $env:GITHUB_ENV + "BINARY_DIR=$pwd\build\bin" >> $env:GITHUB_ENV + $env:PATH += "$pwd\build\bin;" + + - name: Configure CMake + run: cmake -A x64 -DIMB_BIN_DIR=${{env.BINARY_DIR}} -B ${{env.BUILD_DIR}} + + - name: Build + run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} + + - name: Test + run: ctest -j 5 -C ${{env.BUILD_TYPE}} --test-dir ${{env.BUILD_DIR}} -- GitLab From 68b4a08b38f7704eb32a5a305ae274d0cbd27a2e Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Tue, 4 Jul 2023 11:14:59 +0100 Subject: [PATCH 035/204] test: [GCM] Unify test vectors --- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 2 +- test/kat-app/gcm_test.c | 1465 ++++------------------------------ test/kat-app/gcm_test.json.c | 359 +++++++++ test/kat-app/win_x64.mak | 2 +- 5 files changed, 516 insertions(+), 1313 deletions(-) create mode 100644 test/kat-app/gcm_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 8de9f962..40980439 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -106,6 +106,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/ecb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/chacha_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/des_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/gcm_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 6e1fe30d..09965605 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -42,7 +42,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ - des_test.json.c chacha_test.json.c + des_test.json.c chacha_test.json.c gcm_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/gcm_test.c b/test/kat-app/gcm_test.c index 2706df5f..0243cb82 100644 --- a/test/kat-app/gcm_test.c +++ b/test/kat-app/gcm_test.c @@ -33,8 +33,8 @@ #include /* for memcmp() */ #include -#include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "aead_test.h" /* 0 - no extra messages, 1 - additional messages */ #define VERBOSE 0 @@ -45,1059 +45,9 @@ #define MAX_KEY_SZ 32 #define GCM_MAX_JOBS 32 -/* - * 60-Byte Packet Encryption Using GCM-AES-128 - * http://www.ieee802.org/1/files/public/ - * docs2011/bn-randall-test-vectors-0511-v1.pdf - * - * K: AD7A2BD03EAC835A6F620FDCB506B345 - * IV: 12153524C0895E81B2C28465 - * AAD: D609B1F056637A0D46DF998D88E52E00 - * B2C2846512153524C0895E81 - * P: 08000F101112131415161718191A1B1C - * 1D1E1F202122232425262728292A2B2C - * 2D2E2F303132333435363738393A0002 - * C: 701AFA1CC039C0D765128A665DAB6924 - * 3899BF7318CCDC81C9931DA17FBE8EDD - * 7D17CB8B4C26FC81E3284F2B7FBA713D - * AT: 4F8D55E7D3F06FD5A13C0C29B9D5B880 - * H: 73A23D80121DE2D5A850253FCF43120E - */ -static uint8_t K1[] = { - 0xAD, 0x7A, 0x2B, 0xD0, 0x3E, 0xAC, 0x83, 0x5A, - 0x6F, 0x62, 0x0F, 0xDC, 0xB5, 0x06, 0xB3, 0x45 -}; -static uint8_t P1[] = { - 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, - 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, - 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, - 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x00, 0x02 -}; -static uint8_t IV1[] = { - 0x12, 0x15, 0x35, 0x24, 0xC0, 0x89, 0x5E, 0x81, - 0xB2, 0xC2, 0x84, 0x65 -}; -static uint8_t A1[] = { - 0xD6, 0x09, 0xB1, 0xF0, 0x56, 0x63, 0x7A, 0x0D, - 0x46, 0xDF, 0x99, 0x8D, 0x88, 0xE5, 0x2E, 0x00, - 0xB2, 0xC2, 0x84, 0x65, 0x12, 0x15, 0x35, 0x24, - 0xC0, 0x89, 0x5E, 0x81 -}; - -#define A1_len sizeof(A1) - -static uint8_t C1[] = { - 0x70, 0x1A, 0xFA, 0x1C, 0xC0, 0x39, 0xC0, 0xD7, - 0x65, 0x12, 0x8A, 0x66, 0x5D, 0xAB, 0x69, 0x24, - 0x38, 0x99, 0xBF, 0x73, 0x18, 0xCC, 0xDC, 0x81, - 0xC9, 0x93, 0x1D, 0xA1, 0x7F, 0xBE, 0x8E, 0xDD, - 0x7D, 0x17, 0xCB, 0x8B, 0x4C, 0x26, 0xFC, 0x81, - 0xE3, 0x28, 0x4F, 0x2B, 0x7F, 0xBA, 0x71, 0x3D -}; -static uint8_t T1[] = { - 0x4F, 0x8D, 0x55, 0xE7, 0xD3, 0xF0, 0x6F, 0xD5, - 0xA1, 0x3C, 0x0C, 0x29, 0xB9, 0xD5, 0xB8, 0x80 -}; - -/* - * 54-Byte Packet Encryption Using GCM-AES-128 - * http://www.ieee802.org/1/files/public/ - * docs2011/bn-randall-test-vectors-0511-v1.pdf - * - * K: 071B113B0CA743FECCCF3D051F737382 - * IV: F0761E8DCD3D000176D457ED - * AAD: E20106D7CD0DF0761E8DCD3D88E54C2A - * 76D457ED - * P: 08000F101112131415161718191A1B1C - * 1D1E1F202122232425262728292A2B2C - * 2D2E2F30313233340004 - * C: 13B4C72B389DC5018E72A171DD85A5D3 - * 752274D3A019FBCAED09A425CD9B2E1C - * 9B72EEE7C9DE7D52B3F3 - * AT: D6A5284F4A6D3FE22A5D6C2B960494C3 - * H: E4E01725D724C1215C7309AD34539257 - */ -static uint8_t K2[] = { - 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, - 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82 -}; -static uint8_t P2[] = { - 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, - 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, - 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, - 0x00, 0x04 -}; -static uint8_t IV2[] = { - 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, 0x00, 0x01, - 0x76, 0xD4, 0x57, 0xED -}; -/* static uint8_t IV1p[] = {0, 0, 0, 1}; */ -static uint8_t A2[] = { - 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, 0xF0, 0x76, - 0x1E, 0x8D, 0xCD, 0x3D, 0x88, 0xE5, 0x4C, 0x2A, - 0x76, 0xD4, 0x57, 0xED -}; -#define A2_len sizeof(A2) -static uint8_t C2[] = { - 0x13, 0xB4, 0xC7, 0x2B, 0x38, 0x9D, 0xC5, 0x01, - 0x8E, 0x72, 0xA1, 0x71, 0xDD, 0x85, 0xA5, 0xD3, - 0x75, 0x22, 0x74, 0xD3, 0xA0, 0x19, 0xFB, 0xCA, - 0xED, 0x09, 0xA4, 0x25, 0xCD, 0x9B, 0x2E, 0x1C, - 0x9B, 0x72, 0xEE, 0xE7, 0xC9, 0xDE, 0x7D, 0x52, - 0xB3, 0xF3 -}; -static uint8_t T2[] = { - 0xD6, 0xA5, 0x28, 0x4F, 0x4A, 0x6D, 0x3F, 0xE2, - 0x2A, 0x5D, 0x6C, 0x2B, 0x96, 0x04, 0x94, 0xC3 -}; - -/* - * http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip - * gcmEncryptExtIV128.rsp - * - * [Keylen = 128] - * [IVlen = 96] - * [PTlen = 128] - * [AADlen = 128] - * [Taglen = 128] - * Count = 0 - * K: c939cc13397c1d37de6ae0e1cb7c423c - * IV: b3d8cc017cbb89b39e0f67e2 - * P: c3b3c41f113a31b73d9a5cd432103069 - * AAD: 24825602bd12a984e0092d3e448eda5f - * C: 93fe7d9e9bfd10348a5606e5cafa7354 - * AT: 0032a1dc85f1c9786925a2e71d8272dd - */ -static uint8_t K3[] = { - 0xc9, 0x39, 0xcc, 0x13, 0x39, 0x7c, 0x1d, 0x37, - 0xde, 0x6a, 0xe0, 0xe1, 0xcb, 0x7c, 0x42, 0x3c -}; -static uint8_t IV3[] = { - 0xb3, 0xd8, 0xcc, 0x01, 0x7c, 0xbb, 0x89, 0xb3, - 0x9e, 0x0f, 0x67, 0xe2 -}; -static uint8_t P3[] = { - 0xc3, 0xb3, 0xc4, 0x1f, 0x11, 0x3a, 0x31, 0xb7, - 0x3d, 0x9a, 0x5c, 0xd4, 0x32, 0x10, 0x30, 0x69 -}; -static uint8_t A3[] = { - 0x24, 0x82, 0x56, 0x02, 0xbd, 0x12, 0xa9, 0x84, - 0xe0, 0x09, 0x2d, 0x3e, 0x44, 0x8e, 0xda, 0x5f -}; -#define A3_len sizeof(A3) -static uint8_t C3[] = { - 0x93, 0xfe, 0x7d, 0x9e, 0x9b, 0xfd, 0x10, 0x34, - 0x8a, 0x56, 0x06, 0xe5, 0xca, 0xfa, 0x73, 0x54 -}; -static uint8_t T3[] = { - 0x00, 0x32, 0xa1, 0xdc, 0x85, 0xf1, 0xc9, 0x78, - 0x69, 0x25, 0xa2, 0xe7, 0x1d, 0x82, 0x72, 0xdd -}; - -/* - * http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip - * gcmEncryptExtIV128.rsp - * - * [Keylen = 128] - * [IVlen = 96] - * [PTlen = 256] - * [AADlen = 128] - * [Taglen = 128] - * Count = 0 - * K = 298efa1ccf29cf62ae6824bfc19557fc - * IV = 6f58a93fe1d207fae4ed2f6d - * P = cc38bccd6bc536ad919b1395f5d63801f99f8068d65ca5ac63872daf16b93901 - * AAD = 021fafd238463973ffe80256e5b1c6b1 - * C = dfce4e9cd291103d7fe4e63351d9e79d3dfd391e3267104658212da96521b7db - * T = 542465ef599316f73a7a560509a2d9f2 - */ -static uint8_t K4[] = { - 0x29, 0x8e, 0xfa, 0x1c, 0xcf, 0x29, 0xcf, 0x62, - 0xae, 0x68, 0x24, 0xbf, 0xc1, 0x95, 0x57, 0xfc -}; -static uint8_t IV4[] = { - 0x6f, 0x58, 0xa9, 0x3f, 0xe1, 0xd2, 0x07, 0xfa, - 0xe4, 0xed, 0x2f, 0x6d -}; -static uint8_t P4[] = { - 0xcc, 0x38, 0xbc, 0xcd, 0x6b, 0xc5, 0x36, 0xad, - 0x91, 0x9b, 0x13, 0x95, 0xf5, 0xd6, 0x38, 0x01, - 0xf9, 0x9f, 0x80, 0x68, 0xd6, 0x5c, 0xa5, 0xac, - 0x63, 0x87, 0x2d, 0xaf, 0x16, 0xb9, 0x39, 0x01 -}; -static uint8_t A4[] = { - 0x02, 0x1f, 0xaf, 0xd2, 0x38, 0x46, 0x39, 0x73, - 0xff, 0xe8, 0x02, 0x56, 0xe5, 0xb1, 0xc6, 0xb1 -}; -#define A4_len sizeof(A4) -static uint8_t C4[] = { - 0xdf, 0xce, 0x4e, 0x9c, 0xd2, 0x91, 0x10, 0x3d, - 0x7f, 0xe4, 0xe6, 0x33, 0x51, 0xd9, 0xe7, 0x9d, - 0x3d, 0xfd, 0x39, 0x1e, 0x32, 0x67, 0x10, 0x46, - 0x58, 0x21, 0x2d, 0xa9, 0x65, 0x21, 0xb7, 0xdb -}; -static uint8_t T4[] = { - 0x54, 0x24, 0x65, 0xef, 0x59, 0x93, 0x16, 0xf7, - 0x3a, 0x7a, 0x56, 0x05, 0x09, 0xa2, 0xd9, 0xf2 -}; - -/* - * http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip - * gcmEncryptExtIV128.rsp - * - * [Keylen = 128] - * [IVlen = 96] - * [PTlen = 256] - * [AADlen = 128] - * [Taglen = 128] - * Count = 0 - * K = 298efa1ccf29cf62ae6824bfc19557fc - * IV = 6f58a93fe1d207fae4ed2f6d - * P = cc38bccd6bc536ad919b1395f5d63801f99f8068d65ca5ac63872daf16b93901 - * AAD = 021fafd238463973ffe80256e5b1c6b1 - * C = dfce4e9cd291103d7fe4e63351d9e79d3dfd391e3267104658212da96521b7db - * T = 542465ef599316f73a7a560509a2d9f2 - */ -static uint8_t K5[] = { - 0x29, 0x8e, 0xfa, 0x1c, 0xcf, 0x29, 0xcf, 0x62, - 0xae, 0x68, 0x24, 0xbf, 0xc1, 0x95, 0x57, 0xfc -}; -static uint8_t IV5[] = { - 0x6f, 0x58, 0xa9, 0x3f, 0xe1, 0xd2, 0x07, 0xfa, - 0xe4, 0xed, 0x2f, 0x6d -}; -static uint8_t P5[] = { - 0xcc, 0x38, 0xbc, 0xcd, 0x6b, 0xc5, 0x36, 0xad, - 0x91, 0x9b, 0x13, 0x95, 0xf5, 0xd6, 0x38, 0x01, - 0xf9, 0x9f, 0x80, 0x68, 0xd6, 0x5c, 0xa5, 0xac, - 0x63, 0x87, 0x2d, 0xaf, 0x16, 0xb9, 0x39, 0x01 -}; -static uint8_t A5[] = { - 0x02, 0x1f, 0xaf, 0xd2, 0x38, 0x46, 0x39, 0x73, - 0xff, 0xe8, 0x02, 0x56, 0xe5, 0xb1, 0xc6, 0xb1 -}; -#define A5_len sizeof(A5) -static uint8_t C5[] = { - 0xdf, 0xce, 0x4e, 0x9c, 0xd2, 0x91, 0x10, 0x3d, - 0x7f, 0xe4, 0xe6, 0x33, 0x51, 0xd9, 0xe7, 0x9d, - 0x3d, 0xfd, 0x39, 0x1e, 0x32, 0x67, 0x10, 0x46, - 0x58, 0x21, 0x2d, 0xa9, 0x65, 0x21, 0xb7, 0xdb -}; -static uint8_t T5[] = { - 0x54, 0x24, 0x65, 0xef, 0x59, 0x93, 0x16, 0xf7, - 0x3a, 0x7a, 0x56, 0x05, 0x09, 0xa2, 0xd9, 0xf2 -}; - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/ - * proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 2 - * K: 00000000000000000000000000000000 - * P: 00000000000000000000000000000000 - * IV: 000000000000000000000000 - * C: 0388dace60b6a392f328c2b971b2fe78 - * T: ab6e47d42cec13bdf53a67b21257bddf - * H: 66e94bd4ef8a2c3b884cfa59ca342b2e - */ -static uint8_t K6[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; -static uint8_t P6[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; -static uint8_t IV6[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; -static uint8_t A6[] = {0}; -#define A6_len 0 -static uint8_t C6[] = { - 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92, - 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78 -}; -static uint8_t T6[] = { - 0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd, - 0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf -}; - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/ - * documents/proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 3 - * K: feffe9928665731c6d6a8f9467308308 - * P: d9313225f88406e5a55909c5aff5269a - * 86a7a9531534f7da2e4c303d8a318a72 - * 1c3c0c95956809532fcf0e2449a6b525 - * b16aedf5aa0de657ba637b391aafd255 - * IV: cafebabefacedbaddecaf888 - * H: b83b533708bf535d0aa6e52980d53b78 - * C: 42831ec2217774244b7221b784d0d49c - * e3aa212f2c02a4e035c17e2329aca12e - * 21d514b25466931c7d8f6a5aac84aa05 - * 1ba30b396a0aac973d58e091473f5985 - * T: 4d5c2af327cd64a62cf35abd2ba6fab4 - */ -static uint8_t K7[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 -}; -static uint8_t P7[] = { - 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, - 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 -}; -static uint8_t IV7[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88 -}; -static uint8_t A7[] = {0}; -#define A7_len 0 -static uint8_t C7[] = { - 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24, - 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c, - 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0, - 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e, - 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, - 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, - 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, - 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85 -}; -static uint8_t T7[] = { - 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6, - 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 -}; - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/ - * documents/proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 4 - * K: feffe9928665731c6d6a8f9467308308 - * P: d9313225f88406e5a55909c5aff5269a - * 86a7a9531534f7da2e4c303d8a318a72 - * 1c3c0c95956809532fcf0e2449a6b525 - * b16aedf5aa0de657ba637b39 - * A: feedfacedeadbeeffeedfacedeadbeef - * abaddad2 - * IV: cafebabefacedbaddecaf888 - * H: b83b533708bf535d0aa6e52980d53b78 - * C: 42831ec2217774244b7221b784d0d49c - * e3aa212f2c02a4e035c17e2329aca12e - * 21d514b25466931c7d8f6a5aac84aa05 - * 1ba30b396a0aac973d58e091 - * T: 5bc94fbc3221a5db94fae95ae7121a47 - */ -static uint8_t K8[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 -}; -static uint8_t P8[] = { - 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, - 0xba, 0x63, 0x7b, 0x39 -}; -static uint8_t A8[] = { - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xab, 0xad, 0xda, 0xd2 -}; -#define A8_len sizeof(A8) -static uint8_t IV8[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88 -}; -static uint8_t C8[] = { - 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24, - 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c, - 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0, - 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e, - 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, - 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, - 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, - 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85 -}; -static uint8_t T8[] = { - 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb, - 0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47 -}; - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/ - * documents/proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 14 - * K: 00000000000000000000000000000000 - * 00000000000000000000000000000000 - * P: 00000000000000000000000000000000 - * A: - * IV: 000000000000000000000000 - * H: dc95c078a2408989ad48a21492842087 - * C: cea7403d4d606b6e074ec5d3baf39d18 - * T: d0d1c8a799996bf0265b98b5d48ab919 - */ -static uint8_t K9[] = { - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 -}; -static uint8_t P9[] = { - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 -}; -static uint8_t A9[] = {0}; -#define A9_len 0 -static uint8_t IV9[] = { - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0 -}; -static uint8_t C9[] = { - 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e, - 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18 -}; -static uint8_t T9[] = { - 0xd0, 0xd1, 0xc8, 0xa7, 0x99, 0x99, 0x6b, 0xf0, - 0x26, 0x5b, 0x98, 0xb5, 0xd4, 0x8a, 0xb9, 0x19 -}; - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/ - * proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 15 - * K: feffe9928665731c6d6a8f9467308308 - * feffe9928665731c6d6a8f9467308308 - * P: d9313225f88406e5a55909c5aff5269a - * 86a7a9531534f7da2e4c303d8a318a72 - * 1c3c0c95956809532fcf0e2449a6b525 - * b16aedf5aa0de657ba637b391aafd255 - * A: - * IV: cafebabefacedbaddecaf888 - * H: acbef20579b4b8ebce889bac8732dad7 - * C: 522dc1f099567d07f47f37a32a84427d - * 643a8cdcbfe5c0c97598a2bd2555d1aa - * 8cb08e48590dbb3da7b08b1056828838 - * c5f61e6393ba7a0abcc9f662898015ad - * T: b094dac5d93471bdec1a502270e3cc6c - */ -static uint8_t K10[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 -}; -static uint8_t P10[] = { - 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, - 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 -}; -static uint8_t A10[] = {0}; -#define A10_len 0 -static uint8_t IV10[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88 -}; -static uint8_t C10[] = { - 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07, - 0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d, - 0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9, - 0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa, - 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, - 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38, - 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, - 0xbc, 0xc9, 0xf6, 0x62, 0x89, 0x80, 0x15, 0xad -}; -static uint8_t T10[] = { - 0xb0, 0x94, 0xda, 0xc5, 0xd9, 0x34, 0x71, 0xbd, - 0xec, 0x1a, 0x50, 0x22, 0x70, 0xe3, 0xcc, 0x6c -}; - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/ - * proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 16 - * K: feffe9928665731c6d6a8f9467308308 - * feffe9928665731c6d6a8f9467308308 - * P: d9313225f88406e5a55909c5aff5269a - * 86a7a9531534f7da2e4c303d8a318a72 - * 1c3c0c95956809532fcf0e2449a6b525 - * b16aedf5aa0de657ba637b39 - * A: feedfacedeadbeeffeedfacedeadbeef - * abaddad2 - * IV: cafebabefacedbaddecaf888 - * H: acbef20579b4b8ebce889bac8732dad7 - * C: 522dc1f099567d07f47f37a32a84427d - * 643a8cdcbfe5c0c97598a2bd2555d1aa - * 8cb08e48590dbb3da7b08b1056828838 - * c5f61e6393ba7a0abcc9f662 - * T: 76fc6ece0f4e1768cddf8853bb2d551b - */ -static uint8_t K11[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 -}; -static uint8_t P11[] = { - 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, - 0xba, 0x63, 0x7b, 0x39 -}; -static uint8_t A11[] = { - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xab, 0xad, 0xda, 0xd2 -}; -#define A11_len sizeof(A11) -static uint8_t IV11[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88 -}; -static uint8_t C11[] = { - 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07, - 0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d, - 0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9, - 0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa, - 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, - 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38, - 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, - 0xbc, 0xc9, 0xf6, 0x62 -}; -static uint8_t T11[] = { - 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, - 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b -}; - -/* - * https://tools.ietf.org/html/draft-mcgrew-gcm-test-01 - * case #7 - */ -/******************************************************** - key = feffe9928665731c6d6a8f9467308308 - feffe9928665731c - (24 octets) - spi = 0000a5f8 - seq = 0000000a - (4 octets) - nonce = cafebabefacedbaddecaf888 - plaintext = 45000028a4ad4000400678800a01038f - 0a010612802306b8cb712602dd6bb03e - 501016d075680001 - (40 octets) - aad = 0000a5f80000000a - (8 octets) - ctext+tag = a5b1f8066029aea40e598b8122de0242 - 0938b3ab33f828e687b8858b5bfbdbd0 - 315b27452144cc7795457b9652037f53 - 18027b5b4cd7a636 - (56 octets) -********************************************************/ -static uint8_t K13[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, -}; -static uint8_t IV13[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88, -}; -static uint8_t A13[] = { - 0x00, 0x00, 0xa5, 0xf8, 0x00, 0x00, 0x00, 0x0a, -}; -#define A13_len sizeof(A13) -static uint8_t P13[] = { - 0x45, 0x00, 0x00, 0x28, 0xa4, 0xad, 0x40, 0x00, - 0x40, 0x06, 0x78, 0x80, 0x0a, 0x01, 0x03, 0x8f, - 0x0a, 0x01, 0x06, 0x12, 0x80, 0x23, 0x06, 0xb8, - 0xcb, 0x71, 0x26, 0x02, 0xdd, 0x6b, 0xb0, 0x3e, - 0x50, 0x10, 0x16, 0xd0, 0x75, 0x68, 0x00, 0x01, -}; -static uint8_t T13[] = { - 0x95, 0x45, 0x7b, 0x96, 0x52, 0x03, 0x7f, 0x53, - 0x18, 0x02, 0x7b, 0x5b, 0x4c, 0xd7, 0xa6, 0x36, -}; -static uint8_t C13[] = { - 0xa5, 0xb1, 0xf8, 0x06, 0x60, 0x29, 0xae, 0xa4, - 0x0e, 0x59, 0x8b, 0x81, 0x22, 0xde, 0x02, 0x42, - 0x09, 0x38, 0xb3, 0xab, 0x33, 0xf8, 0x28, 0xe6, - 0x87, 0xb8, 0x85, 0x8b, 0x5b, 0xfb, 0xdb, 0xd0, - 0x31, 0x5b, 0x27, 0x45, 0x21, 0x44, 0xcc, 0x77, -}; - -/* - * Test Case 14 -- GHASH output Auth Tag length of 4 bytes - */ -#define K14 K11 -#define P14 P11 -#define A14 A11 -#define A14_len sizeof(A14) -#define IV14 IV11 -#define C14 C11 -static uint8_t T14[] = { - 0x76, 0xfc, 0x6e, 0xce -}; - -/* - * Test Case 15 -- GHASH output Auth Tag length of 8 bytes - */ -#define K15 K11 -#define P15 P11 -#define A15 A11 -#define A15_len sizeof(A15) -#define IV15 IV11 -#define C15 C11 -static uint8_t T15[] = { - 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68 -}; - -/* - * Test Case 16 -- GHASH output Auth Tag length of 14 bytes - */ -#define K16 K11 -#define P16 P11 -#define A16 A11 -#define A16_len sizeof(A16) -#define IV16 IV11 -#define C16 C11 -static uint8_t T16[] = { - 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, - 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d -}; - -/* - * Test Case 17 -- GHASH output Auth Tag length of 15 bytes - */ -#define K17 K11 -#define P17 P11 -#define A17 A11 -#define A17_len sizeof(A17) -#define IV17 IV11 -#define C17 C11 -static uint8_t T17[] = { - 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, - 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55 -}; - -/* - * Test Case 18 -- No plaintext - */ -static uint8_t K18[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F -}; -static uint8_t IV18[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B -}; -static uint8_t A18[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, -}; - -#define P18 NULL -#define C18 NULL -#define P18_len 0 -#define A18_len sizeof(A18) - -static uint8_t T18[] = { - 0x8D, 0xF7, 0xD8, 0xED, 0xB9, 0x91, 0x65, 0xFA, - 0xAD, 0x1B, 0x03, 0x8C, 0x53, 0xB3, 0x20, 0xE8 -}; - -/* - * Test Case 19 -- No AAD - */ -static uint8_t P19[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F -}; -static uint8_t C19[] = { - 0x93, 0x6D, 0xA5, 0xCD, 0x62, 0x1E, 0xF1, 0x53, - 0x43, 0xDB, 0x6B, 0x81, 0x3A, 0xAE, 0x7E, 0x07 -}; - -#define K19 K18 -#define IV19 IV18 -#define P19_len sizeof(P19) -#define A19 NULL -#define A19_len 0 - -static uint8_t T19[] = { - 0xFE, 0x8E, 0xC5, 0x55, 0x5F, 0x36, 0x08, 0xF7, - 0x0E, 0xBC, 0x7F, 0xCE, 0xE9, 0x59, 0x2E, 0x9B -}; - -/* - * Test Case 20 -- No plaintext, no AAD - */ -#define K20 K18 -#define IV20 IV18 -#define P20 NULL -#define C20 NULL -#define P20_len 0 -#define A20 NULL -#define A20_len 0 - -static uint8_t T20[] = { - 0x43, 0x5B, 0x9B, 0xA1, 0x2D, 0x75, 0xA4, 0xBE, - 0x8A, 0x97, 0x7E, 0xA3, 0xCD, 0x01, 0x18, 0x90 -}; - -/* - * Test Case 21 -- Variable tag size (1 byte) - */ - -#define K21 K1 -#define IV21 IV1 -#define P21 P1 -#define C21 C1 -#define A21 A1 -#define A21_len A1_len - -static uint8_t T21[] = { - 0x4F -}; - -/* - * Test Case 22 -- No plaintext - */ -static uint8_t K22[] = { - 0x76, 0x80, 0xc5, 0xd3, 0xca, 0x61, 0x54, 0x75, - 0x8e, 0x51, 0x0f, 0x4d, 0x25, 0xb9, 0x88, 0x20 -}; - -static uint8_t IV22[] = { - 0xf8, 0xf1, 0x05, 0xf9, 0xc3, 0xdf, 0x49, 0x65, - 0x78, 0x03, 0x21, 0xf8 -}; - -static uint8_t A22[] = { - 0xc9, 0x4c, 0x41, 0x01, 0x94, 0xc7, 0x65, 0xe3, - 0xdc, 0xc7, 0x96, 0x43, 0x79, 0x75, 0x8e, 0xd3 -}; - -#define A22_len sizeof(A22) -#define P22 NULL -#define C22 NULL -#define P22_len 0 - -static uint8_t T22[] = { - 0x94, 0xdc, 0xa8, 0xed, 0xfc, 0xf9, 0x0b, 0xb7, - 0x4b, 0x15, 0x3c, 0x8d, 0x48, 0xa1, 0x79, 0x30 -}; - -/* GCM vectors with IV different than 12 bytes */ - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/ - * proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 17 - * K: feffe9928665731c6d6a8f9467308308 - * feffe9928665731c6d6a8f9467308308 - * P: d9313225f88406e5a55909c5aff5269a - * 86a7a9531534f7da2e4c303d8a318a72 - * 1c3c0c95956809532fcf0e2449a6b525 - * b16aedf5aa0de657ba637b39 - * A: feedfacedeadbeeffeedfacedeadbeef - * abaddad2 - * IV: cafebabefacedbad - * H: acbef20579b4b8ebce889bac8732dad7 - * C: c3762df1ca787d32ae47c13bf19844cb - * af1ae14d0b976afac52ff7d79bba9de0 - * feb582d33934a4f0954cc2363bc73f78 - * 62ac430e64abe499f47c9b1f - * T: 3a337dbf46a792c45e454913fe2ea8f2 - */ -static uint8_t K12[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 -}; -static uint8_t P12[] = { - 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, - 0xba, 0x63, 0x7b, 0x39 -}; -static uint8_t A12[] = { - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xab, 0xad, 0xda, 0xd2 -}; -static uint8_t IV12[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad -}; -static uint8_t C12[] = { - 0xc3, 0x76, 0x2d, 0xf1, 0xca, 0x78, 0x7d, 0x32, - 0xae, 0x47, 0xc1, 0x3b, 0xf1, 0x98, 0x44, 0xcb, - 0xaf, 0x1a, 0xe1, 0x4d, 0x0b, 0x97, 0x6a, 0xfa, - 0xc5, 0x2f, 0xf7, 0xd7, 0x9b, 0xba, 0x9d, 0xe0, - 0xfe, 0xb5, 0x82, 0xd3, 0x39, 0x34, 0xa4, 0xf0, - 0x95, 0x4c, 0xc2, 0x36, 0x3b, 0xc7, 0x3f, 0x78, - 0x62, 0xac, 0x43, 0x0e, 0x64, 0xab, 0xe4, 0x99, - 0xf4, 0x7c, 0x9b, 0x1f -}; -static uint8_t T12[] = { - 0x3a, 0x33, 0x7d, 0xbf, 0x46, 0xa7, 0x92, 0xc4, - 0x5e, 0x45, 0x49, 0x13, 0xfe, 0x2e, 0xa8, 0xf2 -}; -#define A12_len sizeof(A12) - -static uint8_t K26[] = { - 0x83, 0xf9, 0xd9, 0x7d, 0x4a, 0xb7, 0x59, 0xfd, - 0xdc, 0xc3, 0xef, 0x54, 0xa0, 0xe2, 0xa8, 0xec -}; -static uint8_t P26[] = { - 0x77, 0xe6, 0x32, 0x9c, 0xf9, 0x42, 0x4f, 0x71, - 0xc8, 0x08, 0xdf, 0x91, 0x70, 0xbf, 0xd2, 0x98 -}; -static uint8_t A26[] = { - 0x6d, 0xd4, 0x9e, 0xae, 0xb4, 0x10, 0x3d, 0xac, - 0x8f, 0x97, 0xe3, 0x23, 0x49, 0x46, 0xdd, 0x2d -}; -static uint8_t IV26[] = { - 0xcf -}; -static uint8_t C26[] = { - 0x50, 0xde, 0x86, 0xa7, 0xa9, 0x2a, 0x8a, 0x5e, - 0xa3, 0x3d, 0xb5, 0x69, 0x6b, 0x96, 0xcd, 0x77 -}; -static uint8_t T26[] = { - 0xaa, 0x18, 0x1e, 0x84, 0xbc, 0x8b, 0x4b, 0xf5, - 0xa6, 0x89, 0x27, 0xc4, 0x09, 0xd4, 0x22, 0xcb -}; -#define A26_len sizeof(A26) - -static uint8_t K27[] = { - 0x8b, 0x1c, 0x63, 0xbc, 0xcb, 0x55, 0x79, 0xe5, - 0x88, 0x7f, 0x5b, 0xf7, 0xb2, 0xbd, 0x0c, 0xbc, - 0xff, 0x13, 0x6d, 0x40, 0xd7, 0xb6, 0x1a, 0xb2 -}; -static uint8_t P27[] = { - 0x22, 0x4f, 0x5f, 0x2a, 0x23, 0x7b, 0x30, 0x7c, - 0x78, 0x42, 0xde, 0x75, 0xd9, 0xd1, 0xbb, 0x65 -}; -static uint8_t A27[] = { - 0x8f, 0xbe, 0x5a, 0x21, 0xa6, 0x5b, 0xdd, 0xd0, - 0x33, 0x16, 0x04, 0xc9, 0x17, 0x83, 0x9c, 0xf7 -}; -static uint8_t IV27[] = { - 0xca -}; -static uint8_t C27[] = { - 0x83, 0x49, 0xe3, 0xa4, 0x8f, 0x5d, 0x89, 0xd9, - 0x42, 0xc2, 0x4d, 0x80, 0xae, 0xfb, 0x1c, 0x5f -}; -static uint8_t T27[] = { - 0x3d, 0x49, 0xe3, 0xd4, 0x3f, 0x9a, 0x4a, 0x96, - 0x4c, 0x6d, 0x84, 0x4d, 0x60, 0xb4, 0xef, 0x1e -}; -#define A27_len sizeof(A27) - -static uint8_t K28[] = { - 0x0e, 0x00, 0xc7, 0x65, 0x61, 0xd2, 0xbd, 0x9b, - 0x40, 0xc3, 0xc1, 0x54, 0x27, 0xe2, 0xb0, 0x8f -}; -static uint8_t P28[] = { - 0xfe, 0xf0, 0x3c, 0x2d, 0x7f, 0xb1, 0x5b, 0xf0, - 0xd2, 0xdf, 0x18, 0x00, 0x7d, 0x99, 0xf9, 0x67, - 0xc8, 0x78, 0xad, 0x59, 0x35, 0x90, 0x34, 0xf7, - 0xbb, 0x2c, 0x19, 0xaf, 0x12, 0x06, 0x85, 0xd7, - 0x8e, 0x32, 0xf6, 0xb8, 0xb8, 0x3b, 0x03, 0x20, - 0x19, 0x95, 0x6c, 0xa9, 0xc0, 0x19, 0x57, 0x21, - 0x47, 0x6b, 0x85 -}; -static uint8_t A28[] = { - 0xd8, 0xf1, 0x16, 0x3d, 0x8c, 0x84, 0x02, 0x92, - 0xa2, 0xb2, 0xda, 0xcf, 0x4a, 0xc7, 0xc3, 0x6a, - 0xff, 0x87, 0x33, 0xf1, 0x8f, 0xab, 0xb4, 0xfa, - 0x55, 0x94, 0x54, 0x41, 0x25, 0xe0, 0x3d, 0x1e, - 0x6e, 0x5d, 0x6d, 0x0f, 0xd6, 0x16, 0x56, 0xc8, - 0xd8, 0xf3, 0x27, 0xc9, 0x28, 0x39, 0xae, 0x55, - 0x39, 0xbb, 0x46, 0x9c, 0x92, 0x57, 0xf1, 0x09, - 0xeb, 0xff, 0x85, 0xaa, 0xd7, 0xbd, 0x22, 0x0f, - 0xda, 0xa9, 0x5c, 0x02, 0x2d, 0xbd, 0x0c, 0x7b, - 0xb2, 0xd8, 0x78, 0xad, 0x50, 0x41, 0x22, 0xc9, - 0x43, 0x04, 0x5d, 0x3c, 0x5e, 0xba, 0x8f, 0x1f, - 0x56, 0xc0 -}; -static uint8_t IV28[] = { - 0x49, 0x2c, 0xad, 0xac, 0xcd, 0x3c, 0xa3, 0xfb, - 0xc9, 0xcf, 0x9f, 0x06, 0xeb, 0x33, 0x25, 0xc4, - 0xe1, 0x59, 0x85, 0x0b, 0x0d, 0xbe, 0x98, 0x19, - 0x9b, 0x89, 0xb7, 0xaf, 0x52, 0x88, 0x06, 0x61, - 0x0b, 0x6f, 0x63, 0x99, 0x8e, 0x1e, 0xae, 0x80, - 0xc3, 0x48, 0xe7, 0x4c, 0xbb, 0x92, 0x1d, 0x83, - 0x26, 0x63, 0x16, 0x31, 0xfc, 0x6a, 0x5d, 0x30, - 0x4f, 0x39, 0x16, 0x6d, 0xaf, 0x7e, 0xa1, 0x5f, - 0xa1, 0x97, 0x7f, 0x10, 0x18, 0x19, 0xad, 0xb5, - 0x10, 0xb5, 0x0f, 0xe9, 0x93, 0x2e, 0x12, 0xc5, - 0xa8, 0x5a, 0xa3, 0xfd, 0x1e, 0x73, 0xd8, 0xd7, - 0x60, 0xaf, 0x21, 0x8b, 0xe8, 0x29, 0x90, 0x3a, - 0x77, 0xc6, 0x33, 0x59, 0xd7, 0x5e, 0xdd, 0x91, - 0xb4, 0xf6, 0xed, 0x54, 0x65, 0xa7, 0x26, 0x62, - 0xf5, 0x05, 0x59, 0x99, 0xe0, 0x59, 0xe7, 0x65, - 0x4a, 0x8e, 0xdc, 0x92, 0x1a, 0xa0, 0xd4, 0x96 -}; -static uint8_t C28[] = { - 0x4f, 0x6c, 0xf4, 0x71, 0xbe, 0x7c, 0xbd, 0x25, - 0x75, 0xcd, 0x5a, 0x17, 0x47, 0xae, 0xa8, 0xfe, - 0x9d, 0xea, 0x83, 0xe5, 0x19, 0x36, 0xbe, 0xac, - 0x3e, 0x68, 0xf6, 0x62, 0x06, 0x92, 0x20, 0x60, - 0xc6, 0x97, 0xff, 0xa7, 0xaf, 0x80, 0xad, 0x6b, - 0xb6, 0x8f, 0x2c, 0xf4, 0xfc, 0x97, 0x41, 0x6e, - 0xe5, 0x2a, 0xbe -}; -static uint8_t T28[] = { - 0xe2, 0x0b, 0x66, 0x55 -}; -#define A28_len sizeof(A28) - -/* - * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/ - * proposedmodes/gcm/gcm-revised-spec.pdf - * - * Test Case 18 - * K: feffe9928665731c6d6a8f9467308308 - * feffe9928665731c6d6a8f9467308308 - * P: d9313225f88406e5a55909c5aff5269a - * 86a7a9531534f7da2e4c303d8a318a72 - * 1c3c0c95956809532fcf0e2449a6b525 - * b16aedf5aa0de657ba637b39 - * A: feedfacedeadbeeffeedfacedeadbeef - * abaddad2 - * IV: 9313225df88406e555909c5aff5269aa - * 6a7a9538534f7da1e4c303d2a318a728 - * c3c0c95156809539fcf0e2429a6b5254 - * 16aedbf5a0de6a57a637b39b - * H: acbef20579b4b8ebce889bac8732dad7 - * C: 5a8def2f0c9e53f1f75d7853659e2a20 - * eeb2b22aafde6419a058ab4f6f746bf4 - * 0fc0c3b780f244452da3ebf1c5d82cde - * a2418997200ef82e44ae7e3f - * T: a44a8266ee1c8eb0c8b5d4cf5ae9f19a - */ -static uint8_t K34[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 -}; -static uint8_t P34[] = { - 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, - 0xba, 0x63, 0x7b, 0x39 -}; -static uint8_t A34[] = { - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xab, 0xad, 0xda, 0xd2 -}; -static uint8_t IV34[] = { - 0x93, 0x13, 0x22, 0x5d, 0xf8, 0x84, 0x06, 0xe5, - 0x55, 0x90, 0x9c, 0x5a, 0xff, 0x52, 0x69, 0xaa, - 0x6a, 0x7a, 0x95, 0x38, 0x53, 0x4f, 0x7d, 0xa1, - 0xe4, 0xc3, 0x03, 0xd2, 0xa3, 0x18, 0xa7, 0x28, - 0xc3, 0xc0, 0xc9, 0x51, 0x56, 0x80, 0x95, 0x39, - 0xfc, 0xf0, 0xe2, 0x42, 0x9a, 0x6b, 0x52, 0x54, - 0x16, 0xae, 0xdb, 0xf5, 0xa0, 0xde, 0x6a, 0x57, - 0xa6, 0x37, 0xb3, 0x9b -}; -static uint8_t C34[] = { - 0x5a, 0x8d, 0xef, 0x2f, 0x0c, 0x9e, 0x53, 0xf1, - 0xf7, 0x5d, 0x78, 0x53, 0x65, 0x9e, 0x2a, 0x20, - 0xee, 0xb2, 0xb2, 0x2a, 0xaf, 0xde, 0x64, 0x19, - 0xa0, 0x58, 0xab, 0x4f, 0x6f, 0x74, 0x6b, 0xf4, - 0x0f, 0xc0, 0xc3, 0xb7, 0x80, 0xf2, 0x44, 0x45, - 0x2d, 0xa3, 0xeb, 0xf1, 0xc5, 0xd8, 0x2c, 0xde, - 0xa2, 0x41, 0x89, 0x97, 0x20, 0x0e, 0xf8, 0x2e, - 0x44, 0xae, 0x7e, 0x3f -}; -static uint8_t T34[] = { - 0xa4, 0x4a, 0x82, 0x66, 0xee, 0x1c, 0x8e, 0xb0, - 0xc8, 0xb5, 0xd4, 0xcf, 0x5a, 0xe9, 0xf1, 0x9a -}; -#define A34_len sizeof(A34) - -static const struct gcm_ctr_vector gcm_vectors[] = { - /* - * field order {K, Klen, IV, IVlen, A, Alen, P, Plen, C, T, Tlen}; - * original vector does not have a valid sub hash key - */ - vector(1), - vector(2), - vector(3), - vector(4), - vector(5), - vector(6), - vector(7), - vector(8), - vector(9), - vector(10), - vector(11), - vector(13), - vector(14), - vector(15), - vector(16), - vector(17), - extra_vector(18), - extra_vector(19), - extra_vector(20), - vector(21), - extra_vector(22), -}; - -/* Variable IV vectors (not 12 bytes) */ -static const struct gcm_ctr_vector gcm_iv_vectors[] = { - /* - * field order {K, Klen, IV, IVlen, A, Alen, P, Plen, C, T, Tlen}; - * original vector does not have a valid sub hash key - */ - vector(12), - vector(26), - vector(27), - vector(28), - vector(34) -}; +int gcm_test(IMB_MGR *p_mgr); + +extern const struct aead_test gcm_test_json[]; typedef int (*gcm_enc_dec_fn_t)(IMB_MGR *, const struct gcm_key_data *, struct gcm_context_data *, @@ -1944,7 +894,7 @@ job_sgl_aes_gcm_dec(IMB_MGR *p_mgr, /*****************************************************************************/ static void -test_gcm_vectors(struct gcm_ctr_vector const *vector, +test_gcm_vectors(struct aead_test const *vector, gcm_enc_dec_fn_t encfn, gcm_enc_dec_fn_t decfn, struct test_suite_context *ts) @@ -1957,95 +907,97 @@ test_gcm_vectors(struct gcm_ctr_vector const *vector, uint8_t *pt_test = NULL; uint8_t *T_test = NULL; uint8_t *T2_test = NULL; - const uint8_t *iv = vector->IV; - uint64_t iv_len = vector->IVlen; + const uint8_t *iv = (const void *) vector->iv; + const uint64_t iv_len = vector->ivSize / 8; - if (vector->Plen != 0) { + if (vector->msgSize / 8 != 0) { /* Allocate space for the calculated ciphertext */ - ct_test = malloc(vector->Plen); + ct_test = malloc(vector->msgSize / 8); if (ct_test == NULL) { fprintf(stderr, "Can't allocate ciphertext memory\n"); goto test_gcm_vectors_exit; } /* Allocate space for the calculated plaintext */ - pt_test = malloc(vector->Plen); + pt_test = malloc(vector->msgSize / 8); if (pt_test == NULL) { fprintf(stderr, "Can't allocate plaintext memory\n"); goto test_gcm_vectors_exit; } } - T_test = malloc(vector->Tlen); + T_test = malloc(vector->tagSize / 8); if (T_test == NULL) { fprintf(stderr, "Can't allocate tag memory\n"); goto test_gcm_vectors_exit; } - memset(T_test, 0, vector->Tlen); + memset(T_test, 0, vector->tagSize / 8); - T2_test = malloc(vector->Tlen); + T2_test = malloc(vector->tagSize / 8); if (T2_test == NULL) { fprintf(stderr, "Can't allocate tag(2) memory\n"); goto test_gcm_vectors_exit; } - memset(T2_test, 0, vector->Tlen); + memset(T2_test, 0, vector->tagSize / 8); /* This is only required once for a given key */ - switch (vector->Klen) { + switch (vector->keySize / 8) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_PRE(p_gcm_mgr, vector->K, &gdata_key); + IMB_AES128_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_PRE(p_gcm_mgr, vector->K, &gdata_key); + IMB_AES192_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_PRE(p_gcm_mgr, vector->K, &gdata_key); + IMB_AES256_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); break; } /* * Encrypt */ - is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, - ct_test, vector->P, vector->Plen, - iv, iv_len, vector->A, - vector->Alen, T_test, vector->Tlen, vector->Klen); - is_error |= check_data(ct_test, vector->C, vector->Plen, + is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, + (const void *) vector->msg, vector->msgSize / 8, + iv, iv_len, (const void *) vector->aad, vector->aadSize / 8, + T_test, vector->tagSize / 8, vector->keySize / 8); + is_error |= check_data(ct_test, (const void *) vector->ct, vector->msgSize / 8, "encrypted cipher text (C)"); - is_error |= check_data(T_test, vector->T, vector->Tlen, "tag (T)"); + is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, "tag (T)"); if (is_error) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); /* test of in-place encrypt */ - memory_copy(pt_test, vector->P, vector->Plen); + memory_copy(pt_test, (const void *) vector->msg, vector->msgSize / 8); is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, pt_test, - vector->Plen, iv, iv_len, vector->A, vector->Alen, - T_test, vector->Tlen, vector->Klen); - is_error |= check_data(pt_test, vector->C, vector->Plen, + vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, + vector->aadSize / 8, T_test, vector->tagSize / 8, + vector->keySize / 8); + is_error |= check_data(pt_test, (const void *) vector->ct, vector->msgSize / 8, "encrypted cipher text(in-place)"); if (is_error) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); - memory_set(ct_test, 0, vector->Plen); - memory_set(T_test, 0, vector->Tlen); + memory_set(ct_test, 0, vector->msgSize / 8); + memory_set(T_test, 0, vector->tagSize / 8); /* * Decrypt */ - is_error = decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, vector->C, - vector->Plen, iv, iv_len, vector->A, vector->Alen, - T_test, vector->Tlen, vector->Klen); - is_error |= check_data(pt_test, vector->P, vector->Plen, + is_error = decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, (const void *) vector->ct, + vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, + vector->aadSize / 8, T_test, vector->tagSize / 8, + vector->keySize / 8); + is_error |= check_data(pt_test, (const void *) vector->msg, vector->msgSize / 8, "decrypted plain text (P)"); /* * GCM decryption outputs a 16 byte tag value * that must be verified against the expected tag value */ - is_error |= check_data(T_test, vector->T, vector->Tlen, + is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, "decrypted tag (T)"); if (is_error) test_suite_update(ts, 0, 1); @@ -2053,31 +1005,33 @@ test_gcm_vectors(struct gcm_ctr_vector const *vector, test_suite_update(ts, 1, 0); /* test in in-place decrypt */ - memory_copy(ct_test, vector->C, vector->Plen); + memory_copy(ct_test, (const void *) vector->ct, vector->msgSize / 8); is_error = decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, ct_test, - vector->Plen, iv, iv_len, vector->A, vector->Alen, - T_test, vector->Tlen, vector->Klen); - is_error |= check_data(ct_test, vector->P, vector->Plen, + vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, + vector->aadSize / 8, T_test, vector->tagSize / 8, + vector->keySize / 8); + is_error |= check_data(ct_test, (const void *) vector->msg, vector->msgSize / 8, "plain text (P) - in-place"); - is_error |= check_data(T_test, vector->T, vector->Tlen, + is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, "decrypted tag (T) - in-place"); if (is_error) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); /* enc -> dec */ - is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, vector->P, - vector->Plen, iv, iv_len, vector->A, vector->Alen, - T_test, vector->Tlen, vector->Klen); + is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, (const void *) vector->msg, + vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, + vector->aadSize / 8, T_test, vector->tagSize / 8, + vector->keySize / 8); - memory_set(pt_test, 0, vector->Plen); + memory_set(pt_test, 0, vector->msgSize / 8); is_error |= decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, ct_test, - vector->Plen, iv, iv_len, vector->A, vector->Alen, - T2_test, vector->Tlen, vector->Klen); - is_error |= check_data(pt_test, vector->P, vector->Plen, + vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, + vector->aadSize / 8, T2_test, vector->tagSize / 8, vector->keySize / 8); + is_error |= check_data(pt_test, (const void *) vector->msg, vector->msgSize / 8, "self decrypted plain text (P)"); - is_error |= check_data(T_test, T2_test, vector->Tlen, + is_error |= check_data(T_test, T2_test, vector->tagSize / 8, "self decrypted tag (T)"); if (is_error) test_suite_update(ts, 0, 1); @@ -2097,7 +1051,7 @@ test_gcm_vectors(struct gcm_ctr_vector const *vector, static void -test_gcm_vectors_burst(struct gcm_ctr_vector const *vector, +test_gcm_vectors_burst(struct aead_test const *vector, gcm_enc_dec_many_fn_t encfn, gcm_enc_dec_many_fn_t decfn, struct test_suite_context *ts) @@ -2109,8 +1063,8 @@ test_gcm_vectors_burst(struct gcm_ctr_vector const *vector, uint8_t **ct_test = NULL; uint8_t **pt_test = NULL; uint8_t **T_test = NULL; - const uint8_t *iv = vector->IV; - uint64_t iv_len = vector->IVlen; + const uint8_t *iv = (const void *) vector->iv; + const uint64_t iv_len = vector->ivSize / 8; uint32_t i, j; const uint32_t num_jobs = GCM_MAX_JOBS; @@ -2148,16 +1102,16 @@ test_gcm_vectors_burst(struct gcm_ctr_vector const *vector, /* Zero buffers */ for (i = 0; i < num_jobs; i++) { - if (vector->Plen != 0) { - ct_test[i] = malloc(vector->Plen); + if (vector->msgSize / 8 != 0) { + ct_test[i] = malloc(vector->msgSize / 8); if (ct_test[i] == NULL) goto test_gcm_vectors_burst_exit; - memset(ct_test[i], 0, vector->Plen); + memset(ct_test[i], 0, vector->msgSize / 8); - pt_test[i] = malloc(vector->Plen); + pt_test[i] = malloc(vector->msgSize / 8); if (pt_test[i] == NULL) goto test_gcm_vectors_burst_exit; - memset(pt_test[i], 0, vector->Plen); + memset(pt_test[i], 0, vector->msgSize / 8); } gdata_ctx[i] = malloc(sizeof(struct gcm_context_data)); @@ -2165,23 +1119,23 @@ test_gcm_vectors_burst(struct gcm_ctr_vector const *vector, goto test_gcm_vectors_burst_exit; memset(gdata_ctx[i], 0, sizeof(struct gcm_context_data)); - T_test[i] = malloc(vector->Tlen); + T_test[i] = malloc(vector->tagSize / 8); if (T_test[i] == NULL) goto test_gcm_vectors_burst_exit; - memset(T_test[i], 0, vector->Tlen); + memset(T_test[i], 0, vector->tagSize / 8); } /* This is only required once for a given key */ - switch (vector->Klen) { + switch (vector->keySize / 8) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_PRE(p_gcm_mgr, vector->K, &gdata_key); + IMB_AES128_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_PRE(p_gcm_mgr, vector->K, &gdata_key); + IMB_AES192_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_PRE(p_gcm_mgr, vector->K, &gdata_key); + IMB_AES256_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); break; } @@ -2191,17 +1145,17 @@ test_gcm_vectors_burst(struct gcm_ctr_vector const *vector, * Encrypt */ is_error = encfn(p_gcm_mgr, &gdata_key, gdata_ctx, - ct_test, vector->P, vector->Plen, - iv, iv_len, vector->A, - vector->Alen, T_test, vector->Tlen, - vector->Klen, i + 1); + ct_test, (const void *) vector->msg, vector->msgSize / 8, + iv, iv_len, (const void *) vector->aad, + vector->aadSize / 8, T_test, vector->tagSize / 8, + vector->keySize / 8, i + 1); for (j = 0; j <= i; j++) { - is_error |= check_data(ct_test[j], vector->C, - vector->Plen, + is_error |= check_data(ct_test[j], (const void *) vector->ct, + vector->msgSize / 8, "encrypted cipher text (burst)"); - is_error |= check_data(T_test[j], vector->T, - vector->Tlen, "tag (burst)"); + is_error |= check_data(T_test[j], (const void *) vector->tag, + vector->tagSize / 8, "tag (burst)"); } if (is_error) test_suite_update(ts, 0, 1); @@ -2211,21 +1165,20 @@ test_gcm_vectors_burst(struct gcm_ctr_vector const *vector, * Decrypt */ is_error = decfn(p_gcm_mgr, &gdata_key, gdata_ctx, pt_test, - vector->C, vector->Plen, iv, iv_len, vector->A, - vector->Alen, T_test, vector->Tlen, - vector->Klen, i + 1); + (const void *) vector->ct, vector->msgSize / 8, iv, iv_len, + (const void *) vector->aad, vector->aadSize / 8, T_test, + vector->tagSize / 8, vector->keySize / 8, i + 1); for (j = 0; j <= i; j++) { - is_error |= check_data(pt_test[j], vector->P, - vector->Plen, + is_error |= check_data(pt_test[j], (const void *) vector->msg, + vector->msgSize / 8, "decrypted plain text (burst)"); /* * GCM decryption outputs a 16 byte tag value * that must be verified against the expected tag value */ - is_error |= check_data(T_test[j], vector->T, - vector->Tlen, - "decrypted tag (burst)"); + is_error |= check_data(T_test[j], (const void *) vector->tag, + vector->tagSize / 8, "decrypted tag (burst)"); } if (is_error) test_suite_update(ts, 0, 1); @@ -2260,134 +1213,74 @@ static void test_gcm_std_vectors(struct test_suite_context *ts128, struct test_suite_context *ts192, struct test_suite_context *ts256, - const struct gcm_ctr_vector *vectors, - const int vectors_cnt, + const struct aead_test *v, const int test_sgl_api) { - int vect; printf("AES-GCM (%s API) standard test vectors:\n", test_sgl_api ? "SGL" : "Direct/JOB"); - for (vect = 0; vect < vectors_cnt; vect++) { + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector %d/%d Keylen:%d IVlen:%d " - "PTLen:%d AADlen:%d Tlen:%d\n", - vect + 1, vectors_cnt, - (int) vectors[vect].Klen, - (int) vectors[vect].IVlen, - (int) vectors[vect].Plen, - (int) vectors[vect].Alen, - (int) vectors[vect].Tlen); + printf("Standard vector %zu Keylen:%zu IVlen:%zu " + "PTLen:%zu AADlen:%zu Tlen:%zu\n", + v->tcId, v->keySize / 8, v->ivSize / 8, + v->msgSize / 8, v->aadSize / 8, v->tagSize / 8); #else printf("."); #endif } - switch (vectors[vect].Klen) { + switch (v->keySize / 8) { case IMB_KEY_128_BYTES: if (test_sgl_api) { - test_gcm_vectors(&vectors[vect], - sgl_aes_gcm_enc, - sgl_aes_gcm_dec, - ts128); - test_gcm_vectors(&vectors[vect], - job_sgl_aes_gcm_enc, - job_sgl_aes_gcm_dec, + test_gcm_vectors(v, sgl_aes_gcm_enc, sgl_aes_gcm_dec, ts128); + test_gcm_vectors(v, job_sgl_aes_gcm_enc, job_sgl_aes_gcm_dec, ts128); - test_gcm_vectors_burst(&vectors[vect], - burst_sgl_aes_gcm_enc, - burst_sgl_aes_gcm_dec, - ts128); + test_gcm_vectors_burst(v, burst_sgl_aes_gcm_enc, + burst_sgl_aes_gcm_dec, ts128); } else { - test_gcm_vectors(&vectors[vect], - aes_gcm_enc, - aes_gcm_dec, - ts128); - test_gcm_vectors(&vectors[vect], - job_aes_gcm_enc, - job_aes_gcm_dec, - ts128); - test_gcm_vectors_burst(&vectors[vect], - burst_aes_gcm_enc, - burst_aes_gcm_dec, + test_gcm_vectors(v, aes_gcm_enc, aes_gcm_dec, ts128); + test_gcm_vectors(v, job_aes_gcm_enc, job_aes_gcm_dec, ts128); + test_gcm_vectors_burst(v, burst_aes_gcm_enc, burst_aes_gcm_dec, ts128); - test_gcm_vectors(&vectors[vect], - quic_aes_gcm_enc, - quic_aes_gcm_dec, - ts128); - test_gcm_vectors_burst(&vectors[vect], - burst_quic_gcm_enc, - burst_quic_gcm_dec, + test_gcm_vectors(v, quic_aes_gcm_enc, quic_aes_gcm_dec, ts128); + test_gcm_vectors_burst(v, burst_quic_gcm_enc, burst_quic_gcm_dec, ts128); } break; case IMB_KEY_192_BYTES: if (test_sgl_api) { - test_gcm_vectors(&vectors[vect], - sgl_aes_gcm_enc, - sgl_aes_gcm_dec, - ts192); - test_gcm_vectors(&vectors[vect], - job_sgl_aes_gcm_enc, - job_sgl_aes_gcm_dec, + test_gcm_vectors(v, sgl_aes_gcm_enc, sgl_aes_gcm_dec, ts192); + test_gcm_vectors(v, job_sgl_aes_gcm_enc, job_sgl_aes_gcm_dec, ts192); - test_gcm_vectors_burst(&vectors[vect], - burst_sgl_aes_gcm_enc, - burst_sgl_aes_gcm_dec, - ts192); + test_gcm_vectors_burst(v, burst_sgl_aes_gcm_enc, + burst_sgl_aes_gcm_dec, ts192); } else { - test_gcm_vectors(&vectors[vect], - aes_gcm_enc, - aes_gcm_dec, + test_gcm_vectors(v, aes_gcm_enc, aes_gcm_dec, ts192); + test_gcm_vectors(v, job_aes_gcm_enc, job_aes_gcm_dec, ts192); - test_gcm_vectors(&vectors[vect], - job_aes_gcm_enc, - job_aes_gcm_dec, - ts192); - test_gcm_vectors_burst(&vectors[vect], - burst_aes_gcm_enc, - burst_aes_gcm_dec, - ts192); + test_gcm_vectors_burst(v, burst_aes_gcm_enc, + burst_aes_gcm_dec, ts192); /* AES-192 is not supported by QUIC */ } break; case IMB_KEY_256_BYTES: if (test_sgl_api) { - test_gcm_vectors(&vectors[vect], - sgl_aes_gcm_enc, - sgl_aes_gcm_dec, - ts256); - test_gcm_vectors(&vectors[vect], - job_sgl_aes_gcm_enc, - job_sgl_aes_gcm_dec, + test_gcm_vectors(v, sgl_aes_gcm_enc, sgl_aes_gcm_dec, ts256); + test_gcm_vectors(v, job_sgl_aes_gcm_enc, job_sgl_aes_gcm_dec, ts256); - test_gcm_vectors_burst(&vectors[vect], - burst_sgl_aes_gcm_enc, - burst_sgl_aes_gcm_dec, - ts256); + test_gcm_vectors_burst(v, burst_sgl_aes_gcm_enc, + burst_sgl_aes_gcm_dec, ts256); } else { - test_gcm_vectors(&vectors[vect], - aes_gcm_enc, - aes_gcm_dec, - ts256); - test_gcm_vectors(&vectors[vect], - job_aes_gcm_enc, - job_aes_gcm_dec, - ts256); - test_gcm_vectors_burst(&vectors[vect], - burst_aes_gcm_enc, - burst_aes_gcm_dec, - ts256); - test_gcm_vectors(&vectors[vect], - quic_aes_gcm_enc, - quic_aes_gcm_dec, - ts256); - test_gcm_vectors_burst(&vectors[vect], - burst_quic_gcm_enc, - burst_quic_gcm_dec, + test_gcm_vectors(v, aes_gcm_enc, aes_gcm_dec, ts256); + test_gcm_vectors(v, job_aes_gcm_enc, job_aes_gcm_dec, ts256); + test_gcm_vectors_burst(v, burst_aes_gcm_enc, burst_aes_gcm_dec, ts256); + test_gcm_vectors(v, quic_aes_gcm_enc, quic_aes_gcm_dec, ts256); + test_gcm_vectors_burst(v, burst_quic_gcm_enc, + burst_quic_gcm_dec, ts256); } break; default: @@ -2459,8 +1352,7 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, segments = malloc(num_segments * sizeof(*segments)); if (segments == NULL) { - fprintf(stderr, - "Could not allocate memory for segments array\n"); + fprintf(stderr, "Could not allocate memory for segments array\n"); test_suite_update(ctx, 0, 1); goto exit; } @@ -2469,9 +1361,7 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, for (i = 0; i < (num_segments - 1); i++) { segments[i] = malloc(seg_sz); if (segments[i] == NULL) { - fprintf(stderr, - "Could not allocate memory for segment %u\n", - i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -2482,8 +1372,7 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, } segments[i] = malloc(last_seg_sz); if (segments[i] == NULL) { - fprintf(stderr, "Could not allocate memory for segment %u\n", - i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -2495,30 +1384,22 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, /* Process linear (single segment) buffer */ if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, in_buffer, in_buffer, buffer_sz, iv, IV_SZ, aad, AAD_SZ, - linear_digest, DIGEST_SZ, - &gcm_ctx, IMB_CIPHER_GCM, 0) < 0) { + linear_digest, DIGEST_SZ, &gcm_ctx, IMB_CIPHER_GCM, 0) < 0) { test_suite_update(ctx, 0, 1); goto exit; } else test_suite_update(ctx, 1, 0); /* Process multi-segment buffer */ - aes_gcm_single_job_sgl(mb_mgr, cipher_dir, &key, key_sz, - sgl_segs, num_segments, - iv, IV_SZ, aad, AAD_SZ, - sgl_digest, DIGEST_SZ, &gcm_ctx); + aes_gcm_single_job_sgl(mb_mgr, cipher_dir, &key, key_sz, sgl_segs, num_segments, + iv, IV_SZ, aad, AAD_SZ, sgl_digest, DIGEST_SZ, &gcm_ctx); for (i = 0; i < (num_segments - 1); i++) { - if (memcmp(in_buffer + i*seg_sz, segments[i], - seg_sz) != 0) { - printf("ciphertext mismatched " - "in segment number %u " - "(segment size = %u)\n", - i, seg_sz); - hexdump(stderr, "Expected output", - in_buffer + i*seg_sz, seg_sz); - hexdump(stderr, "SGL output", segments[i], - seg_sz); + if (memcmp(in_buffer + i*seg_sz, segments[i], seg_sz) != 0) { + printf("ciphertext mismatched in segment number %u " + "(segment size = %u)\n", i, seg_sz); + hexdump(stderr, "Expected output", in_buffer + i*seg_sz, seg_sz); + hexdump(stderr, "SGL output", segments[i], seg_sz); test_suite_update(ctx, 0, 1); goto exit; } @@ -2527,18 +1408,14 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, if (memcmp(in_buffer + i*seg_sz, segments[i], last_seg_sz) != 0) { printf("ciphertext mismatched " - "in segment number %u (segment size = %u)\n", - i, seg_sz); - hexdump(stderr, "Expected output", - in_buffer + i*seg_sz, last_seg_sz); + "in segment number %u (segment size = %u)\n", i, seg_sz); + hexdump(stderr, "Expected output", in_buffer + i*seg_sz, last_seg_sz); hexdump(stderr, "SGL output", segments[i], last_seg_sz); test_suite_update(ctx, 0, 1); } if (memcmp(sgl_digest, linear_digest, 16) != 0) { - printf("hash mismatched (segment size = %u)\n", - seg_sz); - hexdump(stderr, "Expected digest", - linear_digest, DIGEST_SZ); + printf("hash mismatched (segment size = %u)\n", seg_sz); + hexdump(stderr, "Expected digest", linear_digest, DIGEST_SZ); hexdump(stderr, "SGL digest", sgl_digest, DIGEST_SZ); test_suite_update(ctx, 0, 1); } else { @@ -2629,8 +1506,7 @@ test_sgl(struct IMB_MGR *mb_mgr, segments[i] = malloc(seg_sz); if (segments[i] == NULL) { fprintf(stderr, - "Could not allocate memory for segment %u\n", - i); + "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -2639,8 +1515,7 @@ test_sgl(struct IMB_MGR *mb_mgr, } segments[i] = malloc(last_seg_sz); if (segments[i] == NULL) { - fprintf(stderr, "Could not allocate memory for segment %u\n", - i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -2669,8 +1544,7 @@ test_sgl(struct IMB_MGR *mb_mgr, } else test_suite_update(ctx, 1, 0); } else { - imb_aes_gcm_init(mb_mgr, &key, &gcm_ctx, iv, IV_SZ, aad, AAD_SZ, - key_sz); + imb_aes_gcm_init(mb_mgr, &key, &gcm_ctx, iv, IV_SZ, aad, AAD_SZ, key_sz); test_suite_update(ctx, 1, 0); } @@ -2698,52 +1572,38 @@ test_sgl(struct IMB_MGR *mb_mgr, } } else { if (cipher_dir == IMB_DIR_ENCRYPT) { - imb_aes_gcm_enc_update(mb_mgr, &key, &gcm_ctx, - seg_ptr, seg_ptr, - seg_size, key_sz); + imb_aes_gcm_enc_update(mb_mgr, &key, &gcm_ctx, seg_ptr, + seg_ptr, seg_size, key_sz); } else { - imb_aes_gcm_dec_update(mb_mgr, &key, &gcm_ctx, - seg_ptr, seg_ptr, - seg_size, key_sz); + imb_aes_gcm_dec_update(mb_mgr, &key, &gcm_ctx, seg_ptr, + seg_ptr, seg_size, key_sz); } } } if (job_api) { - if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, - NULL, NULL, 0, - iv, IV_SZ, NULL, 0, sgl_digest, DIGEST_SZ, - &gcm_ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_COMPLETE) < 0) { + if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, NULL, NULL, 0, + iv, IV_SZ, NULL, 0, sgl_digest, DIGEST_SZ, &gcm_ctx, + IMB_CIPHER_GCM_SGL, IMB_SGL_COMPLETE) < 0) { test_suite_update(ctx, 0, 1); goto exit; } } else { if (cipher_dir == IMB_DIR_ENCRYPT) - imb_aes_gcm_enc_finalize(mb_mgr, &key, - &gcm_ctx, - sgl_digest, - DIGEST_SZ, - key_sz); + imb_aes_gcm_enc_finalize(mb_mgr, &key, &gcm_ctx, sgl_digest, + DIGEST_SZ, key_sz); else - imb_aes_gcm_dec_finalize(mb_mgr, &key, - &gcm_ctx, - sgl_digest, - DIGEST_SZ, - key_sz); + imb_aes_gcm_dec_finalize(mb_mgr, &key, &gcm_ctx, sgl_digest, + DIGEST_SZ, key_sz); } for (i = 0; i < (num_segments - 1); i++) { if (memcmp(in_buffer + i*seg_sz, segments[i], seg_sz) != 0) { - printf("ciphertext mismatched " - "in segment number %u " - "(segment size = %u)\n", - i, seg_sz); - hexdump(stderr, "Expected output", - in_buffer + i*seg_sz, seg_sz); - hexdump(stderr, "SGL output", segments[i], - seg_sz); + printf("ciphertext mismatched in segment number %u " + "(segment size = %u)\n", i, seg_sz); + hexdump(stderr, "Expected output", in_buffer + i*seg_sz, seg_sz); + hexdump(stderr, "SGL output", segments[i], seg_sz); test_suite_update(ctx, 0, 1); goto exit; } @@ -2751,19 +1611,15 @@ test_sgl(struct IMB_MGR *mb_mgr, /* Check last segment */ if (memcmp(in_buffer + i*seg_sz, segments[i], last_seg_sz) != 0) { - printf("ciphertext mismatched " - "in segment number %u (segment size = %u)\n", + printf("ciphertext mismatched in segment number %u (segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Expected output", - in_buffer + i*seg_sz, last_seg_sz); + hexdump(stderr, "Expected output", in_buffer + i*seg_sz, last_seg_sz); hexdump(stderr, "SGL output", segments[i], last_seg_sz); test_suite_update(ctx, 0, 1); } if (memcmp(sgl_digest, linear_digest, 16) != 0) { - printf("hash mismatched (segment size = %u)\n", - seg_sz); - hexdump(stderr, "Expected digest", - linear_digest, DIGEST_SZ); + printf("hash mismatched (segment size = %u)\n", seg_sz); + hexdump(stderr, "Expected digest", linear_digest, DIGEST_SZ); hexdump(stderr, "SGL digest", sgl_digest, DIGEST_SZ); test_suite_update(ctx, 0, 1); } else { @@ -2795,28 +1651,15 @@ int gcm_test(IMB_MGR *p_mgr) test_suite_start(&ts128, "AES-GCM-128"); test_suite_start(&ts192, "AES-GCM-192"); test_suite_start(&ts256, "AES-GCM-256"); - test_gcm_std_vectors(&ts128, &ts192, &ts256, - gcm_vectors, DIM(gcm_vectors), 0); + test_gcm_std_vectors(&ts128, &ts192, &ts256, gcm_test_json, 0); errors = test_suite_end(&ts128); errors += test_suite_end(&ts192); errors += test_suite_end(&ts256); - test_suite_start(&ts128, "AES-GCM-128 (Variable IV length)"); - test_suite_start(&ts192, "AES-GCM-192 (Variable IV length)"); - test_suite_start(&ts256, "AES-GCM-256 (Variable IV length)"); - test_gcm_std_vectors(&ts128, &ts192, &ts256, - gcm_iv_vectors, DIM(gcm_iv_vectors), 0); - errors += test_suite_end(&ts128); - errors += test_suite_end(&ts192); - errors += test_suite_end(&ts256); - test_suite_start(&ts128, "SGL-GCM-128"); test_suite_start(&ts192, "SGL-GCM-192"); test_suite_start(&ts256, "SGL-GCM-256"); - test_gcm_std_vectors(&ts128, &ts192, &ts256, - gcm_vectors, DIM(gcm_vectors), 1); - test_gcm_std_vectors(&ts128, &ts192, &ts256, - gcm_iv_vectors, DIM(gcm_iv_vectors), 1); + test_gcm_std_vectors(&ts128, &ts192, &ts256, gcm_test_json, 1); /* SGL test comparing linear buffer with segmented buffers */ for (key_sz = IMB_KEY_128_BYTES; key_sz <= IMB_KEY_256_BYTES; key_sz += 16) { diff --git a/test/kat-app/gcm_test.json.c b/test/kat-app/gcm_test.json.c new file mode 100644 index 00000000..cb385924 --- /dev/null +++ b/test/kat-app/gcm_test.json.c @@ -0,0 +1,359 @@ +/********************************************************************** + Copyright(c) 2023 Intel Corporation All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**********************************************************************/ + + +/* AES-GCM */ +#include "aead_test.h" +const struct aead_test gcm_test_json[] = { + /* Vectors from + http://www.ieee802.org/1/files/public/docs2011/ + bn-randall-test-vectors-0511-v1.pdf + */ + {96, 128, 128, 1, + "\xad\x7a\x2b\xd0\x3e\xac\x83\x5a\x6f\x62\x0f\xdc\xb5\x06\xb3\x45", + "\x12\x15\x35\x24\xc0\x89\x5e\x81\xb2\xc2\x84\x65", + "\xd6\x09\xb1\xf0\x56\x63\x7a\x0d\x46\xdf\x99\x8d\x88\xe5\x2e\x00\xb2\xc2" + "\x84\x65\x12\x15\x35\x24\xc0\x89\x5e\x81", + "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" + "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" + "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x00\x02", + "\x70\x1a\xfa\x1c\xc0\x39\xc0\xd7\x65\x12\x8a\x66\x5d\xab\x69\x24\x38\x99" + "\xbf\x73\x18\xcc\xdc\x81\xc9\x93\x1d\xa1\x7f\xbe\x8e\xdd\x7d\x17\xcb\x8b" + "\x4c\x26\xfc\x81\xe3\x28\x4f\x2b\x7f\xba\x71\x3d", + "\x4f\x8d\x55\xe7\xd3\xf0\x6f\xd5\xa1\x3c\x0c\x29\xb9\xd5\xb8\x80", 1, 224, + 384}, + {96, 128, 128, 2, + "\x07\x1b\x11\x3b\x0c\xa7\x43\xfe\xcc\xcf\x3d\x05\x1f\x73\x73\x82", + "\xf0\x76\x1e\x8d\xcd\x3d\x00\x01\x76\xd4\x57\xed", + "\xe2\x01\x06\xd7\xcd\x0d\xf0\x76\x1e\x8d\xcd\x3d\x88\xe5\x4c\x2a\x76\xd4" + "\x57\xed", + "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" + "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" + "\x31\x32\x33\x34\x00\x04", + "\x13\xb4\xc7\x2b\x38\x9d\xc5\x01\x8e\x72\xa1\x71\xdd\x85\xa5\xd3\x75\x22" + "\x74\xd3\xa0\x19\xfb\xca\xed\x09\xa4\x25\xcd\x9b\x2e\x1c\x9b\x72\xee\xe7" + "\xc9\xde\x7d\x52\xb3\xf3", + "\xd6\xa5\x28\x4f\x4a\x6d\x3f\xe2\x2a\x5d\x6c\x2b\x96\x04\x94\xc3", 1, 160, + 336}, + /* Vectors from http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip + gcmEncryptExtIV128.rsp */ + {96, 128, 128, 3, + "\xc9\x39\xcc\x13\x39\x7c\x1d\x37\xde\x6a\xe0\xe1\xcb\x7c\x42\x3c", + "\xb3\xd8\xcc\x01\x7c\xbb\x89\xb3\x9e\x0f\x67\xe2", + "\x24\x82\x56\x02\xbd\x12\xa9\x84\xe0\x09\x2d\x3e\x44\x8e\xda\x5f", + "\xc3\xb3\xc4\x1f\x11\x3a\x31\xb7\x3d\x9a\x5c\xd4\x32\x10\x30\x69", + "\x93\xfe\x7d\x9e\x9b\xfd\x10\x34\x8a\x56\x06\xe5\xca\xfa\x73\x54", + "\x00\x32\xa1\xdc\x85\xf1\xc9\x78\x69\x25\xa2\xe7\x1d\x82\x72\xdd", 1, 128, + 128}, + {96, 128, 128, 4, + "\x29\x8e\xfa\x1c\xcf\x29\xcf\x62\xae\x68\x24\xbf\xc1\x95\x57\xfc", + "\x6f\x58\xa9\x3f\xe1\xd2\x07\xfa\xe4\xed\x2f\x6d", + "\x02\x1f\xaf\xd2\x38\x46\x39\x73\xff\xe8\x02\x56\xe5\xb1\xc6\xb1", + "\xcc\x38\xbc\xcd\x6b\xc5\x36\xad\x91\x9b\x13\x95\xf5\xd6\x38\x01\xf9\x9f" + "\x80\x68\xd6\x5c\xa5\xac\x63\x87\x2d\xaf\x16\xb9\x39\x01", + "\xdf\xce\x4e\x9c\xd2\x91\x10\x3d\x7f\xe4\xe6\x33\x51\xd9\xe7\x9d\x3d\xfd" + "\x39\x1e\x32\x67\x10\x46\x58\x21\x2d\xa9\x65\x21\xb7\xdb", + "\x54\x24\x65\xef\x59\x93\x16\xf7\x3a\x7a\x56\x05\x09\xa2\xd9\xf2", 1, 128, + 256}, + {96, 128, 128, 5, + "\x29\x8e\xfa\x1c\xcf\x29\xcf\x62\xae\x68\x24\xbf\xc1\x95\x57\xfc", + "\x6f\x58\xa9\x3f\xe1\xd2\x07\xfa\xe4\xed\x2f\x6d", + "\x02\x1f\xaf\xd2\x38\x46\x39\x73\xff\xe8\x02\x56\xe5\xb1\xc6\xb1", + "\xcc\x38\xbc\xcd\x6b\xc5\x36\xad\x91\x9b\x13\x95\xf5\xd6\x38\x01\xf9\x9f" + "\x80\x68\xd6\x5c\xa5\xac\x63\x87\x2d\xaf\x16\xb9\x39\x01", + "\xdf\xce\x4e\x9c\xd2\x91\x10\x3d\x7f\xe4\xe6\x33\x51\xd9\xe7\x9d\x3d\xfd" + "\x39\x1e\x32\x67\x10\x46\x58\x21\x2d\xa9\x65\x21\xb7\xdb", + "\x54\x24\x65\xef\x59\x93\x16\xf7\x3a\x7a\x56\x05\x09\xa2\xd9\xf2", 1, 128, + 256}, + /* Vectors from + http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf + */ + {96, 128, 128, 6, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\x88\xda\xce\x60\xb6\xa3\x92\xf3\x28\xc2\xb9\x71\xb2\xfe\x78", + "\xab\x6e\x47\xd4\x2c\xec\x13\xbd\xf5\x3a\x67\xb2\x12\x57\xbd\xdf", 1, 0, + 128}, + {96, 128, 128, 7, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", "\x00", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55", + "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa" + "\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2" + "\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a" + "\xac\x97\x3d\x58\xe0\x91\x47\x3f\x59\x85", + "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4", 1, 0, + 512}, + {96, 128, 128, 8, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa" + "\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2" + "\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a" + "\xac\x97\x3d\x58\xe0\x91\x47\x3f\x59\x85", + "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb\x94\xfa\xe9\x5a\xe7\x12\x1a\x47", 1, 160, + 480}, + {96, 256, 128, 9, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xce\xa7\x40\x3d\x4d\x60\x6b\x6e\x07\x4e\xc5\xd3\xba\xf3\x9d\x18", + "\xd0\xd1\xc8\xa7\x99\x99\x6b\xf0\x26\x5b\x98\xb5\xd4\x8a\xb9\x19", 1, 0, + 128}, + {96, 256, 128, 10, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", "\x00", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62\x89\x80\x15\xad", + "\xb0\x94\xda\xc5\xd9\x34\x71\xbd\xec\x1a\x50\x22\x70\xe3\xcc\x6c", 1, 0, + 512}, + {96, 256, 128, 11, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d\x55\x1b", 1, 160, + 480}, + /* Vectors from https://tools.ietf.org/html/draft-mcgrew-gcm-test-01 case #7 + */ + {96, 192, 128, 12, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\x00\x00\xa5\xf8\x00\x00\x00\x0a", + "\x45\x00\x00\x28\xa4\xad\x40\x00\x40\x06\x78\x80\x0a\x01\x03\x8f\x0a\x01" + "\x06\x12\x80\x23\x06\xb8\xcb\x71\x26\x02\xdd\x6b\xb0\x3e\x50\x10\x16\xd0" + "\x75\x68\x00\x01", + "\xa5\xb1\xf8\x06\x60\x29\xae\xa4\x0e\x59\x8b\x81\x22\xde\x02\x42\x09\x38" + "\xb3\xab\x33\xf8\x28\xe6\x87\xb8\x85\x8b\x5b\xfb\xdb\xd0\x31\x5b\x27\x45" + "\x21\x44\xcc\x77", + "\x95\x45\x7b\x96\x52\x03\x7f\x53\x18\x02\x7b\x5b\x4c\xd7\xa6\x36", 1, 64, + 320}, + {96, 256, 32, 13, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce", 1, 160, 480}, + {96, 256, 64, 14, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68", 1, 160, 480}, + {96, 256, 112, 15, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d", 1, 160, 480}, + {96, 256, 120, 16, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d\x55", 1, 160, + 480}, + {96, 128, 128, 17, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", + "\x00\x01\x02\x03\x04\x05\x06\x07", "", "", + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 1, 64, + 0}, + {96, 128, 128, 18, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x93\x6d\xa5\xcd\x62\x1e\xf1\x53\x43\xdb\x6b\x81\x3a\xae\x7e\x07", + "\xfe\x8e\xc5\x55\x5f\x36\x08\xf7\x0e\xbc\x7f\xce\xe9\x59\x2e\x9b", 1, 0, + 128}, + {96, 128, 128, 19, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "", "", "", + "\x43\x5b\x9b\xa1\x2d\x75\xa4\xbe\x8a\x97\x7e\xa3\xcd\x01\x18\x90", 1, 0, + 0}, + {96, 128, 8, 20, + "\xad\x7a\x2b\xd0\x3e\xac\x83\x5a\x6f\x62\x0f\xdc\xb5\x06\xb3\x45", + "\x12\x15\x35\x24\xc0\x89\x5e\x81\xb2\xc2\x84\x65", + "\xd6\x09\xb1\xf0\x56\x63\x7a\x0d\x46\xdf\x99\x8d\x88\xe5\x2e\x00\xb2\xc2" + "\x84\x65\x12\x15\x35\x24\xc0\x89\x5e\x81", + "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" + "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" + "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x00\x02", + "\x70\x1a\xfa\x1c\xc0\x39\xc0\xd7\x65\x12\x8a\x66\x5d\xab\x69\x24\x38\x99" + "\xbf\x73\x18\xcc\xdc\x81\xc9\x93\x1d\xa1\x7f\xbe\x8e\xdd\x7d\x17\xcb\x8b" + "\x4c\x26\xfc\x81\xe3\x28\x4f\x2b\x7f\xba\x71\x3d", + "\x4f", 1, 224, 384}, + {96, 128, 128, 21, + "\x76\x80\xc5\xd3\xca\x61\x54\x75\x8e\x51\x0f\x4d\x25\xb9\x88\x20", + "\xf8\xf1\x05\xf9\xc3\xdf\x49\x65\x78\x03\x21\xf8", + "\xc9\x4c\x41\x01\x94\xc7\x65\xe3\xdc\xc7\x96\x43\x79\x75\x8e\xd3", "", "", + "\x94\xdc\xa8\xed\xfc\xf9\x0b\xb7\x4b\x15\x3c\x8d\x48\xa1\x79\x30", 1, 128, + 0}, + /* Vectors from + http://csrc.nist.gov/groups/ST/toolkit/BCM/ + documents/proposedmodes/gcm/gcm-revised-spec.pdf + */ + {64, 256, 128, 22, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\xc3\x76\x2d\xf1\xca\x78\x7d\x32\xae\x47\xc1\x3b\xf1\x98\x44\xcb\xaf\x1a" + "\xe1\x4d\x0b\x97\x6a\xfa\xc5\x2f\xf7\xd7\x9b\xba\x9d\xe0\xfe\xb5\x82\xd3" + "\x39\x34\xa4\xf0\x95\x4c\xc2\x36\x3b\xc7\x3f\x78\x62\xac\x43\x0e\x64\xab" + "\xe4\x99\xf4\x7c\x9b\x1f", + "\x3a\x33\x7d\xbf\x46\xa7\x92\xc4\x5e\x45\x49\x13\xfe\x2e\xa8\xf2", 1, 160, + 480}, + {8, 128, 128, 23, + "\x83\xf9\xd9\x7d\x4a\xb7\x59\xfd\xdc\xc3\xef\x54\xa0\xe2\xa8\xec", "\xcf", + "\x6d\xd4\x9e\xae\xb4\x10\x3d\xac\x8f\x97\xe3\x23\x49\x46\xdd\x2d", + "\x77\xe6\x32\x9c\xf9\x42\x4f\x71\xc8\x08\xdf\x91\x70\xbf\xd2\x98", + "\x50\xde\x86\xa7\xa9\x2a\x8a\x5e\xa3\x3d\xb5\x69\x6b\x96\xcd\x77", + "\xaa\x18\x1e\x84\xbc\x8b\x4b\xf5\xa6\x89\x27\xc4\x09\xd4\x22\xcb", 1, 128, + 128}, + {8, 192, 128, 24, + "\x8b\x1c\x63\xbc\xcb\x55\x79\xe5\x88\x7f\x5b\xf7\xb2\xbd\x0c\xbc\xff\x13" + "\x6d\x40\xd7\xb6\x1a\xb2", + "\xca", "\x8f\xbe\x5a\x21\xa6\x5b\xdd\xd0\x33\x16\x04\xc9\x17\x83\x9c\xf7", + "\x22\x4f\x5f\x2a\x23\x7b\x30\x7c\x78\x42\xde\x75\xd9\xd1\xbb\x65", + "\x83\x49\xe3\xa4\x8f\x5d\x89\xd9\x42\xc2\x4d\x80\xae\xfb\x1c\x5f", + "\x3d\x49\xe3\xd4\x3f\x9a\x4a\x96\x4c\x6d\x84\x4d\x60\xb4\xef\x1e", 1, 128, + 128}, + {1024, 128, 32, 25, + "\x0e\x00\xc7\x65\x61\xd2\xbd\x9b\x40\xc3\xc1\x54\x27\xe2\xb0\x8f", + "\x49\x2c\xad\xac\xcd\x3c\xa3\xfb\xc9\xcf\x9f\x06\xeb\x33\x25\xc4\xe1\x59" + "\x85\x0b\x0d\xbe\x98\x19\x9b\x89\xb7\xaf\x52\x88\x06\x61\x0b\x6f\x63\x99" + "\x8e\x1e\xae\x80\xc3\x48\xe7\x4c\xbb\x92\x1d\x83\x26\x63\x16\x31\xfc\x6a" + "\x5d\x30\x4f\x39\x16\x6d\xaf\x7e\xa1\x5f\xa1\x97\x7f\x10\x18\x19\xad\xb5" + "\x10\xb5\x0f\xe9\x93\x2e\x12\xc5\xa8\x5a\xa3\xfd\x1e\x73\xd8\xd7\x60\xaf" + "\x21\x8b\xe8\x29\x90\x3a\x77\xc6\x33\x59\xd7\x5e\xdd\x91\xb4\xf6\xed\x54" + "\x65\xa7\x26\x62\xf5\x05\x59\x99\xe0\x59\xe7\x65\x4a\x8e\xdc\x92\x1a\xa0" + "\xd4\x96", + "\xd8\xf1\x16\x3d\x8c\x84\x02\x92\xa2\xb2\xda\xcf\x4a\xc7\xc3\x6a\xff\x87" + "\x33\xf1\x8f\xab\xb4\xfa\x55\x94\x54\x41\x25\xe0\x3d\x1e\x6e\x5d\x6d\x0f" + "\xd6\x16\x56\xc8\xd8\xf3\x27\xc9\x28\x39\xae\x55\x39\xbb\x46\x9c\x92\x57" + "\xf1\x09\xeb\xff\x85\xaa\xd7\xbd\x22\x0f\xda\xa9\x5c\x02\x2d\xbd\x0c\x7b" + "\xb2\xd8\x78\xad\x50\x41\x22\xc9\x43\x04\x5d\x3c\x5e\xba\x8f\x1f\x56\xc0", + "\xfe\xf0\x3c\x2d\x7f\xb1\x5b\xf0\xd2\xdf\x18\x00\x7d\x99\xf9\x67\xc8\x78" + "\xad\x59\x35\x90\x34\xf7\xbb\x2c\x19\xaf\x12\x06\x85\xd7\x8e\x32\xf6\xb8" + "\xb8\x3b\x03\x20\x19\x95\x6c\xa9\xc0\x19\x57\x21\x47\x6b\x85", + "\x4f\x6c\xf4\x71\xbe\x7c\xbd\x25\x75\xcd\x5a\x17\x47\xae\xa8\xfe\x9d\xea" + "\x83\xe5\x19\x36\xbe\xac\x3e\x68\xf6\x62\x06\x92\x20\x60\xc6\x97\xff\xa7" + "\xaf\x80\xad\x6b\xb6\x8f\x2c\xf4\xfc\x97\x41\x6e\xe5\x2a\xbe", + "\xe2\x0b\x66\x55", 1, 720, 408}, + {480, 256, 128, 26, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\x93\x13\x22\x5d\xf8\x84\x06\xe5\x55\x90\x9c\x5a\xff\x52\x69\xaa\x6a\x7a" + "\x95\x38\x53\x4f\x7d\xa1\xe4\xc3\x03\xd2\xa3\x18\xa7\x28\xc3\xc0\xc9\x51" + "\x56\x80\x95\x39\xfc\xf0\xe2\x42\x9a\x6b\x52\x54\x16\xae\xdb\xf5\xa0\xde" + "\x6a\x57\xa6\x37\xb3\x9b", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x5a\x8d\xef\x2f\x0c\x9e\x53\xf1\xf7\x5d\x78\x53\x65\x9e\x2a\x20\xee\xb2" + "\xb2\x2a\xaf\xde\x64\x19\xa0\x58\xab\x4f\x6f\x74\x6b\xf4\x0f\xc0\xc3\xb7" + "\x80\xf2\x44\x45\x2d\xa3\xeb\xf1\xc5\xd8\x2c\xde\xa2\x41\x89\x97\x20\x0e" + "\xf8\x2e\x44\xae\x7e\x3f", + "\xa4\x4a\x82\x66\xee\x1c\x8e\xb0\xc8\xb5\xd4\xcf\x5a\xe9\xf1\x9a", 1, 160, + 480}, + {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 714923a7..74015d30 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 583d0de47cb2a50eee580031e56dcc7cfc2e5dd6 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 22 Jun 2023 15:47:19 +0100 Subject: [PATCH 036/204] lib: [QUIC] add CHACHA20 HP API --- ReleaseNotes.txt | 2 +- lib/Makefile | 1 + lib/ipsec-mb.h | 20 ++++++++ lib/libIPSec_MB.def | 1 + lib/win_x64.mak | 1 + lib/x86_64/quic_hp_chacha20.c | 86 +++++++++++++++++++++++++++++++++++ 6 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 lib/x86_64/quic_hp_chacha20.c diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index f96d5549..abde1628 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -5,7 +5,7 @@ Unreleased ======================================================================= Library -- QUIC CHACHA20-POLY1305 API added. +- QUIC CHACHA20-POLY1305 and CHACHA20 HP API added. Test Applications - QUIC CHACHA20-POLY1305 tests added. diff --git a/lib/Makefile b/lib/Makefile index 924c524a..e89c600c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -428,6 +428,7 @@ c_lib_objs := \ self_test.o \ quic_aes_gcm.o \ quic_hp_aes_ecb.o \ + quic_hp_chacha20.o \ quic_chacha20_poly1305.o \ hmac_ipad_opad.o \ cipher_suite_id.o diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 98d33f47..d8c4f244 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -4014,6 +4014,26 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, const uint64_t tag_len, const uint64_t num_packets); +/** + * @brief Batch of ChaCha20 encrypt operations with the same key + * + * Sample size is fixed to 16 bytes (read from source pointers). + * Mask output size is fixed to 5 bytes (written to destination pointer). + * Cipher direction is fixed to ENCRYPT. + * + * @param [in] state pointer to IMB_MGR + * @param [in] key Cipher key + * @param [out] dst_ptr_array array with destination pointers + * @param [in] src_ptr_array array with source sample pointers + * @param [in] num_packets number of packets in this batch + */ +IMB_DLL_EXPORT void +imb_quic_hp_chacha20(IMB_MGR *state, + const void *key, + void *dst_ptr_array[], + const void * const src_ptr_array[], + const uint64_t num_packets); + /** * @brief Sets up suite_id and session_id fields for selected cipher suite in * provided \a job structure diff --git a/lib/libIPSec_MB.def b/lib/libIPSec_MB.def index d32d2db1..aeab91c4 100644 --- a/lib/libIPSec_MB.def +++ b/lib/libIPSec_MB.def @@ -711,3 +711,4 @@ EXPORTS sha256_sse_shani @685 sha256_one_block_sse_shani @686 imb_quic_chacha20_poly1305 @687 + imb_quic_hp_chacha20 @688 diff --git a/lib/win_x64.mak b/lib/win_x64.mak index 6a0a26e3..ff1374b2 100644 --- a/lib/win_x64.mak +++ b/lib/win_x64.mak @@ -364,6 +364,7 @@ lib_objs1 = \ $(OBJ_DIR)\self_test.obj \ $(OBJ_DIR)\quic_aes_gcm.obj \ $(OBJ_DIR)\quic_hp_aes_ecb.obj \ + $(OBJ_DIR)\quic_hp_chacha20.obj \ $(OBJ_DIR)\quic_chacha20_poly1305.obj \ $(OBJ_DIR)\hmac_ipad_opad.obj \ $(OBJ_DIR)\cipher_suite_id.obj diff --git a/lib/x86_64/quic_hp_chacha20.c b/lib/x86_64/quic_hp_chacha20.c new file mode 100644 index 00000000..e7c9785c --- /dev/null +++ b/lib/x86_64/quic_hp_chacha20.c @@ -0,0 +1,86 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +#include "ipsec-mb.h" +#include "include/error.h" +#include "include/chacha20_poly1305.h" + +IMB_DLL_EXPORT void +imb_quic_hp_chacha20(IMB_MGR *state, + const void *key, + void *dst_ptr_array[], + const void * const src_ptr_array[], + const uint64_t num_packets) +{ +#ifdef SAFE_PARAM + uint64_t i; + + if (state == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_MBMGR); + return; + } + if (key == NULL) { + imb_set_errno(state, IMB_ERR_NULL_EXP_KEY); + return; + } + if (dst_ptr_array == NULL) { + imb_set_errno(state, IMB_ERR_NULL_DST); + return; + } + if (src_ptr_array == NULL) { + imb_set_errno(state, IMB_ERR_NULL_SRC); + return; + } + for (i = 0; i < num_packets; i++) { + if (dst_ptr_array[i] == NULL) { + imb_set_errno(state, IMB_ERR_NULL_DST); + return; + } + if (src_ptr_array[i] == NULL) { + imb_set_errno(state, IMB_ERR_NULL_SRC); + return; + } + } + +#endif /* SAFE_PARAM */ + + IMB_JOB job; + uint8_t src[5] = {0, 0, 0, 0, 0}; + + job.msg_len_to_cipher_in_bytes = 5; + job.cipher_start_src_offset_in_bytes = 0; + job.src = src; + job.enc_keys = key; + + for (i = 0; i < num_packets; i++) { + job.iv = src_ptr_array[i]; + job.dst = dst_ptr_array[i]; + submit_job_chacha20_enc_dec_avx512(&job); + } + + imb_set_errno(state, 0); +} -- GitLab From 8573cfc1ae2ecec88bb299b8d91d1ef4d53efd79 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 23 Jun 2023 16:02:50 +0100 Subject: [PATCH 037/204] avx512: [QUIC] implement ChaCha20 HP --- lib/avx512_t1/chacha20_avx512.asm | 536 +++++++++++++++++++++++++++++- lib/include/chacha20_poly1305.h | 4 + lib/x86_64/quic_hp_chacha20.c | 14 +- 3 files changed, 536 insertions(+), 18 deletions(-) diff --git a/lib/avx512_t1/chacha20_avx512.asm b/lib/avx512_t1/chacha20_avx512.asm index e38042a5..5514265f 100644 --- a/lib/avx512_t1/chacha20_avx512.asm +++ b/lib/avx512_t1/chacha20_avx512.asm @@ -191,7 +191,7 @@ mksection .text ; Macro adding original state values to processed state values ; and transposing 16x16 u32 from first 16 ZMM registers, ; creating keystreams. -; Note that the registers are tranposed in a different +; Note that the registers are transposed in a different ; order, so first register (IN00) containing row 0 ; will not contain the first column of the matrix, but ; row 1 and same with other registers. @@ -453,6 +453,206 @@ mksection .text %endmacro +; +; Macro adding original state values to processed state values +; and transposing 16x16 u32 from first 16 ZMM registers, +; creating keystreams. +; Note that the registers are transposed in a different +; order, so first register (IN00) containing row 0 +; will not contain the first column of the matrix, but +; row 1 and same with other registers. +; This is done to minimize the number of registers clobbered. +; Once transposition is done, keystream is XOR'd with the plaintext +; and output buffer is written. +; +%macro GENERATE_1K_KS_AND_ENCRYPT_QUIC 36 +%define %%IN00_KS01 %1 ; [in/clobbered] Input row 0 of state, bytes 64-127 of keystream +%define %%IN01_KS02 %2 ; [in/clobbered] Input row 1 of state, bytes 128-191 of keystream +%define %%IN02_KS15 %3 ; [in/clobbered] Input row 2 of state, bytes 960-1023 of keystream +%define %%IN03_KS04 %4 ; [in/clobbered] Input row 3 of state, bytes 256-319 of keystream +%define %%IN04_KS08 %5 ; [in/clobbered] Input row 4 of state, bytes 512-575 of keystream +%define %%IN05 %6 ; [in/clobbered] Input row 5 of state, bytes 576-639 of keystream +%define %%IN06_KS13 %7 ; [in/clobbered] Input row 6 of state, bytes 832-895 of keystream +%define %%IN07_KS07 %8 ; [in/clobbered] Input row 7 of state, bytes 448-511 of keystream +%define %%IN08_KS05 %9 ; [in/clobbered] Input row 8 of state, bytes 320-383 of keystream +%define %%IN09_KS00 %10 ; [in/clobbered] Input row 9 of state, bytes 0-63 of keystream +%define %%IN10_KS06 %11 ; [in/clobbered] Input row 10 of state, bytes 384-447 of keystream +%define %%IN11_KS11 %12 ; [in/clobbered] Input row 11 of state, bytes 704-767 of keystream +%define %%IN12_KS12 %13 ; [in/clobbered] Input row 12 of state, bytes 768-831 of keystream +%define %%IN13_KS03 %14 ; [in/clobbered] Input row 13 of state, bytes 192-255 of keystream +%define %%IN14_KS14 %15 ; [in/clobbered] Input row 14 of state, bytes 896-959 of keystream +%define %%IN15 %16 ; [in/clobbered] Input row 15 of state, bytes 640-703 of keystream +%define %%IN_ORIG00_KS09 %17 ; [in/clobbered] Original input row 0, bytes 576-639 of keystream +%define %%IN_ORIG01_KS10 %18 ; [in/clobbered] Original input row 1, bytes 640-703 of keystream +%define %%IN_ORIG02 %19 ; [in] Original input row 2 +%define %%IN_ORIG03 %20 ; [in] Original input row 3 +%define %%IN_ORIG04 %21 ; [in] Original input row 4 +%define %%IN_ORIG05 %22 ; [in] Original input row 5 +%define %%IN_ORIG06 %23 ; [in] Original input row 6 +%define %%IN_ORIG07 %24 ; [in] Original input row 7 +%define %%IN_ORIG08 %25 ; [in] Original input row 8 +%define %%IN_ORIG09 %26 ; [in] Original input row 9 +%define %%IN_ORIG10 %27 ; [in] Original input row 10 +%define %%IN_ORIG11 %28 ; [in] Original input row 11 +%define %%IN_ORIG12 %29 ; [in] Original input row 12 +%define %%IN_ORIG13 %30 ; [in] Original input row 13 +%define %%IN_ORIG14 %31 ; [in] Original input row 14 +%define %%IN_ORIG15 %32 ; [in] Original input row 15 +%define %%DST %33 ; [in] Array of destination pointers +%define %%OFF %34 ; [in] Offset into destination array +%define %%TMP %35 ; [clobbered] Temporary GP register +%define %%KMASK %36 ; [in] Mask register + + vpaddd %%IN00_KS01, %%IN_ORIG00_KS09 + vpaddd %%IN01_KS02, %%IN_ORIG01_KS10 + vpaddd %%IN02_KS15, %%IN_ORIG02 + vpaddd %%IN03_KS04, %%IN_ORIG03 + + ;; Deal with first lanes 0-7 + ; T0, T1 free + vpunpckldq %%IN_ORIG00_KS09, %%IN00_KS01, %%IN01_KS02 + vpunpckhdq %%IN00_KS01, %%IN00_KS01, %%IN01_KS02 + vpunpckldq %%IN_ORIG01_KS10, %%IN02_KS15, %%IN03_KS04 + vpunpckhdq %%IN02_KS15, %%IN02_KS15, %%IN03_KS04 + + ; IN01_KS02, IN03_KS04 free + vpunpcklqdq %%IN03_KS04, %%IN_ORIG00_KS09, %%IN_ORIG01_KS10 + vpunpckhqdq %%IN01_KS02, %%IN_ORIG00_KS09, %%IN_ORIG01_KS10 + vpunpcklqdq %%IN_ORIG00_KS09, %%IN00_KS01, %%IN02_KS15 + vpunpckhqdq %%IN00_KS01, %%IN00_KS01, %%IN02_KS15 + + vpaddd %%IN04_KS08, %%IN_ORIG04 + vpaddd %%IN05, %%IN_ORIG05 + vpaddd %%IN06_KS13, %%IN_ORIG06 + vpaddd %%IN07_KS07, %%IN_ORIG07 + + ; IN02_KS15, T1 free + vpunpckldq %%IN_ORIG01_KS10, %%IN04_KS08, %%IN05 + vpunpckhdq %%IN04_KS08, %%IN04_KS08, %%IN05 + vpunpckldq %%IN02_KS15, %%IN06_KS13, %%IN07_KS07 + vpunpckhdq %%IN06_KS13, %%IN06_KS13, %%IN07_KS07 + + ; IN07_KS07, IN05 free + vpunpcklqdq %%IN07_KS07, %%IN_ORIG01_KS10, %%IN02_KS15 + vpunpckhqdq %%IN05, %%IN_ORIG01_KS10, %%IN02_KS15 + vpunpcklqdq %%IN02_KS15, %%IN04_KS08, %%IN06_KS13 + vpunpckhqdq %%IN04_KS08, %%IN04_KS08, %%IN06_KS13 + + ; T1, IN06_KS13 free + vshufi64x2 %%IN_ORIG01_KS10, %%IN03_KS04, %%IN07_KS07, 0x44 + vshufi64x2 %%IN03_KS04, %%IN03_KS04, %%IN07_KS07, 0xee + vshufi64x2 %%IN06_KS13, %%IN01_KS02, %%IN05, 0x44 + vshufi64x2 %%IN01_KS02, %%IN01_KS02, %%IN05, 0xee + vshufi64x2 %%IN07_KS07, %%IN_ORIG00_KS09, %%IN02_KS15, 0x44 + vshufi64x2 %%IN02_KS15, %%IN_ORIG00_KS09, %%IN02_KS15, 0xee + vshufi64x2 %%IN05, %%IN00_KS01, %%IN04_KS08, 0x44 + vshufi64x2 %%IN00_KS01, %%IN00_KS01, %%IN04_KS08, 0xee + + ;; Deal with lanes 8-15 + vpaddd %%IN08_KS05, %%IN_ORIG08 + vpaddd %%IN09_KS00, %%IN_ORIG09 + vpaddd %%IN10_KS06, %%IN_ORIG10 + vpaddd %%IN11_KS11, %%IN_ORIG11 + + vpunpckldq %%IN_ORIG00_KS09, %%IN08_KS05, %%IN09_KS00 + vpunpckhdq %%IN08_KS05, %%IN08_KS05, %%IN09_KS00 + vpunpckldq %%IN04_KS08, %%IN10_KS06, %%IN11_KS11 + vpunpckhdq %%IN10_KS06, %%IN10_KS06, %%IN11_KS11 + + vpunpcklqdq %%IN09_KS00, %%IN_ORIG00_KS09, %%IN04_KS08 + vpunpckhqdq %%IN04_KS08, %%IN_ORIG00_KS09, %%IN04_KS08 + vpunpcklqdq %%IN11_KS11, %%IN08_KS05, %%IN10_KS06 + vpunpckhqdq %%IN08_KS05, %%IN08_KS05, %%IN10_KS06 + + vpaddd %%IN12_KS12, %%IN_ORIG12 + vpaddd %%IN13_KS03, %%IN_ORIG13 + vpaddd %%IN14_KS14, %%IN_ORIG14 + vpaddd %%IN15, %%IN_ORIG15 + + vpunpckldq %%IN_ORIG00_KS09, %%IN12_KS12, %%IN13_KS03 + vpunpckhdq %%IN12_KS12, %%IN12_KS12, %%IN13_KS03 + vpunpckldq %%IN10_KS06, %%IN14_KS14, %%IN15 + vpunpckhdq %%IN14_KS14, %%IN14_KS14, %%IN15 + + vpunpcklqdq %%IN13_KS03, %%IN_ORIG00_KS09, %%IN10_KS06 + vpunpckhqdq %%IN10_KS06, %%IN_ORIG00_KS09, %%IN10_KS06 + vpunpcklqdq %%IN15, %%IN12_KS12, %%IN14_KS14 + vpunpckhqdq %%IN12_KS12, %%IN12_KS12, %%IN14_KS14 + + vshufi64x2 %%IN14_KS14, %%IN09_KS00, %%IN13_KS03, 0x44 + vshufi64x2 %%IN09_KS00, %%IN09_KS00, %%IN13_KS03, 0xee + vshufi64x2 %%IN_ORIG00_KS09, %%IN04_KS08, %%IN10_KS06, 0x44 + vshufi64x2 %%IN10_KS06, %%IN04_KS08, %%IN10_KS06, 0xee + vshufi64x2 %%IN13_KS03, %%IN11_KS11, %%IN15, 0x44 + vshufi64x2 %%IN11_KS11, %%IN11_KS11, %%IN15, 0xee + vshufi64x2 %%IN15, %%IN08_KS05, %%IN12_KS12, 0x44 + vshufi64x2 %%IN08_KS05, %%IN08_KS05, %%IN12_KS12, 0xee + + mov %%TMP, [%%DST + %%OFF+ 8*12] + vshufi64x2 %%IN12_KS12, %%IN03_KS04, %%IN09_KS00, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN12_KS12 + + mov %%TMP, [%%DST + %%OFF + 8*8] + vshufi64x2 %%IN04_KS08, %%IN03_KS04, %%IN09_KS00, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN04_KS08 + + mov %%TMP, [%%DST + %%OFF] + vshufi64x2 %%IN09_KS00, %%IN_ORIG01_KS10, %%IN14_KS14, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN09_KS00 + + mov %%TMP, [%%DST + %%OFF + 8*4] + vshufi64x2 %%IN03_KS04, %%IN_ORIG01_KS10, %%IN14_KS14, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN03_KS04 + + mov %%TMP, [%%DST + %%OFF + 8*14] + vshufi64x2 %%IN14_KS14, %%IN02_KS15, %%IN11_KS11, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN14_KS14 + + mov %%TMP, [%%DST + %%OFF + 8*10] + vshufi64x2 %%IN_ORIG01_KS10, %%IN02_KS15, %%IN11_KS11, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN_ORIG01_KS10 + + mov %%TMP, [%%DST + %%OFF + 8*11] + vshufi64x2 %%IN11_KS11, %%IN00_KS01, %%IN08_KS05, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN11_KS11 + + mov %%TMP, [%%DST + %%OFF + 8*15] + vshufi64x2 %%IN02_KS15, %%IN00_KS01, %%IN08_KS05, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN02_KS15 + + mov %%TMP, [%%DST + %%OFF + 8] + vshufi64x2 %%IN00_KS01, %%IN06_KS13, %%IN_ORIG00_KS09, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN00_KS01 + + mov %%TMP, [%%DST + %%OFF + 8*5] + vshufi64x2 %%IN08_KS05, %%IN06_KS13, %%IN_ORIG00_KS09, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN08_KS05 + + mov %%TMP, [%%DST + %%OFF + 8*9] + vshufi64x2 %%IN_ORIG00_KS09, %%IN01_KS02, %%IN10_KS06, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN_ORIG00_KS09 + + mov %%TMP, [%%DST + %%OFF + 8*13] + vshufi64x2 %%IN06_KS13, %%IN01_KS02, %%IN10_KS06, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN06_KS13 + + mov %%TMP, [%%DST + %%OFF + 8*2] + vshufi64x2 %%IN01_KS02, %%IN07_KS07, %%IN13_KS03, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN01_KS02 + + mov %%TMP, [%%DST + %%OFF + 8*6] + vshufi64x2 %%IN10_KS06, %%IN07_KS07, %%IN13_KS03, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN10_KS06 + + mov %%TMP, [%%DST + %%OFF + 8*3] + vshufi64x2 %%IN13_KS03, %%IN05, %%IN15, 0x88 + vmovdqu8 [%%TMP]{%%KMASK}, %%IN13_KS03 + + mov %%TMP, [%%DST + %%OFF + 8*7] + vshufi64x2 %%IN07_KS07, %%IN05, %%IN15, 0xdd + vmovdqu8 [%%TMP]{%%KMASK}, %%IN07_KS07 +%endmacro + ;; ;; Performs a quarter round on all 4 columns, ;; resulting in a full round @@ -644,7 +844,7 @@ mksection .text ;; ;; Generates 64*16 bytes of keystream and encrypt up to 1KB of input data ;; -%macro ENCRYPT_1K 36 +%macro ENCRYPT_1K 36-38 %define %%ZMM_DWORD0 %1 ;; [clobbered] ZMM to contain dword 0 of all states %define %%ZMM_DWORD1 %2 ;; [clobbered] ZMM to contain dword 1 of all states %define %%ZMM_DWORD2 %3 ;; [clobbered] ZMM to contain dword 2 of all states @@ -680,7 +880,9 @@ mksection .text %define %%SRC %33 ;; [in] Source pointer %define %%DST %34 ;; [in] Destination pointer %define %%OFF %35 ;; [in] Offset into src/dst pointers -%define %%GEN_KEY %36 ;; [in] Generate poly key +%define %%TYPE %36 ;; [in] "gen_poly_key", "QUIC", "none" +%define %%TMP %37 ;; [clobbered] Temporary GP register +%define %%KMASK %38 ;; [in] Mask register %assign i 0 %rep 16 @@ -707,6 +909,18 @@ mksection .text %%ZMM_DWORD15, %%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14 %endrep +%ifidn %%TYPE, QUIC + GENERATE_1K_KS_AND_ENCRYPT_QUIC %%ZMM_DWORD0, %%ZMM_DWORD1, %%ZMM_DWORD2, %%ZMM_DWORD3, \ + %%ZMM_DWORD4, %%ZMM_DWORD5, %%ZMM_DWORD6, %%ZMM_DWORD7, \ + %%ZMM_DWORD8, %%ZMM_DWORD9, %%ZMM_DWORD10, %%ZMM_DWORD11, \ + %%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14, %%ZMM_DWORD15, \ + %%ZMM_DWORD_ORIG0, %%ZMM_DWORD_ORIG1, %%ZMM_DWORD_ORIG2, \ + %%ZMM_DWORD_ORIG3,%%ZMM_DWORD_ORIG4, %%ZMM_DWORD_ORIG5, \ + %%ZMM_DWORD_ORIG6, %%ZMM_DWORD_ORIG7, %%ZMM_DWORD_ORIG8, \ + %%ZMM_DWORD_ORIG9, %%ZMM_DWORD_ORIG10, %%ZMM_DWORD_ORIG11, \ + %%ZMM_DWORD_ORIG12, %%ZMM_DWORD_ORIG13, %%ZMM_DWORD_ORIG14, \ + %%ZMM_DWORD_ORIG15, %%DST, %%OFF, %%TMP, %%KMASK +%else ;; ;; Add original states to processed states, transpose ;; these states to form the 64*16 bytes of keystream, ;; XOR with plaintext and write ciphertext out @@ -719,14 +933,15 @@ mksection .text %%ZMM_DWORD_ORIG6, %%ZMM_DWORD_ORIG7, %%ZMM_DWORD_ORIG8, \ %%ZMM_DWORD_ORIG9, %%ZMM_DWORD_ORIG10, %%ZMM_DWORD_ORIG11, \ %%ZMM_DWORD_ORIG12, %%ZMM_DWORD_ORIG13, %%ZMM_DWORD_ORIG14, \ - %%ZMM_DWORD_ORIG15, %%SRC, %%DST, %%OFF, %%GEN_KEY + %%ZMM_DWORD_ORIG15, %%SRC, %%DST, %%OFF, %%TYPE +%endif %endmacro ; ; Macro adding original state values to processed state values ; and transposing 16x16 u32 from first 16 ZMM registers, ; creating keystreams. -; Note that the registers are tranposed in a different +; Note that the registers are transposed in a different ; order, so first register (IN00) containing row 0 ; will not contain the first column of the matrix, but ; row 1 and same with other registers. @@ -1032,6 +1247,38 @@ mksection .text %endmacro +; Macro outputting 5 bytes of KS for every buffers +%macro OUTPUT_KS_1_16_BUFFERS_QUIC 21 +%define %%KS0 %1 ; [in/clobbered] Bytes 0-63 of keystream +%define %%KS1 %2 ; [in/clobbered] Bytes 64-127 of keystream +%define %%KS2 %3 ; [in/clobbered] Bytes 128-191 of keystream +%define %%KS3 %4 ; [in/clobbered] Bytes 192-255 of keystream +%define %%KS4 %5 ; [in/clobbered] Bytes 256-319 of keystream +%define %%KS5 %6 ; [in/clobbered] Bytes 320-383 of keystream +%define %%KS6 %7 ; [in/clobbered] Bytes 384-447 of keystream +%define %%KS7 %8 ; [in/clobbered] Bytes 448-511 of keystream +%define %%KS8 %9 ; [in/clobbered] Bytes 512-575 of keystream +%define %%KS9 %10 ; [in/clobbered] Bytes 576-639 of keystream +%define %%KS10 %11 ; [in/clobbered] Bytes 640-703 of keystream +%define %%KS11 %12 ; [in/clobbered] Bytes 704-767 of keystream +%define %%KS12 %13 ; [in/clobbered] Bytes 768-831 of keystream +%define %%KS13 %14 ; [in/clobbered] Bytes 832-895 of keystream +%define %%KS14 %15 ; [in/clobbered] Bytes 896-959 of keystream +%define %%KS15 %16 ; [in/clobbered] Bytes 960-1023 of keystream +%define %%DST %17 ; [in] Pointer to array with destination pointers +%define %%OFF %18 ; [in] Offset into destinatation pointers +%define %%TMP %19 ; [clobbered] Temporary register +%define %%KMASK %20 ; [in] Mask register for final block +%define %%NUM_BUFFERS %21 ; [in] Number of blocks to encrypt + +%assign %%I 0 +%rep (%%NUM_BUFFERS) + mov %%TMP, [%%DST + %%OFF + %%I*8] + vmovdqu8 [%%TMP]{%%KMASK}, APPEND(%%KS, %%I) +%assign %%I (%%I + 1) +%endrep +%endmacro + %macro PREPARE_NEXT_STATES_4_TO_8 13 %define %%STATE_IN_A_L %1 ;; [out] ZMM containing state "A" part for states 1-4 %define %%STATE_IN_B_L %2 ;; [out] ZMM containing state "B" part for states 1-4 @@ -1094,6 +1341,50 @@ mksection .text %endif ; %%GEN == gen_poly_key %endmacro +%macro PREPARE_NEXT_STATES_1_TO_8_QUIC 9 +%define %%STATE_IN_A_L %1 ;; [out] ZMM containing state "A" part for states 1-4 +%define %%STATE_IN_B_L %2 ;; [out] ZMM containing state "B" part for states 1-4 +%define %%STATE_IN_C_L %3 ;; [out] ZMM containing state "C" part for states 1-4 +%define %%STATE_IN_D_L %4 ;; [out] ZMM containing state "D" part for states 1-4 +%define %%STATE_IN_D_H %5 ;; [out] ZMM containing state "D" part for states 5-8 (or "none" in NUM_BLOCKS <= 4) +%define %%KEY %6 ;; [in] Pointer to key +%define %%SRC %7 ;; [in] Pointer to source buffers +%define %%OFF %8 ;; [in] Offset into source array +%define %%NUM_BLOCKS %9 ;; [in] Number of state blocks to prepare (numerical) + + ;; Prepare next 1-8 states + vbroadcastf64x2 %%STATE_IN_B_L, [%%KEY] ; Load key bytes 0-15 + vbroadcastf64x2 %%STATE_IN_C_L, [%%KEY + 16] ; Load key bytes 16-31 + vbroadcastf64x2 %%STATE_IN_A_L, [rel constants] + +%if %%NUM_BLOCKS <= 4 +%assign %%I 0 +%rep %%NUM_BLOCKS + mov rax, [%%SRC + %%OFF + 8*%%I] + vinserti32x4 %%STATE_IN_D_L, [rax], %%I +%assign %%I (%%I + 1) +%endrep + +%else ; %%NUM_BLOCKS > 4 + +%assign %%I 0 +%rep 4 + mov rax, [%%SRC + %%OFF + 8*%%I] + vinserti32x4 %%STATE_IN_D_L, [rax], %%I +%assign %%I (%%I + 1) +%endrep + +%assign %%I 0 +%rep (%%NUM_BLOCKS - 4) + mov rax, [%%SRC + %%OFF + 8*(%%I + 4)] + ;; Prepare chacha states 4-7 (A-C same as states 0-3) + vinserti32x4 %%STATE_IN_D_H, [rax], %%I +%assign %%I (%%I + 1) +%endrep +%endif + +%endmacro + align 32 MKGLOBAL(submit_job_chacha20_enc_dec_avx512,function,internal) submit_job_chacha20_enc_dec_avx512: @@ -2362,4 +2653,239 @@ no_partial_block_ks: exit_ks: ret +;; +;; quic_chacha20_avx512(void *key, const uint8_t *src_ptr_array, +;; void *dst_ptr_array, const uint64_t num_buffers); +align 32 +MKGLOBAL(quic_chacha20_avx512,function,internal) +quic_chacha20_avx512: + endbranch64 + +%define tmp rax +%define src r10 +%define off r11 + +%define key arg1 +%define src_array arg2 +%define dst_array arg3 +%define num_buffers arg4 + +%ifndef LINUX + mov rax, rsp + sub rsp, STACK_SIZE + and rsp, -16 +%assign i 0 +%assign j 6 +%rep 10 + vmovdqa [rsp + _XMM_WIN_SAVE + i*16], APPEND(xmm, j) +%assign i (i + 1) +%assign j (j + 1) +%endrep + mov [rsp + _RSP_SAVE], rax ; save RSP +%endif + + xor off, off + ; Set up k-mask to write out 5 bytes for all buffers + mov tmp, 0x1f + kmovq k1, tmp + + cmp num_buffers, 8 + jbe exit_loop_quic + + ; Prepare first 16 chacha20 states from IV, key, constants and counter values + vpbroadcastd zmm0, [rel constants] + vpbroadcastd zmm1, [rel constants + 4] + vpbroadcastd zmm2, [rel constants + 8] + vpbroadcastd zmm3, [rel constants + 12] + + vpbroadcastd zmm4, [key] + vpbroadcastd zmm5, [key + 4] + vpbroadcastd zmm6, [key + 8] + vpbroadcastd zmm7, [key + 12] + vpbroadcastd zmm8, [key + 16] + vpbroadcastd zmm9, [key + 20] + vpbroadcastd zmm10, [key + 24] + vpbroadcastd zmm11, [key + 28] + + cmp num_buffers, 16 + jb exit_loop_quic + +align 32 +start_loop_quic: + + ; Load counter + nonce values from the 16 samples (src) +%assign i 0 +%rep 4 + mov src, [src_array + off + i*32] + vmovd xmm16, [src] + vmovd xmm17, [src + 4] + vmovd xmm18, [src + 4*2] + vmovd xmm19, [src + 4*3] + mov src, [src_array + off + i*32 + 8] + vpinsrd xmm16, [src], 1 + vpinsrd xmm17, [src + 4], 1 + vpinsrd xmm18, [src + 4*2], 1 + vpinsrd xmm19, [src + 4*3], 1 + mov src, [src_array + off + i*32 + 8*2] + vpinsrd xmm16, [src], 2 + vpinsrd xmm17, [src + 4], 2 + vpinsrd xmm18, [src + 4*2], 2 + vpinsrd xmm19, [src + 4*3], 2 + mov src, [src_array + off + i*32 + 8*3] + vpinsrd xmm16, [src], 3 + vpinsrd xmm17, [src + 4], 3 + vpinsrd xmm18, [src + 4*2], 3 + vpinsrd xmm19, [src + 4*3], 3 + +%if i == 0 + vmovdqa64 xmm12, xmm16 + vmovdqa64 xmm13, xmm17 + vmovdqa64 xmm14, xmm18 + vmovdqa64 xmm15, xmm19 +%else + vinserti32x4 zmm12, xmm16, i + vinserti32x4 zmm13, xmm17, i + vinserti32x4 zmm14, xmm18, i + vinserti32x4 zmm15, xmm19, i +%endif +%assign i (i + 1) +%endrep + + ENCRYPT_1K zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \ + zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \ + zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \ + zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15, none , \ + dst_array, off, QUIC, tmp, k1 + + ; Update remaining length + sub num_buffers, 16 + add off, 16*8 + + ; Reload first two registers zmm0 and 1, + ; as they have been overwritten by the previous macros + vpbroadcastd zmm0, [rel constants] + vpbroadcastd zmm1, [rel constants + 4] + + cmp num_buffers, 16 + jae start_loop_quic + +exit_loop_quic: + + ; Check if there are no buffers left + or num_buffers, num_buffers + jz end_quic + + cmp num_buffers, 8 + je final_num_buffers_is_8 + jb final_num_buffers_is_1_7 + + ; Final buffers 9-15 + cmp num_buffers, 12 + je final_num_buffers_is_12 + jb final_num_buffers_is_9_11 + + ; Final buffers 13-15 + cmp num_buffers, 14 + je final_num_buffers_is_14 + jb final_num_buffers_is_13 + jmp final_num_buffers_is_15 + +final_num_buffers_is_9_11: + cmp num_buffers, 10 + je final_num_buffers_is_10 + jb final_num_buffers_is_9 + ja final_num_buffers_is_11 + +final_num_buffers_is_1_7: + ; Final buffers 1-7 + cmp num_buffers, 4 + je final_num_buffers_is_4 + jb final_num_buffers_is_1_3 + + ; Final buffers 5-7 + cmp num_buffers, 6 + je final_num_buffers_is_6 + jb final_num_buffers_is_5 + ja final_num_buffers_is_7 + +final_num_buffers_is_1_3: + cmp num_buffers, 2 + je final_num_buffers_is_2 + ja final_num_buffers_is_3 + + ; 1 final buffer if no jump +%assign BUFFERS_LEFT 1 +%rep 15 +APPEND(final_num_buffers_is_, BUFFERS_LEFT): + +%if (BUFFERS_LEFT <= 8) + PREPARE_NEXT_STATES_1_TO_8_QUIC zmm0, zmm1, zmm2, zmm3, zmm4, key, src_array, off, BUFFERS_LEFT +%if (BUFFERS_LEFT <= 4) + GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, none, none, none, none, \ + zmm0, zmm1, zmm2, zmm3, none, \ + zmm8, zmm9, zmm10, zmm11, 4 +%else + GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \ + zmm0, zmm1, zmm2, zmm3, zmm4, \ + zmm8, zmm9, zmm10, zmm11, 8 +%endif + +%else ; BUFFERS_LEFT > 8 +%assign i 0 +%rep 4 +%assign j 0 +%rep 4 +%if ((i*4 + j) < BUFFERS_LEFT) + mov src, [src_array + off + i*32 + 8*j] + vpinsrd xmm16, [src], j + vpinsrd xmm17, [src + 4], j + vpinsrd xmm18, [src + 4*2], j + vpinsrd xmm19, [src + 4*3], j +%endif +%assign j (j + 1) +%endrep + +%if ((i*4) < BUFFERS_LEFT) + vinserti32x4 zmm12, xmm16, i + vinserti32x4 zmm13, xmm17, i + vinserti32x4 zmm14, xmm18, i + vinserti32x4 zmm15, xmm19, i +%endif +%assign i (i + 1) +%endrep + ; Generate another 64*16 bytes of keystream and XOR only the leftover plaintext + GENERATE_1K_KS zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \ + zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \ + zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \ + zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15 +%endif ; BUFFERS_LEFT <= 8 + + OUTPUT_KS_1_16_BUFFERS_QUIC zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \ + zmm20, zmm21, zmm31, zmm27, zmm28, zmm22, zmm30, zmm18, \ + dst_array, off, tmp, k1, BUFFERS_LEFT + jmp end_quic + +%assign BUFFERS_LEFT (BUFFERS_LEFT + 1) +%endrep + +end_quic: + +%ifdef SAFE_DATA + clear_all_zmms_asm +%else + vzeroupper +%endif + +%ifndef LINUX +%assign i 0 +%assign j 6 +%rep 10 + vmovdqa APPEND(xmm, j), [rsp + _XMM_WIN_SAVE + i*16] +%assign i (i + 1) +%assign j (j + 1) +%endrep + mov rsp, [rsp + _RSP_SAVE] +%endif + ret + mksection stack-noexec diff --git a/lib/include/chacha20_poly1305.h b/lib/include/chacha20_poly1305.h index e1b3c1ff..7d0b83a5 100644 --- a/lib/include/chacha20_poly1305.h +++ b/lib/include/chacha20_poly1305.h @@ -186,4 +186,8 @@ void finalize_chacha20_poly1305_avx512( void finalize_chacha20_poly1305_fma_avx512( struct chacha20_poly1305_context_data *ctx, void *tag, const uint64_t tag_len); + +void quic_chacha20_avx512(const void *key, const void * const src_ptr_array[], + void *dst_ptr_array[], const uint64_t num_buffers); + #endif /* IMB_CHACHA20POLY1305_H */ diff --git a/lib/x86_64/quic_hp_chacha20.c b/lib/x86_64/quic_hp_chacha20.c index e7c9785c..97f0e02d 100644 --- a/lib/x86_64/quic_hp_chacha20.c +++ b/lib/x86_64/quic_hp_chacha20.c @@ -68,19 +68,7 @@ imb_quic_hp_chacha20(IMB_MGR *state, #endif /* SAFE_PARAM */ - IMB_JOB job; - uint8_t src[5] = {0, 0, 0, 0, 0}; - - job.msg_len_to_cipher_in_bytes = 5; - job.cipher_start_src_offset_in_bytes = 0; - job.src = src; - job.enc_keys = key; - - for (i = 0; i < num_packets; i++) { - job.iv = src_ptr_array[i]; - job.dst = dst_ptr_array[i]; - submit_job_chacha20_enc_dec_avx512(&job); - } + quic_chacha20_avx512(key, src_ptr_array, dst_ptr_array, num_packets); imb_set_errno(state, 0); } -- GitLab From 75986d67269be6bb047cb4326e4c2279946cd2d1 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 22 Jun 2023 16:31:30 +0100 Subject: [PATCH 038/204] perf: [QUIC] add CHACHA20 HP test --- perf/ipsec_perf.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 041de77b..f4eba77a 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -1696,6 +1696,10 @@ do_test_quic_aes_ecb_hp(struct params_s *params, const uint32_t num_iter, IMB_MG uint64_t n; int i; +#ifndef _WIN32 + (void) params; /* unused for Windows */ +#endif + if (burst_size != 0 && burst_size < MAX_K) K = burst_size; @@ -1737,6 +1741,60 @@ do_test_quic_aes_ecb_hp(struct params_s *params, const uint32_t num_iter, IMB_MG } #endif /* __aarch64__ */ +static uint64_t +do_test_quic_chacha20_hp(struct params_s *params, const uint32_t num_iter, IMB_MGR *p_mgr, + uint8_t *blob) +{ + void *out[MAX_K]; + const void *in[MAX_K]; + const uint8_t kp[32]; + int K = MAX_K; + uint64_t time = 0; + const uint64_t pkt_size = 16; /* Fixed packet size for this API */ + uint32_t aux; + uint64_t n; + int i; + +#ifndef _WIN32 + (void) params; /* unused for Windows */ +#endif + + for (n = 0, i = 0; i < K; i++) { + in[i] = &blob[n]; + n += pkt_size; + + out[i] = &blob[n]; + n += pkt_size; + } + + if (burst_size != 0 && burst_size < MAX_K) + K = burst_size; + + const uint32_t full_num_iter = num_iter / K; + const uint32_t last_iter = num_iter % K; + +#ifndef _WIN32 + if (use_unhalted_cycles) + time = read_cycles(params->core); + else +#endif + time = __rdtscp(&aux); + + for (n = 0; n < full_num_iter; n++) + imb_quic_hp_chacha20(p_mgr, kp, (void **) out, (const void *const *) in, K); + + if (last_iter != 0) + imb_quic_hp_chacha20(p_mgr, kp, (void **) out, (const void *const *) in, last_iter); +#ifndef _WIN32 + if (use_unhalted_cycles) + time = (read_cycles(params->core) - rd_cycles_cost) - time; + else +#endif + time = __rdtscp(&aux) - time; + + return time / num_iter; +} + /* Performs test using AES_HMAC or DOCSIS */ static uint64_t do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8_t *p_buffer, @@ -2837,6 +2895,8 @@ process_variant(IMB_MGR *mgr, const enum arch_type_e arch, struct params_s *para *times = do_test_quic_aes_gcm(params, num_iter, mgr, quic_blob); else if (params->cipher_mode == TEST_ECB) *times = do_test_quic_aes_ecb_hp(params, num_iter, mgr, quic_blob); + else if (params->cipher_mode == TEST_CHACHA20) + *times = do_test_quic_chacha20_hp(params, num_iter, mgr, quic_blob); else { fprintf(stderr, "Algorithm not supported with QUIC API\n"); exit(EXIT_FAILURE); -- GitLab From 4f1b99dcba0a45724ddc1c1577e62c2fc5901269 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 26 Jun 2023 11:07:22 +0100 Subject: [PATCH 039/204] test: [QUIC] add CHACHA20 HP test --- ReleaseNotes.txt | 2 +- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 2 +- test/kat-app/main.c | 8 +- test/kat-app/quic_chacha20_test.c | 194 ++++++++++++++++++++++++++++++ test/kat-app/win_x64.mak | 2 +- 6 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 test/kat-app/quic_chacha20_test.c diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index abde1628..dcbd5e2e 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -8,7 +8,7 @@ Library - QUIC CHACHA20-POLY1305 and CHACHA20 HP API added. Test Applications -- QUIC CHACHA20-POLY1305 tests added. +- QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. Performance Applications - New parameter added to benchmark QUIC `--quic-api`. diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 40980439..79dd1c8f 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -83,6 +83,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/snow_v_test.c ${CMAKE_CURRENT_SOURCE_DIR}/direct_api_param_test.c ${CMAKE_CURRENT_SOURCE_DIR}/quic_ecb_test.c + ${CMAKE_CURRENT_SOURCE_DIR}/quic_chacha20_test.c ${CMAKE_CURRENT_SOURCE_DIR}/gmac_test.c ${CMAKE_CURRENT_SOURCE_DIR}/ghash_test.c ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.c diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 09965605..4a4c3377 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -42,7 +42,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ - des_test.json.c chacha_test.json.c gcm_test.json.c + des_test.json.c chacha_test.json.c gcm_test.json.c quic_chacha20_test.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 81a79e0b..0bd21d17 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -63,6 +63,7 @@ extern int null_test(struct IMB_MGR *mb_mgr); extern int snow_v_test(struct IMB_MGR *mb_mgr); extern int direct_api_param_test(struct IMB_MGR *mb_mgr); extern int quic_ecb_test(struct IMB_MGR *mb_mgr); +extern int quic_chacha20_test(struct IMB_MGR *mb_mgr); extern int gmac_test(struct IMB_MGR *mb_mgr); extern int ghash_test(struct IMB_MGR *mb_mgr); extern int cbc_test(struct IMB_MGR *mb_mg); @@ -278,9 +279,14 @@ struct imb_test tests[] = { }, #ifndef __aarch64__ { - .str = "QUIC", + .str = "QUIC-ECB", .fn = quic_ecb_test, .enabled = 1 + }, + { + .str = "QUIC-CHACHA20", + .fn = quic_chacha20_test, + .enabled = 1 } #endif /* __aarch64__ */ }; diff --git a/test/kat-app/quic_chacha20_test.c b/test/kat-app/quic_chacha20_test.c new file mode 100644 index 00000000..565592e1 --- /dev/null +++ b/test/kat-app/quic_chacha20_test.c @@ -0,0 +1,194 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include +#include +#include +#include +#include + +#include + +#include "utils.h" + +int quic_chacha20_test(struct IMB_MGR *mb_mgr); + +struct quic_chacha20_vector { + const uint8_t *K; /* key */ + const uint8_t *P; /* plain text (16 bytes) */ + const uint8_t *C; /* cipher text - same length as plain text */ +}; + +/* From section A.5 of https://www.rfc-editor.org/rfc/rfc9001.pdf */ +static const uint8_t chacha20_256_K1[] = { + 0x25, 0xa2, 0x82, 0xb9, 0xe8, 0x2f, 0x06, 0xf2, + 0x1f, 0x48, 0x89, 0x17, 0xa4, 0xfc, 0x8f, 0x1b, + 0x73, 0x57, 0x36, 0x85, 0x60, 0x85, 0x97, 0xd0, + 0xef, 0xcb, 0x07, 0x6b, 0x0a, 0xb7, 0xa7, 0xa4 +}; +static const uint8_t chacha20_256_P1[] = { + 0x5e, 0x5c, 0xd5, 0x5c, 0x41, 0xf6, 0x90, 0x80, + 0x57, 0x5d, 0x79, 0x99, 0xc2, 0x5a, 0x5b, 0xfb +}; +static const uint8_t chacha20_256_C1[] = { + 0xae, 0xfe, 0xfe, 0x7d, 0x03 +}; + +static const struct quic_chacha20_vector quic_chacha20_vectors[] = { + {chacha20_256_K1, chacha20_256_P1, chacha20_256_C1}, +}; + +static int +test_quic_chacha20_many(struct IMB_MGR *mb_mgr, + const void *key, + const uint8_t *in_text, + const uint8_t *out_text, + const int in_place, + const int num_jobs) +{ + const unsigned text_len = 16; + const unsigned out_len = 5; + uint8_t **src_bufs = malloc(num_jobs * sizeof(void *)); + uint8_t **dst_bufs = malloc(num_jobs * sizeof(void *)); + int i, ret = -1; + + for (i = 0; i < num_jobs; i++) { + src_bufs[i] = malloc(text_len); + memcpy(src_bufs[i], in_text, text_len); + + dst_bufs[i] = malloc(out_len); + memset(dst_bufs[i], -1, out_len); + } + + if (in_place) { + imb_quic_hp_chacha20(mb_mgr, key, + (void **) src_bufs, + (const void * const*) src_bufs, + num_jobs); + } else { + imb_quic_hp_chacha20(mb_mgr, key, + (void **) dst_bufs, + (const void * const*) src_bufs, + num_jobs); + } + + const int err = imb_get_errno(mb_mgr); + + if (err != 0) { + printf("QUIC CHACHA20 error status:%d, %s\n", err, + imb_get_strerror(err)); + goto end; + } + + for (i = 0; i < num_jobs; i++) { + const uint8_t *d = (in_place) ? src_bufs[i] : dst_bufs[i]; + + if (memcmp(d, out_text, out_len) != 0) { + printf("QUIC CHACHA20 %d vector mismatched\n", i); + hexdump(stderr, "Expected", + out_text, out_len); + hexdump(stderr, "Received", + d, out_len); + goto end; + } + } + + ret = 0; + + end: + for (i = 0; i < num_jobs; i++) { + free(src_bufs[i]); + free(dst_bufs[i]); + } + free(src_bufs); + free(dst_bufs); + return ret; +} + +static void +test_quic_chacha20_vectors(struct IMB_MGR *mb_mgr, const int vec_cnt, + const struct quic_chacha20_vector *vec_tab, const char *banner, + const int num_jobs, + struct test_suite_context *ts256) +{ + int vect; + + if (!quiet_mode) + printf("%s (N jobs = %d):\n", banner, num_jobs); + for (vect = 0; vect < vec_cnt; vect++) { + if (!quiet_mode) { +#ifdef DEBUG + printf("[%d/%d] Standard vector\n", + vect + 1, vec_cnt); +#else + printf("."); +#endif + } + + if (test_quic_chacha20_many(mb_mgr, vec_tab[vect].K, + vec_tab[vect].P, vec_tab[vect].C, 0, + num_jobs)) { + printf("error #%d encrypt\n", vect + 1); + test_suite_update(ts256, 0, 1); + } else { + test_suite_update(ts256, 1, 0); + } + + if (test_quic_chacha20_many(mb_mgr, vec_tab[vect].K, + vec_tab[vect].P, vec_tab[vect].C, 1, + num_jobs)) { + printf("error #%d encrypt in-place\n", vect + 1); + test_suite_update(ts256, 0, 1); + } else { + test_suite_update(ts256, 1, 0); + } + } + + if (!quiet_mode) + printf("\n"); +} + +int +quic_chacha20_test(struct IMB_MGR *mb_mgr) +{ + struct test_suite_context ts256; + unsigned i; + int errors = 0; + + test_suite_start(&ts256, "QUIC-HP-CHACHA20-256"); + + for (i = 1; i <= 32; i++) + test_quic_chacha20_vectors(mb_mgr, DIM(quic_chacha20_vectors), + quic_chacha20_vectors, + "QUIC-HP-CHACHA20 test vectors", + i, + &ts256); + + errors = test_suite_end(&ts256); + + return errors; +} diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 74015d30..2a356074 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From a0a315129ff1b5c852ea8f5390143cbe652e33bd Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 29 Jun 2023 12:09:40 +0100 Subject: [PATCH 040/204] sse: [QUIC] implement ChaCha20 HP --- lib/avx2_t1/mb_mgr_avx2_t1.c | 1 + lib/avx2_t2/mb_mgr_avx2_t2.c | 1 + lib/avx2_t3/mb_mgr_avx2_t3.c | 1 + lib/avx512_t1/mb_mgr_avx512_t1.c | 1 + lib/avx512_t2/mb_mgr_avx512_t2.c | 1 + lib/avx_t1/mb_mgr_avx_t1.c | 1 + lib/avx_t2/mb_mgr_avx_t2.c | 1 + lib/include/chacha20_poly1305.h | 2 + lib/ipsec-mb.h | 4 + lib/no-aesni/mb_mgr_sse_no_aesni.c | 1 + lib/sse_t1/chacha20_sse.asm | 253 +++++++++++++++++++++++++++++ lib/sse_t1/mb_mgr_sse_t1.c | 1 + lib/sse_t2/mb_mgr_sse_t2.c | 1 + lib/sse_t3/mb_mgr_sse_t3.c | 1 + lib/x86_64/quic_hp_chacha20.c | 2 +- 15 files changed, 271 insertions(+), 1 deletion(-) diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index 90e51078..2587b44d 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -486,6 +486,7 @@ init_mb_mgr_avx2_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index a86c1d24..a915e38c 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -487,6 +487,7 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index e031e23f..dc439655 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -494,6 +494,7 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx512_t1/mb_mgr_avx512_t1.c b/lib/avx512_t1/mb_mgr_avx512_t1.c index f11bc0da..820b840f 100644 --- a/lib/avx512_t1/mb_mgr_avx512_t1.c +++ b/lib/avx512_t1/mb_mgr_avx512_t1.c @@ -599,6 +599,7 @@ init_mb_mgr_avx512_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; + state->chacha20_hp_quic = quic_chacha20_avx512; } #include "mb_mgr_code.h" diff --git a/lib/avx512_t2/mb_mgr_avx512_t2.c b/lib/avx512_t2/mb_mgr_avx512_t2.c index 2aef92e9..6dc86adf 100644 --- a/lib/avx512_t2/mb_mgr_avx512_t2.c +++ b/lib/avx512_t2/mb_mgr_avx512_t2.c @@ -614,6 +614,7 @@ init_mb_mgr_avx512_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_vaes_avx512; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_vaes_avx512; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; + state->chacha20_hp_quic = quic_chacha20_avx512; } #include "mb_mgr_code.h" diff --git a/lib/avx_t1/mb_mgr_avx_t1.c b/lib/avx_t1/mb_mgr_avx_t1.c index c9a7f075..c4862042 100644 --- a/lib/avx_t1/mb_mgr_avx_t1.c +++ b/lib/avx_t1/mb_mgr_avx_t1.c @@ -485,6 +485,7 @@ init_mb_mgr_avx_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx_t2/mb_mgr_avx_t2.c b/lib/avx_t2/mb_mgr_avx_t2.c index aa0b826e..d6037ee0 100644 --- a/lib/avx_t2/mb_mgr_avx_t2.c +++ b/lib/avx_t2/mb_mgr_avx_t2.c @@ -488,6 +488,7 @@ init_mb_mgr_avx_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/include/chacha20_poly1305.h b/lib/include/chacha20_poly1305.h index 7d0b83a5..93a06603 100644 --- a/lib/include/chacha20_poly1305.h +++ b/lib/include/chacha20_poly1305.h @@ -187,6 +187,8 @@ void finalize_chacha20_poly1305_fma_avx512( struct chacha20_poly1305_context_data *ctx, void *tag, const uint64_t tag_len); +void quic_chacha20_sse(const void *key, const void * const src_ptr_array[], + void *dst_ptr_array[], const uint64_t num_buffers); void quic_chacha20_avx512(const void *key, const void * const src_ptr_array[], void *dst_ptr_array[], const uint64_t num_buffers); diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index d8c4f244..d97f4e38 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -947,6 +947,9 @@ typedef void (*aes_ecb_quic_t)(const void *, const void *, typedef IMB_JOB * (*chacha20_poly1305_quic_t)(struct IMB_MGR *, IMB_JOB *); +typedef void (*chacha20_hp_quic_t)(const void *, const void * const *, + void **, const uint64_t); + /* Multi-buffer manager flags passed to alloc_mb_mgr() */ #define IMB_FLAG_SHANI_OFF (1ULL << 0) /**< disable use of SHANI extension */ @@ -1179,6 +1182,7 @@ typedef struct IMB_MGR { void (*set_suite_id)(struct IMB_MGR *, IMB_JOB *); chacha20_poly1305_quic_t chacha20_poly1305_quic; + chacha20_hp_quic_t chacha20_hp_quic; /* in-order scheduler fields */ int earliest_job; /**< byte offset, -1 if none */ diff --git a/lib/no-aesni/mb_mgr_sse_no_aesni.c b/lib/no-aesni/mb_mgr_sse_no_aesni.c index a55eee67..800cfcca 100644 --- a/lib/no-aesni/mb_mgr_sse_no_aesni.c +++ b/lib/no-aesni/mb_mgr_sse_no_aesni.c @@ -472,6 +472,7 @@ init_mb_mgr_sse_no_aesni_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse_no_aesni; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; + state->chacha20_hp_quic = quic_chacha20_sse; state->set_suite_id = SET_SUITE_ID_FN; } diff --git a/lib/sse_t1/chacha20_sse.asm b/lib/sse_t1/chacha20_sse.asm index 4458a8f8..1688c281 100644 --- a/lib/sse_t1/chacha20_sse.asm +++ b/lib/sse_t1/chacha20_sse.asm @@ -2920,4 +2920,257 @@ exit_gen: %endif jmp restore_gen_keystr +align 32 +MKGLOBAL(quic_chacha20_sse,function,internal) +quic_chacha20_sse: + +%define tmp rax +%define off r11 + +%define key arg1 +%define src_array arg2 +%define dst_array arg3 +%define num_buffers arg4 + + xor off, off + + ; Check if there are no buffers + or num_buffers, num_buffers + jz exit_quic + + mov rax, rsp + sub rsp, STACK_SIZE + and rsp, -16 + mov [rsp + _RSP_SAVE], rax ; save RSP + +%ifndef LINUX +%assign i 0 +%assign j 6 +%rep 10 + movdqa [rsp + _XMM_WIN_SAVE + i*16], APPEND(xmm, j) +%assign i (i + 1) +%assign j (j + 1) +%endrep +%endif + + ; If less than or equal to 2 buffers, prepare directly states for + ; up to 2 blocks + cmp num_buffers, 2 + je two_buffers_left + jb one_buffer_left + + ; Prepare first 4 chacha states + movdqa xmm0, [rel constants0] + movdqa xmm1, [rel constants1] + movdqa xmm2, [rel constants2] + movdqa xmm3, [rel constants3] + + ; Broadcast 8 dwords from key into XMM4-11 + movdqu xmm12, [key] + movdqu xmm15, [key + 16] + pshufd xmm4, xmm12, 0x0 + pshufd xmm5, xmm12, 0x55 + pshufd xmm6, xmm12, 0xAA + pshufd xmm7, xmm12, 0xFF + pshufd xmm8, xmm15, 0x0 + pshufd xmm9, xmm15, 0x55 + pshufd xmm10, xmm15, 0xAA + pshufd xmm11, xmm15, 0xFF + +%assign i 0 +%rep 12 + movdqa [rsp + _STATE + 16*i], xmm %+ i +%assign i (i + 1) +%endrep + + cmp num_buffers, 4 + jb three_buffers_left + +align 32 +start_loop_quic: + + ; Load 16-byte samples from 4 buffers + mov tmp, [src_array + off] + movd xmm12, [tmp] + movd xmm13, [tmp + 4] + movd xmm14, [tmp + 4*2] + movd xmm15, [tmp + 4*3] + mov tmp, [src_array + off + 8] + pinsrd xmm12, [tmp], 1 + pinsrd xmm13, [tmp + 4], 1 + pinsrd xmm14, [tmp + 4*2], 1 + pinsrd xmm15, [tmp + 4*3], 1 + mov tmp, [src_array + off + 8*2] + pinsrd xmm12, [tmp], 2 + pinsrd xmm13, [tmp + 4], 2 + pinsrd xmm14, [tmp + 4*2], 2 + pinsrd xmm15, [tmp + 4*3], 2 + mov tmp, [src_array + off + 8*3] + pinsrd xmm12, [tmp], 3 + pinsrd xmm13, [tmp + 4], 3 + pinsrd xmm14, [tmp + 4*2], 3 + pinsrd xmm15, [tmp + 4*3], 3 + + movdqa [rsp + _STATE + 16*12], xmm12 + movdqa [rsp + _STATE + 16*13], xmm13 + movdqa [rsp + _STATE + 16*14], xmm14 + movdqa [rsp + _STATE + 16*15], xmm15 + + ; Generate 256 bytes of keystream + GENERATE_256_KS xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, \ + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, tmp + + ;; Transpose state to get keystream and write 5-byte output per buffer + + ; Transpose to get 0-15, 64-95, 128-143, 192-207 bytes of KS + ; Output: xmm14, xmm1, xmm0, xmm3 + TRANSPOSE4_U32 xmm0, xmm1, xmm2, xmm3, xmm14, xmm15 + + mov tmp, [dst_array + off] + movd [tmp], xmm14 + pextrb [tmp + 4], xmm14, 4 + mov tmp, [dst_array + off + 8] + movd [tmp], xmm1 + pextrb [tmp + 4], xmm1, 4 + + mov tmp, [dst_array + off + 8*2] + movd [tmp], xmm0 + pextrb [tmp + 4], xmm0, 4 + mov tmp, [dst_array + off + 8*3] + movd [tmp], xmm3 + pextrb [tmp + 4], xmm3, 4 + + sub num_buffers, 4 + add off, 8*4 + + cmp num_buffers, 4 + jae start_loop_quic + +exit_loop_quic: + + ; Check if there are no more buffers + or num_buffers, num_buffers + jz no_more_buffers + + cmp num_buffers, 2 + ja three_buffers_left + je two_buffers_left + + ; fall-through for one buffer + +one_buffer_left: + ; Prepare next chacha state + movdqu xmm1, [key] ; Load key bytes 0-15 + movdqu xmm2, [key + 16] ; Load key bytes 16-31 + movdqa xmm0, [rel constants] + mov tmp, [src_array + off] + movdqu xmm3, [tmp] + + ; Generate 64 bytes of keystream + GENERATE_64_128_KS xmm0, xmm1, xmm2, xmm3, xmm9, xmm10, xmm11, \ + xmm12, xmm13 + + ; Write 5-byte output for single buffer + mov tmp, [dst_array + off] + movd [tmp], xmm9 + pextrb [tmp + 4], xmm9, 4 + + jmp no_more_buffers + +two_buffers_left: + ; Prepare next 2 chacha states from IV, key + movdqu xmm1, [key] ; Load key bytes 0-15 + movdqu xmm2, [key + 16] ; Load key bytes 16-31 + mov tmp, [src_array + off] + movdqu xmm3, [tmp] + movdqa xmm0, [rel constants] + + mov tmp, [src_array + off + 8] + movdqu xmm8, [tmp] + + ; Generate 128 bytes of keystream + GENERATE_64_128_KS xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, \ + xmm13, xmm8, xmm9, xmm10, xmm11, xmm12 + + ; Write 5-byte output for two buffers + mov tmp, [dst_array + off] + movd [tmp], xmm4 + pextrb [tmp + 4], xmm4, 4 + mov tmp, [dst_array + off + 8] + movd [tmp], xmm9 + pextrb [tmp + 4], xmm9, 4 + + jmp no_more_buffers + +three_buffers_left: + + mov tmp, [src_array + off] + movd xmm12, [tmp] + movd xmm13, [tmp + 4] + movd xmm14, [tmp + 4*2] + movd xmm15, [tmp + 4*3] + mov tmp, [src_array + off + 8] + pinsrd xmm12, [tmp], 1 + pinsrd xmm13, [tmp + 4], 1 + pinsrd xmm14, [tmp + 4*2], 1 + pinsrd xmm15, [tmp + 4*3], 1 + mov tmp, [src_array + off + 8*2] + pinsrd xmm12, [tmp], 2 + pinsrd xmm13, [tmp + 4], 2 + pinsrd xmm14, [tmp + 4*2], 2 + pinsrd xmm15, [tmp + 4*3], 2 + +%assign i 12 +%rep 4 + movdqa [rsp + _STATE + 16*i], xmm %+ i +%assign i (i + 1) +%endrep + + ; Generate 256 bytes of keystream + GENERATE_256_KS xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, \ + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, tmp + + ; Transpose to get 0-15, 64-95, 128-143, 192-207 bytes of KS + ; Output: xmm14, xmm1, xmm0, xmm3 + TRANSPOSE4_U32 xmm0, xmm1, xmm2, xmm3, xmm14, xmm15 + + ; Write 5-byte output for three buffers + mov tmp, [dst_array + off] + movd [tmp], xmm14 + pextrb [tmp + 4], xmm14, 4 + mov tmp, [dst_array + off + 8] + movd [tmp], xmm1 + pextrb [tmp + 4], xmm1, 4 + + mov tmp, [dst_array + off + 8*2] + movd [tmp], xmm0 + pextrb [tmp + 4], xmm0, 4 + +no_more_buffers: + +%ifdef SAFE_DATA + clear_all_xmms_sse_asm + ; Clear stack frame +%assign i 0 +%rep 16 + movdqa [rsp + _STATE + 16*i], xmm0 +%assign i (i + 1) +%endrep +%endif + +%ifndef LINUX +%assign i 0 +%assign j 6 +%rep 10 + movdqa APPEND(xmm, j), [rsp + _XMM_WIN_SAVE + i*16] +%assign i (i + 1) +%assign j (j + 1) +%endrep +%endif + mov rsp, [rsp + _RSP_SAVE] + +exit_quic: + + ret + mksection stack-noexec diff --git a/lib/sse_t1/mb_mgr_sse_t1.c b/lib/sse_t1/mb_mgr_sse_t1.c index fb96eb6f..f7cef5f0 100644 --- a/lib/sse_t1/mb_mgr_sse_t1.c +++ b/lib/sse_t1/mb_mgr_sse_t1.c @@ -493,6 +493,7 @@ init_mb_mgr_sse_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t2/mb_mgr_sse_t2.c b/lib/sse_t2/mb_mgr_sse_t2.c index b52aeb8a..3f598115 100644 --- a/lib/sse_t2/mb_mgr_sse_t2.c +++ b/lib/sse_t2/mb_mgr_sse_t2.c @@ -491,6 +491,7 @@ init_mb_mgr_sse_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t3/mb_mgr_sse_t3.c b/lib/sse_t3/mb_mgr_sse_t3.c index 72d03812..31a61d40 100644 --- a/lib/sse_t3/mb_mgr_sse_t3.c +++ b/lib/sse_t3/mb_mgr_sse_t3.c @@ -492,6 +492,7 @@ init_mb_mgr_sse_t3_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/x86_64/quic_hp_chacha20.c b/lib/x86_64/quic_hp_chacha20.c index 97f0e02d..c88f43d9 100644 --- a/lib/x86_64/quic_hp_chacha20.c +++ b/lib/x86_64/quic_hp_chacha20.c @@ -68,7 +68,7 @@ imb_quic_hp_chacha20(IMB_MGR *state, #endif /* SAFE_PARAM */ - quic_chacha20_avx512(key, src_ptr_array, dst_ptr_array, num_packets); + state->chacha20_hp_quic(key, src_ptr_array, dst_ptr_array, num_packets); imb_set_errno(state, 0); } -- GitLab From b0a2adf2824a7f1707c29a1cc92408b465eaf1fa Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 30 Jun 2023 16:51:20 +0100 Subject: [PATCH 041/204] avx2: [QUIC] implement ChaCha20 HP --- lib/avx2_t1/chacha20_avx2.asm | 404 +++++++++++++++++++++++++++++++- lib/avx2_t1/mb_mgr_avx2_t1.c | 2 +- lib/avx2_t2/mb_mgr_avx2_t2.c | 2 +- lib/avx2_t3/mb_mgr_avx2_t3.c | 2 +- lib/include/chacha20_poly1305.h | 2 + 5 files changed, 403 insertions(+), 9 deletions(-) diff --git a/lib/avx2_t1/chacha20_avx2.asm b/lib/avx2_t1/chacha20_avx2.asm index 7c65f2fb..dd57221d 100644 --- a/lib/avx2_t1/chacha20_avx2.asm +++ b/lib/avx2_t1/chacha20_avx2.asm @@ -482,10 +482,10 @@ mksection .text %define %%YMM_DWORD_14 %15 ;; [out] YMM register to contain encoded dword 14 of the 8 Chacha20 states %define %%YMM_DWORD_15 %16 ;; [out] YMM register to contain encoded dword 15 of the 8 Chacha20 states -%assign i 0 +%assign %%i 0 %rep 16 - vmovdqa APPEND(%%YMM_DWORD_, i), [rsp + _STATE + 32*i] -%assign i (i + 1) + vmovdqa APPEND(%%YMM_DWORD_, %%i), [rsp + _STATE + 32*%%i] +%assign %%i (%%i + 1) %endrep %rep 10 @@ -500,10 +500,10 @@ mksection .text %%YMM_DWORD_15, %%YMM_DWORD_12, %%YMM_DWORD_13, %%YMM_DWORD_14 %endrep -%assign i 0 +%assign %%i 0 %rep 16 - vpaddd APPEND(%%YMM_DWORD_, i), [rsp + _STATE + 32*i] -%assign i (i + 1) + vpaddd APPEND(%%YMM_DWORD_, %%i), [rsp + _STATE + 32*%%i] +%assign %%i (%%i + 1) %endrep %endmacro @@ -554,6 +554,46 @@ mksection .text %endif %endmacro +%macro PREPARE_NEXT_STATES_1_TO_4_QUIC 12 +%define %%STATE_IN_A_L %1 ;; [out] YMM containing state "A" part for states 1-2 +%define %%STATE_IN_B_L %2 ;; [out] YMM containing state "B" part for states 1-2 +%define %%STATE_IN_C_L %3 ;; [out] YMM containing state "C" part for states 1-2 +%define %%STATE_IN_D_L %4 ;; [out] YMM containing state "D" part for states 1-2 +%define %%STATE_IN_D_H %5 ;; [out] YMM containing state "D" part for states 3-4 (or "none" in NUM_BUFFERS <= 2) +%define %%YTMP0 %6 ;; [clobbered] YMM temp reg +%define %%YTMP1 %7 ;; [clobbered] YMM temp reg +%define %%SRC %8 ;; [in] Pointer to array of source pointers +%define %%OFF %9 ;; [in] Offset into array of source pointers +%define %%TMP %10 ;; [in] Temporary GP register +%define %%KEY %11 ;; [in] Pointer to key +%define %%NUM_BUFFERS %12 ;; [in] Number of ChaCha states to prepare (numerical) + + ;; Prepare next 4 states (or 2, if 2 or less blocks left) + vmovdqu %%STATE_IN_B_L, [%%KEY] ; Load key bytes 0-15 + vmovdqu %%STATE_IN_C_L, [%%KEY + 16] ; Load key bytes 16-31 + vperm2i128 %%STATE_IN_B_L,%%STATE_IN_B_L, 0x0 + vperm2i128 %%STATE_IN_C_L, %%STATE_IN_C_L, 0x0 + mov %%TMP, [%%SRC + %%OFF] + vmovdqu XWORD(%%STATE_IN_D_L), [%%TMP] + vmovdqa %%STATE_IN_A_L, [rel constants] +%if %%NUM_BUFFERS > 1 + mov %%TMP, [%%SRC + %%OFF + 8] + vinserti128 %%STATE_IN_D_L, [%%TMP], 1 +%endif + +%if %%NUM_BUFFERS > 2 + ;; Prepare chacha states 2-3 (A-C same as states 0-3) + mov %%TMP, [%%SRC + %%OFF + 8*2] + vmovdqu XWORD(%%STATE_IN_D_H), [%%TMP] +%endif + +%if %%NUM_BUFFERS > 3 + ;; Prepare chacha states 2-3 (A-C same as states 0-3) + mov %%TMP, [%%SRC + %%OFF + 8*3] + vinserti128 %%STATE_IN_D_H, [%%TMP], 1 +%endif +%endmacro + align 32 MKGLOBAL(submit_job_chacha20_enc_dec_avx2,function,internal) submit_job_chacha20_enc_dec_avx2: @@ -1423,4 +1463,356 @@ exit_ks: ret +align 32 +MKGLOBAL(quic_chacha20_avx2,function,internal) +quic_chacha20_avx2: + endbranch64 +%define tmp rax +%define off r11 + +%define key arg1 +%define src_array arg2 +%define dst_array arg3 +%define num_buffers arg4 + + ; Check if there are no buffers + or num_buffers, num_buffers + jz exit_quic + + mov rax, rsp + sub rsp, STACK_SIZE + and rsp, -32 +%ifndef LINUX +%assign i 0 +%assign j 6 +%rep 10 + vmovdqa [rsp + _XMM_WIN_SAVE + i*16], APPEND(xmm, j) +%assign i (i + 1) +%assign j (j + 1) +%endrep +%endif + mov [rsp + _RSP_SAVE], rax ; save RSP + + xor off, off + + ; If less than or equal to 4 buffers, prepare directly states for + ; up to 4 blocks + cmp num_buffers, 4 + jbe exit_loop_quic + + ; Prepare first 8 chacha states from key + vbroadcastss ymm4, [key] + vbroadcastss ymm5, [key + 4] + vbroadcastss ymm6, [key + 8] + vbroadcastss ymm7, [key + 12] + vbroadcastss ymm8, [key + 16] + vbroadcastss ymm9, [key + 20] + vbroadcastss ymm10, [key + 24] + vbroadcastss ymm11, [key + 28] + +%assign i 4 +%rep 8 + vmovdqa [rsp + _STATE + 32*i], ymm %+ i +%assign i (i + 1) +%endrep + + cmp num_buffers, 8 + jb exit_loop_quic + +align 32 +start_loop_quic: + + ; Load counter + nonce values from the 8 samples (src) +%assign i 0 +%rep 2 + mov tmp, [src_array + off + i*32] + vmovd xmm0, [tmp] + vmovd xmm1, [tmp + 4] + vmovd xmm2, [tmp + 4*2] + vmovd xmm3, [tmp + 4*3] + mov tmp, [src_array + off + i*32 + 8] + vpinsrd xmm0, [tmp], 1 + vpinsrd xmm1, [tmp + 4], 1 + vpinsrd xmm2, [tmp + 4*2], 1 + vpinsrd xmm3, [tmp + 4*3], 1 + mov tmp, [src_array + off + i*32 + 8*2] + vpinsrd xmm0, [tmp], 2 + vpinsrd xmm1, [tmp + 4], 2 + vpinsrd xmm2, [tmp + 4*2], 2 + vpinsrd xmm3, [tmp + 4*3], 2 + mov tmp, [src_array + off + i*32 + 8*3] + vpinsrd xmm0, [tmp], 3 + vpinsrd xmm1, [tmp + 4], 3 + vpinsrd xmm2, [tmp + 4*2], 3 + vpinsrd xmm3, [tmp + 4*3], 3 + +%if i == 0 + vmovdqa xmm12, xmm0 + vmovdqa xmm13, xmm1 + vmovdqa xmm14, xmm2 + vmovdqa xmm15, xmm3 +%else + vinserti128 ymm12, xmm0, 1 + vinserti128 ymm13, xmm1, 1 + vinserti128 ymm14, xmm2, 1 + vinserti128 ymm15, xmm3, 1 +%endif +%assign i (i + 1) +%endrep + + ; Load constants + vbroadcastss ymm0, [rel constants] + vbroadcastss ymm1, [rel constants + 4] + vbroadcastss ymm2, [rel constants + 8] + vbroadcastss ymm3, [rel constants + 12] + + ; Save rest of the chacha states + vmovdqa [rsp + _STATE], ymm0 + vmovdqa [rsp + _STATE + 32], ymm1 + vmovdqa [rsp + _STATE + 32*2], ymm2 + vmovdqa [rsp + _STATE + 32*3], ymm3 + vmovdqa [rsp + _STATE + 32*12], ymm12 + vmovdqa [rsp + _STATE + 32*13], ymm13 + vmovdqa [rsp + _STATE + 32*14], ymm14 + vmovdqa [rsp + _STATE + 32*15], ymm15 + + ; Generate 512 bytes of keystream + GENERATE_512_KS ymm0, ymm1, ymm2, ymm3, ymm4, ymm5, ymm6, ymm7, \ + ymm8, ymm9, ymm10, ymm11, ymm12, ymm13, ymm14, ymm15 + + ;; Transpose state to get keystream and write 5-byte output per buffer + + ; Transpose to get [64*I : 64*I + 31] (I = 0-7) bytes of KS + TRANSPOSE8_U32 ymm0, ymm1, ymm2, ymm3, ymm4, ymm5, ymm6, ymm7, ymm14, ymm15 + +%assign i 0 +%rep 8 + + mov tmp, [dst_array + off + 8*i] + vmovd [tmp], xmm %+ i + vpextrb [tmp + 4], xmm %+i, 4 +%assign i (i+1) +%endrep + + sub num_buffers, 8 + add off, 8*8 + + cmp num_buffers, 8 + jae start_loop_quic + +exit_loop_quic: + + ; Check if there are no more buffers + or num_buffers, num_buffers + jz no_more_buffers + + cmp num_buffers, 4 + je four_buffers_left + ja more_than_4_buffers_left + + ;; up to 4 buffers left + cmp num_buffers, 2 + je two_buffers_left + ja three_buffers_left + +one_buffer_left: + PREPARE_NEXT_STATES_1_TO_4_QUIC ymm4, ymm5, ymm6, ymm7, ymm12, \ + ymm8, ymm9, src_array, off, tmp, key, 1 + + ; Generate 128 bytes of keystream + GENERATE_256_KS ymm0, ymm1, ymm8, ymm9, none, none, none, none, \ + ymm4, ymm5, ymm6, ymm7, none, ymm10, 2 + + ; Write 5-byte output for single buffer + mov tmp, [dst_array + off] + vmovd [tmp], xmm0 + vpextrb [tmp + 4], xmm0, 4 + + jmp no_more_buffers + +two_buffers_left: + + PREPARE_NEXT_STATES_1_TO_4_QUIC ymm4, ymm5, ymm6, ymm7, ymm12, \ + ymm8, ymm9, src_array, off, tmp, key, 2 + + ; Generate 128 bytes of keystream + GENERATE_256_KS ymm0, ymm1, ymm8, ymm9, none, none, none, none, \ + ymm4, ymm5, ymm6, ymm7, none, ymm10, 2 + + ; Write 5-byte output for two buffers + mov tmp, [dst_array + off] + vmovd [tmp], xmm0 + vpextrb [tmp + 4], xmm0, 4 + mov tmp, [dst_array + off + 8] + vmovd [tmp], xmm1 + vpextrb [tmp + 4], xmm1, 4 + + jmp no_more_buffers + +four_buffers_left: + + PREPARE_NEXT_STATES_1_TO_4_QUIC ymm4, ymm5, ymm6, ymm7, ymm12, \ + ymm8, ymm9, src_array, off, tmp, key, 4 + + ; Generate 256 bytes of keystream + GENERATE_256_KS ymm0, ymm1, ymm8, ymm9, ymm2, ymm3, ymm10, ymm11, \ + ymm4, ymm5, ymm6, ymm7, ymm12, ymm13, 4 + + ; Write 5-byte output for two buffers + mov tmp, [dst_array + off] + vmovd [tmp], xmm0 + vpextrb [tmp + 4], xmm0, 4 + mov tmp, [dst_array + off + 8] + vmovd [tmp], xmm1 + vpextrb [tmp + 4], xmm1, 4 + mov tmp, [dst_array + off + 8*2] + vmovd [tmp], xmm2 + vpextrb [tmp + 4], xmm2, 4 + mov tmp, [dst_array + off + 8*3] + vmovd [tmp], xmm3 + vpextrb [tmp + 4], xmm3, 4 + + jmp no_more_buffers + +three_buffers_left: + + PREPARE_NEXT_STATES_1_TO_4_QUIC ymm4, ymm5, ymm6, ymm7, ymm12, \ + ymm8, ymm9, src_array, off, tmp, key, 3 + + ; Generate 256 bytes of keystream + GENERATE_256_KS ymm0, ymm1, ymm8, ymm9, ymm2, ymm3, ymm10, ymm11, \ + ymm4, ymm5, ymm6, ymm7, ymm12, ymm13, 4 + + ; Write 5-byte output for two buffers + mov tmp, [dst_array + off] + vmovd [tmp], xmm0 + vpextrb [tmp + 4], xmm0, 4 + mov tmp, [dst_array + off + 8] + vmovd [tmp], xmm1 + vpextrb [tmp + 4], xmm1, 4 + mov tmp, [dst_array + off + 8*2] + vmovd [tmp], xmm2 + vpextrb [tmp + 4], xmm2, 4 + + jmp no_more_buffers + +more_than_4_buffers_left: + + ; Load counter + nonce values from the next 4 samples (src) + mov tmp, [src_array + off] + vmovd xmm0, [tmp] + vmovd xmm1, [tmp + 4] + vmovd xmm2, [tmp + 4*2] + vmovd xmm3, [tmp + 4*3] + mov tmp, [src_array + off + 8] + vpinsrd xmm0, [tmp], 1 + vpinsrd xmm1, [tmp + 4], 1 + vpinsrd xmm2, [tmp + 4*2], 1 + vpinsrd xmm3, [tmp + 4*3], 1 + mov tmp, [src_array + off + 8*2] + vpinsrd xmm0, [tmp], 2 + vpinsrd xmm1, [tmp + 4], 2 + vpinsrd xmm2, [tmp + 4*2], 2 + vpinsrd xmm3, [tmp + 4*3], 2 + mov tmp, [src_array + off + 8*3] + vpinsrd xmm0, [tmp], 3 + vpinsrd xmm1, [tmp + 4], 3 + vpinsrd xmm2, [tmp + 4*2], 3 + vpinsrd xmm3, [tmp + 4*3], 3 + + vmovdqa xmm12, xmm0 + vmovdqa xmm13, xmm1 + vmovdqa xmm14, xmm2 + vmovdqa xmm15, xmm3 + + cmp num_buffers, 6 + je buffers_left_6 + ja buffers_left_7 + +%assign i 5 +%rep 3 +APPEND(buffers_left_, i): + + ; Load counter + nonce values from the final 1-3 samples (src) +%assign j 4 +%rep (i - 4) + mov tmp, [src_array + off + j*8] + vpinsrd xmm0, [tmp], (j-4) + vpinsrd xmm1, [tmp + 4], (j-4) + vpinsrd xmm2, [tmp + 4*2], (j-4) + vpinsrd xmm3, [tmp + 4*3], (j-4) +%assign j (j + 1) +%endrep + vinserti128 ymm12, xmm0, 1 + vinserti128 ymm13, xmm1, 1 + vinserti128 ymm14, xmm2, 1 + vinserti128 ymm15, xmm3, 1 + + ; Load constants + vbroadcastss ymm0, [rel constants] + vbroadcastss ymm1, [rel constants + 4] + vbroadcastss ymm2, [rel constants + 8] + vbroadcastss ymm3, [rel constants + 12] + + ; Save rest of the chacha states + vmovdqa [rsp + _STATE], ymm0 + vmovdqa [rsp + _STATE + 32], ymm1 + vmovdqa [rsp + _STATE + 32*2], ymm2 + vmovdqa [rsp + _STATE + 32*3], ymm3 + vmovdqa [rsp + _STATE + 32*12], ymm12 + vmovdqa [rsp + _STATE + 32*13], ymm13 + vmovdqa [rsp + _STATE + 32*14], ymm14 + vmovdqa [rsp + _STATE + 32*15], ymm15 + + ; Generate 512 bytes of keystream + GENERATE_512_KS ymm0, ymm1, ymm2, ymm3, ymm4, ymm5, ymm6, ymm7, \ + ymm8, ymm9, ymm10, ymm11, ymm12, ymm13, ymm14, ymm15 + + ; Transpose to get [64*I : 64*I + 31] (I = 0-7) bytes of KS + TRANSPOSE8_U32 ymm0, ymm1, ymm2, ymm3, ymm4, ymm5, ymm6, ymm7, ymm14, ymm15 + +%assign j 0 +%rep i + mov tmp, [dst_array + off + 8*j] + vmovd [tmp], xmm %+ j + vpextrb [tmp + 4], xmm %+ j, 4 +%assign j (j + 1) +%endrep + + jmp no_more_buffers + +%assign i (i + 1) +%endrep + +no_more_buffers: +%ifdef SAFE_DATA + vpxor ymm0, ymm0 + ; Clear stack frame +%assign i 0 +%rep 16 + vmovdqa [rsp + _STATE + 32*i], ymm0 +%assign i (i + 1) +%endrep +%endif ; SAFE_DATA + +%ifndef LINUX +%assign i 0 +%assign j 6 +%rep 10 + vmovdqa APPEND(xmm, j), [rsp + _XMM_WIN_SAVE + i*16] +%assign i (i + 1) +%assign j (j + 1) +%endrep +%endif ; LINUX + mov rsp, [rsp + _RSP_SAVE] + +%ifdef SAFE_DATA + clear_scratch_ymms_asm +%else + vzeroupper +%endif + +exit_quic: + ret + mksection stack-noexec diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index 2587b44d..7d3c7656 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -486,7 +486,7 @@ init_mb_mgr_avx2_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index a915e38c..7fc8a318 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -487,7 +487,7 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index dc439655..41ebe194 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -494,7 +494,7 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_avx2; } #include "mb_mgr_code.h" diff --git a/lib/include/chacha20_poly1305.h b/lib/include/chacha20_poly1305.h index 93a06603..38f14f84 100644 --- a/lib/include/chacha20_poly1305.h +++ b/lib/include/chacha20_poly1305.h @@ -189,6 +189,8 @@ void finalize_chacha20_poly1305_fma_avx512( void quic_chacha20_sse(const void *key, const void * const src_ptr_array[], void *dst_ptr_array[], const uint64_t num_buffers); +void quic_chacha20_avx2(const void *key, const void * const src_ptr_array[], + void *dst_ptr_array[], const uint64_t num_buffers); void quic_chacha20_avx512(const void *key, const void * const src_ptr_array[], void *dst_ptr_array[], const uint64_t num_buffers); -- GitLab From cdfe3e23257ef5823f9b2ec06aa759b9a040f053 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 7 Jul 2023 08:30:17 +0100 Subject: [PATCH 042/204] perf: fix build due to unused parameter --- perf/ipsec_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index f4eba77a..469b69c7 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -1696,7 +1696,7 @@ do_test_quic_aes_ecb_hp(struct params_s *params, const uint32_t num_iter, IMB_MG uint64_t n; int i; -#ifndef _WIN32 +#ifdef _WIN32 (void) params; /* unused for Windows */ #endif @@ -1755,7 +1755,7 @@ do_test_quic_chacha20_hp(struct params_s *params, const uint32_t num_iter, IMB_M uint64_t n; int i; -#ifndef _WIN32 +#ifdef _WIN32 (void) params; /* unused for Windows */ #endif -- GitLab From 84aa9314eb7b4414737062e2484da74fc1600ab4 Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Fri, 7 Jul 2023 10:23:21 +0100 Subject: [PATCH 043/204] test: [CHACHA20-POLY1305] Unify test vectors --- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 3 +- test/kat-app/chacha20_poly1305_test.c | 383 ++++----------------- test/kat-app/chacha20_poly1305_test.json.c | 98 ++++++ test/kat-app/win_x64.mak | 2 +- 5 files changed, 173 insertions(+), 314 deletions(-) create mode 100644 test/kat-app/chacha20_poly1305_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 79dd1c8f..a0bbe69f 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -108,6 +108,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/chacha_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/des_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/gcm_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/chacha20_poly1305_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 4a4c3377..46e8c23f 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -42,7 +42,8 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ - des_test.json.c chacha_test.json.c gcm_test.json.c quic_chacha20_test.c + des_test.json.c chacha_test.json.c gcm_test.json.c quic_chacha20_test.c \ + chacha20_poly1305_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/chacha20_poly1305_test.c b/test/kat-app/chacha20_poly1305_test.c index 1955fa5f..93243fa7 100644 --- a/test/kat-app/chacha20_poly1305_test.c +++ b/test/kat-app/chacha20_poly1305_test.c @@ -32,6 +32,7 @@ #include #include "utils.h" +#include "aead_test.h" #define AAD_SZ 24 #define IV_SZ 12 @@ -40,213 +41,10 @@ int chacha20_poly1305_test(struct IMB_MGR *mb_mgr); -/* - * Test vectors from RFC7539 https://tools.ietf.org/html/rfc7539 - */ - -/* 2.8.2. Example and Test Vector for AEAD_CHACHA20_POLY1305 */ -static const uint8_t plain_vec0[] = { - 0x4c, 0x61, 0x64, 0x69, 0x65, 0x73, 0x20, 0x61, - 0x6e, 0x64, 0x20, 0x47, 0x65, 0x6e, 0x74, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x20, 0x6f, 0x66, 0x20, 0x27, 0x39, 0x39, - 0x3a, 0x20, 0x49, 0x66, 0x20, 0x49, 0x20, 0x63, - 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x66, 0x66, - 0x65, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6f, - 0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20, - 0x74, 0x69, 0x70, 0x20, 0x66, 0x6f, 0x72, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x74, 0x75, - 0x72, 0x65, 0x2c, 0x20, 0x73, 0x75, 0x6e, 0x73, - 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x77, 0x6f, - 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x69, - 0x74, 0x2e -}; - -static const uint8_t cipher_vec0[] = { - 0xd3, 0x1a, 0x8d, 0x34, 0x64, 0x8e, 0x60, 0xdb, - 0x7b, 0x86, 0xaf, 0xbc, 0x53, 0xef, 0x7e, 0xc2, - 0xa4, 0xad, 0xed, 0x51, 0x29, 0x6e, 0x08, 0xfe, - 0xa9, 0xe2, 0xb5, 0xa7, 0x36, 0xee, 0x62, 0xd6, - 0x3d, 0xbe, 0xa4, 0x5e, 0x8c, 0xa9, 0x67, 0x12, - 0x82, 0xfa, 0xfb, 0x69, 0xda, 0x92, 0x72, 0x8b, - 0x1a, 0x71, 0xde, 0x0a, 0x9e, 0x06, 0x0b, 0x29, - 0x05, 0xd6, 0xa5, 0xb6, 0x7e, 0xcd, 0x3b, 0x36, - 0x92, 0xdd, 0xbd, 0x7f, 0x2d, 0x77, 0x8b, 0x8c, - 0x98, 0x03, 0xae, 0xe3, 0x28, 0x09, 0x1b, 0x58, - 0xfa, 0xb3, 0x24, 0xe4, 0xfa, 0xd6, 0x75, 0x94, - 0x55, 0x85, 0x80, 0x8b, 0x48, 0x31, 0xd7, 0xbc, - 0x3f, 0xf4, 0xde, 0xf0, 0x8e, 0x4b, 0x7a, 0x9d, - 0xe5, 0x76, 0xd2, 0x65, 0x86, 0xce, 0xc6, 0x4b, - 0x61, 0x16 -}; - -static const uint8_t aad_vec0[] = { - 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7 -}; - -static const uint8_t key_vec0[KEY_SZ] = { - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f -}; - -static const uint8_t iv_vec0[IV_SZ] = { - 0x07, 0x00, 0x00, 0x00, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, -}; -static const uint8_t tag_vec0[DIGEST_SZ] = { - 0x1a, 0xe1, 0x0b, 0x59, 0x4f, 0x09, 0xe2, 0x6a, - 0x7e, 0x90, 0x2e, 0xcb, 0xd0, 0x60, 0x06, 0x91 -}; - -/* A.5. ChaCha20-Poly1305 AEAD Decryption */ - - -static const uint8_t key_vec1[KEY_SZ] = { - 0x1c, 0x92, 0x40, 0xa5, 0xeb, 0x55, 0xd3, 0x8a, - 0xf3, 0x33, 0x88, 0x86, 0x04, 0xf6, 0xb5, 0xf0, - 0x47, 0x39, 0x17, 0xc1, 0x40, 0x2b, 0x80, 0x09, - 0x9d, 0xca, 0x5c, 0xbc, 0x20, 0x70, 0x75, 0xc0 -}; - -static const uint8_t cipher_vec1[] = { - 0x64, 0xa0, 0x86, 0x15, 0x75, 0x86, 0x1a, 0xf4, - 0x60, 0xf0, 0x62, 0xc7, 0x9b, 0xe6, 0x43, 0xbd, - 0x5e, 0x80, 0x5c, 0xfd, 0x34, 0x5c, 0xf3, 0x89, - 0xf1, 0x08, 0x67, 0x0a, 0xc7, 0x6c, 0x8c, 0xb2, - 0x4c, 0x6c, 0xfc, 0x18, 0x75, 0x5d, 0x43, 0xee, - 0xa0, 0x9e, 0xe9, 0x4e, 0x38, 0x2d, 0x26, 0xb0, - 0xbd, 0xb7, 0xb7, 0x3c, 0x32, 0x1b, 0x01, 0x00, - 0xd4, 0xf0, 0x3b, 0x7f, 0x35, 0x58, 0x94, 0xcf, - 0x33, 0x2f, 0x83, 0x0e, 0x71, 0x0b, 0x97, 0xce, - 0x98, 0xc8, 0xa8, 0x4a, 0xbd, 0x0b, 0x94, 0x81, - 0x14, 0xad, 0x17, 0x6e, 0x00, 0x8d, 0x33, 0xbd, - 0x60, 0xf9, 0x82, 0xb1, 0xff, 0x37, 0xc8, 0x55, - 0x97, 0x97, 0xa0, 0x6e, 0xf4, 0xf0, 0xef, 0x61, - 0xc1, 0x86, 0x32, 0x4e, 0x2b, 0x35, 0x06, 0x38, - 0x36, 0x06, 0x90, 0x7b, 0x6a, 0x7c, 0x02, 0xb0, - 0xf9, 0xf6, 0x15, 0x7b, 0x53, 0xc8, 0x67, 0xe4, - 0xb9, 0x16, 0x6c, 0x76, 0x7b, 0x80, 0x4d, 0x46, - 0xa5, 0x9b, 0x52, 0x16, 0xcd, 0xe7, 0xa4, 0xe9, - 0x90, 0x40, 0xc5, 0xa4, 0x04, 0x33, 0x22, 0x5e, - 0xe2, 0x82, 0xa1, 0xb0, 0xa0, 0x6c, 0x52, 0x3e, - 0xaf, 0x45, 0x34, 0xd7, 0xf8, 0x3f, 0xa1, 0x15, - 0x5b, 0x00, 0x47, 0x71, 0x8c, 0xbc, 0x54, 0x6a, - 0x0d, 0x07, 0x2b, 0x04, 0xb3, 0x56, 0x4e, 0xea, - 0x1b, 0x42, 0x22, 0x73, 0xf5, 0x48, 0x27, 0x1a, - 0x0b, 0xb2, 0x31, 0x60, 0x53, 0xfa, 0x76, 0x99, - 0x19, 0x55, 0xeb, 0xd6, 0x31, 0x59, 0x43, 0x4e, - 0xce, 0xbb, 0x4e, 0x46, 0x6d, 0xae, 0x5a, 0x10, - 0x73, 0xa6, 0x72, 0x76, 0x27, 0x09, 0x7a, 0x10, - 0x49, 0xe6, 0x17, 0xd9, 0x1d, 0x36, 0x10, 0x94, - 0xfa, 0x68, 0xf0, 0xff, 0x77, 0x98, 0x71, 0x30, - 0x30, 0x5b, 0xea, 0xba, 0x2e, 0xda, 0x04, 0xdf, - 0x99, 0x7b, 0x71, 0x4d, 0x6c, 0x6f, 0x2c, 0x29, - 0xa6, 0xad, 0x5c, 0xb4, 0x02, 0x2b, 0x02, 0x70, - 0x9b -}; - -static const uint8_t iv_vec1[IV_SZ] = { - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, - 0x05, 0x06, 0x07, 0x08 -}; - -static const uint8_t aad_vec1[] = { - 0xf3, 0x33, 0x88, 0x86, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x4e, 0x91 -}; - -static const uint8_t tag_vec1[DIGEST_SZ] = { - 0xee, 0xad, 0x9d, 0x67, 0x89, 0x0c, 0xbb, 0x22, - 0x39, 0x23, 0x36, 0xfe, 0xa1, 0x85, 0x1f, 0x38 -}; - -static const uint8_t plain_vec1[] = { - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2d, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x20, - 0x61, 0x72, 0x65, 0x20, 0x64, 0x72, 0x61, 0x66, - 0x74, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, - 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, - 0x6f, 0x66, 0x20, 0x73, 0x69, 0x78, 0x20, 0x6d, - 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, - 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x2c, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x64, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x6f, - 0x62, 0x73, 0x6f, 0x6c, 0x65, 0x74, 0x65, 0x64, - 0x20, 0x62, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, - 0x72, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x20, 0x61, 0x74, 0x20, 0x61, - 0x6e, 0x79, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, - 0x20, 0x49, 0x74, 0x20, 0x69, 0x73, 0x20, 0x69, - 0x6e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, - 0x69, 0x61, 0x74, 0x65, 0x20, 0x74, 0x6f, 0x20, - 0x75, 0x73, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2d, 0x44, 0x72, 0x61, - 0x66, 0x74, 0x73, 0x20, 0x61, 0x73, 0x20, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, - 0x6c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, - 0x63, 0x69, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, - 0x6d, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, - 0x74, 0x68, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x20, - 0x2f, 0xe2, 0x80, 0x9c, 0x77, 0x6f, 0x72, 0x6b, - 0x20, 0x69, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x2e, 0x2f, 0xe2, 0x80, - 0x9d -}; - -static const uint8_t key_vec2[KEY_SZ] = { - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x66, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f -}; - -static const uint8_t iv_vec2[IV_SZ] = { - 0x01, 0x02, 0x04, 0x08, 0x0b, 0x0d, 0x0f, 0x10, - 0x10, 0x11, 0x12, 0x13 -}; - -static const uint8_t aad_vec2[] = { - 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, - 0x10, 0x12, 0x14, 0x16 -}; - -static const uint8_t tag_vec2[DIGEST_SZ] = { - 0x32, 0x08, 0x45, 0xB8, 0x85, 0xDD, 0xB5, 0x81, - 0x74, 0x36, 0xE3, 0x11, 0x3F, 0x51, 0x6D, 0xBF -}; - -static const uint8_t plain_vec2[] = {0}; - -static const uint8_t cipher_vec2[] = {0}; - -struct aead_vector { - const uint8_t *plain; - const uint8_t *cipher; - size_t msg_len; - const uint8_t *aad; - size_t aad_len; - const uint8_t *iv; - const uint8_t *key; - const uint8_t *tag; -} aead_vectors[] = { - {plain_vec0, cipher_vec0, sizeof(plain_vec0), - aad_vec0, sizeof(aad_vec0), iv_vec0, key_vec0, tag_vec0}, - {plain_vec1, cipher_vec1, sizeof(plain_vec1), - aad_vec1, sizeof(aad_vec1), iv_vec1, key_vec1, tag_vec1}, - {plain_vec2, cipher_vec2, 0, - aad_vec2, sizeof(aad_vec2), iv_vec2, key_vec2, tag_vec2}, -}; +extern const struct aead_test chacha20_poly1305_test_json[]; static int -aead_ok(const struct aead_vector *vec, +aead_ok(const struct aead_test *vec, const size_t auth_len, const uint8_t *out_text, const IMB_CIPHER_DIRECTION cipher_dir, @@ -255,8 +53,7 @@ aead_ok(const struct aead_vector *vec, const size_t sizeof_padding) { /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + auth_len], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + auth_len], sizeof_padding)) { printf("hash overwrite tail\n"); hexdump(stderr, "Target", &auth[sizeof_padding + auth_len], sizeof_padding); @@ -277,17 +74,17 @@ aead_ok(const struct aead_vector *vec, } if (cipher_dir == IMB_DIR_ENCRYPT) { - if (memcmp(vec->cipher, out_text, vec->msg_len)) { + if (memcmp(vec->ct, out_text, vec->msgSize / 8)) { printf("cipher text mismatched\n"); - hexdump(stderr, "Received", out_text, vec->msg_len); - hexdump(stderr, "Expected", vec->cipher, vec->msg_len); + hexdump(stderr, "Received", out_text, vec->msgSize / 8); + hexdump(stderr, "Expected", (const void *) vec->ct, vec->msgSize / 8); return 0; } } else { - if (memcmp(vec->plain, out_text, vec->msg_len)) { + if (memcmp(vec->msg, out_text, vec->msgSize / 8)) { printf("plain text mismatched\n"); - hexdump(stderr, "Received", out_text, vec->msg_len); - hexdump(stderr, "Expected", vec->plain, vec->msg_len); + hexdump(stderr, "Received", out_text, vec->msgSize / 8); + hexdump(stderr, "Expected", (const void *) vec->msg, vec->msgSize / 8); return 0; } } @@ -298,10 +95,9 @@ aead_ok(const struct aead_vector *vec, return 0; } - if (memcmp(padding, out_text + vec->msg_len, sizeof_padding)) { + if (memcmp(padding, out_text + vec->msgSize / 8, sizeof_padding)) { printf("destination buffer overrun (memory after)\n"); - hexdump(stderr, "", out_text + vec->msg_len, - sizeof_padding); + hexdump(stderr, "", out_text + vec->msgSize / 8, sizeof_padding); return 0; } return 1; @@ -309,7 +105,7 @@ aead_ok(const struct aead_vector *vec, static int test_aead(struct IMB_MGR *mb_mgr, - const struct aead_vector *vec, + const struct aead_test *vec, const int dir, const int num_jobs, const int in_place) @@ -324,7 +120,6 @@ test_aead(struct IMB_MGR *mb_mgr, fprintf(stderr, "Can't allocate buffer memory\n"); goto end2; } - memset(padding, -1, sizeof(padding)); memset(auths, 0, num_jobs * sizeof(void *)); memset(targets, 0, num_jobs * sizeof(void *)); @@ -340,20 +135,20 @@ test_aead(struct IMB_MGR *mb_mgr, } for (i = 0; i < num_jobs; i++) { - targets[i] = malloc(vec->msg_len + (sizeof(padding) * 2)); + targets[i] = malloc(vec->msgSize / 8 + (sizeof(padding) * 2)); if (targets[i] == NULL) { fprintf(stderr, "Can't allocate buffer memory\n"); goto end; } - memset(targets[i], -1, vec->msg_len + (sizeof(padding) * 2)); + memset(targets[i], -1, vec->msgSize / 8 + (sizeof(padding) * 2)); if (in_place) { if (dir == IMB_DIR_ENCRYPT) - memcpy(targets[i] + sizeof(padding), - vec->plain, vec->msg_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->msg, + vec->msgSize / 8); else - memcpy(targets[i] + sizeof(padding), - vec->cipher, vec->msg_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->ct, + vec->msgSize / 8); } } @@ -370,48 +165,39 @@ test_aead(struct IMB_MGR *mb_mgr, src_ptr_array[i] = targets[i] + sizeof(padding); else if (dir == IMB_DIR_ENCRYPT) - src_ptr_array[i] = vec->plain; + src_ptr_array[i] = (const void *) vec->msg; else - src_ptr_array[i] = vec->cipher; + src_ptr_array[i] = (const void *) vec->ct; dst_ptr_array[i] = targets[i] + sizeof(padding); aad_ptr_array[i] = vec->aad; iv_ptr_array[i] = vec->iv; tag_ptr_array[i] = auths[i] + sizeof(padding); - len_array[i] = vec->msg_len; + len_array[i] = vec->msgSize / 8; } - imb_quic_chacha20_poly1305(mb_mgr, - vec->key, - dir, - dst_ptr_array, - src_ptr_array, - len_array, - iv_ptr_array, - aad_ptr_array, - vec->aad_len, - tag_ptr_array, - DIGEST_SZ, - num_jobs); + imb_quic_chacha20_poly1305(mb_mgr, vec->key, dir, dst_ptr_array, src_ptr_array, len_array, + iv_ptr_array, aad_ptr_array, vec->aadSize / 8, tag_ptr_array, + DIGEST_SZ, num_jobs); for (i = 0; i < num_jobs; i++) { if (!aead_ok(vec, DIGEST_SZ, dst_ptr_array[i], dir, auths[i], - padding, sizeof(padding))) + padding, sizeof(padding))) goto end; } /* Reset the source buffers */ for (i = 0; i < num_jobs; i++) { - memset(targets[i], -1, vec->msg_len + (sizeof(padding) * 2)); + memset(targets[i], -1, vec->msgSize / 8 + (sizeof(padding) * 2)); if (in_place) { if (dir == IMB_DIR_ENCRYPT) - memcpy(targets[i] + sizeof(padding), - vec->plain, vec->msg_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->msg, + vec->msgSize / 8); else - memcpy(targets[i] + sizeof(padding), - vec->cipher, vec->msg_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->ct, + vec->msgSize / 8); } } @@ -431,24 +217,24 @@ test_aead(struct IMB_MGR *mb_mgr, job->dec_keys = vec->key; job->key_len_in_bytes = KEY_SZ; - job->u.CHACHA20_POLY1305.aad = vec->aad; - job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aad_len; + job->u.CHACHA20_POLY1305.aad = (const void *)vec->aad; + job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aadSize / 8; if (in_place) job->src = targets[i] + sizeof(padding); else if (dir == IMB_DIR_ENCRYPT) - job->src = vec->plain; + job->src = (const void *) vec->msg; else - job->src = vec->cipher; + job->src = (const void *) vec->ct; job->dst = targets[i] + sizeof(padding); - job->iv = vec->iv; + job->iv = (const void *) vec->iv; job->iv_len_in_bytes = IV_SZ; - job->msg_len_to_cipher_in_bytes = vec->msg_len; + job->msg_len_to_cipher_in_bytes = vec->msgSize / 8; job->cipher_start_src_offset_in_bytes = 0; - job->msg_len_to_hash_in_bytes = vec->msg_len; + job->msg_len_to_hash_in_bytes = vec->msgSize / 8; job->hash_start_src_offset_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); job->auth_tag_output_len_in_bytes = DIGEST_SZ; @@ -516,15 +302,15 @@ test_aead(struct IMB_MGR *mb_mgr, /* reset buffers */ for (i = 0; i < num_jobs; i++) { memset(auths[i], -1, DIGEST_SZ + (sizeof(padding) * 2)); - memset(targets[i], -1, vec->msg_len + (sizeof(padding) * 2)); + memset(targets[i], -1, vec->msgSize / 8 + (sizeof(padding) * 2)); if (in_place) { if (dir == IMB_DIR_ENCRYPT) - memcpy(targets[i] + sizeof(padding), - vec->plain, vec->msg_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->msg, + vec->msgSize / 8); else - memcpy(targets[i] + sizeof(padding), - vec->cipher, vec->msg_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->ct, + vec->msgSize / 8); } } @@ -545,23 +331,23 @@ test_aead(struct IMB_MGR *mb_mgr, job->key_len_in_bytes = KEY_SZ; job->u.CHACHA20_POLY1305.aad = vec->aad; - job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aad_len; + job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aadSize / 8; if (in_place) job->src = targets[i] + sizeof(padding); else if (dir == IMB_DIR_ENCRYPT) - job->src = vec->plain; + job->src = (const void *) vec->msg; else - job->src = vec->cipher; + job->src = (const void *) vec->ct; job->dst = targets[i] + sizeof(padding); - job->iv = vec->iv; + job->iv = (const void *) vec->iv; job->iv_len_in_bytes = IV_SZ; - job->msg_len_to_cipher_in_bytes = vec->msg_len; + job->msg_len_to_cipher_in_bytes = vec->msgSize / 8; job->cipher_start_src_offset_in_bytes = 0; - job->msg_len_to_hash_in_bytes = vec->msg_len; + job->msg_len_to_hash_in_bytes = vec->msgSize / 8; job->hash_start_src_offset_in_bytes = 0; job->auth_tag_output = auths[i] + sizeof(padding); job->auth_tag_output_len_in_bytes = DIGEST_SZ; @@ -655,56 +441,39 @@ static void test_aead_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs, - const struct aead_vector *vec_array, - const size_t vec_array_size, - const char *banner) + const struct aead_test *v) { - size_t vect; - if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_array_size; vect++) { + printf("AEAD Chacha20-Poly1305 vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Vector [%d/%d], M len: %d\n", - (int) vect + 1, (int) vec_array_size, - (int) vec_array[vect].msg_len); + printf("Vector %zu, M len: %zu\n", v->tcId, v->msgSize / 8); #else printf("."); #endif } - if (test_aead(mb_mgr, &vec_array[vect], - IMB_DIR_ENCRYPT, num_jobs, 1)) { - printf("error #%u encrypt in-place\n", - (unsigned) vect + 1); + if (test_aead(mb_mgr, v, IMB_DIR_ENCRYPT, num_jobs, 1)) { + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - - if (test_aead(mb_mgr, &vec_array[vect], - IMB_DIR_DECRYPT, num_jobs, 1)) { - printf("error #%u decrypt in-place\n", - (unsigned) vect + 1); + if (test_aead(mb_mgr, v, IMB_DIR_DECRYPT, num_jobs, 1)) { + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - - if (test_aead(mb_mgr, &vec_array[vect], - IMB_DIR_ENCRYPT, num_jobs, 0)) { - printf("error #%u encrypt out-of-place\n", - (unsigned) vect + 1); + if (test_aead(mb_mgr, v, IMB_DIR_ENCRYPT, num_jobs, 0)) { + printf("error #%zu encrypt out-of-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - - if (test_aead(mb_mgr, &vec_array[vect], - IMB_DIR_DECRYPT, num_jobs, 0)) { - printf("error #%u decrypt out-of-place\n", - (unsigned) vect + 1); + if (test_aead(mb_mgr, v, IMB_DIR_DECRYPT, num_jobs, 0)) { + printf("error #%zu decrypt out-of-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -1114,17 +883,13 @@ test_sgl(struct IMB_MGR *mb_mgr, job = IMB_SUBMIT_JOB(mb_mgr); } else { if (cipher_dir == IMB_DIR_ENCRYPT) - IMB_CHACHA20_POLY1305_ENC_UPDATE(mb_mgr, key, - &chacha_ctx, - segments[i], - segments[i], - segment_sizes[i]); + IMB_CHACHA20_POLY1305_ENC_UPDATE(mb_mgr, key, &chacha_ctx, + segments[i], segments[i], + segment_sizes[i]); else - IMB_CHACHA20_POLY1305_DEC_UPDATE(mb_mgr, key, - &chacha_ctx, - segments[i], - segments[i], - segment_sizes[i]); + IMB_CHACHA20_POLY1305_DEC_UPDATE(mb_mgr, key, &chacha_ctx, + segments[i], segments[i], + segment_sizes[i]); } } @@ -1240,22 +1005,16 @@ chacha20_poly1305_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx, "AEAD-CHACHA20-256-POLY1305"); for (i = 1; i < 20; i++) - test_aead_vectors(mb_mgr, &ctx, i, - aead_vectors, - DIM(aead_vectors), - "AEAD Chacha20-Poly1305 vectors"); - for (seg_sz = SEG_SZ_STEP; seg_sz <= MAX_SEG_SZ; - seg_sz += SEG_SZ_STEP) { + test_aead_vectors(mb_mgr, &ctx, i, chacha20_poly1305_test_json); + for (seg_sz = SEG_SZ_STEP; seg_sz <= MAX_SEG_SZ; seg_sz += SEG_SZ_STEP) { /* Job API */ test_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_ENCRYPT, 1, 0); test_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_DECRYPT, 1, 0); test_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_ENCRYPT, 1, 1); test_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_DECRYPT, 1, 1); /* Single job SGL API */ - test_single_job_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, - IMB_DIR_ENCRYPT); - test_single_job_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, - IMB_DIR_DECRYPT); + test_single_job_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_ENCRYPT); + test_single_job_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_DECRYPT); /* Direct API */ test_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_ENCRYPT, 0, 1); test_sgl(mb_mgr, &ctx, BUF_SZ, seg_sz, IMB_DIR_DECRYPT, 0, 1); diff --git a/test/kat-app/chacha20_poly1305_test.json.c b/test/kat-app/chacha20_poly1305_test.json.c new file mode 100644 index 00000000..4fc96530 --- /dev/null +++ b/test/kat-app/chacha20_poly1305_test.json.c @@ -0,0 +1,98 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* CHACHA20-POLY1305, RFC7539 */ +#include "aead_test.h" +const struct aead_test chacha20_poly1305_test_json[] = { + /* Vectors from https://tools.ietf.org/html/rfc7539 */ + {96, 256, 128, 1, + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91" + "\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", + "\x07\x00\x00\x00\x40\x41\x42\x43\x44\x45\x46\x47", + "\x50\x51\x52\x53\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7", + "\x4c\x61\x64\x69\x65\x73\x20\x61\x6e\x64\x20\x47\x65\x6e\x74\x6c\x65\x6d" + "\x65\x6e\x20\x6f\x66\x20\x74\x68\x65\x20\x63\x6c\x61\x73\x73\x20\x6f\x66" + "\x20\x27\x39\x39\x3a\x20\x49\x66\x20\x49\x20\x63\x6f\x75\x6c\x64\x20\x6f" + "\x66\x66\x65\x72\x20\x79\x6f\x75\x20\x6f\x6e\x6c\x79\x20\x6f\x6e\x65\x20" + "\x74\x69\x70\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x66\x75\x74\x75\x72\x65" + "\x2c\x20\x73\x75\x6e\x73\x63\x72\x65\x65\x6e\x20\x77\x6f\x75\x6c\x64\x20" + "\x62\x65\x20\x69\x74\x2e", + "\xd3\x1a\x8d\x34\x64\x8e\x60\xdb\x7b\x86\xaf\xbc\x53\xef\x7e\xc2\xa4\xad" + "\xed\x51\x29\x6e\x08\xfe\xa9\xe2\xb5\xa7\x36\xee\x62\xd6\x3d\xbe\xa4\x5e" + "\x8c\xa9\x67\x12\x82\xfa\xfb\x69\xda\x92\x72\x8b\x1a\x71\xde\x0a\x9e\x06" + "\x0b\x29\x05\xd6\xa5\xb6\x7e\xcd\x3b\x36\x92\xdd\xbd\x7f\x2d\x77\x8b\x8c" + "\x98\x03\xae\xe3\x28\x09\x1b\x58\xfa\xb3\x24\xe4\xfa\xd6\x75\x94\x55\x85" + "\x80\x8b\x48\x31\xd7\xbc\x3f\xf4\xde\xf0\x8e\x4b\x7a\x9d\xe5\x76\xd2\x65" + "\x86\xce\xc6\x4b\x61\x16", + "\x1a\xe1\x0b\x59\x4f\x09\xe2\x6a\x7e\x90\x2e\xcb\xd0\x60\x06\x91", 1, 96, + 912}, + {96, 256, 128, 2, + "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a\xf3\x33\x88\x86\x04\xf6\xb5\xf0\x47\x39" + "\x17\xc1\x40\x2b\x80\x09\x9d\xca\x5c\xbc\x20\x70\x75\xc0", + "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08", + "\xf3\x33\x88\x86\x00\x00\x00\x00\x00\x00\x4e\x91", + "\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72\x61\x66\x74\x73\x20\x61\x72" + "\x65\x20\x64\x72\x61\x66\x74\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\x73\x20" + "\x76\x61\x6c\x69\x64\x20\x66\x6f\x72\x20\x61\x20\x6d\x61\x78\x69\x6d\x75" + "\x6d\x20\x6f\x66\x20\x73\x69\x78\x20\x6d\x6f\x6e\x74\x68\x73\x20\x61\x6e" + "\x64\x20\x6d\x61\x79\x20\x62\x65\x20\x75\x70\x64\x61\x74\x65\x64\x2c\x20" + "\x72\x65\x70\x6c\x61\x63\x65\x64\x2c\x20\x6f\x72\x20\x6f\x62\x73\x6f\x6c" + "\x65\x74\x65\x64\x20\x62\x79\x20\x6f\x74\x68\x65\x72\x20\x64\x6f\x63\x75" + "\x6d\x65\x6e\x74\x73\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65\x2e" + "\x20\x49\x74\x20\x69\x73\x20\x69\x6e\x61\x70\x70\x72\x6f\x70\x72\x69\x61" + "\x74\x65\x20\x74\x6f\x20\x75\x73\x65\x20\x49\x6e\x74\x65\x72\x6e\x65\x74" + "\x2d\x44\x72\x61\x66\x74\x73\x20\x61\x73\x20\x72\x65\x66\x65\x72\x65\x6e" + "\x63\x65\x20\x6d\x61\x74\x65\x72\x69\x61\x6c\x20\x6f\x72\x20\x74\x6f\x20" + "\x63\x69\x74\x65\x20\x74\x68\x65\x6d\x20\x6f\x74\x68\x65\x72\x20\x74\x68" + "\x61\x6e\x20\x61\x73\x20\x2f\xe2\x80\x9c\x77\x6f\x72\x6b\x20\x69\x6e\x20" + "\x70\x72\x6f\x67\x72\x65\x73\x73\x2e\x2f\xe2\x80\x9d", + "\x64\xa0\x86\x15\x75\x86\x1a\xf4\x60\xf0\x62\xc7\x9b\xe6\x43\xbd\x5e\x80" + "\x5c\xfd\x34\x5c\xf3\x89\xf1\x08\x67\x0a\xc7\x6c\x8c\xb2\x4c\x6c\xfc\x18" + "\x75\x5d\x43\xee\xa0\x9e\xe9\x4e\x38\x2d\x26\xb0\xbd\xb7\xb7\x3c\x32\x1b" + "\x01\x00\xd4\xf0\x3b\x7f\x35\x58\x94\xcf\x33\x2f\x83\x0e\x71\x0b\x97\xce" + "\x98\xc8\xa8\x4a\xbd\x0b\x94\x81\x14\xad\x17\x6e\x00\x8d\x33\xbd\x60\xf9" + "\x82\xb1\xff\x37\xc8\x55\x97\x97\xa0\x6e\xf4\xf0\xef\x61\xc1\x86\x32\x4e" + "\x2b\x35\x06\x38\x36\x06\x90\x7b\x6a\x7c\x02\xb0\xf9\xf6\x15\x7b\x53\xc8" + "\x67\xe4\xb9\x16\x6c\x76\x7b\x80\x4d\x46\xa5\x9b\x52\x16\xcd\xe7\xa4\xe9" + "\x90\x40\xc5\xa4\x04\x33\x22\x5e\xe2\x82\xa1\xb0\xa0\x6c\x52\x3e\xaf\x45" + "\x34\xd7\xf8\x3f\xa1\x15\x5b\x00\x47\x71\x8c\xbc\x54\x6a\x0d\x07\x2b\x04" + "\xb3\x56\x4e\xea\x1b\x42\x22\x73\xf5\x48\x27\x1a\x0b\xb2\x31\x60\x53\xfa" + "\x76\x99\x19\x55\xeb\xd6\x31\x59\x43\x4e\xce\xbb\x4e\x46\x6d\xae\x5a\x10" + "\x73\xa6\x72\x76\x27\x09\x7a\x10\x49\xe6\x17\xd9\x1d\x36\x10\x94\xfa\x68" + "\xf0\xff\x77\x98\x71\x30\x30\x5b\xea\xba\x2e\xda\x04\xdf\x99\x7b\x71\x4d" + "\x6c\x6f\x2c\x29\xa6\xad\x5c\xb4\x02\x2b\x02\x70\x9b", + "\xee\xad\x9d\x67\x89\x0c\xbb\x22\x39\x23\x36\xfe\xa1\x85\x1f\x38", 1, 96, + 2120}, + {96, 256, 128, 3, + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x60\x61" + "\x62\x63\x64\x65\x66\x67\x68\x66\x6a\x6b\x6c\x6d\x6e\x6f", + "\x01\x02\x04\x08\x0b\x0d\x0f\x10\x10\x11\x12\x13", + "\x00\x02\x04\x06\x08\x0a\x0c\x0e\x10\x12\x14\x16", "", "", + "\x32\x08\x45\xb8\x85\xdd\xb5\x81\x74\x36\xe3\x11\x3f\x51\x6d\xbf", 1, 96, + 0}, + {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 2a356074..cbc8439f 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.c TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 76773723a0ff2f7503b649397a8081028c863c43 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 7 Jul 2023 14:32:07 +0100 Subject: [PATCH 044/204] perf: set key size to 24 bytes for 3DES --- perf/ipsec_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 469b69c7..5141903b 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -304,7 +304,7 @@ const struct str_value_mapping cipher_algo_str_map[] = { { .name = "des-docsis4", .values.job_params = { .cipher_mode = TEST_DESDOCSIS4, .key_size = 8 } }, { .name = "des-cbc", .values.job_params = { .cipher_mode = TEST_DES, .key_size = 8 } }, - { .name = "3des-cbc", .values.job_params = { .cipher_mode = TEST_3DES, .key_size = 8 } }, + { .name = "3des-cbc", .values.job_params = { .cipher_mode = TEST_3DES, .key_size = 24 } }, #endif /* __aarch64__ */ { .name = "zuc-eea3", .values.job_params = { .cipher_mode = TEST_ZUC_EEA3, .key_size = 16 } }, -- GitLab From 25a0f5d3e995c5c2882aa7956d64815721f79a4d Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 7 Jul 2023 16:49:21 +0100 Subject: [PATCH 045/204] sse: [QUIC] add endbranch64 for Chacha20 function --- lib/sse_t1/chacha20_sse.asm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/sse_t1/chacha20_sse.asm b/lib/sse_t1/chacha20_sse.asm index 1688c281..528b9e03 100644 --- a/lib/sse_t1/chacha20_sse.asm +++ b/lib/sse_t1/chacha20_sse.asm @@ -30,6 +30,7 @@ %include "include/memcpy.inc" %include "include/clear_regs.inc" %include "include/chacha_poly_defines.inc" +%include "include/cet.inc" mksection .rodata default rel @@ -2923,6 +2924,7 @@ exit_gen: align 32 MKGLOBAL(quic_chacha20_sse,function,internal) quic_chacha20_sse: + endbranch64 %define tmp rax %define off r11 -- GitLab From 510bb68724e0d49a5e471f069dbf11ea15f57182 Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Wed, 12 Jul 2023 14:51:39 +0100 Subject: [PATCH 046/204] test: [CHACHA20-POLY1305] Windows Makefile fix --- test/kat-app/win_x64.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index cbc8439f..b333598b 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.c +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From df56e563bcf2f6cf2c2a14ff93a38b401f78478a Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Wed, 5 Jul 2023 10:44:24 +0100 Subject: [PATCH 047/204] test: [CCM] Unify test vectors --- test/kat-app/CMakeLists.txt | 1 + test/kat-app/Makefile | 2 +- test/kat-app/ccm_test.c | 2375 ++-------------------------------- test/kat-app/ccm_test.json.c | 552 ++++++++ test/kat-app/win_x64.mak | 2 +- 5 files changed, 651 insertions(+), 2281 deletions(-) create mode 100644 test/kat-app/ccm_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index a0bbe69f..4f11a218 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -109,6 +109,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/des_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/gcm_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/chacha20_poly1305_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/ccm_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 46e8c23f..f7d59d01 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -42,7 +42,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ hmac_md5.json.c gmac_test.json.c ghash_test.c ghash_test.json.c poly1305_test.json.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ - des_test.json.c chacha_test.json.c gcm_test.json.c quic_chacha20_test.c \ + des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ diff --git a/test/kat-app/ccm_test.c b/test/kat-app/ccm_test.c index 4f580984..5f78275a 100644 --- a/test/kat-app/ccm_test.c +++ b/test/kat-app/ccm_test.c @@ -34,2140 +34,15 @@ #include #include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "aead_test.h" int ccm_test(struct IMB_MGR *mb_mgr); -/* - * Test vectors from https://tools.ietf.org/html/rfc3610 - */ - -/* - * =============== Packet Vector #1 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 03 02 01 00 A0 A1 A2 A3 A4 A5 - * Total packet length = 31. [Input with 8 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E - * CBC IV in: 59 00 00 00 03 02 01 00 A0 A1 A2 A3 A4 A5 00 17 - * CBC IV out:EB 9D 55 47 73 09 55 AB 23 1E 0A 2D FE 4B 90 D6 - * After xor: EB 95 55 46 71 0A 51 AE 25 19 0A 2D FE 4B 90 D6 [hdr] - * After AES: CD B6 41 1E 3C DC 9B 4F 5D 92 58 B6 9E E7 F0 91 - * After xor: C5 BF 4B 15 30 D1 95 40 4D 83 4A A5 8A F2 E6 86 [msg] - * After AES: 9C 38 40 5E A0 3C 1B C9 04 B5 8B 40 C7 6C A2 EB - * After xor: 84 21 5A 45 BC 21 05 C9 04 B5 8B 40 C7 6C A2 EB [msg] - * After AES: 2D C6 97 E4 11 CA 83 A8 60 C2 C4 06 CC AA 54 2F - * CBC-MAC : 2D C6 97 E4 11 CA 83 A8 - * CTR Start: 01 00 00 00 03 02 01 00 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 50 85 9D 91 6D CB 6D DD E0 77 C2 D1 D4 EC 9F 97 - * CTR[0002]: 75 46 71 7A C6 DE 9A FF 64 0C 9C 06 DE 6D 0D 8F - * CTR[MAC ]: 3A 2E 46 C8 EC 33 A5 48 - * Total packet length = 39. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 58 8C 97 9A 61 C6 63 D2 - * F0 66 D0 C2 C0 F9 89 80 6D 5F 6B 61 DA C3 84 17 - * E8 D1 2C FD F9 26 E0 - */ -static const uint8_t keys_01[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_01[] = { - 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_01[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; -static const uint8_t packet_out_01[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x58, 0x8C, 0x97, 0x9A, 0x61, 0xC6, 0x63, 0xD2, - 0xF0, 0x66, 0xD0, 0xC2, 0xC0, 0xF9, 0x89, 0x80, - 0x6D, 0x5F, 0x6B, 0x61, 0xDA, 0xC3, 0x84, 0x17, - 0xE8, 0xD1, 0x2C, 0xFD, 0xF9, 0x26, 0xE0 -}; -#define clear_len_01 8 -#define auth_len_01 8 - -/* - * =============== Packet Vector #2 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 04 03 02 01 A0 A1 A2 A3 A4 A5 - * Total packet length = 32. [Input with 8 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * CBC IV in: 59 00 00 00 04 03 02 01 A0 A1 A2 A3 A4 A5 00 18 - * CBC IV out:F0 C2 54 D3 CA 03 E2 39 70 BD 24 A8 4C 39 9E 77 - * After xor: F0 CA 54 D2 C8 00 E6 3C 76 BA 24 A8 4C 39 9E 77 [hdr] - * After AES: 48 DE 8B 86 28 EA 4A 40 00 AA 42 C2 95 BF 4A 8C - * After xor: 40 D7 81 8D 24 E7 44 4F 10 BB 50 D1 81 AA 5C 9B [msg] - * After AES: 0F 89 FF BC A6 2B C2 4F 13 21 5F 16 87 96 AA 33 - * After xor: 17 90 E5 A7 BA 36 DC 50 13 21 5F 16 87 96 AA 33 [msg] - * After AES: F7 B9 05 6A 86 92 6C F3 FB 16 3D C4 99 EF AA 11 - * CBC-MAC : F7 B9 05 6A 86 92 6C F3 - * CTR Start: 01 00 00 00 04 03 02 01 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 7A C0 10 3D ED 38 F6 C0 39 0D BA 87 1C 49 91 F4 - * CTR[0002]: D4 0C DE 22 D5 F9 24 24 F7 BE 9A 56 9D A7 9F 51 - * CTR[MAC ]: 57 28 D0 04 96 D2 65 E5 - * Total packet length = 40. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 72 C9 1A 36 E1 35 F8 CF - * 29 1C A8 94 08 5C 87 E3 CC 15 C4 39 C9 E4 3A 3B - * A0 91 D5 6E 10 40 09 16 - */ -static const uint8_t keys_02[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_02[] = { - 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_02[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F -}; -static const uint8_t packet_out_02[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x72, 0xC9, 0x1A, 0x36, 0xE1, 0x35, 0xF8, 0xCF, - 0x29, 0x1C, 0xA8, 0x94, 0x08, 0x5C, 0x87, 0xE3, - 0xCC, 0x15, 0xC4, 0x39, 0xC9, 0xE4, 0x3A, 0x3B, - 0xA0, 0x91, 0xD5, 0x6E, 0x10, 0x40, 0x09, 0x16 -}; -#define clear_len_02 8 -#define auth_len_02 8 - -/* - * =============== Packet Vector #3 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 05 04 03 02 A0 A1 A2 A3 A4 A5 - * Total packet length = 33. [Input with 8 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * 20 - * CBC IV in: 59 00 00 00 05 04 03 02 A0 A1 A2 A3 A4 A5 00 19 - * CBC IV out:6F 8A 12 F7 BF 8D 4D C5 A1 19 6E 95 DF F0 B4 27 - * After xor: 6F 82 12 F6 BD 8E 49 C0 A7 1E 6E 95 DF F0 B4 27 [hdr] - * After AES: 37 E9 B7 8C C2 20 17 E7 33 80 43 0C BE F4 28 24 - * After xor: 3F E0 BD 87 CE 2D 19 E8 23 91 51 1F AA E1 3E 33 [msg] - * After AES: 90 CA 05 13 9F 4D 4E CF 22 6F E9 81 C5 9E 2D 40 - * After xor: 88 D3 1F 08 83 50 50 D0 02 6F E9 81 C5 9E 2D 40 [msg] - * After AES: 73 B4 67 75 C0 26 DE AA 41 03 97 D6 70 FE 5F B0 - * CBC-MAC : 73 B4 67 75 C0 26 DE AA - * CTR Start: 01 00 00 00 05 04 03 02 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 59 B8 EF FF 46 14 73 12 B4 7A 1D 9D 39 3D 3C FF - * CTR[0002]: 69 F1 22 A0 78 C7 9B 89 77 89 4C 99 97 5C 23 78 - * CTR[MAC ]: 39 6E C0 1A 7D B9 6E 6F - * Total packet length = 41. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 51 B1 E5 F4 4A 19 7D 1D - * A4 6B 0F 8E 2D 28 2A E8 71 E8 38 BB 64 DA 85 96 - * 57 4A DA A7 6F BD 9F B0 C5 - */ -static const uint8_t keys_03[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_03[] = { - 0x00, 0x00, 0x00, 0x05, 0x04, 0x03, 0x02, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_03[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20 -}; -static const uint8_t packet_out_03[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x51, 0xB1, 0xE5, 0xF4, 0x4A, 0x19, 0x7D, 0x1D, - 0xA4, 0x6B, 0x0F, 0x8E, 0x2D, 0x28, 0x2A, 0xE8, - 0x71, 0xE8, 0x38, 0xBB, 0x64, 0xDA, 0x85, 0x96, - 0x57, 0x4A, 0xDA, 0xA7, 0x6F, 0xBD, 0x9F, 0xB0, - 0xC5 -}; -#define clear_len_03 8 -#define auth_len_03 8 - -/* - * =============== Packet Vector #4 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 06 05 04 03 A0 A1 A2 A3 A4 A5 - * Total packet length = 31. [Input with 12 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E - * CBC IV in: 59 00 00 00 06 05 04 03 A0 A1 A2 A3 A4 A5 00 13 - * CBC IV out:06 65 2C 60 0E F5 89 63 CA C3 25 A9 CD 3E 2B E1 - * After xor: 06 69 2C 61 0C F6 8D 66 CC C4 2D A0 C7 35 2B E1 [hdr] - * After AES: A0 75 09 AC 15 C2 58 86 04 2F 80 60 54 FE A6 86 - * After xor: AC 78 07 A3 05 D3 4A 95 10 3A 96 77 4C E7 BC 9D [msg] - * After AES: 64 4C 09 90 D9 1B 83 E9 AB 4B 8E ED 06 6F F5 BF - * After xor: 78 51 17 90 D9 1B 83 E9 AB 4B 8E ED 06 6F F5 BF [msg] - * After AES: 4B 4F 4B 39 B5 93 E6 BF B0 B2 C2 B7 0F 29 CD 7A - * CBC-MAC : 4B 4F 4B 39 B5 93 E6 BF - * CTR Start: 01 00 00 00 06 05 04 03 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: AE 81 66 6A 83 8B 88 6A EE BF 4A 5B 32 84 50 8A - * CTR[0002]: D1 B1 92 06 AC 93 9E 2F B6 DD CE 10 A7 74 FD 8D - * CTR[MAC ]: DD 87 2A 80 7C 75 F8 4E - * Total packet length = 39. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 08 09 0A 0B A2 8C 68 65 - * 93 9A 9A 79 FA AA 5C 4C 2A 9D 4A 91 CD AC 8C 96 - * C8 61 B9 C9 E6 1E F1 - */ -static const uint8_t keys_04[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_04[] = { - 0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x03, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_04[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; -static const uint8_t packet_out_04[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0xA2, 0x8C, 0x68, 0x65, - 0x93, 0x9A, 0x9A, 0x79, 0xFA, 0xAA, 0x5C, 0x4C, - 0x2A, 0x9D, 0x4A, 0x91, 0xCD, 0xAC, 0x8C, 0x96, - 0xC8, 0x61, 0xB9, 0xC9, 0xE6, 0x1E, 0xF1 -}; -#define clear_len_04 12 -#define auth_len_04 8 - -/* - * =============== Packet Vector #5 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 07 06 05 04 A0 A1 A2 A3 A4 A5 - * Total packet length = 32. [Input with 12 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * CBC IV in: 59 00 00 00 07 06 05 04 A0 A1 A2 A3 A4 A5 00 14 - * CBC IV out:00 4C 50 95 45 80 3C 48 51 CD E1 3B 56 C8 9A 85 - * After xor: 00 40 50 94 47 83 38 4D 57 CA E9 32 5C C3 9A 85 [hdr] - * After AES: E2 B8 F7 CE 49 B2 21 72 84 A8 EA 84 FA AD 67 5C - * After xor: EE B5 F9 C1 59 A3 33 61 90 BD FC 93 E2 B4 7D 47 [msg] - * After AES: 3E FB 36 72 25 DB 11 01 D3 C2 2F 0E CA FF 44 F3 - * After xor: 22 E6 28 6D 25 DB 11 01 D3 C2 2F 0E CA FF 44 F3 [msg] - * After AES: 48 B9 E8 82 55 05 4A B5 49 0A 95 F9 34 9B 4B 5E - * CBC-MAC : 48 B9 E8 82 55 05 4A B5 - * CTR Start: 01 00 00 00 07 06 05 04 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: D0 FC F5 74 4D 8F 31 E8 89 5B 05 05 4B 7C 90 C3 - * CTR[0002]: 72 A0 D4 21 9F 0D E1 D4 04 83 BC 2D 3D 0C FC 2A - * CTR[MAC ]: 19 51 D7 85 28 99 67 26 - * Total packet length = 40. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 08 09 0A 0B DC F1 FB 7B - * 5D 9E 23 FB 9D 4E 13 12 53 65 8A D8 6E BD CA 3E - * 51 E8 3F 07 7D 9C 2D 93 - */ -static const uint8_t keys_05[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_05[] = { - 0x00, 0x00, 0x00, 0x07, 0x06, 0x05, 0x04, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_05[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F -}; -static const uint8_t packet_out_05[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0xDC, 0xF1, 0xFB, 0x7B, - 0x5D, 0x9E, 0x23, 0xFB, 0x9D, 0x4E, 0x13, 0x12, - 0x53, 0x65, 0x8A, 0xD8, 0x6E, 0xBD, 0xCA, 0x3E, - 0x51, 0xE8, 0x3F, 0x07, 0x7D, 0x9C, 0x2D, 0x93 -}; -#define clear_len_05 12 -#define auth_len_05 8 - -/* - * =============== Packet Vector #6 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 08 07 06 05 A0 A1 A2 A3 A4 A5 - * Total packet length = 33. [Input with 12 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * 20 - * CBC IV in: 59 00 00 00 08 07 06 05 A0 A1 A2 A3 A4 A5 00 15 - * CBC IV out:04 72 DA 4C 6F F6 0A 63 06 52 1A 06 04 80 CD E5 - * After xor: 04 7E DA 4D 6D F5 0E 66 00 55 12 0F 0E 8B CD E5 [hdr] - * After AES: 64 4C 36 A5 A2 27 37 62 0B 89 F1 D7 BF F2 73 D4 - * After xor: 68 41 38 AA B2 36 25 71 1F 9C E7 C0 A7 EB 69 CF [msg] - * After AES: 41 E1 19 CD 19 24 CE 77 F1 2F A6 60 C1 6E BB 4E - * After xor: 5D FC 07 D2 39 24 CE 77 F1 2F A6 60 C1 6E BB 4E [msg] - * After AES: A5 27 D8 15 6A C3 59 BF 1C B8 86 E6 2F 29 91 29 - * CBC-MAC : A5 27 D8 15 6A C3 59 BF - * CTR Start: 01 00 00 00 08 07 06 05 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 63 CC BE 1E E0 17 44 98 45 64 B2 3A 8D 24 5C 80 - * CTR[0002]: 39 6D BA A2 A7 D2 CB D4 B5 E1 7C 10 79 45 BB C0 - * CTR[MAC ]: E5 7D DC 56 C6 52 92 2B - * Total packet length = 41. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 6F C1 B0 11 - * F0 06 56 8B 51 71 A4 2D 95 3D 46 9B 25 70 A4 BD - * 87 40 5A 04 43 AC 91 CB 94 - */ -static const uint8_t keys_06[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_06[] = { - 0x00, 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_06[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20 -}; -static const uint8_t packet_out_06[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x6F, 0xC1, 0xB0, 0x11, - 0xF0, 0x06, 0x56, 0x8B, 0x51, 0x71, 0xA4, 0x2D, - 0x95, 0x3D, 0x46, 0x9B, 0x25, 0x70, 0xA4, 0xBD, - 0x87, 0x40, 0x5A, 0x04, 0x43, 0xAC, 0x91, 0xCB, - 0x94 -}; -#define clear_len_06 12 -#define auth_len_06 8 - -/* - * =============== Packet Vector #7 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 09 08 07 06 A0 A1 A2 A3 A4 A5 - * Total packet length = 31. [Input with 8 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E - * CBC IV in: 61 00 00 00 09 08 07 06 A0 A1 A2 A3 A4 A5 00 17 - * CBC IV out:60 06 C5 72 DA 23 9C BF A0 5B 0A DE D2 CD A8 1E - * After xor: 60 0E C5 73 D8 20 98 BA A6 5C 0A DE D2 CD A8 1E [hdr] - * After AES: 41 7D E2 AE 94 E2 EA D9 00 FC 44 FC D0 69 52 27 - * After xor: 49 74 E8 A5 98 EF E4 D6 10 ED 56 EF C4 7C 44 30 [msg] - * After AES: 2A 6C 42 CA 49 D7 C7 01 C5 7D 59 FF 87 16 49 0E - * After xor: 32 75 58 D1 55 CA D9 01 C5 7D 59 FF 87 16 49 0E [msg] - * After AES: 89 8B D6 45 4E 27 20 BB D2 7E F3 15 7A 7C 90 B2 - * CBC-MAC : 89 8B D6 45 4E 27 20 BB D2 7E - * CTR Start: 01 00 00 00 09 08 07 06 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 09 3C DB B9 C5 52 4F DA C1 C5 EC D2 91 C4 70 AF - * CTR[0002]: 11 57 83 86 E2 C4 72 B4 8E CC 8A AD AB 77 6F CB - * CTR[MAC ]: 8D 07 80 25 62 B0 8C 00 A6 EE - * Total packet length = 41. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 01 35 D1 B2 C9 5F 41 D5 - * D1 D4 FE C1 85 D1 66 B8 09 4E 99 9D FE D9 6C 04 - * 8C 56 60 2C 97 AC BB 74 90 - */ -static const uint8_t keys_07[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_07[] = { - 0x00, 0x00, 0x00, 0x09, 0x08, 0x07, 0x06, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_07[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; -static const uint8_t packet_out_07[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x01, 0x35, 0xD1, 0xB2, 0xC9, 0x5F, 0x41, 0xD5, - 0xD1, 0xD4, 0xFE, 0xC1, 0x85, 0xD1, 0x66, 0xB8, - 0x09, 0x4E, 0x99, 0x9D, 0xFE, 0xD9, 0x6C, 0x04, - 0x8C, 0x56, 0x60, 0x2C, 0x97, 0xAC, 0xBB, 0x74, - 0x90 -}; -#define clear_len_07 8 -#define auth_len_07 10 - -/* - * =============== Packet Vector #8 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 0A 09 08 07 A0 A1 A2 A3 A4 A5 - * Total packet length = 32. [Input with 8 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * CBC IV in: 61 00 00 00 0A 09 08 07 A0 A1 A2 A3 A4 A5 00 18 - * CBC IV out:63 A3 FA E4 6C 79 F3 FA 78 38 B8 A2 80 36 B6 0B - * After xor: 63 AB FA E5 6E 7A F7 FF 7E 3F B8 A2 80 36 B6 0B [hdr] - * After AES: 1C 99 1A 3D B7 60 79 27 34 40 79 1F AD 8B 5B 02 - * After xor: 14 90 10 36 BB 6D 77 28 24 51 6B 0C B9 9E 4D 15 [msg] - * After AES: 14 19 E8 E8 CB BE 75 58 E1 E3 BE 4B 6C 9F 82 E3 - * After xor: 0C 00 F2 F3 D7 A3 6B 47 E1 E3 BE 4B 6C 9F 82 E3 [msg] - * After AES: E0 16 E8 1C 7F 7B 8A 38 A5 38 F2 CB 5B B6 C1 F2 - * CBC-MAC : E0 16 E8 1C 7F 7B 8A 38 A5 38 - * CTR Start: 01 00 00 00 0A 09 08 07 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 73 7C 33 91 CC 8E 13 DD E0 AA C5 4B 6D B7 EB 98 - * CTR[0002]: 74 B7 71 77 C5 AA C5 3B 04 A4 F8 70 8E 92 EB 2B - * CTR[MAC ]: 21 6D AC 2F 8B 4F 1C 07 91 8C - * Total packet length = 42. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 7B 75 39 9A C0 83 1D D2 - * F0 BB D7 58 79 A2 FD 8F 6C AE 6B 6C D9 B7 DB 24 - * C1 7B 44 33 F4 34 96 3F 34 B4 - */ -static const uint8_t keys_08[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_08[] = { - 0x00, 0x00, 0x00, 0x0a, 0x09, 0x08, 0x07, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_08[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F -}; -static const uint8_t packet_out_08[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x7B, 0x75, 0x39, 0x9A, 0xC0, 0x83, 0x1D, 0xD2, - 0xF0, 0xBB, 0xD7, 0x58, 0x79, 0xA2, 0xFD, 0x8F, - 0x6C, 0xAE, 0x6B, 0x6C, 0xD9, 0xB7, 0xDB, 0x24, - 0xC1, 0x7B, 0x44, 0x33, 0xF4, 0x34, 0x96, 0x3F, - 0x34, 0xB4 -}; -#define clear_len_08 8 -#define auth_len_08 10 - -/* - * =============== Packet Vector #9 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 0B 0A 09 08 A0 A1 A2 A3 A4 A5 - * Total packet length = 33. [Input with 8 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * 20 - * CBC IV in: 61 00 00 00 0B 0A 09 08 A0 A1 A2 A3 A4 A5 00 19 - * CBC IV out:4F 2C 86 11 1E 08 2A DD 6B 44 21 3A B5 13 13 16 - * After xor: 4F 24 86 10 1C 0B 2E D8 6D 43 21 3A B5 13 13 16 [hdr] - * After AES: F6 EC 56 87 3C 57 12 DC 9C C5 3C A8 D4 D1 ED 0A - * After xor: FE E5 5C 8C 30 5A 1C D3 8C D4 2E BB C0 C4 FB 1D [msg] - * After AES: 17 C1 80 A5 31 53 D4 C3 03 85 0C 95 65 80 34 52 - * After xor: 0F D8 9A BE 2D 4E CA DC 23 85 0C 95 65 80 34 52 [msg] - * After AES: 46 A1 F6 E2 B1 6E 75 F8 1C F5 6B 1A 80 04 44 1B - * CBC-MAC : 46 A1 F6 E2 B1 6E 75 F8 1C F5 - * CTR Start: 01 00 00 00 0B 0A 09 08 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 8A 5A 10 6B C0 29 9A 55 5B 93 6B 0B 0E A0 DE 5A - * CTR[0002]: EA 05 FD E2 AB 22 5C FE B7 73 12 CB 88 D9 A5 4A - * CTR[MAC ]: AC 3D F1 07 DA 30 C4 86 43 BB - * Total packet length = 43. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 82 53 1A 60 CC 24 94 5A - * 4B 82 79 18 1A B5 C8 4D F2 1C E7 F9 B7 3F 42 E1 - * 97 EA 9C 07 E5 6B 5E B1 7E 5F 4E - */ -static const uint8_t keys_09[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_09[] = { - 0x00, 0x00, 0x00, 0x0b, 0x0a, 0x09, 0x08, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_09[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20 -}; -static const uint8_t packet_out_09[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x82, 0x53, 0x1A, 0x60, 0xCC, 0x24, 0x94, 0x5A, - 0x4B, 0x82, 0x79, 0x18, 0x1A, 0xB5, 0xC8, 0x4D, - 0xF2, 0x1C, 0xE7, 0xF9, 0xB7, 0x3F, 0x42, 0xE1, - 0x97, 0xEA, 0x9C, 0x07, 0xE5, 0x6B, 0x5E, 0xB1, - 0x7E, 0x5F, 0x4E -}; -#define clear_len_09 8 -#define auth_len_09 10 - -/* - * =============== Packet Vector #10 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 0C 0B 0A 09 A0 A1 A2 A3 A4 A5 - * Total packet length = 31. [Input with 12 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E - * CBC IV in: 61 00 00 00 0C 0B 0A 09 A0 A1 A2 A3 A4 A5 00 13 - * CBC IV out:7F B8 0A 32 E9 80 57 46 EC 31 6C 3A B2 A2 EB 5D - * After xor: 7F B4 0A 33 EB 83 53 43 EA 36 64 33 B8 A9 EB 5D [hdr] - * After AES: 7E 96 96 BF F1 56 D6 A8 6E AC F5 7B 7F 23 47 5A - * After xor: 72 9B 98 B0 E1 47 C4 BB 7A B9 E3 6C 67 3A 5D 41 [msg] - * After AES: 8B 4A EE 42 04 24 8A 59 FA CC 88 66 57 66 DD 72 - * After xor: 97 57 F0 42 04 24 8A 59 FA CC 88 66 57 66 DD 72 [msg] - * After AES: 41 63 89 36 62 ED D7 EB CD 6E 15 C1 89 48 62 05 - * CBC-MAC : 41 63 89 36 62 ED D7 EB CD 6E - * CTR Start: 01 00 00 00 0C 0B 0A 09 A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 0B 39 2B 9B 05 66 97 06 3F 12 56 8F 2B 13 A1 0F - * CTR[0002]: 07 89 65 25 23 40 94 3B 9E 69 B2 56 CC 5E F7 31 - * CTR[MAC ]: 17 09 20 76 09 A0 4E 72 45 B3 - * Total packet length = 41. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 07 34 25 94 - * 15 77 85 15 2B 07 40 98 33 0A BB 14 1B 94 7B 56 - * 6A A9 40 6B 4D 99 99 88 DD - */ -static const uint8_t keys_10[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_10[] = { - 0x00, 0x00, 0x00, 0x0c, 0x0b, 0x0a, 0x09, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_10[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; -static const uint8_t packet_out_10[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x07, 0x34, 0x25, 0x94, - 0x15, 0x77, 0x85, 0x15, 0x2B, 0x07, 0x40, 0x98, - 0x33, 0x0A, 0xBB, 0x14, 0x1B, 0x94, 0x7B, 0x56, - 0x6A, 0xA9, 0x40, 0x6B, 0x4D, 0x99, 0x99, 0x88, - 0xDD -}; -#define clear_len_10 12 -#define auth_len_10 10 - -/* - * =============== Packet Vector #11 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 0D 0C 0B 0A A0 A1 A2 A3 A4 A5 - * Total packet length = 32. [Input with 12 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * CBC IV in: 61 00 00 00 0D 0C 0B 0A A0 A1 A2 A3 A4 A5 00 14 - * CBC IV out:B0 84 85 79 51 D2 FA 42 76 EF 3A D7 14 B9 62 87 - * After xor: B0 88 85 78 53 D1 FE 47 70 E8 32 DE 1E B2 62 87 [hdr] - * After AES: C9 B3 64 7E D8 79 2A 5C 65 B7 CE CC 19 0A 97 0A - * After xor: C5 BE 6A 71 C8 68 38 4F 71 A2 D8 DB 01 13 8D 11 [msg] - * After AES: 34 0F 69 17 FA B9 19 D6 1D AC D0 35 36 D6 55 8B - * After xor: 28 12 77 08 FA B9 19 D6 1D AC D0 35 36 D6 55 8B [msg] - * After AES: 6B 5E 24 34 12 CC C2 AD 6F 1B 11 C3 A1 A9 D8 BC - * CBC-MAC : 6B 5E 24 34 12 CC C2 AD 6F 1B - * CTR Start: 01 00 00 00 0D 0C 0B 0A A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: 6B 66 BC 0C 90 A1 F1 12 FC BE 6F 4E 12 20 77 BC - * CTR[0002]: 97 9E 57 2B BE 65 8A E5 CC 20 11 83 2A 9A 9B 5B - * CTR[MAC ]: 9E 64 86 DD 02 B6 49 C1 6D 37 - * Total packet length = 42. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 67 6B B2 03 - * 80 B0 E3 01 E8 AB 79 59 0A 39 6D A7 8B 83 49 34 - * F5 3A A2 E9 10 7A 8B 6C 02 2C - */ -static const uint8_t keys_11[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_11[] = { - 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x0b, 0x0a, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_11[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F -}; -static const uint8_t packet_out_11[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x67, 0x6B, 0xB2, 0x03, - 0x80, 0xB0, 0xE3, 0x01, 0xE8, 0xAB, 0x79, 0x59, - 0x0A, 0x39, 0x6D, 0xA7, 0x8B, 0x83, 0x49, 0x34, - 0xF5, 0x3A, 0xA2, 0xE9, 0x10, 0x7A, 0x8B, 0x6C, - 0x02, 0x2C -}; -#define clear_len_11 12 -#define auth_len_11 10 - -/* - * =============== Packet Vector #12 ================== - * AES Key = C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - * Nonce = 00 00 00 0E 0D 0C 0B A0 A1 A2 A3 A4 A5 - * Total packet length = 33. [Input with 12 cleartext header octets] - * 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - * 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F - * 20 - * CBC IV in: 61 00 00 00 0E 0D 0C 0B A0 A1 A2 A3 A4 A5 00 15 - * CBC IV out:5F 8E 8D 02 AD 95 7C 5A 36 14 CF 63 40 16 97 4F - * After xor: 5F 82 8D 03 AF 96 78 5F 30 13 C7 6A 4A 1D 97 4F [hdr] - * After AES: 63 FA BD 69 B9 55 65 FF 54 AA F4 60 88 7D EC 9F - * After xor: 6F F7 B3 66 A9 44 77 EC 40 BF E2 77 90 64 F6 84 [msg] - * After AES: 5A 76 5F 0B 93 CE 4F 6A B4 1D 91 30 18 57 6A D7 - * After xor: 46 6B 41 14 B3 CE 4F 6A B4 1D 91 30 18 57 6A D7 [msg] - * After AES: 9D 66 92 41 01 08 D5 B6 A1 45 85 AC AF 86 32 E8 - * CBC-MAC : 9D 66 92 41 01 08 D5 B6 A1 45 - * CTR Start: 01 00 00 00 0E 0D 0C 0B A0 A1 A2 A3 A4 A5 00 01 - * CTR[0001]: CC F2 AE D9 E0 4A C9 74 E6 58 55 B3 2B 94 30 BF - * CTR[0002]: A2 CA AC 11 63 F4 07 E5 E5 F6 E3 B3 79 0F 79 F8 - * CTR[MAC ]: 50 7C 31 57 63 EF 78 D3 77 9E - * Total packet length = 43. [Authenticated and Encrypted Output] - * 00 01 02 03 04 05 06 07 08 09 0A 0B C0 FF A0 D6 - * F0 5B DB 67 F2 4D 43 A4 33 8D 2A A4 BE D7 B2 0E - * 43 CD 1A A3 16 62 E7 AD 65 D6 DB - */ -static const uint8_t keys_12[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_12[] = { - 0x00, 0x00, 0x00, 0x0e, 0x0d, 0x0c, 0x0b, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_12[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20 -}; -static const uint8_t packet_out_12[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0xC0, 0xFF, 0xA0, 0xD6, - 0xF0, 0x5B, 0xDB, 0x67, 0xF2, 0x4D, 0x43, 0xA4, - 0x33, 0x8D, 0x2A, 0xA4, 0xBE, 0xD7, 0xB2, 0x0E, - 0x43, 0xCD, 0x1A, 0xA3, 0x16, 0x62, 0xE7, 0xAD, - 0x65, 0xD6, 0xDB -}; -#define clear_len_12 12 -#define auth_len_12 10 - -/* - * =============== Packet Vector #13 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 41 2B 4E A9 CD BE 3C 96 96 76 6C FA - * Total packet length = 31. [Input with 8 cleartext header octets] - * 0B E1 A8 8B AC E0 18 B1 08 E8 CF 97 D8 20 EA 25 - * 84 60 E9 6A D9 CF 52 89 05 4D 89 5C EA C4 7C - * CBC IV in: 59 00 41 2B 4E A9 CD BE 3C 96 96 76 6C FA 00 17 - * CBC IV out:33 AE C3 1A 1F B7 CC 35 E5 DA D2 BA C0 90 D9 A3 - * After xor: 33 A6 C8 FB B7 3C 60 D5 FD 6B D2 BA C0 90 D9 A3 [hdr] - * After AES: B7 56 CA 1E 5B 42 C6 9C 58 E3 0A F5 2B F7 7C FD - * After xor: BF BE 05 89 83 62 2C B9 DC 83 E3 9F F2 38 2E 74 [msg] - * After AES: 33 3D 3A 3D 07 B5 3C 7B 22 0E 96 1A 18 A9 A1 9E - * After xor: 36 70 B3 61 ED 71 40 7B 22 0E 96 1A 18 A9 A1 9E [msg] - * After AES: 14 BD DB 6B F9 01 63 4D FB 56 51 83 BC 74 93 F7 - * CBC-MAC : 14 BD DB 6B F9 01 63 4D - * CTR Start: 01 00 41 2B 4E A9 CD BE 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 44 51 B0 11 7A 84 82 BF 03 19 AE C1 59 5E BD DA - * CTR[0002]: 83 EB 76 E1 3A 44 84 7F 92 20 09 07 76 B8 25 C5 - * CTR[MAC ]: F3 31 2C A0 F5 DC B4 FE - * Total packet length = 39. [Authenticated and Encrypted Output] - * 0B E1 A8 8B AC E0 18 B1 4C B9 7F 86 A2 A4 68 9A - * 87 79 47 AB 80 91 EF 53 86 A6 FF BD D0 80 F8 E7 - * 8C F7 CB 0C DD D7 B3 - */ -static const uint8_t keys_13[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_13[] = { - 0x00, 0x41, 0x2b, 0x4e, 0xa9, 0xcd, 0xbe, 0x3c, - 0x96, 0x96, 0x76, 0x6c, 0xfa -}; -static const uint8_t packet_in_13[] = { - 0x0B, 0xE1, 0xA8, 0x8B, 0xAC, 0xE0, 0x18, 0xB1, - 0x08, 0xE8, 0xCF, 0x97, 0xD8, 0x20, 0xEA, 0x25, - 0x84, 0x60, 0xE9, 0x6A, 0xD9, 0xCF, 0x52, 0x89, - 0x05, 0x4D, 0x89, 0x5C, 0xEA, 0xC4, 0x7C -}; -static const uint8_t packet_out_13[] = { - 0x0B, 0xE1, 0xA8, 0x8B, 0xAC, 0xE0, 0x18, 0xB1, - 0x4C, 0xB9, 0x7F, 0x86, 0xA2, 0xA4, 0x68, 0x9A, - 0x87, 0x79, 0x47, 0xAB, 0x80, 0x91, 0xEF, 0x53, - 0x86, 0xA6, 0xFF, 0xBD, 0xD0, 0x80, 0xF8, 0xE7, - 0x8C, 0xF7, 0xCB, 0x0C, 0xDD, 0xD7, 0xB3 -}; -#define clear_len_13 8 -#define auth_len_13 8 - -/* - * =============== Packet Vector #14 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 33 56 8E F7 B2 63 3C 96 96 76 6C FA - * Total packet length = 32. [Input with 8 cleartext header octets] - * 63 01 8F 76 DC 8A 1B CB 90 20 EA 6F 91 BD D8 5A - * FA 00 39 BA 4B AF F9 BF B7 9C 70 28 94 9C D0 EC - * CBC IV in: 59 00 33 56 8E F7 B2 63 3C 96 96 76 6C FA 00 18 - * CBC IV out:42 0D B1 50 BB 0C 44 DA 83 E4 52 09 55 99 67 E3 - * After xor: 42 05 D2 51 34 7A 98 50 98 2F 52 09 55 99 67 E3 [hdr] - * After AES: EA D1 CA 56 02 02 09 5C E6 12 B0 D2 18 A0 DD 44 - * After xor: 7A F1 20 39 93 BF D1 06 1C 12 89 68 53 0F 24 FB [msg] - * After AES: 51 77 41 69 C3 DE 6B 24 13 27 74 90 F5 FF C5 62 - * After xor: E6 EB 31 41 57 42 BB C8 13 27 C5 62 [msg] - * After AES: D4 CC 3B 82 DF 9F CC 56 7E E5 83 61 D7 8D FB 5E - * CBC-MAC : D4 CC 3B 82 DF 9F CC 56 - * CTR Start: 01 00 33 56 8E F7 B2 63 3C 96 96 76 6C FA 00 01 - * CTR[0001]: DC EB F4 13 38 3C 66 A0 5A 72 55 EF 98 D7 FF AD - * CTR[0002]: 2F 54 2C BA 15 D6 6C DF E1 EC 46 8F 0E 68 A1 24 - * CTR[MAC ]: 11 E2 D3 9F A2 E8 0C DC - * Total packet length = 40. [Authenticated and Encrypted Output] - * 63 01 8F 76 DC 8A 1B CB 4C CB 1E 7C A9 81 BE FA - * A0 72 6C 55 D3 78 06 12 98 C8 5C 92 81 4A BC 33 - * C5 2E E8 1D 7D 77 C0 8A - */ -static const uint8_t keys_14[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_14[] = { - 0x00, 0x33, 0x56, 0x8E, 0xF7, 0xB2, 0x63, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_14[] = { - 0x63, 0x01, 0x8F, 0x76, 0xDC, 0x8A, 0x1B, 0xCB, - 0x90, 0x20, 0xEA, 0x6F, 0x91, 0xBD, 0xD8, 0x5A, - 0xFA, 0x00, 0x39, 0xBA, 0x4B, 0xAF, 0xF9, 0xBF, - 0xB7, 0x9C, 0x70, 0x28, 0x94, 0x9C, 0xD0, 0xEC, -}; -static const uint8_t packet_out_14[] = { - 0x63, 0x01, 0x8F, 0x76, 0xDC, 0x8A, 0x1B, 0xCB, - 0x4C, 0xCB, 0x1E, 0x7C, 0xA9, 0x81, 0xBE, 0xFA, - 0xA0, 0x72, 0x6C, 0x55, 0xD3, 0x78, 0x06, 0x12, - 0x98, 0xC8, 0x5C, 0x92, 0x81, 0x4A, 0xBC, 0x33, - 0xC5, 0x2E, 0xE8, 0x1D, 0x7D, 0x77, 0xC0, 0x8A -}; -#define clear_len_14 8 -#define auth_len_14 8 - -/* - * =============== Packet Vector #15 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 10 3F E4 13 36 71 3C 96 96 76 6C FA - * Total packet length = 33. [Input with 8 cleartext header octets] - * AA 6C FA 36 CA E8 6B 40 B9 16 E0 EA CC 1C 00 D7 - * DC EC 68 EC 0B 3B BB 1A 02 DE 8A 2D 1A A3 46 13 - * 2E - * CBC IV in: 59 00 10 3F E4 13 36 71 3C 96 96 76 6C FA 00 19 - * CBC IV out:B3 26 49 FF D5 9F 56 0F 02 2D 11 E2 62 C5 BE EA - * After xor: B3 2E E3 93 2F A9 9C E7 69 6D 11 E2 62 C5 BE EA [hdr] - * After AES: 82 50 9E E5 B2 FF DB CA 9B D0 2E 20 6B 3F B7 AD - * After xor: 3B 46 7E 0F 7E E3 DB 1D 47 3C 46 CC 60 04 0C B7 [msg] - * After AES: 80 46 0E 4C 08 3A D0 3F B9 A9 13 BE E4 DE 2F 66 - * After xor: 82 98 84 61 12 99 96 2C 97 A9 13 BE E4 DE 2F 66 [msg] - * After AES: 47 29 CB 00 31 F1 81 C1 92 68 4B 89 A4 71 50 E7 - * CBC-MAC : 47 29 CB 00 31 F1 81 C1 - * CTR Start: 01 00 10 3F E4 13 36 71 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 08 C4 DA C8 EC C1 C0 7B 4C E1 F2 4C 37 5A 47 EE - * CTR[0002]: A7 87 2E 6C 6D C4 4E 84 26 02 50 4C 3F A5 73 C5 - * CTR[MAC ]: E0 5F B2 6E EA 83 B4 C7 - * Total packet length = 41. [Authenticated and Encrypted Output] - * AA 6C FA 36 CA E8 6B 40 B1 D2 3A 22 20 DD C0 AC - * 90 0D 9A A0 3C 61 FC F4 A5 59 A4 41 77 67 08 97 - * 08 A7 76 79 6E DB 72 35 06 - */ -static const uint8_t keys_15[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_15[] = { - 0x00, 0x10, 0x3F, 0xE4, 0x13, 0x36, 0x71, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_15[] = { - 0xAA, 0x6C, 0xFA, 0x36, 0xCA, 0xE8, 0x6B, 0x40, - 0xB9, 0x16, 0xE0, 0xEA, 0xCC, 0x1C, 0x00, 0xD7, - 0xDC, 0xEC, 0x68, 0xEC, 0x0B, 0x3B, 0xBB, 0x1A, - 0x02, 0xDE, 0x8A, 0x2D, 0x1A, 0xA3, 0x46, 0x13, - 0x2E -}; -static const uint8_t packet_out_15[] = { - 0xAA, 0x6C, 0xFA, 0x36, 0xCA, 0xE8, 0x6B, 0x40, - 0xB1, 0xD2, 0x3A, 0x22, 0x20, 0xDD, 0xC0, 0xAC, - 0x90, 0x0D, 0x9A, 0xA0, 0x3C, 0x61, 0xFC, 0xF4, - 0xA5, 0x59, 0xA4, 0x41, 0x77, 0x67, 0x08, 0x97, - 0x08, 0xA7, 0x76, 0x79, 0x6E, 0xDB, 0x72, 0x35, - 0x06 -}; -#define clear_len_15 8 -#define auth_len_15 8 - -/* - * =============== Packet Vector #16 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 76 4C 63 B8 05 8E 3C 96 96 76 6C FA - * Total packet length = 31. [Input with 12 cleartext header octets] - * D0 D0 73 5C 53 1E 1B EC F0 49 C2 44 12 DA AC 56 - * 30 EF A5 39 6F 77 0C E1 A6 6B 21 F7 B2 10 1C - * CBC IV in: 59 00 76 4C 63 B8 05 8E 3C 96 96 76 6C FA 00 13 - * CBC IV out:AB DC 4E C9 AA 72 33 97 DF 2D AD 76 33 DE 3B 0D - * After xor: AB D0 9E 19 D9 2E 60 89 C4 C1 5D 3F F1 9A 3B 0D [hdr] - * After AES: 62 86 F6 2F 23 42 63 B0 1C FD 8C 37 40 74 81 EB - * After xor: 70 5C 5A 79 13 AD C6 89 73 8A 80 D6 E6 1F A0 1C [msg] - * After AES: 88 95 84 18 CF 79 CA BE EB C0 0C C4 86 E6 01 F7 - * After xor: 3A 85 98 18 CF 79 CA BE EB C0 0C C4 86 E6 01 F7 [msg] - * After AES: C1 85 92 D9 84 CD 67 80 63 D1 D9 6D C1 DF A1 11 - * CBC-MAC : C1 85 92 D9 84 CD 67 80 - * CTR Start: 01 00 76 4C 63 B8 05 8E 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 06 08 FF 95 A6 94 D5 59 F4 0B B7 9D EF FA 41 DF - * CTR[0002]: 80 55 3A 75 78 38 04 A9 64 8B 68 DD 7F DC DD 7A - * CTR[MAC ]: 5B EA DB 4E DF 07 B9 2F - * Total packet length = 39. [Authenticated and Encrypted Output] - * D0 D0 73 5C 53 1E 1B EC F0 49 C2 44 14 D2 53 C3 - * 96 7B 70 60 9B 7C BB 7C 49 91 60 28 32 45 26 9A - * 6F 49 97 5B CA DE AF - */ -static const uint8_t keys_16[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_16[] = { - 0x00, 0x76, 0x4C, 0x63, 0xB8, 0x05, 0x8E, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_16[] = { - 0xD0, 0xD0, 0x73, 0x5C, 0x53, 0x1E, 0x1B, 0xEC, - 0xF0, 0x49, 0xC2, 0x44, 0x12, 0xDA, 0xAC, 0x56, - 0x30, 0xEF, 0xA5, 0x39, 0x6F, 0x77, 0x0C, 0xE1, - 0xA6, 0x6B, 0x21, 0xF7, 0xB2, 0x10, 0x1C -}; -static const uint8_t packet_out_16[] = { - 0xD0, 0xD0, 0x73, 0x5C, 0x53, 0x1E, 0x1B, 0xEC, - 0xF0, 0x49, 0xC2, 0x44, 0x14, 0xD2, 0x53, 0xC3, - 0x96, 0x7B, 0x70, 0x60, 0x9B, 0x7C, 0xBB, 0x7C, - 0x49, 0x91, 0x60, 0x28, 0x32, 0x45, 0x26, 0x9A, - 0x6F, 0x49, 0x97, 0x5B, 0xCA, 0xDE, 0xAF -}; -#define clear_len_16 12 -#define auth_len_16 8 - -/* - * =============== Packet Vector #17 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 F8 B6 78 09 4E 3B 3C 96 96 76 6C FA - * Total packet length = 32. [Input with 12 cleartext header octets] - * 77 B6 0F 01 1C 03 E1 52 58 99 BC AE E8 8B 6A 46 - * C7 8D 63 E5 2E B8 C5 46 EF B5 DE 6F 75 E9 CC 0D -* CBC IV in: 59 00 F8 B6 78 09 4E 3B 3C 96 96 76 6C FA 00 14 - * CBC IV out:F4 68 FE 5D B1 53 0B 7A 5A A5 FB 27 40 CF 6E 33 - * After xor: F4 64 89 EB BE 52 17 79 BB F7 A3 BE FC 61 6E 33 [hdr] - * After AES: 23 29 0E 0B 33 45 9A 83 32 2D E4 06 86 67 10 04 - * After xor: CB A2 64 4D F4 C8 F9 66 1C 95 21 40 69 D2 CE 6B [msg] - * After AES: 8F BE D4 0F 8B 89 B7 B8 20 D5 5F E0 3C E2 43 11 - * After xor: FA 57 18 02 8B 89 B7 B8 20 D5 5F E0 3C E2 43 11 [msg] - * After AES: 6A DB 15 B6 71 81 B2 E2 2B E3 4A F2 B2 83 E2 29 - * CBC-MAC : 6A DB 15 B6 71 81 B2 E2 - * CTR Start: 01 00 F8 B6 78 09 4E 3B 3C 96 96 76 6C FA 00 01 - * CTR[0001]: BD CE 95 5C CF D3 81 0A 91 EA 77 A6 A4 5B C0 4C - * CTR[0002]: 43 2E F2 32 AE 36 D8 92 22 BF 63 37 E6 B2 6C E8 - * CTR[MAC ]: 1C F7 19 C1 35 7F CC DE - * Total packet length = 40. [Authenticated and Encrypted Output] - * 77 B6 0F 01 1C 03 E1 52 58 99 BC AE 55 45 FF 1A - * 08 5E E2 EF BF 52 B2 E0 4B EE 1E 23 36 C7 3E 3F - * 76 2C 0C 77 44 FE 7E 3C - */ -static const uint8_t keys_17[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_17[] = { - 0x00, 0xF8, 0xB6, 0x78, 0x09, 0x4E, 0x3B, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_17[] = { - 0x77, 0xB6, 0x0F, 0x01, 0x1C, 0x03, 0xE1, 0x52, - 0x58, 0x99, 0xBC, 0xAE, 0xE8, 0x8B, 0x6A, 0x46, - 0xC7, 0x8D, 0x63, 0xE5, 0x2E, 0xB8, 0xC5, 0x46, - 0xEF, 0xB5, 0xDE, 0x6F, 0x75, 0xE9, 0xCC, 0x0D -}; -static const uint8_t packet_out_17[] = { - 0x77, 0xB6, 0x0F, 0x01, 0x1C, 0x03, 0xE1, 0x52, - 0x58, 0x99, 0xBC, 0xAE, 0x55, 0x45, 0xFF, 0x1A, - 0x08, 0x5E, 0xE2, 0xEF, 0xBF, 0x52, 0xB2, 0xE0, - 0x4B, 0xEE, 0x1E, 0x23, 0x36, 0xC7, 0x3E, 0x3F, - 0x76, 0x2C, 0x0C, 0x77, 0x44, 0xFE, 0x7E, 0x3C -}; -#define clear_len_17 12 -#define auth_len_17 8 - -/* - * =============== Packet Vector #18 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 D5 60 91 2D 3F 70 3C 96 96 76 6C FA - * Total packet length = 33. [Input with 12 cleartext header octets] - * CD 90 44 D2 B7 1F DB 81 20 EA 60 C0 64 35 AC BA - * FB 11 A8 2E 2F 07 1D 7C A4 A5 EB D9 3A 80 3B A8 - * 7F - * CBC IV in: 59 00 D5 60 91 2D 3F 70 3C 96 96 76 6C FA 00 15 - * CBC IV out:BA 37 74 54 D7 20 A4 59 25 97 F6 A3 D1 D6 BA 67 - * After xor: BA 3B B9 C4 93 F2 13 46 FE 16 D6 49 B1 16 BA 67 [hdr] - * After AES: 81 6A 20 20 38 D0 A6 30 CB E0 B7 3C 39 BB CE 05 - * After xor: E5 5F 8C 9A C3 C1 0E 1E E4 E7 AA 40 9D 1E 25 DC [msg] - * After AES: 6D 5C 15 FD 85 2D 5C 3C E3 03 3D 85 DA 57 BD AC - * After xor: 57 DC 2E 55 FA 2D 5C 3C E3 03 3D 85 DA 57 BD AC [msg] - * After AES: B0 4A 1C 23 BC 39 B6 51 76 FD 5B FF 9B C1 28 5E - * CBC-MAC : B0 4A 1C 23 BC 39 B6 51 - * CTR Start: 01 00 D5 60 91 2D 3F 70 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 64 A2 C5 56 50 CE E0 4C 7A 93 D8 EE F5 43 E8 8E - * CTR[0002]: 18 E7 65 AC B7 B0 E9 AF 09 2B D0 20 6C A1 C8 3C - * CTR[MAC ]: F7 43 82 79 5C 49 F3 00 - * Total packet length = 41. [Authenticated and Encrypted Output] - * CD 90 44 D2 B7 1F DB 81 20 EA 60 C0 00 97 69 EC - * AB DF 48 62 55 94 C5 92 51 E6 03 57 22 67 5E 04 - * C8 47 09 9E 5A E0 70 45 51 - */ -static const uint8_t keys_18[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_18[] = { - 0x00, 0xD5, 0x60, 0x91, 0x2D, 0x3F, 0x70, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_18[] = { - 0xCD, 0x90, 0x44, 0xD2, 0xB7, 0x1F, 0xDB, 0x81, - 0x20, 0xEA, 0x60, 0xC0, 0x64, 0x35, 0xAC, 0xBA, - 0xFB, 0x11, 0xA8, 0x2E, 0x2F, 0x07, 0x1D, 0x7C, - 0xA4, 0xA5, 0xEB, 0xD9, 0x3A, 0x80, 0x3B, 0xA8, - 0x7F -}; -static const uint8_t packet_out_18[] = { - 0xCD, 0x90, 0x44, 0xD2, 0xB7, 0x1F, 0xDB, 0x81, - 0x20, 0xEA, 0x60, 0xC0, 0x00, 0x97, 0x69, 0xEC, - 0xAB, 0xDF, 0x48, 0x62, 0x55, 0x94, 0xC5, 0x92, - 0x51, 0xE6, 0x03, 0x57, 0x22, 0x67, 0x5E, 0x04, - 0xC8, 0x47, 0x09, 0x9E, 0x5A, 0xE0, 0x70, 0x45, - 0x51 -}; -#define clear_len_18 12 -#define auth_len_18 8 - -/* - * =============== Packet Vector #19 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 42 FF F8 F1 95 1C 3C 96 96 76 6C FA - * Total packet length = 31. [Input with 8 cleartext header octets] - * D8 5B C7 E6 9F 94 4F B8 8A 19 B9 50 BC F7 1A 01 - * 8E 5E 67 01 C9 17 87 65 98 09 D6 7D BE DD 18 - * CBC IV in: 61 00 42 FF F8 F1 95 1C 3C 96 96 76 6C FA 00 17 - * CBC IV out:44 F7 CC 9C 2B DD 2F 45 F6 38 25 6B 73 6E 1D 7A - * After xor: 44 FF 14 C7 EC 3B B0 D1 B9 80 25 6B 73 6E 1D 7A [hdr] - * After AES: 57 C3 73 F8 00 AA 5F CC 7B CF 1D 1B DD BB 4C 52 - * After xor: DD DA CA A8 BC 5D 45 CD F5 91 7A 1A 14 AC CB 37 [msg] - * After AES: 42 4E 93 72 72 C8 79 B6 11 C7 A5 9F 47 8D 9F D8 - * After xor: DA 47 45 0F CC 15 61 B6 11 C7 A5 9F 47 8D 9F D8 [msg] - * After AES: 9A CB 03 F8 B9 DB C8 D2 D2 D7 A4 B4 95 25 08 67 - * CBC-MAC : 9A CB 03 F8 B9 DB C8 D2 D2 D7 - * CTR Start: 01 00 42 FF F8 F1 95 1C 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 36 38 34 FA 28 83 3D B7 55 66 0D 98 65 0D 68 46 - * CTR[0002]: 35 E9 63 54 87 16 72 56 3F 0C 08 AF 78 44 31 A9 - * CTR[MAC ]: F9 B7 FA 46 7B 9B 40 45 14 6D - * Total packet length = 41. [Authenticated and Encrypted Output] - * D8 5B C7 E6 9F 94 4F B8 BC 21 8D AA 94 74 27 B6 - * DB 38 6A 99 AC 1A EF 23 AD E0 B5 29 39 CB 6A 63 - * 7C F9 BE C2 40 88 97 C6 BA - */ -static const uint8_t keys_19[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_19[] = { - 0x00, 0x42, 0xFF, 0xF8, 0xF1, 0x95, 0x1C, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_19[] = { - 0xD8, 0x5B, 0xC7, 0xE6, 0x9F, 0x94, 0x4F, 0xB8, - 0x8A, 0x19, 0xB9, 0x50, 0xBC, 0xF7, 0x1A, 0x01, - 0x8E, 0x5E, 0x67, 0x01, 0xC9, 0x17, 0x87, 0x65, - 0x98, 0x09, 0xD6, 0x7D, 0xBE, 0xDD, 0x18 -}; -static const uint8_t packet_out_19[] = { - 0xD8, 0x5B, 0xC7, 0xE6, 0x9F, 0x94, 0x4F, 0xB8, - 0xBC, 0x21, 0x8D, 0xAA, 0x94, 0x74, 0x27, 0xB6, - 0xDB, 0x38, 0x6A, 0x99, 0xAC, 0x1A, 0xEF, 0x23, - 0xAD, 0xE0, 0xB5, 0x29, 0x39, 0xCB, 0x6A, 0x63, - 0x7C, 0xF9, 0xBE, 0xC2, 0x40, 0x88, 0x97, 0xC6, - 0xBA -}; -#define clear_len_19 8 -#define auth_len_19 10 - -/* - * ================= Packet Vector #20 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 92 0F 40 E5 6C DC 3C 96 96 76 6C FA - * Total packet length = 32. [Input with 8 cleartext header octets] - * 74 A0 EB C9 06 9F 5B 37 17 61 43 3C 37 C5 A3 5F - * C1 F3 9F 40 63 02 EB 90 7C 61 63 BE 38 C9 84 37 - * CBC IV in: 61 00 92 0F 40 E5 6C DC 3C 96 96 76 6C FA 00 18 - * CBC IV out:60 CB 21 CE 40 06 50 AE 2A D2 BE 52 9F 5F 0F C2 - * After xor: 60 C3 55 6E AB CF 56 31 71 E5 BE 52 9F 5F 0F C2 [hdr] - * After AES: 03 20 64 14 35 32 5D 95 C8 A2 50 40 93 28 DA 9B - * After xor: 14 41 27 28 02 F7 FE CA 09 51 CF 00 F0 2A 31 0B [msg] - * After AES: B9 E8 87 95 ED F7 F0 08 15 15 F0 14 E2 FE 0E 48 - * After xor: C5 89 E4 2B D5 3E 74 3F 15 15 F0 14 E2 FE 0E 48 [msg] - * After AES: 8F AD 0C 23 E9 63 7E 87 FA 21 45 51 1B 47 DE F1 - * CBC-MAC : 8F AD 0C 23 E9 63 7E 87 FA 21 - * CTR Start: 01 00 92 0F 40 E5 6C DC 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 4F 71 A5 C1 12 42 E3 7D 29 F0 FE E4 1B E1 02 5F - * CTR[0002]: 34 2B D3 F1 7C B7 7B C1 79 0B 05 05 61 59 27 2C - * CTR[MAC ]: 7F 09 7B EF C6 AA C1 D3 73 65 - * Total packet length = 42. [Authenticated and Encrypted Output] - * 74 A0 EB C9 06 9F 5B 37 58 10 E6 FD 25 87 40 22 - * E8 03 61 A4 78 E3 E9 CF 48 4A B0 4F 44 7E FF F6 - * F0 A4 77 CC 2F C9 BF 54 89 44 - */ -static const uint8_t keys_20[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_20[] = { - 0x00, 0x92, 0x0F, 0x40, 0xE5, 0x6C, 0xDC, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_20[] = { - 0x74, 0xA0, 0xEB, 0xC9, 0x06, 0x9F, 0x5B, 0x37, - 0x17, 0x61, 0x43, 0x3C, 0x37, 0xC5, 0xA3, 0x5F, - 0xC1, 0xF3, 0x9F, 0x40, 0x63, 0x02, 0xEB, 0x90, - 0x7C, 0x61, 0x63, 0xBE, 0x38, 0xC9, 0x84, 0x37 -}; -static const uint8_t packet_out_20[] = { - 0x74, 0xA0, 0xEB, 0xC9, 0x06, 0x9F, 0x5B, 0x37, - 0x58, 0x10, 0xE6, 0xFD, 0x25, 0x87, 0x40, 0x22, - 0xE8, 0x03, 0x61, 0xA4, 0x78, 0xE3, 0xE9, 0xCF, - 0x48, 0x4A, 0xB0, 0x4F, 0x44, 0x7E, 0xFF, 0xF6, - 0xF0, 0xA4, 0x77, 0xCC, 0x2F, 0xC9, 0xBF, 0x54, - 0x89, 0x44 -}; -#define clear_len_20 8 -#define auth_len_20 10 - -/* - * =============== Packet Vector #21 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 27 CA 0C 71 20 BC 3C 96 96 76 6C FA - * Total packet length = 33. [Input with 8 cleartext header octets] - * 44 A3 AA 3A AE 64 75 CA A4 34 A8 E5 85 00 C6 E4 - * 15 30 53 88 62 D6 86 EA 9E 81 30 1B 5A E4 22 6B - * FA - * CBC IV in: 61 00 27 CA 0C 71 20 BC 3C 96 96 76 6C FA 00 19 - * CBC IV out:43 07 C0 73 A8 9E E1 D5 05 27 B2 9A 62 48 D6 D2 - * After xor: 43 0F 84 D0 02 A4 4F B1 70 ED B2 9A 62 48 D6 D2 [hdr] - * After AES: B6 0B C6 F5 84 01 75 BC 01 27 70 F1 11 8D 75 10 - * After xor: 12 3F 6E 10 01 01 B3 58 14 17 23 79 73 5B F3 FA [msg] - * After AES: 7D 5E 64 92 CE 2C B9 EA 7E 4C 4A 09 09 89 C8 FB - * After xor: E3 DF 54 89 94 C8 9B 81 84 4C 4A 09 09 89 C8 FB [msg] - * After AES: 68 5F 8D 79 D2 2B 9B 74 21 DF 4C 3E 87 BA 0A AF - * CBC-MAC : 68 5F 8D 79 D2 2B 9B 74 21 DF - * CTR Start: 01 00 27 CA 0C 71 20 BC 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 56 8A 45 9E 40 09 48 67 EB 85 E0 9E 6A 2E 64 76 - * CTR[0002]: A6 00 AA 92 92 03 54 9A AE EF 2C CC 59 13 7A 57 - * CTR[MAC ]: 25 1E DC DD 3F 11 10 F3 98 11 - * Total packet length = 43. [Authenticated and Encrypted Output] - * 44 A3 AA 3A AE 64 75 CA F2 BE ED 7B C5 09 8E 83 - * FE B5 B3 16 08 F8 E2 9C 38 81 9A 89 C8 E7 76 F1 - * 54 4D 41 51 A4 ED 3A 8B 87 B9 CE - */ -static const uint8_t keys_21[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_21[] = { - 0x00, 0x27, 0xCA, 0x0C, 0x71, 0x20, 0xBC, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_21[] = { - 0x44, 0xA3, 0xAA, 0x3A, 0xAE, 0x64, 0x75, 0xCA, - 0xA4, 0x34, 0xA8, 0xE5, 0x85, 0x00, 0xC6, 0xE4, - 0x15, 0x30, 0x53, 0x88, 0x62, 0xD6, 0x86, 0xEA, - 0x9E, 0x81, 0x30, 0x1B, 0x5A, 0xE4, 0x22, 0x6B, - 0xFA -}; -static const uint8_t packet_out_21[] = { - 0x44, 0xA3, 0xAA, 0x3A, 0xAE, 0x64, 0x75, 0xCA, - 0xF2, 0xBE, 0xED, 0x7B, 0xC5, 0x09, 0x8E, 0x83, - 0xFE, 0xB5, 0xB3, 0x16, 0x08, 0xF8, 0xE2, 0x9C, - 0x38, 0x81, 0x9A, 0x89, 0xC8, 0xE7, 0x76, 0xF1, - 0x54, 0x4D, 0x41, 0x51, 0xA4, 0xED, 0x3A, 0x8B, - 0x87, 0xB9, 0xCE -}; -#define clear_len_21 8 -#define auth_len_21 10 - -/* - * =============== Packet Vector #22 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 5B 8C CB CD 9A F8 3C 96 96 76 6C FA - * Total packet length = 31. [Input with 12 cleartext header octets] - * EC 46 BB 63 B0 25 20 C3 3C 49 FD 70 B9 6B 49 E2 - * 1D 62 17 41 63 28 75 DB 7F 6C 92 43 D2 D7 C2 - * CBC IV in: 61 00 5B 8C CB CD 9A F8 3C 96 96 76 6C FA 00 13 - * CBC IV out:91 14 AD 06 B6 CC 02 35 76 9A B6 14 C4 82 95 03 - * After xor: 91 18 41 40 0D AF B2 10 56 59 8A 5D 39 F2 95 03 [hdr] - * After AES: 29 BD 7C 27 83 E3 E8 D3 C3 5C 01 F4 4C EC BB FA - * After xor: 90 D6 35 C5 9E 81 FF 92 A0 74 74 2F 33 80 29 B9 [msg] - * After AES: 4E DA F4 0D 21 0B D4 5F FE 97 90 B9 AA EC 34 4C - * After xor: 9C 0D 36 0D 21 0B D4 5F FE 97 90 B9 AA EC 34 4C [msg] - * After AES: 21 9E F8 90 EA 64 C2 11 A5 37 88 83 E1 BA 22 0D - * CBC-MAC : 21 9E F8 90 EA 64 C2 11 A5 37 - * CTR Start: 01 00 5B 8C CB CD 9A F8 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 88 BC 19 42 80 C1 FA 3E BE FC EF FB 4D C6 2D 54 - * CTR[0002]: 3E 59 7D A5 AE 21 CC A4 00 9E 4C 0C 91 F6 22 49 - * CTR[MAC ]: 5C BC 30 98 66 02 A9 F4 64 A0 - * Total packet length = 41. [Authenticated and Encrypted Output] - * EC 46 BB 63 B0 25 20 C3 3C 49 FD 70 31 D7 50 A0 - * 9D A3 ED 7F DD D4 9A 20 32 AA BF 17 EC 8E BF 7D - * 22 C8 08 8C 66 6B E5 C1 97 - */ -static const uint8_t keys_22[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_22[] = { - 0x00, 0x5B, 0x8C, 0xCB, 0xCD, 0x9A, 0xF8, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_22[] = { - 0xEC, 0x46, 0xBB, 0x63, 0xB0, 0x25, 0x20, 0xC3, - 0x3C, 0x49, 0xFD, 0x70, 0xB9, 0x6B, 0x49, 0xE2, - 0x1D, 0x62, 0x17, 0x41, 0x63, 0x28, 0x75, 0xDB, - 0x7F, 0x6C, 0x92, 0x43, 0xD2, 0xD7, 0xC2 -}; -static const uint8_t packet_out_22[] = { - 0xEC, 0x46, 0xBB, 0x63, 0xB0, 0x25, 0x20, 0xC3, - 0x3C, 0x49, 0xFD, 0x70, 0x31, 0xD7, 0x50, 0xA0, - 0x9D, 0xA3, 0xED, 0x7F, 0xDD, 0xD4, 0x9A, 0x20, - 0x32, 0xAA, 0xBF, 0x17, 0xEC, 0x8E, 0xBF, 0x7D, - 0x22, 0xC8, 0x08, 0x8C, 0x66, 0x6B, 0xE5, 0xC1, - 0x97 -}; -#define clear_len_22 12 -#define auth_len_22 10 - - -/* - * =============== Packet Vector #23 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 3E BE 94 04 4B 9A 3C 96 96 76 6C FA - * Total packet length = 32. [Input with 12 cleartext header octets] - * 47 A6 5A C7 8B 3D 59 42 27 E8 5E 71 E2 FC FB B8 - * 80 44 2C 73 1B F9 51 67 C8 FF D7 89 5E 33 70 76 - * CBC IV in: 61 00 3E BE 94 04 4B 9A 3C 96 96 76 6C FA 00 14 - * CBC IV out:0F 70 3F 5A 54 2C 44 6E 8B 74 A3 73 9B 48 B9 61 - * After xor: 0F 7C 78 FC 0E EB CF 53 D2 36 84 9B C5 39 B9 61 [hdr] - * After AES: 40 5B ED 29 D0 98 AE 91 DB 68 78 F3 68 B8 73 85 - * After xor: A2 A7 16 91 50 DC 82 E2 C0 91 29 94 A0 47 A4 0C [msg] - * After AES: 3D 03 29 3C FD 81 1B 37 01 51 FB C7 85 6B 7A 74 - * After xor: 63 30 59 4A FD 81 1B 37 01 51 FB C7 85 6B 7A 74 [msg] - * After AES: 66 4F 27 16 3E 36 0F 72 62 0D 4E 67 7C E0 61 DE - * CBC-MAC : 66 4F 27 16 3E 36 0F 72 62 0D - * CTR Start: 01 00 3E BE 94 04 4B 9A 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 0A 7E 0A 63 53 C8 CF 9E BC 3B 6E 63 15 9A D0 97 - * CTR[0002]: EA 20 32 DA 27 82 6E 13 9E 1E 72 5C 5B 0D 3E BF - * CTR[MAC ]: B9 31 27 CA F0 F1 A1 20 FA 70 - * Total packet length = 42. [Authenticated and Encrypted Output] - * 47 A6 5A C7 8B 3D 59 42 27 E8 5E 71 E8 82 F1 DB - * D3 8C E3 ED A7 C2 3F 04 DD 65 07 1E B4 13 42 AC - * DF 7E 00 DC CE C7 AE 52 98 7D - */ -static const uint8_t keys_23[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_23[] = { - 0x00, 0x3E, 0xBE, 0x94, 0x04, 0x4B, 0x9A, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_23[] = { - 0x47, 0xA6, 0x5A, 0xC7, 0x8B, 0x3D, 0x59, 0x42, - 0x27, 0xE8, 0x5E, 0x71, 0xE2, 0xFC, 0xFB, 0xB8, - 0x80, 0x44, 0x2C, 0x73, 0x1B, 0xF9, 0x51, 0x67, - 0xC8, 0xFF, 0xD7, 0x89, 0x5E, 0x33, 0x70, 0x76 -}; -static const uint8_t packet_out_23[] = { - 0x47, 0xA6, 0x5A, 0xC7, 0x8B, 0x3D, 0x59, 0x42, - 0x27, 0xE8, 0x5E, 0x71, 0xE8, 0x82, 0xF1, 0xDB, - 0xD3, 0x8C, 0xE3, 0xED, 0xA7, 0xC2, 0x3F, 0x04, - 0xDD, 0x65, 0x07, 0x1E, 0xB4, 0x13, 0x42, 0xAC, - 0xDF, 0x7E, 0x00, 0xDC, 0xCE, 0xC7, 0xAE, 0x52, - 0x98, 0x7D -}; -#define clear_len_23 12 -#define auth_len_23 10 - -/* - * =============== Packet Vector #24 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 8D 49 3B 30 AE 8B 3C 96 96 76 6C FA - * Total packet length = 33. [Input with 12 cleartext header octets] - * 6E 37 A6 EF 54 6D 95 5D 34 AB 60 59 AB F2 1C 0B - * 02 FE B8 8F 85 6D F4 A3 73 81 BC E3 CC 12 85 17 - * D4 - * CBC IV in: 61 00 8D 49 3B 30 AE 8B 3C 96 96 76 6C FA 00 15 - * CBC IV out:67 AC E4 E8 06 77 7A D3 27 1D 0B 93 4C 67 98 15 - * After xor: 67 A0 8A DF A0 98 2E BE B2 40 3F 38 2C 3E 98 15 [hdr] - * After AES: 35 58 F8 7E CA C2 B4 39 B6 7E 75 BB F1 5E 69 08 - * After xor: 9E AA E4 75 C8 3C 0C B6 33 13 81 18 82 DF D5 EB [msg] - * After AES: 54 E4 7B 62 22 F0 BB 87 17 D0 71 6A EB AF 19 9E - * After xor: 98 F6 FE 75 F6 F0 BB 87 17 D0 71 6A EB AF 19 9E [msg] - * After AES: 23 E3 30 50 BC 57 DC 2C 3D 3E 7C 94 77 D1 49 71 - * CBC-MAC : 23 E3 30 50 BC 57 DC 2C 3D 3E - * CTR Start: 01 00 8D 49 3B 30 AE 8B 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 58 DB 19 B3 88 9A A3 8B 3C A4 0B 16 FF 42 2C 73 - * CTR[0002]: C3 2F 24 3D 65 DC 7E 9F 4B 02 16 AB 7F B9 6B 4D - * CTR[MAC ]: 4E 2D AE D2 53 F6 B1 8A 1D 67 - * Total packet length = 43. [Authenticated and Encrypted Output] - * 6E 37 A6 EF 54 6D 95 5D 34 AB 60 59 F3 29 05 B8 - * 8A 64 1B 04 B9 C9 FF B5 8C C3 90 90 0F 3D A1 2A - * B1 6D CE 9E 82 EF A1 6D A6 20 59 - */ -static const uint8_t keys_24[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_24[] = { - 0x00, 0x8D, 0x49, 0x3B, 0x30, 0xAE, 0x8B, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_24[] = { - 0x6E, 0x37, 0xA6, 0xEF, 0x54, 0x6D, 0x95, 0x5D, - 0x34, 0xAB, 0x60, 0x59, 0xAB, 0xF2, 0x1C, 0x0B, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0xD4 -}; -static const uint8_t packet_out_24[] = { - 0x6E, 0x37, 0xA6, 0xEF, 0x54, 0x6D, 0x95, 0x5D, - 0x34, 0xAB, 0x60, 0x59, 0xF3, 0x29, 0x05, 0xB8, - 0x8A, 0x64, 0x1B, 0x04, 0xB9, 0xC9, 0xFF, 0xB5, - 0x8C, 0xC3, 0x90, 0x90, 0x0F, 0x3D, 0xA1, 0x2A, - 0xB1, 0x6D, 0xCE, 0x9E, 0x82, 0xEF, 0xA1, 0x6D, - 0xA6, 0x20, 0x59 -}; -#define clear_len_24 12 -#define auth_len_24 10 - -/* - * =============== Packet Vector #25 ================== - * AES Key = D7 82 8D 13 B2 B0 BD C3 25 A7 62 36 DF 93 CC 6B - * Nonce = 00 8D 49 3B 30 AE 8B 3C 96 96 76 6C FA - * Total packet length = 33. [Input with 12 cleartext header octets] - * 6E 37 A6 EF 54 6D 95 5D 34 AB 60 59 AB F2 1C 0B - * 02 FE B8 8F 85 6D F4 A3 73 81 BC E3 CC 12 85 17 - * D4 - * CBC IV in: 61 00 8D 49 3B 30 AE 8B 3C 96 96 76 6C FA 00 15 - * CBC IV out:67 AC E4 E8 06 77 7A D3 27 1D 0B 93 4C 67 98 15 - * After xor: 67 A0 8A DF A0 98 2E BE B2 40 3F 38 2C 3E 98 15 [hdr] - * After AES: 35 58 F8 7E CA C2 B4 39 B6 7E 75 BB F1 5E 69 08 - * After xor: 9E AA E4 75 C8 3C 0C B6 33 13 81 18 82 DF D5 EB [msg] - * After AES: 54 E4 7B 62 22 F0 BB 87 17 D0 71 6A EB AF 19 9E - * After xor: 98 F6 FE 75 F6 F0 BB 87 17 D0 71 6A EB AF 19 9E [msg] - * After AES: 23 E3 30 50 BC 57 DC 2C 3D 3E 7C 94 77 D1 49 71 - * CBC-MAC : 23 E3 30 50 BC 57 DC 2C 3D 3E - * CTR Start: 01 00 8D 49 3B 30 AE 8B 3C 96 96 76 6C FA 00 01 - * CTR[0001]: 58 DB 19 B3 88 9A A3 8B 3C A4 0B 16 FF 42 2C 73 - * CTR[0002]: C3 2F 24 3D 65 DC 7E 9F 4B 02 16 AB 7F B9 6B 4D - * CTR[MAC ]: 4E 2D AE D2 53 F6 B1 8A 1D 67 - * Total packet length = 43. [Authenticated and Encrypted Output] - * 6E 37 A6 EF 54 6D 95 5D 34 AB 60 59 F3 29 05 B8 - * 8A 64 1B 04 B9 C9 FF B5 8C C3 90 90 0F 3D A1 2A - * B1 6D CE 9E 82 EF A1 6D A6 20 59 - */ -static const uint8_t keys_25[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_25[] = { - 0x00, 0x8D, 0x49, 0x3B, 0x30, 0xAE, 0x8B, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_25[] = { - 0x6E, 0x37, 0xA6, 0xEF, 0x54, 0x6D, 0x95, 0x5D, - 0x34, 0xAB, 0x60, 0x59, 0xAB, 0xF2, 0x1C, 0x0B, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, -}; -static const uint8_t packet_out_25[] = { - 0x6E, 0x37, 0xA6, 0xEF, 0x54, 0x6D, 0x95, 0x5D, - 0x34, 0xAB, 0x60, 0x59, - 0xF3, 0x29, 0x05, 0xB8, 0x8A, 0x64, 0x1B, 0x04, - 0xB9, 0xC9, 0xFF, 0xB5, 0x8C, 0xC3, 0x90, 0x90, - 0x0F, 0x3D, 0xA1, 0x2A, 0x67, 0x22, 0xC6, 0x10, - 0xCE, 0x6F, 0xE2, 0x08, 0x0C, 0x38, 0xD7, 0xAE, - 0x61, 0x82, 0x21, 0x3D, 0x59, 0x67, 0xF3, 0x26, - 0x72, 0x53, 0x78, 0x37, 0xE4, 0xBA, 0xA7, 0xED, - 0x92, 0x52, 0xD6, 0x01, 0xA5, 0x66, 0x52, 0x20, - 0x6C, 0x51, 0xDB, 0x15, 0x6C, 0xF8, 0x59, 0x38, - 0xAF, 0x28, 0x4D, 0xB7, 0x5F, 0x2A, 0xC8, 0xB0, - 0x6E, 0x37, 0x77, 0x89, 0xB0, 0x6D, 0xC3, 0xE5, - 0xF2, 0x2A, 0xA6, 0xF7, 0xDB, 0xCC, 0x37, 0x79, - 0x88, 0x0E, 0x8F, 0x05, 0xA9, 0xE1, 0x9E, 0x11, - 0x90, 0x3D, 0x2A, 0xB9, 0x70, 0x13, 0x9D, 0xC3, - 0x93, 0xAD, 0xE2, 0x5D, 0xFF, 0xDD, 0x19, 0x0F, - 0xB9, 0x9E, 0x74, 0x88, 0xAB, 0x82, 0x0C, 0xA0, - 0x2E, 0x71, 0xA6, 0x32, 0xEB, 0xA4, 0xBA, 0x10, - 0xF6, 0x61, 0x7B, 0x1B, 0x2A, 0x38, 0x80, 0xEB, - 0xE9, 0x09, 0x01, 0x33, 0x94, 0x8F, 0xB3, 0xD4, - 0xAD, 0x6C, 0xD8, 0x5E, 0x85, 0x98, 0xC5, 0x9C, - 0x11, 0x62, 0x2C, 0x60, 0x32, 0xAE, 0x70, 0xE1, - 0x66, 0x73, 0x09, 0x1E, 0x20, 0x55, 0xB7, 0x20, - 0x77, 0x86, 0x09, 0xC8, 0x1C, 0xFE, 0x86, 0xA7, - 0x08, 0x40, 0x43, 0xE7, 0xAD, 0xB2, 0x5B, 0x39, - 0x64, 0xCB, 0x13, 0x1F, 0x8D, 0xD2, 0x4F, 0xCC, - 0xC5, 0xAA, 0xF1, 0xD6, 0x31, 0xFC, 0x34, 0x9E, - 0x5F, 0x90, 0xC4, 0xB7, 0xE0, 0x07, 0x9C, 0xCD, - 0xFB, 0xEA, 0xE3, 0x75, 0xB5, 0x7B, 0x29, 0xD4, - 0x73, 0x81, 0xEF, 0x9C, 0x2E, 0xAC, 0xF9, 0xA7, - 0x39, 0x2A, 0xF8, 0xE2, 0xEA, 0x3A, 0x6A, 0xDF, - 0xD0, 0x3A, 0xCA, 0x29, 0xD3, 0x13, 0x13, 0x9A, - 0x2C, 0x70, 0xA4, 0xA9, 0x40, 0x1D, 0xEC, 0xC7, - 0xC9, 0x6B, 0xF7, 0x23, 0xD4, 0x53, 0x49, 0xD0, - 0x05, 0xCE, 0x15, 0x65, 0xCE, 0x1F, 0x89, 0xE2, - 0xBE, 0xE0, 0xFA, 0x3F, 0x59, 0x4A, 0x89, 0x99, - 0xE5, 0xDB, 0xA0, 0xE8, 0x54, 0x72, 0x42, 0x69, - 0x79, 0x63, 0x68, 0x91, 0xC9, 0x2C, 0xFC, 0x58, - 0xD4, 0x30, 0xFE, 0xE3, 0x62, 0x5F, 0xDC, 0x49, - 0xEF, 0x32, 0x58, 0x83, 0x27, 0xA9, 0xED, 0xEC, - 0xF3, 0x1D, 0xFB, 0xEA, 0x0A, 0x89 -}; -#define clear_len_25 12 -#define auth_len_25 10 - -/** Additional AES-CCM-128 test vectors */ -static const uint8_t keys_90[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_90[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_90[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23 -}; -static const uint8_t packet_out_90[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x71, 0x62, 0x01, 0x5B, - 0x4D, 0xAC, 0x25, 0x5D -}; -#define clear_len_90 8 -#define auth_len_90 4 - -static const uint8_t keys_91[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_91[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_91[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_91[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, - 0xF3, 0xD0, 0xA2, 0xFE, 0x9A, 0x3D, 0xBF, 0x23, - 0x42, 0xA6, 0x43, 0xE4, 0x32, 0x46, 0xE8, 0x0C, - 0x3C, 0x04, 0xD0, 0x19, - 0x78, 0x45, 0xCE, 0x0B, 0x16, 0xF9, 0x76, 0x23 -}; -#define clear_len_91 22 -#define auth_len_91 8 - - -static const uint8_t keys_92[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_92[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_92[] = { - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_92[] = { - 0xF3, 0xD0, 0xA2, 0xFE, 0x9A, 0x3D, 0xBF, 0x23, - 0x42, 0xA6, 0x43, 0xE4, 0x32, 0x46, 0xE8, 0x0C, - 0x3C, 0x04, 0xD0, 0x19, - 0x41, 0x83, 0x21, 0x89, 0xA3, 0xD3, 0x1B, 0x43 -}; -#define clear_len_92 0 -#define auth_len_92 8 - -static const uint8_t keys_100[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_100[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_100[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_100[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x71, 0x62, 0x01, 0x5B, - 0xB0, 0xC9, 0x5E, 0x58, 0x03, 0x6E -}; -#define clear_len_100 8 -#define auth_len_100 6 - -static const uint8_t keys_101[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_101[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_101[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_101[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x71, 0x62, 0x01, 0x5B, - 0xD0, 0xAD, 0x86, 0xFD, 0x33, 0xC2, 0x69, 0x86 -}; -#define clear_len_101 8 -#define auth_len_101 8 - -static const uint8_t keys_102[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_102[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_102[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_102[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x71, 0x62, 0x01, 0x5B, - 0x05, 0x12, 0xDA, 0xBF, 0xD9, 0x72, 0xA6, 0x68, - 0x53, 0xC1 -}; -#define clear_len_102 8 -#define auth_len_102 10 - -static const uint8_t keys_103[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_103[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_103[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_103[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x71, 0x62, 0x01, 0x5B, - 0xBA, 0x03, 0xBF, 0x8C, 0xE0, 0xD6, 0x00, 0xA4, - 0x48, 0x6F, 0xCC, 0xB3 -}; -#define clear_len_103 8 -#define auth_len_103 12 - -static const uint8_t keys_104[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_104[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_104[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_104[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x71, 0x62, 0x01, 0x5B, - 0x6B, 0x9B, 0xFB, 0xFE, 0xA8, 0x2C, 0x04, 0x77, - 0x8E, 0x67, 0xF5, 0x18, 0x46, 0xC6 -}; -#define clear_len_104 8 -#define auth_len_104 14 - -static const uint8_t keys_105[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_105[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_105[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_105[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x71, 0x62, 0x01, 0x5B, - 0x2B, 0xB5, 0x7C, 0x0A, 0xF4, 0x5E, 0x4D, 0x83, - 0x04, 0xF0, 0x5F, 0x45, 0x99, 0x3F, 0x15, 0x17 -}; -#define clear_len_105 8 -#define auth_len_105 16 - -static const uint8_t keys_106[] = { - 0x4a, 0xe7, 0x01, 0x10, 0x3c, 0x63, 0xde, 0xca, - 0x5b, 0x5a, 0x39, 0x39, 0xd7, 0xd0, 0x59, 0x92 -}; -static const uint8_t nonce_106[] = { - 0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9 -}; -static const uint8_t packet_out_106[] = { - 0x02, 0x20, 0x9f, 0x55 -}; -#define clear_len_106 0 -#define auth_len_106 4 - -static const uint8_t keys_107[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_107[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_107[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_107[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, - 0xF3, 0xD0, 0xA2, 0xFE, 0x9A, 0x3D, 0xBF, 0x23, - 0x42, 0xA6, 0x43, 0xE4, 0x32, 0x46, 0xE8, 0x0C, - 0x3C, 0x04, 0xD0, 0x19, - 0x60, 0x76, 0xE8, 0xE2, 0x0C, 0x0A, 0xF6, 0xDF -}; -#define clear_len_107 14 -#define auth_len_107 8 - -static const uint8_t keys_108[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_108[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_108[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x08, 0x40, - 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_108[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x08, 0x40, - 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, - 0xF3, 0xD0, 0xA2, 0xFE, 0x9A, 0x3D, 0xBF, 0x23, - 0x42, 0xA6, 0x43, 0xE4, 0x32, 0x46, 0xE8, 0x0C, - 0x3C, 0x04, 0xD0, 0x19, - 0x35, 0x0D, 0xA5, 0xAA, 0x1E, 0x71, 0x82, 0x35 -}; -#define clear_len_108 32 -#define auth_len_108 8 - -static const uint8_t keys_109[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_109[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_109[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x08, 0x40, - 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, - 0x00, 0x01, 0x02, 0x03, - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_109[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x08, 0x40, - 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, - 0x00, 0x01, 0x02, 0x03, - 0xF3, 0xD0, 0xA2, 0xFE, 0x9A, 0x3D, 0xBF, 0x23, - 0x42, 0xA6, 0x43, 0xE4, 0x32, 0x46, 0xE8, 0x0C, - 0x3C, 0x04, 0xD0, 0x19, - 0x26, 0x5A, 0x04, 0xB1, 0x56, 0xFF, 0x9F, 0x0E -}; -#define clear_len_109 36 -#define auth_len_109 8 - -static const uint8_t keys_110[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_110[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_110[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x08, 0x40, - 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_110[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x08, 0x40, - 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, - 0xF3, 0xD0, 0xA2, 0xFE, 0x9A, 0x3D, 0xBF, 0x23, - 0x42, 0xA6, 0x43, 0xE4, 0x32, 0x46, 0xE8, 0x0C, - 0x3C, 0x04, 0xD0, 0x19, - 0x07, 0x55, 0x13, 0x40, 0x2B, 0x11, 0x6D, 0xD5 -}; -#define clear_len_110 46 -#define auth_len_110 8 - - -static const uint8_t keys_111[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_111[] = { - 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_111[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; -static const uint8_t packet_out_111[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x21, 0x61, 0x63, 0xDE, 0xCF, 0x74, 0xE0, 0x0C, - 0xAB, 0x04, 0x56, 0xFF, 0x45, 0xCD, 0xA7, 0x17, - 0x1F, 0xA5, 0x96, 0xD7, 0x0F, 0x76, 0x91, 0xCA, - 0x8A, 0xFA, 0xA2, 0x3F, 0x22, 0x3E, 0x64 -}; -#define clear_len_111 8 -#define auth_len_111 8 - - -static const uint8_t keys_112[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_112[] = { - 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_112[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F -}; -static const uint8_t packet_out_112[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x61, 0x6A, 0x60, 0x6D, 0x54, 0x41, 0x94, 0xAB, - 0x29, 0xD2, 0xA9, 0x86, 0x14, 0xDA, 0x02, 0x40, - 0x14, 0xFA, 0xC5, 0xCE, 0x97, 0x0A, 0xA1, 0xE9, - 0xF1, 0xA3, 0xED, 0x0E, 0xE1, 0x2A, 0x9B, 0x69 -}; -#define clear_len_112 8 -#define auth_len_112 8 - - -static const uint8_t keys_113[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_113[] = { - 0x00, 0x00, 0x00, 0x05, 0x04, 0x03, 0x02, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_113[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20 -}; -static const uint8_t packet_out_113[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x75, 0x4C, 0xDD, 0xEA, 0x13, 0x59, 0x9B, 0x30, - 0xBA, 0xC6, 0xD4, 0x0D, 0x12, 0x0D, 0x43, 0x0A, - 0x2B, 0x44, 0xC4, 0x0B, 0x1F, 0xDE, 0x31, 0x24, - 0xC4, 0x9E, 0xD2, 0xC4, 0xF4, 0x04, 0xDC, 0xF3, - 0xEB -}; -#define clear_len_113 8 -#define auth_len_113 8 - - -static const uint8_t keys_114[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_114[] = { - 0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x03, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_114[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; -static const uint8_t packet_out_114[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x5C, 0x14, 0xC7, 0x8C, - 0x02, 0xC5, 0xA2, 0x64, 0xD8, 0xDF, 0x46, 0x57, - 0x88, 0x34, 0xEF, 0x27, 0xC1, 0xA3, 0x01, 0xEF, - 0xDA, 0x9E, 0x13, 0xC7, 0x00, 0xCC, 0x63 - -}; -#define clear_len_114 12 -#define auth_len_114 8 - - -static const uint8_t keys_115[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t nonce_115[] = { - 0x00, 0x00, 0x00, 0x07, 0x06, 0x05, 0x04, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t packet_in_115[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F -}; -static const uint8_t packet_out_115[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x2C, 0xF8, 0x28, 0xA5, - 0x5A, 0x7D, 0xEF, 0xF1, 0x63, 0x3D, 0x26, 0x72, - 0xA0, 0x7B, 0x35, 0x2C, 0x3D, 0xC5, 0xB4, 0xE5, - 0x8F, 0xC4, 0x9D, 0x90, 0xBE, 0x78, 0x94, 0xA5 -}; -#define clear_len_115 12 -#define auth_len_115 8 - - -static const uint8_t keys_116[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B, - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_116[] = { - 0x00, 0x92, 0x0F, 0x40, 0xE5, 0x6C, 0xDC, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_116[] = { - 0x74, 0xA0, 0xEB, 0xC9, 0x06, 0x9F, 0x5B, 0x37, - 0x17, 0x61, 0x43, 0x3C, 0x37, 0xC5, 0xA3, 0x5F, - 0xC1, 0xF3, 0x9F, 0x40, 0x63, 0x02, 0xEB, 0x90, - 0x7C, 0x61, 0x63, 0xBE, 0x38, 0xC9, 0x84, 0x37 -}; -static const uint8_t packet_out_116[] = { - 0x74, 0xA0, 0xEB, 0xC9, 0x06, 0x9F, 0x5B, 0x37, - 0x8E, 0xEF, 0xD9, 0x8C, 0x25, 0x6F, 0xEF, 0xCD, - 0xC3, 0xC0, 0xAD, 0x3C, 0x42, 0xB1, 0xD7, 0x44, - 0x2B, 0x44, 0x75, 0x41, 0xC3, 0xB1, 0x18, 0x85, - 0x90, 0x59, 0x3C, 0x67, 0xE2, 0xF7, 0x9E, 0x2A, - 0xCE, 0x9E - -}; -#define clear_len_116 8 -#define auth_len_116 10 - - -static const uint8_t keys_117[] = { - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B, - 0xD7, 0x82, 0x8D, 0x13, 0xB2, 0xB0, 0xBD, 0xC3, - 0x25, 0xA7, 0x62, 0x36, 0xDF, 0x93, 0xCC, 0x6B -}; -static const uint8_t nonce_117[] = { - 0x00, 0x8D, 0x49, 0x3B, 0x30, 0xAE, 0x8B, 0x3C, - 0x96, 0x96, 0x76, 0x6C, 0xFA -}; -static const uint8_t packet_in_117[] = { - 0x6E, 0x37, 0xA6, 0xEF, 0x54, 0x6D, 0x95, 0x5D, - 0x34, 0xAB, 0x60, 0x59, 0xAB, 0xF2, 0x1C, 0x0B, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, - 0x73, 0x81, 0xBC, 0xE3, 0xCC, 0x12, 0x85, 0x17, - 0x02, 0xFE, 0xB8, 0x8F, 0x85, 0x6D, 0xF4, 0xA3, -}; -static const uint8_t packet_out_117[] = { - 0x6E, 0x37, 0xA6, 0xEF, 0x54, 0x6D, 0x95, 0x5D, - 0x34, 0xAB, 0x60, 0x59, 0x23, 0x68, 0x7A, 0x56, - 0x54, 0x09, 0x51, 0xB0, 0x13, 0x4F, 0x65, 0xE9, - 0xCD, 0xE6, 0xAC, 0x57, 0x22, 0x59, 0x28, 0xE3, - 0x93, 0xEA, 0xA6, 0xC5, 0x14, 0xBF, 0x9D, 0x1D, - 0x5D, 0xB0, 0xA3, 0x16, 0xB2, 0x4A, 0x09, 0xE8, - 0x9A, 0xD2, 0xE4, 0x04, 0x66, 0x01, 0x84, 0xD3, - 0xAF, 0x85, 0x02, 0x69, 0xF4, 0xA2, 0x43, 0x5C, - 0x98, 0x13, 0xF1, 0x96, 0x99, 0x68, 0xC1, 0x8C, - 0x4B, 0x3F, 0x69, 0xCE, 0x05, 0x26, 0x12, 0x76, - 0xDB, 0xB7, 0x7D, 0x99, 0xCC, 0x0B, 0x6E, 0x43, - 0x03, 0x75, 0xFF, 0xD9, 0x85, 0x8E, 0x1C, 0x4E, - 0x7D, 0x0F, 0x4D, 0xFD, 0x1C, 0x6A, 0x1E, 0x5C, - 0xF4, 0x17, 0x3A, 0xA9, 0x1F, 0xF8, 0xD0, 0xAD, - 0xF8, 0xB6, 0x8B, 0xC1, 0xB5, 0xFF, 0x71, 0x6F, - 0xBE, 0x18, 0x92, 0xED, 0x43, 0x73, 0x04, 0xED, - 0xB9, 0x78, 0x35, 0xA4, 0x70, 0x99, 0xDD, 0x62, - 0xC0, 0x68, 0x84, 0x68, 0x5F, 0x37, 0x3C, 0x9F, - 0xDD, 0x8B, 0xFB, 0x75, 0x82, 0x47, 0xAE, 0x1B, - 0x21, 0x54, 0x5E, 0x1E, 0x43, 0x7C, 0x63, 0xC5, - 0xB5, 0x47, 0xA7, 0x65, 0x56, 0x47, 0xBA, 0xC5, - 0x30, 0x4B, 0x4A, 0xAD, 0xA5, 0x68, 0x5D, 0x22, - 0x31, 0xB8, 0x92, 0x25, 0x4D, 0x42, 0x8B, 0x51, - 0xF8, 0xFB, 0xBA, 0x1A, 0xAA, 0x86, 0x71, 0x3E, - 0x22, 0xC0, 0x7F, 0xD7, 0x58, 0xD0, 0x25, 0x90, - 0xF5, 0x18, 0xF7, 0xE9, 0x69, 0xE3, 0x6F, 0x5E, - 0x1C, 0x38, 0xA3, 0x52, 0xA3, 0x49, 0x4B, 0x70, - 0x1E, 0xB6, 0x13, 0x65, 0xF7, 0x1A, 0xF9, 0xE0, - 0x03, 0x94, 0x2B, 0x4B, 0xD9, 0xB0, 0x18, 0xA8, - 0x2A, 0xDA, 0x80, 0xD4, 0x88, 0xD3, 0x0B, 0x37, - 0xE1, 0x4A, 0xBE, 0xBF, 0xD9, 0x2C, 0x84, 0xD1, - 0xF5, 0x56, 0x5C, 0x79, 0x14, 0x77, 0x1B, 0x9D, - 0x34, 0x65, 0x22, 0x39, 0x78, 0x4D, 0xEE, 0x29, - 0x9A, 0x80, 0x42, 0x2A, 0xAF, 0x3D, 0x84, 0xB7, - 0x3C, 0x60, 0xA6, 0x08, 0x4C, 0xBB, 0x2B, 0x8E, - 0xDB, 0x94, 0x4D, 0x72, 0x08, 0x1B, 0x29, 0xD1, - 0xE9, 0xDB, 0xE9, 0x53, 0x2C, 0xC0, 0x22, 0xE0, - 0x75, 0x27, 0x61, 0x2E, 0x26, 0xE4, 0x80, 0x2A, - 0xB0, 0xD3, 0xF4, 0x4E, 0x90, 0x91, 0x92, 0xDB, - 0x92, 0xE1, 0x4F, 0x3D, 0x53, 0x58, 0xC8, 0x86, - 0x18, 0x5D -}; -#define clear_len_117 12 -#define auth_len_117 10 - - -static const uint8_t keys_118[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_118[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_118[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23 -}; -static const uint8_t packet_out_118[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0xD0, 0xB5, 0x4A, 0x05, - 0x45, 0x50, 0xAB, 0xAB -}; -#define clear_len_118 8 -#define auth_len_118 4 - - -static const uint8_t keys_119[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F, - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_119[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_119[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_119[] = { - 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, - 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xAB, 0xAE, - 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, - 0x12, 0x2A, 0xB4, 0xD4, 0x01, 0xC3, 0x1A, 0x55, - 0xE0, 0x59, 0x6A, 0x5E, 0xCC, 0x37, 0xDB, 0xD4, - 0xA2, 0xB5, 0x3F, 0xD8, - 0x42, 0x1D, 0xB8, 0xE9, 0xBF, 0x60, 0x3F, 0xE8 -}; -#define clear_len_119 22 -#define auth_len_119 8 - - -static const uint8_t keys_120[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_120[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_120[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_120[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0xD0, 0xB5, 0x4A, 0x05, - 0xF8, 0x16, 0xAB, 0xE3, 0xA7, 0xC9, 0x26, 0xB4, - 0x3D, 0xEA -}; -#define clear_len_120 8 -#define auth_len_120 10 - - -static const uint8_t keys_121[] = { - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F, - 0xC9, 0x7C, 0x1F, 0x67, 0xCE, 0x37, 0x11, 0x85, - 0x51, 0x4A, 0x8A, 0x19, 0xF2, 0xBD, 0xD5, 0x2F -}; -static const uint8_t nonce_121[] = { - 0x00, 0x50, 0x30, 0xF1, 0x84, 0x44, 0x08, 0xB5, - 0x03, 0x97, 0x76, 0xE7, 0x0C -}; -static const uint8_t packet_in_121[] = { - 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, 0xAE, - 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, 0xA8, 0xEB, - 0x7E, 0x78, 0xA0, 0x50 -}; -static const uint8_t packet_out_121[] = { - 0x12, 0x2A, 0xB4, 0xD4, 0x01, 0xC3, 0x1A, 0x55, - 0xE0, 0x59, 0x6A, 0x5E, 0xCC, 0x37, 0xDB, 0xD4, - 0xA2, 0xB5, 0x3F, 0xD8, - 0x1C, 0x89, 0xDE, 0xF3, 0x72, 0x03, 0x96, 0x19 -}; -#define clear_len_121 0 -#define auth_len_121 8 - - -static const uint8_t keys_122[] = { - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F -}; -static const uint8_t nonce_122[] = { - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 -}; -static const uint8_t packet_in_122[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x20, 0x21, 0x22, 0x23, -}; -static const uint8_t packet_out_122[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0xD0, 0xB5, 0x4A, 0x05, - 0x45, 0x80, 0xD7, 0x1D, 0xA5, 0x34, 0x5F, 0x7C, - 0xF9, 0x11, 0xB9, 0x95, 0x19, 0x86, 0x90, 0x30 -}; -#define clear_len_122 8 -#define auth_len_122 16 - - -#define CCM_TEST_VEC(num) \ - { keys_##num, nonce_##num, sizeof(nonce_##num), \ - packet_in_##num, sizeof(packet_in_##num), \ - clear_len_##num, packet_out_##num, \ - auth_len_##num } -#define CCM_TEST_VEC_2(num) \ - { keys_##num, nonce_##num, sizeof(nonce_##num), \ - NULL, 0, \ - clear_len_##num, packet_out_##num, \ - auth_len_##num } - -struct ccm_rfc3610_vector { - const uint8_t *keys; - const uint8_t *nonce; - const size_t nonce_len; - /* packet in = [ AAD | plain text ] */ - const uint8_t *packet_in; - const size_t packet_len; - const size_t clear_len; - /* packet out = [ AAD | cipher text | authentication tag ] */ - const uint8_t *packet_out; - const size_t auth_len; -}; - -static const struct ccm_rfc3610_vector ccm_vectors[] = { - CCM_TEST_VEC(01), - CCM_TEST_VEC(02), - CCM_TEST_VEC(03), - CCM_TEST_VEC(04), - CCM_TEST_VEC(05), - CCM_TEST_VEC(06), - CCM_TEST_VEC(07), - CCM_TEST_VEC(08), - CCM_TEST_VEC(09), - CCM_TEST_VEC(10), - CCM_TEST_VEC(11), - CCM_TEST_VEC(12), - CCM_TEST_VEC(13), - CCM_TEST_VEC(14), - CCM_TEST_VEC(15), - CCM_TEST_VEC(16), - CCM_TEST_VEC(17), - CCM_TEST_VEC(18), - CCM_TEST_VEC(19), - CCM_TEST_VEC(20), - CCM_TEST_VEC(21), - CCM_TEST_VEC(22), - CCM_TEST_VEC(23), - CCM_TEST_VEC(24), - CCM_TEST_VEC(25), - CCM_TEST_VEC(90), - CCM_TEST_VEC(91), - CCM_TEST_VEC(92), - CCM_TEST_VEC(100), - CCM_TEST_VEC(101), - CCM_TEST_VEC(102), - CCM_TEST_VEC(103), - CCM_TEST_VEC(104), - CCM_TEST_VEC(105), - CCM_TEST_VEC_2(106), - CCM_TEST_VEC(107), - CCM_TEST_VEC(108), - CCM_TEST_VEC(109), - CCM_TEST_VEC(110) -}; - -static const struct ccm_rfc3610_vector ccm_256_vectors[] = { - CCM_TEST_VEC(111), - CCM_TEST_VEC(112), - CCM_TEST_VEC(113), - CCM_TEST_VEC(114), - CCM_TEST_VEC(115), - CCM_TEST_VEC(116), - CCM_TEST_VEC(117), - CCM_TEST_VEC(118), - CCM_TEST_VEC(119), - CCM_TEST_VEC(120), - CCM_TEST_VEC(121), - CCM_TEST_VEC(122), -}; +extern const struct aead_test ccm_128_test_json[]; +extern const struct aead_test ccm_256_test_json[]; static int -ccm_job_ok(const struct ccm_rfc3610_vector *vec, +ccm_job_ok(const struct aead_test *vec, const struct IMB_JOB *job, const uint8_t *target, const uint8_t *padding, @@ -2184,53 +59,45 @@ ccm_job_ok(const struct ccm_rfc3610_vector *vec, /* cipher checks */ if (in_place) { if (dir == IMB_DIR_ENCRYPT) { - if (memcmp(vec->packet_out, target + sizeof_padding, - vec->packet_len)) { + if (memcmp((const void *) vec->ct, target + sizeof_padding, + vec->msgSize / 8)) { printf("cipher mismatched\n"); - hexdump(stderr, "Received", - target + sizeof_padding, - vec->packet_len); - hexdump(stderr, "Expected", - vec->packet_out, vec->packet_len); + hexdump(stderr, "Received", target + sizeof_padding, + vec->msgSize / 8); + hexdump(stderr, "Expected", (const void *) vec->ct, + vec->msgSize / 8); return 0; } } else { - if (memcmp(vec->packet_in, target + sizeof_padding, - vec->packet_len)) { + if (memcmp((const void *) vec->msg, target + sizeof_padding, + vec->msgSize / 8)) { printf("cipher mismatched\n"); - hexdump(stderr, "Received", - target + sizeof_padding, - vec->packet_len); - hexdump(stderr, "Expected", vec->packet_in, - vec->packet_len); + hexdump(stderr, "Received", target + sizeof_padding, + vec->msgSize / 8); + hexdump(stderr, "Expected", (const void *) vec->msg, + vec->msgSize / 8); return 0; } } } else { /* out-of-place */ if (dir == IMB_DIR_ENCRYPT) { - if (memcmp(vec->packet_out + vec->clear_len, - target + sizeof_padding, - vec->packet_len - vec->clear_len)) { + if (memcmp(vec->ct + vec->aadSize / 8, target + sizeof_padding, + vec->msgSize / 8 - vec->aadSize / 8)) { printf("cipher mismatched\n"); - hexdump(stderr, "Received", - target + sizeof_padding, - vec->packet_len - vec->clear_len); - hexdump(stderr, "Expected", - vec->packet_out + vec->clear_len, - vec->packet_len - vec->clear_len); + hexdump(stderr, "Received", target + sizeof_padding, + vec->msgSize / 8 - vec->aadSize / 8); + hexdump(stderr, "Expected", vec->ct + vec->aadSize / 8, + vec->msgSize / 8 - vec->aadSize / 8); return 0; } } else { - if (memcmp(vec->packet_in + vec->clear_len, - target + sizeof_padding, - vec->packet_len - vec->clear_len)) { + if (memcmp(vec->msg + vec->aadSize / 8, target + sizeof_padding, + vec->msgSize / 8 - vec->aadSize / 8)) { printf("cipher mismatched\n"); - hexdump(stderr, "Received", - target + sizeof_padding, - vec->packet_len - vec->clear_len); - hexdump(stderr, "Expected", - vec->packet_in + vec->clear_len, - vec->packet_len - vec->clear_len); + hexdump(stderr, "Received", target + sizeof_padding, + vec->msgSize / 8 - vec->aadSize / 8); + hexdump(stderr, "Expected", vec->msg + vec->aadSize, + vec->msgSize / 8 - vec->aadSize / 8); return 0; } } @@ -2243,31 +110,29 @@ ccm_job_ok(const struct ccm_rfc3610_vector *vec, } if (in_place) { - if (memcmp(padding, target + sizeof_padding + vec->packet_len, - sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + vec->msgSize / 8, sizeof_padding)) { printf("cipher overwrite tail\n"); hexdump(stderr, "Target", - target + sizeof_padding + vec->packet_len, - sizeof_padding); + target + sizeof_padding + vec->msgSize / 8, sizeof_padding); return 0; } } else { - if (memcmp(padding, target + sizeof_padding + vec->packet_len - - vec->clear_len, sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + vec->msgSize / 8 - vec->aadSize / 8, + sizeof_padding)) { printf("cipher overwrite tail\n"); - hexdump(stderr, "Target", target + sizeof_padding + - vec->packet_len - vec->clear_len, + hexdump(stderr, "Target", target + sizeof_padding + vec->msgSize / 8 + - vec->aadSize / 8, sizeof_padding); return 0; } } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + vec->auth_len], + if (memcmp(padding, &auth[sizeof_padding + vec->tagSize / 8], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + vec->auth_len], sizeof_padding); + hexdump(stderr, "Target", &auth[sizeof_padding + vec->tagSize / 8], + sizeof_padding); return 0; } @@ -2277,13 +142,12 @@ ccm_job_ok(const struct ccm_rfc3610_vector *vec, return 0; } - if (memcmp(vec->packet_out + vec->packet_len, &auth[sizeof_padding], - vec->auth_len)) { + if (memcmp(vec->ct + vec->msgSize / 8, &auth[sizeof_padding], + vec->tagSize / 8)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], - vec->auth_len); - hexdump(stderr, "Expected", vec->packet_out + vec->packet_len, - vec->auth_len); + hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); + hexdump(stderr, "Expected", vec->ct + vec->msgSize / 8, + vec->tagSize / 8); return 0; } return 1; @@ -2291,7 +155,7 @@ ccm_job_ok(const struct ccm_rfc3610_vector *vec, static int test_ccm(struct IMB_MGR *mb_mgr, - const struct ccm_rfc3610_vector *vec, + const struct aead_test *vec, const int dir, const int in_place, const int num_jobs, const uint64_t key_length) @@ -2303,8 +167,7 @@ test_ccm(struct IMB_MGR *mb_mgr, uint8_t **targets = malloc(num_jobs * sizeof(void *)); uint8_t **auths = malloc(num_jobs * sizeof(void *)); int i = 0, jobs_rx = 0, ret = -1; - const int order = (dir == IMB_DIR_ENCRYPT) ? - IMB_ORDER_HASH_CIPHER : IMB_ORDER_CIPHER_HASH; + const int order = (dir == IMB_DIR_ENCRYPT) ? IMB_ORDER_HASH_CIPHER : IMB_ORDER_CIPHER_HASH; if (targets == NULL || auths == NULL) { fprintf(stderr, "Can't allocate buffer memory\n"); @@ -2316,30 +179,30 @@ test_ccm(struct IMB_MGR *mb_mgr, memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - targets[i] = malloc(vec->packet_len + (sizeof(padding) * 2)); + targets[i] = malloc(vec->msgSize / 8 + (sizeof(padding) * 2)); auths[i] = malloc(16 + (sizeof(padding) * 2)); if (targets[i] == NULL || auths[i] == NULL) { fprintf(stderr, "Can't allocate buffer memory\n"); goto end; } - memset(targets[i], -1, vec->packet_len + (sizeof(padding) * 2)); + memset(targets[i], -1, vec->msgSize / 8 + (sizeof(padding) * 2)); memset(auths[i], -1, 16 + (sizeof(padding) * 2)); if (in_place) { if (dir == IMB_DIR_ENCRYPT) - memcpy(targets[i] + sizeof(padding), - vec->packet_in, vec->packet_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->msg, + vec->msgSize / 8); else - memcpy(targets[i] + sizeof(padding), - vec->packet_out, vec->packet_len); + memcpy(targets[i] + sizeof(padding), (const void *) vec->ct, + vec->msgSize / 8); } } if (key_length == 16) - IMB_AES_KEYEXP_128(mb_mgr, vec->keys, expkey, dust); + IMB_AES_KEYEXP_128(mb_mgr, vec->key, expkey, dust); else - IMB_AES_KEYEXP_256(mb_mgr, vec->keys, expkey, dust); + IMB_AES_KEYEXP_256(mb_mgr, vec->key, expkey, dust); while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -2351,35 +214,35 @@ test_ccm(struct IMB_MGR *mb_mgr, job->chain_order = order; if (in_place) { job->dst = - targets[i] + sizeof(padding) + vec->clear_len; + targets[i] + sizeof(padding) + vec->aadSize / 8; job->src = targets[i] + sizeof(padding); } else { if (dir == IMB_DIR_ENCRYPT) { job->dst = targets[i] + sizeof(padding); - job->src = vec->packet_in; + job->src = (const void *) vec->msg; } else { job->dst = targets[i] + sizeof(padding); - job->src = vec->packet_out; + job->src = (const void *) vec->ct; } } job->cipher_mode = IMB_CIPHER_CCM; job->enc_keys = expkey; job->dec_keys = expkey; job->key_len_in_bytes = key_length; - job->iv = vec->nonce; - job->iv_len_in_bytes = vec->nonce_len; - job->cipher_start_src_offset_in_bytes = vec->clear_len; + job->iv = (const void *) vec->iv; + job->iv_len_in_bytes = vec->ivSize / 8; + job->cipher_start_src_offset_in_bytes = vec->aadSize / 8; job->msg_len_to_cipher_in_bytes = - vec->packet_len - vec->clear_len; + vec->msgSize / 8 - vec->aadSize / 8; job->hash_alg = IMB_AUTH_AES_CCM; - job->hash_start_src_offset_in_bytes = vec->clear_len; + job->hash_start_src_offset_in_bytes = vec->aadSize / 8; job->msg_len_to_hash_in_bytes = - vec->packet_len - vec->clear_len; + vec->msgSize / 8 - vec->aadSize / 8; job->auth_tag_output = auths[i] + sizeof(padding); - job->auth_tag_output_len_in_bytes = vec->auth_len; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; - job->u.CCM.aad_len_in_bytes = vec->clear_len; + job->u.CCM.aad_len_in_bytes = vec->aadSize / 8; job->u.CCM.aad = job->src; job->user_data = targets[i]; @@ -2389,8 +252,7 @@ test_ccm(struct IMB_MGR *mb_mgr, if (job) { jobs_rx++; if (num_jobs < 4) { - printf("%d Unexpected return from submit_job\n", - __LINE__); + printf("%d Unexpected return from submit_job\n", __LINE__); goto end; } if (!ccm_job_ok(vec, job, job->user_data, padding, @@ -2403,9 +265,8 @@ test_ccm(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!ccm_job_ok(vec, job, job->user_data, padding, - job->user_data2, sizeof(padding), dir, - in_place)) + if (!ccm_job_ok(vec, job, job->user_data, padding, job->user_data2, + sizeof(padding), dir, in_place)) goto end; } @@ -2441,55 +302,45 @@ test_ccm_128_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { - const int vectors_cnt = sizeof(ccm_vectors) / sizeof(ccm_vectors[0]); - int vect; + const struct aead_test *v = ccm_128_test_json; if (!quiet_mode) printf("AES-CCM-128 standard test vectors (N jobs = %d):\n", num_jobs); - for (vect = 1; vect <= vectors_cnt; vect++) { - const int idx = vect - 1; + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector [%d/%d] NONCELen:%d PktLen:%d " - "AADLen:%d AUTHlen:%d\n", - vect, vectors_cnt, - (int) ccm_vectors[idx].nonce_len, - (int) ccm_vectors[idx].packet_len, - (int) ccm_vectors[idx].clear_len, - (int) ccm_vectors[idx].auth_len); + printf("Standard vector %zu NONCELen:%zu PktLen:%zu AADLen:%zu " + "Digestlen:%zu\n", v->tcId, v->ivSize / 8, v->msgSize / 8, + v->aadSize / 8, v->tagSize / 8); #else printf("."); #endif } - if (test_ccm(mb_mgr, &ccm_vectors[idx], IMB_DIR_ENCRYPT, 1, - num_jobs, 16)) { - printf("error #%d encrypt in-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_ENCRYPT, 1, num_jobs, IMB_KEY_128_BYTES)) { + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ccm(mb_mgr, &ccm_vectors[idx], IMB_DIR_DECRYPT, 1, - num_jobs, 16)) { - printf("error #%d decrypt in-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_DECRYPT, 1, num_jobs, IMB_KEY_128_BYTES)) { + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ccm(mb_mgr, &ccm_vectors[idx], IMB_DIR_ENCRYPT, 0, - num_jobs, 16)) { - printf("error #%d encrypt out-of-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_ENCRYPT, 0, num_jobs, IMB_KEY_128_BYTES)) { + printf("error #%zu encrypt out-of-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ccm(mb_mgr, &ccm_vectors[idx], IMB_DIR_DECRYPT, 0, - num_jobs, 16)) { - printf("error #%d decrypt out-of-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_DECRYPT, 0, num_jobs, IMB_KEY_128_BYTES)) { + printf("error #%zu decrypt out-of-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -2504,56 +355,46 @@ test_ccm_256_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { - const int vectors_cnt = DIM(ccm_256_vectors); - int vect; + const struct aead_test *v = ccm_256_test_json; if (!quiet_mode) printf("AES-CCM-256 standard test vectors (N jobs = %d):\n", num_jobs); - for (vect = 1; vect <= vectors_cnt; vect++) { - const int idx = vect - 1; + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector [%d/%d] NONCELen:%d PktLen:%d " - "AADLen:%d AUTHlen:%d\n", - vect, vectors_cnt, - (int) ccm_256_vectors[idx].nonce_len, - (int) ccm_256_vectors[idx].packet_len, - (int) ccm_256_vectors[idx].clear_len, - (int) ccm_256_vectors[idx].auth_len); + printf("Standard vector %zu NONCELen:%zu PktLen:%zu AADLen:%zu " + "Digestlen:%zu\n", v->tcId, v->ivSize / 8, v->msgSize / 8, + v->aadSize / 8, v->tagSize / 8); #else printf("."); #endif } - if (test_ccm(mb_mgr, &ccm_256_vectors[idx], IMB_DIR_ENCRYPT, 1, - num_jobs, 32)) { - printf("error #%d encrypt in-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_ENCRYPT, 1, num_jobs, IMB_KEY_256_BYTES)) { + printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ccm(mb_mgr, &ccm_256_vectors[idx], IMB_DIR_DECRYPT, 1, - num_jobs, 32)) { - printf("error #%d decrypt in-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_DECRYPT, 1, num_jobs, IMB_KEY_256_BYTES)) { + printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ccm(mb_mgr, &ccm_256_vectors[idx], IMB_DIR_ENCRYPT, 0, - num_jobs, 32)) { - printf("error #%d encrypt out-of-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_ENCRYPT, 0, num_jobs, IMB_KEY_256_BYTES)) { + printf("error #%zu encrypt out-of-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ccm(mb_mgr, &ccm_256_vectors[idx], IMB_DIR_DECRYPT, 0, - num_jobs, 32)) { - printf("error #%d decrypt out-of-place\n", vect); + if (test_ccm(mb_mgr, v, IMB_DIR_DECRYPT, 0, num_jobs, IMB_KEY_256_BYTES)) { + printf("error #%zu decrypt out-of-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -2572,38 +413,14 @@ ccm_test(struct IMB_MGR *mb_mgr) /* AES-CCM-128 tests */ test_suite_start(&ctx, "AES-CCM-128"); - test_ccm_128_std_vectors(mb_mgr, &ctx, 1); - test_ccm_128_std_vectors(mb_mgr, &ctx, 3); - test_ccm_128_std_vectors(mb_mgr, &ctx, 4); - test_ccm_128_std_vectors(mb_mgr, &ctx, 5); - test_ccm_128_std_vectors(mb_mgr, &ctx, 7); - test_ccm_128_std_vectors(mb_mgr, &ctx, 8); - test_ccm_128_std_vectors(mb_mgr, &ctx, 9); - test_ccm_128_std_vectors(mb_mgr, &ctx, 10); - test_ccm_128_std_vectors(mb_mgr, &ctx, 13); - test_ccm_128_std_vectors(mb_mgr, &ctx, 14); - test_ccm_128_std_vectors(mb_mgr, &ctx, 15); - test_ccm_128_std_vectors(mb_mgr, &ctx, 17); - test_ccm_128_std_vectors(mb_mgr, &ctx, 18); - test_ccm_128_std_vectors(mb_mgr, &ctx, 19); + for (int i = 0; i <= 19; i++) + test_ccm_128_std_vectors(mb_mgr, &ctx, i); errors += test_suite_end(&ctx); /* AES-CCM-256 tests */ test_suite_start(&ctx, "AES-CCM-256"); - test_ccm_256_std_vectors(mb_mgr, &ctx, 1); - test_ccm_256_std_vectors(mb_mgr, &ctx, 3); - test_ccm_256_std_vectors(mb_mgr, &ctx, 4); - test_ccm_256_std_vectors(mb_mgr, &ctx, 5); - test_ccm_256_std_vectors(mb_mgr, &ctx, 7); - test_ccm_256_std_vectors(mb_mgr, &ctx, 8); - test_ccm_256_std_vectors(mb_mgr, &ctx, 9); - test_ccm_256_std_vectors(mb_mgr, &ctx, 10); - test_ccm_256_std_vectors(mb_mgr, &ctx, 13); - test_ccm_256_std_vectors(mb_mgr, &ctx, 14); - test_ccm_256_std_vectors(mb_mgr, &ctx, 15); - test_ccm_256_std_vectors(mb_mgr, &ctx, 17); - test_ccm_256_std_vectors(mb_mgr, &ctx, 18); - test_ccm_256_std_vectors(mb_mgr, &ctx, 19); + for (int i = 0; i <= 19; i++) + test_ccm_256_std_vectors(mb_mgr, &ctx, i); errors += test_suite_end(&ctx); return errors; diff --git a/test/kat-app/ccm_test.json.c b/test/kat-app/ccm_test.json.c new file mode 100644 index 00000000..d2907574 --- /dev/null +++ b/test/kat-app/ccm_test.json.c @@ -0,0 +1,552 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* AES-CCM, RFC3610 */ +#include "aead_test.h" + +const struct aead_test ccm_128_test_json[] = { + /* Vectors from https://tools.ietf.org/html/rfc3610 */ + {104, 128, 64, 1, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x03\x02\x01\x00\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x58\x8c\x97\x9a\x61\xc6\x63\xd2\xf0\x66" + "\xd0\xc2\xc0\xf9\x89\x80\x6d\x5f\x6b\x61\xda\xc3\x84\x17\xe8\xd1\x2c\xfd" + "\xf9\x26\xe0", + "", 1, 64, 248}, + {104, 128, 64, 2, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x04\x03\x02\x01\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x72\xc9\x1a\x36\xe1\x35\xf8\xcf\x29\x1c" + "\xa8\x94\x08\x5c\x87\xe3\xcc\x15\xc4\x39\xc9\xe4\x3a\x3b\xa0\x91\xd5\x6e" + "\x10\x40\x09\x16", + "", 1, 64, 256}, + {104, 128, 64, 3, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x05\x04\x03\x02\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x51\xb1\xe5\xf4\x4a\x19\x7d\x1d\xa4\x6b" + "\x0f\x8e\x2d\x28\x2a\xe8\x71\xe8\x38\xbb\x64\xda\x85\x96\x57\x4a\xda\xa7" + "\x6f\xbd\x9f\xb0\xc5", + "", 1, 64, 264}, + {104, 128, 64, 4, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x06\x05\x04\x03\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xa2\x8c\x68\x65\x93\x9a" + "\x9a\x79\xfa\xaa\x5c\x4c\x2a\x9d\x4a\x91\xcd\xac\x8c\x96\xc8\x61\xb9\xc9" + "\xe6\x1e\xf1", + "", 1, 96, 248}, + {104, 128, 64, 5, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x07\x06\x05\x04\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xdc\xf1\xfb\x7b\x5d\x9e" + "\x23\xfb\x9d\x4e\x13\x12\x53\x65\x8a\xd8\x6e\xbd\xca\x3e\x51\xe8\x3f\x07" + "\x7d\x9c\x2d\x93", + "", 1, 96, 256}, + {104, 128, 64, 6, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x08\x07\x06\x05\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x6f\xc1\xb0\x11\xf0\x06" + "\x56\x8b\x51\x71\xa4\x2d\x95\x3d\x46\x9b\x25\x70\xa4\xbd\x87\x40\x5a\x04" + "\x43\xac\x91\xcb\x94", + "", 1, 96, 264}, + {104, 128, 80, 7, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x09\x08\x07\x06\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x01\x35\xd1\xb2\xc9\x5f\x41\xd5\xd1\xd4" + "\xfe\xc1\x85\xd1\x66\xb8\x09\x4e\x99\x9d\xfe\xd9\x6c\x04\x8c\x56\x60\x2c" + "\x97\xac\xbb\x74\x90", + "", 1, 64, 248}, + {104, 128, 80, 8, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0a\x09\x08\x07\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x7b\x75\x39\x9a\xc0\x83\x1d\xd2\xf0\xbb" + "\xd7\x58\x79\xa2\xfd\x8f\x6c\xae\x6b\x6c\xd9\xb7\xdb\x24\xc1\x7b\x44\x33" + "\xf4\x34\x96\x3f\x34\xb4", + "", 1, 64, 256}, + {104, 128, 80, 9, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0b\x0a\x09\x08\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x82\x53\x1a\x60\xcc\x24\x94\x5a\x4b\x82" + "\x79\x18\x1a\xb5\xc8\x4d\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1\x97\xea\x9c\x07" + "\xe5\x6b\x5e\xb1\x7e\x5f\x4e", + "", 1, 64, 264}, + {104, 128, 80, 10, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0c\x0b\x0a\x09\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x07\x34\x25\x94\x15\x77" + "\x85\x15\x2b\x07\x40\x98\x33\x0a\xbb\x14\x1b\x94\x7b\x56\x6a\xa9\x40\x6b" + "\x4d\x99\x99\x88\xdd", + "", 1, 96, 248}, + {104, 128, 80, 11, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0d\x0c\x0b\x0a\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x67\x6b\xb2\x03\x80\xb0" + "\xe3\x01\xe8\xab\x79\x59\x0a\x39\x6d\xa7\x8b\x83\x49\x34\xf5\x3a\xa2\xe9" + "\x10\x7a\x8b\x6c\x02\x2c", + "", 1, 96, 256}, + {104, 128, 80, 12, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0e\x0d\x0c\x0b\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xc0\xff\xa0\xd6\xf0\x5b" + "\xdb\x67\xf2\x4d\x43\xa4\x33\x8d\x2a\xa4\xbe\xd7\xb2\x0e\x43\xcd\x1a\xa3" + "\x16\x62\xe7\xad\x65\xd6\xdb", + "", 1, 96, 264}, + {104, 128, 64, 13, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x41\x2b\x4e\xa9\xcd\xbe\x3c\x96\x96\x76\x6c\xfa", "", + "\x0b\xe1\xa8\x8b\xac\xe0\x18\xb1\x08\xe8\xcf\x97\xd8\x20\xea\x25\x84\x60" + "\xe9\x6a\xd9\xcf\x52\x89\x05\x4d\x89\x5c\xea\xc4\x7c", + "\x0b\xe1\xa8\x8b\xac\xe0\x18\xb1\x4c\xb9\x7f\x86\xa2\xa4\x68\x9a\x87\x79" + "\x47\xab\x80\x91\xef\x53\x86\xa6\xff\xbd\xd0\x80\xf8\xe7\x8c\xf7\xcb\x0c" + "\xdd\xd7\xb3", + "", 1, 64, 248}, + {104, 128, 64, 14, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x33\x56\x8e\xf7\xb2\x63\x3c\x96\x96\x76\x6c\xfa", "", + "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb\x90\x20\xea\x6f\x91\xbd\xd8\x5a\xfa\x00" + "\x39\xba\x4b\xaf\xf9\xbf\xb7\x9c\x70\x28\x94\x9c\xd0\xec", + "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa\xa0\x72" + "\x6c\x55\xd3\x78\x06\x12\x98\xc8\x5c\x92\x81\x4a\xbc\x33\xc5\x2e\xe8\x1d" + "\x7d\x77\xc0\x8a", + "", 1, 64, 256}, + {104, 128, 64, 15, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x10\x3f\xe4\x13\x36\x71\x3c\x96\x96\x76\x6c\xfa", "", + "\xaa\x6c\xfa\x36\xca\xe8\x6b\x40\xb9\x16\xe0\xea\xcc\x1c\x00\xd7\xdc\xec" + "\x68\xec\x0b\x3b\xbb\x1a\x02\xde\x8a\x2d\x1a\xa3\x46\x13\x2e", + "\xaa\x6c\xfa\x36\xca\xe8\x6b\x40\xb1\xd2\x3a\x22\x20\xdd\xc0\xac\x90\x0d" + "\x9a\xa0\x3c\x61\xfc\xf4\xa5\x59\xa4\x41\x77\x67\x08\x97\x08\xa7\x76\x79" + "\x6e\xdb\x72\x35\x06", + "", 1, 64, 264}, + {104, 128, 64, 16, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x76\x4c\x63\xb8\x05\x8e\x3c\x96\x96\x76\x6c\xfa", "", + "\xd0\xd0\x73\x5c\x53\x1e\x1b\xec\xf0\x49\xc2\x44\x12\xda\xac\x56\x30\xef" + "\xa5\x39\x6f\x77\x0c\xe1\xa6\x6b\x21\xf7\xb2\x10\x1c", + "\xd0\xd0\x73\x5c\x53\x1e\x1b\xec\xf0\x49\xc2\x44\x14\xd2\x53\xc3\x96\x7b" + "\x70\x60\x9b\x7c\xbb\x7c\x49\x91\x60\x28\x32\x45\x26\x9a\x6f\x49\x97\x5b" + "\xca\xde\xaf", + "", 1, 96, 248}, + {104, 128, 64, 17, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\xf8\xb6\x78\x09\x4e\x3b\x3c\x96\x96\x76\x6c\xfa", "", + "\x77\xb6\x0f\x01\x1c\x03\xe1\x52\x58\x99\xbc\xae\xe8\x8b\x6a\x46\xc7\x8d" + "\x63\xe5\x2e\xb8\xc5\x46\xef\xb5\xde\x6f\x75\xe9\xcc\x0d", + "\x77\xb6\x0f\x01\x1c\x03\xe1\x52\x58\x99\xbc\xae\x55\x45\xff\x1a\x08\x5e" + "\xe2\xef\xbf\x52\xb2\xe0\x4b\xee\x1e\x23\x36\xc7\x3e\x3f\x76\x2c\x0c\x77" + "\x44\xfe\x7e\x3c", + "", 1, 96, 256}, + {104, 128, 64, 18, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\xd5\x60\x91\x2d\x3f\x70\x3c\x96\x96\x76\x6c\xfa", "", + "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81\x20\xea\x60\xc0\x64\x35\xac\xba\xfb\x11" + "\xa8\x2e\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9\x3a\x80\x3b\xa8\x7f", + "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81\x20\xea\x60\xc0\x00\x97\x69\xec\xab\xdf" + "\x48\x62\x55\x94\xc5\x92\x51\xe6\x03\x57\x22\x67\x5e\x04\xc8\x47\x09\x9e" + "\x5a\xe0\x70\x45\x51", + "", 1, 96, 264}, + {104, 128, 80, 19, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x42\xff\xf8\xf1\x95\x1c\x3c\x96\x96\x76\x6c\xfa", "", + "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8\x8a\x19\xb9\x50\xbc\xf7\x1a\x01\x8e\x5e" + "\x67\x01\xc9\x17\x87\x65\x98\x09\xd6\x7d\xbe\xdd\x18", + "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8\xbc\x21\x8d\xaa\x94\x74\x27\xb6\xdb\x38" + "\x6a\x99\xac\x1a\xef\x23\xad\xe0\xb5\x29\x39\xcb\x6a\x63\x7c\xf9\xbe\xc2" + "\x40\x88\x97\xc6\xba", + "", 1, 64, 248}, + {104, 128, 80, 20, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x92\x0f\x40\xe5\x6c\xdc\x3c\x96\x96\x76\x6c\xfa", "", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x17\x61\x43\x3c\x37\xc5\xa3\x5f\xc1\xf3" + "\x9f\x40\x63\x02\xeb\x90\x7c\x61\x63\xbe\x38\xc9\x84\x37", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x58\x10\xe6\xfd\x25\x87\x40\x22\xe8\x03" + "\x61\xa4\x78\xe3\xe9\xcf\x48\x4a\xb0\x4f\x44\x7e\xff\xf6\xf0\xa4\x77\xcc" + "\x2f\xc9\xbf\x54\x89\x44", + "", 1, 64, 256}, + {104, 128, 80, 21, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x27\xca\x0c\x71\x20\xbc\x3c\x96\x96\x76\x6c\xfa", "", + "\x44\xa3\xaa\x3a\xae\x64\x75\xca\xa4\x34\xa8\xe5\x85\x00\xc6\xe4\x15\x30" + "\x53\x88\x62\xd6\x86\xea\x9e\x81\x30\x1b\x5a\xe4\x22\x6b\xfa", + "\x44\xa3\xaa\x3a\xae\x64\x75\xca\xf2\xbe\xed\x7b\xc5\x09\x8e\x83\xfe\xb5" + "\xb3\x16\x08\xf8\xe2\x9c\x38\x81\x9a\x89\xc8\xe7\x76\xf1\x54\x4d\x41\x51" + "\xa4\xed\x3a\x8b\x87\xb9\xce", + "", 1, 64, 264}, + {104, 128, 80, 22, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x5b\x8c\xcb\xcd\x9a\xf8\x3c\x96\x96\x76\x6c\xfa", "", + "\xec\x46\xbb\x63\xb0\x25\x20\xc3\x3c\x49\xfd\x70\xb9\x6b\x49\xe2\x1d\x62" + "\x17\x41\x63\x28\x75\xdb\x7f\x6c\x92\x43\xd2\xd7\xc2", + "\xec\x46\xbb\x63\xb0\x25\x20\xc3\x3c\x49\xfd\x70\x31\xd7\x50\xa0\x9d\xa3" + "\xed\x7f\xdd\xd4\x9a\x20\x32\xaa\xbf\x17\xec\x8e\xbf\x7d\x22\xc8\x08\x8c" + "\x66\x6b\xe5\xc1\x97", + "", 1, 96, 248}, + {104, 128, 80, 23, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x3e\xbe\x94\x04\x4b\x9a\x3c\x96\x96\x76\x6c\xfa", "", + "\x47\xa6\x5a\xc7\x8b\x3d\x59\x42\x27\xe8\x5e\x71\xe2\xfc\xfb\xb8\x80\x44" + "\x2c\x73\x1b\xf9\x51\x67\xc8\xff\xd7\x89\x5e\x33\x70\x76", + "\x47\xa6\x5a\xc7\x8b\x3d\x59\x42\x27\xe8\x5e\x71\xe8\x82\xf1\xdb\xd3\x8c" + "\xe3\xed\xa7\xc2\x3f\x04\xdd\x65\x07\x1e\xb4\x13\x42\xac\xdf\x7e\x00\xdc" + "\xce\xc7\xae\x52\x98\x7d", + "", 1, 96, 256}, + {104, 128, 80, 24, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\xd4", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xf3\x29\x05\xb8\x8a\x64" + "\x1b\x04\xb9\xc9\xff\xb5\x8c\xc3\x90\x90\x0f\x3d\xa1\x2a\xb1\x6d\xce\x9e" + "\x82\xef\xa1\x6d\xa6\x20\x59", + "", 1, 96, 264}, + {104, 128, 80, 25, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xf3\x29\x05\xb8\x8a\x64" + "\x1b\x04\xb9\xc9\xff\xb5\x8c\xc3\x90\x90\x0f\x3d\xa1\x2a\x67\x22\xc6\x10" + "\xce\x6f\xe2\x08\x0c\x38\xd7\xae\x61\x82\x21\x3d\x59\x67\xf3\x26\x72\x53" + "\x78\x37\xe4\xba\xa7\xed\x92\x52\xd6\x01\xa5\x66\x52\x20\x6c\x51\xdb\x15" + "\x6c\xf8\x59\x38\xaf\x28\x4d\xb7\x5f\x2a\xc8\xb0\x6e\x37\x77\x89\xb0\x6d" + "\xc3\xe5\xf2\x2a\xa6\xf7\xdb\xcc\x37\x79\x88\x0e\x8f\x05\xa9\xe1\x9e\x11" + "\x90\x3d\x2a\xb9\x70\x13\x9d\xc3\x93\xad\xe2\x5d\xff\xdd\x19\x0f\xb9\x9e" + "\x74\x88\xab\x82\x0c\xa0\x2e\x71\xa6\x32\xeb\xa4\xba\x10\xf6\x61\x7b\x1b" + "\x2a\x38\x80\xeb\xe9\x09\x01\x33\x94\x8f\xb3\xd4\xad\x6c\xd8\x5e\x85\x98" + "\xc5\x9c\x11\x62\x2c\x60\x32\xae\x70\xe1\x66\x73\x09\x1e\x20\x55\xb7\x20" + "\x77\x86\x09\xc8\x1c\xfe\x86\xa7\x08\x40\x43\xe7\xad\xb2\x5b\x39\x64\xcb" + "\x13\x1f\x8d\xd2\x4f\xcc\xc5\xaa\xf1\xd6\x31\xfc\x34\x9e\x5f\x90\xc4\xb7" + "\xe0\x07\x9c\xcd\xfb\xea\xe3\x75\xb5\x7b\x29\xd4\x73\x81\xef\x9c\x2e\xac" + "\xf9\xa7\x39\x2a\xf8\xe2\xea\x3a\x6a\xdf\xd0\x3a\xca\x29\xd3\x13\x13\x9a" + "\x2c\x70\xa4\xa9\x40\x1d\xec\xc7\xc9\x6b\xf7\x23\xd4\x53\x49\xd0\x05\xce" + "\x15\x65\xce\x1f\x89\xe2\xbe\xe0\xfa\x3f\x59\x4a\x89\x99\xe5\xdb\xa0\xe8" + "\x54\x72\x42\x69\x79\x63\x68\x91\xc9\x2c\xfc\x58\xd4\x30\xfe\xe3\x62\x5f" + "\xdc\x49\xef\x32\x58\x83\x27\xa9\xed\xec\xf3\x1d\xfb\xea\x0a\x89", + "", 1, 96, 2496}, + {56, 128, 32, 26, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x4d\xac\x25\x5d", "", 1, + 64, 96}, + {104, 128, 64, 27, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd" + "\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46" + "\xe8\x0c\x3c\x04\xd0\x19\x78\x45\xce\x0b\x16\xf9\x76\x23", + "", 1, 176, 336}, + {104, 128, 64, 28, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" + "\xa0\x50", + "\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04" + "\xd0\x19\x41\x83\x21\x89\xa3\xd3\x1b\x43", + "", 1, 0, 160}, + {56, 128, 48, 29, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xb0\xc9\x5e\x58\x03\x6e", + "", 1, 64, 96}, + {56, 128, 64, 30, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xd0\xad\x86\xfd\x33\xc2" + "\x69\x86", + "", 1, 64, 96}, + {56, 128, 80, 31, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x05\x12\xda\xbf\xd9\x72" + "\xa6\x68\x53\xc1", + "", 1, 64, 96}, + {56, 128, 96, 32, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xba\x03\xbf\x8c\xe0\xd6" + "\x00\xa4\x48\x6f\xcc\xb3", + "", 1, 64, 96}, + {56, 128, 112, 33, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x6b\x9b\xfb\xfe\xa8\x2c" + "\x04\x77\x8e\x67\xf5\x18\x46\xc6", + "", 1, 64, 96}, + {56, 128, 128, 34, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x2b\xb5\x7c\x0a\xf4\x5e" + "\x4d\x83\x04\xf0\x5f\x45\x99\x3f\x15\x17", + "", 1, 64, 96}, + {56, 128, 32, 35, + "\x4a\xe7\x01\x10\x3c\x63\xde\xca\x5b\x5a\x39\x39\xd7\xd0\x59\x92", + "\x5a\x8a\xa4\x85\xc3\x16\xe9", "", "", "\x02\x20\x9f\x55", "", 1, 0, 0}, + {104, 128, 64, 36, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xf8\xba\x1a\x55" + "\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xf3\xd0\xa2\xfe" + "\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x60\x76" + "\xe8\xe2\x0c\x0a\xf6\xdf", + "", 1, 112, 272}, + {104, 128, 64, 37, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf8\xba\x1a\x55" + "\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf3\xd0\xa2\xfe" + "\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x35\x0d" + "\xa5\xaa\x1e\x71\x82\x35", + "", 1, 256, 416}, + {104, 128, 64, 38, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" + "\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04" + "\xd0\x19\x26\x5a\x04\xb1\x56\xff\x9f\x0e", + "", 1, 288, 448}, + {104, 128, 64, 39, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\xf8\xba\x1a\x55\xd0\x2f\x85\xae" + "\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23" + "\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x07\x55\x13\x40\x2b\x11" + "\x6d\xd5", + "", 1, 368, 528}, + {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} +}; + +const struct aead_test ccm_256_test_json[] = { + /* Vectors from https://tools.ietf.org/html/rfc3610 */ + {104, 256, 64, 1, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x03\x02\x01\x00\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x21\x61\x63\xde\xcf\x74\xe0\x0c\xab\x04" + "\x56\xff\x45\xcd\xa7\x17\x1f\xa5\x96\xd7\x0f\x76\x91\xca\x8a\xfa\xa2\x3f" + "\x22\x3e\x64", + "", 1, 64, 248}, + {104, 256, 64, 2, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x04\x03\x02\x01\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x61\x6a\x60\x6d\x54\x41\x94\xab\x29\xd2" + "\xa9\x86\x14\xda\x02\x40\x14\xfa\xc5\xce\x97\x0a\xa1\xe9\xf1\xa3\xed\x0e" + "\xe1\x2a\x9b\x69", + "", 1, 64, 256}, + {104, 256, 64, 3, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x05\x04\x03\x02\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x75\x4c\xdd\xea\x13\x59\x9b\x30\xba\xc6" + "\xd4\x0d\x12\x0d\x43\x0a\x2b\x44\xc4\x0b\x1f\xde\x31\x24\xc4\x9e\xd2\xc4" + "\xf4\x04\xdc\xf3\xeb", + "", 1, 64, 264}, + {104, 256, 64, 4, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x06\x05\x04\x03\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x5c\x14\xc7\x8c\x02\xc5" + "\xa2\x64\xd8\xdf\x46\x57\x88\x34\xef\x27\xc1\xa3\x01\xef\xda\x9e\x13\xc7" + "\x00\xcc\x63", + "", 1, 96, 248}, + {104, 256, 64, 5, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x07\x06\x05\x04\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x2c\xf8\x28\xa5\x5a\x7d" + "\xef\xf1\x63\x3d\x26\x72\xa0\x7b\x35\x2c\x3d\xc5\xb4\xe5\x8f\xc4\x9d\x90" + "\xbe\x78\x94\xa5", + "", 1, 96, 256}, + {104, 256, 80, 6, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b\xd7\x82" + "\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x92\x0f\x40\xe5\x6c\xdc\x3c\x96\x96\x76\x6c\xfa", "", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x17\x61\x43\x3c\x37\xc5\xa3\x5f\xc1\xf3" + "\x9f\x40\x63\x02\xeb\x90\x7c\x61\x63\xbe\x38\xc9\x84\x37", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x8e\xef\xd9\x8c\x25\x6f\xef\xcd\xc3\xc0" + "\xad\x3c\x42\xb1\xd7\x44\x2b\x44\x75\x41\xc3\xb1\x18\x85\x90\x59\x3c\x67" + "\xe2\xf7\x9e\x2a\xce\x9e", + "", 1, 64, 256}, + {104, 256, 80, 7, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b\xd7\x82" + "\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\x23\x68\x7a\x56\x54\x09" + "\x51\xb0\x13\x4f\x65\xe9\xcd\xe6\xac\x57\x22\x59\x28\xe3\x93\xea\xa6\xc5" + "\x14\xbf\x9d\x1d\x5d\xb0\xa3\x16\xb2\x4a\x09\xe8\x9a\xd2\xe4\x04\x66\x01" + "\x84\xd3\xaf\x85\x02\x69\xf4\xa2\x43\x5c\x98\x13\xf1\x96\x99\x68\xc1\x8c" + "\x4b\x3f\x69\xce\x05\x26\x12\x76\xdb\xb7\x7d\x99\xcc\x0b\x6e\x43\x03\x75" + "\xff\xd9\x85\x8e\x1c\x4e\x7d\x0f\x4d\xfd\x1c\x6a\x1e\x5c\xf4\x17\x3a\xa9" + "\x1f\xf8\xd0\xad\xf8\xb6\x8b\xc1\xb5\xff\x71\x6f\xbe\x18\x92\xed\x43\x73" + "\x04\xed\xb9\x78\x35\xa4\x70\x99\xdd\x62\xc0\x68\x84\x68\x5f\x37\x3c\x9f" + "\xdd\x8b\xfb\x75\x82\x47\xae\x1b\x21\x54\x5e\x1e\x43\x7c\x63\xc5\xb5\x47" + "\xa7\x65\x56\x47\xba\xc5\x30\x4b\x4a\xad\xa5\x68\x5d\x22\x31\xb8\x92\x25" + "\x4d\x42\x8b\x51\xf8\xfb\xba\x1a\xaa\x86\x71\x3e\x22\xc0\x7f\xd7\x58\xd0" + "\x25\x90\xf5\x18\xf7\xe9\x69\xe3\x6f\x5e\x1c\x38\xa3\x52\xa3\x49\x4b\x70" + "\x1e\xb6\x13\x65\xf7\x1a\xf9\xe0\x03\x94\x2b\x4b\xd9\xb0\x18\xa8\x2a\xda" + "\x80\xd4\x88\xd3\x0b\x37\xe1\x4a\xbe\xbf\xd9\x2c\x84\xd1\xf5\x56\x5c\x79" + "\x14\x77\x1b\x9d\x34\x65\x22\x39\x78\x4d\xee\x29\x9a\x80\x42\x2a\xaf\x3d" + "\x84\xb7\x3c\x60\xa6\x08\x4c\xbb\x2b\x8e\xdb\x94\x4d\x72\x08\x1b\x29\xd1" + "\xe9\xdb\xe9\x53\x2c\xc0\x22\xe0\x75\x27\x61\x2e\x26\xe4\x80\x2a\xb0\xd3" + "\xf4\x4e\x90\x91\x92\xdb\x92\xe1\x4f\x3d\x53\x58\xc8\x86\x18\x5d", + "", 1, 96, 2496}, + {56, 256, 32, 8, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" + "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\x45\x50\xab\xab", "", 1, + 64, 96}, + {104, 256, 64, 9, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f\xc9\x7c" + "\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd" + "\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x12\x2a\xb4\xd4\x01\xc3\x1a\x55\xe0\x59\x6a\x5e\xcc\x37" + "\xdb\xd4\xa2\xb5\x3f\xd8\x42\x1d\xb8\xe9\xbf\x60\x3f\xe8", + "", 1, 176, 336}, + {56, 256, 80, 10, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" + "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\xf8\x16\xab\xe3\xa7\xc9" + "\x26\xb4\x3d\xea", + "", 1, 64, 96}, + {104, 256, 64, 11, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f\xc9\x7c" + "\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" + "\xa0\x50", + "\x12\x2a\xb4\xd4\x01\xc3\x1a\x55\xe0\x59\x6a\x5e\xcc\x37\xdb\xd4\xa2\xb5" + "\x3f\xd8\x1c\x89\xde\xf3\x72\x03\x96\x19", + "", 1, 0, 160}, + {56, 256, 128, 12, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" + "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\x45\x80\xd7\x1d\xa5\x34" + "\x5f\x7c\xf9\x11\xb9\x95\x19\x86\x90\x30", + "", 1, 64, 96}, + {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index b333598b..f1c813ca 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 118da81571dae6ba6fd0e81acd52fadefe1c2f79 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 10 Jul 2023 14:26:24 +0100 Subject: [PATCH 048/204] workflows: move all linux builds into one workflow --- .github/workflows/cmake_linux_makefile.yml | 64 --------- .github/workflows/linux.yml | 154 +++++++++++++++++++++ 2 files changed, 154 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/cmake_linux_makefile.yml create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/cmake_linux_makefile.yml b/.github/workflows/cmake_linux_makefile.yml deleted file mode 100644 index 59076f52..00000000 --- a/.github/workflows/cmake_linux_makefile.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: CMake - Linux-Makefile - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - # Build and test release build - Release: - env: - BUILD_TYPE: Release - runs-on: ubuntu-latest - - steps: - - name: Install NASM - run: sudo apt-get install -y nasm - - - uses: actions/checkout@v3 - with: - repository: 'intel/intel-ipsec-mb' - - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest -j 5 -C ${{env.BUILD_TYPE}} - - - name: Install - working-directory: ${{github.workspace}}/build - run: sudo cmake --install . - - - name: Test installation - working-directory: ${{github.workspace}}/examples/burst-app - run: gcc main.c -lIPSec_MB - - Debug: - # Build and test debug build - env: - BUILD_TYPE: Debug - runs-on: ubuntu-latest - - steps: - - name: Install NASM - run: sudo apt-get install -y nasm - - - uses: actions/checkout@v3 - with: - repository: 'intel/intel-ipsec-mb' - - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest -j 5 -C ${{env.BUILD_TYPE}} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..6a1b159d --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,154 @@ +name: Linux + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + # Build shared library with Make (GCC) + release-make-gcc-shared: + runs-on: ubuntu-latest + + steps: + - name: Install packages + run: sudo apt-get install -y nasm + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: intel/intel-ipsec-mb + + - name: Build + run: make -j + + - name: Install + run: sudo make install + + - name: Test installation + working-directory: ${{github.workspace}}/examples/burst-app + run: gcc main.c -lIPSec_MB + + # Build static library with Make (GCC) + release-make-gcc-static: + runs-on: ubuntu-latest + + steps: + - name: Install packages + run: sudo apt-get install -y nasm + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: intel/intel-ipsec-mb + + - name: Build + run: make SHARED=n -j + + # Build shared library with Make (Clang) + release-make-clang-shared: + runs-on: ubuntu-latest + + steps: + - name: Install packages + run: sudo apt-get install -y nasm clang + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: intel/intel-ipsec-mb + + - name: Build + run: make CC=clang -j + + # Build static library with Make (Clang) + release-make-clang-static: + runs-on: ubuntu-latest + + steps: + - name: Install packages + run: sudo apt-get install -y nasm clang + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: intel/intel-ipsec-mb + + - name: Build + run: make CC=clang SHARED=n -j + + # Build shared library with Make and AESNI emulation enabled (Clang) + release-make-clang-shared-aesni-emu: + runs-on: ubuntu-latest + + steps: + - name: Install packages + run: sudo apt-get install -y nasm clang + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: intel/intel-ipsec-mb + + - name: Build + run: make CC=clang AESNI_EMU=y -j + + # CMake release build with shared library (Makefiles) + release-cmake-gcc-shared: + env: + BUILD_TYPE: Release + runs-on: ubuntu-latest + + steps: + - name: Install packages + run: sudo apt-get install -y nasm + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -j 5 -C ${{env.BUILD_TYPE}} + + - name: Install + working-directory: ${{github.workspace}}/build + run: sudo cmake --install . + + - name: Test installation + working-directory: ${{github.workspace}}/examples/burst-app + run: gcc main.c -lIPSec_MB + + # CMake debug build with shared library (Makefiles) + debug-cmake-gcc-shared: + env: + BUILD_TYPE: Debug + runs-on: ubuntu-latest + + steps: + - name: Install packages + run: sudo apt-get install -y nasm + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -j 5 -C ${{env.BUILD_TYPE}} + -- GitLab From 946c1f6a97b47f2f469662f97e44db0fa8cd0921 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 10 Jul 2023 14:27:38 +0100 Subject: [PATCH 049/204] workflows: move all FreeBSD builds into one workflow --- .github/workflows/freebsd.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/freebsd.yml diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml new file mode 100644 index 00000000..f797cecc --- /dev/null +++ b/.github/workflows/freebsd.yml @@ -0,0 +1,48 @@ +name: FreeBSD + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + # Build shared library with GMake (Clang) + release-gmake-clang-shared: + runs-on: macos-12 + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Build + uses: vmactions/freebsd-vm@v0 + with: + usesh: true + mem: 8192 + prepare: pkg install -y curl nasm llvm gmake + run: | + freebsd-version + gmake CC=clang -j 4 + + # Build shared library with GMake (GCC) + release-gmake-gcc-shared: + runs-on: macos-12 + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: 'intel/intel-ipsec-mb' + + - name: Build + uses: vmactions/freebsd-vm@v0 + with: + usesh: true + mem: 8192 + prepare: pkg install -y curl nasm gmake gcc + run: | + freebsd-version + gmake CC=gcc -j 4 -- GitLab From e4ad1f4f33cd48c23659c0b0ce74228da6231f5a Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 10 Jul 2023 14:28:47 +0100 Subject: [PATCH 050/204] workflows: rename and update windows cmake workflow --- ...{cmake_windows_msbuild.yml => windows.yml} | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) rename .github/workflows/{cmake_windows_msbuild.yml => windows.yml} (80%) diff --git a/.github/workflows/cmake_windows_msbuild.yml b/.github/workflows/windows.yml similarity index 80% rename from .github/workflows/cmake_windows_msbuild.yml rename to .github/workflows/windows.yml index 92a129c6..e1032ec6 100644 --- a/.github/workflows/cmake_windows_msbuild.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: CMake - Windows-MSBuild +name: Windows on: push: @@ -7,14 +7,18 @@ on: branches: [ main ] jobs: - Release: + # CMake release build with shared library (msbuild) + release-cmake-msvc-msbuild: env: BUILD_TYPE: Release runs-on: windows-latest steps: - - uses: ilammy/setup-nasm@v1 - - uses: actions/checkout@v3 + - name: Setup NASM + uses: ilammy/setup-nasm@v1 + + - name: Checkout repo + uses: actions/checkout@v3 with: repository: 'intel/intel-ipsec-mb' @@ -37,15 +41,19 @@ jobs: - name: Test run: ctest -j 5 -C ${{env.BUILD_TYPE}} --test-dir ${{env.BUILD_DIR}} - - Debug: + + # CMake debug build with shared library (msbuild) + debug-cmake-msvc-msbuild: env: BUILD_TYPE: Debug runs-on: windows-latest steps: - - uses: ilammy/setup-nasm@v1 - - uses: actions/checkout@v3 + - name: Setup NASM + uses: ilammy/setup-nasm@v1 + + - name: Checkout repo + uses: actions/checkout@v3 with: repository: 'intel/intel-ipsec-mb' -- GitLab From 2cf021d753776df7b037728fdc568b4b740a681c Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 17 Jul 2023 10:01:08 +0100 Subject: [PATCH 051/204] README: fix github action badge links --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 99958b38..886559a4 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ +![Linux](https://github.com/intel/intel-ipsec-mb/actions/workflows/linux.yml/badge.svg) +![Windows](https://github.com/intel/intel-ipsec-mb/actions/workflows/windows.yml/badge.svg) +![FreeBSD](https://github.com/intel/intel-ipsec-mb/actions/workflows/freebsd.yml/badge.svg) [![Coverity Status](https://scan.coverity.com/projects/16449/badge.svg)](https://scan.coverity.com/projects/intel-ipsec-mb) -![Linux Build Shared gcc](https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_shared_gcc.yml/badge.svg) -![Linux Build Static gcc](https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_static_gcc.yml/badge.svg) -![Linux Build Shared clang](https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_shared_clang.yml/badge.svg) -![Linux Build Static clang](https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_static_clang.yml/badge.svg) -![Linux Build Shared clang AESNI emulation](https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_shared_clang_aesni_emu.yml/badge.svg) -![FreeBSD Build Shared clang](https://github.com/intel/intel-ipsec-mb/actions/workflows/freebsd_build_shared_clang.yml/badge.svg) -![FreeBSD Build Shared gcc](https://github.com/intel/intel-ipsec-mb/actions/workflows/freebsd_build_shared_gcc.yml/badge.svg) # Multi-Buffer Crypto for IPsec Library -- GitLab From f2c6e88d2a101d19882ba90c267c5379521a20f9 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 29 Jun 2023 16:22:51 +0100 Subject: [PATCH 052/204] avx512: [aes-gcm] comment update about execution flow of GCM_ENC_DEC macro --- lib/include/gcm_vaes_avx512.inc | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/include/gcm_vaes_avx512.inc b/lib/include/gcm_vaes_avx512.inc index 8298b341..ae944dfe 100644 --- a/lib/include/gcm_vaes_avx512.inc +++ b/lib/include/gcm_vaes_avx512.inc @@ -793,7 +793,7 @@ vshufi64x2 %%ZT5, %%ZT7, %%ZT7, 0x00 ;; broadcast HashKey^8 across all ZT5 - ;; calculate HashKey^9<<1 mod poly, HashKey^10<<1 mod poly, ... HashKey^48<<1 mod poly + ;; calculate HashKey^9<<1 mod poly, HashKey^10<<1 mod poly, ... HashKey^32<<1 mod poly ;; use HashKey^8 as multiplier against ZT8 and ZT7 - this allows deeper ooo execution %assign i 12 %rep ((big_loop_nblocks - 8) / 8) @@ -3159,22 +3159,15 @@ ;;; - 16 blocks < LENGTH < 32 blocks ;;; - cipher 16 blocks ;;; - cipher N blocks & hash 16 blocks, hash N blocks (reduction) -;;; - 32 blocks < LENGTH < 48 blocks +;;; - LENGTH >= 32 blocks ;;; - cipher 2 x 16 blocks -;;; - hash 16 blocks -;;; - cipher N blocks & hash 16 blocks, hash N blocks (reduction) -;;; - LENGTH >= 48 blocks -;;; - cipher 2 x 16 blocks -;;; - while (data_to_cipher >= 48 blocks): +;;; - while (data_to_cipher >= 2 x 32 blocks): ;;; - cipher 16 blocks & hash 16 blocks -;;; - cipher 16 blocks & hash 16 blocks -;;; - cipher 16 blocks & hash 16 blocks (reduction) +;;; - cipher 16 blocks & hash 16 blocks (parallel reduction) ;;; - if (data_to_cipher >= 32 blocks): ;;; - cipher 16 blocks & hash 16 blocks -;;; - cipher 16 blocks & hash 16 blocks -;;; - hash 16 blocks (reduction) -;;; - cipher N blocks & hash 16 blocks, hash N blocks (reduction) -;;; - elif (data_to_cipher >= 16 blocks): +;;; - cipher 16 blocks & hash 16 blocks (reduction) +;;; - if (data_to_cipher >= 16 blocks): ;;; - cipher 16 blocks & hash 16 blocks ;;; - hash 16 blocks ;;; - cipher N blocks & hash 16 blocks, hash N blocks (reduction) -- GitLab From 46b67f013301f42c7898c64628fcaf3822f52fd4 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 29 Jun 2023 16:24:34 +0100 Subject: [PATCH 053/204] avx2: [aes-gcm] hash key structure change to accommodate new constants --- lib/include/gcm_keys_avx2_avx512.inc | 43 ++++++++++++++++------------ lib/ipsec-mb.h | 9 ++++-- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/lib/include/gcm_keys_avx2_avx512.inc b/lib/include/gcm_keys_avx2_avx512.inc index e9605c67..06390322 100644 --- a/lib/include/gcm_keys_avx2_avx512.inc +++ b/lib/include/gcm_keys_avx2_avx512.inc @@ -28,25 +28,30 @@ %ifndef GCM_KEYS_AVX2_AVX512_INCLUDED %define GCM_KEYS_AVX2_AVX512_INCLUDED -;; Define the fields of gcm_key_data struct: -;; uint8_t expanded_keys[GCM_ENC_KEY_LEN * GCM_KEY_SETS]; -;; uint8_t shifted_hkey_8[GCM_ENC_KEY_LEN]; // HashKey^8 <<1 mod poly -;; uint8_t shifted_hkey_7[GCM_ENC_KEY_LEN]; // HashKey^7 <<1 mod poly -;; uint8_t shifted_hkey_6[GCM_ENC_KEY_LEN]; // HashKey^6 <<1 mod poly -;; uint8_t shifted_hkey_5[GCM_ENC_KEY_LEN]; // HashKey^5 <<1 mod poly -;; uint8_t shifted_hkey_4[GCM_ENC_KEY_LEN]; // HashKey^4 <<1 mod poly -;; uint8_t shifted_hkey_3[GCM_ENC_KEY_LEN]; // HashKey^3 <<1 mod poly -;; uint8_t shifted_hkey_2[GCM_ENC_KEY_LEN]; // HashKey^2 <<1 mod poly -;; uint8_t shifted_hkey_1[GCM_ENC_KEY_LEN]; // HashKey <<1 mod poly +;; First 15 128-bit words are reserved for AES round keys +%xdefine HKeyStart (16 * 15) -%define HashKey_8 (16*15) ; HashKey^8 <<1 mod poly -%define HashKey_7 (16*16) ; HashKey^7 <<1 mod poly -%define HashKey_6 (16*17) ; HashKey^6 <<1 mod poly -%define HashKey_5 (16*18) ; HashKey^5 <<1 mod poly -%define HashKey_4 (16*19) ; HashKey^4 <<1 mod poly -%define HashKey_3 (16*20) ; HashKey^3 <<1 mod poly -%define HashKey_2 (16*21) ; HashKey^2 <<1 mod poly -%define HashKey_1 (16*22) ; HashKey <<1 mod poly -%define HashKey (16*22) ; HashKey <<1 mod poly +%xdefine HashKey_8 ((16 * 0) + HKeyStart) ; HashKey^8 << 1 mod poly +%xdefine HashKey_7 ((16 * 1) + HKeyStart) ; HashKey^7 << 1 mod poly +%xdefine HashKey_6 ((16 * 2) + HKeyStart) ; HashKey^6 << 1 mod poly +%xdefine HashKey_5 ((16 * 3) + HKeyStart) ; HashKey^5 << 1 mod poly +%xdefine HashKey_4 ((16 * 4) + HKeyStart) ; HashKey^4 << 1 mod poly +%xdefine HashKey_3 ((16 * 5) + HKeyStart) ; HashKey^3 << 1 mod poly +%xdefine HashKey_2 ((16 * 6) + HKeyStart) ; HashKey^2 << 1 mod poly +%xdefine HashKey_1 ((16 * 7) + HKeyStart) ; HashKey << 1 mod poly +%xdefine HashKey HashKey_1 + +%xdefine HKeyGap (16 * 8) +;; (HashKey^n << 1 mod POLY) x POLY constants + +%xdefine HashKeyK_8 (HashKey_8 + HKeyGap) ; (HashKey^8 << 1 mod poly) x POLY +%xdefine HashKeyK_7 (HashKey_7 + HKeyGap) ; (HashKey^7 << 1 mod poly) x POLY +%xdefine HashKeyK_6 (HashKey_6 + HKeyGap) ; (HashKey^6 << 1 mod poly) x POLY +%xdefine HashKeyK_5 (HashKey_5 + HKeyGap) ; (HashKey^5 << 1 mod poly) x POLY +%xdefine HashKeyK_4 (HashKey_4 + HKeyGap) ; (HashKey^4 << 1 mod poly) x POLY +%xdefine HashKeyK_3 (HashKey_3 + HKeyGap) ; (HashKey^3 << 1 mod poly) x POLY +%xdefine HashKeyK_2 (HashKey_2 + HKeyGap) ; (HashKey^2 << 1 mod poly) x POLY +%xdefine HashKeyK_1 (HashKey_1 + HKeyGap) ; (HashKey << 1 mod poly) x POLY +%xdefine HashKeyK HashKey_1 %endif ; GCM_KEYS_AVX2_AVX512_INCLUDED diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index d97f4e38..5e3e0d28 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -666,9 +666,14 @@ struct gcm_key_data { /** * This is needed for schoolbook multiply purposes. * (HashKey<<1 mod poly), (HashKey^2<<1 mod poly), ..., - * (Hashkey^48<<1 mod poly) + * (Hashkey^8<<1 mod poly) + * + * Followed by: + * (HashKey<<1 mod poly) x POLY, + * (HashKey^2<<1 mod poly) x POLY, ..., + * (Hashkey^8<<1 mod poly) x POLY */ - uint8_t shifted_hkey[IMB_GCM_ENC_KEY_LEN * 8]; + uint8_t shifted_hkey[IMB_GCM_ENC_KEY_LEN * 8 * 2]; } avx2_avx512; struct { /** -- GitLab From f8c1f5397cce9fb87310dbd988cecdfbfa03ea6b Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 29 Jun 2023 16:25:49 +0100 Subject: [PATCH 054/204] avx2: [aes-gcm] GHASH_MUL2() macro added and PRECOMPUTE() updated to generate new hash key constants - GHASH_MUL() replaced with GHASH_MUL2() --- lib/include/gcm_common_avx2_avx512.inc | 139 ++++++++++++++++++------- 1 file changed, 101 insertions(+), 38 deletions(-) diff --git a/lib/include/gcm_common_avx2_avx512.inc b/lib/include/gcm_common_avx2_avx512.inc index 4d6d06c4..88231858 100644 --- a/lib/include/gcm_common_avx2_avx512.inc +++ b/lib/include/gcm_common_avx2_avx512.inc @@ -262,6 +262,65 @@ default rel %endmacro +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; GHASH_MUL2 MACRO to implement: Data*HashKey mod (128,127,126,121,0) +;;; Input: A and B (128-bits each, bit-reflected) +;;; Output: C = A*B*x mod poly, (i.e. >>1 ) +;;; To compute GH = GH*HashKey mod poly, give two constants: +;;; HK = HashKey<<1 mod poly as input +;;; KK = SWAP_H_L( HK_L * POLY) + HK +;;; POLY = 0xC2 << 56 +;;; +;;; Realize four multiplications first, to achieve partially reduced product +;;; TLL = GH_L * KK_L +;;; TLH = GH_L * KK_H +;;; THL = GH_H * HK_L +;;; THH = GH_H * HK_H +;;; +;;; Accumulate results into 2 registers, with corresponding weights +;;; T1 = THH + TLH +;;; T2 = THL + TLL +;;; +;;; Begin reduction +;;; ---------- +;;; | T1 | +;;; --------------- +;;; | T2 | +;;; ---------- +;;; +;;; T3 = SWAP_H_L(T2) +;;; T5 = T2_L * POLY +;;; GH = T1 + T5 + T3 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro GHASH_MUL2 7 +%define %%GH %1 ;; [in/out] xmm with multiply operand(s) (128-bits) +%define %%HK %2 ;; [in] xmm with hash key value(s) (128-bits) +%define %%KK %3 ;; [in] xmm with hash key K value(s) (128-bits) +%define %%TLL %4 ;; [clobbered] xmm +%define %%TLH %5 ;; [clobbered] xmm +%define %%THL %6 ;; [clobbered] xmm +%define %%THH %7 ;; [clobbered] xmm + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpclmulqdq %%TLL, %%GH, %%KK, 0x00 ; TLL = GH_L * KK_L + vpclmulqdq %%TLH, %%GH, %%KK, 0x10 ; TLH = GH_L * KK_H + vpclmulqdq %%THL, %%GH, %%HK, 0x01 ; THL = GH_H * HK_L + vpclmulqdq %%THH, %%GH, %%HK, 0x11 ; THH = GH_H * HK_H + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; add products + vpxorq %%TLL, %%TLL, %%THL + vpxorq %%THH, %%THH, %%TLH + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; new reduction + vpclmulqdq %%GH, %%TLL, [rel POLY], 0x10 + vpshufd %%TLH, %%TLL, 01001110b + vpxor %%GH, %%GH, %%THH + vpxor %%GH, %%GH, %%TLH + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%endmacro + %macro PRECOMPUTE 8 %define %%GDATA %1 ;; [in/out] pointer to GCM key data structure %define %%HK %2 ;; [in] Hash Key @@ -272,28 +331,28 @@ default rel %define %%T5 %7 ;; [clobbered] temporary XMM register %define %%T6 %8 ;; [clobbered] temporary XMM register - vmovdqa %%T5, %%HK - - GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^2<<1 mod poly - vmovdqu [%%GDATA + HashKey_2], %%T5 ; [HashKey_2] = HashKey^2<<1 mod poly + vmovdqa %%T5, %%HK - GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^3<<1 mod poly - vmovdqu [%%GDATA + HashKey_3], %%T5 + ;; calculate HashKeyX = HashKey x POLY + vpclmulqdq %%T1, %%T5, [rel POLY], 0x10 + vpshufd %%T2, %%T5, 01001110b + vpxor %%T1, %%T1, %%T2 + vmovdqu [%%GDATA + HashKeyK_1], %%T1 - GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^4<<1 mod poly - vmovdqu [%%GDATA + HashKey_4], %%T5 - - GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^5<<1 mod poly - vmovdqu [%%GDATA + HashKey_5], %%T5 +%assign i 2 +%rep 7 + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^i<<1 mod poly + vmovdqu [%%GDATA + HashKey_ %+ i], %%T5 ; [HashKey_i] = HashKey^i<<1 mod poly - GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^6<<1 mod poly - vmovdqu [%%GDATA + HashKey_6], %%T5 + ;; calculate HashKeyX = HashKey x POLY + vpclmulqdq %%T1, %%T5, [rel POLY], 0x10 + vpshufd %%T2, %%T5, 01001110b + vpxor %%T1, %%T1, %%T2 + vmovdqu [%%GDATA + HashKeyK_ %+ i], %%T1 - GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^7<<1 mod poly - vmovdqu [%%GDATA + HashKey_7], %%T5 +%assign i (i + 1) +%endrep - GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^8<<1 mod poly - vmovdqu [%%GDATA + HashKey_8], %%T5 %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -481,16 +540,17 @@ default rel or %%T2, %%T2 je %%_CALC_AAD_done - vmovdqu %%XTMP0, [%%GDATA_KEY + HashKey] + vmovdqu %%XTMP0, [%%GDATA_KEY + HashKey_1] + vmovdqu %%XTMP1, [%%GDATA_KEY + HashKeyK_1] %ifdef IS_AVX2_GCM - READ_SMALL_DATA_INPUT_AVX %%XTMP1, %%T1, %%T2, %%T3 + READ_SMALL_DATA_INPUT_AVX %%XTMP2, %%T1, %%T2, %%T3 %else - READ_SMALL_DATA_INPUT_AVX512 %%XTMP1, %%T1, %%T2, %%T3, k1 + READ_SMALL_DATA_INPUT_AVX512 %%XTMP2, %%T1, %%T2, %%T3, k1 %endif ;byte-reflect the AAD data - vpshufb %%XTMP1, [rel SHUF_MASK] - vpxor %%AAD_HASH, %%XTMP1 - GHASH_MUL %%AAD_HASH, %%XTMP0, %%XTMP1, %%XTMP2, %%XTMP3, %%XTMP4, %%XTMP5 + vpshufb %%XTMP2, %%XTMP2, [rel SHUF_MASK] + vpxor %%AAD_HASH, %%XTMP2 + GHASH_MUL2 %%AAD_HASH, %%XTMP0, %%XTMP1, %%XTMP2, %%XTMP3, %%XTMP4, %%XTMP5 %%_CALC_AAD_done: @@ -512,7 +572,7 @@ default rel %define %%PLAIN_CYPH_LEN %4 %define %%DATA_OFFSET %5 %define %%AAD_HASH %6 -%define %%HASH_SUBKEY %7 +%define %%GDATA_KEY %7 %define %%ENC_DEC %8 mov r13, [%%GDATA_CTX + PBlockLen] @@ -570,7 +630,9 @@ default rel or r15, r15 jl %%_partial_incomplete - GHASH_MUL %%AAD_HASH, %%HASH_SUBKEY, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block + vmovdqa xmm3, [%%GDATA_KEY + HashKey_1] + vmovdqa xmm1, [%%GDATA_KEY + HashKeyK_1] + GHASH_MUL2 %%AAD_HASH, xmm3, xmm1, xmm0, xmm10, xmm11, xmm5 ;GHASH computation for the last <16 Byte block xor rax, rax mov [%%GDATA_CTX + PBlockLen], rax jmp %%_enc_dec_done @@ -2625,7 +2687,7 @@ default rel ;; s = 16 * RoundUp(len(IV)/16) - len(IV) */ ;; Calculate GHASH of (IV || 0s) - vpxor %%J0, %%J0 + vpxor %%J0, %%J0, %%J0 %ifdef IS_AVX2_GCM CALC_AAD_HASH %%IV, %%IV_LEN, %%J0, %%KEY, %%XTMP0, %%XTMP1, %%XTMP2, \ %%XTMP3, %%XTMP4, %%XTMP5, %%TMP0, %%TMP1, %%TMP2, %%TMP3, %%TMP4 @@ -2635,14 +2697,15 @@ default rel %endif ;; Calculate GHASH of last 16-byte block (0 || len(IV)64) - vmovdqu %%XTMP0, [%%KEY + HashKey] + vmovdqu %%XTMP0, [%%KEY + HashKey_1] + vmovdqu %%XTMP1, [%%KEY + HashKeyK_1] mov %%TMP2, %%IV_LEN - shl %%TMP2, 3 ;; IV length in bits - vmovq %%XTMP1, %%TMP2 - vpxor %%J0, %%XTMP1 - GHASH_MUL %%J0, %%XTMP0, %%XTMP1, %%XTMP2, %%XTMP3, %%XTMP4, %%XTMP5 + shl %%TMP2, 3 ;; IV length in bits + vmovq %%XTMP2, %%TMP2 + vpxor %%J0, %%J0, %%XTMP2 + GHASH_MUL2 %%J0, %%XTMP0, %%XTMP1, %%XTMP2, %%XTMP3, %%XTMP4, %%XTMP5 - vpshufb %%J0, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%J0, %%J0, [rel SHUF_MASK] ; perform a 16Byte swap %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2835,19 +2898,18 @@ default rel %else add [%%GDATA_CTX + InLen], %%PLAIN_CYPH_LEN %endif - vmovdqu xmm13, [%%GDATA_KEY + HashKey] vmovdqu xmm8, [%%GDATA_CTX + AadHash] %ifidn %%INSTANCE_TYPE, multi_call ;; NOTE: partial block processing makes only sense for multi_call here. ;; Used for the update flow - if there was a previous partial ;; block fill the remaining bytes here. - PARTIAL_BLOCK %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%DATA_OFFSET, xmm8, xmm13, %%ENC_DEC + PARTIAL_BLOCK %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%DATA_OFFSET, xmm8, %%GDATA_KEY, %%ENC_DEC %endif ;; lift CTR set from initial_blocks to here %ifidn %%INSTANCE_TYPE, single_call - vmovdqu xmm9, xmm2 + vmovdqa xmm9, xmm2 %else vmovdqu xmm9, [%%GDATA_CTX + CurCount] %endif @@ -3084,7 +3146,8 @@ default rel %define %%INSTANCE_TYPE %5 %define %%PLAIN_CYPH_LEN rax - vmovdqu xmm13, [%%GDATA_KEY + HashKey] + vmovdqu xmm13, [%%GDATA_KEY + HashKey_1] + vmovdqu xmm0, [%%GDATA_KEY + HashKeyK_1] ;; Start AES as early as possible vmovdqu xmm9, [%%GDATA_CTX + OrigIV] ; xmm9 = Y0 ENCRYPT_SINGLE_BLOCK %%GDATA_KEY, xmm9 ; E(K, Y0) @@ -3102,7 +3165,7 @@ default rel je %%_partial_done - GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block + GHASH_MUL2 xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block vmovdqu [%%GDATA_CTX + AadHash], xmm14 %%_partial_done: @@ -3121,7 +3184,7 @@ default rel vpxor xmm15, xmm15, xmm1 ; xmm15 = len(A)||len(C) vpxor xmm14, xmm15 - GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 + GHASH_MUL2 xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 vpshufb xmm14, [rel SHUF_MASK] ; perform a 16Byte swap vpxor xmm9, xmm9, xmm14 -- GitLab From bb2911f4cf8d98a23379b33f8baca300c7e06827 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 5 Jul 2023 09:58:01 +0100 Subject: [PATCH 055/204] avx2: [aes-gcm] new multiply and reduce used for GHASH, GMAC, IV reduction and AAD --- lib/include/gcm_common_avx2_avx512.inc | 136 ++++++++++--------------- 1 file changed, 52 insertions(+), 84 deletions(-) diff --git a/lib/include/gcm_common_avx2_avx512.inc b/lib/include/gcm_common_avx2_avx512.inc index 88231858..85c00490 100644 --- a/lib/include/gcm_common_avx2_avx512.inc +++ b/lib/include/gcm_common_avx2_avx512.inc @@ -401,12 +401,14 @@ default rel vpxor %%XTMP0, %%AAD_HASH - vmovdqu %%XTMP5, [%%GDATA_KEY + HashKey_8] - vpclmulqdq %%XTMP1, %%XTMP0, %%XTMP5, 0x11 ; %%T1 = a1*b1 - vpclmulqdq %%XTMP2, %%XTMP0, %%XTMP5, 0x00 ; %%T2 = a0*b0 - vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x01 ; %%T3 = a1*b0 - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 ; %%T4 = a0*b1 - vpxor %%XTMP3, %%XTMP3, %%XTMP4 ; %%T3 = a1*b0 + a0*b1 + vmovdqa %%XTMP5, [%%GDATA_KEY + HashKeyK_8] + vpclmulqdq %%XTMP1, %%XTMP0, %%XTMP5, 0x00 ; XTMP1 = XTMP_L * KK_L + vpclmulqdq %%XTMP2, %%XTMP0, %%XTMP5, 0x10 ; XTMP2 = XTMP_L * KK_H + vmovdqa %%XTMP5, [%%GDATA_KEY + HashKey_8] + vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x01 ; XTMP3 = XTMP_H * HK_L + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x11 ; XTMP4 = XTMP_H * HK_H + vpxor %%XTMP1, %%XTMP1, %%XTMP3 ; XTMP1 = XTMP1 + XTMP3 + vpxor %%XTMP2, %%XTMP2, %%XTMP4 ; XTMP2 = XTMP2 + XTMP4 %assign i 1 %assign j 7 @@ -414,44 +416,27 @@ default rel vmovdqu %%XTMP0, [%%T1 + 16*i] vpshufb %%XTMP0, [rel SHUF_MASK] - vmovdqu %%XTMP5, [%%GDATA_KEY + HashKey_ %+ j] - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x11 ; %%T1 = T1 + a1*b1 - vpxor %%XTMP1, %%XTMP1, %%XTMP4 - - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x00 ; %%T2 = T2 + a0*b0 + vmovdqa %%XTMP5, [%%GDATA_KEY + HashKeyK_ %+ j] + vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x00 ; XTMP1 = XTMP_L * KK_L + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 ; XTMP2 = XTMP_L * KK_H + vmovdqa %%XTMP5, [%%GDATA_KEY + HashKey_ %+ j] + vpxor %%XTMP1, %%XTMP1, %%XTMP3 + vpxor %%XTMP2, %%XTMP2, %%XTMP4 + vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x01 ; XTMP3 = XTMP_H * HK_L + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x11 ; XTMP4 = XTMP_H * HK_H + vpxor %%XTMP1, %%XTMP1, %%XTMP3 vpxor %%XTMP2, %%XTMP2, %%XTMP4 - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x01 ; %%T3 = T3 + a1*b0 + a0*b1 - vpxor %%XTMP3, %%XTMP3, %%XTMP4 - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 - vpxor %%XTMP3, %%XTMP3, %%XTMP4 %assign i (i + 1) %assign j (j - 1) %endrep - vpslldq %%XTMP4, %%XTMP3, 8 ; shift-L 2 DWs - vpsrldq %%XTMP3, %%XTMP3, 8 ; shift-R 2 DWs - vpxor %%XTMP2, %%XTMP2, %%XTMP4 - vpxor %%XTMP1, %%XTMP1, %%XTMP3 ; accumulate the results in %%T1(M):%%T2(L) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;first phase of the reduction - vmovdqa %%XTMP5, [rel POLY2] - vpclmulqdq %%XTMP0, %%XTMP5, %%XTMP2, 0x01 - vpslldq %%XTMP0, %%XTMP0, 8 ; shift-L xmm2 2 DWs - vpxor %%XTMP2, %%XTMP2, %%XTMP0 ; first phase of the reduction complete - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;second phase of the reduction - vpclmulqdq %%XTMP3, %%XTMP5, %%XTMP2, 0x00 - vpsrldq %%XTMP3, %%XTMP3, 4 ; shift-R 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) - - vpclmulqdq %%XTMP4, %%XTMP5, %%XTMP2, 0x10 - vpslldq %%XTMP4, %%XTMP4, 4 ; shift-L 1 DW (Shift-L 1-DW to obtain result with no shifts) - - vpxor %%XTMP4, %%XTMP4, %%XTMP3 ; second phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vpxor %%AAD_HASH, %%XTMP1, %%XTMP4 ; the result is in %%T1 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; new reduction + vpclmulqdq %%AAD_HASH, %%XTMP1, [rel POLY], 0x10 + vpshufd %%XTMP3, %%XTMP1, 01001110b + vpxor %%AAD_HASH, %%AAD_HASH, %%XTMP2 + vpxor %%AAD_HASH, %%AAD_HASH, %%XTMP3 ; the result is in %%AAD_HASH sub %%T2, 128 je %%_CALC_AAD_done @@ -461,7 +446,7 @@ default rel %%_exit_AAD_loop128: cmp %%T2, 16 - jl %%_get_small_AAD_block + jb %%_get_small_AAD_block ;; calculate hash_key position to start with mov %%T3, %%T2 @@ -473,75 +458,58 @@ default rel vmovdqu %%XTMP0, [%%T1] vpshufb %%XTMP0, [rel SHUF_MASK] - vpxor %%XTMP0, %%AAD_HASH + vpxor %%XTMP0, %%XTMP0, %%AAD_HASH - vmovdqu %%XTMP5, [%%T3] - vpclmulqdq %%XTMP1, %%XTMP0, %%XTMP5, 0x11 ; %%T1 = a1*b1 - vpclmulqdq %%XTMP2, %%XTMP0, %%XTMP5, 0x00 ; %%T2 = a0*b0 - vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x01 ; %%T3 = a1*b0 - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 ; %%T4 = a0*b1 - vpxor %%XTMP3, %%XTMP3, %%XTMP4 ; %%T3 = a1*b0 + a0*b1 + vmovdqa %%XTMP5, [%%T3 + HKeyGap] + vpclmulqdq %%XTMP1, %%XTMP0, %%XTMP5, 0x00 ; XTMP1 = XTMP_L * KK_L + vpclmulqdq %%XTMP2, %%XTMP0, %%XTMP5, 0x10 ; XTMP2 = XTMP_L * KK_H + vmovdqa %%XTMP5, [%%T3] + vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x01 ; XTMP3 = XTMP_H * HK_L + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x11 ; XTMP4 = XTMP_H * HK_H + vpxor %%XTMP1, %%XTMP1, %%XTMP3 ; XTMP1 = XTMP1 + XTMP3 + vpxor %%XTMP2, %%XTMP2, %%XTMP4 ; XTMP2 = XTMP2 + XTMP4 add %%T3, 16 ; move to next hashkey add %%T1, 16 ; move to next data block sub %%T2, 16 cmp %%T2, 16 - jl %%_AAD_reduce + jb %%_AAD_reduce %%_AAD_blocks: vmovdqu %%XTMP0, [%%T1] vpshufb %%XTMP0, [rel SHUF_MASK] - vmovdqu %%XTMP5, [%%T3] - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x11 ; %%T1 = T1 + a1*b1 - vpxor %%XTMP1, %%XTMP1, %%XTMP4 - - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x00 ; %%T2 = T2 + a0*b0 + vmovdqa %%XTMP5, [%%T3 + HKeyGap] + vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x00 ; XTMP1 = XTMP_L * KK_L + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 ; XTMP2 = XTMP_L * KK_H + vmovdqa %%XTMP5, [%%T3] + vpxor %%XTMP1, %%XTMP1, %%XTMP3 + vpxor %%XTMP2, %%XTMP2, %%XTMP4 + vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x01 ; XTMP3 = XTMP_H * HK_L + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x11 ; XTMP4 = XTMP_H * HK_H + vpxor %%XTMP1, %%XTMP1, %%XTMP3 vpxor %%XTMP2, %%XTMP2, %%XTMP4 - - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x01 ; %%T3 = T3 + a1*b0 + a0*b1 - vpxor %%XTMP3, %%XTMP3, %%XTMP4 - vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 - vpxor %%XTMP3, %%XTMP3, %%XTMP4 add %%T3, 16 ; move to next hashkey add %%T1, 16 sub %%T2, 16 cmp %%T2, 16 - jl %%_AAD_reduce - jmp %%_AAD_blocks + jae %%_AAD_blocks %%_AAD_reduce: - vpslldq %%XTMP4, %%XTMP3, 8 ; shift-L 2 DWs - vpsrldq %%XTMP3, %%XTMP3, 8 ; shift-R 2 DWs - vpxor %%XTMP2, %%XTMP2, %%XTMP4 - vpxor %%XTMP1, %%XTMP1, %%XTMP3 ; accumulate the results in %%T1(M):%%T2(L) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;first phase of the reduction - vmovdqa %%XTMP5, [rel POLY2] - vpclmulqdq %%XTMP0, %%XTMP5, %%XTMP2, 0x01 - vpslldq %%XTMP0, %%XTMP0, 8 ; shift-L xmm2 2 DWs - vpxor %%XTMP2, %%XTMP2, %%XTMP0 ; first phase of the reduction complete - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;second phase of the reduction - vpclmulqdq %%XTMP3, %%XTMP5, %%XTMP2, 0x00 - vpsrldq %%XTMP3, %%XTMP3, 4 ; shift-R 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) - - vpclmulqdq %%XTMP4, %%XTMP5, %%XTMP2, 0x10 - vpslldq %%XTMP4, %%XTMP4, 4 ; shift-L 1 DW (Shift-L 1-DW to obtain result with no shifts) - - vpxor %%XTMP4, %%XTMP4, %%XTMP3 ; second phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vpxor %%AAD_HASH, %%XTMP1, %%XTMP4 ; the result is in %%T1 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; new reduction + vpclmulqdq %%AAD_HASH, %%XTMP1, [rel POLY], 0x10 + vpshufd %%XTMP3, %%XTMP1, 01001110b + vpxor %%AAD_HASH, %%AAD_HASH, %%XTMP2 + vpxor %%AAD_HASH, %%AAD_HASH, %%XTMP3 ; the result is in %%AAD_HASH %%_get_small_AAD_block: or %%T2, %%T2 je %%_CALC_AAD_done - vmovdqu %%XTMP0, [%%GDATA_KEY + HashKey_1] - vmovdqu %%XTMP1, [%%GDATA_KEY + HashKeyK_1] + vmovdqa %%XTMP0, [%%GDATA_KEY + HashKey_1] + vmovdqa %%XTMP1, [%%GDATA_KEY + HashKeyK_1] %ifdef IS_AVX2_GCM READ_SMALL_DATA_INPUT_AVX %%XTMP2, %%T1, %%T2, %%T3 %else -- GitLab From 4c5a018e845648e37cf76fb5411f8d567b4aec63 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 5 Jul 2023 16:04:13 +0100 Subject: [PATCH 056/204] avx2: [aes-gcm] use new multiply & reduce in the remaining code paths List of updated macros: GHASH_LAST_8(), GHASH_LAST_7(), GHASH_8_ENCRYPT_8_PARALLEL(), INITIAL_BLOCKS() and INITIAL_BLOCKS_PARTIAL(). --- lib/include/gcm_common_avx2_avx512.inc | 802 +++++++------------------ 1 file changed, 228 insertions(+), 574 deletions(-) diff --git a/lib/include/gcm_common_avx2_avx512.inc b/lib/include/gcm_common_avx2_avx512.inc index 85c00490..8084fd18 100644 --- a/lib/include/gcm_common_avx2_avx512.inc +++ b/lib/include/gcm_common_avx2_avx512.inc @@ -309,8 +309,8 @@ default rel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; add products - vpxorq %%TLL, %%TLL, %%THL - vpxorq %%THH, %%THH, %%TLH + vpxor %%TLL, %%TLL, %%THL + vpxor %%THH, %%THH, %%TLH ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; new reduction @@ -647,35 +647,36 @@ default rel %endmacro ; PARTIAL_BLOCK %macro GHASH_SINGLE_MUL 9 -%define %%GDATA %1 -%define %%HASHKEY %2 -%define %%CIPHER %3 -%define %%STATE_11 %4 -%define %%STATE_00 %5 -%define %%STATE_MID %6 -%define %%T1 %7 -%define %%T2 %8 -%define %%FIRST %9 +%define %%GDATA %1 ;; [in] GHASH key pointer +%define %%HASHKEY %2 ;; [in] offset to GHASH key +%define %%CIPHER %3 ;; [in] xmm with cipher text block +%define %%STATE_11 %4 ;; [in/out] GHASH product state (hi) +%define %%STATE_00 %5 ;; [in/out] GHASH product state (lo) +%define %%T1 %6 ;; [clobbered] temporary xmm - (it was STATE_MID) +%define %%T2 %7 ;; [clobbered] temporary xmm +%define %%T3 %8 ;; [clobbered] temporary xmm +%define %%FIRST %9 ;; [in] "first" time or not ("update") selector - vmovdqu %%T1, [%%GDATA + %%HASHKEY] %ifidn %%FIRST, first - vpclmulqdq %%STATE_11, %%CIPHER, %%T1, 0x11 ; %%T4 = a1*b1 - vpclmulqdq %%STATE_00, %%CIPHER, %%T1, 0x00 ; %%T4_2 = a0*b0 - vpclmulqdq %%STATE_MID, %%CIPHER, %%T1, 0x01 ; %%T6 = a1*b0 - vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10 ; %%T5 = a0*b1 - vpxor %%STATE_MID, %%STATE_MID, %%T2 + vmovdqa %%T1, [%%GDATA + %%HASHKEY + HKeyGap] + vmovdqa %%T2, [%%GDATA + %%HASHKEY] + vpclmulqdq %%STATE_00, %%CIPHER, %%T1, 0x00 ; STATE_00 = DATA_L * KK_L + vpclmulqdq %%STATE_11, %%CIPHER, %%T1, 0x10 ; STATE_11 = DATA_L * KK_H + vpclmulqdq %%T1, %%CIPHER, %%T2, 0x01 ; T1 = DATA_H * HK_L + vpclmulqdq %%T2, %%CIPHER, %%T2, 0x11 ; T2 = DATA_H * HK_H + vpxor %%STATE_00, %%STATE_00, %%T1 ; STATE_00 += T1 + vpxor %%STATE_11, %%STATE_11, %%T2 ; STATE_11 += T2 %else - vpclmulqdq %%T2, %%CIPHER, %%T1, 0x11 - vpxor %%STATE_11, %%STATE_11, %%T2 - - vpclmulqdq %%T2, %%CIPHER, %%T1, 0x00 - vpxor %%STATE_00, %%STATE_00, %%T2 - - vpclmulqdq %%T2, %%CIPHER, %%T1, 0x01 - vpxor %%STATE_MID, %%STATE_MID, %%T2 - - vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10 - vpxor %%STATE_MID, %%STATE_MID, %%T2 + vmovdqa %%T3, [%%GDATA + %%HASHKEY + HKeyGap] + vpclmulqdq %%T1, %%CIPHER, %%T3, 0x00 ; STATE_00 = DATA_L * KK_L + vpclmulqdq %%T2, %%CIPHER, %%T3, 0x10 ; STATE_11 = DATA_L * KK_H + vpxor %%STATE_00, %%STATE_00, %%T1 ; STATE_00 += T1 + vpxor %%STATE_11, %%STATE_11, %%T2 ; STATE_11 += T2 + vmovdqa %%T3, [%%GDATA + %%HASHKEY] + vpclmulqdq %%T1, %%CIPHER, %%T3, 0x01 ; T1 = DATA_H * HK_L + vpclmulqdq %%T2, %%CIPHER, %%T3, 0x11 ; T2 = DATA_H * HK_H + vpxor %%STATE_00, %%STATE_00, %%T1 ; STATE_00 += T1 + vpxor %%STATE_11, %%STATE_11, %%T2 ; STATE_11 += T2 %endif %endmacro @@ -849,8 +850,6 @@ default rel ;; T2 - incoming AAD hash vpxor %%T2, %%T3 - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, first %endif @@ -879,8 +878,6 @@ default rel %assign j (j+1) %assign k (k-1) %if(%%num_initial_blocks>1) - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 vmovdqu %%T2, [rsp + TMP %+ j] GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, not_first @@ -910,8 +907,6 @@ default rel %assign j (j+1) %assign k (k-1) %if(%%num_initial_blocks>2) - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 vmovdqu %%T2, [rsp + TMP %+ j] GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, not_first @@ -921,8 +916,6 @@ default rel %assign j (j+1) %assign k (k-1) %if(%%num_initial_blocks>3) - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 vmovdqu %%T2, [rsp + TMP %+ j] GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, not_first @@ -952,8 +945,6 @@ default rel %assign j (j+1) %assign k (k-1) %if(%%num_initial_blocks>4) - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 vmovdqu %%T2, [rsp + TMP %+ j] GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, not_first @@ -983,8 +974,6 @@ default rel %assign j (j+1) %assign k (k-1) %if(%%num_initial_blocks>5) - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 vmovdqu %%T2, [rsp + TMP %+ j] GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, not_first @@ -1016,8 +1005,6 @@ default rel %assign j (j+1) %assign k (k-1) %if(%%num_initial_blocks>6) - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 vmovdqu %%T2, [rsp + TMP %+ j] GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, not_first @@ -1082,8 +1069,6 @@ default rel %assign j (j+1) %assign k (k-1) %if(%%num_initial_blocks>7) - ;; GDATA, HASHKEY, CIPHER, - ;; STATE_11, STATE_00, STATE_MID, T1, T2 vmovdqu %%T2, [rsp + TMP %+ j] GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ %%T1, %%T4, %%T6, %%T5, %%T3, not_first @@ -1112,35 +1097,12 @@ default rel %endif ; GCM256 mode %if(%%num_initial_blocks>0) - vpsrldq %%T3, %%T6, 8 ; shift-R %%T2 2 DWs - vpslldq %%T6, %%T6, 8 ; shift-L %%T3 2 DWs - vpxor %%T1, %%T1, %%T3 ; accumulate the results in %%T1:%%T4 - vpxor %%T4, %%T6, %%T4 - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ; First phase of the reduction - vmovdqa %%T3, [rel POLY2] - - vpclmulqdq %%T2, %%T3, %%T4, 0x01 - vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs - - ;; First phase of the reduction complete - vpxor %%T4, %%T4, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ; Second phase of the reduction - vpclmulqdq %%T2, %%T3, %%T4, 0x00 - ;; Shift-R xmm2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) - vpsrldq %%T2, %%T2, 4 - - vpclmulqdq %%T4, %%T3, %%T4, 0x10 - ;; Shift-L xmm0 1 DW (Shift-L 1-DW to obtain result with no shifts) - vpslldq %%T4, %%T4, 4 - ;; Second phase of the reduction complete - vpxor %%T4, %%T4, %%T2 - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ; The result is in %%T3 - vpxor %%T3, %%T1, %%T4 + ; new reduction T4(low):T1(high), result in %%T3 + vpclmulqdq %%T3, %%T4, [rel POLY], 0x10 + vpshufd %%T6, %%T4, 01001110b + vpxor %%T3, %%T3, %%T1 + vpxor %%T3, %%T3, %%T6 %else ;; The hash should end up in T3 vmovdqa %%T3, %%T2 @@ -1411,19 +1373,21 @@ default rel %if (%%num_initial_blocks > last_block_to_hash) ;; Hash in AES state - vpxor %%T2, reg(j) + vpxor %%T2, %%T2, reg(j) ;; T2 - incoming AAD hash ;; reg(i) holds ciphertext ;; T5 - hash key ;; T6 - updated xor ;; reg(1)/xmm1 should now be available for tmp use - vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] - vpclmulqdq %%T1, %%T2, %%T5, 0x11 ; %%T4 = a1*b1 - vpclmulqdq %%T4, %%T2, %%T5, 0x00 ; %%T4 = a0*b0 - vpclmulqdq %%T6, %%T2, %%T5, 0x01 ; %%T6 = a1*b0 - vpclmulqdq %%T5, %%T2, %%T5, 0x10 ; %%T5 = a0*b1 - vpxor %%T6, %%T6, %%T5 + vmovdqa %%T5, [%%GDATA_KEY + HashKeyK_ %+ k] + vmovdqa %%T6, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T1, %%T2, %%T5, 0x00 ; T1 = DATA_L * KK_L + vpclmulqdq %%T4, %%T2, %%T5, 0x10 ; T4 = DATA_L * KK_H + vpclmulqdq %%T5, %%T2, %%T6, 0x01 ; T5 = DATA_H * HK_L + vpclmulqdq %%T6, %%T2, %%T6, 0x11 ; T6 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T5 ; T1 += T5 + vpxor %%T4, %%T4, %%T6 ; T4 += T6 %endif %assign i (i+1) @@ -1432,18 +1396,16 @@ default rel %assign rep_count (%%num_initial_blocks-1) %rep rep_count - vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] - vpclmulqdq %%T3, reg(j), %%T5, 0x11 - vpxor %%T1, %%T1, %%T3 - - vpclmulqdq %%T3, reg(j), %%T5, 0x00 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, reg(j), %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, reg(j), %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vmovdqa %%T5, [%%GDATA_KEY + HashKeyK_ %+ k] + vmovdqa %%T6, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T3, reg(j), %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, reg(j), %%T5, 0x10 ; T5 = DATA_L * KK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T4, %%T4, %%T5 ; T4 += T5 + vpclmulqdq %%T3, reg(j), %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, reg(j), %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T4, %%T4, %%T5 ; T4 += T5 %assign i (i+1) %assign j (j+1) @@ -1451,7 +1413,7 @@ default rel %endrep ;; Record that a reduction is needed - mov r12, 1 + mov DWORD(r12), 1 jmp %%_small_initial_compute_hash @@ -1494,21 +1456,23 @@ default rel %if (%%num_initial_blocks > last_block_to_hash) ;; Record that a reduction is needed - mov r12, 1 + mov DWORD(r12), 1 ;; Hash in AES state - vpxor %%T2, reg(j) + vpxor %%T2, %%T2, reg(j) ;; T2 - incoming AAD hash ;; reg(i) holds ciphertext ;; T5 - hash key ;; T6 - updated xor ;; reg(1)/xmm1 should now be available for tmp use - vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] - vpclmulqdq %%T1, %%T2, %%T5, 0x11 ; %%T4 = a1*b1 - vpclmulqdq %%T4, %%T2, %%T5, 0x00 ; %%T4 = a0*b0 - vpclmulqdq %%T6, %%T2, %%T5, 0x01 ; %%T6 = a1*b0 - vpclmulqdq %%T5, %%T2, %%T5, 0x10 ; %%T5 = a0*b1 - vpxor %%T6, %%T6, %%T5 + vmovdqa %%T5, [%%GDATA_KEY + HashKeyK_ %+ k] + vmovdqa %%T6, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T1, %%T2, %%T5, 0x00 ; T1 = DATA_L * KK_L + vpclmulqdq %%T4, %%T2, %%T5, 0x10 ; T4 = DATA_L * KK_H + vpclmulqdq %%T5, %%T2, %%T6, 0x01 ; T5 = DATA_H * HK_L + vpclmulqdq %%T6, %%T2, %%T6, 0x11 ; T6 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T5 ; T1 += T5 + vpxor %%T4, %%T4, %%T6 ; T4 += T6 %else ;; Record that a reduction is not needed - ;; In this case no hashes are computed because there @@ -1533,18 +1497,16 @@ default rel %rep rep_count - vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] - vpclmulqdq %%T3, reg(j), %%T5, 0x11 - vpxor %%T1, %%T1, %%T3 - - vpclmulqdq %%T3, reg(j), %%T5, 0x00 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, reg(j), %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, reg(j), %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vmovdqa %%T5, [%%GDATA_KEY + HashKeyK_ %+ k] + vmovdqa %%T6, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T3, reg(j), %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, reg(j), %%T5, 0x10 ; T5 = DATA_L * KK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T4, %%T4, %%T5 ; T4 += T5 + vpclmulqdq %%T3, reg(j), %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, reg(j), %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T4, %%T4, %%T5 ; T4 += T5 %assign i (i+1) %assign j (j+1) @@ -1568,36 +1530,12 @@ default rel %endif %endif - vpsrldq %%T3, %%T6, 8 ; shift-R %%T2 2 DWs - vpslldq %%T6, %%T6, 8 ; shift-L %%T3 2 DWs - vpxor %%T1, %%T1, %%T3 ; accumulate the results in %%T1:%%T4 - vpxor %%T4, %%T6, %%T4 - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; First phase of the reduction - vmovdqa %%T3, [rel POLY2] - - vpclmulqdq %%T2, %%T3, %%T4, 0x01 - ;; shift-L xmm2 2 DWs - vpslldq %%T2, %%T2, 8 - vpxor %%T4, %%T4, %%T2 - - ;; First phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Second phase of the reduction - - vpclmulqdq %%T2, %%T3, %%T4, 0x00 - ;; Shift-R xmm2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) - vpsrldq %%T2, %%T2, 4 - - vpclmulqdq %%T4, %%T3, %%T4, 0x10 - ;; Shift-L xmm0 1 DW (Shift-L 1-DW to obtain result with no shifts) - vpslldq %%T4, %%T4, 4 - - vpxor %%T4, %%T4, %%T2 - ;; Second phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vpxor %%T3, %%T1, %%T4 + ; new reduction T1(low):T4(high), result in %%T3 + vpclmulqdq %%T3, %%T1, [rel POLY], 0x10 + vpshufd %%T6, %%T1, 01001110b + vpxor %%T3, %%T3, %%T4 + vpxor %%T3, %%T3, %%T6 %ifidn %%INSTANCE_TYPE, multi_call ;; If using init/update/finalize, we need to xor any partial block data @@ -1744,12 +1682,14 @@ default rel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vmovdqu %%T5, [%%GDATA + HashKey_8] - vpclmulqdq %%T4, %%T2, %%T5, 0x11 ; %%T4 = a1*b1 - vpclmulqdq %%T7, %%T2, %%T5, 0x00 ; %%T7 = a0*b0 - vpclmulqdq %%T6, %%T2, %%T5, 0x01 ; %%T6 = a1*b0 - vpclmulqdq %%T5, %%T2, %%T5, 0x10 ; %%T5 = a0*b1 - vpxor %%T6, %%T6, %%T5 + vmovdqa %%T5, [%%GDATA + HashKeyK_8] + vmovdqa %%T6, [%%GDATA + HashKey_8] + vpclmulqdq %%T7, %%T2, %%T5, 0x00 ; T7 = DATA_L * KK_L + vpclmulqdq %%T4, %%T2, %%T5, 0x10 ; T4 = DATA_L * KK_H + vpclmulqdq %%T5, %%T2, %%T6, 0x01 ; T5 = DATA_H * HK_L + vpclmulqdq %%T6, %%T2, %%T6, 0x11 ; T6 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T5 + vpxor %%T4, %%T4, %%T6 vmovdqu %%T1, [%%GDATA + 16*3] vaesenc %%XMM1, %%T1 @@ -1761,19 +1701,17 @@ default rel vaesenc %%XMM7, %%T1 vaesenc %%XMM8, %%T1 - vmovdqu %%T1, [rsp + TMP2] - vmovdqu %%T5, [%%GDATA + HashKey_7] - vpclmulqdq %%T3, %%T1, %%T5, 0x11 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vmovdqa %%T1, [rsp + TMP2] + vmovdqa %%T5, [%%GDATA + HashKeyK_7] + vmovdqa %%T6, [%%GDATA + HashKey_7] + vpclmulqdq %%T3, %%T1, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, %%T1, %%T5, 0x10 ; T5 = DATA_L * KK_H vpxor %%T7, %%T7, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vpxor %%T4, %%T4, %%T5 + vpclmulqdq %%T3, %%T1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, %%T1, %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T3 + vpxor %%T4, %%T4, %%T5 vmovdqu %%T1, [%%GDATA + 16*4] vaesenc %%XMM1, %%T1 @@ -1786,19 +1724,17 @@ default rel vaesenc %%XMM8, %%T1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vmovdqu %%T1, [rsp + TMP3] - vmovdqu %%T5, [%%GDATA + HashKey_6] - vpclmulqdq %%T3, %%T1, %%T5, 0x11 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vmovdqa %%T1, [rsp + TMP3] + vmovdqa %%T5, [%%GDATA + HashKeyK_6] + vmovdqa %%T6, [%%GDATA + HashKey_6] + vpclmulqdq %%T3, %%T1, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, %%T1, %%T5, 0x10 ; T5 = DATA_L * KK_H vpxor %%T7, %%T7, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vpxor %%T4, %%T4, %%T5 + vpclmulqdq %%T3, %%T1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, %%T1, %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T3 + vpxor %%T4, %%T4, %%T5 vmovdqu %%T1, [%%GDATA + 16*5] vaesenc %%XMM1, %%T1 @@ -1810,19 +1746,17 @@ default rel vaesenc %%XMM7, %%T1 vaesenc %%XMM8, %%T1 - vmovdqu %%T1, [rsp + TMP4] - vmovdqu %%T5, [%%GDATA + HashKey_5] - vpclmulqdq %%T3, %%T1, %%T5, 0x11 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vmovdqa %%T1, [rsp + TMP4] + vmovdqa %%T5, [%%GDATA + HashKeyK_5] + vmovdqa %%T6, [%%GDATA + HashKey_5] + vpclmulqdq %%T3, %%T1, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, %%T1, %%T5, 0x10 ; T5 = DATA_L * KK_H vpxor %%T7, %%T7, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vpxor %%T4, %%T4, %%T5 + vpclmulqdq %%T3, %%T1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, %%T1, %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T3 + vpxor %%T4, %%T4, %%T5 vmovdqu %%T1, [%%GDATA + 16*6] vaesenc %%XMM1, %%T1 @@ -1834,19 +1768,17 @@ default rel vaesenc %%XMM7, %%T1 vaesenc %%XMM8, %%T1 - vmovdqu %%T1, [rsp + TMP5] - vmovdqu %%T5, [%%GDATA + HashKey_4] - vpclmulqdq %%T3, %%T1, %%T5, 0x11 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vmovdqa %%T1, [rsp + TMP5] + vmovdqa %%T5, [%%GDATA + HashKeyK_4] + vmovdqa %%T6, [%%GDATA + HashKey_4] + vpclmulqdq %%T3, %%T1, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, %%T1, %%T5, 0x10 ; T5 = DATA_L * KK_H vpxor %%T7, %%T7, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vpxor %%T4, %%T4, %%T5 + vpclmulqdq %%T3, %%T1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, %%T1, %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T3 + vpxor %%T4, %%T4, %%T5 vmovdqu %%T1, [%%GDATA + 16*7] vaesenc %%XMM1, %%T1 @@ -1858,19 +1790,17 @@ default rel vaesenc %%XMM7, %%T1 vaesenc %%XMM8, %%T1 - vmovdqu %%T1, [rsp + TMP6] - vmovdqu %%T5, [%%GDATA + HashKey_3] - vpclmulqdq %%T3, %%T1, %%T5, 0x11 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vmovdqa %%T1, [rsp + TMP6] + vmovdqa %%T5, [%%GDATA + HashKeyK_3] + vmovdqa %%T6, [%%GDATA + HashKey_3] + vpclmulqdq %%T3, %%T1, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, %%T1, %%T5, 0x10 ; T5 = DATA_L * KK_H vpxor %%T7, %%T7, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vpxor %%T4, %%T4, %%T5 + vpclmulqdq %%T3, %%T1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, %%T1, %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T3 + vpxor %%T4, %%T4, %%T5 vmovdqu %%T1, [%%GDATA + 16*8] vaesenc %%XMM1, %%T1 @@ -1882,19 +1812,17 @@ default rel vaesenc %%XMM7, %%T1 vaesenc %%XMM8, %%T1 - vmovdqu %%T1, [rsp + TMP7] - vmovdqu %%T5, [%%GDATA + HashKey_2] - vpclmulqdq %%T3, %%T1, %%T5, 0x11 - vpxor %%T4, %%T4, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vmovdqa %%T1, [rsp + TMP7] + vmovdqa %%T5, [%%GDATA + HashKeyK_2] + vmovdqa %%T6, [%%GDATA + HashKey_2] + vpclmulqdq %%T3, %%T1, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, %%T1, %%T5, 0x10 ; T5 = DATA_L * KK_H vpxor %%T7, %%T7, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 + vpxor %%T4, %%T4, %%T5 + vpclmulqdq %%T3, %%T1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, %%T1, %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T3 + vpxor %%T4, %%T4, %%T5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1908,20 +1836,17 @@ default rel vaesenc %%XMM7, %%T5 vaesenc %%XMM8, %%T5 - vmovdqu %%T1, [rsp + TMP8] - vmovdqu %%T5, [%%GDATA + HashKey] - - vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vmovdqa %%T1, [rsp + TMP8] + vmovdqa %%T5, [%%GDATA + HashKeyK_1] + vmovdqa %%T6, [%%GDATA + HashKey_1] + vpclmulqdq %%T3, %%T1, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T5, %%T1, %%T5, 0x10 ; T5 = DATA_L * KK_H vpxor %%T7, %%T7, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x01 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x10 - vpxor %%T6, %%T6, %%T3 - - vpclmulqdq %%T3, %%T1, %%T5, 0x11 - vpxor %%T1, %%T4, %%T3 + vpxor %%T4, %%T4, %%T5 + vpclmulqdq %%T3, %%T1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T5, %%T1, %%T6, 0x11 ; T5 = DATA_H * HK_H + vpxor %%T7, %%T7, %%T3 + vpxor %%T4, %%T4, %%T5 vmovdqu %%T5, [%%GDATA + 16*10] %ifndef GCM128_MODE ; GCM192 or GCM256 @@ -1970,12 +1895,7 @@ default rel %endif ; GCM256 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; accumulate product into %%T1:%%T7 - - vpslldq %%T3, %%T6, 8 ; shift-L %%T3 2 DWs - vpsrldq %%T6, %%T6, 8 ; shift-R %%T2 2 DWs - vpxor %%T7, %%T7, %%T3 - vpxor %%T1, %%T1, %%T6 ; accumulate the results in %%T1:%%T7 + ;; product in %%T4:%%T7 %assign i 0 %assign j 1 @@ -2009,14 +1929,12 @@ default rel %endrep ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; first phase of the reduction - vmovdqa %%T3, [rel POLY2] - - vpclmulqdq %%T2, %%T3, %%T7, 0x01 - vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs - - vpxor %%T7, %%T7, %%T2 ; first phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; new reduction T7(low):T4(high), result in %%T1 + vpclmulqdq %%T1, %%T7, [rel POLY], 0x10 + vpshufd %%T5, %%T7, 01001110b + vpxor %%T1, %%T1, %%T4 + vpxor %%T1, %%T1, %%T5 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %assign i 0 %assign j 1 @@ -2044,18 +1962,6 @@ default rel %assign j (j + 1) %endrep - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; second phase of the reduction - vpclmulqdq %%T2, %%T3, %%T7, 0x00 - vpsrldq %%T2, %%T2, 4 ; shift-R xmm2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) - - vpclmulqdq %%T4, %%T3, %%T7, 0x10 - vpslldq %%T4, %%T4, 4 ; shift-L xmm0 1 DW (Shift-L 1-DW to obtain result with no shifts) - - vpxor %%T4, %%T4, %%T2 ; second phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vpxor %%T1, %%T1, %%T4 ; the result is in %%T1 - vpshufb %%XMM1, [rel SHUF_MASK] ; perform a 16Byte swap vpshufb %%XMM2, [rel SHUF_MASK] ; perform a 16Byte swap vpshufb %%XMM3, [rel SHUF_MASK] ; perform a 16Byte swap @@ -2088,174 +1994,40 @@ default rel %define %%XMM7 %15 %define %%XMM8 %16 - ;; Karatsuba Method - - vmovdqu %%T5, [%%GDATA + HashKey_8] - - vpshufd %%T2, %%XMM1, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM1 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T6, %%XMM1, %%T5, 0x11 - vpclmulqdq %%T7, %%XMM1, %%T5, 0x00 - - vpclmulqdq %%XMM1, %%T2, %%T3, 0x00 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_7] - vpshufd %%T2, %%XMM2, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM2 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM2, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM2, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_6] - vpshufd %%T2, %%XMM3, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM3 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM3, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM3, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_5] - vpshufd %%T2, %%XMM4, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM4 - vpxor %%T3, %%T3, %%T5 + vmovdqa %%T5, [%%GDATA + HashKeyK_8] + vmovdqa %%T6, [%%GDATA + HashKey_8] + vpclmulqdq %%T1, %%XMM1, %%T5, 0x00 ; T1 = DATA_L * KK_L + vpclmulqdq %%T2, %%XMM1, %%T5, 0x10 ; T2 = DATA_L * KK_H + vpclmulqdq %%T3, %%XMM1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T4, %%XMM1, %%T6, 0x11 ; T4 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T2, %%T2, %%T4 ; T2 += T4 - vpclmulqdq %%T4, %%XMM4, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM4, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_4] - vpshufd %%T2, %%XMM5, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM5 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM5, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM5, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_3] - vpshufd %%T2, %%XMM6, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM6 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM6, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM6, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_2] - vpshufd %%T2, %%XMM7, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM7 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM7, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM7, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey] - vpshufd %%T2, %%XMM8, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM8 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM8, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM8, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - vpxor %%XMM1, %%XMM1, %%T6 - vpxor %%T2, %%XMM1, %%T7 - - vpslldq %%T4, %%T2, 8 - vpsrldq %%T2, %%T2, 8 - - vpxor %%T7, %%T7, %%T4 - vpxor %%T6, %%T6, %%T2 ; <%%T6:%%T7> holds the result of the accumulated carry-less multiplications - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;first phase of the reduction - vmovdqa %%T3, [rel POLY2] - - vpclmulqdq %%T2, %%T3, %%T7, 0x01 - vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs - - vpxor %%T7, %%T7, %%T2 ; first phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;second phase of the reduction - vpclmulqdq %%T2, %%T3, %%T7, 0x00 - vpsrldq %%T2, %%T2, 4 ; shift-R %%T2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) - - vpclmulqdq %%T4, %%T3, %%T7, 0x10 - vpslldq %%T4, %%T4, 4 ; shift-L %%T4 1 DW (Shift-L 1-DW to obtain result with no shifts) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%assign k 7 +%assign i 2 +%rep 7 + vmovdqa %%T5, [%%GDATA + HashKeyK_ %+ k] + vmovdqa %%T6, [%%GDATA + HashKey_ %+ k] + vpclmulqdq %%T3, %%XMM %+ i, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T4, %%XMM %+ i, %%T5, 0x10 ; T4 = DATA_L * KK_H + vpclmulqdq %%T5, %%XMM %+ i, %%T6, 0x01 ; T5 = DATA_H * HK_L + vpclmulqdq %%T6, %%XMM %+ i, %%T6, 0x11 ; T6 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T2, %%T2, %%T4 ; T2 += T4 + vpxor %%T1, %%T1, %%T5 ; T1 += T5 + vpxor %%T2, %%T2, %%T6 ; T2 += T6 + +%assign k (k - 1) +%assign i (i + 1) +%endrep - vpxor %%T4, %%T4, %%T2 ; second phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vpxor %%T6, %%T6, %%T4 ; the result is in %%T6 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; new reduction T1(low):T2(high), result in %%T6 + vpclmulqdq %%T6, %%T1, [rel POLY], 0x10 + vpshufd %%T3, %%T1, 01001110b + vpxor %%T6, %%T6, %%T2 + vpxor %%T6, %%T6, %%T3 %endmacro ; GHASH the last 4 ciphertext blocks. @@ -2276,159 +2048,41 @@ default rel %define %%XMM6 %14 %define %%XMM7 %15 - ;; Karatsuba Method - - vmovdqu %%T5, [%%GDATA + HashKey_7] - - vpshufd %%T2, %%XMM1, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM1 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T6, %%XMM1, %%T5, 0x11 - vpclmulqdq %%T7, %%XMM1, %%T5, 0x00 - - vpclmulqdq %%XMM1, %%T2, %%T3, 0x00 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_6] - vpshufd %%T2, %%XMM2, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM2 - vpxor %%T3, %%T3, %%T5 - vpclmulqdq %%T4, %%XMM2, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 + vmovdqa %%T5, [%%GDATA + HashKeyK_7] + vmovdqa %%T6, [%%GDATA + HashKey_7] + vpclmulqdq %%T1, %%XMM1, %%T5, 0x00 ; T1 = DATA_L * KK_L + vpclmulqdq %%T2, %%XMM1, %%T5, 0x10 ; T2 = DATA_L * KK_H + vpclmulqdq %%T3, %%XMM1, %%T6, 0x01 ; T3 = DATA_H * HK_L + vpclmulqdq %%T4, %%XMM1, %%T6, 0x11 ; T4 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T2, %%T2, %%T4 ; T2 += T4 - vpclmulqdq %%T4, %%XMM2, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_5] - vpshufd %%T2, %%XMM3, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM3 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM3, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM3, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_4] - vpshufd %%T2, %%XMM4, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM4 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM4, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM4, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_3] - vpshufd %%T2, %%XMM5, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM5 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM5, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM5, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_2] - vpshufd %%T2, %%XMM6, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM6 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM6, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM6, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vmovdqu %%T5, [%%GDATA + HashKey_1] - vpshufd %%T2, %%XMM7, 01001110b - vpshufd %%T3, %%T5, 01001110b - vpxor %%T2, %%T2, %%XMM7 - vpxor %%T3, %%T3, %%T5 - - vpclmulqdq %%T4, %%XMM7, %%T5, 0x11 - vpxor %%T6, %%T6, %%T4 - - vpclmulqdq %%T4, %%XMM7, %%T5, 0x00 - vpxor %%T7, %%T7, %%T4 - - vpclmulqdq %%T2, %%T2, %%T3, 0x00 - - vpxor %%XMM1, %%XMM1, %%T2 - - ;;;;;;;;;;;;;;;;;;;;;; - - vpxor %%XMM1, %%XMM1, %%T6 - vpxor %%T2, %%XMM1, %%T7 - - vpslldq %%T4, %%T2, 8 - vpsrldq %%T2, %%T2, 8 - - vpxor %%T7, %%T7, %%T4 - vpxor %%T6, %%T6, %%T2 ; <%%T6:%%T7> holds the result of the accumulated carry-less multiplications - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;first phase of the reduction - vmovdqa %%T3, [rel POLY2] - - vpclmulqdq %%T2, %%T3, %%T7, 0x01 - vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs - - vpxor %%T7, %%T7, %%T2 ; first phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;second phase of the reduction - vpclmulqdq %%T2, %%T3, %%T7, 0x00 - vpsrldq %%T2, %%T2, 4 ; shift-R %%T2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) - - vpclmulqdq %%T4, %%T3, %%T7, 0x10 - vpslldq %%T4, %%T4, 4 ; shift-L %%T4 1 DW (Shift-L 1-DW to obtain result with no shifts) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%assign k 6 +%assign i 2 +%rep 6 + vmovdqa %%T5, [%%GDATA + HashKeyK_ %+ k] + vmovdqa %%T6, [%%GDATA + HashKey_ %+ k] + vpclmulqdq %%T3, %%XMM %+ i, %%T5, 0x00 ; T3 = DATA_L * KK_L + vpclmulqdq %%T4, %%XMM %+ i, %%T5, 0x10 ; T4 = DATA_L * KK_H + vpclmulqdq %%T5, %%XMM %+ i, %%T6, 0x01 ; T5 = DATA_H * HK_L + vpclmulqdq %%T6, %%XMM %+ i, %%T6, 0x11 ; T6 = DATA_H * HK_H + vpxor %%T1, %%T1, %%T3 ; T1 += T3 + vpxor %%T2, %%T2, %%T4 ; T2 += T4 + vpxor %%T1, %%T1, %%T5 ; T1 += T5 + vpxor %%T2, %%T2, %%T6 ; T2 += T6 + +%assign k (k - 1) +%assign i (i + 1) +%endrep - vpxor %%T4, %%T4, %%T2 ; second phase of the reduction complete - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - vpxor %%T6, %%T6, %%T4 ; the result is in %%T6 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; new reduction T1(low):T2(high), result in %%T6 + vpclmulqdq %%T6, %%T1, [rel POLY], 0x10 + vpshufd %%T3, %%T1, 01001110b + vpxor %%T6, %%T6, %%T2 + vpxor %%T6, %%T6, %%T3 %endmacro ;;; Handle encryption of the final partial block -- GitLab From e55bd0f355909d4f893e9b487210420ea67ec4df Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 10 Jul 2023 14:41:24 +0100 Subject: [PATCH 057/204] avx2: [aes-gcm] typo fix and add parameter description for PARTIAL_BLOCK macro --- lib/include/gcm_common_avx2_avx512.inc | 216 ++++++++++++------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/lib/include/gcm_common_avx2_avx512.inc b/lib/include/gcm_common_avx2_avx512.inc index 8084fd18..afaa60e8 100644 --- a/lib/include/gcm_common_avx2_avx512.inc +++ b/lib/include/gcm_common_avx2_avx512.inc @@ -527,40 +527,40 @@ default rel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; PARTIAL_BLOCK: Handles encryption/decryption and the tag partial blocks between update calls. ; Requires the input data be at least 1 byte long. -; Input: gcm_key_data * (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CYPH_IN), -; input text length (PLAIN_CYPH_LEN), the current data offset (DATA_OFFSET), +; Input: gcm_key_data * (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CIPH_IN), +; input text length (PLAIN_CIPH_LEN), the current data offset (DATA_OFFSET), ; the hash subkey (HASH_SUBKEY) and whether encoding or decoding (ENC_DEC) -; Output: A cypher of the first partial block (CYPH_PLAIN_OUT), and updated GDATA_CTX +; Output: A cipher of the first partial block (CIPH_PLAIN_OUT), and updated GDATA_CTX ; Clobbers rax, r10, r12, r13, r15, xmm0, xmm1, xmm2, xmm3, xmm5, xmm6, xmm9, xmm10, xmm11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro PARTIAL_BLOCK 8 -%define %%GDATA_CTX %1 -%define %%CYPH_PLAIN_OUT %2 -%define %%PLAIN_CYPH_IN %3 -%define %%PLAIN_CYPH_LEN %4 -%define %%DATA_OFFSET %5 -%define %%AAD_HASH %6 -%define %%GDATA_KEY %7 -%define %%ENC_DEC %8 +%define %%GDATA_CTX %1 ;; [in/out] GP with pointer to GCM context structure; context gets updated +%define %%CIPH_PLAIN_OUT %2 ;; [in] GP with pointer to destination buffer +%define %%PLAIN_CIPH_IN %3 ;; [in] GP with pointer to source buffer +%define %%PLAIN_CIPH_LEN %4 ;; [in] GP with message length +%define %%DATA_OFFSET %5 ;; [in/out] GP with offset to source/destination buffer +%define %%AAD_HASH %6 ;; [in/out] an XMM with GHASH value +%define %%GDATA_KEY %7 ;; [in] GP with pointer to GCM keys structure +%define %%ENC_DEC %8 ;; [in] "ENC" or "DEC" cipher direction selector mov r13, [%%GDATA_CTX + PBlockLen] or r13, r13 je %%_partial_block_done ;Leave Macro if no partial blocks %ifdef IS_AVX2_GCM - cmp %%PLAIN_CYPH_LEN, 16 ;Read in input data without over reading + cmp %%PLAIN_CIPH_LEN, 16 ;Read in input data without over reading jl %%_fewer_than_16_bytes - VXLDR xmm1, [%%PLAIN_CYPH_IN] ;If more than 16 bytes of data, just fill the xmm register + VXLDR xmm1, [%%PLAIN_CIPH_IN] ;If more than 16 bytes of data, just fill the xmm register jmp %%_data_read %%_fewer_than_16_bytes: - lea r10, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] - READ_SMALL_DATA_INPUT_AVX xmm1, r10, %%PLAIN_CYPH_LEN, rax + lea r10, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] + READ_SMALL_DATA_INPUT_AVX xmm1, r10, %%PLAIN_CIPH_LEN, rax %%_data_read: ;Finished reading in data %else ; Read in input data without over reading - READ_SMALL_DATA_INPUT_LEN_BT16_AVX512 xmm1, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, r12, rax, k1 + READ_SMALL_DATA_INPUT_LEN_BT16_AVX512 xmm1, %%PLAIN_CIPH_IN, %%PLAIN_CIPH_LEN, r12, rax, k1 %endif vmovdqu xmm9, [%%GDATA_CTX + PBlockEncKey] ;xmm9 = my_ctx_data.partial_block_enc_key @@ -575,9 +575,9 @@ default rel %endif vpxor xmm9, xmm1 ; Ciphertext XOR E(K, Yn) - mov r15, %%PLAIN_CYPH_LEN + mov r15, %%PLAIN_CIPH_LEN add r15, r13 - sub r15, 16 ;Set r15 to be the amount of data left in CYPH_PLAIN_IN after filling the block + sub r15, 16 ;Set r15 to be the amount of data left in CIPH_PLAIN_IN after filling the block jge %%_no_extra_mask ;Determine if if partial block is not being filled and shift mask accordingly sub r12, r15 %%_no_extra_mask: @@ -607,10 +607,10 @@ default rel %%_partial_incomplete: %ifidn __OUTPUT_FORMAT__, win64 - mov rax, %%PLAIN_CYPH_LEN + mov rax, %%PLAIN_CIPH_LEN add [%%GDATA_CTX + PBlockLen], rax %else - add [%%GDATA_CTX + PBlockLen], %%PLAIN_CYPH_LEN + add [%%GDATA_CTX + PBlockLen], %%PLAIN_CIPH_LEN %endif %%_enc_dec_done: vmovdqu [%%GDATA_CTX + AadHash], %%AAD_HASH @@ -629,16 +629,16 @@ default rel sub r13, r12 ; Set r13 to be the number of bytes to write out jmp %%_count_set %%_partial_fill: - mov r13, %%PLAIN_CYPH_LEN + mov r13, %%PLAIN_CIPH_LEN %%_count_set: %ifdef IS_AVX2_GCM - simd_store_avx %%CYPH_PLAIN_OUT, xmm9, r13, rax, r12, %%DATA_OFFSET + simd_store_avx %%CIPH_PLAIN_OUT, xmm9, r13, rax, r12, %%DATA_OFFSET add %%DATA_OFFSET, r13 %else lea rax, [rel byte_len_to_mask_table] kmovw k1, [rax + r13*2] - vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, xmm9 + vmovdqu8 [%%CIPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, xmm9 add %%DATA_OFFSET, r13 %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -685,13 +685,13 @@ default rel ; b = floor(a/16) ; %%num_initial_blocks = b mod 8; ; encrypt the initial %%num_initial_blocks blocks and apply ghash on the ciphertext -; %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r14 are used as a pointer only, not modified. +; %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r14 are used as a pointer only, not modified. ; Updated AAD_HASH is returned in %%T3 %macro INITIAL_BLOCKS 23 %define %%GDATA_KEY %1 -%define %%CYPH_PLAIN_OUT %2 -%define %%PLAIN_CYPH_IN %3 +%define %%CIPH_PLAIN_OUT %2 +%define %%PLAIN_CIPH_IN %3 %define %%LENGTH %4 %define %%DATA_OFFSET %5 %define %%num_initial_blocks %6 ; can be 0, 1, 2, 3, 4, 5, 6 or 7 @@ -758,7 +758,7 @@ default rel %assign i (9 - %%num_initial_blocks) %assign k 0 %rep %%num_initial_blocks - VXLDR %%T1, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + k*16] + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + k*16] vpxor reg(i), reg(i), %%T1 %ifidn %%ENC_DEC, DEC @@ -777,7 +777,7 @@ default rel %assign k 0 %rep %%num_initial_blocks ;; Write back ciphertext for %%num_initial_blocks blocks - VXSTR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + k*16], reg(i) + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + k*16], reg(i) ;; Prepare ciphertext for GHASH computations %ifidn %%ENC_DEC, DEC %if k == 0 @@ -1129,7 +1129,7 @@ default rel %rep 8 %assign k (i - 1) - VXLDR %%T1, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 16*k] + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*k] vpxor reg(i), reg(i), %%T1 %ifidn %%ENC_DEC, DEC %if i == 1 @@ -1145,7 +1145,7 @@ default rel %assign i 1 %rep 8 %assign k (i - 1) - VXSTR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 16*k], reg(i) + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*k], reg(i) %ifidn %%ENC_DEC, DEC %if i == 1 vmovdqa reg(i), %%T6 @@ -1170,7 +1170,7 @@ default rel %rep 7 %assign k (i - 1) - VXLDR %%T1, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 16*k] + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*k] vpxor reg(i), reg(i), %%T1 %ifidn %%ENC_DEC, DEC %if i == 1 @@ -1186,7 +1186,7 @@ default rel %assign i 1 %rep 7 %assign k (i - 1) - VXSTR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 16*k], reg(i) + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*k], reg(i) %ifidn %%ENC_DEC, DEC %if i == 1 vmovdqa reg(i), %%T6 @@ -1227,8 +1227,8 @@ default rel %macro INITIAL_BLOCKS_PARTIAL 25 %define %%GDATA_KEY %1 ;; [in] pointer to GCM key data %define %%GDATA_CTX %2 ;; [in] pointer to GCM context data -%define %%CYPH_PLAIN_OUT %3 ;; [in] pointer to destination buffer -%define %%PLAIN_CYPH_IN %4 ;; [in] pointer to source buffer +%define %%CIPH_PLAIN_OUT %3 ;; [in] pointer to destination buffer +%define %%PLAIN_CIPH_IN %4 ;; [in] pointer to source buffer %define %%LENGTH %5 ;; [in] message length %define %%DATA_OFFSET %6 ;; [in/out] buffer offset %define %%num_initial_blocks %7 ;; [in] numeric value, number of blocks can be from 1 to 7 (not 0) @@ -1300,7 +1300,7 @@ default rel %assign i (9 - %%num_initial_blocks) %rep %%num_initial_blocks - 1 ;; Encrypt the message for all but the last block - VXLDR %%T1, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 16*k] + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*k] vpxor reg(i), reg(i), %%T1 %ifidn %%ENC_DEC, DEC %if k == 0 @@ -1317,7 +1317,7 @@ default rel %assign i (9 - %%num_initial_blocks) %rep %%num_initial_blocks - 1 ;; write back ciphertext for %%num_initial_blocks blocks - VXSTR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 16*k], reg(i) + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*k], reg(i) ;; Prepare ciphertext for GHASH computations %ifidn %%ENC_DEC, DEC %if k == 0 @@ -1353,10 +1353,10 @@ default rel mov [%%GDATA_CTX + PBlockLen], %%LENGTH ;; Encrypt the message - VXLDR %%T1, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] vpxor reg(i), reg(i), %%T1 ;; write back ciphertext for %%num_initial_blocks blocks - VXSTR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], reg(i) + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET], reg(i) add %%DATA_OFFSET, 16 ;; Prepare ciphertext for GHASH computations %ifidn %%ENC_DEC, DEC @@ -1438,8 +1438,8 @@ default rel ;; LT16 - indicates type of read and that the buffer is less than 16 bytes long ;; NOTE: could be replaced with %%LENGTH but at this point ;; %%LENGTH is always less than 16. - ;; No PLAIN_CYPH_LEN argument available in this macro. - ENCRYPT_FINAL_PARTIAL_BLOCK reg(i), %%T1, %%T3, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, LT16, %%ENC_DEC, %%DATA_OFFSET + ;; No PLAIN_CIPH_LEN argument available in this macro. + ENCRYPT_FINAL_PARTIAL_BLOCK reg(i), %%T1, %%T3, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, LT16, %%ENC_DEC, %%DATA_OFFSET vpshufb reg(i), [rel SHUF_MASK] %ifidn %%INSTANCE_TYPE, multi_call @@ -1576,12 +1576,12 @@ default rel ; encrypt 8 blocks at a time ; ghash the 8 previously encrypted ciphertext blocks -; %%GDATA (KEY), %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN are used as pointers only, not modified +; %%GDATA (KEY), %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN are used as pointers only, not modified ; %%DATA_OFFSET is the data offset value %macro GHASH_8_ENCRYPT_8_PARALLEL 23 %define %%GDATA %1 -%define %%CYPH_PLAIN_OUT %2 -%define %%PLAIN_CYPH_IN %3 +%define %%CIPH_PLAIN_OUT %2 +%define %%PLAIN_CIPH_IN %3 %define %%DATA_OFFSET %4 %define %%T1 %5 %define %%T2 %6 @@ -1910,7 +1910,7 @@ default rel %endif %if skip_load_and_xor == 0 - VXLDR %%T2, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 16*i] + VXLDR %%T2, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*i] %endif vaesenclast reg(j), reg(j), %%T5 %if skip_load_and_xor == 0 @@ -1948,7 +1948,7 @@ default rel %endif %if skip_store == 0 - VXSTR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 16*i], reg(j) + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*i], reg(j) %ifidn %%ENC_DEC, DEC %if i == 0 vmovdqa reg(j), %%T6 @@ -2095,30 +2095,30 @@ default rel ;;; r10, r12, r15, rax ;;; T1, T2 ;;; Note AVX2: -;;; PLAIN_CYPH_LEN, %7, is passed only to determine +;;; PLAIN_CIPH_LEN, %7, is passed only to determine ;;; if buffer is big enough to do a 16 byte read & shift. ;;; 'LT16' is passed here only if buffer is known to be smaller ;;; than 16 bytes. ;;; Any other value passed here will result in 16 byte read ;;; code path. ;;; Note AVX512: -;;; PLAIN_CYPH_LEN and T2 are unused at this stage. +;;; PLAIN_CIPH_LEN and T2 are unused at this stage. %macro ENCRYPT_FINAL_PARTIAL_BLOCK 8 %define %%KEY %1 %define %%T1 %2 %define %%T2 %3 -%define %%CYPH_PLAIN_OUT %4 -%define %%PLAIN_CYPH_IN %5 -%define %%PLAIN_CYPH_LEN %6 +%define %%CIPH_PLAIN_OUT %4 +%define %%PLAIN_CIPH_IN %5 +%define %%PLAIN_CIPH_LEN %6 %define %%ENC_DEC %7 %define %%DATA_OFFSET %8 %ifdef IS_AVX2_GCM - ;; NOTE: type of read tuned based %%PLAIN_CYPH_LEN setting -%ifidn %%PLAIN_CYPH_LEN, LT16 + ;; NOTE: type of read tuned based %%PLAIN_CIPH_LEN setting +%ifidn %%PLAIN_CIPH_LEN, LT16 ;; Handle the case where the message is < 16 bytes - lea r10, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] + lea r10, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] ;; T1 - packed output ;; r10 - input data address @@ -2133,7 +2133,7 @@ default rel sub %%DATA_OFFSET, 16 add %%DATA_OFFSET, r13 ;; Receive the last <16 Byte block - vmovdqu %%T1, [%%PLAIN_CYPH_IN+%%DATA_OFFSET] + vmovdqu %%T1, [%%PLAIN_CIPH_IN+%%DATA_OFFSET] sub %%DATA_OFFSET, r13 add %%DATA_OFFSET, 16 @@ -2145,7 +2145,7 @@ default rel vmovdqu %%T2, [r12] ;; shift right 16-r13 bytes vpshufb %%T1, %%T2 -%endif ; %%PLAIN_CYPH_LEN, LT16 +%endif ; %%PLAIN_CIPH_LEN, LT16 ;; At this point T1 contains the partial block data %ifidn %%ENC_DEC, DEC @@ -2173,7 +2173,7 @@ default rel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Output r13 Bytes vmovdqa %%T1, %%KEY - simd_store_avx %%CYPH_PLAIN_OUT, %%T1, r13, rax, r12, %%DATA_OFFSET + simd_store_avx %%CIPH_PLAIN_OUT, %%T1, r13, rax, r12, %%DATA_OFFSET ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %ifidn %%ENC_DEC, DEC @@ -2183,14 +2183,14 @@ default rel %else ;; IS_AVX512_GCM - ;; %%PLAIN_CYPH_IN + %%DATA_OFFSET + ;; %%PLAIN_CIPH_IN + %%DATA_OFFSET ;; - input data address ;; r13 - input data length ;; rax - temp registers ;; out: ;; T1 - packed output ;; k1 - valid byte mask - READ_SMALL_DATA_INPUT_AVX512 %%T1, {%%PLAIN_CYPH_IN + %%DATA_OFFSET}, r13, rax, k1 + READ_SMALL_DATA_INPUT_AVX512 %%T1, {%%PLAIN_CIPH_IN + %%DATA_OFFSET}, r13, rax, k1 ;; At this point T1 contains the partial block data ;; Plaintext XOR E(K, Yn) @@ -2198,7 +2198,7 @@ default rel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Output r13 Bytes - vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, %%KEY + vmovdqu8 [%%CIPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, %%KEY %ifidn %%ENC_DEC, DEC ;; If decrypt, restore the ciphertext into %%KEY @@ -2384,9 +2384,9 @@ default rel %macro GCM_ENC_DEC_SMALL 12 %define %%GDATA_KEY %1 %define %%GDATA_CTX %2 -%define %%CYPH_PLAIN_OUT %3 -%define %%PLAIN_CYPH_IN %4 -%define %%PLAIN_CYPH_LEN %5 +%define %%CIPH_PLAIN_OUT %3 +%define %%PLAIN_CIPH_IN %4 +%define %%PLAIN_CIPH_LEN %5 %define %%ENC_DEC %6 %define %%DATA_OFFSET %7 %define %%LENGTH %8 ; assumed r13 @@ -2413,64 +2413,64 @@ default rel jmp %%_small_initial_num_blocks_is_1 %%_small_initial_num_blocks_is_8: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 8, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 8, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_7: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 7, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 7, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_6: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 6, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 6, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_5: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 5, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 5, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_4: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 4, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 4, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_3: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 3, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 3, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_2: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 2, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 2, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_1: - INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ - %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 1, \ + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, \ + %%PLAIN_CIPH_IN, %%LENGTH, %%DATA_OFFSET, 1, \ xmm12, xmm13, %%HASH_OUT, xmm15, xmm11, %%CTR, \ xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, \ xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE @@ -2484,17 +2484,17 @@ default rel ; GCM_ENC_DEC Encodes/Decodes given data. Assumes that the passed gcm_context_data struct ; has been initialized by GCM_INIT ; Requires the input data be at least 1 byte long because of READ_SMALL_INPUT_DATA. -; Input: gcm_key_data struct* (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CYPH_IN), -; input text length (PLAIN_CYPH_LEN) and whether encoding or decoding (ENC_DEC). -; Output: A cypher of the given plain text (CYPH_PLAIN_OUT), and updated GDATA_CTX +; Input: gcm_key_data struct* (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CIPH_IN), +; input text length (PLAIN_CIPH_LEN) and whether encoding or decoding (ENC_DEC). +; Output: A cipher of the given plain text (CIPH_PLAIN_OUT), and updated GDATA_CTX ; Clobbers rax, r10-r15, and xmm0-xmm15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro GCM_ENC_DEC 7 %define %%GDATA_KEY %1 %define %%GDATA_CTX %2 -%define %%CYPH_PLAIN_OUT %3 -%define %%PLAIN_CYPH_IN %4 -%define %%PLAIN_CYPH_LEN %5 +%define %%CIPH_PLAIN_OUT %3 +%define %%PLAIN_CIPH_IN %4 +%define %%PLAIN_CIPH_LEN %5 %define %%ENC_DEC %6 %define %%INSTANCE_TYPE %7 %define %%DATA_OFFSET r11 @@ -2506,19 +2506,19 @@ default rel ; if there is a block of less than 16 bytes process it '%%_zero_cipher_left .. %%_multiple_of_16_bytes' %ifidn __OUTPUT_FORMAT__, win64 - cmp %%PLAIN_CYPH_LEN, 0 + cmp %%PLAIN_CIPH_LEN, 0 %else - or %%PLAIN_CYPH_LEN, %%PLAIN_CYPH_LEN + or %%PLAIN_CIPH_LEN, %%PLAIN_CIPH_LEN %endif je %%_enc_dec_done xor %%DATA_OFFSET, %%DATA_OFFSET ;; Update length of data processed %ifidn __OUTPUT_FORMAT__, win64 - mov rax, %%PLAIN_CYPH_LEN + mov rax, %%PLAIN_CIPH_LEN add [%%GDATA_CTX + InLen], rax %else - add [%%GDATA_CTX + InLen], %%PLAIN_CYPH_LEN + add [%%GDATA_CTX + InLen], %%PLAIN_CIPH_LEN %endif vmovdqu xmm8, [%%GDATA_CTX + AadHash] @@ -2526,7 +2526,7 @@ default rel ;; NOTE: partial block processing makes only sense for multi_call here. ;; Used for the update flow - if there was a previous partial ;; block fill the remaining bytes here. - PARTIAL_BLOCK %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%DATA_OFFSET, xmm8, %%GDATA_KEY, %%ENC_DEC + PARTIAL_BLOCK %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%PLAIN_CIPH_LEN, %%DATA_OFFSET, xmm8, %%GDATA_KEY, %%ENC_DEC %endif ;; lift CTR set from initial_blocks to here @@ -2537,10 +2537,10 @@ default rel %endif ;; Save the amount of data left to process in r10 - mov r13, %%PLAIN_CYPH_LEN + mov r13, %%PLAIN_CIPH_LEN %ifidn %%INSTANCE_TYPE, multi_call ;; NOTE: %%DATA_OFFSET is zero in single_call case. - ;; Consequently PLAIN_CYPH_LEN will never be zero after + ;; Consequently PLAIN_CIPH_LEN will never be zero after ;; %%DATA_OFFSET subtraction below. sub r13, %%DATA_OFFSET @@ -2566,7 +2566,7 @@ default rel cmp r13, 128 jge %%_large_message_path - GCM_ENC_DEC_SMALL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%ENC_DEC, %%DATA_OFFSET, r13, r12, xmm9, xmm14, %%INSTANCE_TYPE + GCM_ENC_DEC_SMALL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%PLAIN_CIPH_LEN, %%ENC_DEC, %%DATA_OFFSET, r13, r12, xmm9, xmm14, %%INSTANCE_TYPE jmp %%_ghash_done %%_large_message_path: @@ -2604,35 +2604,35 @@ default rel ;; xmm8 - XMM8 - AAD HASH IN ;; xmm10 - T6 ;; xmm0 - T_key - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 7, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 7, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_6: - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 6, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 6, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_5: - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 5, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 5, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_4: - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 4, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 4, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_3: - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 3, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 3, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_2: - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 2, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 2, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_1: - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 1, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 1, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_0: - INITIAL_BLOCKS %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, r13, %%DATA_OFFSET, 0, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 0, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC %%_initial_blocks_encrypted: ;; The entire message was encrypted processed in initial and now need to be hashed @@ -2676,7 +2676,7 @@ default rel ;; xmm8 - XMM8 ;; xmm15 - T7 add r15b, 8 - GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, out_order, %%ENC_DEC, full + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, out_order, %%ENC_DEC, full add %%DATA_OFFSET, 128 sub r13, 128 cmp r13, 128 @@ -2688,7 +2688,7 @@ default rel %%_encrypt_by_8: vpshufb xmm9, [rel SHUF_MASK] add r15b, 8 - GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, full + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, full vpshufb xmm9, [rel SHUF_MASK] add %%DATA_OFFSET, 128 sub r13, 128 @@ -2708,7 +2708,7 @@ default rel ;; TBD: Might need to account for when we don't have room to increment the counter. ;; Process parallel buffers with a final partial block. - GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, partial + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, partial add %%DATA_OFFSET, 128-16 sub r13, 128-16 @@ -2721,7 +2721,7 @@ default rel ;; xmm8 - Final encrypted counter - need to hash with partial or full block ciphertext ;; GDATA, KEY, T1, T2 - ENCRYPT_FINAL_PARTIAL_BLOCK xmm8, xmm0, xmm10, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%ENC_DEC, %%DATA_OFFSET + ENCRYPT_FINAL_PARTIAL_BLOCK xmm8, xmm0, xmm10, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%PLAIN_CIPH_LEN, %%ENC_DEC, %%DATA_OFFSET vpshufb xmm8, [rel SHUF_MASK] @@ -2766,7 +2766,7 @@ default rel %define %%AUTH_TAG %3 %define %%AUTH_TAG_LEN %4 %define %%INSTANCE_TYPE %5 -%define %%PLAIN_CYPH_LEN rax +%define %%PLAIN_CIPH_LEN rax vmovdqu xmm13, [%%GDATA_KEY + HashKey_1] vmovdqu xmm0, [%%GDATA_KEY + HashKeyK_1] @@ -2795,13 +2795,13 @@ default rel %endif mov r12, [%%GDATA_CTX + AadLen] ; r12 = aadLen (number of bytes) - mov %%PLAIN_CYPH_LEN, [%%GDATA_CTX + InLen] + mov %%PLAIN_CIPH_LEN, [%%GDATA_CTX + InLen] shl r12, 3 ; convert into number of bits vmovq xmm15, r12 ; len(A) in xmm15 - shl %%PLAIN_CYPH_LEN, 3 ; len(C) in bits (*128) - vmovq xmm1, %%PLAIN_CYPH_LEN + shl %%PLAIN_CIPH_LEN, 3 ; len(C) in bits (*128) + vmovq xmm1, %%PLAIN_CIPH_LEN vpslldq xmm15, xmm15, 8 ; xmm15 = len(A)|| 0x0000000000000000 vpxor xmm15, xmm15, xmm1 ; xmm15 = len(A)||len(C) -- GitLab From 273def9c9e0944e61d9754306106c60a5fb0c692 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 4 Aug 2023 10:09:39 +0100 Subject: [PATCH 058/204] test: [XVALID] support CRC algorithms --- test/xvalid-app/ipsec_xvalid.c | 72 ++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index dcc7d8dd..374a72b6 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -462,6 +462,12 @@ struct str_value_mapping hash_algo_str_map[] = { .hash_alg = IMB_AUTH_SNOW3G_UIA2_BITLEN, } }, + { + .name = "ZUC-EIA3-256", + .values.job_params = { + .hash_alg = IMB_AUTH_ZUC256_EIA3_BITLEN, + } + }, #ifndef __aarch64__ { .name = "KASUMI-F9", @@ -505,18 +511,70 @@ struct str_value_mapping hash_algo_str_map[] = { .hash_alg = IMB_AUTH_POLY1305, } }, -#endif /* __aarch64__ */ { - .name = "ZUC-EIA3-256", + .name = "GHASH", .values.job_params = { - .hash_alg = IMB_AUTH_ZUC256_EIA3_BITLEN, + .hash_alg = IMB_AUTH_GHASH, } }, -#ifndef __aarch64__ - { - .name = "GHASH", + { .name = "CRC32-ETHERNET-FCS", .values.job_params = { - .hash_alg = IMB_AUTH_GHASH, + .hash_alg = IMB_AUTH_CRC32_ETHERNET_FCS, + } + }, + { .name = "CRC32-SCTP", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC32_SCTP, + } + }, + { .name = "CRC32-WIMAX-OFDMA-DATA", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC32_WIMAX_OFDMA_DATA, + } + }, + { .name = "CRC24-LTE-A", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC24_LTE_A, + } + }, + { .name = "CRC24-LTE-B", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC24_LTE_B, + } + }, + { .name = "CRC16-X25", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC16_X25, + } + }, + { .name = "CRC16-FP-DATA", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC16_FP_DATA, + } + }, + { .name = "CRC11-FP-HEADER", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC11_FP_HEADER, + } + }, + { .name = "CRC10-IUUP-DATA", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC10_IUUP_DATA, + } + }, + { .name = "CRC8-WIMAX-OFDMA-HCS", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC8_WIMAX_OFDMA_HCS, + } + }, + { .name = "CRC7-FP-HEADER", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC7_FP_HEADER, + } + }, + { .name = "CRC6-IUUP-HEADER", + .values.job_params = { + .hash_alg = IMB_AUTH_CRC6_IUUP_HEADER, } }, #endif /* __aarch64__ */ -- GitLab From 493e9b9e93c2bd2b42b38a2b236522d0c80fb3ad Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 7 Aug 2023 22:19:02 +0100 Subject: [PATCH 059/204] avx512: [CRC] optimize last bytes handling --- lib/avx512_t2/crc32_by16_vclmul_avx512.asm | 35 ++++++++---------- .../crc32_refl_by16_vclmul_avx512.asm | 37 ++++++++----------- 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/lib/avx512_t2/crc32_by16_vclmul_avx512.asm b/lib/avx512_t2/crc32_by16_vclmul_avx512.asm index 70288ac1..4668d1d6 100644 --- a/lib/avx512_t2/crc32_by16_vclmul_avx512.asm +++ b/lib/avx512_t2/crc32_by16_vclmul_avx512.asm @@ -323,7 +323,7 @@ align 32 cmp len, 16 je .exact_16_left - jl .less_than_16_left + jb .less_than_16_left vmovdqu xmm7, [msg] ; load the plaintext vpshufb xmm7, xmm18 @@ -342,7 +342,7 @@ align 32 vpxor xmm7, xmm0 ; xor the initial crc value cmp len, 4 - jl .only_less_than_4 + jb .only_less_than_4 lea r11, [rel pshufb_shf_table + 16] sub r11, len @@ -352,23 +352,11 @@ align 32 jmp .done_128 .only_less_than_4: - cmp len, 3 - jl .only_less_than_3 - - vpsrldq xmm7, 5 - jmp .barrett - -.only_less_than_3: - cmp len, 2 - jl .only_less_than_2 - - vpsrldq xmm7, 6 - jmp .barrett - -.only_less_than_2: - vpsrldq xmm7, 7 - jmp .barrett - + lea r11, [rel pshufb_shift_table + 3] + sub r11, len + vmovdqu xmm0, [r11] + vpshufb xmm7, xmm0 + jmp .barrett align 32 .exact_16_left: vmovdqu xmm7, [msg] @@ -380,10 +368,17 @@ mksection .rodata align 16 pshufb_shf_table: - ;; use these values for shift constants for the pshufb instruction + ;; use these values to shift constants for the pshufb instruction dq 0x8786858483828100, 0x8f8e8d8c8b8a8988 dq 0x0706050403020100, 0x000e0d0c0b0a0908 +align 16 +pshufb_shift_table: + ;; use these values to shift data for the pshufb instruction + db 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, + db 0x0C, 0x0D, 0x0E, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF + db 0xFF, 0xFF + align 16 mask1: dq 0x8080808080808080, 0x8080808080808080 diff --git a/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm b/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm index 67dfb645..5a644f00 100644 --- a/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm +++ b/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm @@ -92,7 +92,7 @@ crc32_refl_by16_vclmul_avx512: sub len, 256 cmp len, 256 - jl .fold_128_B_loop + jb .fold_128_B_loop vmovdqu8 zmm7, [msg + 16*8] vmovdqu8 zmm8, [msg + 16*12] @@ -313,7 +313,7 @@ align 32 cmp len, 16 je .exact_16_left - jl .less_than_16_left + jb .less_than_16_left vmovdqu xmm7, [msg] ; load the plaintext vpxor xmm7, xmm0 ; xor the initial crc value @@ -330,30 +330,18 @@ align 32 vpxor xmm7, xmm0 ; xor the initial crc value cmp len, 4 - jl .only_less_than_4 + jb .only_less_than_4 lea r11, [rel pshufb_shf_table] vmovdqu xmm0, [r11 + len] - vpshufb xmm7,xmm0 + vpshufb xmm7, xmm0 jmp .done_128 .only_less_than_4: - cmp len, 3 - jl .only_less_than_3 - - vpslldq xmm7, 5 - jmp .barrett - -.only_less_than_3: - cmp len, 2 - jl .only_less_than_2 - - vpslldq xmm7, 6 - jmp .barrett - -.only_less_than_2: - vpslldq xmm7, 7 - jmp .barrett + lea r11, [rel pshufb_shift_table] + vmovdqu xmm0, [r11 + len] + vpshufb xmm7, xmm0 + jmp .barrett align 32 .exact_16_left: @@ -365,10 +353,17 @@ mksection .rodata align 16 pshufb_shf_table: - ;; use these values for shift constants for the pshufb instruction + ;; use these values to shift constants for the pshufb instruction dq 0x8786858483828100, 0x8f8e8d8c8b8a8988 dq 0x0706050403020100, 0x000e0d0c0b0a0908 +align 16 +pshufb_shift_table: + ;; use these values to shift data for the pshufb instruction + db 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + db 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + db 0x08, 0x09, 0x0A + align 16 mask: dq 0xFFFFFFFFFFFFFFFF, 0x0000000000000000 mask2: dq 0xFFFFFFFF00000000, 0xFFFFFFFFFFFFFFFF -- GitLab From dd3e3433cbf725d2ae0de8d25367958df672df7f Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 8 Aug 2023 13:04:00 +0100 Subject: [PATCH 060/204] avx512: [CRC] fold 64 bytes of data if possible When less than 256 bytes of data are left, fold data in steps of 64 bytes, instead of 16 bytes, if there is enough data. --- lib/avx512_t2/crc32_by16_vclmul_avx512.asm | 90 ++++++++++++++++--- .../crc32_refl_by16_vclmul_avx512.asm | 82 ++++++++++++++--- 2 files changed, 146 insertions(+), 26 deletions(-) diff --git a/lib/avx512_t2/crc32_by16_vclmul_avx512.asm b/lib/avx512_t2/crc32_by16_vclmul_avx512.asm index 4668d1d6..3fdd2444 100644 --- a/lib/avx512_t2/crc32_by16_vclmul_avx512.asm +++ b/lib/avx512_t2/crc32_by16_vclmul_avx512.asm @@ -79,7 +79,7 @@ crc32_by16_vclmul_avx512: ;; check if smaller than 256B cmp len, 256 - jl .less_than_256 + jb .less_than_256 ;; load the initial crc value vmovd xmm10, DWORD(arg1) @@ -147,7 +147,7 @@ crc32_by16_vclmul_avx512: vmovdqa32 zmm4, zmm8 add len, 128 - jmp .fold_128_B_register + jmp .less_than_128_B ;; In this section of the code, there is ((128 * x) + y) bytes of buffer ;; where, 0 <= y < 128. @@ -175,6 +175,24 @@ crc32_by16_vclmul_avx512: add msg, 128 +.less_than_128_B: + ;; At this point, the buffer pointer is pointing at the last + ;; y bytes of the buffer, where 0 <= y < 128. + ;; The 128 bytes of folded data is in 2 of the zmm registers: + ;; zmm0 and zmm4 + + cmp len, -64 + jl .fold_128_B_register + + vbroadcasti32x4 zmm10, [arg4 + crc32_const_fold_4x128b] + ;; If there are still 64 bytes left, folds from 128 bytes to 64 bytes + ;; and handles the next 64 bytes + vpclmulqdq zmm2, zmm0, zmm10, 0x11 + vpclmulqdq zmm0, zmm0, zmm10, 0x00 + vpternlogq zmm0, zmm2, zmm4, 0x96 + add len, 128 + + jmp .fold_64B_loop ;; At this point, the buffer pointer is pointing at the last ;; y bytes of the buffer, where 0 <= y < 128. ;; The 128 bytes of folded data is in 2 of the zmm registers: @@ -291,19 +309,67 @@ crc32_by16_vclmul_avx512: align 32 .less_than_256: - vmovd xmm0, DWORD(arg1) ; get the initial crc value - vpslldq xmm0, 12 + vmovd xmm1, DWORD(arg1) ; get the initial crc value + vpslldq xmm1, 12 - ;; check if there is enough buffer to be able to fold 16B at a time - cmp len, 32 - jl .less_than_32 + ;; check if there is enough buffer to be able to fold 16B at a time + cmp len, 32 + jb .less_than_32 + + cmp len, 64 + jb .less_than_64 + + ;; receive the initial 64B data, xor the initial crc value + vmovdqu8 zmm0, [msg] + vpshufb zmm0, zmm0, zmm18 + vpxorq zmm0, zmm1 + add msg, 64 + sub len, 64 + + cmp len, 64 + jb .reduce_64B + + vbroadcasti32x4 zmm10, [arg4 + crc32_const_fold_4x128b] + +.fold_64B_loop: + vmovdqu8 zmm4, [msg] + vpshufb zmm4, zmm4, zmm18 + vpclmulqdq zmm2, zmm0, zmm10, 0x11 + vpclmulqdq zmm0, zmm0, zmm10, 0x00 + vpternlogq zmm0, zmm2, zmm4, 0x96 + add msg, 64 + sub len, 64 + + cmp len, 64 + jge .fold_64B_loop + +.reduce_64B: + ; Reduce from 64 bytes to 16 bytes + vmovdqu8 zmm11, [arg4 + crc32_const_fold_3x128b] + vpclmulqdq zmm1, zmm0, zmm11, 0x11 + vpclmulqdq zmm2, zmm0, zmm11, 0x00 + vextracti64x2 xmm7, zmm0, 3 ; save last that has no multiplicand + vpternlogq zmm1, zmm2, zmm7, 0x96 + + vmovdqa xmm10, [arg4 + crc32_const_fold_1x128b] ; Needed later in reduction loop + + vshufi64x2 zmm8, zmm1, zmm1, 0x4e ; Swap 1,0,3,2 - 01 00 11 10 + vpxorq ymm8, ymm8, ymm1 + vextracti64x2 xmm5, ymm8, 1 + vpxorq xmm7, xmm5, xmm8 + + sub len, 16 + jns .reduction_loop_16B ; At least 16 bytes of data to digest + jmp .final_reduction_for_128 + +.less_than_64: ;; if there is, load the constants vmovdqa xmm10, [arg4 + crc32_const_fold_1x128b] - vmovdqu xmm7, [msg] ; load the plaintext + vmovdqu xmm7, [msg] ; load the plaintext vpshufb xmm7, xmm18 - vpxor xmm7, xmm0 + vpxor xmm7, xmm1 ; xmm1 already has initial crc value ;; update the buffer pointer add msg, 16 @@ -327,7 +393,7 @@ align 32 vmovdqu xmm7, [msg] ; load the plaintext vpshufb xmm7, xmm18 - vpxor xmm7, xmm0 ; xor the initial crc value + vpxor xmm7, xmm1 ; xor the initial crc value add msg, 16 sub len, 16 vmovdqa xmm10, [arg4 + crc32_const_fold_1x128b] @@ -339,7 +405,7 @@ align 32 kmovw k2, [r11 + len*2] vmovdqu8 xmm7{k2}{z}, [msg] vpshufb xmm7, xmm18 - vpxor xmm7, xmm0 ; xor the initial crc value + vpxor xmm7, xmm1 ; xor the initial crc value cmp len, 4 jb .only_less_than_4 @@ -361,7 +427,7 @@ align 32 .exact_16_left: vmovdqu xmm7, [msg] vpshufb xmm7, xmm18 - vpxor xmm7, xmm0 ; xor the initial crc value + vpxor xmm7, xmm1 ; xor the initial crc value jmp .done_128 mksection .rodata diff --git a/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm b/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm index 5a644f00..2f30b99c 100644 --- a/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm +++ b/lib/avx512_t2/crc32_refl_by16_vclmul_avx512.asm @@ -79,7 +79,7 @@ crc32_refl_by16_vclmul_avx512: ;; check if smaller than 256B cmp len, 256 - jl .less_than_256 + jb .less_than_256 ;; load the initial crc value vmovd xmm10, DWORD(arg1) @@ -138,15 +138,8 @@ crc32_refl_by16_vclmul_avx512: vmovdqa32 zmm4, zmm8 add len, 128 - jmp .fold_128_B_register + jmp .less_than_128_B - ;; In this section of the code, there is ((128 * x) + y) bytes of buffer - ;; where, 0 <= y < 128. - ;; The fold_128_B_loop loop will fold 128 bytes at a time until - ;; there is (128 + y) bytes of buffer left - - ;; Fold 128 bytes at a time. - ;; This section of the code folds 8 xmm registers in parallel .fold_128_B_loop: add msg, 128 vmovdqu8 zmm8, [msg + 16*0] @@ -164,11 +157,24 @@ crc32_refl_by16_vclmul_avx512: add msg, 128 +.less_than_128_B: ;; At this point, the buffer pointer is pointing at the last ;; y bytes of the buffer, where 0 <= y < 128. ;; The 128 bytes of folded data is in 2 of the zmm registers: ;; zmm0 and zmm4 + cmp len, -64 + jl .fold_128_B_register + + vbroadcasti32x4 zmm10, [arg4 + crc32_const_fold_4x128b] + ;; If there are still 64 bytes left, folds from 128 bytes to 64 bytes + ;; and handles the next 64 bytes + vpclmulqdq zmm2, zmm0, zmm10, 0x10 + vpclmulqdq zmm0, zmm0, zmm10, 0x01 + vpternlogq zmm0, zmm2, zmm4, 0x96 + add len, 128 + + jmp .fold_64B_loop .fold_128_B_register: ;; fold the 8x128-bits into 1x128-bits with different constants vmovdqu8 zmm16, [arg4 + crc32_const_fold_7x128b] @@ -282,16 +288,64 @@ crc32_refl_by16_vclmul_avx512: align 32 .less_than_256: - ;; check if there is enough buffer to be able to fold 16B at a time - cmp len, 32 - jl .less_than_32 + ;; check if there is enough buffer to be able to fold 16B at a time + cmp len, 32 + jb .less_than_32 + + ;; load the initial crc value + vmovd xmm1, DWORD(arg1) + + cmp len, 64 + jb .less_than_64 + + ;; receive the initial 64B data, xor the initial crc value + vmovdqu8 zmm0, [msg] + vpxorq zmm0, zmm1 + add msg, 64 + sub len, 64 + + cmp len, 64 + jb .reduce_64B + + vbroadcasti32x4 zmm10, [arg4 + crc32_const_fold_4x128b] + +.fold_64B_loop: + vmovdqu8 zmm4, [msg] + vpclmulqdq zmm2, zmm0, zmm10, 0x10 + vpclmulqdq zmm0, zmm0, zmm10, 0x01 + vpternlogq zmm0, zmm2, zmm4, 0x96 + + add msg, 64 + sub len, 64 + + cmp len, 64 + jge .fold_64B_loop +.reduce_64B: + ; Reduce from 64 bytes to 16 bytes + vmovdqu8 zmm11, [arg4 + crc32_const_fold_3x128b] + vpclmulqdq zmm1, zmm0, zmm11, 0x01 + vpclmulqdq zmm2, zmm0, zmm11, 0x10 + vextracti64x2 xmm7, zmm0, 3 ; save last that has no multiplicand + vpternlogq zmm1, zmm2, zmm7, 0x96 + + vmovdqa xmm10, [arg4 + crc32_const_fold_1x128b] ; Needed later in reduction loop + + vshufi64x2 zmm8, zmm1, zmm1, 0x4e ; Swap 1,0,3,2 - 01 00 11 10 + vpxorq ymm8, ymm8, ymm1 + vextracti64x2 xmm5, ymm8, 1 + vpxorq xmm7, xmm5, xmm8 + + sub len, 16 + jns .reduction_loop_16B ; At least 16 bytes of data to digest + jmp .final_reduction_for_128 + +.less_than_64: ;; if there is, load the constants vmovdqa xmm10, [arg4 + crc32_const_fold_1x128b] - vmovd xmm0, DWORD(arg1) ; get the initial crc value vmovdqu xmm7, [msg] ; load the plaintext - vpxor xmm7, xmm0 + vpxor xmm7, xmm1 ; xmm1 already has initial crc value ;; update the buffer pointer add msg, 16 -- GitLab From d1c1884385769d2235cd180c19cf0a340460215e Mon Sep 17 00:00:00 2001 From: "Kania, Iwo" Date: Mon, 28 Aug 2023 12:57:17 +0100 Subject: [PATCH 061/204] test: Unify test vectors for SNOW3G --- lib/ipsec-mb.h | 4 + test/kat-app/CMakeLists.txt | 4 + test/kat-app/Makefile | 4 +- test/kat-app/snow3g_test.c | 1059 ++++++++--------- test/kat-app/snow3g_test_f8_vectors.json.c | 427 +++++++ test/kat-app/snow3g_test_f9_vectors.json.c | 190 +++ test/kat-app/snow3g_test_vectors.h | 1242 -------------------- test/kat-app/win_x64.mak | 2 +- 8 files changed, 1149 insertions(+), 1783 deletions(-) create mode 100644 test/kat-app/snow3g_test_f8_vectors.json.c create mode 100644 test/kat-app/snow3g_test_f9_vectors.json.c delete mode 100644 test/kat-app/snow3g_test_vectors.h diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 5e3e0d28..169e4d06 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -169,6 +169,10 @@ typedef enum { #define IMB_ZUC256_DIGEST_LEN_IN_BYTES_MIN 4 #define IMB_ZUC256_DIGEST_LEN_IN_BYTES_MAX 16 + +#define IMB_SNOW3G_DIGEST_LEN 4 +#define IMB_SNOW3G_IV_LEN_IN_BYTES 16 + /** * Minimum Ethernet frame size to calculate CRC32 * Source Address (6 bytes) + Destination Address (6 bytes) + Type/Len (2 bytes) diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 4f11a218..fd8b9e01 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -44,6 +44,8 @@ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") ${CMAKE_CURRENT_SOURCE_DIR}/api_test.c ${CMAKE_CURRENT_SOURCE_DIR}/zuc_test.c ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test.c + ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f8_vectors.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f9_vectors.json.c ${CMAKE_CURRENT_SOURCE_DIR}/direct_api_test.c ${CMAKE_CURRENT_SOURCE_DIR}/clear_mem_test.c ${CMAKE_CURRENT_SOURCE_DIR}/direct_api_param_test.c @@ -110,6 +112,8 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/gcm_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/chacha20_poly1305_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/ccm_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f8_vectors.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f9_vectors.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index f7d59d01..f2e1c0fb 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -43,10 +43,10 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ - chacha20_poly1305_test.json.c + chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ - clear_mem_test.c direct_api_param_test.c + snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c endif # aarch64 OBJECTS := $(SOURCES:%.c=%.o) utils.o diff --git a/test/kat-app/snow3g_test.c b/test/kat-app/snow3g_test.c index fb5372fd..e070390e 100644 --- a/test/kat-app/snow3g_test.c +++ b/test/kat-app/snow3g_test.c @@ -32,13 +32,19 @@ #include "ipsec-mb.h" -#include "gcm_ctr_vectors_test.h" #include "utils.h" -#include "snow3g_test_vectors.h" +#include "cipher_test.h" +#include "mac_test.h" -#define SNOW3GIVLEN 8 -#define PAD_LEN 16 +#define IMB_SNOW3G_PAD_LEN 16 +#define IMB_SNOW3G_MAX_DATA_LEN 3048 +#define IMB_SNOW3G_NUM_SUPPORTED_BUFFERS 16 + +extern const struct cipher_test snow3g_cipher_bit_test_vectors_json[]; +extern const struct mac_test snow3g_hash_test_vectors_json[]; +extern const struct cipher_test snow3g_cipher_test_vectors_json[]; +extern const struct cipher_test snow3g_cipher_linear_test_vectors_json[]; int snow3g_test(struct IMB_MGR *mb_mgr); static void @@ -119,6 +125,40 @@ struct { "validate_snow3g_f9"} }; +struct cipher_iv_gen_params { + size_t tcId; + const char *count; + const char *bearer; + const char *dir; +}; + +struct hash_iv_gen_params { + size_t tcId; + const char *count; + const char *fresh; + const char *dir; +}; + +const struct cipher_iv_gen_params snow3g_iv_params_f8_json[] = { +{ 1, "\x00\x00\x00\x00", "\x00", "\x00"}, +{ 2, "\x0f\xf2\xa4\x72", "\x0c", "\x01"}, +{ 3, "\x26\x6b\x55\xfa", "\x03", "\x01"}, +{ 4, "\x7b\xcf\x8b\xe2", "\x18", "\x00"}, +{ 5, "\xb4\x59\x8a\x39", "\x05", "\x01"}, +{ 6, "\x0f\xf2\xa4\x72", "\x09", "\x00"}, +{ 0, NULL, NULL, NULL} +}; + +const struct hash_iv_gen_params snow3g_iv_params_f9_json[] = { +{ 1, "\x56\xf0\xa6\x38", "\x49\xec\xd2\x05", "\x00"}, +{ 2, "\xe2\x87\xdc\x3e", "\xe2\xd8\xf2\xa4", "\x01"}, +{ 3, "\x44\x61\xaf\x36", "\x3a\xf0\x38\x98", "\x01"}, +{ 4, "\x41\x3e\x79\x14", "\xfd\xe8\x97\x03", "\x01"}, +{ 5, "\x3c\x39\x6f\x29", "\x37\x77\x22\x6b", "\x01"}, +{ 6, "\x3c\x39\x6f\x29", "\x37\x77\x22\x6b", "\x01"}, +{ 0, NULL, NULL, NULL} +}; + /****************************************************************************** * @description - utility function to dump test buffers * @@ -182,8 +222,8 @@ submit_uea2_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, i); + printf("%d error status:%d\n", + __LINE__, job->status); return -1; } } @@ -199,7 +239,7 @@ submit_uea2_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, static inline int submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, uint8_t *src, uint8_t *tag, const uint32_t bitlen, - uint8_t *exp_out, const int num_jobs) + const uint8_t *exp_out, const int num_jobs) { int i, err, jobs_rx = 0; IMB_JOB *job; @@ -233,13 +273,13 @@ submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, } /*Compare the digest with the expected in the vectors*/ if (memcmp(job->auth_tag_output, - exp_out, DIGEST_LEN) != 0) { + exp_out, IMB_SNOW3G_DIGEST_LEN) != 0) { printf("IMB_AUTH_SNOW3G_UIA2_BITLEN " "job num:%d\n", i); snow3g_hexdump("Actual:", job->auth_tag_output, - DIGEST_LEN); + IMB_SNOW3G_DIGEST_LEN); snow3g_hexdump("Expected:", exp_out, - DIGEST_LEN); + IMB_SNOW3G_DIGEST_LEN); goto end; } } else { @@ -262,11 +302,11 @@ submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, goto end; } - if (memcmp(job->auth_tag_output, exp_out, DIGEST_LEN) != 0) { + if (memcmp(job->auth_tag_output, exp_out, IMB_SNOW3G_DIGEST_LEN) != 0) { printf("IMB_AUTH_SNOW3G_UIA2_BITLEN job num:%d\n", i); snow3g_hexdump("Actual:", job->auth_tag_output, - DIGEST_LEN); - snow3g_hexdump("Expected:", exp_out, DIGEST_LEN); + IMB_SNOW3G_DIGEST_LEN); + snow3g_hexdump("Expected:", exp_out, IMB_SNOW3G_DIGEST_LEN); goto end; } } @@ -290,17 +330,15 @@ validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int numVectors, i, length; + int numVectors = 0, i; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; snow3g_key_schedule_t *pKeySched = NULL; uint8_t *pKey = NULL; - int keyLen = MAX_KEY_LEN; - uint8_t srcBuff[MAX_DATA_LEN]; - uint8_t dstBuff[MAX_DATA_LEN]; + int keyLen = IMB_KEY_256_BYTES; + uint8_t srcBuff[IMB_SNOW3G_MAX_DATA_LEN]; + uint8_t dstBuff[IMB_SNOW3G_MAX_DATA_LEN]; uint8_t *pSrcBuff = srcBuff; uint8_t *pIV = NULL; int status = -1; @@ -314,12 +352,16 @@ validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, memset(srcBuff, 0, sizeof(srcBuff)); memset(dstBuff, 0, sizeof(dstBuff)); + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f8_1_buffer_exit; } - pIV = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV) { printf("malloc(pIV):failed !\n"); goto snow3g_f8_1_buffer_exit; @@ -340,16 +382,15 @@ validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, goto snow3g_f8_1_buffer_exit; } - /*Copy the data for for Snow3g 1 Packet version*/ + /*Copy the data for for Snow3g 1 Packet version */ for (i = 0; i < numVectors; i++) { + const int length = (int) testVectors[i].msgSize / 8; - length = testVectors[i].dataLenInBytes; - - memcpy(pKey, testVectors[i].key, testVectors[i].keyLenInBytes); - memcpy(srcBuff, testVectors[i].plaintext, length); + memcpy(pKey, testVectors[i].key, testVectors->keySize / 8); + memcpy(srcBuff, testVectors[i].msg, length); - memcpy(dstBuff, testVectors[i].ciphertext, length); - memcpy(pIV, testVectors[i].iv, testVectors[i].ivLenInBytes); + memcpy(pIV, testVectors[i].iv, testVectors->ivSize / 8); + memcpy(dstBuff, testVectors[i].ct, length); /*setup the keysched to be used*/ if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey, pKeySched) == -1) { @@ -362,40 +403,34 @@ validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, uint32_t bit_len = length << 3; uint32_t bit_offset = 0; - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - &pIV, &pSrcBuff, &pSrcBuff, - &bit_len, &bit_offset, - IMB_DIR_ENCRYPT, 1); + submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, &pIV, &pSrcBuff, &pSrcBuff, + &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); } else - IMB_SNOW3G_F8_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, - srcBuff, length); + IMB_SNOW3G_F8_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, srcBuff, length); /*check against the ciphertext in the vector against the * encrypted plaintext*/ if (memcmp(srcBuff, dstBuff, length) != 0) { - printf("IMB_SNOW3G_F8_1_BUFFER(Enc) vector:%d\n", i); + printf("IMB_SNOW3G_F8_1_BUFFER(Enc) vector: %zu\n", testVectors[i].tcId); snow3g_hexdump("Actual:", srcBuff, length); snow3g_hexdump("Expected:", dstBuff, length); goto snow3g_f8_1_buffer_exit; } - memcpy(dstBuff, testVectors[i].plaintext, length); + memcpy(dstBuff, testVectors[i].msg, length); /*Validate Decrypt*/ if (job_api) { unsigned bit_len = length << 3; uint32_t bit_offset = 0; - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - &pIV, &pSrcBuff, &pSrcBuff, - &bit_len, &bit_offset, - IMB_DIR_ENCRYPT, 1); + submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, &pIV, &pSrcBuff, &pSrcBuff, + &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); } else - IMB_SNOW3G_F8_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, - srcBuff, length); + IMB_SNOW3G_F8_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, srcBuff, length); if (memcmp(srcBuff, dstBuff, length) != 0) { - printf("IMB_SNOW3G_F8_1_BUFFER(Dec) vector:%d\n", i); + printf("IMB_SNOW3G_F8_1_BUFFER(Dec) vector: %zu\n", testVectors[i].tcId); snow3g_hexdump("Actual:", srcBuff, length); snow3g_hexdump("Expected:", dstBuff, length); goto snow3g_f8_1_buffer_exit; @@ -448,11 +483,11 @@ static void copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, * - working buffer to -1 (for padding check) * and copy test vectors */ - memset(wrkBuff, -1, (byte_len + PAD_LEN * 2)); - memset(plainBuff, 0, (byte_len + PAD_LEN * 2)); - memset(ciphBuff, 0, (byte_len + PAD_LEN * 2)); - memcpy(plainBuff + PAD_LEN, src_test, byte_len); - memcpy(ciphBuff + PAD_LEN, dst_test, byte_len); + memset(wrkBuff, -1, (byte_len + IMB_SNOW3G_PAD_LEN * 2)); + memset(plainBuff, 0, (byte_len + IMB_SNOW3G_PAD_LEN * 2)); + memset(ciphBuff, 0, (byte_len + IMB_SNOW3G_PAD_LEN * 2)); + memcpy(plainBuff + IMB_SNOW3G_PAD_LEN, src_test, byte_len); + memcpy(ciphBuff + IMB_SNOW3G_PAD_LEN, dst_test, byte_len); } static void @@ -461,24 +496,19 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int i; + int i, numVectors = 0; size_t size = 0; - cipherbit_test_linear_vector_t *testVectors = - &snow3g_f8_linear_bitvectors /*snow3g_cipher_test_vectors[1]*/; - cipher_test_vector_t *testStandardVectors = - snow3g_f8_vectors; /* scipher_test_vectors[1]; */ - /* snow3g f8 test vectors are located at index 1 */ - const int numVectors = - MAX_BIT_BUFFERS; /* numSnow3gCipherTestVectors[3]; */ + const struct cipher_test *vect_bit = snow3g_cipher_bit_test_vectors_json; + const struct cipher_test *vect_standard = snow3g_cipher_test_vectors_json; snow3g_key_schedule_t *pKeySched = NULL; uint8_t *pKey = NULL; - const int keyLen = MAX_KEY_LEN; - uint8_t srcBuff[MAX_DATA_LEN]; - uint8_t midBuff[MAX_DATA_LEN]; - uint8_t dstBuff[MAX_DATA_LEN]; + const int keyLen = IMB_KEY_256_BYTES; + uint8_t srcBuff[IMB_SNOW3G_MAX_DATA_LEN]; + uint8_t midBuff[IMB_SNOW3G_MAX_DATA_LEN]; + uint8_t dstBuff[IMB_SNOW3G_MAX_DATA_LEN]; /* Adding extra byte for offset tests (shifting up to 7 bits) */ - uint8_t padding[PAD_LEN + 1]; + uint8_t padding[IMB_SNOW3G_PAD_LEN + 1]; uint8_t *pIV = NULL; int status = -1; @@ -493,7 +523,16 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, memset(midBuff, 0, sizeof(midBuff)); memset(dstBuff, 0, sizeof(dstBuff)); - pIV = malloc(SNOW3G_IV_LEN_IN_BYTES); + /* calculate number of vectors */ + for (i = 0; vect_bit[i].msg != NULL; i++) + numVectors++; + + if (!numVectors) { + printf("No Snow3G test vectors found !\n"); + goto snow3g_f8_1_buffer_bit_exit; + } + + pIV = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV) { printf("malloc(pIV):failed !\n"); goto snow3g_f8_1_buffer_bit_exit; @@ -517,58 +556,48 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, /*Copy the data for for Snow3g 1 Packet version*/ for (i = 0; i < numVectors; i++) { uint8_t *midBufBefPad = midBuff; - uint8_t *midBufAftPad = midBuff + PAD_LEN; + uint8_t *midBufAftPad = midBuff + IMB_SNOW3G_PAD_LEN; uint8_t *srcBufBefPad = srcBuff; - uint8_t *srcBufAftPad = srcBuff + PAD_LEN; + uint8_t *srcBufAftPad = srcBuff + IMB_SNOW3G_PAD_LEN; uint8_t *dstBufBefPad = dstBuff; - uint8_t *dstBufAftPad = dstBuff + PAD_LEN; + uint8_t *dstBufAftPad = dstBuff + IMB_SNOW3G_PAD_LEN; uint32_t head_offset; for (head_offset = 0; head_offset < 8; head_offset++) { uint32_t byte_len, bit_len, tail_offset, final_byte_offset; - memcpy(pKey, testVectors->key[i], - testVectors->keyLenInBytes); - memcpy(pIV, testVectors->iv[i], - testVectors->ivLenInBytes); + memcpy(pKey, vect_bit[i].key, vect_bit[i].keySize / 8); + memcpy(pIV, vect_bit[i].iv, vect_bit[i].ivSize / 8); if (head_offset != 0) { - bit_len = testVectors->dataLenInBits[i]; + bit_len = (uint32_t) vect_bit[i].msgSize; byte_len = (bit_len + 7) / 8; tail_offset = (head_offset + bit_len) % 8; final_byte_offset = (bit_len + head_offset) / 8; - copy_test_bufs(srcBufBefPad, midBufBefPad, - dstBufBefPad, - testVectors->plaintext[i], - testVectors->ciphertext[i], - byte_len); + copy_test_bufs(srcBufBefPad, midBufBefPad, dstBufBefPad, + (const uint8_t *) vect_bit[i].msg, + (const uint8_t *) vect_bit[i].ct, byte_len); /* shift buffers by offset for this round */ buffer_shift_right(srcBufBefPad, - (byte_len + PAD_LEN * 2) * 8, + (byte_len + IMB_SNOW3G_PAD_LEN * 2) * 8, head_offset); buffer_shift_right(dstBufBefPad, - (byte_len + PAD_LEN * 2) * 8, + (byte_len + IMB_SNOW3G_PAD_LEN * 2) * 8, head_offset); } else { - byte_len = - testStandardVectors[i].dataLenInBytes; + byte_len = (uint32_t) vect_standard[i].msgSize / 8; final_byte_offset = byte_len; bit_len = byte_len * 8; tail_offset = bit_len % 8; - memcpy(srcBuff, - testStandardVectors[i].plaintext, - byte_len); - memcpy(dstBuff, - testStandardVectors[i].ciphertext, - byte_len); + memcpy(srcBuff, vect_standard[i].msg, byte_len); + memcpy(dstBuff, vect_standard[i].ct, byte_len); } /*setup the keysched to be used*/ - if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey, - pKeySched) == -1) { + if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey, pKeySched) == -1) { printf("SNOW3G init key schedule failed\n"); goto snow3g_f8_1_buffer_bit_exit; } @@ -591,14 +620,13 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, * Check against the ciphertext in the vector against * the encrypted plaintext */ - if (membitcmp(midBufAftPad, dstBufAftPad, - bit_len, head_offset) != 0) { + if (membitcmp(midBufAftPad, dstBufAftPad, bit_len, head_offset) != 0) { const uint32_t byte_len_with_offset = (bit_len + head_offset + 7) / 8; printf("Test1: snow3g_f8_1_bitbuffer(Enc) " - "buffer:%d size:%u bit offset:%u\n", - i, bit_len, head_offset); + "buffer:%zu size:%u bit offset:%u\n", + vect_bit[i].tcId, bit_len, head_offset); snow3g_hexdump("Actual:", midBufAftPad, byte_len_with_offset); snow3g_hexdump("Expected:", dstBufAftPad, @@ -611,25 +639,25 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, * overwritten */ if (membitcmp(midBufBefPad, padding, - (PAD_LEN * 8) + head_offset, 0)) { + (IMB_SNOW3G_PAD_LEN * 8) + head_offset, 0)) { printf("overwrite head\n"); snow3g_hexdump("Head", midBufBefPad, - PAD_LEN + 1); + IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } if (membitcmp(midBufAftPad + final_byte_offset, padding, - (PAD_LEN * 8) - tail_offset, + (IMB_SNOW3G_PAD_LEN * 8) - tail_offset, tail_offset)) { printf("overwrite tail\n"); snow3g_hexdump("Tail", midBufAftPad + final_byte_offset, - PAD_LEN + 1); + IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } /* reset working buffer */ - memset(midBufBefPad, -1, (byte_len + PAD_LEN * 2)); + memset(midBufBefPad, -1, (byte_len + IMB_SNOW3G_PAD_LEN * 2)); /*Validate Decrypt*/ if (job_api) @@ -665,20 +693,20 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, * overwritten */ if (membitcmp(midBufBefPad, padding, - (PAD_LEN * 8) + head_offset, 0)) { + (IMB_SNOW3G_PAD_LEN * 8) + head_offset, 0)) { printf("overwrite head\n"); snow3g_hexdump("Head", midBufBefPad, - PAD_LEN + 1); + IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } if (membitcmp(midBufAftPad + final_byte_offset, padding, - (PAD_LEN * 8) - tail_offset, + (IMB_SNOW3G_PAD_LEN * 8) - tail_offset, tail_offset)) { printf("overwrite tail\n"); snow3g_hexdump("Tail", midBufAftPad + final_byte_offset, - PAD_LEN + 1); + IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } } /* head_offset = 0..7 */ @@ -704,19 +732,16 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i = 0, j = 0, numPackets = 2; + int i, j, numVectors = 0, numPackets = 2; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; - - snow3g_key_schedule_t *pKeySched[NUM_SUPPORTED_BUFFERS]; - uint8_t *pKey[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t packetLen[NUM_SUPPORTED_BUFFERS]; - int keyLen = MAX_KEY_LEN; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; + + snow3g_key_schedule_t *pKeySched[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pKey[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pIV[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t packetLen[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; int status = -1; (void) uia2_ctx; @@ -731,6 +756,10 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, memset(pKeySched, 0, sizeof(pKeySched)); memset(pKey, 0, sizeof(pKey)); + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f8_2_buffer_exit; @@ -742,10 +771,10 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Test with all vectors */ for (j = 0; j < numVectors; j++) { - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; + uint32_t bitOffsets[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitLens[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; - length = testVectors[j].dataLenInBytes; + const int length = (int) testVectors[j].msgSize / 8; /* Create test Data for num Packets */ for (i = 0; i < numPackets; i++) { @@ -753,7 +782,7 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, bitLens[i] = length * 8; bitOffsets[i] = 0; - pKey[i] = malloc(keyLen); + pKey[i] = malloc(IMB_KEY_256_BYTES); if (!pKey[i]) { printf("malloc(pKey[%d]):failed !\n", i); goto snow3g_f8_2_buffer_exit; @@ -773,27 +802,23 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_2_buffer_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_2_buffer_exit; } - memcpy(pKey[i], testVectors[j].key, - testVectors[j].keyLenInBytes); + memcpy(pKey[i], testVectors[j].key, testVectors[j].keySize / 8); - memcpy(pSrcBuff[i], testVectors[j].plaintext, length); + memcpy(pSrcBuff[i], testVectors[j].msg, length); memset(pDstBuff[i], 0, length); - memcpy(pIV[i], testVectors[j].iv, - testVectors[j].ivLenInBytes); + memcpy(pIV[i], testVectors[j].iv, testVectors[j].ivSize / 8); /* init key shed */ - if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], - pKeySched[i])) { - printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) " - "error\n"); + if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { + printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) error\n"); goto snow3g_f8_2_buffer_exit; } } @@ -813,15 +838,12 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pSrcBuff[i], testVectors[j].ciphertext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_2_BUFFER(Enc) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pSrcBuff[i], - packetLen[0]); - snow3g_hexdump("Expected:", - testVectors[j].ciphertext, - packetLen[0]); + if (memcmp(pSrcBuff[i], testVectors[j].ct, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_2_BUFFER(Enc) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, + packetLen[i]); goto snow3g_f8_2_buffer_exit; } } @@ -829,7 +851,7 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Set the source buffer with ciphertext, and clear destination * buffer */ for (i = 0; i < numPackets; i++) - memcpy(pSrcBuff[i], testVectors[j].ciphertext, length); + memcpy(pSrcBuff[i], testVectors[j].ct, length); /*Test the decrypt*/ if (job_api) @@ -845,14 +867,11 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pSrcBuff[i], testVectors[j].plaintext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_2_BUFFER(Dec) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pSrcBuff[i], - packetLen[0]); - snow3g_hexdump("Expected:", - testVectors[j].plaintext, + if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_2_BUFFER(Dec) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_2_buffer_exit; } @@ -873,23 +892,19 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pDstBuff[i], testVectors[j].ciphertext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_2_BUFFER(Enc) vector:%d " - "buffer:%d\n", - j, i); - snow3g_hexdump("Actual:", pDstBuff[i], - packetLen[0]); - snow3g_hexdump("Expected:", - testVectors[j].ciphertext, - packetLen[0]); + if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_2_BUFFER(Enc) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, + packetLen[i]); goto snow3g_f8_2_buffer_exit; } } /* Set the source buffer with ciphertext, and clear destination * buffer */ for (i = 0; i < numPackets; i++) { - memcpy(pSrcBuff[i], testVectors[j].ciphertext, length); + memcpy(pSrcBuff[i], testVectors[j].ct, length); memset(pDstBuff[i], 0, length); } @@ -907,14 +922,11 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pDstBuff[i], testVectors[j].plaintext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_2_BUFFER(Dec) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pDstBuff[i], - packetLen[0]); - snow3g_hexdump("Expected:", - testVectors[j].plaintext, + if (memcmp(pDstBuff[i], testVectors[j].msg, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_2_BUFFER(Dec) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_2_buffer_exit; } @@ -971,21 +983,19 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i = 0, j = 0, numPackets = 4; + int i, j, numVectors = 0, numPackets = 4; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; - - snow3g_key_schedule_t *pKeySched[NUM_SUPPORTED_BUFFERS]; - uint8_t *pKey[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t packetLen[NUM_SUPPORTED_BUFFERS]; - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; - int keyLen = MAX_KEY_LEN; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; + + snow3g_key_schedule_t *pKeySched[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pKey[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pIV[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t packetLen[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitOffsets[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitLens[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + int keyLen = IMB_KEY_256_BYTES; int status = -1; (void) uia2_ctx; @@ -1000,6 +1010,10 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, memset(pKeySched, 0, sizeof(pKeySched)); memset(pKey, 0, sizeof(pKey)); + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f8_4_buffer_exit; @@ -1011,7 +1025,7 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Test with all vectors */ for (j = 0; j < numVectors; j++) { - length = testVectors[j].dataLenInBytes; + const int length = (int) testVectors[j].msgSize / 8; /* Create test Data for num Packets */ for (i = 0; i < numPackets; i++) { @@ -1039,27 +1053,21 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_4_buffer_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_4_buffer_exit; } + memcpy(pKey[i], testVectors[j].key, testVectors[j].keySize / 8); - memcpy(pKey[i], testVectors[j].key, - testVectors[j].keyLenInBytes); - - memcpy(pSrcBuff[i], testVectors[j].plaintext, length); + memcpy(pSrcBuff[i], testVectors[j].msg, length); memset(pDstBuff[i], 0, length); - memcpy(pIV[i], testVectors[j].iv, - testVectors[j].ivLenInBytes); - + memcpy(pIV[i], testVectors[j].iv, testVectors[j].ivSize / 8); /* init key shed */ - if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], - pKeySched[i])) { - printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) " - "error\n"); + if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { + printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) error\n"); goto snow3g_f8_4_buffer_exit; } } @@ -1067,10 +1075,8 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* TEST IN-PLACE ENCRYPTION/DECRYPTION */ /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pSrcBuff, - bitLens, bitOffsets, - IMB_DIR_ENCRYPT, 4); + submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, pSrcBuff, pSrcBuff, + bitLens, bitOffsets, IMB_DIR_ENCRYPT, 4); else IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], @@ -1083,14 +1089,11 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pSrcBuff[i], testVectors[j].ciphertext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_4_BUFFER(Enc) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pSrcBuff[i], - packetLen[i]); - snow3g_hexdump("Expected:", - testVectors[j].ciphertext, + if (memcmp(pSrcBuff[i], testVectors[j].ct, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_4_BUFFER(Enc) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); goto snow3g_f8_4_buffer_exit; } @@ -1099,14 +1102,12 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Set the source buffer with ciphertext, and clear destination * buffer */ for (i = 0; i < numPackets; i++) - memcpy(pSrcBuff[i], testVectors[j].ciphertext, length); + memcpy(pSrcBuff[i], testVectors[j].ct, length); /*Test the decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pSrcBuff, - bitLens, bitOffsets, - IMB_DIR_DECRYPT, 4); + submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, pSrcBuff, pSrcBuff, + bitLens, bitOffsets, IMB_DIR_DECRYPT, 4); else IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], @@ -1119,14 +1120,11 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pSrcBuff[i], testVectors[j].plaintext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_4_BUFFER(Dec) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pSrcBuff[i], - packetLen[i]); - snow3g_hexdump("Expected:", - testVectors[j].plaintext, + if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_4_BUFFER(Dec) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_4_buffer_exit; } @@ -1150,14 +1148,11 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pDstBuff[i], testVectors[j].ciphertext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_4_BUFFER(Enc) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pDstBuff[i], - packetLen[i]); - snow3g_hexdump("Expected:", - testVectors[j].ciphertext, + if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_4_BUFFER(Enc) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); goto snow3g_f8_4_buffer_exit; } @@ -1166,7 +1161,7 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Set the source buffer with ciphertext, and clear destination * buffer */ for (i = 0; i < numPackets; i++) { - memcpy(pSrcBuff[i], testVectors[j].ciphertext, length); + memcpy(pSrcBuff[i], testVectors[j].ct, length); memset(pDstBuff[i], 0, length); } /*Test the decrypt*/ @@ -1187,14 +1182,12 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pDstBuff[i], testVectors[j].plaintext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_4_BUFFER(Dec) vector:%d " - "buffer:%d\n", j, i); + if (memcmp(pDstBuff[i], testVectors[j].msg, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_4_BUFFER(Dec) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", - testVectors[j].plaintext, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_4_buffer_exit; } @@ -1224,8 +1217,12 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, } } - /*vectors are in bits used to round up to bytes*/ - length = testVectors[1].dataLenInBytes; + /* use vectors[1] as it is large enough for test case */ + /* vectors are in bits used to round up to bytes */ + const int length = (int) testVectors[1].msgSize / 8; + + if (testVectors[1].msg == NULL) + goto snow3g_f8_4_buffer_exit; /*Create test Data for num Packets*/ for (i = 0; i < numPackets; i++) { @@ -1254,19 +1251,18 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_4_buffer_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_4_buffer_exit; } - memcpy(pKey[i], testVectors[1].key, - testVectors[1].keyLenInBytes); + memcpy(pKey[i], testVectors[1].key, testVectors[1].keySize / 8); - memcpy(pSrcBuff[i], testVectors[1].plaintext, packetLen[i]); + memcpy(pSrcBuff[i], testVectors[1].msg, packetLen[i]); memset(pDstBuff[i], 0, packetLen[i]); - memcpy(pIV[i], testVectors[1].iv, testVectors[1].ivLenInBytes); + memcpy(pIV[i], testVectors[1].iv, testVectors[1].ivSize / 8); /* init key shed */ if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { @@ -1290,12 +1286,12 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pDstBuff[i], testVectors[1].ciphertext, - packetLen[i]) != 0) { + if (memcmp(pDstBuff[i], (const uint8_t *) testVectors[1].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_4_BUFFER(Enc, diff size) " "vector:%d buffer:%d\n", 1, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", testVectors[1].ciphertext, + snow3g_hexdump("Expected:", + (const uint8_t *) testVectors[1].ct, packetLen[i]); goto snow3g_f8_4_buffer_exit; } @@ -1328,21 +1324,19 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i, j, numPackets = 8; + int i, j, numVectors = 0, numPackets = 8; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; - - snow3g_key_schedule_t *pKeySched[NUM_SUPPORTED_BUFFERS]; - uint8_t *pKey[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t packetLen[NUM_SUPPORTED_BUFFERS]; - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; - int keyLen = MAX_KEY_LEN; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; + + snow3g_key_schedule_t *pKeySched[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pKey[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pIV[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t packetLen[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitOffsets[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitLens[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + int keyLen = IMB_KEY_256_BYTES; int status = -1; (void) uia2_ctx; @@ -1357,6 +1351,10 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, memset(pKeySched, 0, sizeof(pKeySched)); memset(pKey, 0, sizeof(pKey)); + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f8_8_buffer_exit; @@ -1368,7 +1366,7 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Test with all vectors */ for (j = 0; j < numVectors; j++) { - length = testVectors[j].dataLenInBytes; + const int length = (int) testVectors[j].msgSize / 8; /* Create test Data for num Packets */ for (i = 0; i < numPackets; i++) { @@ -1396,27 +1394,22 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_8_buffer_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_8_buffer_exit; } + memcpy(pKey[i], testVectors[j].key, testVectors[j].keySize / 8); - memcpy(pKey[i], testVectors[j].key, - testVectors[j].keyLenInBytes); - - memcpy(pSrcBuff[i], testVectors[j].plaintext, length); + memcpy(pSrcBuff[i], testVectors[j].msg, length); memset(pDstBuff[i], 0, length); - memcpy(pIV[i], testVectors[j].iv, - testVectors[j].ivLenInBytes); + memcpy(pIV[i], testVectors[j].iv, testVectors[j].ivSize / 8); /* init key shed */ - if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], - pKeySched[i])) { - printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) " - "error\n"); + if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { + printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) error\n"); goto snow3g_f8_8_buffer_exit; } } @@ -1446,14 +1439,11 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pDstBuff[i], testVectors[j].ciphertext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_8_BUFFER(Enc) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pDstBuff[i], - packetLen[i]); - snow3g_hexdump("Expected:", - testVectors[j].ciphertext, + if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_8_BUFFER(Enc) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); goto snow3g_f8_8_buffer_exit; } @@ -1484,14 +1474,11 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pSrcBuff[i], testVectors[j].plaintext, - packetLen[i]) != 0) { - printf("IMB_SNOW3G_F8_8_BUFFER(Dec) vector:%d " - "buffer:%d\n", j, i); - snow3g_hexdump("Actual:", pSrcBuff[i], - packetLen[i]); - snow3g_hexdump("Expected:", - testVectors[j].plaintext, + if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { + printf("IMB_SNOW3G_F8_8_BUFFER(Dec) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_8_buffer_exit; } @@ -1520,9 +1507,12 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, } } } + /* use vectors[1] as it is large enough for test case */ + /* vectors are in bits used to round up to bytes */ + const int length = (int) testVectors[1].msgSize / 8; - /*vectors are in bits used to round up to bytes*/ - length = testVectors[1].dataLenInBytes; + if (testVectors[1].msg == NULL) + goto snow3g_f8_8_buffer_exit; /*Create test Data for num Packets*/ for (i = 0; i < numPackets; i++) { @@ -1551,19 +1541,18 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_8_buffer_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_8_buffer_exit; } - memcpy(pKey[i], testVectors[1].key, - testVectors[1].keyLenInBytes); + memcpy(pKey[i], testVectors[1].key, testVectors[1].keySize / 8); - memcpy(pSrcBuff[i], testVectors[1].plaintext, packetLen[i]); + memcpy(pSrcBuff[i], testVectors[1].msg, packetLen[i]); memset(pDstBuff[i], 0, packetLen[i]); - memcpy(pIV[i], testVectors[1].iv, testVectors[1].ivLenInBytes); + memcpy(pIV[i], testVectors[1].iv, testVectors[1].ivSize / 8); /* init key shed */ if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { @@ -1592,13 +1581,11 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { - if (memcmp(pDstBuff[i], testVectors[1].ciphertext, - packetLen[i]) != 0) { + if (memcmp(pDstBuff[i], testVectors[1].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_8_BUFFER(Enc, diff size) " - "vector:%d buffer:%d\n", - 1, i); + "vector:%d buffer:%d\n", 1, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", testVectors[1].ciphertext, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[1].ct, packetLen[i]); goto snow3g_f8_8_buffer_exit; } @@ -1632,22 +1619,20 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i, j; + int length, i, j, numVectors = 0; const int numPackets = 8; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; - snow3g_key_schedule_t *pKeySched[NUM_SUPPORTED_BUFFERS]; - uint8_t *pKey[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t packetLen[NUM_SUPPORTED_BUFFERS]; - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; + snow3g_key_schedule_t *pKeySched[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pKey[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pIV[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t packetLen[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitOffsets[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitLens[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; int status = -1; @@ -1664,6 +1649,10 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, memset(packetLen, 0, sizeof(packetLen)); memset(pKeySched, 0, sizeof(pKeySched)); + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f8_8_buffer_multikey_exit; @@ -1675,10 +1664,11 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, goto snow3g_f8_8_buffer_multikey_exit; } + /* Test with all vectors */ for (i = 0; i < numPackets; i++) { j = i % numVectors; - length = testVectors[j].dataLenInBytes; + length = (int) testVectors[j].msgSize / 8; packetLen[i] = length; bitLens[i] = length * 8; bitOffsets[i] = 0; @@ -1698,23 +1688,22 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_8_buffer_multikey_exit; } - pKey[i] = malloc(testVectors[j].keyLenInBytes); + pKey[i] = malloc(testVectors[j].keySize / 8); if (!pKey[i]) { printf("malloc(pKey[%d]):failed !\n", i); goto snow3g_f8_8_buffer_multikey_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_8_buffer_multikey_exit; } - memcpy(pKey[i], testVectors[j].key, - testVectors[j].keyLenInBytes); + memcpy(pKey[i], testVectors[j].key, testVectors[j].keySize / 8); - memcpy(pSrcBuff[i], testVectors[j].plaintext, length); + memcpy(pSrcBuff[i], testVectors[j].msg, length); - memcpy(pIV[i], testVectors[j].iv, testVectors[j].ivLenInBytes); + memcpy(pIV[i], testVectors[j].iv, testVectors[j].ivSize / 8); if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) error\n"); @@ -1739,14 +1728,13 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, /*compare the ciphertext with the encrypted plaintext*/ for (i = 0; i < numPackets; i++) { j = i % numVectors; - if (memcmp(pDstBuff[i], testVectors[j].ciphertext, - packetLen[i]) != 0) { - printf("snow3g_f8_8_multi_buffer(Enc) vector:%d " - "buffer:%d\n", - j, i); + + if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { + printf("snow3g_f8_8_multi_buffer(Enc) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", testVectors[j].ciphertext, - packetLen[i]); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, + packetLen[i]); goto snow3g_f8_8_buffer_multikey_exit; } } @@ -1758,20 +1746,20 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, IMB_DIR_DECRYPT, 8); else IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(mb_mgr, - (const snow3g_key_schedule_t * const *) pKeySched, - (const void * const *)pIV, - (const void * const *)pDstBuff, - (void **)pSrcBuff, packetLen); + (const snow3g_key_schedule_t * const *) pKeySched, + (const void * const *)pIV, + (const void * const *)pDstBuff, + (void **)pSrcBuff, packetLen); /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { j = i % numVectors; - if (memcmp(pSrcBuff[i], testVectors[j].plaintext, - packetLen[i]) != 0) { - printf("snow3g_f8_8_multi_buffer(Dec) vector:%d " - "buffer:%d\n", j, i); + + if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { + printf("snow3g_f8_8_multi_buffer(Dec) vector:%zu " + "buffer:%d\n", testVectors[j].tcId, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", testVectors[j].plaintext, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_8_buffer_multikey_exit; } @@ -1804,21 +1792,19 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i, numPackets = 16; + int numVectors = 0, i, numPackets = IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; - - snow3g_key_schedule_t *pKeySched[NUM_SUPPORTED_BUFFERS]; - uint8_t *pKey[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t packetLen[NUM_SUPPORTED_BUFFERS]; - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; - int keyLen = MAX_KEY_LEN; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; + + snow3g_key_schedule_t *pKeySched[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pKey[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pIV[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t packetLen[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitOffsets[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitLens[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + int keyLen = IMB_KEY_256_BYTES; int status = -1; (void) uia2_ctx; @@ -1834,6 +1820,10 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, memset(packetLen, 0, sizeof(packetLen)); memset(pKeySched, 0, sizeof(pKeySched)); + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f8_n_buffer_exit; @@ -1844,9 +1834,9 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, goto snow3g_f8_n_buffer_exit; /*vectors are in bits used to round up to bytes*/ - length = testVectors[0].dataLenInBytes; + const int length = (int) testVectors[0].msgSize / 8; - /* Create test Data for num Packets*/ + /*Create test Data for num Packets*/ for (i = 0; i < numPackets; i++) { packetLen[i] = length; @@ -1873,31 +1863,28 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_n_buffer_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_n_buffer_exit; } - memcpy(pKey[i], testVectors[0].key, - testVectors[0].keyLenInBytes); + memcpy(pKey[i], testVectors[0].key, testVectors[0].keySize / 8); - memcpy(pSrcBuff[i], testVectors[0].plaintext, length); + memcpy(pSrcBuff[i], testVectors[0].msg, length); memset(pDstBuff[i], 0, length); - memcpy(pIV[i], testVectors[0].iv, - testVectors[0].ivLenInBytes); + memcpy(pIV[i], testVectors[0].iv, testVectors[0].ivSize / 8); /* init key shed */ - if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], - pKeySched[i])) { + if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) error\n"); goto snow3g_f8_n_buffer_exit; } } - for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { + for (i = 0; i < IMB_SNOW3G_NUM_SUPPORTED_BUFFERS ; i++) { /*Test the encrypt*/ if (job_api) { submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, @@ -1917,11 +1904,10 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, } /*Compare the data in the pDstBuff with the cipher pattern*/ - if (memcmp(testVectors[0].ciphertext, pDstBuff[i], - packetLen[i]) != 0) { + if (memcmp(testVectors[0].ct, pDstBuff[i], packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_N_BUFFER(Enc) , vector:%d\n", i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[0]); - snow3g_hexdump("Expected:", testVectors[0].ciphertext, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[0].ct, packetLen[0]); goto snow3g_f8_n_buffer_exit; } @@ -1945,12 +1931,12 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, } /*Compare the data in the pSrcBuff with the pDstBuff*/ - if (memcmp(pSrcBuff[i], testVectors[0].plaintext, + if (memcmp(pSrcBuff[i], testVectors[0].msg, packetLen[i]) != 0) { printf("snow3g_f8_n_buffer equal sizes, vector:%d\n", i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", testVectors[0].plaintext, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[0].msg, packetLen[0]); goto snow3g_f8_n_buffer_exit; } @@ -1983,25 +1969,22 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i, j, numPackets = 16; + int i, j, numPackets = IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; size_t size = 0; - cipher_test_linear_vector_t *testVectors = - snow3g_cipher_test_vectors_linear[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectorsLinear[1]; - - snow3g_key_schedule_t *pKeySched[NUM_SUPPORTED_BUFFERS]; - uint8_t *pKey[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff_const[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff_const[NUM_SUPPORTED_BUFFERS]; - uint8_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t packetLen[NUM_SUPPORTED_BUFFERS]; - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; - int keyLen = MAX_KEY_LEN; - int status = 0; + const struct cipher_test *testVectors = snow3g_cipher_linear_test_vectors_json; + + snow3g_key_schedule_t *pKeySched[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pKey[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff_const[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff_const[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pIV[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t packetLen[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitOffsets[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitLens[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + int keyLen = IMB_KEY_256_BYTES; + int status = -1; (void)uia2_ctx; #ifdef DEBUG @@ -2017,22 +2000,20 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, memset(packetLen, 0, sizeof(packetLen)); memset(pKeySched, 0, sizeof(pKeySched)); - if (!numVectors) { + /* use first vector for all tests */ + if (testVectors[0].msg == NULL) { printf("No Snow3G test vectors found !\n"); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } size = IMB_SNOW3G_KEY_SCHED_SIZE(mb_mgr); - if (!size) { - status = -1; + if (!size) goto snow3g_f8_n_buffer_linear_exit; - } /* Create test Data for num Packets*/ for (i = 0; i < numPackets; i++) { /*vectors are in bits used to round up to bytes*/ - length = testVectors[0].dataLenInBytes[i]; + const int length = (int) testVectors[0].msgSize / 8; packetLen[i] = length; bitLens[i] = length * 8; @@ -2041,62 +2022,52 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, pKey[i] = malloc(keyLen); if (!pKey[i]) { printf("malloc(pKey[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } pKeySched[i] = malloc(size); if (!pKeySched[i]) { printf("malloc(pKeySched[%d]): failed !\n", i); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } pSrcBuff[i] = malloc(length); if (!pSrcBuff[i]) { printf("malloc(pSrcBuff[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } pDstBuff[i] = malloc(length); if (!pDstBuff[i]) { printf("malloc(pDstBuff[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } pSrcBuff_const[i] = malloc(length); if (!pSrcBuff_const[i]) { printf("malloc(pSrcBuff_const[%d]): failed !\n", i); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } pDstBuff_const[i] = malloc(length); if (!pDstBuff_const[i]) { printf("malloc(pDstBuff_const[%d]): failed !\n", i); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } - memcpy(pKey[i], testVectors[0].key[i], - testVectors[0].keyLenInBytes); + memcpy(pKey[i], testVectors[0].key, testVectors[0].keySize / 8); memset(pSrcBuff[i], 0, length); - memcpy(pSrcBuff_const[i], testVectors[0].plaintext[i], length); + memcpy(pSrcBuff_const[i], testVectors[0].msg, length); memset(pDstBuff[i], 0, length); - memcpy(pDstBuff_const[i], testVectors[0].ciphertext[i], length); + memcpy(pDstBuff_const[i], testVectors[0].ct, length); - memcpy(pIV[i], testVectors[0].iv[i], - testVectors[0].ivLenInBytes); + memcpy(pIV[i], testVectors[0].iv, testVectors[0].ivSize / 8); /* init key shed */ if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) error\n"); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } } @@ -2105,6 +2076,8 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, const char *fn_name = job_api ? "submit_uea2_jobs" : "IMB_SNOW3G_F8_N_BUFFER"; + const int length = (int) testVectors[0].msgSize / 8; + for (j = 0; j < i; j++) { /* Cleanup previous values */ memset(pSrcBuff[j], 0, length); @@ -2125,7 +2098,6 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, i + 1); if (pDstBuff[0] == NULL) { printf("N buffer failure\n"); - status = -1; goto snow3g_f8_n_buffer_linear_exit; } } @@ -2140,7 +2112,6 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, packetLen[j]); snow3g_hexdump("Expected:", pDstBuff_const[j], packetLen[j]); - status = -1; } } @@ -2156,10 +2127,8 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, pDstBuff_const, (void **)pSrcBuff, packetLen, i + 1); - if (pSrcBuff[0] == NULL) { - status = -1; + if (pSrcBuff[0] == NULL) goto snow3g_f8_n_buffer_linear_exit; - } } /*Compare the data in the pSrcBuff with the pDstBuff*/ @@ -2172,11 +2141,14 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, packetLen[j]); snow3g_hexdump("Expected:", pSrcBuff_const[j], packetLen[j]); - status = -1; + goto snow3g_f8_n_buffer_linear_exit; } } } + /* no errors detected */ + status = 0; + snow3g_f8_n_buffer_linear_exit: for (i = 0; i < numPackets; i++) { if (pKey[i] != NULL) @@ -2207,29 +2179,35 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i, j; + int numVectors = 0, i, j; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 random test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; - - snow3g_key_schedule_t **pKeySched; - uint8_t **pKey; - uint8_t **pSrcBuff; - uint8_t **pDstBuff; - uint8_t **pSrcBuff_const; - uint8_t **pDstBuff_const; - uint8_t **pIV; - uint32_t *packetLen; - uint32_t *bitOffsets; - uint32_t *bitLens; - int status = 0; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; + + snow3g_key_schedule_t **pKeySched = NULL; + uint8_t **pKey = NULL; + uint8_t **pSrcBuff = NULL; + uint8_t **pDstBuff = NULL; + uint8_t **pSrcBuff_const = NULL; + uint8_t **pDstBuff_const = NULL; + uint8_t **pIV = NULL; + uint32_t *packetLen = NULL; + uint32_t *bitOffsets = NULL; + uint32_t *bitLens = NULL; + int status = -1; (void)uia2_ctx; #ifdef DEBUG printf("Testing IMB_SNOW3G_F8_N_BUFFER_MULTI for usecase %s: (%s):\n", __func__, job_api ? "Job API" : "Direct API"); #endif + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + + if (!numVectors) { + printf("No Snow3G test vectors found !\n"); + goto snow3g_f8_n_buff_linear_mkey_early_exit; + } pSrcBuff = malloc(sizeof(*pSrcBuff) * numVectors); pSrcBuff_const = malloc(sizeof(*pSrcBuff_const) * numVectors); @@ -2258,85 +2236,70 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, memset(bitOffsets, 0, sizeof(*bitOffsets) * numVectors); memset(bitLens, 0, sizeof(*bitLens) * numVectors); - if (!numVectors) { - printf("No Snow3G test vectors found !\n"); - status = -1; - goto snow3g_f8_n_buff_linear_mkey_exit; - } - size = IMB_SNOW3G_KEY_SCHED_SIZE(mb_mgr); - if (!size) { - status = -1; + if (!size) goto snow3g_f8_n_buff_linear_mkey_exit; - } /* Create test Data for num Vectors */ for (i = 0; i < numVectors; i++) { + j = i % numVectors; + /*vectors are in bits used to round up to bytes*/ - length = testVectors[i].dataLenInBytes; + const int length = (int) testVectors[j].msgSize / 8; packetLen[i] = length; bitLens[i] = length * 8; bitOffsets[i] = 0; - pKey[i] = malloc(testVectors[i].keyLenInBytes); + pKey[i] = malloc(testVectors[j].keySize / 8); if (!pKey[i]) { printf("malloc(pKey[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } pKeySched[i] = malloc(size); if (!pKeySched[i]) { printf("malloc(pKeySched[%d]): failed !\n", i); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } pSrcBuff[i] = malloc(length); if (!pSrcBuff[i]) { printf("malloc(pSrcBuff[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } pDstBuff[i] = malloc(length); if (!pDstBuff[i]) { printf("malloc(pDstBuff[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } pSrcBuff_const[i] = malloc(length); if (!pSrcBuff_const[i]) { printf("malloc(pSrcBuff_const[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } pDstBuff_const[i] = malloc(length); if (!pDstBuff_const[i]) { printf("malloc(pDstBuff_const[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } - pIV[i] = malloc(testVectors[i].ivLenInBytes); + pIV[i] = malloc(testVectors[j].ivSize / 8); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } - memcpy(pKey[i], testVectors[i].key, - testVectors[i].keyLenInBytes); + memcpy(pKey[i], testVectors[j].key, testVectors[j].keySize / 8); memset(pSrcBuff[i], 0, length); - memcpy(pSrcBuff_const[i], testVectors[i].plaintext, length); + memcpy(pSrcBuff_const[i], testVectors[j].msg, length); memset(pDstBuff[i], 0, length); - memcpy(pDstBuff_const[i], testVectors[i].ciphertext, length); + memcpy(pDstBuff_const[i], testVectors[j].ct, length); - memcpy(pIV[i], testVectors[i].iv, testVectors[i].ivLenInBytes); + memcpy(pIV[i], testVectors[j].iv, testVectors[j].ivSize / 8); /* init key shed */ if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { printf("IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr) error\n"); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } } @@ -2354,9 +2317,9 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, /*Test the encrypt*/ while (nb_remain_elem > 0) { - if (nb_remain_elem >= NUM_SUPPORTED_BUFFERS) { - nb_elem = NUM_SUPPORTED_BUFFERS; - nb_remain_elem -= NUM_SUPPORTED_BUFFERS; + if (nb_remain_elem >= IMB_SNOW3G_NUM_SUPPORTED_BUFFERS) { + nb_elem = IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; + nb_remain_elem -= IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; } else { nb_elem = nb_remain_elem; nb_remain_elem = 0; @@ -2381,13 +2344,12 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, nb_elem); if (pDstBuff[idx] == NULL) { printf("N buffer failure\n"); - status = -1; goto snow3g_f8_n_buff_linear_mkey_exit; } } - if (nb_elem == NUM_SUPPORTED_BUFFERS) - idx += NUM_SUPPORTED_BUFFERS; + if (nb_elem == IMB_SNOW3G_NUM_SUPPORTED_BUFFERS) + idx += IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; } /*Compare the data in the pDstBuff with the cipher pattern*/ @@ -2400,16 +2362,16 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, packetLen[j]); snow3g_hexdump("Expected:", pDstBuff_const[j], packetLen[j]); - status = -1; + goto snow3g_f8_n_buff_linear_mkey_exit; } } nb_remain_elem = i + 1; idx = 0; while (nb_remain_elem > 0) { - if (nb_remain_elem >= NUM_SUPPORTED_BUFFERS) { - nb_elem = NUM_SUPPORTED_BUFFERS; - nb_remain_elem -= NUM_SUPPORTED_BUFFERS; + if (nb_remain_elem >= IMB_SNOW3G_NUM_SUPPORTED_BUFFERS) { + nb_elem = IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; + nb_remain_elem -= IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; } else { nb_elem = nb_remain_elem; nb_remain_elem = 0; @@ -2432,14 +2394,12 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, (const void *const *)&pDstBuff_const[idx], (void **)&pSrcBuff[idx], &packetLen[idx], nb_elem); - if (pSrcBuff[idx] == NULL) { - status = -1; + if (pSrcBuff[idx] == NULL) goto snow3g_f8_n_buff_linear_mkey_exit; - } } - if (nb_elem == NUM_SUPPORTED_BUFFERS) - idx += NUM_SUPPORTED_BUFFERS; + if (nb_elem == IMB_SNOW3G_NUM_SUPPORTED_BUFFERS) + idx += IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; } /*Compare the data in the pSrcBuff with the pDstBuff*/ for (j = 0; j <= i; j++) { @@ -2451,11 +2411,14 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, packetLen[j]); snow3g_hexdump("Expected:", pSrcBuff_const[j], packetLen[j]); - status = -1; + goto snow3g_f8_n_buff_linear_mkey_exit; } } } + /* no errors detected */ + status = 0; + snow3g_f8_n_buff_linear_mkey_exit: for (i = 0; i < numVectors; i++) { if (pKey[i] != NULL) @@ -2507,20 +2470,18 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int length, numVectors, i, numPackets = NUM_SUPPORTED_BUFFERS; + int i, j, numVectors = 0, numPackets = IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; size_t size = 0; - cipher_test_vector_t *testVectors = snow3g_cipher_test_vectors[1]; - /* snow3g f8 test vectors are located at index 1 */ - numVectors = numSnow3gCipherTestVectors[1]; - - snow3g_key_schedule_t *pKeySched[NUM_SUPPORTED_BUFFERS]; - uint8_t *pKey[NUM_SUPPORTED_BUFFERS]; - uint8_t *pSrcBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pDstBuff[NUM_SUPPORTED_BUFFERS]; - uint8_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t packetLen[NUM_SUPPORTED_BUFFERS]; - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; + const struct cipher_test *testVectors = snow3g_cipher_test_vectors_json; + + snow3g_key_schedule_t *pKeySched[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pKey[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pSrcBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pDstBuff[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint8_t *pIV[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t packetLen[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitOffsets[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; + uint32_t bitLens[IMB_SNOW3G_NUM_SUPPORTED_BUFFERS]; int status = -1; (void) uia2_ctx; @@ -2537,6 +2498,10 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, memset(pKey, 0, sizeof(pKey)); memset(packetLen, 0, sizeof(packetLen)); + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f8_n_buffer_multikey_exit; @@ -2547,7 +2512,10 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, goto snow3g_f8_n_buffer_multikey_exit; for (i = 0; i < numPackets; i++) { - length = testVectors[0].dataLenInBytes; + j = i % numVectors; + + const int length = (int) testVectors[j].msgSize / 8; + packetLen[i] = length; bitLens[i] = length * 8; bitOffsets[i] = 0; @@ -2567,23 +2535,22 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, printf("malloc(pDstBuff[%d]):failed !\n", i); goto snow3g_f8_n_buffer_multikey_exit; } - pKey[i] = malloc(testVectors[0].keyLenInBytes); + pKey[i] = malloc(testVectors[j].keySize / 8); if (!pKey[i]) { printf("malloc(pKey[%d]):failed !\n", i); goto snow3g_f8_n_buffer_multikey_exit; } - pIV[i] = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV[i] = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV[i]) { printf("malloc(pIV[%d]):failed !\n", i); goto snow3g_f8_n_buffer_multikey_exit; } - memcpy(pKey[i], testVectors[0].key, - testVectors[0].keyLenInBytes); + memcpy(pKey[i], testVectors[j].key, testVectors[j].keySize / 8); - memcpy(pSrcBuff[i], testVectors[0].plaintext, length); + memcpy(pSrcBuff[i], testVectors[j].msg, length); - memcpy(pIV[i], testVectors[0].iv, testVectors[0].ivLenInBytes); + memcpy(pIV[i], testVectors[j].iv, testVectors[j].ivSize / 8); if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey[i], pKeySched[i])) { printf("IMB_SNOW3G_INIT_KEY_SCHED() error\n"); @@ -2592,9 +2559,12 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, } for (i = 0; i < numPackets; i++) { + j = i % numVectors; + /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, + submit_uea2_jobs(mb_mgr, + (uint8_t **)&pKeySched, pIV, pSrcBuff, pDstBuff, bitLens, bitOffsets, IMB_DIR_ENCRYPT, i + 1); @@ -2612,12 +2582,11 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, } /*Compare the data in the pDstBuff with the cipher pattern*/ - if (memcmp(testVectors[0].ciphertext, pDstBuff[i], - packetLen[i]) != 0) { + if (memcmp(testVectors[j].ct, pDstBuff[i], packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_N_BUFFER(Enc) , vector:%d " "buffer: %d\n", 0, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", testVectors[0].ciphertext, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); goto snow3g_f8_n_buffer_multikey_exit; } @@ -2642,12 +2611,11 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, } /*Compare the data in the pSrcBuff with the pDstBuff*/ - if (memcmp(pSrcBuff[i], testVectors[0].plaintext, - packetLen[i]) != 0) { + if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("snow3g_f8_n_buffer equal sizes, vector:%d " "buffer: %d\n", 0, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", testVectors[0].plaintext, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_n_buffer_multikey_exit; } @@ -2680,17 +2648,15 @@ validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { - int numVectors, i, inputLen; + int numVectors = 0, i; size_t size = 0; - hash_test_vector_t *testVectors = snow3g_hash_test_vectors[2]; - /* snow3g f9 test vectors are located at index 2 */ - numVectors = numSnow3gHashTestVectors[2]; + const struct mac_test *testVectors = snow3g_hash_test_vectors_json; snow3g_key_schedule_t *pKeySched = NULL; uint8_t *pKey = NULL; - int keyLen = MAX_KEY_LEN; - uint8_t srcBuff[MAX_DATA_LEN]; - uint8_t digest[DIGEST_LEN]; + int keyLen = IMB_KEY_256_BYTES; + uint8_t srcBuff[IMB_SNOW3G_MAX_DATA_LEN]; + uint8_t digest[IMB_SNOW3G_DIGEST_LEN]; uint8_t *pIV = NULL; int status = -1; @@ -2700,12 +2666,16 @@ validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, job_api ? "Job API" : "Direct API"); #endif + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { printf("No Snow3G test vectors found !\n"); goto snow3g_f9_1_buffer_exit; } - pIV = malloc(SNOW3G_IV_LEN_IN_BYTES); + pIV = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); if (!pIV) { printf("malloc(pIV):failed !\n"); goto snow3g_f9_1_buffer_exit; @@ -2729,11 +2699,11 @@ validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Get test data for for Snow3g 1 Packet version*/ for (i = 0; i < numVectors; i++) { - inputLen = (testVectors[i].lengthInBits + 7) / 8; + const int inputLen = ((int) testVectors[i].msgSize + 7) / 8; - memcpy(pKey, testVectors[i].key, testVectors[i].keyLenInBytes); - memcpy(srcBuff, testVectors[i].input, inputLen); - memcpy(pIV, testVectors[i].iv, testVectors[i].ivLenInBytes); + memcpy(pKey, testVectors[i].key, testVectors[i].keySize / 8); + memcpy(srcBuff, testVectors[i].msg, inputLen); + memcpy(pIV, testVectors[i].iv, testVectors[i].ivSize / 8); /*Only 1 key sched is used*/ if (IMB_SNOW3G_INIT_KEY_SCHED(mb_mgr, pKey, pKeySched)) { @@ -2749,32 +2719,29 @@ validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, }; for (j = 0; j < DIM(num_jobs_tab); j++) { - int ret = submit_uia2_job(mb_mgr, - (uint8_t *)pKeySched, - pIV, srcBuff, digest, - testVectors[i].lengthInBits, - testVectors[i].exp_out, - num_jobs_tab[j]); + int ret = submit_uia2_job(mb_mgr, (uint8_t *)pKeySched, pIV, + srcBuff, digest, + (const uint32_t) testVectors[i].msgSize, + (const uint8_t *) testVectors[i].tag, + num_jobs_tab[j]); if (ret < 0) { - printf("IMB_SNOW3G_F9 JOB API " - "vector num:%d\n", i); + printf("IMB_SNOW3G_F9 JOB API vector num:%zu\n", + testVectors[i].tcId); goto snow3g_f9_1_buffer_exit; } } } else { IMB_SNOW3G_F9_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, - testVectors[i].lengthInBits, + testVectors[i].msgSize, digest); /*Compare the digest with the expected in the vectors*/ - if (memcmp(digest, testVectors[i].exp_out, - DIGEST_LEN) != 0) { - printf("IMB_SNOW3G_F9_1_BUFFER() " - "vector num:%d\n", i); - snow3g_hexdump("Actual:", digest, DIGEST_LEN); - snow3g_hexdump("Expected:", - testVectors[i].exp_out, - DIGEST_LEN); + if (memcmp(digest, testVectors[i].tag, IMB_SNOW3G_DIGEST_LEN) != 0) { + printf("IMB_SNOW3G_F9_1_BUFFER() vector num:%zu\n", + testVectors[i].tcId); + snow3g_hexdump("Actual:", digest, IMB_SNOW3G_DIGEST_LEN); + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[i].tag, + IMB_SNOW3G_DIGEST_LEN); goto snow3g_f9_1_buffer_exit; } } @@ -2796,32 +2763,40 @@ snow3g_f9_1_buffer_exit: static int validate_f8_iv_gen(void) { - uint32_t i; + uint32_t i, numVectors = 0; uint8_t IV[16]; - const uint32_t numVectors = MAX_BIT_BUFFERS; #ifdef DEBUG printf("Testing snow3g_f8_iv_gen:\n"); #endif + const struct cipher_iv_gen_params *iv_params = snow3g_iv_params_f8_json; + const struct cipher_test *testVectors = snow3g_cipher_bit_test_vectors_json; + + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + + if (!numVectors) { + printf("No Snow3G test vectors found !\n"); + return 1; + } /* skip first vector as it's not part of test data */ for (i = 1; i < numVectors; i++) { - cipher_iv_gen_params_t *iv_params = - &snow3g_f8_linear_bitvectors.iv_params[i]; - memset(IV, 0, sizeof(IV)); /* generate IV */ - if (snow3g_f8_iv_gen(iv_params->count, iv_params->bearer, - iv_params->dir, &IV) < 0) + if (snow3g_f8_iv_gen(*(const uint32_t *) iv_params[i].count, + *(const uint8_t *) iv_params[i].bearer, + *(const uint8_t *) iv_params[i].dir, &IV) < 0) return 1; /* validate result */ - if (memcmp(IV, snow3g_f8_linear_bitvectors.iv[i], 16) != 0) { - printf("snow3g_f8_iv_gen vector num: %u\n", i); + if (memcmp(IV, testVectors[i].iv, 16) != 0) { + printf("snow3g_f8_iv_gen vector num: %zu\n", testVectors[i].tcId); snow3g_hexdump("Actual", IV, 16); snow3g_hexdump("Expected", - snow3g_f8_linear_bitvectors.iv[i], 16); + (const uint8_t *)testVectors[i].iv, 16); return 1; } } @@ -2831,32 +2806,40 @@ static int validate_f8_iv_gen(void) static int validate_f9_iv_gen(void) { - uint32_t i; + uint32_t i, numVectors = 0; uint8_t IV[16]; - /* snow3g f9 test vectors are located at index 2 */ - const uint32_t numVectors = numSnow3gHashTestVectors[2]; #ifdef DEBUG printf("Testing snow3g_f9_iv_gen:\n"); #endif /* 6 test sets */ - for (i = 0; i < numVectors; i++) { - hash_iv_gen_params_t *iv_params = - &snow_f9_vectors[i].iv_params; + const struct hash_iv_gen_params *iv_params = snow3g_iv_params_f9_json; + const struct mac_test *testVectors = snow3g_hash_test_vectors_json; + + /* calculate number of vectors */ + for (i = 0; testVectors[i].msg != NULL; i++) + numVectors++; + if (!numVectors) { + printf("No Snow3G test vectors found !\n"); + return 1; + } + + for (i = 0; i < numVectors; i++) { memset(IV, 0, sizeof(IV)); /* generate IV */ - if (snow3g_f9_iv_gen(iv_params->count, iv_params->fresh, - iv_params->dir, &IV) < 0) + if (snow3g_f9_iv_gen(*(const uint32_t *) iv_params[i].count, + *(const uint32_t *) iv_params[i].fresh, + *(const uint8_t *) iv_params[i].dir, &IV) < 0) return 1; /* validate result */ - if (memcmp(IV, snow_f9_vectors[i].iv, 16) != 0) { - printf("snow3g_f9_iv_gen vector num: %u\n", i); + if (memcmp(IV, testVectors[i].iv, 16) != 0) { + printf("snow3g_f9_iv_gen vector num: %zu\n", testVectors[i].tcId); snow3g_hexdump("Actual", IV, 16); - snow3g_hexdump("Expected", snow_f9_vectors[i].iv, 16); + snow3g_hexdump("Expected", (const uint8_t *) testVectors[i].iv, 16); return 1; } } diff --git a/test/kat-app/snow3g_test_f8_vectors.json.c b/test/kat-app/snow3g_test_f8_vectors.json.c new file mode 100644 index 00000000..038b84cf --- /dev/null +++ b/test/kat-app/snow3g_test_f8_vectors.json.c @@ -0,0 +1,427 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + Copyright (c) 2022, Nokia + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* SNOW3G_f8 */ +#include "cipher_test.h" +const struct cipher_test snow3g_cipher_bit_test_vectors_json[] = { + {128, 128, 1, + "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xac\x00\x00\x00\x39\x8a\x59\xb4\xac\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", + "\x5d\x5b\xfe\x75\xeb\x04\xf6\x8c\xe0\xa1\x23\x77\xea\x00\xb3\x7d\x47\xc6" + "\xa0\xba\x06\x30\x91\x55\x08\x6a\x85\x9c\x43\x41\xb3\x7c", + 1, 256}, + {128, 128, 2, + "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" + "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" + "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" + "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" + "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" + "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\x8c\xeb\xa6\x29\x43\xdc\xed\x3a\x09\x90\xb0\x6e\xa1\xb0\xa2\xc4\xfb\x3c" + "\xed\xc7\x1b\x36\x9f\x42\xba\x64\xc1\xeb\x66\x65\xe7\x2a\xa1\xc9\xbb\x0d" + "\xea\xa2\x0f\xe8\x60\x58\xb8\xba\xee\x2c\x2e\x7f\x0b\xec\xce\x48\xb5\x29" + "\x32\xa5\x3c\x9d\x5f\x93\x1a\x3a\x7c\x53\x22\x59\xaf\x43\x25\xe2\xa6\x5e" + "\x30\x84\xad\x5f\x6a\x51\x3b\x7b\xdd\xc1\xb6\x5f\x0a\xa0\xd9\x7a\x05\x3d" + "\xb5\x5a\x88\xc4\xc4\xf9\x60\x5e\x41\x40", + 1, 798}, + {128, 128, 3, + "\x5a\xcb\x1d\x64\x4c\x0d\x51\x20\x4e\xa5\xf1\x45\x10\x10\xd8\x52", + "\xfa\x55\x6b\x26\x1c\x00\x00\x00\xfa\x55\x6b\x26\x1c\x00\x00\x00", + "\xad\x9c\x44\x1f\x89\x0b\x38\xc4\x57\xa4\x9d\x42\x14\x07\xe8", + "\xba\x0f\x31\x30\x03\x34\xc5\x6b\x52\xa7\x49\x7c\xba\xc0\x46", 1, 120}, + {128, 128, 4, + "\xef\xa8\xb2\x22\x9e\x72\x0c\x2a\x7c\x36\xea\x55\xe9\x60\x56\x95", + "\xe2\x8b\xcf\x7b\xc0\x00\x00\x00\xe2\x8b\xcf\x7b\xc0\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27" + "\xb5\x99\xb6\xb1\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49" + "\x46\x24\xfb\x50\x36\x7f\xa3\x6c\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37" + "\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xe0\xda\x15\xca\x8e\x25\x54\xf5\xe5\x6c\x94\x68\xdc\x6c\x7c\x12\x9c\x56" + "\x8a\xa5\x03\x23\x17\xe0\x4e\x07\x29\x64\x6c\xab\xef\xa6\x89\x86\x4c\x41" + "\x0f\x24\xf9\x19\xe6\x1e\x3d\xfd\xfa\xd7\x7e\x56\x0d\xb0\xa9\xcd\x36\xc3" + "\x4a\xe4\x18\x14\x90\xb2\x9f\x5f\xa2\xfc", + 1, 510}, + {128, 128, 5, + "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\x2c\x00\x00\x00\x39\x8a\x59\xb4\x2c\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", + "\x98\x9b\x71\x9c\xdc\x33\xce\xb7\xcf\x27\x6a\x52\x82\x7c\xef\x94\xa5\x6c" + "\x40\xc0\xab\x9d\x81\xf7\xa2\xa9\xba\xc6\x0e\x11\xc4\xb0", + 1, 253}, + {128, 128, 6, + "\x60\x90\xea\xe0\x4c\x83\x70\x6e\xec\xbf\x65\x2b\xe8\xe3\x65\x66", + "\x72\xa4\xf2\x0f\x48\x00\x00\x00\x72\xa4\xf2\x0f\x48\x00\x00\x00", + "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" + "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" + "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" + "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" + "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" + "\x44\x54\x31\x87\x45\xe3\x98\x76\x45\x98\x7a\x98\x6f\x2c\xb0", + "\x58\x92\xbb\xa8\x8b\xbb\xca\xae\xae\x76\x9a\xa0\x6b\x68\x3d\x3a\x17\xcc" + "\x04\xa3\x69\x88\x16\x97\x43\x5e\x44\xfe\xd5\xff\x9a\xf5\x7b\x9e\x89\x0d" + "\x4d\x5c\x64\x70\x98\x85\xd4\x8a\xe4\x06\x90\xec\x04\x3b\xaa\xe9\x70\x57" + "\x96\xe4\xa9\xff\x5a\x4b\x8d\x8b\x36\xd7\xf3\xfe\x57\xcc\x6c\xfd\x6c\xd0" + "\x05\xcd\x38\x52\xa8\x5e\x94\xce\x6b\xcd\x90\xd0\xd0\x78\x39\xce\x09\x73" + "\x35\x44\xca\x8e\x35\x08\x43\x24\x85\x50\x92\x2a\xc1\x28\x18", + 1, 837}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; + +const struct cipher_test snow3g_cipher_linear_test_vectors_json[] = { + {128, 128, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xea\xe9\x11\x49\x21\x58\x44\x59\xc6\xec\x77\x82\x71\x6f\x91\xd4\xe1\xf6" + "\xbf\xfa\x45\xfc\x80\x94\xc2\x3d\x5c\x5f\x17\x72\x44\x92", + 1, 256}, + {128, 128, 2, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x01\x1c\x00\x00\x00\x00\x00\x00\x01\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x96\x7f\x63\x88\x74\x2d\x7c\x3b\x3d\x5a\x08\xc0\x8d\x1a\xc2\xa1\xf2" + "\x38\x96\xc7\x41\x1b\xc1\xde\xac\x24\x57\x9c\x45\x0d\xb0", + 1, 256}, + {128, 128, 3, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x02\x1c\x00\x00\x00\x00\x00\x00\x02\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4d\x50\xd2\xe3\xa6\xe7\x97\xee\xf3\xe6\x2a\x32\xf3\x66\xea\x99\xbc\x54" + "\x24\xa6\x3f\xc3\xbb\x27\xc7\xba\x42\xd8\x2f\x86\xfc\xdf", + 1, 256}, + {128, 128, 4, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x00\x03\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4a\x98\xa3\x04\xad\xcf\xb9\xfa\xdb\x3b\xe7\x7c\xd1\x69\x59\x6c\x7e\x44" + "\x73\x8d\x96\xd0\x51\x1f\x55\x32\x55\x59\xc2\xe9\x0a\x21", + 1, 256}, + {128, 128, 5, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x04\x1c\x00\x00\x00\x00\x00\x00\x04\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe4\xf5\x71\x42\xaf\x93\x5e\x6d\x7d\xb8\x44\xf7\xcb\x0d\x08\xd3\x3a\xe6" + "\x20\xcd\xc5\x33\xa3\x5a\x5e\x5a\x41\x92\x96\x44\x28\xc1", + 1, 256}, + {128, 128, 6, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x05\x1c\x00\x00\x00\x00\x00\x00\x05\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x1b\x6e\x3a\x76\x18\x77\x0b\x77\xf2\xda\xca\x1d\xd2\x9c\xa9\xc2\x10\x6b" + "\xe7\x4b\xdb\x30\x79\xc5\x56\xf4\xcb\xb7\x19\xdf\xe5\xcb", + 1, 256}, + {128, 128, 7, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x06\x1c\x00\x00\x00\x00\x00\x00\x06\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x10\x4e\x19\x91\x09\x91\xd0\x9d\x41\x99\x33\x1b\xfd\xa0\xe0\xf7\x80\x6c" + "\x1f\x7b\x12\x78\x3d\x46\x65\x86\x7e\xdf\x9f\xac\x31\x42", + 1, 256}, + {128, 128, 8, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x07\x1c\x00\x00\x00\x00\x00\x00\x07\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x59\x02\x9f\xe6\x98\x24\xe3\xc5\x1b\x19\x61\x08\x37\x79\xd0\xfe\xe4\xa1" + "\xd8\xd4\x04\xf2\x43\x60\xa4\x68\x08\x9b\x06\x9c\xb3\x51", + 1, 256}, + {128, 128, 9, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x08\x1c\x00\x00\x00\x00\x00\x00\x08\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x60\x59\x72\x8f\xd0\x0b\x69\x67\xdf\x89\xb0\xd1\xc3\x02\x3e\xe4\x5b\xde" + "\xe2\x0a\xea\x67\xc6\x05\x40\x4f\xe9\x38\xd4\x10\x1d\x5a", + 1, 256}, + {128, 128, 10, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x09\x1c\x00\x00\x00\x00\x00\x00\x09\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x46\x63\x8d\x94\x5a\xcc\x87\x2d\x57\x4f\xcb\x55\x71\xaa\x6c\x17\xcb\x7c" + "\x7a\x6d\x19\xbf\xba\xcd\xe1\x3c\x77\xed\x0f\x10\x4f\x38", + 1, 256}, + {128, 128, 11, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x00\x0a\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe5\xdd\xa1\x58\xbe\x47\x6e\xa6\x3b\xea\x90\x02\xf6\x87\xbd\x69\x1b\x15" + "\xb7\x3c\x6f\xa1\x28\xde\x0f\xf3\x80\xfb\xef\x89\xa5\xd5", + 1, 256}, + {128, 128, 12, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0b\x1c\x00\x00\x00\x00\x00\x00\x0b\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xae\x68\x9e\x4e\x8d\x49\x2a\x59\x5c\x02\x53\x73\x91\xb2\x92\x94\xc3\x7e" + "\x09\xae\xe3\x6d\x3c\xea\xac\x57\x34\x19\x82\x56\x10\x2e", + 1, 256}, + {128, 128, 13, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0c\x1c\x00\x00\x00\x00\x00\x00\x0c\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd4\x35\x4b\x73\x1b\x6e\xa3\x4c\xd5\x9b\x10\xd0\x93\x64\xc9\xdf\xe0\xe5" + "\x2e\xa0\x8c\x2d\x85\x38\x53\xaa\x79\x92\xad\xae\x36\xb3", + 1, 256}, + {128, 128, 14, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0d\x1c\x00\x00\x00\x00\x00\x00\x0d\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xdb\x9b\x66\x28\xf7\x9d\x37\x32\xbe\x36\x78\x8d\xa3\xd0\xc2\x73\x68\x0d" + "\x47\xf7\x13\x8f\x3d\x83\x2a\xcf\x5e\xe1\xb8\x6d\x86\xb8", + 1, 256}, + {128, 128, 15, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" + "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", + 1, 256}, + {128, 128, 16, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", "", + "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" + "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", + 1, 0}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; + +const struct cipher_test snow3g_cipher_test_vectors_json[] = { + {128, 128, 1, + "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xac\x00\x00\x00\x39\x8a\x59\xb4\xac\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", + "\x5d\x5b\xfe\x75\xeb\x04\xf6\x8c\xe0\xa1\x23\x77\xea\x00\xb3\x7d\x47\xc6" + "\xa0\xba\x06\x30\x91\x55\x08\x6a\x85\x9c\x43\x41\xb3\x7c", + 1, 256}, + {128, 128, 2, + "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" + "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" + "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" + "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" + "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" + "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48", + "\x8c\xeb\xa6\x29\x43\xdc\xed\x3a\x09\x90\xb0\x6e\xa1\xb0\xa2\xc4\xfb\x3c" + "\xed\xc7\x1b\x36\x9f\x42\xba\x64\xc1\xeb\x66\x65\xe7\x2a\xa1\xc9\xbb\x0d" + "\xea\xa2\x0f\xe8\x60\x58\xb8\xba\xee\x2c\x2e\x7f\x0b\xec\xce\x48\xb5\x29" + "\x32\xa5\x3c\x9d\x5f\x93\x1a\x3a\x7c\x53\x22\x59\xaf\x43\x25\xe2\xa6\x5e" + "\x30\x84\xad\x5f\x6a\x51\x3b\x7b\xdd\xc1\xb6\x5f\x0a\xa0\xd9\x7a\x05\x3d" + "\xb5\x5a\x88\xc4\xc4\xf9\x60\x5e\x41", + 1, 792}, + {128, 128, 3, + "\x5a\xcb\x1d\x64\x4c\x0d\x51\x20\x4e\xa5\xf1\x45\x10\x10\xd8\x52", + "\xfa\x55\x6b\x26\x1c\x00\x00\x00\xfa\x55\x6b\x26\x1c\x00\x00\x00", + "\xad\x9c\x44\x1f\x89\x0b\x38\xc4\x57\xa4\x9d\x42\x14\x07\xe8", + "\xba\x0f\x31\x30\x03\x34\xc5\x6b\x52\xa7\x49\x7c\xba\xc0\x46", 1, 120}, + {128, 128, 4, + "\xef\xa8\xb2\x22\x9e\x72\x0c\x2a\x7c\x36\xea\x55\xe9\x60\x56\x95", + "\xe2\x8b\xcf\x7b\xc0\x00\x00\x00\xe2\x8b\xcf\x7b\xc0\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27" + "\xb5\x99\xb6\xb1\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49" + "\x46\x24\xfb\x50\x36\x7f\xa3\x6c\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37" + "\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69", + "\xe0\xda\x15\xca\x8e\x25\x54\xf5\xe5\x6c\x94\x68\xdc\x6c\x7c\x12\x9c\x56" + "\x8a\xa5\x03\x23\x17\xe0\x4e\x07\x29\x64\x6c\xab\xef\xa6\x89\x86\x4c\x41" + "\x0f\x24\xf9\x19\xe6\x1e\x3d\xfd\xfa\xd7\x7e\x56\x0d\xb0\xa9\xcd\x36\xc3" + "\x4a\xe4\x18\x14\x90\xb2\x9f\x5f\xa2", + 1, 504}, + {128, 128, 5, + "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\x2c\x00\x00\x00\x39\x8a\x59\xb4\x2c\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1", + "\x98\x9b\x71\x9c\xdc\x33\xce\xb7\xcf\x27\x6a\x52\x82\x7c\xef\x94\xa5\x6c" + "\x40\xc0\xab\x9d\x81\xf7\xa2\xa9\xba\xc6\x0e\x11\xc4\xb6", + 1, 248}, + {128, 128, 6, + "\x60\x90\xea\xe0\x4c\x83\x70\x6e\xec\xbf\x65\x2b\xe8\xe3\x65\x66", + "\x72\xa4\xf2\x0f\x48\x00\x00\x00\x72\xa4\xf2\x0f\x48\x00\x00\x00", + "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" + "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" + "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" + "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" + "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" + "\x44\x54\x31\x87\x45\xe3\x98\x76\x45\x98\x7a\x98\x6f\x2c", + "\x58\x92\xbb\xa8\x8b\xbb\xca\xae\xae\x76\x9a\xa0\x6b\x68\x3d\x3a\x17\xcc" + "\x04\xa3\x69\x88\x16\x97\x43\x5e\x44\xfe\xd5\xff\x9a\xf5\x7b\x9e\x89\x0d" + "\x4d\x5c\x64\x70\x98\x85\xd4\x8a\xe4\x06\x90\xec\x04\x3b\xaa\xe9\x70\x57" + "\x96\xe4\xa9\xff\x5a\x4b\x8d\x8b\x36\xd7\xf3\xfe\x57\xcc\x6c\xfd\x6c\xd0" + "\x05\xcd\x38\x52\xa8\x5e\x94\xce\x6b\xcd\x90\xd0\xd0\x78\x39\xce\x09\x73" + "\x35\x44\xca\x8e\x35\x08\x43\x24\x85\x50\x92\x2a\xc1\x28", + 1, 832}, + {128, 128, 7, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xea\xe9\x11\x49\x21\x58\x44\x59\xc6\xec\x77\x82\x71\x6f\x91\xd4\xe1\xf6" + "\xbf\xfa\x45\xfc\x80\x94\xc2\x3d\x5c\x5f\x17\x72\x44\x92", + 1, 256}, + {128, 128, 8, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x01\x1c\x00\x00\x00\x00\x00\x00\x01\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x96\x7f\x63\x88\x74\x2d\x7c\x3b\x3d\x5a\x08\xc0\x8d\x1a\xc2\xa1\xf2" + "\x38\x96\xc7\x41\x1b\xc1\xde\xac\x24\x57\x9c\x45\x0d\xb0", + 1, 256}, + {128, 128, 9, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x02\x1c\x00\x00\x00\x00\x00\x00\x02\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4d\x50\xd2\xe3\xa6\xe7\x97\xee\xf3\xe6\x2a\x32\xf3\x66\xea\x99\xbc\x54" + "\x24\xa6\x3f\xc3\xbb\x27\xc7\xba\x42\xd8\x2f\x86\xfc\xdf", + 1, 256}, + {128, 128, 10, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x00\x03\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4a\x98\xa3\x04\xad\xcf\xb9\xfa\xdb\x3b\xe7\x7c\xd1\x69\x59\x6c\x7e\x44" + "\x73\x8d\x96\xd0\x51\x1f\x55\x32\x55\x59\xc2\xe9\x0a\x21", + 1, 256}, + {128, 128, 11, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x04\x1c\x00\x00\x00\x00\x00\x00\x04\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe4\xf5\x71\x42\xaf\x93\x5e\x6d\x7d\xb8\x44\xf7\xcb\x0d\x08\xd3\x3a\xe6" + "\x20\xcd\xc5\x33\xa3\x5a\x5e\x5a\x41\x92\x96\x44\x28\xc1", + 1, 256}, + {128, 128, 12, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x05\x1c\x00\x00\x00\x00\x00\x00\x05\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x1b\x6e\x3a\x76\x18\x77\x0b\x77\xf2\xda\xca\x1d\xd2\x9c\xa9\xc2\x10\x6b" + "\xe7\x4b\xdb\x30\x79\xc5\x56\xf4\xcb\xb7\x19\xdf\xe5\xcb", + 1, 256}, + {128, 128, 13, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x06\x1c\x00\x00\x00\x00\x00\x00\x06\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x10\x4e\x19\x91\x09\x91\xd0\x9d\x41\x99\x33\x1b\xfd\xa0\xe0\xf7\x80\x6c" + "\x1f\x7b\x12\x78\x3d\x46\x65\x86\x7e\xdf\x9f\xac\x31\x42", + 1, 256}, + {128, 128, 14, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x07\x1c\x00\x00\x00\x00\x00\x00\x07\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x59\x02\x9f\xe6\x98\x24\xe3\xc5\x1b\x19\x61\x08\x37\x79\xd0\xfe\xe4\xa1" + "\xd8\xd4\x04\xf2\x43\x60\xa4\x68\x08\x9b\x06\x9c\xb3\x51", + 1, 256}, + {128, 128, 15, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x08\x1c\x00\x00\x00\x00\x00\x00\x08\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x60\x59\x72\x8f\xd0\x0b\x69\x67\xdf\x89\xb0\xd1\xc3\x02\x3e\xe4\x5b\xde" + "\xe2\x0a\xea\x67\xc6\x05\x40\x4f\xe9\x38\xd4\x10\x1d\x5a", + 1, 256}, + {128, 128, 16, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x09\x1c\x00\x00\x00\x00\x00\x00\x09\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x46\x63\x8d\x94\x5a\xcc\x87\x2d\x57\x4f\xcb\x55\x71\xaa\x6c\x17\xcb\x7c" + "\x7a\x6d\x19\xbf\xba\xcd\xe1\x3c\x77\xed\x0f\x10\x4f\x38", + 1, 256}, + {128, 128, 17, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x00\x0a\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe5\xdd\xa1\x58\xbe\x47\x6e\xa6\x3b\xea\x90\x02\xf6\x87\xbd\x69\x1b\x15" + "\xb7\x3c\x6f\xa1\x28\xde\x0f\xf3\x80\xfb\xef\x89\xa5\xd5", + 1, 256}, + {128, 128, 18, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0b\x1c\x00\x00\x00\x00\x00\x00\x0b\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xae\x68\x9e\x4e\x8d\x49\x2a\x59\x5c\x02\x53\x73\x91\xb2\x92\x94\xc3\x7e" + "\x09\xae\xe3\x6d\x3c\xea\xac\x57\x34\x19\x82\x56\x10\x2e", + 1, 256}, + {128, 128, 19, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0c\x1c\x00\x00\x00\x00\x00\x00\x0c\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd4\x35\x4b\x73\x1b\x6e\xa3\x4c\xd5\x9b\x10\xd0\x93\x64\xc9\xdf\xe0\xe5" + "\x2e\xa0\x8c\x2d\x85\x38\x53\xaa\x79\x92\xad\xae\x36\xb3", + 1, 256}, + {128, 128, 20, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0d\x1c\x00\x00\x00\x00\x00\x00\x0d\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xdb\x9b\x66\x28\xf7\x9d\x37\x32\xbe\x36\x78\x8d\xa3\xd0\xc2\x73\x68\x0d" + "\x47\xf7\x13\x8f\x3d\x83\x2a\xcf\x5e\xe1\xb8\x6d\x86\xb8", + 1, 256}, + {128, 128, 21, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" + "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", + 1, 256}, + {128, 128, 22, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0f\x1c\x00\x00\x00\x00\x00\x00\x0f\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x62\x45\xff\xfa\x89\x47\x18\x63\x28\x4e\xd5\xf2\x94\xb0\x54\x43\xd5\xae" + "\xb5\x68\x2f\xf6\x7c\x81\xe3\xc5\x81\x32\x0e\x59\xc5\x60", + 1, 256}, + {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} +}; + + diff --git a/test/kat-app/snow3g_test_f9_vectors.json.c b/test/kat-app/snow3g_test_f9_vectors.json.c new file mode 100644 index 00000000..edaf6d3c --- /dev/null +++ b/test/kat-app/snow3g_test_f9_vectors.json.c @@ -0,0 +1,190 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + Copyright (c) 2022, Nokia + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* SNOW3G_f9 */ +#include "mac_test.h" + +const struct mac_test snow3g_hash_test_vectors_json[] = { + {128, 32, 1, + "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x6b\x22\x77\x37\x29\x6f\x39\x3c\x80\x79\x35\x3e\xdc\x87\xe2\xe8\x05\xd2" + "\xec\x49\xa4\xf2\xd8\xe0", + "\x2b\xce\x18\x20", 1, 189, + "\x38\xa6\xf0\x56\x05\xd2\xec\x49\x38\xa6\xf0\x56\x05\xd2\xec\x49", 128}, + {128, 32, 2, + "\xd4\x2f\x68\x24\x28\x20\x1c\xaf\xcd\x9f\x97\x94\x5e\x6d\xe7\xb7", + "\xb5\x92\x43\x84\x32\x8a\x4a\xe0\x0b\x73\x71\x09\xf8\xb6\xc8\xdd\x2b\x4d" + "\xb6\x3d\xd5\x33\x98\x1c\xeb\x19\xaa\xd5\x2a\x5b\x2b\xc0", + "\xfc\x7b\x18\xbd", 1, 254, + "\x3e\xdc\x87\xe2\xa4\xf2\xd8\xe2\xbe\xdc\x87\xe2\xa4\xf2\x58\xe2", 128}, + {128, 32, 3, + "\xfd\xb9\xcf\xdf\x28\x93\x6c\xc4\x83\xa3\x18\x69\xd8\x1b\x8f\xab", + "\x59\x32\xbc\x0a\xce\x2b\x0a\xba\x33\xd8\xac\x18\x8a\xc5\x4f\x34\x6f\xad" + "\x10\xbf\x9d\xee\x29\x20\xb4\x3b\xd0\xc5\x3a\x91\x5c\xb7\xdf\x6c\xaa\x72" + "\x05\x3a\xbf\xf2", + "\x02\xf1\xfa\xaf", 1, 319, + "\x36\xaf\x61\x44\x98\x38\xf0\x3a\xb6\xaf\x61\x44\x98\x38\x70\x3a", 128}, + {128, 32, 4, + "\xc7\x36\xc6\xaa\xb2\x2b\xff\xf9\x1e\x26\x98\xd2\xe2\x2a\xd5\x7e", + "\xd0\xa7\xd4\x63\xdf\x9f\xb2\xb2\x78\x83\x3f\xa0\x2e\x23\x5a\xa1\x72\xbd" + "\x97\x0c\x14\x73\xe1\x29\x07\xfb\x64\x8b\x65\x99\xaa\xa0\xb2\x4a\x03\x86" + "\x65\x42\x2b\x20\xa4\x99\x27\x6a\x50\x42\x70\x09", + "\x38\xb5\x54\xc0", 1, 384, + "\x14\x79\x3e\x41\x03\x97\xe8\xfd\x94\x79\x3e\x41\x03\x97\x68\xfd", 128}, + {128, 32, 5, + "\xf4\xeb\xec\x69\xe7\x3e\xaf\x2e\xb2\xcf\x6a\xf4\xb3\x12\x0f\xfd", + "\x10\xbf\xff\x83\x9e\x0c\x71\x65\x8d\xbb\x2d\x17\x07\xe1\x45\x72\x4f\x41" + "\xc1\x6f\x48\xbf\x40\x3c\x3b\x18\xe3\x8f\xd5\xd1\x66\x3b\x6f\x6d\x90\x01" + "\x93\xe3\xce\xa8\xbb\x4f\x1b\x4f\x5b\xe8\x22\x03\x22\x32\xa7\x8d\x7d\x75" + "\x23\x8d\x5e\x6d\xae\xcd\x3b\x43\x22\xcf\x59\xbc\x7e\xa8\x4a\xb1\x88\x11" + "\xb5\xbf\xb7\xbc\x55\x3f\x4f\xe4\x44\x78\xce\x28\x7a\x14\x87\x99\x90\xd1" + "\x8d\x12\xca\x79\xd2\xc8\x55\x14\x90\x21\xcd\x5c\xe8\xca\x03\x71\xca\x04" + "\xfc\xce\x14\x3e\x3d\x7c\xfe\xe9\x45\x85\xb5\x88\x5c\xac\x46\x06\x8b", + "\x06\x17\x45\xae", 1, 1000, + "\x29\x6f\x39\x3c\x6b\x22\x77\x37\xa9\x6f\x39\x3c\x6b\x22\xf7\x37", 128}, + {128, 32, 6, + "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", + "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x01\x01\xe0\x95" + "\x80\x45\xf3\xa0\xbb\xa4\xe3\x96\x83\x46\xf0\xa3\xb8\xa7\xc0\x2a\x01\x8a" + "\xe6\x40\x76\x52\x26\xb9\x87\xc9\x13\xe6\xcb\xf0\x83\x57\x00\x16\xcf\x83" + "\xef\xbc\x61\xc0\x82\x51\x3e\x21\x56\x1a\x42\x7c\x00\x9d\x28\xc2\x98\xef" + "\xac\xe7\x8e\xd6\xd5\x6c\x2d\x45\x05\xad\x03\x2e\x9c\x04\xdc\x60\xe7\x3a" + "\x81\x69\x6d\xa6\x65\xc6\xc4\x86\x03\xa5\x7b\x45\xab\x33\x22\x15\x85\xe6" + "\x8e\xe3\x16\x91\x87\xfb\x02\x39\x52\x86\x32\xdd\x65\x6c\x80\x7e\xa3\x24" + "\x8b\x7b\x46\xd0\x02\xb2\xb5\xc7\x45\x8e\xb8\x5b\x9c\xe9\x58\x79\xe0\x34" + "\x08\x59\x05\x5e\x3b\x0a\xbb\xc3\xea\xce\x87\x19\xca\xa8\x02\x65\xc9\x72" + "\x05\xd5\xdc\x4b\xcc\x90\x2f\xe1\x83\x96\x29\xed\x71\x32\x8a\x0f\x04\x49" + "\xf5\x88\x55\x7e\x68\x98\x86\x0e\x04\x2a\xec\xd8\x4b\x24\x04\xc2\x12\xc9" + "\x22\x2d\xa5\xbf\x8a\x89\xef\x67\x97\x87\x0c\xf5\x07\x71\xa6\x0f\x66\xa2" + "\xee\x62\x85\x36\x57\xad\xdf\x04\xcd\xde\x07\xfa\x41\x4e\x11\xf1\x2b\x4d" + "\x81\xb9\xb4\xe8\xac\x53\x8e\xa3\x06\x66\x68\x8d\x88\x1f\x6c\x34\x84\x21" + "\x99\x2f\x31\xb9\x4f\x88\x06\xed\x8f\xcc\xff\x4c\x91\x23\xb8\x96\x42\x52" + "\x7a\xd6\x13\xb1\x09\xbf\x75\x16\x74\x85\xf1\x26\x8b\xf8\x84\xb4\xcd\x23" + "\xd2\x9a\x09\x34\x92\x57\x03\xd6\x34\x09\x8f\x77\x67\xf1\xbe\x74\x91\xe7" + "\x08\xa8\xbb\x94\x9a\x38\x73\x70\x8a\xef\x4a\x36\x23\x9e\x50\xcc\x08\x23" + "\x5c\xd5\xed\x6b\xbe\x57\x86\x68\xa1\x7b\x58\xc1\x17\x1d\x0b\x90\xe8\x13" + "\xa9\xe4\xf5\x8a\x89\xd7\x19\xb1\x10\x42\xd6\x36\x0b\x1b\x0f\x52\xde\xb7" + "\x30\xa5\x8d\x58\xfa\xf4\x63\x15\x95\x4b\x0a\x87\x26\x91\x47\x59\x77\xdc" + "\x88\xc0\xd7\x33\xfe\xff\x54\x60\x0a\x0c\xc1\xd0\x30\x0a\xaa\xeb\x94\x57" + "\x2c\x6e\x95\xb0\x1a\xe9\x0d\xe0\x4f\x1d\xce\x47\xf8\x7e\x8f\xa7\xbe\xbf" + "\x77\xe1\xdb\xc2\x0d\x6b\xa8\x5c\xb9\x14\x3d\x51\x8b\x28\x5d\xfa\x04\xb6" + "\x98\xbf\x0c\xf7\x81\x9f\x20\xfa\x7a\x28\x8e\xb0\x70\x3d\x99\x5c\x59\x94" + "\x0c\x7c\x66\xde\x57\xa9\xb7\x0f\x82\x37\x9b\x70\xe2\x03\x1e\x45\x0f\xcf" + "\xd2\x18\x13\x26\xfc\xd2\x8d\x88\x23\xba\xaa\x80\xdf\x6e\x0f\x44\x35\x59" + "\x64\x75\x39\xfd\x89\x07\xc0\xff\xd9\xd7\x9c\x13\x0e\xd8\x1c\x9a\xfd\x9b" + "\x7e\x84\x8c\x9f\xed\x38\x44\x3d\x5d\x38\x0e\x53\xfb\xdb\x8a\xc8\xc3\xd3" + "\xf0\x68\x76\x05\x4f\x12\x24\x61\x10\x7d\xe9\x2f\xea\x09\xc6\xf6\x92\x3a" + "\x18\x8d\x53\xaf\xe5\x4a\x10\xf6\x0e\x6e\x9d\x5a\x03\xd9\x96\xb5\xfb\xc8" + "\x20\xf8\xa6\x37\x11\x6a\x27\xad\x04\xb4\x44\xa0\x93\x2d\xd6\x0f\xbd\x12" + "\x67\x1c\x11\xe1\xc0\xec\x73\xe7\x89\x87\x9f\xaa\x3d\x42\xc6\x4d\x20\xcd" + "\x12\x52\x74\x2a\x37\x68\xc2\x5a\x90\x15\x85\x88\x8e\xce\xe1\xe6\x12\xd9" + "\x93\x6b\x40\x3b\x07\x75\x94\x9a\x66\xcd\xfd\x99\xa2\x9b\x13\x45\xba\xa8" + "\xd9\xd5\x40\x0c\x91\x02\x4b\x0a\x60\x73\x63\xb0\x13\xce\x5d\xe9\xae\x86" + "\x9d\x3b\x8d\x95\xb0\x57\x0b\x3c\x2d\x39\x14\x22\xd3\x24\x50\xcb\xcf\xae" + "\x96\x65\x22\x86\xe9\x6d\xec\x12\x14\xa9\x34\x65\x27\x98\x0a\x81\x92\xea" + "\xc1\xc3\x9a\x3a\xaf\x6f\x15\x35\x1d\xa6\xbe\x76\x4d\xf8\x97\x72\xec\x04" + "\x07\xd0\x6e\x44\x15\xbe\xfa\xe7\xc9\x25\x80\xdf\x9b\xf5\x07\x49\x7c\x8f" + "\x29\x95\x16\x0d\x4e\x21\x8d\xaa\xcb\x02\x94\x4a\xbf\x83\x34\x0c\xe8\xbe" + "\x16\x86\xa9\x60\xfa\xf9\x0e\x2d\x90\xc5\x5c\xc6\x47\x5b\xab\xc3\x17\x1a" + "\x80\xa3\x63\x17\x49\x54\x95\x5d\x71\x01\xda\xb1\x6a\xe8\x17\x91\x67\xe2" + "\x14\x44\xb4\x43\xa9\xea\xaa\x7c\x91\xde\x36\xd1\x18\xc3\x9d\x38\x9f\x8d" + "\xd4\x46\x9a\x84\x6c\x9a\x26\x2b\xf7\xfa\x18\x48\x7a\x79\xe8\xde\x11\x69" + "\x9e\x0b\x8f\xdf\x55\x7c\xb4\x87\x19\xd4\x53\xba\x71\x30\x56\x10\x9b\x93" + "\xa2\x18\xc8\x96\x75\xac\x19\x5f\xb4\xfb\x06\x63\x9b\x37\x97\x14\x49\x55" + "\xb3\xc9\x32\x7d\x1a\xec\x00\x3d\x42\xec\xd0\xea\x98\xab\xf1\x9f\xfb\x4a" + "\xf3\x56\x1a\x67\xe7\x7c\x35\xbf\x15\xc5\x9c\x24\x12\xda\x88\x1d\xb0\x2b" + "\x1b\xfb\xce\xbf\xac\x51\x52\xbc\x99\xbc\x3f\x1d\x15\xf7\x71\x00\x1b\x70" + "\x29\xfe\xdb\x02\x8f\x8b\x85\x2b\xc4\x40\x7e\xb8\x3f\x89\x1c\x9c\xa7\x33" + "\x25\x4f\xdd\x1e\x9e\xdb\x56\x91\x9c\xe9\xfe\xa2\x1c\x17\x40\x72\x52\x1c" + "\x18\x31\x9a\x54\xb5\xd4\xef\xbe\xbd\xdf\x1d\x8b\x69\xb1\xcb\xf2\x5f\x48" + "\x9f\xcc\x98\x13\x72\x54\x7c\xf4\x1d\x00\x8e\xf0\xbc\xa1\x92\x6f\x93\x4b" + "\x73\x5e\x09\x0b\x3b\x25\x1e\xb3\x3a\x36\xf8\x2e\xd9\xb2\x9c\xf4\xcb\x94" + "\x41\x88\xfa\x0e\x1e\x38\xdd\x77\x8f\x7d\x1c\x9d\x98\x7b\x28\xd1\x32\xdf" + "\xb9\x73\x1f\xa4\xf4\xb4\x16\x93\x5b\xe4\x9d\xe3\x05\x16\xaf\x35\x78\x58" + "\x1f\x2f\x13\xf5\x61\xc0\x66\x33\x61\x94\x1e\xab\x24\x9a\x4b\xc1\x23\xf8" + "\xd1\x5c\xd7\x11\xa9\x56\xa1\xbf\x20\xfe\x6e\xb7\x8a\xea\x23\x73\x36\x1d" + "\xa0\x42\x6c\x79\xa5\x30\xc3\xbb\x1d\xe0\xc9\x97\x22\xef\x1f\xde\x39\xac" + "\x2b\x00\xa0\xa8\xee\x7c\x80\x0a\x08\xbc\x22\x64\xf8\x9f\x4e\xff\xe6\x27" + "\xac\x2f\x05\x31\xfb\x55\x4f\x6d\x21\xd7\x4c\x59\x0a\x70\xad\xfa\xa3\x90" + "\xbd\xfb\xb3\xd6\x8e\x46\x21\x5c\xab\x18\x7d\x23\x68\xd5\xa7\x1f\x5e\xbe" + "\xc0\x81\xcd\x3b\x20\xc0\x82\xdb\xe4\xcd\x2f\xac\xa2\x87\x73\x79\x5d\x6b" + "\x0c\x10\x20\x4b\x65\x9a\x93\x9e\xf2\x9b\xbe\x10\x88\x24\x36\x24\x42\x99" + "\x27\xa7\xeb\x57\x6d\xd3\xa0\x0e\xa5\xe0\x1a\xf5\xd4\x75\x83\xb2\x27\x2c" + "\x0c\x16\x1a\x80\x65\x21\xa1\x6f\xf9\xb0\xa7\x22\xc0\xcf\x26\xb0\x25\xd5" + "\x83\x6e\x22\x58\xa4\xf7\xd4\x77\x3a\xc8\x01\xe4\x26\x3b\xc2\x94\xf4\x3d" + "\xef\x7f\xa8\x70\x3f\x3a\x41\x97\x46\x35\x25\x88\x76\x52\xb0\xb2\xa4\xa2" + "\xa7\xcf\x87\xf0\x09\x14\x87\x1e\x25\x03\x91\x13\xc7\xe1\x61\x8d\xa3\x40" + "\x64\xb5\x7a\x43\xc4\x63\x24\x9f\xb8\xd0\x5e\x0f\x26\xf4\xa6\xd8\x49\x72" + "\xe7\xa9\x05\x48\x24\x14\x5f\x91\x29\x5c\xdb\xe3\x9a\x6f\x92\x0f\xac\xc6" + "\x59\x71\x2b\x46\xa5\x4b\xa2\x95\xbb\xe6\xa9\x01\x54\xe9\x1b\x33\x98\x5a" + "\x2b\xcd\x42\x0a\xd5\xc6\x7e\xc9\xad\x8e\xb7\xac\x68\x64\xdb\x27\x2a\x51" + "\x6b\xc9\x4c\x28\x39\xb0\xa8\x16\x9a\x6b\xf5\x8e\x1a\x0c\x2a\xda\x8c\x88" + "\x3b\x7b\xf4\x97\xa4\x91\x71\x26\x8e\xd1\x5d\xdd\x29\x69\x38\x4e\x7f\xf4" + "\xbf\x4a\xab\x2e\xc9\xec\xc6\x52\x9c\xf6\x29\xe2\xdf\x0f\x08\xa7\x7a\x65" + "\xaf\xa1\x2a\xa9\xb5\x05\xdf\x8b\x28\x7e\xf6\xcc\x91\x49\x3d\x1c\xaa\x39" + "\x07\x6e\x28\xef\x1e\xa0\x28\xf5\x11\x8d\xe6\x1a\xe0\x2b\xb6\xae\xfc\x33" + "\x43\xa0\x50\x29\x2f\x19\x9f\x40\x18\x57\xb2\xbe\xad\x5e\x6e\xe2\xa1\xf1" + "\x91\x02\x2f\x92\x78\x01\x6f\x04\x77\x91\xa9\xd1\x8d\xa7\xd2\xa6\xd2\x7f" + "\x2e\x0e\x51\xc2\xf6\xea\x30\xe8\xac\x49\xa0\x60\x4f\x4c\x13\x54\x2e\x85" + "\xb6\x83\x81\xb9\xfd\xcf\xa0\xce\x4b\x2d\x34\x13\x54\x85\x2d\x36\x02\x45" + "\xc5\x36\xb6\x12\xaf\x71\xf3\xe7\x7c\x90\x95\xae\x2d\xbd\xe5\x04\xb2\x65" + "\x73\x3d\xab\xfe\x10\xa2\x0f\xc7\xd6\xd3\x2c\x21\xcc\xc7\x2b\x8b\x34\x44" + "\xae\x66\x3d\x65\x92\x2d\x17\xf8\x2c\xaa\x2b\x86\x5c\xd8\x89\x13\xd2\x91" + "\xa6\x58\x99\x02\x6e\xa1\x32\x84\x39\x72\x3c\x19\x8c\x36\xb0\xc3\xc8\xd0" + "\x85\xbf\xaf\x8a\x32\x0f\xde\x33\x4b\x4a\x49\x19\xb4\x4c\x2b\x95\xf6\xe8" + "\xec\xf7\x33\x93\xf7\xf0\xd2\xa4\x0e\x60\xb1\xd4\x06\x52\x6b\x02\x2d\xdc" + "\x33\x18\x10\xb1\xa5\xf7\xc3\x47\xbd\x53\xed\x1f\x10\x5d\x6a\x0d\x30\xab" + "\xa4\x77\xe1\x78\x88\x9a\xb2\xec\x55\xd5\x58\xde\xab\x26\x30\x20\x43\x36" + "\x96\x2b\x4d\xb5\xb6\x63\xb6\x90\x2b\x89\xe8\x5b\x31\xbc\x6a\xf5\x0f\xc5" + "\x0a\xcc\xb3\xfb\x9b\x57\xb6\x63\x29\x70\x31\x37\x8d\xb4\x78\x96\xd7\xfb" + "\xaf\x6c\x60\x0a\xdd\x2c\x67\xf9\x36\xdb\x03\x79\x86\xdb\x85\x6e\xb4\x9c" + "\xf2\xdb\x3f\x7d\xa6\xd2\x36\x50\xe4\x38\xf1\x88\x40\x41\xb0\x13\x11\x9e" + "\x4c\x2a\xe5\xaf\x37\xcc\xcd\xfb\x68\x66\x07\x38\xb5\x8b\x3c\x59\xd1\xc0" + "\x24\x84\x37\x47\x2a\xba\x1f\x35\xca\x1f\xb9\x0c\xd7\x14\xaa\x9f\x63\x55" + "\x34\xf4\x9e\x7c\x5b\xba\x81\xc2\xb6\xb3\x6f\xde\xe2\x1c\xa2\x7e\x34\x7f" + "\x79\x3d\x2c\xe9\x44\xed\xb2\x3c\x8c\x9b\x91\x4b\xe1\x03\x35\xe3\x50\xfe" + "\xb5\x07\x03\x94\xb7\xa4\xa1\x5c\x0c\xa1\x20\x28\x35\x68\xb7\xbf\xc2\x54" + "\xfe\x83\x8b\x13\x7a\x21\x47\xce\x7c\x11\x3a\x3a\x4d\x65\x49\x9d\x9e\x86" + "\xb8\x7d\xbc\xc7\xf0\x3b\xbd\x3a\x3a\xb1\xaa\x24\x3e\xce\x5b\xa9\xbc\xf2" + "\x5f\x82\x83\x6c\xfe\x47\x3b\x2d\x83\xe7\xa7\x20\x1c\xd0\xb9\x6a\x72\x45" + "\x1e\x86\x3f\x6c\x3b\xa6\x64\xa6\xd0\x73\xd1\xf7\xb5\xed\x99\x08\x65\xd9" + "\x78\xbd\x38\x15\xd0\x60\x94\xfc\x9a\x2a\xba\x52\x21\xc2\x2d\x5a\xb9\x96" + "\x38\x9e\x37\x21\xe3\xaf\x5f\x05\xbe\xdd\xc2\x87\x5e\x0d\xfa\xeb\x39\x02" + "\x1e\xe2\x7a\x41\x18\x7c\xbb\x45\xef\x40\xc3\xe7\x3b\xc0\x39\x89\xf9\xa3" + "\x0d\x12\xc5\x4b\xa7\xd2\x14\x1d\xa8\xa8\x75\x49\x3e\x65\x77\x6e\xf3\x5f" + "\x97\xde\xbc\x22\x86\xcc\x4a\xf9\xb4\x62\x3e\xee\x90\x2f\x84\x0c\x52\xf1" + "\xb8\xad\x65\x89\x39\xae\xf7\x1f\x3f\x72\xb9\xec\x1d\xe2\x15\x88\xbd\x35" + "\x48\x4e\xa4\x44\x36\x34\x3f\xf9\x5e\xad\x6a\xb1\xd8\xaf\xb1\xb2\xa3\x03" + "\xdf\x1b\x71\xe5\x3c\x4a\xea\x6b\x2e\x3e\x93\x72\xbe\x0d\x1b\xc9\x97\x98" + "\xb0\xce\x3c\xc1\x0d\x2a\x59\x6d\x56\x5d\xba\x82\xf8\x8c\xe4\xcf\xf3\xb3" + "\x3d\x5d\x24\xe9\xc0\x83\x11\x24\xbf\x1a\xd5\x4b\x79\x25\x32\x98\x3d\xd6" + "\xc3\xa8\xb7\xd0", + "\x17\x9f\x2f\xa6", 1, 16448, + "\x29\x6f\x39\x3c\x6b\x22\x77\x37\xa9\x6f\x39\x3c\x6b\x22\xf7\x37", 128}, + {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} +}; diff --git a/test/kat-app/snow3g_test_vectors.h b/test/kat-app/snow3g_test_vectors.h deleted file mode 100644 index 2d49299c..00000000 --- a/test/kat-app/snow3g_test_vectors.h +++ /dev/null @@ -1,1242 +0,0 @@ -/***************************************************************************** - Copyright (c) 2009-2023, Intel Corporation - Copyright (c) 2022, Nokia - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#include -#include - -#ifndef __SSO_TEST_VECTORS_H__ -#define __SSO_TEST_VECTORS_H__ - -#define MAX_DATA_LEN (3048) -#define MAX_KEY_LEN (32) -#define MAX_IV_LEN (16) -#define BLOCK_SIZE (8) -#define DIGEST_LEN (4) -#define NUM_SUPPORTED_BUFFERS (16) -#define MAX_SIZE_IN_BYTES_1024 (1024) -#define MAX_BIT_BUFFERS (6) -#define SNOW3G_KEY_LEN_IN_BYTES (16) /* 128b */ -#define SNOW3G_IV_LEN_IN_BYTES (16) /* 128b */ - -typedef struct cipher_iv_gen_params_s { - uint32_t count; - uint8_t bearer; - uint8_t dir; -} cipher_iv_gen_params_t; -typedef struct cipher_test_vector_s { - uint32_t dataLenInBytes; - uint32_t keyLenInBytes; - uint32_t ivLenInBytes; - uint8_t plaintext[MAX_DATA_LEN]; - uint8_t ciphertext[MAX_DATA_LEN]; - uint8_t key[MAX_KEY_LEN]; - uint8_t iv[MAX_IV_LEN]; -} cipher_test_vector_t; -typedef struct cipher_test_linear_vector_s { - uint32_t dataLenInBytes[NUM_SUPPORTED_BUFFERS]; - uint32_t keyLenInBytes; - uint32_t ivLenInBytes; - uint8_t plaintext[NUM_SUPPORTED_BUFFERS][MAX_DATA_LEN]; - uint8_t ciphertext[NUM_SUPPORTED_BUFFERS][MAX_DATA_LEN]; - uint8_t key[NUM_SUPPORTED_BUFFERS][MAX_KEY_LEN]; - uint8_t iv[NUM_SUPPORTED_BUFFERS][MAX_IV_LEN]; -} cipher_test_linear_vector_t; -typedef struct cipherbit_test_vector_s { - uint32_t dataLenInBits; - uint32_t keyLenInBytes; - uint32_t ivLenInBytes; - uint8_t plaintext[MAX_DATA_LEN]; - uint8_t ciphertext[MAX_DATA_LEN]; - uint8_t key[MAX_KEY_LEN]; - uint8_t iv[MAX_IV_LEN]; -} cipherbit_test_vector_t; -typedef struct cipherbit_test_linear_vector_s { - uint32_t dataLenInBits[MAX_BIT_BUFFERS]; - uint32_t keyLenInBytes; - uint32_t ivLenInBytes; - uint8_t plaintext[MAX_BIT_BUFFERS][MAX_DATA_LEN]; - uint8_t ciphertext[MAX_BIT_BUFFERS][MAX_DATA_LEN]; - uint8_t key[MAX_BIT_BUFFERS][MAX_KEY_LEN]; - uint8_t iv[MAX_BIT_BUFFERS][MAX_IV_LEN]; - cipher_iv_gen_params_t iv_params[MAX_BIT_BUFFERS]; -} cipherbit_test_linear_vector_t; - - -typedef struct hash_iv_gen_params_s { - uint32_t count; - uint32_t fresh; - uint8_t dir; -} hash_iv_gen_params_t; -typedef struct hash_test_vector_s { - uint8_t input[MAX_DATA_LEN]; - uint32_t lengthInBits; - uint8_t key[MAX_DATA_LEN]; - uint32_t keyLenInBytes; - uint8_t exp_out[BLOCK_SIZE]; - uint8_t iv[MAX_DATA_LEN]; - uint32_t ivLenInBytes; - uint32_t direction; - hash_iv_gen_params_t iv_params; -} hash_test_vector_t; - -static cipherbit_test_linear_vector_t snow3g_f8_linear_bitvectors = { - {256, 798, 120, 510, 253, 837}, - 16, - 16, - {/*plaintext linear bit bit buffer*/ - /* reference data from 3GPP tests 1-5 */ - { - 0x98, 0x1b, 0xa6, 0x82, 0x4c, 0x1b, 0xfb, 0x1a, - 0xb4, 0x85, 0x47, 0x20, 0x29, 0xb7, 0x1d, 0x80, - 0x8c, 0xe3, 0x3e, 0x2c, 0xc3, 0xc0, 0xb5, 0xfc, - 0x1f, 0x3d, 0xe8, 0xa6, 0xdc, 0x66, 0xb1, 0xf0 - }, - { - 0x7e, 0xc6, 0x12, 0x72, 0x74, 0x3b, 0xf1, 0x61, - 0x47, 0x26, 0x44, 0x6a, 0x6c, 0x38, 0xce, 0xd1, - 0x66, 0xf6, 0xca, 0x76, 0xeb, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6c, 0xef, 0x13, 0xf, 0x92, - 0x92, 0x2b, 0x3, 0x45, 0xd, 0x3a, 0x99, 0x75, - 0xe5, 0xbd, 0x2e, 0xa0, 0xeb, 0x55, 0xad, 0x8e, - 0x1b, 0x19, 0x9e, 0x3e, 0xc4, 0x31, 0x60, 0x20, - 0xe9, 0xa1, 0xb2, 0x85, 0xe7, 0x62, 0x79, 0x53, - 0x59, 0xb7, 0xbd, 0xfd, 0x39, 0xbe, 0xf4, 0xb2, - 0x48, 0x45, 0x83, 0xd5, 0xaf, 0xe0, 0x82, 0xae, - 0xe6, 0x38, 0xbf, 0x5f, 0xd5, 0xa6, 0x6, 0x19, - 0x39, 0x1, 0xa0, 0x8f, 0x4a, 0xb4, 0x1a, 0xab, - 0x9b, 0x13, 0x48, 0x80 - }, - { - 0xAD, 0x9C, 0x44, 0x1F, 0x89, 0x0B, 0x38, 0xC4, - 0x57, 0xA4, 0x9D, 0x42, 0x14, 0x07, 0xE8 - }, - { - 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, - 0x43, 0xFD, 0x3F, 0x57, 0xE3, 0x76, 0x07, 0xAB, - 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, - 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, - 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, - 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, - 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, 0x02, - 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 - }, - { - 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, - 0xB4, 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, 0x80, - 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, 0xC0, 0xB5, 0xFC, - 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x66, 0xB1, 0xF0 - }, - { - 0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, - 0x42, 0x86, 0xB2, 0x99, 0x78, 0x3D, 0xAF, 0x44, - 0x2C, 0x09, 0x9F, 0x7A, 0xB0, 0xF5, 0x8D, 0x5C, - 0x8E, 0x46, 0xB1, 0x04, 0xF0, 0x8F, 0x01, 0xB4, - 0x1A, 0xB4, 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, - 0x36, 0xBD, 0x1A, 0x3D, 0x90, 0xDC, 0x3A, 0x41, - 0xB4, 0x6D, 0x51, 0x67, 0x2A, 0xC4, 0xC9, 0x66, - 0x3A, 0x2B, 0xE0, 0x63, 0xDA, 0x4B, 0xC8, 0xD2, - 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xCC, 0xBF, 0xC6, - 0x34, 0xE1, 0xB2, 0x59, 0x06, 0x08, 0x76, 0xA0, - 0xFB, 0xB5, 0xA4, 0x37, 0xEB, 0xCC, 0x8D, 0x31, - 0xC1, 0x9E, 0x44, 0x54, 0x31, 0x87, 0x45, 0xE3, - 0x98, 0x76, 0x45, 0x98, 0x7A, 0x98, 0x6F, 0x2C, - 0xB0 - }, - }, - {/*ciphertext linear bit buffer*/ - /* reference data from 3GPP tests 1-5 */ - { - 0x5d, 0x5b, 0xfe, 0x75, 0xeb, 0x04, 0xf6, 0x8c, - 0xe0, 0xa1, 0x23, 0x77, 0xea, 0x00, 0xb3, 0x7d, - 0x47, 0xc6, 0xa0, 0xba, 0x06, 0x30, 0x91, 0x55, - 0x08, 0x6a, 0x85, 0x9c, 0x43, 0x41, 0xb3, 0x7C - }, - { - 0x8C, 0xEB, 0xA6, 0x29, 0x43, 0xDC, 0xED, 0x3A, - 0x09, 0x90, 0xB0, 0x6E, 0xA1, 0xB0, 0xA2, 0xC4, - 0xFB, 0x3C, 0xED, 0xC7, 0x1B, 0x36, 0x9F, 0x42, - 0xBA, 0x64, 0xC1, 0xEB, 0x66, 0x65, 0xE7, 0x2A, - 0xA1, 0xC9, 0xBB, 0x0D, 0xEA, 0xA2, 0x0F, 0xE8, - 0x60, 0x58, 0xB8, 0xBA, 0xEE, 0x2C, 0x2E, 0x7F, - 0x0B, 0xEC, 0xCE, 0x48, 0xB5, 0x29, 0x32, 0xA5, - 0x3C, 0x9D, 0x5F, 0x93, 0x1A, 0x3A, 0x7C, 0x53, - 0x22, 0x59, 0xAF, 0x43, 0x25, 0xE2, 0xA6, 0x5E, - 0x30, 0x84, 0xAD, 0x5F, 0x6A, 0x51, 0x3B, 0x7B, - 0xDD, 0xC1, 0xB6, 0x5F, 0x0A, 0xA0, 0xD9, 0x7A, - 0x05, 0x3D, 0xB5, 0x5A, 0x88, 0xC4, 0xC4, 0xF9, - 0x60, 0x5E, 0x41, 0x40 - }, - { - 0xBA, 0x0F, 0x31, 0x30, 0x03, 0x34, 0xC5, 0x6B, - 0x52, 0xA7, 0x49, 0x7C, 0xBA, 0xC0, 0x46 - }, - { - 0xE0, 0xDA, 0x15, 0xCA, 0x8E, 0x25, 0x54, 0xF5, - 0xE5, 0x6C, 0x94, 0x68, 0xDC, 0x6C, 0x7C, 0x12, - 0x9C, 0x56, 0x8A, 0xA5, 0x03, 0x23, 0x17, 0xE0, - 0x4E, 0x07, 0x29, 0x64, 0x6C, 0xAB, 0xEF, 0xA6, - 0x89, 0x86, 0x4C, 0x41, 0x0F, 0x24, 0xF9, 0x19, - 0xE6, 0x1E, 0x3D, 0xFD, 0xFA, 0xD7, 0x7E, 0x56, - 0x0D, 0xB0, 0xA9, 0xCD, 0x36, 0xC3, 0x4A, 0xE4, - 0x18, 0x14, 0x90, 0xB2, 0x9F, 0x5F, 0xA2, 0xFC - }, - { - 0x98, 0x9B, 0x71, 0x9C, 0xDC, 0x33, 0xCE, 0xB7, - 0xCF, 0x27, 0x6A, 0x52, 0x82, 0x7C, 0xEF, 0x94, - 0xA5, 0x6C, 0x40, 0xC0, 0xAB, 0x9D, 0x81, 0xF7, - 0xA2, 0xA9, 0xBA, 0xC6, 0x0E, 0x11, 0xC4, 0xB0 - }, - { - 0x58, 0x92, 0xBB, 0xA8, 0x8B, 0xBB, 0xCA, 0xAE, - 0xAE, 0x76, 0x9A, 0xA0, 0x6B, 0x68, 0x3D, 0x3A, - 0x17, 0xCC, 0x04, 0xA3, 0x69, 0x88, 0x16, 0x97, - 0x43, 0x5E, 0x44, 0xFE, 0xD5, 0xFF, 0x9A, 0xF5, - 0x7B, 0x9E, 0x89, 0x0D, 0x4D, 0x5C, 0x64, 0x70, - 0x98, 0x85, 0xD4, 0x8A, 0xE4, 0x06, 0x90, 0xEC, - 0x04, 0x3B, 0xAA, 0xE9, 0x70, 0x57, 0x96, 0xE4, - 0xA9, 0xFF, 0x5A, 0x4B, 0x8D, 0x8B, 0x36, 0xD7, - 0xF3, 0xFE, 0x57, 0xCC, 0x6C, 0xFD, 0x6C, 0xD0, - 0x05, 0xCD, 0x38, 0x52, 0xA8, 0x5E, 0x94, 0xCE, - 0x6B, 0xCD, 0x90, 0xD0, 0xD0, 0x78, 0x39, 0xCE, - 0x09, 0x73, 0x35, 0x44, 0xCA, 0x8E, 0x35, 0x08, - 0x43, 0x24, 0x85, 0x50, 0x92, 0x2A, 0xC1, 0x28, - 0x18 - }, - }, - {/*key buffers*/ - {0xd3, 0xc5, 0xd5, 0x92, 0x32, 0x7f, 0xb1, 0x1c, 0x40, 0x35, 0xc6, - 0x68, 0x0a, 0xf8, 0xc6, 0xd1}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, - 0x10, 0x48, 0x81, 0xFF, 0x48}, - {0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, - 0x45, 0x10, 0x10, 0xD8, 0x52}, - {0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, - 0x55, 0xE9, 0x60, 0x56, 0x95}, - {0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, - 0x68, 0x0A, 0xF8, 0xC6, 0xD1}, - {0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, - 0x2B, 0xE8, 0xE3, 0x65, 0x66} }, - {/* IV buffers*/ - {0x39, 0x8a, 0x59, 0xb4, 0xac, 0x00, 0x00, 0x00, 0x39, 0x8a, 0x59, - 0xb4, 0xac, 0x00, 0x00, 0x00}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00, 0x72, 0xA4, 0xF2, - 0x0F, 0x64, 0x00, 0x00, 0x00}, /* test 1 */ - {0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00, 0xFA, 0x55, 0x6B, - 0x26, 0x1C, 0x00, 0x00, 0x00}, /* test 3 */ - {0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00, 0xE2, 0x8B, 0xCF, - 0x7B, 0xC0, 0x00, 0x00, 0x00}, /* test 2 */ - {0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00, 0x39, 0x8A, 0x59, - 0xB4, 0x2C, 0x00, 0x00, 0x00}, /* test 4 */ - {0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00, 0x72, 0xA4, 0xF2, - 0x0F, 0x48, 0x00, 0x00, 0x00} }, /* test 5 */ - { /* IV gen params*/ - {0x0, 0x0, 0x0}, /* N/A - not part of test data */ - {0x72A4F20F, 0x0C, 0x1}, - {0xFA556B26, 0x03, 0x1}, - {0xE28BCF7B, 0x18, 0x0}, - {0x398A59B4, 0x05, 0x1}, - {0x72A4F20F, 0x09, 0x0}, - } -}; - -static cipher_test_linear_vector_t snow3g_f8_linear[] = { - { - /*dataLenInBytes*/ - { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 }, - /*keyLenInBytes*/ - 16, - /*ivLenInBytes*/ - 16, - { /*plaintext linear bit bit buffer*/ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, - { /*ciphertext linear bit buffer*/ - { 0xea, 0xe9, 0x11, 0x49, 0x21, 0x58, 0x44, 0x59, 0xc6, 0xec, 0x77, - 0x82, 0x71, 0x6f, 0x91, 0xd4, 0xe1, 0xf6, 0xbf, 0xfa, 0x45, 0xfc, - 0x80, 0x94, 0xc2, 0x3d, 0x5c, 0x5f, 0x17, 0x72, 0x44, 0x92 }, - { 0xe3, 0x96, 0x7f, 0x63, 0x88, 0x74, 0x2d, 0x7c, 0x3b, 0x3d, 0x5a, - 0x08, 0xc0, 0x8d, 0x1a, 0xc2, 0xa1, 0xf2, 0x38, 0x96, 0xc7, 0x41, - 0x1b, 0xc1, 0xde, 0xac, 0x24, 0x57, 0x9c, 0x45, 0x0d, 0xb0 }, - { 0x4d, 0x50, 0xd2, 0xe3, 0xa6, 0xe7, 0x97, 0xee, 0xf3, 0xe6, 0x2a, - 0x32, 0xf3, 0x66, 0xea, 0x99, 0xbc, 0x54, 0x24, 0xa6, 0x3f, 0xc3, - 0xbb, 0x27, 0xc7, 0xba, 0x42, 0xd8, 0x2f, 0x86, 0xfc, 0xdf }, - { 0x4a, 0x98, 0xa3, 0x04, 0xad, 0xcf, 0xb9, 0xfa, 0xdb, 0x3b, 0xe7, - 0x7c, 0xd1, 0x69, 0x59, 0x6c, 0x7e, 0x44, 0x73, 0x8d, 0x96, 0xd0, - 0x51, 0x1f, 0x55, 0x32, 0x55, 0x59, 0xc2, 0xe9, 0x0a, 0x21 }, - { 0xe4, 0xf5, 0x71, 0x42, 0xaf, 0x93, 0x5e, 0x6d, 0x7d, 0xb8, 0x44, - 0xf7, 0xcb, 0x0d, 0x08, 0xd3, 0x3a, 0xe6, 0x20, 0xcd, 0xc5, 0x33, - 0xa3, 0x5a, 0x5e, 0x5a, 0x41, 0x92, 0x96, 0x44, 0x28, 0xc1 }, - { 0x1b, 0x6e, 0x3a, 0x76, 0x18, 0x77, 0x0b, 0x77, 0xf2, 0xda, 0xca, - 0x1d, 0xd2, 0x9c, 0xa9, 0xc2, 0x10, 0x6b, 0xe7, 0x4b, 0xdb, 0x30, - 0x79, 0xc5, 0x56, 0xf4, 0xcb, 0xb7, 0x19, 0xdf, 0xe5, 0xcb }, - { 0x10, 0x4e, 0x19, 0x91, 0x09, 0x91, 0xd0, 0x9d, 0x41, 0x99, 0x33, - 0x1b, 0xfd, 0xa0, 0xe0, 0xf7, 0x80, 0x6c, 0x1f, 0x7b, 0x12, 0x78, - 0x3d, 0x46, 0x65, 0x86, 0x7e, 0xdf, 0x9f, 0xac, 0x31, 0x42 }, - { 0x59, 0x02, 0x9f, 0xe6, 0x98, 0x24, 0xe3, 0xc5, 0x1b, 0x19, 0x61, - 0x08, 0x37, 0x79, 0xd0, 0xfe, 0xe4, 0xa1, 0xd8, 0xd4, 0x04, 0xf2, - 0x43, 0x60, 0xa4, 0x68, 0x08, 0x9b, 0x06, 0x9c, 0xb3, 0x51 }, - { 0x60, 0x59, 0x72, 0x8f, 0xd0, 0x0b, 0x69, 0x67, 0xdf, 0x89, 0xb0, - 0xd1, 0xc3, 0x02, 0x3e, 0xe4, 0x5b, 0xde, 0xe2, 0x0a, 0xea, 0x67, - 0xc6, 0x05, 0x40, 0x4f, 0xe9, 0x38, 0xd4, 0x10, 0x1d, 0x5a }, - { 0x46, 0x63, 0x8d, 0x94, 0x5a, 0xcc, 0x87, 0x2d, 0x57, 0x4f, 0xcb, - 0x55, 0x71, 0xaa, 0x6c, 0x17, 0xcb, 0x7c, 0x7a, 0x6d, 0x19, 0xbf, - 0xba, 0xcd, 0xe1, 0x3c, 0x77, 0xed, 0x0f, 0x10, 0x4f, 0x38 }, - { 0xe5, 0xdd, 0xa1, 0x58, 0xbe, 0x47, 0x6e, 0xa6, 0x3b, 0xea, 0x90, - 0x02, 0xf6, 0x87, 0xbd, 0x69, 0x1b, 0x15, 0xb7, 0x3c, 0x6f, 0xa1, - 0x28, 0xde, 0x0f, 0xf3, 0x80, 0xfb, 0xef, 0x89, 0xa5, 0xd5 }, - { 0xae, 0x68, 0x9e, 0x4e, 0x8d, 0x49, 0x2a, 0x59, 0x5c, 0x02, 0x53, - 0x73, 0x91, 0xb2, 0x92, 0x94, 0xc3, 0x7e, 0x09, 0xae, 0xe3, 0x6d, - 0x3c, 0xea, 0xac, 0x57, 0x34, 0x19, 0x82, 0x56, 0x10, 0x2e }, - { 0xd4, 0x35, 0x4b, 0x73, 0x1b, 0x6e, 0xa3, 0x4c, 0xd5, 0x9b, 0x10, - 0xd0, 0x93, 0x64, 0xc9, 0xdf, 0xe0, 0xe5, 0x2e, 0xa0, 0x8c, 0x2d, - 0x85, 0x38, 0x53, 0xaa, 0x79, 0x92, 0xad, 0xae, 0x36, 0xb3 }, - { 0xdb, 0x9b, 0x66, 0x28, 0xf7, 0x9d, 0x37, 0x32, 0xbe, 0x36, 0x78, - 0x8d, 0xa3, 0xd0, 0xc2, 0x73, 0x68, 0x0d, 0x47, 0xf7, 0x13, 0x8f, - 0x3d, 0x83, 0x2a, 0xcf, 0x5e, 0xe1, 0xb8, 0x6d, 0x86, 0xb8 }, - { 0xd5, 0xbf, 0x80, 0x07, 0x53, 0x33, 0xad, 0x71, 0x9a, 0x05, 0x70, - 0xd9, 0xe7, 0xdd, 0x45, 0xf0, 0xd0, 0x2d, 0xaf, 0xdc, 0xf1, 0x12, - 0x67, 0x8f, 0x46, 0x20, 0xac, 0xb4, 0xd7, 0xf8, 0x98, 0x41 }, - { 0xd5, 0xbf, 0x80, 0x07, 0x53, 0x33, 0xad, 0x71, 0x9a, 0x05, 0x70, - 0xd9, 0xe7, 0xdd, 0x45, 0xf0, 0xd0, 0x2d, 0xaf, 0xdc, 0xf1, 0x12, - 0x67, 0x8f, 0x46, 0x20, 0xac, 0xb4, 0xd7, 0xf8, 0x98, 0x41 } }, - { /*key buffers*/ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 } }, - { /* IV buffers*/ - { 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x01, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x02, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x03, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x04, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x05, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x06, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x07, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x08, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x09, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x09, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x0A, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0A, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x0B, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0B, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x0C, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x0D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0D, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0E, 0x1C, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0E, 0x1C, 0x00, 0x00, 0x00 } } } }; - -static cipher_test_vector_t snow3g_f8_vectors[] = { - {/* SCPM test vector */ - /*dataLenInBytes*/ - 32, - /*keyLenInBytes*/ - 16, - /*ivLenInBytes*/ - 16, - /*plaintext*/ - {0x98, 0x1b, 0xa6, 0x82, 0x4c, 0x1b, 0xfb, 0x1a, 0xb4, 0x85, 0x47, - 0x20, 0x29, 0xb7, 0x1d, 0x80, 0x8c, 0xe3, 0x3e, 0x2c, 0xc3, 0xc0, - 0xb5, 0xfc, 0x1f, 0x3d, 0xe8, 0xa6, 0xdc, 0x66, 0xb1, 0xf0}, - /*ciphertext*/ - /* taken from 3GPP implementors test data, the last 4bits of ciphertext - *modified - ** to get around input buffer size in bytes instead of bits */ - { - 0x5d, 0x5b, 0xfe, 0x75, 0xeb, 0x04, 0xf6, 0x8c, - 0xe0, 0xa1, 0x23, 0x77, 0xea, 0x00, 0xb3, 0x7d, - 0x47, 0xc6, 0xa0, 0xba, 0x06, 0x30, 0x91, 0x55, - 0x08, 0x6a, 0x85, 0x9c, 0x43, 0x41, 0xb3, 0x7C, - }, - /*key*/ - {0xd3, 0xc5, 0xd5, 0x92, 0x32, 0x7f, 0xb1, 0x1c, 0x40, 0x35, 0xc6, - 0x68, 0x0a, 0xf8, 0xc6, 0xd1}, - /*iv*/ - {0x39, 0x8a, 0x59, 0xb4, 0xac, 0x00, 0x00, 0x00, 0x39, 0x8a, 0x59, - 0xb4, 0xac, 0x00, 0x00, 0x00}, - }, - {/* 3GPP specs Test Set 1 */ - /*dataLenInBytes*/ - 99, - /*keyLenInBytes*/ - 16, - /*ivLenInBytes*/ - 16, - /*plaintext*/ - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, - 0x6A, 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, - 0x30, 0x04, 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, - 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, - 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, - 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, - 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, - 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, - 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48}, - /*ciphertext*/ - /* taken from 3GPP implementors test data, the last 4bits of ciphertext - *modified - ** to get around input buffer size in bytes instead of bits */ - {0x8C, 0xEB, 0xA6, 0x29, 0x43, 0xDC, 0xED, 0x3A, 0x09, 0x90, 0xB0, - 0x6E, 0xA1, 0xB0, 0xA2, 0xC4, 0xFB, 0x3C, 0xED, 0xC7, 0x1B, 0x36, - 0x9F, 0x42, 0xBA, 0x64, 0xC1, 0xEB, 0x66, 0x65, 0xE7, 0x2A, 0xA1, - 0xC9, 0xBB, 0x0D, 0xEA, 0xA2, 0x0F, 0xE8, 0x60, 0x58, 0xB8, 0xBA, - 0xEE, 0x2C, 0x2E, 0x7F, 0x0B, 0xEC, 0xCE, 0x48, 0xB5, 0x29, 0x32, - 0xA5, 0x3C, 0x9D, 0x5F, 0x93, 0x1A, 0x3A, 0x7C, 0x53, 0x22, 0x59, - 0xAF, 0x43, 0x25, 0xE2, 0xA6, 0x5E, 0x30, 0x84, 0xAD, 0x5F, 0x6A, - 0x51, 0x3B, 0x7B, 0xDD, 0xC1, 0xB6, 0x5F, 0x0A, 0xA0, 0xD9, 0x7A, - 0x05, 0x3D, 0xB5, 0x5A, 0x88, 0xC4, 0xC4, 0xF9, 0x60, 0x5E, 0x41}, - /*key*/ - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, - 0x10, 0x48, 0x81, 0xFF, 0x48}, - /*iv*/ - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00, 0x72, 0xA4, 0xF2, - 0x0F, 0x64, 0x00, 0x00, 0x00} }, - {/* 3GPP specs Test Set 3 */ - /*dataLenInBytes*/ - 15, - /*keyLenInBytes*/ - 16, - /*ivLenInBytes*/ - 16, - /*plaintext*/ - {0xAD, 0x9C, 0x44, 0x1F, 0x89, 0x0B, 0x38, 0xC4, 0x57, 0xA4, 0x9D, - 0x42, 0x14, 0x07, 0xE8}, - /*ciphertext*/ - /* taken from 3GPP implementors test data, the last 4bits of ciphertext - *modified - ** to get around input buffer size in bytes instead of bits */ - {0xBA, 0x0F, 0x31, 0x30, 0x03, 0x34, 0xC5, 0x6B, 0x52, 0xA7, 0x49, - 0x7C, 0xBA, 0xC0, 0x46}, - /*key*/ - {0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, - 0x45, 0x10, 0x10, 0xD8, 0x52}, - /*iv*/ - {0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00, 0xFA, 0x55, 0x6B, - 0x26, 0x1C, 0x00, 0x00, 0x00} }, - {/* 3GPP specs Test Set 2 */ - /*dataLenInBytes*/ - 63, - /*keyLenInBytes*/ - 16, - /*ivLenInBytes*/ - 16, - /*plaintext*/ - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69}, - /*ciphertext*/ - /* taken from 3GPP implementors test data, the last 4bits of ciphertext - *modified - ** to get around input buffer size in bytes instead of bits */ - {0xE0, 0xDA, 0x15, 0xCA, 0x8E, 0x25, 0x54, 0xF5, 0xE5, 0x6C, 0x94, - 0x68, 0xDC, 0x6C, 0x7C, 0x12, 0x9C, 0x56, 0x8A, 0xA5, 0x03, 0x23, - 0x17, 0xE0, 0x4E, 0x07, 0x29, 0x64, 0x6C, 0xAB, 0xEF, 0xA6, 0x89, - 0x86, 0x4C, 0x41, 0x0F, 0x24, 0xF9, 0x19, 0xE6, 0x1E, 0x3D, 0xFD, - 0xFA, 0xD7, 0x7E, 0x56, 0x0D, 0xB0, 0xA9, 0xCD, 0x36, 0xC3, 0x4A, - 0xE4, 0x18, 0x14, 0x90, 0xB2, 0x9F, 0x5F, 0xA2}, - /*key*/ - {0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, - 0x55, 0xE9, 0x60, 0x56, 0x95}, - /*iv*/ - {0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00, 0xE2, 0x8B, 0xCF, - 0x7B, 0xC0, 0x00, 0x00, 0x00} }, - {/* 3GPP specs Test Set 4 */ - /*dataLenInBytes*/ - 31, - /*keyLenInBytes*/ - 16, - /*ivLenInBytes*/ - 16, - /*plaintext*/ - {0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, 0xB4, 0x85, 0x47, - 0x20, 0x29, 0xB7, 0x1D, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, 0xC0, - 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x66, 0xB1}, - /*ciphertext*/ - /* taken from 3GPP implementors test data, the last 4bits of ciphertext - *modified - ** to get around input buffer size in bytes instead of bits */ - {0x98, 0x9B, 0x71, 0x9C, 0xDC, 0x33, 0xCE, 0xB7, 0xCF, 0x27, 0x6A, - 0x52, 0x82, 0x7C, 0xEF, 0x94, 0xA5, 0x6C, 0x40, 0xC0, 0xAB, 0x9D, - 0x81, 0xF7, 0xA2, 0xA9, 0xBA, 0xC6, 0x0E, 0x11, 0xC4, 0xB6}, - /*key*/ - {0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, - 0x68, 0x0A, 0xF8, 0xC6, 0xD1}, - /*iv*/ - {0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00, 0x39, 0x8A, 0x59, - 0xB4, 0x2C, 0x00, 0x00, 0x0} }, - {/* 3GPP specs Test Set 5 */ - /*dataLenInBytes*/ - 104, - /*keyLenInBytes*/ - 16, - /*ivLenInBytes*/ - 16, - /*plaintext*/ - {0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x42, 0x86, 0xB2, - 0x99, 0x78, 0x3D, 0xAF, 0x44, 0x2C, 0x09, 0x9F, 0x7A, 0xB0, 0xF5, - 0x8D, 0x5C, 0x8E, 0x46, 0xB1, 0x04, 0xF0, 0x8F, 0x01, 0xB4, 0x1A, - 0xB4, 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, 0x36, 0xBD, 0x1A, 0x3D, - 0x90, 0xDC, 0x3A, 0x41, 0xB4, 0x6D, 0x51, 0x67, 0x2A, 0xC4, 0xC9, - 0x66, 0x3A, 0x2B, 0xE0, 0x63, 0xDA, 0x4B, 0xC8, 0xD2, 0x80, 0x8C, - 0xE3, 0x3E, 0x2C, 0xCC, 0xBF, 0xC6, 0x34, 0xE1, 0xB2, 0x59, 0x06, - 0x08, 0x76, 0xA0, 0xFB, 0xB5, 0xA4, 0x37, 0xEB, 0xCC, 0x8D, 0x31, - 0xC1, 0x9E, 0x44, 0x54, 0x31, 0x87, 0x45, 0xE3, 0x98, 0x76, 0x45, - 0x98, 0x7A, 0x98, 0x6F, 0x2C}, - /*ciphertext*/ - /* taken from 3GPP implementors test data, the last 4bits of ciphertext - *modified - ** to get around input buffer size in bytes instead of bits */ - {0x58, 0x92, 0xBB, 0xA8, 0x8B, 0xBB, 0xCA, 0xAE, 0xAE, 0x76, 0x9A, - 0xA0, 0x6B, 0x68, 0x3D, 0x3A, 0x17, 0xCC, 0x04, 0xA3, 0x69, 0x88, - 0x16, 0x97, 0x43, 0x5E, 0x44, 0xFE, 0xD5, 0xFF, 0x9A, 0xF5, 0x7B, - 0x9E, 0x89, 0x0D, 0x4D, 0x5C, 0x64, 0x70, 0x98, 0x85, 0xD4, 0x8A, - 0xE4, 0x06, 0x90, 0xEC, 0x04, 0x3B, 0xAA, 0xE9, 0x70, 0x57, 0x96, - 0xE4, 0xA9, 0xFF, 0x5A, 0x4B, 0x8D, 0x8B, 0x36, 0xD7, 0xF3, 0xFE, - 0x57, 0xCC, 0x6C, 0xFD, 0x6C, 0xD0, 0x05, 0xCD, 0x38, 0x52, 0xA8, - 0x5E, 0x94, 0xCE, 0x6B, 0xCD, 0x90, 0xD0, 0xD0, 0x78, 0x39, 0xCE, - 0x09, 0x73, 0x35, 0x44, 0xCA, 0x8E, 0x35, 0x08, 0x43, 0x24, 0x85, - 0x50, 0x92, 0x2A, 0xC1, 0x28}, - /*key*/ - {0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, - 0x2B, 0xE8, 0xE3, 0x65, 0x66}, - /*iv*/ - {0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00, 0x72, 0xA4, 0xF2, - 0x0F, 0x48, 0x00, 0x00, 0x00} }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xea, 0xe9, 0x11, 0x49, 0x21, 0x58, 0x44, 0x59, 0xc6, 0xec, 0x77, - 0x82, 0x71, 0x6f, 0x91, 0xd4, 0xe1, 0xf6, 0xbf, 0xfa, 0x45, 0xfc, - 0x80, 0x94, 0xc2, 0x3d, 0x5c, 0x5f, 0x17, 0x72, 0x44, 0x92}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xe3, 0x96, 0x7f, 0x63, 0x88, 0x74, 0x2d, 0x7c, 0x3b, 0x3d, 0x5a, - 0x08, 0xc0, 0x8d, 0x1a, 0xc2, 0xa1, 0xf2, 0x38, 0x96, 0xc7, 0x41, - 0x1b, 0xc1, 0xde, 0xac, 0x24, 0x57, 0x9c, 0x45, 0x0d, 0xb0}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x01, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x4d, 0x50, 0xd2, 0xe3, 0xa6, 0xe7, 0x97, 0xee, 0xf3, 0xe6, 0x2a, - 0x32, 0xf3, 0x66, 0xea, 0x99, 0xbc, 0x54, 0x24, 0xa6, 0x3f, 0xc3, - 0xbb, 0x27, 0xc7, 0xba, 0x42, 0xd8, 0x2f, 0x86, 0xfc, 0xdf}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x02, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x4a, 0x98, 0xa3, 0x04, 0xad, 0xcf, 0xb9, 0xfa, 0xdb, 0x3b, 0xe7, - 0x7c, 0xd1, 0x69, 0x59, 0x6c, 0x7e, 0x44, 0x73, 0x8d, 0x96, 0xd0, - 0x51, 0x1f, 0x55, 0x32, 0x55, 0x59, 0xc2, 0xe9, 0x0a, 0x21}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x03, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xe4, 0xf5, 0x71, 0x42, 0xaf, 0x93, 0x5e, 0x6d, 0x7d, 0xb8, 0x44, - 0xf7, 0xcb, 0x0d, 0x08, 0xd3, 0x3a, 0xe6, 0x20, 0xcd, 0xc5, 0x33, - 0xa3, 0x5a, 0x5e, 0x5a, 0x41, 0x92, 0x96, 0x44, 0x28, 0xc1}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x04, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x1b, 0x6e, 0x3a, 0x76, 0x18, 0x77, 0x0b, 0x77, 0xf2, 0xda, 0xca, - 0x1d, 0xd2, 0x9c, 0xa9, 0xc2, 0x10, 0x6b, 0xe7, 0x4b, 0xdb, 0x30, - 0x79, 0xc5, 0x56, 0xf4, 0xcb, 0xb7, 0x19, 0xdf, 0xe5, 0xcb}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x05, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x10, 0x4e, 0x19, 0x91, 0x09, 0x91, 0xd0, 0x9d, 0x41, 0x99, 0x33, - 0x1b, 0xfd, 0xa0, 0xe0, 0xf7, 0x80, 0x6c, 0x1f, 0x7b, 0x12, 0x78, - 0x3d, 0x46, 0x65, 0x86, 0x7e, 0xdf, 0x9f, 0xac, 0x31, 0x42}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x06, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x59, 0x02, 0x9f, 0xe6, 0x98, 0x24, 0xe3, 0xc5, 0x1b, 0x19, 0x61, - 0x08, 0x37, 0x79, 0xd0, 0xfe, 0xe4, 0xa1, 0xd8, 0xd4, 0x04, 0xf2, - 0x43, 0x60, 0xa4, 0x68, 0x08, 0x9b, 0x06, 0x9c, 0xb3, 0x51}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x07, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, - 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x60, 0x59, 0x72, 0x8f, 0xd0, 0x0b, 0x69, 0x67, 0xdf, 0x89, 0xb0, - 0xd1, 0xc3, 0x02, 0x3e, 0xe4, 0x5b, 0xde, 0xe2, 0x0a, 0xea, 0x67, - 0xc6, 0x05, 0x40, 0x4f, 0xe9, 0x38, 0xd4, 0x10, 0x1d, 0x5a}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x08, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x46, 0x63, 0x8d, 0x94, 0x5a, 0xcc, 0x87, 0x2d, 0x57, 0x4f, 0xcb, - 0x55, 0x71, 0xaa, 0x6c, 0x17, 0xcb, 0x7c, 0x7a, 0x6d, 0x19, 0xbf, - 0xba, 0xcd, 0xe1, 0x3c, 0x77, 0xed, 0x0f, 0x10, 0x4f, 0x38}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x09, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x09, - 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xe5, 0xdd, 0xa1, 0x58, 0xbe, 0x47, 0x6e, 0xa6, 0x3b, 0xea, 0x90, - 0x02, 0xf6, 0x87, 0xbd, 0x69, 0x1b, 0x15, 0xb7, 0x3c, 0x6f, 0xa1, - 0x28, 0xde, 0x0f, 0xf3, 0x80, 0xfb, 0xef, 0x89, 0xa5, 0xd5}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x0A, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0A, - 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xae, 0x68, 0x9e, 0x4e, 0x8d, 0x49, 0x2a, 0x59, 0x5c, 0x02, 0x53, - 0x73, 0x91, 0xb2, 0x92, 0x94, 0xc3, 0x7e, 0x09, 0xae, 0xe3, 0x6d, - 0x3c, 0xea, 0xac, 0x57, 0x34, 0x19, 0x82, 0x56, 0x10, 0x2e}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x0B, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0B, 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xd4, 0x35, 0x4b, 0x73, 0x1b, 0x6e, 0xa3, 0x4c, 0xd5, 0x9b, 0x10, - 0xd0, 0x93, 0x64, 0xc9, 0xdf, 0xe0, 0xe5, 0x2e, 0xa0, 0x8c, 0x2d, - 0x85, 0x38, 0x53, 0xaa, 0x79, 0x92, 0xad, 0xae, 0x36, 0xb3}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x0C, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0C, - 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xdb, 0x9b, 0x66, 0x28, 0xf7, 0x9d, 0x37, 0x32, 0xbe, 0x36, 0x78, - 0x8d, 0xa3, 0xd0, 0xc2, 0x73, 0x68, 0x0d, 0x47, 0xf7, 0x13, 0x8f, - 0x3d, 0x83, 0x2a, 0xcf, 0x5e, 0xe1, 0xb8, 0x6d, 0x86, 0xb8}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x0D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0D, - 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0xd5, 0xbf, 0x80, 0x07, 0x53, 0x33, 0xad, 0x71, 0x9a, 0x05, 0x70, - 0xd9, 0xe7, 0xdd, 0x45, 0xf0, 0xd0, 0x2d, 0xaf, 0xdc, 0xf1, 0x12, - 0x67, 0x8f, 0x46, 0x20, 0xac, 0xb4, 0xd7, 0xf8, 0x98, 0x41}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0E, - 0x1C, 0x00, 0x00, 0x00} - }, - { - 32, - 16, - 16, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x62, 0x45, 0xff, 0xfa, 0x89, 0x47, 0x18, 0x63, 0x28, 0x4e, 0xd5, - 0xf2, 0x94, 0xb0, 0x54, 0x43, 0xd5, 0xae, 0xb5, 0x68, 0x2f, 0xf6, - 0x7c, 0x81, 0xe3, 0xc5, 0x81, 0x32, 0x0e, 0x59, 0xc5, 0x60}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x0F, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0x1C, 0x00, 0x00, 0x00} - } -}; - -static hash_test_vector_t snow_f9_vectors[] = { - { - /* 3GPP specs Test Set 1 */ - /*input*/ - {0x6B, 0x22, 0x77, 0x37, 0x29, 0x6F, 0x39, 0x3C, - 0x80, 0x79, 0x35, 0x3E, 0xDC, 0x87, 0xE2, 0xE8, - 0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE0}, - /*lengthinbits*/ - 189, - /*key*/ - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, - 0x49, 0x10, 0x48, 0x81, 0xFF, 0x48}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0x2B, 0xCE, 0x18, 0x20}, - /*iv*/ - {0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49, 0x38, 0xA6, - 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49}, - /*ivLeninbytes*/ - 16, - /*direction*/ - 0, - /* IV params */ - {0x38A6F056, 0x05D2EC49, 0x0}, - }, - { - /* 3GPP specs Test Set 2 */ - /*input*/ - {0xB5, 0x92, 0x43, 0x84, 0x32, 0x8A, 0x4A, 0xE0, - 0x0B, 0x73, 0x71, 0x09, 0xF8, 0xB6, 0xC8, 0xDD, - 0x2B, 0x4D, 0xB6, 0x3D, 0xD5, 0x33, 0x98, 0x1C, - 0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC0}, - /*lengthinbits*/ - 254, - /*key*/ - {0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF, 0xCD, 0x9F, - 0x97, 0x94, 0x5E, 0x6D, 0xE7, 0xB7}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0xFC, 0x7B, 0x18, 0xBD}, - /*iv*/ - {0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2, 0xBE, 0xDC, - 0x87, 0xE2, 0xA4, 0xF2, 0x58, 0xE2}, - /*ivLeninbytes*/ - 16, - /*direction*/ - 1, - /* IV params */ - {0x3EDC87E2, 0xA4F2D8E2, 0x1}, - }, - { - /* 3GPP specs Test Set 3 */ - /*input*/ - {0x59, 0x32, 0xBC, 0x0A, 0xCE, 0x2B, 0x0A, 0xBA, 0x33, 0xD8, - 0xAC, 0x18, 0x8A, 0xC5, 0x4F, 0x34, 0x6F, 0xAD, 0x10, 0xBF, - 0x9D, 0xEE, 0x29, 0x20, 0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, - 0x5C, 0xB7, 0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF2}, - /*lengthinbits*/ - 319, - /*key*/ - {0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4, 0x83, 0xA3, - 0x18, 0x69, 0xD8, 0x1B, 0x8F, 0xAB}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0x02, 0xF1, 0xFA, 0xAF}, - /*iv*/ - {0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0xB6, 0xAF, - 0x61, 0x44, 0x98, 0x38, 0x70, 0x3A}, - /*ivLeninbytes*/ - 16, - /*direction*/ - 1, - /* IV params */ - {0x36AF6144, 0x9838F03A, 0x1}, - }, - { - /* 3GPP specs Test Set 4 */ - /*input*/ - {0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, 0x78, 0x83, - 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, 0x72, 0xBD, 0x97, 0x0C, - 0x14, 0x73, 0xE1, 0x29, 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, - 0xAA, 0xA0, 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, - 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09}, - /*lengthinbits*/ - 384, - /*key*/ - {0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, 0x1E, 0x26, - 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0x38, 0xB5, 0x54, 0xC0}, - /*iv*/ - {0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, 0x94, 0x79, - 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD}, - /*ivLeninbytes*/ - 16, - /*direction*/ - 1, - /* IV params */ - {0x14793E41, 0x0397E8FD, 0x1}, - }, - { - /* 3GPP specs Test Set 5 */ - /*input*/ - {0x10, 0xBF, 0xFF, 0x83, 0x9E, 0x0C, 0x71, 0x65, 0x8D, 0xBB, - 0x2D, 0x17, 0x07, 0xE1, 0x45, 0x72, 0x4F, 0x41, 0xC1, 0x6F, - 0x48, 0xBF, 0x40, 0x3C, 0x3B, 0x18, 0xE3, 0x8F, 0xD5, 0xD1, - 0x66, 0x3B, 0x6F, 0x6D, 0x90, 0x01, 0x93, 0xE3, 0xCE, 0xA8, - 0xBB, 0x4F, 0x1B, 0x4F, 0x5B, 0xE8, 0x22, 0x03, 0x22, 0x32, - 0xA7, 0x8D, 0x7D, 0x75, 0x23, 0x8D, 0x5E, 0x6D, 0xAE, 0xCD, - 0x3B, 0x43, 0x22, 0xCF, 0x59, 0xBC, 0x7E, 0xA8, 0x4A, 0xB1, - 0x88, 0x11, 0xB5, 0xBF, 0xB7, 0xBC, 0x55, 0x3F, 0x4F, 0xE4, - 0x44, 0x78, 0xCE, 0x28, 0x7A, 0x14, 0x87, 0x99, 0x90, 0xD1, - 0x8D, 0x12, 0xCA, 0x79, 0xD2, 0xC8, 0x55, 0x14, 0x90, 0x21, - 0xCD, 0x5C, 0xE8, 0xCA, 0x03, 0x71, 0xCA, 0x04, 0xFC, 0xCE, - 0x14, 0x3E, 0x3D, 0x7C, 0xFE, 0xE9, 0x45, 0x85, 0xB5, 0x88, - 0x5C, 0xAC, 0x46, 0x06, 0x8B}, - /*lengthinbits*/ - 1000, - /*key*/ - {0xF4, 0xEB, 0xEC, 0x69, 0xE7, 0x3E, 0xAF, 0x2E, 0xB2, 0xCF, - 0x6A, 0xF4, 0xB3, 0x12, 0x0F, 0xFD}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0x06, 0x17, 0x45, 0xAE}, - /*iv*/ - {0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37, 0xA9, 0x6F, - 0x39, 0x3C, 0x6B, 0x22, 0xF7, 0x37}, - /*ivLeninbytes*/ - 16, - /*direction*/ - 1, - /* IV params */ - {0x296F393C, 0x6B227737, 0x1}, - }, - {/* 3GPP specs Test Set 6 */ - /*input*/ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0xE0, 0x95, 0x80, 0x45, 0xF3, 0xA0, - 0xBB, 0xA4, 0xE3, 0x96, 0x83, 0x46, 0xF0, 0xA3, 0xB8, 0xA7, 0xC0, - 0x2A, 0x01, 0x8A, 0xE6, 0x40, 0x76, 0x52, 0x26, 0xB9, 0x87, 0xC9, - 0x13, 0xE6, 0xCB, 0xF0, 0x83, 0x57, 0x00, 0x16, 0xCF, 0x83, 0xEF, - 0xBC, 0x61, 0xC0, 0x82, 0x51, 0x3E, 0x21, 0x56, 0x1A, 0x42, 0x7C, - 0x00, 0x9D, 0x28, 0xC2, 0x98, 0xEF, 0xAC, 0xE7, 0x8E, 0xD6, 0xD5, - 0x6C, 0x2D, 0x45, 0x05, 0xAD, 0x03, 0x2E, 0x9C, 0x04, 0xDC, 0x60, - 0xE7, 0x3A, 0x81, 0x69, 0x6D, 0xA6, 0x65, 0xC6, 0xC4, 0x86, 0x03, - 0xA5, 0x7B, 0x45, 0xAB, 0x33, 0x22, 0x15, 0x85, 0xE6, 0x8E, 0xE3, - 0x16, 0x91, 0x87, 0xFB, 0x02, 0x39, 0x52, 0x86, 0x32, 0xDD, 0x65, - 0x6C, 0x80, 0x7E, 0xA3, 0x24, 0x8B, 0x7B, 0x46, 0xD0, 0x02, 0xB2, - 0xB5, 0xC7, 0x45, 0x8E, 0xB8, 0x5B, 0x9C, 0xE9, 0x58, 0x79, 0xE0, - 0x34, 0x08, 0x59, 0x05, 0x5E, 0x3B, 0x0A, 0xBB, 0xC3, 0xEA, 0xCE, - 0x87, 0x19, 0xCA, 0xA8, 0x02, 0x65, 0xC9, 0x72, 0x05, 0xD5, 0xDC, - 0x4B, 0xCC, 0x90, 0x2F, 0xE1, 0x83, 0x96, 0x29, 0xED, 0x71, 0x32, - 0x8A, 0x0F, 0x04, 0x49, 0xF5, 0x88, 0x55, 0x7E, 0x68, 0x98, 0x86, - 0x0E, 0x04, 0x2A, 0xEC, 0xD8, 0x4B, 0x24, 0x04, 0xC2, 0x12, 0xC9, - 0x22, 0x2D, 0xA5, 0xBF, 0x8A, 0x89, 0xEF, 0x67, 0x97, 0x87, 0x0C, - 0xF5, 0x07, 0x71, 0xA6, 0x0F, 0x66, 0xA2, 0xEE, 0x62, 0x85, 0x36, - 0x57, 0xAD, 0xDF, 0x04, 0xCD, 0xDE, 0x07, 0xFA, 0x41, 0x4E, 0x11, - 0xF1, 0x2B, 0x4D, 0x81, 0xB9, 0xB4, 0xE8, 0xAC, 0x53, 0x8E, 0xA3, - 0x06, 0x66, 0x68, 0x8D, 0x88, 0x1F, 0x6C, 0x34, 0x84, 0x21, 0x99, - 0x2F, 0x31, 0xB9, 0x4F, 0x88, 0x06, 0xED, 0x8F, 0xCC, 0xFF, 0x4C, - 0x91, 0x23, 0xB8, 0x96, 0x42, 0x52, 0x7A, 0xD6, 0x13, 0xB1, 0x09, - 0xBF, 0x75, 0x16, 0x74, 0x85, 0xF1, 0x26, 0x8B, 0xF8, 0x84, 0xB4, - 0xCD, 0x23, 0xD2, 0x9A, 0x09, 0x34, 0x92, 0x57, 0x03, 0xD6, 0x34, - 0x09, 0x8F, 0x77, 0x67, 0xF1, 0xBE, 0x74, 0x91, 0xE7, 0x08, 0xA8, - 0xBB, 0x94, 0x9A, 0x38, 0x73, 0x70, 0x8A, 0xEF, 0x4A, 0x36, 0x23, - 0x9E, 0x50, 0xCC, 0x08, 0x23, 0x5C, 0xD5, 0xED, 0x6B, 0xBE, 0x57, - 0x86, 0x68, 0xA1, 0x7B, 0x58, 0xC1, 0x17, 0x1D, 0x0B, 0x90, 0xE8, - 0x13, 0xA9, 0xE4, 0xF5, 0x8A, 0x89, 0xD7, 0x19, 0xB1, 0x10, 0x42, - 0xD6, 0x36, 0x0B, 0x1B, 0x0F, 0x52, 0xDE, 0xB7, 0x30, 0xA5, 0x8D, - 0x58, 0xFA, 0xF4, 0x63, 0x15, 0x95, 0x4B, 0x0A, 0x87, 0x26, 0x91, - 0x47, 0x59, 0x77, 0xDC, 0x88, 0xC0, 0xD7, 0x33, 0xFE, 0xFF, 0x54, - 0x60, 0x0A, 0x0C, 0xC1, 0xD0, 0x30, 0x0A, 0xAA, 0xEB, 0x94, 0x57, - 0x2C, 0x6E, 0x95, 0xB0, 0x1A, 0xE9, 0x0D, 0xE0, 0x4F, 0x1D, 0xCE, - 0x47, 0xF8, 0x7E, 0x8F, 0xA7, 0xBE, 0xBF, 0x77, 0xE1, 0xDB, 0xC2, - 0x0D, 0x6B, 0xA8, 0x5C, 0xB9, 0x14, 0x3D, 0x51, 0x8B, 0x28, 0x5D, - 0xFA, 0x04, 0xB6, 0x98, 0xBF, 0x0C, 0xF7, 0x81, 0x9F, 0x20, 0xFA, - 0x7A, 0x28, 0x8E, 0xB0, 0x70, 0x3D, 0x99, 0x5C, 0x59, 0x94, 0x0C, - 0x7C, 0x66, 0xDE, 0x57, 0xA9, 0xB7, 0x0F, 0x82, 0x37, 0x9B, 0x70, - 0xE2, 0x03, 0x1E, 0x45, 0x0F, 0xCF, 0xD2, 0x18, 0x13, 0x26, 0xFC, - 0xD2, 0x8D, 0x88, 0x23, 0xBA, 0xAA, 0x80, 0xDF, 0x6E, 0x0F, 0x44, - 0x35, 0x59, 0x64, 0x75, 0x39, 0xFD, 0x89, 0x07, 0xC0, 0xFF, 0xD9, - 0xD7, 0x9C, 0x13, 0x0E, 0xD8, 0x1C, 0x9A, 0xFD, 0x9B, 0x7E, 0x84, - 0x8C, 0x9F, 0xED, 0x38, 0x44, 0x3D, 0x5D, 0x38, 0x0E, 0x53, 0xFB, - 0xDB, 0x8A, 0xC8, 0xC3, 0xD3, 0xF0, 0x68, 0x76, 0x05, 0x4F, 0x12, - 0x24, 0x61, 0x10, 0x7D, 0xE9, 0x2F, 0xEA, 0x09, 0xC6, 0xF6, 0x92, - 0x3A, 0x18, 0x8D, 0x53, 0xAF, 0xE5, 0x4A, 0x10, 0xF6, 0x0E, 0x6E, - 0x9D, 0x5A, 0x03, 0xD9, 0x96, 0xB5, 0xFB, 0xC8, 0x20, 0xF8, 0xA6, - 0x37, 0x11, 0x6A, 0x27, 0xAD, 0x04, 0xB4, 0x44, 0xA0, 0x93, 0x2D, - 0xD6, 0x0F, 0xBD, 0x12, 0x67, 0x1C, 0x11, 0xE1, 0xC0, 0xEC, 0x73, - 0xE7, 0x89, 0x87, 0x9F, 0xAA, 0x3D, 0x42, 0xC6, 0x4D, 0x20, 0xCD, - 0x12, 0x52, 0x74, 0x2A, 0x37, 0x68, 0xC2, 0x5A, 0x90, 0x15, 0x85, - 0x88, 0x8E, 0xCE, 0xE1, 0xE6, 0x12, 0xD9, 0x93, 0x6B, 0x40, 0x3B, - 0x07, 0x75, 0x94, 0x9A, 0x66, 0xCD, 0xFD, 0x99, 0xA2, 0x9B, 0x13, - 0x45, 0xBA, 0xA8, 0xD9, 0xD5, 0x40, 0x0C, 0x91, 0x02, 0x4B, 0x0A, - 0x60, 0x73, 0x63, 0xB0, 0x13, 0xCE, 0x5D, 0xE9, 0xAE, 0x86, 0x9D, - 0x3B, 0x8D, 0x95, 0xB0, 0x57, 0x0B, 0x3C, 0x2D, 0x39, 0x14, 0x22, - 0xD3, 0x24, 0x50, 0xCB, 0xCF, 0xAE, 0x96, 0x65, 0x22, 0x86, 0xE9, - 0x6D, 0xEC, 0x12, 0x14, 0xA9, 0x34, 0x65, 0x27, 0x98, 0x0A, 0x81, - 0x92, 0xEA, 0xC1, 0xC3, 0x9A, 0x3A, 0xAF, 0x6F, 0x15, 0x35, 0x1D, - 0xA6, 0xBE, 0x76, 0x4D, 0xF8, 0x97, 0x72, 0xEC, 0x04, 0x07, 0xD0, - 0x6E, 0x44, 0x15, 0xBE, 0xFA, 0xE7, 0xC9, 0x25, 0x80, 0xDF, 0x9B, - 0xF5, 0x07, 0x49, 0x7C, 0x8F, 0x29, 0x95, 0x16, 0x0D, 0x4E, 0x21, - 0x8D, 0xAA, 0xCB, 0x02, 0x94, 0x4A, 0xBF, 0x83, 0x34, 0x0C, 0xE8, - 0xBE, 0x16, 0x86, 0xA9, 0x60, 0xFA, 0xF9, 0x0E, 0x2D, 0x90, 0xC5, - 0x5C, 0xC6, 0x47, 0x5B, 0xAB, 0xC3, 0x17, 0x1A, 0x80, 0xA3, 0x63, - 0x17, 0x49, 0x54, 0x95, 0x5D, 0x71, 0x01, 0xDA, 0xB1, 0x6A, 0xE8, - 0x17, 0x91, 0x67, 0xE2, 0x14, 0x44, 0xB4, 0x43, 0xA9, 0xEA, 0xAA, - 0x7C, 0x91, 0xDE, 0x36, 0xD1, 0x18, 0xC3, 0x9D, 0x38, 0x9F, 0x8D, - 0xD4, 0x46, 0x9A, 0x84, 0x6C, 0x9A, 0x26, 0x2B, 0xF7, 0xFA, 0x18, - 0x48, 0x7A, 0x79, 0xE8, 0xDE, 0x11, 0x69, 0x9E, 0x0B, 0x8F, 0xDF, - 0x55, 0x7C, 0xB4, 0x87, 0x19, 0xD4, 0x53, 0xBA, 0x71, 0x30, 0x56, - 0x10, 0x9B, 0x93, 0xA2, 0x18, 0xC8, 0x96, 0x75, 0xAC, 0x19, 0x5F, - 0xB4, 0xFB, 0x06, 0x63, 0x9B, 0x37, 0x97, 0x14, 0x49, 0x55, 0xB3, - 0xC9, 0x32, 0x7D, 0x1A, 0xEC, 0x00, 0x3D, 0x42, 0xEC, 0xD0, 0xEA, - 0x98, 0xAB, 0xF1, 0x9F, 0xFB, 0x4A, 0xF3, 0x56, 0x1A, 0x67, 0xE7, - 0x7C, 0x35, 0xBF, 0x15, 0xC5, 0x9C, 0x24, 0x12, 0xDA, 0x88, 0x1D, - 0xB0, 0x2B, 0x1B, 0xFB, 0xCE, 0xBF, 0xAC, 0x51, 0x52, 0xBC, 0x99, - 0xBC, 0x3F, 0x1D, 0x15, 0xF7, 0x71, 0x00, 0x1B, 0x70, 0x29, 0xFE, - 0xDB, 0x02, 0x8F, 0x8B, 0x85, 0x2B, 0xC4, 0x40, 0x7E, 0xB8, 0x3F, - 0x89, 0x1C, 0x9C, 0xA7, 0x33, 0x25, 0x4F, 0xDD, 0x1E, 0x9E, 0xDB, - 0x56, 0x91, 0x9C, 0xE9, 0xFE, 0xA2, 0x1C, 0x17, 0x40, 0x72, 0x52, - 0x1C, 0x18, 0x31, 0x9A, 0x54, 0xB5, 0xD4, 0xEF, 0xBE, 0xBD, 0xDF, - 0x1D, 0x8B, 0x69, 0xB1, 0xCB, 0xF2, 0x5F, 0x48, 0x9F, 0xCC, 0x98, - 0x13, 0x72, 0x54, 0x7C, 0xF4, 0x1D, 0x00, 0x8E, 0xF0, 0xBC, 0xA1, - 0x92, 0x6F, 0x93, 0x4B, 0x73, 0x5E, 0x09, 0x0B, 0x3B, 0x25, 0x1E, - 0xB3, 0x3A, 0x36, 0xF8, 0x2E, 0xD9, 0xB2, 0x9C, 0xF4, 0xCB, 0x94, - 0x41, 0x88, 0xFA, 0x0E, 0x1E, 0x38, 0xDD, 0x77, 0x8F, 0x7D, 0x1C, - 0x9D, 0x98, 0x7B, 0x28, 0xD1, 0x32, 0xDF, 0xB9, 0x73, 0x1F, 0xA4, - 0xF4, 0xB4, 0x16, 0x93, 0x5B, 0xE4, 0x9D, 0xE3, 0x05, 0x16, 0xAF, - 0x35, 0x78, 0x58, 0x1F, 0x2F, 0x13, 0xF5, 0x61, 0xC0, 0x66, 0x33, - 0x61, 0x94, 0x1E, 0xAB, 0x24, 0x9A, 0x4B, 0xC1, 0x23, 0xF8, 0xD1, - 0x5C, 0xD7, 0x11, 0xA9, 0x56, 0xA1, 0xBF, 0x20, 0xFE, 0x6E, 0xB7, - 0x8A, 0xEA, 0x23, 0x73, 0x36, 0x1D, 0xA0, 0x42, 0x6C, 0x79, 0xA5, - 0x30, 0xC3, 0xBB, 0x1D, 0xE0, 0xC9, 0x97, 0x22, 0xEF, 0x1F, 0xDE, - 0x39, 0xAC, 0x2B, 0x00, 0xA0, 0xA8, 0xEE, 0x7C, 0x80, 0x0A, 0x08, - 0xBC, 0x22, 0x64, 0xF8, 0x9F, 0x4E, 0xFF, 0xE6, 0x27, 0xAC, 0x2F, - 0x05, 0x31, 0xFB, 0x55, 0x4F, 0x6D, 0x21, 0xD7, 0x4C, 0x59, 0x0A, - 0x70, 0xAD, 0xFA, 0xA3, 0x90, 0xBD, 0xFB, 0xB3, 0xD6, 0x8E, 0x46, - 0x21, 0x5C, 0xAB, 0x18, 0x7D, 0x23, 0x68, 0xD5, 0xA7, 0x1F, 0x5E, - 0xBE, 0xC0, 0x81, 0xCD, 0x3B, 0x20, 0xC0, 0x82, 0xDB, 0xE4, 0xCD, - 0x2F, 0xAC, 0xA2, 0x87, 0x73, 0x79, 0x5D, 0x6B, 0x0C, 0x10, 0x20, - 0x4B, 0x65, 0x9A, 0x93, 0x9E, 0xF2, 0x9B, 0xBE, 0x10, 0x88, 0x24, - 0x36, 0x24, 0x42, 0x99, 0x27, 0xA7, 0xEB, 0x57, 0x6D, 0xD3, 0xA0, - 0x0E, 0xA5, 0xE0, 0x1A, 0xF5, 0xD4, 0x75, 0x83, 0xB2, 0x27, 0x2C, - 0x0C, 0x16, 0x1A, 0x80, 0x65, 0x21, 0xA1, 0x6F, 0xF9, 0xB0, 0xA7, - 0x22, 0xC0, 0xCF, 0x26, 0xB0, 0x25, 0xD5, 0x83, 0x6E, 0x22, 0x58, - 0xA4, 0xF7, 0xD4, 0x77, 0x3A, 0xC8, 0x01, 0xE4, 0x26, 0x3B, 0xC2, - 0x94, 0xF4, 0x3D, 0xEF, 0x7F, 0xA8, 0x70, 0x3F, 0x3A, 0x41, 0x97, - 0x46, 0x35, 0x25, 0x88, 0x76, 0x52, 0xB0, 0xB2, 0xA4, 0xA2, 0xA7, - 0xCF, 0x87, 0xF0, 0x09, 0x14, 0x87, 0x1E, 0x25, 0x03, 0x91, 0x13, - 0xC7, 0xE1, 0x61, 0x8D, 0xA3, 0x40, 0x64, 0xB5, 0x7A, 0x43, 0xC4, - 0x63, 0x24, 0x9F, 0xB8, 0xD0, 0x5E, 0x0F, 0x26, 0xF4, 0xA6, 0xD8, - 0x49, 0x72, 0xE7, 0xA9, 0x05, 0x48, 0x24, 0x14, 0x5F, 0x91, 0x29, - 0x5C, 0xDB, 0xE3, 0x9A, 0x6F, 0x92, 0x0F, 0xAC, 0xC6, 0x59, 0x71, - 0x2B, 0x46, 0xA5, 0x4B, 0xA2, 0x95, 0xBB, 0xE6, 0xA9, 0x01, 0x54, - 0xE9, 0x1B, 0x33, 0x98, 0x5A, 0x2B, 0xCD, 0x42, 0x0A, 0xD5, 0xC6, - 0x7E, 0xC9, 0xAD, 0x8E, 0xB7, 0xAC, 0x68, 0x64, 0xDB, 0x27, 0x2A, - 0x51, 0x6B, 0xC9, 0x4C, 0x28, 0x39, 0xB0, 0xA8, 0x16, 0x9A, 0x6B, - 0xF5, 0x8E, 0x1A, 0x0C, 0x2A, 0xDA, 0x8C, 0x88, 0x3B, 0x7B, 0xF4, - 0x97, 0xA4, 0x91, 0x71, 0x26, 0x8E, 0xD1, 0x5D, 0xDD, 0x29, 0x69, - 0x38, 0x4E, 0x7F, 0xF4, 0xBF, 0x4A, 0xAB, 0x2E, 0xC9, 0xEC, 0xC6, - 0x52, 0x9C, 0xF6, 0x29, 0xE2, 0xDF, 0x0F, 0x08, 0xA7, 0x7A, 0x65, - 0xAF, 0xA1, 0x2A, 0xA9, 0xB5, 0x05, 0xDF, 0x8B, 0x28, 0x7E, 0xF6, - 0xCC, 0x91, 0x49, 0x3D, 0x1C, 0xAA, 0x39, 0x07, 0x6E, 0x28, 0xEF, - 0x1E, 0xA0, 0x28, 0xF5, 0x11, 0x8D, 0xE6, 0x1A, 0xE0, 0x2B, 0xB6, - 0xAE, 0xFC, 0x33, 0x43, 0xA0, 0x50, 0x29, 0x2F, 0x19, 0x9F, 0x40, - 0x18, 0x57, 0xB2, 0xBE, 0xAD, 0x5E, 0x6E, 0xE2, 0xA1, 0xF1, 0x91, - 0x02, 0x2F, 0x92, 0x78, 0x01, 0x6F, 0x04, 0x77, 0x91, 0xA9, 0xD1, - 0x8D, 0xA7, 0xD2, 0xA6, 0xD2, 0x7F, 0x2E, 0x0E, 0x51, 0xC2, 0xF6, - 0xEA, 0x30, 0xE8, 0xAC, 0x49, 0xA0, 0x60, 0x4F, 0x4C, 0x13, 0x54, - 0x2E, 0x85, 0xB6, 0x83, 0x81, 0xB9, 0xFD, 0xCF, 0xA0, 0xCE, 0x4B, - 0x2D, 0x34, 0x13, 0x54, 0x85, 0x2D, 0x36, 0x02, 0x45, 0xC5, 0x36, - 0xB6, 0x12, 0xAF, 0x71, 0xF3, 0xE7, 0x7C, 0x90, 0x95, 0xAE, 0x2D, - 0xBD, 0xE5, 0x04, 0xB2, 0x65, 0x73, 0x3D, 0xAB, 0xFE, 0x10, 0xA2, - 0x0F, 0xC7, 0xD6, 0xD3, 0x2C, 0x21, 0xCC, 0xC7, 0x2B, 0x8B, 0x34, - 0x44, 0xAE, 0x66, 0x3D, 0x65, 0x92, 0x2D, 0x17, 0xF8, 0x2C, 0xAA, - 0x2B, 0x86, 0x5C, 0xD8, 0x89, 0x13, 0xD2, 0x91, 0xA6, 0x58, 0x99, - 0x02, 0x6E, 0xA1, 0x32, 0x84, 0x39, 0x72, 0x3C, 0x19, 0x8C, 0x36, - 0xB0, 0xC3, 0xC8, 0xD0, 0x85, 0xBF, 0xAF, 0x8A, 0x32, 0x0F, 0xDE, - 0x33, 0x4B, 0x4A, 0x49, 0x19, 0xB4, 0x4C, 0x2B, 0x95, 0xF6, 0xE8, - 0xEC, 0xF7, 0x33, 0x93, 0xF7, 0xF0, 0xD2, 0xA4, 0x0E, 0x60, 0xB1, - 0xD4, 0x06, 0x52, 0x6B, 0x02, 0x2D, 0xDC, 0x33, 0x18, 0x10, 0xB1, - 0xA5, 0xF7, 0xC3, 0x47, 0xBD, 0x53, 0xED, 0x1F, 0x10, 0x5D, 0x6A, - 0x0D, 0x30, 0xAB, 0xA4, 0x77, 0xE1, 0x78, 0x88, 0x9A, 0xB2, 0xEC, - 0x55, 0xD5, 0x58, 0xDE, 0xAB, 0x26, 0x30, 0x20, 0x43, 0x36, 0x96, - 0x2B, 0x4D, 0xB5, 0xB6, 0x63, 0xB6, 0x90, 0x2B, 0x89, 0xE8, 0x5B, - 0x31, 0xBC, 0x6A, 0xF5, 0x0F, 0xC5, 0x0A, 0xCC, 0xB3, 0xFB, 0x9B, - 0x57, 0xB6, 0x63, 0x29, 0x70, 0x31, 0x37, 0x8D, 0xB4, 0x78, 0x96, - 0xD7, 0xFB, 0xAF, 0x6C, 0x60, 0x0A, 0xDD, 0x2C, 0x67, 0xF9, 0x36, - 0xDB, 0x03, 0x79, 0x86, 0xDB, 0x85, 0x6E, 0xB4, 0x9C, 0xF2, 0xDB, - 0x3F, 0x7D, 0xA6, 0xD2, 0x36, 0x50, 0xE4, 0x38, 0xF1, 0x88, 0x40, - 0x41, 0xB0, 0x13, 0x11, 0x9E, 0x4C, 0x2A, 0xE5, 0xAF, 0x37, 0xCC, - 0xCD, 0xFB, 0x68, 0x66, 0x07, 0x38, 0xB5, 0x8B, 0x3C, 0x59, 0xD1, - 0xC0, 0x24, 0x84, 0x37, 0x47, 0x2A, 0xBA, 0x1F, 0x35, 0xCA, 0x1F, - 0xB9, 0x0C, 0xD7, 0x14, 0xAA, 0x9F, 0x63, 0x55, 0x34, 0xF4, 0x9E, - 0x7C, 0x5B, 0xBA, 0x81, 0xC2, 0xB6, 0xB3, 0x6F, 0xDE, 0xE2, 0x1C, - 0xA2, 0x7E, 0x34, 0x7F, 0x79, 0x3D, 0x2C, 0xE9, 0x44, 0xED, 0xB2, - 0x3C, 0x8C, 0x9B, 0x91, 0x4B, 0xE1, 0x03, 0x35, 0xE3, 0x50, 0xFE, - 0xB5, 0x07, 0x03, 0x94, 0xB7, 0xA4, 0xA1, 0x5C, 0x0C, 0xA1, 0x20, - 0x28, 0x35, 0x68, 0xB7, 0xBF, 0xC2, 0x54, 0xFE, 0x83, 0x8B, 0x13, - 0x7A, 0x21, 0x47, 0xCE, 0x7C, 0x11, 0x3A, 0x3A, 0x4D, 0x65, 0x49, - 0x9D, 0x9E, 0x86, 0xB8, 0x7D, 0xBC, 0xC7, 0xF0, 0x3B, 0xBD, 0x3A, - 0x3A, 0xB1, 0xAA, 0x24, 0x3E, 0xCE, 0x5B, 0xA9, 0xBC, 0xF2, 0x5F, - 0x82, 0x83, 0x6C, 0xFE, 0x47, 0x3B, 0x2D, 0x83, 0xE7, 0xA7, 0x20, - 0x1C, 0xD0, 0xB9, 0x6A, 0x72, 0x45, 0x1E, 0x86, 0x3F, 0x6C, 0x3B, - 0xA6, 0x64, 0xA6, 0xD0, 0x73, 0xD1, 0xF7, 0xB5, 0xED, 0x99, 0x08, - 0x65, 0xD9, 0x78, 0xBD, 0x38, 0x15, 0xD0, 0x60, 0x94, 0xFC, 0x9A, - 0x2A, 0xBA, 0x52, 0x21, 0xC2, 0x2D, 0x5A, 0xB9, 0x96, 0x38, 0x9E, - 0x37, 0x21, 0xE3, 0xAF, 0x5F, 0x05, 0xBE, 0xDD, 0xC2, 0x87, 0x5E, - 0x0D, 0xFA, 0xEB, 0x39, 0x02, 0x1E, 0xE2, 0x7A, 0x41, 0x18, 0x7C, - 0xBB, 0x45, 0xEF, 0x40, 0xC3, 0xE7, 0x3B, 0xC0, 0x39, 0x89, 0xF9, - 0xA3, 0x0D, 0x12, 0xC5, 0x4B, 0xA7, 0xD2, 0x14, 0x1D, 0xA8, 0xA8, - 0x75, 0x49, 0x3E, 0x65, 0x77, 0x6E, 0xF3, 0x5F, 0x97, 0xDE, 0xBC, - 0x22, 0x86, 0xCC, 0x4A, 0xF9, 0xB4, 0x62, 0x3E, 0xEE, 0x90, 0x2F, - 0x84, 0x0C, 0x52, 0xF1, 0xB8, 0xAD, 0x65, 0x89, 0x39, 0xAE, 0xF7, - 0x1F, 0x3F, 0x72, 0xB9, 0xEC, 0x1D, 0xE2, 0x15, 0x88, 0xBD, 0x35, - 0x48, 0x4E, 0xA4, 0x44, 0x36, 0x34, 0x3F, 0xF9, 0x5E, 0xAD, 0x6A, - 0xB1, 0xD8, 0xAF, 0xB1, 0xB2, 0xA3, 0x03, 0xDF, 0x1B, 0x71, 0xE5, - 0x3C, 0x4A, 0xEA, 0x6B, 0x2E, 0x3E, 0x93, 0x72, 0xBE, 0x0D, 0x1B, - 0xC9, 0x97, 0x98, 0xB0, 0xCE, 0x3C, 0xC1, 0x0D, 0x2A, 0x59, 0x6D, - 0x56, 0x5D, 0xBA, 0x82, 0xF8, 0x8C, 0xE4, 0xCF, 0xF3, 0xB3, 0x3D, - 0x5D, 0x24, 0xE9, 0xC0, 0x83, 0x11, 0x24, 0xBF, 0x1A, 0xD5, 0x4B, - 0x79, 0x25, 0x32, 0x98, 0x3D, 0xD6, 0xC3, 0xA8, 0xB7, 0xD0}, - /*lengthinbits*/ - 16448, - /*key*/ - {0xB3, 0x12, 0x0F, 0xFD, 0xB2, 0xCF, 0x6A, 0xF4, 0xE7, 0x3E, 0xAF, - 0x2E, 0xF4, 0xEB, 0xEC, 0x69}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0x17, 0x9F, 0x2F, 0xA6}, - /*iv*/ - {0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37, 0xA9, 0x6F, 0x39, - 0x3C, 0x6B, 0x22, 0xF7, 0x37}, - /*ivLeninbytes*/ - 16, - /*direction*/ - 1, - /* IV params */ - {0x296F393C, 0x6B227737, 0x1}, - } }; /* snow3g f9 3GPP test vectors */ - -cipher_test_vector_t *snow3g_cipher_test_vectors[] = { - snow3g_f8_vectors, snow3g_f8_vectors -}; - -uint32_t numSnow3gCipherTestVectors[] = { - sizeof(snow3g_f8_vectors) / sizeof(cipher_test_vector_t), - sizeof(snow3g_f8_vectors) / sizeof(cipher_test_vector_t), - sizeof(snow3g_f8_linear_bitvectors) / sizeof(cipherbit_test_vector_t), - sizeof(snow3g_f8_linear_bitvectors) / sizeof(cipherbit_test_vector_t) -}; - -cipher_test_linear_vector_t *snow3g_cipher_test_vectors_linear[] = { - snow3g_f8_linear, snow3g_f8_linear -}; - -uint32_t numSnow3gCipherTestVectorsLinear[] = { - sizeof(snow3g_f8_linear) / sizeof(cipher_test_linear_vector_t), - sizeof(snow3g_f8_linear) / sizeof(cipher_test_linear_vector_t) -}; - -hash_test_vector_t *snow3g_hash_test_vectors[] = { - snow_f9_vectors, snow_f9_vectors, snow_f9_vectors -}; -uint32_t numSnow3gHashTestVectors[] = { - sizeof(snow_f9_vectors) / sizeof(hash_test_vector_t), - sizeof(snow_f9_vectors) / sizeof(hash_test_vector_t), - sizeof(snow_f9_vectors) / sizeof(hash_test_vector_t) -}; - -#endif /*__SSO_TEST_VECTORS_H__*/ diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index f1c813ca..595d9bff 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From d96aec441dad1b99a052cbfe30db4cda3d99d78d Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 28 Aug 2023 15:17:46 +0200 Subject: [PATCH 062/204] CMake: Requires nasm 2.14 at least Signed-off-by: Uilian Ries --- lib/CMakeLists.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8954e099..4b7e7251 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -224,6 +224,24 @@ else() message(FATAL_ERROR "Can't find assembler") endif() endif() + +set(NASM_MAJOR_REQUIRED 2) +set(NASM_MINOR_REQUIRED 14) + +execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -v + OUTPUT_VARIABLE NASM_VERSION_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE +) +string(REGEX MATCH "NASM version ([0-9]*).([0-9]*)" NASM_VERSION "${NASM_VERSION_OUTPUT}") +if (NASM_VERSION) + if (NASM_MAJOR_REQUIRED GREATER ${CMAKE_MATCH_1} OR NASM_MINOR_REQUIRED GREATER ${CMAKE_MATCH_2}) + message(FATAL_ERROR "NASM version must be at least ${NASM_MAJOR_REQUIRED}.${NASM_MINOR_REQUIRED}!") + endif() + message(STATUS "NASM version: ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}") +else() + message(WARNING "Could not parse NASM version string: ${NASM_VERSION_OUTPUT}.\nPlease, be sure that ${CMAKE_ASM_NASM_COMPILER} version is >= ${NASM_MAJOR_REQUIRED}.${NASM_MINOR_REQUIRED}.") +endif() + set(CAN_USE_ASSEMBLER 1) ######################################## @@ -247,4 +265,3 @@ endforeach() # add include directories target_include_directories(${LIB} PRIVATE ${DIR_CURRENT} ${DIR_INCLUDE} ${DIR_NO_AESNI}) - -- GitLab From 70353fd48b86867b8343529787c4167f94080d2c Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 30 Aug 2023 10:52:57 +0100 Subject: [PATCH 063/204] perf: update style check - add back checkpatch target - checkpatch just checking ASM source files - add --max-line-length=100 option to checkpatch --- perf/Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/perf/Makefile b/perf/Makefile index 6162274b..f1280af4 100644 --- a/perf/Makefile +++ b/perf/Makefile @@ -142,15 +142,28 @@ clean: -rm -f $(DEPFILES) -rm -f $(EXE) -CLANGFORMAT?=clang-format .PHONY: style -style: +style: clang-format checkpatch + +.PHONY: clang-format +CLANGFORMAT?=clang-format +clang-format: @for file in $(wildcard *.[ch]); do \ echo "Checking style $$file"; \ $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ { echo "ERROR: $$file has style problems"; exit 1; } \ done +.PHONY: checkpatch +SOURCES_STYLE := $(foreach infile,$(ASM_SOURCES),-f $(infile)) +CHECKPATCH?=checkpatch.pl +checkpatch: + $(CHECKPATCH) --no-tree --no-signoff --emacs --no-color \ +--ignore CODE_INDENT,INITIALISED_STATIC,LEADING_SPACE,SPLIT_STRING,\ +UNSPECIFIED_INT,ARRAY_SIZE,BLOCK_COMMENT_STYLE,GLOBAL_INITIALISERS,\ +COMPLEX_MACRO,SPACING,STORAGE_CLASS,USE_FUNC,NEW_TYPEDEFS,VOLATILE,\ +CONSTANT_COMPARISON --max-line-length=100 $(SOURCES_STYLE) + # cppcheck analysis check CPPCHECK ?= cppcheck CPPCHECK_OPTS ?= -I../lib -I./ -- GitLab From 125461a87b2565b5412a0fbd0a6f421e3504ac6b Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 1 Sep 2023 14:48:11 +0100 Subject: [PATCH 064/204] test: add clang-format to makefile style check - clang-format used for .c and .h files - checkpatch used for .asm and .inc files --- test/Makefile | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/test/Makefile b/test/Makefile index b92352de..df0925d0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -61,35 +61,27 @@ clean: $(MAKE) -C acvp-app clean $(MAKE) -C wycheproof-app clean +.PHONY: style +style: clang-format checkpatch + # style check section CHECKPATCH?=checkpatch.pl CHECKPATCH_FLAGS = --no-tree --no-signoff --emacs --no-color --max-line-length=100 --ignore CODE_INDENT,INITIALISED_STATIC,LEADING_SPACE,SPLIT_STRING,UNSPECIFIED_INT,ARRAY_SIZE,BLOCK_COMMENT_STYLE,GLOBAL_INITIALISERS,AVOID_EXTERNS,COMPLEX_MACRO,USE_FUNC,CONSTANT_COMPARISON,MISSING_SPACE,NEW_TYPEDEFS -%.c_style_check : %.c - $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< - -%.h_style_check : %.h - $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< +ASM_SOURCES := $(wildcard ./**/*.asm) $(wildcard ./**/*.inc) -%.asm_style_check : %.asm - $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< +.PHONY: checkpatch +checkpatch: + $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $(ASM_SOURCES) -%.inc_style_check : %.inc - $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< - -KAT_APP_SOURCES := $(wildcard $(KAT_APP)/*.[ch]) -FUZZ_APP_SOURCES := $(wildcard $(FUZZ_APP)/*.[ch]) -ACVP_APP_SOURCES := $(wildcard $(ACVP_APP)/*.[ch]) -WYCHEPROOF_APP_SOURCES := $(wildcard $(WYCHEPROOF_APP)/*.[ch]) -XVALID_APP_SOURCES := $(wildcard $(XVALID_APP)/*.[ch]) \ - $(wildcard $(XVALID_APP)/*.asm) \ - $(wildcard $(XVALID_APP)/*.inc) -SOURCES_ALL := $(KAT_APP_SOURCES) $(XVALID_APP_SOURCES) \ - $(FUZZ_APP_SOURCES) $(ACVP_APP_SOURCES) $(WYCHEPROOF_APP_SOURCES) -SOURCES_STYLE := $(foreach infile,$(SOURCES_ALL),$(infile)_style_check) - -.PHONY: style -style: $(SOURCES_STYLE) +CLANGFORMAT?=clang-format +.PHONY: clang-format +clang-format: + @for file in $(wildcard ./**/*.[ch]); do \ + echo "Checking style $$file"; \ + $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ + { echo "ERROR: $$file has style problems"; exit 1; } \ + done # cppcheck analysis check CPPCHECK ?= cppcheck -- GitLab From ba5c08535ba83da6b0a42280fdec0f8efd072285 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 1 Sep 2023 14:51:49 +0100 Subject: [PATCH 065/204] test: reformat .c and .h files using clang-format --- test/acvp-app/acvp_app_main.c | 260 +- test/common/utils.c | 63 +- test/fuzz-app/direct_api_fuzz_test.c | 436 +-- test/fuzz-app/job_api_fuzz_test.c | 142 +- test/include/aead_test.h | 2 +- test/include/cipher_test.h | 2 +- test/include/utils.h | 43 +- test/kat-app/aes_cbc_test.c | 258 +- test/kat-app/aes_cbc_test.json.c | 473 ++- test/kat-app/aes_cbcs_test.c | 134 +- test/kat-app/aes_cbcs_test.json.c | 2966 ++++++++--------- test/kat-app/aes_cfb_test.c | 57 +- test/kat-app/aes_cfb_test.json.c | 140 +- test/kat-app/aes_test.c | 1109 +++--- test/kat-app/api_test.c | 792 ++--- test/kat-app/ccm_test.c | 109 +- test/kat-app/ccm_test.json.c | 979 +++--- test/kat-app/chacha20_poly1305_test.c | 207 +- test/kat-app/chacha20_poly1305_test.json.c | 129 +- test/kat-app/chacha_test.c | 86 +- test/kat-app/chacha_test.json.c | 134 +- test/kat-app/chained_test.c | 265 +- test/kat-app/clear_mem_test.c | 25 +- test/kat-app/cmac_test.c | 394 +-- test/kat-app/cmac_test.json.c | 666 ++-- test/kat-app/crc_test.c | 121 +- test/kat-app/ctr_test.c | 244 +- test/kat-app/ctr_test.json.c | 775 +++-- test/kat-app/customop_test.c | 65 +- test/kat-app/customop_test.h | 3 +- test/kat-app/des_test.c | 193 +- test/kat-app/des_test.json.c | 112 +- test/kat-app/direct_api_param_test.c | 1116 +++---- test/kat-app/direct_api_test.c | 461 +-- test/kat-app/do_test.h | 136 +- test/kat-app/ecb_test.c | 104 +- test/kat-app/ecb_test.json.c | 465 ++- test/kat-app/gcm_ctr_vectors_test.h | 62 +- test/kat-app/gcm_test.c | 1089 +++--- test/kat-app/gcm_test.json.c | 585 ++-- test/kat-app/ghash_test.c | 158 +- test/kat-app/ghash_test.json.c | 37 +- test/kat-app/gmac_test.c | 112 +- test/kat-app/gmac_test.json.c | 81 +- test/kat-app/hec_test.c | 47 +- test/kat-app/hmac_md5.json.c | 197 +- test/kat-app/hmac_md5_test.c | 70 +- test/kat-app/hmac_sha1.json.c | 158 +- test/kat-app/hmac_sha1_test.c | 145 +- test/kat-app/hmac_sha224.json.c | 3 +- test/kat-app/hmac_sha256.json.c | 3 +- test/kat-app/hmac_sha256_sha512_test.c | 166 +- test/kat-app/hmac_sha384.json.c | 11 +- test/kat-app/hmac_sha512.json.c | 3 +- test/kat-app/kasumi_test.c | 695 ++-- test/kat-app/kasumi_test_vectors.h | 2019 ++++++----- test/kat-app/main.c | 403 +-- test/kat-app/null_test.c | 52 +- test/kat-app/poly1305_test.c | 71 +- test/kat-app/poly1305_test.json.c | 254 +- test/kat-app/pon_test.c | 370 +- test/kat-app/quic_chacha20_test.c | 96 +- test/kat-app/quic_ecb_test.c | 133 +- test/kat-app/sha_test.c | 72 +- test/kat-app/snow3g_test.c | 812 ++--- test/kat-app/snow3g_test_f8_vectors.json.c | 732 ++-- test/kat-app/snow3g_test_f9_vectors.json.c | 308 +- test/kat-app/snow_v_test.c | 1355 +++----- test/kat-app/xcbc_test.c | 72 +- test/kat-app/zuc_test.c | 723 ++-- test/kat-app/zuc_test_vectors.h | 2654 ++++++--------- test/wycheproof-app/aes_ccm_test.json.c | 1929 ++++------- test/wycheproof-app/aes_cmac_test.json.c | 1347 +++----- test/wycheproof-app/aes_gcm_test.json.c | 1280 +++---- .../chacha20_poly1305_test.json.c | 1382 +++----- test/wycheproof-app/gmac_test.json.c | 2631 ++++++--------- test/wycheproof-app/hmac_sha1_test.json.c | 31 +- test/wycheproof-app/hmac_sha224_test.json.c | 278 +- test/wycheproof-app/hmac_sha256_test.json.c | 316 +- test/wycheproof-app/wycheproof.c | 369 +- test/xvalid-app/ipsec_xvalid.c | 1250 +++---- test/xvalid-app/misc.h | 67 +- 82 files changed, 15677 insertions(+), 22617 deletions(-) diff --git a/test/acvp-app/acvp_app_main.c b/test/acvp-app/acvp_app_main.c index e98ee13b..b59c4d92 100644 --- a/test/acvp-app/acvp_app_main.c +++ b/test/acvp-app/acvp_app_main.c @@ -36,7 +36,8 @@ #define MAX_TAG_LENGTH 16 -static ACVP_RESULT logger(char *msg) +static ACVP_RESULT +logger(char *msg) { printf("%s", msg); return ACVP_SUCCESS; @@ -46,12 +47,13 @@ IMB_MGR *mb_mgr = NULL; int verbose = 0; int direct_api = 0; /* job API by default */ -static int aes_cbc_handler(ACVP_TEST_CASE *test_case) +static int +aes_cbc_handler(ACVP_TEST_CASE *test_case) { ACVP_SYM_CIPHER_TC *tc; IMB_JOB *job = NULL; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); static uint8_t next_iv[16]; if (test_case == NULL) @@ -88,8 +90,7 @@ static int aes_cbc_handler(ACVP_TEST_CASE *test_case) * If Monte-carlo test, use the IV from the ciphertext of * the previous iteration */ - if (tc->test_type == ACVP_SYM_TEST_TYPE_MCT && - tc->mct_index != 0) + if (tc->test_type == ACVP_SYM_TEST_TYPE_MCT && tc->mct_index != 0) job->iv = next_iv; else job->iv = tc->iv; @@ -140,12 +141,13 @@ static int aes_cbc_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int aes_ecb_handler(ACVP_TEST_CASE *test_case) +static int +aes_ecb_handler(ACVP_TEST_CASE *test_case) { ACVP_SYM_CIPHER_TC *tc; IMB_JOB *job = NULL; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (test_case == NULL) return ACVP_CRYPTO_MODULE_FAIL; @@ -222,17 +224,16 @@ static int aes_ecb_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int aes_gcm_handler(ACVP_TEST_CASE *test_case) +static int +aes_gcm_handler(ACVP_TEST_CASE *test_case) { ACVP_SYM_CIPHER_TC *tc; IMB_JOB *job = NULL; aes_gcm_init_var_iv_t gcm_init_var_iv = mb_mgr->gcm128_init_var_iv; aes_gcm_enc_dec_update_t gcm_update_enc = mb_mgr->gcm128_enc_update; - aes_gcm_enc_dec_finalize_t gcm_finalize_enc = - mb_mgr->gcm128_enc_finalize; + aes_gcm_enc_dec_finalize_t gcm_finalize_enc = mb_mgr->gcm128_enc_finalize; aes_gcm_enc_dec_update_t gcm_update_dec = mb_mgr->gcm128_dec_update; - aes_gcm_enc_dec_finalize_t gcm_finalize_dec = - mb_mgr->gcm128_dec_finalize; + aes_gcm_enc_dec_finalize_t gcm_finalize_dec = mb_mgr->gcm128_dec_finalize; struct gcm_key_data key; struct gcm_context_data ctx; @@ -302,12 +303,9 @@ static int aes_gcm_handler(ACVP_TEST_CASE *test_case) if (tc->direction == ACVP_SYM_CIPH_DIR_ENCRYPT) { if (direct_api == 1) { - gcm_init_var_iv(&key, &ctx, tc->iv, tc->iv_len, - tc->aad, tc->aad_len); - gcm_update_enc(&key, &ctx, tc->ct, - tc->pt, tc->pt_len); - gcm_finalize_enc(&key, &ctx, tc->tag, - tc->tag_len); + gcm_init_var_iv(&key, &ctx, tc->iv, tc->iv_len, tc->aad, tc->aad_len); + gcm_update_enc(&key, &ctx, tc->ct, tc->pt, tc->pt_len); + gcm_finalize_enc(&key, &ctx, tc->tag, tc->tag_len); } else { job->src = tc->pt; job->dst = tc->ct; @@ -326,15 +324,12 @@ static int aes_gcm_handler(ACVP_TEST_CASE *test_case) } } } else /* DECRYPT */ { - uint8_t res_tag[MAX_TAG_LENGTH] = {0}; + uint8_t res_tag[MAX_TAG_LENGTH] = { 0 }; if (direct_api == 1) { - gcm_init_var_iv(&key, &ctx, tc->iv, tc->iv_len, - tc->aad, tc->aad_len); - gcm_update_dec(&key, &ctx, tc->pt, - tc->ct, tc->ct_len); - gcm_finalize_dec(&key, &ctx, - res_tag, tc->tag_len); + gcm_init_var_iv(&key, &ctx, tc->iv, tc->iv_len, tc->aad, tc->aad_len); + gcm_update_dec(&key, &ctx, tc->pt, tc->ct, tc->ct_len); + gcm_finalize_dec(&key, &ctx, res_tag, tc->tag_len); } else { job->src = tc->ct; job->dst = tc->pt; @@ -354,10 +349,8 @@ static int aes_gcm_handler(ACVP_TEST_CASE *test_case) } if (memcmp(res_tag, tc->tag, tc->tag_len) != 0) { if (verbose) { - hexdump(stdout, "result tag: ", - res_tag, tc->tag_len); - hexdump(stdout, "reference tag: ", - tc->tag, tc->tag_len); + hexdump(stdout, "result tag: ", res_tag, tc->tag_len); + hexdump(stdout, "reference tag: ", tc->tag, tc->tag_len); fprintf(stderr, "Tag mismatch\n"); } return ACVP_CRYPTO_MODULE_FAIL; @@ -366,7 +359,8 @@ static int aes_gcm_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int aes_gmac_handler(ACVP_TEST_CASE *test_case) +static int +aes_gmac_handler(ACVP_TEST_CASE *test_case) { ACVP_SYM_CIPHER_TC *tc; IMB_JOB *job = NULL; @@ -441,8 +435,7 @@ static int aes_gmac_handler(ACVP_TEST_CASE *test_case) if (direct_api == 1) { gmac_init_var(&key, &ctx, tc->iv, tc->iv_len); gmac_update(&key, &ctx, tc->aad, tc->aad_len); - gmac_finalize(&key, &ctx, tc->tag, - tc->tag_len); + gmac_finalize(&key, &ctx, tc->tag, tc->tag_len); } else { job->src = tc->aad; job->msg_len_to_hash_in_bytes = tc->aad_len; @@ -459,7 +452,7 @@ static int aes_gmac_handler(ACVP_TEST_CASE *test_case) } } } else /* DECRYPT */ { - uint8_t res_tag[MAX_TAG_LENGTH] = {0}; + uint8_t res_tag[MAX_TAG_LENGTH] = { 0 }; if (direct_api == 1) { gmac_init_var(&key, &ctx, tc->iv, tc->iv_len); @@ -482,10 +475,8 @@ static int aes_gmac_handler(ACVP_TEST_CASE *test_case) } if (memcmp(res_tag, tc->tag, tc->tag_len) != 0) { if (verbose) { - hexdump(stdout, "result tag: ", - res_tag, tc->tag_len); - hexdump(stdout, "reference tag: ", - tc->tag, tc->tag_len); + hexdump(stdout, "result tag: ", res_tag, tc->tag_len); + hexdump(stdout, "reference tag: ", tc->tag, tc->tag_len); fprintf(stderr, "Tag mismatch\n"); } return ACVP_CRYPTO_MODULE_FAIL; @@ -494,12 +485,13 @@ static int aes_gmac_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int aes_ctr_handler(ACVP_TEST_CASE *test_case) +static int +aes_ctr_handler(ACVP_TEST_CASE *test_case) { ACVP_SYM_CIPHER_TC *tc; IMB_JOB *job = NULL; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (test_case == NULL) return ACVP_CRYPTO_MODULE_FAIL; @@ -572,7 +564,8 @@ static int aes_ctr_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int tdes_cbc_handler(ACVP_TEST_CASE *test_case) +static int +tdes_cbc_handler(ACVP_TEST_CASE *test_case) { ACVP_SYM_CIPHER_TC *tc; IMB_JOB *job = NULL; @@ -645,8 +638,7 @@ static int tdes_cbc_handler(ACVP_TEST_CASE *test_case) job->iv = tc->iv; - if (tc->test_type == ACVP_SYM_TEST_TYPE_MCT && - tc->direction == ACVP_SYM_CIPH_DIR_DECRYPT && + if (tc->test_type == ACVP_SYM_TEST_TYPE_MCT && tc->direction == ACVP_SYM_CIPH_DIR_DECRYPT && tc->mct_index != 0) job->iv = next_iv; @@ -695,13 +687,14 @@ static int tdes_cbc_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int aes_ccm_handler(ACVP_TEST_CASE *test_case) +static int +aes_ccm_handler(ACVP_TEST_CASE *test_case) { ACVP_SYM_CIPHER_TC *tc; IMB_JOB *job = NULL; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); - uint8_t res_tag[MAX_TAG_LENGTH] = {0}; + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); + uint8_t res_tag[MAX_TAG_LENGTH] = { 0 }; if (test_case == NULL) return ACVP_CRYPTO_MODULE_FAIL; @@ -779,10 +772,8 @@ static int aes_ccm_handler(ACVP_TEST_CASE *test_case) if (memcmp(res_tag, ref_tag, tc->tag_len) != 0) { if (verbose) { - hexdump(stdout, "result tag: ", - res_tag, tc->tag_len); - hexdump(stdout, "reference tag: ", - ref_tag, tc->tag_len); + hexdump(stdout, "result tag: ", res_tag, tc->tag_len); + hexdump(stdout, "reference tag: ", ref_tag, tc->tag_len); fprintf(stderr, "Tag mismatch\n"); } return ACVP_CRYPTO_MODULE_FAIL; @@ -791,14 +782,15 @@ static int aes_ccm_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int aes_cmac_handler(ACVP_TEST_CASE *test_case) +static int +aes_cmac_handler(ACVP_TEST_CASE *test_case) { ACVP_CMAC_TC *tc; IMB_JOB *job = NULL; - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint32_t skey1[4], skey2[4]; - uint8_t res_tag[MAX_TAG_LENGTH] = {0}; + uint8_t res_tag[MAX_TAG_LENGTH] = { 0 }; if (test_case == NULL) return ACVP_CRYPTO_MODULE_FAIL; @@ -853,10 +845,8 @@ static int aes_cmac_handler(ACVP_TEST_CASE *test_case) if (tc->verify == 1) { if (memcmp(res_tag, tc->mac, tc->mac_len) != 0) { if (verbose) { - hexdump(stdout, "result tag: ", - res_tag, (tc->mac_len)); - hexdump(stdout, "reference tag: ", - tc->mac, tc->mac_len); + hexdump(stdout, "result tag: ", res_tag, (tc->mac_len)); + hexdump(stdout, "reference tag: ", tc->mac, tc->mac_len); fprintf(stderr, "Tag mismatch\n"); } tc->ver_disposition = ACVP_TEST_DISPOSITION_FAIL; @@ -866,7 +856,8 @@ static int aes_cmac_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int hmac_sha1_handler(ACVP_TEST_CASE *test_case) +static int +hmac_sha1_handler(ACVP_TEST_CASE *test_case) { ACVP_HMAC_TC *tc; IMB_JOB *job = NULL; @@ -878,8 +869,7 @@ static int hmac_sha1_handler(ACVP_TEST_CASE *test_case) tc = test_case->tc.hmac; - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - tc->key, tc->key_len, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, tc->key, tc->key_len, ipad_hash, opad_hash); job = IMB_GET_NEXT_JOB(mb_mgr); job->key_len_in_bytes = tc->key_len; @@ -895,7 +885,7 @@ static int hmac_sha1_handler(ACVP_TEST_CASE *test_case) /* * The library only supports 12 or 20-byte tags and therefore, * we are outputting 20 bytes always - */ + */ job->auth_tag_output_len_in_bytes = IMB_SHA1_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->mac; @@ -909,7 +899,8 @@ static int hmac_sha1_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int hmac_sha256_handler(ACVP_TEST_CASE *test_case) +static int +hmac_sha256_handler(ACVP_TEST_CASE *test_case) { ACVP_HMAC_TC *tc; IMB_JOB *job = NULL; @@ -921,8 +912,8 @@ static int hmac_sha256_handler(ACVP_TEST_CASE *test_case) tc = test_case->tc.hmac; - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_256, - tc->key, tc->key_len, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_256, tc->key, tc->key_len, ipad_hash, + opad_hash); job = IMB_GET_NEXT_JOB(mb_mgr); job->key_len_in_bytes = tc->key_len; @@ -938,7 +929,7 @@ static int hmac_sha256_handler(ACVP_TEST_CASE *test_case) /* * The library only supports 16 or 32-byte tags and therefore, * we are outputting 32 bytes always - */ + */ job->auth_tag_output_len_in_bytes = IMB_SHA256_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->mac; @@ -952,7 +943,8 @@ static int hmac_sha256_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int hmac_sha224_handler(ACVP_TEST_CASE *test_case) +static int +hmac_sha224_handler(ACVP_TEST_CASE *test_case) { ACVP_HMAC_TC *tc; IMB_JOB *job = NULL; @@ -964,8 +956,8 @@ static int hmac_sha224_handler(ACVP_TEST_CASE *test_case) tc = test_case->tc.hmac; - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_224, - tc->key, tc->key_len, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_224, tc->key, tc->key_len, ipad_hash, + opad_hash); job = IMB_GET_NEXT_JOB(mb_mgr); job->key_len_in_bytes = tc->key_len; @@ -981,7 +973,7 @@ static int hmac_sha224_handler(ACVP_TEST_CASE *test_case) /* * The library only supports 14 or 28-byte tags and therefore, * we are outputting 28 bytes always - */ + */ job->auth_tag_output_len_in_bytes = IMB_SHA224_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->mac; @@ -995,7 +987,8 @@ static int hmac_sha224_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int hmac_sha384_handler(ACVP_TEST_CASE *test_case) +static int +hmac_sha384_handler(ACVP_TEST_CASE *test_case) { ACVP_HMAC_TC *tc; IMB_JOB *job = NULL; @@ -1007,8 +1000,8 @@ static int hmac_sha384_handler(ACVP_TEST_CASE *test_case) tc = test_case->tc.hmac; - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_384, - tc->key, tc->key_len, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_384, tc->key, tc->key_len, ipad_hash, + opad_hash); job = IMB_GET_NEXT_JOB(mb_mgr); job->key_len_in_bytes = tc->key_len; @@ -1024,7 +1017,7 @@ static int hmac_sha384_handler(ACVP_TEST_CASE *test_case) /* * The library only supports 24 or 48-byte tags and therefore, * we are outputting 48 bytes always - */ + */ job->auth_tag_output_len_in_bytes = IMB_SHA384_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->mac; @@ -1038,7 +1031,8 @@ static int hmac_sha384_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int hmac_sha512_handler(ACVP_TEST_CASE *test_case) +static int +hmac_sha512_handler(ACVP_TEST_CASE *test_case) { ACVP_HMAC_TC *tc; IMB_JOB *job = NULL; @@ -1050,8 +1044,8 @@ static int hmac_sha512_handler(ACVP_TEST_CASE *test_case) tc = test_case->tc.hmac; - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_512, - tc->key, tc->key_len, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_512, tc->key, tc->key_len, ipad_hash, + opad_hash); job = IMB_GET_NEXT_JOB(mb_mgr); job->key_len_in_bytes = tc->key_len; @@ -1067,7 +1061,7 @@ static int hmac_sha512_handler(ACVP_TEST_CASE *test_case) /* * The library only supports 32 or 64-byte tags and therefore, * we are outputting 64 bytes always - */ + */ job->auth_tag_output_len_in_bytes = IMB_SHA512_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->mac; @@ -1081,7 +1075,8 @@ static int hmac_sha512_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int sha1_handler(ACVP_TEST_CASE *test_case) +static int +sha1_handler(ACVP_TEST_CASE *test_case) { ACVP_HASH_TC *tc; IMB_JOB *job = NULL; @@ -1121,8 +1116,7 @@ static int sha1_handler(ACVP_TEST_CASE *test_case) job->hash_start_src_offset_in_bytes = 0; job->src = m; job->msg_len_to_hash_in_bytes = len; - job->auth_tag_output_len_in_bytes = - IMB_SHA1_DIGEST_SIZE_IN_BYTES; + job->auth_tag_output_len_in_bytes = IMB_SHA1_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->md; job = IMB_SUBMIT_JOB(mb_mgr); @@ -1139,7 +1133,8 @@ static int sha1_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int sha2_224_handler(ACVP_TEST_CASE *test_case) +static int +sha2_224_handler(ACVP_TEST_CASE *test_case) { ACVP_HASH_TC *tc; IMB_JOB *job = NULL; @@ -1179,8 +1174,7 @@ static int sha2_224_handler(ACVP_TEST_CASE *test_case) job->hash_start_src_offset_in_bytes = 0; job->src = m; job->msg_len_to_hash_in_bytes = len; - job->auth_tag_output_len_in_bytes = - IMB_SHA224_DIGEST_SIZE_IN_BYTES; + job->auth_tag_output_len_in_bytes = IMB_SHA224_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->md; job = IMB_SUBMIT_JOB(mb_mgr); @@ -1197,7 +1191,8 @@ static int sha2_224_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int sha2_256_handler(ACVP_TEST_CASE *test_case) +static int +sha2_256_handler(ACVP_TEST_CASE *test_case) { ACVP_HASH_TC *tc; IMB_JOB *job = NULL; @@ -1237,8 +1232,7 @@ static int sha2_256_handler(ACVP_TEST_CASE *test_case) job->hash_start_src_offset_in_bytes = 0; job->src = m; job->msg_len_to_hash_in_bytes = len; - job->auth_tag_output_len_in_bytes = - IMB_SHA256_DIGEST_SIZE_IN_BYTES; + job->auth_tag_output_len_in_bytes = IMB_SHA256_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->md; job = IMB_SUBMIT_JOB(mb_mgr); @@ -1255,7 +1249,8 @@ static int sha2_256_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int sha2_384_handler(ACVP_TEST_CASE *test_case) +static int +sha2_384_handler(ACVP_TEST_CASE *test_case) { ACVP_HASH_TC *tc; IMB_JOB *job = NULL; @@ -1295,8 +1290,7 @@ static int sha2_384_handler(ACVP_TEST_CASE *test_case) job->hash_start_src_offset_in_bytes = 0; job->src = m; job->msg_len_to_hash_in_bytes = len; - job->auth_tag_output_len_in_bytes = - IMB_SHA384_DIGEST_SIZE_IN_BYTES; + job->auth_tag_output_len_in_bytes = IMB_SHA384_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->md; job = IMB_SUBMIT_JOB(mb_mgr); @@ -1313,7 +1307,8 @@ static int sha2_384_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static int sha2_512_handler(ACVP_TEST_CASE *test_case) +static int +sha2_512_handler(ACVP_TEST_CASE *test_case) { ACVP_HASH_TC *tc; IMB_JOB *job = NULL; @@ -1353,8 +1348,7 @@ static int sha2_512_handler(ACVP_TEST_CASE *test_case) job->hash_start_src_offset_in_bytes = 0; job->src = m; job->msg_len_to_hash_in_bytes = len; - job->auth_tag_output_len_in_bytes = - IMB_SHA512_DIGEST_SIZE_IN_BYTES; + job->auth_tag_output_len_in_bytes = IMB_SHA512_DIGEST_SIZE_IN_BYTES; job->auth_tag_output = tc->md; job = IMB_SUBMIT_JOB(mb_mgr); @@ -1371,9 +1365,11 @@ static int sha2_512_handler(ACVP_TEST_CASE *test_case) return ACVP_SUCCESS; } -static void usage(const char *app_name) +static void +usage(const char *app_name) { - fprintf(stderr, "Usage: %s --req FILENAME --resp FILENAME [opt args], " + fprintf(stderr, + "Usage: %s --req FILENAME --resp FILENAME [opt args], " "where args are two or more\n" "--req FILENAME: request file in JSON format (required)\n" "--resp FILENAME: response file in JSON format (required)\n" @@ -1385,7 +1381,8 @@ static void usage(const char *app_name) app_name, app_name); } -int main(int argc, char **argv) +int +main(int argc, char **argv) { ACVP_RESULT acvp_ret = ACVP_SUCCESS; ACVP_CTX *ctx = NULL; @@ -1409,23 +1406,20 @@ int main(int argc, char **argv) req_filename = realpath(argv[i + 1], NULL); if (req_filename == NULL) { - fprintf(stderr, - "Request file does not exist\n"); + fprintf(stderr, "Request file does not exist\n"); goto exit; } i++; } else if (strcmp(argv[i], "--resp") == 0) { if (argv[i + 1] == NULL) { - fprintf(stderr, - "Missing argument for --resp\n"); + fprintf(stderr, "Missing argument for --resp\n"); goto exit; } resp_filename = argv[i + 1]; i++; } else if (strcmp(argv[i], "--arch") == 0) { if (argv[i + 1] == NULL) { - fprintf(stderr, - "Missing argument for --arch\n"); + fprintf(stderr, "Missing argument for --arch\n"); goto exit; } if (strcmp(argv[i + 1], "SSE") == 0) @@ -1477,76 +1471,58 @@ int main(int argc, char **argv) if (acvp_ret != ACVP_SUCCESS) goto exit; - if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_GCM, - &aes_gcm_handler) != ACVP_SUCCESS) + if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_GCM, &aes_gcm_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_CBC, - &aes_cbc_handler) != ACVP_SUCCESS) + if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_CBC, &aes_cbc_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_ECB, - &aes_ecb_handler) != ACVP_SUCCESS) + if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_ECB, &aes_ecb_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_CTR, - &aes_ctr_handler) != ACVP_SUCCESS) + if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_CTR, &aes_ctr_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_GMAC, - &aes_gmac_handler) != ACVP_SUCCESS) + if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_GMAC, &aes_gmac_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_sym_cipher_enable(ctx, ACVP_TDES_CBC, - &tdes_cbc_handler) != ACVP_SUCCESS) + if (acvp_cap_sym_cipher_enable(ctx, ACVP_TDES_CBC, &tdes_cbc_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_CCM, - &aes_ccm_handler) != ACVP_SUCCESS) + if (acvp_cap_sym_cipher_enable(ctx, ACVP_AES_CCM, &aes_ccm_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_cmac_enable(ctx, ACVP_CMAC_AES, - &aes_cmac_handler) != ACVP_SUCCESS) + if (acvp_cap_cmac_enable(ctx, ACVP_CMAC_AES, &aes_cmac_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA1, - &hmac_sha1_handler) != ACVP_SUCCESS) + if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA1, &hmac_sha1_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_256, - &hmac_sha256_handler) != ACVP_SUCCESS) + if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_256, &hmac_sha256_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_224, - &hmac_sha224_handler) != ACVP_SUCCESS) + if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_224, &hmac_sha224_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_384, - &hmac_sha384_handler) != ACVP_SUCCESS) + if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_384, &hmac_sha384_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_512, - &hmac_sha512_handler) != ACVP_SUCCESS) + if (acvp_cap_hmac_enable(ctx, ACVP_HMAC_SHA2_512, &hmac_sha512_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA1, - &sha1_handler) != ACVP_SUCCESS) + if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA1, &sha1_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA224, - &sha2_224_handler) != ACVP_SUCCESS) + if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA224, &sha2_224_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA256, - &sha2_256_handler) != ACVP_SUCCESS) + if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA256, &sha2_256_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA384, - &sha2_384_handler) != ACVP_SUCCESS) + if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA384, &sha2_384_handler) != ACVP_SUCCESS) goto exit; - if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA512, - &sha2_512_handler) != ACVP_SUCCESS) + if (acvp_cap_hash_enable(ctx, ACVP_HASH_SHA512, &sha2_512_handler) != ACVP_SUCCESS) goto exit; /* Allocate and initialize MB_MGR */ @@ -1612,7 +1588,7 @@ exit: free_mb_mgr(mb_mgr); if (ctx != NULL) - acvp_free_test_session(ctx); + acvp_free_test_session(ctx); if (req_filename != NULL) free(req_filename); diff --git a/test/common/utils.c b/test/common/utils.c index 29a3519f..401f11d6 100644 --- a/test/common/utils.c +++ b/test/common/utils.c @@ -48,7 +48,8 @@ int quiet_mode = 0; * @param src source buffer pointer * @param length length of the buffer to copy in bytes */ -void memory_copy(void *dst, const void *src, size_t length) +void +memory_copy(void *dst, const void *src, size_t length) { uint8_t *d = (uint8_t *) dst; const uint8_t *s = (const uint8_t *) src; @@ -64,7 +65,8 @@ void memory_copy(void *dst, const void *src, size_t length) * @param val value to set each byte in destination buffer * @param length length of the buffer to copy in bytes */ -void memory_set(void *dst, const int val, size_t length) +void +memory_set(void *dst, const int val, size_t length) { uint8_t *d = (uint8_t *) dst; @@ -88,11 +90,7 @@ void memory_set(void *dst, const int val, size_t length) * - NULL pointer then first column witll display indexes */ void -hexdump_ex(FILE *fp, - const char *msg, - const void *p, - size_t len, - const void *start_ptr) +hexdump_ex(FILE *fp, const char *msg, const void *p, size_t len, const void *start_ptr) { static uint8_t hex_buffer[16 * 1024]; size_t ofs = 0; @@ -146,10 +144,7 @@ hexdump_ex(FILE *fp, * @param len size of the data block to dump in bytes */ void -hexdump(FILE *fp, - const char *msg, - const void *p, - size_t len) +hexdump(FILE *fp, const char *msg, const void *p, size_t len) { hexdump_ex(fp, msg, p, len, NULL); } @@ -168,9 +163,7 @@ hexdump(FILE *fp, * @retval -1 argument error */ int -update_flags_and_archs(const char *arg, - uint8_t arch_support[IMB_ARCH_NUM], - uint64_t *flags) +update_flags_and_archs(const char *arg, uint8_t arch_support[IMB_ARCH_NUM], uint64_t *flags) { int match = 1; @@ -228,10 +221,8 @@ int detect_arch(uint8_t arch_support[IMB_ARCH_NUM]) { #ifndef __aarch64__ - const uint64_t detect_sse = - IMB_FEATURE_SSE4_2 | IMB_FEATURE_CMOV | IMB_FEATURE_AESNI; - const uint64_t detect_avx = - IMB_FEATURE_AVX | IMB_FEATURE_CMOV | IMB_FEATURE_AESNI; + const uint64_t detect_sse = IMB_FEATURE_SSE4_2 | IMB_FEATURE_CMOV | IMB_FEATURE_AESNI; + const uint64_t detect_avx = IMB_FEATURE_AVX | IMB_FEATURE_CMOV | IMB_FEATURE_AESNI; const uint64_t detect_avx2 = IMB_FEATURE_AVX2 | detect_avx; const uint64_t detect_avx512 = IMB_FEATURE_AVX512_SKX | detect_avx2; const uint64_t detect_noaesni = IMB_FEATURE_SSE4_2 | IMB_FEATURE_CMOV; @@ -286,10 +277,9 @@ detect_arch(uint8_t arch_support[IMB_ARCH_NUM]) if (arch_support[IMB_ARCH_NOAESNI] == 0 && #ifndef __aarch64__ - arch_support[IMB_ARCH_SSE] == 0 && - arch_support[IMB_ARCH_AVX] == 0 && - arch_support[IMB_ARCH_AVX2] == 0 && - arch_support[IMB_ARCH_AVX512] == 0) { + arch_support[IMB_ARCH_SSE] == 0 && arch_support[IMB_ARCH_AVX] == 0 && + arch_support[IMB_ARCH_AVX2] == 0 && arch_support[IMB_ARCH_AVX512] == 0) { + #else arch_support[IMB_ARCH_AARCH64] == 0 && arch_support[IMB_ARCH_SVE256] == 0) { @@ -332,8 +322,7 @@ print_tested_arch(const uint64_t features, const IMB_ARCH arch) } break; case IMB_ARCH_AVX512: - if ((features & IMB_FEATURE_VAES) && - (features & IMB_FEATURE_GFNI) && + if ((features & IMB_FEATURE_VAES) && (features & IMB_FEATURE_GFNI) && (features & IMB_FEATURE_VPCLMULQDQ)) feat = "-VAES-GFNI-VCLMUL"; break; @@ -348,11 +337,8 @@ print_tested_arch(const uint64_t features, const IMB_ARCH arch) return; } - printf("[INFO] [ARCH] using %s interface [%s%s]\n", - arch_str_tab[arch], - arch_str_tab[arch], - feat); - + printf("[INFO] [ARCH] using %s interface [%s%s]\n", arch_str_tab[arch], arch_str_tab[arch], + feat); } /* =================================================================== */ @@ -368,8 +354,7 @@ print_tested_arch(const uint64_t features, const IMB_ARCH arch) * @param alg_name name of the algorithm being tested */ void -test_suite_start(struct test_suite_context *ctx, - const char *alg_name) +test_suite_start(struct test_suite_context *ctx, const char *alg_name) { assert(ctx != NULL); assert(alg_name != NULL); @@ -388,9 +373,7 @@ test_suite_start(struct test_suite_context *ctx, * @param failed number of tests that failed */ void -test_suite_update(struct test_suite_context *ctx, - const unsigned passed, - const unsigned failed) +test_suite_update(struct test_suite_context *ctx, const unsigned passed, const unsigned failed) { assert(ctx != NULL); @@ -409,7 +392,8 @@ test_suite_update(struct test_suite_context *ctx, * @retval 0 all tests passed * @retval >0 failed tests detected, returning number of fails */ -int test_suite_end(struct test_suite_context *ctx) +int +test_suite_end(struct test_suite_context *ctx) { const char *result = "PASS"; int ret = 0; @@ -440,11 +424,12 @@ generate_random_buf(uint8_t *buf, const uint32_t length) } /** Compare two buffers at bit-level */ -int membitcmp(const uint8_t *input, const uint8_t *output, - const uint32_t bitlength, const uint32_t bitoffset) +int +membitcmp(const uint8_t *input, const uint8_t *output, const uint32_t bitlength, + const uint32_t bitoffset) { uint32_t bitresoffset; - const uint8_t bitresMask = ~((uint8_t)-1 << (8 - (bitoffset % 8))); + const uint8_t bitresMask = ~((uint8_t) -1 << (8 - (bitoffset % 8))); uint32_t res = 0; uint32_t bytelengthfl = bitlength / 8; const uint8_t *buf1fl = input + bitoffset / 8; @@ -467,7 +452,7 @@ int membitcmp(const uint8_t *input, const uint8_t *output, index++; } if ((bitresoffset) && (0 == bytelengthfl)) { - res &= (uint8_t)-1 << (8 - bitresoffset); + res &= (uint8_t) -1 << (8 - bitresoffset); if (res) return index; } diff --git a/test/fuzz-app/direct_api_fuzz_test.c b/test/fuzz-app/direct_api_fuzz_test.c index 91b4bd1d..73d40d3b 100644 --- a/test/fuzz-app/direct_api_fuzz_test.c +++ b/test/fuzz-app/direct_api_fuzz_test.c @@ -36,18 +36,16 @@ #include #include "utils.h" -int LLVMFuzzerTestOneInput(const uint8_t *, size_t); -int LLVMFuzzerInitialize(int *, char ***); +int +LLVMFuzzerTestOneInput(const uint8_t *, size_t); +int +LLVMFuzzerInitialize(int *, char ***); enum ar { #ifndef __aarch64__ - SSE = 1, - AVX, - AVX2, - AVX512 + SSE = 1, AVX, AVX2, AVX512 #else - AARCH64 = 1, - SVE256 + AARCH64 = 1, SVE256 #endif }; @@ -55,7 +53,8 @@ enum ar arch; int count = 8; -static void parse_matched(int argc, char **argv) +static void +parse_matched(int argc, char **argv) { int i; @@ -78,7 +77,8 @@ static void parse_matched(int argc, char **argv) } } -int LLVMFuzzerInitialize(int *argc, char ***argv) +int +LLVMFuzzerInitialize(int *argc, char ***argv) { int i; @@ -101,8 +101,8 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) return 0; } -static void test_snow3g_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *init_key = buff; snow3g_key_schedule_t exp_key_s; @@ -114,8 +114,8 @@ static void test_snow3g_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, IMB_SNOW3G_INIT_KEY_SCHED(p_mgr, init_key, exp_key); } -static void test_snow3g_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -129,13 +129,13 @@ static void test_snow3g_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, len = len * 8; const uint8_t *iv = buff; - const uint32_t offset = *(uint32_t *)buff; + const uint32_t offset = *(uint32_t *) buff; IMB_SNOW3G_F8_1_BUFFER_BIT(p_mgr, exp_key, iv, in, out, len, offset); } -static void test_snow3g_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -151,8 +151,8 @@ static void test_snow3g_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, IMB_SNOW3G_F8_1_BUFFER(p_mgr, exp_key, iv, in, out, len); } -static void test_snow3g_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -165,12 +165,11 @@ static void test_snow3g_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, uint64_t len = dataSize; const uint8_t *iv = buff; - IMB_SNOW3G_F8_2_BUFFER(p_mgr, exp_key, iv, iv, in, - out, len, in, out, len); + IMB_SNOW3G_F8_2_BUFFER(p_mgr, exp_key, iv, iv, in, out, len, in, out, len); } -static void test_snow3g_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -183,14 +182,12 @@ static void test_snow3g_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, uint64_t len = dataSize; const uint8_t *iv = buff; - IMB_SNOW3G_F8_4_BUFFER(p_mgr, exp_key, iv, iv, iv, - iv, in, out, len, in, out, - len, in, out, len, - in, out, len); + IMB_SNOW3G_F8_4_BUFFER(p_mgr, exp_key, iv, iv, iv, iv, in, out, len, in, out, len, in, out, + len, in, out, len); } -static void test_snow3g_f8_8_buff(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_8_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -203,17 +200,13 @@ static void test_snow3g_f8_8_buff(IMB_MGR *p_mgr, uint8_t *buff, uint64_t len = dataSize; const uint8_t *iv = buff; - IMB_SNOW3G_F8_8_BUFFER(p_mgr, exp_key, iv, iv, iv, - iv, iv, iv, iv, iv, - in, out, len, in, out, len, - in, out, len, - in, out, len, in, out, - len, in, out, len, in, + IMB_SNOW3G_F8_8_BUFFER(p_mgr, exp_key, iv, iv, iv, iv, iv, iv, iv, iv, in, out, len, in, + out, len, in, out, len, in, out, len, in, out, len, in, out, len, in, out, len, in, out, len); } -static void test_snow3g_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -236,8 +229,8 @@ static void test_snow3g_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, IMB_SNOW3G_F8_N_BUFFER(p_mgr, exp_key, iv, in, out, len, count); } -static void test_snow3g_f8_8_multikey(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_8_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -260,8 +253,8 @@ static void test_snow3g_f8_8_multikey(IMB_MGR *p_mgr, uint8_t *buff, IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(p_mgr, &exp_key, iv, in, out, len); } -static void test_snow3g_f8_n_multikey(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f8_n_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -281,12 +274,11 @@ static void test_snow3g_f8_n_multikey(IMB_MGR *p_mgr, uint8_t *buff, len[i] = dataSize; } - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(p_mgr, &exp_key, iv, in, out, len, - count); + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(p_mgr, &exp_key, iv, in, out, len, count); } -static void test_snow3g_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_snow3g_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const snow3g_key_schedule_t exp_key_s; const snow3g_key_schedule_t *exp_key = &exp_key_s; @@ -303,14 +295,15 @@ static void test_snow3g_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, } #ifndef __aarch64__ -static void test_aes128_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_aes128_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -320,19 +313,18 @@ static void test_aes128_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint8_t *auth_tag = buff; uint64_t tag_len = (uint64_t) *buff; - - IMB_AES128_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, - aad_len, auth_tag, tag_len); + IMB_AES128_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); } -static void test_aes128_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_aes128_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -342,18 +334,18 @@ static void test_aes128_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint8_t *auth_tag = buff; uint64_t tag_len = (uint64_t) *buff; - IMB_AES128_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, - aad_len, auth_tag, tag_len); + IMB_AES128_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); } -static void test_aes192_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_aes192_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -363,18 +355,18 @@ static void test_aes192_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint8_t *auth_tag = buff; uint64_t tag_len = (uint64_t) *buff; - IMB_AES192_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, - aad_len, auth_tag, tag_len); + IMB_AES192_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); } -static void test_aes192_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_aes192_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -384,18 +376,18 @@ static void test_aes192_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint8_t *auth_tag = buff; uint64_t tag_len = (uint64_t) *buff; - IMB_AES192_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, - aad_len, auth_tag, tag_len); + IMB_AES192_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); } -static void test_aes256_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_aes256_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -405,18 +397,18 @@ static void test_aes256_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint8_t *auth_tag = buff; uint64_t tag_len = (uint64_t) *buff; - IMB_AES256_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, - aad_len, auth_tag, tag_len); + IMB_AES256_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); } -static void test_aes256_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_aes256_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -426,19 +418,18 @@ static void test_aes256_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint8_t *auth_tag = buff; uint64_t tag_len = (uint64_t) *buff; - IMB_AES256_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, - aad_len, auth_tag, tag_len); + IMB_AES256_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); } -static void test_aes128_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_aes128_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -453,15 +444,15 @@ static void test_aes128_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, IMB_AES128_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); } -static void test_aes128_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_aes128_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -476,15 +467,15 @@ static void test_aes128_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, IMB_AES128_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); } -static void test_aes192_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_aes192_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -499,15 +490,15 @@ static void test_aes192_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, IMB_AES192_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); } -static void test_aes192_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_aes192_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -522,14 +513,14 @@ static void test_aes192_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, IMB_AES192_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); } -static void test_aes256_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_aes256_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -544,15 +535,15 @@ static void test_aes256_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, IMB_AES256_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); } -static void test_aes256_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_aes256_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) return; - const struct gcm_key_data *key = (const struct gcm_key_data *)buff; - struct gcm_context_data *ctx = (struct gcm_context_data *)buff; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; + struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; @@ -568,7 +559,8 @@ static void test_aes256_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, } #endif /* __aarch64__ */ -static void test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; @@ -577,13 +569,14 @@ static void test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) void *out = buff; const void *in = buff; - const uint32_t len = dataSize; - const void *iv = (const void *) buff; + const uint32_t len = dataSize; + const void *iv = (const void *) buff; IMB_ZUC_EEA3_1_BUFFER(p_mgr, key, iv, in, out, len); } -static void test_zuc_eea3_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_zuc_eea3_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key[4]; @@ -606,7 +599,8 @@ static void test_zuc_eea3_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_ZUC_EEA3_4_BUFFER(p_mgr, key, iv, in, out, len); } -static void test_zuc_eea3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_zuc_eea3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key[8]; @@ -629,7 +623,8 @@ static void test_zuc_eea3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_ZUC_EEA3_N_BUFFER(p_mgr, key, iv, in, out, len, count); } -static void test_zuc_eia3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_zuc_eia3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; @@ -637,14 +632,15 @@ static void test_zuc_eia3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return; const void *in = buff; - uint32_t len = dataSize * 8; - const void *iv = (const void *) buff; - uint32_t *tag = (uint32_t *)buff; + uint32_t len = dataSize * 8; + const void *iv = (const void *) buff; + uint32_t *tag = (uint32_t *) buff; IMB_ZUC_EIA3_1_BUFFER(p_mgr, key, iv, in, len, tag); } -static void test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key[8]; @@ -662,7 +658,7 @@ static void test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) iv[i] = buff; in[i] = buff; tag_ptr_array[i] = buff; - tag[i] = (uint32_t *)buff; + tag[i] = (uint32_t *) buff; len[i] = dataSize * 8; } @@ -670,13 +666,13 @@ static void test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) } #ifndef __aarch64__ -static void test_chacha_poly_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_chacha_poly_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if (dataSize < sizeof(struct chacha20_poly1305_context_data)) return; - struct chacha20_poly1305_context_data *ctx = - (struct chacha20_poly1305_context_data *)buff; + struct chacha20_poly1305_context_data *ctx = (struct chacha20_poly1305_context_data *) buff; const void *key = buff; uint8_t *out = buff; const uint8_t *in = buff; @@ -692,13 +688,13 @@ static void test_chacha_poly_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CHACHA20_POLY1305_ENC_FINALIZE(p_mgr, ctx, auth_tag, tag_len); } -static void test_chacha_poly_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_chacha_poly_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if (dataSize < sizeof(struct chacha20_poly1305_context_data)) return; - struct chacha20_poly1305_context_data *ctx = - (struct chacha20_poly1305_context_data *)buff; + struct chacha20_poly1305_context_data *ctx = (struct chacha20_poly1305_context_data *) buff; const void *key = buff; uint8_t *out = buff; const uint8_t *in = buff; @@ -714,8 +710,8 @@ static void test_chacha_poly_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CHACHA20_POLY1305_DEC_FINALIZE(p_mgr, ctx, auth_tag, tag_len); } -static void test_crc32_ethernet_fcs(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_crc32_ethernet_fcs(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -723,7 +719,8 @@ static void test_crc32_ethernet_fcs(IMB_MGR *p_mgr, uint8_t *buff, IMB_CRC32_ETHERNET_FCS(p_mgr, in, len); } -static void test_crc16_x25(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_crc16_x25(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -731,7 +728,8 @@ static void test_crc16_x25(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CRC16_X25(p_mgr, in, len); } -static void test_crc32_sctp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_crc32_sctp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -739,7 +737,8 @@ static void test_crc32_sctp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CRC32_SCTP(p_mgr, in, len); } -static void test_crc24_lte_a(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_crc24_lte_a(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -747,7 +746,8 @@ static void test_crc24_lte_a(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CRC24_LTE_A(p_mgr, in, len); } -static void test_crc24_lte_b(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_crc24_lte_b(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -755,7 +755,8 @@ static void test_crc24_lte_b(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CRC24_LTE_B(p_mgr, in, len); } -static void test_crc16_fp_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_crc16_fp_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -763,8 +764,8 @@ static void test_crc16_fp_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CRC16_FP_DATA(p_mgr, in, len); } -static void test_crc11_fp_header(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_crc11_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -772,7 +773,8 @@ static void test_crc11_fp_header(IMB_MGR *p_mgr, uint8_t *buff, IMB_CRC11_FP_HEADER(p_mgr, in, len); } -static void test_crc7_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_crc7_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -780,8 +782,8 @@ static void test_crc7_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_CRC7_FP_HEADER(p_mgr, in, len); } -static void test_crc10_iuup_data(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_crc10_iuup_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -789,8 +791,8 @@ static void test_crc10_iuup_data(IMB_MGR *p_mgr, uint8_t *buff, IMB_CRC10_IUUP_DATA(p_mgr, in, len); } -static void test_crc6_iuup_header(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_crc6_iuup_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -798,8 +800,8 @@ static void test_crc6_iuup_header(IMB_MGR *p_mgr, uint8_t *buff, IMB_CRC6_IUUP_HEADER(p_mgr, in, len); } -static void test_crc32_wimax_ofdma_data(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_crc32_wimax_ofdma_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -807,8 +809,8 @@ static void test_crc32_wimax_ofdma_data(IMB_MGR *p_mgr, uint8_t *buff, IMB_CRC32_WIMAX_OFDMA_DATA(p_mgr, in, len); } -static void test_crc8_wimax_ofdma_hcs(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_crc8_wimax_ofdma_hcs(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; @@ -816,8 +818,8 @@ static void test_crc8_wimax_ofdma_hcs(IMB_MGR *p_mgr, uint8_t *buff, IMB_CRC8_WIMAX_OFDMA_HCS(p_mgr, in, len); } -static void test_kasumi_f8_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_kasumi_f8_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; kasumi_key_sched_t exp_key_s; @@ -829,7 +831,8 @@ static void test_kasumi_f8_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, IMB_KASUMI_INIT_F8_KEY_SCHED(p_mgr, key, exp_key); } -static void test_kasumi_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; @@ -840,65 +843,67 @@ static void test_kasumi_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t data uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = (dataSize * 8) - offset; + uint64_t len = (dataSize * 8) - offset; const uint64_t iv = *((uint64_t *) buff); IMB_KASUMI_F8_1_BUFFER_BIT(p_mgr, exp_key, iv, in, out, len, offset); } -static void test_kasumi_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; + uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); IMB_KASUMI_F8_1_BUFFER(p_mgr, exp_key, iv, in, out, len); } -static void test_kasumi_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; + uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_2_BUFFER(p_mgr, exp_key, iv, iv, in, - out, len, in, out, len); + IMB_KASUMI_F8_2_BUFFER(p_mgr, exp_key, iv, iv, in, out, len, in, out, len); } -static void test_kasumi_f8_3_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f8_3_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; + uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_3_BUFFER(p_mgr, exp_key, iv, iv, iv, in, out, - in, out, in, out, len); + IMB_KASUMI_F8_3_BUFFER(p_mgr, exp_key, iv, iv, iv, in, out, in, out, in, out, len); } -static void test_kasumi_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; + uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_4_BUFFER(p_mgr, exp_key, iv, iv, iv, - iv, in, out, in, out, - in, out, in, out, len); + IMB_KASUMI_F8_4_BUFFER(p_mgr, exp_key, iv, iv, iv, iv, in, out, in, out, in, out, in, out, + len); } -static void test_kasumi_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; @@ -916,23 +921,25 @@ static void test_kasumi_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSiz IMB_KASUMI_F8_N_BUFFER(p_mgr, exp_key, iv, in, out, len, count); } -static void test_kasumi_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; const uint8_t *in = buff; - uint64_t len = dataSize; + uint64_t len = dataSize; uint8_t *tag = buff; IMB_KASUMI_F9_1_BUFFER(p_mgr, exp_key, in, len, tag); } -static void test_kasumi_f9_1_buff_user(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +static void +test_kasumi_f9_1_buff_user(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; const uint8_t *in = buff; - uint64_t len = dataSize * 8; + uint64_t len = dataSize * 8; uint8_t *tag = buff; const uint64_t iv = (uint64_t) buff; const uint32_t dir = (uint32_t) *buff * 8; @@ -940,8 +947,8 @@ static void test_kasumi_f9_1_buff_user(IMB_MGR *p_mgr, uint8_t *buff, size_t dat IMB_KASUMI_F9_1_BUFFER_USER(p_mgr, exp_key, iv, in, len, tag, dir); } -static void test_kasumi_f9_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, - size_t dataSize) +static void +test_kasumi_f9_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; kasumi_key_sched_t exp_key_s; @@ -958,64 +965,65 @@ struct { void (*func)(IMB_MGR *mb_mgr, uint8_t *buff, size_t dataSize); const char *func_name; } direct_apis[] = { - {test_snow3g_init_key_sched, "test_snow3g_init_key_sched"}, - {test_snow3g_f8_1_buff_bit, "test_snow3g_f8_1_buff_bit"}, - {test_snow3g_f8_1_buff, "test_snow3g_f8_1_buff"}, - {test_snow3g_f8_2_buff, "test_snow3g_f8_2_buff"}, - {test_snow3g_f8_4_buff, "test_snow3g_f8_4_buff"}, - {test_snow3g_f8_8_buff, "test_snow3g_f8_8_buff"}, - {test_snow3g_f8_n_buff, "test_snow3g_f8_n_buff"}, - {test_snow3g_f8_8_multikey, "test_snow3g_f8_8_multikey"}, - {test_snow3g_f8_n_multikey, "test_snow3g_f8_n_multikey"}, - {test_snow3g_f9_1_buff, "test_snow3g_f9_1_buff"}, + { test_snow3g_init_key_sched, "test_snow3g_init_key_sched" }, + { test_snow3g_f8_1_buff_bit, "test_snow3g_f8_1_buff_bit" }, + { test_snow3g_f8_1_buff, "test_snow3g_f8_1_buff" }, + { test_snow3g_f8_2_buff, "test_snow3g_f8_2_buff" }, + { test_snow3g_f8_4_buff, "test_snow3g_f8_4_buff" }, + { test_snow3g_f8_8_buff, "test_snow3g_f8_8_buff" }, + { test_snow3g_f8_n_buff, "test_snow3g_f8_n_buff" }, + { test_snow3g_f8_8_multikey, "test_snow3g_f8_8_multikey" }, + { test_snow3g_f8_n_multikey, "test_snow3g_f8_n_multikey" }, + { test_snow3g_f9_1_buff, "test_snow3g_f9_1_buff" }, #ifndef __aarch64__ - {test_aes128_gcm_enc_sgl, "test_aes128_gcm_enc_sgl"}, - {test_aes128_gcm_dec_sgl, "test_aes128_gcm_dec_sgl"}, - {test_aes192_gcm_enc_sgl, "test_aes192_gcm_enc_sgl"}, - {test_aes192_gcm_dec_sgl, "test_aes192_gcm_dec_sgl"}, - {test_aes256_gcm_enc_sgl, "test_aes256_gcm_enc_sgl"}, - {test_aes256_gcm_dec_sgl, "test_aes256_gcm_dec_sgl"}, - {test_aes128_gcm_enc, "test_aes128_gcm_enc"}, - {test_aes128_gcm_dec, "test_aes128_gcm_dec"}, - {test_aes192_gcm_enc, "test_aes192_gcm_enc"}, - {test_aes192_gcm_dec, "test_aes192_gcm_dec"}, - {test_aes256_gcm_enc, "test_aes256_gcm_enc"}, - {test_aes256_gcm_dec, "test_aes256_gcm_dec"}, + { test_aes128_gcm_enc_sgl, "test_aes128_gcm_enc_sgl" }, + { test_aes128_gcm_dec_sgl, "test_aes128_gcm_dec_sgl" }, + { test_aes192_gcm_enc_sgl, "test_aes192_gcm_enc_sgl" }, + { test_aes192_gcm_dec_sgl, "test_aes192_gcm_dec_sgl" }, + { test_aes256_gcm_enc_sgl, "test_aes256_gcm_enc_sgl" }, + { test_aes256_gcm_dec_sgl, "test_aes256_gcm_dec_sgl" }, + { test_aes128_gcm_enc, "test_aes128_gcm_enc" }, + { test_aes128_gcm_dec, "test_aes128_gcm_dec" }, + { test_aes192_gcm_enc, "test_aes192_gcm_enc" }, + { test_aes192_gcm_dec, "test_aes192_gcm_dec" }, + { test_aes256_gcm_enc, "test_aes256_gcm_enc" }, + { test_aes256_gcm_dec, "test_aes256_gcm_dec" }, #endif /* __aarch64__ */ - {test_zuc_eea3_1_buff, "test_zuc_eea3_1_buff"}, - {test_zuc_eea3_4_buff, "test_zuc_eea3_4_buff"}, - {test_zuc_eea3_n_buff, "test_zuc_eea3_n_buff"}, - {test_zuc_eia3_1_buff, "test_zuc_eia3_1_buff"}, - {test_zuc_eia3_n_buff, "test_zuc_eia3_n_buff"}, + { test_zuc_eea3_1_buff, "test_zuc_eea3_1_buff" }, + { test_zuc_eea3_4_buff, "test_zuc_eea3_4_buff" }, + { test_zuc_eea3_n_buff, "test_zuc_eea3_n_buff" }, + { test_zuc_eia3_1_buff, "test_zuc_eia3_1_buff" }, + { test_zuc_eia3_n_buff, "test_zuc_eia3_n_buff" }, #ifndef __aarch64__ - {test_chacha_poly_enc, "test_chacha_poly_enc"}, - {test_chacha_poly_dec, "test_chacha_poly_dec"}, - {test_crc32_ethernet_fcs, "test_crc32_ethernet_fcs"}, - {test_crc16_x25, "test_crc16_x25"}, - {test_crc32_sctp, "test_crc32_sctp"}, - {test_crc16_fp_data, "test_crc16_fp_data"}, - {test_crc11_fp_header, "test_crc11_fp_header"}, - {test_crc24_lte_a, "test_crc24_lte_a"}, - {test_crc24_lte_b, "test_crc24_lte_b"}, - {test_crc7_fp_header, "test_crc7_fp_header"}, - {test_crc10_iuup_data, "test_crc10_iuup_data"}, - {test_crc6_iuup_header, "test_crc6_iuup_header"}, - {test_crc32_wimax_ofdma_data, "test_crc32_wimax_ofdma_data"}, - {test_crc8_wimax_ofdma_hcs, "test_crc8_wimax_ofdma_hcs"}, - {test_kasumi_f8_init_key_sched, "test_kasumi_f8_init_key_sched"}, - {test_kasumi_f8_1_buff_bit, "test_kasumi_f8_1_buff_bit"}, - {test_kasumi_f8_1_buff, "test_kasumi_f8_1_buff"}, - {test_kasumi_f8_2_buff, "test_kasumi_f8_2_buff"}, - {test_kasumi_f8_3_buff, "test_kasumi_f8_3_buff"}, - {test_kasumi_f8_4_buff, "test_kasumi_f8_4_buff"}, - {test_kasumi_f8_n_buff, "test_kasumi_f8_n_buff"}, - {test_kasumi_f9_1_buff, "test_kasumi_f9_1_buff"}, - {test_kasumi_f9_1_buff_user, "test_kasumi_f9_1_buff_user"}, - {test_kasumi_f9_init_key_sched, "test_kasumi_f9_init_key_sched"}, + { test_chacha_poly_enc, "test_chacha_poly_enc" }, + { test_chacha_poly_dec, "test_chacha_poly_dec" }, + { test_crc32_ethernet_fcs, "test_crc32_ethernet_fcs" }, + { test_crc16_x25, "test_crc16_x25" }, + { test_crc32_sctp, "test_crc32_sctp" }, + { test_crc16_fp_data, "test_crc16_fp_data" }, + { test_crc11_fp_header, "test_crc11_fp_header" }, + { test_crc24_lte_a, "test_crc24_lte_a" }, + { test_crc24_lte_b, "test_crc24_lte_b" }, + { test_crc7_fp_header, "test_crc7_fp_header" }, + { test_crc10_iuup_data, "test_crc10_iuup_data" }, + { test_crc6_iuup_header, "test_crc6_iuup_header" }, + { test_crc32_wimax_ofdma_data, "test_crc32_wimax_ofdma_data" }, + { test_crc8_wimax_ofdma_hcs, "test_crc8_wimax_ofdma_hcs" }, + { test_kasumi_f8_init_key_sched, "test_kasumi_f8_init_key_sched" }, + { test_kasumi_f8_1_buff_bit, "test_kasumi_f8_1_buff_bit" }, + { test_kasumi_f8_1_buff, "test_kasumi_f8_1_buff" }, + { test_kasumi_f8_2_buff, "test_kasumi_f8_2_buff" }, + { test_kasumi_f8_3_buff, "test_kasumi_f8_3_buff" }, + { test_kasumi_f8_4_buff, "test_kasumi_f8_4_buff" }, + { test_kasumi_f8_n_buff, "test_kasumi_f8_n_buff" }, + { test_kasumi_f9_1_buff, "test_kasumi_f9_1_buff" }, + { test_kasumi_f9_1_buff_user, "test_kasumi_f9_1_buff_user" }, + { test_kasumi_f9_init_key_sched, "test_kasumi_f9_init_key_sched" }, #endif /* __aarch64__ */ }; -int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) +int +LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) { IMB_ARCH arch_to_run = IMB_ARCH_NUM; static IMB_MGR *p_mgr = NULL; @@ -1054,7 +1062,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) init_mb_mgr_auto(p_mgr, &arch_to_run); } - const int idx = data[0]%DIM(direct_apis); + const int idx = data[0] % DIM(direct_apis); direct_apis[idx].func(p_mgr, buff, dataSize); diff --git a/test/fuzz-app/job_api_fuzz_test.c b/test/fuzz-app/job_api_fuzz_test.c index 7f6f7587..7bb3e461 100644 --- a/test/fuzz-app/job_api_fuzz_test.c +++ b/test/fuzz-app/job_api_fuzz_test.c @@ -34,18 +34,21 @@ #include #include -#define BUFF_SIZE (32*1024*1024) +#define BUFF_SIZE (32 * 1024 * 1024) #define MAX_BURST_JOBS 32 -int LLVMFuzzerTestOneInput(const uint8_t *, size_t); +int +LLVMFuzzerTestOneInput(const uint8_t *, size_t); -static int custom_op(struct IMB_JOB *job) +static int +custom_op(struct IMB_JOB *job) { (void) job; return 0; } -static void clamp_lengths(struct IMB_JOB *job, const uint64_t buffsize) +static void +clamp_lengths(struct IMB_JOB *job, const uint64_t buffsize) { if (job->msg_len_to_cipher_in_bytes > buffsize) job->msg_len_to_cipher_in_bytes = buffsize; @@ -60,24 +63,25 @@ static void clamp_lengths(struct IMB_JOB *job, const uint64_t buffsize) job->hash_start_src_offset_in_bytes = buffsize; } -static void fill_job_data(struct IMB_JOB *job, void *buff) +static void +fill_job_data(struct IMB_JOB *job, void *buff) { if (job->src != NULL) - job->src = (uint8_t *)buff; + job->src = (uint8_t *) buff; if (job->dst != NULL) - job->dst = (uint8_t *)buff; + job->dst = (uint8_t *) buff; if (job->enc_keys != NULL) job->enc_keys = buff; if (job->dec_keys != NULL) job->dec_keys = buff; if (job->iv != NULL) - job->iv = (uint8_t *)buff; + job->iv = (uint8_t *) buff; if (job->auth_tag_output != NULL) - job->auth_tag_output = (uint8_t *)buff; + job->auth_tag_output = (uint8_t *) buff; } -static void fill_additional_cipher_data(struct IMB_JOB *job, - void *buff, const uint64_t buffsize) +static void +fill_additional_cipher_data(struct IMB_JOB *job, void *buff, const uint64_t buffsize) { const IMB_CIPHER_MODE cipherMode = job->cipher_mode; @@ -114,10 +118,8 @@ static void fill_additional_cipher_data(struct IMB_JOB *job, case IMB_CIPHER_CHACHA20_POLY1305: if (job->u.CHACHA20_POLY1305.aad != NULL) job->u.CHACHA20_POLY1305.aad = buff; - if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > - buffsize) - job->u.CHACHA20_POLY1305.aad_len_in_bytes = - buffsize; + if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > buffsize) + job->u.CHACHA20_POLY1305.aad_len_in_bytes = buffsize; break; case IMB_CIPHER_CHACHA20_POLY1305_SGL: if (job->u.CHACHA20_POLY1305.aad != NULL) @@ -127,20 +129,16 @@ static void fill_additional_cipher_data(struct IMB_JOB *job, job->u.CHACHA20_POLY1305.ctx->remain_ks_bytes &= 63; job->u.CHACHA20_POLY1305.ctx->remain_ct_bytes &= 15; } - if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > - buffsize) - job->u.CHACHA20_POLY1305.aad_len_in_bytes = - buffsize; + if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > buffsize) + job->u.CHACHA20_POLY1305.aad_len_in_bytes = buffsize; break; case IMB_CIPHER_SNOW_V_AEAD: if (job->u.SNOW_V_AEAD.aad != NULL) job->u.SNOW_V_AEAD.aad = buff; if (job->u.SNOW_V_AEAD.reserved != NULL) job->u.SNOW_V_AEAD.reserved = buff; - if (job->u.SNOW_V_AEAD.aad_len_in_bytes > - buffsize) - job->u.SNOW_V_AEAD.aad_len_in_bytes = - buffsize; + if (job->u.SNOW_V_AEAD.aad_len_in_bytes > buffsize) + job->u.SNOW_V_AEAD.aad_len_in_bytes = buffsize; break; case IMB_CIPHER_CBCS_1_9: if (job->cipher_fields.CBCS.next_iv != NULL) @@ -151,8 +149,8 @@ static void fill_additional_cipher_data(struct IMB_JOB *job, } } -static void fill_additional_hash_data(struct IMB_JOB *job, - void *buff, uint64_t buffsize) +static void +fill_additional_hash_data(struct IMB_JOB *job, void *buff, uint64_t buffsize) { const IMB_HASH_ALG hashMode = job->hash_alg; @@ -167,17 +165,17 @@ static void fill_additional_hash_data(struct IMB_JOB *job, case IMB_AUTH_HMAC_SHA_512: case IMB_AUTH_MD5: if (job->u.HMAC._hashed_auth_key_xor_ipad != NULL) - job->u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *)buff; + job->u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) buff; if (job->u.HMAC._hashed_auth_key_xor_opad != NULL) - job->u.HMAC._hashed_auth_key_xor_opad = (uint8_t *)buff; + job->u.HMAC._hashed_auth_key_xor_opad = (uint8_t *) buff; break; case IMB_AUTH_AES_XCBC: if (job->u.XCBC._k1_expanded != NULL) - job->u.XCBC._k1_expanded = (uint32_t *)buff; + job->u.XCBC._k1_expanded = (uint32_t *) buff; if (job->u.XCBC._k2 != NULL) - job->u.XCBC._k2 = (uint8_t *)buff; + job->u.XCBC._k2 = (uint8_t *) buff; if (job->u.XCBC._k3 != NULL) - job->u.XCBC._k3 = (uint8_t *)buff; + job->u.XCBC._k3 = (uint8_t *) buff; break; case IMB_AUTH_AES_CCM: if (job->u.CCM.aad != NULL) @@ -197,13 +195,13 @@ static void fill_additional_hash_data(struct IMB_JOB *job, break; case IMB_AUTH_ZUC256_EIA3_BITLEN: if (job->u.ZUC_EIA3._iv23 != NULL) - job->u.ZUC_EIA3._iv23 = (uint8_t *)buff; + job->u.ZUC_EIA3._iv23 = (uint8_t *) buff; /* fall through */ case IMB_AUTH_ZUC_EIA3_BITLEN: if (job->u.ZUC_EIA3._key != NULL) - job->u.ZUC_EIA3._key = (uint8_t *)buff; + job->u.ZUC_EIA3._key = (uint8_t *) buff; if (job->u.ZUC_EIA3._iv != NULL) - job->u.ZUC_EIA3._iv = (uint8_t *)buff; + job->u.ZUC_EIA3._iv = (uint8_t *) buff; break; case IMB_AUTH_SNOW3G_UIA2_BITLEN: if (job->u.SNOW3G_UIA2._key != NULL) @@ -239,10 +237,8 @@ static void fill_additional_hash_data(struct IMB_JOB *job, case IMB_AUTH_CHACHA20_POLY1305: if (job->u.CHACHA20_POLY1305.aad != NULL) job->u.CHACHA20_POLY1305.aad = buff; - if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > - buffsize) - job->u.CHACHA20_POLY1305.aad_len_in_bytes = - buffsize; + if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > buffsize) + job->u.CHACHA20_POLY1305.aad_len_in_bytes = buffsize; break; case IMB_AUTH_CHACHA20_POLY1305_SGL: if (job->u.CHACHA20_POLY1305.aad != NULL) @@ -252,18 +248,14 @@ static void fill_additional_hash_data(struct IMB_JOB *job, job->u.CHACHA20_POLY1305.ctx->remain_ks_bytes &= 63; job->u.CHACHA20_POLY1305.ctx->remain_ct_bytes &= 15; } - if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > - buffsize) - job->u.CHACHA20_POLY1305.aad_len_in_bytes = - buffsize; - break; + if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > buffsize) + job->u.CHACHA20_POLY1305.aad_len_in_bytes = buffsize; + break; case IMB_AUTH_SNOW_V_AEAD: if (job->u.SNOW_V_AEAD.aad != NULL) job->u.SNOW_V_AEAD.aad = buff; - if (job->u.SNOW_V_AEAD.aad_len_in_bytes > - buffsize) - job->u.SNOW_V_AEAD.aad_len_in_bytes = - buffsize; + if (job->u.SNOW_V_AEAD.aad_len_in_bytes > buffsize) + job->u.SNOW_V_AEAD.aad_len_in_bytes = buffsize; break; case IMB_AUTH_GCM_SGL: if (job->u.GCM.aad != NULL) @@ -283,14 +275,15 @@ static void fill_additional_hash_data(struct IMB_JOB *job, } /* function to read env variables to import specific hash mode */ -static IMB_HASH_ALG hash_selection(void) +static IMB_HASH_ALG +hash_selection(void) { const char *a = getenv("HASH"); if (a == NULL) { return 0; } else { - if (strcmp(a, "IMB_AUTH_HMAC_SHA_1") == 0) + if (strcmp(a, "IMB_AUTH_HMAC_SHA_1") == 0) return IMB_AUTH_HMAC_SHA_1; else if (strcmp(a, "IMB_AUTH_HMAC_SHA_224") == 0) return IMB_AUTH_HMAC_SHA_224; @@ -388,14 +381,15 @@ static IMB_HASH_ALG hash_selection(void) } /* function to read env variables to import specific cipher mode */ -static IMB_CIPHER_MODE cipher_selection(void) +static IMB_CIPHER_MODE +cipher_selection(void) { const char *a = getenv("CIPHER"); if (a == NULL) { return 0; } else { - if (strcmp(a, "IMB_CIPHER_CBC") == 0) + if (strcmp(a, "IMB_CIPHER_CBC") == 0) return IMB_CIPHER_CBC; else if (strcmp(a, "IMB_CIPHER_CNTR") == 0) return IMB_CIPHER_CNTR; @@ -446,7 +440,8 @@ static IMB_CIPHER_MODE cipher_selection(void) } } -int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) +int +LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) { IMB_HASH_ALG hash; IMB_CIPHER_MODE cipher; @@ -463,8 +458,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) unsigned num_jobs; unsigned key_len; const size_t buffsize = BUFF_SIZE; - bool single = false, cipher_burst = false, - hash_burst = false, burst = false; + bool single = false, cipher_burst = false, hash_burst = false, burst = false; if (n_jobs == NULL) num_jobs = 10; @@ -557,7 +551,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) else job->cipher_mode = cipher; clamp_lengths(job, buffsize); - static DECLARE_ALIGNED(uint8_t buff[2*BUFF_SIZE], 64); + static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); fill_job_data(job, buff); fill_additional_cipher_data(job, buff, buffsize); @@ -565,10 +559,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) job = IMB_SUBMIT_JOB(p_mgr); } } else if (burst) { - IMB_JOB *jobs[MAX_BURST_JOBS] = {NULL}; + IMB_JOB *jobs[MAX_BURST_JOBS] = { NULL }; - while (IMB_GET_NEXT_BURST(p_mgr, num_jobs, jobs) - < (uint32_t)num_jobs) + while (IMB_GET_NEXT_BURST(p_mgr, num_jobs, jobs) < (uint32_t) num_jobs) IMB_FLUSH_BURST(p_mgr, num_jobs, jobs); for (i = 0; i < num_jobs; i++) { @@ -587,24 +580,20 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) else job->hash_alg = hash; if (cipher == 0) - job->cipher_mode %= - (IMB_CIPHER_NUM + 1); + job->cipher_mode %= (IMB_CIPHER_NUM + 1); else job->cipher_mode = cipher; clamp_lengths(job, buffsize); - static DECLARE_ALIGNED - (uint8_t buff[2*BUFF_SIZE], 64); + static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); fill_job_data(job, buff); - fill_additional_cipher_data - (job, buff, buffsize); - fill_additional_hash_data - (job, buff, buffsize); + fill_additional_cipher_data(job, buff, buffsize); + fill_additional_hash_data(job, buff, buffsize); } IMB_SUBMIT_BURST(p_mgr, num_jobs, jobs); } else if (cipher_burst) { - IMB_JOB jobs[MAX_BURST_JOBS] = {0}; + IMB_JOB jobs[MAX_BURST_JOBS] = { 0 }; for (i = 0; i < num_jobs; i++) { job = &jobs[i]; @@ -617,20 +606,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) * selected to fuzz. */ if (cipher == 0) - cipher = (job->cipher_mode % - (IMB_CIPHER_NUM + 1)); + cipher = (job->cipher_mode % (IMB_CIPHER_NUM + 1)); clamp_lengths(job, buffsize); - static DECLARE_ALIGNED - (uint8_t buff[2*BUFF_SIZE], 64); + static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); fill_job_data(job, buff); - fill_additional_cipher_data(job, buff, buffsize); + fill_additional_cipher_data(job, buff, buffsize); } - IMB_SUBMIT_CIPHER_BURST(p_mgr, jobs, num_jobs, - cipher, dir, key_len); + IMB_SUBMIT_CIPHER_BURST(p_mgr, jobs, num_jobs, cipher, dir, key_len); } else if (hash_burst) { - IMB_JOB jobs[MAX_BURST_JOBS] = {0}; + IMB_JOB jobs[MAX_BURST_JOBS] = { 0 }; for (i = 0; i < num_jobs; i++) { job = &jobs[i]; @@ -643,14 +629,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) * been selected to fuzz. */ if (hash == 0) - hash = (job->hash_alg % - (IMB_AUTH_NUM + 1)); + hash = (job->hash_alg % (IMB_AUTH_NUM + 1)); clamp_lengths(job, buffsize); - static DECLARE_ALIGNED - (uint8_t buff[2*BUFF_SIZE], 64); + static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); fill_job_data(job, buff); - fill_additional_hash_data(job, buff, buffsize); + fill_additional_hash_data(job, buff, buffsize); } IMB_SUBMIT_HASH_BURST(p_mgr, jobs, num_jobs, hash); diff --git a/test/include/aead_test.h b/test/include/aead_test.h index 99594758..b5399da8 100644 --- a/test/include/aead_test.h +++ b/test/include/aead_test.h @@ -32,7 +32,7 @@ #include struct aead_test { - size_t ivSize; /* bits */ + size_t ivSize; /* bits */ size_t keySize; /* bits */ size_t tagSize; /* bits */ size_t tcId; diff --git a/test/include/cipher_test.h b/test/include/cipher_test.h index f6539032..c338308d 100644 --- a/test/include/cipher_test.h +++ b/test/include/cipher_test.h @@ -32,7 +32,7 @@ #include struct cipher_test { - size_t ivSize; /* bits */ + size_t ivSize; /* bits */ size_t keySize; /* bits */ size_t tcId; const char *key; diff --git a/test/include/utils.h b/test/include/utils.h index 322bf5d4..9d620c3c 100644 --- a/test/include/utils.h +++ b/test/include/utils.h @@ -31,19 +31,22 @@ #include #include -#define DIM(_x) (sizeof(_x)/sizeof(_x[0])) +#define DIM(_x) (sizeof(_x) / sizeof(_x[0])) #define DIV_ROUND_UP(x, y) ((x + y - 1) / y) extern int quiet_mode; -void hexdump(FILE *fp, const char *msg, const void *p, size_t len); -void hexdump_ex(FILE *fp, const char *msg, const void *p, size_t len, - const void *start_ptr); +void +hexdump(FILE *fp, const char *msg, const void *p, size_t len); +void +hexdump_ex(FILE *fp, const char *msg, const void *p, size_t len, const void *start_ptr); -int update_flags_and_archs(const char *arg, uint8_t arch_support[IMB_ARCH_NUM], - uint64_t *flags); -int detect_arch(uint8_t arch_support[IMB_ARCH_NUM]); -void print_tested_arch(const uint64_t features, const IMB_ARCH arch); +int +update_flags_and_archs(const char *arg, uint8_t arch_support[IMB_ARCH_NUM], uint64_t *flags); +int +detect_arch(uint8_t arch_support[IMB_ARCH_NUM]); +void +print_tested_arch(const uint64_t features, const IMB_ARCH arch); struct test_suite_context { unsigned pass; @@ -51,16 +54,22 @@ struct test_suite_context { const char *alg_name; }; -void test_suite_start(struct test_suite_context *ctx, const char *alg_name); -void test_suite_update(struct test_suite_context *ctx, const unsigned passed, - const unsigned failed); -int test_suite_end(struct test_suite_context *ctx); +void +test_suite_start(struct test_suite_context *ctx, const char *alg_name); +void +test_suite_update(struct test_suite_context *ctx, const unsigned passed, const unsigned failed); +int +test_suite_end(struct test_suite_context *ctx); -void generate_random_buf(uint8_t *buf, const uint32_t length); +void +generate_random_buf(uint8_t *buf, const uint32_t length); -int membitcmp(const uint8_t *input, const uint8_t *output, - const uint32_t bitlength, const uint32_t bitoffset); -void memory_copy(void *dst, const void *src, size_t length); -void memory_set(void *dst, const int val, size_t length); +int +membitcmp(const uint8_t *input, const uint8_t *output, const uint32_t bitlength, + const uint32_t bitoffset); +void +memory_copy(void *dst, const void *src, size_t length); +void +memory_set(void *dst, const int val, size_t length); #endif /* TESTAPP_UTILS_H */ diff --git a/test/kat-app/aes_cbc_test.c b/test/kat-app/aes_cbc_test.c index 562d80da..b4a892f7 100644 --- a/test/kat-app/aes_cbc_test.c +++ b/test/kat-app/aes_cbc_test.c @@ -38,27 +38,22 @@ #define MAX_BURST_JOBS 64 -int cbc_test(struct IMB_MGR *mb_mgr); +int +cbc_test(struct IMB_MGR *mb_mgr); extern const struct cipher_test cbc_test_json[]; static int -aes_job_ok(const struct IMB_JOB *job, - const uint8_t *out_text, - const uint8_t *target, - const uint8_t *padding, - const size_t sizeof_padding, - const unsigned text_len) +aes_job_ok(const struct IMB_JOB *job, const uint8_t *out_text, const uint8_t *target, + const uint8_t *padding, const size_t sizeof_padding, const unsigned text_len) { - const int num = (const int)((uint64_t)job->user_data2); + const int num = (const int) ((uint64_t) job->user_data2); if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %d", - __LINE__, job->status, num); + printf("%d error status:%d, job %d", __LINE__, job->status, num); return 0; } - if (memcmp(out_text, target + sizeof_padding, - text_len)) { + if (memcmp(out_text, target + sizeof_padding, text_len)) { printf("%d mismatched\n", num); return 0; } @@ -66,9 +61,7 @@ aes_job_ok(const struct IMB_JOB *job, printf("%d overwrite head\n", num); return 0; } - if (memcmp(padding, - target + sizeof_padding + text_len, - sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { printf("%d overwrite tail\n", num); return 0; } @@ -76,19 +69,10 @@ aes_job_ok(const struct IMB_JOB *job, } static int -test_aes_many(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const unsigned text_len, - const int dir, - const int order, - const IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) +test_aes_many(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, const void *iv, + const uint8_t *in_text, const uint8_t *out_text, const unsigned text_len, + const int dir, const int order, const IMB_CIPHER_MODE cipher, const int in_place, + const int key_len, const int num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -137,7 +121,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); job->hash_alg = IMB_AUTH_NULL; @@ -152,8 +136,8 @@ test_aes_many(struct IMB_MGR *mb_mgr, } else { /* got job back */ jobs_rx++; - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), + text_len)) goto end; } } @@ -166,8 +150,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, } jobs_rx++; - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), text_len)) goto end; } @@ -177,7 +160,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) { err = imb_get_errno(mb_mgr); if (err != 0) { @@ -197,21 +180,12 @@ end_alloc: } static int -test_aes_many_burst(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const unsigned text_len, - const int dir, - const int order, - const IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) +test_aes_many_burst(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, const void *iv, + const uint8_t *in_text, const uint8_t *out_text, const unsigned text_len, + const int dir, const int order, const IMB_CIPHER_MODE cipher, + const int in_place, const int key_len, const int num_jobs) { - struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = {NULL}; + struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; uint8_t padding[16]; uint8_t **targets = malloc(num_jobs * sizeof(void *)); int i, completed_jobs, jobs_rx = 0, ret = -1; @@ -233,7 +207,7 @@ test_aes_many_burst(struct IMB_MGR *mb_mgr, } } - while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < (uint32_t)num_jobs) + while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < (uint32_t) num_jobs) IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); for (i = 0; i < num_jobs; i++) { @@ -260,7 +234,7 @@ test_aes_many_burst(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); imb_set_session(mb_mgr, job); } @@ -270,8 +244,7 @@ test_aes_many_burst(struct IMB_MGR *mb_mgr, int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } } @@ -281,32 +254,28 @@ check_burst_jobs: job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %d status not complete!\n", i+1); + printf("job %d status not complete!\n", i + 1); goto end; } - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), text_len)) goto end; jobs_rx++; } if (jobs_rx != num_jobs) { - completed_jobs = IMB_FLUSH_BURST(mb_mgr, - num_jobs - completed_jobs, - jobs); + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); if (completed_jobs == 0) { - printf("Expected %d jobs, received %d\n", - num_jobs, jobs_rx); + printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); goto end; } goto check_burst_jobs; } ret = 0; - end: +end: - end_alloc: +end_alloc: if (targets != NULL) { for (i = 0; i < num_jobs; i++) free(targets[i]); @@ -316,20 +285,11 @@ check_burst_jobs: return ret; } - static int -test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const unsigned text_len, - const int dir, - const IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) +test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, const void *iv, + const uint8_t *in_text, const uint8_t *out_text, const unsigned text_len, + const int dir, const IMB_CIPHER_MODE cipher, const int in_place, + const int key_len, const int num_jobs) { struct IMB_JOB *job, jobs[MAX_BURST_JOBS]; uint8_t padding[16]; @@ -372,17 +332,15 @@ test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); } - completed_jobs = IMB_SUBMIT_CIPHER_BURST(mb_mgr, jobs, num_jobs, - cipher, dir, key_len); + completed_jobs = IMB_SUBMIT_CIPHER_BURST(mb_mgr, jobs, num_jobs, cipher, dir, key_len); if (completed_jobs != num_jobs) { int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } else { printf("submit_burst error: not enough " @@ -395,12 +353,11 @@ test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, job = &jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %d status not complete!\n", i+1); + printf("job %d status not complete!\n", i + 1); goto end; } - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), text_len)) goto end; jobs_rx++; } @@ -411,9 +368,9 @@ test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: - end_alloc: +end_alloc: if (targets != NULL) { for (i = 0; i < num_jobs; i++) free(targets[i]); @@ -424,25 +381,22 @@ test_aes_many_cipher_burst(struct IMB_MGR *mb_mgr, } static void -test_cbc_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx128, - struct test_suite_context *ctx192, - struct test_suite_context *ctx256, +test_cbc_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, + struct test_suite_context *ctx192, struct test_suite_context *ctx256, const IMB_CIPHER_MODE cipher, const int num_jobs) { const struct cipher_test *v = cbc_test_json; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (!quiet_mode) - printf("CBC Test (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("CBC Test (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { struct test_suite_context *ctx; if (!quiet_mode) { #ifdef DEBUG - printf("AES-CBC Test Case %zu key_len:%zu\n", - v->tcId, v->keySize); + printf("AES-CBC Test Case %zu key_len:%zu\n", v->tcId, v->keySize); #else printf("."); #endif @@ -450,105 +404,94 @@ test_cbc_vectors(struct IMB_MGR *mb_mgr, switch (v->keySize / 8) { case 16: - IMB_AES_KEYEXP_128(mb_mgr, v->key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, v->key, enc_keys, dec_keys); ctx = ctx128; break; case 24: - IMB_AES_KEYEXP_192(mb_mgr, v->key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_192(mb_mgr, v->key, enc_keys, dec_keys); ctx = ctx192; break; case 32: default: - IMB_AES_KEYEXP_256(mb_mgr, v->key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_256(mb_mgr, v->key, enc_keys, dec_keys); ctx = ctx256; break; } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 0, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0, + (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu encrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 0, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0, + (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu decrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 1, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1, + (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu encrypt burst in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 1, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, (unsigned) v->keySize / 8, num_jobs)) { + if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1, + (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu decrypt burst in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -556,10 +499,9 @@ test_cbc_vectors(struct IMB_MGR *mb_mgr, } if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, cipher, 0, - (unsigned) v->keySize / 8, num_jobs)) { + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, cipher, + 0, (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu encrypt cipher burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -568,9 +510,8 @@ test_cbc_vectors(struct IMB_MGR *mb_mgr, if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, cipher, 0, - (unsigned) v->keySize / 8, num_jobs)) { + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, cipher, + 0, (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu decrypt cipher burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -578,10 +519,9 @@ test_cbc_vectors(struct IMB_MGR *mb_mgr, } if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, cipher, 1, - (unsigned) v->keySize / 8, num_jobs)) { + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, cipher, + 1, (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu encrypt cipher burst in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -590,15 +530,14 @@ test_cbc_vectors(struct IMB_MGR *mb_mgr, if (test_aes_many_cipher_burst(mb_mgr, enc_keys, dec_keys, v->iv, (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, cipher, 1, - (unsigned) v->keySize / 8, num_jobs)) { + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, cipher, + 1, (unsigned) v->keySize / 8, num_jobs)) { printf("error #%zu decrypt cipher burst in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } @@ -606,9 +545,7 @@ test_cbc_vectors(struct IMB_MGR *mb_mgr, int cbc_test(struct IMB_MGR *mb_mgr) { - const int num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17, MAX_BURST_JOBS - }; + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17, MAX_BURST_JOBS }; unsigned i; int errors = 0; struct test_suite_context ctx128; @@ -619,8 +556,7 @@ cbc_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx192, "AES-CBC-192"); test_suite_start(&ctx256, "AES-CBC-256"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_cbc_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, - IMB_CIPHER_CBC, + test_cbc_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, IMB_CIPHER_CBC, num_jobs_tab[i]); errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx192); diff --git a/test/kat-app/aes_cbc_test.json.c b/test/kat-app/aes_cbc_test.json.c index 90d56f6b..afdfc5d0 100644 --- a/test/kat-app/aes_cbc_test.json.c +++ b/test/kat-app/aes_cbc_test.json.c @@ -28,242 +28,239 @@ /* CBC */ #include "cipher_test.h" const struct cipher_test cbc_test_json[] = { - /* Vectors from http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ - {128, 128, 1, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x50\x86" - "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x73\xbe\xd6\xb8" - "\xe3\xc1\x74\x3b\x71\x16\xe6\x9e\x22\x22\x95\x16\x3f\xf1\xca\xa1\x68\x1f" - "\xac\x09\x12\x0e\xca\x30\x75\x86\xe1\xa7", - 1, 512}, - {128, 192, 2, - "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" - "\xea\xd2\x52\x2c\x6b\x7b", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d\x71\x78\x18\x3a\x9f\xa0\x71\xe8\xb4\xd9" - "\xad\xa9\xad\x7d\xed\xf4\xe5\xe7\x38\x76\x3f\x69\x14\x5a\x57\x1b\x24\x20" - "\x12\xfb\x7a\xe0\x7f\xa9\xba\xac\x3d\xf1\x02\xe0\x08\xb0\xe2\x79\x88\x59" - "\x88\x81\xd9\x20\xa9\xe6\x4f\x56\x15\xcd", - 1, 512}, - {128, 256, 3, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6\x9c\xfc" - "\x4e\x96\x7e\xdb\x80\x8d\x67\x9f\x77\x7b\xc6\x70\x2c\x7d\x39\xf2\x33\x69" - "\xa9\xd9\xba\xcf\xa5\x30\xe2\x63\x04\x23\x14\x61\xb2\xeb\x05\xe2\xc3\x9b" - "\xe9\xfc\xda\x6c\x19\x07\x8c\x6a\x9d\x1b", - 1, 512}, - {128, 128, 4, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\xfc\x47" - "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\xba\x91\x17\x8d" - "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x80\x40\xe9\x37\xb0\xd6" - "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" - "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" - "\x28\x1f\x3a\x9c\x18\x7d\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" - "\xcf\x21\xa0\x1e\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" - "\x33\x90", - "\xf0\x8f\x91\x13\x11\x01\xdc\xbb\xcd\xf9\x95\x92\xda\xbf\x2a\x86\xea\x8d" - "\xa6\x08\xc8\xb5\x65\x82\x93\x43\xb7\x0e\x14\x36\xb4\xcf\xd8\x11\xab\x21" - "\x5b\x64\xb8\xc5\xee\x27\x93\x66\x59\xd9\x1d\xc9\x84\x9d\x03\xbd\xab\xce" - "\x6a\x14\x76\x73\x17\xe3\xb3\xe5\x70\xe8\xa2\xa8\xce\xb0\xf6\xc4\xc5\xb5" - "\x8e\x22\xef\x33\xdf\x18\x42\x40\x56\xc4\xb9\x7f\x60\x9e\x8b\x45\xc1\xbf" - "\xa7\xfa\x1b\x3e\x02\x5d\xb3\x04\x93\x30\xf5\xff\x8e\xb6\x0a\xfb\x41\xfe" - "\x09\xa5\x90\xc7\x22\xab\xaa\x22\x89\xd8\x3c\x4e\x46\x18\x93\xbf\x1a\xce" - "\x77\x59", - 1, 1024}, - {128, 192, 5, - "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" - "\xea\xd2\x52\x2c\x6b\x7b", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x08\xa3\x58\x17\x14\x70\x5a\xb8\xab\x4f\x5f\xa4\x25\x2b\xec\xb6\x74" - "\x0b\x9d\x56\x3b\xaf\xa3\xa4\x2d\x3e\x1f\x18\x84\x3b\x4f\x48\xd9\xa3\xfe" - "\x59\x1e\x80\x67\x44\x35\x26\x00\x78\xda\x68\xfa\x61\x9c\xd8\x8e\x5c\xc1" - "\xff\xeb\x9c\x7d\xe7\xa9\x38\xeb\x66\xf8\x6a\x46\x71\x51\x02\xba\x8d\x70" - "\x55\x5b\x60\xc6\x4c\xae\xda\x2e\x17\xbb\x65\xef\x60\x85\x9e\x77\xe5\x83" - "\xef\x30\x08\x3a\xba\x80\x28\xc0\xa1\x93\x4c\x2a\x0b\xe1\xcb\xd0\xac\x72" - "\x72\x1d\x96\x76\x0e\xc0\xec\x7d\x84\xfd\xee\x08\xa1\x11\x20\x0d\x59\x5c" - "\x06\x3f\xa3\xf1\xd7\xa3\x1d\x29\xc3\xaa\x05\x2b\x74\x8c\x73\x60\x65\x43" - "\x76\xd4\xd7\x7b\x5f\x40\xf4\x77\xe1\xcc\x85\x37\x1c\xd8\xda\x91\xf0\x40" - "\xb2\x43\x2d\x87\x51\xd0\xce\x27\xa6\x60\xac\x67\xea\x8b\xae\x46\x2e\x78" - "\x06\x09\x8a\x82\xb0\x0d\x57\x56\x82\xfe\x89\xd2", - "\xfa\x88\xb3\x4e\x7f\x3e\x78\x4d\xfd\xb3\x38\xee\xb0\xdd\x0d\xf5\xeb\x24" - "\xe6\x70\xd8\xac\xd7\xfa\x41\x67\x2e\x2d\x7e\x9b\x26\xac\xf1\x0f\x1f\x47" - "\x6d\xff\x46\xd1\x1a\xeb\xe9\x3c\x1b\x9d\x55\x86\xde\xee\x3d\xd8\x12\x05" - "\x12\x9d\xff\x23\x97\x57\xb0\xdc\x7b\x7a\xdf\xba\x7f\x69\x85\xdf\xa9\xfd" - "\x3e\xa7\x36\x26\x30\xdd\x07\x0f\x89\x0b\x27\x9c\x23\xa1\xfa\x7d\x4e\x64" - "\x50\x07\x86\x13\x98\xee\x05\xc6\x6c\xd9\xd1\xe8\xb2\x6b\xe6\x73\x06\x39" - "\xbb\x72\x74\xa3\xc2\x1a\x40\xcd\xec\x40\x8f\x44\xf8\x86\xff\x7e\xb7\xea" - "\xda\xb0\x5c\x25\xdf\x3f\x54\xda\xca\xea\x76\xe5\xec\xbb\x21\xd3\x86\x8d" - "\x8a\x57\xf0\x31\x9f\x56\xa3\x1b\xf9\x55\xe6\xa6\xde\xb7\x74\xcc\x2b\x17" - "\x9a\xe3\x1b\x74\x0d\x2b\x99\xcd\x64\xe1\x7b\x7e\x1c\xcd\x9b\x23\x02\x7d" - "\x86\x52\xfd\x14\x2d\xbb\x75\x3d\xa3\x3b\xc1\xe0", - 1, 1536}, - {128, 256, 6, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0b\xe5\x48\xa6\xa1\xbc\xac\x81\x80\x06\x5f\xae\x1e\x3f\x55\x73\x6d\x36" - "\x7f\x57\x3d\xa4\x4a\x6b\xb6\x65\x2f\xb7\xe8\x85\x47\xe2\x41\x42\xc2\x4e" - "\x58\xf1\xde\x42\x9f\x15\x4c\xaf\xea\x04\x20\xd0\x1a\x19\x36\x74\x71\x12" - "\x72\x1b\xdb\x18\xf9\x0b\xb3\xf3\x63\xd4\x62\x52\x8b\x63\x0f\x6b\x4d\xb9" - "\x70\xd6\x91\xa0\x43\x3f\x46\xfe\x43\xbb\xb8\xdc\x5e\xdb\xd4\x1f\xf0\x17" - "\x94\x25\xee\x55\x67\xbf\x4d\xda\x9d\xe7\x4b\xc6\x7a\xcf\x8f\xd7\xbb\x29" - "\x6e\x26\xd4\xc3\x08\x9b\x67\x15\xe9\x2d\x9f\x2d\x3c\x76\x26\xd3\xda\xfe" - "\x6e\x73\x9d\x09\x60\x4b\x35\x60\xdb\x77\xb6\xc0\x45\x91\xf9\x14\x8a\x7a" - "\xdd\xe2\xf1\xdf\x8f\x12\x4f\xd7\x75\xd6\x9a\x17\xda\x76\x88\xf0\xfa\x44" - "\x27\xbe\x61\xaf\x55\x9f\xc7\xf0\x76\x77\xde\xca\xd1\x47\x51\x55\xb1\xbf" - "\xfa\x1e\xca\x28\x17\x70\xf3\xb5\xd4\x32\x47\x04\xe0\x92\xd8\xa5\x03\x69" - "\x46\x99\x7f\x1e\x3f\xb2\x93\x36\xa3\x88\x75\x07\x68\xb8\x33\xce\x17\x3f" - "\x5c\xb7\x1e\x93\x38\xc5\x1d\x79\x86\x7c\x9d\x9e\x2f\x69\x38\x0f\x97\x5c" - "\x67\xbf\xa0\x8d\x37\x0b\xd3\xb1\x04\x87\x1d\x74\xfe\x30\xfb\xd0\x22\x92" - "\xf9\xf3\x23\xc9", - "\x16\x60\x36\xd9\xcf\xe8\xd6\x07\x81\xdf\x28\x0a\x40\x44\x61\x45\x83\x28" - "\xd5\x1b\xf7\x55\x54\x35\xd3\x43\x73\x0e\x7a\xc3\x83\xb1\xc9\xbd\x22\x70" - "\xf0\xde\x8f\x92\x5e\xe1\x56\xd3\x4d\x01\x64\xfa\xe9\x83\x35\x60\x80\x70" - "\xf5\xb5\x13\x76\xd3\x88\xbb\x7f\x2d\x0a\x31\x04\xb4\x77\x47\x91\x3f\xe4" - "\xa9\x9a\x19\xbe\xfb\xd6\x70\xae\xb1\xea\xd5\x03\xd6\xb5\xca\x76\x5e\x0d" - "\x21\x31\x87\xf3\xb2\x2e\xe2\xbc\x71\xb5\x8b\x7e\xa6\x09\x78\x6e\x76\xe6" - "\x61\xdf\x86\xe6\x8d\x2f\x12\x43\x99\xf9\xf1\x86\xf1\x55\xfd\x35\xcd\xe8" - "\x92\x4e\x87\x33\x77\x62\x64\xaa\x60\x07\x33\x08\x45\xf5\xd6\xb0\x9c\xf4" - "\xba\xda\x17\x74\x74\x23\x54\x9c\x7e\x86\x57\x83\x3d\xda\xc3\xe1\x02\x90" - "\xe3\x69\x80\x7a\x5b\x47\xf5\xea\x83\x1a\xc6\x1a\xaa\x53\x66\xfe\xe6\xbd" - "\x72\x9b\x8b\x96\xdb\x94\xa9\x5b\xc3\x40\x6a\xcd\xf4\x78\x14\x29\x7b\x8f" - "\x26\xb0\x89\xbd\x03\x55\x33\x46\x4c\x96\x2a\x58\x69\x7c\x9b\xdf\xba\xb8" - "\x75\x5b\xbc\x4b\x19\xd3\x9d\xee\xfd\x17\x2f\x14\xea\xd9\x32\xd2\xaa\xaf" - "\x09\xce\x81\xca\x7f\xc1\x50\x5d\x13\x3a\x91\x27\x16\x97\x57\x1f\x5d\xc5" - "\x2e\x56\xc2\xca", - 1, 2048}, - {128, 128, 7, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x92\x65" - "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\xdd\x4e\xe9\xeb" - "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\xfe\x2c\x73\x23\xea\x45" - "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x1d\x92\x82\xd8\x0f\xa9\x36\x23" - "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" - "\x86\x8c\xbd\xdc\x6b\x12\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" - "\x0a\x8d\x1e\xf1\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" - "\xb6\x35\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" - "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\xe4\x95" - "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x5a\x53\xc3\xdc" - "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\xac\x1f\xa7\x9c\x64\xfd" - "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\xba\x99\xa4\x12\x6e\x4e\xea\x0b" - "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" - "\x09\xff\xaa\x17\x5d\x82\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" - "\x33\x58\x7e\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" - "\x81\xd0\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" - "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x97\x9c" - "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x2f\xe7\xcd\x8a" - "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\xc9\x2c\xb7\x75\xa8\xf6" - "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x33\x73\xaf\xde\xcb\x37\x0a\x50" - "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" - "\xd8\xb0\x84\x26\x6b\xe8\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" - "\x1a\xd2\xd6\x3a\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" - "\x9f\xc7\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" - "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x1a\xb3" - "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\xb8\xa1\x62\x8c" - "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x8e\x46\xa0\xc5\x45\x5c" - "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\xe2\x04\x30\x63\x22\x87\xb6\xc7" - "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" - "\x35\xa1\x5d\x17\x48\x55\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" - "\xab\xde\xe1\x02\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" - "\x0e\x05\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" - "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x1b\xa2" - "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x46\xb9\xc9\xf6" - "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x7a\xce\xfd\x3c\x16\xff" - "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" - "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" - "\xb5\xed\xb7\xa2\x54\x84\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" - "\xbd\xbf\x3a\xb8\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" - "\x19\x33\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" - "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\xbe\x4a" - "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x2d\x06\x98\x32" - "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\xca\xf3\xc0\xc7\x64\xee" - "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" - "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" - "\x50\x5d\xc4\xb3\x3d\x09\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" - "\xc2\x8e\xea\xbe\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" - "\x04\x9d\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" - "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x6f\xe4" - "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\xd1\x28\x4d\x7c" - "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\xf2\xd5\x36\x4a\x54\xe8" - "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x17\xd1\x20\x93\x31\x89\xff\xed" - "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" - "\x42\xdd\x99\x15\x9a\xf4\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" - "\x97\xf7\xde\x31\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" - "\x86\x9a\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a", - "\xfb\x04\xe9\x1c\xc3\x56\x9c\xb0\xba\xc4\x66\xa3\xba\x45\xac\xb8\xd6\xd8" - "\x95\x6c\x28\xd1\x51\x6d\xaa\x8c\x2e\xf1\x34\xab\xeb\x66\xf9\x4e\x24\x61" - "\x1d\x16\x99\xd5\x10\x30\x42\x31\x68\x98\xc5\xdb\x0c\x9f\x0a\x1a\x65\x7d" - "\x03\x50\xb8\x00\x0c\x40\x93\x6b\xa9\x1f\x28\x87\x01\x3c\xe9\xeb\x0e\x10" - "\x0f\x35\xbe\x9c\x6a\xfa\x00\xac\x25\x77\x5d\x49\xde\xdc\xa1\x62\xa7\xb7" - "\x30\x75\x36\x32\x31\xab\x40\xbb\x96\xba\x46\x32\x53\x8c\x35\x7d\xa4\x21" - "\xfa\x6a\xeb\x68\xe4\xa4\xbf\xac\x24\xbf\x59\x8e\x98\xa6\x53\xca\xe3\x69" - "\xdd\x47\x6e\x18\x94\xf0\x40\x03\x59\x93\x96\xde\x57\x96\x00\xaf\x56\x88" - "\xb5\x0d\x55\xbc\x24\xac\x11\xff\x4d\x72\x82\xda\xf2\xee\xbc\x56\x8a\x17" - "\x24\x6b\x88\x7e\x9c\xdb\x07\xdd\xd4\x12\x15\x4d\x9e\x1a\x57\x12\x8d\x84" - "\xdb\x17\x1a\x2f\x7a\x3d\x4c\xbb\xc2\xb8\x73\xad\x39\x13\xf8\x2e\xfc\xf9" - "\x3b\x64\x06\x9e\x78\x73\xff\x2b\x8c\x1b\x4e\x21\x3e\x05\x4d\xee\x9d\x39" - "\x7c\x61\xe1\x18\x98\xe3\x50\x25\xf9\x48\x5e\x66\x9d\x41\xa2\x08\x3f\x88" - "\x28\x03\x68\x8a\xfc\xf4\x7a\xf5\xcb\x7d\xeb\x9e\xb2\x22\xbc\x1a\x94\x51" - "\xa4\x7b\x9a\x2c\xb3\x67\x60\x94\x06\x31\x80\xa0\xf7\x7f\xe8\x47\x00\xab" - "\x0b\x56\x09\xa6\xa4\x77\x18\xa5\x30\x81\xd9\x7e\x2d\x6a\x77\x34\x4e\xca" - "\x72\x0d\xb3\x31\x87\x9c\x98\xc9\x48\x4c\xa0\x8d\xed\x9d\x7b\x9e\xb4\xfe" - "\x05\x7f\x93\x56\xa8\x2b\x07\x0b\xc5\x52\x96\xd5\x6a\xe4\xf6\x38\x79\x67" - "\xd6\xfe\x8c\x0b\x33\xe0\xe8\x15\xe7\x70\x3e\xca\xa7\x6a\xbb\x81\xf7\x94" - "\x7f\x17\xd6\x66\x96\xbf\x1c\x8f\x71\xb6\x9c\x5c\xe2\x61\x47\x7b\x6e\xa2" - "\x87\x17\x55\x08\x1d\x10\xb1\x34\x3c\x21\x16\x70\x3d\x0d\x93\x68\x5e\x46" - "\x22\x45\x00\xdb\xf0\x9b\xa1\x1f\xc7\x5b\x17\xe1\x95\x07\x57\xe5\xae\x5a" - "\x6d\x10\x83\xc4\x1c\x0d\xf5\x73\xd3\xeb\x52\x29\x33\x4f\xb0\xe7\x5c\xf6" - "\xdb\xb5\x21\x6f\x35\x9a\x43\x9c\x86\xeb\x11\x95\x91\x10\xa3\xbd\xe2\xe4" - "\x69\xac\xb1\x50\xd4\xf1\x68\xe6\x65\xb1\x96\xda\xfb\xf0\x13\x06\xa4\x63" - "\xb6\xdb\x79\x2b\x3a\xc9\x98\x7a\x2c\x37\xf9\x4f\xa6\x93\x9d\x3b\xb3\x06" - "\x63\xe2\xf6\x92\x07\xe2\x82\xfd\xb5\x08\x9b\x79\x79\x78\x3b\xee\x28\x54" - "\x81\x5d\x7a\xa3\x81\x93\xa9\xc2\x59\x3f\xb3\xc5\xcd\x89\xa2\x31\xc2\xf0" - "\x84\x8c\x2e\x0a\xa4\x2f\x9c\xf2\x54\x56\xec\x75\x39\xd7\x92\x53\x60\x58" - "\xf8\x81\x84\x0c\x99\xc4\x6f\x88\xf8\x6e\x6d\xd6\x08\x47\x6a\xa4\x79\xbc" - "\xeb\x1e\x67\xd7\xdf\x0c\x52\xdc\x74\x40\x39\x17\xdc\xd9\x13\x72\x58\xc5" - "\x30\xda\xad\x76\xa9\x9a\xad\xed\xfb\x4b\x4e\x60\xde\xc9\x18\xa0\x77\x50" - "\x54\xfa\x00\xd6\xa9\x52\xfe\x67\x3e\xe9\xdf\x46\x14\x6c\xfb\x50\xd6\x21" - "\xf6\xe5\xf7\x99\x38\xad\x65\xa5\x6c\x4e\x21\x31\x77\x7a\xdc\x6f\x5d\xb5" - "\x7f\x63\xf4\xa8\xee\x0d\x68\x10\xde\x5b\x45\x4b\x03\xd8\x55\x04\x15\x6e" - "\xc6\xb7\xc1\x30\x29\x6a\x6c\x26\xe8\x41\x53\xb9\x82\x67\x5b\xfe\xa9\x5f" - "\x0b\xf8\x38\xf8\xbe\x3c\x26\xf2\x83\x94\xd6\x45\x64\x1f\x17\x20\x4d\xae" - "\x4a\x15\x27\x7d\x7f\x3b\x71\x3c\x3a\xc3\x56\x1b\xe5\xbd\x34\x4b\x3f\x88" - "\x3e\xcc\x98\xb5\x5e\x8b\xab\x18\x98\xf0\xef\x1b\x78\x15\xb7\x4a\x1f\xe3" - "\x45\xc7\x31\x34\x5a\x7b\x6e\xb8\xea\xfe\xaf\x34\x32\x45\xfa\x3e\x75\x8a" - "\x30\x3f\xed\xe5\xfe\x66\x15\xc7\xbe\xd9\xc7\x27\x3c\x26\x66\x2d\xa1\x0b" - "\xb9\x1e\x17\x44\xd3\x4b\xe6\x30\x85\x9e\x29\x3d\xa9\x35\xca\x61\xea\x22" - "\x76\xdb\xce\x82\xfe\x8b\xac\xd3\x09\x90\xad\xf2\x42\x45\x8b\xbd\xad\x34" - "\x56\x67\x3a\x81\x3d\x95\x37\x72\xe6\xcc\x20\xe7\x09\x84\x99\x8b\x1a\x68" - "\x5f\x4e\x00\x14\x3e\x94\xa7\x15\xab\xdd\x01\x2f\x9d\x57\xce\x24\x40\x97" - "\x5e\x62\x7c\x4f\xe7\x1d\x53\x79\x05\x52\x5d\xc9\xc6\xe0\x47\xc1\xb5\x7f" - "\x47\x28\x7d\x0b\xa8\x51\x27\xb9\x21\x97\x2d\x5b\x03\x94\x30\x63\xa5\x02" - "\x04\xf0\x53\x53\x23\xfa\x81\xd1\x31\x3b\x63\x5d\x61\x3b\x44\x19\xb2\x24" - "\x15\x79\x54\xb0\x57\x8c\x17\x0d\x36\xad\xa3\x08\x71\x60\x85\xc9\x5e\x7b" - "\x55\x85\x8a\x90\x0b\x2c\x2b\x9a\x5d\xb6\x0e\xb6\xa6\x1d\xb1\xf5\xe1\xae" - "\xf9\x94\xb6\x3d\xd0\xad\x5b\xa7\x3a\x66\xd0\x31\x45\xcc\xb7\x7f\xce\x0f" - "\x07\x2e\x64\x11\xe0\xcd\xac\xdb\x75\xb1\x5a\x4a\x5b\x15\x6a\xe2\x28\x8c" - "\x6d\xe5\x5a\x82\x62\xeb\xfc\xf5\x9b\x67\xa0\x79\x75\x24\x2e\xd4\x3b\x53" - "\xd4\xec\x6b\x0f\x43\x22\xe3\xc3\x75\x83\x2d\x64\x5f\x8a\x79\x49\x5f\x1a" - "\x81\xeb\xd5\x47\xc9\xe7\xa8\x14\xd9\xcc\xb0\xa4\xea\xfc\x12\x23\xb3\x1b" - "\x7a\xac\x0f\x6a\x86\x4c\x4b\x91\x13\xa3\x52\x51\x69\xc8\xff\x52\x8f\x44", - 1, 8064}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + /* Vectors from http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ + { 128, 128, 1, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x50\x86" + "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x73\xbe\xd6\xb8" + "\xe3\xc1\x74\x3b\x71\x16\xe6\x9e\x22\x22\x95\x16\x3f\xf1\xca\xa1\x68\x1f" + "\xac\x09\x12\x0e\xca\x30\x75\x86\xe1\xa7", + 1, 512 }, + { 128, 192, 2, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d\x71\x78\x18\x3a\x9f\xa0\x71\xe8\xb4\xd9" + "\xad\xa9\xad\x7d\xed\xf4\xe5\xe7\x38\x76\x3f\x69\x14\x5a\x57\x1b\x24\x20" + "\x12\xfb\x7a\xe0\x7f\xa9\xba\xac\x3d\xf1\x02\xe0\x08\xb0\xe2\x79\x88\x59" + "\x88\x81\xd9\x20\xa9\xe6\x4f\x56\x15\xcd", + 1, 512 }, + { 128, 256, 3, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6\x9c\xfc" + "\x4e\x96\x7e\xdb\x80\x8d\x67\x9f\x77\x7b\xc6\x70\x2c\x7d\x39\xf2\x33\x69" + "\xa9\xd9\xba\xcf\xa5\x30\xe2\x63\x04\x23\x14\x61\xb2\xeb\x05\xe2\xc3\x9b" + "\xe9\xfc\xda\x6c\x19\x07\x8c\x6a\x9d\x1b", + 1, 512 }, + { 128, 128, 4, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\xfc\x47" + "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\xba\x91\x17\x8d" + "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x80\x40\xe9\x37\xb0\xd6" + "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" + "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" + "\x28\x1f\x3a\x9c\x18\x7d\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" + "\xcf\x21\xa0\x1e\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" + "\x33\x90", + "\xf0\x8f\x91\x13\x11\x01\xdc\xbb\xcd\xf9\x95\x92\xda\xbf\x2a\x86\xea\x8d" + "\xa6\x08\xc8\xb5\x65\x82\x93\x43\xb7\x0e\x14\x36\xb4\xcf\xd8\x11\xab\x21" + "\x5b\x64\xb8\xc5\xee\x27\x93\x66\x59\xd9\x1d\xc9\x84\x9d\x03\xbd\xab\xce" + "\x6a\x14\x76\x73\x17\xe3\xb3\xe5\x70\xe8\xa2\xa8\xce\xb0\xf6\xc4\xc5\xb5" + "\x8e\x22\xef\x33\xdf\x18\x42\x40\x56\xc4\xb9\x7f\x60\x9e\x8b\x45\xc1\xbf" + "\xa7\xfa\x1b\x3e\x02\x5d\xb3\x04\x93\x30\xf5\xff\x8e\xb6\x0a\xfb\x41\xfe" + "\x09\xa5\x90\xc7\x22\xab\xaa\x22\x89\xd8\x3c\x4e\x46\x18\x93\xbf\x1a\xce" + "\x77\x59", + 1, 1024 }, + { 128, 192, 5, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x19\x08\xa3\x58\x17\x14\x70\x5a\xb8\xab\x4f\x5f\xa4\x25\x2b\xec\xb6\x74" + "\x0b\x9d\x56\x3b\xaf\xa3\xa4\x2d\x3e\x1f\x18\x84\x3b\x4f\x48\xd9\xa3\xfe" + "\x59\x1e\x80\x67\x44\x35\x26\x00\x78\xda\x68\xfa\x61\x9c\xd8\x8e\x5c\xc1" + "\xff\xeb\x9c\x7d\xe7\xa9\x38\xeb\x66\xf8\x6a\x46\x71\x51\x02\xba\x8d\x70" + "\x55\x5b\x60\xc6\x4c\xae\xda\x2e\x17\xbb\x65\xef\x60\x85\x9e\x77\xe5\x83" + "\xef\x30\x08\x3a\xba\x80\x28\xc0\xa1\x93\x4c\x2a\x0b\xe1\xcb\xd0\xac\x72" + "\x72\x1d\x96\x76\x0e\xc0\xec\x7d\x84\xfd\xee\x08\xa1\x11\x20\x0d\x59\x5c" + "\x06\x3f\xa3\xf1\xd7\xa3\x1d\x29\xc3\xaa\x05\x2b\x74\x8c\x73\x60\x65\x43" + "\x76\xd4\xd7\x7b\x5f\x40\xf4\x77\xe1\xcc\x85\x37\x1c\xd8\xda\x91\xf0\x40" + "\xb2\x43\x2d\x87\x51\xd0\xce\x27\xa6\x60\xac\x67\xea\x8b\xae\x46\x2e\x78" + "\x06\x09\x8a\x82\xb0\x0d\x57\x56\x82\xfe\x89\xd2", + "\xfa\x88\xb3\x4e\x7f\x3e\x78\x4d\xfd\xb3\x38\xee\xb0\xdd\x0d\xf5\xeb\x24" + "\xe6\x70\xd8\xac\xd7\xfa\x41\x67\x2e\x2d\x7e\x9b\x26\xac\xf1\x0f\x1f\x47" + "\x6d\xff\x46\xd1\x1a\xeb\xe9\x3c\x1b\x9d\x55\x86\xde\xee\x3d\xd8\x12\x05" + "\x12\x9d\xff\x23\x97\x57\xb0\xdc\x7b\x7a\xdf\xba\x7f\x69\x85\xdf\xa9\xfd" + "\x3e\xa7\x36\x26\x30\xdd\x07\x0f\x89\x0b\x27\x9c\x23\xa1\xfa\x7d\x4e\x64" + "\x50\x07\x86\x13\x98\xee\x05\xc6\x6c\xd9\xd1\xe8\xb2\x6b\xe6\x73\x06\x39" + "\xbb\x72\x74\xa3\xc2\x1a\x40\xcd\xec\x40\x8f\x44\xf8\x86\xff\x7e\xb7\xea" + "\xda\xb0\x5c\x25\xdf\x3f\x54\xda\xca\xea\x76\xe5\xec\xbb\x21\xd3\x86\x8d" + "\x8a\x57\xf0\x31\x9f\x56\xa3\x1b\xf9\x55\xe6\xa6\xde\xb7\x74\xcc\x2b\x17" + "\x9a\xe3\x1b\x74\x0d\x2b\x99\xcd\x64\xe1\x7b\x7e\x1c\xcd\x9b\x23\x02\x7d" + "\x86\x52\xfd\x14\x2d\xbb\x75\x3d\xa3\x3b\xc1\xe0", + 1, 1536 }, + { 128, 256, 6, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x0b\xe5\x48\xa6\xa1\xbc\xac\x81\x80\x06\x5f\xae\x1e\x3f\x55\x73\x6d\x36" + "\x7f\x57\x3d\xa4\x4a\x6b\xb6\x65\x2f\xb7\xe8\x85\x47\xe2\x41\x42\xc2\x4e" + "\x58\xf1\xde\x42\x9f\x15\x4c\xaf\xea\x04\x20\xd0\x1a\x19\x36\x74\x71\x12" + "\x72\x1b\xdb\x18\xf9\x0b\xb3\xf3\x63\xd4\x62\x52\x8b\x63\x0f\x6b\x4d\xb9" + "\x70\xd6\x91\xa0\x43\x3f\x46\xfe\x43\xbb\xb8\xdc\x5e\xdb\xd4\x1f\xf0\x17" + "\x94\x25\xee\x55\x67\xbf\x4d\xda\x9d\xe7\x4b\xc6\x7a\xcf\x8f\xd7\xbb\x29" + "\x6e\x26\xd4\xc3\x08\x9b\x67\x15\xe9\x2d\x9f\x2d\x3c\x76\x26\xd3\xda\xfe" + "\x6e\x73\x9d\x09\x60\x4b\x35\x60\xdb\x77\xb6\xc0\x45\x91\xf9\x14\x8a\x7a" + "\xdd\xe2\xf1\xdf\x8f\x12\x4f\xd7\x75\xd6\x9a\x17\xda\x76\x88\xf0\xfa\x44" + "\x27\xbe\x61\xaf\x55\x9f\xc7\xf0\x76\x77\xde\xca\xd1\x47\x51\x55\xb1\xbf" + "\xfa\x1e\xca\x28\x17\x70\xf3\xb5\xd4\x32\x47\x04\xe0\x92\xd8\xa5\x03\x69" + "\x46\x99\x7f\x1e\x3f\xb2\x93\x36\xa3\x88\x75\x07\x68\xb8\x33\xce\x17\x3f" + "\x5c\xb7\x1e\x93\x38\xc5\x1d\x79\x86\x7c\x9d\x9e\x2f\x69\x38\x0f\x97\x5c" + "\x67\xbf\xa0\x8d\x37\x0b\xd3\xb1\x04\x87\x1d\x74\xfe\x30\xfb\xd0\x22\x92" + "\xf9\xf3\x23\xc9", + "\x16\x60\x36\xd9\xcf\xe8\xd6\x07\x81\xdf\x28\x0a\x40\x44\x61\x45\x83\x28" + "\xd5\x1b\xf7\x55\x54\x35\xd3\x43\x73\x0e\x7a\xc3\x83\xb1\xc9\xbd\x22\x70" + "\xf0\xde\x8f\x92\x5e\xe1\x56\xd3\x4d\x01\x64\xfa\xe9\x83\x35\x60\x80\x70" + "\xf5\xb5\x13\x76\xd3\x88\xbb\x7f\x2d\x0a\x31\x04\xb4\x77\x47\x91\x3f\xe4" + "\xa9\x9a\x19\xbe\xfb\xd6\x70\xae\xb1\xea\xd5\x03\xd6\xb5\xca\x76\x5e\x0d" + "\x21\x31\x87\xf3\xb2\x2e\xe2\xbc\x71\xb5\x8b\x7e\xa6\x09\x78\x6e\x76\xe6" + "\x61\xdf\x86\xe6\x8d\x2f\x12\x43\x99\xf9\xf1\x86\xf1\x55\xfd\x35\xcd\xe8" + "\x92\x4e\x87\x33\x77\x62\x64\xaa\x60\x07\x33\x08\x45\xf5\xd6\xb0\x9c\xf4" + "\xba\xda\x17\x74\x74\x23\x54\x9c\x7e\x86\x57\x83\x3d\xda\xc3\xe1\x02\x90" + "\xe3\x69\x80\x7a\x5b\x47\xf5\xea\x83\x1a\xc6\x1a\xaa\x53\x66\xfe\xe6\xbd" + "\x72\x9b\x8b\x96\xdb\x94\xa9\x5b\xc3\x40\x6a\xcd\xf4\x78\x14\x29\x7b\x8f" + "\x26\xb0\x89\xbd\x03\x55\x33\x46\x4c\x96\x2a\x58\x69\x7c\x9b\xdf\xba\xb8" + "\x75\x5b\xbc\x4b\x19\xd3\x9d\xee\xfd\x17\x2f\x14\xea\xd9\x32\xd2\xaa\xaf" + "\x09\xce\x81\xca\x7f\xc1\x50\x5d\x13\x3a\x91\x27\x16\x97\x57\x1f\x5d\xc5" + "\x2e\x56\xc2\xca", + 1, 2048 }, + { 128, 128, 7, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x92\x65" + "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\xdd\x4e\xe9\xeb" + "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\xfe\x2c\x73\x23\xea\x45" + "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x1d\x92\x82\xd8\x0f\xa9\x36\x23" + "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" + "\x86\x8c\xbd\xdc\x6b\x12\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" + "\x0a\x8d\x1e\xf1\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" + "\xb6\x35\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" + "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\xe4\x95" + "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x5a\x53\xc3\xdc" + "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\xac\x1f\xa7\x9c\x64\xfd" + "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\xba\x99\xa4\x12\x6e\x4e\xea\x0b" + "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" + "\x09\xff\xaa\x17\x5d\x82\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" + "\x33\x58\x7e\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" + "\x81\xd0\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" + "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x97\x9c" + "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x2f\xe7\xcd\x8a" + "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\xc9\x2c\xb7\x75\xa8\xf6" + "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x33\x73\xaf\xde\xcb\x37\x0a\x50" + "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" + "\xd8\xb0\x84\x26\x6b\xe8\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" + "\x1a\xd2\xd6\x3a\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" + "\x9f\xc7\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" + "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x1a\xb3" + "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\xb8\xa1\x62\x8c" + "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x8e\x46\xa0\xc5\x45\x5c" + "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\xe2\x04\x30\x63\x22\x87\xb6\xc7" + "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" + "\x35\xa1\x5d\x17\x48\x55\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" + "\xab\xde\xe1\x02\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" + "\x0e\x05\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" + "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x1b\xa2" + "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x46\xb9\xc9\xf6" + "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x7a\xce\xfd\x3c\x16\xff" + "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" + "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" + "\xb5\xed\xb7\xa2\x54\x84\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" + "\xbd\xbf\x3a\xb8\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" + "\x19\x33\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" + "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\xbe\x4a" + "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x2d\x06\x98\x32" + "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\xca\xf3\xc0\xc7\x64\xee" + "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" + "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" + "\x50\x5d\xc4\xb3\x3d\x09\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" + "\xc2\x8e\xea\xbe\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" + "\x04\x9d\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" + "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x6f\xe4" + "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\xd1\x28\x4d\x7c" + "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\xf2\xd5\x36\x4a\x54\xe8" + "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x17\xd1\x20\x93\x31\x89\xff\xed" + "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" + "\x42\xdd\x99\x15\x9a\xf4\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" + "\x97\xf7\xde\x31\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" + "\x86\x9a\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a", + "\xfb\x04\xe9\x1c\xc3\x56\x9c\xb0\xba\xc4\x66\xa3\xba\x45\xac\xb8\xd6\xd8" + "\x95\x6c\x28\xd1\x51\x6d\xaa\x8c\x2e\xf1\x34\xab\xeb\x66\xf9\x4e\x24\x61" + "\x1d\x16\x99\xd5\x10\x30\x42\x31\x68\x98\xc5\xdb\x0c\x9f\x0a\x1a\x65\x7d" + "\x03\x50\xb8\x00\x0c\x40\x93\x6b\xa9\x1f\x28\x87\x01\x3c\xe9\xeb\x0e\x10" + "\x0f\x35\xbe\x9c\x6a\xfa\x00\xac\x25\x77\x5d\x49\xde\xdc\xa1\x62\xa7\xb7" + "\x30\x75\x36\x32\x31\xab\x40\xbb\x96\xba\x46\x32\x53\x8c\x35\x7d\xa4\x21" + "\xfa\x6a\xeb\x68\xe4\xa4\xbf\xac\x24\xbf\x59\x8e\x98\xa6\x53\xca\xe3\x69" + "\xdd\x47\x6e\x18\x94\xf0\x40\x03\x59\x93\x96\xde\x57\x96\x00\xaf\x56\x88" + "\xb5\x0d\x55\xbc\x24\xac\x11\xff\x4d\x72\x82\xda\xf2\xee\xbc\x56\x8a\x17" + "\x24\x6b\x88\x7e\x9c\xdb\x07\xdd\xd4\x12\x15\x4d\x9e\x1a\x57\x12\x8d\x84" + "\xdb\x17\x1a\x2f\x7a\x3d\x4c\xbb\xc2\xb8\x73\xad\x39\x13\xf8\x2e\xfc\xf9" + "\x3b\x64\x06\x9e\x78\x73\xff\x2b\x8c\x1b\x4e\x21\x3e\x05\x4d\xee\x9d\x39" + "\x7c\x61\xe1\x18\x98\xe3\x50\x25\xf9\x48\x5e\x66\x9d\x41\xa2\x08\x3f\x88" + "\x28\x03\x68\x8a\xfc\xf4\x7a\xf5\xcb\x7d\xeb\x9e\xb2\x22\xbc\x1a\x94\x51" + "\xa4\x7b\x9a\x2c\xb3\x67\x60\x94\x06\x31\x80\xa0\xf7\x7f\xe8\x47\x00\xab" + "\x0b\x56\x09\xa6\xa4\x77\x18\xa5\x30\x81\xd9\x7e\x2d\x6a\x77\x34\x4e\xca" + "\x72\x0d\xb3\x31\x87\x9c\x98\xc9\x48\x4c\xa0\x8d\xed\x9d\x7b\x9e\xb4\xfe" + "\x05\x7f\x93\x56\xa8\x2b\x07\x0b\xc5\x52\x96\xd5\x6a\xe4\xf6\x38\x79\x67" + "\xd6\xfe\x8c\x0b\x33\xe0\xe8\x15\xe7\x70\x3e\xca\xa7\x6a\xbb\x81\xf7\x94" + "\x7f\x17\xd6\x66\x96\xbf\x1c\x8f\x71\xb6\x9c\x5c\xe2\x61\x47\x7b\x6e\xa2" + "\x87\x17\x55\x08\x1d\x10\xb1\x34\x3c\x21\x16\x70\x3d\x0d\x93\x68\x5e\x46" + "\x22\x45\x00\xdb\xf0\x9b\xa1\x1f\xc7\x5b\x17\xe1\x95\x07\x57\xe5\xae\x5a" + "\x6d\x10\x83\xc4\x1c\x0d\xf5\x73\xd3\xeb\x52\x29\x33\x4f\xb0\xe7\x5c\xf6" + "\xdb\xb5\x21\x6f\x35\x9a\x43\x9c\x86\xeb\x11\x95\x91\x10\xa3\xbd\xe2\xe4" + "\x69\xac\xb1\x50\xd4\xf1\x68\xe6\x65\xb1\x96\xda\xfb\xf0\x13\x06\xa4\x63" + "\xb6\xdb\x79\x2b\x3a\xc9\x98\x7a\x2c\x37\xf9\x4f\xa6\x93\x9d\x3b\xb3\x06" + "\x63\xe2\xf6\x92\x07\xe2\x82\xfd\xb5\x08\x9b\x79\x79\x78\x3b\xee\x28\x54" + "\x81\x5d\x7a\xa3\x81\x93\xa9\xc2\x59\x3f\xb3\xc5\xcd\x89\xa2\x31\xc2\xf0" + "\x84\x8c\x2e\x0a\xa4\x2f\x9c\xf2\x54\x56\xec\x75\x39\xd7\x92\x53\x60\x58" + "\xf8\x81\x84\x0c\x99\xc4\x6f\x88\xf8\x6e\x6d\xd6\x08\x47\x6a\xa4\x79\xbc" + "\xeb\x1e\x67\xd7\xdf\x0c\x52\xdc\x74\x40\x39\x17\xdc\xd9\x13\x72\x58\xc5" + "\x30\xda\xad\x76\xa9\x9a\xad\xed\xfb\x4b\x4e\x60\xde\xc9\x18\xa0\x77\x50" + "\x54\xfa\x00\xd6\xa9\x52\xfe\x67\x3e\xe9\xdf\x46\x14\x6c\xfb\x50\xd6\x21" + "\xf6\xe5\xf7\x99\x38\xad\x65\xa5\x6c\x4e\x21\x31\x77\x7a\xdc\x6f\x5d\xb5" + "\x7f\x63\xf4\xa8\xee\x0d\x68\x10\xde\x5b\x45\x4b\x03\xd8\x55\x04\x15\x6e" + "\xc6\xb7\xc1\x30\x29\x6a\x6c\x26\xe8\x41\x53\xb9\x82\x67\x5b\xfe\xa9\x5f" + "\x0b\xf8\x38\xf8\xbe\x3c\x26\xf2\x83\x94\xd6\x45\x64\x1f\x17\x20\x4d\xae" + "\x4a\x15\x27\x7d\x7f\x3b\x71\x3c\x3a\xc3\x56\x1b\xe5\xbd\x34\x4b\x3f\x88" + "\x3e\xcc\x98\xb5\x5e\x8b\xab\x18\x98\xf0\xef\x1b\x78\x15\xb7\x4a\x1f\xe3" + "\x45\xc7\x31\x34\x5a\x7b\x6e\xb8\xea\xfe\xaf\x34\x32\x45\xfa\x3e\x75\x8a" + "\x30\x3f\xed\xe5\xfe\x66\x15\xc7\xbe\xd9\xc7\x27\x3c\x26\x66\x2d\xa1\x0b" + "\xb9\x1e\x17\x44\xd3\x4b\xe6\x30\x85\x9e\x29\x3d\xa9\x35\xca\x61\xea\x22" + "\x76\xdb\xce\x82\xfe\x8b\xac\xd3\x09\x90\xad\xf2\x42\x45\x8b\xbd\xad\x34" + "\x56\x67\x3a\x81\x3d\x95\x37\x72\xe6\xcc\x20\xe7\x09\x84\x99\x8b\x1a\x68" + "\x5f\x4e\x00\x14\x3e\x94\xa7\x15\xab\xdd\x01\x2f\x9d\x57\xce\x24\x40\x97" + "\x5e\x62\x7c\x4f\xe7\x1d\x53\x79\x05\x52\x5d\xc9\xc6\xe0\x47\xc1\xb5\x7f" + "\x47\x28\x7d\x0b\xa8\x51\x27\xb9\x21\x97\x2d\x5b\x03\x94\x30\x63\xa5\x02" + "\x04\xf0\x53\x53\x23\xfa\x81\xd1\x31\x3b\x63\x5d\x61\x3b\x44\x19\xb2\x24" + "\x15\x79\x54\xb0\x57\x8c\x17\x0d\x36\xad\xa3\x08\x71\x60\x85\xc9\x5e\x7b" + "\x55\x85\x8a\x90\x0b\x2c\x2b\x9a\x5d\xb6\x0e\xb6\xa6\x1d\xb1\xf5\xe1\xae" + "\xf9\x94\xb6\x3d\xd0\xad\x5b\xa7\x3a\x66\xd0\x31\x45\xcc\xb7\x7f\xce\x0f" + "\x07\x2e\x64\x11\xe0\xcd\xac\xdb\x75\xb1\x5a\x4a\x5b\x15\x6a\xe2\x28\x8c" + "\x6d\xe5\x5a\x82\x62\xeb\xfc\xf5\x9b\x67\xa0\x79\x75\x24\x2e\xd4\x3b\x53" + "\xd4\xec\x6b\x0f\x43\x22\xe3\xc3\x75\x83\x2d\x64\x5f\x8a\x79\x49\x5f\x1a" + "\x81\xeb\xd5\x47\xc9\xe7\xa8\x14\xd9\xcc\xb0\xa4\xea\xfc\x12\x23\xb3\x1b" + "\x7a\xac\x0f\x6a\x86\x4c\x4b\x91\x13\xa3\x52\x51\x69\xc8\xff\x52\x8f\x44", + 1, 8064 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/aes_cbcs_test.c b/test/kat-app/aes_cbcs_test.c index be489c47..1d430579 100644 --- a/test/kat-app/aes_cbcs_test.c +++ b/test/kat-app/aes_cbcs_test.c @@ -36,29 +36,23 @@ #include "utils.h" #include "cipher_test.h" -int aes_cbcs_test(struct IMB_MGR *mb_mgr); +int +aes_cbcs_test(struct IMB_MGR *mb_mgr); extern const struct cipher_test aes_cbcs_test_json[]; static int -aes_job_ok(const struct IMB_JOB *job, - const uint8_t *out_text, - const uint8_t *target, - const uint8_t *padding, - const size_t sizeof_padding, - const unsigned text_len, - const uint8_t *last_cipher_block, - const uint8_t *next_iv) +aes_job_ok(const struct IMB_JOB *job, const uint8_t *out_text, const uint8_t *target, + const uint8_t *padding, const size_t sizeof_padding, const unsigned text_len, + const uint8_t *last_cipher_block, const uint8_t *next_iv) { - const int num = (const int)((uint64_t)job->user_data2); + const int num = (const int) ((uint64_t) job->user_data2); if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %d", - __LINE__, job->status, num); + printf("%d error status:%d, job %d", __LINE__, job->status, num); return 0; } - if (memcmp(out_text, target + sizeof_padding, - text_len)) { + if (memcmp(out_text, target + sizeof_padding, text_len)) { printf("%d mismatched\n", num); return 0; } @@ -66,9 +60,7 @@ aes_job_ok(const struct IMB_JOB *job, printf("%d overwrite head\n", num); return 0; } - if (memcmp(padding, - target + sizeof_padding + text_len, - sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { printf("%d overwrite tail\n", num); return 0; } @@ -80,19 +72,10 @@ aes_job_ok(const struct IMB_JOB *job, } static int -test_aes_many(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const size_t text_len, - const int dir, - const int order, - const IMB_CIPHER_MODE cipher, - const int in_place, - const size_t key_len, - const int num_jobs) +test_aes_many(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, const void *iv, + const uint8_t *in_text, const uint8_t *out_text, const size_t text_len, const int dir, + const int order, const IMB_CIPHER_MODE cipher, const int in_place, + const size_t key_len, const int num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -118,16 +101,13 @@ test_aes_many(struct IMB_MGR *mb_mgr, /* get offset of last AES block to be processed */ if (text_len >= 16) /* last block offset = (number of blocks - 1) * 160 */ - last_block_offset = - (((text_len + 9 * IMB_AES_BLOCK_SIZE) / 160) - 1) * 160; + last_block_offset = (((text_len + 9 * IMB_AES_BLOCK_SIZE) / 160) - 1) * 160; /* store copy of last ciphertext block to validate context */ if (dir == IMB_DIR_ENCRYPT) - memcpy(last_cipher_block, out_text + last_block_offset, - IMB_AES_BLOCK_SIZE); + memcpy(last_cipher_block, out_text + last_block_offset, IMB_AES_BLOCK_SIZE); else - memcpy(last_cipher_block, in_text + last_block_offset, - IMB_AES_BLOCK_SIZE); + memcpy(last_cipher_block, in_text + last_block_offset, IMB_AES_BLOCK_SIZE); for (i = 0; i < num_jobs; i++) { targets[i] = malloc(text_len + (sizeof(padding) * 2)); @@ -138,8 +118,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, memset(targets[i], 0, text_len + (sizeof(padding) * 2)); memcpy(targets[i], padding, sizeof(padding)); - memcpy(targets[i] + sizeof(padding) + text_len, - padding, sizeof(padding)); + memcpy(targets[i] + sizeof(padding) + text_len, padding, sizeof(padding)); if (in_place) { /* copy input text to the allocated buffer */ @@ -179,7 +158,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); job->hash_alg = IMB_AUTH_NULL; @@ -188,10 +167,9 @@ test_aes_many(struct IMB_MGR *mb_mgr, job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { jobs_rx++; - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), (unsigned) text_len, - (uint8_t *)&last_cipher_block, - next_ivs[(uint64_t)job->user_data2])) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), + (unsigned) text_len, (uint8_t *) &last_cipher_block, + next_ivs[(uint64_t) job->user_data2])) goto end; /* reset job next_iv pointer */ job->cipher_fields.CBCS.next_iv = NULL; @@ -203,10 +181,9 @@ test_aes_many(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), (unsigned) text_len, - (uint8_t *)&last_cipher_block, - next_ivs[(uint64_t)job->user_data2])) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), + (unsigned) text_len, (uint8_t *) &last_cipher_block, + next_ivs[(uint64_t) job->user_data2])) goto end; /* reset job next_iv pointer */ job->cipher_fields.CBCS.next_iv = NULL; @@ -218,7 +195,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -240,71 +217,65 @@ end_alloc: } static void -test_aes_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, +test_aes_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const IMB_CIPHER_MODE cipher, const int num_jobs) { const struct cipher_test *v = aes_cbcs_test_json; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (!quiet_mode) - printf("AES-CBCS Test (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("AES-CBCS Test (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("AES-CBCS Test Case %zu key_len:%zu\n", - v->tcId, v->keySize); + printf("AES-CBCS Test Case %zu key_len:%zu\n", v->tcId, v->keySize); #else printf("."); #endif } IMB_AES_KEYEXP_128(mb_mgr, v->key, enc_keys, dec_keys); - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - (const void *) v->iv, (const void *) v->msg, - (const void *) v->ct, v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, (const void *) v->iv, + (const void *) v->msg, (const void *) v->ct, v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0, v->keySize / 8, + num_jobs)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - (const void *) v->iv, (const void *) v->ct, - (const void *) v->msg, v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, (const void *) v->iv, + (const void *) v->ct, (const void *) v->msg, v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0, v->keySize / 8, + num_jobs)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - (const void *) v->iv, (const void *) v->msg, - (const void *) v->ct, v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, (const void *) v->iv, + (const void *) v->msg, (const void *) v->ct, v->msgSize / 8, + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1, v->keySize / 8, + num_jobs)) { printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - (const void *) v->iv, (const void *) v->ct, - (const void *) v->msg, v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, v->keySize / 8, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, (const void *) v->iv, + (const void *) v->ct, (const void *) v->msg, v->msgSize / 8, + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1, v->keySize / 8, + num_jobs)) { printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } @@ -312,18 +283,15 @@ test_aes_vectors(struct IMB_MGR *mb_mgr, int aes_cbcs_test(struct IMB_MGR *mb_mgr) { - const int num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 - }; + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 }; unsigned i; int errors = 0; struct test_suite_context ctx; test_suite_start(&ctx, "AES-CBCS-128"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_aes_vectors(mb_mgr, &ctx, IMB_CIPHER_CBCS_1_9, - num_jobs_tab[i]); + test_aes_vectors(mb_mgr, &ctx, IMB_CIPHER_CBCS_1_9, num_jobs_tab[i]); errors = test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/aes_cbcs_test.json.c b/test/kat-app/aes_cbcs_test.json.c index 49a0f773..0219aed6 100644 --- a/test/kat-app/aes_cbcs_test.json.c +++ b/test/kat-app/aes_cbcs_test.json.c @@ -29,1491 +29,1483 @@ #include "cipher_test.h" const struct cipher_test aes_cbcs_test_json[] = { /* - * Vectors from http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf - */ - {128, 128, 1, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x86" - "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\xbe\xd6\xb8" - "\xe3\xc1\x74\x3b\x71\x16\xe6\x9e\x22\x22\x95\x16\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf1\xca\xa1\x68\x1f" - "\xac\x09\x12\x0e\xca\x30\x75\x86\xe1\xa7\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - 1, 5120}, - {128, 128, 2, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x47" - "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x91\x17\x8d" - "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x40\xe9\x37\xb0\xd6" - "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" - "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" - "\x28\x1f\x3a\x9c\x18\x7d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" - "\xcf\x21\xa0\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" - "\x33\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00", - "\xf0\x8f\x91\x13\x11\x01\xdc\xbb\xcd\xf9\x95\x92\xda\xbf\x2a\x86\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xea\x8d" - "\xa6\x08\xc8\xb5\x65\x82\x93\x43\xb7\x0e\x14\x36\xb4\xcf\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\x11\xab\x21" - "\x5b\x64\xb8\xc5\xee\x27\x93\x66\x59\xd9\x1d\xc9\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x84\x9d\x03\xbd\xab\xce" - "\x6a\x14\x76\x73\x17\xe3\xb3\xe5\x70\xe8\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xa8\xce\xb0\xf6\xc4\xc5\xb5" - "\x8e\x22\xef\x33\xdf\x18\x42\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x56\xc4\xb9\x7f\x60\x9e\x8b\x45\xc1\xbf" - "\xa7\xfa\x1b\x3e\x02\x5d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\xb3\x04\x93\x30\xf5\xff\x8e\xb6\x0a\xfb\x41\xfe" - "\x09\xa5\x90\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x22\xab\xaa\x22\x89\xd8\x3c\x4e\x46\x18\x93\xbf\x1a\xce" - "\x77\x59\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00", - 1, 10240}, - {128, 128, 3, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x65" - "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\x4e\xe9\xeb" - "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\x2c\x73\x23\xea\x45" - "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x92\x82\xd8\x0f\xa9\x36\x23" - "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" - "\x86\x8c\xbd\xdc\x6b\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" - "\x0a\x8d\x1e\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" - "\xb6\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x95" - "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5a\x53\xc3\xdc" - "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\x1f\xa7\x9c\x64\xfd" - "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x99\xa4\x12\x6e\x4e\xea\x0b" - "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" - "\x09\xff\xaa\x17\x5d\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" - "\x33\x58\x7e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" - "\x81\xd0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x97\x9c" - "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\xe7\xcd\x8a" - "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc9\x2c\xb7\x75\xa8\xf6" - "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x33\x73\xaf\xde\xcb\x37\x0a\x50" - "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" - "\xd8\xb0\x84\x26\x6b\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" - "\x1a\xd2\xd6\x3a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" - "\x9f\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\xb3" - "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\xa1\x62\x8c" - "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x46\xa0\xc5\x45\x5c" - "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe2\x04\x30\x63\x22\x87\xb6\xc7" - "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" - "\x35\xa1\x5d\x17\x48\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" - "\xab\xde\xe1\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" - "\x0e\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\xa2" - "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\xb9\xc9\xf6" - "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7a\xce\xfd\x3c\x16\xff" - "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" - "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" - "\xb5\xed\xb7\xa2\x54\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" - "\xbd\xbf\x3a\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" - "\x19\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x4a" - "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x06\x98\x32" - "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\xf3\xc0\xc7\x64\xee" - "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" - "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" - "\x50\x5d\xc4\xb3\x3d\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" - "\xc2\x8e\xea\xbe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" - "\x04\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6f\xe4" - "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x28\x4d\x7c" - "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf2\xd5\x36\x4a\x54\xe8" - "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\xd1\x20\x93\x31\x89\xff\xed" - "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" - "\x42\xdd\x99\x15\x9a\xf4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" - "\x97\xf7\xde\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" - "\x86\x9a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xfb\x04\xe9\x1c\xc3\x56\x9c\xb0\xba\xc4\x66\xa3\xba\x45\xac\xb8\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd6\xd8" - "\x95\x6c\x28\xd1\x51\x6d\xaa\x8c\x2e\xf1\x34\xab\xeb\x66\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x4e\x24\x61" - "\x1d\x16\x99\xd5\x10\x30\x42\x31\x68\x98\xc5\xdb\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x9f\x0a\x1a\x65\x7d" - "\x03\x50\xb8\x00\x0c\x40\x93\x6b\xa9\x1f\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x87\x01\x3c\xe9\xeb\x0e\x10" - "\x0f\x35\xbe\x9c\x6a\xfa\x00\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x25\x77\x5d\x49\xde\xdc\xa1\x62\xa7\xb7" - "\x30\x75\x36\x32\x31\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x40\xbb\x96\xba\x46\x32\x53\x8c\x35\x7d\xa4\x21" - "\xfa\x6a\xeb\x68\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\xe4\xa4\xbf\xac\x24\xbf\x59\x8e\x98\xa6\x53\xca\xe3\x69" - "\xdd\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x6e\x18\x94\xf0\x40\x03\x59\x93\x96\xde\x57\x96\x00\xaf\x56\x88" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\xb5\x0d\x55\xbc\x24\xac\x11\xff\x4d\x72\x82\xda\xf2\xee\xbc\x56\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8a\x17" - "\x24\x6b\x88\x7e\x9c\xdb\x07\xdd\xd4\x12\x15\x4d\x9e\x1a\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x57\x12\x8d\x84" - "\xdb\x17\x1a\x2f\x7a\x3d\x4c\xbb\xc2\xb8\x73\xad\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\x13\xf8\x2e\xfc\xf9" - "\x3b\x64\x06\x9e\x78\x73\xff\x2b\x8c\x1b\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4e\x21\x3e\x05\x4d\xee\x9d\x39" - "\x7c\x61\xe1\x18\x98\xe3\x50\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x48\x5e\x66\x9d\x41\xa2\x08\x3f\x88" - "\x28\x03\x68\x8a\xfc\xf4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x7a\xf5\xcb\x7d\xeb\x9e\xb2\x22\xbc\x1a\x94\x51" - "\xa4\x7b\x9a\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\xb3\x67\x60\x94\x06\x31\x80\xa0\xf7\x7f\xe8\x47\x00\xab" - "\x0b\x56\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x09\xa6\xa4\x77\x18\xa5\x30\x81\xd9\x7e\x2d\x6a\x77\x34\x4e\xca" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x72\x0d\xb3\x31\x87\x9c\x98\xc9\x48\x4c\xa0\x8d\xed\x9d\x7b\x9e\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\xfe" - "\x05\x7f\x93\x56\xa8\x2b\x07\x0b\xc5\x52\x96\xd5\x6a\xe4\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x38\x79\x67" - "\xd6\xfe\x8c\x0b\x33\xe0\xe8\x15\xe7\x70\x3e\xca\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa7\x6a\xbb\x81\xf7\x94" - "\x7f\x17\xd6\x66\x96\xbf\x1c\x8f\x71\xb6\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x5c\xe2\x61\x47\x7b\x6e\xa2" - "\x87\x17\x55\x08\x1d\x10\xb1\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x21\x16\x70\x3d\x0d\x93\x68\x5e\x46" - "\x22\x45\x00\xdb\xf0\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\xa1\x1f\xc7\x5b\x17\xe1\x95\x07\x57\xe5\xae\x5a" - "\x6d\x10\x83\xc4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x1c\x0d\xf5\x73\xd3\xeb\x52\x29\x33\x4f\xb0\xe7\x5c\xf6" - "\xdb\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x21\x6f\x35\x9a\x43\x9c\x86\xeb\x11\x95\x91\x10\xa3\xbd\xe2\xe4" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x69\xac\xb1\x50\xd4\xf1\x68\xe6\x65\xb1\x96\xda\xfb\xf0\x13\x06\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x63" - "\xb6\xdb\x79\x2b\x3a\xc9\x98\x7a\x2c\x37\xf9\x4f\xa6\x93\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x3b\xb3\x06" - "\x63\xe2\xf6\x92\x07\xe2\x82\xfd\xb5\x08\x9b\x79\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x79\x78\x3b\xee\x28\x54" - "\x81\x5d\x7a\xa3\x81\x93\xa9\xc2\x59\x3f\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb3\xc5\xcd\x89\xa2\x31\xc2\xf0" - "\x84\x8c\x2e\x0a\xa4\x2f\x9c\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x54\x56\xec\x75\x39\xd7\x92\x53\x60\x58" - "\xf8\x81\x84\x0c\x99\xc4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x6f\x88\xf8\x6e\x6d\xd6\x08\x47\x6a\xa4\x79\xbc" - "\xeb\x1e\x67\xd7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\xdf\x0c\x52\xdc\x74\x40\x39\x17\xdc\xd9\x13\x72\x58\xc5" - "\x30\xda\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\xad\x76\xa9\x9a\xad\xed\xfb\x4b\x4e\x60\xde\xc9\x18\xa0\x77\x50" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x54\xfa\x00\xd6\xa9\x52\xfe\x67\x3e\xe9\xdf\x46\x14\x6c\xfb\x50\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd6\x21" - "\xf6\xe5\xf7\x99\x38\xad\x65\xa5\x6c\x4e\x21\x31\x77\x7a\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdc\x6f\x5d\xb5" - "\x7f\x63\xf4\xa8\xee\x0d\x68\x10\xde\x5b\x45\x4b\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xd8\x55\x04\x15\x6e" - "\xc6\xb7\xc1\x30\x29\x6a\x6c\x26\xe8\x41\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\xb9\x82\x67\x5b\xfe\xa9\x5f" - "\x0b\xf8\x38\xf8\xbe\x3c\x26\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x83\x94\xd6\x45\x64\x1f\x17\x20\x4d\xae" - "\x4a\x15\x27\x7d\x7f\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x71\x3c\x3a\xc3\x56\x1b\xe5\xbd\x34\x4b\x3f\x88" - "\x3e\xcc\x98\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x5e\x8b\xab\x18\x98\xf0\xef\x1b\x78\x15\xb7\x4a\x1f\xe3" - "\x45\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x31\x34\x5a\x7b\x6e\xb8\xea\xfe\xaf\x34\x32\x45\xfa\x3e\x75\x8a" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x30\x3f\xed\xe5\xfe\x66\x15\xc7\xbe\xd9\xc7\x27\x3c\x26\x66\x2d\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa1\x0b" - "\xb9\x1e\x17\x44\xd3\x4b\xe6\x30\x85\x9e\x29\x3d\xa9\x35\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\x61\xea\x22" - "\x76\xdb\xce\x82\xfe\x8b\xac\xd3\x09\x90\xad\xf2\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x42\x45\x8b\xbd\xad\x34" - "\x56\x67\x3a\x81\x3d\x95\x37\x72\xe6\xcc\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\xe7\x09\x84\x99\x8b\x1a\x68" - "\x5f\x4e\x00\x14\x3e\x94\xa7\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\xab\xdd\x01\x2f\x9d\x57\xce\x24\x40\x97" - "\x5e\x62\x7c\x4f\xe7\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x53\x79\x05\x52\x5d\xc9\xc6\xe0\x47\xc1\xb5\x7f" - "\x47\x28\x7d\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\xa8\x51\x27\xb9\x21\x97\x2d\x5b\x03\x94\x30\x63\xa5\x02" - "\x04\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x53\x53\x23\xfa\x81\xd1\x31\x3b\x63\x5d\x61\x3b\x44\x19\xb2\x24" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x15\x79\x54\xb0\x57\x8c\x17\x0d\x36\xad\xa3\x08\x71\x60\x85\xc9\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x7b" - "\x55\x85\x8a\x90\x0b\x2c\x2b\x9a\x5d\xb6\x0e\xb6\xa6\x1d\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb1\xf5\xe1\xae" - "\xf9\x94\xb6\x3d\xd0\xad\x5b\xa7\x3a\x66\xd0\x31\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\xcc\xb7\x7f\xce\x0f" - "\x07\x2e\x64\x11\xe0\xcd\xac\xdb\x75\xb1\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5a\x4a\x5b\x15\x6a\xe2\x28\x8c" - "\x6d\xe5\x5a\x82\x62\xeb\xfc\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x67\xa0\x79\x75\x24\x2e\xd4\x3b\x53" - "\xd4\xec\x6b\x0f\x43\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\xe3\xc3\x75\x83\x2d\x64\x5f\x8a\x79\x49\x5f\x1a" - "\x81\xeb\xd5\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\xc9\xe7\xa8\x14\xd9\xcc\xb0\xa4\xea\xfc\x12\x23\xb3\x1b" - "\x7a\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x0f\x6a\x86\x4c\x4b\x91\x13\xa3\x52\x51\x69\xc8\xff\x52\x8f\x44" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - 1, 80640}, - {128, 128, 4, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00", - "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00", - 1, 640}, - {128, 128, 5, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x86" - "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - 1, 2432}, - {128, 128, 6, - "\x5a\x2b\x4f\x1f\x4b\xab\x08\xea\xac\x78\xf7\x4b\xca\x3b\x4f\xa9", - "\x84\x38\x02\x6b\x5e\xb6\xc5\xb5\x8a\x9a\xf0\x20\x95\x7a\x46\x10", - "\x0d\xbc\xe9\x8c\x31\x07\x59\x65\x66\xcb\x4f\xa0\x5d\x6c\xf9\x63\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xda" - "\xb3\x61\x42\xa6\x1f\x38\x49\xa1\x55\x9b\xe1\xf6\xee\xd9\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcb\xd1\x42\x10" - "\x13\x24\x80\xa7\xa1\xd9\xeb\xfe\x3a\xd7\xef\x48\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2e\x81\x48\x53\xea\x35" - "\x0c\x1a\x29\xdd\xc3\xed\xc4\x71\x55\x97\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x3b\xb9\x7a\x94\x26\xba\x3a" - "\xa6\x64\x66\x1a\x11\x32\xb7\x6e", - "\xe5\xb9\xdb\x9d\x79\x53\x98\x92\x56\x9a\x90\xd2\xea\xc2\x37\xb9\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\xa2" - "\x61\x08\xc4\x15\x47\x41\x18\xf5\x73\x56\xee\x36\x6f\xcc\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\xe0\x4f\x0b" - "\xce\x32\xcf\x58\x88\x95\x87\x8a\xf8\x00\xd3\x3d\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xb0\xd3\x51\x1c\x1e" - "\x58\x65\x2d\x7c\x94\x70\xcf\x32\x0f\xb7\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9f\x53\x3a\x47\x3b\x4d\x99\xeb" - "\x86\xd2\xcf\x6a\x6c\x50\x42\xe5", - 1, 5248}, - {128, 128, 7, - "\x5a\x2b\x4f\x1f\x4b\xab\x08\xea\xac\x78\xf7\x4b\xca\x3b\x4f\xa9", - "\x84\x38\x02\x6b\x5e\xb6\xc5\xb5\x8a\x9a\xf0\x20\x95\x7a\x46\x10", - "\xb2\x4c\x2d\x5c\xaf\x35\xce\x96\x76\xde\x0f\xc7\x77\x87\x1f\x7d", - "\x15\xda\xb3\xcf\x2d\xf2\x62\x0f\x53\x66\xc8\x2e\x3b\x25\xa2\xd7", - 1, 128}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + * Vectors from http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf + */ + { 128, 128, 1, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x86" + "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\xbe\xd6\xb8" + "\xe3\xc1\x74\x3b\x71\x16\xe6\x9e\x22\x22\x95\x16\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf1\xca\xa1\x68\x1f" + "\xac\x09\x12\x0e\xca\x30\x75\x86\xe1\xa7\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 5120 }, + { 128, 128, 2, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x47" + "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x91\x17\x8d" + "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x40\xe9\x37\xb0\xd6" + "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" + "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" + "\x28\x1f\x3a\x9c\x18\x7d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" + "\xcf\x21\xa0\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" + "\x33\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00", + "\xf0\x8f\x91\x13\x11\x01\xdc\xbb\xcd\xf9\x95\x92\xda\xbf\x2a\x86\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xea\x8d" + "\xa6\x08\xc8\xb5\x65\x82\x93\x43\xb7\x0e\x14\x36\xb4\xcf\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\x11\xab\x21" + "\x5b\x64\xb8\xc5\xee\x27\x93\x66\x59\xd9\x1d\xc9\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x84\x9d\x03\xbd\xab\xce" + "\x6a\x14\x76\x73\x17\xe3\xb3\xe5\x70\xe8\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xa8\xce\xb0\xf6\xc4\xc5\xb5" + "\x8e\x22\xef\x33\xdf\x18\x42\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x56\xc4\xb9\x7f\x60\x9e\x8b\x45\xc1\xbf" + "\xa7\xfa\x1b\x3e\x02\x5d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xb3\x04\x93\x30\xf5\xff\x8e\xb6\x0a\xfb\x41\xfe" + "\x09\xa5\x90\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x22\xab\xaa\x22\x89\xd8\x3c\x4e\x46\x18\x93\xbf\x1a\xce" + "\x77\x59\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00", + 1, 10240 }, + { 128, 128, 3, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x92\x65" + "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\x4e\xe9\xeb" + "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\x2c\x73\x23\xea\x45" + "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x92\x82\xd8\x0f\xa9\x36\x23" + "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" + "\x86\x8c\xbd\xdc\x6b\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" + "\x0a\x8d\x1e\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" + "\xb6\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x95" + "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5a\x53\xc3\xdc" + "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\x1f\xa7\x9c\x64\xfd" + "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x99\xa4\x12\x6e\x4e\xea\x0b" + "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" + "\x09\xff\xaa\x17\x5d\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" + "\x33\x58\x7e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" + "\x81\xd0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x97\x9c" + "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\xe7\xcd\x8a" + "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc9\x2c\xb7\x75\xa8\xf6" + "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x33\x73\xaf\xde\xcb\x37\x0a\x50" + "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" + "\xd8\xb0\x84\x26\x6b\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" + "\x1a\xd2\xd6\x3a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" + "\x9f\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\xb3" + "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\xa1\x62\x8c" + "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x46\xa0\xc5\x45\x5c" + "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe2\x04\x30\x63\x22\x87\xb6\xc7" + "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" + "\x35\xa1\x5d\x17\x48\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" + "\xab\xde\xe1\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" + "\x0e\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1b\xa2" + "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\xb9\xc9\xf6" + "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7a\xce\xfd\x3c\x16\xff" + "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" + "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" + "\xb5\xed\xb7\xa2\x54\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" + "\xbd\xbf\x3a\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" + "\x19\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x4a" + "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x06\x98\x32" + "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\xf3\xc0\xc7\x64\xee" + "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" + "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" + "\x50\x5d\xc4\xb3\x3d\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" + "\xc2\x8e\xea\xbe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" + "\x04\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6f\xe4" + "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x28\x4d\x7c" + "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf2\xd5\x36\x4a\x54\xe8" + "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\xd1\x20\x93\x31\x89\xff\xed" + "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" + "\x42\xdd\x99\x15\x9a\xf4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" + "\x97\xf7\xde\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" + "\x86\x9a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfb\x04\xe9\x1c\xc3\x56\x9c\xb0\xba\xc4\x66\xa3\xba\x45\xac\xb8\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd6\xd8" + "\x95\x6c\x28\xd1\x51\x6d\xaa\x8c\x2e\xf1\x34\xab\xeb\x66\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x4e\x24\x61" + "\x1d\x16\x99\xd5\x10\x30\x42\x31\x68\x98\xc5\xdb\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x9f\x0a\x1a\x65\x7d" + "\x03\x50\xb8\x00\x0c\x40\x93\x6b\xa9\x1f\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x87\x01\x3c\xe9\xeb\x0e\x10" + "\x0f\x35\xbe\x9c\x6a\xfa\x00\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x25\x77\x5d\x49\xde\xdc\xa1\x62\xa7\xb7" + "\x30\x75\x36\x32\x31\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x40\xbb\x96\xba\x46\x32\x53\x8c\x35\x7d\xa4\x21" + "\xfa\x6a\xeb\x68\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xe4\xa4\xbf\xac\x24\xbf\x59\x8e\x98\xa6\x53\xca\xe3\x69" + "\xdd\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x6e\x18\x94\xf0\x40\x03\x59\x93\x96\xde\x57\x96\x00\xaf\x56\x88" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\xb5\x0d\x55\xbc\x24\xac\x11\xff\x4d\x72\x82\xda\xf2\xee\xbc\x56\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8a\x17" + "\x24\x6b\x88\x7e\x9c\xdb\x07\xdd\xd4\x12\x15\x4d\x9e\x1a\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x57\x12\x8d\x84" + "\xdb\x17\x1a\x2f\x7a\x3d\x4c\xbb\xc2\xb8\x73\xad\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\x13\xf8\x2e\xfc\xf9" + "\x3b\x64\x06\x9e\x78\x73\xff\x2b\x8c\x1b\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4e\x21\x3e\x05\x4d\xee\x9d\x39" + "\x7c\x61\xe1\x18\x98\xe3\x50\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x48\x5e\x66\x9d\x41\xa2\x08\x3f\x88" + "\x28\x03\x68\x8a\xfc\xf4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x7a\xf5\xcb\x7d\xeb\x9e\xb2\x22\xbc\x1a\x94\x51" + "\xa4\x7b\x9a\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xb3\x67\x60\x94\x06\x31\x80\xa0\xf7\x7f\xe8\x47\x00\xab" + "\x0b\x56\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x09\xa6\xa4\x77\x18\xa5\x30\x81\xd9\x7e\x2d\x6a\x77\x34\x4e\xca" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x72\x0d\xb3\x31\x87\x9c\x98\xc9\x48\x4c\xa0\x8d\xed\x9d\x7b\x9e\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\xfe" + "\x05\x7f\x93\x56\xa8\x2b\x07\x0b\xc5\x52\x96\xd5\x6a\xe4\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x38\x79\x67" + "\xd6\xfe\x8c\x0b\x33\xe0\xe8\x15\xe7\x70\x3e\xca\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa7\x6a\xbb\x81\xf7\x94" + "\x7f\x17\xd6\x66\x96\xbf\x1c\x8f\x71\xb6\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x5c\xe2\x61\x47\x7b\x6e\xa2" + "\x87\x17\x55\x08\x1d\x10\xb1\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x21\x16\x70\x3d\x0d\x93\x68\x5e\x46" + "\x22\x45\x00\xdb\xf0\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xa1\x1f\xc7\x5b\x17\xe1\x95\x07\x57\xe5\xae\x5a" + "\x6d\x10\x83\xc4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x1c\x0d\xf5\x73\xd3\xeb\x52\x29\x33\x4f\xb0\xe7\x5c\xf6" + "\xdb\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x21\x6f\x35\x9a\x43\x9c\x86\xeb\x11\x95\x91\x10\xa3\xbd\xe2\xe4" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x69\xac\xb1\x50\xd4\xf1\x68\xe6\x65\xb1\x96\xda\xfb\xf0\x13\x06\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x63" + "\xb6\xdb\x79\x2b\x3a\xc9\x98\x7a\x2c\x37\xf9\x4f\xa6\x93\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x3b\xb3\x06" + "\x63\xe2\xf6\x92\x07\xe2\x82\xfd\xb5\x08\x9b\x79\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x79\x78\x3b\xee\x28\x54" + "\x81\x5d\x7a\xa3\x81\x93\xa9\xc2\x59\x3f\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb3\xc5\xcd\x89\xa2\x31\xc2\xf0" + "\x84\x8c\x2e\x0a\xa4\x2f\x9c\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x54\x56\xec\x75\x39\xd7\x92\x53\x60\x58" + "\xf8\x81\x84\x0c\x99\xc4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x6f\x88\xf8\x6e\x6d\xd6\x08\x47\x6a\xa4\x79\xbc" + "\xeb\x1e\x67\xd7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xdf\x0c\x52\xdc\x74\x40\x39\x17\xdc\xd9\x13\x72\x58\xc5" + "\x30\xda\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\xad\x76\xa9\x9a\xad\xed\xfb\x4b\x4e\x60\xde\xc9\x18\xa0\x77\x50" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x54\xfa\x00\xd6\xa9\x52\xfe\x67\x3e\xe9\xdf\x46\x14\x6c\xfb\x50\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd6\x21" + "\xf6\xe5\xf7\x99\x38\xad\x65\xa5\x6c\x4e\x21\x31\x77\x7a\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdc\x6f\x5d\xb5" + "\x7f\x63\xf4\xa8\xee\x0d\x68\x10\xde\x5b\x45\x4b\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xd8\x55\x04\x15\x6e" + "\xc6\xb7\xc1\x30\x29\x6a\x6c\x26\xe8\x41\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\xb9\x82\x67\x5b\xfe\xa9\x5f" + "\x0b\xf8\x38\xf8\xbe\x3c\x26\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x83\x94\xd6\x45\x64\x1f\x17\x20\x4d\xae" + "\x4a\x15\x27\x7d\x7f\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x71\x3c\x3a\xc3\x56\x1b\xe5\xbd\x34\x4b\x3f\x88" + "\x3e\xcc\x98\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x5e\x8b\xab\x18\x98\xf0\xef\x1b\x78\x15\xb7\x4a\x1f\xe3" + "\x45\xc7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x31\x34\x5a\x7b\x6e\xb8\xea\xfe\xaf\x34\x32\x45\xfa\x3e\x75\x8a" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x30\x3f\xed\xe5\xfe\x66\x15\xc7\xbe\xd9\xc7\x27\x3c\x26\x66\x2d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa1\x0b" + "\xb9\x1e\x17\x44\xd3\x4b\xe6\x30\x85\x9e\x29\x3d\xa9\x35\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\x61\xea\x22" + "\x76\xdb\xce\x82\xfe\x8b\xac\xd3\x09\x90\xad\xf2\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x42\x45\x8b\xbd\xad\x34" + "\x56\x67\x3a\x81\x3d\x95\x37\x72\xe6\xcc\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\xe7\x09\x84\x99\x8b\x1a\x68" + "\x5f\x4e\x00\x14\x3e\x94\xa7\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xab\xdd\x01\x2f\x9d\x57\xce\x24\x40\x97" + "\x5e\x62\x7c\x4f\xe7\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x53\x79\x05\x52\x5d\xc9\xc6\xe0\x47\xc1\xb5\x7f" + "\x47\x28\x7d\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xa8\x51\x27\xb9\x21\x97\x2d\x5b\x03\x94\x30\x63\xa5\x02" + "\x04\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x53\x53\x23\xfa\x81\xd1\x31\x3b\x63\x5d\x61\x3b\x44\x19\xb2\x24" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x15\x79\x54\xb0\x57\x8c\x17\x0d\x36\xad\xa3\x08\x71\x60\x85\xc9\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x7b" + "\x55\x85\x8a\x90\x0b\x2c\x2b\x9a\x5d\xb6\x0e\xb6\xa6\x1d\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb1\xf5\xe1\xae" + "\xf9\x94\xb6\x3d\xd0\xad\x5b\xa7\x3a\x66\xd0\x31\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\xcc\xb7\x7f\xce\x0f" + "\x07\x2e\x64\x11\xe0\xcd\xac\xdb\x75\xb1\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5a\x4a\x5b\x15\x6a\xe2\x28\x8c" + "\x6d\xe5\x5a\x82\x62\xeb\xfc\xf5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x67\xa0\x79\x75\x24\x2e\xd4\x3b\x53" + "\xd4\xec\x6b\x0f\x43\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\xe3\xc3\x75\x83\x2d\x64\x5f\x8a\x79\x49\x5f\x1a" + "\x81\xeb\xd5\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\xc9\xe7\xa8\x14\xd9\xcc\xb0\xa4\xea\xfc\x12\x23\xb3\x1b" + "\x7a\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x0f\x6a\x86\x4c\x4b\x91\x13\xa3\x52\x51\x69\xc8\xff\x52\x8f\x44" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 80640 }, + { 128, 128, 4, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 640 }, + { 128, 128, 5, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x86" + "\xcb\x9b\x50\x72\x19\xee\x95\xdb\x11\x3a\x91\x76\x78\xb2\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + 1, 2432 }, + { 128, 128, 6, "\x5a\x2b\x4f\x1f\x4b\xab\x08\xea\xac\x78\xf7\x4b\xca\x3b\x4f\xa9", + "\x84\x38\x02\x6b\x5e\xb6\xc5\xb5\x8a\x9a\xf0\x20\x95\x7a\x46\x10", + "\x0d\xbc\xe9\x8c\x31\x07\x59\x65\x66\xcb\x4f\xa0\x5d\x6c\xf9\x63\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xda" + "\xb3\x61\x42\xa6\x1f\x38\x49\xa1\x55\x9b\xe1\xf6\xee\xd9\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcb\xd1\x42\x10" + "\x13\x24\x80\xa7\xa1\xd9\xeb\xfe\x3a\xd7\xef\x48\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2e\x81\x48\x53\xea\x35" + "\x0c\x1a\x29\xdd\xc3\xed\xc4\x71\x55\x97\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x3b\xb9\x7a\x94\x26\xba\x3a" + "\xa6\x64\x66\x1a\x11\x32\xb7\x6e", + "\xe5\xb9\xdb\x9d\x79\x53\x98\x92\x56\x9a\x90\xd2\xea\xc2\x37\xb9\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\xa2" + "\x61\x08\xc4\x15\x47\x41\x18\xf5\x73\x56\xee\x36\x6f\xcc\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\xe0\x4f\x0b" + "\xce\x32\xcf\x58\x88\x95\x87\x8a\xf8\x00\xd3\x3d\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xb0\xd3\x51\x1c\x1e" + "\x58\x65\x2d\x7c\x94\x70\xcf\x32\x0f\xb7\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9f\x53\x3a\x47\x3b\x4d\x99\xeb" + "\x86\xd2\xcf\x6a\x6c\x50\x42\xe5", + 1, 5248 }, + { 128, 128, 7, "\x5a\x2b\x4f\x1f\x4b\xab\x08\xea\xac\x78\xf7\x4b\xca\x3b\x4f\xa9", + "\x84\x38\x02\x6b\x5e\xb6\xc5\xb5\x8a\x9a\xf0\x20\x95\x7a\x46\x10", + "\xb2\x4c\x2d\x5c\xaf\x35\xce\x96\x76\xde\x0f\xc7\x77\x87\x1f\x7d", + "\x15\xda\xb3\xcf\x2d\xf2\x62\x0f\x53\x66\xc8\x2e\x3b\x25\xa2\xd7", 1, 128 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/aes_cfb_test.c b/test/kat-app/aes_cfb_test.c index 30758e07..765c000e 100644 --- a/test/kat-app/aes_cfb_test.c +++ b/test/kat-app/aes_cfb_test.c @@ -38,21 +38,18 @@ #define MAX_BURST_JOBS 64 - -int cfb_test(struct IMB_MGR *mb_mgr); +int +cfb_test(struct IMB_MGR *mb_mgr); extern const struct cipher_test cfb_test_json[]; static int -cfb_validate_ok(const uint8_t *output, const uint8_t *in_text, - const size_t plen, const uint32_t klen, - const unsigned i, const unsigned is_enc, - const int in_place) +cfb_validate_ok(const uint8_t *output, const uint8_t *in_text, const size_t plen, + const uint32_t klen, const unsigned i, const unsigned is_enc, const int in_place) { if (memcmp(output, in_text, plen) != 0) { printf("\nAES-CFB%s standard test vector %u %s (%s): fail\n", - (klen == 16) ? "128" : "256", - i + 1, (is_enc) ? "encrypt" : "decrypt", + (klen == 16) ? "128" : "256", i + 1, (is_enc) ? "encrypt" : "decrypt", (in_place) ? "in-place" : "out-of-place"); return 0; } @@ -60,8 +57,7 @@ cfb_validate_ok(const uint8_t *output, const uint8_t *in_text, #ifdef DEBUG if (!quiet_mode) { printf("Standard test vector %u %s %s\n", i + 1, - (in_place) ? "in-place" : "out-of-place", - (is_enc) ? "encrypt" : "decrypt"); + (in_place) ? "in-place" : "out-of-place", (is_enc) ? "encrypt" : "decrypt"); } #endif return 1; @@ -73,8 +69,8 @@ cfb_validate(struct IMB_MGR *mb_mgr, const struct cipher_test *p_vec) uint8_t output1[16]; uint8_t output2[16]; const uint32_t kLength = (unsigned) p_vec->keySize / 8; - DECLARE_ALIGNED(uint32_t keys_enc[15*4], 16); - DECLARE_ALIGNED(uint32_t keys_dec[15*4], 16); + DECLARE_ALIGNED(uint32_t keys_enc[15 * 4], 16); + DECLARE_ALIGNED(uint32_t keys_dec[15 * 4], 16); if (kLength == 16) IMB_AES_KEYEXP_128(mb_mgr, p_vec->key, keys_enc, keys_dec); @@ -84,22 +80,22 @@ cfb_validate(struct IMB_MGR *mb_mgr, const struct cipher_test *p_vec) /* encrypt test */ if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output1, (const void *) p_vec->msg, - p_vec->iv, keys_enc, p_vec->msgSize / 8); + IMB_AES128_CFB_ONE(mb_mgr, output1, (const void *) p_vec->msg, p_vec->iv, keys_enc, + p_vec->msgSize / 8); else - IMB_AES256_CFB_ONE(mb_mgr, output1, (const void *) p_vec->msg, - p_vec->iv, keys_enc, p_vec->msgSize / 8); + IMB_AES256_CFB_ONE(mb_mgr, output1, (const void *) p_vec->msg, p_vec->iv, keys_enc, + p_vec->msgSize / 8); if (!cfb_validate_ok(output1, (const void *) p_vec->ct, p_vec->msgSize / 8, (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 1, 0)) return 0; /* decrypt test */ if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output2, output1, p_vec->iv, - keys_enc, p_vec->msgSize / 8); + IMB_AES128_CFB_ONE(mb_mgr, output2, output1, p_vec->iv, keys_enc, + p_vec->msgSize / 8); else - IMB_AES256_CFB_ONE(mb_mgr, output2, output1, p_vec->iv, - keys_enc, p_vec->msgSize / 8); + IMB_AES256_CFB_ONE(mb_mgr, output2, output1, p_vec->iv, keys_enc, + p_vec->msgSize / 8); if (!cfb_validate_ok(output2, (const void *) p_vec->msg, p_vec->msgSize / 8, (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 0, 0)) return 0; @@ -108,11 +104,11 @@ cfb_validate(struct IMB_MGR *mb_mgr, const struct cipher_test *p_vec) /* encrypt test */ memcpy(output1, (const void *) p_vec->msg, p_vec->msgSize / 8); if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, - keys_enc, p_vec->msgSize / 8); + IMB_AES128_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, keys_enc, + p_vec->msgSize / 8); else - IMB_AES256_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, - keys_enc, p_vec->msgSize / 8); + IMB_AES256_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, keys_enc, + p_vec->msgSize / 8); if (!cfb_validate_ok(output1, (const void *) p_vec->ct, p_vec->msgSize / 8, (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 1, 1)) return 0; @@ -120,11 +116,11 @@ cfb_validate(struct IMB_MGR *mb_mgr, const struct cipher_test *p_vec) /* decrypt test */ memcpy(output1, (const void *) p_vec->ct, p_vec->msgSize / 8); if (kLength == 16) - IMB_AES128_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, - keys_enc, p_vec->msgSize / 8); + IMB_AES128_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, keys_enc, + p_vec->msgSize / 8); else - IMB_AES256_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, - keys_enc, p_vec->msgSize / 8); + IMB_AES256_CFB_ONE(mb_mgr, output1, output1, p_vec->iv, keys_enc, + p_vec->msgSize / 8); if (!cfb_validate_ok(output1, (const void *) p_vec->msg, p_vec->msgSize / 8, (unsigned) p_vec->keySize / 8, (unsigned) p_vec->tcId, 0, 1)) return 0; @@ -137,13 +133,12 @@ cfb_test_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, { const struct cipher_test *v = cfb_test_json; - for (; v->msg != NULL; v++) { + for (; v->msg != NULL; v++) { struct test_suite_context *ctx; if (!quiet_mode) { #ifdef DEBUG - printf("AES-CFB Test Case %zu key_len:%zu\n", - v->tcId, v->keySize); + printf("AES-CFB Test Case %zu key_len:%zu\n", v->tcId, v->keySize); #else printf("."); #endif diff --git a/test/kat-app/aes_cfb_test.json.c b/test/kat-app/aes_cfb_test.json.c index 20dcfd66..3ee167cc 100644 --- a/test/kat-app/aes_cfb_test.json.c +++ b/test/kat-app/aes_cfb_test.json.c @@ -29,86 +29,66 @@ #include "cipher_test.h" const struct cipher_test cfb_test_json[] = { /* Vectors from CM-SP-SECv3.1-I06-160602 section I.10.2 */ - {128, 128, 1, - "\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef", - "\x12\x34\x56\x78\x90\xab\xcd\xef\x12\x34\x56\x78\x90\xab\xcd\xef", - "\x4e\x6f\x77\x20\x69\x73\x20\x74\x68\x65\x20\x74\x69\x6d\x65\x20", - "\x43\xbc\x0a\xd0\xfc\x8d\x93\xff\x80\xe0\xbf\xf1\x41\xfc\x67\x08", 1, - 128}, - {128, 128, 2, - "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", - "\x9d\xd1\x67\x4b\xba\x61\x10\x1b\x56\x75\x64\x74\x36\x4f\x10\x1d", - "\xd2\xd1\x9f", "\x44\xd4\x73", 1, 24}, + { 128, 128, 1, "\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef", + "\x12\x34\x56\x78\x90\xab\xcd\xef\x12\x34\x56\x78\x90\xab\xcd\xef", + "\x4e\x6f\x77\x20\x69\x73\x20\x74\x68\x65\x20\x74\x69\x6d\x65\x20", + "\x43\xbc\x0a\xd0\xfc\x8d\x93\xff\x80\xe0\xbf\xf1\x41\xfc\x67\x08", 1, 128 }, + { 128, 128, 2, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", + "\x9d\xd1\x67\x4b\xba\x61\x10\x1b\x56\x75\x64\x74\x36\x4f\x10\x1d", "\xd2\xd1\x9f", + "\x44\xd4\x73", 1, 24 }, /* Vectors from * https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf - */ - {128, 128, 3, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", - "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20\x33\x34\x49\xf8\xe8\x3c\xfb\x4a", 1, - 128}, - {128, 128, 4, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20\x33\x34\x49\xf8\xe8\x3c\xfb\x4a", - "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", - "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", 1, - 128}, - {128, 128, 5, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", - "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef", - "\x26\x75\x1f\x67\xa3\xcb\xb1\x40\xb1\x80\x8c\xf1\x87\xa4\xf4\xdf", 1, - 128}, - {128, 128, 6, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x26\x75\x1f\x67\xa3\xcb\xb1\x40\xb1\x80\x8c\xf1\x87\xa4\xf4\xdf", - "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xc0\x4b\x05\x35\x7c\x5d\x1c\x0e\xea\xc4\xc6\x6f\x9f\xf7\xf2\xe6", 1, - 128}, - {128, 128, 7, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96", "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20", 1, - 64}, - {128, 128, 8, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", - "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11", "\x26\x75\x1f\x67\xa3\xcb\xb1\x40", 1, - 64}, - {128, 256, 9, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", - "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", 1, - 128}, - {128, 256, 10, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", - "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", - "\x39\xff\xed\x14\x3b\x28\xb1\xc8\x32\x11\x3c\x63\x31\xe5\x40\x7b", 1, - 128}, - {128, 256, 11, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x39\xff\xed\x14\x3b\x28\xb1\xc8\x32\x11\x3c\x63\x31\xe5\x40\x7b", - "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef", - "\xdf\x10\x13\x24\x15\xe5\x4b\x92\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9", 1, - 128}, - {128, 256, 12, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\xdf\x10\x13\x24\x15\xe5\x4b\x92\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9", - "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x75\xa3\x85\x74\x1a\xb9\xce\xf8\x20\x31\x62\x3d\x55\xb1\xe4\x71", 1, - 128}, - {128, 256, 13, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", - "\xae\x2d\x8a\x57\x1e\x03\xac\x9c", "\x39\xff\xed\x14\x3b\x28\xb1\xc8", 1, - 64}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + */ + { 128, 128, 3, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", + "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20\x33\x34\x49\xf8\xe8\x3c\xfb\x4a", 1, 128 }, + { 128, 128, 4, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20\x33\x34\x49\xf8\xe8\x3c\xfb\x4a", + "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", + "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", 1, 128 }, + { 128, 128, 5, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", + "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef", + "\x26\x75\x1f\x67\xa3\xcb\xb1\x40\xb1\x80\x8c\xf1\x87\xa4\xf4\xdf", 1, 128 }, + { 128, 128, 6, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x26\x75\x1f\x67\xa3\xcb\xb1\x40\xb1\x80\x8c\xf1\x87\xa4\xf4\xdf", + "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xc0\x4b\x05\x35\x7c\x5d\x1c\x0e\xea\xc4\xc6\x6f\x9f\xf7\xf2\xe6", 1, 128 }, + { 128, 128, 7, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96", "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20", 1, 64 }, + { 128, 128, 8, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b", + "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11", "\x26\x75\x1f\x67\xa3\xcb\xb1\x40", 1, 64 }, + { 128, 256, 9, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", + "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", 1, 128 }, + { 128, 256, 10, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", + "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", + "\x39\xff\xed\x14\x3b\x28\xb1\xc8\x32\x11\x3c\x63\x31\xe5\x40\x7b", 1, 128 }, + { 128, 256, 11, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x39\xff\xed\x14\x3b\x28\xb1\xc8\x32\x11\x3c\x63\x31\xe5\x40\x7b", + "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef", + "\xdf\x10\x13\x24\x15\xe5\x4b\x92\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9", 1, 128 }, + { 128, 256, 12, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xdf\x10\x13\x24\x15\xe5\x4b\x92\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9", + "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x75\xa3\x85\x74\x1a\xb9\xce\xf8\x20\x31\x62\x3d\x55\xb1\xe4\x71", 1, 128 }, + { 128, 256, 13, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60", + "\xae\x2d\x8a\x57\x1e\x03\xac\x9c", "\x39\xff\xed\x14\x3b\x28\xb1\xc8", 1, 64 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/aes_test.c b/test/kat-app/aes_test.c index f327c894..69476ef7 100644 --- a/test/kat-app/aes_test.c +++ b/test/kat-app/aes_test.c @@ -37,15 +37,16 @@ #define MAX_BURST_JOBS 64 -int aes_test(struct IMB_MGR *mb_mgr); +int +aes_test(struct IMB_MGR *mb_mgr); struct aes_vector { - const uint8_t *K; /* key */ - const uint8_t *IV; /* initialization vector */ - const uint8_t *P; /* plain text */ - uint64_t Plen; /* plain text length */ - const uint8_t *C; /* cipher text - same length as plain text */ - uint32_t Klen; /* key length */ + const uint8_t *K; /* key */ + const uint8_t *IV; /* initialization vector */ + const uint8_t *P; /* plain text */ + uint64_t Plen; /* plain text length */ + const uint8_t *C; /* cipher text - same length as plain text */ + uint32_t Klen; /* key length */ }; /* =================================================================== */ @@ -57,262 +58,149 @@ struct aes_vector { */ /* DOCSIS: AES-128 CFB */ -static const uint8_t DK1[] = { - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab, - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab -}; -static const uint8_t DIV1[] = { - 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a, - 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a -}; -static const uint8_t DP1[] = { - 0x00, 0x01, 0x02, 0x88, 0xee, 0x59, 0x7e -}; -static const uint8_t DC1[] = { - 0xfc, 0x68, 0xa3, 0x55, 0x60, 0x37, 0xdc -}; +static const uint8_t DK1[] = { 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab, + 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab }; +static const uint8_t DIV1[] = { 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a, + 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a }; +static const uint8_t DP1[] = { 0x00, 0x01, 0x02, 0x88, 0xee, 0x59, 0x7e }; +static const uint8_t DC1[] = { 0xfc, 0x68, 0xa3, 0x55, 0x60, 0x37, 0xdc }; /* DOCSIS: AES-128 CBC + CFB */ -static const uint8_t DK2[] = { - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab, - 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab -}; -static const uint8_t DIV2[] = { - 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a, - 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a -}; -static const uint8_t DP2[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x91, - 0xd2, 0xd1, 0x9f -}; -static const uint8_t DC2[] = { - 0x9d, 0xd1, 0x67, 0x4b, 0xba, 0x61, 0x10, 0x1b, - 0x56, 0x75, 0x64, 0x74, 0x36, 0x4f, 0x10, 0x1d, - 0x44, 0xd4, 0x73 -}; +static const uint8_t DK2[] = { 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab, + 0xe6, 0x60, 0x0f, 0xd8, 0x85, 0x2e, 0xf5, 0xab }; +static const uint8_t DIV2[] = { 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a, + 0x81, 0x0e, 0x52, 0x8e, 0x1c, 0x5f, 0xda, 0x1a }; +static const uint8_t DP2[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x91, 0xd2, 0xd1, 0x9f }; +static const uint8_t DC2[] = { 0x9d, 0xd1, 0x67, 0x4b, 0xba, 0x61, 0x10, 0x1b, 0x56, 0x75, + 0x64, 0x74, 0x36, 0x4f, 0x10, 0x1d, 0x44, 0xd4, 0x73 }; /* DOCSIS: AES-128 CBC */ -static const uint8_t DK3[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t DIV3[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t DP3[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t DC3[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, - 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, - 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, - 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, - 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, - 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 -}; +static const uint8_t DK3[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; +static const uint8_t DIV3[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; +static const uint8_t DP3[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, + 0x11, 0x73, 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, + 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, + 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, + 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, + 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; +static const uint8_t DC3[] = { 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, + 0x9b, 0x12, 0xe9, 0x19, 0x7d, 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, + 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, 0x73, + 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, 0x71, 0x16, 0xe6, 0x9e, + 0x22, 0x22, 0x95, 0x16, 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, + 0x09, 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 }; /* DOCSIS: AES-256 CFB */ -static const uint8_t DK4[] = { - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB -}; -static const uint8_t DIV4[] = { - 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A, - 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A -}; -static const uint8_t DP4[] = { - 0x00, 0x01, 0x02, 0x88, 0xEE, 0x59, 0x7E -}; -static const uint8_t DC4[] = { - 0xE3, 0x75, 0xF2, 0x30, 0x1F, 0x75, 0x9A -}; +static const uint8_t DK4[] = { 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, 0xE6, 0x60, 0x0F, + 0xD8, 0x85, 0x2E, 0xF5, 0xAB, 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, + 0xF5, 0xAB, 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB }; +static const uint8_t DIV4[] = { 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A, + 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A }; +static const uint8_t DP4[] = { 0x00, 0x01, 0x02, 0x88, 0xEE, 0x59, 0x7E }; +static const uint8_t DC4[] = { 0xE3, 0x75, 0xF2, 0x30, 0x1F, 0x75, 0x9A }; /* DOCSIS: AES-256 CBC + CFB */ -static const uint8_t DK5[] = { - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, - 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB -}; -static const uint8_t DIV5[] = { - 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A, - 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A -}; -static const uint8_t DP5[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x91, - 0xD2, 0xD1, 0x9F -}; -static const uint8_t DC5[] = { - 0xD1, 0x28, 0x73, 0x1F, 0xB5, 0x28, 0xB5, 0x18, - 0xAB, 0x51, 0xAB, 0xC8, 0x98, 0x3D, 0xD1, 0xEE, - 0xE4, 0x43, 0x59 -}; +static const uint8_t DK5[] = { 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB, 0xE6, 0x60, 0x0F, + 0xD8, 0x85, 0x2E, 0xF5, 0xAB, 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, + 0xF5, 0xAB, 0xE6, 0x60, 0x0F, 0xD8, 0x85, 0x2E, 0xF5, 0xAB }; +static const uint8_t DIV5[] = { 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A, + 0x81, 0x0E, 0x52, 0x8E, 0x1C, 0x5F, 0xDA, 0x1A }; +static const uint8_t DP5[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x91, 0xD2, 0xD1, 0x9F }; +static const uint8_t DC5[] = { 0xD1, 0x28, 0x73, 0x1F, 0xB5, 0x28, 0xB5, 0x18, 0xAB, 0x51, + 0xAB, 0xC8, 0x98, 0x3D, 0xD1, 0xEE, 0xE4, 0x43, 0x59 }; /* DOCSIS: AES-256 CBC */ -static const uint8_t DK6[] = { - 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, - 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, - 0xD4, 0xC3, 0xA3, 0xAA, 0x33, 0x62, 0x61, 0xE0, - 0x37, 0x07, 0xB8, 0x23, 0xA2, 0xA3, 0xB5, 0x8D -}; -static const uint8_t DIV6[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F -}; +static const uint8_t DK6[] = { 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, 0x49, 0x03, 0xDD, + 0xC6, 0xB8, 0xCA, 0x55, 0x7A, 0xD4, 0xC3, 0xA3, 0xAA, 0x33, 0x62, + 0x61, 0xE0, 0x37, 0x07, 0xB8, 0x23, 0xA2, 0xA3, 0xB5, 0x8D }; +static const uint8_t DIV6[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; static const uint8_t DP6[] = { - 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6c, - 0x6f, 0x75, 0x73, 0x79, 0x20, 0x65, 0x61, 0x72, - 0x74, 0x68, 0x21, 0x20, 0x48, 0x65, 0x20, 0x77, - 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, - 0x68, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, - 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, - 0x77, 0x65, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, - 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x74, - 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6d, 0x65, - 0x20, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x20, 0x65, - 0x76, 0x65, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x68, - 0x69, 0x73, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x70, - 0x72, 0x6f, 0x73, 0x70, 0x65, 0x72, 0x6f, 0x75, - 0x73, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, - 0x79, 0x2c, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x6d, - 0x61, 0x6e, 0x79, 0x20, 0x68, 0x6f, 0x6d, 0x65, - 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x73, - 0x68, 0x61, 0x6e, 0x74, 0x69, 0x65, 0x73, 0x2c, - 0x20, 0x68, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, - 0x79, 0x20, 0x68, 0x75, 0x73, 0x62, 0x61, 0x6e, - 0x64, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, - 0x64, 0x72, 0x75, 0x6e, 0x6b, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x77, 0x69, 0x76, 0x65, 0x73, 0x20, - 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x2c, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x68, 0x6f, 0x77, 0x20, - 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x20, 0x77, 0x65, - 0x72, 0x65, 0x20, 0x62, 0x75, 0x6c, 0x6c, 0x69, - 0x65, 0x64, 0x2c, 0x20, 0x61, 0x62, 0x75, 0x73, - 0x65, 0x64, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x61, - 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x65, 0x64, - 0x2e, 0x20, 0x48, 0x6f, 0x77, 0x20, 0x6d, 0x61, - 0x6e, 0x79, 0x20, 0x66, 0x61, 0x6d, 0x69, 0x6c, - 0x69, 0x65, 0x73, 0x20, 0x68, 0x75, 0x6e, 0x67, - 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, - 0x20, 0x66, 0x6f, 0x6f, 0x64, 0x20, 0x74, 0x68, - 0x65, 0x79, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, - 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x66, 0x66, - 0x6f, 0x72, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, - 0x75, 0x79, 0x3f, 0x20, 0x48, 0x6f, 0x77, 0x20, - 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x68, 0x65, 0x61, - 0x72, 0x74, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, - 0x20, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x3f, - 0x20, 0x48, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, - 0x79, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, - 0x65, 0x73, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, - 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, - 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x69, - 0x67, 0x68, 0x74, 0x2c, 0x20, 0x68, 0x6f, 0x77, - 0x20, 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x65, - 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x75, - 0x6c, 0x64, 0x20, 0x67, 0x6f, 0x20, 0x69, 0x6e, - 0x73, 0x61, 0x6e, 0x65, 0x3f, 0x20, 0x48, 0x6f, - 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x63, - 0x6f, 0x63, 0x6b, 0x72, 0x6f, 0x61, 0x63, 0x68, - 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, - 0x61, 0x6e, 0x64, 0x6c, 0x6f, 0x72, 0x64, 0x73, - 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x74, - 0x72, 0x69, 0x75, 0x6d, 0x70, 0x68, 0x3f, 0x20, - 0x48, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, - 0x20, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x73, - 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6c, 0x6f, - 0x73, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x73, 0x75 + 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6c, 0x6f, 0x75, 0x73, 0x79, 0x20, 0x65, 0x61, + 0x72, 0x74, 0x68, 0x21, 0x20, 0x48, 0x65, 0x20, 0x77, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x65, + 0x64, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x65, 0x6f, 0x70, + 0x6c, 0x65, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, 0x74, 0x69, 0x74, 0x75, + 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x69, + 0x67, 0x68, 0x74, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x68, 0x69, 0x73, + 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x72, 0x6f, 0x75, 0x73, + 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x2c, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x6d, + 0x61, 0x6e, 0x79, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, + 0x73, 0x68, 0x61, 0x6e, 0x74, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x6d, + 0x61, 0x6e, 0x79, 0x20, 0x68, 0x75, 0x73, 0x62, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x77, 0x65, + 0x72, 0x65, 0x20, 0x64, 0x72, 0x75, 0x6e, 0x6b, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, + 0x76, 0x65, 0x73, 0x20, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x6e, 0x64, + 0x20, 0x68, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x72, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x62, 0x75, 0x6c, 0x6c, 0x69, 0x65, + 0x64, 0x2c, 0x20, 0x61, 0x62, 0x75, 0x73, 0x65, 0x64, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x61, + 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x65, 0x64, 0x2e, 0x20, 0x48, 0x6f, 0x77, 0x20, 0x6d, + 0x61, 0x6e, 0x79, 0x20, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x68, 0x75, + 0x6e, 0x67, 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x6f, 0x64, + 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f, 0x74, + 0x20, 0x61, 0x66, 0x66, 0x6f, 0x72, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x3f, + 0x20, 0x48, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x68, 0x65, 0x61, 0x72, 0x74, + 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x3f, 0x20, + 0x48, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, + 0x65, 0x73, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, + 0x6e, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, + 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x67, + 0x6f, 0x20, 0x69, 0x6e, 0x73, 0x61, 0x6e, 0x65, 0x3f, 0x20, 0x48, 0x6f, 0x77, 0x20, 0x6d, + 0x61, 0x6e, 0x79, 0x20, 0x63, 0x6f, 0x63, 0x6b, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x65, 0x73, + 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x6c, 0x6f, 0x72, 0x64, 0x73, 0x20, + 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x74, 0x72, 0x69, 0x75, 0x6d, 0x70, 0x68, 0x3f, 0x20, + 0x48, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x79, 0x20, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, + 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6c, 0x6f, 0x73, 0x65, 0x72, 0x73, 0x2c, 0x20, + 0x73, 0x75 }; static const uint8_t DC6[] = { - 0xF3, 0xDD, 0xF0, 0x0B, 0xFF, 0xA2, 0x6A, 0x04, - 0xBE, 0xDA, 0x52, 0xA6, 0xFE, 0x6B, 0xA6, 0xA7, - 0x48, 0x1D, 0x7D, 0x98, 0x65, 0xDB, 0xEF, 0x06, - 0x26, 0xB5, 0x8E, 0xEB, 0x05, 0x0E, 0x77, 0x98, - 0x17, 0x8E, 0xD0, 0xD4, 0x7B, 0x92, 0x8F, 0x5C, - 0xD0, 0x74, 0x5C, 0xA8, 0x4B, 0x54, 0xB6, 0x2F, - 0x83, 0x72, 0x2C, 0xFF, 0x72, 0xE9, 0xE4, 0x15, - 0x4C, 0x32, 0xAF, 0xC8, 0xC9, 0x89, 0x3C, 0x6E, - 0x31, 0xD5, 0xC0, 0x16, 0xC0, 0x31, 0x7D, 0x11, - 0xAB, 0xCB, 0xDE, 0xD2, 0xD6, 0xAA, 0x76, 0x5E, - 0xBA, 0xF6, 0xE2, 0x92, 0xCB, 0x86, 0x07, 0xFA, - 0xD4, 0x9E, 0x83, 0xED, 0xFD, 0xB8, 0x70, 0x54, - 0x6B, 0xBE, 0xEC, 0x72, 0xDD, 0x28, 0x5E, 0x95, - 0x78, 0xA5, 0x28, 0x43, 0x3D, 0x6D, 0xB1, 0xD9, - 0x69, 0x1F, 0xC9, 0x66, 0x0E, 0x32, 0x44, 0x08, - 0xD2, 0xAE, 0x2C, 0x43, 0xF2, 0xD0, 0x7D, 0x26, - 0x70, 0xE5, 0xA1, 0xCA, 0x37, 0xE9, 0x7D, 0xC7, - 0xA3, 0xFA, 0x81, 0x91, 0x64, 0xAA, 0x64, 0x91, - 0x9A, 0x95, 0x2D, 0xC9, 0xF9, 0xCE, 0xFE, 0x9F, - 0xC4, 0xD8, 0x81, 0xBE, 0x57, 0x84, 0xC5, 0x02, - 0xDB, 0x30, 0xC1, 0xD9, 0x0E, 0xA0, 0xA6, 0x00, - 0xD6, 0xF3, 0x52, 0x7E, 0x0D, 0x23, 0x6B, 0x2B, - 0x34, 0x99, 0x1F, 0x70, 0x27, 0x6D, 0x58, 0x84, - 0x93, 0x77, 0xB8, 0x3E, 0xF1, 0x71, 0x58, 0x42, - 0x8B, 0x2B, 0xC8, 0x6D, 0x05, 0x84, 0xFF, 0x4E, - 0x85, 0xEF, 0x4A, 0x9D, 0x91, 0x6A, 0xD5, 0xE1, - 0xAF, 0x01, 0xEB, 0x83, 0x8F, 0x23, 0x7C, 0x7F, - 0x12, 0x91, 0x05, 0xF0, 0x4E, 0xD9, 0x17, 0x62, - 0x75, 0xBB, 0xAC, 0x97, 0xEE, 0x3B, 0x4E, 0xC7, - 0xE5, 0x92, 0xF8, 0x9D, 0x4C, 0xF9, 0xEE, 0x55, - 0x18, 0xBB, 0xCC, 0xB4, 0xF2, 0x59, 0xB9, 0xFC, - 0x7A, 0x0F, 0x98, 0xD4, 0x8B, 0xFE, 0xF7, 0x83, - 0x46, 0xE2, 0x83, 0x33, 0x3E, 0x95, 0x8D, 0x17, - 0x1E, 0x85, 0xF8, 0x8C, 0x51, 0xB0, 0x6C, 0xB5, - 0x5E, 0x95, 0xBA, 0x4B, 0x69, 0x1B, 0x48, 0x69, - 0x0B, 0x8F, 0xA5, 0x18, 0x13, 0xB9, 0x77, 0xD1, - 0x80, 0x32, 0x32, 0x6D, 0x53, 0xA1, 0x95, 0x40, - 0x96, 0x8A, 0xCC, 0xA3, 0x69, 0xF8, 0x9F, 0xB5, - 0x8E, 0xD2, 0x68, 0x07, 0x4F, 0xA7, 0xEC, 0xF8, - 0x20, 0x21, 0x58, 0xF8, 0xD8, 0x9E, 0x5F, 0x40, - 0xBA, 0xB9, 0x76, 0x57, 0x3B, 0x17, 0xAD, 0xEE, - 0xCB, 0xDF, 0x07, 0xC1, 0xDF, 0x66, 0xA8, 0x0D, - 0xC2, 0xCE, 0x8F, 0x79, 0xC3, 0x32, 0xE0, 0x8C, - 0xFE, 0x5A, 0xF3, 0x55, 0x27, 0x73, 0x6F, 0xA1, - 0x54, 0xC6, 0xFC, 0x28, 0x9D, 0xBE, 0x97, 0xB9, - 0x54, 0x97, 0x72, 0x3A, 0x61, 0xAF, 0x6F, 0xDE, - 0xF8, 0x0E, 0xBB, 0x6B, 0x96, 0x84, 0xDD, 0x9B, - 0x62, 0xBA, 0x47, 0xB5, 0xC9, 0x3B, 0x4E, 0x8C, - 0x78, 0x2A, 0xCC, 0x0A, 0x69, 0x54, 0x25, 0x5E, - 0x8B, 0xAC, 0x56, 0xD9, 0xFE, 0x48, 0xBA, 0xCE, - 0xA9, 0xCE, 0xA6, 0x1D, 0xBF, 0x3E, 0x3C, 0x66, - 0x40, 0x71, 0x79, 0xAD, 0x5B, 0x26, 0xAD, 0xBE, - 0x58, 0x13, 0x64, 0x60, 0x7C, 0x05, 0xFC, 0xE3, - 0x51, 0x7A, 0xF2, 0xCC, 0x54, 0x16, 0x2C, 0xA4, - 0xCE, 0x5F, 0x59, 0x12, 0x77, 0xEB, 0xD9, 0x23, - 0xE3, 0x86, 0xFB, 0xD7, 0x48, 0x76, 0x9D, 0xE3, - 0x89, 0x87, 0x39, 0xFA, 0x7B, 0x21, 0x0B, 0x76, - 0xB2, 0xED, 0x1C, 0x27, 0x4B, 0xD5, 0x27, 0x05, - 0x8C, 0x7D, 0x58, 0x6C, 0xCA, 0xA5, 0x54, 0x9A, - 0x0F, 0xCB, 0xE9, 0x88, 0x31, 0xAD, 0x49, 0xEE, - 0x38, 0xFB, 0xC9, 0xFB, 0xB4, 0x7A, 0x00, 0x58, - 0x20, 0x32, 0xD3, 0x53, 0x5A, 0xDD, 0x74, 0x95, - 0x60, 0x59, 0x09, 0xAE, 0x7E, 0xEC, 0x74, 0xA3, - 0xB7, 0x1C, 0x6D, 0xF2, 0xAE, 0x79, 0xA4, 0x7C + 0xF3, 0xDD, 0xF0, 0x0B, 0xFF, 0xA2, 0x6A, 0x04, 0xBE, 0xDA, 0x52, 0xA6, 0xFE, 0x6B, 0xA6, + 0xA7, 0x48, 0x1D, 0x7D, 0x98, 0x65, 0xDB, 0xEF, 0x06, 0x26, 0xB5, 0x8E, 0xEB, 0x05, 0x0E, + 0x77, 0x98, 0x17, 0x8E, 0xD0, 0xD4, 0x7B, 0x92, 0x8F, 0x5C, 0xD0, 0x74, 0x5C, 0xA8, 0x4B, + 0x54, 0xB6, 0x2F, 0x83, 0x72, 0x2C, 0xFF, 0x72, 0xE9, 0xE4, 0x15, 0x4C, 0x32, 0xAF, 0xC8, + 0xC9, 0x89, 0x3C, 0x6E, 0x31, 0xD5, 0xC0, 0x16, 0xC0, 0x31, 0x7D, 0x11, 0xAB, 0xCB, 0xDE, + 0xD2, 0xD6, 0xAA, 0x76, 0x5E, 0xBA, 0xF6, 0xE2, 0x92, 0xCB, 0x86, 0x07, 0xFA, 0xD4, 0x9E, + 0x83, 0xED, 0xFD, 0xB8, 0x70, 0x54, 0x6B, 0xBE, 0xEC, 0x72, 0xDD, 0x28, 0x5E, 0x95, 0x78, + 0xA5, 0x28, 0x43, 0x3D, 0x6D, 0xB1, 0xD9, 0x69, 0x1F, 0xC9, 0x66, 0x0E, 0x32, 0x44, 0x08, + 0xD2, 0xAE, 0x2C, 0x43, 0xF2, 0xD0, 0x7D, 0x26, 0x70, 0xE5, 0xA1, 0xCA, 0x37, 0xE9, 0x7D, + 0xC7, 0xA3, 0xFA, 0x81, 0x91, 0x64, 0xAA, 0x64, 0x91, 0x9A, 0x95, 0x2D, 0xC9, 0xF9, 0xCE, + 0xFE, 0x9F, 0xC4, 0xD8, 0x81, 0xBE, 0x57, 0x84, 0xC5, 0x02, 0xDB, 0x30, 0xC1, 0xD9, 0x0E, + 0xA0, 0xA6, 0x00, 0xD6, 0xF3, 0x52, 0x7E, 0x0D, 0x23, 0x6B, 0x2B, 0x34, 0x99, 0x1F, 0x70, + 0x27, 0x6D, 0x58, 0x84, 0x93, 0x77, 0xB8, 0x3E, 0xF1, 0x71, 0x58, 0x42, 0x8B, 0x2B, 0xC8, + 0x6D, 0x05, 0x84, 0xFF, 0x4E, 0x85, 0xEF, 0x4A, 0x9D, 0x91, 0x6A, 0xD5, 0xE1, 0xAF, 0x01, + 0xEB, 0x83, 0x8F, 0x23, 0x7C, 0x7F, 0x12, 0x91, 0x05, 0xF0, 0x4E, 0xD9, 0x17, 0x62, 0x75, + 0xBB, 0xAC, 0x97, 0xEE, 0x3B, 0x4E, 0xC7, 0xE5, 0x92, 0xF8, 0x9D, 0x4C, 0xF9, 0xEE, 0x55, + 0x18, 0xBB, 0xCC, 0xB4, 0xF2, 0x59, 0xB9, 0xFC, 0x7A, 0x0F, 0x98, 0xD4, 0x8B, 0xFE, 0xF7, + 0x83, 0x46, 0xE2, 0x83, 0x33, 0x3E, 0x95, 0x8D, 0x17, 0x1E, 0x85, 0xF8, 0x8C, 0x51, 0xB0, + 0x6C, 0xB5, 0x5E, 0x95, 0xBA, 0x4B, 0x69, 0x1B, 0x48, 0x69, 0x0B, 0x8F, 0xA5, 0x18, 0x13, + 0xB9, 0x77, 0xD1, 0x80, 0x32, 0x32, 0x6D, 0x53, 0xA1, 0x95, 0x40, 0x96, 0x8A, 0xCC, 0xA3, + 0x69, 0xF8, 0x9F, 0xB5, 0x8E, 0xD2, 0x68, 0x07, 0x4F, 0xA7, 0xEC, 0xF8, 0x20, 0x21, 0x58, + 0xF8, 0xD8, 0x9E, 0x5F, 0x40, 0xBA, 0xB9, 0x76, 0x57, 0x3B, 0x17, 0xAD, 0xEE, 0xCB, 0xDF, + 0x07, 0xC1, 0xDF, 0x66, 0xA8, 0x0D, 0xC2, 0xCE, 0x8F, 0x79, 0xC3, 0x32, 0xE0, 0x8C, 0xFE, + 0x5A, 0xF3, 0x55, 0x27, 0x73, 0x6F, 0xA1, 0x54, 0xC6, 0xFC, 0x28, 0x9D, 0xBE, 0x97, 0xB9, + 0x54, 0x97, 0x72, 0x3A, 0x61, 0xAF, 0x6F, 0xDE, 0xF8, 0x0E, 0xBB, 0x6B, 0x96, 0x84, 0xDD, + 0x9B, 0x62, 0xBA, 0x47, 0xB5, 0xC9, 0x3B, 0x4E, 0x8C, 0x78, 0x2A, 0xCC, 0x0A, 0x69, 0x54, + 0x25, 0x5E, 0x8B, 0xAC, 0x56, 0xD9, 0xFE, 0x48, 0xBA, 0xCE, 0xA9, 0xCE, 0xA6, 0x1D, 0xBF, + 0x3E, 0x3C, 0x66, 0x40, 0x71, 0x79, 0xAD, 0x5B, 0x26, 0xAD, 0xBE, 0x58, 0x13, 0x64, 0x60, + 0x7C, 0x05, 0xFC, 0xE3, 0x51, 0x7A, 0xF2, 0xCC, 0x54, 0x16, 0x2C, 0xA4, 0xCE, 0x5F, 0x59, + 0x12, 0x77, 0xEB, 0xD9, 0x23, 0xE3, 0x86, 0xFB, 0xD7, 0x48, 0x76, 0x9D, 0xE3, 0x89, 0x87, + 0x39, 0xFA, 0x7B, 0x21, 0x0B, 0x76, 0xB2, 0xED, 0x1C, 0x27, 0x4B, 0xD5, 0x27, 0x05, 0x8C, + 0x7D, 0x58, 0x6C, 0xCA, 0xA5, 0x54, 0x9A, 0x0F, 0xCB, 0xE9, 0x88, 0x31, 0xAD, 0x49, 0xEE, + 0x38, 0xFB, 0xC9, 0xFB, 0xB4, 0x7A, 0x00, 0x58, 0x20, 0x32, 0xD3, 0x53, 0x5A, 0xDD, 0x74, + 0x95, 0x60, 0x59, 0x09, 0xAE, 0x7E, 0xEC, 0x74, 0xA3, 0xB7, 0x1C, 0x6D, 0xF2, 0xAE, 0x79, + 0xA4, 0x7C }; static const struct aes_vector docsis_vectors[] = { - {DK1, DIV1, DP1, sizeof(DP1), DC1, sizeof(DK1)}, - {DK2, DIV2, DP2, sizeof(DP2), DC2, sizeof(DK2)}, - {DK3, DIV3, DP3, sizeof(DP3), DC3, sizeof(DK3)}, - {DK4, DIV4, DP4, sizeof(DP4), DC4, sizeof(DK4)}, - {DK5, DIV5, DP5, sizeof(DP5), DC5, sizeof(DK5)}, - {DK6, DIV6, DP6, sizeof(DP6), DC6, sizeof(DK6)}, + { DK1, DIV1, DP1, sizeof(DP1), DC1, sizeof(DK1) }, + { DK2, DIV2, DP2, sizeof(DP2), DC2, sizeof(DK2) }, + { DK3, DIV3, DP3, sizeof(DP3), DC3, sizeof(DK3) }, + { DK4, DIV4, DP4, sizeof(DP4), DC4, sizeof(DK4) }, + { DK5, DIV5, DP5, sizeof(DP5), DC5, sizeof(DK5) }, + { DK6, DIV6, DP6, sizeof(DP6), DC6, sizeof(DK6) }, }; /* =================================================================== */ @@ -320,21 +208,15 @@ static const struct aes_vector docsis_vectors[] = { /* DOCSIS with CRC: AES CBC + CFB + CRC32 */ /* 128-bit keys */ -static const uint8_t DOCRC1_KEY[] = { - 0x00, 0x00, 0x00, 0x00, 0xaa, 0xbb, 0xcc, 0xdd, - 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 -}; -static const uint8_t DOCRC1_IV[] = { - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 -}; +static const uint8_t DOCRC1_KEY[] = { 0x00, 0x00, 0x00, 0x00, 0xaa, 0xbb, 0xcc, 0xdd, + 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; +static const uint8_t DOCRC1_IV[] = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }; static const uint8_t DOCRC1_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (14 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, /* CRC (4 bytes) */ 0x14, 0x08, 0xe8, 0x55 }; @@ -342,8 +224,7 @@ static const uint8_t DOCRC1_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, - 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x7A, 0xF0, /* CRC (encrypted) */ @@ -361,8 +242,7 @@ static const uint8_t DOCRC2_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ @@ -374,8 +254,7 @@ static const uint8_t DOCRC2_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x7A, 0xF0, /* PDU payload */ @@ -397,13 +276,11 @@ static const uint8_t DOCRC3_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xCB, 0x7C, 0xAB, 0x56 }; @@ -411,13 +288,11 @@ static const uint8_t DOCRC3_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0xD6, 0xE2, /* PDU payload */ - 0x70, 0x5C, 0xE6, 0x4D, 0xCC, 0x8C, 0x47, 0xB7, - 0x09, 0xD6, + 0x70, 0x5C, 0xE6, 0x4D, 0xCC, 0x8C, 0x47, 0xB7, 0x09, 0xD6, /* CRC (encrypted) */ 0x54, 0x85, 0xF8, 0x32 }; @@ -435,13 +310,11 @@ static const uint8_t DOCRC4_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0x3F, 0x15, 0xE1, 0xE8 }; @@ -449,13 +322,11 @@ static const uint8_t DOCRC4_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x92, 0x6A, /* PDU payload */ - 0xC2, 0xDC, 0xEE, 0x3B, 0x31, 0xEC, 0x03, 0xDE, - 0x95, 0x33, 0x5E, + 0xC2, 0xDC, 0xEE, 0x3B, 0x31, 0xEC, 0x03, 0xDE, 0x95, 0x33, 0x5E, /* CRC (encrypted) */ 0xFE, 0x47, 0x3E, 0x22 }; @@ -473,19 +344,14 @@ static const uint8_t DOCRC5_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0x2E, 0x07, 0xC8, 0x3C }; @@ -493,19 +359,14 @@ static const uint8_t DOCRC5_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x77, 0x74, /* PDU payload */ - 0x56, 0x05, 0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, - 0x11, 0xFC, 0x7D, 0xB0, 0xE7, 0x18, 0xCE, 0x75, - 0x7C, 0x89, 0x14, 0x56, 0xE2, 0xF2, 0xB7, 0x47, - 0x08, 0x27, 0xF7, 0x08, 0x7A, 0x13, 0x90, 0x81, - 0x75, 0xB0, 0xC7, 0x91, 0x04, 0x83, 0xAD, 0x11, - 0x46, 0x46, 0xF8, 0x54, 0x87, 0xA0, 0x42, 0xF3, - 0x71, 0xA9, 0x8A, 0xCD, 0x59, 0x77, 0x67, 0x11, - 0x1A, 0x87, + 0x56, 0x05, 0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, 0x11, 0xFC, 0x7D, 0xB0, 0xE7, 0x18, 0xCE, + 0x75, 0x7C, 0x89, 0x14, 0x56, 0xE2, 0xF2, 0xB7, 0x47, 0x08, 0x27, 0xF7, 0x08, 0x7A, 0x13, + 0x90, 0x81, 0x75, 0xB0, 0xC7, 0x91, 0x04, 0x83, 0xAD, 0x11, 0x46, 0x46, 0xF8, 0x54, 0x87, + 0xA0, 0x42, 0xF3, 0x71, 0xA9, 0x8A, 0xCD, 0x59, 0x77, 0x67, 0x11, 0x1A, 0x87, /* CRC (encrypted) */ 0xAB, 0xED, 0x2C, 0x26 }; @@ -523,19 +384,14 @@ static const uint8_t DOCRC6_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xB3, 0x60, 0xEB, 0x38 }; @@ -543,19 +399,14 @@ static const uint8_t DOCRC6_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x77, 0x74, /* PDU payload */ - 0x56, 0x05, 0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, - 0x11, 0xFC, 0x7D, 0xB0, 0xE7, 0x18, 0xCE, 0x75, - 0x7C, 0x89, 0x14, 0x56, 0xE2, 0xF2, 0xB7, 0x47, - 0x08, 0x27, 0xF7, 0x08, 0x7A, 0x13, 0x90, 0x81, - 0x75, 0xB0, 0xC7, 0x91, 0x04, 0x83, 0xAD, 0x11, - 0x46, 0x46, 0xF8, 0x54, 0x87, 0xA0, 0xA4, 0x0C, - 0xC2, 0xF0, 0x81, 0x49, 0xA8, 0xA6, 0x6C, 0x48, - 0xEB, 0x1F, 0x4B, + 0x56, 0x05, 0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, 0x11, 0xFC, 0x7D, 0xB0, 0xE7, 0x18, 0xCE, + 0x75, 0x7C, 0x89, 0x14, 0x56, 0xE2, 0xF2, 0xB7, 0x47, 0x08, 0x27, 0xF7, 0x08, 0x7A, 0x13, + 0x90, 0x81, 0x75, 0xB0, 0xC7, 0x91, 0x04, 0x83, 0xAD, 0x11, 0x46, 0x46, 0xF8, 0x54, 0x87, + 0xA0, 0xA4, 0x0C, 0xC2, 0xF0, 0x81, 0x49, 0xA8, 0xA6, 0x6C, 0x48, 0xEB, 0x1F, 0x4B, /* CRC (encrypted) */ 0x2F, 0xD4, 0x48, 0x18 }; @@ -573,19 +424,14 @@ static const uint8_t DOCRC7_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xB3, 0x60, 0xEB, 0x38 }; @@ -593,19 +439,14 @@ static const uint8_t DOCRC7_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0x3B, 0x9F, 0x72, 0x4C, - 0xB5, 0x72, 0x3E, 0x56, 0x54, 0x49, 0x13, 0x53, - 0xC4, 0xAA, 0xCD, 0xEA, 0x6A, 0x88, 0x99, 0x07, - 0x86, 0xF4, 0xCF, 0x03, 0x4E, 0xDF, 0x65, 0x61, - 0x47, 0x5B, 0x2F, 0x81, 0x09, 0x12, 0x9A, 0xC2, - 0x24, 0x8C, 0x09, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x3B, 0x9F, 0x72, 0x4C, 0xB5, 0x72, 0x3E, 0x56, 0x54, 0x49, + 0x13, 0x53, 0xC4, 0xAA, 0xCD, 0xEA, 0x6A, 0x88, 0x99, 0x07, 0x86, 0xF4, 0xCF, 0x03, 0x4E, + 0xDF, 0x65, 0x61, 0x47, 0x5B, 0x2F, 0x81, 0x09, 0x12, 0x9A, 0xC2, 0x24, 0x8C, 0x09, /* CRC (encrypted) */ 0x11, 0xB4, 0x06, 0x33 }; @@ -624,13 +465,11 @@ static const uint8_t DOCRC8_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xCB, 0x7C, 0xAB, 0x56 }; @@ -638,13 +477,11 @@ static const uint8_t DOCRC8_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xCB, 0x7C, 0xAB, 0x56 }; @@ -663,13 +500,11 @@ static const uint8_t DOCRC9_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* instead of CRC (4 bytes) */ 0xAA, 0xAA, 0xAA, 0xAA }; @@ -677,13 +512,11 @@ static const uint8_t DOCRC9_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* DA/ SA */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x77, 0x74, /* PDU payload */ - 0x56, 0x05, 0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, - 0x11, 0xFC, + 0x56, 0x05, 0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, 0x11, 0xFC, /* instead of CRC (4 bytes) */ 0x7D, 0xB0, 0xE7, 0x18 }; @@ -702,13 +535,11 @@ static const uint8_t DOCRC10_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xFF, 0xFF, 0xFF, 0x55 }; @@ -716,13 +547,11 @@ static const uint8_t DOCRC10_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len */ 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xFF, 0xFF, 0xFF, 0x55 }; @@ -736,53 +565,33 @@ static const uint8_t DOCRC10_CT[] = { #define DOCRC10_CRC 0x0 #define DOCRC10_FRAME_LEN DIM(DOCRC10_PT) -static const uint8_t DOCRC18_KEY[] = { - 0x00, 0x00, 0x00, 0x00, 0xaa, 0xbb, 0xcc, 0xdd, - 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 -}; -static const uint8_t DOCRC18_IV[] = { - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 -}; +static const uint8_t DOCRC18_KEY[] = { 0x00, 0x00, 0x00, 0x00, 0xaa, 0xbb, 0xcc, 0xdd, + 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; +static const uint8_t DOCRC18_IV[] = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }; static const uint8_t DOCRC18_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (14 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, /* PDU payload */ - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF }; static const uint8_t DOCRC18_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU payload */ - 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, - 0x3B, 0x9F, 0x72, 0x4C, 0xB5, 0x72, - 0x3E, 0x56, 0x54, 0x49, 0x13, 0x53, - 0xC4, 0xAA, 0xCD, 0xEA, 0x6A, 0x88, - 0x99, 0x07, 0x86, 0xF4, 0xCF, 0x03, - 0x4E, 0xDF, 0x65, 0x61, 0x47, 0x5B, - 0x2F, 0x81, 0x09, 0x12, 0x9A, 0xC2, - 0x24, 0x8C, 0x09, 0x5D, 0x2B, 0x12, - 0xF4 + 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x3B, 0x9F, 0x72, 0x4C, 0xB5, 0x72, 0x3E, 0x56, + 0x54, 0x49, 0x13, 0x53, 0xC4, 0xAA, 0xCD, 0xEA, 0x6A, 0x88, 0x99, 0x07, 0x86, 0xF4, 0xCF, + 0x03, 0x4E, 0xDF, 0x65, 0x61, 0x47, 0x5B, 0x2F, 0x81, 0x09, 0x12, 0x9A, 0xC2, 0x24, 0x8C, + 0x09, 0x5D, 0x2B, 0x12, 0xF4 }; #define DOCRC18_KEY_LEN 16 #define DOCRC18_HASH_OFFSET 6 @@ -793,23 +602,17 @@ static const uint8_t DOCRC18_CT[] = { #define DOCRC18_FRAME_LEN DIM(DOCRC18_PT) /* 256-bit keys */ -static const uint8_t DOCRC11_KEY[] = { - 0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, - 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, - 0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, - 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 -}; -static const uint8_t DOCRC11_IV[] = { - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 -}; +static const uint8_t DOCRC11_KEY[] = { 0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, + 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, + 0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, + 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; +static const uint8_t DOCRC11_IV[] = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }; static const uint8_t DOCRC11_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (14 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, /* CRC (4 bytes) */ 0x14, 0x08, 0xe8, 0x55 }; @@ -817,8 +620,7 @@ static const uint8_t DOCRC11_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x08, 0x46, /* CRC (encrypted) */ @@ -837,9 +639,7 @@ static const uint8_t DOCRC12_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (15 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, 0xAA, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, /* CRC (4 bytes) */ 0x0E, 0x99, 0x8E, 0xFE }; @@ -847,8 +647,7 @@ static const uint8_t DOCRC12_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ 0x08, 0x46, 0x26, /* CRC (encrypted) */ @@ -869,10 +668,8 @@ static const uint8_t DOCRC13_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (24 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xCB, 0x7C, 0xAB, 0x56 }; @@ -880,11 +677,9 @@ static const uint8_t DOCRC13_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ - 0xA1, 0xFF, 0x45, 0x21, 0x43, 0xC7, - 0x5B, 0x3C, 0xAB, 0x7A, 0x80, 0xC9, + 0xA1, 0xFF, 0x45, 0x21, 0x43, 0xC7, 0x5B, 0x3C, 0xAB, 0x7A, 0x80, 0xC9, /* CRC (encrypted) */ 0x70, 0x51, 0x54, 0xD0 }; @@ -903,11 +698,8 @@ static const uint8_t DOCRC14_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (24 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0x3F, 0x15, 0xE1, 0xE8 }; @@ -915,12 +707,9 @@ static const uint8_t DOCRC14_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ - 0xA0, 0x88, 0x19, 0x50, 0x3B, 0x70, - 0x91, 0x3C, 0x2A, 0x46, 0x74, 0x45, - 0x03, + 0xA0, 0x88, 0x19, 0x50, 0x3B, 0x70, 0x91, 0x3C, 0x2A, 0x46, 0x74, 0x45, 0x03, /* CRC (encrypted) */ 0x30, 0xC8, 0xA9, 0xCC }; @@ -939,18 +728,11 @@ static const uint8_t DOCRC15_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (72 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0x2E, 0x07, 0xC8, 0x3C }; @@ -959,19 +741,12 @@ static const uint8_t DOCRC15_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ - 0x5D, 0xB3, 0xD1, 0xF4, 0x6C, 0x65, - 0xCA, 0x3B, 0x5C, 0x16, 0xB3, 0xA4, - 0x23, 0x74, 0x81, 0x5E, 0x12, 0x03, - 0x7B, 0x3F, 0xBB, 0x62, 0x1D, 0x29, - 0x66, 0x60, 0x1B, 0x6E, 0x01, 0xFE, - 0x6F, 0x40, 0x12, 0xE6, 0x20, 0xE6, - 0x10, 0xBE, 0x5B, 0xF2, 0x7E, 0x7F, - 0x43, 0x53, 0x66, 0x38, 0xA6, 0x4D, - 0xF3, 0x66, 0x84, 0x9F, 0xE2, 0xEC, - 0x9F, 0xBC, 0xD4, 0x38, 0xDB, 0x33, + 0x5D, 0xB3, 0xD1, 0xF4, 0x6C, 0x65, 0xCA, 0x3B, 0x5C, 0x16, 0xB3, 0xA4, 0x23, 0x74, 0x81, + 0x5E, 0x12, 0x03, 0x7B, 0x3F, 0xBB, 0x62, 0x1D, 0x29, 0x66, 0x60, 0x1B, 0x6E, 0x01, 0xFE, + 0x6F, 0x40, 0x12, 0xE6, 0x20, 0xE6, 0x10, 0xBE, 0x5B, 0xF2, 0x7E, 0x7F, 0x43, 0x53, 0x66, + 0x38, 0xA6, 0x4D, 0xF3, 0x66, 0x84, 0x9F, 0xE2, 0xEC, 0x9F, 0xBC, 0xD4, 0x38, 0xDB, 0x33, /* CRC (encrypted) */ 0x4E, 0x12, 0xB3, 0xB4 }; @@ -990,19 +765,11 @@ static const uint8_t DOCRC16_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (72 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xB3, 0x60, 0xEB, 0x38 }; @@ -1011,19 +778,12 @@ static const uint8_t DOCRC16_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA (12 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, /* PDU Type/Len (encrypted) */ - 0x5D, 0xB3, 0xD1, 0xF4, 0x6C, 0x65, - 0xCA, 0x3B, 0x5C, 0x16, 0xB3, 0xA4, - 0x23, 0x74, 0x81, 0x5E, 0x12, 0x03, - 0x7B, 0x3F, 0xBB, 0x62, 0x1D, 0x29, - 0x66, 0x60, 0x1B, 0x6E, 0x01, 0xFE, - 0x6F, 0x40, 0x12, 0xE6, 0x20, 0xE6, - 0x10, 0xBE, 0x5B, 0xF2, 0x7E, 0x7F, - 0x43, 0x53, 0x66, 0x38, 0xA6, 0x4D, - 0xD9, 0xA6, 0x6A, 0x07, 0x6B, 0xAA, - 0x5C, 0xF6, 0xB4, 0x1D, 0xC5, 0x9A, + 0x5D, 0xB3, 0xD1, 0xF4, 0x6C, 0x65, 0xCA, 0x3B, 0x5C, 0x16, 0xB3, 0xA4, 0x23, 0x74, 0x81, + 0x5E, 0x12, 0x03, 0x7B, 0x3F, 0xBB, 0x62, 0x1D, 0x29, 0x66, 0x60, 0x1B, 0x6E, 0x01, 0xFE, + 0x6F, 0x40, 0x12, 0xE6, 0x20, 0xE6, 0x10, 0xBE, 0x5B, 0xF2, 0x7E, 0x7F, 0x43, 0x53, 0x66, + 0x38, 0xA6, 0x4D, 0xD9, 0xA6, 0x6A, 0x07, 0x6B, 0xAA, 0x5C, 0xF6, 0xB4, 0x1D, 0xC5, 0x9A, 0x7C, /* CRC (encrypted) */ 0x48, 0xDB, 0xB1, 0x74 @@ -1043,19 +803,11 @@ static const uint8_t DOCRC17_PT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU without CRC (73 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* CRC (4 bytes) */ 0xB3, 0x60, 0xEB, 0x38 }; @@ -1064,20 +816,13 @@ static const uint8_t DOCRC17_CT[] = { /* DOCSIS Header (6 bytes) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* PDU DA / SA + Extra data (34 bytes) */ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, - 0x08, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, /* PDU Type/Len (encrypted) */ - 0x96, 0x03, 0x94, 0x9B, 0xDA, 0x96, - 0x00, 0x42, 0x7B, 0x52, 0xD3, 0xB9, - 0xA4, 0x10, 0x7B, 0x87, 0x0B, 0xBA, - 0x41, 0x0E, 0x2B, 0x8F, 0xA6, 0xA3, - 0xF5, 0x55, 0x9C, 0x0C, 0x69, 0x7C, - 0x36, 0xD2, 0xBF, 0xA1, 0xF2, 0x2B, - 0xAB, 0x1A, 0x92, + 0x96, 0x03, 0x94, 0x9B, 0xDA, 0x96, 0x00, 0x42, 0x7B, 0x52, 0xD3, 0xB9, 0xA4, 0x10, 0x7B, + 0x87, 0x0B, 0xBA, 0x41, 0x0E, 0x2B, 0x8F, 0xA6, 0xA3, 0xF5, 0x55, 0x9C, 0x0C, 0x69, 0x7C, + 0x36, 0xD2, 0xBF, 0xA1, 0xF2, 0x2B, 0xAB, 0x1A, 0x92, /* CRC (encrypted) */ 0xAF, 0x19, 0x88, 0xDD }; @@ -1092,13 +837,12 @@ static const uint8_t DOCRC17_CT[] = { #define DOCRC17_CRC 0x38EB60B3 /* LE */ #define DOCRC17_FRAME_LEN DIM(DOCRC17_PT) - -#define MK_DOCRC_VEC(_n) \ - { _n ## _FRAME_LEN, _n ## _KEY, _n ## _KEY_LEN, _n ## _IV, \ - _n ## _PT, _n ## _CT, \ - _n ## _HASH_OFFSET, _n ## _HASH_LENGTH, \ - _n ## _CIPHER_OFFSET, _n ## _CIPHER_LENGTH, \ - _n ## _CRC } +#define MK_DOCRC_VEC(_n) \ + { \ + _n##_FRAME_LEN, _n##_KEY, _n##_KEY_LEN, _n##_IV, _n##_PT, _n##_CT, \ + _n##_HASH_OFFSET, _n##_HASH_LENGTH, _n##_CIPHER_OFFSET, \ + _n##_CIPHER_LENGTH, _n##_CRC \ + } struct docsis_crc_vector { uint64_t frame_len; @@ -1138,22 +882,16 @@ struct docsis_crc_vector docsis_crc_tab[] = { }; static int -aes_job_ok(const struct IMB_JOB *job, - const uint8_t *out_text, - const uint8_t *target, - const uint8_t *padding, - const size_t sizeof_padding, - const unsigned text_len) +aes_job_ok(const struct IMB_JOB *job, const uint8_t *out_text, const uint8_t *target, + const uint8_t *padding, const size_t sizeof_padding, const unsigned text_len) { - const int num = (const int)((uint64_t)job->user_data2); + const int num = (const int) ((uint64_t) job->user_data2); if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %d", - __LINE__, job->status, num); + printf("%d error status:%d, job %d", __LINE__, job->status, num); return 0; } - if (memcmp(out_text, target + sizeof_padding, - text_len)) { + if (memcmp(out_text, target + sizeof_padding, text_len)) { printf("%d mismatched\n", num); return 0; } @@ -1161,9 +899,7 @@ aes_job_ok(const struct IMB_JOB *job, printf("%d overwrite head\n", num); return 0; } - if (memcmp(padding, - target + sizeof_padding + text_len, - sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { printf("%d overwrite tail\n", num); return 0; } @@ -1171,19 +907,10 @@ aes_job_ok(const struct IMB_JOB *job, } static int -test_aes_many(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const unsigned text_len, - const int dir, - const int order, - const IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) +test_aes_many(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, const void *iv, + const uint8_t *in_text, const uint8_t *out_text, const unsigned text_len, + const int dir, const int order, const IMB_CIPHER_MODE cipher, const int in_place, + const int key_len, const int num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -1232,7 +959,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); job->hash_alg = IMB_AUTH_NULL; @@ -1247,8 +974,8 @@ test_aes_many(struct IMB_MGR *mb_mgr, } else { /* got job back */ jobs_rx++; - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), + text_len)) goto end; } } @@ -1261,8 +988,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, } jobs_rx++; - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), text_len)) goto end; } @@ -1272,7 +998,7 @@ test_aes_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) { err = imb_get_errno(mb_mgr); if (err != 0) { @@ -1292,21 +1018,12 @@ end_alloc: } static int -test_aes_many_burst(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const unsigned text_len, - const int dir, - const int order, - const IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) +test_aes_many_burst(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, const void *iv, + const uint8_t *in_text, const uint8_t *out_text, const unsigned text_len, + const int dir, const int order, const IMB_CIPHER_MODE cipher, + const int in_place, const int key_len, const int num_jobs) { - struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = {NULL}; + struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; uint8_t padding[16]; uint8_t **targets = malloc(num_jobs * sizeof(void *)); int i, completed_jobs, jobs_rx = 0, ret = -1; @@ -1328,7 +1045,7 @@ test_aes_many_burst(struct IMB_MGR *mb_mgr, } } - while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < (uint32_t)num_jobs) + while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < (uint32_t) num_jobs) IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); for (i = 0; i < num_jobs; i++) { @@ -1355,7 +1072,7 @@ test_aes_many_burst(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); imb_set_session(mb_mgr, job); } @@ -1365,8 +1082,7 @@ test_aes_many_burst(struct IMB_MGR *mb_mgr, int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } } @@ -1376,32 +1092,28 @@ check_burst_jobs: job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %d status not complete!\n", i+1); + printf("job %d status not complete!\n", i + 1); goto end; } - if (!aes_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!aes_job_ok(job, out_text, job->user_data, padding, sizeof(padding), text_len)) goto end; jobs_rx++; } if (jobs_rx != num_jobs) { - completed_jobs = IMB_FLUSH_BURST(mb_mgr, - num_jobs - completed_jobs, - jobs); + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); if (completed_jobs == 0) { - printf("Expected %d jobs, received %d\n", - num_jobs, jobs_rx); + printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); goto end; } goto check_burst_jobs; } ret = 0; - end: +end: - end_alloc: +end_alloc: if (targets != NULL) { for (i = 0; i < num_jobs; i++) free(targets[i]); @@ -1412,26 +1124,23 @@ check_burst_jobs: } static void -test_aes_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx128, - struct test_suite_context *ctx256, - const int vec_cnt, - const struct aes_vector *vec_tab, const char *banner, - const IMB_CIPHER_MODE cipher, const int num_jobs) +test_aes_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, + struct test_suite_context *ctx256, const int vec_cnt, + const struct aes_vector *vec_tab, const char *banner, const IMB_CIPHER_MODE cipher, + const int num_jobs) { - int vect; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + int vect; + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_cnt; vect++) { + printf("%s (N jobs = %d):\n", banner, num_jobs); + for (vect = 0; vect < vec_cnt; vect++) { struct test_suite_context *ctx; if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector key_len:%d\n", - vect + 1, vec_cnt, + printf("[%d/%d] Standard vector key_len:%d\n", vect + 1, vec_cnt, (int) vec_tab[vect].Klen); #else printf("."); @@ -1440,146 +1149,111 @@ test_aes_vectors(struct IMB_MGR *mb_mgr, switch (vec_tab[vect].Klen) { case 16: - IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].K, enc_keys, dec_keys); ctx = ctx128; break; case 32: default: - IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].K, enc_keys, dec_keys); ctx = ctx256; break; } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].P, + vec_tab[vect].C, (unsigned) vec_tab[vect].Plen, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 0, vec_tab[vect].Klen, num_jobs)) { printf("error #%d encrypt\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many_burst( + mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].P, + vec_tab[vect].C, (unsigned) vec_tab[vect].Plen, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 0, vec_tab[vect].Klen, num_jobs)) { printf("error #%d encrypt burst\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].C, + vec_tab[vect].P, (unsigned) vec_tab[vect].Plen, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 0, vec_tab[vect].Klen, num_jobs)) { printf("error #%d decrypt\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many_burst( + mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].C, + vec_tab[vect].P, (unsigned) vec_tab[vect].Plen, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 0, vec_tab[vect].Klen, num_jobs)) { printf("error #%d decrypt burst\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].P, + vec_tab[vect].C, (unsigned) vec_tab[vect].Plen, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 1, vec_tab[vect].Klen, num_jobs)) { printf("error #%d encrypt in-place\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].P, vec_tab[vect].C, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many_burst( + mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].P, + vec_tab[vect].C, (unsigned) vec_tab[vect].Plen, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 1, vec_tab[vect].Klen, num_jobs)) { printf("error #%d encrypt burst in-place\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many(mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].C, + vec_tab[vect].P, (unsigned) vec_tab[vect].Plen, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 1, vec_tab[vect].Klen, num_jobs)) { printf("error #%d decrypt in-place\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_aes_many_burst(mb_mgr, enc_keys, dec_keys, - vec_tab[vect].IV, - vec_tab[vect].C, vec_tab[vect].P, - (unsigned) vec_tab[vect].Plen, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, - vec_tab[vect].Klen, num_jobs)) { + if (test_aes_many_burst( + mb_mgr, enc_keys, dec_keys, vec_tab[vect].IV, vec_tab[vect].C, + vec_tab[vect].P, (unsigned) vec_tab[vect].Plen, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 1, vec_tab[vect].Klen, num_jobs)) { printf("error #%d decrypt burst in-place\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } static int -docrc_job_ok(const struct IMB_JOB *job, - const struct docsis_crc_vector *p_vec, - const uint8_t *target, - const uint8_t *padding, - const size_t sizeof_padding, +docrc_job_ok(const struct IMB_JOB *job, const struct docsis_crc_vector *p_vec, + const uint8_t *target, const uint8_t *padding, const size_t sizeof_padding, const uint8_t *out_text) { - const int num = (const int)((uint64_t)job->user_data2); + const int num = (const int) ((uint64_t) job->user_data2); const unsigned text_len = (unsigned) p_vec->frame_len; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %d", - __LINE__, job->status, num); + printf("%d error status:%d, job %d", __LINE__, job->status, num); return 0; } if (job->msg_len_to_cipher_in_bytes > 0) { - if (memcmp(out_text, target + sizeof_padding, - text_len)) { + if (memcmp(out_text, target + sizeof_padding, text_len)) { printf("%d message mismatched\n", num); return 0; } @@ -1589,21 +1263,16 @@ docrc_job_ok(const struct IMB_JOB *job, return 0; } - if (memcmp(padding, - target + sizeof_padding + text_len, - sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { printf("%d overwrite tail\n", num); return 0; } } if (job->msg_len_to_hash_in_bytes >= 14) { - if (memcmp(job->auth_tag_output, &p_vec->crc_hash, - sizeof(p_vec->crc_hash))) { - const uint32_t *p_got = - (const uint32_t *)job->auth_tag_output; - const uint32_t *p_exp = - (const uint32_t *)&p_vec->crc_hash; + if (memcmp(job->auth_tag_output, &p_vec->crc_hash, sizeof(p_vec->crc_hash))) { + const uint32_t *p_got = (const uint32_t *) job->auth_tag_output; + const uint32_t *p_exp = (const uint32_t *) &p_vec->crc_hash; printf("%d authentication tag mismatch " "(got = 0x%X, exp = 0x%X)\n", @@ -1616,14 +1285,9 @@ docrc_job_ok(const struct IMB_JOB *job, } static int -test_docrc_many(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const struct docsis_crc_vector *p_vec, - const int dir, - const int order, - const int in_place, - const int num_jobs) +test_docrc_many(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, + const struct docsis_crc_vector *p_vec, const int dir, const int order, + const int in_place, const int num_jobs) { const uint64_t key_len = p_vec->key_len; const unsigned tag_len = 4; @@ -1661,11 +1325,10 @@ test_docrc_many(struct IMB_MGR *mb_mgr, memset(targets[i], -1, frame_len + (sizeof(padding) * 2)); if (in_place) { /* copy input text to the allocated buffer */ - memcpy(targets[i] + sizeof(padding), in_text, - frame_len); + memcpy(targets[i] + sizeof(padding), in_text, frame_len); if (dir == IMB_DIR_ENCRYPT && p_vec->hash_length >= 14) - memset(targets[i] + sizeof(padding) + - frame_len - tag_len, 0xff, tag_len); + memset(targets[i] + sizeof(padding) + frame_len - tag_len, 0xff, + tag_len); } } @@ -1681,8 +1344,7 @@ test_docrc_many(struct IMB_MGR *mb_mgr, job->dst = targets[i] + sizeof(padding); job->src = in_text; } else { - job->dst = targets[i] + sizeof(padding) + - p_vec->cipher_offset; + job->dst = targets[i] + sizeof(padding) + p_vec->cipher_offset; job->src = targets[i] + sizeof(padding); } job->cipher_mode = IMB_CIPHER_DOCSIS_SEC_BPI; @@ -1695,7 +1357,7 @@ test_docrc_many(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = p_vec->cipher_offset; job->msg_len_to_cipher_in_bytes = p_vec->cipher_length; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); job->hash_alg = IMB_AUTH_DOCSIS_CRC32; job->hash_start_src_offset_in_bytes = p_vec->hash_offset; @@ -1706,16 +1368,15 @@ test_docrc_many(struct IMB_MGR *mb_mgr, job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { jobs_rx++; - if (!docrc_job_ok(job, p_vec, job->user_data, padding, - sizeof(padding), out_text)) + if (!docrc_job_ok(job, p_vec, job->user_data, padding, sizeof(padding), + out_text)) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!docrc_job_ok(job, p_vec, job->user_data, padding, - sizeof(padding), out_text)) + if (!docrc_job_ok(job, p_vec, job->user_data, padding, sizeof(padding), out_text)) goto end; } @@ -1725,10 +1386,10 @@ test_docrc_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; - end_alloc: +end_alloc: if (targets != NULL) { for (i = 0; i < num_jobs; i++) @@ -1741,63 +1402,51 @@ test_docrc_many(struct IMB_MGR *mb_mgr, } static void -test_docrc_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx128, - struct test_suite_context *ctx256, - const int vec_cnt, - const struct docsis_crc_vector *vec_tab, - const char *banner, const int num_jobs) +test_docrc_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, + struct test_suite_context *ctx256, const int vec_cnt, + const struct docsis_crc_vector *vec_tab, const char *banner, const int num_jobs) { - int vect; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + int vect; + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_cnt; vect++) { + printf("%s (N jobs = %d):\n", banner, num_jobs); + for (vect = 0; vect < vec_cnt; vect++) { struct test_suite_context *ctx; if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector\n", - vect + 1, vec_cnt); + printf("[%d/%d] Standard vector\n", vect + 1, vec_cnt); #else printf("."); #endif } if (vec_tab[vect].key_len == 16) { - IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].key, enc_keys, dec_keys); ctx = ctx128; } else { - IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].key, enc_keys, dec_keys); ctx = ctx256; } - - if (test_docrc_many(mb_mgr, enc_keys, dec_keys, - &vec_tab[vect], - IMB_DIR_ENCRYPT, IMB_ORDER_HASH_CIPHER, 1, - num_jobs)) { + if (test_docrc_many(mb_mgr, enc_keys, dec_keys, &vec_tab[vect], IMB_DIR_ENCRYPT, + IMB_ORDER_HASH_CIPHER, 1, num_jobs)) { printf("error #%d encrypt\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_docrc_many(mb_mgr, enc_keys, dec_keys, - &vec_tab[vect], - IMB_DIR_DECRYPT, IMB_ORDER_CIPHER_HASH, 1, - num_jobs)) { + if (test_docrc_many(mb_mgr, enc_keys, dec_keys, &vec_tab[vect], IMB_DIR_DECRYPT, + IMB_ORDER_CIPHER_HASH, 1, num_jobs)) { printf("error #%d decrypt\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - - } + } if (!quiet_mode) printf("\n"); } @@ -1805,9 +1454,7 @@ test_docrc_vectors(struct IMB_MGR *mb_mgr, int aes_test(struct IMB_MGR *mb_mgr) { - const int num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17, MAX_BURST_JOBS - }; + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17, MAX_BURST_JOBS }; unsigned i; int errors = 0; struct test_suite_context ctx128; @@ -1816,11 +1463,8 @@ aes_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx128, "DOCSIS-SEC-128"); test_suite_start(&ctx256, "DOCSIS-SEC-256"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_aes_vectors(mb_mgr, &ctx128, &ctx256, - DIM(docsis_vectors), - docsis_vectors, - "AES-DOCSIS standard test vectors", - IMB_CIPHER_DOCSIS_SEC_BPI, + test_aes_vectors(mb_mgr, &ctx128, &ctx256, DIM(docsis_vectors), docsis_vectors, + "AES-DOCSIS standard test vectors", IMB_CIPHER_DOCSIS_SEC_BPI, num_jobs_tab[i]); errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx256); @@ -1828,11 +1472,8 @@ aes_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx128, "DOCSIS-SEC-128-CRC32"); test_suite_start(&ctx256, "DOCSIS-SEC-256-CRC32"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_docrc_vectors(mb_mgr, &ctx128, &ctx256, - DIM(docsis_crc_tab), - docsis_crc_tab, - "AES-DOCSIS+CRC32 vectors", - num_jobs_tab[i]); + test_docrc_vectors(mb_mgr, &ctx128, &ctx256, DIM(docsis_crc_tab), docsis_crc_tab, + "AES-DOCSIS+CRC32 vectors", num_jobs_tab[i]); errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx256); diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index f581408d..bec1501a 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -40,7 +40,8 @@ #define MAX_BURST_JOBS 32 -int api_test(struct IMB_MGR *mb_mgr); +int +api_test(struct IMB_MGR *mb_mgr); enum { TEST_UNEXPECTED_JOB = 1, @@ -75,7 +76,8 @@ enum { TEST_INVALID_PON_PLI = 300, }; -static void print_progress(void) +static void +print_progress(void) { if (!quiet_mode) printf("."); @@ -90,20 +92,19 @@ test_job_api(struct IMB_MGR *mb_mgr) struct IMB_JOB *job, *job_next; int err; - printf("JOB API behavior test:\n"); + printf("JOB API behavior test:\n"); /* ======== test 1 */ job = IMB_GET_NEXT_JOB(mb_mgr); if (job == NULL) { - printf("%s: test %d, unexpected job = NULL\n", - __func__, TEST_UNEXPECTED_JOB); + printf("%s: test %d, unexpected job = NULL\n", __func__, TEST_UNEXPECTED_JOB); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != 0) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_UNEXPECTED_JOB, imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_UNEXPECTED_JOB, + imb_get_strerror(err)); return 1; } print_progress(); @@ -113,15 +114,14 @@ test_job_api(struct IMB_MGR *mb_mgr) job_next = IMB_SUBMIT_JOB(mb_mgr); if (job != job_next) { /* Invalid job should be returned straight away */ - printf("%s: test %d, unexpected job != job_next\n", - __func__, TEST_INVALID_JOB); + printf("%s: test %d, unexpected job != job_next\n", __func__, TEST_INVALID_JOB); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err == 0) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_JOB, imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_JOB, + imb_get_strerror(err)); return 1; } print_progress(); @@ -129,7 +129,8 @@ test_job_api(struct IMB_MGR *mb_mgr) if (job_next->status != IMB_STATUS_INVALID_ARGS) { /* Invalid job is returned, and status should be INVALID_ARGS */ printf("%s: test %d, unexpected job->status != " - "IMB_STATUS_INVALID_ARGS\n", __func__, TEST_INVALID_JOB); + "IMB_STATUS_INVALID_ARGS\n", + __func__, TEST_INVALID_JOB); return 1; } print_progress(); @@ -137,15 +138,15 @@ test_job_api(struct IMB_MGR *mb_mgr) job_next = IMB_GET_NEXT_JOB(mb_mgr); if (job == job_next) { /* get next job should point to a new job slot */ - printf("%s: test %d, unexpected job == get_next_job()\n", - __func__, TEST_INVALID_JOB); + printf("%s: test %d, unexpected job == get_next_job()\n", __func__, + TEST_INVALID_JOB); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != 0) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_JOB, imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_JOB, + imb_get_strerror(err)); return 1; } print_progress(); @@ -153,15 +154,14 @@ test_job_api(struct IMB_MGR *mb_mgr) job = IMB_GET_COMPLETED_JOB(mb_mgr); if (job) { /* there should not be any completed jobs left */ - printf("%s: test %d, unexpected completed job\n", - __func__, TEST_INVALID_JOB); + printf("%s: test %d, unexpected completed job\n", __func__, TEST_INVALID_JOB); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != 0) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_JOB, imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_JOB, + imb_get_strerror(err)); return 1; } print_progress(); @@ -178,7 +178,8 @@ test_job_api(struct IMB_MGR *mb_mgr) /* * @brief Dummy function for custom hash and cipher modes */ -static int dummy_cipher_hash_func(struct IMB_JOB *job) +static int +dummy_cipher_hash_func(struct IMB_JOB *job) { (void) job; return 0; @@ -188,12 +189,9 @@ static int dummy_cipher_hash_func(struct IMB_JOB *job) * @brief Fills in job structure with valid settings */ static void -fill_in_job(struct IMB_JOB *job, - const IMB_CIPHER_MODE cipher_mode, - const IMB_CIPHER_DIRECTION cipher_direction, - const IMB_HASH_ALG hash_alg, - const IMB_CHAIN_ORDER chain_order, - struct chacha20_poly1305_context_data *chacha_ctx, +fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, + const IMB_CIPHER_DIRECTION cipher_direction, const IMB_HASH_ALG hash_alg, + const IMB_CHAIN_ORDER chain_order, struct chacha20_poly1305_context_data *chacha_ctx, struct gcm_context_data *gcm_ctx) { const uint64_t tag_len_tab[] = { @@ -335,12 +333,10 @@ fill_in_job(struct IMB_JOB *job, job->iv_len_in_bytes = 16; /* create XGEM header template */ - const uint64_t pli = - (msg_len_to_cipher << 2) & 0xffff; + const uint64_t pli = (msg_len_to_cipher << 2) & 0xffff; uint64_t *ptr64 = (uint64_t *) dust_bin; - ptr64[0] = ((pli >> 8) & 0xff) | - ((pli & 0xff) << 8); + ptr64[0] = ((pli >> 8) & 0xff) | ((pli & 0xff) << 8); break; case IMB_CIPHER_ECB: job->key_len_in_bytes = UINT64_C(16); @@ -444,8 +440,7 @@ fill_in_job(struct IMB_JOB *job, case IMB_AUTH_AES_CCM: job->u.CCM.aad = dust_bin; job->u.CCM.aad_len_in_bytes = 16; - job->hash_start_src_offset_in_bytes = - job->cipher_start_src_offset_in_bytes; + job->hash_start_src_offset_in_bytes = job->cipher_start_src_offset_in_bytes; job->msg_len_to_hash_in_bytes = msg_len_to_cipher; /* set required cipher mode fields */ job->cipher_mode = IMB_CIPHER_CCM; @@ -482,11 +477,9 @@ fill_in_job(struct IMB_JOB *job, case IMB_AUTH_DOCSIS_CRC32: job->auth_tag_output_len_in_bytes = 4; job->hash_start_src_offset_in_bytes = 32; - job->cipher_start_src_offset_in_bytes = - job->hash_start_src_offset_in_bytes + 12; + job->cipher_start_src_offset_in_bytes = job->hash_start_src_offset_in_bytes + 12; job->msg_len_to_hash_in_bits = 64; - job->msg_len_to_cipher_in_bytes = - job->msg_len_to_hash_in_bytes - 12 + 4; + job->msg_len_to_cipher_in_bytes = job->msg_len_to_hash_in_bytes - 12 + 4; /* set required cipher mode fields */ job->cipher_mode = IMB_CIPHER_DOCSIS_SEC_BPI; job->key_len_in_bytes = UINT64_C(16); @@ -564,8 +557,8 @@ fill_in_job(struct IMB_JOB *job, * invalid arguments status. */ static int -is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, - const int test_num, int expected_errnum) +is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, const int test_num, + int expected_errnum) { struct IMB_JOB *mb_job = NULL, *job_ret = NULL; int err; @@ -576,9 +569,8 @@ is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected get_next_job() == NULL\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, (int) job->cipher_direction, - (int) job->cipher_mode); + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode); return 0; } err = imb_get_errno(mb_mgr); @@ -586,9 +578,8 @@ is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected error: %s\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, (int) job->cipher_direction, - (int) job->cipher_mode, imb_get_strerror(err)); + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode, imb_get_strerror(err)); return 0; } @@ -602,9 +593,8 @@ is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected error: %s\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, (int) job->cipher_direction, - (int) job->cipher_mode, imb_get_strerror(err)); + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode, imb_get_strerror(err)); return 0; } @@ -621,10 +611,8 @@ is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, "unexpected job_ret == NULL " "(most likely job passed checks and got " "submitted)\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, - (int) job->cipher_direction, - (int) job->cipher_mode); + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode); return 0; } err = imb_get_errno(mb_mgr); @@ -632,10 +620,8 @@ is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected error: %s\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, - (int) job->cipher_direction, - (int) job->cipher_mode, + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode, imb_get_strerror(err)); return 0; } @@ -645,10 +631,9 @@ is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected job->status %d != IMB_STATUS_INVALID_ARGS\n", - __func__, test_num, (int) job_ret->hash_alg, - (int) job_ret->chain_order, - (int) job_ret->cipher_direction, - (int) job_ret->cipher_mode, (int) job_ret->status); + __func__, test_num, (int) job_ret->hash_alg, (int) job_ret->chain_order, + (int) job_ret->cipher_direction, (int) job_ret->cipher_mode, + (int) job_ret->status); return 0; } @@ -660,10 +645,10 @@ is_submit_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, * invalid arguments status and error value */ static int -is_submit_burst_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, - const int test_num, int expected_errnum) +is_submit_burst_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, const int test_num, + int expected_errnum) { - IMB_JOB * jobs[MAX_BURST_JOBS] = {NULL}; + IMB_JOB *jobs[MAX_BURST_JOBS] = { NULL }; uint32_t i, completed_jobs, n_jobs = MAX_BURST_JOBS; int err; @@ -680,9 +665,8 @@ is_submit_burst_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected number of completed jobs: %u\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, (int) job->cipher_direction, - (int) job->cipher_mode, completed_jobs); + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode, completed_jobs); } err = imb_get_errno(mb_mgr); @@ -690,9 +674,8 @@ is_submit_burst_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected error: %s\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, (int) job->cipher_direction, - (int) job->cipher_mode, imb_get_strerror(err)); + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode, imb_get_strerror(err)); return 0; } @@ -700,10 +683,8 @@ is_submit_burst_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, printf("%s : test %d, hash_alg %d, chain_order %d, " "cipher_dir %d, cipher_mode %d : " "unexpected job->status %d != IMB_STATUS_INVALID_ARGS\n", - __func__, test_num, (int) job->hash_alg, - (int) job->chain_order, - (int) job->cipher_direction, - (int) job->cipher_mode, (int) job->status); + __func__, test_num, (int) job->hash_alg, (int) job->chain_order, + (int) job->cipher_direction, (int) job->cipher_mode, (int) job->status); return 0; } @@ -716,12 +697,12 @@ is_submit_burst_invalid(struct IMB_MGR *mb_mgr, const struct IMB_JOB *job, static int test_burst_api(struct IMB_MGR *mb_mgr) { - struct IMB_JOB *job = NULL, *jobs[MAX_BURST_JOBS] = {NULL}; + struct IMB_JOB *job = NULL, *jobs[MAX_BURST_JOBS] = { NULL }; uint32_t i, completed_jobs, n_jobs = MAX_BURST_JOBS; struct IMB_JOB **null_jobs = NULL; int err; - printf("SUBMIT_BURST() API behavior test:\n"); + printf("SUBMIT_BURST() API behavior test:\n"); /* ======== test 1 : NULL pointer to jobs array */ @@ -729,15 +710,15 @@ test_burst_api(struct IMB_MGR *mb_mgr) completed_jobs = IMB_SUBMIT_BURST(mb_mgr, n_jobs, null_jobs); if (completed_jobs != 0) { printf("%s: test %d, unexpected number of completed " - "jobs\n", __func__, TEST_INVALID_BURST); + "jobs\n", + __func__, TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_NULL_BURST) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -748,15 +729,15 @@ test_burst_api(struct IMB_MGR *mb_mgr) completed_jobs = IMB_SUBMIT_BURST(mb_mgr, n_jobs, jobs); if (completed_jobs != 0) { printf("%s: test %d, unexpected number of completed " - "jobs\n", __func__, TEST_INVALID_BURST); + "jobs\n", + __func__, TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_NULL_JOB) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -764,19 +745,18 @@ test_burst_api(struct IMB_MGR *mb_mgr) /* ========== test 3: invalid burst size */ - completed_jobs = IMB_SUBMIT_BURST(mb_mgr, - IMB_MAX_BURST_SIZE + 1, jobs); + completed_jobs = IMB_SUBMIT_BURST(mb_mgr, IMB_MAX_BURST_SIZE + 1, jobs); if (completed_jobs != 0) { printf("%s: test %d, unexpected number of completed " - "jobs\n", __func__, TEST_INVALID_BURST); + "jobs\n", + __func__, TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_BURST_SIZE) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -807,15 +787,15 @@ test_burst_api(struct IMB_MGR *mb_mgr) completed_jobs = IMB_SUBMIT_BURST(mb_mgr, n_jobs, jobs); if (completed_jobs != 0) { printf("%s: test %d, unexpected number of completed " - "jobs\n", __func__, TEST_INVALID_BURST); + "jobs\n", + __func__, TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_BURST_OOO) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -845,24 +825,23 @@ test_burst_api(struct IMB_MGR *mb_mgr) /* no jobs should complete if any job is invalid */ completed_jobs = IMB_SUBMIT_BURST(mb_mgr, n_jobs, jobs); if (completed_jobs != 0) { - printf("%s: test %d, unexpected number of completed jobs\n", - __func__, TEST_INVALID_BURST); + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_JOB_NULL_KEY) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, + imb_get_strerror(err)); return 1; } print_progress(); /* check invalid job returned in jobs[0] */ if (jobs[0] != jobs[n_jobs - 1]) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, "invalid job not returned in burst_job[0]"); return 1; } @@ -879,16 +858,15 @@ test_burst_api(struct IMB_MGR *mb_mgr) completed_jobs = IMB_GET_NEXT_BURST(mb_mgr, n_jobs, null_jobs); if (completed_jobs != 0) { - printf("%s: test %d, unexpected number of completed jobs\n", - __func__, TEST_INVALID_BURST); + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_NULL_BURST) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -896,19 +874,17 @@ test_burst_api(struct IMB_MGR *mb_mgr) /* ======== test 7 : Invalid burst size */ - completed_jobs = IMB_GET_NEXT_BURST(mb_mgr, - IMB_MAX_BURST_SIZE + 1, jobs); + completed_jobs = IMB_GET_NEXT_BURST(mb_mgr, IMB_MAX_BURST_SIZE + 1, jobs); if (completed_jobs != 0) { - printf("%s: test %d, unexpected number of completed jobs\n", - __func__, TEST_INVALID_BURST); + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_BURST_SIZE) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -920,16 +896,15 @@ test_burst_api(struct IMB_MGR *mb_mgr) completed_jobs = IMB_FLUSH_BURST(mb_mgr, n_jobs, null_jobs); if (completed_jobs != 0) { - printf("%s: test %d, unexpected number of completed jobs\n", - __func__, TEST_INVALID_BURST); + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_NULL_BURST) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -960,15 +935,15 @@ test_burst_api(struct IMB_MGR *mb_mgr) completed_jobs = IMB_SUBMIT_BURST(mb_mgr, n_jobs, jobs); if (completed_jobs != 0) { printf("%s: test %d, unexpected number of completed " - "jobs\n", __func__, TEST_INVALID_BURST); + "jobs\n", + __func__, TEST_INVALID_BURST); return 1; } print_progress(); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_BURST_SUITE_ID) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, + printf("%s: test %d, unexpected error: %s\n", __func__, TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } @@ -1005,9 +980,8 @@ test_burst_api(struct IMB_MGR *mb_mgr) imb_set_session(NULL, job); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_NULL_MBMGR) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, - imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, + TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } print_progress(); @@ -1016,9 +990,8 @@ test_burst_api(struct IMB_MGR *mb_mgr) imb_set_session(mb_mgr, NULL); err = imb_get_errno(mb_mgr); if (err != IMB_ERR_NULL_JOB) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, - imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, + TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } print_progress(); @@ -1027,9 +1000,8 @@ test_burst_api(struct IMB_MGR *mb_mgr) imb_set_session(mb_mgr, job); err = imb_get_errno(mb_mgr); if (err != 0) { - printf("%s: test %d, unexpected error: %s\n", - __func__, TEST_INVALID_BURST, - imb_get_strerror(err)); + printf("%s: test %d, unexpected error: %s\n", __func__, + TEST_INVALID_BURST, imb_get_strerror(err)); return 1; } } @@ -1038,13 +1010,12 @@ test_burst_api(struct IMB_MGR *mb_mgr) completed_jobs = IMB_SUBMIT_BURST(mb_mgr, n_jobs, jobs); completed_jobs += IMB_FLUSH_BURST(mb_mgr, n_jobs, jobs); if (completed_jobs != n_jobs) { - printf("%s: test %d, unexpected number of completed jobs\n", - __func__, TEST_INVALID_BURST); + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); return 1; } print_progress(); - /* ======== end */ if (!quiet_mode) @@ -1059,24 +1030,16 @@ test_burst_api(struct IMB_MGR *mb_mgr) static int check_aead(IMB_HASH_ALG hash, IMB_CIPHER_MODE cipher) { - if (hash == IMB_AUTH_CHACHA20_POLY1305 || - hash == IMB_AUTH_CHACHA20_POLY1305_SGL || - hash == IMB_AUTH_DOCSIS_CRC32 || - hash == IMB_AUTH_GCM_SGL || - hash == IMB_AUTH_AES_GMAC || - hash == IMB_AUTH_AES_CCM || - hash == IMB_AUTH_SNOW_V_AEAD || + if (hash == IMB_AUTH_CHACHA20_POLY1305 || hash == IMB_AUTH_CHACHA20_POLY1305_SGL || + hash == IMB_AUTH_DOCSIS_CRC32 || hash == IMB_AUTH_GCM_SGL || + hash == IMB_AUTH_AES_GMAC || hash == IMB_AUTH_AES_CCM || hash == IMB_AUTH_SNOW_V_AEAD || hash == IMB_AUTH_PON_CRC_BIP) return 1; - if (cipher == IMB_CIPHER_CHACHA20_POLY1305 || - cipher == IMB_CIPHER_CHACHA20_POLY1305_SGL || - cipher == IMB_CIPHER_DOCSIS_SEC_BPI || - cipher == IMB_CIPHER_GCM_SGL || - cipher == IMB_CIPHER_GCM || - cipher == IMB_CIPHER_CCM || - cipher == IMB_CIPHER_SNOW_V_AEAD || - cipher == IMB_CIPHER_PON_AES_CNTR) + if (cipher == IMB_CIPHER_CHACHA20_POLY1305 || cipher == IMB_CIPHER_CHACHA20_POLY1305_SGL || + cipher == IMB_CIPHER_DOCSIS_SEC_BPI || cipher == IMB_CIPHER_GCM_SGL || + cipher == IMB_CIPHER_GCM || cipher == IMB_CIPHER_CCM || + cipher == IMB_CIPHER_SNOW_V_AEAD || cipher == IMB_CIPHER_PON_AES_CNTR) return 1; return 0; } @@ -1095,7 +1058,7 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) struct chacha20_poly1305_context_data chacha_ctx; struct gcm_context_data gcm_ctx; - printf("Invalid JOB MAC arguments test:\n"); + printf("Invalid JOB MAC arguments test:\n"); /* prep */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -1104,13 +1067,10 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * SRC = NULL test */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { - if (hash == IMB_AUTH_NULL || - hash == IMB_AUTH_CUSTOM) + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { + if (hash == IMB_AUTH_NULL || hash == IMB_AUTH_CUSTOM) continue; #ifdef __aarch64__ if (hash != IMB_AUTH_SNOW3G_UIA2_BITLEN && @@ -1127,18 +1087,15 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) if (check_aead(hash, cipher)) continue; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, + &gcm_ctx); template_job.src = NULL; - if (!is_submit_invalid(mb_mgr, - &template_job, - TEST_AUTH_SRC_NULL, + if (!is_submit_invalid(mb_mgr, &template_job, TEST_AUTH_SRC_NULL, IMB_ERR_JOB_NULL_SRC)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_AUTH_SRC_NULL, IMB_ERR_JOB_NULL_SRC)) return 1; @@ -1148,13 +1105,10 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * AUTH_TAG_OUTPUT = NULL test */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { - if (hash == IMB_AUTH_NULL || - hash == IMB_AUTH_CUSTOM) + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { + if (hash == IMB_AUTH_NULL || hash == IMB_AUTH_CUSTOM) continue; #ifdef __aarch64__ if (hash != IMB_AUTH_SNOW3G_UIA2_BITLEN && @@ -1170,20 +1124,18 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) if (check_aead(hash, cipher)) continue; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, + &gcm_ctx); template_job.auth_tag_output = NULL; if (hash == IMB_AUTH_GCM_SGL) - template_job.sgl_state = - IMB_SGL_COMPLETE; + template_job.sgl_state = IMB_SGL_COMPLETE; if (!is_submit_invalid(mb_mgr, &template_job, TEST_AUTH_AUTH_TAG_OUTPUT_NULL, IMB_ERR_JOB_NULL_AUTH)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_AUTH_AUTH_TAG_OUTPUT_NULL, IMB_ERR_JOB_NULL_AUTH)) return 1; @@ -1193,13 +1145,10 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * AUTH_TAG_OUTPUT_LEN = 0 test */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { - if (hash == IMB_AUTH_NULL || - hash == IMB_AUTH_CUSTOM) + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { + if (hash == IMB_AUTH_NULL || hash == IMB_AUTH_CUSTOM) continue; #ifdef __aarch64__ if (hash != IMB_AUTH_SNOW3G_UIA2_BITLEN && @@ -1215,19 +1164,17 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) if (check_aead(hash, cipher)) continue; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, + &gcm_ctx); template_job.auth_tag_output_len_in_bytes = 0; if (hash == IMB_AUTH_GCM_SGL) - template_job.sgl_state = - IMB_SGL_COMPLETE; + template_job.sgl_state = IMB_SGL_COMPLETE; if (!is_submit_invalid(mb_mgr, &template_job, TEST_AUTH_TAG_OUTPUT_LEN_ZERO, IMB_ERR_JOB_AUTH_TAG_LEN)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_AUTH_TAG_OUTPUT_LEN_ZERO, IMB_ERR_JOB_AUTH_TAG_LEN)) return 1; @@ -1237,34 +1184,26 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * AUTH_MSG_LEN > MAX */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { /* skip algorithms with no max length limit */ - if (hash == IMB_AUTH_NULL || - hash == IMB_AUTH_CUSTOM || - hash == IMB_AUTH_PON_CRC_BIP || - hash == IMB_AUTH_AES_GMAC || + if (hash == IMB_AUTH_NULL || hash == IMB_AUTH_CUSTOM || + hash == IMB_AUTH_PON_CRC_BIP || hash == IMB_AUTH_AES_GMAC || hash == IMB_AUTH_AES_GMAC_128 || hash == IMB_AUTH_AES_GMAC_192 || - hash == IMB_AUTH_AES_GMAC_256 || - hash == IMB_AUTH_SNOW_V_AEAD || + hash == IMB_AUTH_AES_GMAC_256 || hash == IMB_AUTH_SNOW_V_AEAD || hash == IMB_AUTH_CRC32_ETHERNET_FCS || hash == IMB_AUTH_CRC32_SCTP || hash == IMB_AUTH_CRC32_WIMAX_OFDMA_DATA || - hash == IMB_AUTH_CRC24_LTE_A || - hash == IMB_AUTH_CRC24_LTE_B || - hash == IMB_AUTH_CRC16_X25 || - hash == IMB_AUTH_CRC16_FP_DATA || + hash == IMB_AUTH_CRC24_LTE_A || hash == IMB_AUTH_CRC24_LTE_B || + hash == IMB_AUTH_CRC16_X25 || hash == IMB_AUTH_CRC16_FP_DATA || hash == IMB_AUTH_CRC11_FP_HEADER || hash == IMB_AUTH_CRC10_IUUP_DATA || hash == IMB_AUTH_CRC8_WIMAX_OFDMA_HCS || hash == IMB_AUTH_CRC7_FP_HEADER || hash == IMB_AUTH_CRC6_IUUP_HEADER || - hash == IMB_AUTH_POLY1305 || - hash == IMB_AUTH_GHASH) + hash == IMB_AUTH_POLY1305 || hash == IMB_AUTH_GHASH) continue; #ifdef __aarch64__ if (hash != IMB_AUTH_SNOW3G_UIA2_BITLEN && @@ -1280,20 +1219,18 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) if (check_aead(hash, cipher)) continue; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, + &gcm_ctx); switch (hash) { case IMB_AUTH_ZUC_EIA3_BITLEN: case IMB_AUTH_ZUC256_EIA3_BITLEN: /* (2^32) - 32 is max */ - template_job.msg_len_to_hash_in_bytes = - ((1ULL << 32) - 31); + template_job.msg_len_to_hash_in_bytes = ((1ULL << 32) - 31); break; case IMB_AUTH_SNOW3G_UIA2_BITLEN: /* (2^32) is max */ - template_job.msg_len_to_hash_in_bits = - ((1ULL << 32) + 1); + template_job.msg_len_to_hash_in_bits = ((1ULL << 32) + 1); break; case IMB_AUTH_KASUMI_UIA1: /* 20000 bits (2500 bytes) is max */ @@ -1307,8 +1244,7 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) ((1ULL << 38) - 64) + 1; break; default: - template_job.msg_len_to_hash_in_bytes = - ((1 << 16) - 1); + template_job.msg_len_to_hash_in_bytes = ((1 << 16) - 1); break; } if (!is_submit_invalid(mb_mgr, &template_job, @@ -1317,8 +1253,7 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_AUTH_MSG_LEN_GT_MAX, IMB_ERR_JOB_AUTH_LEN)) return 1; @@ -1328,11 +1263,9 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * AUTH_MSG_LEN = 0 */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { #ifdef __aarch64__ if (hash != IMB_AUTH_SNOW3G_UIA2_BITLEN && hash != IMB_AUTH_ZUC_EIA3_BITLEN && @@ -1352,11 +1285,9 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) case IMB_AUTH_HMAC_SHA_512: case IMB_AUTH_MD5: case IMB_AUTH_KASUMI_UIA1: - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); - template_job.msg_len_to_hash_in_bytes - = 0; + fill_in_job(&template_job, cipher, dir, hash, order, + &chacha_ctx, &gcm_ctx); + template_job.msg_len_to_hash_in_bytes = 0; break; default: /* @@ -1379,8 +1310,7 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_AUTH_MSG_LEN_ZERO, IMB_ERR_JOB_AUTH_LEN)) return 1; @@ -1390,16 +1320,12 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * Invalid auth IV length test */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { IMB_JOB *job = &template_job; - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); /* * Set invalid IV lengths * for relevant algos @@ -1419,14 +1345,12 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) */ continue; } - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_IV_LEN, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_IV_LEN, IMB_ERR_JOB_IV_LEN)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_IV_LEN, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_IV_LEN, IMB_ERR_JOB_IV_LEN)) return 1; print_progress(); @@ -1435,11 +1359,9 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * Invalid HMAC IPAD & OPAD */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { IMB_JOB *job = &template_job; int skip = 1; @@ -1461,100 +1383,78 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) if (skip) continue; - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.HMAC._hashed_auth_key_xor_ipad = NULL; const int err_ipad = IMB_ERR_JOB_NULL_HMAC_IPAD; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_HMAC_IPAD, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_HMAC_IPAD, err_ipad)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_HMAC_IPAD, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_HMAC_IPAD, err_ipad)) return 1; print_progress(); - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.HMAC._hashed_auth_key_xor_opad = NULL; const int err_opad = IMB_ERR_JOB_NULL_HMAC_OPAD; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_HMAC_OPAD, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_HMAC_OPAD, err_opad)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_HMAC_OPAD, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_HMAC_OPAD, err_opad)) return 1; print_progress(); - } #ifndef __aarch64__ /* * Invalid XCBC key parameters */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { IMB_JOB *job = &template_job; hash = IMB_AUTH_AES_XCBC; - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.XCBC._k1_expanded = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_XCBC_K1_EXP, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_XCBC_K1_EXP, IMB_ERR_JOB_NULL_XCBC_K1_EXP)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_XCBC_K1_EXP, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_XCBC_K1_EXP, IMB_ERR_JOB_NULL_XCBC_K1_EXP)) return 1; print_progress(); - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.XCBC._k2 = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_XCBC_K2, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_XCBC_K2, IMB_ERR_JOB_NULL_XCBC_K2)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_XCBC_K2, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_XCBC_K2, IMB_ERR_JOB_NULL_XCBC_K2)) return 1; print_progress(); - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.XCBC._k3 = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_XCBC_K3, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_XCBC_K3, IMB_ERR_JOB_NULL_XCBC_K3)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_XCBC_K3, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_XCBC_K3, IMB_ERR_JOB_NULL_XCBC_K3)) return 1; print_progress(); @@ -1563,41 +1463,32 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * Invalid GHASH parameters */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { IMB_JOB *job = &template_job; hash = IMB_AUTH_GHASH; - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.GHASH._key = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_GHASH_KEY, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_GHASH_KEY, IMB_ERR_JOB_NULL_AUTH_KEY)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_GHASH_KEY, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_GHASH_KEY, IMB_ERR_JOB_NULL_AUTH_KEY)) return 1; print_progress(); - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.GHASH._init_tag = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_GHASH_INIT_TAG, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_GHASH_INIT_TAG, IMB_ERR_JOB_NULL_GHASH_INIT_TAG)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_GHASH_INIT_TAG, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_GHASH_INIT_TAG, IMB_ERR_JOB_NULL_GHASH_INIT_TAG)) return 1; print_progress(); @@ -1606,58 +1497,44 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) /* * Invalid GMAC parameters */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { - for (hash = IMB_AUTH_AES_GMAC_128; - hash <= IMB_AUTH_AES_GMAC_256; hash++) { + for (hash = IMB_AUTH_AES_GMAC_128; hash <= IMB_AUTH_AES_GMAC_256; hash++) { IMB_JOB *job = &template_job; - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.GMAC._key = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_GMAC_KEY, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_GMAC_KEY, IMB_ERR_JOB_NULL_AUTH_KEY)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_GMAC_KEY, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_GMAC_KEY, IMB_ERR_JOB_NULL_AUTH_KEY)) return 1; print_progress(); - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.GMAC._iv = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_NULL_GMAC_IV, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_NULL_GMAC_IV, IMB_ERR_JOB_NULL_IV)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_NULL_GMAC_IV, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_NULL_GMAC_IV, IMB_ERR_JOB_NULL_IV)) return 1; print_progress(); - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->u.GMAC.iv_len_in_bytes = 0; - if (!is_submit_invalid(mb_mgr, job, - TEST_AUTH_GMAC_IV_LEN, + if (!is_submit_invalid(mb_mgr, job, TEST_AUTH_GMAC_IV_LEN, IMB_ERR_JOB_IV_LEN)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_AUTH_GMAC_IV_LEN, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_AUTH_GMAC_IV_LEN, IMB_ERR_JOB_IV_LEN)) return 1; print_progress(); @@ -1688,7 +1565,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) struct chacha20_poly1305_context_data chacha_ctx; struct gcm_context_data gcm_ctx; - printf("Invalid JOB CIPHER arguments test:\n"); + printf("Invalid JOB CIPHER arguments test:\n"); /* prep */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -1697,13 +1574,10 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) /* * SRC = NULL test */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { - if (cipher == IMB_CIPHER_NULL || - cipher == IMB_CIPHER_CUSTOM) + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { + if (cipher == IMB_CIPHER_NULL || cipher == IMB_CIPHER_CUSTOM) continue; #ifdef __aarch64__ if (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN && @@ -1718,17 +1592,15 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) if (check_aead(hash, cipher)) continue; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, + &gcm_ctx); template_job.src = NULL; - if (!is_submit_invalid(mb_mgr, &template_job, - TEST_CIPH_SRC_NULL, + if (!is_submit_invalid(mb_mgr, &template_job, TEST_CIPH_SRC_NULL, IMB_ERR_JOB_NULL_SRC)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_SRC_NULL, IMB_ERR_JOB_NULL_SRC)) return 1; @@ -1738,13 +1610,10 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) /* * DST = NULL test */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { - if (cipher == IMB_CIPHER_NULL || - cipher == IMB_CIPHER_CUSTOM) + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { + if (cipher == IMB_CIPHER_NULL || cipher == IMB_CIPHER_CUSTOM) continue; #ifdef __aarch64__ if (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN && @@ -1759,17 +1628,15 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) if (check_aead(hash, cipher)) continue; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, + &gcm_ctx); template_job.dst = NULL; - if (!is_submit_invalid(mb_mgr, &template_job, - TEST_CIPH_DST_NULL, + if (!is_submit_invalid(mb_mgr, &template_job, TEST_CIPH_DST_NULL, IMB_ERR_JOB_NULL_DST)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_DST_NULL, IMB_ERR_JOB_NULL_DST)) return 1; @@ -1779,13 +1646,10 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) /* * IV = NULL test */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { - if (cipher == IMB_CIPHER_NULL || - cipher == IMB_CIPHER_CUSTOM) + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { + if (cipher == IMB_CIPHER_NULL || cipher == IMB_CIPHER_CUSTOM) continue; #ifdef __aarch64__ if (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN && @@ -1804,17 +1668,15 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) if (cipher == IMB_CIPHER_ECB) continue; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, + &gcm_ctx); template_job.iv = NULL; - if (!is_submit_invalid(mb_mgr, &template_job, - TEST_CIPH_IV_NULL, + if (!is_submit_invalid(mb_mgr, &template_job, TEST_CIPH_IV_NULL, IMB_ERR_JOB_NULL_IV)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_IV_NULL, IMB_ERR_JOB_NULL_IV)) return 1; @@ -1828,11 +1690,9 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) if (dir == IMB_DIR_ENCRYPT || dir == IMB_DIR_DECRYPT) continue; - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { - if (cipher == IMB_CIPHER_NULL || - cipher == IMB_CIPHER_CUSTOM) + if (cipher == IMB_CIPHER_NULL || cipher == IMB_CIPHER_CUSTOM) continue; #ifdef __aarch64__ if (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN && @@ -1849,17 +1709,14 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) order = IMB_ORDER_CIPHER_HASH; - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); - if (!is_submit_invalid(mb_mgr, &template_job, - TEST_CIPH_DIR, + if (!is_submit_invalid(mb_mgr, &template_job, TEST_CIPH_DIR, IMB_ERR_JOB_CIPH_DIR)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, &template_job, - TEST_CIPH_DIR, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_DIR, IMB_ERR_JOB_CIPH_DIR)) return 1; print_progress(); @@ -1870,10 +1727,8 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) * AES_ENC_KEY_EXPANDED = NULL * AES_DEC_KEY_EXPANDED = NULL */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) - for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; - cipher++) { + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { #ifdef __aarch64__ if ((cipher != IMB_CIPHER_NULL) && (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN) && @@ -1881,8 +1736,8 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) continue; #endif - fill_in_job(&template_job, cipher, IMB_DIR_ENCRYPT, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, IMB_DIR_ENCRYPT, hash, order, + &chacha_ctx, &gcm_ctx); /* * Skip cipher algorithms belonging to AEAD @@ -1903,8 +1758,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_ENC_KEY_NULL, IMB_ERR_JOB_NULL_KEY)) return 1; @@ -1917,10 +1771,8 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) * AES_ENC_KEY_EXPANDED = NULL * AES_DEC_KEY_EXPANDED = NULL */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) - for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; - cipher++) { + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { #ifdef __aarch64__ if ((cipher != IMB_CIPHER_NULL) && (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN) && @@ -1934,8 +1786,8 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) if (check_aead(hash, cipher)) continue; - fill_in_job(&template_job, cipher, IMB_DIR_DECRYPT, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(&template_job, cipher, IMB_DIR_DECRYPT, hash, order, + &chacha_ctx, &gcm_ctx); switch (cipher) { case IMB_CIPHER_GCM: case IMB_CIPHER_CBC: @@ -1951,8 +1803,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_DEC_KEY_NULL, IMB_ERR_JOB_NULL_KEY)) return 1; @@ -1972,8 +1823,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_DEC_KEY_NULL, IMB_ERR_JOB_NULL_KEY)) return 1; @@ -1986,13 +1836,11 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_DEC_KEY_NULL, IMB_ERR_JOB_NULL_KEY)) return 1; - template_job.enc_keys = - template_job.dec_keys; + template_job.enc_keys = template_job.dec_keys; template_job.dec_keys = NULL; if (!is_submit_invalid(mb_mgr, &template_job, TEST_CIPH_DEC_KEY_NULL, @@ -2000,8 +1848,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, - &template_job, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_CIPH_DEC_KEY_NULL, IMB_ERR_JOB_NULL_KEY)) return 1; @@ -2017,13 +1864,10 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) /* * CIPHER_MSG_LEN = 0 */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { - if (cipher == IMB_CIPHER_NULL || - cipher == IMB_CIPHER_CUSTOM) + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { + if (cipher == IMB_CIPHER_NULL || cipher == IMB_CIPHER_CUSTOM) continue; #ifdef __aarch64__ if (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN && @@ -2040,8 +1884,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) IMB_JOB *job = &template_job; - fill_in_job(job, cipher, dir, hash, order, - &chacha_ctx, &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); switch (cipher) { /* skip ciphers that allow msg length 0 */ @@ -2058,14 +1901,12 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) break; default: job->msg_len_to_cipher_in_bytes = 0; - if (!is_submit_invalid(mb_mgr, job, - TEST_CIPH_MSG_LEN_ZERO, + if (!is_submit_invalid(mb_mgr, job, TEST_CIPH_MSG_LEN_ZERO, IMB_ERR_JOB_CIPH_LEN)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, - job, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_CIPH_MSG_LEN_ZERO, IMB_ERR_JOB_CIPH_LEN)) return 1; @@ -2076,13 +1917,10 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) /* * CIPHER_MSG_LEN > MAX */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { - if (cipher == IMB_CIPHER_NULL || - cipher == IMB_CIPHER_CUSTOM) + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { + if (cipher == IMB_CIPHER_NULL || cipher == IMB_CIPHER_CUSTOM) continue; #ifdef __aarch64__ if (cipher != IMB_CIPHER_SNOW3G_UEA2_BITLEN && @@ -2099,8 +1937,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) IMB_JOB *job = &template_job; - fill_in_job(job, cipher, dir, hash, order, - &chacha_ctx, &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); switch (cipher) { /* skip ciphers with no max limit */ @@ -2124,38 +1961,31 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) break; case IMB_CIPHER_SNOW3G_UEA2_BITLEN: /* max is 2^32 bits */ - job->msg_len_to_cipher_in_bits = - ((1ULL << 32)); + job->msg_len_to_cipher_in_bits = ((1ULL << 32)); break; case IMB_CIPHER_KASUMI_UEA1_BITLEN: /* max is 20000 bits */ - job->msg_len_to_cipher_in_bits = - 20008; + job->msg_len_to_cipher_in_bits = 20008; break; case IMB_CIPHER_CBCS_1_9: /* max is 2^60 bytes */ - job->msg_len_to_cipher_in_bytes = - ((1ULL << 60) + 1); + job->msg_len_to_cipher_in_bytes = ((1ULL << 60) + 1); break; case IMB_CIPHER_CHACHA20: /* Chacha20 limit (2^32 - 1) x 64 */ - job->msg_len_to_cipher_in_bytes = - ((1ULL << 38) - 64) + 1; + job->msg_len_to_cipher_in_bytes = ((1ULL << 38) - 64) + 1; break; default: /* most MB max len is 2^16 - 2 */ - job->msg_len_to_cipher_in_bytes = - ((1 << 16) - 1); + job->msg_len_to_cipher_in_bytes = ((1 << 16) - 1); break; } - if (!is_submit_invalid(mb_mgr, job, - TEST_CIPH_MSG_LEN_GT_MAX, + if (!is_submit_invalid(mb_mgr, job, TEST_CIPH_MSG_LEN_GT_MAX, IMB_ERR_JOB_CIPH_LEN)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_CIPH_MSG_LEN_GT_MAX, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_CIPH_MSG_LEN_GT_MAX, IMB_ERR_JOB_CIPH_LEN)) return 1; @@ -2229,12 +2059,10 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) dir = IMB_DIR_ENCRYPT; - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) { + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) { uint64_t key_len; - for (key_len = IMB_KEY_128_BYTES; key_len <= IMB_KEY_256_BYTES; - key_len += 8) { + for (key_len = IMB_KEY_128_BYTES; key_len <= IMB_KEY_256_BYTES; key_len += 8) { uint32_t i; for (i = 0; i < DIM(invalid_iv_lens); i++) { @@ -2244,15 +2072,13 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) cipher = invalid_iv_lens[i].cipher_mode; /* set up job fields */ - fill_in_job(job, cipher, dir, hash, order, - &chacha_ctx, &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); /* set key length */ job->key_len_in_bytes = key_len; /* set invalid IV length */ - job->iv_len_in_bytes = - invalid_iv_lens[i].invalid_iv_len; + job->iv_len_in_bytes = invalid_iv_lens[i].invalid_iv_len; /* skip some key lengths for specific ciphers */ switch (cipher) { @@ -2296,14 +2122,12 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) break; } - if (!is_submit_invalid(mb_mgr, job, - TEST_CIPH_IV_LEN, + if (!is_submit_invalid(mb_mgr, job, TEST_CIPH_IV_LEN, IMB_ERR_JOB_IV_LEN)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_CIPH_IV_LEN, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_CIPH_IV_LEN, IMB_ERR_JOB_IV_LEN)) return 1; print_progress(); @@ -2317,8 +2141,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) #ifndef __aarch64__ /* CBCS NULL NEXT IV TEST */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { cipher = IMB_CIPHER_CBCS_1_9; @@ -2331,19 +2154,16 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) IMB_JOB *job = &template_job; - fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); job->cipher_fields.CBCS.next_iv = NULL; - if (!is_submit_invalid(mb_mgr, job, - TEST_CIPH_NEXT_IV_NULL, + if (!is_submit_invalid(mb_mgr, job, TEST_CIPH_NEXT_IV_NULL, IMB_ERR_JOB_NULL_NEXT_IV)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_CIPH_NEXT_IV_NULL, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_CIPH_NEXT_IV_NULL, IMB_ERR_JOB_NULL_NEXT_IV)) return 1; print_progress(); @@ -2373,7 +2193,7 @@ test_job_invalid_misc_args(struct IMB_MGR *mb_mgr) struct chacha20_poly1305_context_data chacha_ctx; struct gcm_context_data gcm_ctx; - printf("Invalid MISC JOB arguments test:\n"); + printf("Invalid MISC JOB arguments test:\n"); /* prep */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -2382,8 +2202,7 @@ test_job_invalid_misc_args(struct IMB_MGR *mb_mgr) /* * Invalid PLI for PON */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) #ifndef __aarch64__ for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { cipher = IMB_CIPHER_PON_AES_CNTR; @@ -2393,37 +2212,30 @@ test_job_invalid_misc_args(struct IMB_MGR *mb_mgr) * XGEM header is set to all 1s in fill_in_job() * This will result in an invalid PLI field */ - fill_in_job(&template_job, cipher, dir, - hash, order, &chacha_ctx, - &gcm_ctx); + fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); /* Set msg len to ensure PLI error */ template_job.msg_len_to_cipher_in_bytes = 8; - if (!is_submit_invalid(mb_mgr, &template_job, - TEST_INVALID_PON_PLI, + if (!is_submit_invalid(mb_mgr, &template_job, TEST_INVALID_PON_PLI, IMB_ERR_JOB_PON_PLI)) return 1; imb_set_session(mb_mgr, &template_job); - if (!is_submit_burst_invalid(mb_mgr, &template_job, - TEST_INVALID_PON_PLI, + if (!is_submit_burst_invalid(mb_mgr, &template_job, TEST_INVALID_PON_PLI, IMB_ERR_JOB_PON_PLI)) return 1; print_progress(); } #endif - /* * AEAD MSG_LEN > MAX */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { /* reset hash alg */ hash = IMB_AUTH_NULL; @@ -2433,8 +2245,7 @@ test_job_invalid_misc_args(struct IMB_MGR *mb_mgr) IMB_JOB *job = &template_job; - fill_in_job(job, cipher, dir, hash, order, - &chacha_ctx, &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); switch (cipher) { /* skip algos with no max limit */ @@ -2448,21 +2259,18 @@ test_job_invalid_misc_args(struct IMB_MGR *mb_mgr) case IMB_CIPHER_GCM: case IMB_CIPHER_GCM_SGL: /* must be < ((2^39) - 256) bytes */ - job->msg_len_to_cipher_in_bytes = - ((1ULL << 39) - 256); + job->msg_len_to_cipher_in_bytes = ((1ULL << 39) - 256); break; #endif default: continue; } - if (!is_submit_invalid(mb_mgr, job, - TEST_CIPH_MSG_LEN_GT_MAX, + if (!is_submit_invalid(mb_mgr, job, TEST_CIPH_MSG_LEN_GT_MAX, IMB_ERR_JOB_CIPH_LEN)) return 1; imb_set_session(mb_mgr, job); - if (!is_submit_burst_invalid(mb_mgr, job, - TEST_CIPH_MSG_LEN_GT_MAX, + if (!is_submit_burst_invalid(mb_mgr, job, TEST_CIPH_MSG_LEN_GT_MAX, IMB_ERR_JOB_CIPH_LEN)) return 1; @@ -2484,8 +2292,7 @@ test_job_invalid_misc_args(struct IMB_MGR *mb_mgr) * should remain, so after a flush, a job should be retrieved. */ static int -submit_reset_check_job(struct IMB_MGR *mb_mgr, - IMB_CIPHER_MODE cipher, IMB_CIPHER_DIRECTION dir, +submit_reset_check_job(struct IMB_MGR *mb_mgr, IMB_CIPHER_MODE cipher, IMB_CIPHER_DIRECTION dir, IMB_HASH_ALG hash, IMB_CHAIN_ORDER order) { struct IMB_JOB *job, *next_job; @@ -2494,8 +2301,7 @@ submit_reset_check_job(struct IMB_MGR *mb_mgr, job = IMB_GET_NEXT_JOB(mb_mgr); - fill_in_job(job, cipher, dir, - hash, order, &chacha_ctx, &gcm_ctx); + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); next_job = IMB_SUBMIT_JOB(mb_mgr); @@ -2523,8 +2329,7 @@ submit_reset_check_job(struct IMB_MGR *mb_mgr, if (next_job->status != IMB_STATUS_COMPLETED) { printf("Returned job's status is not completed\n"); printf("cipher = %d\n", cipher); - printf("imb errno = %d (%s)\n", - mb_mgr->imb_errno, + printf("imb errno = %d (%s)\n", mb_mgr->imb_errno, imb_get_strerror(mb_mgr->imb_errno)); exit(0); } @@ -2543,7 +2348,7 @@ test_reset_api(struct IMB_MGR *mb_mgr) IMB_CIPHER_MODE cipher; IMB_CHAIN_ORDER order; - printf("Reset API test:\n"); + printf("Reset API test:\n"); /* prep */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -2554,11 +2359,9 @@ test_reset_api(struct IMB_MGR *mb_mgr) return 1; /* Loop around all cipher algorithms */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) { + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) { for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { - for (cipher = IMB_CIPHER_CBC; - cipher < IMB_CIPHER_NUM; cipher++) { + for (cipher = IMB_CIPHER_CBC; cipher < IMB_CIPHER_NUM; cipher++) { /* Cipher only */ hash = IMB_AUTH_NULL; @@ -2576,21 +2379,16 @@ test_reset_api(struct IMB_MGR *mb_mgr) continue; #endif - if (submit_reset_check_job(mb_mgr, - cipher, dir, - hash, order) > 0) + if (submit_reset_check_job(mb_mgr, cipher, dir, hash, order) > 0) return 1; } } } /* Loop around all authentication algorithms */ - for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; - order++) { + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) { for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { - for (hash = IMB_AUTH_HMAC_SHA_1; - hash < IMB_AUTH_NUM; hash++) { - if (hash == IMB_AUTH_NULL || - hash == IMB_AUTH_CUSTOM) + for (hash = IMB_AUTH_HMAC_SHA_1; hash < IMB_AUTH_NUM; hash++) { + if (hash == IMB_AUTH_NULL || hash == IMB_AUTH_CUSTOM) continue; /* Hash only */ @@ -2610,9 +2408,7 @@ test_reset_api(struct IMB_MGR *mb_mgr) continue; #endif - if (submit_reset_check_job(mb_mgr, - cipher, dir, - hash, order) > 0) + if (submit_reset_check_job(mb_mgr, cipher, dir, hash, order) > 0) return 1; } } @@ -2620,22 +2416,15 @@ test_reset_api(struct IMB_MGR *mb_mgr) #ifndef __aarch64__ /* Test AEAD algorithms */ - const IMB_HASH_ALG aead_hash_algos[] = { - IMB_AUTH_AES_GMAC, - IMB_AUTH_AES_CCM, - IMB_AUTH_CHACHA20_POLY1305, - IMB_AUTH_PON_CRC_BIP, - IMB_AUTH_DOCSIS_CRC32, - IMB_AUTH_SNOW_V_AEAD - }; - const IMB_CIPHER_MODE aead_cipher_algos[] = { - IMB_CIPHER_GCM, - IMB_CIPHER_CCM, - IMB_CIPHER_CHACHA20_POLY1305, - IMB_CIPHER_PON_AES_CNTR, - IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_CIPHER_SNOW_V_AEAD - }; + const IMB_HASH_ALG aead_hash_algos[] = { IMB_AUTH_AES_GMAC, IMB_AUTH_AES_CCM, + IMB_AUTH_CHACHA20_POLY1305, IMB_AUTH_PON_CRC_BIP, + IMB_AUTH_DOCSIS_CRC32, IMB_AUTH_SNOW_V_AEAD }; + const IMB_CIPHER_MODE aead_cipher_algos[] = { IMB_CIPHER_GCM, + IMB_CIPHER_CCM, + IMB_CIPHER_CHACHA20_POLY1305, + IMB_CIPHER_PON_AES_CNTR, + IMB_CIPHER_DOCSIS_SEC_BPI, + IMB_CIPHER_SNOW_V_AEAD }; unsigned int i; @@ -2643,28 +2432,23 @@ test_reset_api(struct IMB_MGR *mb_mgr) hash = aead_hash_algos[i]; cipher = aead_cipher_algos[i]; - if (cipher == IMB_CIPHER_CCM || - cipher == IMB_CIPHER_DOCSIS_SEC_BPI) + if (cipher == IMB_CIPHER_CCM || cipher == IMB_CIPHER_DOCSIS_SEC_BPI) order = IMB_ORDER_HASH_CIPHER; else order = IMB_ORDER_CIPHER_HASH; dir = IMB_DIR_ENCRYPT; - if (submit_reset_check_job(mb_mgr, cipher, - dir, hash, order) > 0) + if (submit_reset_check_job(mb_mgr, cipher, dir, hash, order) > 0) return 1; - if (cipher == IMB_CIPHER_CCM || - cipher == IMB_CIPHER_DOCSIS_SEC_BPI) + if (cipher == IMB_CIPHER_CCM || cipher == IMB_CIPHER_DOCSIS_SEC_BPI) order = IMB_ORDER_CIPHER_HASH; else order = IMB_ORDER_HASH_CIPHER; dir = IMB_DIR_DECRYPT; - if (submit_reset_check_job(mb_mgr, cipher, - dir, hash, order) > 0) + if (submit_reset_check_job(mb_mgr, cipher, dir, hash, order) > 0) return 1; - } #endif /* __aarch64__ */ diff --git a/test/kat-app/ccm_test.c b/test/kat-app/ccm_test.c index 5f78275a..ca3a347d 100644 --- a/test/kat-app/ccm_test.c +++ b/test/kat-app/ccm_test.c @@ -30,25 +30,20 @@ #include #include - #include #include "gcm_ctr_vectors_test.h" #include "utils.h" #include "aead_test.h" -int ccm_test(struct IMB_MGR *mb_mgr); +int +ccm_test(struct IMB_MGR *mb_mgr); extern const struct aead_test ccm_128_test_json[]; extern const struct aead_test ccm_256_test_json[]; static int -ccm_job_ok(const struct aead_test *vec, - const struct IMB_JOB *job, - const uint8_t *target, - const uint8_t *padding, - const uint8_t *auth, - const size_t sizeof_padding, - const int dir, +ccm_job_ok(const struct aead_test *vec, const struct IMB_JOB *job, const uint8_t *target, + const uint8_t *padding, const uint8_t *auth, const size_t sizeof_padding, const int dir, const int in_place) { if (job->status != IMB_STATUS_COMPLETED) { @@ -60,7 +55,7 @@ ccm_job_ok(const struct aead_test *vec, if (in_place) { if (dir == IMB_DIR_ENCRYPT) { if (memcmp((const void *) vec->ct, target + sizeof_padding, - vec->msgSize / 8)) { + vec->msgSize / 8)) { printf("cipher mismatched\n"); hexdump(stderr, "Received", target + sizeof_padding, vec->msgSize / 8); @@ -112,27 +107,25 @@ ccm_job_ok(const struct aead_test *vec, if (in_place) { if (memcmp(padding, target + sizeof_padding + vec->msgSize / 8, sizeof_padding)) { printf("cipher overwrite tail\n"); - hexdump(stderr, "Target", - target + sizeof_padding + vec->msgSize / 8, sizeof_padding); + hexdump(stderr, "Target", target + sizeof_padding + vec->msgSize / 8, + sizeof_padding); return 0; } } else { if (memcmp(padding, target + sizeof_padding + vec->msgSize / 8 - vec->aadSize / 8, sizeof_padding)) { printf("cipher overwrite tail\n"); - hexdump(stderr, "Target", target + sizeof_padding + vec->msgSize / 8 - - vec->aadSize / 8, + hexdump(stderr, "Target", + target + sizeof_padding + vec->msgSize / 8 - vec->aadSize / 8, sizeof_padding); return 0; } } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + vec->tagSize / 8], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + vec->tagSize / 8], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", &auth[sizeof_padding + vec->tagSize / 8], - sizeof_padding); + hexdump(stderr, "Target", &auth[sizeof_padding + vec->tagSize / 8], sizeof_padding); return 0; } @@ -142,26 +135,21 @@ ccm_job_ok(const struct aead_test *vec, return 0; } - if (memcmp(vec->ct + vec->msgSize / 8, &auth[sizeof_padding], - vec->tagSize / 8)) { + if (memcmp(vec->ct + vec->msgSize / 8, &auth[sizeof_padding], vec->tagSize / 8)) { printf("hash mismatched\n"); hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); - hexdump(stderr, "Expected", vec->ct + vec->msgSize / 8, - vec->tagSize / 8); + hexdump(stderr, "Expected", vec->ct + vec->msgSize / 8, vec->tagSize / 8); return 0; } return 1; } static int -test_ccm(struct IMB_MGR *mb_mgr, - const struct aead_test *vec, - const int dir, const int in_place, - const int num_jobs, - const uint64_t key_length) +test_ccm(struct IMB_MGR *mb_mgr, const struct aead_test *vec, const int dir, const int in_place, + const int num_jobs, const uint64_t key_length) { - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); struct IMB_JOB *job; uint8_t padding[16]; uint8_t **targets = malloc(num_jobs * sizeof(void *)); @@ -170,8 +158,8 @@ test_ccm(struct IMB_MGR *mb_mgr, const int order = (dir == IMB_DIR_ENCRYPT) ? IMB_ORDER_HASH_CIPHER : IMB_ORDER_CIPHER_HASH; if (targets == NULL || auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); @@ -204,7 +192,6 @@ test_ccm(struct IMB_MGR *mb_mgr, else IMB_AES_KEYEXP_256(mb_mgr, vec->key, expkey, dust); - while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -213,8 +200,7 @@ test_ccm(struct IMB_MGR *mb_mgr, job->cipher_direction = dir; job->chain_order = order; if (in_place) { - job->dst = - targets[i] + sizeof(padding) + vec->aadSize / 8; + job->dst = targets[i] + sizeof(padding) + vec->aadSize / 8; job->src = targets[i] + sizeof(padding); } else { if (dir == IMB_DIR_ENCRYPT) { @@ -232,13 +218,11 @@ test_ccm(struct IMB_MGR *mb_mgr, job->iv = (const void *) vec->iv; job->iv_len_in_bytes = vec->ivSize / 8; job->cipher_start_src_offset_in_bytes = vec->aadSize / 8; - job->msg_len_to_cipher_in_bytes = - vec->msgSize / 8 - vec->aadSize / 8; + job->msg_len_to_cipher_in_bytes = vec->msgSize / 8 - vec->aadSize / 8; job->hash_alg = IMB_AUTH_AES_CCM; job->hash_start_src_offset_in_bytes = vec->aadSize / 8; - job->msg_len_to_hash_in_bytes = - vec->msgSize / 8 - vec->aadSize / 8; + job->msg_len_to_hash_in_bytes = vec->msgSize / 8 - vec->aadSize / 8; job->auth_tag_output = auths[i] + sizeof(padding); job->auth_tag_output_len_in_bytes = vec->tagSize / 8; @@ -255,9 +239,8 @@ test_ccm(struct IMB_MGR *mb_mgr, printf("%d Unexpected return from submit_job\n", __LINE__); goto end; } - if (!ccm_job_ok(vec, job, job->user_data, padding, - job->user_data2, sizeof(padding), - dir, in_place)) + if (!ccm_job_ok(vec, job, job->user_data, padding, job->user_data2, + sizeof(padding), dir, in_place)) goto end; } } @@ -265,8 +248,8 @@ test_ccm(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!ccm_job_ok(vec, job, job->user_data, padding, job->user_data2, - sizeof(padding), dir, in_place)) + if (!ccm_job_ok(vec, job, job->user_data, padding, job->user_data2, sizeof(padding), + dir, in_place)) goto end; } @@ -276,7 +259,7 @@ test_ccm(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -287,7 +270,7 @@ test_ccm(struct IMB_MGR *mb_mgr, free(auths[i]); } - end2: +end2: if (targets != NULL) free(targets); @@ -298,21 +281,20 @@ test_ccm(struct IMB_MGR *mb_mgr, } static void -test_ccm_128_std_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const int num_jobs) +test_ccm_128_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { - const struct aead_test *v = ccm_128_test_json; + const struct aead_test *v = ccm_128_test_json; if (!quiet_mode) - printf("AES-CCM-128 standard test vectors (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("AES-CCM-128 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("Standard vector %zu NONCELen:%zu PktLen:%zu AADLen:%zu " - "Digestlen:%zu\n", v->tcId, v->ivSize / 8, v->msgSize / 8, - v->aadSize / 8, v->tagSize / 8); + "Digestlen:%zu\n", + v->tcId, v->ivSize / 8, v->msgSize / 8, v->aadSize / 8, + v->tagSize / 8); #else printf("."); #endif @@ -345,28 +327,26 @@ test_ccm_128_std_vectors(struct IMB_MGR *mb_mgr, } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } static void -test_ccm_256_std_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const int num_jobs) +test_ccm_256_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { const struct aead_test *v = ccm_256_test_json; if (!quiet_mode) - printf("AES-CCM-256 standard test vectors (N jobs = %d):\n", - num_jobs); - for (; v->msg != NULL; v++) { + printf("AES-CCM-256 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("Standard vector %zu NONCELen:%zu PktLen:%zu AADLen:%zu " - "Digestlen:%zu\n", v->tcId, v->ivSize / 8, v->msgSize / 8, - v->aadSize / 8, v->tagSize / 8); + "Digestlen:%zu\n", + v->tcId, v->ivSize / 8, v->msgSize / 8, v->aadSize / 8, + v->tagSize / 8); #else printf("."); #endif @@ -399,12 +379,11 @@ test_ccm_256_std_vectors(struct IMB_MGR *mb_mgr, } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } - int ccm_test(struct IMB_MGR *mb_mgr) { @@ -423,5 +402,5 @@ ccm_test(struct IMB_MGR *mb_mgr) test_ccm_256_std_vectors(mb_mgr, &ctx, i); errors += test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/ccm_test.json.c b/test/kat-app/ccm_test.json.c index d2907574..dc991bd5 100644 --- a/test/kat-app/ccm_test.json.c +++ b/test/kat-app/ccm_test.json.c @@ -30,523 +30,472 @@ const struct aead_test ccm_128_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc3610 */ - {104, 128, 64, 1, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x03\x02\x01\x00\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", - "\x00\x01\x02\x03\x04\x05\x06\x07\x58\x8c\x97\x9a\x61\xc6\x63\xd2\xf0\x66" - "\xd0\xc2\xc0\xf9\x89\x80\x6d\x5f\x6b\x61\xda\xc3\x84\x17\xe8\xd1\x2c\xfd" - "\xf9\x26\xe0", - "", 1, 64, 248}, - {104, 128, 64, 2, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x04\x03\x02\x01\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x72\xc9\x1a\x36\xe1\x35\xf8\xcf\x29\x1c" - "\xa8\x94\x08\x5c\x87\xe3\xcc\x15\xc4\x39\xc9\xe4\x3a\x3b\xa0\x91\xd5\x6e" - "\x10\x40\x09\x16", - "", 1, 64, 256}, - {104, 128, 64, 3, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x05\x04\x03\x02\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", - "\x00\x01\x02\x03\x04\x05\x06\x07\x51\xb1\xe5\xf4\x4a\x19\x7d\x1d\xa4\x6b" - "\x0f\x8e\x2d\x28\x2a\xe8\x71\xe8\x38\xbb\x64\xda\x85\x96\x57\x4a\xda\xa7" - "\x6f\xbd\x9f\xb0\xc5", - "", 1, 64, 264}, - {104, 128, 64, 4, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x06\x05\x04\x03\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xa2\x8c\x68\x65\x93\x9a" - "\x9a\x79\xfa\xaa\x5c\x4c\x2a\x9d\x4a\x91\xcd\xac\x8c\x96\xc8\x61\xb9\xc9" - "\xe6\x1e\xf1", - "", 1, 96, 248}, - {104, 128, 64, 5, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x07\x06\x05\x04\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xdc\xf1\xfb\x7b\x5d\x9e" - "\x23\xfb\x9d\x4e\x13\x12\x53\x65\x8a\xd8\x6e\xbd\xca\x3e\x51\xe8\x3f\x07" - "\x7d\x9c\x2d\x93", - "", 1, 96, 256}, - {104, 128, 64, 6, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x08\x07\x06\x05\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x6f\xc1\xb0\x11\xf0\x06" - "\x56\x8b\x51\x71\xa4\x2d\x95\x3d\x46\x9b\x25\x70\xa4\xbd\x87\x40\x5a\x04" - "\x43\xac\x91\xcb\x94", - "", 1, 96, 264}, - {104, 128, 80, 7, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x09\x08\x07\x06\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", - "\x00\x01\x02\x03\x04\x05\x06\x07\x01\x35\xd1\xb2\xc9\x5f\x41\xd5\xd1\xd4" - "\xfe\xc1\x85\xd1\x66\xb8\x09\x4e\x99\x9d\xfe\xd9\x6c\x04\x8c\x56\x60\x2c" - "\x97\xac\xbb\x74\x90", - "", 1, 64, 248}, - {104, 128, 80, 8, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x0a\x09\x08\x07\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x7b\x75\x39\x9a\xc0\x83\x1d\xd2\xf0\xbb" - "\xd7\x58\x79\xa2\xfd\x8f\x6c\xae\x6b\x6c\xd9\xb7\xdb\x24\xc1\x7b\x44\x33" - "\xf4\x34\x96\x3f\x34\xb4", - "", 1, 64, 256}, - {104, 128, 80, 9, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x0b\x0a\x09\x08\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", - "\x00\x01\x02\x03\x04\x05\x06\x07\x82\x53\x1a\x60\xcc\x24\x94\x5a\x4b\x82" - "\x79\x18\x1a\xb5\xc8\x4d\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1\x97\xea\x9c\x07" - "\xe5\x6b\x5e\xb1\x7e\x5f\x4e", - "", 1, 64, 264}, - {104, 128, 80, 10, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x0c\x0b\x0a\x09\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x07\x34\x25\x94\x15\x77" - "\x85\x15\x2b\x07\x40\x98\x33\x0a\xbb\x14\x1b\x94\x7b\x56\x6a\xa9\x40\x6b" - "\x4d\x99\x99\x88\xdd", - "", 1, 96, 248}, - {104, 128, 80, 11, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x0d\x0c\x0b\x0a\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x67\x6b\xb2\x03\x80\xb0" - "\xe3\x01\xe8\xab\x79\x59\x0a\x39\x6d\xa7\x8b\x83\x49\x34\xf5\x3a\xa2\xe9" - "\x10\x7a\x8b\x6c\x02\x2c", - "", 1, 96, 256}, - {104, 128, 80, 12, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x0e\x0d\x0c\x0b\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xc0\xff\xa0\xd6\xf0\x5b" - "\xdb\x67\xf2\x4d\x43\xa4\x33\x8d\x2a\xa4\xbe\xd7\xb2\x0e\x43\xcd\x1a\xa3" - "\x16\x62\xe7\xad\x65\xd6\xdb", - "", 1, 96, 264}, - {104, 128, 64, 13, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x41\x2b\x4e\xa9\xcd\xbe\x3c\x96\x96\x76\x6c\xfa", "", - "\x0b\xe1\xa8\x8b\xac\xe0\x18\xb1\x08\xe8\xcf\x97\xd8\x20\xea\x25\x84\x60" - "\xe9\x6a\xd9\xcf\x52\x89\x05\x4d\x89\x5c\xea\xc4\x7c", - "\x0b\xe1\xa8\x8b\xac\xe0\x18\xb1\x4c\xb9\x7f\x86\xa2\xa4\x68\x9a\x87\x79" - "\x47\xab\x80\x91\xef\x53\x86\xa6\xff\xbd\xd0\x80\xf8\xe7\x8c\xf7\xcb\x0c" - "\xdd\xd7\xb3", - "", 1, 64, 248}, - {104, 128, 64, 14, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x33\x56\x8e\xf7\xb2\x63\x3c\x96\x96\x76\x6c\xfa", "", - "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb\x90\x20\xea\x6f\x91\xbd\xd8\x5a\xfa\x00" - "\x39\xba\x4b\xaf\xf9\xbf\xb7\x9c\x70\x28\x94\x9c\xd0\xec", - "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa\xa0\x72" - "\x6c\x55\xd3\x78\x06\x12\x98\xc8\x5c\x92\x81\x4a\xbc\x33\xc5\x2e\xe8\x1d" - "\x7d\x77\xc0\x8a", - "", 1, 64, 256}, - {104, 128, 64, 15, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x10\x3f\xe4\x13\x36\x71\x3c\x96\x96\x76\x6c\xfa", "", - "\xaa\x6c\xfa\x36\xca\xe8\x6b\x40\xb9\x16\xe0\xea\xcc\x1c\x00\xd7\xdc\xec" - "\x68\xec\x0b\x3b\xbb\x1a\x02\xde\x8a\x2d\x1a\xa3\x46\x13\x2e", - "\xaa\x6c\xfa\x36\xca\xe8\x6b\x40\xb1\xd2\x3a\x22\x20\xdd\xc0\xac\x90\x0d" - "\x9a\xa0\x3c\x61\xfc\xf4\xa5\x59\xa4\x41\x77\x67\x08\x97\x08\xa7\x76\x79" - "\x6e\xdb\x72\x35\x06", - "", 1, 64, 264}, - {104, 128, 64, 16, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x76\x4c\x63\xb8\x05\x8e\x3c\x96\x96\x76\x6c\xfa", "", - "\xd0\xd0\x73\x5c\x53\x1e\x1b\xec\xf0\x49\xc2\x44\x12\xda\xac\x56\x30\xef" - "\xa5\x39\x6f\x77\x0c\xe1\xa6\x6b\x21\xf7\xb2\x10\x1c", - "\xd0\xd0\x73\x5c\x53\x1e\x1b\xec\xf0\x49\xc2\x44\x14\xd2\x53\xc3\x96\x7b" - "\x70\x60\x9b\x7c\xbb\x7c\x49\x91\x60\x28\x32\x45\x26\x9a\x6f\x49\x97\x5b" - "\xca\xde\xaf", - "", 1, 96, 248}, - {104, 128, 64, 17, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\xf8\xb6\x78\x09\x4e\x3b\x3c\x96\x96\x76\x6c\xfa", "", - "\x77\xb6\x0f\x01\x1c\x03\xe1\x52\x58\x99\xbc\xae\xe8\x8b\x6a\x46\xc7\x8d" - "\x63\xe5\x2e\xb8\xc5\x46\xef\xb5\xde\x6f\x75\xe9\xcc\x0d", - "\x77\xb6\x0f\x01\x1c\x03\xe1\x52\x58\x99\xbc\xae\x55\x45\xff\x1a\x08\x5e" - "\xe2\xef\xbf\x52\xb2\xe0\x4b\xee\x1e\x23\x36\xc7\x3e\x3f\x76\x2c\x0c\x77" - "\x44\xfe\x7e\x3c", - "", 1, 96, 256}, - {104, 128, 64, 18, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\xd5\x60\x91\x2d\x3f\x70\x3c\x96\x96\x76\x6c\xfa", "", - "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81\x20\xea\x60\xc0\x64\x35\xac\xba\xfb\x11" - "\xa8\x2e\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9\x3a\x80\x3b\xa8\x7f", - "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81\x20\xea\x60\xc0\x00\x97\x69\xec\xab\xdf" - "\x48\x62\x55\x94\xc5\x92\x51\xe6\x03\x57\x22\x67\x5e\x04\xc8\x47\x09\x9e" - "\x5a\xe0\x70\x45\x51", - "", 1, 96, 264}, - {104, 128, 80, 19, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x42\xff\xf8\xf1\x95\x1c\x3c\x96\x96\x76\x6c\xfa", "", - "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8\x8a\x19\xb9\x50\xbc\xf7\x1a\x01\x8e\x5e" - "\x67\x01\xc9\x17\x87\x65\x98\x09\xd6\x7d\xbe\xdd\x18", - "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8\xbc\x21\x8d\xaa\x94\x74\x27\xb6\xdb\x38" - "\x6a\x99\xac\x1a\xef\x23\xad\xe0\xb5\x29\x39\xcb\x6a\x63\x7c\xf9\xbe\xc2" - "\x40\x88\x97\xc6\xba", - "", 1, 64, 248}, - {104, 128, 80, 20, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x92\x0f\x40\xe5\x6c\xdc\x3c\x96\x96\x76\x6c\xfa", "", - "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x17\x61\x43\x3c\x37\xc5\xa3\x5f\xc1\xf3" - "\x9f\x40\x63\x02\xeb\x90\x7c\x61\x63\xbe\x38\xc9\x84\x37", - "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x58\x10\xe6\xfd\x25\x87\x40\x22\xe8\x03" - "\x61\xa4\x78\xe3\xe9\xcf\x48\x4a\xb0\x4f\x44\x7e\xff\xf6\xf0\xa4\x77\xcc" - "\x2f\xc9\xbf\x54\x89\x44", - "", 1, 64, 256}, - {104, 128, 80, 21, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x27\xca\x0c\x71\x20\xbc\x3c\x96\x96\x76\x6c\xfa", "", - "\x44\xa3\xaa\x3a\xae\x64\x75\xca\xa4\x34\xa8\xe5\x85\x00\xc6\xe4\x15\x30" - "\x53\x88\x62\xd6\x86\xea\x9e\x81\x30\x1b\x5a\xe4\x22\x6b\xfa", - "\x44\xa3\xaa\x3a\xae\x64\x75\xca\xf2\xbe\xed\x7b\xc5\x09\x8e\x83\xfe\xb5" - "\xb3\x16\x08\xf8\xe2\x9c\x38\x81\x9a\x89\xc8\xe7\x76\xf1\x54\x4d\x41\x51" - "\xa4\xed\x3a\x8b\x87\xb9\xce", - "", 1, 64, 264}, - {104, 128, 80, 22, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x5b\x8c\xcb\xcd\x9a\xf8\x3c\x96\x96\x76\x6c\xfa", "", - "\xec\x46\xbb\x63\xb0\x25\x20\xc3\x3c\x49\xfd\x70\xb9\x6b\x49\xe2\x1d\x62" - "\x17\x41\x63\x28\x75\xdb\x7f\x6c\x92\x43\xd2\xd7\xc2", - "\xec\x46\xbb\x63\xb0\x25\x20\xc3\x3c\x49\xfd\x70\x31\xd7\x50\xa0\x9d\xa3" - "\xed\x7f\xdd\xd4\x9a\x20\x32\xaa\xbf\x17\xec\x8e\xbf\x7d\x22\xc8\x08\x8c" - "\x66\x6b\xe5\xc1\x97", - "", 1, 96, 248}, - {104, 128, 80, 23, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x3e\xbe\x94\x04\x4b\x9a\x3c\x96\x96\x76\x6c\xfa", "", - "\x47\xa6\x5a\xc7\x8b\x3d\x59\x42\x27\xe8\x5e\x71\xe2\xfc\xfb\xb8\x80\x44" - "\x2c\x73\x1b\xf9\x51\x67\xc8\xff\xd7\x89\x5e\x33\x70\x76", - "\x47\xa6\x5a\xc7\x8b\x3d\x59\x42\x27\xe8\x5e\x71\xe8\x82\xf1\xdb\xd3\x8c" - "\xe3\xed\xa7\xc2\x3f\x04\xdd\x65\x07\x1e\xb4\x13\x42\xac\xdf\x7e\x00\xdc" - "\xce\xc7\xae\x52\x98\x7d", - "", 1, 96, 256}, - {104, 128, 80, 24, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", - "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" - "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\xd4", - "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xf3\x29\x05\xb8\x8a\x64" - "\x1b\x04\xb9\xc9\xff\xb5\x8c\xc3\x90\x90\x0f\x3d\xa1\x2a\xb1\x6d\xce\x9e" - "\x82\xef\xa1\x6d\xa6\x20\x59", - "", 1, 96, 264}, - {104, 128, 80, 25, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", - "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" - "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" - "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" - "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" - "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" - "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" - "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" - "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" - "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" - "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" - "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" - "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" - "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" - "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" - "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" - "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" - "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" - "\xb8\x8f\x85\x6d\xf4\xa3", - "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xf3\x29\x05\xb8\x8a\x64" - "\x1b\x04\xb9\xc9\xff\xb5\x8c\xc3\x90\x90\x0f\x3d\xa1\x2a\x67\x22\xc6\x10" - "\xce\x6f\xe2\x08\x0c\x38\xd7\xae\x61\x82\x21\x3d\x59\x67\xf3\x26\x72\x53" - "\x78\x37\xe4\xba\xa7\xed\x92\x52\xd6\x01\xa5\x66\x52\x20\x6c\x51\xdb\x15" - "\x6c\xf8\x59\x38\xaf\x28\x4d\xb7\x5f\x2a\xc8\xb0\x6e\x37\x77\x89\xb0\x6d" - "\xc3\xe5\xf2\x2a\xa6\xf7\xdb\xcc\x37\x79\x88\x0e\x8f\x05\xa9\xe1\x9e\x11" - "\x90\x3d\x2a\xb9\x70\x13\x9d\xc3\x93\xad\xe2\x5d\xff\xdd\x19\x0f\xb9\x9e" - "\x74\x88\xab\x82\x0c\xa0\x2e\x71\xa6\x32\xeb\xa4\xba\x10\xf6\x61\x7b\x1b" - "\x2a\x38\x80\xeb\xe9\x09\x01\x33\x94\x8f\xb3\xd4\xad\x6c\xd8\x5e\x85\x98" - "\xc5\x9c\x11\x62\x2c\x60\x32\xae\x70\xe1\x66\x73\x09\x1e\x20\x55\xb7\x20" - "\x77\x86\x09\xc8\x1c\xfe\x86\xa7\x08\x40\x43\xe7\xad\xb2\x5b\x39\x64\xcb" - "\x13\x1f\x8d\xd2\x4f\xcc\xc5\xaa\xf1\xd6\x31\xfc\x34\x9e\x5f\x90\xc4\xb7" - "\xe0\x07\x9c\xcd\xfb\xea\xe3\x75\xb5\x7b\x29\xd4\x73\x81\xef\x9c\x2e\xac" - "\xf9\xa7\x39\x2a\xf8\xe2\xea\x3a\x6a\xdf\xd0\x3a\xca\x29\xd3\x13\x13\x9a" - "\x2c\x70\xa4\xa9\x40\x1d\xec\xc7\xc9\x6b\xf7\x23\xd4\x53\x49\xd0\x05\xce" - "\x15\x65\xce\x1f\x89\xe2\xbe\xe0\xfa\x3f\x59\x4a\x89\x99\xe5\xdb\xa0\xe8" - "\x54\x72\x42\x69\x79\x63\x68\x91\xc9\x2c\xfc\x58\xd4\x30\xfe\xe3\x62\x5f" - "\xdc\x49\xef\x32\x58\x83\x27\xa9\xed\xec\xf3\x1d\xfb\xea\x0a\x89", - "", 1, 96, 2496}, - {56, 128, 32, 26, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x4d\xac\x25\x5d", "", 1, - 64, 96}, - {104, 128, 64, 27, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd" - "\xa8\xeb\x7e\x78\xa0\x50", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46" - "\xe8\x0c\x3c\x04\xd0\x19\x78\x45\xce\x0b\x16\xf9\x76\x23", - "", 1, 176, 336}, - {104, 128, 64, 28, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" - "\xa0\x50", - "\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04" - "\xd0\x19\x41\x83\x21\x89\xa3\xd3\x1b\x43", - "", 1, 0, 160}, - {56, 128, 48, 29, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xb0\xc9\x5e\x58\x03\x6e", - "", 1, 64, 96}, - {56, 128, 64, 30, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xd0\xad\x86\xfd\x33\xc2" - "\x69\x86", - "", 1, 64, 96}, - {56, 128, 80, 31, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x05\x12\xda\xbf\xd9\x72" - "\xa6\x68\x53\xc1", - "", 1, 64, 96}, - {56, 128, 96, 32, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xba\x03\xbf\x8c\xe0\xd6" - "\x00\xa4\x48\x6f\xcc\xb3", - "", 1, 64, 96}, - {56, 128, 112, 33, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x6b\x9b\xfb\xfe\xa8\x2c" - "\x04\x77\x8e\x67\xf5\x18\x46\xc6", - "", 1, 64, 96}, - {56, 128, 128, 34, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x2b\xb5\x7c\x0a\xf4\x5e" - "\x4d\x83\x04\xf0\x5f\x45\x99\x3f\x15\x17", - "", 1, 64, 96}, - {56, 128, 32, 35, - "\x4a\xe7\x01\x10\x3c\x63\xde\xca\x5b\x5a\x39\x39\xd7\xd0\x59\x92", - "\x5a\x8a\xa4\x85\xc3\x16\xe9", "", "", "\x02\x20\x9f\x55", "", 1, 0, 0}, - {104, 128, 64, 36, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xf8\xba\x1a\x55" - "\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xf3\xd0\xa2\xfe" - "\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x60\x76" - "\xe8\xe2\x0c\x0a\xf6\xdf", - "", 1, 112, 272}, - {104, 128, 64, 37, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf8\xba\x1a\x55" - "\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf3\xd0\xa2\xfe" - "\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x35\x0d" - "\xa5\xaa\x1e\x71\x82\x35", - "", 1, 256, 416}, - {104, 128, 64, 38, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" - "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" - "\xa0\x50", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" - "\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04" - "\xd0\x19\x26\x5a\x04\xb1\x56\xff\x9f\x0e", - "", 1, 288, 448}, - {104, 128, 64, 39, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" - "\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\xf8\xba\x1a\x55\xd0\x2f\x85\xae" - "\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" - "\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23" - "\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x07\x55\x13\x40\x2b\x11" - "\x6d\xd5", - "", 1, 368, 528}, - {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} + { 104, 128, 64, 1, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x03\x02\x01\x00\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x58\x8c\x97\x9a\x61\xc6\x63\xd2\xf0\x66" + "\xd0\xc2\xc0\xf9\x89\x80\x6d\x5f\x6b\x61\xda\xc3\x84\x17\xe8\xd1\x2c\xfd" + "\xf9\x26\xe0", + "", 1, 64, 248 }, + { 104, 128, 64, 2, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x04\x03\x02\x01\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x72\xc9\x1a\x36\xe1\x35\xf8\xcf\x29\x1c" + "\xa8\x94\x08\x5c\x87\xe3\xcc\x15\xc4\x39\xc9\xe4\x3a\x3b\xa0\x91\xd5\x6e" + "\x10\x40\x09\x16", + "", 1, 64, 256 }, + { 104, 128, 64, 3, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x05\x04\x03\x02\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x51\xb1\xe5\xf4\x4a\x19\x7d\x1d\xa4\x6b" + "\x0f\x8e\x2d\x28\x2a\xe8\x71\xe8\x38\xbb\x64\xda\x85\x96\x57\x4a\xda\xa7" + "\x6f\xbd\x9f\xb0\xc5", + "", 1, 64, 264 }, + { 104, 128, 64, 4, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x06\x05\x04\x03\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xa2\x8c\x68\x65\x93\x9a" + "\x9a\x79\xfa\xaa\x5c\x4c\x2a\x9d\x4a\x91\xcd\xac\x8c\x96\xc8\x61\xb9\xc9" + "\xe6\x1e\xf1", + "", 1, 96, 248 }, + { 104, 128, 64, 5, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x07\x06\x05\x04\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xdc\xf1\xfb\x7b\x5d\x9e" + "\x23\xfb\x9d\x4e\x13\x12\x53\x65\x8a\xd8\x6e\xbd\xca\x3e\x51\xe8\x3f\x07" + "\x7d\x9c\x2d\x93", + "", 1, 96, 256 }, + { 104, 128, 64, 6, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x08\x07\x06\x05\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x6f\xc1\xb0\x11\xf0\x06" + "\x56\x8b\x51\x71\xa4\x2d\x95\x3d\x46\x9b\x25\x70\xa4\xbd\x87\x40\x5a\x04" + "\x43\xac\x91\xcb\x94", + "", 1, 96, 264 }, + { 104, 128, 80, 7, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x09\x08\x07\x06\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x01\x35\xd1\xb2\xc9\x5f\x41\xd5\xd1\xd4" + "\xfe\xc1\x85\xd1\x66\xb8\x09\x4e\x99\x9d\xfe\xd9\x6c\x04\x8c\x56\x60\x2c" + "\x97\xac\xbb\x74\x90", + "", 1, 64, 248 }, + { 104, 128, 80, 8, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0a\x09\x08\x07\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x7b\x75\x39\x9a\xc0\x83\x1d\xd2\xf0\xbb" + "\xd7\x58\x79\xa2\xfd\x8f\x6c\xae\x6b\x6c\xd9\xb7\xdb\x24\xc1\x7b\x44\x33" + "\xf4\x34\x96\x3f\x34\xb4", + "", 1, 64, 256 }, + { 104, 128, 80, 9, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0b\x0a\x09\x08\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x82\x53\x1a\x60\xcc\x24\x94\x5a\x4b\x82" + "\x79\x18\x1a\xb5\xc8\x4d\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1\x97\xea\x9c\x07" + "\xe5\x6b\x5e\xb1\x7e\x5f\x4e", + "", 1, 64, 264 }, + { 104, 128, 80, 10, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0c\x0b\x0a\x09\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x07\x34\x25\x94\x15\x77" + "\x85\x15\x2b\x07\x40\x98\x33\x0a\xbb\x14\x1b\x94\x7b\x56\x6a\xa9\x40\x6b" + "\x4d\x99\x99\x88\xdd", + "", 1, 96, 248 }, + { 104, 128, 80, 11, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0d\x0c\x0b\x0a\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x67\x6b\xb2\x03\x80\xb0" + "\xe3\x01\xe8\xab\x79\x59\x0a\x39\x6d\xa7\x8b\x83\x49\x34\xf5\x3a\xa2\xe9" + "\x10\x7a\x8b\x6c\x02\x2c", + "", 1, 96, 256 }, + { 104, 128, 80, 12, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x0e\x0d\x0c\x0b\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\xc0\xff\xa0\xd6\xf0\x5b" + "\xdb\x67\xf2\x4d\x43\xa4\x33\x8d\x2a\xa4\xbe\xd7\xb2\x0e\x43\xcd\x1a\xa3" + "\x16\x62\xe7\xad\x65\xd6\xdb", + "", 1, 96, 264 }, + { 104, 128, 64, 13, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x41\x2b\x4e\xa9\xcd\xbe\x3c\x96\x96\x76\x6c\xfa", "", + "\x0b\xe1\xa8\x8b\xac\xe0\x18\xb1\x08\xe8\xcf\x97\xd8\x20\xea\x25\x84\x60" + "\xe9\x6a\xd9\xcf\x52\x89\x05\x4d\x89\x5c\xea\xc4\x7c", + "\x0b\xe1\xa8\x8b\xac\xe0\x18\xb1\x4c\xb9\x7f\x86\xa2\xa4\x68\x9a\x87\x79" + "\x47\xab\x80\x91\xef\x53\x86\xa6\xff\xbd\xd0\x80\xf8\xe7\x8c\xf7\xcb\x0c" + "\xdd\xd7\xb3", + "", 1, 64, 248 }, + { 104, 128, 64, 14, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x33\x56\x8e\xf7\xb2\x63\x3c\x96\x96\x76\x6c\xfa", "", + "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb\x90\x20\xea\x6f\x91\xbd\xd8\x5a\xfa\x00" + "\x39\xba\x4b\xaf\xf9\xbf\xb7\x9c\x70\x28\x94\x9c\xd0\xec", + "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa\xa0\x72" + "\x6c\x55\xd3\x78\x06\x12\x98\xc8\x5c\x92\x81\x4a\xbc\x33\xc5\x2e\xe8\x1d" + "\x7d\x77\xc0\x8a", + "", 1, 64, 256 }, + { 104, 128, 64, 15, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x10\x3f\xe4\x13\x36\x71\x3c\x96\x96\x76\x6c\xfa", "", + "\xaa\x6c\xfa\x36\xca\xe8\x6b\x40\xb9\x16\xe0\xea\xcc\x1c\x00\xd7\xdc\xec" + "\x68\xec\x0b\x3b\xbb\x1a\x02\xde\x8a\x2d\x1a\xa3\x46\x13\x2e", + "\xaa\x6c\xfa\x36\xca\xe8\x6b\x40\xb1\xd2\x3a\x22\x20\xdd\xc0\xac\x90\x0d" + "\x9a\xa0\x3c\x61\xfc\xf4\xa5\x59\xa4\x41\x77\x67\x08\x97\x08\xa7\x76\x79" + "\x6e\xdb\x72\x35\x06", + "", 1, 64, 264 }, + { 104, 128, 64, 16, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x76\x4c\x63\xb8\x05\x8e\x3c\x96\x96\x76\x6c\xfa", "", + "\xd0\xd0\x73\x5c\x53\x1e\x1b\xec\xf0\x49\xc2\x44\x12\xda\xac\x56\x30\xef" + "\xa5\x39\x6f\x77\x0c\xe1\xa6\x6b\x21\xf7\xb2\x10\x1c", + "\xd0\xd0\x73\x5c\x53\x1e\x1b\xec\xf0\x49\xc2\x44\x14\xd2\x53\xc3\x96\x7b" + "\x70\x60\x9b\x7c\xbb\x7c\x49\x91\x60\x28\x32\x45\x26\x9a\x6f\x49\x97\x5b" + "\xca\xde\xaf", + "", 1, 96, 248 }, + { 104, 128, 64, 17, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\xf8\xb6\x78\x09\x4e\x3b\x3c\x96\x96\x76\x6c\xfa", "", + "\x77\xb6\x0f\x01\x1c\x03\xe1\x52\x58\x99\xbc\xae\xe8\x8b\x6a\x46\xc7\x8d" + "\x63\xe5\x2e\xb8\xc5\x46\xef\xb5\xde\x6f\x75\xe9\xcc\x0d", + "\x77\xb6\x0f\x01\x1c\x03\xe1\x52\x58\x99\xbc\xae\x55\x45\xff\x1a\x08\x5e" + "\xe2\xef\xbf\x52\xb2\xe0\x4b\xee\x1e\x23\x36\xc7\x3e\x3f\x76\x2c\x0c\x77" + "\x44\xfe\x7e\x3c", + "", 1, 96, 256 }, + { 104, 128, 64, 18, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\xd5\x60\x91\x2d\x3f\x70\x3c\x96\x96\x76\x6c\xfa", "", + "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81\x20\xea\x60\xc0\x64\x35\xac\xba\xfb\x11" + "\xa8\x2e\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9\x3a\x80\x3b\xa8\x7f", + "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81\x20\xea\x60\xc0\x00\x97\x69\xec\xab\xdf" + "\x48\x62\x55\x94\xc5\x92\x51\xe6\x03\x57\x22\x67\x5e\x04\xc8\x47\x09\x9e" + "\x5a\xe0\x70\x45\x51", + "", 1, 96, 264 }, + { 104, 128, 80, 19, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x42\xff\xf8\xf1\x95\x1c\x3c\x96\x96\x76\x6c\xfa", "", + "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8\x8a\x19\xb9\x50\xbc\xf7\x1a\x01\x8e\x5e" + "\x67\x01\xc9\x17\x87\x65\x98\x09\xd6\x7d\xbe\xdd\x18", + "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8\xbc\x21\x8d\xaa\x94\x74\x27\xb6\xdb\x38" + "\x6a\x99\xac\x1a\xef\x23\xad\xe0\xb5\x29\x39\xcb\x6a\x63\x7c\xf9\xbe\xc2" + "\x40\x88\x97\xc6\xba", + "", 1, 64, 248 }, + { 104, 128, 80, 20, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x92\x0f\x40\xe5\x6c\xdc\x3c\x96\x96\x76\x6c\xfa", "", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x17\x61\x43\x3c\x37\xc5\xa3\x5f\xc1\xf3" + "\x9f\x40\x63\x02\xeb\x90\x7c\x61\x63\xbe\x38\xc9\x84\x37", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x58\x10\xe6\xfd\x25\x87\x40\x22\xe8\x03" + "\x61\xa4\x78\xe3\xe9\xcf\x48\x4a\xb0\x4f\x44\x7e\xff\xf6\xf0\xa4\x77\xcc" + "\x2f\xc9\xbf\x54\x89\x44", + "", 1, 64, 256 }, + { 104, 128, 80, 21, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x27\xca\x0c\x71\x20\xbc\x3c\x96\x96\x76\x6c\xfa", "", + "\x44\xa3\xaa\x3a\xae\x64\x75\xca\xa4\x34\xa8\xe5\x85\x00\xc6\xe4\x15\x30" + "\x53\x88\x62\xd6\x86\xea\x9e\x81\x30\x1b\x5a\xe4\x22\x6b\xfa", + "\x44\xa3\xaa\x3a\xae\x64\x75\xca\xf2\xbe\xed\x7b\xc5\x09\x8e\x83\xfe\xb5" + "\xb3\x16\x08\xf8\xe2\x9c\x38\x81\x9a\x89\xc8\xe7\x76\xf1\x54\x4d\x41\x51" + "\xa4\xed\x3a\x8b\x87\xb9\xce", + "", 1, 64, 264 }, + { 104, 128, 80, 22, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x5b\x8c\xcb\xcd\x9a\xf8\x3c\x96\x96\x76\x6c\xfa", "", + "\xec\x46\xbb\x63\xb0\x25\x20\xc3\x3c\x49\xfd\x70\xb9\x6b\x49\xe2\x1d\x62" + "\x17\x41\x63\x28\x75\xdb\x7f\x6c\x92\x43\xd2\xd7\xc2", + "\xec\x46\xbb\x63\xb0\x25\x20\xc3\x3c\x49\xfd\x70\x31\xd7\x50\xa0\x9d\xa3" + "\xed\x7f\xdd\xd4\x9a\x20\x32\xaa\xbf\x17\xec\x8e\xbf\x7d\x22\xc8\x08\x8c" + "\x66\x6b\xe5\xc1\x97", + "", 1, 96, 248 }, + { 104, 128, 80, 23, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x3e\xbe\x94\x04\x4b\x9a\x3c\x96\x96\x76\x6c\xfa", "", + "\x47\xa6\x5a\xc7\x8b\x3d\x59\x42\x27\xe8\x5e\x71\xe2\xfc\xfb\xb8\x80\x44" + "\x2c\x73\x1b\xf9\x51\x67\xc8\xff\xd7\x89\x5e\x33\x70\x76", + "\x47\xa6\x5a\xc7\x8b\x3d\x59\x42\x27\xe8\x5e\x71\xe8\x82\xf1\xdb\xd3\x8c" + "\xe3\xed\xa7\xc2\x3f\x04\xdd\x65\x07\x1e\xb4\x13\x42\xac\xdf\x7e\x00\xdc" + "\xce\xc7\xae\x52\x98\x7d", + "", 1, 96, 256 }, + { 104, 128, 80, 24, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\xd4", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xf3\x29\x05\xb8\x8a\x64" + "\x1b\x04\xb9\xc9\xff\xb5\x8c\xc3\x90\x90\x0f\x3d\xa1\x2a\xb1\x6d\xce\x9e" + "\x82\xef\xa1\x6d\xa6\x20\x59", + "", 1, 96, 264 }, + { 104, 128, 80, 25, "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xf3\x29\x05\xb8\x8a\x64" + "\x1b\x04\xb9\xc9\xff\xb5\x8c\xc3\x90\x90\x0f\x3d\xa1\x2a\x67\x22\xc6\x10" + "\xce\x6f\xe2\x08\x0c\x38\xd7\xae\x61\x82\x21\x3d\x59\x67\xf3\x26\x72\x53" + "\x78\x37\xe4\xba\xa7\xed\x92\x52\xd6\x01\xa5\x66\x52\x20\x6c\x51\xdb\x15" + "\x6c\xf8\x59\x38\xaf\x28\x4d\xb7\x5f\x2a\xc8\xb0\x6e\x37\x77\x89\xb0\x6d" + "\xc3\xe5\xf2\x2a\xa6\xf7\xdb\xcc\x37\x79\x88\x0e\x8f\x05\xa9\xe1\x9e\x11" + "\x90\x3d\x2a\xb9\x70\x13\x9d\xc3\x93\xad\xe2\x5d\xff\xdd\x19\x0f\xb9\x9e" + "\x74\x88\xab\x82\x0c\xa0\x2e\x71\xa6\x32\xeb\xa4\xba\x10\xf6\x61\x7b\x1b" + "\x2a\x38\x80\xeb\xe9\x09\x01\x33\x94\x8f\xb3\xd4\xad\x6c\xd8\x5e\x85\x98" + "\xc5\x9c\x11\x62\x2c\x60\x32\xae\x70\xe1\x66\x73\x09\x1e\x20\x55\xb7\x20" + "\x77\x86\x09\xc8\x1c\xfe\x86\xa7\x08\x40\x43\xe7\xad\xb2\x5b\x39\x64\xcb" + "\x13\x1f\x8d\xd2\x4f\xcc\xc5\xaa\xf1\xd6\x31\xfc\x34\x9e\x5f\x90\xc4\xb7" + "\xe0\x07\x9c\xcd\xfb\xea\xe3\x75\xb5\x7b\x29\xd4\x73\x81\xef\x9c\x2e\xac" + "\xf9\xa7\x39\x2a\xf8\xe2\xea\x3a\x6a\xdf\xd0\x3a\xca\x29\xd3\x13\x13\x9a" + "\x2c\x70\xa4\xa9\x40\x1d\xec\xc7\xc9\x6b\xf7\x23\xd4\x53\x49\xd0\x05\xce" + "\x15\x65\xce\x1f\x89\xe2\xbe\xe0\xfa\x3f\x59\x4a\x89\x99\xe5\xdb\xa0\xe8" + "\x54\x72\x42\x69\x79\x63\x68\x91\xc9\x2c\xfc\x58\xd4\x30\xfe\xe3\x62\x5f" + "\xdc\x49\xef\x32\x58\x83\x27\xa9\xed\xec\xf3\x1d\xfb\xea\x0a\x89", + "", 1, 96, 2496 }, + { 56, 128, 32, 26, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x4d\xac\x25\x5d", "", 1, 64, 96 }, + { 104, 128, 64, 27, "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd" + "\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46" + "\xe8\x0c\x3c\x04\xd0\x19\x78\x45\xce\x0b\x16\xf9\x76\x23", + "", 1, 176, 336 }, + { 104, 128, 64, 28, "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" + "\xa0\x50", + "\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04" + "\xd0\x19\x41\x83\x21\x89\xa3\xd3\x1b\x43", + "", 1, 0, 160 }, + { 56, 128, 48, 29, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xb0\xc9\x5e\x58\x03\x6e", "", 1, 64, + 96 }, + { 56, 128, 64, 30, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xd0\xad\x86\xfd\x33\xc2" + "\x69\x86", + "", 1, 64, 96 }, + { 56, 128, 80, 31, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x05\x12\xda\xbf\xd9\x72" + "\xa6\x68\x53\xc1", + "", 1, 64, 96 }, + { 56, 128, 96, 32, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\xba\x03\xbf\x8c\xe0\xd6" + "\x00\xa4\x48\x6f\xcc\xb3", + "", 1, 64, 96 }, + { 56, 128, 112, 33, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x6b\x9b\xfb\xfe\xa8\x2c" + "\x04\x77\x8e\x67\xf5\x18\x46\xc6", + "", 1, 64, 96 }, + { 56, 128, 128, 34, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\x71\x62\x01\x5b\x2b\xb5\x7c\x0a\xf4\x5e" + "\x4d\x83\x04\xf0\x5f\x45\x99\x3f\x15\x17", + "", 1, 64, 96 }, + { 56, 128, 32, 35, "\x4a\xe7\x01\x10\x3c\x63\xde\xca\x5b\x5a\x39\x39\xd7\xd0\x59\x92", + "\x5a\x8a\xa4\x85\xc3\x16\xe9", "", "", "\x02\x20\x9f\x55", "", 1, 0, 0 }, + { 104, 128, 64, 36, "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xf8\xba\x1a\x55" + "\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xf3\xd0\xa2\xfe" + "\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x60\x76" + "\xe8\xe2\x0c\x0a\xf6\xdf", + "", 1, 112, 272 }, + { 104, 128, 64, 37, "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf8\xba\x1a\x55" + "\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf3\xd0\xa2\xfe" + "\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x35\x0d" + "\xa5\xaa\x1e\x71\x82\x35", + "", 1, 256, 416 }, + { 104, 128, 64, 38, "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" + "\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04" + "\xd0\x19\x26\x5a\x04\xb1\x56\xff\x9f\x0e", + "", 1, 288, 448 }, + { 104, 128, 64, 39, "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\xf8\xba\x1a\x55\xd0\x2f\x85\xae" + "\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\x00\x01\x02\x03" + "\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\xf3\xd0\xa2\xfe\x9a\x3d\xbf\x23" + "\x42\xa6\x43\xe4\x32\x46\xe8\x0c\x3c\x04\xd0\x19\x07\x55\x13\x40\x2b\x11" + "\x6d\xd5", + "", 1, 368, 528 }, + { 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; const struct aead_test ccm_256_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc3610 */ - {104, 256, 64, 1, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" - "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x03\x02\x01\x00\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", - "\x00\x01\x02\x03\x04\x05\x06\x07\x21\x61\x63\xde\xcf\x74\xe0\x0c\xab\x04" - "\x56\xff\x45\xcd\xa7\x17\x1f\xa5\x96\xd7\x0f\x76\x91\xca\x8a\xfa\xa2\x3f" - "\x22\x3e\x64", - "", 1, 64, 248}, - {104, 256, 64, 2, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" - "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x04\x03\x02\x01\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x61\x6a\x60\x6d\x54\x41\x94\xab\x29\xd2" - "\xa9\x86\x14\xda\x02\x40\x14\xfa\xc5\xce\x97\x0a\xa1\xe9\xf1\xa3\xed\x0e" - "\xe1\x2a\x9b\x69", - "", 1, 64, 256}, - {104, 256, 64, 3, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" - "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x05\x04\x03\x02\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", - "\x00\x01\x02\x03\x04\x05\x06\x07\x75\x4c\xdd\xea\x13\x59\x9b\x30\xba\xc6" - "\xd4\x0d\x12\x0d\x43\x0a\x2b\x44\xc4\x0b\x1f\xde\x31\x24\xc4\x9e\xd2\xc4" - "\xf4\x04\xdc\xf3\xeb", - "", 1, 64, 264}, - {104, 256, 64, 4, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" - "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x06\x05\x04\x03\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x5c\x14\xc7\x8c\x02\xc5" - "\xa2\x64\xd8\xdf\x46\x57\x88\x34\xef\x27\xc1\xa3\x01\xef\xda\x9e\x13\xc7" - "\x00\xcc\x63", - "", 1, 96, 248}, - {104, 256, 64, 5, - "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" - "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", - "\x00\x00\x00\x07\x06\x05\x04\xa0\xa1\xa2\xa3\xa4\xa5", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x2c\xf8\x28\xa5\x5a\x7d" - "\xef\xf1\x63\x3d\x26\x72\xa0\x7b\x35\x2c\x3d\xc5\xb4\xe5\x8f\xc4\x9d\x90" - "\xbe\x78\x94\xa5", - "", 1, 96, 256}, - {104, 256, 80, 6, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b\xd7\x82" - "\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x92\x0f\x40\xe5\x6c\xdc\x3c\x96\x96\x76\x6c\xfa", "", - "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x17\x61\x43\x3c\x37\xc5\xa3\x5f\xc1\xf3" - "\x9f\x40\x63\x02\xeb\x90\x7c\x61\x63\xbe\x38\xc9\x84\x37", - "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x8e\xef\xd9\x8c\x25\x6f\xef\xcd\xc3\xc0" - "\xad\x3c\x42\xb1\xd7\x44\x2b\x44\x75\x41\xc3\xb1\x18\x85\x90\x59\x3c\x67" - "\xe2\xf7\x9e\x2a\xce\x9e", - "", 1, 64, 256}, - {104, 256, 80, 7, - "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b\xd7\x82" - "\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", - "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", - "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" - "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" - "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" - "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" - "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" - "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" - "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" - "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" - "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" - "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" - "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" - "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" - "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" - "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" - "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" - "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" - "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" - "\xb8\x8f\x85\x6d\xf4\xa3", - "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\x23\x68\x7a\x56\x54\x09" - "\x51\xb0\x13\x4f\x65\xe9\xcd\xe6\xac\x57\x22\x59\x28\xe3\x93\xea\xa6\xc5" - "\x14\xbf\x9d\x1d\x5d\xb0\xa3\x16\xb2\x4a\x09\xe8\x9a\xd2\xe4\x04\x66\x01" - "\x84\xd3\xaf\x85\x02\x69\xf4\xa2\x43\x5c\x98\x13\xf1\x96\x99\x68\xc1\x8c" - "\x4b\x3f\x69\xce\x05\x26\x12\x76\xdb\xb7\x7d\x99\xcc\x0b\x6e\x43\x03\x75" - "\xff\xd9\x85\x8e\x1c\x4e\x7d\x0f\x4d\xfd\x1c\x6a\x1e\x5c\xf4\x17\x3a\xa9" - "\x1f\xf8\xd0\xad\xf8\xb6\x8b\xc1\xb5\xff\x71\x6f\xbe\x18\x92\xed\x43\x73" - "\x04\xed\xb9\x78\x35\xa4\x70\x99\xdd\x62\xc0\x68\x84\x68\x5f\x37\x3c\x9f" - "\xdd\x8b\xfb\x75\x82\x47\xae\x1b\x21\x54\x5e\x1e\x43\x7c\x63\xc5\xb5\x47" - "\xa7\x65\x56\x47\xba\xc5\x30\x4b\x4a\xad\xa5\x68\x5d\x22\x31\xb8\x92\x25" - "\x4d\x42\x8b\x51\xf8\xfb\xba\x1a\xaa\x86\x71\x3e\x22\xc0\x7f\xd7\x58\xd0" - "\x25\x90\xf5\x18\xf7\xe9\x69\xe3\x6f\x5e\x1c\x38\xa3\x52\xa3\x49\x4b\x70" - "\x1e\xb6\x13\x65\xf7\x1a\xf9\xe0\x03\x94\x2b\x4b\xd9\xb0\x18\xa8\x2a\xda" - "\x80\xd4\x88\xd3\x0b\x37\xe1\x4a\xbe\xbf\xd9\x2c\x84\xd1\xf5\x56\x5c\x79" - "\x14\x77\x1b\x9d\x34\x65\x22\x39\x78\x4d\xee\x29\x9a\x80\x42\x2a\xaf\x3d" - "\x84\xb7\x3c\x60\xa6\x08\x4c\xbb\x2b\x8e\xdb\x94\x4d\x72\x08\x1b\x29\xd1" - "\xe9\xdb\xe9\x53\x2c\xc0\x22\xe0\x75\x27\x61\x2e\x26\xe4\x80\x2a\xb0\xd3" - "\xf4\x4e\x90\x91\x92\xdb\x92\xe1\x4f\x3d\x53\x58\xc8\x86\x18\x5d", - "", 1, 96, 2496}, - {56, 256, 32, 8, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" - "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\x45\x50\xab\xab", "", 1, - 64, 96}, - {104, 256, 64, 9, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f\xc9\x7c" - "\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd" - "\xa8\xeb\x7e\x78\xa0\x50", - "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" - "\xfc\xba\x00\x00\x12\x2a\xb4\xd4\x01\xc3\x1a\x55\xe0\x59\x6a\x5e\xcc\x37" - "\xdb\xd4\xa2\xb5\x3f\xd8\x42\x1d\xb8\xe9\xbf\x60\x3f\xe8", - "", 1, 176, 336}, - {56, 256, 80, 10, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" - "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\xf8\x16\xab\xe3\xa7\xc9" - "\x26\xb4\x3d\xea", - "", 1, 64, 96}, - {104, 256, 64, 11, - "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f\xc9\x7c" - "\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", - "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", - "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" - "\xa0\x50", - "\x12\x2a\xb4\xd4\x01\xc3\x1a\x55\xe0\x59\x6a\x5e\xcc\x37\xdb\xd4\xa2\xb5" - "\x3f\xd8\x1c\x89\xde\xf3\x72\x03\x96\x19", - "", 1, 0, 160}, - {56, 256, 128, 12, - "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" - "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", - "\x10\x11\x12\x13\x14\x15\x16", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", - "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\x45\x80\xd7\x1d\xa5\x34" - "\x5f\x7c\xf9\x11\xb9\x95\x19\x86\x90\x30", - "", 1, 64, 96}, - {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} + { 104, 256, 64, 1, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x03\x02\x01\x00\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x21\x61\x63\xde\xcf\x74\xe0\x0c\xab\x04" + "\x56\xff\x45\xcd\xa7\x17\x1f\xa5\x96\xd7\x0f\x76\x91\xca\x8a\xfa\xa2\x3f" + "\x22\x3e\x64", + "", 1, 64, 248 }, + { 104, 256, 64, 2, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x04\x03\x02\x01\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x61\x6a\x60\x6d\x54\x41\x94\xab\x29\xd2" + "\xa9\x86\x14\xda\x02\x40\x14\xfa\xc5\xce\x97\x0a\xa1\xe9\xf1\xa3\xed\x0e" + "\xe1\x2a\x9b\x69", + "", 1, 64, 256 }, + { 104, 256, 64, 3, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x05\x04\x03\x02\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", + "\x00\x01\x02\x03\x04\x05\x06\x07\x75\x4c\xdd\xea\x13\x59\x9b\x30\xba\xc6" + "\xd4\x0d\x12\x0d\x43\x0a\x2b\x44\xc4\x0b\x1f\xde\x31\x24\xc4\x9e\xd2\xc4" + "\xf4\x04\xdc\xf3\xeb", + "", 1, 64, 264 }, + { 104, 256, 64, 4, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x06\x05\x04\x03\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x5c\x14\xc7\x8c\x02\xc5" + "\xa2\x64\xd8\xdf\x46\x57\x88\x34\xef\x27\xc1\xa3\x01\xef\xda\x9e\x13\xc7" + "\x00\xcc\x63", + "", 1, 96, 248 }, + { 104, 256, 64, 5, + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xc0\xc1" + "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + "\x00\x00\x00\x07\x06\x05\x04\xa0\xa1\xa2\xa3\xa4\xa5", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x2c\xf8\x28\xa5\x5a\x7d" + "\xef\xf1\x63\x3d\x26\x72\xa0\x7b\x35\x2c\x3d\xc5\xb4\xe5\x8f\xc4\x9d\x90" + "\xbe\x78\x94\xa5", + "", 1, 96, 256 }, + { 104, 256, 80, 6, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b\xd7\x82" + "\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x92\x0f\x40\xe5\x6c\xdc\x3c\x96\x96\x76\x6c\xfa", "", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x17\x61\x43\x3c\x37\xc5\xa3\x5f\xc1\xf3" + "\x9f\x40\x63\x02\xeb\x90\x7c\x61\x63\xbe\x38\xc9\x84\x37", + "\x74\xa0\xeb\xc9\x06\x9f\x5b\x37\x8e\xef\xd9\x8c\x25\x6f\xef\xcd\xc3\xc0" + "\xad\x3c\x42\xb1\xd7\x44\x2b\x44\x75\x41\xc3\xb1\x18\x85\x90\x59\x3c\x67" + "\xe2\xf7\x9e\x2a\xce\x9e", + "", 1, 64, 256 }, + { 104, 256, 80, 7, + "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b\xd7\x82" + "\x8d\x13\xb2\xb0\xbd\xc3\x25\xa7\x62\x36\xdf\x93\xcc\x6b", + "\x00\x8d\x49\x3b\x30\xae\x8b\x3c\x96\x96\x76\x6c\xfa", "", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\xab\xf2\x1c\x0b\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f" + "\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d" + "\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3" + "\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81" + "\xbc\xe3\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3" + "\xcc\x12\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12" + "\x85\x17\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17" + "\x02\xfe\xb8\x8f\x85\x6d\xf4\xa3\x73\x81\xbc\xe3\xcc\x12\x85\x17\x02\xfe" + "\xb8\x8f\x85\x6d\xf4\xa3", + "\x6e\x37\xa6\xef\x54\x6d\x95\x5d\x34\xab\x60\x59\x23\x68\x7a\x56\x54\x09" + "\x51\xb0\x13\x4f\x65\xe9\xcd\xe6\xac\x57\x22\x59\x28\xe3\x93\xea\xa6\xc5" + "\x14\xbf\x9d\x1d\x5d\xb0\xa3\x16\xb2\x4a\x09\xe8\x9a\xd2\xe4\x04\x66\x01" + "\x84\xd3\xaf\x85\x02\x69\xf4\xa2\x43\x5c\x98\x13\xf1\x96\x99\x68\xc1\x8c" + "\x4b\x3f\x69\xce\x05\x26\x12\x76\xdb\xb7\x7d\x99\xcc\x0b\x6e\x43\x03\x75" + "\xff\xd9\x85\x8e\x1c\x4e\x7d\x0f\x4d\xfd\x1c\x6a\x1e\x5c\xf4\x17\x3a\xa9" + "\x1f\xf8\xd0\xad\xf8\xb6\x8b\xc1\xb5\xff\x71\x6f\xbe\x18\x92\xed\x43\x73" + "\x04\xed\xb9\x78\x35\xa4\x70\x99\xdd\x62\xc0\x68\x84\x68\x5f\x37\x3c\x9f" + "\xdd\x8b\xfb\x75\x82\x47\xae\x1b\x21\x54\x5e\x1e\x43\x7c\x63\xc5\xb5\x47" + "\xa7\x65\x56\x47\xba\xc5\x30\x4b\x4a\xad\xa5\x68\x5d\x22\x31\xb8\x92\x25" + "\x4d\x42\x8b\x51\xf8\xfb\xba\x1a\xaa\x86\x71\x3e\x22\xc0\x7f\xd7\x58\xd0" + "\x25\x90\xf5\x18\xf7\xe9\x69\xe3\x6f\x5e\x1c\x38\xa3\x52\xa3\x49\x4b\x70" + "\x1e\xb6\x13\x65\xf7\x1a\xf9\xe0\x03\x94\x2b\x4b\xd9\xb0\x18\xa8\x2a\xda" + "\x80\xd4\x88\xd3\x0b\x37\xe1\x4a\xbe\xbf\xd9\x2c\x84\xd1\xf5\x56\x5c\x79" + "\x14\x77\x1b\x9d\x34\x65\x22\x39\x78\x4d\xee\x29\x9a\x80\x42\x2a\xaf\x3d" + "\x84\xb7\x3c\x60\xa6\x08\x4c\xbb\x2b\x8e\xdb\x94\x4d\x72\x08\x1b\x29\xd1" + "\xe9\xdb\xe9\x53\x2c\xc0\x22\xe0\x75\x27\x61\x2e\x26\xe4\x80\x2a\xb0\xd3" + "\xf4\x4e\x90\x91\x92\xdb\x92\xe1\x4f\x3d\x53\x58\xc8\x86\x18\x5d", + "", 1, 96, 2496 }, + { 56, 256, 32, 8, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" + "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\x45\x50\xab\xab", "", 1, 64, 96 }, + { 104, 256, 64, 9, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f\xc9\x7c" + "\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd" + "\xa8\xeb\x7e\x78\xa0\x50", + "\x08\x40\x0f\xd2\xe1\x28\xa5\x7c\x50\x30\xf1\x84\x44\x08\xab\xae\xa5\xb8" + "\xfc\xba\x00\x00\x12\x2a\xb4\xd4\x01\xc3\x1a\x55\xe0\x59\x6a\x5e\xcc\x37" + "\xdb\xd4\xa2\xb5\x3f\xd8\x42\x1d\xb8\xe9\xbf\x60\x3f\xe8", + "", 1, 176, 336 }, + { 56, 256, 80, 10, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" + "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\xf8\x16\xab\xe3\xa7\xc9" + "\x26\xb4\x3d\xea", + "", 1, 64, 96 }, + { 104, 256, 64, 11, + "\xc9\x7c\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f\xc9\x7c" + "\x1f\x67\xce\x37\x11\x85\x51\x4a\x8a\x19\xf2\xbd\xd5\x2f", + "\x00\x50\x30\xf1\x84\x44\x08\xb5\x03\x97\x76\xe7\x0c", "", + "\xf8\xba\x1a\x55\xd0\x2f\x85\xae\x96\x7b\xb6\x2f\xb6\xcd\xa8\xeb\x7e\x78" + "\xa0\x50", + "\x12\x2a\xb4\xd4\x01\xc3\x1a\x55\xe0\x59\x6a\x5e\xcc\x37\xdb\xd4\xa2\xb5" + "\x3f\xd8\x1c\x89\xde\xf3\x72\x03\x96\x19", + "", 1, 0, 160 }, + { 56, 256, 128, 12, + "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x40\x41" + "\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f", + "\x10\x11\x12\x13\x14\x15\x16", "", "\x00\x01\x02\x03\x04\x05\x06\x07\x20\x21\x22\x23", + "\x00\x01\x02\x03\x04\x05\x06\x07\xd0\xb5\x4a\x05\x45\x80\xd7\x1d\xa5\x34" + "\x5f\x7c\xf9\x11\xb9\x95\x19\x86\x90\x30", + "", 1, 64, 96 }, + { 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; diff --git a/test/kat-app/chacha20_poly1305_test.c b/test/kat-app/chacha20_poly1305_test.c index 93243fa7..9454f97f 100644 --- a/test/kat-app/chacha20_poly1305_test.c +++ b/test/kat-app/chacha20_poly1305_test.c @@ -34,29 +34,25 @@ #include "utils.h" #include "aead_test.h" -#define AAD_SZ 24 -#define IV_SZ 12 -#define KEY_SZ 32 +#define AAD_SZ 24 +#define IV_SZ 12 +#define KEY_SZ 32 #define DIGEST_SZ 16 -int chacha20_poly1305_test(struct IMB_MGR *mb_mgr); +int +chacha20_poly1305_test(struct IMB_MGR *mb_mgr); extern const struct aead_test chacha20_poly1305_test_json[]; static int -aead_ok(const struct aead_test *vec, - const size_t auth_len, - const uint8_t *out_text, - const IMB_CIPHER_DIRECTION cipher_dir, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +aead_ok(const struct aead_test *vec, const size_t auth_len, const uint8_t *out_text, + const IMB_CIPHER_DIRECTION cipher_dir, const uint8_t *auth, const uint8_t *padding, + const size_t sizeof_padding) { /* hash checks */ if (memcmp(padding, &auth[sizeof_padding + auth_len], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + auth_len], sizeof_padding); + hexdump(stderr, "Target", &auth[sizeof_padding + auth_len], sizeof_padding); return 0; } @@ -104,10 +100,7 @@ aead_ok(const struct aead_test *vec, } static int -test_aead(struct IMB_MGR *mb_mgr, - const struct aead_test *vec, - const int dir, - const int num_jobs, +test_aead(struct IMB_MGR *mb_mgr, const struct aead_test *vec, const int dir, const int num_jobs, const int in_place) { struct IMB_JOB *job; @@ -117,8 +110,8 @@ test_aead(struct IMB_MGR *mb_mgr, int i = 0, jobs_rx = 0, ret = -1; if (auths == NULL || targets == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); memset(auths, 0, num_jobs * sizeof(void *)); @@ -163,11 +156,10 @@ test_aead(struct IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { if (in_place) src_ptr_array[i] = targets[i] + sizeof(padding); + else if (dir == IMB_DIR_ENCRYPT) + src_ptr_array[i] = (const void *) vec->msg; else - if (dir == IMB_DIR_ENCRYPT) - src_ptr_array[i] = (const void *) vec->msg; - else - src_ptr_array[i] = (const void *) vec->ct; + src_ptr_array[i] = (const void *) vec->ct; dst_ptr_array[i] = targets[i] + sizeof(padding); @@ -182,8 +174,8 @@ test_aead(struct IMB_MGR *mb_mgr, DIGEST_SZ, num_jobs); for (i = 0; i < num_jobs; i++) { - if (!aead_ok(vec, DIGEST_SZ, dst_ptr_array[i], dir, auths[i], - padding, sizeof(padding))) + if (!aead_ok(vec, DIGEST_SZ, dst_ptr_array[i], dir, auths[i], padding, + sizeof(padding))) goto end; } @@ -217,16 +209,15 @@ test_aead(struct IMB_MGR *mb_mgr, job->dec_keys = vec->key; job->key_len_in_bytes = KEY_SZ; - job->u.CHACHA20_POLY1305.aad = (const void *)vec->aad; + job->u.CHACHA20_POLY1305.aad = (const void *) vec->aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aadSize / 8; if (in_place) job->src = targets[i] + sizeof(padding); + else if (dir == IMB_DIR_ENCRYPT) + job->src = (const void *) vec->msg; else - if (dir == IMB_DIR_ENCRYPT) - job->src = (const void *) vec->msg; - else - job->src = (const void *) vec->ct; + job->src = (const void *) vec->ct; job->dst = targets[i] + sizeof(padding); job->iv = (const void *) vec->iv; @@ -247,21 +238,19 @@ test_aead(struct IMB_MGR *mb_mgr, if (job->status != IMB_STATUS_COMPLETED) { const int errcode = imb_get_errno(mb_mgr); - printf("Error!: job status %d, errno %d => %s\n", - job->status, errcode, imb_get_strerror(errcode)); + printf("Error!: job status %d, errno %d => %s\n", job->status, + errcode, imb_get_strerror(errcode)); goto end; } - if (!aead_ok(vec, job->auth_tag_output_len_in_bytes, - job->dst, dir, job->user_data, - padding, sizeof(padding))) + if (!aead_ok(vec, job->auth_tag_output_len_in_bytes, job->dst, dir, + job->user_data, padding, sizeof(padding))) goto end; } else { int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_job error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_job error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } } @@ -273,13 +262,13 @@ test_aead(struct IMB_MGR *mb_mgr, if (job->status != IMB_STATUS_COMPLETED) { const int errcode = imb_get_errno(mb_mgr); - printf("Error!: job status %d, errno %d => %s\n", - job->status, errcode, imb_get_strerror(errcode)); + printf("Error!: job status %d, errno %d => %s\n", job->status, errcode, + imb_get_strerror(errcode)); goto end; } if (!aead_ok(vec, job->auth_tag_output_len_in_bytes, job->dst, dir, job->user_data, - padding, sizeof(padding))) + padding, sizeof(padding))) goto end; } @@ -295,7 +284,7 @@ test_aead(struct IMB_MGR *mb_mgr, */ /* create job array */ - IMB_JOB * jobs[32] = {NULL}; + IMB_JOB *jobs[32] = { NULL }; jobs_rx = 0; @@ -314,7 +303,7 @@ test_aead(struct IMB_MGR *mb_mgr, } } - while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < (uint32_t)num_jobs) + while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < (uint32_t) num_jobs) IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); /** @@ -335,11 +324,10 @@ test_aead(struct IMB_MGR *mb_mgr, if (in_place) job->src = targets[i] + sizeof(padding); + else if (dir == IMB_DIR_ENCRYPT) + job->src = (const void *) vec->msg; else - if (dir == IMB_DIR_ENCRYPT) - job->src = (const void *) vec->msg; - else - job->src = (const void *) vec->ct; + job->src = (const void *) vec->ct; job->dst = targets[i] + sizeof(padding); job->iv = (const void *) vec->iv; @@ -359,12 +347,11 @@ test_aead(struct IMB_MGR *mb_mgr, uint32_t completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, jobs); - if (completed_jobs != (uint32_t)num_jobs) { + if (completed_jobs != (uint32_t) num_jobs) { int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } else { printf("submit_burst error: not enough " @@ -377,27 +364,28 @@ test_aead(struct IMB_MGR *mb_mgr, job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %d status not complete!\n", i+1); + printf("job %d status not complete!\n", i + 1); goto end; } if (job->status != IMB_STATUS_COMPLETED) { const int errcode = imb_get_errno(mb_mgr); - printf("Error!: job status %d, errno %d => %s\n", - job->status, errcode, imb_get_strerror(errcode)); + printf("Error!: job status %d, errno %d => %s\n", job->status, errcode, + imb_get_strerror(errcode)); goto end; } if (!aead_ok(vec, job->auth_tag_output_len_in_bytes, job->dst, dir, job->user_data, - padding, sizeof(padding))) + padding, sizeof(padding))) goto end; jobs_rx++; } if (jobs_rx != num_jobs) { printf("Expected %d jobs after burst, " - "received %d\n", num_jobs, jobs_rx); + "received %d\n", + num_jobs, jobs_rx); goto end; } @@ -409,7 +397,7 @@ test_aead(struct IMB_MGR *mb_mgr, ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -427,7 +415,7 @@ test_aead(struct IMB_MGR *mb_mgr, } } - end2: +end2: if (auths != NULL) free(auths); @@ -438,14 +426,12 @@ test_aead(struct IMB_MGR *mb_mgr, } static void -test_aead_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const int num_jobs, +test_aead_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs, const struct aead_test *v) { if (!quiet_mode) - printf("AEAD Chacha20-Poly1305 vectors (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("AEAD Chacha20-Poly1305 vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("Vector %zu, M len: %zu\n", v->tcId, v->msgSize / 8); @@ -478,17 +464,14 @@ test_aead_vectors(struct IMB_MGR *mb_mgr, } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); - } static void -test_single_job_sgl(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const uint32_t buffer_sz, - const uint32_t seg_sz, +test_single_job_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, + const uint32_t buffer_sz, const uint32_t seg_sz, const IMB_CIPHER_DIRECTION cipher_dir) { struct IMB_JOB *job; @@ -536,8 +519,7 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, segments = malloc(num_segments * sizeof(*segments)); if (segments == NULL) { - fprintf(stderr, - "Could not allocate memory for segments array\n"); + fprintf(stderr, "Could not allocate memory for segments array\n"); test_suite_update(ctx, 0, 1); goto exit; } @@ -546,9 +528,7 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, for (i = 0; i < (num_segments - 1); i++) { segments[i] = malloc(seg_sz); if (segments[i] == NULL) { - fprintf(stderr, - "Could not allocate memory for segment %u\n", - i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -559,8 +539,7 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, } segments[i] = malloc(last_seg_sz); if (segments[i] == NULL) { - fprintf(stderr, "Could not allocate memory for segment %u\n", - i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -634,36 +613,29 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, if (job->status == IMB_STATUS_COMPLETED) { for (i = 0; i < (num_segments - 1); i++) { - if (memcmp(in_buffer + i*seg_sz, segments[i], - seg_sz) != 0) { + if (memcmp(in_buffer + i * seg_sz, segments[i], seg_sz) != 0) { printf("ciphertext mismatched " "in segment number %u " "(segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Linear output", - in_buffer + i*seg_sz, seg_sz); - hexdump(stderr, "SGL output", segments[i], - seg_sz); + hexdump(stderr, "Linear output", in_buffer + i * seg_sz, seg_sz); + hexdump(stderr, "SGL output", segments[i], seg_sz); test_suite_update(ctx, 0, 1); goto exit; } } /* Check last segment */ - if (memcmp(in_buffer + i*seg_sz, segments[i], - last_seg_sz) != 0) { + if (memcmp(in_buffer + i * seg_sz, segments[i], last_seg_sz) != 0) { printf("ciphertext mismatched " "in segment number %u (segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Linear output", - in_buffer + i*seg_sz, last_seg_sz); + hexdump(stderr, "Linear output", in_buffer + i * seg_sz, last_seg_sz); hexdump(stderr, "SGL output", segments[i], last_seg_sz); test_suite_update(ctx, 0, 1); } if (memcmp(sgl_digest, linear_digest, 16) != 0) { - printf("hash mismatched (segment size = %u)\n", - seg_sz); - hexdump(stderr, "Linear digest", - linear_digest, DIGEST_SZ); + printf("hash mismatched (segment size = %u)\n", seg_sz); + hexdump(stderr, "Linear digest", linear_digest, DIGEST_SZ); hexdump(stderr, "SGL digest", sgl_digest, DIGEST_SZ); test_suite_update(ctx, 0, 1); } else { @@ -686,12 +658,8 @@ exit: } static void -test_sgl(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const uint32_t buffer_sz, - const uint32_t seg_sz, - const IMB_CIPHER_DIRECTION cipher_dir, - const unsigned job_api, +test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t buffer_sz, + const uint32_t seg_sz, const IMB_CIPHER_DIRECTION cipher_dir, const unsigned job_api, const unsigned encrypt_on_update_only) { struct IMB_JOB *job; @@ -733,8 +701,7 @@ test_sgl(struct IMB_MGR *mb_mgr, segments = malloc(num_segments * sizeof(*segments)); if (segments == NULL) { - fprintf(stderr, - "Could not allocate memory for segments array\n"); + fprintf(stderr, "Could not allocate memory for segments array\n"); test_suite_update(ctx, 0, 1); goto exit; } @@ -742,8 +709,7 @@ test_sgl(struct IMB_MGR *mb_mgr, segment_sizes = malloc(num_segments * sizeof(*segment_sizes)); if (segment_sizes == NULL) { - fprintf(stderr, - "Could not allocate memory for array of sizes\n"); + fprintf(stderr, "Could not allocate memory for array of sizes\n"); test_suite_update(ctx, 0, 1); goto exit; } @@ -751,9 +717,7 @@ test_sgl(struct IMB_MGR *mb_mgr, for (i = 0; i < (num_segments - 1); i++) { segments[i] = malloc(seg_sz); if (segments[i] == NULL) { - fprintf(stderr, - "Could not allocate memory for segment %u\n", - i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -762,8 +726,7 @@ test_sgl(struct IMB_MGR *mb_mgr, } segments[i] = malloc(last_seg_sz); if (segments[i] == NULL) { - fprintf(stderr, "Could not allocate memory for segment %u\n", - i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -847,8 +810,7 @@ test_sgl(struct IMB_MGR *mb_mgr, job->sgl_state = IMB_SGL_INIT; job = IMB_SUBMIT_JOB(mb_mgr); } else { - IMB_CHACHA20_POLY1305_INIT(mb_mgr, key, &chacha_ctx, iv, - aad, AAD_SZ); + IMB_CHACHA20_POLY1305_INIT(mb_mgr, key, &chacha_ctx, iv, aad, AAD_SZ); i = 0; /* Start update from segment 0 */ segments_to_update = num_segments; } @@ -929,49 +891,38 @@ test_sgl(struct IMB_MGR *mb_mgr, job = IMB_SUBMIT_JOB(mb_mgr); } else { if (cipher_dir == IMB_DIR_ENCRYPT) - IMB_CHACHA20_POLY1305_ENC_FINALIZE(mb_mgr, - &chacha_ctx, - sgl_digest, + IMB_CHACHA20_POLY1305_ENC_FINALIZE(mb_mgr, &chacha_ctx, sgl_digest, DIGEST_SZ); else - IMB_CHACHA20_POLY1305_DEC_FINALIZE(mb_mgr, - &chacha_ctx, - sgl_digest, + IMB_CHACHA20_POLY1305_DEC_FINALIZE(mb_mgr, &chacha_ctx, sgl_digest, DIGEST_SZ); } if (job->status == IMB_STATUS_COMPLETED) { for (i = 0; i < (num_segments - 1); i++) { - if (memcmp(in_buffer + i*seg_sz, segments[i], - seg_sz) != 0) { + if (memcmp(in_buffer + i * seg_sz, segments[i], seg_sz) != 0) { printf("ciphertext mismatched " "in segment number %u " "(segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Linear output", - in_buffer + i*seg_sz, seg_sz); - hexdump(stderr, "SGL output", segments[i], - seg_sz); + hexdump(stderr, "Linear output", in_buffer + i * seg_sz, seg_sz); + hexdump(stderr, "SGL output", segments[i], seg_sz); test_suite_update(ctx, 0, 1); goto exit; } } /* Check last segment */ - if (memcmp(in_buffer + i*seg_sz, segments[i], - last_seg_sz) != 0) { + if (memcmp(in_buffer + i * seg_sz, segments[i], last_seg_sz) != 0) { printf("ciphertext mismatched " "in segment number %u (segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Linear output", - in_buffer + i*seg_sz, last_seg_sz); + hexdump(stderr, "Linear output", in_buffer + i * seg_sz, last_seg_sz); hexdump(stderr, "SGL output", segments[i], last_seg_sz); test_suite_update(ctx, 0, 1); } if (memcmp(sgl_digest, linear_digest, DIGEST_SZ) != 0) { - printf("hash mismatched (segment size = %u)\n", - seg_sz); - hexdump(stderr, "Linear digest", - linear_digest, DIGEST_SZ); + printf("hash mismatched (segment size = %u)\n", seg_sz); + hexdump(stderr, "Linear digest", linear_digest, DIGEST_SZ); hexdump(stderr, "SGL digest", sgl_digest, DIGEST_SZ); test_suite_update(ctx, 0, 1); } else { @@ -993,9 +944,9 @@ exit: free(segment_sizes); } -#define BUF_SZ 2032 +#define BUF_SZ 2032 #define SEG_SZ_STEP 4 -#define MAX_SEG_SZ 2048 +#define MAX_SEG_SZ 2048 int chacha20_poly1305_test(struct IMB_MGR *mb_mgr) { @@ -1022,5 +973,5 @@ chacha20_poly1305_test(struct IMB_MGR *mb_mgr) errors = test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/chacha20_poly1305_test.json.c b/test/kat-app/chacha20_poly1305_test.json.c index 4fc96530..5928407d 100644 --- a/test/kat-app/chacha20_poly1305_test.json.c +++ b/test/kat-app/chacha20_poly1305_test.json.c @@ -29,70 +29,67 @@ #include "aead_test.h" const struct aead_test chacha20_poly1305_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc7539 */ - {96, 256, 128, 1, - "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91" - "\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", - "\x07\x00\x00\x00\x40\x41\x42\x43\x44\x45\x46\x47", - "\x50\x51\x52\x53\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7", - "\x4c\x61\x64\x69\x65\x73\x20\x61\x6e\x64\x20\x47\x65\x6e\x74\x6c\x65\x6d" - "\x65\x6e\x20\x6f\x66\x20\x74\x68\x65\x20\x63\x6c\x61\x73\x73\x20\x6f\x66" - "\x20\x27\x39\x39\x3a\x20\x49\x66\x20\x49\x20\x63\x6f\x75\x6c\x64\x20\x6f" - "\x66\x66\x65\x72\x20\x79\x6f\x75\x20\x6f\x6e\x6c\x79\x20\x6f\x6e\x65\x20" - "\x74\x69\x70\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x66\x75\x74\x75\x72\x65" - "\x2c\x20\x73\x75\x6e\x73\x63\x72\x65\x65\x6e\x20\x77\x6f\x75\x6c\x64\x20" - "\x62\x65\x20\x69\x74\x2e", - "\xd3\x1a\x8d\x34\x64\x8e\x60\xdb\x7b\x86\xaf\xbc\x53\xef\x7e\xc2\xa4\xad" - "\xed\x51\x29\x6e\x08\xfe\xa9\xe2\xb5\xa7\x36\xee\x62\xd6\x3d\xbe\xa4\x5e" - "\x8c\xa9\x67\x12\x82\xfa\xfb\x69\xda\x92\x72\x8b\x1a\x71\xde\x0a\x9e\x06" - "\x0b\x29\x05\xd6\xa5\xb6\x7e\xcd\x3b\x36\x92\xdd\xbd\x7f\x2d\x77\x8b\x8c" - "\x98\x03\xae\xe3\x28\x09\x1b\x58\xfa\xb3\x24\xe4\xfa\xd6\x75\x94\x55\x85" - "\x80\x8b\x48\x31\xd7\xbc\x3f\xf4\xde\xf0\x8e\x4b\x7a\x9d\xe5\x76\xd2\x65" - "\x86\xce\xc6\x4b\x61\x16", - "\x1a\xe1\x0b\x59\x4f\x09\xe2\x6a\x7e\x90\x2e\xcb\xd0\x60\x06\x91", 1, 96, - 912}, - {96, 256, 128, 2, - "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a\xf3\x33\x88\x86\x04\xf6\xb5\xf0\x47\x39" - "\x17\xc1\x40\x2b\x80\x09\x9d\xca\x5c\xbc\x20\x70\x75\xc0", - "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08", - "\xf3\x33\x88\x86\x00\x00\x00\x00\x00\x00\x4e\x91", - "\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72\x61\x66\x74\x73\x20\x61\x72" - "\x65\x20\x64\x72\x61\x66\x74\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\x73\x20" - "\x76\x61\x6c\x69\x64\x20\x66\x6f\x72\x20\x61\x20\x6d\x61\x78\x69\x6d\x75" - "\x6d\x20\x6f\x66\x20\x73\x69\x78\x20\x6d\x6f\x6e\x74\x68\x73\x20\x61\x6e" - "\x64\x20\x6d\x61\x79\x20\x62\x65\x20\x75\x70\x64\x61\x74\x65\x64\x2c\x20" - "\x72\x65\x70\x6c\x61\x63\x65\x64\x2c\x20\x6f\x72\x20\x6f\x62\x73\x6f\x6c" - "\x65\x74\x65\x64\x20\x62\x79\x20\x6f\x74\x68\x65\x72\x20\x64\x6f\x63\x75" - "\x6d\x65\x6e\x74\x73\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65\x2e" - "\x20\x49\x74\x20\x69\x73\x20\x69\x6e\x61\x70\x70\x72\x6f\x70\x72\x69\x61" - "\x74\x65\x20\x74\x6f\x20\x75\x73\x65\x20\x49\x6e\x74\x65\x72\x6e\x65\x74" - "\x2d\x44\x72\x61\x66\x74\x73\x20\x61\x73\x20\x72\x65\x66\x65\x72\x65\x6e" - "\x63\x65\x20\x6d\x61\x74\x65\x72\x69\x61\x6c\x20\x6f\x72\x20\x74\x6f\x20" - "\x63\x69\x74\x65\x20\x74\x68\x65\x6d\x20\x6f\x74\x68\x65\x72\x20\x74\x68" - "\x61\x6e\x20\x61\x73\x20\x2f\xe2\x80\x9c\x77\x6f\x72\x6b\x20\x69\x6e\x20" - "\x70\x72\x6f\x67\x72\x65\x73\x73\x2e\x2f\xe2\x80\x9d", - "\x64\xa0\x86\x15\x75\x86\x1a\xf4\x60\xf0\x62\xc7\x9b\xe6\x43\xbd\x5e\x80" - "\x5c\xfd\x34\x5c\xf3\x89\xf1\x08\x67\x0a\xc7\x6c\x8c\xb2\x4c\x6c\xfc\x18" - "\x75\x5d\x43\xee\xa0\x9e\xe9\x4e\x38\x2d\x26\xb0\xbd\xb7\xb7\x3c\x32\x1b" - "\x01\x00\xd4\xf0\x3b\x7f\x35\x58\x94\xcf\x33\x2f\x83\x0e\x71\x0b\x97\xce" - "\x98\xc8\xa8\x4a\xbd\x0b\x94\x81\x14\xad\x17\x6e\x00\x8d\x33\xbd\x60\xf9" - "\x82\xb1\xff\x37\xc8\x55\x97\x97\xa0\x6e\xf4\xf0\xef\x61\xc1\x86\x32\x4e" - "\x2b\x35\x06\x38\x36\x06\x90\x7b\x6a\x7c\x02\xb0\xf9\xf6\x15\x7b\x53\xc8" - "\x67\xe4\xb9\x16\x6c\x76\x7b\x80\x4d\x46\xa5\x9b\x52\x16\xcd\xe7\xa4\xe9" - "\x90\x40\xc5\xa4\x04\x33\x22\x5e\xe2\x82\xa1\xb0\xa0\x6c\x52\x3e\xaf\x45" - "\x34\xd7\xf8\x3f\xa1\x15\x5b\x00\x47\x71\x8c\xbc\x54\x6a\x0d\x07\x2b\x04" - "\xb3\x56\x4e\xea\x1b\x42\x22\x73\xf5\x48\x27\x1a\x0b\xb2\x31\x60\x53\xfa" - "\x76\x99\x19\x55\xeb\xd6\x31\x59\x43\x4e\xce\xbb\x4e\x46\x6d\xae\x5a\x10" - "\x73\xa6\x72\x76\x27\x09\x7a\x10\x49\xe6\x17\xd9\x1d\x36\x10\x94\xfa\x68" - "\xf0\xff\x77\x98\x71\x30\x30\x5b\xea\xba\x2e\xda\x04\xdf\x99\x7b\x71\x4d" - "\x6c\x6f\x2c\x29\xa6\xad\x5c\xb4\x02\x2b\x02\x70\x9b", - "\xee\xad\x9d\x67\x89\x0c\xbb\x22\x39\x23\x36\xfe\xa1\x85\x1f\x38", 1, 96, - 2120}, - {96, 256, 128, 3, - "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x60\x61" - "\x62\x63\x64\x65\x66\x67\x68\x66\x6a\x6b\x6c\x6d\x6e\x6f", - "\x01\x02\x04\x08\x0b\x0d\x0f\x10\x10\x11\x12\x13", - "\x00\x02\x04\x06\x08\x0a\x0c\x0e\x10\x12\x14\x16", "", "", - "\x32\x08\x45\xb8\x85\xdd\xb5\x81\x74\x36\xe3\x11\x3f\x51\x6d\xbf", 1, 96, - 0}, - {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} + { 96, 256, 128, 1, + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91" + "\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", + "\x07\x00\x00\x00\x40\x41\x42\x43\x44\x45\x46\x47", + "\x50\x51\x52\x53\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7", + "\x4c\x61\x64\x69\x65\x73\x20\x61\x6e\x64\x20\x47\x65\x6e\x74\x6c\x65\x6d" + "\x65\x6e\x20\x6f\x66\x20\x74\x68\x65\x20\x63\x6c\x61\x73\x73\x20\x6f\x66" + "\x20\x27\x39\x39\x3a\x20\x49\x66\x20\x49\x20\x63\x6f\x75\x6c\x64\x20\x6f" + "\x66\x66\x65\x72\x20\x79\x6f\x75\x20\x6f\x6e\x6c\x79\x20\x6f\x6e\x65\x20" + "\x74\x69\x70\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x66\x75\x74\x75\x72\x65" + "\x2c\x20\x73\x75\x6e\x73\x63\x72\x65\x65\x6e\x20\x77\x6f\x75\x6c\x64\x20" + "\x62\x65\x20\x69\x74\x2e", + "\xd3\x1a\x8d\x34\x64\x8e\x60\xdb\x7b\x86\xaf\xbc\x53\xef\x7e\xc2\xa4\xad" + "\xed\x51\x29\x6e\x08\xfe\xa9\xe2\xb5\xa7\x36\xee\x62\xd6\x3d\xbe\xa4\x5e" + "\x8c\xa9\x67\x12\x82\xfa\xfb\x69\xda\x92\x72\x8b\x1a\x71\xde\x0a\x9e\x06" + "\x0b\x29\x05\xd6\xa5\xb6\x7e\xcd\x3b\x36\x92\xdd\xbd\x7f\x2d\x77\x8b\x8c" + "\x98\x03\xae\xe3\x28\x09\x1b\x58\xfa\xb3\x24\xe4\xfa\xd6\x75\x94\x55\x85" + "\x80\x8b\x48\x31\xd7\xbc\x3f\xf4\xde\xf0\x8e\x4b\x7a\x9d\xe5\x76\xd2\x65" + "\x86\xce\xc6\x4b\x61\x16", + "\x1a\xe1\x0b\x59\x4f\x09\xe2\x6a\x7e\x90\x2e\xcb\xd0\x60\x06\x91", 1, 96, 912 }, + { 96, 256, 128, 2, + "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a\xf3\x33\x88\x86\x04\xf6\xb5\xf0\x47\x39" + "\x17\xc1\x40\x2b\x80\x09\x9d\xca\x5c\xbc\x20\x70\x75\xc0", + "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08", + "\xf3\x33\x88\x86\x00\x00\x00\x00\x00\x00\x4e\x91", + "\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72\x61\x66\x74\x73\x20\x61\x72" + "\x65\x20\x64\x72\x61\x66\x74\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\x73\x20" + "\x76\x61\x6c\x69\x64\x20\x66\x6f\x72\x20\x61\x20\x6d\x61\x78\x69\x6d\x75" + "\x6d\x20\x6f\x66\x20\x73\x69\x78\x20\x6d\x6f\x6e\x74\x68\x73\x20\x61\x6e" + "\x64\x20\x6d\x61\x79\x20\x62\x65\x20\x75\x70\x64\x61\x74\x65\x64\x2c\x20" + "\x72\x65\x70\x6c\x61\x63\x65\x64\x2c\x20\x6f\x72\x20\x6f\x62\x73\x6f\x6c" + "\x65\x74\x65\x64\x20\x62\x79\x20\x6f\x74\x68\x65\x72\x20\x64\x6f\x63\x75" + "\x6d\x65\x6e\x74\x73\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65\x2e" + "\x20\x49\x74\x20\x69\x73\x20\x69\x6e\x61\x70\x70\x72\x6f\x70\x72\x69\x61" + "\x74\x65\x20\x74\x6f\x20\x75\x73\x65\x20\x49\x6e\x74\x65\x72\x6e\x65\x74" + "\x2d\x44\x72\x61\x66\x74\x73\x20\x61\x73\x20\x72\x65\x66\x65\x72\x65\x6e" + "\x63\x65\x20\x6d\x61\x74\x65\x72\x69\x61\x6c\x20\x6f\x72\x20\x74\x6f\x20" + "\x63\x69\x74\x65\x20\x74\x68\x65\x6d\x20\x6f\x74\x68\x65\x72\x20\x74\x68" + "\x61\x6e\x20\x61\x73\x20\x2f\xe2\x80\x9c\x77\x6f\x72\x6b\x20\x69\x6e\x20" + "\x70\x72\x6f\x67\x72\x65\x73\x73\x2e\x2f\xe2\x80\x9d", + "\x64\xa0\x86\x15\x75\x86\x1a\xf4\x60\xf0\x62\xc7\x9b\xe6\x43\xbd\x5e\x80" + "\x5c\xfd\x34\x5c\xf3\x89\xf1\x08\x67\x0a\xc7\x6c\x8c\xb2\x4c\x6c\xfc\x18" + "\x75\x5d\x43\xee\xa0\x9e\xe9\x4e\x38\x2d\x26\xb0\xbd\xb7\xb7\x3c\x32\x1b" + "\x01\x00\xd4\xf0\x3b\x7f\x35\x58\x94\xcf\x33\x2f\x83\x0e\x71\x0b\x97\xce" + "\x98\xc8\xa8\x4a\xbd\x0b\x94\x81\x14\xad\x17\x6e\x00\x8d\x33\xbd\x60\xf9" + "\x82\xb1\xff\x37\xc8\x55\x97\x97\xa0\x6e\xf4\xf0\xef\x61\xc1\x86\x32\x4e" + "\x2b\x35\x06\x38\x36\x06\x90\x7b\x6a\x7c\x02\xb0\xf9\xf6\x15\x7b\x53\xc8" + "\x67\xe4\xb9\x16\x6c\x76\x7b\x80\x4d\x46\xa5\x9b\x52\x16\xcd\xe7\xa4\xe9" + "\x90\x40\xc5\xa4\x04\x33\x22\x5e\xe2\x82\xa1\xb0\xa0\x6c\x52\x3e\xaf\x45" + "\x34\xd7\xf8\x3f\xa1\x15\x5b\x00\x47\x71\x8c\xbc\x54\x6a\x0d\x07\x2b\x04" + "\xb3\x56\x4e\xea\x1b\x42\x22\x73\xf5\x48\x27\x1a\x0b\xb2\x31\x60\x53\xfa" + "\x76\x99\x19\x55\xeb\xd6\x31\x59\x43\x4e\xce\xbb\x4e\x46\x6d\xae\x5a\x10" + "\x73\xa6\x72\x76\x27\x09\x7a\x10\x49\xe6\x17\xd9\x1d\x36\x10\x94\xfa\x68" + "\xf0\xff\x77\x98\x71\x30\x30\x5b\xea\xba\x2e\xda\x04\xdf\x99\x7b\x71\x4d" + "\x6c\x6f\x2c\x29\xa6\xad\x5c\xb4\x02\x2b\x02\x70\x9b", + "\xee\xad\x9d\x67\x89\x0c\xbb\x22\x39\x23\x36\xfe\xa1\x85\x1f\x38", 1, 96, 2120 }, + { 96, 256, 128, 3, + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x60\x61" + "\x62\x63\x64\x65\x66\x67\x68\x66\x6a\x6b\x6c\x6d\x6e\x6f", + "\x01\x02\x04\x08\x0b\x0d\x0f\x10\x10\x11\x12\x13", + "\x00\x02\x04\x06\x08\x0a\x0c\x0e\x10\x12\x14\x16", "", "", + "\x32\x08\x45\xb8\x85\xdd\xb5\x81\x74\x36\xe3\x11\x3f\x51\x6d\xbf", 1, 96, 0 }, + { 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; diff --git a/test/kat-app/chacha_test.c b/test/kat-app/chacha_test.c index c7d384cc..5bc54346 100644 --- a/test/kat-app/chacha_test.c +++ b/test/kat-app/chacha_test.c @@ -36,27 +36,22 @@ #include "utils.h" #include "cipher_test.h" -int chacha_test(struct IMB_MGR *mb_mgr); +int +chacha_test(struct IMB_MGR *mb_mgr); extern const struct cipher_test chacha_test_json[]; static int -chacha_job_ok(const struct IMB_JOB *job, - const uint8_t *out_text, - const uint8_t *target, - const uint8_t *padding, - const size_t sizeof_padding, - const unsigned text_len) +chacha_job_ok(const struct IMB_JOB *job, const uint8_t *out_text, const uint8_t *target, + const uint8_t *padding, const size_t sizeof_padding, const unsigned text_len) { - const int num = (const int)((uint64_t)job->user_data2); + const int num = (const int) ((uint64_t) job->user_data2); if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %d", - __LINE__, job->status, num); + printf("%d error status:%d, job %d", __LINE__, job->status, num); return 0; } - if (memcmp(out_text, target + sizeof_padding, - text_len)) { + if (memcmp(out_text, target + sizeof_padding, text_len)) { printf("%d mismatched\n", num); return 0; } @@ -64,9 +59,7 @@ chacha_job_ok(const struct IMB_JOB *job, printf("%d overwrite head\n", num); return 0; } - if (memcmp(padding, - target + sizeof_padding + text_len, - sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { printf("%d overwrite tail\n", num); return 0; } @@ -74,19 +67,10 @@ chacha_job_ok(const struct IMB_JOB *job, } static int -test_chacha_many(struct IMB_MGR *mb_mgr, - const void *enc_keys, - const void *dec_keys, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const unsigned text_len, - const int dir, - const int order, - const IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) +test_chacha_many(struct IMB_MGR *mb_mgr, const void *enc_keys, const void *dec_keys, const void *iv, + const uint8_t *in_text, const uint8_t *out_text, const unsigned text_len, + const int dir, const int order, const IMB_CIPHER_MODE cipher, const int in_place, + const int key_len, const int num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -135,23 +119,23 @@ test_chacha_many(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); job->hash_alg = IMB_AUTH_NULL; job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { jobs_rx++; - if (!chacha_job_ok(job, out_text, job->user_data, - padding, sizeof(padding), text_len)) + if (!chacha_job_ok(job, out_text, job->user_data, padding, sizeof(padding), + text_len)) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!chacha_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!chacha_job_ok(job, out_text, job->user_data, padding, sizeof(padding), + text_len)) goto end; } @@ -161,7 +145,7 @@ test_chacha_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -176,19 +160,17 @@ end_alloc: } static void -test_chacha_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, +test_chacha_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const IMB_CIPHER_MODE cipher, const int num_jobs) { const struct cipher_test *v = chacha_test_json; if (!quiet_mode) - printf("CHACHA20 standard test vectors (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("CHACHA20 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("%zu Standard vector key_len:%zu\n", - v->tcId, v->keySize / 8); + printf("%zu Standard vector key_len:%zu\n", v->tcId, v->keySize / 8); #else printf("."); #endif @@ -196,8 +178,8 @@ test_chacha_vectors(struct IMB_MGR *mb_mgr, if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->msg, (const void *) v->ct, (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 0, IMB_KEY_256_BYTES, num_jobs)) { + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0, + IMB_KEY_256_BYTES, num_jobs)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -206,8 +188,8 @@ test_chacha_vectors(struct IMB_MGR *mb_mgr, if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->ct, (const void *) v->msg, (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 0, IMB_KEY_256_BYTES, num_jobs)) { + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0, + IMB_KEY_256_BYTES, num_jobs)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -216,8 +198,8 @@ test_chacha_vectors(struct IMB_MGR *mb_mgr, if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->msg, (const void *) v->ct, (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - cipher, 1, IMB_KEY_256_BYTES, num_jobs)) { + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1, + IMB_KEY_256_BYTES, num_jobs)) { printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -226,14 +208,14 @@ test_chacha_vectors(struct IMB_MGR *mb_mgr, if (test_chacha_many(mb_mgr, v->key, v->key, v->iv, (const void *) v->ct, (const void *) v->msg, (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - cipher, 1, IMB_KEY_256_BYTES, num_jobs)) { + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1, + IMB_KEY_256_BYTES, num_jobs)) { printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } @@ -241,9 +223,7 @@ test_chacha_vectors(struct IMB_MGR *mb_mgr, int chacha_test(struct IMB_MGR *mb_mgr) { - const int num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 - }; + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 }; unsigned i; int errors = 0; struct test_suite_context ctx; @@ -253,5 +233,5 @@ chacha_test(struct IMB_MGR *mb_mgr) test_chacha_vectors(mb_mgr, &ctx, IMB_CIPHER_CHACHA20, num_jobs_tab[i]); errors = test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/chacha_test.json.c b/test/kat-app/chacha_test.json.c index 06e7d32d..6f41f780 100644 --- a/test/kat-app/chacha_test.json.c +++ b/test/kat-app/chacha_test.json.c @@ -28,71 +28,71 @@ /* CHACHA20 */ #include "cipher_test.h" const struct cipher_test chacha_test_json[] = { - {96, 256, 1, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", - "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" - "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" - "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" - "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" - "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" - "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" - "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" - "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" - "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" - "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" - "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" - "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" - "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" - "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" - "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" - "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" - "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" - "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" - "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" - "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", - "\xa3\xfb\xf0\x7d\xf3\xfa\x2f\xde\x4f\x37\x6c\xa2\x3e\x82\x73\x70\x41\x60" - "\x5d\x9f\x4f\x4f\x57\xbd\x8c\xff\x2c\x1d\x4b\x79\x55\xec\x2a\x97\x94\x8b" - "\xd3\x72\x29\x15\xc8\xf3\xd3\x37\xf7\xd3\x70\x05\x0e\x9e\x96\xd6\x47\xb7" - "\xc3\x9f\x56\xe0\x31\xca\x5e\xb6\x25\x0d\x40\x42\xe0\x27\x85\xec\xec\xfa" - "\x4b\x4b\xb5\xe8\xea\xd0\x44\x0e\x20\xb6\xe8\xdb\x09\xd8\x81\xa7\xc6\x13" - "\x2f\x42\x0e\x52\x79\x50\x42\xbd\xfa\x77\x73\xd8\xa9\x05\x14\x47\xb3\x29" - "\x1c\xe1\x41\x1c\x68\x04\x65\x55\x2a\xa6\xc4\x05\xb7\x76\x4d\x5e\x87\xbe" - "\xa8\x5a\xd0\x0f\x84\x49\xed\x8f\x72\xd0\xd6\x62\xab\x05\x26\x91\xca\x66" - "\x42\x4b\xc8\x6d\x2d\xf8\x0e\xa4\x1f\x43\xab\xf9\x37\xd3\x25\x9d\xc4\xb2" - "\xd0\xdf\xb4\x8a\x6c\x91\x39\xdd\xd7\xf7\x69\x66\xe9\x28\xe6\x35\x55\x3b" - "\xa7\x6c\x5c\x87\x9d\x7b\x35\xd4\x9e\xb2\xe6\x2b\x08\x71\xcd\xac\x63\x89" - "\x39\xe2\x5e\x8a\x1e\x0e\xf9\xd5\x28\x0f\xa8\xca\x32\x8b\x35\x1c\x3c\x76" - "\x59\x89\xcb\xcf\x3d\xaa\x8b\x6c\xcc\x3a\xaf\x9f\x39\x79\xc9\x2b\x37\x20" - "\xfc\x88\xdc\x95\xed\x84\xa1\xbe\x05\x9c\x64\x99\xb9\xfd\xa2\x36\xe7\xe8" - "\x18\xb0\x4b\x0b\xc3\x9c\x1e\x87\x6b\x19\x3b\xfe\x55\x69\x75\x3f\x88\x12" - "\x8c\xc0\x8a\xaa\x9b\x63\xd1\xa1\x6f\x80\xef\x25\x54\xd7\x18\x9c\x41\x1f" - "\x58\x69\xca\x52\xc5\xb8\x3f\xa3\x6f\xf2\x16\xb9\xc1\xd3\x00\x62\xbe\xbc" - "\xfd\x2d\xc5\xbc\xe0\x91\x19\x34\xfd\xa7\x9a\x86\xf6\xe6\x98\xce\xd7\x59" - "\xc3\xff\x9b\x64\x77\x33\x8f\x3d\xa4\xf9\xcd\x85\x14\xea\x99\x82\xcc\xaf" - "\xb3\x41\xb2\x38\x4d\xd9\x02\xf3\xd1\xab\x7a\xc6\x1d\xd2\x9c\x6f\x21\xba" - "\x5b\x86\x2f\x37\x30\xe3\x7c\xfd\xc4\xfd\x80\x6c\x22\xf2\x21", - 1, 3000}, - {96, 256, 2, - "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91" - "\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", - "\x07\x00\x00\x00\x40\x41\x42\x43\x44\x45\x46\x47", - "\x4c\x61\x64\x69\x65\x73\x20\x61\x6e\x64\x20\x47\x65\x6e\x74\x6c\x65\x6d" - "\x65\x6e\x20\x6f\x66\x20\x74\x68\x65\x20\x63\x6c\x61\x73\x73\x20\x6f\x66" - "\x20\x27\x39\x39\x3a\x20\x49\x66\x20\x49\x20\x63\x6f\x75\x6c\x64\x20\x6f" - "\x66\x66\x65\x72\x20\x79\x6f\x75\x20\x6f\x6e\x6c\x79\x20\x6f\x6e\x65\x20" - "\x74\x69\x70\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x66\x75\x74\x75\x72\x65" - "\x2c\x20\x73\x75\x6e\x73\x63\x72\x65\x65\x6e\x20\x77\x6f\x75\x6c\x64\x20" - "\x62\x65\x20\x69\x74\x2e", - "\xd3\x1a\x8d\x34\x64\x8e\x60\xdb\x7b\x86\xaf\xbc\x53\xef\x7e\xc2\xa4\xad" - "\xed\x51\x29\x6e\x08\xfe\xa9\xe2\xb5\xa7\x36\xee\x62\xd6\x3d\xbe\xa4\x5e" - "\x8c\xa9\x67\x12\x82\xfa\xfb\x69\xda\x92\x72\x8b\x1a\x71\xde\x0a\x9e\x06" - "\x0b\x29\x05\xd6\xa5\xb6\x7e\xcd\x3b\x36\x92\xdd\xbd\x7f\x2d\x77\x8b\x8c" - "\x98\x03\xae\xe3\x28\x09\x1b\x58\xfa\xb3\x24\xe4\xfa\xd6\x75\x94\x55\x85" - "\x80\x8b\x48\x31\xd7\xbc\x3f\xf4\xde\xf0\x8e\x4b\x7a\x9d\xe5\x76\xd2\x65" - "\x86\xce\xc6\x4b\x61\x16", - 1, 912}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 96, 256, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", + "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" + "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" + "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" + "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" + "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" + "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" + "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" + "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" + "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" + "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" + "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" + "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" + "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" + "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" + "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" + "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" + "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" + "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" + "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" + "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" + "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", + "\xa3\xfb\xf0\x7d\xf3\xfa\x2f\xde\x4f\x37\x6c\xa2\x3e\x82\x73\x70\x41\x60" + "\x5d\x9f\x4f\x4f\x57\xbd\x8c\xff\x2c\x1d\x4b\x79\x55\xec\x2a\x97\x94\x8b" + "\xd3\x72\x29\x15\xc8\xf3\xd3\x37\xf7\xd3\x70\x05\x0e\x9e\x96\xd6\x47\xb7" + "\xc3\x9f\x56\xe0\x31\xca\x5e\xb6\x25\x0d\x40\x42\xe0\x27\x85\xec\xec\xfa" + "\x4b\x4b\xb5\xe8\xea\xd0\x44\x0e\x20\xb6\xe8\xdb\x09\xd8\x81\xa7\xc6\x13" + "\x2f\x42\x0e\x52\x79\x50\x42\xbd\xfa\x77\x73\xd8\xa9\x05\x14\x47\xb3\x29" + "\x1c\xe1\x41\x1c\x68\x04\x65\x55\x2a\xa6\xc4\x05\xb7\x76\x4d\x5e\x87\xbe" + "\xa8\x5a\xd0\x0f\x84\x49\xed\x8f\x72\xd0\xd6\x62\xab\x05\x26\x91\xca\x66" + "\x42\x4b\xc8\x6d\x2d\xf8\x0e\xa4\x1f\x43\xab\xf9\x37\xd3\x25\x9d\xc4\xb2" + "\xd0\xdf\xb4\x8a\x6c\x91\x39\xdd\xd7\xf7\x69\x66\xe9\x28\xe6\x35\x55\x3b" + "\xa7\x6c\x5c\x87\x9d\x7b\x35\xd4\x9e\xb2\xe6\x2b\x08\x71\xcd\xac\x63\x89" + "\x39\xe2\x5e\x8a\x1e\x0e\xf9\xd5\x28\x0f\xa8\xca\x32\x8b\x35\x1c\x3c\x76" + "\x59\x89\xcb\xcf\x3d\xaa\x8b\x6c\xcc\x3a\xaf\x9f\x39\x79\xc9\x2b\x37\x20" + "\xfc\x88\xdc\x95\xed\x84\xa1\xbe\x05\x9c\x64\x99\xb9\xfd\xa2\x36\xe7\xe8" + "\x18\xb0\x4b\x0b\xc3\x9c\x1e\x87\x6b\x19\x3b\xfe\x55\x69\x75\x3f\x88\x12" + "\x8c\xc0\x8a\xaa\x9b\x63\xd1\xa1\x6f\x80\xef\x25\x54\xd7\x18\x9c\x41\x1f" + "\x58\x69\xca\x52\xc5\xb8\x3f\xa3\x6f\xf2\x16\xb9\xc1\xd3\x00\x62\xbe\xbc" + "\xfd\x2d\xc5\xbc\xe0\x91\x19\x34\xfd\xa7\x9a\x86\xf6\xe6\x98\xce\xd7\x59" + "\xc3\xff\x9b\x64\x77\x33\x8f\x3d\xa4\xf9\xcd\x85\x14\xea\x99\x82\xcc\xaf" + "\xb3\x41\xb2\x38\x4d\xd9\x02\xf3\xd1\xab\x7a\xc6\x1d\xd2\x9c\x6f\x21\xba" + "\x5b\x86\x2f\x37\x30\xe3\x7c\xfd\xc4\xfd\x80\x6c\x22\xf2\x21", + 1, 3000 }, + { 96, 256, 2, + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91" + "\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", + "\x07\x00\x00\x00\x40\x41\x42\x43\x44\x45\x46\x47", + "\x4c\x61\x64\x69\x65\x73\x20\x61\x6e\x64\x20\x47\x65\x6e\x74\x6c\x65\x6d" + "\x65\x6e\x20\x6f\x66\x20\x74\x68\x65\x20\x63\x6c\x61\x73\x73\x20\x6f\x66" + "\x20\x27\x39\x39\x3a\x20\x49\x66\x20\x49\x20\x63\x6f\x75\x6c\x64\x20\x6f" + "\x66\x66\x65\x72\x20\x79\x6f\x75\x20\x6f\x6e\x6c\x79\x20\x6f\x6e\x65\x20" + "\x74\x69\x70\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x66\x75\x74\x75\x72\x65" + "\x2c\x20\x73\x75\x6e\x73\x63\x72\x65\x65\x6e\x20\x77\x6f\x75\x6c\x64\x20" + "\x62\x65\x20\x69\x74\x2e", + "\xd3\x1a\x8d\x34\x64\x8e\x60\xdb\x7b\x86\xaf\xbc\x53\xef\x7e\xc2\xa4\xad" + "\xed\x51\x29\x6e\x08\xfe\xa9\xe2\xb5\xa7\x36\xee\x62\xd6\x3d\xbe\xa4\x5e" + "\x8c\xa9\x67\x12\x82\xfa\xfb\x69\xda\x92\x72\x8b\x1a\x71\xde\x0a\x9e\x06" + "\x0b\x29\x05\xd6\xa5\xb6\x7e\xcd\x3b\x36\x92\xdd\xbd\x7f\x2d\x77\x8b\x8c" + "\x98\x03\xae\xe3\x28\x09\x1b\x58\xfa\xb3\x24\xe4\xfa\xd6\x75\x94\x55\x85" + "\x80\x8b\x48\x31\xd7\xbc\x3f\xf4\xde\xf0\x8e\x4b\x7a\x9d\xe5\x76\xd2\x65" + "\x86\xce\xc6\x4b\x61\x16", + 1, 912 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/chained_test.c b/test/kat-app/chained_test.c index 7ac6375d..79a1ec5b 100644 --- a/test/kat-app/chained_test.c +++ b/test/kat-app/chained_test.c @@ -36,20 +36,21 @@ #include "gcm_ctr_vectors_test.h" #include "utils.h" -int chained_test(struct IMB_MGR *mb_mgr); +int +chained_test(struct IMB_MGR *mb_mgr); struct chained_vector { - const uint8_t *cipher_key; /* cipher key */ - uint32_t cipher_key_len; /* cipher key length */ - const uint8_t *IV; /* initialization vector */ - const uint8_t *PT; /* plaintext */ - uint64_t PTlen; /* plaintext length */ - const uint8_t *CT; /* ciphertext - same length as PT */ - const uint8_t *hash_key; /* hash key */ - uint32_t hash_key_len; /* hash key length */ - const uint8_t *Digest_PT; /* digest for plaintext */ - const uint8_t *Digest_CT; /* digest for ciphertext */ - uint32_t Digest_len; /* digest length */ + const uint8_t *cipher_key; /* cipher key */ + uint32_t cipher_key_len; /* cipher key length */ + const uint8_t *IV; /* initialization vector */ + const uint8_t *PT; /* plaintext */ + uint64_t PTlen; /* plaintext length */ + const uint8_t *CT; /* ciphertext - same length as PT */ + const uint8_t *hash_key; /* hash key */ + uint32_t hash_key_len; /* hash key length */ + const uint8_t *Digest_PT; /* digest for plaintext */ + const uint8_t *Digest_CT; /* digest for ciphertext */ + uint32_t Digest_len; /* digest length */ }; const struct test_set { @@ -57,105 +58,60 @@ const struct test_set { IMB_CHAIN_ORDER order; const char *set_name; } test_sets[] = { - { - .dir = IMB_DIR_ENCRYPT, - .order = IMB_ORDER_CIPHER_HASH, - .set_name = "encrypt-hash" - }, - { - .dir = IMB_DIR_DECRYPT, - .order = IMB_ORDER_CIPHER_HASH, - .set_name = "decrypt-hash" - }, - { - .dir = IMB_DIR_ENCRYPT, - .order = IMB_ORDER_HASH_CIPHER, - .set_name = "hash-encrypt" - }, - { - .dir = IMB_DIR_DECRYPT, - .order = IMB_ORDER_HASH_CIPHER, - .set_name = "hash-decrypt" - }, + { .dir = IMB_DIR_ENCRYPT, .order = IMB_ORDER_CIPHER_HASH, .set_name = "encrypt-hash" }, + { .dir = IMB_DIR_DECRYPT, .order = IMB_ORDER_CIPHER_HASH, .set_name = "decrypt-hash" }, + { .dir = IMB_DIR_ENCRYPT, .order = IMB_ORDER_HASH_CIPHER, .set_name = "hash-encrypt" }, + { .dir = IMB_DIR_DECRYPT, .order = IMB_ORDER_HASH_CIPHER, .set_name = "hash-decrypt" }, }; -const char *place_str[] = {"out-of-place", "in-place"}; +const char *place_str[] = { "out-of-place", "in-place" }; /* AES-CBC + SHA1-HMAC test vectors */ /* 128-bit */ -static const uint8_t K1[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t IV1[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; -static const uint8_t P1[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; -static const uint8_t C1[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, - 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, - 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, - 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, - 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, - 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 -}; -static const uint8_t DP1[] = { - 0x6F, 0xA4, 0x7D, 0x1B, 0x8E, 0xAB, 0x1D, 0xB9, - 0x8B, 0x62, 0xC9, 0xF2, 0xDF, 0xA2, 0xCC, 0x46, - 0x37, 0xB8, 0xD7, 0xB1 -}; -static const uint8_t DC1[] = { - 0xDF, 0x1E, 0x5A, 0xDB, 0xE7, 0x5A, 0xAB, 0xAE, - 0x0B, 0x98, 0x34, 0x30, 0xE8, 0x40, 0x8B, 0xB4, - 0xDB, 0x22, 0x3A, 0x89 -}; +static const uint8_t K1[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; +static const uint8_t IV1[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; +static const uint8_t P1[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, + 0x11, 0x73, 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, + 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, + 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, + 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, + 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; +static const uint8_t C1[] = { 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, + 0x9b, 0x12, 0xe9, 0x19, 0x7d, 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, + 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, 0x73, + 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, 0x71, 0x16, 0xe6, 0x9e, + 0x22, 0x22, 0x95, 0x16, 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, + 0x09, 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 }; +static const uint8_t DP1[] = { 0x6F, 0xA4, 0x7D, 0x1B, 0x8E, 0xAB, 0x1D, 0xB9, 0x8B, 0x62, + 0xC9, 0xF2, 0xDF, 0xA2, 0xCC, 0x46, 0x37, 0xB8, 0xD7, 0xB1 }; +static const uint8_t DC1[] = { 0xDF, 0x1E, 0x5A, 0xDB, 0xE7, 0x5A, 0xAB, 0xAE, 0x0B, 0x98, + 0x34, 0x30, 0xE8, 0x40, 0x8B, 0xB4, 0xDB, 0x22, 0x3A, 0x89 }; /* Same key for cipher and hash */ static const struct chained_vector chained_vectors[] = { - {K1, sizeof(K1), IV1, P1, sizeof(P1), C1, - K1, sizeof(K1), DP1, DC1, sizeof(DP1)}, + { K1, sizeof(K1), IV1, P1, sizeof(P1), C1, K1, sizeof(K1), DP1, DC1, sizeof(DP1) }, }; static int -chained_job_ok(const IMB_JOB *job, - const unsigned num_vec, - const uint8_t *expected_text, - const unsigned text_len, - const uint8_t *received_text, - const uint8_t *expected_digest, - const unsigned digest_len, - const uint8_t *received_digest, - const uint8_t *padding, - const size_t sizeof_padding) +chained_job_ok(const IMB_JOB *job, const unsigned num_vec, const uint8_t *expected_text, + const unsigned text_len, const uint8_t *received_text, + const uint8_t *expected_digest, const unsigned digest_len, + const uint8_t *received_digest, const uint8_t *padding, const size_t sizeof_padding) { if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, num_vec); + printf("%d error status:%d, job %u", __LINE__, job->status, num_vec); return 0; } /* cipher checks */ - if (memcmp(expected_text, received_text + sizeof_padding, - text_len)) { + if (memcmp(expected_text, received_text + sizeof_padding, text_len)) { printf("cipher %u mismatched\n", num_vec); - hexdump(stderr, "Received", received_text + sizeof_padding, - text_len); - hexdump(stderr, "Expected", expected_text, - text_len); + hexdump(stderr, "Received", received_text + sizeof_padding, text_len); + hexdump(stderr, "Expected", expected_text, text_len); return 0; } @@ -165,24 +121,18 @@ chained_job_ok(const IMB_JOB *job, return 0; } - if (memcmp(padding, - received_text + sizeof_padding + text_len, - sizeof_padding)) { + if (memcmp(padding, received_text + sizeof_padding + text_len, sizeof_padding)) { printf("cipher %u overwrite tail\n", num_vec); - hexdump(stderr, "Target", - received_text + sizeof_padding + text_len, + hexdump(stderr, "Target", received_text + sizeof_padding + text_len, sizeof_padding); return 0; } /* hash checks */ - if (memcmp(expected_digest, received_digest + sizeof_padding, - digest_len)) { + if (memcmp(expected_digest, received_digest + sizeof_padding, digest_len)) { printf("hash %u mismatched\n", num_vec); - hexdump(stderr, "Received", received_digest + sizeof_padding, - digest_len); - hexdump(stderr, "Expected", expected_digest, - digest_len); + hexdump(stderr, "Received", received_digest + sizeof_padding, digest_len); + hexdump(stderr, "Expected", expected_digest, digest_len); return 0; } @@ -192,32 +142,21 @@ chained_job_ok(const IMB_JOB *job, return 0; } - if (memcmp(padding, received_digest + sizeof_padding + digest_len, - sizeof_padding)) { + if (memcmp(padding, received_digest + sizeof_padding + digest_len, sizeof_padding)) { printf("hash %u overwrite tail\n", num_vec); - hexdump(stderr, "Target", - received_digest + sizeof_padding + digest_len, + hexdump(stderr, "Target", received_digest + sizeof_padding + digest_len, sizeof_padding); return 0; } - return 1; } static int -test_chained_many(struct IMB_MGR *mb_mgr, - const void *enc_keys, - const void *dec_keys, - const struct chained_vector *vec, - IMB_CIPHER_DIRECTION dir, - IMB_CHAIN_ORDER order, - IMB_CIPHER_MODE cipher, - IMB_HASH_ALG hash, - const void *ipad_hash, - const void *opad_hash, - const unsigned in_place, - const unsigned num_jobs) +test_chained_many(struct IMB_MGR *mb_mgr, const void *enc_keys, const void *dec_keys, + const struct chained_vector *vec, IMB_CIPHER_DIRECTION dir, IMB_CHAIN_ORDER order, + IMB_CIPHER_MODE cipher, IMB_HASH_ALG hash, const void *ipad_hash, + const void *opad_hash, const unsigned in_place, const unsigned num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -301,7 +240,7 @@ test_chained_many(struct IMB_MGR *mb_mgr, job->iv_len_in_bytes = 16; job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; - job->user_data = (void *)((uint64_t)i); + job->user_data = (void *) ((uint64_t) i); job->hash_alg = hash; job->auth_tag_output = auths[i] + sizeof(padding); @@ -317,11 +256,11 @@ test_chained_many(struct IMB_MGR *mb_mgr, if (!in_place && (job->chain_order == IMB_ORDER_CIPHER_HASH)) { const uintptr_t u_src = (const uintptr_t) job->src; const uintptr_t u_dst = (const uintptr_t) job->dst; - const uintptr_t offset = (u_dst > u_src) ? - (u_dst - u_src) : - (UINTPTR_MAX - u_src + u_dst + 1); + const uintptr_t offset = (u_dst > u_src) + ? (u_dst - u_src) + : (UINTPTR_MAX - u_src + u_dst + 1); - job->hash_start_src_offset_in_bytes = (uint64_t)offset; + job->hash_start_src_offset_in_bytes = (uint64_t) offset; } else { job->hash_start_src_offset_in_bytes = 0; } @@ -332,24 +271,20 @@ test_chained_many(struct IMB_MGR *mb_mgr, job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { jobs_rx++; - const unsigned num = - (const unsigned)((uint64_t)job->user_data); + const unsigned num = (const unsigned) ((uint64_t) job->user_data); - if (!chained_job_ok(job, num, out_text, text_len, - targets[num], - digest, digest_size, auths[num], - padding, sizeof(padding))) + if (!chained_job_ok(job, num, out_text, text_len, targets[num], digest, + digest_size, auths[num], padding, sizeof(padding))) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - const int num = (const unsigned)((uint64_t)job->user_data); + const int num = (const unsigned) ((uint64_t) job->user_data); - if (!chained_job_ok(job, num, out_text, text_len, targets[num], - digest, digest_size, auths[num], - padding, sizeof(padding))) + if (!chained_job_ok(job, num, out_text, text_len, targets[num], digest, digest_size, + auths[num], padding, sizeof(padding))) goto end; } @@ -359,7 +294,7 @@ test_chained_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -375,16 +310,13 @@ test_chained_many(struct IMB_MGR *mb_mgr, } static void -test_chained_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const int vec_cnt, +test_chained_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int vec_cnt, const struct chained_vector *vec_tab, const char *banner, - const IMB_CIPHER_MODE cipher, - const IMB_HASH_ALG hash, int num_jobs) + const IMB_CIPHER_MODE cipher, const IMB_HASH_ALG hash, int num_jobs) { int vect; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); DECLARE_ALIGNED(uint8_t ipad_hash[128], 16); DECLARE_ALIGNED(uint8_t opad_hash[128], 16); unsigned i; @@ -394,8 +326,7 @@ test_chained_vectors(struct IMB_MGR *mb_mgr, for (vect = 0; vect < vec_cnt; vect++) { if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector key_len:%d\n", - vect + 1, vec_cnt, + printf("[%d/%d] Standard vector key_len:%d\n", vect + 1, vec_cnt, (int) vec_tab[vect].cipher_key_len); #else printf("."); @@ -405,40 +336,29 @@ test_chained_vectors(struct IMB_MGR *mb_mgr, /* prepare the cipher key */ switch (vec_tab[vect].cipher_key_len) { case 16: - IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].cipher_key, - enc_keys, dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].cipher_key, enc_keys, dec_keys); break; case 24: - IMB_AES_KEYEXP_192(mb_mgr, vec_tab[vect].cipher_key, - enc_keys, dec_keys); + IMB_AES_KEYEXP_192(mb_mgr, vec_tab[vect].cipher_key, enc_keys, dec_keys); break; case 32: default: - IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].cipher_key, - enc_keys, dec_keys); + IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].cipher_key, enc_keys, dec_keys); break; } - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - vec_tab[vect].cipher_key, - vec_tab[vect].cipher_key_len, - ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, vec_tab[vect].cipher_key, + vec_tab[vect].cipher_key_len, ipad_hash, opad_hash); for (i = 0; i < DIM(test_sets); i++) { unsigned in_place; - for (in_place = 0; in_place < DIM(place_str); - in_place++) { - if (test_chained_many(mb_mgr, - enc_keys, dec_keys, - &vec_tab[vect], - test_sets[i].dir, - test_sets[i].order, - cipher, hash, - ipad_hash, opad_hash, - in_place, num_jobs)) { - printf("error #%d %s %s\n", vect + 1, - test_sets[i].set_name, + for (in_place = 0; in_place < DIM(place_str); in_place++) { + if (test_chained_many(mb_mgr, enc_keys, dec_keys, &vec_tab[vect], + test_sets[i].dir, test_sets[i].order, cipher, + hash, ipad_hash, opad_hash, in_place, + num_jobs)) { + printf("error #%d %s %s\n", vect + 1, test_sets[i].set_name, place_str[in_place]); test_suite_update(ctx, 0, 1); } else { @@ -454,21 +374,16 @@ test_chained_vectors(struct IMB_MGR *mb_mgr, int chained_test(struct IMB_MGR *mb_mgr) { - const int num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 - }; + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 }; unsigned i; int errors = 0; struct test_suite_context ctx; test_suite_start(&ctx, "CHAINED-OP"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_chained_vectors(mb_mgr, &ctx, - DIM(chained_vectors), - chained_vectors, - "AES-CBC + SHA1-HMAC standard test vectors", - IMB_CIPHER_CBC, IMB_AUTH_HMAC_SHA_1, - num_jobs_tab[i]); + test_chained_vectors(mb_mgr, &ctx, DIM(chained_vectors), chained_vectors, + "AES-CBC + SHA1-HMAC standard test vectors", IMB_CIPHER_CBC, + IMB_AUTH_HMAC_SHA_1, num_jobs_tab[i]); errors += test_suite_end(&ctx); diff --git a/test/kat-app/clear_mem_test.c b/test/kat-app/clear_mem_test.c index a269f752..aa2eb59a 100644 --- a/test/kat-app/clear_mem_test.c +++ b/test/kat-app/clear_mem_test.c @@ -36,9 +36,10 @@ #include "utils.h" #define MAX_RAND 1024 -#define PATTERN 0x66 +#define PATTERN 0x66 -int clear_mem_test(struct IMB_MGR *mb_mgr); +int +clear_mem_test(struct IMB_MGR *mb_mgr); /* validate expected bytes */ static int @@ -51,7 +52,8 @@ validate_bytes_zero(const uint8_t *ptr, const int mem_size) if (*p != 0) { printf("Byte mismatch -- found 0x%x!\n" - "Byte Offset = %u\n", *p, (unsigned)(p - ptr)); + "Byte Offset = %u\n", + *p, (unsigned) (p - ptr)); return 1; } p++; @@ -61,7 +63,8 @@ validate_bytes_zero(const uint8_t *ptr, const int mem_size) } /* print bytes */ -static void print_bytes(uint8_t *ptr, int size) +static void +print_bytes(uint8_t *ptr, int size) { int i; @@ -71,10 +74,11 @@ static void print_bytes(uint8_t *ptr, int size) printf("\n"); } -int clear_mem_test(struct IMB_MGR *mb_mgr) +int +clear_mem_test(struct IMB_MGR *mb_mgr) { struct test_suite_context ctx; - (void)mb_mgr; + (void) mb_mgr; int i, errors; uint8_t *buf, padding[16]; @@ -87,8 +91,7 @@ int clear_mem_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx, "CLEAR-MEM"); for (i = 0; i < 100; i++) { - const unsigned r = (rand() % MAX_RAND) + - sizeof(padding) * 2 + 1; + const unsigned r = (rand() % MAX_RAND) + sizeof(padding) * 2 + 1; const int sz = r - (sizeof(padding) * 2); uint8_t *clear_zn; @@ -129,11 +132,9 @@ int clear_mem_test(struct IMB_MGR *mb_mgr) test_suite_update(&ctx, 1, 0); /* validate tail */ - if (memcmp(buf + sizeof(padding) + sz, - padding, sizeof(padding)) != 0) { + if (memcmp(buf + sizeof(padding) + sz, padding, sizeof(padding)) != 0) { printf("Found mismatch in tail!\n"); - print_bytes(buf + sizeof(padding) + sz, - sizeof(padding)); + print_bytes(buf + sizeof(padding) + sz, sizeof(padding)); test_suite_update(&ctx, 0, 1); } else test_suite_update(&ctx, 1, 0); diff --git a/test/kat-app/cmac_test.c b/test/kat-app/cmac_test.c index 47aee4ff..d68c0d4a 100644 --- a/test/kat-app/cmac_test.c +++ b/test/kat-app/cmac_test.c @@ -41,7 +41,8 @@ enum cmac_type { CMAC_256, }; -int cmac_test(struct IMB_MGR *mb_mgr); +int +cmac_test(struct IMB_MGR *mb_mgr); extern const struct mac_test cmac_128_test_json[]; extern const struct mac_test cmac_256_test_json[]; @@ -51,166 +52,109 @@ static const struct cmac_subkeys { const char *key; const char *sub_key1; const char *sub_key2; -} cmac_128_subkeys[] = { - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", - "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" - }, - { NULL, NULL, NULL } -}; +} cmac_128_subkeys[] = { { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xfb\xee\xd6\x18\x35\x71\x33\x66\x7c\x85\xe0\x8f\x72\x36\xa8\xde", + "\xf7\xdd\xac\x30\x6a\xe2\x66\xcc\xf9\x0b\xc1\x1e\xe4\x6d\x51\x3b" }, + { NULL, NULL, NULL } }; static const struct cmac_subkeys cmac_256_subkeys[] = { - { - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", - "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" - }, - { - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", - "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" - }, - { - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", - "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" - }, - { - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", - "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" - }, - {NULL, NULL, NULL} + { "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61" + "\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", + "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" }, + { "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61" + "\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", + "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" }, + { "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61" + "\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", + "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" }, + { "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61" + "\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\xca\xd1\xed\x03\x29\x9e\xed\xac\x2e\x9a\x99\x80\x86\x21\x50\x2f", + "\x95\xa3\xda\x06\x53\x3d\xdb\x58\x5d\x35\x33\x01\x0c\x42\xa0\xd9" }, + { NULL, NULL, NULL } }; static const struct cmac_subkeys cmac_3gpp_subkeys[] = { - { - "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", - "\xdc\x84\xc2\x70\xb5\xbf\x83\xf9\x6f\x90\xbe\x18\x8d\x3f\x64\x18", - "\xb9\x09\x84\xe1\x6b\x7f\x07\xf2\xdf\x21\x7c\x31\x1a\x7e\xc8\xb7" - }, - { - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x36\xe3\xe5\x32\x26\x52\x2b\xa6\xc0\xa4\x23\x6b\xcb\xbf\x0c\xe3", - "\x6d\xc7\xca\x64\x4c\xa4\x57\x4d\x81\x48\x46\xd7\x97\x7e\x19\xc6" - }, - { - "\x7e\x5e\x94\x43\x1e\x11\xd7\x38\x28\xd7\x39\xcc\x6c\xed\x45\x73", - "\xaf\x16\x8c\x50\x6a\xf0\x3c\xf3\xa4\x4a\xbf\x1a\x61\x34\xc1\x59", - "\x5e\x2d\x18\xa0\xd5\xe0\x79\xe7\x48\x95\x7e\x34\xc2\x69\x82\x35" - }, - { - "\xd3\x41\x9b\xe8\x21\x08\x7a\xcd\x02\x12\x3a\x92\x48\x03\x33\x59", - "\x0a\x9b\xa0\x10\x5b\x3d\x9a\x43\x47\xe6\x56\x15\x4e\x6d\x37\xc8", - "\x15\x37\x40\x20\xb6\x7b\x34\x86\x8f\xcc\xac\x2a\x9c\xda\x6f\x90" - }, - { - "\x83\xfd\x23\xa2\x44\xa7\x4c\xf3\x58\xda\x30\x19\xf1\x72\x26\x35", - "\x3b\xec\x38\xae\x79\x0d\x59\x58\xe0\x9b\x73\xab\x61\xbd\x48\x0f", - "\x77\xd8\x71\x5c\xf2\x1a\xb2\xb1\xc1\x36\xe7\x56\xc3\x7a\x90\x1e" - }, - { - "\x68\x32\xa6\x5c\xff\x44\x73\x62\x1e\xbd\xd4\xba\x26\xa9\x21\xfe", - "\xca\x02\x47\x87\x0f\xc2\x7f\xad\x1b\x17\xe1\xa1\x48\xb0\x2d\x8d", - "\x94\x04\x8f\x0e\x1f\x84\xff\x5a\x36\x2f\xc3\x42\x91\x60\x5b\x9d" - }, - { - "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", - "\x30\x65\xc4\x53\xf7\x72\x72\xe1\x79\xef\x65\x04\x7d\xc9\xfc\x3d", - "\x60\xcb\x88\xa7\xee\xe4\xe5\xc2\xf3\xde\xca\x08\xfb\x93\xf8\x7a" - }, - { - "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", - "\x58\xc8\xbb\x9a\xe4\x22\x92\xc3\xb1\x73\x90\xc8\xf5\x58\x58\xb6", - "\xb1\x91\x77\x35\xc8\x45\x25\x87\x62\xe7\x21\x91\xea\xb0\xb1\x6c" - }, - {NULL, NULL, NULL} + { "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\xdc\x84\xc2\x70\xb5\xbf\x83\xf9\x6f\x90\xbe\x18\x8d\x3f\x64\x18", + "\xb9\x09\x84\xe1\x6b\x7f\x07\xf2\xdf\x21\x7c\x31\x1a\x7e\xc8\xb7" }, + { "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x36\xe3\xe5\x32\x26\x52\x2b\xa6\xc0\xa4\x23\x6b\xcb\xbf\x0c\xe3", + "\x6d\xc7\xca\x64\x4c\xa4\x57\x4d\x81\x48\x46\xd7\x97\x7e\x19\xc6" }, + { "\x7e\x5e\x94\x43\x1e\x11\xd7\x38\x28\xd7\x39\xcc\x6c\xed\x45\x73", + "\xaf\x16\x8c\x50\x6a\xf0\x3c\xf3\xa4\x4a\xbf\x1a\x61\x34\xc1\x59", + "\x5e\x2d\x18\xa0\xd5\xe0\x79\xe7\x48\x95\x7e\x34\xc2\x69\x82\x35" }, + { "\xd3\x41\x9b\xe8\x21\x08\x7a\xcd\x02\x12\x3a\x92\x48\x03\x33\x59", + "\x0a\x9b\xa0\x10\x5b\x3d\x9a\x43\x47\xe6\x56\x15\x4e\x6d\x37\xc8", + "\x15\x37\x40\x20\xb6\x7b\x34\x86\x8f\xcc\xac\x2a\x9c\xda\x6f\x90" }, + { "\x83\xfd\x23\xa2\x44\xa7\x4c\xf3\x58\xda\x30\x19\xf1\x72\x26\x35", + "\x3b\xec\x38\xae\x79\x0d\x59\x58\xe0\x9b\x73\xab\x61\xbd\x48\x0f", + "\x77\xd8\x71\x5c\xf2\x1a\xb2\xb1\xc1\x36\xe7\x56\xc3\x7a\x90\x1e" }, + { "\x68\x32\xa6\x5c\xff\x44\x73\x62\x1e\xbd\xd4\xba\x26\xa9\x21\xfe", + "\xca\x02\x47\x87\x0f\xc2\x7f\xad\x1b\x17\xe1\xa1\x48\xb0\x2d\x8d", + "\x94\x04\x8f\x0e\x1f\x84\xff\x5a\x36\x2f\xc3\x42\x91\x60\x5b\x9d" }, + { "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", + "\x30\x65\xc4\x53\xf7\x72\x72\xe1\x79\xef\x65\x04\x7d\xc9\xfc\x3d", + "\x60\xcb\x88\xa7\xee\xe4\xe5\xc2\xf3\xde\xca\x08\xfb\x93\xf8\x7a" }, + { "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", + "\x58\xc8\xbb\x9a\xe4\x22\x92\xc3\xb1\x73\x90\xc8\xf5\x58\x58\xb6", + "\xb1\x91\x77\x35\xc8\x45\x25\x87\x62\xe7\x21\x91\xea\xb0\xb1\x6c" }, + { NULL, NULL, NULL } }; static int -cmac_subkey_test(const struct cmac_subkeys *skeys, - uint32_t *skey1, uint32_t *skey2) +cmac_subkey_test(const struct cmac_subkeys *skeys, uint32_t *skey1, uint32_t *skey2) { uint32_t sub_key_size = sizeof(skey1); @@ -233,11 +177,8 @@ cmac_subkey_test(const struct cmac_subkeys *skeys, } static int -cmac_job_ok(const struct mac_test *vec, - const struct IMB_JOB *job, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +cmac_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const uint8_t *auth, + const uint8_t *padding, const size_t sizeof_padding) { const size_t auth_len = job->auth_tag_output_len_in_bytes; @@ -247,11 +188,9 @@ cmac_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + auth_len], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + auth_len], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + auth_len], sizeof_padding); + hexdump(stderr, "Target", &auth[sizeof_padding + auth_len], sizeof_padding); return 0; } @@ -263,25 +202,19 @@ cmac_job_ok(const struct mac_test *vec, if (memcmp(vec->tag, &auth[sizeof_padding], auth_len)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], - auth_len); - hexdump(stderr, "Expected", vec->tag, - auth_len); + hexdump(stderr, "Received", &auth[sizeof_padding], auth_len); + hexdump(stderr, "Expected", vec->tag, auth_len); return 0; } return 1; } static int -test_cmac(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const struct cmac_subkeys *subKeys, - const int dir, - const int num_jobs, - const enum cmac_type type) +test_cmac(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const struct cmac_subkeys *subKeys, + const int dir, const int num_jobs, const enum cmac_type type) { - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint32_t skey1[4], skey2[4]; struct IMB_JOB *job; uint8_t padding[16]; @@ -289,8 +222,8 @@ test_cmac(struct IMB_MGR *mb_mgr, int i = 0, jobs_rx = 0, ret = -1; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); @@ -362,12 +295,10 @@ test_cmac(struct IMB_MGR *mb_mgr, if (job) { jobs_rx++; if (num_jobs < 4) { - printf("%d Unexpected return from submit_job\n", - __LINE__); + printf("%d Unexpected return from submit_job\n", __LINE__); goto end; } - if (!cmac_job_ok(vec, job, job->user_data, padding, - sizeof(padding))) + if (!cmac_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } } @@ -375,8 +306,7 @@ test_cmac(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!cmac_job_ok(vec, job, job->user_data, padding, - sizeof(padding))) + if (!cmac_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } @@ -438,15 +368,14 @@ test_cmac(struct IMB_MGR *mb_mgr, printf("Invalid return job received\n"); goto end; } - if (!cmac_job_ok(vec, job, job->user_data, padding, - sizeof(padding))) + if (!cmac_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -455,7 +384,7 @@ test_cmac(struct IMB_MGR *mb_mgr, free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -463,178 +392,153 @@ test_cmac(struct IMB_MGR *mb_mgr, } static void -test_cmac_std_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const int num_jobs) +test_cmac_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { - const struct mac_test *v = cmac_128_test_json; + const struct mac_test *v = cmac_128_test_json; const struct cmac_subkeys *sk = cmac_128_subkeys; if (!quiet_mode) - printf("AES-CMAC-128 standard test vectors (N jobs = %d):\n", - num_jobs); - for (; v->msg != NULL; v++, sk++) { + printf("AES-CMAC-128 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++, sk++) { if (!quiet_mode) { #ifdef DEBUG printf("Standard CMAC-128 vector %zu Message length: %zu, " "Tag length:%zu\n", - v->tcId, - v->msgSize / 8, - v->tagSize / 8); + v->tcId, v->msgSize / 8, v->tagSize / 8); #else printf("."); #endif } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_ENCRYPT, num_jobs, CMAC_128)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_ENCRYPT, num_jobs, CMAC_128)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_DECRYPT, num_jobs, CMAC_128)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_DECRYPT, num_jobs, CMAC_128)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } static void -test_cmac_256_std_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, +test_cmac_256_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { - const struct mac_test *v = cmac_256_test_json; + const struct mac_test *v = cmac_256_test_json; const struct cmac_subkeys *sk = cmac_256_subkeys; if (!quiet_mode) - printf("AES-CMAC-256 standard test vectors (N jobs = %d):\n", - num_jobs); - for (; v->msg != NULL; v++, sk++) { + printf("AES-CMAC-256 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++, sk++) { if (!quiet_mode) { #ifdef DEBUG printf("Standard CMAC-256 vector %zu Message length: %zu, " "Tag length:%zu\n", - v->tcId, - v->msgSize / 8, - v->tagSize / 8); + v->tcId, v->msgSize / 8, v->tagSize / 8); #else printf("."); #endif } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_ENCRYPT, num_jobs, CMAC_256)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_ENCRYPT, num_jobs, CMAC_256)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_DECRYPT, num_jobs, CMAC_256)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_DECRYPT, num_jobs, CMAC_256)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } static void -test_cmac_bitlen_std_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, +test_cmac_bitlen_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { - const struct mac_test *v = cmac_128_test_json; + const struct mac_test *v = cmac_128_test_json; const struct cmac_subkeys *sk = cmac_128_subkeys; if (!quiet_mode) printf("AES-CMAC-128 BITLEN standard test vectors " - "(N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++, sk++) { + "(N jobs = %d):\n", + num_jobs); + for (; v->msg != NULL; v++, sk++) { if (!quiet_mode) { #ifdef DEBUG printf("Standard bit length vector %zu Message length (bits): %zu, " "Tag length:%zu\n", - v->tcId, - v->msgSize, - v->tagSize / 8); + v->tcId, v->msgSize, v->tagSize / 8); #else printf("."); #endif } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_ENCRYPT, num_jobs, CMAC_128_BITLEN)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_ENCRYPT, num_jobs, CMAC_128_BITLEN)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_DECRYPT, num_jobs, CMAC_128_BITLEN)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_DECRYPT, num_jobs, CMAC_128_BITLEN)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - - } + } if (!quiet_mode) printf("\n"); } static void -test_cmac_bitlen_3gpp_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, +test_cmac_bitlen_3gpp_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { - const struct mac_test *v = cmac_3gpp_test_json; + const struct mac_test *v = cmac_3gpp_test_json; const struct cmac_subkeys *sk = cmac_3gpp_subkeys; if (!quiet_mode) - printf("AES-CMAC-128 BITLEN 3GPP test vectors (N jobs = %d):\n", - num_jobs); - for (; v->msg != NULL; v++, sk++) { + printf("AES-CMAC-128 BITLEN 3GPP test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++, sk++) { if (!quiet_mode) { #ifdef DEBUG printf("3gpp vector %zu Message length (bits): %zu, " "Tag length:%zu\n", - v->tcId, - v->msgSize, - v->tagSize / 8); + v->tcId, v->msgSize, v->tagSize / 8); #else printf("."); #endif } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_ENCRYPT, num_jobs, CMAC_128_BITLEN)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_ENCRYPT, num_jobs, CMAC_128_BITLEN)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_cmac(mb_mgr, v, sk, - IMB_DIR_DECRYPT, num_jobs, CMAC_128_BITLEN)) { + if (test_cmac(mb_mgr, v, sk, IMB_DIR_DECRYPT, num_jobs, CMAC_128_BITLEN)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - - } + } if (!quiet_mode) printf("\n"); } @@ -667,5 +571,5 @@ cmac_test(struct IMB_MGR *mb_mgr) test_cmac_256_std_vectors(mb_mgr, &ctx, i); errors += test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/cmac_test.json.c b/test/kat-app/cmac_test.json.c index 5e10250f..ca1729bc 100644 --- a/test/kat-app/cmac_test.json.c +++ b/test/kat-app/cmac_test.json.c @@ -30,364 +30,318 @@ const struct mac_test cmac_128_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc4493 */ - {128, 128, 1, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 128, 2, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 128, 3, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 128, 4, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 120, 5, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 120, 6, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 120, 7, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 120, 8, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 96, 9, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 96, 10, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 96, 11, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 96, 12, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 32, 13, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, - NULL, 0}, - {128, 32, 14, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, - NULL, 0}, - {128, 32, 15, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, - NULL, 0}, - {128, 32, 16, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, - NULL, 0}, - {128, 128, 17, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xdc\x87\xcd\xcf\x77\xa2\xf1\x82\x9e\x01\x2c\x4d\x31\xaf\x2f\x8b", 1, 64, - NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} - }; + { 128, 128, 1, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, NULL, 0 }, + { 128, 128, 2, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, NULL, 0 }, + { 128, 128, 3, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, NULL, 0 }, + { 128, 128, 4, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, NULL, 0 }, + { 128, 120, 5, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, NULL, 0 }, + { 128, 120, 6, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, NULL, 0 }, + { 128, 120, 7, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, NULL, 0 }, + { 128, 120, 8, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, NULL, 0 }, + { 128, 96, 9, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, NULL, 0 }, + { 128, 96, 10, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, NULL, 0 }, + { 128, 96, 11, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, NULL, 0 }, + { 128, 96, 12, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, NULL, 0 }, + { 128, 32, 13, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbb\x1d\x69\x29\xe9\x59\x37\x28\x7f\xa3\x7d\x12\x9b\x75\x67\x46", 1, 0, NULL, 0 }, + { 128, 32, 14, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x07\x0a\x16\xb4\x6b\x4d\x41\x44\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c", 1, 128, NULL, 0 }, + { 128, 32, 15, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdf\xa6\x67\x47\xde\x9a\xe6\x30\x30\xca\x32\x61\x14\x97\xc8\x27", 1, 320, NULL, 0 }, + { 128, 32, 16, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92\xfc\x49\x74\x17\x79\x36\x3c\xfe", 1, 512, NULL, 0 }, + { 128, 128, 17, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xdc\x87\xcd\xcf\x77\xa2\xf1\x82\x9e\x01\x2c\x4d\x31\xaf\x2f\x8b", 1, 64, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; const struct mac_test cmac_256_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc4493 */ - {256, 128, 1, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e\xfc\x6b\x55\x1f\x46\x67\xd9\x83", 1, 0, - NULL, 0}, - {256, 128, 2, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x28\xa7\x02\x3f\x45\x2e\x8f\x82\xbd\x4b\xf2\x8d\x8c\x37\xc3\x5c", 1, 128, - NULL, 0}, - {256, 128, 3, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x15\x67\x27\xdc\x08\x78\x94\x4a\x02\x3c\x1f\xe0\x3b\xad\x6d\x93", 1, 160, - NULL, 0}, - {256, 128, 4, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xe1\x99\x21\x90\x54\x9f\x6e\xd5\x69\x6a\x2c\x05\x6c\x31\x54\x10", 1, 512, - NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} - }; + { 256, 128, 1, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e\xfc\x6b\x55\x1f\x46\x67\xd9\x83", 1, 0, NULL, 0 }, + { 256, 128, 2, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x28\xa7\x02\x3f\x45\x2e\x8f\x82\xbd\x4b\xf2\x8d\x8c\x37\xc3\x5c", 1, 128, NULL, 0 }, + { 256, 128, 3, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x15\x67\x27\xdc\x08\x78\x94\x4a\x02\x3c\x1f\xe0\x3b\xad\x6d\x93", 1, 160, NULL, 0 }, + { 256, 128, 4, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xe1\x99\x21\x90\x54\x9f\x6e\xd5\x69\x6a\x2c\x05\x6c\x31\x54\x10", 1, 512, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; - const struct mac_test cmac_3gpp_test_json[] = { +const struct mac_test cmac_3gpp_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc4493 */ - {128, 32, 1, - "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", - "\x38\xa6\xf0\x56\xc0\x00\x00\x00\x33\x32\x34\x62\x63\x39\x38\x40", - "\x11\x8c\x6e\xb8", 1, 122, NULL, 0}, - {128, 32, 2, - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x39\x8a\x59\xb4\xd4\x00\x00\x00\x48\x45\x83\xd5\xaf\xe0\x82\xae", - "\xb9\x37\x87\xe6", 1, 128, NULL, 0}, - {128, 32, 3, - "\x7e\x5e\x94\x43\x1e\x11\xd7\x38\x28\xd7\x39\xcc\x6c\xed\x45\x73", - "\x36\xaf\x61\x44\xc4\x00\x00\x00\xb3\xd3\xc9\x17\x0a\x4e\x16\x32\xf6\x0f" - "\x86\x10\x13\xd2\x2d\x84\xb7\x26\xb6\xa2\x78\xd8\x02\xd1\xee\xaf\x13\x21" - "\xba\x59\x29\xdc", - "\x1f\x60\xb0\x1d", 1, 318, NULL, 0}, - {128, 32, 4, - "\xd3\x41\x9b\xe8\x21\x08\x7a\xcd\x02\x12\x3a\x92\x48\x03\x33\x59", - "\xc7\x59\x0e\xa9\xb8\x00\x00\x00\xbb\xb0\x57\x03\x88\x09\x49\x6b\xcf\xf8" - "\x6d\x6f\xbc\x8c\xe5\xb1\x35\xa0\x6b\x16\x60\x54\xf2\xd5\x65\xbe\x8a\xce" - "\x75\xdc\x85\x1e\x0b\xcd\xd8\xf0\x71\x41\xc4\x95\x87\x2f\xb5\xd8\xc0\xc6" - "\x6a\x8b\x6d\xa5\x56\x66\x3e\x4e\x46\x12\x05\xd8\x45\x80\xbe\xe5\xbc\x7e", - "\x68\x46\xa2\xf0", 1, 575, NULL, 0}, - {128, 32, 5, - "\x83\xfd\x23\xa2\x44\xa7\x4c\xf3\x58\xda\x30\x19\xf1\x72\x26\x35", - "\x36\xaf\x61\x44\x7c\x00\x00\x00\x35\xc6\x87\x16\x63\x3c\x66\xfb\x75\x0c" - "\x26\x68\x65\xd5\x3c\x11\xea\x05\xb1\xe9\xfa\x49\xc8\x39\x8d\x48\xe1\xef" - "\xa5\x90\x9d\x39\x47\x90\x28\x37\xf5\xae\x96\xd5\xa0\x5b\xc8\xd6\x1c\xa8" - "\xdb\xef\x1b\x13\xa4\xb4\xab\xfe\x4f\xb1\x00\x60\x45\xb6\x74\xbb\x54\x72" - "\x93\x04\xc3\x82\xbe\x53\xa5\xaf\x05\x55\x61\x76\xf6\xea\xa2\xef\x1d\x05" - "\xe4\xb0\x83\x18\x1e\xe6\x74\xcd\xa5\xa4\x85\xf7\x4d\x7a", - "\xe6\x57\xe1\x82", 1, 832, NULL, 0}, - {128, 32, 6, - "\x68\x32\xa6\x5c\xff\x44\x73\x62\x1e\xbd\xd4\xba\x26\xa9\x21\xfe", - "\x36\xaf\x61\x44\xc0\x00\x00\x00\xd3\xc5\x38\x39\x62\x68\x20\x71\x77\x65" - "\x66\x76\x20\x32\x38\x37\x63\x62\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4" - "\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8" - "\xa6\xdc", - "\xf0\x66\x8c\x1e", 1, 447, NULL, 0}, - {128, 32, 7, - "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", - "\x78\x27\xfa\xb2\x2c\x00\x00\x00\x70\xde\xdf\x2d\xc4\x2c\x5c\xbd\x3a\x96" - "\xf8\xa0\xb1\x14\x18\xb3\x60\x8d\x57\x33\x60\x4a\x2c\xd3\x6a\xab\xc7\x0c" - "\xe3\x19\x3b\xb5\x15\x3b\xe2\xd3\xc0\x6d\xfd\xb2\xd1\x6e\x9c\x35\x71\x58" - "\xbe\x6a\x41\xd6\xb8\x61\xe4\x91\xdb\x3f\xbf\xeb\x51\x8e\xfc\xf0\x48\xd7" - "\xd5\x89\x53\x73\x0f\xf3\x0c\x9e\xc4\x70\xff\xcd\x66\x3d\xc3\x42\x01\xc3" - "\x6a\xdd\xc0\x11\x1c\x35\xb3\x8a\xfe\xe7\xcf\xdb\x58\x2e\x37\x31\xf8\xb4" - "\xba\xa8\xd1\xa8\x9c\x06\xe8\x11\x99\xa9\x71\x62\x27\xbe\x34\x4e\xfc\xb4" - "\x36\xdd\xd0\xf0\x96\xc0\x64\xc3\xb5\xe2\xc3\x99\x99\x3f\xc7\x73\x94\xf9" - "\xe0\x97\x20\xa8\x11\x85\x0e\xf2\x3b\x2e\xe0\x5d\x9e\x61\x73\x60\x9d\x86" - "\xe1\xc0\xc1\x8e\xa5\x1a\x01\x2a\x00\xbb\x41\x3b\x9c\xb8\x18\x8a\x70\x3c" - "\xd6\xba\xe3\x1c\xc6\x7b\x34\xb1\xb0\x00\x19\xe6\xa2\xb2\xa6\x90\xf0\x26" - "\x71\xfe\x7c\x9e\xf8\xde\xc0\x09\x4e\x53\x37\x63\x47\x8d\x58\xd2\xc5\xf5" - "\xb8\x27\xa0\x14\x8c\x59\x48\xa9\x69\x31\xac\xf8\x4f\x46\x5a\x64\xe6\x2c" - "\xe7\x40\x07\xe9\x91\xe3\x7e\xa8\x23\xfa\x0f\xb2\x19\x23\xb7\x99\x05\xb7" - "\x33\xb6\x31\xe6\xc7\xd6\x86\x0a\x38\x31\xac\x35\x1a\x9c\x73\x0c\x52\xff" - "\x72\xd9\xd3\x08\xee\xdb\xab\x21\xfd\xe1\x43\xa0\xea\x17\xe2\x3e\xdc\x1f" - "\x74\xcb\xb3\x63\x8a\x20\x33\xaa\xa1\x54\x64\xea\xa7\x33\x38\x5d\xbb\xeb" - "\x6f\xd7\x35\x09\xb8\x57\xe6\xa4\x19\xdc\xa1\xd8\x90\x7a\xf9\x77\xfb\xac" - "\x4d\xfa\x35\xec", - "\xf4\xcc\x8f\xa3", 1, 2622, NULL, 0}, - {128, 32, 8, - "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", - "\x29\x6f\x39\x3c\x5c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01" - "\x01\x01\x01\x01\x01\x01\xe0\x95\x80\x45\xf3\xa0\xbb\xa4\xe3\x96\x83\x46" - "\xf0\xa3\xb8\xa7\xc0\x2a\x01\x8a\xe6\x40\x76\x52\x26\xb9\x87\xc9\x13\xe6" - "\xcb\xf0\x83\x57\x00\x16\xcf\x83\xef\xbc\x61\xc0\x82\x51\x3e\x21\x56\x1a" - "\x42\x7c\x00\x9d\x28\xc2\x98\xef\xac\xe7\x8e\xd6\xd5\x6c\x2d\x45\x05\xad" - "\x03\x2e\x9c\x04\xdc\x60\xe7\x3a\x81\x69\x6d\xa6\x65\xc6\xc4\x86\x03\xa5" - "\x7b\x45\xab\x33\x22\x15\x85\xe6\x8e\xe3\x16\x91\x87\xfb\x02\x39\x52\x86" - "\x32\xdd\x65\x6c\x80\x7e\xa3\x24\x8b\x7b\x46\xd0\x02\xb2\xb5\xc7\x45\x8e" - "\xb8\x5b\x9c\xe9\x58\x79\xe0\x34\x08\x59\x05\x5e\x3b\x0a\xbb\xc3\xea\xce" - "\x87\x19\xca\xa8\x02\x65\xc9\x72\x05\xd5\xdc\x4b\xcc\x90\x2f\xe1\x83\x96" - "\x29\xed\x71\x32\x8a\x0f\x04\x49\xf5\x88\x55\x7e\x68\x98\x86\x0e\x04\x2a" - "\xec\xd8\x4b\x24\x04\xc2\x12\xc9\x22\x2d\xa5\xbf\x8a\x89\xef\x67\x97\x87" - "\x0c\xf5\x07\x71\xa6\x0f\x66\xa2\xee\x62\x85\x36\x57\xad\xdf\x04\xcd\xde" - "\x07\xfa\x41\x4e\x11\xf1\x2b\x4d\x81\xb9\xb4\xe8\xac\x53\x8e\xa3\x06\x66" - "\x68\x8d\x88\x1f\x6c\x34\x84\x21\x99\x2f\x31\xb9\x4f\x88\x06\xed\x8f\xcc" - "\xff\x4c\x91\x23\xb8\x96\x42\x52\x7a\xd6\x13\xb1\x09\xbf\x75\x16\x74\x85" - "\xf1\x26\x8b\xf8\x84\xb4\xcd\x23\xd2\x9a\x09\x34\x92\x57\x03\xd6\x34\x09" - "\x8f\x77\x67\xf1\xbe\x74\x91\xe7\x08\xa8\xbb\x94\x9a\x38\x73\x70\x8a\xef" - "\x4a\x36\x23\x9e\x50\xcc\x08\x23\x5c\xd5\xed\x6b\xbe\x57\x86\x68\xa1\x7b" - "\x58\xc1\x17\x1d\x0b\x90\xe8\x13\xa9\xe4\xf5\x8a\x89\xd7\x19\xb1\x10\x42" - "\xd6\x36\x0b\x1b\x0f\x52\xde\xb7\x30\xa5\x8d\x58\xfa\xf4\x63\x15\x95\x4b" - "\x0a\x87\x26\x91\x47\x59\x77\xdc\x88\xc0\xd7\x33\xfe\xff\x54\x60\x0a\x0c" - "\xc1\xd0\x30\x0a\xaa\xeb\x94\x57\x2c\x6e\x95\xb0\x1a\xe9\x0d\xe0\x4f\x1d" - "\xce\x47\xf8\x7e\x8f\xa7\xbe\xbf\x77\xe1\xdb\xc2\x0d\x6b\xa8\x5c\xb9\x14" - "\x3d\x51\x8b\x28\x5d\xfa\x04\xb6\x98\xbf\x0c\xf7\x81\x9f\x20\xfa\x7a\x28" - "\x8e\xb0\x70\x3d\x99\x5c\x59\x94\x0c\x7c\x66\xde\x57\xa9\xb7\x0f\x82\x37" - "\x9b\x70\xe2\x03\x1e\x45\x0f\xcf\xd2\x18\x13\x26\xfc\xd2\x8d\x88\x23\xba" - "\xaa\x80\xdf\x6e\x0f\x44\x35\x59\x64\x75\x39\xfd\x89\x07\xc0\xff\xd9\xd7" - "\x9c\x13\x0e\xd8\x1c\x9a\xfd\x9b\x7e\x84\x8c\x9f\xed\x38\x44\x3d\x5d\x38" - "\x0e\x53\xfb\xdb\x8a\xc8\xc3\xd3\xf0\x68\x76\x05\x4f\x12\x24\x61\x10\x7d" - "\xe9\x2f\xea\x09\xc6\xf6\x92\x3a\x18\x8d\x53\xaf\xe5\x4a\x10\xf6\x0e\x6e" - "\x9d\x5a\x03\xd9\x96\xb5\xfb\xc8\x20\xf8\xa6\x37\x11\x6a\x27\xad\x04\xb4" - "\x44\xa0\x93\x2d\xd6\x0f\xbd\x12\x67\x1c\x11\xe1\xc0\xec\x73\xe7\x89\x87" - "\x9f\xaa\x3d\x42\xc6\x4d\x20\xcd\x12\x52\x74\x2a\x37\x68\xc2\x5a\x90\x15" - "\x85\x88\x8e\xce\xe1\xe6\x12\xd9\x93\x6b\x40\x3b\x07\x75\x94\x9a\x66\xcd" - "\xfd\x99\xa2\x9b\x13\x45\xba\xa8\xd9\xd5\x40\x0c\x91\x02\x4b\x0a\x60\x73" - "\x63\xb0\x13\xce\x5d\xe9\xae\x86\x9d\x3b\x8d\x95\xb0\x57\x0b\x3c\x2d\x39" - "\x14\x22\xd3\x24\x50\xcb\xcf\xae\x96\x65\x22\x86\xe9\x6d\xec\x12\x14\xa9" - "\x34\x65\x27\x98\x0a\x81\x92\xea\xc1\xc3\x9a\x3a\xaf\x6f\x15\x35\x1d\xa6" - "\xbe\x76\x4d\xf8\x97\x72\xec\x04\x07\xd0\x6e\x44\x15\xbe\xfa\xe7\xc9\x25" - "\x80\xdf\x9b\xf5\x07\x49\x7c\x8f\x29\x95\x16\x0d\x4e\x21\x8d\xaa\xcb\x02" - "\x94\x4a\xbf\x83\x34\x0c\xe8\xbe\x16\x86\xa9\x60\xfa\xf9\x0e\x2d\x90\xc5" - "\x5c\xc6\x47\x5b\xab\xc3\x17\x1a\x80\xa3\x63\x17\x49\x54\x95\x5d\x71\x01" - "\xda\xb1\x6a\xe8\x17\x91\x67\xe2\x14\x44\xb4\x43\xa9\xea\xaa\x7c\x91\xde" - "\x36\xd1\x18\xc3\x9d\x38\x9f\x8d\xd4\x46\x9a\x84\x6c\x9a\x26\x2b\xf7\xfa" - "\x18\x48\x7a\x79\xe8\xde\x11\x69\x9e\x0b\x8f\xdf\x55\x7c\xb4\x87\x19\xd4" - "\x53\xba\x71\x30\x56\x10\x9b\x93\xa2\x18\xc8\x96\x75\xac\x19\x5f\xb4\xfb" - "\x06\x63\x9b\x37\x97\x14\x49\x55\xb3\xc9\x32\x7d\x1a\xec\x00\x3d\x42\xec" - "\xd0\xea\x98\xab\xf1\x9f\xfb\x4a\xf3\x56\x1a\x67\xe7\x7c\x35\xbf\x15\xc5" - "\x9c\x24\x12\xda\x88\x1d\xb0\x2b\x1b\xfb\xce\xbf\xac\x51\x52\xbc\x99\xbc" - "\x3f\x1d\x15\xf7\x71\x00\x1b\x70\x29\xfe\xdb\x02\x8f\x8b\x85\x2b\xc4\x40" - "\x7e\xb8\x3f\x89\x1c\x9c\xa7\x33\x25\x4f\xdd\x1e\x9e\xdb\x56\x91\x9c\xe9" - "\xfe\xa2\x1c\x17\x40\x72\x52\x1c\x18\x31\x9a\x54\xb5\xd4\xef\xbe\xbd\xdf" - "\x1d\x8b\x69\xb1\xcb\xf2\x5f\x48\x9f\xcc\x98\x13\x72\x54\x7c\xf4\x1d\x00" - "\x8e\xf0\xbc\xa1\x92\x6f\x93\x4b\x73\x5e\x09\x0b\x3b\x25\x1e\xb3\x3a\x36" - "\xf8\x2e\xd9\xb2\x9c\xf4\xcb\x94\x41\x88\xfa\x0e\x1e\x38\xdd\x77\x8f\x7d" - "\x1c\x9d\x98\x7b\x28\xd1\x32\xdf\xb9\x73\x1f\xa4\xf4\xb4\x16\x93\x5b\xe4" - "\x9d\xe3\x05\x16\xaf\x35\x78\x58\x1f\x2f\x13\xf5\x61\xc0\x66\x33\x61\x94" - "\x1e\xab\x24\x9a\x4b\xc1\x23\xf8\xd1\x5c\xd7\x11\xa9\x56\xa1\xbf\x20\xfe" - "\x6e\xb7\x8a\xea\x23\x73\x36\x1d\xa0\x42\x6c\x79\xa5\x30\xc3\xbb\x1d\xe0" - "\xc9\x97\x22\xef\x1f\xde\x39\xac\x2b\x00\xa0\xa8\xee\x7c\x80\x0a\x08\xbc" - "\x22\x64\xf8\x9f\x4e\xff\xe6\x27\xac\x2f\x05\x31\xfb\x55\x4f\x6d\x21\xd7" - "\x4c\x59\x0a\x70\xad\xfa\xa3\x90\xbd\xfb\xb3\xd6\x8e\x46\x21\x5c\xab\x18" - "\x7d\x23\x68\xd5\xa7\x1f\x5e\xbe\xc0\x81\xcd\x3b\x20\xc0\x82\xdb\xe4\xcd" - "\x2f\xac\xa2\x87\x73\x79\x5d\x6b\x0c\x10\x20\x4b\x65\x9a\x93\x9e\xf2\x9b" - "\xbe\x10\x88\x24\x36\x24\x42\x99\x27\xa7\xeb\x57\x6d\xd3\xa0\x0e\xa5\xe0" - "\x1a\xf5\xd4\x75\x83\xb2\x27\x2c\x0c\x16\x1a\x80\x65\x21\xa1\x6f\xf9\xb0" - "\xa7\x22\xc0\xcf\x26\xb0\x25\xd5\x83\x6e\x22\x58\xa4\xf7\xd4\x77\x3a\xc8" - "\x01\xe4\x26\x3b\xc2\x94\xf4\x3d\xef\x7f\xa8\x70\x3f\x3a\x41\x97\x46\x35" - "\x25\x88\x76\x52\xb0\xb2\xa4\xa2\xa7\xcf\x87\xf0\x09\x14\x87\x1e\x25\x03" - "\x91\x13\xc7\xe1\x61\x8d\xa3\x40\x64\xb5\x7a\x43\xc4\x63\x24\x9f\xb8\xd0" - "\x5e\x0f\x26\xf4\xa6\xd8\x49\x72\xe7\xa9\x05\x48\x24\x14\x5f\x91\x29\x5c" - "\xdb\xe3\x9a\x6f\x92\x0f\xac\xc6\x59\x71\x2b\x46\xa5\x4b\xa2\x95\xbb\xe6" - "\xa9\x01\x54\xe9\x1b\x33\x98\x5a\x2b\xcd\x42\x0a\xd5\xc6\x7e\xc9\xad\x8e" - "\xb7\xac\x68\x64\xdb\x27\x2a\x51\x6b\xc9\x4c\x28\x39\xb0\xa8\x16\x9a\x6b" - "\xf5\x8e\x1a\x0c\x2a\xda\x8c\x88\x3b\x7b\xf4\x97\xa4\x91\x71\x26\x8e\xd1" - "\x5d\xdd\x29\x69\x38\x4e\x7f\xf4\xbf\x4a\xab\x2e\xc9\xec\xc6\x52\x9c\xf6" - "\x29\xe2\xdf\x0f\x08\xa7\x7a\x65\xaf\xa1\x2a\xa9\xb5\x05\xdf\x8b\x28\x7e" - "\xf6\xcc\x91\x49\x3d\x1c\xaa\x39\x07\x6e\x28\xef\x1e\xa0\x28\xf5\x11\x8d" - "\xe6\x1a\xe0\x2b\xb6\xae\xfc\x33\x43\xa0\x50\x29\x2f\x19\x9f\x40\x18\x57" - "\xb2\xbe\xad\x5e\x6e\xe2\xa1\xf1\x91\x02\x2f\x92\x78\x01\x6f\x04\x77\x91" - "\xa9\xd1\x8d\xa7\xd2\xa6\xd2\x7f\x2e\x0e\x51\xc2\xf6\xea\x30\xe8\xac\x49" - "\xa0\x60\x4f\x4c\x13\x54\x2e\x85\xb6\x83\x81\xb9\xfd\xcf\xa0\xce\x4b\x2d" - "\x34\x13\x54\x85\x2d\x36\x02\x45\xc5\x36\xb6\x12\xaf\x71\xf3\xe7\x7c\x90" - "\x95\xae\x2d\xbd\xe5\x04\xb2\x65\x73\x3d\xab\xfe\x10\xa2\x0f\xc7\xd6\xd3" - "\x2c\x21\xcc\xc7\x2b\x8b\x34\x44\xae\x66\x3d\x65\x92\x2d\x17\xf8\x2c\xaa" - "\x2b\x86\x5c\xd8\x89\x13\xd2\x91\xa6\x58\x99\x02\x6e\xa1\x32\x84\x39\x72" - "\x3c\x19\x8c\x36\xb0\xc3\xc8\xd0\x85\xbf\xaf\x8a\x32\x0f\xde\x33\x4b\x4a" - "\x49\x19\xb4\x4c\x2b\x95\xf6\xe8\xec\xf7\x33\x93\xf7\xf0\xd2\xa4\x0e\x60" - "\xb1\xd4\x06\x52\x6b\x02\x2d\xdc\x33\x18\x10\xb1\xa5\xf7\xc3\x47\xbd\x53" - "\xed\x1f\x10\x5d\x6a\x0d\x30\xab\xa4\x77\xe1\x78\x88\x9a\xb2\xec\x55\xd5" - "\x58\xde\xab\x26\x30\x20\x43\x36\x96\x2b\x4d\xb5\xb6\x63\xb6\x90\x2b\x89" - "\xe8\x5b\x31\xbc\x6a\xf5\x0f\xc5\x0a\xcc\xb3\xfb\x9b\x57\xb6\x63\x29\x70" - "\x31\x37\x8d\xb4\x78\x96\xd7\xfb\xaf\x6c\x60\x0a\xdd\x2c\x67\xf9\x36\xdb" - "\x03\x79\x86\xdb\x85\x6e\xb4\x9c\xf2\xdb\x3f\x7d\xa6\xd2\x36\x50\xe4\x38" - "\xf1\x88\x40\x41\xb0\x13\x11\x9e\x4c\x2a\xe5\xaf\x37\xcc\xcd\xfb\x68\x66" - "\x07\x38\xb5\x8b\x3c\x59\xd1\xc0\x24\x84\x37\x47\x2a\xba\x1f\x35\xca\x1f" - "\xb9\x0c\xd7\x14\xaa\x9f\x63\x55\x34\xf4\x9e\x7c\x5b\xba\x81\xc2\xb6\xb3" - "\x6f\xde\xe2\x1c\xa2\x7e\x34\x7f\x79\x3d\x2c\xe9\x44\xed\xb2\x3c\x8c\x9b" - "\x91\x4b\xe1\x03\x35\xe3\x50\xfe\xb5\x07\x03\x94\xb7\xa4\xa1\x5c\x0c\xa1" - "\x20\x28\x35\x68\xb7\xbf\xc2\x54\xfe\x83\x8b\x13\x7a\x21\x47\xce\x7c\x11" - "\x3a\x3a\x4d\x65\x49\x9d\x9e\x86\xb8\x7d\xbc\xc7\xf0\x3b\xbd\x3a\x3a\xb1" - "\xaa\x24\x3e\xce\x5b\xa9\xbc\xf2\x5f\x82\x83\x6c\xfe\x47\x3b\x2d\x83\xe7" - "\xa7\x20\x1c\xd0\xb9\x6a\x72\x45\x1e\x86\x3f\x6c\x3b\xa6\x64\xa6\xd0\x73" - "\xd1\xf7\xb5\xed\x99\x08\x65\xd9\x78\xbd\x38\x15\xd0\x60\x94\xfc\x9a\x2a" - "\xba\x52\x21\xc2\x2d\x5a\xb9\x96\x38\x9e\x37\x21\xe3\xaf\x5f\x05\xbe\xdd" - "\xc2\x87\x5e\x0d\xfa\xeb\x39\x02\x1e\xe2\x7a\x41\x18\x7c\xbb\x45\xef\x40" - "\xc3\xe7\x3b\xc0\x39\x89\xf9\xa3\x0d\x12\xc5\x4b\xa7\xd2\x14\x1d\xa8\xa8" - "\x75\x49\x3e\x65\x77\x6e\xf3\x5f\x97\xde\xbc\x22\x86\xcc\x4a\xf9\xb4\x62" - "\x3e\xee\x90\x2f\x84\x0c\x52\xf1\xb8\xad\x65\x89\x39\xae\xf7\x1f\x3f\x72" - "\xb9\xec\x1d\xe2\x15\x88\xbd\x35\x48\x4e\xa4\x44\x36\x34\x3f\xf9\x5e\xad" - "\x6a\xb1\xd8\xaf\xb1\xb2\xa3\x03\xdf\x1b\x71\xe5\x3c\x4a\xea\x6b\x2e\x3e" - "\x93\x72\xbe\x0d\x1b\xc9\x97\x98\xb0\xce\x3c\xc1\x0d\x2a\x59\x6d\x56\x5d" - "\xba\x82\xf8\x8c\xe4\xcf\xf3\xb3\x3d\x5d\x24\xe9\xc0\x83\x11\x24\xbf\x1a" - "\xd5\x4b\x79\x25\x32\x98\x3d\xd6\xc3\xa8\xb7\xd0", - "\xeb\xd5\xcc\xb0", 1, 16512, NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} - }; + { 128, 32, 1, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x38\xa6\xf0\x56\xc0\x00\x00\x00\x33\x32\x34\x62\x63\x39\x38\x40", "\x11\x8c\x6e\xb8", 1, + 122, NULL, 0 }, + { 128, 32, 2, "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xd4\x00\x00\x00\x48\x45\x83\xd5\xaf\xe0\x82\xae", "\xb9\x37\x87\xe6", 1, + 128, NULL, 0 }, + { 128, 32, 3, "\x7e\x5e\x94\x43\x1e\x11\xd7\x38\x28\xd7\x39\xcc\x6c\xed\x45\x73", + "\x36\xaf\x61\x44\xc4\x00\x00\x00\xb3\xd3\xc9\x17\x0a\x4e\x16\x32\xf6\x0f" + "\x86\x10\x13\xd2\x2d\x84\xb7\x26\xb6\xa2\x78\xd8\x02\xd1\xee\xaf\x13\x21" + "\xba\x59\x29\xdc", + "\x1f\x60\xb0\x1d", 1, 318, NULL, 0 }, + { 128, 32, 4, "\xd3\x41\x9b\xe8\x21\x08\x7a\xcd\x02\x12\x3a\x92\x48\x03\x33\x59", + "\xc7\x59\x0e\xa9\xb8\x00\x00\x00\xbb\xb0\x57\x03\x88\x09\x49\x6b\xcf\xf8" + "\x6d\x6f\xbc\x8c\xe5\xb1\x35\xa0\x6b\x16\x60\x54\xf2\xd5\x65\xbe\x8a\xce" + "\x75\xdc\x85\x1e\x0b\xcd\xd8\xf0\x71\x41\xc4\x95\x87\x2f\xb5\xd8\xc0\xc6" + "\x6a\x8b\x6d\xa5\x56\x66\x3e\x4e\x46\x12\x05\xd8\x45\x80\xbe\xe5\xbc\x7e", + "\x68\x46\xa2\xf0", 1, 575, NULL, 0 }, + { 128, 32, 5, "\x83\xfd\x23\xa2\x44\xa7\x4c\xf3\x58\xda\x30\x19\xf1\x72\x26\x35", + "\x36\xaf\x61\x44\x7c\x00\x00\x00\x35\xc6\x87\x16\x63\x3c\x66\xfb\x75\x0c" + "\x26\x68\x65\xd5\x3c\x11\xea\x05\xb1\xe9\xfa\x49\xc8\x39\x8d\x48\xe1\xef" + "\xa5\x90\x9d\x39\x47\x90\x28\x37\xf5\xae\x96\xd5\xa0\x5b\xc8\xd6\x1c\xa8" + "\xdb\xef\x1b\x13\xa4\xb4\xab\xfe\x4f\xb1\x00\x60\x45\xb6\x74\xbb\x54\x72" + "\x93\x04\xc3\x82\xbe\x53\xa5\xaf\x05\x55\x61\x76\xf6\xea\xa2\xef\x1d\x05" + "\xe4\xb0\x83\x18\x1e\xe6\x74\xcd\xa5\xa4\x85\xf7\x4d\x7a", + "\xe6\x57\xe1\x82", 1, 832, NULL, 0 }, + { 128, 32, 6, "\x68\x32\xa6\x5c\xff\x44\x73\x62\x1e\xbd\xd4\xba\x26\xa9\x21\xfe", + "\x36\xaf\x61\x44\xc0\x00\x00\x00\xd3\xc5\x38\x39\x62\x68\x20\x71\x77\x65" + "\x66\x76\x20\x32\x38\x37\x63\x62\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4" + "\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8" + "\xa6\xdc", + "\xf0\x66\x8c\x1e", 1, 447, NULL, 0 }, + { 128, 32, 7, "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", + "\x78\x27\xfa\xb2\x2c\x00\x00\x00\x70\xde\xdf\x2d\xc4\x2c\x5c\xbd\x3a\x96" + "\xf8\xa0\xb1\x14\x18\xb3\x60\x8d\x57\x33\x60\x4a\x2c\xd3\x6a\xab\xc7\x0c" + "\xe3\x19\x3b\xb5\x15\x3b\xe2\xd3\xc0\x6d\xfd\xb2\xd1\x6e\x9c\x35\x71\x58" + "\xbe\x6a\x41\xd6\xb8\x61\xe4\x91\xdb\x3f\xbf\xeb\x51\x8e\xfc\xf0\x48\xd7" + "\xd5\x89\x53\x73\x0f\xf3\x0c\x9e\xc4\x70\xff\xcd\x66\x3d\xc3\x42\x01\xc3" + "\x6a\xdd\xc0\x11\x1c\x35\xb3\x8a\xfe\xe7\xcf\xdb\x58\x2e\x37\x31\xf8\xb4" + "\xba\xa8\xd1\xa8\x9c\x06\xe8\x11\x99\xa9\x71\x62\x27\xbe\x34\x4e\xfc\xb4" + "\x36\xdd\xd0\xf0\x96\xc0\x64\xc3\xb5\xe2\xc3\x99\x99\x3f\xc7\x73\x94\xf9" + "\xe0\x97\x20\xa8\x11\x85\x0e\xf2\x3b\x2e\xe0\x5d\x9e\x61\x73\x60\x9d\x86" + "\xe1\xc0\xc1\x8e\xa5\x1a\x01\x2a\x00\xbb\x41\x3b\x9c\xb8\x18\x8a\x70\x3c" + "\xd6\xba\xe3\x1c\xc6\x7b\x34\xb1\xb0\x00\x19\xe6\xa2\xb2\xa6\x90\xf0\x26" + "\x71\xfe\x7c\x9e\xf8\xde\xc0\x09\x4e\x53\x37\x63\x47\x8d\x58\xd2\xc5\xf5" + "\xb8\x27\xa0\x14\x8c\x59\x48\xa9\x69\x31\xac\xf8\x4f\x46\x5a\x64\xe6\x2c" + "\xe7\x40\x07\xe9\x91\xe3\x7e\xa8\x23\xfa\x0f\xb2\x19\x23\xb7\x99\x05\xb7" + "\x33\xb6\x31\xe6\xc7\xd6\x86\x0a\x38\x31\xac\x35\x1a\x9c\x73\x0c\x52\xff" + "\x72\xd9\xd3\x08\xee\xdb\xab\x21\xfd\xe1\x43\xa0\xea\x17\xe2\x3e\xdc\x1f" + "\x74\xcb\xb3\x63\x8a\x20\x33\xaa\xa1\x54\x64\xea\xa7\x33\x38\x5d\xbb\xeb" + "\x6f\xd7\x35\x09\xb8\x57\xe6\xa4\x19\xdc\xa1\xd8\x90\x7a\xf9\x77\xfb\xac" + "\x4d\xfa\x35\xec", + "\xf4\xcc\x8f\xa3", 1, 2622, NULL, 0 }, + { 128, 32, 8, "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", + "\x29\x6f\x39\x3c\x5c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01" + "\x01\x01\x01\x01\x01\x01\xe0\x95\x80\x45\xf3\xa0\xbb\xa4\xe3\x96\x83\x46" + "\xf0\xa3\xb8\xa7\xc0\x2a\x01\x8a\xe6\x40\x76\x52\x26\xb9\x87\xc9\x13\xe6" + "\xcb\xf0\x83\x57\x00\x16\xcf\x83\xef\xbc\x61\xc0\x82\x51\x3e\x21\x56\x1a" + "\x42\x7c\x00\x9d\x28\xc2\x98\xef\xac\xe7\x8e\xd6\xd5\x6c\x2d\x45\x05\xad" + "\x03\x2e\x9c\x04\xdc\x60\xe7\x3a\x81\x69\x6d\xa6\x65\xc6\xc4\x86\x03\xa5" + "\x7b\x45\xab\x33\x22\x15\x85\xe6\x8e\xe3\x16\x91\x87\xfb\x02\x39\x52\x86" + "\x32\xdd\x65\x6c\x80\x7e\xa3\x24\x8b\x7b\x46\xd0\x02\xb2\xb5\xc7\x45\x8e" + "\xb8\x5b\x9c\xe9\x58\x79\xe0\x34\x08\x59\x05\x5e\x3b\x0a\xbb\xc3\xea\xce" + "\x87\x19\xca\xa8\x02\x65\xc9\x72\x05\xd5\xdc\x4b\xcc\x90\x2f\xe1\x83\x96" + "\x29\xed\x71\x32\x8a\x0f\x04\x49\xf5\x88\x55\x7e\x68\x98\x86\x0e\x04\x2a" + "\xec\xd8\x4b\x24\x04\xc2\x12\xc9\x22\x2d\xa5\xbf\x8a\x89\xef\x67\x97\x87" + "\x0c\xf5\x07\x71\xa6\x0f\x66\xa2\xee\x62\x85\x36\x57\xad\xdf\x04\xcd\xde" + "\x07\xfa\x41\x4e\x11\xf1\x2b\x4d\x81\xb9\xb4\xe8\xac\x53\x8e\xa3\x06\x66" + "\x68\x8d\x88\x1f\x6c\x34\x84\x21\x99\x2f\x31\xb9\x4f\x88\x06\xed\x8f\xcc" + "\xff\x4c\x91\x23\xb8\x96\x42\x52\x7a\xd6\x13\xb1\x09\xbf\x75\x16\x74\x85" + "\xf1\x26\x8b\xf8\x84\xb4\xcd\x23\xd2\x9a\x09\x34\x92\x57\x03\xd6\x34\x09" + "\x8f\x77\x67\xf1\xbe\x74\x91\xe7\x08\xa8\xbb\x94\x9a\x38\x73\x70\x8a\xef" + "\x4a\x36\x23\x9e\x50\xcc\x08\x23\x5c\xd5\xed\x6b\xbe\x57\x86\x68\xa1\x7b" + "\x58\xc1\x17\x1d\x0b\x90\xe8\x13\xa9\xe4\xf5\x8a\x89\xd7\x19\xb1\x10\x42" + "\xd6\x36\x0b\x1b\x0f\x52\xde\xb7\x30\xa5\x8d\x58\xfa\xf4\x63\x15\x95\x4b" + "\x0a\x87\x26\x91\x47\x59\x77\xdc\x88\xc0\xd7\x33\xfe\xff\x54\x60\x0a\x0c" + "\xc1\xd0\x30\x0a\xaa\xeb\x94\x57\x2c\x6e\x95\xb0\x1a\xe9\x0d\xe0\x4f\x1d" + "\xce\x47\xf8\x7e\x8f\xa7\xbe\xbf\x77\xe1\xdb\xc2\x0d\x6b\xa8\x5c\xb9\x14" + "\x3d\x51\x8b\x28\x5d\xfa\x04\xb6\x98\xbf\x0c\xf7\x81\x9f\x20\xfa\x7a\x28" + "\x8e\xb0\x70\x3d\x99\x5c\x59\x94\x0c\x7c\x66\xde\x57\xa9\xb7\x0f\x82\x37" + "\x9b\x70\xe2\x03\x1e\x45\x0f\xcf\xd2\x18\x13\x26\xfc\xd2\x8d\x88\x23\xba" + "\xaa\x80\xdf\x6e\x0f\x44\x35\x59\x64\x75\x39\xfd\x89\x07\xc0\xff\xd9\xd7" + "\x9c\x13\x0e\xd8\x1c\x9a\xfd\x9b\x7e\x84\x8c\x9f\xed\x38\x44\x3d\x5d\x38" + "\x0e\x53\xfb\xdb\x8a\xc8\xc3\xd3\xf0\x68\x76\x05\x4f\x12\x24\x61\x10\x7d" + "\xe9\x2f\xea\x09\xc6\xf6\x92\x3a\x18\x8d\x53\xaf\xe5\x4a\x10\xf6\x0e\x6e" + "\x9d\x5a\x03\xd9\x96\xb5\xfb\xc8\x20\xf8\xa6\x37\x11\x6a\x27\xad\x04\xb4" + "\x44\xa0\x93\x2d\xd6\x0f\xbd\x12\x67\x1c\x11\xe1\xc0\xec\x73\xe7\x89\x87" + "\x9f\xaa\x3d\x42\xc6\x4d\x20\xcd\x12\x52\x74\x2a\x37\x68\xc2\x5a\x90\x15" + "\x85\x88\x8e\xce\xe1\xe6\x12\xd9\x93\x6b\x40\x3b\x07\x75\x94\x9a\x66\xcd" + "\xfd\x99\xa2\x9b\x13\x45\xba\xa8\xd9\xd5\x40\x0c\x91\x02\x4b\x0a\x60\x73" + "\x63\xb0\x13\xce\x5d\xe9\xae\x86\x9d\x3b\x8d\x95\xb0\x57\x0b\x3c\x2d\x39" + "\x14\x22\xd3\x24\x50\xcb\xcf\xae\x96\x65\x22\x86\xe9\x6d\xec\x12\x14\xa9" + "\x34\x65\x27\x98\x0a\x81\x92\xea\xc1\xc3\x9a\x3a\xaf\x6f\x15\x35\x1d\xa6" + "\xbe\x76\x4d\xf8\x97\x72\xec\x04\x07\xd0\x6e\x44\x15\xbe\xfa\xe7\xc9\x25" + "\x80\xdf\x9b\xf5\x07\x49\x7c\x8f\x29\x95\x16\x0d\x4e\x21\x8d\xaa\xcb\x02" + "\x94\x4a\xbf\x83\x34\x0c\xe8\xbe\x16\x86\xa9\x60\xfa\xf9\x0e\x2d\x90\xc5" + "\x5c\xc6\x47\x5b\xab\xc3\x17\x1a\x80\xa3\x63\x17\x49\x54\x95\x5d\x71\x01" + "\xda\xb1\x6a\xe8\x17\x91\x67\xe2\x14\x44\xb4\x43\xa9\xea\xaa\x7c\x91\xde" + "\x36\xd1\x18\xc3\x9d\x38\x9f\x8d\xd4\x46\x9a\x84\x6c\x9a\x26\x2b\xf7\xfa" + "\x18\x48\x7a\x79\xe8\xde\x11\x69\x9e\x0b\x8f\xdf\x55\x7c\xb4\x87\x19\xd4" + "\x53\xba\x71\x30\x56\x10\x9b\x93\xa2\x18\xc8\x96\x75\xac\x19\x5f\xb4\xfb" + "\x06\x63\x9b\x37\x97\x14\x49\x55\xb3\xc9\x32\x7d\x1a\xec\x00\x3d\x42\xec" + "\xd0\xea\x98\xab\xf1\x9f\xfb\x4a\xf3\x56\x1a\x67\xe7\x7c\x35\xbf\x15\xc5" + "\x9c\x24\x12\xda\x88\x1d\xb0\x2b\x1b\xfb\xce\xbf\xac\x51\x52\xbc\x99\xbc" + "\x3f\x1d\x15\xf7\x71\x00\x1b\x70\x29\xfe\xdb\x02\x8f\x8b\x85\x2b\xc4\x40" + "\x7e\xb8\x3f\x89\x1c\x9c\xa7\x33\x25\x4f\xdd\x1e\x9e\xdb\x56\x91\x9c\xe9" + "\xfe\xa2\x1c\x17\x40\x72\x52\x1c\x18\x31\x9a\x54\xb5\xd4\xef\xbe\xbd\xdf" + "\x1d\x8b\x69\xb1\xcb\xf2\x5f\x48\x9f\xcc\x98\x13\x72\x54\x7c\xf4\x1d\x00" + "\x8e\xf0\xbc\xa1\x92\x6f\x93\x4b\x73\x5e\x09\x0b\x3b\x25\x1e\xb3\x3a\x36" + "\xf8\x2e\xd9\xb2\x9c\xf4\xcb\x94\x41\x88\xfa\x0e\x1e\x38\xdd\x77\x8f\x7d" + "\x1c\x9d\x98\x7b\x28\xd1\x32\xdf\xb9\x73\x1f\xa4\xf4\xb4\x16\x93\x5b\xe4" + "\x9d\xe3\x05\x16\xaf\x35\x78\x58\x1f\x2f\x13\xf5\x61\xc0\x66\x33\x61\x94" + "\x1e\xab\x24\x9a\x4b\xc1\x23\xf8\xd1\x5c\xd7\x11\xa9\x56\xa1\xbf\x20\xfe" + "\x6e\xb7\x8a\xea\x23\x73\x36\x1d\xa0\x42\x6c\x79\xa5\x30\xc3\xbb\x1d\xe0" + "\xc9\x97\x22\xef\x1f\xde\x39\xac\x2b\x00\xa0\xa8\xee\x7c\x80\x0a\x08\xbc" + "\x22\x64\xf8\x9f\x4e\xff\xe6\x27\xac\x2f\x05\x31\xfb\x55\x4f\x6d\x21\xd7" + "\x4c\x59\x0a\x70\xad\xfa\xa3\x90\xbd\xfb\xb3\xd6\x8e\x46\x21\x5c\xab\x18" + "\x7d\x23\x68\xd5\xa7\x1f\x5e\xbe\xc0\x81\xcd\x3b\x20\xc0\x82\xdb\xe4\xcd" + "\x2f\xac\xa2\x87\x73\x79\x5d\x6b\x0c\x10\x20\x4b\x65\x9a\x93\x9e\xf2\x9b" + "\xbe\x10\x88\x24\x36\x24\x42\x99\x27\xa7\xeb\x57\x6d\xd3\xa0\x0e\xa5\xe0" + "\x1a\xf5\xd4\x75\x83\xb2\x27\x2c\x0c\x16\x1a\x80\x65\x21\xa1\x6f\xf9\xb0" + "\xa7\x22\xc0\xcf\x26\xb0\x25\xd5\x83\x6e\x22\x58\xa4\xf7\xd4\x77\x3a\xc8" + "\x01\xe4\x26\x3b\xc2\x94\xf4\x3d\xef\x7f\xa8\x70\x3f\x3a\x41\x97\x46\x35" + "\x25\x88\x76\x52\xb0\xb2\xa4\xa2\xa7\xcf\x87\xf0\x09\x14\x87\x1e\x25\x03" + "\x91\x13\xc7\xe1\x61\x8d\xa3\x40\x64\xb5\x7a\x43\xc4\x63\x24\x9f\xb8\xd0" + "\x5e\x0f\x26\xf4\xa6\xd8\x49\x72\xe7\xa9\x05\x48\x24\x14\x5f\x91\x29\x5c" + "\xdb\xe3\x9a\x6f\x92\x0f\xac\xc6\x59\x71\x2b\x46\xa5\x4b\xa2\x95\xbb\xe6" + "\xa9\x01\x54\xe9\x1b\x33\x98\x5a\x2b\xcd\x42\x0a\xd5\xc6\x7e\xc9\xad\x8e" + "\xb7\xac\x68\x64\xdb\x27\x2a\x51\x6b\xc9\x4c\x28\x39\xb0\xa8\x16\x9a\x6b" + "\xf5\x8e\x1a\x0c\x2a\xda\x8c\x88\x3b\x7b\xf4\x97\xa4\x91\x71\x26\x8e\xd1" + "\x5d\xdd\x29\x69\x38\x4e\x7f\xf4\xbf\x4a\xab\x2e\xc9\xec\xc6\x52\x9c\xf6" + "\x29\xe2\xdf\x0f\x08\xa7\x7a\x65\xaf\xa1\x2a\xa9\xb5\x05\xdf\x8b\x28\x7e" + "\xf6\xcc\x91\x49\x3d\x1c\xaa\x39\x07\x6e\x28\xef\x1e\xa0\x28\xf5\x11\x8d" + "\xe6\x1a\xe0\x2b\xb6\xae\xfc\x33\x43\xa0\x50\x29\x2f\x19\x9f\x40\x18\x57" + "\xb2\xbe\xad\x5e\x6e\xe2\xa1\xf1\x91\x02\x2f\x92\x78\x01\x6f\x04\x77\x91" + "\xa9\xd1\x8d\xa7\xd2\xa6\xd2\x7f\x2e\x0e\x51\xc2\xf6\xea\x30\xe8\xac\x49" + "\xa0\x60\x4f\x4c\x13\x54\x2e\x85\xb6\x83\x81\xb9\xfd\xcf\xa0\xce\x4b\x2d" + "\x34\x13\x54\x85\x2d\x36\x02\x45\xc5\x36\xb6\x12\xaf\x71\xf3\xe7\x7c\x90" + "\x95\xae\x2d\xbd\xe5\x04\xb2\x65\x73\x3d\xab\xfe\x10\xa2\x0f\xc7\xd6\xd3" + "\x2c\x21\xcc\xc7\x2b\x8b\x34\x44\xae\x66\x3d\x65\x92\x2d\x17\xf8\x2c\xaa" + "\x2b\x86\x5c\xd8\x89\x13\xd2\x91\xa6\x58\x99\x02\x6e\xa1\x32\x84\x39\x72" + "\x3c\x19\x8c\x36\xb0\xc3\xc8\xd0\x85\xbf\xaf\x8a\x32\x0f\xde\x33\x4b\x4a" + "\x49\x19\xb4\x4c\x2b\x95\xf6\xe8\xec\xf7\x33\x93\xf7\xf0\xd2\xa4\x0e\x60" + "\xb1\xd4\x06\x52\x6b\x02\x2d\xdc\x33\x18\x10\xb1\xa5\xf7\xc3\x47\xbd\x53" + "\xed\x1f\x10\x5d\x6a\x0d\x30\xab\xa4\x77\xe1\x78\x88\x9a\xb2\xec\x55\xd5" + "\x58\xde\xab\x26\x30\x20\x43\x36\x96\x2b\x4d\xb5\xb6\x63\xb6\x90\x2b\x89" + "\xe8\x5b\x31\xbc\x6a\xf5\x0f\xc5\x0a\xcc\xb3\xfb\x9b\x57\xb6\x63\x29\x70" + "\x31\x37\x8d\xb4\x78\x96\xd7\xfb\xaf\x6c\x60\x0a\xdd\x2c\x67\xf9\x36\xdb" + "\x03\x79\x86\xdb\x85\x6e\xb4\x9c\xf2\xdb\x3f\x7d\xa6\xd2\x36\x50\xe4\x38" + "\xf1\x88\x40\x41\xb0\x13\x11\x9e\x4c\x2a\xe5\xaf\x37\xcc\xcd\xfb\x68\x66" + "\x07\x38\xb5\x8b\x3c\x59\xd1\xc0\x24\x84\x37\x47\x2a\xba\x1f\x35\xca\x1f" + "\xb9\x0c\xd7\x14\xaa\x9f\x63\x55\x34\xf4\x9e\x7c\x5b\xba\x81\xc2\xb6\xb3" + "\x6f\xde\xe2\x1c\xa2\x7e\x34\x7f\x79\x3d\x2c\xe9\x44\xed\xb2\x3c\x8c\x9b" + "\x91\x4b\xe1\x03\x35\xe3\x50\xfe\xb5\x07\x03\x94\xb7\xa4\xa1\x5c\x0c\xa1" + "\x20\x28\x35\x68\xb7\xbf\xc2\x54\xfe\x83\x8b\x13\x7a\x21\x47\xce\x7c\x11" + "\x3a\x3a\x4d\x65\x49\x9d\x9e\x86\xb8\x7d\xbc\xc7\xf0\x3b\xbd\x3a\x3a\xb1" + "\xaa\x24\x3e\xce\x5b\xa9\xbc\xf2\x5f\x82\x83\x6c\xfe\x47\x3b\x2d\x83\xe7" + "\xa7\x20\x1c\xd0\xb9\x6a\x72\x45\x1e\x86\x3f\x6c\x3b\xa6\x64\xa6\xd0\x73" + "\xd1\xf7\xb5\xed\x99\x08\x65\xd9\x78\xbd\x38\x15\xd0\x60\x94\xfc\x9a\x2a" + "\xba\x52\x21\xc2\x2d\x5a\xb9\x96\x38\x9e\x37\x21\xe3\xaf\x5f\x05\xbe\xdd" + "\xc2\x87\x5e\x0d\xfa\xeb\x39\x02\x1e\xe2\x7a\x41\x18\x7c\xbb\x45\xef\x40" + "\xc3\xe7\x3b\xc0\x39\x89\xf9\xa3\x0d\x12\xc5\x4b\xa7\xd2\x14\x1d\xa8\xa8" + "\x75\x49\x3e\x65\x77\x6e\xf3\x5f\x97\xde\xbc\x22\x86\xcc\x4a\xf9\xb4\x62" + "\x3e\xee\x90\x2f\x84\x0c\x52\xf1\xb8\xad\x65\x89\x39\xae\xf7\x1f\x3f\x72" + "\xb9\xec\x1d\xe2\x15\x88\xbd\x35\x48\x4e\xa4\x44\x36\x34\x3f\xf9\x5e\xad" + "\x6a\xb1\xd8\xaf\xb1\xb2\xa3\x03\xdf\x1b\x71\xe5\x3c\x4a\xea\x6b\x2e\x3e" + "\x93\x72\xbe\x0d\x1b\xc9\x97\x98\xb0\xce\x3c\xc1\x0d\x2a\x59\x6d\x56\x5d" + "\xba\x82\xf8\x8c\xe4\xcf\xf3\xb3\x3d\x5d\x24\xe9\xc0\x83\x11\x24\xbf\x1a" + "\xd5\x4b\x79\x25\x32\x98\x3d\xd6\xc3\xa8\xb7\xd0", + "\xeb\xd5\xcc\xb0", 1, 16512, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; diff --git a/test/kat-app/crc_test.c b/test/kat-app/crc_test.c index a9978913..772cbc71 100644 --- a/test/kat-app/crc_test.c +++ b/test/kat-app/crc_test.c @@ -34,7 +34,8 @@ #include "utils.h" -int crc_test(struct IMB_MGR *mb_mgr); +int +crc_test(struct IMB_MGR *mb_mgr); static uint32_t m_lut[256]; static struct IMB_MGR *p_mgr; @@ -107,10 +108,7 @@ crc32_ref_init_lut(const uint32_t poly, uint32_t *rlut) * @return New CRC value */ static uint32_t -crc32_ref_calc_lut(const uint8_t *data, - uint64_t data_len, - uint32_t crc, - const uint32_t *rlut) +crc32_ref_calc_lut(const uint8_t *data, uint64_t data_len, uint32_t crc, const uint32_t *rlut) { if (data == NULL || rlut == NULL) return crc; @@ -159,10 +157,7 @@ crc32_init_lut(const uint32_t poly, uint32_t *lut) * @return New CRC value */ static uint32_t -crc32_calc_lut(const uint8_t *data, - uint64_t data_len, - uint32_t crc, - const uint32_t *lut) +crc32_calc_lut(const uint8_t *data, uint64_t data_len, uint32_t crc, const uint32_t *lut) { if (data == NULL || lut == NULL) return crc; @@ -201,18 +196,15 @@ randomize_buffer(void *p, size_t len) * @retval 1 error */ static int -test_crc_polynomial(void (*fn_crc_setup)(void), - uint32_t (*fn_crc_calc)(const void *, uint64_t), - uint32_t (*fn_crc)(const void *, uint64_t, const unsigned), - const char *title, +test_crc_polynomial(void (*fn_crc_setup)(void), uint32_t (*fn_crc_calc)(const void *, uint64_t), + uint32_t (*fn_crc)(const void *, uint64_t, const unsigned), const char *title, struct test_suite_context *ctx) { uint8_t buffer[2048]; size_t n; unsigned job_api; - if (fn_crc_setup == NULL || fn_crc_calc == NULL || - fn_crc == NULL || title == NULL) { + if (fn_crc_setup == NULL || fn_crc_calc == NULL || fn_crc == NULL || title == NULL) { printf("crc_test: NULL parameter passed!\n"); test_suite_update(ctx, 0, 1); return 1; @@ -238,8 +230,7 @@ test_crc_polynomial(void (*fn_crc_setup)(void), if (reference_crc != received_crc) { printf("! CRC mismatch for buffer size %lu, " "received = 0x%lx, expected = 0x%lx\n", - (unsigned long) n, - (unsigned long) received_crc, + (unsigned long) n, (unsigned long) received_crc, (unsigned long) reference_crc); hexdump(stdout, "buffer content", buffer, n); test_suite_update(ctx, 0, 1); @@ -289,14 +280,14 @@ crc_job(const void *p, const uint64_t len, IMB_HASH_ALG hash_alg) return 0; } - job->cipher_mode = IMB_CIPHER_NULL; - job->hash_alg = hash_alg; - job->src = p; - job->dst = NULL; - job->msg_len_to_hash_in_bytes = len; + job->cipher_mode = IMB_CIPHER_NULL; + job->hash_alg = hash_alg; + job->src = p; + job->dst = NULL; + job->msg_len_to_hash_in_bytes = len; job->hash_start_src_offset_in_bytes = UINT64_C(0); - job->auth_tag_output = (uint8_t *) &auth_tag; - job->auth_tag_output_len_in_bytes = sizeof(auth_tag); + job->auth_tag_output = (uint8_t *) &auth_tag; + job->auth_tag_output_len_in_bytes = sizeof(auth_tag); job = IMB_SUBMIT_JOB(p_mgr); while (job) { @@ -321,8 +312,7 @@ crc_job(const void *p, const uint64_t len, IMB_HASH_ALG hash_alg) * @return CRC value */ static uint32_t -crc32_ethernet_fcs_tested_calc(const void *p, uint64_t len, - const unsigned job_api) +crc32_ethernet_fcs_tested_calc(const void *p, uint64_t len, const unsigned job_api) { if (job_api) return crc_job(p, len, IMB_AUTH_CRC32_ETHERNET_FCS); @@ -493,7 +483,7 @@ crc32_lte24b_tested_calc(const void *p, uint64_t len, const unsigned job_api) if (job_api) return crc_job(p, len, IMB_AUTH_CRC24_LTE_B); else - return IMB_CRC24_LTE_B(p_mgr, p, len); + return IMB_CRC24_LTE_B(p_mgr, p, len); } /** @@ -625,7 +615,7 @@ crc7_fp_header_tested_calc(const void *p, uint64_t len, const unsigned job_api) if (job_api) return crc_job(p, len, IMB_AUTH_CRC7_FP_HEADER); else - return IMB_CRC7_FP_HEADER(p_mgr, p, len); + return IMB_CRC7_FP_HEADER(p_mgr, p, len); } /** @@ -708,13 +698,12 @@ crc6_iuup_header_calc(const void *p, uint64_t len) * @return CRC value */ static uint32_t -crc6_iuup_header_tested_calc(const void *p, uint64_t len, - const unsigned job_api) +crc6_iuup_header_tested_calc(const void *p, uint64_t len, const unsigned job_api) { if (job_api) return crc_job(p, len, IMB_AUTH_CRC6_IUUP_HEADER); else - return IMB_CRC6_IUUP_HEADER(p_mgr, p, len); + return IMB_CRC6_IUUP_HEADER(p_mgr, p, len); } /** @@ -751,8 +740,7 @@ crc32_wimax_ofdma_data_calc(const void *p, uint64_t len) * @return CRC value */ static uint32_t -crc32_wimax_ofdma_data_tested_calc(const void *p, uint64_t len, - const unsigned job_api) +crc32_wimax_ofdma_data_tested_calc(const void *p, uint64_t len, const unsigned job_api) { if (job_api) return crc_job(p, len, IMB_AUTH_CRC32_WIMAX_OFDMA_DATA); @@ -794,8 +782,7 @@ crc8_wimax_ofdma_hcs_calc(const void *p, uint64_t len) * @return CRC value */ static uint32_t -crc8_wimax_ofdma_hcs_tested_calc(const void *p, uint64_t len, - const unsigned job_api) +crc8_wimax_ofdma_hcs_tested_calc(const void *p, uint64_t len, const unsigned job_api) { if (job_api) return crc_job(p, len, IMB_AUTH_CRC8_WIMAX_OFDMA_HCS); @@ -816,90 +803,68 @@ crc_test(struct IMB_MGR *mb_mgr) /* reflected CRC32 functions */ test_suite_start(&ctx, "ETH-CRC32"); - test_crc_polynomial(crc32_ethernet_fcs_setup, - crc32_ethernet_fcs_ref_calc, - crc32_ethernet_fcs_tested_calc, - "CRC32 ETHERNET FCS 0x04c11db7", &ctx); + test_crc_polynomial(crc32_ethernet_fcs_setup, crc32_ethernet_fcs_ref_calc, + crc32_ethernet_fcs_tested_calc, "CRC32 ETHERNET FCS 0x04c11db7", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "X25-CRC16"); - test_crc_polynomial(crc16_x25_setup, - crc16_x25_ref_calc, - crc16_x25_tested_calc, + test_crc_polynomial(crc16_x25_setup, crc16_x25_ref_calc, crc16_x25_tested_calc, "CRC16 X25 0x1021", &ctx); errors += test_suite_end(&ctx); /* CRC32 functions */ test_suite_start(&ctx, "SCTP-CRC32"); - test_crc_polynomial(crc32_sctp_setup, - crc32_sctp_calc, - crc32_sctp_tested_calc, + test_crc_polynomial(crc32_sctp_setup, crc32_sctp_calc, crc32_sctp_tested_calc, "CRC32 SCTP 0x1edc6f41 (Castagnoli93)", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "LTE-A-CRC24"); - test_crc_polynomial(crc32_lte24a_setup, - crc32_lte24a_calc, - crc32_lte24a_tested_calc, + test_crc_polynomial(crc32_lte24a_setup, crc32_lte24a_calc, crc32_lte24a_tested_calc, "LTE CRC24A 0x864cFB", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "LTE-B-CRC24"); - test_crc_polynomial(crc32_lte24b_setup, - crc32_lte24b_calc, - crc32_lte24b_tested_calc, + test_crc_polynomial(crc32_lte24b_setup, crc32_lte24b_calc, crc32_lte24b_tested_calc, "LTE CRC24B 0x800063", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "FP-CRC16"); - test_crc_polynomial(crc16_fp_data_setup, - crc16_fp_data_calc, - crc16_fp_data_tested_calc, + test_crc_polynomial(crc16_fp_data_setup, crc16_fp_data_calc, crc16_fp_data_tested_calc, "Framing Protocol Data CRC16 0x8005", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "FP-CRC11"); - test_crc_polynomial(crc11_fp_header_setup, - crc11_fp_header_calc, - crc11_fp_header_tested_calc, - "Framing Protocol Header CRC11 0x307", &ctx); + test_crc_polynomial(crc11_fp_header_setup, crc11_fp_header_calc, + crc11_fp_header_tested_calc, "Framing Protocol Header CRC11 0x307", + &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "FP-CRC7"); - test_crc_polynomial(crc7_fp_header_setup, - crc7_fp_header_calc, - crc7_fp_header_tested_calc, + test_crc_polynomial(crc7_fp_header_setup, crc7_fp_header_calc, crc7_fp_header_tested_calc, "Framing Protocol Header CRC7 0x45", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "IUUP-CRC10"); - test_crc_polynomial(crc10_iuup_data_setup, - crc10_iuup_data_calc, - crc10_iuup_data_tested_calc, - "IUUP Data CRC10 0x233", &ctx); + test_crc_polynomial(crc10_iuup_data_setup, crc10_iuup_data_calc, + crc10_iuup_data_tested_calc, "IUUP Data CRC10 0x233", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "IUUP-CRC6"); - test_crc_polynomial(crc6_iuup_header_setup, - crc6_iuup_header_calc, - crc6_iuup_header_tested_calc, - "IUUP Header CRC6 0x2f", &ctx); + test_crc_polynomial(crc6_iuup_header_setup, crc6_iuup_header_calc, + crc6_iuup_header_tested_calc, "IUUP Header CRC6 0x2f", &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "WIMAX-OFDMA-CRC32"); - test_crc_polynomial(crc32_wimax_ofdma_data_setup, - crc32_wimax_ofdma_data_calc, - crc32_wimax_ofdma_data_tested_calc, - "WIMAX OFDMA CRC32 0x04c11db7", &ctx); + test_crc_polynomial(crc32_wimax_ofdma_data_setup, crc32_wimax_ofdma_data_calc, + crc32_wimax_ofdma_data_tested_calc, "WIMAX OFDMA CRC32 0x04c11db7", + &ctx); errors += test_suite_end(&ctx); test_suite_start(&ctx, "WIMAX-OFDMA-CRC8"); - test_crc_polynomial(crc8_wimax_ofdma_hcs_setup, - crc8_wimax_ofdma_hcs_calc, - crc8_wimax_ofdma_hcs_tested_calc, - "WIMAX OFDMA CRC8 HCS 0x07", &ctx); + test_crc_polynomial(crc8_wimax_ofdma_hcs_setup, crc8_wimax_ofdma_hcs_calc, + crc8_wimax_ofdma_hcs_tested_calc, "WIMAX OFDMA CRC8 HCS 0x07", &ctx); errors += test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/ctr_test.c b/test/kat-app/ctr_test.c index 72dd09f2..f571bda9 100644 --- a/test/kat-app/ctr_test.c +++ b/test/kat-app/ctr_test.c @@ -38,23 +38,16 @@ #define BYTE_ROUND_UP(x) ((x + 7) / 8) -int ctr_test(struct IMB_MGR *); +int +ctr_test(struct IMB_MGR *); extern const struct cipher_test ctr_test_json[]; extern const struct cipher_test ctr_bit_test_json[]; static int -test_ctr(struct IMB_MGR *mb_mgr, - const void *expkey, - unsigned key_len, - const void *iv, - unsigned iv_len, - const uint8_t *in_text, - const uint8_t *out_text, - unsigned text_len, - const IMB_CIPHER_DIRECTION dir, - const IMB_CHAIN_ORDER order, - const IMB_CIPHER_MODE alg) +test_ctr(struct IMB_MGR *mb_mgr, const void *expkey, unsigned key_len, const void *iv, + unsigned iv_len, const uint8_t *in_text, const uint8_t *out_text, unsigned text_len, + const IMB_CIPHER_DIRECTION dir, const IMB_CHAIN_ORDER order, const IMB_CIPHER_MODE alg) { uint32_t text_byte_len; struct IMB_JOB *job; @@ -70,8 +63,8 @@ test_ctr(struct IMB_MGR *mb_mgr, target = malloc(text_byte_len + (sizeof(padding) * 2)); if (target == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end; } memset(target, -1, text_byte_len + (sizeof(padding) * 2)); @@ -111,8 +104,8 @@ test_ctr(struct IMB_MGR *mb_mgr, if (job->status != IMB_STATUS_COMPLETED) { const int err = imb_get_errno(mb_mgr); - printf("%d job status: %d, error code %d, %s\n", - __LINE__, job->status, err, imb_get_strerror(err)); + printf("%d job status: %d, error code %d, %s\n", __LINE__, job->status, err, + imb_get_strerror(err)); goto end; } job = IMB_FLUSH_JOB(mb_mgr); @@ -132,8 +125,7 @@ test_ctr(struct IMB_MGR *mb_mgr, hexdump(stderr, "Target", target, text_byte_len + 32); goto end; } - if (memcmp(padding, target + sizeof(padding) + text_byte_len, - sizeof(padding))) { + if (memcmp(padding, target + sizeof(padding) + text_byte_len, sizeof(padding))) { printf("overwrite tail\n"); hexdump(stderr, "Target", target, text_byte_len + 32); goto end; @@ -141,25 +133,17 @@ test_ctr(struct IMB_MGR *mb_mgr, ret = 0; while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; - end: +end: if (target != NULL) free(target); return ret; } static int -test_ctr_burst(struct IMB_MGR *mb_mgr, - const void *expkey, - unsigned key_len, - const void *iv, - unsigned iv_len, - const uint8_t *in_text, - const uint8_t *out_text, - unsigned text_len, - const IMB_CIPHER_DIRECTION dir, - const IMB_CHAIN_ORDER order, - const IMB_CIPHER_MODE alg, - const uint32_t num_jobs) +test_ctr_burst(struct IMB_MGR *mb_mgr, const void *expkey, unsigned key_len, const void *iv, + unsigned iv_len, const uint8_t *in_text, const uint8_t *out_text, unsigned text_len, + const IMB_CIPHER_DIRECTION dir, const IMB_CHAIN_ORDER order, + const IMB_CIPHER_MODE alg, const uint32_t num_jobs) { uint32_t text_byte_len, i, completed_jobs, jobs_rx = 0; struct IMB_JOB *job, *jobs[MAX_CTR_JOBS]; @@ -208,7 +192,7 @@ test_ctr_burst(struct IMB_MGR *mb_mgr, job->msg_len_to_cipher_in_bits = text_len; job->hash_alg = IMB_AUTH_NULL; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); imb_set_session(mb_mgr, job); } @@ -217,8 +201,7 @@ test_ctr_burst(struct IMB_MGR *mb_mgr, int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } else { printf("submit_burst error: not enough " @@ -231,28 +214,26 @@ test_ctr_burst(struct IMB_MGR *mb_mgr, job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); goto end; } - if (memcmp(out_text, targets[i] + sizeof(padding), - text_byte_len)) { + if (memcmp(out_text, targets[i] + sizeof(padding), text_byte_len)) { printf("mismatched\n"); - hexdump(stderr, "Target", targets[i] + sizeof(padding), - text_byte_len); + hexdump(stderr, "Target", targets[i] + sizeof(padding), text_byte_len); hexdump(stderr, "Expected", out_text, text_byte_len); goto end; } if (memcmp(padding, targets[i], sizeof(padding))) { printf("overwrite head\n"); - hexdump(stderr, "Target", targets[i], text_byte_len + - (sizeof(padding) * 2)); + hexdump(stderr, "Target", targets[i], + text_byte_len + (sizeof(padding) * 2)); goto end; } - if (memcmp(padding, targets[i] + sizeof(padding) + - text_byte_len, sizeof(padding))) { + if (memcmp(padding, targets[i] + sizeof(padding) + text_byte_len, + sizeof(padding))) { printf("overwrite tail\n"); - hexdump(stderr, "Target", targets[i], text_byte_len + - (sizeof(padding) * 2)); + hexdump(stderr, "Target", targets[i], + text_byte_len + (sizeof(padding) * 2)); goto end; } jobs_rx++; @@ -263,9 +244,9 @@ test_ctr_burst(struct IMB_MGR *mb_mgr, goto end; } ret = 0; - end: +end: - end_alloc: +end_alloc: if (targets != NULL) { for (i = 0; i < num_jobs; i++) free(targets[i]); @@ -276,17 +257,10 @@ test_ctr_burst(struct IMB_MGR *mb_mgr, } static int -test_ctr_cipher_burst(struct IMB_MGR *mb_mgr, - const void *expkey, - unsigned key_len, - const void *iv, - unsigned iv_len, - const uint8_t *in_text, - const uint8_t *out_text, - unsigned text_len, - const IMB_CIPHER_DIRECTION dir, - const IMB_CHAIN_ORDER order, - const IMB_CIPHER_MODE alg, +test_ctr_cipher_burst(struct IMB_MGR *mb_mgr, const void *expkey, unsigned key_len, const void *iv, + unsigned iv_len, const uint8_t *in_text, const uint8_t *out_text, + unsigned text_len, const IMB_CIPHER_DIRECTION dir, + const IMB_CHAIN_ORDER order, const IMB_CIPHER_MODE alg, const uint32_t num_jobs) { uint32_t text_byte_len, i, completed_jobs, jobs_rx = 0; @@ -333,18 +307,15 @@ test_ctr_cipher_burst(struct IMB_MGR *mb_mgr, job->msg_len_to_cipher_in_bits = text_len; job->hash_alg = IMB_AUTH_NULL; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); } - - completed_jobs = IMB_SUBMIT_CIPHER_BURST(mb_mgr, jobs, num_jobs, - alg, dir, key_len); + completed_jobs = IMB_SUBMIT_CIPHER_BURST(mb_mgr, jobs, num_jobs, alg, dir, key_len); if (completed_jobs != num_jobs) { int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } else { printf("submit_burst error: not enough " @@ -357,28 +328,26 @@ test_ctr_cipher_burst(struct IMB_MGR *mb_mgr, job = &jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); goto end; } - if (memcmp(out_text, targets[i] + sizeof(padding), - text_byte_len)) { + if (memcmp(out_text, targets[i] + sizeof(padding), text_byte_len)) { printf("mismatched\n"); - hexdump(stderr, "Target", targets[i] + sizeof(padding), - text_byte_len); + hexdump(stderr, "Target", targets[i] + sizeof(padding), text_byte_len); hexdump(stderr, "Expected", out_text, text_byte_len); goto end; } if (memcmp(padding, targets[i], sizeof(padding))) { printf("overwrite head\n"); - hexdump(stderr, "Target", targets[i], text_byte_len + - (sizeof(padding) * 2)); + hexdump(stderr, "Target", targets[i], + text_byte_len + (sizeof(padding) * 2)); goto end; } - if (memcmp(padding, targets[i] + sizeof(padding) + - text_byte_len, sizeof(padding))) { + if (memcmp(padding, targets[i] + sizeof(padding) + text_byte_len, + sizeof(padding))) { printf("overwrite tail\n"); - hexdump(stderr, "Target", targets[i], text_byte_len + - (sizeof(padding) * 2)); + hexdump(stderr, "Target", targets[i], + text_byte_len + (sizeof(padding) * 2)); goto end; } jobs_rx++; @@ -389,9 +358,9 @@ test_ctr_cipher_burst(struct IMB_MGR *mb_mgr, goto end; } ret = 0; - end: +end: - end_alloc: +end_alloc: if (targets != NULL) { for (i = 0; i < num_jobs; i++) free(targets[i]); @@ -402,18 +371,15 @@ test_ctr_cipher_burst(struct IMB_MGR *mb_mgr, } static void -test_ctr_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx128, - struct test_suite_context *ctx192, - struct test_suite_context *ctx256, - const struct cipher_test *v, - const IMB_CIPHER_MODE alg) +test_ctr_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, + struct test_suite_context *ctx192, struct test_suite_context *ctx256, + const struct cipher_test *v, const IMB_CIPHER_MODE alg) { - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); - printf("AES-CTR standard test vectors:\n"); - for (; v->msg != NULL; v++) { + printf("AES-CTR standard test vectors:\n"); + for (; v->msg != NULL; v++) { struct test_suite_context *ctx; if (!quiet_mode) { @@ -447,9 +413,8 @@ test_ctr_vectors(struct IMB_MGR *mb_mgr, } if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, - (unsigned) v->ivSize / 8, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg)) { + (unsigned) v->ivSize / 8, (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize, IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -457,9 +422,8 @@ test_ctr_vectors(struct IMB_MGR *mb_mgr, } if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, - (unsigned) v->ivSize / 8, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg)) { + (unsigned) v->ivSize / 8, (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -482,47 +446,43 @@ test_ctr_vectors(struct IMB_MGR *mb_mgr, local_iv[14] = 0x00; local_iv[15] = 0x01; - if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, - local_iv, new_iv_len, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg)) { + if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, local_iv, + new_iv_len, (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize, IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, + alg)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, - local_iv, new_iv_len, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg)) { + if (test_ctr(mb_mgr, expkey, (unsigned) v->keySize / 8, local_iv, + new_iv_len, (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, + alg)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } } - } + } if (!quiet_mode) printf("\n"); } static void -test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx128, - struct test_suite_context *ctx192, - struct test_suite_context *ctx256, - const struct cipher_test *v, - const IMB_CIPHER_MODE alg, +test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx128, + struct test_suite_context *ctx192, struct test_suite_context *ctx256, + const struct cipher_test *v, const IMB_CIPHER_MODE alg, const uint32_t num_jobs) { - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); if (!quiet_mode) - printf("AES-CTR standard test vectors - Burst API (N jobs = %u):\n", - num_jobs); - for (; v->msg != NULL; v++) { + printf("AES-CTR standard test vectors - Burst API (N jobs = %u):\n", num_jobs); + for (; v->msg != NULL; v++) { struct test_suite_context *ctx; if (!quiet_mode) { @@ -557,9 +517,8 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, (unsigned) v->ivSize / 8, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, - num_jobs)) { + (const void *) v->ct, (unsigned) v->msgSize, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, alg, num_jobs)) { printf("error #%zu encrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -568,17 +527,15 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, (unsigned) v->ivSize / 8, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, - num_jobs)) { + (const void *) v->msg, (unsigned) v->msgSize, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, alg, num_jobs)) { printf("error #%zu decrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (v->ivSize / 8 == 12 && - alg == IMB_CIPHER_CNTR) { + if (v->ivSize / 8 == 12 && alg == IMB_CIPHER_CNTR) { /* IV in the table didn't include block counter (12 bytes). * Let's encrypt & decrypt the same but * with 16 byte IV that includes block counter. @@ -594,22 +551,20 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, local_iv[14] = 0x00; local_iv[15] = 0x01; - if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, - local_iv, new_iv_len, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, - num_jobs)) { + if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, local_iv, + new_iv_len, (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, alg, num_jobs)) { printf("error #%zu encrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, - local_iv, new_iv_len, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, - num_jobs)) { + if (test_ctr_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, local_iv, + new_iv_len, (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, alg, num_jobs)) { printf("error #%zu decrypt burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -624,8 +579,7 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, if (test_ctr_cipher_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, (unsigned) v->ivSize / 8, (const void *) v->msg, (const void *) v->ct, (unsigned) v->msgSize, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, - num_jobs)) { + IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, alg, num_jobs)) { printf("error #%zu encrypt cipher-only burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -635,16 +589,14 @@ test_ctr_vectors_burst(struct IMB_MGR *mb_mgr, if (test_ctr_cipher_burst(mb_mgr, expkey, (unsigned) v->keySize / 8, v->iv, (unsigned) v->ivSize / 8, (const void *) v->ct, (const void *) v->msg, (unsigned) v->msgSize, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, - num_jobs)) { + IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, alg, num_jobs)) { printf("error #%zu decrypt cipher-only burst\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (v->ivSize / 8 == 12 && - alg == IMB_CIPHER_CNTR) { + if (v->ivSize / 8 == 12 && alg == IMB_CIPHER_CNTR) { /* IV in the table didn't include block counter (12 bytes). * Let's encrypt & decrypt the same but * with 16 byte IV that includes block counter. @@ -700,11 +652,10 @@ ctr_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx128, "AES-CTR-128"); test_suite_start(&ctx192, "AES-CTR-192"); test_suite_start(&ctx256, "AES-CTR-256"); - test_ctr_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, - ctr_test_json, IMB_CIPHER_CNTR); + test_ctr_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, ctr_test_json, IMB_CIPHER_CNTR); for (i = 1; i <= MAX_CTR_JOBS; i++) - test_ctr_vectors_burst(mb_mgr, &ctx128, &ctx192, &ctx256, - ctr_test_json, IMB_CIPHER_CNTR, i); + test_ctr_vectors_burst(mb_mgr, &ctx128, &ctx192, &ctx256, ctr_test_json, + IMB_CIPHER_CNTR, i); errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx192); errors += test_suite_end(&ctx256); @@ -713,15 +664,14 @@ ctr_test(struct IMB_MGR *mb_mgr) test_suite_start(&ctx128, "AES-CTR-128-BIT-LENGTH"); test_suite_start(&ctx192, "AES-CTR-192-BIT-LENGTH"); test_suite_start(&ctx256, "AES-CTR-256-BIT-LENGTH"); - test_ctr_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, - ctr_bit_test_json, IMB_CIPHER_CNTR_BITLEN); + test_ctr_vectors(mb_mgr, &ctx128, &ctx192, &ctx256, ctr_bit_test_json, + IMB_CIPHER_CNTR_BITLEN); for (i = 1; i <= MAX_CTR_JOBS; i++) - test_ctr_vectors_burst(mb_mgr, &ctx128, &ctx192, &ctx256, - ctr_bit_test_json, IMB_CIPHER_CNTR_BITLEN, i); + test_ctr_vectors_burst(mb_mgr, &ctx128, &ctx192, &ctx256, ctr_bit_test_json, + IMB_CIPHER_CNTR_BITLEN, i); errors += test_suite_end(&ctx128); errors += test_suite_end(&ctx192); errors += test_suite_end(&ctx256); - - return errors; + return errors; } diff --git a/test/kat-app/ctr_test.json.c b/test/kat-app/ctr_test.json.c index db47594e..3ff0093b 100644 --- a/test/kat-app/ctr_test.json.c +++ b/test/kat-app/ctr_test.json.c @@ -29,404 +29,385 @@ #include "cipher_test.h" const struct cipher_test ctr_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc3686 */ - {96, 128, 1, - "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", - "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", - "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", - "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79\x2d\x61\x75\xa3\x26\x13\x11\xb8", 1, - 128}, - {96, 128, 2, - "\x7e\x24\x06\x78\x17\xfa\xe0\xd7\x43\xd6\xce\x1f\x32\x53\x91\x63", - "\x00\x6c\xb6\xdb\xc0\x54\x3b\x59\xda\x48\xd9\x0b", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x51\x04\xa1\x06\x16\x8a\x72\xd9\x79\x0d\x41\xee\x8e\xda\xd3\x88\xeb\x2e" - "\x1e\xfc\x46\xda\x57\xc8\xfc\xe6\x30\xdf\x91\x41\xbe\x28", - 1, 256}, - {96, 128, 3, - "\x76\x91\xbe\x03\x5e\x50\x20\xa8\xac\x6e\x61\x85\x29\xf9\xa0\xdc", - "\x00\xe0\x01\x7b\x27\x77\x7f\x3f\x4a\x17\x86\xf0", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", - "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9\xcf\x46\x52\xe9\xef\xdb\x72\xd7\x45\x40" - "\xa4\x2b\xde\x6d\x78\x36\xd5\x9a\x5c\xea\xae\xf3\x10\x53\x25\xb2\x07\x2f", - 1, 288}, - {96, 192, 4, - "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed\x86\x3d" - "\x06\xcc\xfd\xb7\x85\x15", - "\x00\x00\x00\x48\x36\x73\x3c\x14\x7d\x6d\x93\xcb", - "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", - "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8\x4e\x79\x35\xa0\x03\xcb\xe9\x28", 1, - 128}, - {96, 192, 5, - "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c\x19\xe7\x34\x08\x19\xe0\xf6\x9c\x67\x8c" - "\x3d\xb8\xe6\xf6\xa9\x1a", - "\x00\x96\xb0\x3b\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x45\x32\x43\xfc\x60\x9b\x23\x32\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f\x84\x90" - "\x70\x1c\x5a\xd4\xa7\x9c\xfc\x1f\xe0\xff\x42\xf4\xfb\x00", - 1, 256}, - {96, 192, 6, - "\x02\xbf\x39\x1e\xe8\xec\xb1\x59\xb9\x59\x61\x7b\x09\x65\x27\x9b\xf5\x9b" - "\x60\xa7\x86\xd3\xe0\xfe", - "\x00\x07\xbd\xfd\x5c\xbd\x60\x27\x8d\xcc\x09\x12", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", - "\x96\x89\x3f\xc5\x5e\x5c\x72\x2f\x54\x0b\x7d\xd1\xdd\xf7\xe7\x58\xd2\x88" - "\xbc\x95\xc6\x91\x65\x88\x45\x36\xc8\x11\x66\x2f\x21\x88\xab\xee\x09\x35", - 1, 288}, - {96, 256, 7, - "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f\x4c\x8a\x05\x42\xc8\x69\x6f\x6c\x6a\x81" - "\xaf\x1e\xec\x96\xb4\xd3\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04", - "\x00\x00\x00\x60\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", - "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", - "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7\x56\x08\x63\xdc\x71\xe3\xe0\xc0", 1, - 128}, - {96, 256, 8, - "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb\x07\x96\x36\x58\x79\xef\xf8\x86\xc6\x6d" - "\xd5\x1a\x5b\x6a\x99\x74\x4b\x50\x59\x0c\x87\xa2\x38\x84", - "\x00\xfa\xac\x24\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\xf0\x5e\x23\x1b\x38\x94\x61\x2c\x49\xee\x00\x0b\x80\x4e\xb2\xa9\xb8\x30" - "\x6b\x50\x8f\x83\x9d\x6a\x55\x30\x83\x1d\x93\x44\xaf\x1c", - 1, 256}, - {96, 256, 9, - "\xff\x7a\x61\x7c\xe6\x91\x48\xe4\xf1\x72\x6e\x2f\x43\x58\x1d\xe2\xaa\x62" - "\xd9\xf8\x05\x53\x2e\xdf\xf1\xee\xd6\x87\xfb\x54\x15\x3d", - "\x00\x1c\xc5\xb7\x51\xa5\x1d\x70\xa1\xc1\x11\x48", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", - "\xeb\x6c\x52\x82\x1d\x0b\xbb\xf7\xce\x75\x94\x46\x2a\xca\x4f\xaa\xb4\x07" - "\xdf\x86\x65\x69\xfd\x07\xf4\x8c\xc0\xb5\x83\xd6\x07\x1f\x1e\xc0\xe6\xb8", - 1, 288}, - {96, 128, 10, - "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", - "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", - "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" - "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" - "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" - "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" - "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" - "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" - "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" - "\x98\xb9", - "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" - "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" - "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" - "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" - "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" - "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" - "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" - "\x16\x7a", - 1, 1024}, - {96, 128, 11, - "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", - "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", - "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" - "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" - "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" - "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" - "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" - "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" - "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" - "\x98\xb9\x12\xad\x82\xdf\x2f\xf8\x9c\xe0", - "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" - "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" - "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" - "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" - "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" - "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" - "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" - "\x16\x7a\x7a\x13\xb4\x40\x69\x9b\x58\x16", - 1, 1088}, - {96, 128, 12, - "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", - "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", - "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" - "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" - "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" - "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" - "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" - "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" - "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" - "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" - "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" - "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" - "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" - "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" - "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" - "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" - "\xac\xd9\xad\x94", - "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" - "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" - "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" - "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" - "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" - "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" - "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" - "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" - "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" - "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" - "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" - "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" - "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" - "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" - "\x51\x6c\x16\x7a", - 1, 2048}, - {96, 128, 13, - "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", - "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", - "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" - "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" - "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" - "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" - "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" - "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" - "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" - "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" - "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" - "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" - "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" - "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" - "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" - "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" - "\xac\xd9\xad\x94\x66\xb8\x3f\x3a\x21\x9f\xd0\x43\x46\xdd\x65\x8b\x44\x99" - "\x66\x91\x64\xe2\x69\x6f\xbb\x85\x8c\xcc\x7f\xea\x96\xd1\x5e\xb4\x7c\xd0" - "\xab\x02\x8d\xa3\x59\x3b\x8c\xd5\xd0\xe7\xb4\xc4", - "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" - "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" - "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" - "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" - "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" - "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" - "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" - "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" - "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" - "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" - "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" - "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" - "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" - "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" - "\x51\x6c\x16\x7a\xed\x52\x55\xb9\x76\x6c\x5e\x6e\x76\x97\x00\xc7\xeb\xfe" - "\xec\x10\x94\x2c\xa9\xaf\x9b\x09\x19\xb3\x17\x29\x96\xba\x8e\xac\x3d\x0a" - "\x9b\x70\x54\x0f\x1e\xd4\xe8\x13\xe6\x8f\xad\xfd", - 1, 2400}, - {96, 128, 14, - "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", - "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", - "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" - "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" - "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" - "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" - "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" - "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" - "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" - "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" - "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" - "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" - "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" - "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" - "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" - "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" - "\xac\xd9\xad\x94\x66\xb8\x3f\x3a\x21\x9f\xd0\x43\x46\xdd\x65\x8b\x44\x99" - "\x66\x91\x64\xe2\x69\x6f\xbb\x85\x8c\xcc\x7f\xea\x96\xd1\x5e\xb4\x7c\xd0" - "\xab\x02\x8d\xa3\x59\x3b\x8c\xd5\xd0\xe7\xb4\xc4\x90\x41\x9f\x78\x4e\x82" - "\x9e\xe4\x1b\x97\xa9\xa4\x7b\x48\xad\x56\xc0\xe4\x86\x52\xfc\xad\x93\x0b" - "\x7d\x38\xce\x73\x64\xbd\xf7\x00\x7b\xe6\x46\x03\x2f\x4b\x75\x9f\x3a\x2d" - "\x32\x42\xfe\x80\x74\x89\x27\x34\xce\x5e\xbf\xbe\x07\x50\x91\x08\x27\x2b" - "\x32\x77\xa7\xff\x83\xb1\xab\xc8\x98\xbe\xac\x33\x7c\x47\x19\x33\x6f\x4d" - "\xbe\x3e\xdc\xe0\x87\xfb", - "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" - "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" - "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" - "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" - "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" - "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" - "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" - "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" - "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" - "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" - "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" - "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" - "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" - "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" - "\x51\x6c\x16\x7a\xed\x52\x55\xb9\x76\x6c\x5e\x6e\x76\x97\x00\xc7\xeb\xfe" - "\xec\x10\x94\x2c\xa9\xaf\x9b\x09\x19\xb3\x17\x29\x96\xba\x8e\xac\x3d\x0a" - "\x9b\x70\x54\x0f\x1e\xd4\xe8\x13\xe6\x8f\xad\xfd\xfd\x13\xcf\xd5\x94\x06" - "\xa0\x24\x79\xc0\xf8\x05\x3d\x19\xeb\x96\xda\x31\xae\xf5\x4d\x82\x2c\x23" - "\x03\x9a\x43\x85\x94\x36\x30\xe8\x0a\x9b\x1f\x05\x6e\x4b\xa5\x98\x78\xbe" - "\x73\x0d\x8c\x60\x55\x88\xd6\xa3\x80\x13\x19\xdb\xf8\xcd\xa7\xdc\x28\x4c" - "\x09\xaf\xfe\x88\x77\xe1\x6e\x12\x57\x5a\xa8\xc6\x38\xcf\xf5\x0d\x42\x2c" - "\x67\xb3\x22\x6f\x3d\x7d", - 1, 3072}, - {128, 128, 15, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x87\x4d\x61\x91\xb6\x20\xe3\x26\x1b\xef\x68\x64\x99\x0d\xb6\xce\x98\x06" - "\xf6\x6b\x79\x70\xfd\xff\x86\x17\x18\x7b\xb9\xff\xfd\xff\x5a\xe4\xdf\x3e" - "\xdb\xd5\xd3\x5e\x5b\x4f\x09\x02\x0d\xb0\x3e\xab\x1e\x03\x1d\xda\x2f\xbe" - "\x03\xd1\x79\x21\x70\xa0\xf3\x00\x9c\xee", - 1, 512}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 96, 128, 1, "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", + "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79\x2d\x61\x75\xa3\x26\x13\x11\xb8", 1, 128 }, + { 96, 128, 2, "\x7e\x24\x06\x78\x17\xfa\xe0\xd7\x43\xd6\xce\x1f\x32\x53\x91\x63", + "\x00\x6c\xb6\xdb\xc0\x54\x3b\x59\xda\x48\xd9\x0b", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x51\x04\xa1\x06\x16\x8a\x72\xd9\x79\x0d\x41\xee\x8e\xda\xd3\x88\xeb\x2e" + "\x1e\xfc\x46\xda\x57\xc8\xfc\xe6\x30\xdf\x91\x41\xbe\x28", + 1, 256 }, + { 96, 128, 3, "\x76\x91\xbe\x03\x5e\x50\x20\xa8\xac\x6e\x61\x85\x29\xf9\xa0\xdc", + "\x00\xe0\x01\x7b\x27\x77\x7f\x3f\x4a\x17\x86\xf0", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", + "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9\xcf\x46\x52\xe9\xef\xdb\x72\xd7\x45\x40" + "\xa4\x2b\xde\x6d\x78\x36\xd5\x9a\x5c\xea\xae\xf3\x10\x53\x25\xb2\x07\x2f", + 1, 288 }, + { 96, 192, 4, + "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed\x86\x3d" + "\x06\xcc\xfd\xb7\x85\x15", + "\x00\x00\x00\x48\x36\x73\x3c\x14\x7d\x6d\x93\xcb", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", + "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8\x4e\x79\x35\xa0\x03\xcb\xe9\x28", 1, 128 }, + { 96, 192, 5, + "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c\x19\xe7\x34\x08\x19\xe0\xf6\x9c\x67\x8c" + "\x3d\xb8\xe6\xf6\xa9\x1a", + "\x00\x96\xb0\x3b\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\x45\x32\x43\xfc\x60\x9b\x23\x32\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f\x84\x90" + "\x70\x1c\x5a\xd4\xa7\x9c\xfc\x1f\xe0\xff\x42\xf4\xfb\x00", + 1, 256 }, + { 96, 192, 6, + "\x02\xbf\x39\x1e\xe8\xec\xb1\x59\xb9\x59\x61\x7b\x09\x65\x27\x9b\xf5\x9b" + "\x60\xa7\x86\xd3\xe0\xfe", + "\x00\x07\xbd\xfd\x5c\xbd\x60\x27\x8d\xcc\x09\x12", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", + "\x96\x89\x3f\xc5\x5e\x5c\x72\x2f\x54\x0b\x7d\xd1\xdd\xf7\xe7\x58\xd2\x88" + "\xbc\x95\xc6\x91\x65\x88\x45\x36\xc8\x11\x66\x2f\x21\x88\xab\xee\x09\x35", + 1, 288 }, + { 96, 256, 7, + "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f\x4c\x8a\x05\x42\xc8\x69\x6f\x6c\x6a\x81" + "\xaf\x1e\xec\x96\xb4\xd3\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04", + "\x00\x00\x00\x60\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67", + "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7\x56\x08\x63\xdc\x71\xe3\xe0\xc0", 1, 128 }, + { 96, 256, 8, + "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb\x07\x96\x36\x58\x79\xef\xf8\x86\xc6\x6d" + "\xd5\x1a\x5b\x6a\x99\x74\x4b\x50\x59\x0c\x87\xa2\x38\x84", + "\x00\xfa\xac\x24\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\xf0\x5e\x23\x1b\x38\x94\x61\x2c\x49\xee\x00\x0b\x80\x4e\xb2\xa9\xb8\x30" + "\x6b\x50\x8f\x83\x9d\x6a\x55\x30\x83\x1d\x93\x44\xaf\x1c", + 1, 256 }, + { 96, 256, 9, + "\xff\x7a\x61\x7c\xe6\x91\x48\xe4\xf1\x72\x6e\x2f\x43\x58\x1d\xe2\xaa\x62" + "\xd9\xf8\x05\x53\x2e\xdf\xf1\xee\xd6\x87\xfb\x54\x15\x3d", + "\x00\x1c\xc5\xb7\x51\xa5\x1d\x70\xa1\xc1\x11\x48", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23", + "\xeb\x6c\x52\x82\x1d\x0b\xbb\xf7\xce\x75\x94\x46\x2a\xca\x4f\xaa\xb4\x07" + "\xdf\x86\x65\x69\xfd\x07\xf4\x8c\xc0\xb5\x83\xd6\x07\x1f\x1e\xc0\xe6\xb8", + 1, 288 }, + { 96, 128, 10, "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a", + 1, 1024 }, + { 96, 128, 11, "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x12\xad\x82\xdf\x2f\xf8\x9c\xe0", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x7a\x13\xb4\x40\x69\x9b\x58\x16", + 1, 1088 }, + { 96, 128, 12, "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" + "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" + "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" + "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" + "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" + "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" + "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" + "\xac\xd9\xad\x94", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" + "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" + "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" + "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" + "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" + "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" + "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" + "\x51\x6c\x16\x7a", + 1, 2048 }, + { 96, 128, 13, "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" + "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" + "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" + "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" + "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" + "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" + "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" + "\xac\xd9\xad\x94\x66\xb8\x3f\x3a\x21\x9f\xd0\x43\x46\xdd\x65\x8b\x44\x99" + "\x66\x91\x64\xe2\x69\x6f\xbb\x85\x8c\xcc\x7f\xea\x96\xd1\x5e\xb4\x7c\xd0" + "\xab\x02\x8d\xa3\x59\x3b\x8c\xd5\xd0\xe7\xb4\xc4", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" + "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" + "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" + "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" + "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" + "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" + "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" + "\x51\x6c\x16\x7a\xed\x52\x55\xb9\x76\x6c\x5e\x6e\x76\x97\x00\xc7\xeb\xfe" + "\xec\x10\x94\x2c\xa9\xaf\x9b\x09\x19\xb3\x17\x29\x96\xba\x8e\xac\x3d\x0a" + "\x9b\x70\x54\x0f\x1e\xd4\xe8\x13\xe6\x8f\xad\xfd", + 1, 2400 }, + { 96, 128, 14, "\xae\x68\x52\xf8\x12\x10\x67\xcc\x4b\xf7\xa5\x76\x55\x77\xf3\x9e", + "\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00", + "\xa8\x63\x44\xf8\x36\x59\x2f\xf2\xda\xdd\x17\xce\xfe\x2a\xf2\xa2\x35\x87" + "\x34\x0f\x35\xfc\xd8\xf2\x57\xa1\xcb\x19\x0c\x33\x14\xe1\x23\xeb\xc0\x88" + "\x82\x05\x5f\x01\x5d\xfc\x53\x08\xdb\x34\x8e\x94\xe4\xa8\x26\x7f\xbc\xb7" + "\x8b\xe1\x58\x2f\x2c\x91\xcd\x5b\x4a\xaa\x7a\xba\x5f\xd2\x9b\xf8\x7d\xea" + "\x76\xb6\x64\xb3\x29\xd3\x02\x19\xa0\xdc\xe9\xb8\x90\x51\xa8\xde\x2e\xa1" + "\xb7\x7e\x51\x0d\x34\xb3\xed\xe7\x5e\xb8\x8a\xe9\xfe\x89\xf8\x0b\x85\x09" + "\x76\x08\x78\x0d\x27\x59\x8e\x14\x43\x46\xa0\x91\xee\xaa\xff\x74\x8d\xbc" + "\x98\xb9\x77\xbd\x41\x4f\xab\xf8\x78\x1f\xed\x2b\x14\x89\xb5\x7b\x61\x5e" + "\x88\x35\x46\x0f\x83\x5b\xc6\xe6\x61\x1d\xd8\x5e\xd3\xc3\xc6\xe8\xfb\x8e" + "\x59\xdb\x31\x17\xf8\xcd\xc1\xd4\x2d\xef\xd8\x25\x9e\x88\x10\x58\xf2\xa6" + "\x84\x4f\xa1\x32\x5f\x0e\xa2\x14\xf7\x03\x85\x06\x94\x4f\x83\x87\x04\x97" + "\x5a\x8d\x9a\x73\x36\x2a\xe0\x6d\xa9\x1f\xbc\x2f\xd2\x9e\xd1\x7d\x2c\x89" + "\x1f\xe1\xa0\x8f\x5d\x3e\xab\x9e\x79\x1a\x76\xc3\x0a\xc8\xcf\xcb\x35\x63" + "\xd9\x46\x87\xaf\x74\x24\x47\xba\x60\xab\x33\x5d\xa8\xde\xfe\x1b\xc5\x3f" + "\xac\xd9\xad\x94\x66\xb8\x3f\x3a\x21\x9f\xd0\x43\x46\xdd\x65\x8b\x44\x99" + "\x66\x91\x64\xe2\x69\x6f\xbb\x85\x8c\xcc\x7f\xea\x96\xd1\x5e\xb4\x7c\xd0" + "\xab\x02\x8d\xa3\x59\x3b\x8c\xd5\xd0\xe7\xb4\xc4\x90\x41\x9f\x78\x4e\x82" + "\x9e\xe4\x1b\x97\xa9\xa4\x7b\x48\xad\x56\xc0\xe4\x86\x52\xfc\xad\x93\x0b" + "\x7d\x38\xce\x73\x64\xbd\xf7\x00\x7b\xe6\x46\x03\x2f\x4b\x75\x9f\x3a\x2d" + "\x32\x42\xfe\x80\x74\x89\x27\x34\xce\x5e\xbf\xbe\x07\x50\x91\x08\x27\x2b" + "\x32\x77\xa7\xff\x83\xb1\xab\xc8\x98\xbe\xac\x33\x7c\x47\x19\x33\x6f\x4d" + "\xbe\x3e\xdc\xe0\x87\xfb", + "\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d\x67\x6f" + "\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c\x22\x37" + "\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41\x64\xfc" + "\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff\x9b\x6a" + "\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85\x31\x56" + "\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f\x62\x0a" + "\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6\x51\x6c" + "\x16\x7a\x1f\x03\x77\xd0\xed\x9b\xbc\xe9\x9b\xd3\x01\x06\xf8\x54\x90\x7d" + "\x67\x6f\x19\xd7\x0b\xf3\x92\x8d\x60\xc0\x18\x5a\x24\xc1\xd7\x60\x82\x9c" + "\x22\x37\x45\xe3\x9d\xa6\x76\x37\xe1\x7a\x13\xb4\x40\x63\xf4\xd8\xde\x41" + "\x64\xfc\xe2\x42\x2e\x3f\xea\xe1\x28\x06\xa5\xac\x6a\xc1\x58\x0c\x84\xff" + "\x9b\x6a\xe5\xbe\x4e\x8c\x4c\xe9\x97\xd5\x24\x30\x1b\x19\xdf\x87\x56\x85" + "\x31\x56\x5a\xde\xe0\x6e\xc0\x1c\xcb\x51\x5b\x6e\xac\xf5\xb0\x60\x60\x2f" + "\x62\x0a\xea\x62\x51\x2e\x5b\x1b\x99\x51\x3b\xac\xe9\xc5\x59\x7d\x0e\xb6" + "\x51\x6c\x16\x7a\xed\x52\x55\xb9\x76\x6c\x5e\x6e\x76\x97\x00\xc7\xeb\xfe" + "\xec\x10\x94\x2c\xa9\xaf\x9b\x09\x19\xb3\x17\x29\x96\xba\x8e\xac\x3d\x0a" + "\x9b\x70\x54\x0f\x1e\xd4\xe8\x13\xe6\x8f\xad\xfd\xfd\x13\xcf\xd5\x94\x06" + "\xa0\x24\x79\xc0\xf8\x05\x3d\x19\xeb\x96\xda\x31\xae\xf5\x4d\x82\x2c\x23" + "\x03\x9a\x43\x85\x94\x36\x30\xe8\x0a\x9b\x1f\x05\x6e\x4b\xa5\x98\x78\xbe" + "\x73\x0d\x8c\x60\x55\x88\xd6\xa3\x80\x13\x19\xdb\xf8\xcd\xa7\xdc\x28\x4c" + "\x09\xaf\xfe\x88\x77\xe1\x6e\x12\x57\x5a\xa8\xc6\x38\xcf\xf5\x0d\x42\x2c" + "\x67\xb3\x22\x6f\x3d\x7d", + 1, 3072 }, + { 128, 128, 15, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", + "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x87\x4d\x61\x91\xb6\x20\xe3\x26\x1b\xef\x68\x64\x99\x0d\xb6\xce\x98\x06" + "\xf6\x6b\x79\x70\xfd\xff\x86\x17\x18\x7b\xb9\xff\xfd\xff\x5a\xe4\xdf\x3e" + "\xdb\xd5\xd3\x5e\x5b\x4f\x09\x02\x0d\xb0\x3e\xab\x1e\x03\x1d\xda\x2f\xbe" + "\x03\xd1\x79\x21\x70\xa0\xf3\x00\x9c\xee", + 1, 512 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - const struct cipher_test ctr_bit_test_json[] = { +const struct cipher_test ctr_bit_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc3686 */ - {128, 128, 1, - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x39\x8a\x59\xb4\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" - "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf7", - "\xe9\xfe\xd8\xa6\x3d\x15\x53\x04\xd7\x1d\xf2\x0b\xf3\xe8\x22\x14\xb2\x0e" - "\xd7\xda\xd2\xf2\x33\xdc\x3c\x22\xd7\xbd\xee\xed\x8e\x7f", - 1, 253}, - {128, 128, 2, - "\x2b\xd6\x45\x9f\x82\xc4\x40\xe0\x95\x2c\x49\x10\x48\x05\xff\x48", - "\xc6\x75\xa6\x4b\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" - "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" - "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" - "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" - "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" - "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x83", - "\x59\x61\x60\x53\x53\xc6\x4b\xdc\xa1\x5b\x19\x5e\x28\x85\x53\xa9\x10\x63" - "\x25\x06\xd6\x20\x0a\xa7\x90\xc4\xc8\x06\xc9\x99\x04\xcf\x24\x45\xcc\x50" - "\xbb\x1c\xf1\x68\xa4\x96\x73\x73\x4e\x08\x1b\x57\xe3\x24\xce\x52\x59\xc0" - "\xe7\x8d\x4c\xd9\x7b\x87\x09\x76\x50\x3c\x09\x43\xf2\xcb\x5a\xe8\xf0\x52" - "\xc7\xb7\xd3\x92\x23\x95\x87\xb8\x95\x60\x86\xbc\xab\x18\x83\x60\x42\xe2" - "\xe6\xce\x42\x43\x2a\x17\x10\x5c\x53\xd3", - 1, 798}, - {128, 128, 3, - "\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08\xd6\x4e\x32\xd1\x81\x77\x77\xfb", - "\x54\x4d\x49\xcd\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68\x7d\x47\xba\x1d\x36\xd2" - "\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40\xc1\x32\x71\xaf\xf2\x64" - "\xd0\xf2\x4b", - "\x75\x75\x0d\x37\xb4\xbb\xa2\xa4\xde\xdb\x34\x23\x5b\xd6\x8c\x66\x45\xac" - "\xda\xac\xa4\x81\x38\xa3\xb0\xc4\x71\xe2\xa7\x04\x1a\x57\x64\x23\xd2\x92" - "\x72\x87\xf3", - 1, 310}, - {128, 128, 4, - "\xaa\x1f\x95\xae\xa5\x33\xbc\xb3\x2e\xb6\x3b\xf5\x2d\x8f\x83\x1a", - "\x72\xd8\xc6\x71\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xfb\x1b\x96\xc5\xc8\xba\xdf\xb2\xe8\xe8\xed\xfd\xe7\x8e\x57\xf2\xad\x81" - "\xe7\x41\x03\xfc\x43\x0a\x53\x4d\xcc\x37\xaf\xce\xc7\x0e\x15\x17\xbb\x06" - "\xf2\x72\x19\xda\xe4\x90\x22\xdd\xc4\x7a\x06\x8d\xe4\xc9\x49\x6a\x95\x1a" - "\x6b\x09\xed\xbd\xc8\x64\xc7\xad\xbd\x74\x0a\xc5\x0c\x02\x2f\x30\x82\xba" - "\xfd\x22\xd7\x81\x97\xc5\xd5\x08\xb9\x77\xbc\xa1\x3f\x32\xe6\x52\xe7\x4b" - "\xa7\x28\x57\x60\x77\xce\x62\x8c\x53\x5e\x87\xdc\x60\x77\xba\x07\xd2\x90" - "\x68\x59\x0c\x8c\xb5\xf1\x08\x8e\x08\x2c\xfa\x0e\xc9\x61\x30\x2d\x69\xcf" - "\x3d\x47", - "\xdf\xb4\x40\xac\xb3\x77\x35\x49\xef\xc0\x46\x28\xae\xb8\xd8\x15\x62\x75" - "\x23\x0b\xdc\x69\x0d\x94\xb0\x0d\x8d\x95\xf2\x8c\x4b\x56\x30\x7f\x60\xf4" - "\xca\x55\xeb\xa6\x61\xeb\xba\x72\xac\x80\x8f\xa8\xc4\x9e\x26\x78\x8e\xd0" - "\x4a\x5d\x60\x6c\xb4\x18\xde\x74\x87\x8b\x9a\x22\xf8\xef\x29\x59\x0b\xc4" - "\xeb\x57\xc9\xfa\xf7\xc4\x15\x24\xa8\x85\xb8\x97\x9c\x42\x3f\x2f\x8f\x8e" - "\x05\x92\xa9\x87\x92\x01\xbe\x7f\xf9\x77\x7a\x16\x2a\xb8\x10\xfe\xb3\x24" - "\xba\x74\xc4\xc1\x56\xe0\x4d\x39\x09\x72\x09\x65\x3a\xc3\x3e\x5a\x5f\x2d" - "\x88\x67", - 1, 1022}, - {128, 128, 5, - "\x96\x18\xae\x46\x89\x1f\x86\x57\x8e\xeb\xe9\x0e\xf7\xa1\x20\x2e", - "\xc6\x75\xa6\x4b\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x8d\xaa\x17\xb1\xae\x05\x05\x29\xc6\x82\x7f\x28\xc0\xef\x6a\x12\x42\xe9" - "\x3f\x8b\x31\x4f\xb1\x8a\x77\xf7\x90\xae\x04\x9f\xed\xd6\x12\x26\x7f\xec" - "\xae\xfc\x45\x01\x74\xd7\x6d\x9f\x9a\xa7\x75\x5a\x30\xcd\x90\xa9\xa5\x87" - "\x4b\xf4\x8e\xaf\x70\xee\xa3\xa6\x2a\x25\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08" - "\xd6\x4e\x32\xd1\x81\x77\x77\xfb\x54\x4d\x49\xcd\x49\x72\x0e\x21\x9d\xbf" - "\x8b\xbe\xd3\x39\x04\xe1\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68" - "\x7d\x47\xba\x1d\x36\xd2\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40" - "\xc1\x32\x71\xaf\xf2\x64\xd0\xf2\x48\x41\xd6\x46\x5f\x09\x96\xff\x84\xe6" - "\x5f\xc5\x17\xc5\x3e\xfc\x33\x63\xc3\x84\x92\xaf", - "\x91\x9c\x8c\x33\xd6\x67\x89\x70\x3d\x05\xa0\xd7\xce\x82\xa2\xae\xac\x4e" - "\xe7\x6c\x0f\x4d\xa0\x50\x33\x5e\x8a\x84\xe7\x89\x7b\xa5\xdf\x2f\x36\xbd" - "\x51\x3e\x3d\x0c\x85\x78\xc7\xa0\xfc\xf0\x43\xe0\x3a\xa3\xa3\x9f\xba\xad" - "\x7d\x15\xbe\x07\x4f\xaa\x5d\x90\x29\xf7\x1f\xb4\x57\xb6\x47\x83\x47\x14" - "\xb0\xe1\x8f\x11\x7f\xca\x10\x67\x79\x45\x09\x6c\x8c\x5f\x32\x6b\xa8\xd6" - "\x09\x5e\xb2\x9c\x3e\x36\xcf\x24\x5d\x16\x22\xaa\xfe\x92\x1f\x75\x66\xc4" - "\xf5\xd6\x44\xf2\xf1\xfc\x0e\xc6\x84\xdd\xb2\x13\x49\x74\x76\x22\xe2\x09" - "\x29\x5d\x27\xff\x3f\x95\x62\x33\x71\xd4\x9b\x14\x7c\x0a\xf4\x86\x17\x1f" - "\x22\xcd\x04\xb1\xcb\xeb\x26\x58\x22\x3e\x69\x3f", - 1, 1245}, - {128, 128, 6, - "\x54\xf4\xe2\xe0\x4c\x83\x78\x6e\xec\x8f\xb5\xab\xe8\xe3\x65\x66", - "\xac\xa4\xf5\x0f\x58\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" - "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" - "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" - "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" - "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" - "\x44\x54\x31\x87\x45\xe3\xfa\x16\xbb\x11\xad\xae\x24\x88\x79\xfe\x52\xdb" - "\x25\x43\xe5\x3c\xf4\x45\xd3\xd8\x28\xce\x0b\xf5\xc5\x60\x59\x3d\x97\x27" - "\x8a\x59\x76\x2d\xd0\xc2\xc9\xcd\x68\xd4\x49\x6a\x79\x25\x08\x61\x40\x14" - "\xb1\x3b\x6a\xa5\x11\x28\xc1\x8c\xd6\xa9\x0b\x87\x97\x8c\x2f\xf1\xca\xbe" - "\x7d\x9f\x89\x8a\x41\x1b\xfd\xb8\x4f\x68\xf6\x72\x7b\x14\x99\xcd\xd3\x0d" - "\xf0\x44\x3a\xb4\xa6\x66\x53\x33\x0b\xcb\xa1\x10\x5e\x4c\xec\x03\x4c\x73" - "\xe6\x05\xb4\x31\x0e\xaa\xad\xcf\xd5\xb0\xca\x27\xff\xd8\x9d\x14\x4d\xf4" - "\x79\x27\x59\x42\x7c\x9c\xc1\xf8\xcd\x8c\x87\x20\x23\x64\xb8\xa6\x87\x95" - "\x4c\xb0\x5a\x8d\x4e\x2d\x99\xe7\x3d\xb1\x60\xde\xb1\x80\xad\x08\x41\xe9" - "\x67\x41\xa5\xd5\x9f\xe4\x18\x9f\x15\x42\x00\x26\xfe\x4c\xd1\x21\x04\x93" - "\x2f\xb3\x8f\x73\x53\x40\x43\x8a\xaf\x7e\xca\x6f\xd5\xcf\xd3\xa1\x95\xce" - "\x5a\xbe\x65\x27\x2a\xf6\x07\xad\xa1\xbe\x65\xa6\xb4\xc9\xc0\x69\x32\x34" - "\x09\x2c\x4d\x01\x8f\x17\x56\xc6\xdb\x9d\xc8\xa6\xd8\x0b\x88\x81\x38\x61" - "\x6b\x68\x12\x62\xf9\x54\xd0\xe7\x71\x17\x48\x78\x0d\x92\x29\x1d\x86\x29" - "\x99\x72\xdb\x74\x1c\xfa\x4f\x37\xb8\xb5\x6c\xdb\x18\xa7\xca\x82\x18\xe8" - "\x6e\x4b\x4b\x71\x6a\x4d\x04\x37\x1f\xbe\xc2\x62\xfc\x5a\xd0\xb3\x81\x9b" - "\x18\x7b\x97\xe5\x5b\x1a\x4d\x7c\x19\xee\x24\xc8\xb4\xd7\x72\x3c\xfe\xdf" - "\x04\x5b\x8a\xca\xe4\x86\x95\x17\xd8\x0e\x50\x61\x5d\x90\x35\xd5\xd9\xc5" - "\xa4\x0a\xf6\x02\x28\x0b\x54\x25\x97\xb0\xcb\x18\x61\x9e\xeb\x35\x92\x57" - "\x59\xd1\x95\xe1\x00\xe8\xe4\xaa\x0c\x38\xa3\xc2\xab\xe0\xf3\xd8\xff\x04" - "\xf3\xc3\x3c\x29\x50\x69\xc2\x36\x94\xb5\xbb\xea\xcd\xd5\x42\xe2\x8e\x8a" - "\x94\xed\xb9\x11\x9f\x41\x2d\x05\x4b\xe1\xfa\x72\x00\xb0\x97", - "\x5c\xb7\x2c\x6e\xdc\x87\x8f\x15\x66\xe1\x02\x53\xaf\xc3\x64\xc9\xfa\x54" - "\x0d\x91\x4d\xb9\x4c\xbe\xe2\x75\xd0\x91\x7c\xa6\xaf\x0d\x77\xac\xb4\xef" - "\x3b\xbe\x1a\x72\x2b\x2e\xf5\xbd\x1d\x4b\x8e\x2a\xa5\x02\x4e\xc1\x38\x8a" - "\x20\x1e\x7b\xce\x79\x20\xae\xc6\x15\x89\x5f\x76\x3a\x55\x64\xdc\xc4\xc4" - "\x82\xa2\xee\x1d\x8b\xfe\xcc\x44\x98\xec\xa8\x3f\xbb\x75\xf9\xab\x53\x0e" - "\x0d\xaf\xbe\xde\x2f\xa5\x89\x5b\x82\x99\x1b\x62\x77\xc5\x29\xe0\xf2\x52" - "\x9d\x7f\x79\x60\x6b\xe9\x67\x06\x29\x6d\xed\xfa\x9d\x74\x12\xb6\x16\x95" - "\x8c\xb5\x63\xc6\x78\xc0\x28\x25\xc3\x0d\x0a\xee\x77\xc4\xc1\x46\xd2\x76" - "\x54\x12\x42\x1a\x80\x8d\x13\xce\xc8\x19\x69\x4c\x75\xad\x57\x2e\x9b\x97" - "\x3d\x94\x8b\x81\xa9\x33\x7c\x3b\x2a\x17\x19\x2e\x22\xc2\x06\x9f\x7e\xd1" - "\x16\x2a\xf4\x4c\xde\xa8\x17\x60\x36\x65\xe8\x07\xce\x40\xc8\xe0\xdd\x9d" - "\x63\x94\xdc\x6e\x31\x15\x3f\xe1\x95\x5c\x47\xaf\xb5\x1f\x26\x17\xee\x0c" - "\x5e\x3b\x8e\xf1\xad\x75\x74\xed\x34\x3e\xdc\x27\x43\xcc\x94\xc9\x90\xe1" - "\xf1\xfd\x26\x42\x53\xc1\x78\xde\xa7\x39\xc0\xbe\xfe\xeb\xcd\x9f\x9b\x76" - "\xd4\x9c\x10\x15\xc9\xfe\xcf\x50\xe5\x3b\x8b\x52\x04\xdb\xcd\x3e\xed\x86" - "\x38\x55\xda\xbc\xdc\xc9\x4b\x31\xe3\x18\x02\x15\x68\x85\x5c\x8b\x9e\x52" - "\xa9\x81\x95\x7a\x11\x28\x27\xf9\x78\xba\x96\x0f\x14\x47\x91\x1b\x31\x7b" - "\x55\x11\xfb\xcc\x7f\xb1\x3a\xc1\x53\xdb\x74\x25\x11\x17\xe4\x86\x1e\xb9" - "\xe8\x3b\xff\xff\xc4\xeb\x77\x55\x57\x90\x38\xe5\x79\x24\xb1\xf7\x8b\x3e" - "\x1a\xd9\x0b\xab\x2a\x07\x87\x1b\x72\xdb\x5e\xef\x96\xc3\x34\x04\x49\x66" - "\xdb\x0c\x37\xca\xfd\x1a\x89\xe5\x64\x6a\x35\x80\xeb\x64\x65\xf1\x21\xdc" - "\xe9\xcb\x88\xd8\x5b\x96\xcf\x23\xcc\xcc\xd4\x28\x07\x67\xbe\xe8\xee\xb2" - "\x3d\x86\x52\x46\x1d\xb6\x49\x31\x03\x00\x3b\xaf\x89\xf5\xe1\x82\x61\xea" - "\x43\xc8\x4a\x92\xeb\xff\xff\xe4\x90\x9d\xc4\x6c\x51\x92\xf8\x25\xf7\x70" - "\x60\x0b\x96\x02\xc5\x57\xb5\xf8\xb4\x31\xa7\x9d\x45\x97\x7d\xd9\xc4\x1b" - "\x86\x3d\xa9\xe1\x42\xe9\x00\x20\xcf\xd0\x74\xd6\x92\x7b\x7a\xb3\xb6\x72" - "\x5d\x1a\x6f\x3f\x98\xb9\xc9\xda\xa8\x98\x2a\xff\x06\x78\x2f", - 1, 3861}, - {128, 192, 7, - "\x02\xbf\x39\x1e\xe8\xec\xb1\x59\xb9\x59\x61\x7b\x09\x65\x27\x9b\xf5\x9b" - "\x60\xa7\x86\xd3\xe0\xfe", - "\x00\x07\xbd\xfd\x5c\xbd\x60\x27\x8d\xcc\x09\x12\x00\x00\x00\x01", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x2f", - "\x96\x89\x3f\xc5\x5e\x5c\x72\x2f\x54\x0b\x7d\xd1\xdd\xf7\xe7\x58\xd2\x88" - "\xbc\x95\xc6\x91\x65\x88\x45\x36\xc8\x11\x66\x2f\x21\x88\xab\xee\x09\x3f", - 1, 284}, - {128, 256, 8, - "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f\x4c\x8a\x05\x42\xc8\x69\x6f\x6c\x6a\x81" - "\xaf\x1e\xec\x96\xb4\xd3\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04", - "\x00\x00\x00\x60\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2\x00\x00\x00\x01", - "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x6f", - "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7\x56\x08\x63\xdc\x71\xe3\xe0\xcf", 1, - 124}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 128, 128, 1, "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf7", + "\xe9\xfe\xd8\xa6\x3d\x15\x53\x04\xd7\x1d\xf2\x0b\xf3\xe8\x22\x14\xb2\x0e" + "\xd7\xda\xd2\xf2\x33\xdc\x3c\x22\xd7\xbd\xee\xed\x8e\x7f", + 1, 253 }, + { 128, 128, 2, "\x2b\xd6\x45\x9f\x82\xc4\x40\xe0\x95\x2c\x49\x10\x48\x05\xff\x48", + "\xc6\x75\xa6\x4b\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" + "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" + "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" + "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" + "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" + "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x83", + "\x59\x61\x60\x53\x53\xc6\x4b\xdc\xa1\x5b\x19\x5e\x28\x85\x53\xa9\x10\x63" + "\x25\x06\xd6\x20\x0a\xa7\x90\xc4\xc8\x06\xc9\x99\x04\xcf\x24\x45\xcc\x50" + "\xbb\x1c\xf1\x68\xa4\x96\x73\x73\x4e\x08\x1b\x57\xe3\x24\xce\x52\x59\xc0" + "\xe7\x8d\x4c\xd9\x7b\x87\x09\x76\x50\x3c\x09\x43\xf2\xcb\x5a\xe8\xf0\x52" + "\xc7\xb7\xd3\x92\x23\x95\x87\xb8\x95\x60\x86\xbc\xab\x18\x83\x60\x42\xe2" + "\xe6\xce\x42\x43\x2a\x17\x10\x5c\x53\xd3", + 1, 798 }, + { 128, 128, 3, "\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08\xd6\x4e\x32\xd1\x81\x77\x77\xfb", + "\x54\x4d\x49\xcd\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68\x7d\x47\xba\x1d\x36\xd2" + "\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40\xc1\x32\x71\xaf\xf2\x64" + "\xd0\xf2\x4b", + "\x75\x75\x0d\x37\xb4\xbb\xa2\xa4\xde\xdb\x34\x23\x5b\xd6\x8c\x66\x45\xac" + "\xda\xac\xa4\x81\x38\xa3\xb0\xc4\x71\xe2\xa7\x04\x1a\x57\x64\x23\xd2\x92" + "\x72\x87\xf3", + 1, 310 }, + { 128, 128, 4, "\xaa\x1f\x95\xae\xa5\x33\xbc\xb3\x2e\xb6\x3b\xf5\x2d\x8f\x83\x1a", + "\x72\xd8\xc6\x71\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfb\x1b\x96\xc5\xc8\xba\xdf\xb2\xe8\xe8\xed\xfd\xe7\x8e\x57\xf2\xad\x81" + "\xe7\x41\x03\xfc\x43\x0a\x53\x4d\xcc\x37\xaf\xce\xc7\x0e\x15\x17\xbb\x06" + "\xf2\x72\x19\xda\xe4\x90\x22\xdd\xc4\x7a\x06\x8d\xe4\xc9\x49\x6a\x95\x1a" + "\x6b\x09\xed\xbd\xc8\x64\xc7\xad\xbd\x74\x0a\xc5\x0c\x02\x2f\x30\x82\xba" + "\xfd\x22\xd7\x81\x97\xc5\xd5\x08\xb9\x77\xbc\xa1\x3f\x32\xe6\x52\xe7\x4b" + "\xa7\x28\x57\x60\x77\xce\x62\x8c\x53\x5e\x87\xdc\x60\x77\xba\x07\xd2\x90" + "\x68\x59\x0c\x8c\xb5\xf1\x08\x8e\x08\x2c\xfa\x0e\xc9\x61\x30\x2d\x69\xcf" + "\x3d\x47", + "\xdf\xb4\x40\xac\xb3\x77\x35\x49\xef\xc0\x46\x28\xae\xb8\xd8\x15\x62\x75" + "\x23\x0b\xdc\x69\x0d\x94\xb0\x0d\x8d\x95\xf2\x8c\x4b\x56\x30\x7f\x60\xf4" + "\xca\x55\xeb\xa6\x61\xeb\xba\x72\xac\x80\x8f\xa8\xc4\x9e\x26\x78\x8e\xd0" + "\x4a\x5d\x60\x6c\xb4\x18\xde\x74\x87\x8b\x9a\x22\xf8\xef\x29\x59\x0b\xc4" + "\xeb\x57\xc9\xfa\xf7\xc4\x15\x24\xa8\x85\xb8\x97\x9c\x42\x3f\x2f\x8f\x8e" + "\x05\x92\xa9\x87\x92\x01\xbe\x7f\xf9\x77\x7a\x16\x2a\xb8\x10\xfe\xb3\x24" + "\xba\x74\xc4\xc1\x56\xe0\x4d\x39\x09\x72\x09\x65\x3a\xc3\x3e\x5a\x5f\x2d" + "\x88\x67", + 1, 1022 }, + { 128, 128, 5, "\x96\x18\xae\x46\x89\x1f\x86\x57\x8e\xeb\xe9\x0e\xf7\xa1\x20\x2e", + "\xc6\x75\xa6\x4b\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x8d\xaa\x17\xb1\xae\x05\x05\x29\xc6\x82\x7f\x28\xc0\xef\x6a\x12\x42\xe9" + "\x3f\x8b\x31\x4f\xb1\x8a\x77\xf7\x90\xae\x04\x9f\xed\xd6\x12\x26\x7f\xec" + "\xae\xfc\x45\x01\x74\xd7\x6d\x9f\x9a\xa7\x75\x5a\x30\xcd\x90\xa9\xa5\x87" + "\x4b\xf4\x8e\xaf\x70\xee\xa3\xa6\x2a\x25\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08" + "\xd6\x4e\x32\xd1\x81\x77\x77\xfb\x54\x4d\x49\xcd\x49\x72\x0e\x21\x9d\xbf" + "\x8b\xbe\xd3\x39\x04\xe1\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68" + "\x7d\x47\xba\x1d\x36\xd2\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40" + "\xc1\x32\x71\xaf\xf2\x64\xd0\xf2\x48\x41\xd6\x46\x5f\x09\x96\xff\x84\xe6" + "\x5f\xc5\x17\xc5\x3e\xfc\x33\x63\xc3\x84\x92\xaf", + "\x91\x9c\x8c\x33\xd6\x67\x89\x70\x3d\x05\xa0\xd7\xce\x82\xa2\xae\xac\x4e" + "\xe7\x6c\x0f\x4d\xa0\x50\x33\x5e\x8a\x84\xe7\x89\x7b\xa5\xdf\x2f\x36\xbd" + "\x51\x3e\x3d\x0c\x85\x78\xc7\xa0\xfc\xf0\x43\xe0\x3a\xa3\xa3\x9f\xba\xad" + "\x7d\x15\xbe\x07\x4f\xaa\x5d\x90\x29\xf7\x1f\xb4\x57\xb6\x47\x83\x47\x14" + "\xb0\xe1\x8f\x11\x7f\xca\x10\x67\x79\x45\x09\x6c\x8c\x5f\x32\x6b\xa8\xd6" + "\x09\x5e\xb2\x9c\x3e\x36\xcf\x24\x5d\x16\x22\xaa\xfe\x92\x1f\x75\x66\xc4" + "\xf5\xd6\x44\xf2\xf1\xfc\x0e\xc6\x84\xdd\xb2\x13\x49\x74\x76\x22\xe2\x09" + "\x29\x5d\x27\xff\x3f\x95\x62\x33\x71\xd4\x9b\x14\x7c\x0a\xf4\x86\x17\x1f" + "\x22\xcd\x04\xb1\xcb\xeb\x26\x58\x22\x3e\x69\x3f", + 1, 1245 }, + { 128, 128, 6, "\x54\xf4\xe2\xe0\x4c\x83\x78\x6e\xec\x8f\xb5\xab\xe8\xe3\x65\x66", + "\xac\xa4\xf5\x0f\x58\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" + "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" + "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" + "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" + "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" + "\x44\x54\x31\x87\x45\xe3\xfa\x16\xbb\x11\xad\xae\x24\x88\x79\xfe\x52\xdb" + "\x25\x43\xe5\x3c\xf4\x45\xd3\xd8\x28\xce\x0b\xf5\xc5\x60\x59\x3d\x97\x27" + "\x8a\x59\x76\x2d\xd0\xc2\xc9\xcd\x68\xd4\x49\x6a\x79\x25\x08\x61\x40\x14" + "\xb1\x3b\x6a\xa5\x11\x28\xc1\x8c\xd6\xa9\x0b\x87\x97\x8c\x2f\xf1\xca\xbe" + "\x7d\x9f\x89\x8a\x41\x1b\xfd\xb8\x4f\x68\xf6\x72\x7b\x14\x99\xcd\xd3\x0d" + "\xf0\x44\x3a\xb4\xa6\x66\x53\x33\x0b\xcb\xa1\x10\x5e\x4c\xec\x03\x4c\x73" + "\xe6\x05\xb4\x31\x0e\xaa\xad\xcf\xd5\xb0\xca\x27\xff\xd8\x9d\x14\x4d\xf4" + "\x79\x27\x59\x42\x7c\x9c\xc1\xf8\xcd\x8c\x87\x20\x23\x64\xb8\xa6\x87\x95" + "\x4c\xb0\x5a\x8d\x4e\x2d\x99\xe7\x3d\xb1\x60\xde\xb1\x80\xad\x08\x41\xe9" + "\x67\x41\xa5\xd5\x9f\xe4\x18\x9f\x15\x42\x00\x26\xfe\x4c\xd1\x21\x04\x93" + "\x2f\xb3\x8f\x73\x53\x40\x43\x8a\xaf\x7e\xca\x6f\xd5\xcf\xd3\xa1\x95\xce" + "\x5a\xbe\x65\x27\x2a\xf6\x07\xad\xa1\xbe\x65\xa6\xb4\xc9\xc0\x69\x32\x34" + "\x09\x2c\x4d\x01\x8f\x17\x56\xc6\xdb\x9d\xc8\xa6\xd8\x0b\x88\x81\x38\x61" + "\x6b\x68\x12\x62\xf9\x54\xd0\xe7\x71\x17\x48\x78\x0d\x92\x29\x1d\x86\x29" + "\x99\x72\xdb\x74\x1c\xfa\x4f\x37\xb8\xb5\x6c\xdb\x18\xa7\xca\x82\x18\xe8" + "\x6e\x4b\x4b\x71\x6a\x4d\x04\x37\x1f\xbe\xc2\x62\xfc\x5a\xd0\xb3\x81\x9b" + "\x18\x7b\x97\xe5\x5b\x1a\x4d\x7c\x19\xee\x24\xc8\xb4\xd7\x72\x3c\xfe\xdf" + "\x04\x5b\x8a\xca\xe4\x86\x95\x17\xd8\x0e\x50\x61\x5d\x90\x35\xd5\xd9\xc5" + "\xa4\x0a\xf6\x02\x28\x0b\x54\x25\x97\xb0\xcb\x18\x61\x9e\xeb\x35\x92\x57" + "\x59\xd1\x95\xe1\x00\xe8\xe4\xaa\x0c\x38\xa3\xc2\xab\xe0\xf3\xd8\xff\x04" + "\xf3\xc3\x3c\x29\x50\x69\xc2\x36\x94\xb5\xbb\xea\xcd\xd5\x42\xe2\x8e\x8a" + "\x94\xed\xb9\x11\x9f\x41\x2d\x05\x4b\xe1\xfa\x72\x00\xb0\x97", + "\x5c\xb7\x2c\x6e\xdc\x87\x8f\x15\x66\xe1\x02\x53\xaf\xc3\x64\xc9\xfa\x54" + "\x0d\x91\x4d\xb9\x4c\xbe\xe2\x75\xd0\x91\x7c\xa6\xaf\x0d\x77\xac\xb4\xef" + "\x3b\xbe\x1a\x72\x2b\x2e\xf5\xbd\x1d\x4b\x8e\x2a\xa5\x02\x4e\xc1\x38\x8a" + "\x20\x1e\x7b\xce\x79\x20\xae\xc6\x15\x89\x5f\x76\x3a\x55\x64\xdc\xc4\xc4" + "\x82\xa2\xee\x1d\x8b\xfe\xcc\x44\x98\xec\xa8\x3f\xbb\x75\xf9\xab\x53\x0e" + "\x0d\xaf\xbe\xde\x2f\xa5\x89\x5b\x82\x99\x1b\x62\x77\xc5\x29\xe0\xf2\x52" + "\x9d\x7f\x79\x60\x6b\xe9\x67\x06\x29\x6d\xed\xfa\x9d\x74\x12\xb6\x16\x95" + "\x8c\xb5\x63\xc6\x78\xc0\x28\x25\xc3\x0d\x0a\xee\x77\xc4\xc1\x46\xd2\x76" + "\x54\x12\x42\x1a\x80\x8d\x13\xce\xc8\x19\x69\x4c\x75\xad\x57\x2e\x9b\x97" + "\x3d\x94\x8b\x81\xa9\x33\x7c\x3b\x2a\x17\x19\x2e\x22\xc2\x06\x9f\x7e\xd1" + "\x16\x2a\xf4\x4c\xde\xa8\x17\x60\x36\x65\xe8\x07\xce\x40\xc8\xe0\xdd\x9d" + "\x63\x94\xdc\x6e\x31\x15\x3f\xe1\x95\x5c\x47\xaf\xb5\x1f\x26\x17\xee\x0c" + "\x5e\x3b\x8e\xf1\xad\x75\x74\xed\x34\x3e\xdc\x27\x43\xcc\x94\xc9\x90\xe1" + "\xf1\xfd\x26\x42\x53\xc1\x78\xde\xa7\x39\xc0\xbe\xfe\xeb\xcd\x9f\x9b\x76" + "\xd4\x9c\x10\x15\xc9\xfe\xcf\x50\xe5\x3b\x8b\x52\x04\xdb\xcd\x3e\xed\x86" + "\x38\x55\xda\xbc\xdc\xc9\x4b\x31\xe3\x18\x02\x15\x68\x85\x5c\x8b\x9e\x52" + "\xa9\x81\x95\x7a\x11\x28\x27\xf9\x78\xba\x96\x0f\x14\x47\x91\x1b\x31\x7b" + "\x55\x11\xfb\xcc\x7f\xb1\x3a\xc1\x53\xdb\x74\x25\x11\x17\xe4\x86\x1e\xb9" + "\xe8\x3b\xff\xff\xc4\xeb\x77\x55\x57\x90\x38\xe5\x79\x24\xb1\xf7\x8b\x3e" + "\x1a\xd9\x0b\xab\x2a\x07\x87\x1b\x72\xdb\x5e\xef\x96\xc3\x34\x04\x49\x66" + "\xdb\x0c\x37\xca\xfd\x1a\x89\xe5\x64\x6a\x35\x80\xeb\x64\x65\xf1\x21\xdc" + "\xe9\xcb\x88\xd8\x5b\x96\xcf\x23\xcc\xcc\xd4\x28\x07\x67\xbe\xe8\xee\xb2" + "\x3d\x86\x52\x46\x1d\xb6\x49\x31\x03\x00\x3b\xaf\x89\xf5\xe1\x82\x61\xea" + "\x43\xc8\x4a\x92\xeb\xff\xff\xe4\x90\x9d\xc4\x6c\x51\x92\xf8\x25\xf7\x70" + "\x60\x0b\x96\x02\xc5\x57\xb5\xf8\xb4\x31\xa7\x9d\x45\x97\x7d\xd9\xc4\x1b" + "\x86\x3d\xa9\xe1\x42\xe9\x00\x20\xcf\xd0\x74\xd6\x92\x7b\x7a\xb3\xb6\x72" + "\x5d\x1a\x6f\x3f\x98\xb9\xc9\xda\xa8\x98\x2a\xff\x06\x78\x2f", + 1, 3861 }, + { 128, 192, 7, + "\x02\xbf\x39\x1e\xe8\xec\xb1\x59\xb9\x59\x61\x7b\x09\x65\x27\x9b\xf5\x9b" + "\x60\xa7\x86\xd3\xe0\xfe", + "\x00\x07\xbd\xfd\x5c\xbd\x60\x27\x8d\xcc\x09\x12\x00\x00\x00\x01", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x2f", + "\x96\x89\x3f\xc5\x5e\x5c\x72\x2f\x54\x0b\x7d\xd1\xdd\xf7\xe7\x58\xd2\x88" + "\xbc\x95\xc6\x91\x65\x88\x45\x36\xc8\x11\x66\x2f\x21\x88\xab\xee\x09\x3f", + 1, 284 }, + { 128, 256, 8, + "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f\x4c\x8a\x05\x42\xc8\x69\x6f\x6c\x6a\x81" + "\xaf\x1e\xec\x96\xb4\xd3\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04", + "\x00\x00\x00\x60\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2\x00\x00\x00\x01", + "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x6f", + "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7\x56\x08\x63\xdc\x71\xe3\xe0\xcf", 1, 124 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/customop_test.c b/test/kat-app/customop_test.c index 70f1a9ed..9dfd6447 100644 --- a/test/kat-app/customop_test.c +++ b/test/kat-app/customop_test.c @@ -36,16 +36,16 @@ #ifdef DEBUG #ifdef _WIN32 -#define TRACE(fmt, ...) if (!quiet_mode) \ - fprintf(stderr, "%s:%d "fmt, \ - __FUNCTION__, __LINE__, __VA_ARGS__) +#define TRACE(fmt, ...) \ + if (!quiet_mode) \ + fprintf(stderr, "%s:%d " fmt, __FUNCTION__, __LINE__, __VA_ARGS__) #else -#define TRACE(fmt, ...) if (!quiet_mode) \ - fprintf(stderr, "%s:%d "fmt, \ - __func__, __LINE__, __VA_ARGS__) +#define TRACE(fmt, ...) \ + if (!quiet_mode) \ + fprintf(stderr, "%s:%d " fmt, __func__, __LINE__, __VA_ARGS__) #endif #else -# define TRACE(fmt, ...) +#define TRACE(fmt, ...) #endif struct cipher_attr_s { @@ -67,8 +67,8 @@ struct test_vec_s { uint8_t tag[32]; uint8_t verify[32]; - DECLARE_ALIGNED(uint8_t enc_key[16*16], 64); - DECLARE_ALIGNED(uint8_t dec_key[16*16], 64); + DECLARE_ALIGNED(uint8_t enc_key[16 * 16], 64); + DECLARE_ALIGNED(uint8_t dec_key[16 * 16], 64); uint8_t ipad[256]; uint8_t opad[256]; const struct cipher_attr_s *cipher; @@ -87,15 +87,15 @@ cipher_addon(struct IMB_JOB *job) struct test_vec_s *node = job->user_data; #endif - TRACE("Seq:%u Cipher Addon cipher:%s auth:%s\n", - node->seq, node->cipher->name, node->auth->name); + TRACE("Seq:%u Cipher Addon cipher:%s auth:%s\n", node->seq, node->cipher->name, + node->auth->name); if (job->cipher_direction == IMB_DIR_ENCRYPT) memset(job->dst, 1, job->msg_len_to_cipher_in_bytes); else memset(job->dst, 2, job->msg_len_to_cipher_in_bytes); - return 0; /* success */ + return 0; /* success */ } /* @@ -108,49 +108,41 @@ hash_addon(struct IMB_JOB *job) struct test_vec_s *node = job->user_data; #endif - TRACE("Seq:%u Auth Addon cipher:%s auth:%s\n", - node->seq, node->cipher->name, node->auth->name); + TRACE("Seq:%u Auth Addon cipher:%s auth:%s\n", node->seq, node->cipher->name, + node->auth->name); memset(job->auth_tag_output, 3, job->auth_tag_output_len_in_bytes); - return 0; /* success */ + return 0; /* success */ } /* * test cipher functions */ static const struct auth_attr_s auth_attr_tab[] = { - { "SHA1", IMB_AUTH_HMAC_SHA_1, 12 }, - { "SHA224", IMB_AUTH_HMAC_SHA_224, 14 }, - { "SHA256", IMB_AUTH_HMAC_SHA_256, 16 }, - { "SHA384", IMB_AUTH_HMAC_SHA_384, 24 }, - { "SHA512", IMB_AUTH_HMAC_SHA_512, 32 }, - { "MD5", IMB_AUTH_MD5, 12 }, - { "CUSTOM_HASH", IMB_AUTH_CUSTOM, 16 } + { "SHA1", IMB_AUTH_HMAC_SHA_1, 12 }, { "SHA224", IMB_AUTH_HMAC_SHA_224, 14 }, + { "SHA256", IMB_AUTH_HMAC_SHA_256, 16 }, { "SHA384", IMB_AUTH_HMAC_SHA_384, 24 }, + { "SHA512", IMB_AUTH_HMAC_SHA_512, 32 }, { "MD5", IMB_AUTH_MD5, 12 }, + { "CUSTOM_HASH", IMB_AUTH_CUSTOM, 16 } }; /* * test hash functions */ static const struct cipher_attr_s cipher_attr_tab[] = { - { "CBC128", IMB_CIPHER_CBC, 16, 16 }, - { "CBC192", IMB_CIPHER_CBC, 24, 16 }, - { "CBC256", IMB_CIPHER_CBC, 32, 16 }, - { "CUSTOM_CIPHER", IMB_CIPHER_CUSTOM, 32, 12 }, - { "CTR128", IMB_CIPHER_CNTR, 16, 12 }, - { "CTR192", IMB_CIPHER_CNTR, 24, 12 }, - { "CTR256", IMB_CIPHER_CNTR, 32, 12 } + { "CBC128", IMB_CIPHER_CBC, 16, 16 }, { "CBC192", IMB_CIPHER_CBC, 24, 16 }, + { "CBC256", IMB_CIPHER_CBC, 32, 16 }, { "CUSTOM_CIPHER", IMB_CIPHER_CUSTOM, 32, 12 }, + { "CTR128", IMB_CIPHER_CNTR, 16, 12 }, { "CTR192", IMB_CIPHER_CNTR, 24, 12 }, + { "CTR256", IMB_CIPHER_CNTR, 32, 12 } }; static int -job_check(const struct IMB_JOB *job, - struct test_suite_context *ctx) +job_check(const struct IMB_JOB *job, struct test_suite_context *ctx) { #ifdef DEBUG struct test_vec_s *done = job->user_data; #endif - TRACE("done Seq:%u Cipher:%s Auth:%s\n", - done->seq, done->cipher->name, done->auth->name); + TRACE("done Seq:%u Cipher:%s Auth:%s\n", done->seq, done->cipher->name, done->auth->name); if (job->status != IMB_STATUS_COMPLETED) { TRACE("failed job status:%d\n", job->status); @@ -200,7 +192,6 @@ job_check(const struct IMB_JOB *job, return 0; } - int customop_test(struct IMB_MGR *mgr) { @@ -242,8 +233,7 @@ customop_test(struct IMB_MGR *mgr) job->cipher_start_src_offset_in_bytes = 16; job->msg_len_to_cipher_in_bytes = sizeof(node->txt); job->hash_start_src_offset_in_bytes = 0; - job->msg_len_to_hash_in_bytes = - sizeof(node->txt) + sizeof(node->iv); + job->msg_len_to_hash_in_bytes = sizeof(node->txt) + sizeof(node->iv); job->iv = node->iv; job->iv_len_in_bytes = node->cipher->iv_len; job->auth_tag_output = node->tag; @@ -287,8 +277,7 @@ customop_test(struct IMB_MGR *mgr) job->cipher_start_src_offset_in_bytes = 16; job->msg_len_to_cipher_in_bytes = sizeof(node->txt); job->hash_start_src_offset_in_bytes = 0; - job->msg_len_to_hash_in_bytes = - sizeof(node->txt) + sizeof(node->iv); + job->msg_len_to_hash_in_bytes = sizeof(node->txt) + sizeof(node->iv); job->iv = node->iv; job->iv_len_in_bytes = node->cipher->iv_len; job->auth_tag_output = node->tag; diff --git a/test/kat-app/customop_test.h b/test/kat-app/customop_test.h index fb5ca099..a07cd6f2 100644 --- a/test/kat-app/customop_test.h +++ b/test/kat-app/customop_test.h @@ -29,6 +29,7 @@ #define _CUSTOMOP_TEST_H_ struct MB_MGR; -extern int customop_test(struct IMB_MGR *state); +extern int +customop_test(struct IMB_MGR *state); #endif /* !_CUSTOMOP_TEST_H_ */ diff --git a/test/kat-app/des_test.c b/test/kat-app/des_test.c index 96262d32..f9537880 100644 --- a/test/kat-app/des_test.c +++ b/test/kat-app/des_test.c @@ -36,7 +36,8 @@ #include "utils.h" #include "cipher_test.h" -int des_test(struct IMB_MGR *mb_mgr); +int +des_test(struct IMB_MGR *mb_mgr); extern const struct cipher_test des_test_json[]; extern const struct cipher_test des_docsis_test_json[]; @@ -44,19 +45,9 @@ extern const struct cipher_test des_cfb_test_json[]; extern const struct cipher_test des3_test_json[]; static int -test_des_many(struct IMB_MGR *mb_mgr, - const uint64_t *ks, - const uint64_t *ks2, - const uint64_t *ks3, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - unsigned text_len, - int dir, - int order, - IMB_CIPHER_MODE cipher, - const int in_place, - const int num_jobs) +test_des_many(struct IMB_MGR *mb_mgr, const uint64_t *ks, const uint64_t *ks2, const uint64_t *ks3, + const void *iv, const uint8_t *in_text, const uint8_t *out_text, unsigned text_len, + int dir, int order, IMB_CIPHER_MODE cipher, const int in_place, const int num_jobs) { const void *ks_ptr[3]; /* 3DES */ struct IMB_JOB *job; @@ -111,22 +102,20 @@ test_des_many(struct IMB_MGR *mb_mgr, job->iv_len_in_bytes = 8; job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; - job->user_data = (void *)((uint64_t)i); + job->user_data = (void *) ((uint64_t) i); job->hash_alg = IMB_AUTH_NULL; job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { - const int num = (const int)((uint64_t)job->user_data); + const int num = (const int) ((uint64_t) job->user_data); jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %d", - __LINE__, job->status, num); + printf("%d error status:%d, job %d", __LINE__, job->status, num); goto end; } - if (memcmp(out_text, targets[num] + sizeof(padding), - text_len)) { + if (memcmp(out_text, targets[num] + sizeof(padding), text_len)) { printf("%d mismatched\n", num); goto end; } @@ -134,8 +123,7 @@ test_des_many(struct IMB_MGR *mb_mgr, printf("%d overwrite head\n", num); goto end; } - if (memcmp(padding, - targets[num] + sizeof(padding) + text_len, + if (memcmp(padding, targets[num] + sizeof(padding) + text_len, sizeof(padding))) { printf("%d overwrite tail\n", num); goto end; @@ -144,16 +132,14 @@ test_des_many(struct IMB_MGR *mb_mgr, } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { - const int num = (const int)((uint64_t)job->user_data); + const int num = (const int) ((uint64_t) job->user_data); jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d Error status:%d, job %d", - __LINE__, job->status, num); + printf("%d Error status:%d, job %d", __LINE__, job->status, num); goto end; } - if (memcmp(out_text, targets[num] + sizeof(padding), - text_len)) { + if (memcmp(out_text, targets[num] + sizeof(padding), text_len)) { printf("%d mismatched\n", num); goto end; } @@ -161,8 +147,7 @@ test_des_many(struct IMB_MGR *mb_mgr, printf("%d overwrite head\n", num); goto end; } - if (memcmp(padding, targets[num] + sizeof(padding) + text_len, - sizeof(padding))) { + if (memcmp(padding, targets[num] + sizeof(padding) + text_len, sizeof(padding))) { printf("%d overwrite tail\n", num); goto end; } @@ -174,7 +159,7 @@ test_des_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -185,64 +170,45 @@ test_des_many(struct IMB_MGR *mb_mgr, } static int -test_des(struct IMB_MGR *mb_mgr, - const uint64_t *ks, - const uint64_t *ks2, - const uint64_t *ks3, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - unsigned text_len, - int dir, - int order, - IMB_CIPHER_MODE cipher, - const int in_place) +test_des(struct IMB_MGR *mb_mgr, const uint64_t *ks, const uint64_t *ks2, const uint64_t *ks3, + const void *iv, const uint8_t *in_text, const uint8_t *out_text, unsigned text_len, + int dir, int order, IMB_CIPHER_MODE cipher, const int in_place) { int ret = 0; if (cipher == IMB_CIPHER_DES3) { if (ks2 == NULL && ks3 == NULL) { - ret |= test_des_many(mb_mgr, ks, ks, ks, iv, in_text, - out_text, text_len, dir, order, - cipher, in_place, 1); - ret |= test_des_many(mb_mgr, ks, ks, ks, iv, in_text, - out_text, text_len, dir, order, - cipher, in_place, 32); + ret |= test_des_many(mb_mgr, ks, ks, ks, iv, in_text, out_text, text_len, + dir, order, cipher, in_place, 1); + ret |= test_des_many(mb_mgr, ks, ks, ks, iv, in_text, out_text, text_len, + dir, order, cipher, in_place, 32); } else { - ret |= test_des_many(mb_mgr, ks, ks2, ks3, iv, in_text, - out_text, text_len, dir, order, - cipher, in_place, 1); - ret |= test_des_many(mb_mgr, ks, ks2, ks3, iv, in_text, - out_text, text_len, dir, order, - cipher, in_place, 32); + ret |= test_des_many(mb_mgr, ks, ks2, ks3, iv, in_text, out_text, text_len, + dir, order, cipher, in_place, 1); + ret |= test_des_many(mb_mgr, ks, ks2, ks3, iv, in_text, out_text, text_len, + dir, order, cipher, in_place, 32); } } else { - ret |= test_des_many(mb_mgr, ks, NULL, NULL, iv, in_text, - out_text, text_len, dir, order, cipher, - in_place, 1); - ret |= test_des_many(mb_mgr, ks, NULL, NULL, iv, in_text, - out_text, text_len, dir, order, cipher, - in_place, 32); + ret |= test_des_many(mb_mgr, ks, NULL, NULL, iv, in_text, out_text, text_len, dir, + order, cipher, in_place, 1); + ret |= test_des_many(mb_mgr, ks, NULL, NULL, iv, in_text, out_text, text_len, dir, + order, cipher, in_place, 32); } return ret; } static void -test_des_vectors(struct IMB_MGR *mb_mgr, - const struct cipher_test *v, - const char *banner, - const IMB_CIPHER_MODE cipher, - struct test_suite_context *ctx) +test_des_vectors(struct IMB_MGR *mb_mgr, const struct cipher_test *v, const char *banner, + const IMB_CIPHER_MODE cipher, struct test_suite_context *ctx) { uint64_t ks[16]; - printf("%s:\n", banner); - for (; v->msg != NULL; v++) { + printf("%s:\n", banner); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector %zu PTLen:%zu\n", - v->tcId, v->msgSize / 8); + printf("Standard vector %zu PTLen:%zu\n", v->tcId, v->msgSize / 8); #else printf("."); #endif @@ -251,8 +217,8 @@ test_des_vectors(struct IMB_MGR *mb_mgr, des_key_schedule(ks, v->key); if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0)) { + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 0)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -260,8 +226,8 @@ test_des_vectors(struct IMB_MGR *mb_mgr, } if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0)) { + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 0)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -269,8 +235,8 @@ test_des_vectors(struct IMB_MGR *mb_mgr, } if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1)) { + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 1)) { printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -278,34 +244,31 @@ test_des_vectors(struct IMB_MGR *mb_mgr, } if (test_des(mb_mgr, ks, NULL, NULL, v->iv, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1)) { + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 1)) { printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } static void -test_des3_vectors(struct IMB_MGR *mb_mgr, - const struct cipher_test *v, - const char *banner, +test_des3_vectors(struct IMB_MGR *mb_mgr, const struct cipher_test *v, const char *banner, struct test_suite_context *ctx) { uint64_t ks1[16]; uint64_t ks2[16]; uint64_t ks3[16]; - printf("%s:\n", banner); - for (; v->msg != NULL; v++) { + printf("%s:\n", banner); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector %zu PTLen:%zu\n", - v->tcId, v->msgSize / 8); + printf("Standard vector %zu PTLen:%zu\n", v->tcId, v->msgSize / 8); #else printf("."); #endif @@ -314,50 +277,42 @@ test_des3_vectors(struct IMB_MGR *mb_mgr, des_key_schedule(ks2, v->key + 8); des_key_schedule(ks3, v->key + 16); - if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - IMB_CIPHER_DES3, 0)) { + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, IMB_CIPHER_DES3, 0)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, - (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - IMB_CIPHER_DES3, 0)) { + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, IMB_CIPHER_DES3, 0)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, - (const void *) v->msg, (const void *) v->ct, - (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, - IMB_CIPHER_DES3, 1)) { + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, (const void *) v->msg, + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, IMB_CIPHER_DES3, 1)) { printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, - (const void *) v->ct, (const void *) v->msg, - (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, - IMB_CIPHER_DES3, 1)) { + if (test_des(mb_mgr, ks1, ks2, ks3, v->iv, (const void *) v->ct, + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, IMB_CIPHER_DES3, 1)) { printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } @@ -378,8 +333,8 @@ des_cfb_validate(struct test_suite_context *ctx) /* Out of place */ /* encrypt test */ - des_cfb_one(output1, (const void *) v->msg, (const uint64_t *) v->iv, - ks, (int) v->msgSize / 8); + des_cfb_one(output1, (const void *) v->msg, (const uint64_t *) v->iv, ks, + (int) v->msgSize / 8); if (memcmp(output1, (const void *) v->ct, v->msgSize / 8)) { printf("DES-CFB enc (OOP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); @@ -387,8 +342,8 @@ des_cfb_validate(struct test_suite_context *ctx) test_suite_update(ctx, 1, 0); } /* decrypt test */ - des_cfb_one(output2, (const void *) v->ct, (const uint64_t *) v->iv, - ks, (int) v->msgSize / 8); + des_cfb_one(output2, (const void *) v->ct, (const uint64_t *) v->iv, ks, + (int) v->msgSize / 8); if (memcmp(output2, (const void *) v->msg, v->msgSize / 8)) { printf("DES-CFB dec (OOP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); @@ -400,8 +355,7 @@ des_cfb_validate(struct test_suite_context *ctx) /* encrypt test */ memcpy(output1, (const void *) v->msg, v->msgSize / 8); - des_cfb_one(output2, output1, (const uint64_t *) v->iv, ks, - (int) v->msgSize / 8); + des_cfb_one(output2, output1, (const uint64_t *) v->iv, ks, (int) v->msgSize / 8); if (memcmp(output2, (const void *) v->ct, v->msgSize / 8)) { printf("DES-CFB enc (IP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); @@ -410,15 +364,13 @@ des_cfb_validate(struct test_suite_context *ctx) } /* decrypt test */ memcpy(output1, (const void *) v->ct, v->msgSize / 8); - des_cfb_one(output2, output1, (const uint64_t *) v->iv, - ks, (int) v->msgSize / 8); + des_cfb_one(output2, output1, (const uint64_t *) v->iv, ks, (int) v->msgSize / 8); if (memcmp(output2, (const void *) v->msg, v->msgSize / 8)) { printf("DES-CFB dec (IP) vector %zu mismatched\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } if (!quiet_mode) printf("\n"); @@ -432,8 +384,7 @@ des_test(struct IMB_MGR *mb_mgr) int errors; test_suite_start(&ctx, "DES-CBC-64"); - test_des_vectors(mb_mgr, des_test_json, "DES standard test vectors", - IMB_CIPHER_DES, &ctx); + test_des_vectors(mb_mgr, des_test_json, "DES standard test vectors", IMB_CIPHER_DES, &ctx); errors = test_suite_end(&ctx); test_suite_start(&ctx, "DOCSIS-DES-64"); @@ -446,12 +397,10 @@ des_test(struct IMB_MGR *mb_mgr) errors += test_suite_end(&ctx); test_suite_start(&ctx, "3DES-CBC-192"); - test_des_vectors(mb_mgr, des_test_json, - "3DES (single key) standard test vectors", + test_des_vectors(mb_mgr, des_test_json, "3DES (single key) standard test vectors", IMB_CIPHER_DES3, &ctx); - test_des3_vectors(mb_mgr, des3_test_json, - "3DES (multiple keys) test vectors", &ctx); + test_des3_vectors(mb_mgr, des3_test_json, "3DES (multiple keys) test vectors", &ctx); errors += test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/des_test.json.c b/test/kat-app/des_test.json.c index 6501130d..df7e4eda 100644 --- a/test/kat-app/des_test.json.c +++ b/test/kat-app/des_test.json.c @@ -30,75 +30,67 @@ const struct cipher_test des_test_json[] = { /* CM-SP-SECv3.1-I07-170111 I.7 */ - {64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", - "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x88\x41\x65\x06", - "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x9f\x04\xd1\xb6\x41\x3d\x4e\xed", 1, - 128}, - {64, 64, 2, "\x3b\x38\x98\x37\x15\x20\xf7\x5e", - "\x02\xa8\x11\x77\x4d\xcd\xe1\x3b", - "\x05\xef\xf7\x00\xe9\xa1\x3a\xe5\xca\x0b\xcb\xd0\x48\x47\x64\xbd\x1f\x23" - "\x1e\xa8\x1c\x7b\x64\xc5\x14\x73\x5a\xc5\x5e\x4b\x79\x63\x3b\x70\x64\x24" - "\x11\x9e\x09\xdc\xaa\xd4\xac\xf2\x1b\x10\xaf\x3b\x33\xcd\xe3\x50\x48\x47" - "\x15\x5c\xbb\x6f\x22\x19\xba\x9b\x7d\xf5", - "\xf3\x31\x8d\x01\x19\x4d\xa8\x00\xa4\x2c\x10\xb5\x33\xd6\xbc\x11\x97\x59" - "\x2d\xcc\x9b\x5d\x35\x9a\xc3\x04\x5d\x07\x4c\x86\xbf\x72\xe5\x1a\x72\x25" - "\x82\x22\x54\x03\xde\x8b\x7a\x58\x5c\x6c\x28\xdf\x41\x0e\x38\xd6\x2a\x86" - "\xe3\x4f\xa2\x7c\x22\x39\x60\x06\x03\x6f", - 1, 512}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x88\x41\x65\x06", + "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x9f\x04\xd1\xb6\x41\x3d\x4e\xed", 1, 128 }, + { 64, 64, 2, "\x3b\x38\x98\x37\x15\x20\xf7\x5e", "\x02\xa8\x11\x77\x4d\xcd\xe1\x3b", + "\x05\xef\xf7\x00\xe9\xa1\x3a\xe5\xca\x0b\xcb\xd0\x48\x47\x64\xbd\x1f\x23" + "\x1e\xa8\x1c\x7b\x64\xc5\x14\x73\x5a\xc5\x5e\x4b\x79\x63\x3b\x70\x64\x24" + "\x11\x9e\x09\xdc\xaa\xd4\xac\xf2\x1b\x10\xaf\x3b\x33\xcd\xe3\x50\x48\x47" + "\x15\x5c\xbb\x6f\x22\x19\xba\x9b\x7d\xf5", + "\xf3\x31\x8d\x01\x19\x4d\xa8\x00\xa4\x2c\x10\xb5\x33\xd6\xbc\x11\x97\x59" + "\x2d\xcc\x9b\x5d\x35\x9a\xc3\x04\x5d\x07\x4c\x86\xbf\x72\xe5\x1a\x72\x25" + "\x82\x22\x54\x03\xde\x8b\x7a\x58\x5c\x6c\x28\xdf\x41\x0e\x38\xd6\x2a\x86" + "\xe3\x4f\xa2\x7c\x22\x39\x60\x06\x03\x6f", + 1, 512 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; const struct cipher_test des_docsis_test_json[] = { /* CM-SP-SECv3.1-I07-170111 I.7 */ - {64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", - "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x88\x41\x65\x06", - "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x9f\x04\xd1\xb6\x41\x3d\x4e\xed", 1, - 128}, - {64, 64, 2, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", - "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x91\xd2\xd1" - "\x9f", - "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x51\x47\x46\x86\x8a\x71\xe5\x77\xef\xac" - "\x88", - 1, 152}, - {64, 64, 3, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", - "\x51\x47\x46\x86\x8a\x71\xe5\x77", "\xd2\xd1\x9f", "\xef\xac\x88", 1, 24}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x88\x41\x65\x06", + "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x9f\x04\xd1\xb6\x41\x3d\x4e\xed", 1, 128 }, + { 64, 64, 2, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", "\x81\x0e\x52\x8e\x1c\x5f\xda\x1a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x91\xd2\xd1" + "\x9f", + "\x0d\xda\x5a\xcb\xd0\x5e\x55\x67\x51\x47\x46\x86\x8a\x71\xe5\x77\xef\xac" + "\x88", + 1, 152 }, + { 64, 64, 3, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", "\x51\x47\x46\x86\x8a\x71\xe5\x77", + "\xd2\xd1\x9f", "\xef\xac\x88", 1, 24 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; const struct cipher_test des_cfb_test_json[] = { /* CM-SP-SECv3.1-I07-170111 I.7 */ - {64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", - "\x51\x47\x46\x86\x8a\x71\xe5\x77", "\xd2\xd1\x9f", "\xef\xac\x88", 1, 24}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 64, 64, 1, "\xe6\x60\x0f\xd8\x85\x2e\xf5\xab", "\x51\x47\x46\x86\x8a\x71\xe5\x77", + "\xd2\xd1\x9f", "\xef\xac\x88", 1, 24 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; const struct cipher_test des3_test_json[] = { - {64, 192, 1, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x00\x01" - "\x02\x03\x04\x05\x06\x07", - "\x00\x01\x02\x03\x04\x05\x06\x07", "\x00\x00\x00\x00\x00\x00\x00\x00", - "\xdf\x0b\x6c\x9c\x31\xcd\x0c\xe4", 1, 64}, - {64, 192, 2, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x00\x01" - "\x02\x03\x04\x05\x06\x07", - "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xdd\xad\xa1\x61\xe8\xd7\x96\x73\xed\x75\x32\xe5\x92\x23\xcd\x0d", 1, - 128}, - {64, 192, 3, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17", - "\x00\x01\x02\x03\x04\x05\x06\x07", "\x00\x00\x00\x00\x00\x00\x00\x00", - "\x58\xed\x24\x8f\x77\xf6\xb1\x9e", 1, 64}, - {64, 192, 4, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17", - "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x89\x4b\xc3\x08\x54\x26\xa4\x41\xf2\x7f\x73\xae\x26\xab\xbf\x74", 1, - 128}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 64, 192, 1, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x00\x01" + "\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07", "\x00\x00\x00\x00\x00\x00\x00\x00", + "\xdf\x0b\x6c\x9c\x31\xcd\x0c\xe4", 1, 64 }, + { 64, 192, 2, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x00\x01" + "\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xdd\xad\xa1\x61\xe8\xd7\x96\x73\xed\x75\x32\xe5\x92\x23\xcd\x0d", 1, 128 }, + { 64, 192, 3, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17", + "\x00\x01\x02\x03\x04\x05\x06\x07", "\x00\x00\x00\x00\x00\x00\x00\x00", + "\x58\xed\x24\x8f\x77\xf6\xb1\x9e", 1, 64 }, + { 64, 192, 4, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17", + "\x00\x01\x02\x03\x04\x05\x06\x07", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x89\x4b\xc3\x08\x54\x26\xa4\x41\xf2\x7f\x73\xae\x26\xab\xbf\x74", 1, 128 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/direct_api_param_test.c b/test/kat-app/direct_api_param_test.c index 93ee734a..7fddb22e 100644 --- a/test/kat-app/direct_api_param_test.c +++ b/test/kat-app/direct_api_param_test.c @@ -47,7 +47,8 @@ #define BUFF_SIZE 4 #define MAX_BUFFS 17 -int direct_api_param_test(struct IMB_MGR *mb_mgr); +int +direct_api_param_test(struct IMB_MGR *mb_mgr); /* Check if imb_errno contains unexpected value */ static int @@ -56,8 +57,8 @@ unexpected_err(IMB_MGR *mgr, const IMB_ERR expected_err, const char *func_desc) const IMB_ERR err = imb_get_errno(mgr); if (err != expected_err) { - printf("%s error: expected %s, got %s\n", func_desc, - imb_get_strerror(expected_err), imb_get_strerror(err)); + printf("%s error: expected %s, got %s\n", func_desc, imb_get_strerror(expected_err), + imb_get_strerror(err)); return 1; } return 0; @@ -72,13 +73,14 @@ jmp_buf dir_api_param_env; #ifndef DEBUG #ifndef _WIN32 -static void seg_handler(int signum) __attribute__((noreturn)); +static void +seg_handler(int signum) __attribute__((noreturn)); #endif /* Signal handler to handle segfaults */ static void seg_handler(int signum) { - (void)signum; /* unused */ + (void) signum; /* unused */ signal(SIGSEGV, seg_handler); /* reset handler */ longjmp(dir_api_param_env, 1); /* reset dir_api_param_env */ @@ -116,8 +118,7 @@ test_IMB_AES_KEYEXP_128(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES_KEYEXP_128(mgr, ap->key, ap->enc_exp_key, - ap->dec_exp_key); + IMB_AES_KEYEXP_128(mgr, ap->key, ap->enc_exp_key, ap->dec_exp_key); if (unexpected_err(mgr, ap->exp_err, "IMB_AES_KEYEXP_128")) return 1; } @@ -154,8 +155,7 @@ test_IMB_AES_KEYEXP_192(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES_KEYEXP_192(mgr, ap->key, ap->enc_exp_key, - ap->dec_exp_key); + IMB_AES_KEYEXP_192(mgr, ap->key, ap->enc_exp_key, ap->dec_exp_key); if (unexpected_err(mgr, ap->exp_err, "IMB_AES_KEYEXP_192")) return 1; } @@ -192,8 +192,7 @@ test_IMB_AES_KEYEXP_256(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES_KEYEXP_256(mgr, ap->key, ap->enc_exp_key, - ap->dec_exp_key); + IMB_AES_KEYEXP_256(mgr, ap->key, ap->enc_exp_key, ap->dec_exp_key); if (unexpected_err(mgr, ap->exp_err, "IMB_AES_KEYEXP_256")) return 1; } @@ -231,10 +230,8 @@ test_IMB_AES_CMAC_SUBKEY_GEN_128(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES_CMAC_SUBKEY_GEN_128(mgr, ap->exp_key, ap->key1, - ap->key2); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES_CMAC_SUBKEY_GEN_128")) + IMB_AES_CMAC_SUBKEY_GEN_128(mgr, ap->exp_key, ap->key1, ap->key2); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES_CMAC_SUBKEY_GEN_128")) return 1; } return 0; @@ -267,15 +264,13 @@ test_IMB_AES_XCBC_KEYEXP(struct IMB_MGR *mgr) } fn_args[] = { { NULL, exp_key, exp_key2, exp_key3, IMB_ERR_NULL_KEY }, { key, NULL, exp_key2, exp_key3, IMB_ERR_NULL_EXP_KEY }, { key, exp_key, NULL, exp_key3, IMB_ERR_NULL_EXP_KEY }, - { key, exp_key, exp_key2, NULL, - IMB_ERR_NULL_EXP_KEY } }; + { key, exp_key, exp_key2, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES_XCBC_KEYEXP(mgr, ap->key, ap->exp_key, ap->exp_key2, - ap->exp_key3); + IMB_AES_XCBC_KEYEXP(mgr, ap->key, ap->exp_key, ap->exp_key2, ap->exp_key3); if (unexpected_err(mgr, ap->exp_err, "IMB_AES_XCBC_KEYEXP")) return 1; } @@ -302,8 +297,7 @@ test_IMB_DES_KEYSCHED(struct IMB_MGR *mgr) uint64_t *exp_key; const void *key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, key, IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, IMB_ERR_NULL_KEY } }; + } fn_args[] = { { NULL, key, IMB_ERR_NULL_EXP_KEY }, { exp_key, NULL, IMB_ERR_NULL_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -336,8 +330,7 @@ test_IMB_SHA1_ONE_BLOCK(struct IMB_MGR *mgr) const void *src; void *tag; const IMB_ERR exp_err; - } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, - { src, NULL, IMB_ERR_NULL_AUTH } }; + } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, { src, NULL, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -370,8 +363,7 @@ test_IMB_SHA224_ONE_BLOCK(struct IMB_MGR *mgr) const void *src; void *tag; const IMB_ERR exp_err; - } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, - { src, NULL, IMB_ERR_NULL_AUTH } }; + } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, { src, NULL, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -404,8 +396,7 @@ test_IMB_SHA256_ONE_BLOCK(struct IMB_MGR *mgr) const void *src; void *tag; const IMB_ERR exp_err; - } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, - { src, NULL, IMB_ERR_NULL_AUTH } }; + } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, { src, NULL, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -438,8 +429,7 @@ test_IMB_SHA384_ONE_BLOCK(struct IMB_MGR *mgr) const void *src; void *tag; const IMB_ERR exp_err; - } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, - { src, NULL, IMB_ERR_NULL_AUTH } }; + } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, { src, NULL, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -472,8 +462,7 @@ test_IMB_SHA512_ONE_BLOCK(struct IMB_MGR *mgr) const void *src; void *tag; const IMB_ERR exp_err; - } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, - { src, NULL, IMB_ERR_NULL_AUTH } }; + } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, { src, NULL, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -506,8 +495,7 @@ test_IMB_MD5_ONE_BLOCK(struct IMB_MGR *mgr) const void *src; void *tag; const IMB_ERR exp_err; - } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, - { src, NULL, IMB_ERR_NULL_AUTH } }; + } fn_args[] = { { NULL, tag, IMB_ERR_NULL_SRC }, { src, NULL, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -735,8 +723,7 @@ test_IMB_AES128_CFB_ONE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_CFB_ONE(mgr, ap->dst, ap->src, ap->iv, - ap->enc_exp_key, ap->len); + IMB_AES128_CFB_ONE(mgr, ap->dst, ap->src, ap->iv, ap->enc_exp_key, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_CFB_ONE")) return 1; } @@ -781,32 +768,26 @@ test_IMB_AES128_GCM_ENC(struct IMB_MGR *mgr) uint8_t *tag; uint64_t tagl; const IMB_ERR exp_err; - } fn_args[] = { { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, - IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_CTX }, - { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_DST }, - { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, - aadl, tag, tagl, IMB_ERR_CIPH_LEN }, - { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, - tagl, IMB_ERR_NULL_IV }, - { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, - tagl, IMB_ERR_NULL_AAD }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, - tagl, IMB_ERR_NULL_AUTH }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, - ((1ULL << 39) - 256), IMB_ERR_AUTH_TAG_LEN } }; + } fn_args[] = { + { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_CTX }, + { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_DST }, + { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_SRC }, + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, aadl, tag, tagl, + IMB_ERR_CIPH_LEN }, + { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, tagl, IMB_ERR_NULL_IV }, + { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, tagl, IMB_ERR_NULL_AAD }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, tagl, IMB_ERR_NULL_AUTH }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, ((1ULL << 39) - 256), + IMB_ERR_AUTH_TAG_LEN } + }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_ENC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, - ap->len, ap->iv, ap->aad, ap->aadl, ap->tag, - ap->tagl); + IMB_AES128_GCM_ENC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len, ap->iv, + ap->aad, ap->aadl, ap->tag, ap->tagl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_ENC")) return 1; } @@ -851,32 +832,26 @@ test_IMB_AES192_GCM_ENC(struct IMB_MGR *mgr) uint8_t *tag; uint64_t tagl; const IMB_ERR exp_err; - } fn_args[] = { { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, - IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_CTX }, - { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_DST }, - { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, - aadl, tag, tagl, IMB_ERR_CIPH_LEN }, - { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, - tagl, IMB_ERR_NULL_IV }, - { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, - tagl, IMB_ERR_NULL_AAD }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, - tagl, IMB_ERR_NULL_AUTH }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, - ((1ULL << 39) - 256), IMB_ERR_AUTH_TAG_LEN } }; + } fn_args[] = { + { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_CTX }, + { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_DST }, + { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_SRC }, + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, aadl, tag, tagl, + IMB_ERR_CIPH_LEN }, + { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, tagl, IMB_ERR_NULL_IV }, + { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, tagl, IMB_ERR_NULL_AAD }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, tagl, IMB_ERR_NULL_AUTH }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, ((1ULL << 39) - 256), + IMB_ERR_AUTH_TAG_LEN } + }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_ENC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, - ap->len, ap->iv, ap->aad, ap->aadl, ap->tag, - ap->tagl); + IMB_AES192_GCM_ENC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len, ap->iv, + ap->aad, ap->aadl, ap->tag, ap->tagl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_ENC")) return 1; } @@ -921,32 +896,26 @@ test_IMB_AES256_GCM_ENC(struct IMB_MGR *mgr) uint8_t *tag; uint64_t tagl; const IMB_ERR exp_err; - } fn_args[] = { { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, - IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_CTX }, - { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_DST }, - { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, - aadl, tag, tagl, IMB_ERR_CIPH_LEN }, - { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, - tagl, IMB_ERR_NULL_IV }, - { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, - tagl, IMB_ERR_NULL_AAD }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, - tagl, IMB_ERR_NULL_AUTH }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, - ((1ULL << 39) - 256), IMB_ERR_AUTH_TAG_LEN } }; + } fn_args[] = { + { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_CTX }, + { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_DST }, + { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_SRC }, + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, aadl, tag, tagl, + IMB_ERR_CIPH_LEN }, + { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, tagl, IMB_ERR_NULL_IV }, + { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, tagl, IMB_ERR_NULL_AAD }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, tagl, IMB_ERR_NULL_AUTH }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, ((1ULL << 39) - 256), + IMB_ERR_AUTH_TAG_LEN } + }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_ENC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, - ap->len, ap->iv, ap->aad, ap->aadl, ap->tag, - ap->tagl); + IMB_AES256_GCM_ENC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len, ap->iv, + ap->aad, ap->aadl, ap->tag, ap->tagl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_ENC")) return 1; } @@ -991,32 +960,26 @@ test_IMB_AES128_GCM_DEC(struct IMB_MGR *mgr) uint8_t *tag; uint64_t tagl; const IMB_ERR exp_err; - } fn_args[] = { { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, - IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_CTX }, - { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_DST }, - { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, - aadl, tag, tagl, IMB_ERR_CIPH_LEN }, - { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, - tagl, IMB_ERR_NULL_IV }, - { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, - tagl, IMB_ERR_NULL_AAD }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, - tagl, IMB_ERR_NULL_AUTH }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, - ((1ULL << 39) - 256), IMB_ERR_AUTH_TAG_LEN } }; + } fn_args[] = { + { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_CTX }, + { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_DST }, + { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_SRC }, + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, aadl, tag, tagl, + IMB_ERR_CIPH_LEN }, + { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, tagl, IMB_ERR_NULL_IV }, + { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, tagl, IMB_ERR_NULL_AAD }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, tagl, IMB_ERR_NULL_AUTH }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, ((1ULL << 39) - 256), + IMB_ERR_AUTH_TAG_LEN } + }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_DEC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, - ap->len, ap->iv, ap->aad, ap->aadl, ap->tag, - ap->tagl); + IMB_AES128_GCM_DEC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len, ap->iv, + ap->aad, ap->aadl, ap->tag, ap->tagl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_DEC")) return 1; } @@ -1061,32 +1024,26 @@ test_IMB_AES192_GCM_DEC(struct IMB_MGR *mgr) uint8_t *tag; uint64_t tagl; const IMB_ERR exp_err; - } fn_args[] = { { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, - IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_CTX }, - { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_DST }, - { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, - aadl, tag, tagl, IMB_ERR_CIPH_LEN }, - { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, - tagl, IMB_ERR_NULL_IV }, - { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, - tagl, IMB_ERR_NULL_AAD }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, - tagl, IMB_ERR_NULL_AUTH }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, - ((1ULL << 39) - 256), IMB_ERR_AUTH_TAG_LEN } }; + } fn_args[] = { + { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_CTX }, + { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_DST }, + { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_SRC }, + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, aadl, tag, tagl, + IMB_ERR_CIPH_LEN }, + { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, tagl, IMB_ERR_NULL_IV }, + { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, tagl, IMB_ERR_NULL_AAD }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, tagl, IMB_ERR_NULL_AUTH }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, ((1ULL << 39) - 256), + IMB_ERR_AUTH_TAG_LEN } + }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_DEC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, - ap->len, ap->iv, ap->aad, ap->aadl, ap->tag, - ap->tagl); + IMB_AES192_GCM_DEC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len, ap->iv, + ap->aad, ap->aadl, ap->tag, ap->tagl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_DEC")) return 1; } @@ -1131,32 +1088,26 @@ test_IMB_AES256_GCM_DEC(struct IMB_MGR *mgr) uint8_t *tag; uint64_t tagl; const IMB_ERR exp_err; - } fn_args[] = { { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, - IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_CTX }, - { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_DST }, - { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, - tagl, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, - aadl, tag, tagl, IMB_ERR_CIPH_LEN }, - { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, - tagl, IMB_ERR_NULL_IV }, - { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, - tagl, IMB_ERR_NULL_AAD }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, - tagl, IMB_ERR_NULL_AUTH }, - { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, - ((1ULL << 39) - 256), IMB_ERR_AUTH_TAG_LEN } }; + } fn_args[] = { + { NULL, ctx, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, dst, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_CTX }, + { exp_key, ctx, NULL, src, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_DST }, + { exp_key, ctx, dst, NULL, len, iv, aad, aadl, tag, tagl, IMB_ERR_NULL_SRC }, + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), iv, aad, aadl, tag, tagl, + IMB_ERR_CIPH_LEN }, + { exp_key, ctx, dst, src, len, NULL, aad, aadl, tag, tagl, IMB_ERR_NULL_IV }, + { exp_key, ctx, dst, src, len, iv, NULL, aadl, tag, tagl, IMB_ERR_NULL_AAD }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, NULL, tagl, IMB_ERR_NULL_AUTH }, + { exp_key, ctx, dst, src, len, iv, aad, aadl, tag, ((1ULL << 39) - 256), + IMB_ERR_AUTH_TAG_LEN } + }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_DEC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, - ap->len, ap->iv, ap->aad, ap->aadl, ap->tag, - ap->tagl); + IMB_AES256_GCM_DEC(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len, ap->iv, + ap->aad, ap->aadl, ap->tag, ap->tagl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_DEC")) return 1; } @@ -1200,8 +1151,7 @@ test_IMB_AES128_GCM_INIT(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->aad, - ap->aadl); + IMB_AES128_GCM_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->aad, ap->aadl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_INIT")) return 1; } @@ -1245,8 +1195,7 @@ test_IMB_AES192_GCM_INIT(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->aad, - ap->aadl); + IMB_AES192_GCM_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->aad, ap->aadl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_INIT")) return 1; } @@ -1290,8 +1239,7 @@ test_IMB_AES256_GCM_INIT(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->aad, - ap->aadl); + IMB_AES256_GCM_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->aad, ap->aadl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_INIT")) return 1; } @@ -1331,17 +1279,14 @@ test_IMB_AES128_GCM_ENC_UPDATE(struct IMB_MGR *mgr) { exp_key, NULL, dst, src, len, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, src, len, IMB_ERR_NULL_DST }, { exp_key, ctx, dst, NULL, len, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), - IMB_ERR_CIPH_LEN } }; + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_ENC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES128_GCM_ENC_UPDATE")) + IMB_AES128_GCM_ENC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_ENC_UPDATE")) return 1; } return 0; @@ -1380,17 +1325,14 @@ test_IMB_AES192_GCM_ENC_UPDATE(struct IMB_MGR *mgr) { exp_key, NULL, dst, src, len, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, src, len, IMB_ERR_NULL_DST }, { exp_key, ctx, dst, NULL, len, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), - IMB_ERR_CIPH_LEN } }; + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_ENC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES192_GCM_ENC_UPDATE")) + IMB_AES192_GCM_ENC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_ENC_UPDATE")) return 1; } return 0; @@ -1429,17 +1371,14 @@ test_IMB_AES256_GCM_ENC_UPDATE(struct IMB_MGR *mgr) { exp_key, NULL, dst, src, len, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, src, len, IMB_ERR_NULL_DST }, { exp_key, ctx, dst, NULL, len, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), - IMB_ERR_CIPH_LEN } }; + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_ENC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES256_GCM_ENC_UPDATE")) + IMB_AES256_GCM_ENC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_ENC_UPDATE")) return 1; } return 0; @@ -1478,17 +1417,14 @@ test_IMB_AES128_GCM_DEC_UPDATE(struct IMB_MGR *mgr) { exp_key, NULL, dst, src, len, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, src, len, IMB_ERR_NULL_DST }, { exp_key, ctx, dst, NULL, len, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), - IMB_ERR_CIPH_LEN } }; + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_DEC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES128_GCM_DEC_UPDATE")) + IMB_AES128_GCM_DEC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_DEC_UPDATE")) return 1; } return 0; @@ -1527,17 +1463,14 @@ test_IMB_AES192_GCM_DEC_UPDATE(struct IMB_MGR *mgr) { exp_key, NULL, dst, src, len, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, src, len, IMB_ERR_NULL_DST }, { exp_key, ctx, dst, NULL, len, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), - IMB_ERR_CIPH_LEN } }; + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_DEC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES192_GCM_DEC_UPDATE")) + IMB_AES192_GCM_DEC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_DEC_UPDATE")) return 1; } return 0; @@ -1576,17 +1509,14 @@ test_IMB_AES256_GCM_DEC_UPDATE(struct IMB_MGR *mgr) { exp_key, NULL, dst, src, len, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, src, len, IMB_ERR_NULL_DST }, { exp_key, ctx, dst, NULL, len, IMB_ERR_NULL_SRC }, - { exp_key, ctx, dst, src, ((1ULL << 39) - 256), - IMB_ERR_CIPH_LEN } }; + { exp_key, ctx, dst, src, ((1ULL << 39) - 256), IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_DEC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES256_GCM_DEC_UPDATE")) + IMB_AES256_GCM_DEC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_DEC_UPDATE")) return 1; } return 0; @@ -1628,10 +1558,8 @@ test_IMB_AES128_GCM_ENC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_ENC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES128_GCM_ENC_FINALIZE")) + IMB_AES128_GCM_ENC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_ENC_FINALIZE")) return 1; } return 0; @@ -1673,10 +1601,8 @@ test_IMB_AES192_GCM_ENC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_ENC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES192_GCM_ENC_FINALIZE")) + IMB_AES192_GCM_ENC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_ENC_FINALIZE")) return 1; } return 0; @@ -1718,10 +1644,8 @@ test_IMB_AES256_GCM_ENC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_ENC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES256_GCM_ENC_FINALIZE")) + IMB_AES256_GCM_ENC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_ENC_FINALIZE")) return 1; } return 0; @@ -1763,10 +1687,8 @@ test_IMB_AES128_GCM_DEC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_DEC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES128_GCM_DEC_FINALIZE")) + IMB_AES128_GCM_DEC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_DEC_FINALIZE")) return 1; } return 0; @@ -1808,10 +1730,8 @@ test_IMB_AES192_GCM_DEC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_DEC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES192_GCM_DEC_FINALIZE")) + IMB_AES192_GCM_DEC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_DEC_FINALIZE")) return 1; } return 0; @@ -1853,10 +1773,8 @@ test_IMB_AES256_GCM_DEC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_DEC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES256_GCM_DEC_FINALIZE")) + IMB_AES256_GCM_DEC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_DEC_FINALIZE")) return 1; } return 0; @@ -1883,8 +1801,7 @@ test_IMB_AES128_GCM_PRE(struct IMB_MGR *mgr) const void *key; struct gcm_key_data *exp_key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, - { key, NULL, IMB_ERR_NULL_EXP_KEY } }; + } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, { key, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -1918,8 +1835,7 @@ test_IMB_AES192_GCM_PRE(struct IMB_MGR *mgr) const void *key; struct gcm_key_data *exp_key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, - { key, NULL, IMB_ERR_NULL_EXP_KEY } }; + } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, { key, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -1953,8 +1869,7 @@ test_IMB_AES256_GCM_PRE(struct IMB_MGR *mgr) const void *key; struct gcm_key_data *exp_key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, - { key, NULL, IMB_ERR_NULL_EXP_KEY } }; + } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, { key, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -2004,8 +1919,7 @@ test_IMB_ZUC_EEA3_1_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_ZUC_EEA3_1_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->dst, - ap->len); + IMB_ZUC_EEA3_1_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->dst, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_ZUC_EEA3_1_BUFFER")) return 1; } @@ -2030,10 +1944,10 @@ test_IMB_ZUC_EEA3_4_BUFFER(struct IMB_MGR *mgr) void *dst[MAX_BUFFS]; void *dst_NULL_pts[MAX_BUFFS]; uint8_t dst_s[MAX_BUFFS][BUFF_SIZE]; - const uint32_t len_all_zero[MAX_BUFFS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 }; - const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 }; + const uint32_t len_all_zero[MAX_BUFFS] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; int seg_err; /* segfault flag */ seg_err = setjmp(dir_api_param_env); @@ -2074,8 +1988,7 @@ test_IMB_ZUC_EEA3_4_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_ZUC_EEA3_4_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->dst, - ap->len); + IMB_ZUC_EEA3_4_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->dst, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_ZUC_EEA3_4_BUFFER")) return 1; } @@ -2100,10 +2013,10 @@ test_IMB_ZUC_EEA3_N_BUFFER(struct IMB_MGR *mgr) void *dst[MAX_BUFFS]; void *dst_NULL_pts[MAX_BUFFS]; uint8_t dst_s[MAX_BUFFS][BUFF_SIZE]; - const uint32_t len_all_zero[MAX_BUFFS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 }; - const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 }; + const uint32_t len_all_zero[MAX_BUFFS] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; const uint32_t count = MAX_BUFFS; int seg_err; /* segfault flag */ @@ -2132,24 +2045,21 @@ test_IMB_ZUC_EEA3_N_BUFFER(struct IMB_MGR *mgr) const uint32_t *len; const uint32_t count; const IMB_ERR exp_err; - } fn_args[] = { - { key_NULL_pts, iv, src, dst, len, count, IMB_ERR_NULL_KEY }, - { NULL, iv, src, dst, len, count, IMB_ERR_NULL_KEY }, - { key, iv_NULL_pts, src, dst, len, count, IMB_ERR_NULL_IV }, - { key, NULL, src, dst, len, count, IMB_ERR_NULL_IV }, - { key, iv, src_NULL_pts, dst, len, count, IMB_ERR_NULL_SRC }, - { key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, - { key, iv, src, dst_NULL_pts, len, count, IMB_ERR_NULL_DST }, - { key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, - { key, iv, src, dst, len_all_zero, count, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { key_NULL_pts, iv, src, dst, len, count, IMB_ERR_NULL_KEY }, + { NULL, iv, src, dst, len, count, IMB_ERR_NULL_KEY }, + { key, iv_NULL_pts, src, dst, len, count, IMB_ERR_NULL_IV }, + { key, NULL, src, dst, len, count, IMB_ERR_NULL_IV }, + { key, iv, src_NULL_pts, dst, len, count, IMB_ERR_NULL_SRC }, + { key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, + { key, iv, src, dst_NULL_pts, len, count, IMB_ERR_NULL_DST }, + { key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, + { key, iv, src, dst, len_all_zero, count, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_ZUC_EEA3_N_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->dst, - ap->len, ap->count); + IMB_ZUC_EEA3_N_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->dst, ap->len, ap->count); if (unexpected_err(mgr, ap->exp_err, "IMB_ZUC_EEA3_N_BUFFER")) return 1; } @@ -2192,8 +2102,7 @@ test_IMB_ZUC_EIA3_1_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_ZUC_EIA3_1_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->len, - ap->tag); + IMB_ZUC_EIA3_1_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->len, ap->tag); if (unexpected_err(mgr, ap->exp_err, "IMB_ZUC_EIA3_1_BUFFER")) return 1; } @@ -2237,8 +2146,7 @@ test_IMB_KASUMI_F8_1_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F8_1_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, - ap->dst, ap->len); + IMB_KASUMI_F8_1_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F8_1_BUFFER")) return 1; } @@ -2275,21 +2183,18 @@ test_IMB_KASUMI_F8_1_BUFFER_BIT(struct IMB_MGR *mgr) const uint32_t len; const uint32_t offset; const IMB_ERR exp_err; - } fn_args[] = { - { NULL, iv, src, dst, len, offset, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv, NULL, dst, len, offset, IMB_ERR_NULL_SRC }, - { exp_key, iv, src, NULL, len, offset, IMB_ERR_NULL_DST }, - { exp_key, iv, src, dst, 0, offset, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { NULL, iv, src, dst, len, offset, IMB_ERR_NULL_EXP_KEY }, + { exp_key, iv, NULL, dst, len, offset, IMB_ERR_NULL_SRC }, + { exp_key, iv, src, NULL, len, offset, IMB_ERR_NULL_DST }, + { exp_key, iv, src, dst, 0, offset, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, ap->exp_key, ap->iv, ap->src, - ap->dst, ap->len, ap->offset); - if (unexpected_err(mgr, ap->exp_err, - "IMB_KASUMI_F8_1_BUFFER_BIT")) + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, ap->len, + ap->offset); + if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F8_1_BUFFER_BIT")) return 1; } return 0; @@ -2332,26 +2237,19 @@ test_IMB_KASUMI_F8_2_BUFFER(struct IMB_MGR *mgr) const IMB_ERR exp_err; } fn_args[] = { { NULL, iv1, iv2, src1, dst1, len1, src2, dst2, len2, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv1, iv2, NULL, dst1, len1, src2, dst2, len2, - IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, src1, NULL, len1, src2, dst2, len2, - IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, src1, dst1, 0, src2, dst2, len2, - IMB_ERR_CIPH_LEN }, - { exp_key, iv1, iv2, src1, dst1, len1, NULL, dst2, len2, - IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, src1, dst1, len1, src2, NULL, len2, - IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, src1, dst1, len1, src2, dst2, 0, - IMB_ERR_CIPH_LEN } }; + { exp_key, iv1, iv2, NULL, dst1, len1, src2, dst2, len2, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, src1, NULL, len1, src2, dst2, len2, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, src1, dst1, 0, src2, dst2, len2, IMB_ERR_CIPH_LEN }, + { exp_key, iv1, iv2, src1, dst1, len1, NULL, dst2, len2, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, src1, dst1, len1, src2, NULL, len2, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, src1, dst1, len1, src2, dst2, 0, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F8_2_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, - ap->src1, ap->dst1, ap->len1, ap->src2, - ap->dst2, ap->len2); + IMB_KASUMI_F8_2_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, ap->src1, ap->dst1, + ap->len1, ap->src2, ap->dst2, ap->len2); if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F8_2_BUFFER")) return 1; } @@ -2397,30 +2295,29 @@ test_IMB_KASUMI_F8_3_BUFFER(struct IMB_MGR *mgr) void *dst3; const uint32_t len; const IMB_ERR exp_err; - } fn_args[] = { { NULL, iv1, iv2, iv3, src1, dst1, src2, dst2, src3, - dst3, len, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv1, iv2, iv3, NULL, dst1, src2, dst2, src3, - dst3, len, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, src1, NULL, src2, dst2, src3, - dst3, len, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, src1, dst1, NULL, dst2, src3, - dst3, len, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, src1, dst1, src2, NULL, src3, - dst3, len, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, src1, dst1, src2, dst2, NULL, - dst3, len, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, src1, dst1, src2, dst2, src3, - NULL, len, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, src1, dst1, src2, dst2, src3, - dst3, 0, IMB_ERR_CIPH_LEN } }; + } fn_args[] = { { NULL, iv1, iv2, iv3, src1, dst1, src2, dst2, src3, dst3, len, + IMB_ERR_NULL_EXP_KEY }, + { exp_key, iv1, iv2, iv3, NULL, dst1, src2, dst2, src3, dst3, len, + IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, src1, NULL, src2, dst2, src3, dst3, len, + IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, src1, dst1, NULL, dst2, src3, dst3, len, + IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, src1, dst1, src2, NULL, src3, dst3, len, + IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, src1, dst1, src2, dst2, NULL, dst3, len, + IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, src1, dst1, src2, dst2, src3, NULL, len, + IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, src1, dst1, src2, dst2, src3, dst3, 0, + IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F8_3_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, - ap->iv3, ap->src1, ap->dst1, ap->src2, - ap->dst2, ap->src3, ap->dst3, ap->len); + IMB_KASUMI_F8_3_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, ap->iv3, ap->src1, + ap->dst1, ap->src2, ap->dst2, ap->src3, ap->dst3, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F8_3_BUFFER")) return 1; } @@ -2472,34 +2369,33 @@ test_IMB_KASUMI_F8_4_BUFFER(struct IMB_MGR *mgr) void *dst4; const uint32_t len; const IMB_ERR exp_err; - } fn_args[] = { { NULL, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, - src3, dst3, src4, dst4, len, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv1, iv2, iv3, iv4, NULL, dst1, src2, dst2, - src3, dst3, src4, dst4, len, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, NULL, src2, dst2, - src3, dst3, src4, dst4, len, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, NULL, dst2, - src3, dst3, src4, dst4, len, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, NULL, - src3, dst3, src4, dst4, len, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, - NULL, dst3, src4, dst4, len, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, - src3, NULL, src4, dst4, len, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, - src3, dst3, NULL, dst4, len, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, - src3, dst3, src4, NULL, len, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, - src3, dst3, src4, dst4, 0, IMB_ERR_CIPH_LEN } }; + } fn_args[] = { { NULL, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, src3, dst3, src4, dst4, + len, IMB_ERR_NULL_EXP_KEY }, + { exp_key, iv1, iv2, iv3, iv4, NULL, dst1, src2, dst2, src3, dst3, src4, + dst4, len, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, NULL, src2, dst2, src3, dst3, src4, + dst4, len, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, NULL, dst2, src3, dst3, src4, + dst4, len, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, NULL, src3, dst3, src4, + dst4, len, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, NULL, dst3, src4, + dst4, len, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, src3, NULL, src4, + dst4, len, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, src3, dst3, NULL, + dst4, len, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, src3, dst3, src4, + NULL, len, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, src2, dst2, src3, dst3, src4, + dst4, 0, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F8_4_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, - ap->iv3, ap->iv4, ap->src1, ap->dst1, - ap->src2, ap->dst2, ap->src3, ap->dst3, + IMB_KASUMI_F8_4_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, ap->iv3, ap->iv4, + ap->src1, ap->dst1, ap->src2, ap->dst2, ap->src3, ap->dst3, ap->src4, ap->dst4, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F8_4_BUFFER")) return 1; @@ -2522,10 +2418,10 @@ test_IMB_KASUMI_F8_N_BUFFER(struct IMB_MGR *mgr) void *dst[MAX_BUFFS]; void *dst_NULL_pts[MAX_BUFFS]; uint8_t dst_s[MAX_BUFFS][BUFF_SIZE]; - const uint32_t len_all_zero[MAX_BUFFS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 }; - const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 }; + const uint32_t len_all_zero[MAX_BUFFS] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; const uint32_t count = MAX_BUFFS; int seg_err; /* segfault flag */ @@ -2550,23 +2446,19 @@ test_IMB_KASUMI_F8_N_BUFFER(struct IMB_MGR *mgr) const uint32_t *len; const uint32_t count; const IMB_ERR exp_err; - } fn_args[] = { - { NULL, iv, src, dst, len, count, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv, src_NULL_pts, dst, len, count, - IMB_ERR_NULL_SRC }, - { exp_key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, - { exp_key, iv, src, dst_NULL_pts, len, count, - IMB_ERR_NULL_DST }, - { exp_key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, - { exp_key, iv, src, dst, len_all_zero, count, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { NULL, iv, src, dst, len, count, IMB_ERR_NULL_EXP_KEY }, + { exp_key, iv, src_NULL_pts, dst, len, count, IMB_ERR_NULL_SRC }, + { exp_key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, + { exp_key, iv, src, dst_NULL_pts, len, count, IMB_ERR_NULL_DST }, + { exp_key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, + { exp_key, iv, src, dst, len_all_zero, count, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F8_N_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, - ap->dst, ap->len, ap->count); + IMB_KASUMI_F8_N_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, ap->len, + ap->count); if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F8_N_BUFFER")) return 1; } @@ -2607,8 +2499,7 @@ test_IMB_KASUMI_F9_1_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F9_1_BUFFER(mgr, ap->exp_key, ap->src, ap->len, - ap->tag); + IMB_KASUMI_F9_1_BUFFER(mgr, ap->exp_key, ap->src, ap->len, ap->tag); if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F9_1_BUFFER")) return 1; } @@ -2648,17 +2539,15 @@ test_IMB_KASUMI_F9_1_BUFFER_USER(struct IMB_MGR *mgr) } fn_args[] = { { NULL, iv, src, len, tag, dir, IMB_ERR_NULL_EXP_KEY }, { exp_key, iv, NULL, len, tag, dir, IMB_ERR_NULL_SRC }, { exp_key, iv, src, 0, tag, dir, IMB_ERR_AUTH_LEN }, - { exp_key, iv, src, len, NULL, dir, - IMB_ERR_NULL_AUTH } }; + { exp_key, iv, src, len, NULL, dir, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_KASUMI_F9_1_BUFFER_USER(mgr, ap->exp_key, ap->iv, ap->src, - ap->len, ap->tag, ap->dir); - if (unexpected_err(mgr, ap->exp_err, - "IMB_KASUMI_F9_1_BUFFER_USER")) + IMB_KASUMI_F9_1_BUFFER_USER(mgr, ap->exp_key, ap->iv, ap->src, ap->len, ap->tag, + ap->dir); + if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_F9_1_BUFFER_USER")) return 1; } return 0; @@ -2686,16 +2575,14 @@ test_IMB_KASUMI_INIT_F8_KEY_SCHED(struct IMB_MGR *mgr) const void *key; kasumi_key_sched_t *exp_key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, - { key, NULL, IMB_ERR_NULL_EXP_KEY } }; + } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, { key, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, ap->key, ap->exp_key); - if (unexpected_err(mgr, ap->exp_err, - "IMB_KASUMI_INIT_F8_KEY_SCHED")) + if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_INIT_F8_KEY_SCHED")) return 1; } return 0; @@ -2723,16 +2610,14 @@ test_IMB_KASUMI_INIT_F9_KEY_SCHED(struct IMB_MGR *mgr) const void *key; kasumi_key_sched_t *exp_key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, - { key, NULL, IMB_ERR_NULL_EXP_KEY } }; + } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, { key, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, ap->key, ap->exp_key); - if (unexpected_err(mgr, ap->exp_err, - "IMB_KASUMI_INIT_F9_KEY_SCHED")) + if (unexpected_err(mgr, ap->exp_err, "IMB_KASUMI_INIT_F9_KEY_SCHED")) return 1; } return 0; @@ -2769,22 +2654,19 @@ test_IMB_SNOW3G_F8_1_BUFFER_BIT(struct IMB_MGR *mgr) const uint32_t len; const uint32_t offset; const IMB_ERR exp_err; - } fn_args[] = { - { NULL, iv, src, dst, len, offset, IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, src, dst, len, offset, IMB_ERR_NULL_IV }, - { exp_key, iv, NULL, dst, len, offset, IMB_ERR_NULL_SRC }, - { exp_key, iv, src, NULL, len, offset, IMB_ERR_NULL_DST }, - { exp_key, iv, src, dst, 0, offset, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { NULL, iv, src, dst, len, offset, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, src, dst, len, offset, IMB_ERR_NULL_IV }, + { exp_key, iv, NULL, dst, len, offset, IMB_ERR_NULL_SRC }, + { exp_key, iv, src, NULL, len, offset, IMB_ERR_NULL_DST }, + { exp_key, iv, src, dst, 0, offset, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_1_BUFFER_BIT(mgr, ap->exp_key, ap->iv, ap->src, - ap->dst, ap->len, ap->offset); - if (unexpected_err(mgr, ap->exp_err, - "IMB_SNOW3G_F8_1_BUFFER_BIT")) + IMB_SNOW3G_F8_1_BUFFER_BIT(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, ap->len, + ap->offset); + if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_1_BUFFER_BIT")) return 1; } return 0; @@ -2827,8 +2709,7 @@ test_IMB_SNOW3G_F8_1_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_1_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, - ap->dst, ap->len); + IMB_SNOW3G_F8_1_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_1_BUFFER")) return 1; } @@ -2872,30 +2753,21 @@ test_IMB_SNOW3G_F8_2_BUFFER(struct IMB_MGR *mgr) const IMB_ERR exp_err; } fn_args[] = { { NULL, iv1, iv2, src1, dst1, len1, src2, dst2, len2, IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, iv2, src1, dst1, len1, src2, dst2, - len2, IMB_ERR_NULL_IV }, - { exp_key, iv1, NULL, src1, dst1, len1, src2, dst2, - len2, IMB_ERR_NULL_IV }, - { exp_key, iv1, iv2, NULL, dst1, len1, src2, dst2, len2, - IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, src1, NULL, len1, src2, dst2, len2, - IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, src1, dst1, 0, src2, dst2, len2, - IMB_ERR_CIPH_LEN }, - { exp_key, iv1, iv2, src1, dst1, len1, NULL, dst2, len2, - IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, src1, dst1, len1, src2, NULL, len2, - IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, src1, dst1, len1, src2, dst2, 0, - IMB_ERR_CIPH_LEN } }; + { exp_key, NULL, iv2, src1, dst1, len1, src2, dst2, len2, IMB_ERR_NULL_IV }, + { exp_key, iv1, NULL, src1, dst1, len1, src2, dst2, len2, IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, NULL, dst1, len1, src2, dst2, len2, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, src1, NULL, len1, src2, dst2, len2, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, src1, dst1, 0, src2, dst2, len2, IMB_ERR_CIPH_LEN }, + { exp_key, iv1, iv2, src1, dst1, len1, NULL, dst2, len2, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, src1, dst1, len1, src2, NULL, len2, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, src1, dst1, len1, src2, dst2, 0, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_2_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, - ap->src1, ap->dst1, ap->len1, ap->src2, - ap->dst2, ap->len2); + IMB_SNOW3G_F8_2_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, ap->src1, ap->dst1, + ap->len1, ap->src2, ap->dst2, ap->len2); if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_2_BUFFER")) return 1; } @@ -2953,51 +2825,48 @@ test_IMB_SNOW3G_F8_4_BUFFER(struct IMB_MGR *mgr) void *dst4; const uint32_t len4; const IMB_ERR exp_err; - } fn_args[] = { - { NULL, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, - src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, - { exp_key, iv1, NULL, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, - { exp_key, iv1, iv2, NULL, iv4, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, - { exp_key, iv1, iv2, iv3, NULL, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, - { exp_key, iv1, iv2, iv3, iv4, NULL, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, NULL, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, 0, src2, dst2, len2, - src3, dst3, len3, src4, dst4, len4, IMB_ERR_CIPH_LEN }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, NULL, dst2, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, NULL, - len2, src3, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, 0, - src3, dst3, len3, src4, dst4, len4, IMB_ERR_CIPH_LEN }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, NULL, dst3, len3, src4, dst4, len4, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, src3, NULL, len3, src4, dst4, len4, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, src3, dst3, 0, src4, dst4, len4, IMB_ERR_CIPH_LEN }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, NULL, dst4, len4, IMB_ERR_NULL_SRC }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, NULL, len4, IMB_ERR_NULL_DST }, - { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, 0, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { NULL, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, dst3, + len3, src4, dst4, len4, IMB_ERR_NULL_EXP_KEY }, + { exp_key, NULL, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, + { exp_key, iv1, NULL, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, NULL, iv4, src1, dst1, len1, src2, dst2, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, iv3, NULL, src1, dst1, len1, src2, dst2, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, iv3, iv4, NULL, dst1, len1, src2, dst2, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, NULL, len1, src2, dst2, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, 0, src2, dst2, len2, src3, dst3, + len3, src4, dst4, len4, IMB_ERR_CIPH_LEN }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, NULL, dst2, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, NULL, len2, src3, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, 0, src3, dst3, + len3, src4, dst4, len4, IMB_ERR_CIPH_LEN }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, NULL, + dst3, len3, src4, dst4, len4, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, + NULL, len3, src4, dst4, len4, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, + dst3, 0, src4, dst4, len4, IMB_ERR_CIPH_LEN }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, + dst3, len3, NULL, dst4, len4, IMB_ERR_NULL_SRC }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, + dst3, len3, src4, NULL, len4, IMB_ERR_NULL_DST }, + { exp_key, iv1, iv2, iv3, iv4, src1, dst1, len1, src2, dst2, len2, src3, + dst3, len3, src4, dst4, 0, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_4_BUFFER( - mgr, ap->exp_key, ap->iv1, ap->iv2, ap->iv3, ap->iv4, - ap->src1, ap->dst1, ap->len1, ap->src2, ap->dst2, ap->len2, - ap->src3, ap->dst3, ap->len3, ap->src4, ap->dst4, ap->len4); + IMB_SNOW3G_F8_4_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, ap->iv3, ap->iv4, + ap->src1, ap->dst1, ap->len1, ap->src2, ap->dst2, ap->len2, + ap->src3, ap->dst3, ap->len3, ap->src4, ap->dst4, ap->len4); if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_4_BUFFER")) return 1; } @@ -3105,107 +2974,38 @@ test_IMB_SNOW3G_F8_8_BUFFER(struct IMB_MGR *mgr) dst7, len7, src8, dst8, len8, IMB_ERR_NULL_EXP_KEY }, - { exp_key, NULL, iv2, iv3, iv4, iv5, iv6, iv7, - iv8, src1, dst1, len1, src2, dst2, len2, src3, - dst3, len3, src4, dst4, len4, src5, dst5, len5, - src6, dst6, len6, src7, dst7, len7, src8, dst8, - len8, IMB_ERR_NULL_IV }, - { exp_key, iv1, - NULL, iv3, - iv4, iv5, - iv6, iv7, - iv8, src1, - dst1, len1, - src2, dst2, - len2, src3, - dst3, len3, - src4, dst4, - len4, src5, - dst5, len5, - src6, dst6, - len6, src7, - dst7, len7, - src8, dst8, - len8, IMB_ERR_NULL_IV }, - { exp_key, iv1, iv2, NULL, iv4, iv5, - iv6, iv7, iv8, src1, dst1, len1, - src2, dst2, len2, src3, dst3, len3, - src4, dst4, len4, src5, dst5, len5, - src6, dst6, len6, src7, dst7, len7, + { exp_key, NULL, iv2, iv3, iv4, iv5, iv6, iv7, iv8, src1, dst1, + len1, src2, dst2, len2, src3, dst3, len3, src4, dst4, len4, src5, + dst5, len5, src6, dst6, len6, src7, dst7, len7, src8, dst8, len8, + IMB_ERR_NULL_IV }, + { exp_key, iv1, NULL, iv3, iv4, iv5, iv6, iv7, iv8, src1, dst1, + len1, src2, dst2, len2, src3, dst3, len3, src4, dst4, len4, src5, + dst5, len5, src6, dst6, len6, src7, dst7, len7, src8, dst8, len8, + IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, NULL, iv4, iv5, iv6, iv7, iv8, src1, + dst1, len1, src2, dst2, len2, src3, dst3, len3, src4, dst4, + len4, src5, dst5, len5, src6, dst6, len6, src7, dst7, len7, src8, dst8, len8, IMB_ERR_NULL_IV }, - { exp_key, iv1, - iv2, iv3, - NULL, iv5, - iv6, iv7, - iv8, src1, - dst1, len1, - src2, dst2, - len2, src3, - dst3, len3, - src4, dst4, - len4, src5, - dst5, len5, - src6, dst6, - len6, src7, - dst7, len7, - src8, dst8, - len8, IMB_ERR_NULL_IV }, - { exp_key, iv1, iv2, iv3, iv4, NULL, iv6, - iv7, iv8, src1, dst1, len1, src2, dst2, - len2, src3, dst3, len3, src4, dst4, len4, - src5, dst5, len5, src6, dst6, len6, src7, - dst7, len7, src8, dst8, len8, IMB_ERR_NULL_IV }, - { exp_key, iv1, - iv2, iv3, - iv4, iv5, - NULL, iv7, - iv8, src1, - dst1, len1, - src2, dst2, - len2, src3, - dst3, len3, - src4, dst4, - len4, src5, - dst5, len5, - src6, dst6, - len6, src7, - dst7, len7, - src8, dst8, - len8, IMB_ERR_NULL_IV }, - { exp_key, iv1, - iv2, iv3, - iv4, iv5, - iv6, NULL, - iv8, src1, - dst1, len1, - src2, dst2, - len2, src3, - dst3, len3, - src4, dst4, - len4, src5, - dst5, len5, - src6, dst6, - len6, src7, - dst7, len7, - src8, dst8, - len8, IMB_ERR_NULL_IV }, - { exp_key, iv1, - iv2, iv3, - iv4, iv5, - iv6, iv7, - NULL, src1, - dst1, len1, - src2, dst2, - len2, src3, - dst3, len3, - src4, dst4, - len4, src5, - dst5, len5, - src6, dst6, - len6, src7, - dst7, len7, - src8, dst8, - len8, IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, iv3, NULL, iv5, iv6, iv7, iv8, src1, dst1, + len1, src2, dst2, len2, src3, dst3, len3, src4, dst4, len4, src5, + dst5, len5, src6, dst6, len6, src7, dst7, len7, src8, dst8, len8, + IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, iv3, iv4, NULL, iv6, iv7, iv8, src1, dst1, + len1, src2, dst2, len2, src3, dst3, len3, src4, dst4, len4, src5, + dst5, len5, src6, dst6, len6, src7, dst7, len7, src8, dst8, len8, + IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, iv3, iv4, iv5, NULL, iv7, iv8, + src1, dst1, len1, src2, dst2, len2, src3, dst3, len3, + src4, dst4, len4, src5, dst5, len5, src6, dst6, len6, + src7, dst7, len7, src8, dst8, len8, IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, iv3, iv4, iv5, iv6, NULL, iv8, src1, dst1, + len1, src2, dst2, len2, src3, dst3, len3, src4, dst4, len4, src5, + dst5, len5, src6, dst6, len6, src7, dst7, len7, src8, dst8, len8, + IMB_ERR_NULL_IV }, + { exp_key, iv1, iv2, iv3, iv4, iv5, iv6, iv7, NULL, src1, dst1, + len1, src2, dst2, len2, src3, dst3, len3, src4, dst4, len4, src5, + dst5, len5, src6, dst6, len6, src7, dst7, len7, src8, dst8, len8, + IMB_ERR_NULL_IV }, { exp_key, iv1, iv2, iv3, iv4, iv5, @@ -3620,13 +3420,12 @@ test_IMB_SNOW3G_F8_8_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_8_BUFFER( - mgr, ap->exp_key, ap->iv1, ap->iv2, ap->iv3, ap->iv4, - ap->iv5, ap->iv6, ap->iv7, ap->iv8, ap->src1, ap->dst1, - ap->len1, ap->src2, ap->dst2, ap->len2, ap->src3, ap->dst3, - ap->len3, ap->src4, ap->dst4, ap->len4, ap->src5, ap->dst5, - ap->len5, ap->src6, ap->dst6, ap->len6, ap->src7, ap->dst7, - ap->len7, ap->src8, ap->dst8, ap->len8); + IMB_SNOW3G_F8_8_BUFFER(mgr, ap->exp_key, ap->iv1, ap->iv2, ap->iv3, ap->iv4, + ap->iv5, ap->iv6, ap->iv7, ap->iv8, ap->src1, ap->dst1, + ap->len1, ap->src2, ap->dst2, ap->len2, ap->src3, ap->dst3, + ap->len3, ap->src4, ap->dst4, ap->len4, ap->src5, ap->dst5, + ap->len5, ap->src6, ap->dst6, ap->len6, ap->src7, ap->dst7, + ap->len7, ap->src8, ap->dst8, ap->len8); if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_8_BUFFER")) return 1; } @@ -3650,8 +3449,7 @@ test_IMB_SNOW3G_F8_N_BUFFER(struct IMB_MGR *mgr) void *dst[MAX_BUFFS]; void *dst_NULL_pts[MAX_BUFFS]; uint8_t dst_s[MAX_BUFFS][BUFF_SIZE]; - const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 }; + const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; const uint32_t count = MAX_BUFFS; int seg_err; /* segfault flag */ @@ -3678,25 +3476,21 @@ test_IMB_SNOW3G_F8_N_BUFFER(struct IMB_MGR *mgr) const uint32_t *len; const uint32_t count; const IMB_ERR exp_err; - } fn_args[] = { - { NULL, iv, src, dst, len, count, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv_NULL_pts, src, dst, len, count, IMB_ERR_NULL_IV }, - { exp_key, NULL, src, dst, len, count, IMB_ERR_NULL_IV }, - { exp_key, iv, src_NULL_pts, dst, len, count, - IMB_ERR_NULL_SRC }, - { exp_key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, - { exp_key, iv, src, dst_NULL_pts, len, count, - IMB_ERR_NULL_DST }, - { exp_key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, - { exp_key, iv, src, dst, 0, count, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { NULL, iv, src, dst, len, count, IMB_ERR_NULL_EXP_KEY }, + { exp_key, iv_NULL_pts, src, dst, len, count, IMB_ERR_NULL_IV }, + { exp_key, NULL, src, dst, len, count, IMB_ERR_NULL_IV }, + { exp_key, iv, src_NULL_pts, dst, len, count, IMB_ERR_NULL_SRC }, + { exp_key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, + { exp_key, iv, src, dst_NULL_pts, len, count, IMB_ERR_NULL_DST }, + { exp_key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, + { exp_key, iv, src, dst, 0, count, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_N_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, - ap->dst, ap->len, ap->count); + IMB_SNOW3G_F8_N_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, ap->len, + ap->count); if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_N_BUFFER")) return 1; } @@ -3722,8 +3516,7 @@ test_IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(struct IMB_MGR *mgr) void *dst[MAX_BUFFS]; void *dst_NULL_pts[MAX_BUFFS]; uint8_t dst_s[MAX_BUFFS][BUFF_SIZE]; - const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 }; + const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; int seg_err; /* segfault flag */ seg_err = setjmp(dir_api_param_env); @@ -3750,26 +3543,23 @@ test_IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(struct IMB_MGR *mgr) void **dst; const uint32_t *len; const IMB_ERR exp_err; - } fn_args[] = { - { exp_key_NULL_pts, iv, src, dst, len, IMB_ERR_NULL_EXP_KEY }, - { NULL, iv, src, dst, len, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv_NULL_pts, src, dst, len, IMB_ERR_NULL_IV }, - { exp_key, NULL, src, dst, len, IMB_ERR_NULL_IV }, - { exp_key, iv, src_NULL_pts, dst, len, IMB_ERR_NULL_SRC }, - { exp_key, iv, NULL, dst, len, IMB_ERR_NULL_SRC }, - { exp_key, iv, src, dst_NULL_pts, len, IMB_ERR_NULL_DST }, - { exp_key, iv, src, NULL, len, IMB_ERR_NULL_DST }, - { exp_key, iv, src, dst, 0, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { exp_key_NULL_pts, iv, src, dst, len, IMB_ERR_NULL_EXP_KEY }, + { NULL, iv, src, dst, len, IMB_ERR_NULL_EXP_KEY }, + { exp_key, iv_NULL_pts, src, dst, len, IMB_ERR_NULL_IV }, + { exp_key, NULL, src, dst, len, IMB_ERR_NULL_IV }, + { exp_key, iv, src_NULL_pts, dst, len, IMB_ERR_NULL_SRC }, + { exp_key, iv, NULL, dst, len, IMB_ERR_NULL_SRC }, + { exp_key, iv, src, dst_NULL_pts, len, IMB_ERR_NULL_DST }, + { exp_key, iv, src, NULL, len, IMB_ERR_NULL_DST }, + { exp_key, iv, src, dst, 0, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(mgr, ap->exp_key, ap->iv, - ap->src, ap->dst, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_SNOW3G_F8_8_BUFFER_MULTIKEY")) + IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, + ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_8_BUFFER_MULTIKEY")) return 1; } return 0; @@ -3794,8 +3584,7 @@ test_IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(struct IMB_MGR *mgr) void *dst[MAX_BUFFS]; void *dst_NULL_pts[MAX_BUFFS]; uint8_t dst_s[MAX_BUFFS][BUFF_SIZE]; - const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 }; + const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; const uint32_t count = MAX_BUFFS; int seg_err; /* segfault flag */ @@ -3824,30 +3613,23 @@ test_IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(struct IMB_MGR *mgr) const uint32_t *len; const uint32_t count; const IMB_ERR exp_err; - } fn_args[] = { - { exp_key_NULL_pts, iv, src, dst, len, count, - IMB_ERR_NULL_EXP_KEY }, - { NULL, iv, src, dst, len, count, IMB_ERR_NULL_EXP_KEY }, - { exp_key, iv_NULL_pts, src, dst, len, count, IMB_ERR_NULL_IV }, - { exp_key, NULL, src, dst, len, count, IMB_ERR_NULL_IV }, - { exp_key, iv, src_NULL_pts, dst, len, count, - IMB_ERR_NULL_SRC }, - { exp_key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, - { exp_key, iv, src, dst_NULL_pts, len, count, - IMB_ERR_NULL_DST }, - { exp_key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, - { exp_key, iv, src, dst, 0, count, IMB_ERR_CIPH_LEN } - }; + } fn_args[] = { { exp_key_NULL_pts, iv, src, dst, len, count, IMB_ERR_NULL_EXP_KEY }, + { NULL, iv, src, dst, len, count, IMB_ERR_NULL_EXP_KEY }, + { exp_key, iv_NULL_pts, src, dst, len, count, IMB_ERR_NULL_IV }, + { exp_key, NULL, src, dst, len, count, IMB_ERR_NULL_IV }, + { exp_key, iv, src_NULL_pts, dst, len, count, IMB_ERR_NULL_SRC }, + { exp_key, iv, NULL, dst, len, count, IMB_ERR_NULL_SRC }, + { exp_key, iv, src, dst_NULL_pts, len, count, IMB_ERR_NULL_DST }, + { exp_key, iv, src, NULL, len, count, IMB_ERR_NULL_DST }, + { exp_key, iv, src, dst, 0, count, IMB_ERR_CIPH_LEN } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mgr, ap->exp_key, ap->iv, - ap->src, ap->dst, ap->len, + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mgr, ap->exp_key, ap->iv, ap->src, ap->dst, ap->len, ap->count); - if (unexpected_err(mgr, ap->exp_err, - "IMB_SNOW3G_F8_N_BUFFER_MULTIKEY")) + if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F8_N_BUFFER_MULTIKEY")) return 1; } return 0; @@ -3890,8 +3672,7 @@ test_IMB_SNOW3G_F9_1_BUFFER(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_SNOW3G_F9_1_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, - ap->len, ap->tag); + IMB_SNOW3G_F9_1_BUFFER(mgr, ap->exp_key, ap->iv, ap->src, ap->len, ap->tag); if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_F9_1_BUFFER")) return 1; } @@ -3920,16 +3701,14 @@ test_IMB_SNOW3G_INIT_KEY_SCHED(struct IMB_MGR *mgr) const void *key; snow3g_key_schedule_t *exp_key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, - { key, NULL, IMB_ERR_NULL_EXP_KEY } }; + } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, { key, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; IMB_SNOW3G_INIT_KEY_SCHED(mgr, ap->key, ap->exp_key); - if (unexpected_err(mgr, ap->exp_err, - "IMB_SNOW3G_INIT_KEY_SCHED")) + if (unexpected_err(mgr, ap->exp_err, "IMB_SNOW3G_INIT_KEY_SCHED")) return 1; } return 0; @@ -3973,8 +3752,7 @@ test_IMB_GHASH(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_GHASH(mgr, ap->exp_key, ap->src, ap->len, ap->tag, - ap->tagl); + IMB_GHASH(mgr, ap->exp_key, ap->src, ap->len, ap->tag, ap->tagl); if (unexpected_err(mgr, ap->exp_err, "IMB_GHASH")) return 1; } @@ -3997,10 +3775,10 @@ test_IMB_ZUC_EIA3_N_BUFFER(struct IMB_MGR *mgr) const void *src[MAX_BUFFS]; const void *src_NULL_pts[MAX_BUFFS]; const uint8_t src_s[MAX_BUFFS][BUFF_SIZE]; - const uint32_t len_all_zero[MAX_BUFFS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 }; - const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 }; + const uint32_t len_all_zero[MAX_BUFFS] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + const uint32_t len[MAX_BUFFS] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; uint32_t *tag[MAX_BUFFS]; uint32_t *tag_NULL_pts[MAX_BUFFS]; uint32_t tag_s[MAX_BUFFS][BUFF_SIZE]; @@ -4032,24 +3810,21 @@ test_IMB_ZUC_EIA3_N_BUFFER(struct IMB_MGR *mgr) uint32_t **tag; const uint32_t count; const IMB_ERR exp_err; - } fn_args[] = { - { key_NULL_pts, iv, src, len, tag, count, IMB_ERR_NULL_KEY }, - { NULL, iv, src, len, tag, count, IMB_ERR_NULL_KEY }, - { key, iv_NULL_pts, src, len, tag, count, IMB_ERR_NULL_IV }, - { key, NULL, src, len, tag, count, IMB_ERR_NULL_IV }, - { key, iv, src_NULL_pts, len, tag, count, IMB_ERR_NULL_SRC }, - { key, iv, NULL, len, tag, count, IMB_ERR_NULL_SRC }, - { key, iv, src, len_all_zero, tag, count, IMB_ERR_AUTH_LEN }, - { key, iv, src, len, tag_NULL_pts, count, IMB_ERR_NULL_AUTH }, - { key, iv, src, len, NULL, count, IMB_ERR_NULL_AUTH } - }; + } fn_args[] = { { key_NULL_pts, iv, src, len, tag, count, IMB_ERR_NULL_KEY }, + { NULL, iv, src, len, tag, count, IMB_ERR_NULL_KEY }, + { key, iv_NULL_pts, src, len, tag, count, IMB_ERR_NULL_IV }, + { key, NULL, src, len, tag, count, IMB_ERR_NULL_IV }, + { key, iv, src_NULL_pts, len, tag, count, IMB_ERR_NULL_SRC }, + { key, iv, NULL, len, tag, count, IMB_ERR_NULL_SRC }, + { key, iv, src, len_all_zero, tag, count, IMB_ERR_AUTH_LEN }, + { key, iv, src, len, tag_NULL_pts, count, IMB_ERR_NULL_AUTH }, + { key, iv, src, len, NULL, count, IMB_ERR_NULL_AUTH } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_ZUC_EIA3_N_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->len, - ap->tag, ap->count); + IMB_ZUC_EIA3_N_BUFFER(mgr, ap->key, ap->iv, ap->src, ap->len, ap->tag, ap->count); if (unexpected_err(mgr, ap->exp_err, "IMB_ZUC_EIA3_N_BUFFER")) return 1; } @@ -4092,17 +3867,15 @@ test_IMB_AES128_GCM_INIT_VAR_IV(struct IMB_MGR *mgr) { exp_key, NULL, iv, ivl, aad, aadl, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, ivl, aad, aadl, IMB_ERR_NULL_IV }, { exp_key, ctx, iv, 0, aad, aadl, IMB_ERR_IV_LEN }, - { exp_key, ctx, iv, ivl, NULL, aadl, - IMB_ERR_NULL_AAD } }; + { exp_key, ctx, iv, ivl, NULL, aadl, IMB_ERR_NULL_AAD } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GCM_INIT_VAR_IV(mgr, ap->exp_key, ap->ctx, ap->iv, - ap->ivl, ap->aad, ap->aadl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES128_GCM_INIT_VAR_IV")) + IMB_AES128_GCM_INIT_VAR_IV(mgr, ap->exp_key, ap->ctx, ap->iv, ap->ivl, ap->aad, + ap->aadl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GCM_INIT_VAR_IV")) return 1; } return 0; @@ -4143,17 +3916,15 @@ test_IMB_AES192_GCM_INIT_VAR_IV(struct IMB_MGR *mgr) { exp_key, NULL, iv, ivl, aad, aadl, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, ivl, aad, aadl, IMB_ERR_NULL_IV }, { exp_key, ctx, iv, 0, aad, aadl, IMB_ERR_IV_LEN }, - { exp_key, ctx, iv, ivl, NULL, aadl, - IMB_ERR_NULL_AAD } }; + { exp_key, ctx, iv, ivl, NULL, aadl, IMB_ERR_NULL_AAD } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GCM_INIT_VAR_IV(mgr, ap->exp_key, ap->ctx, ap->iv, - ap->ivl, ap->aad, ap->aadl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES192_GCM_INIT_VAR_IV")) + IMB_AES192_GCM_INIT_VAR_IV(mgr, ap->exp_key, ap->ctx, ap->iv, ap->ivl, ap->aad, + ap->aadl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GCM_INIT_VAR_IV")) return 1; } return 0; @@ -4194,17 +3965,15 @@ test_IMB_AES256_GCM_INIT_VAR_IV(struct IMB_MGR *mgr) { exp_key, NULL, iv, ivl, aad, aadl, IMB_ERR_NULL_CTX }, { exp_key, ctx, NULL, ivl, aad, aadl, IMB_ERR_NULL_IV }, { exp_key, ctx, iv, 0, aad, aadl, IMB_ERR_IV_LEN }, - { exp_key, ctx, iv, ivl, NULL, aadl, - IMB_ERR_NULL_AAD } }; + { exp_key, ctx, iv, ivl, NULL, aadl, IMB_ERR_NULL_AAD } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GCM_INIT_VAR_IV(mgr, ap->exp_key, ap->ctx, ap->iv, - ap->ivl, ap->aad, ap->aadl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES256_GCM_INIT_VAR_IV")) + IMB_AES256_GCM_INIT_VAR_IV(mgr, ap->exp_key, ap->ctx, ap->iv, ap->ivl, ap->aad, + ap->aadl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GCM_INIT_VAR_IV")) return 1; } return 0; @@ -4245,8 +4014,7 @@ test_IMB_AES128_GMAC_INIT(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GMAC_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, - ap->ivl); + IMB_AES128_GMAC_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->ivl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GMAC_INIT")) return 1; } @@ -4288,8 +4056,7 @@ test_IMB_AES192_GMAC_INIT(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GMAC_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, - ap->ivl); + IMB_AES192_GMAC_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->ivl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GMAC_INIT")) return 1; } @@ -4331,8 +4098,7 @@ test_IMB_AES256_GMAC_INIT(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GMAC_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, - ap->ivl); + IMB_AES256_GMAC_INIT(mgr, ap->exp_key, ap->ctx, ap->iv, ap->ivl); if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GMAC_INIT")) return 1; } @@ -4373,8 +4139,7 @@ test_IMB_AES128_GMAC_UPDATE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GMAC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->src, - ap->len); + IMB_AES128_GMAC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->src, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GMAC_UPDATE")) return 1; } @@ -4415,8 +4180,7 @@ test_IMB_AES192_GMAC_UPDATE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GMAC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->src, - ap->len); + IMB_AES192_GMAC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->src, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GMAC_UPDATE")) return 1; } @@ -4457,8 +4221,7 @@ test_IMB_AES256_GMAC_UPDATE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GMAC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->src, - ap->len); + IMB_AES256_GMAC_UPDATE(mgr, ap->exp_key, ap->ctx, ap->src, ap->len); if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GMAC_UPDATE")) return 1; } @@ -4501,10 +4264,8 @@ test_IMB_AES128_GMAC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES128_GMAC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES128_GMAC_FINALIZE")) + IMB_AES128_GMAC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES128_GMAC_FINALIZE")) return 1; } return 0; @@ -4546,10 +4307,8 @@ test_IMB_AES192_GMAC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES192_GMAC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES192_GMAC_FINALIZE")) + IMB_AES192_GMAC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES192_GMAC_FINALIZE")) return 1; } return 0; @@ -4591,10 +4350,8 @@ test_IMB_AES256_GMAC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES256_GMAC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES256_GMAC_FINALIZE")) + IMB_AES256_GMAC_FINALIZE(mgr, ap->exp_key, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES256_GMAC_FINALIZE")) return 1; } return 0; @@ -4631,10 +4388,8 @@ test_IMB_AES_CMAC_SUBKEY_GEN_256(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_AES_CMAC_SUBKEY_GEN_256(mgr, ap->exp_key, ap->key1, - ap->key2); - if (unexpected_err(mgr, ap->exp_err, - "IMB_AES_CMAC_SUBKEY_GEN_256")) + IMB_AES_CMAC_SUBKEY_GEN_256(mgr, ap->exp_key, ap->key1, ap->key2); + if (unexpected_err(mgr, ap->exp_err, "IMB_AES_CMAC_SUBKEY_GEN_256")) return 1; } return 0; @@ -4661,8 +4416,7 @@ test_IMB_GHASH_PRE(struct IMB_MGR *mgr) const void *key; struct gcm_key_data *exp_key; const IMB_ERR exp_err; - } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, - { key, NULL, IMB_ERR_NULL_EXP_KEY } }; + } fn_args[] = { { NULL, exp_key, IMB_ERR_NULL_KEY }, { key, NULL, IMB_ERR_NULL_EXP_KEY } }; /* Iterate over args */ for (i = 0; i < DIM(fn_args); i++) { @@ -5022,8 +4776,7 @@ test_IMB_CRC32_WIMAX_OFDMA_DATA(struct IMB_MGR *mgr) const struct fn_args *ap = &fn_args[i]; IMB_CRC32_WIMAX_OFDMA_DATA(mgr, ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_CRC32_WIMAX_OFDMA_DATA")) + if (unexpected_err(mgr, ap->exp_err, "IMB_CRC32_WIMAX_OFDMA_DATA")) return 1; } return 0; @@ -5056,8 +4809,7 @@ test_IMB_CRC8_WIMAX_OFDMA_HCS(struct IMB_MGR *mgr) const struct fn_args *ap = &fn_args[i]; IMB_CRC8_WIMAX_OFDMA_HCS(mgr, ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_CRC8_WIMAX_OFDMA_HCS")) + if (unexpected_err(mgr, ap->exp_err, "IMB_CRC8_WIMAX_OFDMA_HCS")) return 1; } return 0; @@ -5100,10 +4852,8 @@ test_IMB_CHACHA20_POLY1305_INIT(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_CHACHA20_POLY1305_INIT(mgr, ap->key, ap->ctx, ap->iv, - ap->aad, ap->aadl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_CHACHA20_POLY1305_INIT")) + IMB_CHACHA20_POLY1305_INIT(mgr, ap->key, ap->ctx, ap->iv, ap->aad, ap->aadl); + if (unexpected_err(mgr, ap->exp_err, "IMB_CHACHA20_POLY1305_INIT")) return 1; } return 0; @@ -5146,10 +4896,8 @@ test_IMB_CHACHA20_POLY1305_ENC_UPDATE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_CHACHA20_POLY1305_ENC_UPDATE(mgr, ap->key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_CHACHA20_POLY1305_ENC_UPDATE")) + IMB_CHACHA20_POLY1305_ENC_UPDATE(mgr, ap->key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_CHACHA20_POLY1305_ENC_UPDATE")) return 1; } return 0; @@ -5192,10 +4940,8 @@ test_IMB_CHACHA20_POLY1305_DEC_UPDATE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_CHACHA20_POLY1305_DEC_UPDATE(mgr, ap->key, ap->ctx, ap->dst, - ap->src, ap->len); - if (unexpected_err(mgr, ap->exp_err, - "IMB_CHACHA20_POLY1305_DEC_UPDATE")) + IMB_CHACHA20_POLY1305_DEC_UPDATE(mgr, ap->key, ap->ctx, ap->dst, ap->src, ap->len); + if (unexpected_err(mgr, ap->exp_err, "IMB_CHACHA20_POLY1305_DEC_UPDATE")) return 1; } return 0; @@ -5233,10 +4979,8 @@ test_IMB_CHACHA20_POLY1305_DEC_FINALIZE(struct IMB_MGR *mgr) for (i = 0; i < DIM(fn_args); i++) { const struct fn_args *ap = &fn_args[i]; - IMB_CHACHA20_POLY1305_DEC_FINALIZE(mgr, ap->ctx, ap->tag, - ap->tagl); - if (unexpected_err(mgr, ap->exp_err, - "IMB_CHACHA20_POLY1305_DEC_FINALIZE")) + IMB_CHACHA20_POLY1305_DEC_FINALIZE(mgr, ap->ctx, ap->tag, ap->tagl); + if (unexpected_err(mgr, ap->exp_err, "IMB_CHACHA20_POLY1305_DEC_FINALIZE")) return 1; } return 0; diff --git a/test/kat-app/direct_api_test.c b/test/kat-app/direct_api_test.c index fa746183..702547e9 100644 --- a/test/kat-app/direct_api_test.c +++ b/test/kat-app/direct_api_test.c @@ -37,7 +37,7 @@ #include "utils.h" -#define BUF_SIZE ((uint32_t)sizeof(struct gcm_key_data)) +#define BUF_SIZE ((uint32_t) sizeof(struct gcm_key_data)) #define NUM_BUFS 8 #ifdef _WIN32 @@ -52,7 +52,8 @@ jmp_buf env; #ifndef DEBUG #ifndef _WIN32 -static void seg_handler(int signum) __attribute__((noreturn)); +static void +seg_handler(int signum) __attribute__((noreturn)); #endif /* Signal handler to handle segfaults */ static void @@ -61,11 +62,12 @@ seg_handler(int signum) (void) signum; /* unused */ signal(SIGSEGV, seg_handler); /* reset handler */ - longjmp(env, 1); /* reset env */ + longjmp(env, 1); /* reset env */ } #endif /* DEBUG */ -static void print_progress(void) +static void +print_progress(void) { if (!quiet_mode) printf("."); @@ -81,7 +83,7 @@ test_gcm_api(struct IMB_MGR *mgr) const uint32_t text_len = BUF_SIZE; uint8_t out_buf[BUF_SIZE]; uint8_t zero_buf[BUF_SIZE]; - struct gcm_key_data *key_data = (struct gcm_key_data *)out_buf; + struct gcm_key_data *key_data = (struct gcm_key_data *) out_buf; int seg_err; /* segfault flag */ seg_err = setjmp(env); @@ -101,100 +103,94 @@ test_gcm_api(struct IMB_MGR *mgr) */ /* GCM Encrypt API tests */ - IMB_AES128_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, - NULL, NULL, -1, NULL, -1); - IMB_AES128_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, - text_len, NULL, NULL, -1, NULL, -1); + IMB_AES128_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, NULL, NULL, -1, NULL, -1); + IMB_AES128_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, text_len, NULL, NULL, -1, NULL, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_ENC, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_AES192_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, - NULL, NULL, -1, NULL, -1); - IMB_AES192_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, - text_len, NULL, NULL, -1, NULL, -1); + IMB_AES192_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, NULL, NULL, -1, NULL, -1); + IMB_AES192_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, text_len, NULL, NULL, -1, NULL, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_ENC, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_AES256_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, - NULL, NULL, -1, NULL, -1); - IMB_AES256_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, - text_len, NULL, NULL, -1, NULL, -1); + IMB_AES256_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, NULL, NULL, -1, NULL, -1); + IMB_AES256_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, text_len, NULL, NULL, -1, NULL, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_ENC, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); /* GCM Decrypt API tests */ - IMB_AES128_GCM_DEC(mgr, NULL, NULL, NULL, NULL, -1, - NULL, NULL, -1, NULL, -1); - IMB_AES128_GCM_DEC(mgr, NULL, NULL, out_buf, zero_buf, - text_len, NULL, NULL, -1, NULL, -1); + IMB_AES128_GCM_DEC(mgr, NULL, NULL, NULL, NULL, -1, NULL, NULL, -1, NULL, -1); + IMB_AES128_GCM_DEC(mgr, NULL, NULL, out_buf, zero_buf, text_len, NULL, NULL, -1, NULL, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_DEC, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_AES192_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, - NULL, NULL, -1, NULL, -1); - IMB_AES192_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, - text_len, NULL, NULL, -1, NULL, -1); + IMB_AES192_GCM_ENC(mgr, NULL, NULL, NULL, NULL, -1, NULL, NULL, -1, NULL, -1); + IMB_AES192_GCM_ENC(mgr, NULL, NULL, out_buf, zero_buf, text_len, NULL, NULL, -1, NULL, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_DEC, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_AES256_GCM_DEC(mgr, NULL, NULL, NULL, NULL, -1, - NULL, NULL, -1, NULL, -1); - IMB_AES256_GCM_DEC(mgr, NULL, NULL, out_buf, zero_buf, - text_len, NULL, NULL, -1, NULL, -1); + IMB_AES256_GCM_DEC(mgr, NULL, NULL, NULL, NULL, -1, NULL, NULL, -1, NULL, -1); + IMB_AES256_GCM_DEC(mgr, NULL, NULL, out_buf, zero_buf, text_len, NULL, NULL, -1, NULL, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_DEC, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); /* GCM Init tests */ IMB_AES128_GCM_INIT(mgr, NULL, NULL, NULL, NULL, -1); - IMB_AES128_GCM_INIT(mgr, NULL, (struct gcm_context_data *)out_buf, - NULL, NULL, text_len); + IMB_AES128_GCM_INIT(mgr, NULL, (struct gcm_context_data *) out_buf, NULL, NULL, text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_INIT, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); IMB_AES192_GCM_INIT(mgr, NULL, NULL, NULL, NULL, -1); - IMB_AES192_GCM_INIT(mgr, NULL, (struct gcm_context_data *)out_buf, - NULL, NULL, text_len); + IMB_AES192_GCM_INIT(mgr, NULL, (struct gcm_context_data *) out_buf, NULL, NULL, text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_INIT, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); IMB_AES256_GCM_INIT(mgr, NULL, NULL, NULL, NULL, -1); - IMB_AES256_GCM_INIT(mgr, NULL, (struct gcm_context_data *)out_buf, - NULL, NULL, text_len); + IMB_AES256_GCM_INIT(mgr, NULL, (struct gcm_context_data *) out_buf, NULL, NULL, text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_INIT, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -204,7 +200,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES128_GCM_ENC_UPDATE(mgr, NULL, NULL, out_buf, zero_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_ENC_UPDATE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -213,7 +210,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES192_GCM_ENC_UPDATE(mgr, NULL, NULL, out_buf, zero_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_ENC_UPDATE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -222,7 +220,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES256_GCM_ENC_UPDATE(mgr, NULL, NULL, out_buf, zero_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_ENC_UPDATE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -232,7 +231,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES128_GCM_DEC_UPDATE(mgr, NULL, NULL, out_buf, zero_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_DEC_UPDATE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -241,7 +241,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES192_GCM_DEC_UPDATE(mgr, NULL, NULL, out_buf, zero_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_DEC_UPDATE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -250,7 +251,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES256_GCM_DEC_UPDATE(mgr, NULL, NULL, out_buf, zero_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_DEC_UPDATE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -260,7 +262,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES128_GCM_ENC_FINALIZE(mgr, NULL, NULL, out_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_ENC_FINALIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -269,7 +272,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES192_GCM_ENC_FINALIZE(mgr, NULL, NULL, out_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_ENC_FINALIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -278,7 +282,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES256_GCM_ENC_FINALIZE(mgr, NULL, NULL, out_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_ENC_FINALIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -288,7 +293,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES128_GCM_DEC_FINALIZE(mgr, NULL, NULL, out_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_DEC_FINALIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -297,7 +303,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES192_GCM_DEC_FINALIZE(mgr, NULL, NULL, out_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_DEC_FINALIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -306,7 +313,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES256_GCM_DEC_FINALIZE(mgr, NULL, NULL, out_buf, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_DEC_FINALIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -325,7 +333,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES128_GCM_PRE(mgr, NULL, key_data); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_GCM_PRE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -334,7 +343,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES192_GCM_PRE(mgr, NULL, key_data); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES192_GCM_PRE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -343,7 +353,8 @@ test_gcm_api(struct IMB_MGR *mgr) IMB_AES256_GCM_PRE(mgr, NULL, key_data); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES256_GCM_PRE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -385,7 +396,8 @@ test_key_exp_gen_api(struct IMB_MGR *mgr) IMB_AES_KEYEXP_128(mgr, NULL, out_buf, zero_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES_KEYEXP_128, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -394,7 +406,8 @@ test_key_exp_gen_api(struct IMB_MGR *mgr) IMB_AES_KEYEXP_192(mgr, NULL, out_buf, zero_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES_KEYEXP_192, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -403,7 +416,8 @@ test_key_exp_gen_api(struct IMB_MGR *mgr) IMB_AES_KEYEXP_256(mgr, NULL, out_buf, zero_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES_KEYEXP_256, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -412,7 +426,8 @@ test_key_exp_gen_api(struct IMB_MGR *mgr) IMB_AES_CMAC_SUBKEY_GEN_128(mgr, NULL, out_buf, zero_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES_CMAC_SUBKEY_GEN_128, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -421,16 +436,18 @@ test_key_exp_gen_api(struct IMB_MGR *mgr) IMB_AES_XCBC_KEYEXP(mgr, NULL, out_buf, out_buf, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES_XCBC_KEYEXP, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); IMB_DES_KEYSCHED(mgr, NULL, NULL); - IMB_DES_KEYSCHED(mgr, (uint64_t *)out_buf, NULL); + IMB_DES_KEYSCHED(mgr, (uint64_t *) out_buf, NULL); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_DES_KEYSCHED, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -471,7 +488,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA1_ONE_BLOCK(mgr, NULL, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA1_ONE_BLOCK, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -480,7 +498,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA1(mgr, NULL, BUF_SIZE, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA1, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -489,7 +508,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA224_ONE_BLOCK(mgr, NULL, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA224_ONE_BLOCK, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -498,7 +518,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA224(mgr, NULL, BUF_SIZE, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA224, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -507,7 +528,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA256_ONE_BLOCK(mgr, NULL, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA256_ONE_BLOCK, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -516,7 +538,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA256(mgr, NULL, BUF_SIZE, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA256, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -525,7 +548,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA384_ONE_BLOCK(mgr, NULL, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA384_ONE_BLOCK, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -534,7 +558,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA384(mgr, NULL, BUF_SIZE, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA384, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -543,7 +568,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA512_ONE_BLOCK(mgr, NULL, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA512_ONE_BLOCK, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -552,7 +578,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_SHA512(mgr, NULL, BUF_SIZE, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SHA512, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -561,7 +588,8 @@ test_hash_api(struct IMB_MGR *mgr) IMB_MD5_ONE_BLOCK(mgr, NULL, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_MD5_ONE_BLOCK, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -602,7 +630,8 @@ test_aes_api(struct IMB_MGR *mgr) IMB_AES128_CFB_ONE(mgr, out_buf, NULL, NULL, NULL, -1); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_AES128_CFB_ONE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -634,7 +663,7 @@ test_zuc_api(struct IMB_MGR *mgr) } for (i = 0; i < NUM_BUFS; i++) { - out_bufs[i] = (void *)&out_buf; + out_bufs[i] = (void *) &out_buf; lens[i] = text_len; } @@ -648,26 +677,22 @@ test_zuc_api(struct IMB_MGR *mgr) * and verify output buffer is not modified */ - ret1 = zuc_eea3_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, NULL); - ret2 = zuc_eea3_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret1 = zuc_eea3_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, NULL); + ret2 = zuc_eea3_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: zuc_eea3_iv_gen, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - ret1 = zuc_eia3_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, NULL); - ret2 = zuc_eia3_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret1 = zuc_eia3_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, NULL); + ret2 = zuc_eia3_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: zuc_eia3_iv_gen, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -676,7 +701,8 @@ test_zuc_api(struct IMB_MGR *mgr) IMB_ZUC_EEA3_1_BUFFER(mgr, NULL, NULL, NULL, out_buf, text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_ZUC_EEA3_1_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -685,18 +711,18 @@ test_zuc_api(struct IMB_MGR *mgr) IMB_ZUC_EEA3_4_BUFFER(mgr, NULL, NULL, NULL, out_bufs, lens); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_ZUC_EEA3_4_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_ZUC_EEA3_N_BUFFER(mgr, NULL, NULL, NULL, - NULL, NULL, inv_len); - IMB_ZUC_EEA3_N_BUFFER(mgr, NULL, NULL, NULL, - out_bufs, lens, NUM_BUFS); + IMB_ZUC_EEA3_N_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, inv_len); + IMB_ZUC_EEA3_N_BUFFER(mgr, NULL, NULL, NULL, out_bufs, lens, NUM_BUFS); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_ZUC_EEA3_N_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -705,7 +731,8 @@ test_zuc_api(struct IMB_MGR *mgr) IMB_ZUC_EIA3_1_BUFFER(mgr, NULL, NULL, NULL, text_len, out_bufs[0]); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_ZUC_EIA3_1_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -738,7 +765,7 @@ test_kasumi_api(struct IMB_MGR *mgr) } for (i = 0; i < NUM_BUFS; i++) { - out_bufs[i] = (void *)&out_buf; + out_bufs[i] = (void *) &out_buf; lens[i] = text_len; } @@ -752,14 +779,12 @@ test_kasumi_api(struct IMB_MGR *mgr) * and verify output buffer is not modified */ - ret1 = kasumi_f8_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, NULL); - ret2 = kasumi_f8_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret1 = kasumi_f8_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, NULL); + ret2 = kasumi_f8_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: kasumi_f8_iv_gen, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -767,7 +792,8 @@ test_kasumi_api(struct IMB_MGR *mgr) ret1 = kasumi_f9_iv_gen(inv_len, inv_len, NULL); if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0) { printf("%s: kasumi_f9_iv_gen, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -776,64 +802,63 @@ test_kasumi_api(struct IMB_MGR *mgr) IMB_KASUMI_F8_1_BUFFER(mgr, NULL, inv_iv, NULL, out_buf, text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F8_1_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, NULL, inv_iv, NULL, - NULL, inv_len, inv_len); - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, NULL, inv_iv, NULL, - out_buf, text_len, 0); + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, NULL, inv_iv, NULL, NULL, inv_len, inv_len); + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, NULL, inv_iv, NULL, out_buf, text_len, 0); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F8_1_BUFFER_BIT, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_KASUMI_F8_2_BUFFER(mgr, NULL, inv_iv, inv_iv, NULL, - NULL, inv_len, NULL, NULL, inv_len); - IMB_KASUMI_F8_2_BUFFER(mgr, NULL, inv_iv, inv_iv, NULL, - out_buf, text_len, NULL, out_buf, text_len); + IMB_KASUMI_F8_2_BUFFER(mgr, NULL, inv_iv, inv_iv, NULL, NULL, inv_len, NULL, NULL, inv_len); + IMB_KASUMI_F8_2_BUFFER(mgr, NULL, inv_iv, inv_iv, NULL, out_buf, text_len, NULL, out_buf, + text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F8_2_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_KASUMI_F8_3_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, NULL, - NULL, NULL, NULL, NULL, NULL, inv_len); - IMB_KASUMI_F8_3_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, NULL, - out_buf, NULL, out_buf, NULL, out_buf, text_len); + IMB_KASUMI_F8_3_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, NULL, NULL, NULL, NULL, NULL, + NULL, inv_len); + IMB_KASUMI_F8_3_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, NULL, out_buf, NULL, out_buf, + NULL, out_buf, text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F8_3_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_KASUMI_F8_4_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, inv_iv, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - inv_len); - IMB_KASUMI_F8_4_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, inv_iv, - NULL, out_buf, NULL, out_buf, NULL, out_buf, - NULL, out_buf, inv_len); + IMB_KASUMI_F8_4_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, inv_iv, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, inv_len); + IMB_KASUMI_F8_4_BUFFER(mgr, NULL, inv_iv, inv_iv, inv_iv, inv_iv, NULL, out_buf, NULL, + out_buf, NULL, out_buf, NULL, out_buf, inv_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F8_4_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_KASUMI_F8_N_BUFFER(mgr, NULL, NULL, NULL, - NULL, NULL, inv_len); - IMB_KASUMI_F8_N_BUFFER(mgr, NULL, NULL, NULL, - out_bufs, lens, NUM_BUFS); + IMB_KASUMI_F8_N_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, inv_len); + IMB_KASUMI_F8_N_BUFFER(mgr, NULL, NULL, NULL, out_bufs, lens, NUM_BUFS); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F8_N_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -842,47 +867,46 @@ test_kasumi_api(struct IMB_MGR *mgr) IMB_KASUMI_F9_1_BUFFER(mgr, NULL, NULL, text_len, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F9_1_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_KASUMI_F9_1_BUFFER_USER(mgr, NULL, inv_iv, NULL, - inv_len, NULL, inv_len); - IMB_KASUMI_F9_1_BUFFER_USER(mgr, NULL, inv_iv, NULL, - text_len, out_buf, 0); + IMB_KASUMI_F9_1_BUFFER_USER(mgr, NULL, inv_iv, NULL, inv_len, NULL, inv_len); + IMB_KASUMI_F9_1_BUFFER_USER(mgr, NULL, inv_iv, NULL, text_len, out_buf, 0); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_KASUMI_F9_1_BUFFER_USER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); ret1 = IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, NULL, NULL); - ret2 = IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, NULL, - (kasumi_key_sched_t *)out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret2 = IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, NULL, (kasumi_key_sched_t *) out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: IMB_KASUMI_INIT_F8_KEY_SCHED, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); ret1 = IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, NULL, NULL); - ret2 = IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, NULL, - (kasumi_key_sched_t *)out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret2 = IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, NULL, (kasumi_key_sched_t *) out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: IMB_KASUMI_INIT_F9_KEY_SCHED, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); if (IMB_KASUMI_KEY_SCHED_SIZE(mgr) == 0) { printf("%s: IMB_KASUMI_KEY_SCHED_SIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -914,7 +938,7 @@ test_snow3g_api(struct IMB_MGR *mgr) } for (i = 0; i < NUM_BUFS; i++) { - out_bufs[i] = (void *)&out_buf; + out_bufs[i] = (void *) &out_buf; lens[i] = text_len; } @@ -928,26 +952,22 @@ test_snow3g_api(struct IMB_MGR *mgr) * and verify output buffer is not modified */ - ret1 = snow3g_f8_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, NULL); - ret2 = snow3g_f8_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret1 = snow3g_f8_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, NULL); + ret2 = snow3g_f8_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: snow3g_f8_iv_gen, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - ret1 = snow3g_f9_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, NULL); - ret2 = snow3g_f9_iv_gen(inv_len, (const uint8_t)inv_len, - (const uint8_t)inv_len, out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret1 = snow3g_f9_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, NULL); + ret2 = snow3g_f9_iv_gen(inv_len, (const uint8_t) inv_len, (const uint8_t) inv_len, out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: snow3g_f9_iv_gen, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -956,61 +976,57 @@ test_snow3g_api(struct IMB_MGR *mgr) IMB_SNOW3G_F8_1_BUFFER(mgr, NULL, NULL, NULL, out_buf, text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_1_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_SNOW3G_F8_1_BUFFER_BIT(mgr, NULL, NULL, NULL, NULL, - inv_len, inv_len); - IMB_SNOW3G_F8_1_BUFFER_BIT(mgr, NULL, NULL, NULL, out_buf, - text_len, 0); + IMB_SNOW3G_F8_1_BUFFER_BIT(mgr, NULL, NULL, NULL, NULL, inv_len, inv_len); + IMB_SNOW3G_F8_1_BUFFER_BIT(mgr, NULL, NULL, NULL, out_buf, text_len, 0); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_1_BUFFER_BIT, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_SNOW3G_F8_2_BUFFER(mgr, NULL, NULL, NULL, NULL, - NULL, inv_len, NULL, NULL, inv_len); - IMB_SNOW3G_F8_2_BUFFER(mgr, NULL, NULL, NULL, NULL, - out_buf, text_len, NULL, out_buf, text_len); + IMB_SNOW3G_F8_2_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, inv_len, NULL, NULL, inv_len); + IMB_SNOW3G_F8_2_BUFFER(mgr, NULL, NULL, NULL, NULL, out_buf, text_len, NULL, out_buf, + text_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_2_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_SNOW3G_F8_4_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, inv_len, NULL, NULL, inv_len, - NULL, NULL, inv_len, NULL, NULL, inv_len); - IMB_SNOW3G_F8_4_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, - NULL, out_buf, inv_len, NULL, out_buf, inv_len, - NULL, out_buf, inv_len, NULL, out_buf, inv_len); + IMB_SNOW3G_F8_4_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, inv_len, NULL, NULL, + inv_len, NULL, NULL, inv_len, NULL, NULL, inv_len); + IMB_SNOW3G_F8_4_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, NULL, out_buf, inv_len, NULL, + out_buf, inv_len, NULL, out_buf, inv_len, NULL, out_buf, inv_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_4_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_SNOW3G_F8_8_BUFFER(mgr, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, - NULL, NULL, inv_len, NULL, NULL, inv_len, - NULL, NULL, inv_len, NULL, NULL, inv_len, - NULL, NULL, inv_len, NULL, NULL, inv_len, - NULL, NULL, inv_len, NULL, NULL, inv_len); - IMB_SNOW3G_F8_8_BUFFER(mgr, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, - NULL, out_buf, inv_len, NULL, out_buf, inv_len, - NULL, out_buf, inv_len, NULL, out_buf, inv_len, - NULL, out_buf, inv_len, NULL, out_buf, inv_len, - NULL, out_buf, inv_len, NULL, out_buf, inv_len); + IMB_SNOW3G_F8_8_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, inv_len, NULL, NULL, inv_len, NULL, NULL, inv_len, NULL, NULL, + inv_len, NULL, NULL, inv_len, NULL, NULL, inv_len, NULL, NULL, + inv_len, NULL, NULL, inv_len); + IMB_SNOW3G_F8_8_BUFFER(mgr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + out_buf, inv_len, NULL, out_buf, inv_len, NULL, out_buf, inv_len, + NULL, out_buf, inv_len, NULL, out_buf, inv_len, NULL, out_buf, + inv_len, NULL, out_buf, inv_len, NULL, out_buf, inv_len); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_8_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -1019,7 +1035,8 @@ test_snow3g_api(struct IMB_MGR *mgr) IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(mgr, NULL, NULL, NULL, out_bufs, lens); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_8_BUFFER_MULTIKEY, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -1028,18 +1045,18 @@ test_snow3g_api(struct IMB_MGR *mgr) IMB_SNOW3G_F8_N_BUFFER(mgr, NULL, NULL, NULL, out_bufs, lens, NUM_BUFS); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_N_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mgr, NULL, NULL, NULL, NULL, - NULL, inv_len); - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mgr, NULL, NULL, NULL, out_bufs, - lens, NUM_BUFS); + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mgr, NULL, NULL, NULL, NULL, NULL, inv_len); + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mgr, NULL, NULL, NULL, out_bufs, lens, NUM_BUFS); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F8_N_BUFFER_MULTIKEY, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -1048,25 +1065,26 @@ test_snow3g_api(struct IMB_MGR *mgr) IMB_SNOW3G_F9_1_BUFFER(mgr, NULL, NULL, NULL, text_len, out_buf); if (memcmp(out_buf, zero_buf, text_len) != 0) { printf("%s: IMB_SNOW3G_F9_1_BUFFER, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); ret1 = IMB_SNOW3G_INIT_KEY_SCHED(mgr, NULL, NULL); - ret2 = IMB_SNOW3G_INIT_KEY_SCHED(mgr, NULL, - (snow3g_key_schedule_t *)out_buf); - if ((memcmp(out_buf, zero_buf, text_len) != 0) || - ret1 == 0 || ret2 == 0) { + ret2 = IMB_SNOW3G_INIT_KEY_SCHED(mgr, NULL, (snow3g_key_schedule_t *) out_buf); + if ((memcmp(out_buf, zero_buf, text_len) != 0) || ret1 == 0 || ret2 == 0) { printf("%s: IMB_SNOW3G_INIT_KEY_SCHED, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); if (IMB_SNOW3G_KEY_SCHED_SIZE(mgr) == 0) { printf("%s: IMB_SNOW3G_KEY_SCHED_SIZE, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -1106,7 +1124,8 @@ test_clear_mem_api(void) imb_clear_mem(NULL, text_len); if (memcmp(out_buf, cmp_buf, text_len) != 0) { printf("%s: imb_clear_mem, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -1114,7 +1133,8 @@ test_clear_mem_api(void) imb_clear_mem(out_buf, 0); if (memcmp(out_buf, cmp_buf, text_len) != 0) { printf("%s: imb_clear_mem, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -1122,7 +1142,8 @@ test_clear_mem_api(void) imb_clear_mem(out_buf, text_len); if (memcmp(out_buf, cmp_buf, text_len) == 0) { printf("%s: imb_clear_mem, invalid " - "param test failed!\n", __func__); + "param test failed!\n", + __func__); return 1; } print_progress(); @@ -1187,11 +1208,11 @@ direct_api_test(struct IMB_MGR *mb_mgr) test_suite_update(&ts, run - errors, errors); - dir_api_exit: +dir_api_exit: errors = test_suite_end(&ts); #ifndef DEBUG signal(SIGSEGV, handler); #endif - return errors; + return errors; } diff --git a/test/kat-app/do_test.h b/test/kat-app/do_test.h index 2790eb78..69b20e91 100644 --- a/test/kat-app/do_test.h +++ b/test/kat-app/do_test.h @@ -33,42 +33,29 @@ #ifndef DO_TEST_H #define DO_TEST_H -static unsigned char key[] = { - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0 -}; - -static unsigned char text[] = { - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x23, 0x34 -}; - -static unsigned char hmac12[] = { - 0x9e, 0xa8, 0x86, 0xef, 0xe2, 0x68, 0xdb, 0xec, 0xce, 0x42, 0x0c, 0x75 -}; +static unsigned char key[] = { 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, + 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0 }; + +static unsigned char text[] = { 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x23, 0x34 }; + +static unsigned char hmac12[] = { 0x9e, 0xa8, 0x86, 0xef, 0xe2, 0x68, + 0xdb, 0xec, 0xce, 0x42, 0x0c, 0x75 }; #define KEYSIZE sizeof(key) #define TEXTSIZE sizeof(text) -static unsigned char plain[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; - -static unsigned char key128[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; +static unsigned char plain[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, + 0x11, 0x73, 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, + 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, + 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, + 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, + 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; + +static unsigned char key128[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; /* static unsigned char key256[] = { */ /* 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, */ @@ -77,21 +64,16 @@ static unsigned char key128[] = { /* 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 */ /* }; */ -static unsigned char ic[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; - -static unsigned char cipherCBC128[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, - 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, - 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, - 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, - 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, - 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 -}; +static unsigned char ic[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; + +static unsigned char cipherCBC128[] = { 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, + 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, 0x50, 0x86, 0xcb, 0x9b, + 0x50, 0x72, 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, + 0x78, 0xb2, 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, + 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, 0x3f, 0xf1, + 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, 0x12, 0x0e, 0xca, 0x30, + 0x75, 0x86, 0xe1, 0xa7 }; /* static unsigned char cipherCBC256[] = { */ /* 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, */ @@ -105,18 +87,17 @@ static unsigned char cipherCBC128[] = { /* }; */ #define NUMBLOCKS 4 -#define NUMBYTES (NUMBLOCKS * 16) - +#define NUMBYTES (NUMBLOCKS * 16) static int known_answer_test(IMB_MGR *mb_mgr) { uint8_t test_buf[NUMBYTES]; uint8_t buf[64]; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); - DECLARE_ALIGNED(uint8_t ipad_hash[5*4], 16); - DECLARE_ALIGNED(uint8_t opad_hash[5*4], 16); + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); + DECLARE_ALIGNED(uint8_t ipad_hash[5 * 4], 16); + DECLARE_ALIGNED(uint8_t opad_hash[5 * 4], 16); IMB_JOB *job; uint8_t iv[16]; uint8_t digest[12]; @@ -136,11 +117,10 @@ known_answer_test(IMB_MGR *mb_mgr) buf[i] ^= key[i]; IMB_SHA1_ONE_BLOCK(mb_mgr, buf, opad_hash); - /* Expand key */ IMB_AES_KEYEXP_128(mb_mgr, key128, enc_keys, dec_keys); - /* flush the scheduler */ + /* flush the scheduler */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -161,8 +141,7 @@ known_answer_test(IMB_MGR *mb_mgr) job->src = cipherCBC128; job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = NUMBYTES; - job->hash_start_src_offset_in_bytes = - (uintptr_t) text - (uintptr_t) job->src; + job->hash_start_src_offset_in_bytes = (uintptr_t) text - (uintptr_t) job->src; job->msg_len_to_hash_in_bytes = TEXTSIZE; job->u.HMAC._hashed_auth_key_xor_ipad = ipad_hash; job->u.HMAC._hashed_auth_key_xor_opad = opad_hash; @@ -200,14 +179,14 @@ static void test_aux_func(IMB_MGR *mgr) { /* test aux functions */ - imb_uint128_t keys[15] = {{0, 0} }; - static uint8_t buf[4096+20]; + imb_uint128_t keys[15] = { { 0, 0 } }; + static uint8_t buf[4096 + 20]; uint32_t digest1[8]; uint64_t digest3[8]; - DECLARE_ALIGNED(uint32_t k1_exp[15*4], 16); - DECLARE_ALIGNED(uint32_t k2[4], 16); - DECLARE_ALIGNED(uint32_t k3[4], 16); + DECLARE_ALIGNED(uint32_t k1_exp[15 * 4], 16); + DECLARE_ALIGNED(uint32_t k2[4], 16); + DECLARE_ALIGNED(uint32_t k3[4], 16); printf("Testing aux funcs\n"); @@ -228,9 +207,9 @@ do_test(IMB_MGR *mb_mgr) { uint32_t size; IMB_JOB *job; - static imb_uint128_t IV = {0, 0}; + static imb_uint128_t IV = { 0, 0 }; static uint32_t ipad[5], opad[5], digest[3]; - imb_uint128_t keys[15] = {{0, 0} }; + imb_uint128_t keys[15] = { { 0, 0 } }; static uint8_t buf[4096 + 20]; for (size = 32; size < 4096; size += 16) { @@ -243,11 +222,10 @@ do_test(IMB_MGR *mb_mgr) job->auth_tag_output = (uint8_t *) digest; job->auth_tag_output_len_in_bytes = 12; - job->u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *)ipad; - job->u.HMAC._hashed_auth_key_xor_opad = (uint8_t *)opad; + job->u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) ipad; + job->u.HMAC._hashed_auth_key_xor_opad = (uint8_t *) opad; - job->enc_keys = - job->dec_keys = (uint32_t *) keys; + job->enc_keys = job->dec_keys = (uint32_t *) keys; job->src = buf; job->dst = buf + 20; job->iv = (uint8_t *) &IV; @@ -269,22 +247,22 @@ do_test(IMB_MGR *mb_mgr) } switch (rand() % 4) { - case 0: + case 0: job->cipher_direction = IMB_DIR_ENCRYPT; job->chain_order = IMB_ORDER_HASH_CIPHER; - break; - case 1: + break; + case 1: job->cipher_direction = IMB_DIR_ENCRYPT; job->chain_order = IMB_ORDER_CIPHER_HASH; - break; + break; case 2: - job->cipher_direction = IMB_DIR_DECRYPT; - job->chain_order = IMB_ORDER_CIPHER_HASH; - break; - case 3: - job->cipher_direction = IMB_DIR_DECRYPT; - job->chain_order = IMB_ORDER_HASH_CIPHER; - break; + job->cipher_direction = IMB_DIR_DECRYPT; + job->chain_order = IMB_ORDER_CIPHER_HASH; + break; + case 3: + job->cipher_direction = IMB_DIR_DECRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + break; } job = IMB_SUBMIT_JOB(mb_mgr); while (job) diff --git a/test/kat-app/ecb_test.c b/test/kat-app/ecb_test.c index 2c0a1d2d..59e9712c 100644 --- a/test/kat-app/ecb_test.c +++ b/test/kat-app/ecb_test.c @@ -36,27 +36,22 @@ #include "utils.h" #include "cipher_test.h" -int ecb_test(struct IMB_MGR *mb_mgr); +int +ecb_test(struct IMB_MGR *mb_mgr); extern const struct cipher_test ecb_test_json[]; static int -ecb_job_ok(const struct IMB_JOB *job, - const uint8_t *out_text, - const uint8_t *target, - const uint8_t *padding, - const size_t sizeof_padding, - const unsigned text_len) +ecb_job_ok(const struct IMB_JOB *job, const uint8_t *out_text, const uint8_t *target, + const uint8_t *padding, const size_t sizeof_padding, const unsigned text_len) { - const int num = (const int)((uint64_t)job->user_data2); + const int num = (const int) ((uint64_t) job->user_data2); if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %d", - __LINE__, job->status, num); + printf("%d error status:%d, job %d", __LINE__, job->status, num); return 0; } - if (memcmp(out_text, target + sizeof_padding, - text_len)) { + if (memcmp(out_text, target + sizeof_padding, text_len)) { printf("%d mismatched\n", num); return 0; } @@ -64,9 +59,7 @@ ecb_job_ok(const struct IMB_JOB *job, printf("%d overwrite head\n", num); return 0; } - if (memcmp(padding, - target + sizeof_padding + text_len, - sizeof_padding)) { + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { printf("%d overwrite tail\n", num); return 0; } @@ -74,18 +67,9 @@ ecb_job_ok(const struct IMB_JOB *job, } static int -test_ecb_many(struct IMB_MGR *mb_mgr, - void *enc_keys, - void *dec_keys, - const uint8_t *in_text, - const uint8_t *out_text, - unsigned text_len, - int dir, - int order, - IMB_CIPHER_MODE cipher, - const int in_place, - const int key_len, - const int num_jobs) +test_ecb_many(struct IMB_MGR *mb_mgr, void *enc_keys, void *dec_keys, const uint8_t *in_text, + const uint8_t *out_text, unsigned text_len, int dir, int order, + IMB_CIPHER_MODE cipher, const int in_place, const int key_len, const int num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -129,23 +113,22 @@ test_ecb_many(struct IMB_MGR *mb_mgr, job->cipher_start_src_offset_in_bytes = 0; job->msg_len_to_cipher_in_bytes = text_len; job->user_data = targets[i]; - job->user_data2 = (void *)((uint64_t)i); + job->user_data2 = (void *) ((uint64_t) i); job->hash_alg = IMB_AUTH_NULL; job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { jobs_rx++; - if (!ecb_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!ecb_job_ok(job, out_text, job->user_data, padding, sizeof(padding), + text_len)) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!ecb_job_ok(job, out_text, job->user_data, padding, - sizeof(padding), text_len)) + if (!ecb_job_ok(job, out_text, job->user_data, padding, sizeof(padding), text_len)) goto end; } @@ -155,7 +138,7 @@ test_ecb_many(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -166,26 +149,22 @@ test_ecb_many(struct IMB_MGR *mb_mgr, } static void -test_ecb_vectors(struct IMB_MGR *mb_mgr, - const IMB_CIPHER_MODE cipher, - const int num_jobs, - struct test_suite_context *ts128, - struct test_suite_context *ts192, +test_ecb_vectors(struct IMB_MGR *mb_mgr, const IMB_CIPHER_MODE cipher, const int num_jobs, + struct test_suite_context *ts128, struct test_suite_context *ts192, struct test_suite_context *ts256) { - const struct cipher_test *v = ecb_test_json; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + const struct cipher_test *v = ecb_test_json; + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (!quiet_mode) - printf("AES-ECB standard test vectors (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("AES-ECB standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { struct test_suite_context *ctx = NULL; if (!quiet_mode) { #ifdef DEBUG - printf("Standard vector %zu key_len:%zu\n", - v->tcId, v->keySize / 8); + printf("Standard vector %zu key_len:%zu\n", v->tcId, v->keySize / 8); #else printf("."); #endif @@ -208,9 +187,9 @@ test_ecb_vectors(struct IMB_MGR *mb_mgr, } if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 0, - (unsigned) v->keySize / 8, num_jobs)) { + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 0, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -218,9 +197,9 @@ test_ecb_vectors(struct IMB_MGR *mb_mgr, } if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 0, - (unsigned) v->keySize / 8, num_jobs)) { + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 0, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -228,9 +207,9 @@ test_ecb_vectors(struct IMB_MGR *mb_mgr, } if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->msg, - (const void *) v->ct, (unsigned) v->msgSize / 8, - IMB_DIR_ENCRYPT, IMB_ORDER_CIPHER_HASH, cipher, 1, - (unsigned) v->keySize / 8, num_jobs)) { + (const void *) v->ct, (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 1, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu encrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { @@ -238,15 +217,15 @@ test_ecb_vectors(struct IMB_MGR *mb_mgr, } if (test_ecb_many(mb_mgr, enc_keys, dec_keys, (const void *) v->ct, - (const void *) v->msg, (unsigned) v->msgSize / 8, - IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER, cipher, 1, - (unsigned) v->keySize / 8, num_jobs)) { + (const void *) v->msg, (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 1, (unsigned) v->keySize / 8, + num_jobs)) { printf("error #%zu decrypt in-place\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } @@ -255,9 +234,7 @@ int ecb_test(struct IMB_MGR *mb_mgr) { struct test_suite_context ts128, ts192, ts256; - const int num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 - }; + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 }; unsigned i; int errors = 0; @@ -266,12 +243,11 @@ ecb_test(struct IMB_MGR *mb_mgr) test_suite_start(&ts256, "AES-ECB-256"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_ecb_vectors(mb_mgr, IMB_CIPHER_ECB, num_jobs_tab[i], - &ts128, &ts192, &ts256); + test_ecb_vectors(mb_mgr, IMB_CIPHER_ECB, num_jobs_tab[i], &ts128, &ts192, &ts256); errors = test_suite_end(&ts128); errors += test_suite_end(&ts192); errors += test_suite_end(&ts256); - return errors; + return errors; } diff --git a/test/kat-app/ecb_test.json.c b/test/kat-app/ecb_test.json.c index 411d5be1..09d9faff 100644 --- a/test/kat-app/ecb_test.json.c +++ b/test/kat-app/ecb_test.json.c @@ -28,238 +28,235 @@ /* ECB */ #include "cipher_test.h" const struct cipher_test ecb_test_json[] = { - {0, 128, 1, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60\xa8\x9e\xca\xf3\x24\x66\xef\x97\xf5\xd3" - "\xd5\x85\x03\xb9\x69\x9d\xe7\x85\x89\x5a\x96\xfd\xba\xaf\x43\xb1\xcd\x7f" - "\x59\x8e\xce\x23\x88\x1b\x00\xe3\xed\x03\x06\x88\x7b\x0c\x78\x5e\x27\xe8" - "\xad\x3f\x82\x23\x20\x71\x04\x72\x5d\xd4", - 1, 512}, - {0, 192, 2, - "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" - "\xea\xd2\x52\x2c\x6b\x7b", - NULL, - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xbd\x33\x4f\x1d\x6e\x45\xf2\x5f\xf7\x12\xa2\x14\x57\x1f\xa5\xcc\x97\x41" - "\x04\x84\x6d\x0a\xd3\xad\x77\x34\xec\xb3\xec\xee\x4e\xef\xef\x7a\xfd\x22" - "\x70\xe2\xe6\x0a\xdc\xe0\xba\x2f\xac\xe6\x44\x4e\x9a\x4b\x41\xba\x73\x8d" - "\x6c\x72\xfb\x16\x69\x16\x03\xc1\x8e\x0e", - 1, 512}, - {0, 256, 3, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - NULL, - "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" - "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" - "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" - "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", - "\xf3\xee\xd1\xbd\xb5\xd2\xa0\x3c\x06\x4b\x5a\x7e\x3d\xb1\x81\xf8\x59\x1c" - "\xcb\x10\xd4\x10\xed\x26\xdc\x5b\xa7\x4a\x31\x36\x28\x70\xb6\xed\x21\xb9" - "\x9c\xa6\xf4\xf9\xf1\x53\xe7\xb1\xbe\xaf\xed\x1d\x23\x30\x4b\x7a\x39\xf9" - "\xf3\xff\x06\x7d\x8d\x8f\x9e\x24\xec\xc7", - 1, 512}, - {0, 128, 4, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, - "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\xfc\x47" - "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\xba\x91\x17\x8d" - "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x80\x40\xe9\x37\xb0\xd6" - "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" - "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" - "\x28\x1f\x3a\x9c\x18\x7d\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" - "\xcf\x21\xa0\x1e\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" - "\x33\x90", - "\x48\xa0\xe8\x0a\x89\x99\xab\xb5\x66\x6d\x68\x23\x43\x40\x1f\x26\xac\x52" - "\xc4\x7b\x09\x0a\x8f\xc0\x38\x00\xf5\x48\x3a\xfd\xcd\x7e\x21\xe7\xf8\xf6" - "\xc2\xa7\x4c\x1c\x6e\x83\x57\xf4\xa4\xb0\xc0\x5f\x36\x73\x22\xff\x33\x44" - "\xab\xeb\x96\xa8\xe0\x37\x65\x81\x6b\x82\x89\xcd\xcc\xac\x33\x18\x7d\x43" - "\x0e\x79\x53\x30\x21\x4c\x95\x18\xb6\xc9\xea\x5c\x6f\xa1\x10\xa3\x51\x0e" - "\x67\x8c\x1c\x9d\xf1\x57\xeb\xf6\xad\x4f\xf2\x55\xe8\x11\x6f\xaa\x4d\xe5" - "\x18\x3d\xc3\x14\xf9\x40\xfa\x86\x9d\xaf\xff\xfc\x78\xba\xbe\x61\xf8\xd1" - "\x00\x8d", - 1, 1024}, - {0, 192, 5, - "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" - "\xea\xd2\x52\x2c\x6b\x7b", - NULL, - "\x19\x08\xa3\x58\x17\x14\x70\x5a\xb8\xab\x4f\x5f\xa4\x25\x2b\xec\xb6\x74" - "\x0b\x9d\x56\x3b\xaf\xa3\xa4\x2d\x3e\x1f\x18\x84\x3b\x4f\x48\xd9\xa3\xfe" - "\x59\x1e\x80\x67\x44\x35\x26\x00\x78\xda\x68\xfa\x61\x9c\xd8\x8e\x5c\xc1" - "\xff\xeb\x9c\x7d\xe7\xa9\x38\xeb\x66\xf8\x6a\x46\x71\x51\x02\xba\x8d\x70" - "\x55\x5b\x60\xc6\x4c\xae\xda\x2e\x17\xbb\x65\xef\x60\x85\x9e\x77\xe5\x83" - "\xef\x30\x08\x3a\xba\x80\x28\xc0\xa1\x93\x4c\x2a\x0b\xe1\xcb\xd0\xac\x72" - "\x72\x1d\x96\x76\x0e\xc0\xec\x7d\x84\xfd\xee\x08\xa1\x11\x20\x0d\x59\x5c" - "\x06\x3f\xa3\xf1\xd7\xa3\x1d\x29\xc3\xaa\x05\x2b\x74\x8c\x73\x60\x65\x43" - "\x76\xd4\xd7\x7b\x5f\x40\xf4\x77\xe1\xcc\x85\x37\x1c\xd8\xda\x91\xf0\x40" - "\xb2\x43\x2d\x87\x51\xd0\xce\x27\xa6\x60\xac\x67\xea\x8b\xae\x46\x2e\x78" - "\x06\x09\x8a\x82\xb0\x0d\x57\x56\x82\xfe\x89\xd2", - "\xcc\xe2\x3f\xc3\x12\x41\x31\x63\x03\x3a\x3c\xfe\x76\x55\xd2\x26\xf0\xc9" - "\xb5\xc6\xf0\x1e\xc3\x72\xfb\x64\x94\x7d\xf1\x5e\x2a\x9e\x0d\x9a\x7a\xe0" - "\xbc\x7b\xa6\x65\x41\xc0\xa0\x9d\xb1\xb1\x09\x99\x6e\xe7\x25\x5e\x64\x2b" - "\x74\xfa\xa1\x9a\x03\x33\x88\x81\x27\x48\xdd\x53\x77\x0b\xef\xd9\x2f\xfa" - "\xc8\x50\x0e\x08\xa1\x45\x12\x82\x2b\xfb\x85\x5a\x39\x8c\x71\x32\x59\x27" - "\x37\x53\xce\x3e\xae\x00\x45\x53\xfd\xaf\xa5\xd1\x1a\xe9\xa4\x1b\xe3\x99" - "\xde\xcd\x03\x36\x6b\x72\x43\x76\x04\xa8\xf9\x83\xef\x9e\x57\x75\x36\x0e" - "\x99\xe1\x79\x2b\x2b\x96\x01\x10\xb8\xf6\x4a\xa6\x13\xab\x7f\x55\x60\xf0" - "\xc9\x5c\x81\xa7\x96\x99\xb4\x55\x41\x48\xf1\xd4\xa1\xb4\x76\xb5\x35\xe1" - "\x02\x8e\x09\xb2\x6c\x11\x3f\xfb\x04\x47\x98\xab\x9b\x55\xc3\xa9\x2a\x64" - "\x32\x5a\x69\x96\x28\x8c\x5b\xe3\xb2\x60\x82\xec", - 1, 1536}, - {0, 256, 6, - "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" - "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", - NULL, - "\x0b\xe5\x48\xa6\xa1\xbc\xac\x81\x80\x06\x5f\xae\x1e\x3f\x55\x73\x6d\x36" - "\x7f\x57\x3d\xa4\x4a\x6b\xb6\x65\x2f\xb7\xe8\x85\x47\xe2\x41\x42\xc2\x4e" - "\x58\xf1\xde\x42\x9f\x15\x4c\xaf\xea\x04\x20\xd0\x1a\x19\x36\x74\x71\x12" - "\x72\x1b\xdb\x18\xf9\x0b\xb3\xf3\x63\xd4\x62\x52\x8b\x63\x0f\x6b\x4d\xb9" - "\x70\xd6\x91\xa0\x43\x3f\x46\xfe\x43\xbb\xb8\xdc\x5e\xdb\xd4\x1f\xf0\x17" - "\x94\x25\xee\x55\x67\xbf\x4d\xda\x9d\xe7\x4b\xc6\x7a\xcf\x8f\xd7\xbb\x29" - "\x6e\x26\xd4\xc3\x08\x9b\x67\x15\xe9\x2d\x9f\x2d\x3c\x76\x26\xd3\xda\xfe" - "\x6e\x73\x9d\x09\x60\x4b\x35\x60\xdb\x77\xb6\xc0\x45\x91\xf9\x14\x8a\x7a" - "\xdd\xe2\xf1\xdf\x8f\x12\x4f\xd7\x75\xd6\x9a\x17\xda\x76\x88\xf0\xfa\x44" - "\x27\xbe\x61\xaf\x55\x9f\xc7\xf0\x76\x77\xde\xca\xd1\x47\x51\x55\xb1\xbf" - "\xfa\x1e\xca\x28\x17\x70\xf3\xb5\xd4\x32\x47\x04\xe0\x92\xd8\xa5\x03\x69" - "\x46\x99\x7f\x1e\x3f\xb2\x93\x36\xa3\x88\x75\x07\x68\xb8\x33\xce\x17\x3f" - "\x5c\xb7\x1e\x93\x38\xc5\x1d\x79\x86\x7c\x9d\x9e\x2f\x69\x38\x0f\x97\x5c" - "\x67\xbf\xa0\x8d\x37\x0b\xd3\xb1\x04\x87\x1d\x74\xfe\x30\xfb\xd0\x22\x92" - "\xf9\xf3\x23\xc9", - "\x4b\xc0\x1f\x80\xf5\xc7\xe8\xf5\xc9\xd0\x3c\x86\x50\x78\x21\xce\x01\xec" - "\x91\x00\xc9\xf8\x73\x43\x2f\x73\x8a\x6d\xee\xed\x2d\x40\x17\x16\x93\x15" - "\xac\xed\x28\x61\xb0\x0f\xa2\xe1\xd3\x80\x51\xdf\x73\xce\x48\x4c\x1c\xc1" - "\x8b\xc9\x9e\x5c\x48\x07\xa0\xf6\x29\xf8\x63\x87\xe4\xe7\x8b\xf8\xcf\x58" - "\xda\x57\x62\x11\x2e\x6e\x91\x7e\xc7\x73\xdb\x27\x3c\x64\x72\x52\xe3\x27" - "\x84\x1f\x73\x3f\xf4\x94\xd2\xdd\x93\x33\x65\x91\x98\x89\x13\xa9\x2b\x0d" - "\x6f\x56\x51\x15\x07\xc6\xa7\x36\x8f\x0c\xd6\xc2\x07\x06\x65\x7a\xf8\x94" - "\xa6\x75\x48\x4c\xcc\xa5\xa9\x91\x04\x2f\x7b\x89\x46\xd2\x87\xcb\xd6\x1b" - "\xf3\x1e\xa7\xe5\x09\xcf\x75\x05\x9f\xc9\xac\xcc\x61\x15\x2d\x2e\x2c\x0a" - "\x57\x4d\x33\x17\x6b\x22\x9e\x92\xc5\x81\xce\x9d\x52\x68\x7d\x98\xe1\x23" - "\x70\xc5\x19\x3e\x91\xfc\xc6\xd7\x67\x5f\xbb\x57\x20\x96\x3f\x1f\x9f\x64" - "\xe9\xb1\x51\xfd\x8c\xc1\x0f\x50\xbe\x43\x5f\x90\xb4\xd1\xb6\x41\x7c\x37" - "\x92\x71\xda\x9d\xfd\xee\x69\x8c\x24\x18\xe8\x81\x60\xe2\x89\x33\x42\xd4" - "\x1b\x6a\xcb\x4a\x5b\x00\x01\x4f\x11\x47\x0f\x57\xb0\x90\xf0\xed\xb0\x34" - "\x2e\x9f\x81\x6c", - 1, 2048}, - {0, 128, 7, - "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, - "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x92\x65" - "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\xdd\x4e\xe9\xeb" - "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\xfe\x2c\x73\x23\xea\x45" - "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x1d\x92\x82\xd8\x0f\xa9\x36\x23" - "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" - "\x86\x8c\xbd\xdc\x6b\x12\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" - "\x0a\x8d\x1e\xf1\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" - "\xb6\x35\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" - "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\xe4\x95" - "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x5a\x53\xc3\xdc" - "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\xac\x1f\xa7\x9c\x64\xfd" - "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\xba\x99\xa4\x12\x6e\x4e\xea\x0b" - "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" - "\x09\xff\xaa\x17\x5d\x82\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" - "\x33\x58\x7e\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" - "\x81\xd0\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" - "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x97\x9c" - "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x2f\xe7\xcd\x8a" - "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\xc9\x2c\xb7\x75\xa8\xf6" - "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x33\x73\xaf\xde\xcb\x37\x0a\x50" - "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" - "\xd8\xb0\x84\x26\x6b\xe8\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" - "\x1a\xd2\xd6\x3a\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" - "\x9f\xc7\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" - "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x1a\xb3" - "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\xb8\xa1\x62\x8c" - "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x8e\x46\xa0\xc5\x45\x5c" - "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\xe2\x04\x30\x63\x22\x87\xb6\xc7" - "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" - "\x35\xa1\x5d\x17\x48\x55\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" - "\xab\xde\xe1\x02\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" - "\x0e\x05\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" - "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x1b\xa2" - "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x46\xb9\xc9\xf6" - "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x7a\xce\xfd\x3c\x16\xff" - "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" - "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" - "\xb5\xed\xb7\xa2\x54\x84\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" - "\xbd\xbf\x3a\xb8\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" - "\x19\x33\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" - "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\xbe\x4a" - "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x2d\x06\x98\x32" - "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\xca\xf3\xc0\xc7\x64\xee" - "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" - "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" - "\x50\x5d\xc4\xb3\x3d\x09\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" - "\xc2\x8e\xea\xbe\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" - "\x04\x9d\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" - "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x6f\xe4" - "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\xd1\x28\x4d\x7c" - "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\xf2\xd5\x36\x4a\x54\xe8" - "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x17\xd1\x20\x93\x31\x89\xff\xed" - "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" - "\x42\xdd\x99\x15\x9a\xf4\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" - "\x97\xf7\xde\x31\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" - "\x86\x9a\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a", - "\x62\xa1\xcc\x1e\x1b\xc3\xb1\x11\xb5\x11\x4c\x37\xbf\xd0\x0c\xef\x36\x9f" - "\x99\x49\x38\xc2\x62\xbd\x3e\x03\xd1\x02\xa2\x18\xdc\x58\x9c\x01\x99\xd8" - "\x47\xeb\x27\xce\x76\x84\xa5\xab\xb7\x9b\xbb\x98\xc9\x84\x02\x6e\x32\x65" - "\xc9\xcb\xca\xc7\xa5\x95\x11\xcc\x0a\x9d\x5e\xea\xba\x59\xef\x25\xc0\x2d" - "\x8b\xa2\xec\x2f\x34\xea\x7c\xef\xee\x2a\x57\x80\xc4\xca\x5e\x08\x8c\x12" - "\x13\x39\xd1\xc7\x96\x93\x41\x22\x97\x1c\x7d\xe0\x47\xab\xfa\xd7\xc6\x38" - "\x5a\x39\xdb\x4c\xd4\x6d\x50\x2b\x8f\xb1\x92\x06\x01\xbf\xdc\x14\x5c\x32" - "\xee\xb0\x6a\x36\xe8\xe9\xf3\x12\x9f\x1f\x00\xe5\x25\x3b\x52\x74\xba\x50" - "\x17\x81\x60\x5c\x15\xec\x4d\xb0\x6a\xa1\xdd\xb4\xa2\x71\x01\xb8\x8b\x59" - "\x93\x58\x23\xd6\x38\xbf\x49\x94\xb7\x6e\x22\x75\x68\x1f\x15\x2c\xc4\x46" - "\x44\x35\xc8\x7a\x40\x2e\x55\x3f\x67\x4d\x12\x21\xf6\xb1\x20\x47\x4f\x35" - "\xe4\x96\xf9\xa2\xdc\x4c\xe3\xa2\x13\x41\xed\x6d\x86\x80\x23\xe5\x2a\xd1" - "\xa0\x69\x8f\x7e\x22\x3f\xf1\x65\x9f\xd7\x86\xa8\x78\x57\x49\x74\x91\x52" - "\x91\xe7\x1e\xe2\x14\xe9\x88\xe1\x67\x12\x3d\x0a\x22\x31\x56\x2e\x36\xd4" - "\x45\xc9\x9b\x7b\x09\x53\x55\x36\xed\xa3\xc2\x22\xac\x00\x5e\x57\xc8\x40" - "\x65\xd2\x62\x61\x35\xf2\xe8\x4f\xb3\x9d\x2c\xb2\x12\x5e\x15\x47\xd6\x1c" - "\x99\x80\xe0\x1c\x09\x28\xa0\x7e\x6c\x96\xc9\x62\x33\xd3\xbe\x53\x16\xa0" - "\xf2\xa9\x42\x1c\x81\xa3\x35\x9b\x93\x9e\xc6\xc0\x83\x03\xb7\x39\x66\xc9" - "\x86\xf8\x8d\xc0\xe2\x88\xb4\x1f\x5d\x15\x80\x60\x2d\x53\x1d\x60\x07\xbc" - "\x72\x11\xd0\x0e\xcb\x70\x9c\xa0\x48\x56\x21\x5f\x18\xdd\xa3\x1d\xdb\xe0" - "\x41\x0c\x9e\xb9\xa2\x7e\x32\xb3\x3e\x91\x9d\xf2\xa6\x0d\x8c\xea\xae\x44" - "\xb2\x0f\x11\x35\x27\x2e\xb6\x3d\xe9\x63\x86\x2e\x81\xdc\xfa\xb4\x52\x1d" - "\x9c\xd5\x44\x95\xc8\xd0\x66\x8a\xbd\xf6\xd1\xff\xeb\x82\x68\x58\x7b\xec" - "\x0e\x92\x0e\x48\xd6\xff\x8d\xac\xc1\x41\x84\x9e\x56\x54\xf9\xb5\x1c\xb0" - "\x9f\xde\xfe\x14\x42\x0d\x22\x12\xf2\x7d\x7b\xc3\x2e\x72\x27\x76\x12\xdf" - "\x57\x2f\x97\x82\x9b\xcf\x75\x1a\x4a\x0c\xad\x29\x56\x4c\x74\xaf\x95\x03" - "\xff\x9f\x9d\xc3\x2e\x9c\x1a\x42\x75\xe1\x59\xc9\x05\x12\x6c\xea\x2b\x2f" - "\x89\xfc\xa4\x73\xc8\xdc\xf6\xd5\x50\x19\x22\x80\xbc\x08\x48\xb4\x45\x47" - "\x25\x01\xa9\x55\x7b\x66\xbd\x84\x0f\x16\xfa\x44\x23\x51\x6f\xed\x35\x0e" - "\x88\x4d\xda\xe8\x27\x94\xbd\x68\x46\x28\x79\x8c\x03\x03\xf0\x81\xac\xbc" - "\xc2\xdd\xa8\x98\xdf\xe3\x1c\x1c\x4b\x43\x9e\x7b\x26\x3c\xe9\xff\x3b\xee" - "\x35\xe6\x2a\xcf\xdc\x17\x85\x99\x9e\x88\x5c\x38\x4c\x56\x4a\x06\xeb\x28" - "\xf7\xb5\x97\x04\xd4\x05\x85\xee\x90\xd7\xe2\x10\x8a\x86\xb2\x3f\xbf\x3f" - "\x6a\xe6\xeb\xc1\x42\x97\xcb\x30\x41\x44\x79\x44\x7e\x1e\x3e\x55\xe5\xc8" - "\xd5\xec\x64\x3d\x09\x69\xea\xdb\xe5\x08\x33\x00\x79\x1b\x31\xf2\x3d\xbd" - "\x73\xe6\x0e\xc1\xb9\x45\xbf\xa5\x52\x5a\xcd\x71\x7a\x2e\x20\x1e\xbf\xff" - "\x42\x0a\x6a\x1b\xa4\xad\x79\x3d\x34\x54\x73\xe2\xd6\x6f\xb0\xcc\xc0\x8a" - "\x56\x3d\x4d\x90\x35\xe3\x4b\xcc\x40\x40\xbc\xcf\x93\xa0\xbd\x5c\xed\x22" - "\x57\x92\x5c\x8d\xfb\x67\x9e\xab\x40\xc9\xed\x7c\xa1\xb6\x36\xb2\xcb\xbc" - "\xf2\x1a\x46\x6c\x1f\xb3\xe4\xf6\x4c\x7a\x10\x81\x16\x93\x77\xa3\xa1\x07" - "\xec\xc8\x01\x76\xf8\xe3\xe6\xae\xaf\x90\x98\x3a\xbd\x7d\x28\x57\xb4\xc5" - "\xfe\x13\xab\x6c\x77\xc1\xc3\x47\x1d\x34\x2f\xdd\xe1\x7b\x8b\x65\xc4\xe3" - "\x45\xda\x6e\xba\x37\xb1\x37\xbf\x63\x1d\x39\x77\xf0\xa8\xf8\xda\x91\xd3" - "\x27\xb9\x29\x70\xf7\xae\x11\x6d\x8a\x8f\x2f\x3a\xe1\xb8\x9b\xb5\x2a\xa8" - "\x7b\x86\x49\xca\x0c\x95\x17\x1e\xaf\x9c\x52\x6b\x68\xae\xe3\xc3\xc9\x8c" - "\x89\x4b\xf2\xfb\xb1\xae\x2f\x80\xf9\xa3\xf4\x10\x09\x36\x81\x27\x06\x6d" - "\xe9\x79\x8e\xa4\x8e\x12\xfa\x03\x8e\x69\x4c\x7e\xc5\x10\xd5\x00\x64\x87" - "\xf8\x10\x8a\x8e\x96\x9e\xc8\xac\x42\x75\x97\x6d\x62\x3f\xa3\x29\x11\xd2" - "\x73\xd3\x95\xef\xb4\x64\xa4\x37\x09\x15\x42\x7f\xc4\x46\x8b\x80\xa8\xd9" - "\x2a\xfc\x38\x8f\xf9\xc1\xc5\x95\xad\x62\xc9\x6c\x60\x0b\x30\x04\x8c\x88" - "\xb5\x0b\x73\x23\xa4\xe0\xb7\x6e\x4c\x78\xe5\x0a\xfb\xe1\xc4\xeb\x1a\xb4" - "\xd8\x3c\x06\xb0\x00\x23\x86\xb0\xb4\x9d\x33\xe4\x21\xca\xf2\xad\x14\x07" - "\x82\x25\xde\x85\xe4\x58\x56\x93\x09\x3a\xeb\xde\x46\x77\x76\xa2\x35\x39" - "\xd0\xf6\x10\x81\x73\x3f\x22\x3b\xeb\xca\x00\x19\x38\x89\x26\x29\x7d\x6f" - "\x70\xa6\xbb\x52\x58\xb1\x0a\x85\xe9\x0b\x74\x2f\x08\xe8\xa4\x4d\xa1\xcf" - "\xf2\x75\xed\x05\xae\x7f\x10\xb1\x71\x26\xc5\xc7\xdc\xb0\x2d\x26\xf1\xb4", - 1, 8064}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 0, 128, 1, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60\xa8\x9e\xca\xf3\x24\x66\xef\x97\xf5\xd3" + "\xd5\x85\x03\xb9\x69\x9d\xe7\x85\x89\x5a\x96\xfd\xba\xaf\x43\xb1\xcd\x7f" + "\x59\x8e\xce\x23\x88\x1b\x00\xe3\xed\x03\x06\x88\x7b\x0c\x78\x5e\x27\xe8" + "\xad\x3f\x82\x23\x20\x71\x04\x72\x5d\xd4", + 1, 512 }, + { 0, 192, 2, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + NULL, + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xbd\x33\x4f\x1d\x6e\x45\xf2\x5f\xf7\x12\xa2\x14\x57\x1f\xa5\xcc\x97\x41" + "\x04\x84\x6d\x0a\xd3\xad\x77\x34\xec\xb3\xec\xee\x4e\xef\xef\x7a\xfd\x22" + "\x70\xe2\xe6\x0a\xdc\xe0\xba\x2f\xac\xe6\x44\x4e\x9a\x4b\x41\xba\x73\x8d" + "\x6c\x72\xfb\x16\x69\x16\x03\xc1\x8e\x0e", + 1, 512 }, + { 0, 256, 3, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + NULL, + "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a\xae\x2d" + "\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51\x30\xc8\x1c\x46" + "\xa3\x5c\xe4\x11\xe5\xfb\xc1\x19\x1a\x0a\x52\xef\xf6\x9f\x24\x45\xdf\x4f" + "\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", + "\xf3\xee\xd1\xbd\xb5\xd2\xa0\x3c\x06\x4b\x5a\x7e\x3d\xb1\x81\xf8\x59\x1c" + "\xcb\x10\xd4\x10\xed\x26\xdc\x5b\xa7\x4a\x31\x36\x28\x70\xb6\xed\x21\xb9" + "\x9c\xa6\xf4\xf9\xf1\x53\xe7\xb1\xbe\xaf\xed\x1d\x23\x30\x4b\x7a\x39\xf9" + "\xf3\xff\x06\x7d\x8d\x8f\x9e\x24\xec\xc7", + 1, 512 }, + { 0, 128, 4, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, + "\xf7\xcd\x12\xfb\x4f\x8e\x50\xab\x35\x8e\x56\xf9\x83\x53\x9a\x1a\xfc\x47" + "\x3c\x96\x01\xfe\x01\x87\xd5\xde\x46\x24\x5c\x62\x8f\xba\xba\x91\x17\x8d" + "\xba\x5a\x79\xb1\x57\x05\x4d\x08\xba\x1f\x30\xd3\x80\x40\xe9\x37\xb0\xd6" + "\x34\x87\x33\xdd\xc0\x5b\x2d\x58\x1d\x2a\x7b\xb6\xe3\xd0\xc8\xa0\x7a\x69" + "\xc8\x5d\x10\xa2\xc3\x39\xca\xaf\x40\xdc\xc7\xcb\xff\x18\x7d\x51\x06\x28" + "\x28\x1f\x3a\x9c\x18\x7d\x5b\xb5\xe9\x20\xc2\xae\x17\x7f\xd1\x65\x7a\x75" + "\xcf\x21\xa0\x1e\x17\x1b\xf7\xe8\x62\x5f\xaf\x34\x7f\xd8\x18\x4a\x94\xf2" + "\x33\x90", + "\x48\xa0\xe8\x0a\x89\x99\xab\xb5\x66\x6d\x68\x23\x43\x40\x1f\x26\xac\x52" + "\xc4\x7b\x09\x0a\x8f\xc0\x38\x00\xf5\x48\x3a\xfd\xcd\x7e\x21\xe7\xf8\xf6" + "\xc2\xa7\x4c\x1c\x6e\x83\x57\xf4\xa4\xb0\xc0\x5f\x36\x73\x22\xff\x33\x44" + "\xab\xeb\x96\xa8\xe0\x37\x65\x81\x6b\x82\x89\xcd\xcc\xac\x33\x18\x7d\x43" + "\x0e\x79\x53\x30\x21\x4c\x95\x18\xb6\xc9\xea\x5c\x6f\xa1\x10\xa3\x51\x0e" + "\x67\x8c\x1c\x9d\xf1\x57\xeb\xf6\xad\x4f\xf2\x55\xe8\x11\x6f\xaa\x4d\xe5" + "\x18\x3d\xc3\x14\xf9\x40\xfa\x86\x9d\xaf\xff\xfc\x78\xba\xbe\x61\xf8\xd1" + "\x00\x8d", + 1, 1024 }, + { 0, 192, 5, + "\x8e\x73\xb0\xf7\xda\x0e\x64\x52\xc8\x10\xf3\x2b\x80\x90\x79\xe5\x62\xf8" + "\xea\xd2\x52\x2c\x6b\x7b", + NULL, + "\x19\x08\xa3\x58\x17\x14\x70\x5a\xb8\xab\x4f\x5f\xa4\x25\x2b\xec\xb6\x74" + "\x0b\x9d\x56\x3b\xaf\xa3\xa4\x2d\x3e\x1f\x18\x84\x3b\x4f\x48\xd9\xa3\xfe" + "\x59\x1e\x80\x67\x44\x35\x26\x00\x78\xda\x68\xfa\x61\x9c\xd8\x8e\x5c\xc1" + "\xff\xeb\x9c\x7d\xe7\xa9\x38\xeb\x66\xf8\x6a\x46\x71\x51\x02\xba\x8d\x70" + "\x55\x5b\x60\xc6\x4c\xae\xda\x2e\x17\xbb\x65\xef\x60\x85\x9e\x77\xe5\x83" + "\xef\x30\x08\x3a\xba\x80\x28\xc0\xa1\x93\x4c\x2a\x0b\xe1\xcb\xd0\xac\x72" + "\x72\x1d\x96\x76\x0e\xc0\xec\x7d\x84\xfd\xee\x08\xa1\x11\x20\x0d\x59\x5c" + "\x06\x3f\xa3\xf1\xd7\xa3\x1d\x29\xc3\xaa\x05\x2b\x74\x8c\x73\x60\x65\x43" + "\x76\xd4\xd7\x7b\x5f\x40\xf4\x77\xe1\xcc\x85\x37\x1c\xd8\xda\x91\xf0\x40" + "\xb2\x43\x2d\x87\x51\xd0\xce\x27\xa6\x60\xac\x67\xea\x8b\xae\x46\x2e\x78" + "\x06\x09\x8a\x82\xb0\x0d\x57\x56\x82\xfe\x89\xd2", + "\xcc\xe2\x3f\xc3\x12\x41\x31\x63\x03\x3a\x3c\xfe\x76\x55\xd2\x26\xf0\xc9" + "\xb5\xc6\xf0\x1e\xc3\x72\xfb\x64\x94\x7d\xf1\x5e\x2a\x9e\x0d\x9a\x7a\xe0" + "\xbc\x7b\xa6\x65\x41\xc0\xa0\x9d\xb1\xb1\x09\x99\x6e\xe7\x25\x5e\x64\x2b" + "\x74\xfa\xa1\x9a\x03\x33\x88\x81\x27\x48\xdd\x53\x77\x0b\xef\xd9\x2f\xfa" + "\xc8\x50\x0e\x08\xa1\x45\x12\x82\x2b\xfb\x85\x5a\x39\x8c\x71\x32\x59\x27" + "\x37\x53\xce\x3e\xae\x00\x45\x53\xfd\xaf\xa5\xd1\x1a\xe9\xa4\x1b\xe3\x99" + "\xde\xcd\x03\x36\x6b\x72\x43\x76\x04\xa8\xf9\x83\xef\x9e\x57\x75\x36\x0e" + "\x99\xe1\x79\x2b\x2b\x96\x01\x10\xb8\xf6\x4a\xa6\x13\xab\x7f\x55\x60\xf0" + "\xc9\x5c\x81\xa7\x96\x99\xb4\x55\x41\x48\xf1\xd4\xa1\xb4\x76\xb5\x35\xe1" + "\x02\x8e\x09\xb2\x6c\x11\x3f\xfb\x04\x47\x98\xab\x9b\x55\xc3\xa9\x2a\x64" + "\x32\x5a\x69\x96\x28\x8c\x5b\xe3\xb2\x60\x82\xec", + 1, 1536 }, + { 0, 256, 6, + "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35" + "\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4", + NULL, + "\x0b\xe5\x48\xa6\xa1\xbc\xac\x81\x80\x06\x5f\xae\x1e\x3f\x55\x73\x6d\x36" + "\x7f\x57\x3d\xa4\x4a\x6b\xb6\x65\x2f\xb7\xe8\x85\x47\xe2\x41\x42\xc2\x4e" + "\x58\xf1\xde\x42\x9f\x15\x4c\xaf\xea\x04\x20\xd0\x1a\x19\x36\x74\x71\x12" + "\x72\x1b\xdb\x18\xf9\x0b\xb3\xf3\x63\xd4\x62\x52\x8b\x63\x0f\x6b\x4d\xb9" + "\x70\xd6\x91\xa0\x43\x3f\x46\xfe\x43\xbb\xb8\xdc\x5e\xdb\xd4\x1f\xf0\x17" + "\x94\x25\xee\x55\x67\xbf\x4d\xda\x9d\xe7\x4b\xc6\x7a\xcf\x8f\xd7\xbb\x29" + "\x6e\x26\xd4\xc3\x08\x9b\x67\x15\xe9\x2d\x9f\x2d\x3c\x76\x26\xd3\xda\xfe" + "\x6e\x73\x9d\x09\x60\x4b\x35\x60\xdb\x77\xb6\xc0\x45\x91\xf9\x14\x8a\x7a" + "\xdd\xe2\xf1\xdf\x8f\x12\x4f\xd7\x75\xd6\x9a\x17\xda\x76\x88\xf0\xfa\x44" + "\x27\xbe\x61\xaf\x55\x9f\xc7\xf0\x76\x77\xde\xca\xd1\x47\x51\x55\xb1\xbf" + "\xfa\x1e\xca\x28\x17\x70\xf3\xb5\xd4\x32\x47\x04\xe0\x92\xd8\xa5\x03\x69" + "\x46\x99\x7f\x1e\x3f\xb2\x93\x36\xa3\x88\x75\x07\x68\xb8\x33\xce\x17\x3f" + "\x5c\xb7\x1e\x93\x38\xc5\x1d\x79\x86\x7c\x9d\x9e\x2f\x69\x38\x0f\x97\x5c" + "\x67\xbf\xa0\x8d\x37\x0b\xd3\xb1\x04\x87\x1d\x74\xfe\x30\xfb\xd0\x22\x92" + "\xf9\xf3\x23\xc9", + "\x4b\xc0\x1f\x80\xf5\xc7\xe8\xf5\xc9\xd0\x3c\x86\x50\x78\x21\xce\x01\xec" + "\x91\x00\xc9\xf8\x73\x43\x2f\x73\x8a\x6d\xee\xed\x2d\x40\x17\x16\x93\x15" + "\xac\xed\x28\x61\xb0\x0f\xa2\xe1\xd3\x80\x51\xdf\x73\xce\x48\x4c\x1c\xc1" + "\x8b\xc9\x9e\x5c\x48\x07\xa0\xf6\x29\xf8\x63\x87\xe4\xe7\x8b\xf8\xcf\x58" + "\xda\x57\x62\x11\x2e\x6e\x91\x7e\xc7\x73\xdb\x27\x3c\x64\x72\x52\xe3\x27" + "\x84\x1f\x73\x3f\xf4\x94\xd2\xdd\x93\x33\x65\x91\x98\x89\x13\xa9\x2b\x0d" + "\x6f\x56\x51\x15\x07\xc6\xa7\x36\x8f\x0c\xd6\xc2\x07\x06\x65\x7a\xf8\x94" + "\xa6\x75\x48\x4c\xcc\xa5\xa9\x91\x04\x2f\x7b\x89\x46\xd2\x87\xcb\xd6\x1b" + "\xf3\x1e\xa7\xe5\x09\xcf\x75\x05\x9f\xc9\xac\xcc\x61\x15\x2d\x2e\x2c\x0a" + "\x57\x4d\x33\x17\x6b\x22\x9e\x92\xc5\x81\xce\x9d\x52\x68\x7d\x98\xe1\x23" + "\x70\xc5\x19\x3e\x91\xfc\xc6\xd7\x67\x5f\xbb\x57\x20\x96\x3f\x1f\x9f\x64" + "\xe9\xb1\x51\xfd\x8c\xc1\x0f\x50\xbe\x43\x5f\x90\xb4\xd1\xb6\x41\x7c\x37" + "\x92\x71\xda\x9d\xfd\xee\x69\x8c\x24\x18\xe8\x81\x60\xe2\x89\x33\x42\xd4" + "\x1b\x6a\xcb\x4a\x5b\x00\x01\x4f\x11\x47\x0f\x57\xb0\x90\xf0\xed\xb0\x34" + "\x2e\x9f\x81\x6c", + 1, 2048 }, + { 0, 128, 7, "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", NULL, + "\xdd\x14\xde\x30\xe0\xfd\x7b\x2a\x94\x8e\x28\xa0\xf6\x93\x6e\xf5\x92\x65" + "\x1d\x5e\x78\x2a\x9d\x39\xfc\xb8\x6d\x8b\xa5\xf4\x4b\x21\xdd\x4e\xe9\xeb" + "\xd7\xa7\xa1\x59\xdc\x4c\x5e\xcc\x83\xab\xd3\x45\xfe\x2c\x73\x23\xea\x45" + "\xcb\x0c\x12\x67\x28\xcd\xef\x4e\xca\xe2\x1d\x92\x82\xd8\x0f\xa9\x36\x23" + "\x6d\x38\x68\xac\xa0\xeb\xdc\xcc\xdf\xb8\x3a\x53\x04\x1a\x55\x27\x8e\x22" + "\x86\x8c\xbd\xdc\x6b\x12\x9c\x69\xd2\x7a\x4b\x52\x5d\x76\x34\xb9\x5e\x30" + "\x0a\x8d\x1e\xf1\x27\xda\x5b\xb9\x5e\xbf\x65\x34\x00\xb6\xd2\xb0\x89\x12" + "\xb6\x35\xae\x27\x7f\x11\xe9\xf9\x1c\x71\xc9\x50\xfe\xd4\x76\x50\x95\xf7" + "\xe1\x1c\x14\xcd\x67\x0f\xf0\x6d\xa2\x93\x7b\x2c\x8d\x83\x5c\xff\xe4\x95" + "\xf3\xa1\xfd\x00\x77\x68\x41\xb4\xfb\x81\xf4\x61\x1a\x84\x5a\x53\xc3\xdc" + "\xba\x0d\x67\x2e\xcf\xf2\x30\xf5\x1d\xe9\xc4\x2c\xac\x1f\xa7\x9c\x64\xfd" + "\x45\x30\x1b\xa1\x3b\x3d\xc7\xf5\xf9\xbb\xba\x99\xa4\x12\x6e\x4e\xea\x0b" + "\x29\x7f\xcd\x84\x64\x50\x40\xb7\x6a\x24\x29\xa4\xa7\xa1\xef\xa9\xcf\xdf" + "\x09\xff\xaa\x17\x5d\x82\x74\xf5\xae\xd0\xe9\xec\xad\x5e\xa7\x84\xda\xe7" + "\x33\x58\x7e\x00\x45\x5f\xbb\x15\xa3\x65\x0e\xf5\x7e\x27\xe7\x04\x52\x58" + "\x81\xd0\xee\x8f\xaf\xe2\x3c\xbe\x08\x97\x8a\x97\x12\xb0\x09\xfe\xa5\xeb" + "\xd1\x9c\x30\xe8\x9a\x3f\xe0\x38\x34\x2b\xad\xb7\xc4\xda\x54\xab\x97\x9c" + "\x46\x2b\x2c\x0b\xb3\x49\xcd\x9d\x32\x38\x3c\x1a\x49\xdc\x2f\xe7\xcd\x8a" + "\xb0\x76\xcf\x30\xea\x0b\xb0\xb7\x63\xed\xb2\x8c\xc9\x2c\xb7\x75\xa8\xf6" + "\x63\xb6\xcd\xb5\x63\xfb\x5f\x89\xae\x3d\x33\x73\xaf\xde\xcb\x37\x0a\x50" + "\x6f\xae\xf3\xa6\x79\x85\xdd\xc5\x24\xc5\x29\x23\x64\xef\x43\xd7\xc4\xab" + "\xd8\xb0\x84\x26\x6b\xe8\xb1\x5d\xb5\x69\xfb\x97\x0e\x20\xb3\xc1\x60\xad" + "\x1a\xd2\xd6\x3a\x73\x08\xf0\x47\x5f\xcf\x15\xf7\x7b\xf3\x69\x08\x5a\x6b" + "\x9f\xc7\x12\xa1\xf0\xfb\x91\xc9\x07\x61\x21\xa0\x30\x4c\x16\x81\xcd\x3c" + "\x61\xe8\x96\x91\x30\xdd\x0c\x0e\x0b\xa1\x33\x95\x67\x99\xd6\x1e\x1a\xb3" + "\x12\xfd\xad\x46\x48\x87\x5e\xe8\xd4\xf5\xac\xdf\xa7\x37\xb8\xa1\x62\x8c" + "\xb8\xb6\xb0\x69\x63\x29\x60\x64\x26\xc3\xf8\x18\x8e\x46\xa0\xc5\x45\x5c" + "\x08\x2a\xed\x29\x84\x11\xea\x59\xc0\x16\xe2\x04\x30\x63\x22\x87\xb6\xc7" + "\x81\xa6\x58\xc0\xb2\xb0\x7d\xbc\x16\x44\x6e\x5d\x6d\xce\x2a\xe0\x20\x69" + "\x35\xa1\x5d\x17\x48\x55\x88\xfe\xde\x34\xe7\x18\xbf\x7e\x0a\x1c\x32\x88" + "\xab\xde\xe1\x02\x61\x09\x58\x96\xef\x16\x73\xac\xc0\x5c\x15\xca\x9b\xea" + "\x0e\x05\x97\x88\x09\xc5\xd0\x95\x90\xae\xa5\xb5\x28\xc6\x5a\x7b\xb3\xcc" + "\xae\x57\x71\x83\x56\x57\xca\xe8\x8b\x21\x0c\x37\x1d\xde\x85\xe2\x1b\xa2" + "\x38\xa0\xc5\xc7\x98\x7b\xf9\x5e\x6a\x68\xb3\xed\x49\x5e\x46\xb9\xc9\xf6" + "\x34\xa6\x0e\xac\x90\x72\xcf\xf8\x5b\x48\x13\x40\x7a\xce\xfd\x3c\x16\xff" + "\xb5\xea\xb2\x56\x47\xcc\x9f\xbc\xae\x4a\xc8\xa5\x59\x57\x01\xd7\x9f\xd7" + "\xbf\x13\xb1\xbf\xb7\x9a\xa0\xa1\xc6\x66\x61\x96\xf2\xcd\x8c\xcb\x3c\x67" + "\xb5\xed\xb7\xa2\x54\x84\x3c\xcb\x7e\xb3\x97\x05\xcb\x8f\xa9\xc6\x3c\xa2" + "\xbd\xbf\x3a\xb8\x92\x08\x01\xea\xfd\x55\x2f\x27\x2a\x82\x38\x26\x1d\x81" + "\x19\x33\x75\x3c\xa2\x13\x1e\x58\x9f\x0b\x08\x5d\x7a\x2c\x9a\xd1\xa5\x4c" + "\x41\xb4\x1d\xf8\x42\x08\x87\xdd\x8e\xc9\x05\xd2\x8c\xba\x93\x28\xbe\x4a" + "\x14\x13\x2a\x58\xf0\x1c\xac\xc1\xc4\x49\xbc\xe1\xda\xb6\x2d\x06\x98\x32" + "\xea\xa3\x89\x11\xca\x5f\x3e\xda\x24\xe2\xdb\x1e\xca\xf3\xc0\xc7\x64\xee" + "\x4b\x3d\xa2\xee\x69\xb0\x3f\x2c\xd5\x49\xba\x2d\x45\x7d\xdd\xb0\x0d\xc5" + "\xe0\x57\x95\xbe\xf8\x4a\x11\x46\x4c\xbb\xdf\xa8\x5a\xf9\xff\x0e\x31\xa9" + "\x50\x5d\xc4\xb3\x3d\x09\x46\x33\x39\x31\xd5\xb3\xe5\x91\xcf\xca\x8a\xe0" + "\xc2\x8e\xea\xbe\x54\x64\x78\x0c\x25\x1c\x17\xbc\x49\xf9\xc0\x30\x5f\x08" + "\x04\x9d\xb5\xe4\xeb\x9e\xe5\x1e\x6d\xbc\x7b\xe7\xf0\xd1\xa0\x01\x18\x51" + "\x4f\x64\xc3\x9c\x70\x25\x4f\xed\xc7\xbc\x19\x00\x09\x22\x97\x5d\x6f\xe4" + "\x47\x98\x05\xcd\xcc\xde\xd5\xe3\xaf\xa3\xde\x69\x99\x2a\xd1\x28\x4d\x7c" + "\x89\xa0\xdb\xae\xf9\xf1\x4a\x46\xdf\xbe\x1d\x37\xf2\xd5\x36\x4a\x54\xe8" + "\xc4\xfb\x57\x77\x09\x05\x31\x99\xaf\x9a\x17\xd1\x20\x93\x31\x89\xff\xed" + "\x0f\xf8\xed\xb3\xcf\x4c\x9a\x74\xbb\x00\x36\x41\xd1\x13\x68\x73\x78\x63" + "\x42\xdd\x99\x15\x9a\xf4\xe1\xad\x6d\xf6\x5e\xca\x20\x24\xd7\x9d\x2f\x58" + "\x97\xf7\xde\x31\x51\xa3\x1c\xe2\x66\x24\x4b\xa1\x56\x02\x32\xf4\x89\xf3" + "\x86\x9a\x85\xda\x95\xa8\x7f\x6a\x77\x02\x3a\xba\xe0\xbe\x34\x5c\x9a\x1a", + "\x62\xa1\xcc\x1e\x1b\xc3\xb1\x11\xb5\x11\x4c\x37\xbf\xd0\x0c\xef\x36\x9f" + "\x99\x49\x38\xc2\x62\xbd\x3e\x03\xd1\x02\xa2\x18\xdc\x58\x9c\x01\x99\xd8" + "\x47\xeb\x27\xce\x76\x84\xa5\xab\xb7\x9b\xbb\x98\xc9\x84\x02\x6e\x32\x65" + "\xc9\xcb\xca\xc7\xa5\x95\x11\xcc\x0a\x9d\x5e\xea\xba\x59\xef\x25\xc0\x2d" + "\x8b\xa2\xec\x2f\x34\xea\x7c\xef\xee\x2a\x57\x80\xc4\xca\x5e\x08\x8c\x12" + "\x13\x39\xd1\xc7\x96\x93\x41\x22\x97\x1c\x7d\xe0\x47\xab\xfa\xd7\xc6\x38" + "\x5a\x39\xdb\x4c\xd4\x6d\x50\x2b\x8f\xb1\x92\x06\x01\xbf\xdc\x14\x5c\x32" + "\xee\xb0\x6a\x36\xe8\xe9\xf3\x12\x9f\x1f\x00\xe5\x25\x3b\x52\x74\xba\x50" + "\x17\x81\x60\x5c\x15\xec\x4d\xb0\x6a\xa1\xdd\xb4\xa2\x71\x01\xb8\x8b\x59" + "\x93\x58\x23\xd6\x38\xbf\x49\x94\xb7\x6e\x22\x75\x68\x1f\x15\x2c\xc4\x46" + "\x44\x35\xc8\x7a\x40\x2e\x55\x3f\x67\x4d\x12\x21\xf6\xb1\x20\x47\x4f\x35" + "\xe4\x96\xf9\xa2\xdc\x4c\xe3\xa2\x13\x41\xed\x6d\x86\x80\x23\xe5\x2a\xd1" + "\xa0\x69\x8f\x7e\x22\x3f\xf1\x65\x9f\xd7\x86\xa8\x78\x57\x49\x74\x91\x52" + "\x91\xe7\x1e\xe2\x14\xe9\x88\xe1\x67\x12\x3d\x0a\x22\x31\x56\x2e\x36\xd4" + "\x45\xc9\x9b\x7b\x09\x53\x55\x36\xed\xa3\xc2\x22\xac\x00\x5e\x57\xc8\x40" + "\x65\xd2\x62\x61\x35\xf2\xe8\x4f\xb3\x9d\x2c\xb2\x12\x5e\x15\x47\xd6\x1c" + "\x99\x80\xe0\x1c\x09\x28\xa0\x7e\x6c\x96\xc9\x62\x33\xd3\xbe\x53\x16\xa0" + "\xf2\xa9\x42\x1c\x81\xa3\x35\x9b\x93\x9e\xc6\xc0\x83\x03\xb7\x39\x66\xc9" + "\x86\xf8\x8d\xc0\xe2\x88\xb4\x1f\x5d\x15\x80\x60\x2d\x53\x1d\x60\x07\xbc" + "\x72\x11\xd0\x0e\xcb\x70\x9c\xa0\x48\x56\x21\x5f\x18\xdd\xa3\x1d\xdb\xe0" + "\x41\x0c\x9e\xb9\xa2\x7e\x32\xb3\x3e\x91\x9d\xf2\xa6\x0d\x8c\xea\xae\x44" + "\xb2\x0f\x11\x35\x27\x2e\xb6\x3d\xe9\x63\x86\x2e\x81\xdc\xfa\xb4\x52\x1d" + "\x9c\xd5\x44\x95\xc8\xd0\x66\x8a\xbd\xf6\xd1\xff\xeb\x82\x68\x58\x7b\xec" + "\x0e\x92\x0e\x48\xd6\xff\x8d\xac\xc1\x41\x84\x9e\x56\x54\xf9\xb5\x1c\xb0" + "\x9f\xde\xfe\x14\x42\x0d\x22\x12\xf2\x7d\x7b\xc3\x2e\x72\x27\x76\x12\xdf" + "\x57\x2f\x97\x82\x9b\xcf\x75\x1a\x4a\x0c\xad\x29\x56\x4c\x74\xaf\x95\x03" + "\xff\x9f\x9d\xc3\x2e\x9c\x1a\x42\x75\xe1\x59\xc9\x05\x12\x6c\xea\x2b\x2f" + "\x89\xfc\xa4\x73\xc8\xdc\xf6\xd5\x50\x19\x22\x80\xbc\x08\x48\xb4\x45\x47" + "\x25\x01\xa9\x55\x7b\x66\xbd\x84\x0f\x16\xfa\x44\x23\x51\x6f\xed\x35\x0e" + "\x88\x4d\xda\xe8\x27\x94\xbd\x68\x46\x28\x79\x8c\x03\x03\xf0\x81\xac\xbc" + "\xc2\xdd\xa8\x98\xdf\xe3\x1c\x1c\x4b\x43\x9e\x7b\x26\x3c\xe9\xff\x3b\xee" + "\x35\xe6\x2a\xcf\xdc\x17\x85\x99\x9e\x88\x5c\x38\x4c\x56\x4a\x06\xeb\x28" + "\xf7\xb5\x97\x04\xd4\x05\x85\xee\x90\xd7\xe2\x10\x8a\x86\xb2\x3f\xbf\x3f" + "\x6a\xe6\xeb\xc1\x42\x97\xcb\x30\x41\x44\x79\x44\x7e\x1e\x3e\x55\xe5\xc8" + "\xd5\xec\x64\x3d\x09\x69\xea\xdb\xe5\x08\x33\x00\x79\x1b\x31\xf2\x3d\xbd" + "\x73\xe6\x0e\xc1\xb9\x45\xbf\xa5\x52\x5a\xcd\x71\x7a\x2e\x20\x1e\xbf\xff" + "\x42\x0a\x6a\x1b\xa4\xad\x79\x3d\x34\x54\x73\xe2\xd6\x6f\xb0\xcc\xc0\x8a" + "\x56\x3d\x4d\x90\x35\xe3\x4b\xcc\x40\x40\xbc\xcf\x93\xa0\xbd\x5c\xed\x22" + "\x57\x92\x5c\x8d\xfb\x67\x9e\xab\x40\xc9\xed\x7c\xa1\xb6\x36\xb2\xcb\xbc" + "\xf2\x1a\x46\x6c\x1f\xb3\xe4\xf6\x4c\x7a\x10\x81\x16\x93\x77\xa3\xa1\x07" + "\xec\xc8\x01\x76\xf8\xe3\xe6\xae\xaf\x90\x98\x3a\xbd\x7d\x28\x57\xb4\xc5" + "\xfe\x13\xab\x6c\x77\xc1\xc3\x47\x1d\x34\x2f\xdd\xe1\x7b\x8b\x65\xc4\xe3" + "\x45\xda\x6e\xba\x37\xb1\x37\xbf\x63\x1d\x39\x77\xf0\xa8\xf8\xda\x91\xd3" + "\x27\xb9\x29\x70\xf7\xae\x11\x6d\x8a\x8f\x2f\x3a\xe1\xb8\x9b\xb5\x2a\xa8" + "\x7b\x86\x49\xca\x0c\x95\x17\x1e\xaf\x9c\x52\x6b\x68\xae\xe3\xc3\xc9\x8c" + "\x89\x4b\xf2\xfb\xb1\xae\x2f\x80\xf9\xa3\xf4\x10\x09\x36\x81\x27\x06\x6d" + "\xe9\x79\x8e\xa4\x8e\x12\xfa\x03\x8e\x69\x4c\x7e\xc5\x10\xd5\x00\x64\x87" + "\xf8\x10\x8a\x8e\x96\x9e\xc8\xac\x42\x75\x97\x6d\x62\x3f\xa3\x29\x11\xd2" + "\x73\xd3\x95\xef\xb4\x64\xa4\x37\x09\x15\x42\x7f\xc4\x46\x8b\x80\xa8\xd9" + "\x2a\xfc\x38\x8f\xf9\xc1\xc5\x95\xad\x62\xc9\x6c\x60\x0b\x30\x04\x8c\x88" + "\xb5\x0b\x73\x23\xa4\xe0\xb7\x6e\x4c\x78\xe5\x0a\xfb\xe1\xc4\xeb\x1a\xb4" + "\xd8\x3c\x06\xb0\x00\x23\x86\xb0\xb4\x9d\x33\xe4\x21\xca\xf2\xad\x14\x07" + "\x82\x25\xde\x85\xe4\x58\x56\x93\x09\x3a\xeb\xde\x46\x77\x76\xa2\x35\x39" + "\xd0\xf6\x10\x81\x73\x3f\x22\x3b\xeb\xca\x00\x19\x38\x89\x26\x29\x7d\x6f" + "\x70\xa6\xbb\x52\x58\xb1\x0a\x85\xe9\x0b\x74\x2f\x08\xe8\xa4\x4d\xa1\xcf" + "\xf2\x75\xed\x05\xae\x7f\x10\xb1\x71\x26\xc5\xc7\xdc\xb0\x2d\x26\xf1\xb4", + 1, 8064 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/gcm_ctr_vectors_test.h b/test/kat-app/gcm_ctr_vectors_test.h index fca04308..5c455878 100644 --- a/test/kat-app/gcm_ctr_vectors_test.h +++ b/test/kat-app/gcm_ctr_vectors_test.h @@ -30,45 +30,45 @@ #include -enum arch_type { - ARCH_SSE = 0, - ARCH_AVX, - ARCH_AVX2, - ARCH_AVX512, - ARCH_NO_AESNI, - ARCH_NUMOF -}; +enum arch_type { ARCH_SSE = 0, ARCH_AVX, ARCH_AVX2, ARCH_AVX512, ARCH_NO_AESNI, ARCH_NUMOF }; -#define KBITS(K) (sizeof(K)) +#define KBITS(K) (sizeof(K)) /* struct to hold pointers to the key, plaintext and ciphertext vectors */ struct gcm_ctr_vector { - const uint8_t *K; /* AES Key */ - IMB_KEY_SIZE_BYTES Klen;/* length of key in bits */ - const uint8_t *IV; /* initial value used by GCM */ - uint64_t IVlen; /* length of IV in bytes */ - const uint8_t *A; /* additional authenticated data */ - uint64_t Alen; /* length of AAD in bytes */ - const uint8_t *P; /* Plain text */ - uint64_t Plen; /* length of our plaintext */ - /* outputs of encryption */ - const uint8_t *C; /* same length as PT */ - const uint8_t *T; /* Authentication tag */ - uint8_t Tlen; /* AT length can be 0 to 128bits */ + const uint8_t *K; /* AES Key */ + IMB_KEY_SIZE_BYTES Klen; /* length of key in bits */ + const uint8_t *IV; /* initial value used by GCM */ + uint64_t IVlen; /* length of IV in bytes */ + const uint8_t *A; /* additional authenticated data */ + uint64_t Alen; /* length of AAD in bytes */ + const uint8_t *P; /* Plain text */ + uint64_t Plen; /* length of our plaintext */ + /* outputs of encryption */ + const uint8_t *C; /* same length as PT */ + const uint8_t *T; /* Authentication tag */ + uint8_t Tlen; /* AT length can be 0 to 128bits */ }; -#define vector(N) \ - {K##N, (KBITS(K##N)), IV##N, sizeof(IV##N), A##N, A##N##_len, \ - P##N, sizeof(P##N), C##N, T##N, sizeof(T##N)} +#define vector(N) \ + { \ + K##N, (KBITS(K##N)), IV##N, sizeof(IV##N), A##N, A##N##_len, P##N, sizeof(P##N), \ + C##N, T##N, sizeof(T##N) \ + } -#define extra_vector(N) \ - {K##N, (KBITS(K##N)), IV##N, sizeof(IV##N), A##N, A##N##_len, \ - P##N, P##N##_len, C##N, T##N, sizeof(T##N)} -#define ghash_vector(N) \ - {K##N, (KBITS(K##N)), NULL, 0, NULL, 0, P##N, sizeof(P##N), \ - NULL, T##N, sizeof(T##N)} +#define extra_vector(N) \ + { \ + K##N, (KBITS(K##N)), IV##N, sizeof(IV##N), A##N, A##N##_len, P##N, P##N##_len, \ + C##N, T##N, sizeof(T##N) \ + } +#define ghash_vector(N) \ + { \ + K##N, (KBITS(K##N)), NULL, 0, NULL, 0, P##N, sizeof(P##N), NULL, T##N, \ + sizeof(T##N) \ + } struct MB_MGR; -extern int gcm_test(IMB_MGR *p_mgr); +extern int +gcm_test(IMB_MGR *p_mgr); #endif /* GCM_CTR_VECTORS_TEST_H_ */ diff --git a/test/kat-app/gcm_test.c b/test/kat-app/gcm_test.c index 0243cb82..d757afe9 100644 --- a/test/kat-app/gcm_test.c +++ b/test/kat-app/gcm_test.c @@ -30,7 +30,7 @@ #include #include #include -#include /* for memcmp() */ +#include /* for memcmp() */ #include #include "utils.h" @@ -39,38 +39,35 @@ /* 0 - no extra messages, 1 - additional messages */ #define VERBOSE 0 -#define AAD_SZ 24 -#define IV_SZ 12 -#define DIGEST_SZ 16 -#define MAX_KEY_SZ 32 +#define AAD_SZ 24 +#define IV_SZ 12 +#define DIGEST_SZ 16 +#define MAX_KEY_SZ 32 #define GCM_MAX_JOBS 32 -int gcm_test(IMB_MGR *p_mgr); +int +gcm_test(IMB_MGR *p_mgr); extern const struct aead_test gcm_test_json[]; -typedef int (*gcm_enc_dec_fn_t)(IMB_MGR *, const struct gcm_key_data *, - struct gcm_context_data *, - uint8_t *, const uint8_t *, uint64_t, - const uint8_t *, const uint64_t, - const uint8_t *, uint64_t, - uint8_t *, uint64_t, IMB_KEY_SIZE_BYTES); +typedef int (*gcm_enc_dec_fn_t)(IMB_MGR *, const struct gcm_key_data *, struct gcm_context_data *, + uint8_t *, const uint8_t *, uint64_t, const uint8_t *, + const uint64_t, const uint8_t *, uint64_t, uint8_t *, uint64_t, + IMB_KEY_SIZE_BYTES); typedef int (*gcm_enc_dec_many_fn_t)(IMB_MGR *, const struct gcm_key_data *, - struct gcm_context_data **, - uint8_t **, const uint8_t *, - const uint64_t, const uint8_t *, - const uint64_t, const uint8_t *, - const uint64_t, uint8_t **, const uint64_t, + struct gcm_context_data **, uint8_t **, const uint8_t *, + const uint64_t, const uint8_t *, const uint64_t, + const uint8_t *, const uint64_t, uint8_t **, const uint64_t, const IMB_KEY_SIZE_BYTES, const uint32_t); static IMB_MGR *p_gcm_mgr = NULL; -static int check_data(const uint8_t *test, const uint8_t *expected, - uint64_t len, const char *data_name) +static int +check_data(const uint8_t *test, const uint8_t *expected, uint64_t len, const char *data_name) { - int mismatch; - int is_error = 0; + int mismatch; + int is_error = 0; if (len == 0) return is_error; @@ -78,202 +75,158 @@ static int check_data(const uint8_t *test, const uint8_t *expected, if (test == NULL || expected == NULL || data_name == NULL) return 1; - mismatch = memcmp(test, expected, len); - if (mismatch) { + mismatch = memcmp(test, expected, len); + if (mismatch) { uint64_t a; - is_error = 1; - printf(" expected results don't match %s \t\t", data_name); + is_error = 1; + printf(" expected results don't match %s \t\t", data_name); for (a = 0; a < len; a++) { if (test[a] != expected[a]) { - printf(" '%x' != '%x' at %llx of %llx\n", - test[a], expected[a], - (unsigned long long) a, - (unsigned long long) len); + printf(" '%x' != '%x' at %llx of %llx\n", test[a], expected[a], + (unsigned long long) a, (unsigned long long) len); break; } } - } - return is_error; + } + return is_error; } static void -imb_aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, +imb_aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { switch (key_len) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_ENC(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + IMB_AES128_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_ENC(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + IMB_AES192_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_ENC(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + IMB_AES256_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len); break; } } static void -imb_aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, +imb_aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { switch (key_len) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_DEC(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + IMB_AES128_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_DEC(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + IMB_AES192_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_DEC(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + IMB_AES256_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len); break; } } static void -imb_aes_gcm_init(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, uint64_t aad_len, +imb_aes_gcm_init(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + const uint8_t *iv, const uint64_t iv_len, const uint8_t *aad, uint64_t aad_len, IMB_KEY_SIZE_BYTES key_len) { switch (key_len) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_INIT_VAR_IV(p_mgr, key, ctx, - iv, iv_len, aad, aad_len); + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, key, ctx, iv, iv_len, aad, aad_len); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_INIT_VAR_IV(p_mgr, key, ctx, - iv, iv_len, aad, aad_len); + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, key, ctx, iv, iv_len, aad, aad_len); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_INIT_VAR_IV(p_mgr, key, ctx, - iv, iv_len, aad, aad_len); + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, key, ctx, iv, iv_len, aad, aad_len); break; } } static void -imb_aes_gcm_enc_update(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - IMB_KEY_SIZE_BYTES key_len) +imb_aes_gcm_enc_update(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, IMB_KEY_SIZE_BYTES key_len) { switch (key_len) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_ENC_UPDATE(p_mgr, key, ctx, out, - in, len); + IMB_AES128_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_ENC_UPDATE(p_mgr, key, ctx, out, - in, len); + IMB_AES192_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_ENC_UPDATE(p_mgr, key, ctx, out, - in, len); + IMB_AES256_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); break; } } static void -imb_aes_gcm_dec_update(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - IMB_KEY_SIZE_BYTES key_len) +imb_aes_gcm_dec_update(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, IMB_KEY_SIZE_BYTES key_len) { switch (key_len) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_DEC_UPDATE(p_mgr, key, ctx, out, - in, len); + IMB_AES128_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_DEC_UPDATE(p_mgr, key, ctx, out, - in, len); + IMB_AES192_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_DEC_UPDATE(p_mgr, key, ctx, out, - in, len); + IMB_AES256_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); break; } } static void -imb_aes_gcm_enc_finalize(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *auth_tag, uint64_t auth_tag_len, +imb_aes_gcm_enc_finalize(IMB_MGR *p_mgr, const struct gcm_key_data *key, + struct gcm_context_data *ctx, uint8_t *auth_tag, uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { switch (key_len) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_ENC_FINALIZE(p_mgr, key, ctx, - auth_tag, auth_tag_len); + IMB_AES128_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, auth_tag_len); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_ENC_FINALIZE(p_mgr, key, ctx, - auth_tag, auth_tag_len); + IMB_AES192_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, auth_tag_len); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_ENC_FINALIZE(p_mgr, key, ctx, - auth_tag, auth_tag_len); + IMB_AES256_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, auth_tag_len); break; } } static void -imb_aes_gcm_dec_finalize(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *auth_tag, uint64_t auth_tag_len, +imb_aes_gcm_dec_finalize(IMB_MGR *p_mgr, const struct gcm_key_data *key, + struct gcm_context_data *ctx, uint8_t *auth_tag, uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { switch (key_len) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_DEC_FINALIZE(p_mgr, key, ctx, - auth_tag, auth_tag_len); + IMB_AES128_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, auth_tag_len); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_DEC_FINALIZE(p_mgr, key, ctx, - auth_tag, auth_tag_len); + IMB_AES192_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, auth_tag_len); break; case IMB_KEY_256_BYTES: default: - IMB_AES256_GCM_DEC_FINALIZE(p_mgr, key, ctx, - auth_tag, auth_tag_len); + IMB_AES256_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, auth_tag_len); break; } } @@ -282,51 +235,35 @@ imb_aes_gcm_dec_finalize(IMB_MGR *p_mgr, * RAW API *****************************************************************************/ static int -aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, +aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, const uint64_t iv_len, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { if (iv_len == 12) { - imb_aes_gcm_enc(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + imb_aes_gcm_enc(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len, key_len); } else { - imb_aes_gcm_init(p_mgr, key, ctx, iv, iv_len, aad, aad_len, - key_len); - imb_aes_gcm_enc_update(p_mgr, key, ctx, out, in, len, - key_len); - imb_aes_gcm_enc_finalize(p_mgr, key, ctx, - auth_tag, auth_tag_len, key_len); + imb_aes_gcm_init(p_mgr, key, ctx, iv, iv_len, aad, aad_len, key_len); + imb_aes_gcm_enc_update(p_mgr, key, ctx, out, in, len, key_len); + imb_aes_gcm_enc_finalize(p_mgr, key, ctx, auth_tag, auth_tag_len, key_len); } return 0; } static int -aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, +aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, const uint64_t iv_len, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { if (iv_len == 12) { - imb_aes_gcm_dec(p_mgr, key, ctx, out, in, len, - iv, aad, aad_len, auth_tag, + imb_aes_gcm_dec(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, auth_tag_len, key_len); } else { - imb_aes_gcm_init(p_mgr, key, ctx, iv, iv_len, aad, aad_len, - key_len); - imb_aes_gcm_dec_update(p_mgr, key, ctx, out, in, len, - key_len); - imb_aes_gcm_dec_finalize(p_mgr, key, ctx, - auth_tag, auth_tag_len, key_len); + imb_aes_gcm_init(p_mgr, key, ctx, iv, iv_len, aad, aad_len, key_len); + imb_aes_gcm_dec_update(p_mgr, key, ctx, out, in, len, key_len); + imb_aes_gcm_dec_finalize(p_mgr, key, ctx, auth_tag, auth_tag_len, key_len); } return 0; } @@ -335,36 +272,26 @@ aes_gcm_dec(IMB_MGR *p_mgr, * RAW SGL API *****************************************************************************/ static int -sgl_aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, - IMB_KEY_SIZE_BYTES key_len) +sgl_aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { imb_aes_gcm_init(p_mgr, key, ctx, iv, iv_len, aad, aad_len, key_len); imb_aes_gcm_enc_update(p_mgr, key, ctx, out, in, len, key_len); - imb_aes_gcm_enc_finalize(p_mgr, key, ctx, auth_tag, auth_tag_len, - key_len); + imb_aes_gcm_enc_finalize(p_mgr, key, ctx, auth_tag, auth_tag_len, key_len); return 0; } static int -sgl_aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, - IMB_KEY_SIZE_BYTES key_len) +sgl_aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { imb_aes_gcm_init(p_mgr, key, ctx, iv, iv_len, aad, aad_len, key_len); imb_aes_gcm_dec_update(p_mgr, key, ctx, out, in, len, key_len); - imb_aes_gcm_dec_finalize(p_mgr, key, ctx, auth_tag, auth_tag_len, - key_len); + imb_aes_gcm_dec_finalize(p_mgr, key, ctx, auth_tag, auth_tag_len, key_len); return 0; } @@ -372,66 +299,46 @@ sgl_aes_gcm_dec(IMB_MGR *p_mgr, * QUIC API *****************************************************************************/ static int -quic_aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, - IMB_KEY_SIZE_BYTES key_len) +quic_aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { - if (iv_len != 12) - return aes_gcm_enc(p_mgr, key, ctx, - out, in, len, - iv, iv_len, - aad, aad_len, - auth_tag, auth_tag_len, key_len); - - imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_ENCRYPT, - (void **) &out, (const void * const*) &in, &len, - (const void * const*) &iv, - (const void * const*) &aad, aad_len, - (void **) &auth_tag, auth_tag_len, 1); + if (iv_len != 12) + return aes_gcm_enc(p_mgr, key, ctx, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, key_len); + + imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_ENCRYPT, (void **) &out, + (const void *const *) &in, &len, (const void *const *) &iv, + (const void *const *) &aad, aad_len, (void **) &auth_tag, auth_tag_len, 1); const int err = imb_get_errno(p_mgr); if (err != 0) { - printf("QUIC GCM encrypt error %d, %s\n", - err, imb_get_strerror(err)); + printf("QUIC GCM encrypt error %d, %s\n", err, imb_get_strerror(err)); return 1; } return 0; } static int -quic_aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len, - IMB_KEY_SIZE_BYTES key_len) +quic_aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len, IMB_KEY_SIZE_BYTES key_len) { - if (iv_len != 12) - return aes_gcm_dec(p_mgr, key, ctx, - out, in, len, - iv, iv_len, - aad, aad_len, - auth_tag, auth_tag_len, key_len); - - imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_DECRYPT, - (void **) &out, (const void * const*) &in, &len, - (const void * const*) &iv, - (const void * const*) &aad, aad_len, - (void **) &auth_tag, auth_tag_len, 1); + if (iv_len != 12) + return aes_gcm_dec(p_mgr, key, ctx, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, key_len); + + imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_DECRYPT, (void **) &out, + (const void *const *) &in, &len, (const void *const *) &iv, + (const void *const *) &aad, aad_len, (void **) &auth_tag, auth_tag_len, 1); const int err = imb_get_errno(p_mgr); if (err != 0) { - printf("QUIC GCM decrypt error %d, %s\n", - err, imb_get_strerror(err)); + printf("QUIC GCM decrypt error %d, %s\n", err, imb_get_strerror(err)); return 1; } return 0; @@ -441,14 +348,11 @@ quic_aes_gcm_dec(IMB_MGR *p_mgr, * burst API *****************************************************************************/ static int -aes_gcm_burst(IMB_MGR *mb_mgr, - const IMB_CIPHER_DIRECTION cipher_dir, - const struct gcm_key_data *key, - const uint64_t key_len, - uint8_t ** const out, const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, const uint8_t *aad, - const uint64_t aad_len, uint8_t ** const auth_tag, - const uint64_t auth_tag_len, struct gcm_context_data ** const ctx, +aes_gcm_burst(IMB_MGR *mb_mgr, const IMB_CIPHER_DIRECTION cipher_dir, + const struct gcm_key_data *key, const uint64_t key_len, uint8_t **const out, + const uint8_t *in, const uint64_t len, const uint8_t *iv, const uint64_t iv_len, + const uint8_t *aad, const uint64_t aad_len, uint8_t **const auth_tag, + const uint64_t auth_tag_len, struct gcm_context_data **const ctx, const IMB_CIPHER_MODE cipher_mode, const IMB_SGL_STATE sgl_state, const uint32_t num_jobs) { @@ -461,25 +365,23 @@ aes_gcm_burst(IMB_MGR *mb_mgr, for (i = 0; i < num_jobs; i++) { job = jobs[i]; - job->cipher_mode = cipher_mode; - job->chain_order = - (cipher_dir == IMB_DIR_ENCRYPT) ? - IMB_ORDER_CIPHER_HASH : - IMB_ORDER_HASH_CIPHER; - job->enc_keys = key; - job->dec_keys = key; - job->key_len_in_bytes = key_len; - job->src = in; - job->dst = out[i]; - job->msg_len_to_cipher_in_bytes = len; + job->cipher_mode = cipher_mode; + job->chain_order = (cipher_dir == IMB_DIR_ENCRYPT) ? IMB_ORDER_CIPHER_HASH + : IMB_ORDER_HASH_CIPHER; + job->enc_keys = key; + job->dec_keys = key; + job->key_len_in_bytes = key_len; + job->src = in; + job->dst = out[i]; + job->msg_len_to_cipher_in_bytes = len; job->cipher_start_src_offset_in_bytes = UINT64_C(0); - job->iv = iv; - job->iv_len_in_bytes = iv_len; - job->u.GCM.aad = aad; - job->u.GCM.aad_len_in_bytes = aad_len; - job->auth_tag_output = auth_tag[i]; - job->auth_tag_output_len_in_bytes = auth_tag_len; - job->cipher_direction = cipher_dir; + job->iv = iv; + job->iv_len_in_bytes = iv_len; + job->u.GCM.aad = aad; + job->u.GCM.aad_len_in_bytes = aad_len; + job->auth_tag_output = auth_tag[i]; + job->auth_tag_output_len_in_bytes = auth_tag_len; + job->cipher_direction = cipher_dir; if (cipher_mode == IMB_CIPHER_GCM_SGL) { job->u.GCM.ctx = ctx[i]; job->sgl_state = sgl_state; @@ -490,15 +392,13 @@ aes_gcm_burst(IMB_MGR *mb_mgr, imb_set_session(mb_mgr, job); } - const uint32_t completed_jobs = - IMB_SUBMIT_BURST(mb_mgr, num_jobs, jobs); + const uint32_t completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, jobs); if (completed_jobs != num_jobs) { int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); return -1; } else { printf("submit_burst error: not enough " @@ -511,8 +411,8 @@ aes_gcm_burst(IMB_MGR *mb_mgr, job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); - return -1; + printf("job %u status not complete!\n", i + 1); + return -1; } } @@ -520,36 +420,26 @@ aes_gcm_burst(IMB_MGR *mb_mgr, } static int -burst_aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data **ctx, uint8_t **out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, - uint8_t **auth_tag, const uint64_t auth_tag_len, - const IMB_KEY_SIZE_BYTES key_len, const uint32_t num_jobs) +burst_aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data **ctx, + uint8_t **out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, + uint8_t **auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len, + const uint32_t num_jobs) { - return aes_gcm_burst(p_mgr, IMB_DIR_ENCRYPT, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0, - num_jobs); + return aes_gcm_burst(p_mgr, IMB_DIR_ENCRYPT, key, key_len, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0, num_jobs); } static int -burst_quic_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data **ctx, uint8_t **out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, +burst_quic_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data **ctx, + uint8_t **out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, uint8_t **auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len, const uint32_t num_jobs) { - if (iv_len != 12) { - return burst_aes_gcm_enc(p_mgr, key, ctx, out, in, len, - iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, - key_len, num_jobs); + if (iv_len != 12) { + return burst_aes_gcm_enc(p_mgr, key, ctx, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, key_len, num_jobs); } const void *in_array[GCM_MAX_JOBS]; @@ -565,52 +455,39 @@ burst_quic_gcm_enc(IMB_MGR *p_mgr, aad_array[i] = (const void *) aad; } - imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_ENCRYPT, - (void **) out, in_array, len_array, - iv_array, aad_array, aad_len, - (void **) auth_tag, auth_tag_len, num_jobs); + imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_ENCRYPT, (void **) out, in_array, len_array, + iv_array, aad_array, aad_len, (void **) auth_tag, auth_tag_len, num_jobs); const int err = imb_get_errno(p_mgr); if (err != 0) { - printf("QUIC GCM burst-encrypt error %d, %s\n", - err, imb_get_strerror(err)); + printf("QUIC GCM burst-encrypt error %d, %s\n", err, imb_get_strerror(err)); return 1; } return 0; } static int -burst_aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data **ctx, uint8_t **out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, - uint8_t **auth_tag, const uint64_t auth_tag_len, - const IMB_KEY_SIZE_BYTES key_len, const uint32_t num_jobs) +burst_aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data **ctx, + uint8_t **out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, + uint8_t **auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len, + const uint32_t num_jobs) { - return aes_gcm_burst(p_mgr, IMB_DIR_DECRYPT, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0, - num_jobs); + return aes_gcm_burst(p_mgr, IMB_DIR_DECRYPT, key, key_len, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0, num_jobs); } static int -burst_quic_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data **ctx, uint8_t **out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, +burst_quic_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data **ctx, + uint8_t **out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, uint8_t **auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len, const uint32_t num_jobs) { - if (iv_len != 12) { - return burst_aes_gcm_dec(p_mgr, key, ctx, out, in, len, - iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, - key_len, num_jobs); + if (iv_len != 12) { + return burst_aes_gcm_dec(p_mgr, key, ctx, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, key_len, num_jobs); } const void *in_array[GCM_MAX_JOBS]; @@ -626,92 +503,71 @@ burst_quic_gcm_dec(IMB_MGR *p_mgr, aad_array[i] = (const void *) aad; } - imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_DECRYPT, - (void **) out, in_array, len_array, - iv_array, aad_array, aad_len, - (void **) auth_tag, auth_tag_len, num_jobs); + imb_quic_aes_gcm(p_mgr, key, key_len, IMB_DIR_DECRYPT, (void **) out, in_array, len_array, + iv_array, aad_array, aad_len, (void **) auth_tag, auth_tag_len, num_jobs); const int err = imb_get_errno(p_mgr); if (err != 0) { - printf("QUIC GCM burst-decrypt error %d, %s\n", - err, imb_get_strerror(err)); + printf("QUIC GCM burst-decrypt error %d, %s\n", err, imb_get_strerror(err)); return 1; } return 0; } static int -burst_sgl_aes_gcm(IMB_MGR *p_mgr, - IMB_CIPHER_DIRECTION cipher_dir, - const struct gcm_key_data *key, - struct gcm_context_data **ctx, uint8_t **out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, - uint8_t **auth_tag, const uint64_t auth_tag_len, +burst_sgl_aes_gcm(IMB_MGR *p_mgr, IMB_CIPHER_DIRECTION cipher_dir, const struct gcm_key_data *key, + struct gcm_context_data **ctx, uint8_t **out, const uint8_t *in, + const uint64_t len, const uint8_t *iv, const uint64_t iv_len, const uint8_t *aad, + const uint64_t aad_len, uint8_t **auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len, const uint32_t num_jobs) { - if (aes_gcm_burst(p_mgr, cipher_dir, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_INIT, num_jobs) < 0) + if (aes_gcm_burst(p_mgr, cipher_dir, key, key_len, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, IMB_SGL_INIT, + num_jobs) < 0) return -1; - if (aes_gcm_burst(p_mgr, cipher_dir, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_UPDATE, num_jobs) < 0) + if (aes_gcm_burst(p_mgr, cipher_dir, key, key_len, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, IMB_SGL_UPDATE, + num_jobs) < 0) return -1; - if (aes_gcm_burst(p_mgr, cipher_dir, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_COMPLETE, num_jobs) < 0) + if (aes_gcm_burst(p_mgr, cipher_dir, key, key_len, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, IMB_SGL_COMPLETE, + num_jobs) < 0) return -1; return 0; } static int -burst_sgl_aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data **ctx, uint8_t **out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, +burst_sgl_aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data **ctx, + uint8_t **out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, uint8_t **auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len, const uint32_t num_jobs) { - return burst_sgl_aes_gcm(p_mgr, IMB_DIR_ENCRYPT, key, ctx, out, in, - len, iv, iv_len, aad, aad_len, auth_tag, - auth_tag_len, key_len, num_jobs); + return burst_sgl_aes_gcm(p_mgr, IMB_DIR_ENCRYPT, key, ctx, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, key_len, num_jobs); } static int -burst_sgl_aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data **ctx, uint8_t **out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, +burst_sgl_aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data **ctx, + uint8_t **out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, uint8_t **auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len, const uint32_t num_jobs) { - return burst_sgl_aes_gcm(p_mgr, IMB_DIR_DECRYPT, key, ctx, out, in, - len, iv, iv_len, aad, aad_len, auth_tag, - auth_tag_len, key_len, num_jobs); + return burst_sgl_aes_gcm(p_mgr, IMB_DIR_DECRYPT, key, ctx, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, key_len, num_jobs); } /***************************************************************************** * job API *****************************************************************************/ static int -aes_gcm_job(IMB_MGR *mb_mgr, - IMB_CIPHER_DIRECTION cipher_dir, - const struct gcm_key_data *key, const uint64_t key_len, - uint8_t *out, const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, const uint8_t *aad, - const uint64_t aad_len, uint8_t *auth_tag, - const uint64_t auth_tag_len, struct gcm_context_data *ctx, +aes_gcm_job(IMB_MGR *mb_mgr, IMB_CIPHER_DIRECTION cipher_dir, const struct gcm_key_data *key, + const uint64_t key_len, uint8_t *out, const uint8_t *in, const uint64_t len, + const uint8_t *iv, const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, + uint8_t *auth_tag, const uint64_t auth_tag_len, struct gcm_context_data *ctx, const IMB_CIPHER_MODE cipher_mode, const IMB_SGL_STATE sgl_state) { IMB_JOB *job; @@ -722,24 +578,23 @@ aes_gcm_job(IMB_MGR *mb_mgr, return -1; } - job->cipher_mode = cipher_mode; - job->chain_order = - (cipher_dir == IMB_DIR_ENCRYPT) ? IMB_ORDER_CIPHER_HASH : - IMB_ORDER_HASH_CIPHER; - job->enc_keys = key; - job->dec_keys = key; - job->key_len_in_bytes = key_len; - job->src = in; - job->dst = out; - job->msg_len_to_cipher_in_bytes = len; + job->cipher_mode = cipher_mode; + job->chain_order = + (cipher_dir == IMB_DIR_ENCRYPT) ? IMB_ORDER_CIPHER_HASH : IMB_ORDER_HASH_CIPHER; + job->enc_keys = key; + job->dec_keys = key; + job->key_len_in_bytes = key_len; + job->src = in; + job->dst = out; + job->msg_len_to_cipher_in_bytes = len; job->cipher_start_src_offset_in_bytes = UINT64_C(0); - job->iv = iv; - job->iv_len_in_bytes = iv_len; - job->u.GCM.aad = aad; - job->u.GCM.aad_len_in_bytes = aad_len; - job->auth_tag_output = auth_tag; - job->auth_tag_output_len_in_bytes = auth_tag_len; - job->cipher_direction = cipher_dir; + job->iv = iv; + job->iv_len_in_bytes = iv_len; + job->u.GCM.aad = aad; + job->u.GCM.aad_len_in_bytes = aad_len; + job->auth_tag_output = auth_tag; + job->auth_tag_output_len_in_bytes = auth_tag_len; + job->cipher_direction = cipher_dir; if (cipher_mode == IMB_CIPHER_GCM_SGL) { job->u.GCM.ctx = ctx; job->sgl_state = sgl_state; @@ -757,71 +612,50 @@ aes_gcm_job(IMB_MGR *mb_mgr, } static int -job_aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, uint8_t *out, const uint8_t *in, - const uint64_t len, const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, uint8_t *auth_tag, - const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len) +job_aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, + uint8_t *auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len) { - return aes_gcm_job(p_mgr, IMB_DIR_ENCRYPT, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0); + return aes_gcm_job(p_mgr, IMB_DIR_ENCRYPT, key, key_len, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0); } static int -job_aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, uint8_t *out, const uint8_t *in, - const uint64_t len, const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, uint8_t *auth_tag, - const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len) +job_aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, + uint8_t *auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len) { - return aes_gcm_job(p_mgr, IMB_DIR_DECRYPT, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0); + return aes_gcm_job(p_mgr, IMB_DIR_DECRYPT, key, key_len, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM, 0); } static int -job_sgl_aes_gcm(IMB_MGR *p_mgr, - const IMB_CIPHER_DIRECTION cipher_dir, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, uint8_t *out, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, - uint8_t *auth_tag, const uint64_t auth_tag_len, - const IMB_KEY_SIZE_BYTES key_len) +job_sgl_aes_gcm(IMB_MGR *p_mgr, const IMB_CIPHER_DIRECTION cipher_dir, + const struct gcm_key_data *key, struct gcm_context_data *ctx, uint8_t *out, + const uint8_t *in, const uint64_t len, const uint8_t *iv, const uint64_t iv_len, + const uint8_t *aad, const uint64_t aad_len, uint8_t *auth_tag, + const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len) { - if (aes_gcm_job(p_mgr, cipher_dir, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_INIT) < 0) + if (aes_gcm_job(p_mgr, cipher_dir, key, key_len, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, IMB_SGL_INIT) < 0) return -1; - if (aes_gcm_job(p_mgr, cipher_dir, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_UPDATE) < 0) + if (aes_gcm_job(p_mgr, cipher_dir, key, key_len, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, IMB_SGL_UPDATE) < 0) return -1; - if (aes_gcm_job(p_mgr, cipher_dir, key, - key_len, out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_COMPLETE) < 0) + if (aes_gcm_job(p_mgr, cipher_dir, key, key_len, out, in, len, iv, iv_len, aad, aad_len, + auth_tag, auth_tag_len, ctx, IMB_CIPHER_GCM_SGL, IMB_SGL_COMPLETE) < 0) return -1; return 0; } static int -aes_gcm_single_job_sgl(IMB_MGR *mb_mgr, - IMB_CIPHER_DIRECTION cipher_dir, - const struct gcm_key_data *key, - const uint64_t key_len, - struct IMB_SGL_IOV *sgl_segs, - const unsigned num_sgl_segs, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, - uint8_t *auth_tag, const uint64_t auth_tag_len, - struct gcm_context_data *ctx) +aes_gcm_single_job_sgl(IMB_MGR *mb_mgr, IMB_CIPHER_DIRECTION cipher_dir, + const struct gcm_key_data *key, const uint64_t key_len, + struct IMB_SGL_IOV *sgl_segs, const unsigned num_sgl_segs, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, + uint8_t *auth_tag, const uint64_t auth_tag_len, struct gcm_context_data *ctx) { IMB_JOB *job; @@ -834,21 +668,20 @@ aes_gcm_single_job_sgl(IMB_MGR *mb_mgr, job->cipher_mode = IMB_CIPHER_GCM_SGL; job->cipher_direction = cipher_dir; job->hash_alg = IMB_AUTH_GCM_SGL; - job->chain_order = - (cipher_dir == IMB_DIR_ENCRYPT) ? IMB_ORDER_CIPHER_HASH : - IMB_ORDER_HASH_CIPHER; - job->enc_keys = key; - job->dec_keys = key; - job->key_len_in_bytes = key_len; - job->num_sgl_io_segs = num_sgl_segs; - job->sgl_io_segs = sgl_segs; + job->chain_order = + (cipher_dir == IMB_DIR_ENCRYPT) ? IMB_ORDER_CIPHER_HASH : IMB_ORDER_HASH_CIPHER; + job->enc_keys = key; + job->dec_keys = key; + job->key_len_in_bytes = key_len; + job->num_sgl_io_segs = num_sgl_segs; + job->sgl_io_segs = sgl_segs; job->cipher_start_src_offset_in_bytes = UINT64_C(0); - job->iv = iv; - job->iv_len_in_bytes = iv_len; - job->u.GCM.aad = aad; - job->u.GCM.aad_len_in_bytes = aad_len; - job->auth_tag_output = auth_tag; - job->auth_tag_output_len_in_bytes = auth_tag_len; + job->iv = iv; + job->iv_len_in_bytes = iv_len; + job->u.GCM.aad = aad; + job->u.GCM.aad_len_in_bytes = aad_len; + job->auth_tag_output = auth_tag; + job->auth_tag_output_len_in_bytes = auth_tag_len; job->u.GCM.ctx = ctx; job->sgl_state = IMB_SGL_ALL; job = IMB_SUBMIT_JOB(mb_mgr); @@ -862,84 +695,74 @@ aes_gcm_single_job_sgl(IMB_MGR *mb_mgr, } static int -job_sgl_aes_gcm_enc(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, +job_sgl_aes_gcm_enc(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, uint8_t *auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len) { - return job_sgl_aes_gcm(p_mgr, IMB_DIR_ENCRYPT, key, ctx, - out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, key_len); + return job_sgl_aes_gcm(p_mgr, IMB_DIR_ENCRYPT, key, ctx, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, key_len); } static int -job_sgl_aes_gcm_dec(IMB_MGR *p_mgr, - const struct gcm_key_data *key, - struct gcm_context_data *ctx, - uint8_t *out, const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len, +job_sgl_aes_gcm_dec(IMB_MGR *p_mgr, const struct gcm_key_data *key, struct gcm_context_data *ctx, + uint8_t *out, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len, uint8_t *auth_tag, const uint64_t auth_tag_len, const IMB_KEY_SIZE_BYTES key_len) { - return job_sgl_aes_gcm(p_mgr, IMB_DIR_DECRYPT, key, ctx, - out, in, len, iv, iv_len, aad, aad_len, - auth_tag, auth_tag_len, key_len); + return job_sgl_aes_gcm(p_mgr, IMB_DIR_DECRYPT, key, ctx, out, in, len, iv, iv_len, aad, + aad_len, auth_tag, auth_tag_len, key_len); } /*****************************************************************************/ static void -test_gcm_vectors(struct aead_test const *vector, - gcm_enc_dec_fn_t encfn, - gcm_enc_dec_fn_t decfn, +test_gcm_vectors(struct aead_test const *vector, gcm_enc_dec_fn_t encfn, gcm_enc_dec_fn_t decfn, struct test_suite_context *ts) { - struct gcm_key_data gdata_key; - struct gcm_context_data gdata_ctx; - int is_error = 0; - /* Temporary array for the calculated vectors */ - uint8_t *ct_test = NULL; - uint8_t *pt_test = NULL; - uint8_t *T_test = NULL; - uint8_t *T2_test = NULL; + struct gcm_key_data gdata_key; + struct gcm_context_data gdata_ctx; + int is_error = 0; + /* Temporary array for the calculated vectors */ + uint8_t *ct_test = NULL; + uint8_t *pt_test = NULL; + uint8_t *T_test = NULL; + uint8_t *T2_test = NULL; const uint8_t *iv = (const void *) vector->iv; const uint64_t iv_len = vector->ivSize / 8; if (vector->msgSize / 8 != 0) { - /* Allocate space for the calculated ciphertext */ - ct_test = malloc(vector->msgSize / 8); - if (ct_test == NULL) { - fprintf(stderr, "Can't allocate ciphertext memory\n"); - goto test_gcm_vectors_exit; - } - /* Allocate space for the calculated plaintext */ - pt_test = malloc(vector->msgSize / 8); - if (pt_test == NULL) { - fprintf(stderr, "Can't allocate plaintext memory\n"); - goto test_gcm_vectors_exit; - } - } - - T_test = malloc(vector->tagSize / 8); - if (T_test == NULL) { - fprintf(stderr, "Can't allocate tag memory\n"); + /* Allocate space for the calculated ciphertext */ + ct_test = malloc(vector->msgSize / 8); + if (ct_test == NULL) { + fprintf(stderr, "Can't allocate ciphertext memory\n"); + goto test_gcm_vectors_exit; + } + /* Allocate space for the calculated plaintext */ + pt_test = malloc(vector->msgSize / 8); + if (pt_test == NULL) { + fprintf(stderr, "Can't allocate plaintext memory\n"); + goto test_gcm_vectors_exit; + } + } + + T_test = malloc(vector->tagSize / 8); + if (T_test == NULL) { + fprintf(stderr, "Can't allocate tag memory\n"); goto test_gcm_vectors_exit; - } + } memset(T_test, 0, vector->tagSize / 8); - T2_test = malloc(vector->tagSize / 8); - if (T2_test == NULL) { - fprintf(stderr, "Can't allocate tag(2) memory\n"); + T2_test = malloc(vector->tagSize / 8); + if (T2_test == NULL) { + fprintf(stderr, "Can't allocate tag(2) memory\n"); goto test_gcm_vectors_exit; - } + } memset(T2_test, 0, vector->tagSize / 8); - /* This is only required once for a given key */ + /* This is only required once for a given key */ switch (vector->keySize / 8) { case IMB_KEY_128_BYTES: IMB_AES128_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); @@ -953,28 +776,26 @@ test_gcm_vectors(struct aead_test const *vector, break; } - /* + /* * Encrypt */ - is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, - (const void *) vector->msg, vector->msgSize / 8, - iv, iv_len, (const void *) vector->aad, vector->aadSize / 8, - T_test, vector->tagSize / 8, vector->keySize / 8); - is_error |= check_data(ct_test, (const void *) vector->ct, vector->msgSize / 8, - "encrypted cipher text (C)"); + is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, (const void *) vector->msg, + vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, + vector->aadSize / 8, T_test, vector->tagSize / 8, vector->keySize / 8); + is_error |= check_data(ct_test, (const void *) vector->ct, vector->msgSize / 8, + "encrypted cipher text (C)"); is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, "tag (T)"); if (is_error) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); - /* test of in-place encrypt */ + /* test of in-place encrypt */ memory_copy(pt_test, (const void *) vector->msg, vector->msgSize / 8); - is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, pt_test, - vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, - vector->aadSize / 8, T_test, vector->tagSize / 8, - vector->keySize / 8); - is_error |= check_data(pt_test, (const void *) vector->ct, vector->msgSize / 8, + is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, pt_test, vector->msgSize / 8, + iv, iv_len, (const void *) vector->aad, vector->aadSize / 8, T_test, + vector->tagSize / 8, vector->keySize / 8); + is_error |= check_data(pt_test, (const void *) vector->ct, vector->msgSize / 8, "encrypted cipher text(in-place)"); if (is_error) test_suite_update(ts, 0, 1); @@ -982,87 +803,80 @@ test_gcm_vectors(struct aead_test const *vector, test_suite_update(ts, 1, 0); memory_set(ct_test, 0, vector->msgSize / 8); - memory_set(T_test, 0, vector->tagSize / 8); + memory_set(T_test, 0, vector->tagSize / 8); - /* + /* * Decrypt */ - is_error = decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, (const void *) vector->ct, + is_error = decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, (const void *) vector->ct, vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, - vector->aadSize / 8, T_test, vector->tagSize / 8, - vector->keySize / 8); - is_error |= check_data(pt_test, (const void *) vector->msg, vector->msgSize / 8, + vector->aadSize / 8, T_test, vector->tagSize / 8, vector->keySize / 8); + is_error |= check_data(pt_test, (const void *) vector->msg, vector->msgSize / 8, "decrypted plain text (P)"); - /* + /* * GCM decryption outputs a 16 byte tag value * that must be verified against the expected tag value */ - is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, + is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, "decrypted tag (T)"); if (is_error) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); - /* test in in-place decrypt */ + /* test in in-place decrypt */ memory_copy(ct_test, (const void *) vector->ct, vector->msgSize / 8); - is_error = decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, ct_test, - vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, - vector->aadSize / 8, T_test, vector->tagSize / 8, - vector->keySize / 8); - is_error |= check_data(ct_test, (const void *) vector->msg, vector->msgSize / 8, + is_error = decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, ct_test, vector->msgSize / 8, + iv, iv_len, (const void *) vector->aad, vector->aadSize / 8, T_test, + vector->tagSize / 8, vector->keySize / 8); + is_error |= check_data(ct_test, (const void *) vector->msg, vector->msgSize / 8, "plain text (P) - in-place"); - is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, + is_error |= check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, "decrypted tag (T) - in-place"); if (is_error) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); - /* enc -> dec */ - is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, (const void *) vector->msg, + /* enc -> dec */ + is_error = encfn(p_gcm_mgr, &gdata_key, &gdata_ctx, ct_test, (const void *) vector->msg, vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, - vector->aadSize / 8, T_test, vector->tagSize / 8, - vector->keySize / 8); + vector->aadSize / 8, T_test, vector->tagSize / 8, vector->keySize / 8); memory_set(pt_test, 0, vector->msgSize / 8); - is_error |= decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, ct_test, - vector->msgSize / 8, iv, iv_len, (const void *) vector->aad, - vector->aadSize / 8, T2_test, vector->tagSize / 8, vector->keySize / 8); - is_error |= check_data(pt_test, (const void *) vector->msg, vector->msgSize / 8, + is_error |= decfn(p_gcm_mgr, &gdata_key, &gdata_ctx, pt_test, ct_test, vector->msgSize / 8, + iv, iv_len, (const void *) vector->aad, vector->aadSize / 8, T2_test, + vector->tagSize / 8, vector->keySize / 8); + is_error |= check_data(pt_test, (const void *) vector->msg, vector->msgSize / 8, "self decrypted plain text (P)"); - is_error |= check_data(T_test, T2_test, vector->tagSize / 8, - "self decrypted tag (T)"); + is_error |= check_data(T_test, T2_test, vector->tagSize / 8, "self decrypted tag (T)"); if (is_error) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); - test_gcm_vectors_exit: - if (NULL != ct_test) - free(ct_test); - if (NULL != pt_test) - free(pt_test); - if (NULL != T_test) - free(T_test); - if (NULL != T2_test) - free(T2_test); +test_gcm_vectors_exit: + if (NULL != ct_test) + free(ct_test); + if (NULL != pt_test) + free(pt_test); + if (NULL != T_test) + free(T_test); + if (NULL != T2_test) + free(T2_test); } - static void -test_gcm_vectors_burst(struct aead_test const *vector, - gcm_enc_dec_many_fn_t encfn, - gcm_enc_dec_many_fn_t decfn, - struct test_suite_context *ts) +test_gcm_vectors_burst(struct aead_test const *vector, gcm_enc_dec_many_fn_t encfn, + gcm_enc_dec_many_fn_t decfn, struct test_suite_context *ts) { - struct gcm_key_data gdata_key; - int is_error = 0; - /* Temporary array for the calculated vectors */ + struct gcm_key_data gdata_key; + int is_error = 0; + /* Temporary array for the calculated vectors */ struct gcm_context_data **gdata_ctx = NULL; - uint8_t **ct_test = NULL; - uint8_t **pt_test = NULL; - uint8_t **T_test = NULL; + uint8_t **ct_test = NULL; + uint8_t **pt_test = NULL; + uint8_t **T_test = NULL; const uint8_t *iv = (const void *) vector->iv; const uint64_t iv_len = vector->ivSize / 8; uint32_t i, j; @@ -1093,11 +907,11 @@ test_gcm_vectors_burst(struct aead_test const *vector, memset(gdata_ctx, 0, num_jobs * sizeof(void *)); /* Allocate space for the calculated tag */ - T_test = malloc(num_jobs * sizeof(void *)); - if (T_test == NULL) { - fprintf(stderr, "Can't allocate tag memory\n"); + T_test = malloc(num_jobs * sizeof(void *)); + if (T_test == NULL) { + fprintf(stderr, "Can't allocate tag memory\n"); goto test_gcm_vectors_burst_exit; - } + } memset(T_test, 0, num_jobs * sizeof(void *)); /* Zero buffers */ @@ -1125,7 +939,7 @@ test_gcm_vectors_burst(struct aead_test const *vector, memset(T_test[i], 0, vector->tagSize / 8); } - /* This is only required once for a given key */ + /* This is only required once for a given key */ switch (vector->keySize / 8) { case IMB_KEY_128_BYTES: IMB_AES128_GCM_PRE(p_gcm_mgr, vector->key, &gdata_key); @@ -1144,16 +958,15 @@ test_gcm_vectors_burst(struct aead_test const *vector, /* * Encrypt */ - is_error = encfn(p_gcm_mgr, &gdata_key, gdata_ctx, - ct_test, (const void *) vector->msg, vector->msgSize / 8, - iv, iv_len, (const void *) vector->aad, - vector->aadSize / 8, T_test, vector->tagSize / 8, - vector->keySize / 8, i + 1); + is_error = encfn(p_gcm_mgr, &gdata_key, gdata_ctx, ct_test, + (const void *) vector->msg, vector->msgSize / 8, iv, iv_len, + (const void *) vector->aad, vector->aadSize / 8, T_test, + vector->tagSize / 8, vector->keySize / 8, i + 1); for (j = 0; j <= i; j++) { - is_error |= check_data(ct_test[j], (const void *) vector->ct, - vector->msgSize / 8, - "encrypted cipher text (burst)"); + is_error |= + check_data(ct_test[j], (const void *) vector->ct, + vector->msgSize / 8, "encrypted cipher text (burst)"); is_error |= check_data(T_test[j], (const void *) vector->tag, vector->tagSize / 8, "tag (burst)"); } @@ -1171,8 +984,7 @@ test_gcm_vectors_burst(struct aead_test const *vector, for (j = 0; j <= i; j++) { is_error |= check_data(pt_test[j], (const void *) vector->msg, - vector->msgSize / 8, - "decrypted plain text (burst)"); + vector->msgSize / 8, "decrypted plain text (burst)"); /* * GCM decryption outputs a 16 byte tag value * that must be verified against the expected tag value @@ -1186,13 +998,13 @@ test_gcm_vectors_burst(struct aead_test const *vector, test_suite_update(ts, 1, 0); } - test_gcm_vectors_burst_exit: +test_gcm_vectors_burst_exit: if (NULL != ct_test) { for (i = 0; i < num_jobs; i++) free(ct_test[i]); - free(ct_test); + free(ct_test); } - if (NULL != pt_test) { + if (NULL != pt_test) { for (i = 0; i < num_jobs; i++) free(pt_test[i]); free(pt_test); @@ -1202,30 +1014,27 @@ test_gcm_vectors_burst(struct aead_test const *vector, free(gdata_ctx[i]); free(gdata_ctx); } - if (NULL != T_test) { + if (NULL != T_test) { for (i = 0; i < num_jobs; i++) free(T_test[i]); - free(T_test); + free(T_test); } } static void -test_gcm_std_vectors(struct test_suite_context *ts128, - struct test_suite_context *ts192, - struct test_suite_context *ts256, - const struct aead_test *v, +test_gcm_std_vectors(struct test_suite_context *ts128, struct test_suite_context *ts192, + struct test_suite_context *ts256, const struct aead_test *v, const int test_sgl_api) { - printf("AES-GCM (%s API) standard test vectors:\n", - test_sgl_api ? "SGL" : "Direct/JOB"); - for (; v->msg != NULL; v++) { + printf("AES-GCM (%s API) standard test vectors:\n", test_sgl_api ? "SGL" : "Direct/JOB"); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("Standard vector %zu Keylen:%zu IVlen:%zu " "PTLen:%zu AADlen:%zu Tlen:%zu\n", - v->tcId, v->keySize / 8, v->ivSize / 8, - v->msgSize / 8, v->aadSize / 8, v->tagSize / 8); + v->tcId, v->keySize / 8, v->ivSize / 8, v->msgSize / 8, + v->aadSize / 8, v->tagSize / 8); #else printf("."); #endif @@ -1258,10 +1067,9 @@ test_gcm_std_vectors(struct test_suite_context *ts128, burst_sgl_aes_gcm_dec, ts192); } else { test_gcm_vectors(v, aes_gcm_enc, aes_gcm_dec, ts192); - test_gcm_vectors(v, job_aes_gcm_enc, job_aes_gcm_dec, - ts192); - test_gcm_vectors_burst(v, burst_aes_gcm_enc, - burst_aes_gcm_dec, ts192); + test_gcm_vectors(v, job_aes_gcm_enc, job_aes_gcm_dec, ts192); + test_gcm_vectors_burst(v, burst_aes_gcm_enc, burst_aes_gcm_dec, + ts192); /* AES-192 is not supported by QUIC */ } break; @@ -1279,25 +1087,22 @@ test_gcm_std_vectors(struct test_suite_context *ts128, test_gcm_vectors_burst(v, burst_aes_gcm_enc, burst_aes_gcm_dec, ts256); test_gcm_vectors(v, quic_aes_gcm_enc, quic_aes_gcm_dec, ts256); - test_gcm_vectors_burst(v, burst_quic_gcm_enc, - burst_quic_gcm_dec, ts256); + test_gcm_vectors_burst(v, burst_quic_gcm_enc, burst_quic_gcm_dec, + ts256); } break; default: printf("ERROR: wrong key size error in the table\n"); return; - } - } + } + } if (!quiet_mode) printf("\n"); } static void -test_single_job_sgl(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const uint32_t key_sz, - const uint32_t buffer_sz, - const uint32_t seg_sz, +test_single_job_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t key_sz, + const uint32_t buffer_sz, const uint32_t seg_sz, const IMB_CIPHER_DIRECTION cipher_dir) { uint8_t *in_buffer = NULL; @@ -1382,34 +1187,35 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, sgl_segs[i].len = last_seg_sz; /* Process linear (single segment) buffer */ - if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, - in_buffer, in_buffer, buffer_sz, iv, IV_SZ, aad, AAD_SZ, - linear_digest, DIGEST_SZ, &gcm_ctx, IMB_CIPHER_GCM, 0) < 0) { + if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, in_buffer, in_buffer, buffer_sz, iv, + IV_SZ, aad, AAD_SZ, linear_digest, DIGEST_SZ, &gcm_ctx, IMB_CIPHER_GCM, + 0) < 0) { test_suite_update(ctx, 0, 1); goto exit; } else test_suite_update(ctx, 1, 0); /* Process multi-segment buffer */ - aes_gcm_single_job_sgl(mb_mgr, cipher_dir, &key, key_sz, sgl_segs, num_segments, - iv, IV_SZ, aad, AAD_SZ, sgl_digest, DIGEST_SZ, &gcm_ctx); + aes_gcm_single_job_sgl(mb_mgr, cipher_dir, &key, key_sz, sgl_segs, num_segments, iv, IV_SZ, + aad, AAD_SZ, sgl_digest, DIGEST_SZ, &gcm_ctx); for (i = 0; i < (num_segments - 1); i++) { - if (memcmp(in_buffer + i*seg_sz, segments[i], seg_sz) != 0) { + if (memcmp(in_buffer + i * seg_sz, segments[i], seg_sz) != 0) { printf("ciphertext mismatched in segment number %u " - "(segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Expected output", in_buffer + i*seg_sz, seg_sz); + "(segment size = %u)\n", + i, seg_sz); + hexdump(stderr, "Expected output", in_buffer + i * seg_sz, seg_sz); hexdump(stderr, "SGL output", segments[i], seg_sz); test_suite_update(ctx, 0, 1); goto exit; } } /* Check last segment */ - if (memcmp(in_buffer + i*seg_sz, segments[i], - last_seg_sz) != 0) { + if (memcmp(in_buffer + i * seg_sz, segments[i], last_seg_sz) != 0) { printf("ciphertext mismatched " - "in segment number %u (segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Expected output", in_buffer + i*seg_sz, last_seg_sz); + "in segment number %u (segment size = %u)\n", + i, seg_sz); + hexdump(stderr, "Expected output", in_buffer + i * seg_sz, last_seg_sz); hexdump(stderr, "SGL output", segments[i], last_seg_sz); test_suite_update(ctx, 0, 1); } @@ -1433,12 +1239,8 @@ exit: } static void -test_sgl(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const uint32_t key_sz, - const uint32_t buffer_sz, - const uint32_t seg_sz, - const IMB_CIPHER_DIRECTION cipher_dir, +test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t key_sz, + const uint32_t buffer_sz, const uint32_t seg_sz, const IMB_CIPHER_DIRECTION cipher_dir, const unsigned job_api) { uint8_t *in_buffer = NULL; @@ -1487,8 +1289,7 @@ test_sgl(struct IMB_MGR *mb_mgr, segments = malloc(num_segments * sizeof(*segments)); if (segments == NULL) { - fprintf(stderr, - "Could not allocate memory for segments array\n"); + fprintf(stderr, "Could not allocate memory for segments array\n"); test_suite_update(ctx, 0, 1); goto exit; } @@ -1496,8 +1297,7 @@ test_sgl(struct IMB_MGR *mb_mgr, segment_sizes = malloc(num_segments * sizeof(*segment_sizes)); if (segment_sizes == NULL) { - fprintf(stderr, - "Could not allocate memory for array of sizes\n"); + fprintf(stderr, "Could not allocate memory for array of sizes\n"); test_suite_update(ctx, 0, 1); goto exit; } @@ -1505,8 +1305,7 @@ test_sgl(struct IMB_MGR *mb_mgr, for (i = 0; i < (num_segments - 1); i++) { segments[i] = malloc(seg_sz); if (segments[i] == NULL) { - fprintf(stderr, - "Could not allocate memory for segment %u\n", i); + fprintf(stderr, "Could not allocate memory for segment %u\n", i); test_suite_update(ctx, 0, 1); goto exit; } @@ -1523,10 +1322,9 @@ test_sgl(struct IMB_MGR *mb_mgr, segment_sizes[i] = last_seg_sz; /* Process linear (single segment) buffer */ - if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, - in_buffer, in_buffer, buffer_sz, iv, IV_SZ, aad, AAD_SZ, - linear_digest, DIGEST_SZ, - &gcm_ctx, IMB_CIPHER_GCM, 0) < 0) { + if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, in_buffer, in_buffer, buffer_sz, iv, + IV_SZ, aad, AAD_SZ, linear_digest, DIGEST_SZ, &gcm_ctx, IMB_CIPHER_GCM, + 0) < 0) { test_suite_update(ctx, 0, 1); goto exit; } else @@ -1534,11 +1332,8 @@ test_sgl(struct IMB_MGR *mb_mgr, /* Process multi-segment buffer */ if (job_api) { - if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, - NULL, NULL, 0, iv, IV_SZ, - aad, AAD_SZ, NULL, 0, - &gcm_ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_INIT) < 0) { + if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, NULL, NULL, 0, iv, IV_SZ, aad, + AAD_SZ, NULL, 0, &gcm_ctx, IMB_CIPHER_GCM_SGL, IMB_SGL_INIT) < 0) { test_suite_update(ctx, 0, 1); goto exit; } else @@ -1558,62 +1353,59 @@ test_sgl(struct IMB_MGR *mb_mgr, } #if VERBOSE != 0 printf("gcm-sgl: job-api=%c, segment=%u, #segments=%u, " - "size=%u bytes\n", job_api ? 'y' : 'n', i, - num_segments, (unsigned) seg_size); + "size=%u bytes\n", + job_api ? 'y' : 'n', i, num_segments, (unsigned) seg_size); #endif if (job_api) { - if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, - seg_ptr, seg_ptr, seg_size, - iv, IV_SZ, NULL, 0, NULL, 0, - &gcm_ctx, IMB_CIPHER_GCM_SGL, - IMB_SGL_UPDATE) < 0) { + if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, seg_ptr, seg_ptr, + seg_size, iv, IV_SZ, NULL, 0, NULL, 0, &gcm_ctx, + IMB_CIPHER_GCM_SGL, IMB_SGL_UPDATE) < 0) { test_suite_update(ctx, 0, 1); goto exit; } } else { if (cipher_dir == IMB_DIR_ENCRYPT) { - imb_aes_gcm_enc_update(mb_mgr, &key, &gcm_ctx, seg_ptr, - seg_ptr, seg_size, key_sz); + imb_aes_gcm_enc_update(mb_mgr, &key, &gcm_ctx, seg_ptr, seg_ptr, + seg_size, key_sz); } else { - imb_aes_gcm_dec_update(mb_mgr, &key, &gcm_ctx, seg_ptr, - seg_ptr, seg_size, key_sz); + imb_aes_gcm_dec_update(mb_mgr, &key, &gcm_ctx, seg_ptr, seg_ptr, + seg_size, key_sz); } } } if (job_api) { - if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, NULL, NULL, 0, - iv, IV_SZ, NULL, 0, sgl_digest, DIGEST_SZ, &gcm_ctx, - IMB_CIPHER_GCM_SGL, IMB_SGL_COMPLETE) < 0) { + if (aes_gcm_job(mb_mgr, cipher_dir, &key, key_sz, NULL, NULL, 0, iv, IV_SZ, NULL, 0, + sgl_digest, DIGEST_SZ, &gcm_ctx, IMB_CIPHER_GCM_SGL, + IMB_SGL_COMPLETE) < 0) { test_suite_update(ctx, 0, 1); goto exit; } } else { if (cipher_dir == IMB_DIR_ENCRYPT) - imb_aes_gcm_enc_finalize(mb_mgr, &key, &gcm_ctx, sgl_digest, - DIGEST_SZ, key_sz); + imb_aes_gcm_enc_finalize(mb_mgr, &key, &gcm_ctx, sgl_digest, DIGEST_SZ, + key_sz); else - imb_aes_gcm_dec_finalize(mb_mgr, &key, &gcm_ctx, sgl_digest, - DIGEST_SZ, key_sz); + imb_aes_gcm_dec_finalize(mb_mgr, &key, &gcm_ctx, sgl_digest, DIGEST_SZ, + key_sz); } for (i = 0; i < (num_segments - 1); i++) { - if (memcmp(in_buffer + i*seg_sz, segments[i], - seg_sz) != 0) { + if (memcmp(in_buffer + i * seg_sz, segments[i], seg_sz) != 0) { printf("ciphertext mismatched in segment number %u " - "(segment size = %u)\n", i, seg_sz); - hexdump(stderr, "Expected output", in_buffer + i*seg_sz, seg_sz); + "(segment size = %u)\n", + i, seg_sz); + hexdump(stderr, "Expected output", in_buffer + i * seg_sz, seg_sz); hexdump(stderr, "SGL output", segments[i], seg_sz); test_suite_update(ctx, 0, 1); goto exit; } } /* Check last segment */ - if (memcmp(in_buffer + i*seg_sz, segments[i], - last_seg_sz) != 0) { - printf("ciphertext mismatched in segment number %u (segment size = %u)\n", - i, seg_sz); - hexdump(stderr, "Expected output", in_buffer + i*seg_sz, last_seg_sz); + if (memcmp(in_buffer + i * seg_sz, segments[i], last_seg_sz) != 0) { + printf("ciphertext mismatched in segment number %u (segment size = %u)\n", i, + seg_sz); + hexdump(stderr, "Expected output", in_buffer + i * seg_sz, last_seg_sz); hexdump(stderr, "SGL output", segments[i], last_seg_sz); test_suite_update(ctx, 0, 1); } @@ -1636,7 +1428,8 @@ exit: free(segment_sizes); } -int gcm_test(IMB_MGR *p_mgr) +int +gcm_test(IMB_MGR *p_mgr) { struct test_suite_context ts128, ts192, ts256; struct test_suite_context *ctx; @@ -1644,14 +1437,14 @@ int gcm_test(IMB_MGR *p_mgr) const uint32_t buf_sz = 2032; const uint32_t seg_sz_step = 4; const uint32_t max_seg_sz = 2048; - int errors = 0; + int errors = 0; p_gcm_mgr = p_mgr; test_suite_start(&ts128, "AES-GCM-128"); test_suite_start(&ts192, "AES-GCM-192"); test_suite_start(&ts256, "AES-GCM-256"); - test_gcm_std_vectors(&ts128, &ts192, &ts256, gcm_test_json, 0); + test_gcm_std_vectors(&ts128, &ts192, &ts256, gcm_test_json, 0); errors = test_suite_end(&ts128); errors += test_suite_end(&ts192); errors += test_suite_end(&ts256); @@ -1659,10 +1452,9 @@ int gcm_test(IMB_MGR *p_mgr) test_suite_start(&ts128, "SGL-GCM-128"); test_suite_start(&ts192, "SGL-GCM-192"); test_suite_start(&ts256, "SGL-GCM-256"); - test_gcm_std_vectors(&ts128, &ts192, &ts256, gcm_test_json, 1); + test_gcm_std_vectors(&ts128, &ts192, &ts256, gcm_test_json, 1); /* SGL test comparing linear buffer with segmented buffers */ - for (key_sz = IMB_KEY_128_BYTES; key_sz <= IMB_KEY_256_BYTES; - key_sz += 16) { + for (key_sz = IMB_KEY_128_BYTES; key_sz <= IMB_KEY_256_BYTES; key_sz += 16) { if (key_sz == IMB_KEY_128_BYTES) ctx = &ts128; else if (key_sz == IMB_KEY_192_BYTES) @@ -1672,23 +1464,16 @@ int gcm_test(IMB_MGR *p_mgr) uint32_t seg_sz; - for (seg_sz = seg_sz_step; seg_sz <= max_seg_sz; - seg_sz += seg_sz_step) { + for (seg_sz = seg_sz_step; seg_sz <= max_seg_sz; seg_sz += seg_sz_step) { /* Job API */ - test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, - IMB_DIR_ENCRYPT, 1); - test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, - IMB_DIR_DECRYPT, 1); + test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, IMB_DIR_ENCRYPT, 1); + test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, IMB_DIR_DECRYPT, 1); /* Single job SGL API */ - test_single_job_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, - IMB_DIR_ENCRYPT); - test_single_job_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, - IMB_DIR_DECRYPT); + test_single_job_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, IMB_DIR_ENCRYPT); + test_single_job_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, IMB_DIR_DECRYPT); /* Direct API */ - test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, - IMB_DIR_ENCRYPT, 0); - test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, - IMB_DIR_DECRYPT, 0); + test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, IMB_DIR_ENCRYPT, 0); + test_sgl(p_mgr, ctx, key_sz, buf_sz, seg_sz, IMB_DIR_DECRYPT, 0); } } @@ -1696,5 +1481,5 @@ int gcm_test(IMB_MGR *p_mgr) errors += test_suite_end(&ts192); errors += test_suite_end(&ts256); - return errors; + return errors; } diff --git a/test/kat-app/gcm_test.json.c b/test/kat-app/gcm_test.json.c index cb385924..4c3c3557 100644 --- a/test/kat-app/gcm_test.json.c +++ b/test/kat-app/gcm_test.json.c @@ -27,7 +27,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **********************************************************************/ - /* AES-GCM */ #include "aead_test.h" const struct aead_test gcm_test_json[] = { @@ -35,325 +34,287 @@ const struct aead_test gcm_test_json[] = { http://www.ieee802.org/1/files/public/docs2011/ bn-randall-test-vectors-0511-v1.pdf */ - {96, 128, 128, 1, - "\xad\x7a\x2b\xd0\x3e\xac\x83\x5a\x6f\x62\x0f\xdc\xb5\x06\xb3\x45", - "\x12\x15\x35\x24\xc0\x89\x5e\x81\xb2\xc2\x84\x65", - "\xd6\x09\xb1\xf0\x56\x63\x7a\x0d\x46\xdf\x99\x8d\x88\xe5\x2e\x00\xb2\xc2" - "\x84\x65\x12\x15\x35\x24\xc0\x89\x5e\x81", - "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" - "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" - "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x00\x02", - "\x70\x1a\xfa\x1c\xc0\x39\xc0\xd7\x65\x12\x8a\x66\x5d\xab\x69\x24\x38\x99" - "\xbf\x73\x18\xcc\xdc\x81\xc9\x93\x1d\xa1\x7f\xbe\x8e\xdd\x7d\x17\xcb\x8b" - "\x4c\x26\xfc\x81\xe3\x28\x4f\x2b\x7f\xba\x71\x3d", - "\x4f\x8d\x55\xe7\xd3\xf0\x6f\xd5\xa1\x3c\x0c\x29\xb9\xd5\xb8\x80", 1, 224, - 384}, - {96, 128, 128, 2, - "\x07\x1b\x11\x3b\x0c\xa7\x43\xfe\xcc\xcf\x3d\x05\x1f\x73\x73\x82", - "\xf0\x76\x1e\x8d\xcd\x3d\x00\x01\x76\xd4\x57\xed", - "\xe2\x01\x06\xd7\xcd\x0d\xf0\x76\x1e\x8d\xcd\x3d\x88\xe5\x4c\x2a\x76\xd4" - "\x57\xed", - "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" - "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" - "\x31\x32\x33\x34\x00\x04", - "\x13\xb4\xc7\x2b\x38\x9d\xc5\x01\x8e\x72\xa1\x71\xdd\x85\xa5\xd3\x75\x22" - "\x74\xd3\xa0\x19\xfb\xca\xed\x09\xa4\x25\xcd\x9b\x2e\x1c\x9b\x72\xee\xe7" - "\xc9\xde\x7d\x52\xb3\xf3", - "\xd6\xa5\x28\x4f\x4a\x6d\x3f\xe2\x2a\x5d\x6c\x2b\x96\x04\x94\xc3", 1, 160, - 336}, + { 96, 128, 128, 1, "\xad\x7a\x2b\xd0\x3e\xac\x83\x5a\x6f\x62\x0f\xdc\xb5\x06\xb3\x45", + "\x12\x15\x35\x24\xc0\x89\x5e\x81\xb2\xc2\x84\x65", + "\xd6\x09\xb1\xf0\x56\x63\x7a\x0d\x46\xdf\x99\x8d\x88\xe5\x2e\x00\xb2\xc2" + "\x84\x65\x12\x15\x35\x24\xc0\x89\x5e\x81", + "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" + "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" + "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x00\x02", + "\x70\x1a\xfa\x1c\xc0\x39\xc0\xd7\x65\x12\x8a\x66\x5d\xab\x69\x24\x38\x99" + "\xbf\x73\x18\xcc\xdc\x81\xc9\x93\x1d\xa1\x7f\xbe\x8e\xdd\x7d\x17\xcb\x8b" + "\x4c\x26\xfc\x81\xe3\x28\x4f\x2b\x7f\xba\x71\x3d", + "\x4f\x8d\x55\xe7\xd3\xf0\x6f\xd5\xa1\x3c\x0c\x29\xb9\xd5\xb8\x80", 1, 224, 384 }, + { 96, 128, 128, 2, "\x07\x1b\x11\x3b\x0c\xa7\x43\xfe\xcc\xcf\x3d\x05\x1f\x73\x73\x82", + "\xf0\x76\x1e\x8d\xcd\x3d\x00\x01\x76\xd4\x57\xed", + "\xe2\x01\x06\xd7\xcd\x0d\xf0\x76\x1e\x8d\xcd\x3d\x88\xe5\x4c\x2a\x76\xd4" + "\x57\xed", + "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" + "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" + "\x31\x32\x33\x34\x00\x04", + "\x13\xb4\xc7\x2b\x38\x9d\xc5\x01\x8e\x72\xa1\x71\xdd\x85\xa5\xd3\x75\x22" + "\x74\xd3\xa0\x19\xfb\xca\xed\x09\xa4\x25\xcd\x9b\x2e\x1c\x9b\x72\xee\xe7" + "\xc9\xde\x7d\x52\xb3\xf3", + "\xd6\xa5\x28\x4f\x4a\x6d\x3f\xe2\x2a\x5d\x6c\x2b\x96\x04\x94\xc3", 1, 160, 336 }, /* Vectors from http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip gcmEncryptExtIV128.rsp */ - {96, 128, 128, 3, - "\xc9\x39\xcc\x13\x39\x7c\x1d\x37\xde\x6a\xe0\xe1\xcb\x7c\x42\x3c", - "\xb3\xd8\xcc\x01\x7c\xbb\x89\xb3\x9e\x0f\x67\xe2", - "\x24\x82\x56\x02\xbd\x12\xa9\x84\xe0\x09\x2d\x3e\x44\x8e\xda\x5f", - "\xc3\xb3\xc4\x1f\x11\x3a\x31\xb7\x3d\x9a\x5c\xd4\x32\x10\x30\x69", - "\x93\xfe\x7d\x9e\x9b\xfd\x10\x34\x8a\x56\x06\xe5\xca\xfa\x73\x54", - "\x00\x32\xa1\xdc\x85\xf1\xc9\x78\x69\x25\xa2\xe7\x1d\x82\x72\xdd", 1, 128, - 128}, - {96, 128, 128, 4, - "\x29\x8e\xfa\x1c\xcf\x29\xcf\x62\xae\x68\x24\xbf\xc1\x95\x57\xfc", - "\x6f\x58\xa9\x3f\xe1\xd2\x07\xfa\xe4\xed\x2f\x6d", - "\x02\x1f\xaf\xd2\x38\x46\x39\x73\xff\xe8\x02\x56\xe5\xb1\xc6\xb1", - "\xcc\x38\xbc\xcd\x6b\xc5\x36\xad\x91\x9b\x13\x95\xf5\xd6\x38\x01\xf9\x9f" - "\x80\x68\xd6\x5c\xa5\xac\x63\x87\x2d\xaf\x16\xb9\x39\x01", - "\xdf\xce\x4e\x9c\xd2\x91\x10\x3d\x7f\xe4\xe6\x33\x51\xd9\xe7\x9d\x3d\xfd" - "\x39\x1e\x32\x67\x10\x46\x58\x21\x2d\xa9\x65\x21\xb7\xdb", - "\x54\x24\x65\xef\x59\x93\x16\xf7\x3a\x7a\x56\x05\x09\xa2\xd9\xf2", 1, 128, - 256}, - {96, 128, 128, 5, - "\x29\x8e\xfa\x1c\xcf\x29\xcf\x62\xae\x68\x24\xbf\xc1\x95\x57\xfc", - "\x6f\x58\xa9\x3f\xe1\xd2\x07\xfa\xe4\xed\x2f\x6d", - "\x02\x1f\xaf\xd2\x38\x46\x39\x73\xff\xe8\x02\x56\xe5\xb1\xc6\xb1", - "\xcc\x38\xbc\xcd\x6b\xc5\x36\xad\x91\x9b\x13\x95\xf5\xd6\x38\x01\xf9\x9f" - "\x80\x68\xd6\x5c\xa5\xac\x63\x87\x2d\xaf\x16\xb9\x39\x01", - "\xdf\xce\x4e\x9c\xd2\x91\x10\x3d\x7f\xe4\xe6\x33\x51\xd9\xe7\x9d\x3d\xfd" - "\x39\x1e\x32\x67\x10\x46\x58\x21\x2d\xa9\x65\x21\xb7\xdb", - "\x54\x24\x65\xef\x59\x93\x16\xf7\x3a\x7a\x56\x05\x09\xa2\xd9\xf2", 1, 128, - 256}, + { 96, 128, 128, 3, "\xc9\x39\xcc\x13\x39\x7c\x1d\x37\xde\x6a\xe0\xe1\xcb\x7c\x42\x3c", + "\xb3\xd8\xcc\x01\x7c\xbb\x89\xb3\x9e\x0f\x67\xe2", + "\x24\x82\x56\x02\xbd\x12\xa9\x84\xe0\x09\x2d\x3e\x44\x8e\xda\x5f", + "\xc3\xb3\xc4\x1f\x11\x3a\x31\xb7\x3d\x9a\x5c\xd4\x32\x10\x30\x69", + "\x93\xfe\x7d\x9e\x9b\xfd\x10\x34\x8a\x56\x06\xe5\xca\xfa\x73\x54", + "\x00\x32\xa1\xdc\x85\xf1\xc9\x78\x69\x25\xa2\xe7\x1d\x82\x72\xdd", 1, 128, 128 }, + { 96, 128, 128, 4, "\x29\x8e\xfa\x1c\xcf\x29\xcf\x62\xae\x68\x24\xbf\xc1\x95\x57\xfc", + "\x6f\x58\xa9\x3f\xe1\xd2\x07\xfa\xe4\xed\x2f\x6d", + "\x02\x1f\xaf\xd2\x38\x46\x39\x73\xff\xe8\x02\x56\xe5\xb1\xc6\xb1", + "\xcc\x38\xbc\xcd\x6b\xc5\x36\xad\x91\x9b\x13\x95\xf5\xd6\x38\x01\xf9\x9f" + "\x80\x68\xd6\x5c\xa5\xac\x63\x87\x2d\xaf\x16\xb9\x39\x01", + "\xdf\xce\x4e\x9c\xd2\x91\x10\x3d\x7f\xe4\xe6\x33\x51\xd9\xe7\x9d\x3d\xfd" + "\x39\x1e\x32\x67\x10\x46\x58\x21\x2d\xa9\x65\x21\xb7\xdb", + "\x54\x24\x65\xef\x59\x93\x16\xf7\x3a\x7a\x56\x05\x09\xa2\xd9\xf2", 1, 128, 256 }, + { 96, 128, 128, 5, "\x29\x8e\xfa\x1c\xcf\x29\xcf\x62\xae\x68\x24\xbf\xc1\x95\x57\xfc", + "\x6f\x58\xa9\x3f\xe1\xd2\x07\xfa\xe4\xed\x2f\x6d", + "\x02\x1f\xaf\xd2\x38\x46\x39\x73\xff\xe8\x02\x56\xe5\xb1\xc6\xb1", + "\xcc\x38\xbc\xcd\x6b\xc5\x36\xad\x91\x9b\x13\x95\xf5\xd6\x38\x01\xf9\x9f" + "\x80\x68\xd6\x5c\xa5\xac\x63\x87\x2d\xaf\x16\xb9\x39\x01", + "\xdf\xce\x4e\x9c\xd2\x91\x10\x3d\x7f\xe4\xe6\x33\x51\xd9\xe7\x9d\x3d\xfd" + "\x39\x1e\x32\x67\x10\x46\x58\x21\x2d\xa9\x65\x21\xb7\xdb", + "\x54\x24\x65\xef\x59\x93\x16\xf7\x3a\x7a\x56\x05\x09\xa2\xd9\xf2", 1, 128, 256 }, /* Vectors from http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf */ - {96, 128, 128, 6, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x03\x88\xda\xce\x60\xb6\xa3\x92\xf3\x28\xc2\xb9\x71\xb2\xfe\x78", - "\xab\x6e\x47\xd4\x2c\xec\x13\xbd\xf5\x3a\x67\xb2\x12\x57\xbd\xdf", 1, 0, - 128}, - {96, 128, 128, 7, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", "\x00", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55", - "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa" - "\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2" - "\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a" - "\xac\x97\x3d\x58\xe0\x91\x47\x3f\x59\x85", - "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4", 1, 0, - 512}, - {96, 128, 128, 8, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa" - "\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2" - "\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a" - "\xac\x97\x3d\x58\xe0\x91\x47\x3f\x59\x85", - "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb\x94\xfa\xe9\x5a\xe7\x12\x1a\x47", 1, 160, - 480}, - {96, 256, 128, 9, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xce\xa7\x40\x3d\x4d\x60\x6b\x6e\x07\x4e\xc5\xd3\xba\xf3\x9d\x18", - "\xd0\xd1\xc8\xa7\x99\x99\x6b\xf0\x26\x5b\x98\xb5\xd4\x8a\xb9\x19", 1, 0, - 128}, - {96, 256, 128, 10, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", "\x00", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55", - "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" - "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" - "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" - "\x7a\x0a\xbc\xc9\xf6\x62\x89\x80\x15\xad", - "\xb0\x94\xda\xc5\xd9\x34\x71\xbd\xec\x1a\x50\x22\x70\xe3\xcc\x6c", 1, 0, - 512}, - {96, 256, 128, 11, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" - "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" - "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" - "\x7a\x0a\xbc\xc9\xf6\x62", - "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d\x55\x1b", 1, 160, - 480}, + { 96, 128, 128, 6, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\x88\xda\xce\x60\xb6\xa3\x92\xf3\x28\xc2\xb9\x71\xb2\xfe\x78", + "\xab\x6e\x47\xd4\x2c\xec\x13\xbd\xf5\x3a\x67\xb2\x12\x57\xbd\xdf", 1, 0, 128 }, + { 96, 128, 128, 7, "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", "\x00", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55", + "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa" + "\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2" + "\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a" + "\xac\x97\x3d\x58\xe0\x91\x47\x3f\x59\x85", + "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4", 1, 0, 512 }, + { 96, 128, 128, 8, "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa" + "\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2" + "\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a" + "\xac\x97\x3d\x58\xe0\x91\x47\x3f\x59\x85", + "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb\x94\xfa\xe9\x5a\xe7\x12\x1a\x47", 1, 160, 480 }, + { 96, 256, 128, 9, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xce\xa7\x40\x3d\x4d\x60\x6b\x6e\x07\x4e\xc5\xd3\xba\xf3\x9d\x18", + "\xd0\xd1\xc8\xa7\x99\x99\x6b\xf0\x26\x5b\x98\xb5\xd4\x8a\xb9\x19", 1, 0, 128 }, + { 96, 256, 128, 10, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", "\x00", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62\x89\x80\x15\xad", + "\xb0\x94\xda\xc5\xd9\x34\x71\xbd\xec\x1a\x50\x22\x70\xe3\xcc\x6c", 1, 0, 512 }, + { 96, 256, 128, 11, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d\x55\x1b", 1, 160, 480 }, /* Vectors from https://tools.ietf.org/html/draft-mcgrew-gcm-test-01 case #7 - */ - {96, 192, 128, 12, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", - "\x00\x00\xa5\xf8\x00\x00\x00\x0a", - "\x45\x00\x00\x28\xa4\xad\x40\x00\x40\x06\x78\x80\x0a\x01\x03\x8f\x0a\x01" - "\x06\x12\x80\x23\x06\xb8\xcb\x71\x26\x02\xdd\x6b\xb0\x3e\x50\x10\x16\xd0" - "\x75\x68\x00\x01", - "\xa5\xb1\xf8\x06\x60\x29\xae\xa4\x0e\x59\x8b\x81\x22\xde\x02\x42\x09\x38" - "\xb3\xab\x33\xf8\x28\xe6\x87\xb8\x85\x8b\x5b\xfb\xdb\xd0\x31\x5b\x27\x45" - "\x21\x44\xcc\x77", - "\x95\x45\x7b\x96\x52\x03\x7f\x53\x18\x02\x7b\x5b\x4c\xd7\xa6\x36", 1, 64, - 320}, - {96, 256, 32, 13, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" - "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" - "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" - "\x7a\x0a\xbc\xc9\xf6\x62", - "\x76\xfc\x6e\xce", 1, 160, 480}, - {96, 256, 64, 14, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" - "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" - "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" - "\x7a\x0a\xbc\xc9\xf6\x62", - "\x76\xfc\x6e\xce\x0f\x4e\x17\x68", 1, 160, 480}, - {96, 256, 112, 15, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" - "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" - "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" - "\x7a\x0a\xbc\xc9\xf6\x62", - "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d", 1, 160, 480}, - {96, 256, 120, 16, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" - "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" - "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" - "\x7a\x0a\xbc\xc9\xf6\x62", - "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d\x55", 1, 160, - 480}, - {96, 128, 128, 17, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", - "\x00\x01\x02\x03\x04\x05\x06\x07", "", "", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 1, 64, - 0}, - {96, 128, 128, 18, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x93\x6d\xa5\xcd\x62\x1e\xf1\x53\x43\xdb\x6b\x81\x3a\xae\x7e\x07", - "\xfe\x8e\xc5\x55\x5f\x36\x08\xf7\x0e\xbc\x7f\xce\xe9\x59\x2e\x9b", 1, 0, - 128}, - {96, 128, 128, 19, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "", "", "", - "\x43\x5b\x9b\xa1\x2d\x75\xa4\xbe\x8a\x97\x7e\xa3\xcd\x01\x18\x90", 1, 0, - 0}, - {96, 128, 8, 20, - "\xad\x7a\x2b\xd0\x3e\xac\x83\x5a\x6f\x62\x0f\xdc\xb5\x06\xb3\x45", - "\x12\x15\x35\x24\xc0\x89\x5e\x81\xb2\xc2\x84\x65", - "\xd6\x09\xb1\xf0\x56\x63\x7a\x0d\x46\xdf\x99\x8d\x88\xe5\x2e\x00\xb2\xc2" - "\x84\x65\x12\x15\x35\x24\xc0\x89\x5e\x81", - "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" - "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" - "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x00\x02", - "\x70\x1a\xfa\x1c\xc0\x39\xc0\xd7\x65\x12\x8a\x66\x5d\xab\x69\x24\x38\x99" - "\xbf\x73\x18\xcc\xdc\x81\xc9\x93\x1d\xa1\x7f\xbe\x8e\xdd\x7d\x17\xcb\x8b" - "\x4c\x26\xfc\x81\xe3\x28\x4f\x2b\x7f\xba\x71\x3d", - "\x4f", 1, 224, 384}, - {96, 128, 128, 21, - "\x76\x80\xc5\xd3\xca\x61\x54\x75\x8e\x51\x0f\x4d\x25\xb9\x88\x20", - "\xf8\xf1\x05\xf9\xc3\xdf\x49\x65\x78\x03\x21\xf8", - "\xc9\x4c\x41\x01\x94\xc7\x65\xe3\xdc\xc7\x96\x43\x79\x75\x8e\xd3", "", "", - "\x94\xdc\xa8\xed\xfc\xf9\x0b\xb7\x4b\x15\x3c\x8d\x48\xa1\x79\x30", 1, 128, - 0}, + */ + { 96, 192, 128, 12, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", "\x00\x00\xa5\xf8\x00\x00\x00\x0a", + "\x45\x00\x00\x28\xa4\xad\x40\x00\x40\x06\x78\x80\x0a\x01\x03\x8f\x0a\x01" + "\x06\x12\x80\x23\x06\xb8\xcb\x71\x26\x02\xdd\x6b\xb0\x3e\x50\x10\x16\xd0" + "\x75\x68\x00\x01", + "\xa5\xb1\xf8\x06\x60\x29\xae\xa4\x0e\x59\x8b\x81\x22\xde\x02\x42\x09\x38" + "\xb3\xab\x33\xf8\x28\xe6\x87\xb8\x85\x8b\x5b\xfb\xdb\xd0\x31\x5b\x27\x45" + "\x21\x44\xcc\x77", + "\x95\x45\x7b\x96\x52\x03\x7f\x53\x18\x02\x7b\x5b\x4c\xd7\xa6\x36", 1, 64, 320 }, + { 96, 256, 32, 13, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce", 1, 160, 480 }, + { 96, 256, 64, 14, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68", 1, 160, 480 }, + { 96, 256, 112, 15, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d", 1, 160, 480 }, + { 96, 256, 120, 16, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x52\x2d\xc1\xf0\x99\x56\x7d\x07\xf4\x7f\x37\xa3\x2a\x84\x42\x7d\x64\x3a" + "\x8c\xdc\xbf\xe5\xc0\xc9\x75\x98\xa2\xbd\x25\x55\xd1\xaa\x8c\xb0\x8e\x48" + "\x59\x0d\xbb\x3d\xa7\xb0\x8b\x10\x56\x82\x88\x38\xc5\xf6\x1e\x63\x93\xba" + "\x7a\x0a\xbc\xc9\xf6\x62", + "\x76\xfc\x6e\xce\x0f\x4e\x17\x68\xcd\xdf\x88\x53\xbb\x2d\x55", 1, 160, 480 }, + { 96, 128, 128, 17, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02\x03\x04\x05\x06\x07", + "", "", "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 1, 64, 0 }, + { 96, 128, 128, 18, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x93\x6d\xa5\xcd\x62\x1e\xf1\x53\x43\xdb\x6b\x81\x3a\xae\x7e\x07", + "\xfe\x8e\xc5\x55\x5f\x36\x08\xf7\x0e\xbc\x7f\xce\xe9\x59\x2e\x9b", 1, 0, 128 }, + { 96, 128, 128, 19, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "", "", "", + "\x43\x5b\x9b\xa1\x2d\x75\xa4\xbe\x8a\x97\x7e\xa3\xcd\x01\x18\x90", 1, 0, 0 }, + { 96, 128, 8, 20, "\xad\x7a\x2b\xd0\x3e\xac\x83\x5a\x6f\x62\x0f\xdc\xb5\x06\xb3\x45", + "\x12\x15\x35\x24\xc0\x89\x5e\x81\xb2\xc2\x84\x65", + "\xd6\x09\xb1\xf0\x56\x63\x7a\x0d\x46\xdf\x99\x8d\x88\xe5\x2e\x00\xb2\xc2" + "\x84\x65\x12\x15\x35\x24\xc0\x89\x5e\x81", + "\x08\x00\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e" + "\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" + "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x00\x02", + "\x70\x1a\xfa\x1c\xc0\x39\xc0\xd7\x65\x12\x8a\x66\x5d\xab\x69\x24\x38\x99" + "\xbf\x73\x18\xcc\xdc\x81\xc9\x93\x1d\xa1\x7f\xbe\x8e\xdd\x7d\x17\xcb\x8b" + "\x4c\x26\xfc\x81\xe3\x28\x4f\x2b\x7f\xba\x71\x3d", + "\x4f", 1, 224, 384 }, + { 96, 128, 128, 21, "\x76\x80\xc5\xd3\xca\x61\x54\x75\x8e\x51\x0f\x4d\x25\xb9\x88\x20", + "\xf8\xf1\x05\xf9\xc3\xdf\x49\x65\x78\x03\x21\xf8", + "\xc9\x4c\x41\x01\x94\xc7\x65\xe3\xdc\xc7\x96\x43\x79\x75\x8e\xd3", "", "", + "\x94\xdc\xa8\xed\xfc\xf9\x0b\xb7\x4b\x15\x3c\x8d\x48\xa1\x79\x30", 1, 128, 0 }, /* Vectors from http://csrc.nist.gov/groups/ST/toolkit/BCM/ documents/proposedmodes/gcm/gcm-revised-spec.pdf */ - {64, 256, 128, 22, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\xca\xfe\xba\xbe\xfa\xce\xdb\xad", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\xc3\x76\x2d\xf1\xca\x78\x7d\x32\xae\x47\xc1\x3b\xf1\x98\x44\xcb\xaf\x1a" - "\xe1\x4d\x0b\x97\x6a\xfa\xc5\x2f\xf7\xd7\x9b\xba\x9d\xe0\xfe\xb5\x82\xd3" - "\x39\x34\xa4\xf0\x95\x4c\xc2\x36\x3b\xc7\x3f\x78\x62\xac\x43\x0e\x64\xab" - "\xe4\x99\xf4\x7c\x9b\x1f", - "\x3a\x33\x7d\xbf\x46\xa7\x92\xc4\x5e\x45\x49\x13\xfe\x2e\xa8\xf2", 1, 160, - 480}, - {8, 128, 128, 23, - "\x83\xf9\xd9\x7d\x4a\xb7\x59\xfd\xdc\xc3\xef\x54\xa0\xe2\xa8\xec", "\xcf", - "\x6d\xd4\x9e\xae\xb4\x10\x3d\xac\x8f\x97\xe3\x23\x49\x46\xdd\x2d", - "\x77\xe6\x32\x9c\xf9\x42\x4f\x71\xc8\x08\xdf\x91\x70\xbf\xd2\x98", - "\x50\xde\x86\xa7\xa9\x2a\x8a\x5e\xa3\x3d\xb5\x69\x6b\x96\xcd\x77", - "\xaa\x18\x1e\x84\xbc\x8b\x4b\xf5\xa6\x89\x27\xc4\x09\xd4\x22\xcb", 1, 128, - 128}, - {8, 192, 128, 24, - "\x8b\x1c\x63\xbc\xcb\x55\x79\xe5\x88\x7f\x5b\xf7\xb2\xbd\x0c\xbc\xff\x13" - "\x6d\x40\xd7\xb6\x1a\xb2", - "\xca", "\x8f\xbe\x5a\x21\xa6\x5b\xdd\xd0\x33\x16\x04\xc9\x17\x83\x9c\xf7", - "\x22\x4f\x5f\x2a\x23\x7b\x30\x7c\x78\x42\xde\x75\xd9\xd1\xbb\x65", - "\x83\x49\xe3\xa4\x8f\x5d\x89\xd9\x42\xc2\x4d\x80\xae\xfb\x1c\x5f", - "\x3d\x49\xe3\xd4\x3f\x9a\x4a\x96\x4c\x6d\x84\x4d\x60\xb4\xef\x1e", 1, 128, - 128}, - {1024, 128, 32, 25, - "\x0e\x00\xc7\x65\x61\xd2\xbd\x9b\x40\xc3\xc1\x54\x27\xe2\xb0\x8f", - "\x49\x2c\xad\xac\xcd\x3c\xa3\xfb\xc9\xcf\x9f\x06\xeb\x33\x25\xc4\xe1\x59" - "\x85\x0b\x0d\xbe\x98\x19\x9b\x89\xb7\xaf\x52\x88\x06\x61\x0b\x6f\x63\x99" - "\x8e\x1e\xae\x80\xc3\x48\xe7\x4c\xbb\x92\x1d\x83\x26\x63\x16\x31\xfc\x6a" - "\x5d\x30\x4f\x39\x16\x6d\xaf\x7e\xa1\x5f\xa1\x97\x7f\x10\x18\x19\xad\xb5" - "\x10\xb5\x0f\xe9\x93\x2e\x12\xc5\xa8\x5a\xa3\xfd\x1e\x73\xd8\xd7\x60\xaf" - "\x21\x8b\xe8\x29\x90\x3a\x77\xc6\x33\x59\xd7\x5e\xdd\x91\xb4\xf6\xed\x54" - "\x65\xa7\x26\x62\xf5\x05\x59\x99\xe0\x59\xe7\x65\x4a\x8e\xdc\x92\x1a\xa0" - "\xd4\x96", - "\xd8\xf1\x16\x3d\x8c\x84\x02\x92\xa2\xb2\xda\xcf\x4a\xc7\xc3\x6a\xff\x87" - "\x33\xf1\x8f\xab\xb4\xfa\x55\x94\x54\x41\x25\xe0\x3d\x1e\x6e\x5d\x6d\x0f" - "\xd6\x16\x56\xc8\xd8\xf3\x27\xc9\x28\x39\xae\x55\x39\xbb\x46\x9c\x92\x57" - "\xf1\x09\xeb\xff\x85\xaa\xd7\xbd\x22\x0f\xda\xa9\x5c\x02\x2d\xbd\x0c\x7b" - "\xb2\xd8\x78\xad\x50\x41\x22\xc9\x43\x04\x5d\x3c\x5e\xba\x8f\x1f\x56\xc0", - "\xfe\xf0\x3c\x2d\x7f\xb1\x5b\xf0\xd2\xdf\x18\x00\x7d\x99\xf9\x67\xc8\x78" - "\xad\x59\x35\x90\x34\xf7\xbb\x2c\x19\xaf\x12\x06\x85\xd7\x8e\x32\xf6\xb8" - "\xb8\x3b\x03\x20\x19\x95\x6c\xa9\xc0\x19\x57\x21\x47\x6b\x85", - "\x4f\x6c\xf4\x71\xbe\x7c\xbd\x25\x75\xcd\x5a\x17\x47\xae\xa8\xfe\x9d\xea" - "\x83\xe5\x19\x36\xbe\xac\x3e\x68\xf6\x62\x06\x92\x20\x60\xc6\x97\xff\xa7" - "\xaf\x80\xad\x6b\xb6\x8f\x2c\xf4\xfc\x97\x41\x6e\xe5\x2a\xbe", - "\xe2\x0b\x66\x55", 1, 720, 408}, - {480, 256, 128, 26, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" - "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\x93\x13\x22\x5d\xf8\x84\x06\xe5\x55\x90\x9c\x5a\xff\x52\x69\xaa\x6a\x7a" - "\x95\x38\x53\x4f\x7d\xa1\xe4\xc3\x03\xd2\xa3\x18\xa7\x28\xc3\xc0\xc9\x51" - "\x56\x80\x95\x39\xfc\xf0\xe2\x42\x9a\x6b\x52\x54\x16\xae\xdb\xf5\xa0\xde" - "\x6a\x57\xa6\x37\xb3\x9b", - "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" - "\xda\xd2", - "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" - "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" - "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" - "\xe6\x57\xba\x63\x7b\x39", - "\x5a\x8d\xef\x2f\x0c\x9e\x53\xf1\xf7\x5d\x78\x53\x65\x9e\x2a\x20\xee\xb2" - "\xb2\x2a\xaf\xde\x64\x19\xa0\x58\xab\x4f\x6f\x74\x6b\xf4\x0f\xc0\xc3\xb7" - "\x80\xf2\x44\x45\x2d\xa3\xeb\xf1\xc5\xd8\x2c\xde\xa2\x41\x89\x97\x20\x0e" - "\xf8\x2e\x44\xae\x7e\x3f", - "\xa4\x4a\x82\x66\xee\x1c\x8e\xb0\xc8\xb5\xd4\xcf\x5a\xe9\xf1\x9a", 1, 160, - 480}, - {0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} + { 64, 256, 128, 22, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\xc3\x76\x2d\xf1\xca\x78\x7d\x32\xae\x47\xc1\x3b\xf1\x98\x44\xcb\xaf\x1a" + "\xe1\x4d\x0b\x97\x6a\xfa\xc5\x2f\xf7\xd7\x9b\xba\x9d\xe0\xfe\xb5\x82\xd3" + "\x39\x34\xa4\xf0\x95\x4c\xc2\x36\x3b\xc7\x3f\x78\x62\xac\x43\x0e\x64\xab" + "\xe4\x99\xf4\x7c\x9b\x1f", + "\x3a\x33\x7d\xbf\x46\xa7\x92\xc4\x5e\x45\x49\x13\xfe\x2e\xa8\xf2", 1, 160, 480 }, + { 8, 128, 128, 23, "\x83\xf9\xd9\x7d\x4a\xb7\x59\xfd\xdc\xc3\xef\x54\xa0\xe2\xa8\xec", + "\xcf", "\x6d\xd4\x9e\xae\xb4\x10\x3d\xac\x8f\x97\xe3\x23\x49\x46\xdd\x2d", + "\x77\xe6\x32\x9c\xf9\x42\x4f\x71\xc8\x08\xdf\x91\x70\xbf\xd2\x98", + "\x50\xde\x86\xa7\xa9\x2a\x8a\x5e\xa3\x3d\xb5\x69\x6b\x96\xcd\x77", + "\xaa\x18\x1e\x84\xbc\x8b\x4b\xf5\xa6\x89\x27\xc4\x09\xd4\x22\xcb", 1, 128, 128 }, + { 8, 192, 128, 24, + "\x8b\x1c\x63\xbc\xcb\x55\x79\xe5\x88\x7f\x5b\xf7\xb2\xbd\x0c\xbc\xff\x13" + "\x6d\x40\xd7\xb6\x1a\xb2", + "\xca", "\x8f\xbe\x5a\x21\xa6\x5b\xdd\xd0\x33\x16\x04\xc9\x17\x83\x9c\xf7", + "\x22\x4f\x5f\x2a\x23\x7b\x30\x7c\x78\x42\xde\x75\xd9\xd1\xbb\x65", + "\x83\x49\xe3\xa4\x8f\x5d\x89\xd9\x42\xc2\x4d\x80\xae\xfb\x1c\x5f", + "\x3d\x49\xe3\xd4\x3f\x9a\x4a\x96\x4c\x6d\x84\x4d\x60\xb4\xef\x1e", 1, 128, 128 }, + { 1024, 128, 32, 25, "\x0e\x00\xc7\x65\x61\xd2\xbd\x9b\x40\xc3\xc1\x54\x27\xe2\xb0\x8f", + "\x49\x2c\xad\xac\xcd\x3c\xa3\xfb\xc9\xcf\x9f\x06\xeb\x33\x25\xc4\xe1\x59" + "\x85\x0b\x0d\xbe\x98\x19\x9b\x89\xb7\xaf\x52\x88\x06\x61\x0b\x6f\x63\x99" + "\x8e\x1e\xae\x80\xc3\x48\xe7\x4c\xbb\x92\x1d\x83\x26\x63\x16\x31\xfc\x6a" + "\x5d\x30\x4f\x39\x16\x6d\xaf\x7e\xa1\x5f\xa1\x97\x7f\x10\x18\x19\xad\xb5" + "\x10\xb5\x0f\xe9\x93\x2e\x12\xc5\xa8\x5a\xa3\xfd\x1e\x73\xd8\xd7\x60\xaf" + "\x21\x8b\xe8\x29\x90\x3a\x77\xc6\x33\x59\xd7\x5e\xdd\x91\xb4\xf6\xed\x54" + "\x65\xa7\x26\x62\xf5\x05\x59\x99\xe0\x59\xe7\x65\x4a\x8e\xdc\x92\x1a\xa0" + "\xd4\x96", + "\xd8\xf1\x16\x3d\x8c\x84\x02\x92\xa2\xb2\xda\xcf\x4a\xc7\xc3\x6a\xff\x87" + "\x33\xf1\x8f\xab\xb4\xfa\x55\x94\x54\x41\x25\xe0\x3d\x1e\x6e\x5d\x6d\x0f" + "\xd6\x16\x56\xc8\xd8\xf3\x27\xc9\x28\x39\xae\x55\x39\xbb\x46\x9c\x92\x57" + "\xf1\x09\xeb\xff\x85\xaa\xd7\xbd\x22\x0f\xda\xa9\x5c\x02\x2d\xbd\x0c\x7b" + "\xb2\xd8\x78\xad\x50\x41\x22\xc9\x43\x04\x5d\x3c\x5e\xba\x8f\x1f\x56\xc0", + "\xfe\xf0\x3c\x2d\x7f\xb1\x5b\xf0\xd2\xdf\x18\x00\x7d\x99\xf9\x67\xc8\x78" + "\xad\x59\x35\x90\x34\xf7\xbb\x2c\x19\xaf\x12\x06\x85\xd7\x8e\x32\xf6\xb8" + "\xb8\x3b\x03\x20\x19\x95\x6c\xa9\xc0\x19\x57\x21\x47\x6b\x85", + "\x4f\x6c\xf4\x71\xbe\x7c\xbd\x25\x75\xcd\x5a\x17\x47\xae\xa8\xfe\x9d\xea" + "\x83\xe5\x19\x36\xbe\xac\x3e\x68\xf6\x62\x06\x92\x20\x60\xc6\x97\xff\xa7" + "\xaf\x80\xad\x6b\xb6\x8f\x2c\xf4\xfc\x97\x41\x6e\xe5\x2a\xbe", + "\xe2\x0b\x66\x55", 1, 720, 408 }, + { 480, 256, 128, 26, + "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff" + "\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\x93\x13\x22\x5d\xf8\x84\x06\xe5\x55\x90\x9c\x5a\xff\x52\x69\xaa\x6a\x7a" + "\x95\x38\x53\x4f\x7d\xa1\xe4\xc3\x03\xd2\xa3\x18\xa7\x28\xc3\xc0\xc9\x51" + "\x56\x80\x95\x39\xfc\xf0\xe2\x42\x9a\x6b\x52\x54\x16\xae\xdb\xf5\xa0\xde" + "\x6a\x57\xa6\x37\xb3\x9b", + "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad" + "\xda\xd2", + "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7" + "\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95" + "\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d" + "\xe6\x57\xba\x63\x7b\x39", + "\x5a\x8d\xef\x2f\x0c\x9e\x53\xf1\xf7\x5d\x78\x53\x65\x9e\x2a\x20\xee\xb2" + "\xb2\x2a\xaf\xde\x64\x19\xa0\x58\xab\x4f\x6f\x74\x6b\xf4\x0f\xc0\xc3\xb7" + "\x80\xf2\x44\x45\x2d\xa3\xeb\xf1\xc5\xd8\x2c\xde\xa2\x41\x89\x97\x20\x0e" + "\xf8\x2e\x44\xae\x7e\x3f", + "\xa4\x4a\x82\x66\xee\x1c\x8e\xb0\xc8\xb5\xd4\xcf\x5a\xe9\xf1\x9a", 1, 160, 480 }, + { 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; diff --git a/test/kat-app/ghash_test.c b/test/kat-app/ghash_test.c index 2185ce3a..889d1fce 100644 --- a/test/kat-app/ghash_test.c +++ b/test/kat-app/ghash_test.c @@ -30,45 +30,47 @@ #include #include #include -#include /* for memcmp() */ +#include /* for memcmp() */ #include #include "utils.h" #include "mac_test.h" -int ghash_test(struct IMB_MGR *mb_mgr); +int +ghash_test(struct IMB_MGR *mb_mgr); extern const struct mac_test ghash_test_json[]; -static int check_data(const uint8_t *test, const char *expected, - uint64_t len, const char *data_name) +static int +check_data(const uint8_t *test, const char *expected, uint64_t len, const char *data_name) { - int mismatch; - int is_error = 0; - - if (len == 0) - return is_error; - - if (test == NULL || expected == NULL || data_name == NULL) - return 1; - - mismatch = memcmp(test, expected, len); - if (mismatch) { - uint64_t a; - - is_error = 1; - printf(" expected results don't match %s \t\t", data_name); - for (a = 0; a < len; a++) - if (test[a] != expected[a]) { - printf(" '%x' != '%x' at %llx of %llx\n", test[a], expected[a], - (unsigned long long) a, (unsigned long long) len); - break; - } - } - return is_error; + int mismatch; + int is_error = 0; + + if (len == 0) + return is_error; + + if (test == NULL || expected == NULL || data_name == NULL) + return 1; + + mismatch = memcmp(test, expected, len); + if (mismatch) { + uint64_t a; + + is_error = 1; + printf(" expected results don't match %s \t\t", data_name); + for (a = 0; a < len; a++) + if (test[a] != expected[a]) { + printf(" '%x' != '%x' at %llx of %llx\n", test[a], expected[a], + (unsigned long long) a, (unsigned long long) len); + break; + } + } + return is_error; } -int ghash_test(struct IMB_MGR *mb_mgr) +int +ghash_test(struct IMB_MGR *mb_mgr) { struct test_suite_context ts; int use_job_api = 0; @@ -76,56 +78,56 @@ int ghash_test(struct IMB_MGR *mb_mgr) test_suite_start(&ts, "GHASH"); while (use_job_api < 2) { - const struct mac_test *vec = ghash_test_json; - - printf("GHASH test vectors (%s API):\n", use_job_api ? "job" : "direct"); - while (vec->msg != NULL) { - struct gcm_key_data gdata_key; - uint8_t T_test[16]; - - memset(&gdata_key, 0, sizeof(struct gcm_key_data)); - memset(T_test, 0, sizeof(T_test)); - IMB_GHASH_PRE(mb_mgr, vec->key, &gdata_key); - - if (!use_job_api) { - IMB_GHASH(mb_mgr, &gdata_key, vec->msg, - (vec->msgSize / 8), T_test, vec->tagSize / 8); - } else { - IMB_JOB *job = IMB_GET_NEXT_JOB(mb_mgr); - - if (!job) { - fprintf(stderr, "failed to get job for ghash\n"); - test_suite_update(&ts, 0, 1); - return test_suite_end(&ts); - } - - job->cipher_mode = IMB_CIPHER_NULL; - job->hash_alg = IMB_AUTH_GHASH; - job->u.GHASH._key = &gdata_key; - job->u.GHASH._init_tag = T_test; - job->src = (const void *) vec->msg; - job->msg_len_to_hash_in_bytes = (vec->msgSize / 8); - job->hash_start_src_offset_in_bytes = UINT64_C(0); - job->auth_tag_output = T_test; - job->auth_tag_output_len_in_bytes = vec->tagSize / 8; - - job = IMB_SUBMIT_JOB(mb_mgr); - - if (job == NULL) - job = IMB_FLUSH_JOB(mb_mgr); - if (job == NULL) - fprintf(stderr, "No job retrieved\n"); - else if (job->status != IMB_STATUS_COMPLETED) - fprintf(stderr, "failed job, status:%d\n", job->status); - } - - if (check_data(T_test, vec->tag, vec->tagSize / 8, "generated tag (T)")) - test_suite_update(&ts, 0, 1); - else - test_suite_update(&ts, 1, 0); - vec++; - } - use_job_api++; + const struct mac_test *vec = ghash_test_json; + + printf("GHASH test vectors (%s API):\n", use_job_api ? "job" : "direct"); + while (vec->msg != NULL) { + struct gcm_key_data gdata_key; + uint8_t T_test[16]; + + memset(&gdata_key, 0, sizeof(struct gcm_key_data)); + memset(T_test, 0, sizeof(T_test)); + IMB_GHASH_PRE(mb_mgr, vec->key, &gdata_key); + + if (!use_job_api) { + IMB_GHASH(mb_mgr, &gdata_key, vec->msg, (vec->msgSize / 8), T_test, + vec->tagSize / 8); + } else { + IMB_JOB *job = IMB_GET_NEXT_JOB(mb_mgr); + + if (!job) { + fprintf(stderr, "failed to get job for ghash\n"); + test_suite_update(&ts, 0, 1); + return test_suite_end(&ts); + } + + job->cipher_mode = IMB_CIPHER_NULL; + job->hash_alg = IMB_AUTH_GHASH; + job->u.GHASH._key = &gdata_key; + job->u.GHASH._init_tag = T_test; + job->src = (const void *) vec->msg; + job->msg_len_to_hash_in_bytes = (vec->msgSize / 8); + job->hash_start_src_offset_in_bytes = UINT64_C(0); + job->auth_tag_output = T_test; + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; + + job = IMB_SUBMIT_JOB(mb_mgr); + + if (job == NULL) + job = IMB_FLUSH_JOB(mb_mgr); + if (job == NULL) + fprintf(stderr, "No job retrieved\n"); + else if (job->status != IMB_STATUS_COMPLETED) + fprintf(stderr, "failed job, status:%d\n", job->status); + } + + if (check_data(T_test, vec->tag, vec->tagSize / 8, "generated tag (T)")) + test_suite_update(&ts, 0, 1); + else + test_suite_update(&ts, 1, 0); + vec++; + } + use_job_api++; } return test_suite_end(&ts); diff --git a/test/kat-app/ghash_test.json.c b/test/kat-app/ghash_test.json.c index f2fb634f..910152b1 100644 --- a/test/kat-app/ghash_test.json.c +++ b/test/kat-app/ghash_test.json.c @@ -31,26 +31,19 @@ #include "mac_test.h" const struct mac_test ghash_test_json[] = { - {128, 128, 1, - "\xa1\xf6\x25\x8c\x87\x7d\x5f\xcd\x89\x64\x48\x45\x38\xbf\xc9\x2c", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x9e\xe5\xa5\x1f\xbe\x28\xa1\x15\x3e\xf1\x96\xf5\x0b\xbf\x03\xca", 1, 128, - NULL, 0}, - {128, 96, 2, - "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\xb5\x40\xda\x44\xa3\x8c\x9c\x2b\x95\x8e\x4b\x0b", 1, 256, NULL, 0}, - {128, 128, 3, - "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", "\x05", - "\xe6\xce\x47\xb5\xfb\xf2\xef\x37\x51\xf1\x57\x53\xad\x56\x4f\xed", 1, 8, - NULL, 0}, - {128, 128, 4, - "\x1f\x0f\x8a\x3a\xca\x64\x2e\xde\xb1\xdf\x8a\x52\x9a\x29\x76\xee", - "\x9b\xb5\x92\x9f\xa7\xaa\x83\xfd\x0c\xd1\x83\x3a\x8e\xd5\x4d\xda\x6a\xaf" - "\xa1\xc7\xa1\x32\x3a\xd4\x92\x9a\x2c\x83\xc6\x27\x92\x59\x28\x90\x11\xde" - "\x19\x4e\xd5\x16\xef\x4f\x72\xeb\x79\x18\xd5\xb1\xc5\x22\x40\x14\x92\xa2", - "\x8b\xa5\x3f\x5f\xd7\x0e\x55\x7c\x30\xd4\xf2\xe1\x1a\x4f\xf8\xc7", 1, 432, - NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + { 128, 128, 1, "\xa1\xf6\x25\x8c\x87\x7d\x5f\xcd\x89\x64\x48\x45\x38\xbf\xc9\x2c", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x9e\xe5\xa5\x1f\xbe\x28\xa1\x15\x3e\xf1\x96\xf5\x0b\xbf\x03\xca", 1, 128, NULL, 0 }, + { 128, 96, 2, "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + "\xb5\x40\xda\x44\xa3\x8c\x9c\x2b\x95\x8e\x4b\x0b", 1, 256, NULL, 0 }, + { 128, 128, 3, "\x1f\x0a\x6d\xcc\x67\xb1\x87\x22\x98\x22\x77\x91\xdd\xa1\x9b\x6a", "\x05", + "\xe6\xce\x47\xb5\xfb\xf2\xef\x37\x51\xf1\x57\x53\xad\x56\x4f\xed", 1, 8, NULL, 0 }, + { 128, 128, 4, "\x1f\x0f\x8a\x3a\xca\x64\x2e\xde\xb1\xdf\x8a\x52\x9a\x29\x76\xee", + "\x9b\xb5\x92\x9f\xa7\xaa\x83\xfd\x0c\xd1\x83\x3a\x8e\xd5\x4d\xda\x6a\xaf" + "\xa1\xc7\xa1\x32\x3a\xd4\x92\x9a\x2c\x83\xc6\x27\x92\x59\x28\x90\x11\xde" + "\x19\x4e\xd5\x16\xef\x4f\x72\xeb\x79\x18\xd5\xb1\xc5\x22\x40\x14\x92\xa2", + "\x8b\xa5\x3f\x5f\xd7\x0e\x55\x7c\x30\xd4\xf2\xe1\x1a\x4f\xf8\xc7", 1, 432, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/kat-app/gmac_test.c b/test/kat-app/gmac_test.c index c2e7e08c..ea70ec0c 100644 --- a/test/kat-app/gmac_test.c +++ b/test/kat-app/gmac_test.c @@ -30,21 +30,22 @@ #include #include #include -#include /* for memcmp() */ +#include /* for memcmp() */ #include #include "utils.h" #include "mac_test.h" -int gmac_test(struct IMB_MGR *mb_mgr); +int +gmac_test(struct IMB_MGR *mb_mgr); extern const struct mac_test gmac_test_kat_json[]; -static int check_data(const uint8_t *test, const uint8_t *expected, - uint64_t len, const char *data_name) +static int +check_data(const uint8_t *test, const uint8_t *expected, uint64_t len, const char *data_name) { - int mismatch; - int is_error = 0; + int mismatch; + int is_error = 0; if (len == 0) return is_error; @@ -52,33 +53,27 @@ static int check_data(const uint8_t *test, const uint8_t *expected, if (test == NULL || expected == NULL || data_name == NULL) return 1; - mismatch = memcmp(test, expected, len); - if (mismatch) { + mismatch = memcmp(test, expected, len); + if (mismatch) { uint64_t a; - is_error = 1; - printf(" expected results don't match %s \t\t", data_name); + is_error = 1; + printf(" expected results don't match %s \t\t", data_name); for (a = 0; a < len; a++) { if (test[a] != expected[a]) { - printf(" '%x' != '%x' at %llx of %llx\n", - test[a], expected[a], - (unsigned long long) a, - (unsigned long long) len); + printf(" '%x' != '%x' at %llx of %llx\n", test[a], expected[a], + (unsigned long long) a, (unsigned long long) len); break; } } - } - return is_error; + } + return is_error; } static void -aes_gmac_job(IMB_MGR *mb_mgr, - const uint8_t *k, - struct gcm_key_data *gmac_key, - const uint64_t key_len, - const uint8_t *in, const uint64_t len, - const uint8_t *iv, const uint64_t iv_len, - uint8_t *auth_tag, const uint64_t auth_tag_len) +aes_gmac_job(IMB_MGR *mb_mgr, const uint8_t *k, struct gcm_key_data *gmac_key, + const uint64_t key_len, const uint8_t *in, const uint64_t len, const uint8_t *iv, + const uint64_t iv_len, uint8_t *auth_tag, const uint64_t auth_tag_len) { IMB_JOB *job; @@ -106,27 +101,23 @@ aes_gmac_job(IMB_MGR *mb_mgr, job->src = in; job->msg_len_to_hash_in_bytes = len; job->hash_start_src_offset_in_bytes = UINT64_C(0); - job->auth_tag_output = auth_tag; - job->auth_tag_output_len_in_bytes = auth_tag_len; + job->auth_tag_output = auth_tag; + job->auth_tag_output_len_in_bytes = auth_tag_len; job = IMB_SUBMIT_JOB(mb_mgr); if (job == NULL) job = IMB_FLUSH_JOB(mb_mgr); - if (job == NULL) + if (job == NULL) fprintf(stderr, "No job retrieved\n"); - else if (job->status != IMB_STATUS_COMPLETED) + else if (job->status != IMB_STATUS_COMPLETED) fprintf(stderr, "failed job, status:%d\n", job->status); } #define MAX_SEG_SIZE 64 static void -gmac_test_vector(IMB_MGR *mb_mgr, - const struct mac_test *vector, - const uint64_t seg_size, - const unsigned job_api, - struct test_suite_context *ts128, - struct test_suite_context *ts192, - struct test_suite_context *ts256) +gmac_test_vector(IMB_MGR *mb_mgr, const struct mac_test *vector, const uint64_t seg_size, + const unsigned job_api, struct test_suite_context *ts128, + struct test_suite_context *ts192, struct test_suite_context *ts256) { struct gcm_key_data key; struct gcm_context_data ctx; @@ -138,10 +129,10 @@ gmac_test_vector(IMB_MGR *mb_mgr, uint8_t T_test[16]; struct test_suite_context *ts = ts128; - if ((vector->keySize / 8) == IMB_KEY_192_BYTES) + if ((vector->keySize / 8) == IMB_KEY_192_BYTES) ts = ts192; - if ((vector->keySize / 8) == IMB_KEY_256_BYTES) + if ((vector->keySize / 8) == IMB_KEY_256_BYTES) ts = ts256; memset(&key, 0, sizeof(struct gcm_key_data)); @@ -159,21 +150,17 @@ gmac_test_vector(IMB_MGR *mb_mgr, in_ptr = (const void *) vector->msg; for (i = 0; i < nb_segs; i++) { memcpy(in_seg, in_ptr, seg_size); - IMB_AES128_GMAC_UPDATE(mb_mgr, &key, &ctx, - in_seg, - seg_size); + IMB_AES128_GMAC_UPDATE(mb_mgr, &key, &ctx, in_seg, seg_size); in_ptr += seg_size; } if (last_partial_seg != 0) { memcpy(in_seg, in_ptr, last_partial_seg); - IMB_AES128_GMAC_UPDATE(mb_mgr, &key, &ctx, - in_seg, + IMB_AES128_GMAC_UPDATE(mb_mgr, &key, &ctx, in_seg, last_partial_seg); } - IMB_AES128_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, - vector->tagSize / 8); + IMB_AES128_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, vector->tagSize / 8); break; case IMB_KEY_192_BYTES: IMB_AES192_GCM_PRE(mb_mgr, vector->key, &key); @@ -181,21 +168,17 @@ gmac_test_vector(IMB_MGR *mb_mgr, in_ptr = (const void *) vector->msg; for (i = 0; i < nb_segs; i++) { memcpy(in_seg, in_ptr, seg_size); - IMB_AES192_GMAC_UPDATE(mb_mgr, &key, &ctx, - in_seg, - seg_size); + IMB_AES192_GMAC_UPDATE(mb_mgr, &key, &ctx, in_seg, seg_size); in_ptr += seg_size; } if (last_partial_seg != 0) { memcpy(in_seg, in_ptr, last_partial_seg); - IMB_AES192_GMAC_UPDATE(mb_mgr, &key, &ctx, - in_seg, + IMB_AES192_GMAC_UPDATE(mb_mgr, &key, &ctx, in_seg, last_partial_seg); } - IMB_AES192_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, - vector->tagSize / 8); + IMB_AES192_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, vector->tagSize / 8); break; case IMB_KEY_256_BYTES: default: @@ -204,54 +187,49 @@ gmac_test_vector(IMB_MGR *mb_mgr, in_ptr = (const void *) vector->msg; for (i = 0; i < nb_segs; i++) { memcpy(in_seg, in_ptr, seg_size); - IMB_AES256_GMAC_UPDATE(mb_mgr, &key, &ctx, - in_seg, - seg_size); + IMB_AES256_GMAC_UPDATE(mb_mgr, &key, &ctx, in_seg, seg_size); in_ptr += seg_size; } if (last_partial_seg != 0) { memcpy(in_seg, in_ptr, last_partial_seg); - IMB_AES256_GMAC_UPDATE(mb_mgr, &key, &ctx, - in_seg, + IMB_AES256_GMAC_UPDATE(mb_mgr, &key, &ctx, in_seg, last_partial_seg); } - IMB_AES256_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, - vector->tagSize / 8); + IMB_AES256_GMAC_FINALIZE(mb_mgr, &key, &ctx, T_test, vector->tagSize / 8); break; } } - if (check_data(T_test, (const void *) vector->tag, - vector->tagSize / 8, "generated tag (T)")) + if (check_data(T_test, (const void *) vector->tag, vector->tagSize / 8, + "generated tag (T)")) test_suite_update(ts, 0, 1); else test_suite_update(ts, 1, 0); } -int gmac_test(IMB_MGR *mb_mgr) +int +gmac_test(IMB_MGR *mb_mgr) { struct test_suite_context ts128, ts192, ts256; - int errors = 0; + int errors = 0; test_suite_start(&ts128, "AES-GMAC-128"); test_suite_start(&ts192, "AES-GMAC-192"); test_suite_start(&ts256, "AES-GMAC-256"); - printf("GMAC test vectors:\n"); + printf("GMAC test vectors:\n"); const struct mac_test *vec = gmac_test_kat_json; - while (vec->msg != NULL) { + while (vec->msg != NULL) { uint64_t seg_size; /* Using direct API, which allows SGL */ for (seg_size = 1; seg_size <= MAX_SEG_SIZE; seg_size++) - gmac_test_vector(mb_mgr, vec, seg_size, 0, - &ts128, &ts192, &ts256); + gmac_test_vector(mb_mgr, vec, seg_size, 0, &ts128, &ts192, &ts256); /* Using job API */ - gmac_test_vector(mb_mgr, vec, (vec->msgSize / 8), 1, - &ts128, &ts192, &ts256); + gmac_test_vector(mb_mgr, vec, (vec->msgSize / 8), 1, &ts128, &ts192, &ts256); vec++; } errors += test_suite_end(&ts128); diff --git a/test/kat-app/gmac_test.json.c b/test/kat-app/gmac_test.json.c index b413ff3f..5b8f58bb 100644 --- a/test/kat-app/gmac_test.json.c +++ b/test/kat-app/gmac_test.json.c @@ -35,46 +35,43 @@ const struct mac_test gmac_test_kat_json[] = { * Vectors from * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/ * proposedmodes/gcm/gcm-revised-spec.pdf - */ - {128, 32, 1, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" - "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23" - "\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35" - "\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\xc5\x3a\xf9\xe8", 1, 512, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96}, - {128, 128, 2, - "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" - "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" - "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" - "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" - "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c" - "\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" - "\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", - "\x4c\x0c\x4f\x47\x2d\x78\xf6\xd8\x03\x53\x20\x2f\x1a\xdf\x90\xd0", 1, - 1280, "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", 96}, - {192, 128, 3, - "\xaa\x74\x0a\xbf\xad\xcd\xa7\x79\x22\x0d\x3b\x40\x6c\x5d\x7e\xc0\x9a\x77" - "\xfe\x9d\x94\x10\x45\x39", - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" - "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" - "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" - "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" - "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", - "\xcf\x82\x80\x64\x02\x46\xf4\xfb\x33\xae\x1d\x90\xea\x48\x83\xdb", 1, 640, - "\xab\x22\x65\xb4\xc1\x68\x95\x55\x61\xf0\x43\x15", 96}, - {256, 128, 4, - "\xb5\x48\xe4\x93\x4f\x5c\x64\xd3\xc0\xf0\xb7\x8f\x7b\x4d\x88\x24\xaa\xc4" - "\x6b\x3c\x8d\x2c\xc3\x5e\xe4\xbf\xb2\x54\xe4\xfc\xba\xf7", - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" - "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" - "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" - "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01", - "\x77\x46\x0d\x6f\xb1\x87\xdb\xa9\x46\xad\xcd\xfb\xb7\xf9\x13\xa1", 1, 520, - "\x2e\xed\xe1\xdc\x64\x47\xc7\xaf\xc4\x41\x53\x58", 96}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + */ + { 128, 32, 1, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11" + "\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23" + "\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35" + "\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", + "\xc5\x3a\xf9\xe8", 1, 512, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 2, "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08", + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" + "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" + "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" + "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" + "\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c" + "\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" + "\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", + "\x4c\x0c\x4f\x47\x2d\x78\xf6\xd8\x03\x53\x20\x2f\x1a\xdf\x90\xd0", 1, 1280, + "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88", 96 }, + { 192, 128, 3, + "\xaa\x74\x0a\xbf\xad\xcd\xa7\x79\x22\x0d\x3b\x40\x6c\x5d\x7e\xc0\x9a\x77" + "\xfe\x9d\x94\x10\x45\x39", + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" + "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" + "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" + "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", + "\xcf\x82\x80\x64\x02\x46\xf4\xfb\x33\xae\x1d\x90\xea\x48\x83\xdb", 1, 640, + "\xab\x22\x65\xb4\xc1\x68\x95\x55\x61\xf0\x43\x15", 96 }, + { 256, 128, 4, + "\xb5\x48\xe4\x93\x4f\x5c\x64\xd3\xc0\xf0\xb7\x8f\x7b\x4d\x88\x24\xaa\xc4" + "\x6b\x3c\x8d\x2c\xc3\x5e\xe4\xbf\xb2\x54\xe4\xfc\xba\xf7", + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02" + "\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04" + "\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01\x02\x03\x04\x05\x06" + "\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x01", + "\x77\x46\x0d\x6f\xb1\x87\xdb\xa9\x46\xad\xcd\xfb\xb7\xf9\x13\xa1", 1, 520, + "\x2e\xed\xe1\xdc\x64\x47\xc7\xaf\xc4\x41\x53\x58", 96 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/kat-app/hec_test.c b/test/kat-app/hec_test.c index d6d58681..f17b4318 100644 --- a/test/kat-app/hec_test.c +++ b/test/kat-app/hec_test.c @@ -35,21 +35,18 @@ #include "gcm_ctr_vectors_test.h" #include "utils.h" -int hec_test(struct IMB_MGR *mb_mgr); +int +hec_test(struct IMB_MGR *mb_mgr); static void test_32_bit(IMB_MGR *mgr, struct test_suite_context *ctx) { - static const uint32_t pf19_hec13[] = { - 0x660e4758, 0xcc076e69, 0xcb1f206b, - 0xa611502d, 0x4e1b7320, 0x0a196148, - 0xda034e4f, 0x5e116970, 0xea11646a, - 0xd70a6820, 0xa3186574, 0x41156375, - 0x0d077061, 0x9b1e6f20, 0x6601657a, - 0x5d1d6570, 0x130f2066, 0x631f696e, - 0x6013656e, 0x2e02614d, 0x1b012e61, - 0xd4182064, 0x9a0a6572, 0x2f162020 - }; + static const uint32_t pf19_hec13[] = { 0x660e4758, 0xcc076e69, 0xcb1f206b, 0xa611502d, + 0x4e1b7320, 0x0a196148, 0xda034e4f, 0x5e116970, + 0xea11646a, 0xd70a6820, 0xa3186574, 0x41156375, + 0x0d077061, 0x9b1e6f20, 0x6601657a, 0x5d1d6570, + 0x130f2066, 0x631f696e, 0x6013656e, 0x2e02614d, + 0x1b012e61, 0xd4182064, 0x9a0a6572, 0x2f162020 }; unsigned i; for (i = 0; i < DIM(pf19_hec13); i++) { @@ -65,8 +62,7 @@ test_32_bit(IMB_MGR *mgr, struct test_suite_context *ctx) out = IMB_HEC_32(mgr, in_p); if (out != expected_out) { - printf("\tHEC 32 - mismatch!\t0x%08lx\n", - (unsigned long) out); + printf("\tHEC 32 - mismatch!\t0x%08lx\n", (unsigned long) out); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); @@ -82,17 +78,15 @@ static void test_64_bit(IMB_MGR *mgr, struct test_suite_context *ctx) { static const uint64_t pf51_hec13[] = { - 0x550a4e4f502d4758, 0x48172c696e614b20, 0x8b0c696b616f7269, - 0x7415702073617720, 0x47025320656f4a20, 0x220a69616b754d20, - 0x8e12656375646f72, 0x231a202c6874696d, 0x731a65766144202c, - 0x181a6e6168742064, 0x6e0a726168636952, 0x790f2c646f6f4820, - 0x0517206f7420736b, 0x6e17646f6f472064, 0xf2044c2069655720, - 0x15094320616e6e41, 0x000f44202c6e6f73, 0xe9056e61202c6e69, - 0x9f156146202c6975, 0x80174b2073696e65, 0x471c6320666f2064, - 0x7203206563697262, 0x441f736d69746f68, 0x05042c657372756f, - 0x3d03616772756f42, 0x5f157559202c796b, 0x01066b6e61724620, - 0x6017754a202c7472, 0xe805207569716e61, 0x97186e6566664520, - 0xa808696863692d6e, 0xd21748202c6f754c, 0x8604726567726562 + 0x550a4e4f502d4758, 0x48172c696e614b20, 0x8b0c696b616f7269, 0x7415702073617720, + 0x47025320656f4a20, 0x220a69616b754d20, 0x8e12656375646f72, 0x231a202c6874696d, + 0x731a65766144202c, 0x181a6e6168742064, 0x6e0a726168636952, 0x790f2c646f6f4820, + 0x0517206f7420736b, 0x6e17646f6f472064, 0xf2044c2069655720, 0x15094320616e6e41, + 0x000f44202c6e6f73, 0xe9056e61202c6e69, 0x9f156146202c6975, 0x80174b2073696e65, + 0x471c6320666f2064, 0x7203206563697262, 0x441f736d69746f68, 0x05042c657372756f, + 0x3d03616772756f42, 0x5f157559202c796b, 0x01066b6e61724620, 0x6017754a202c7472, + 0xe805207569716e61, 0x97186e6566664520, 0xa808696863692d6e, 0xd21748202c6f754c, + 0x8604726567726562 }; unsigned i; @@ -104,13 +98,12 @@ test_64_bit(IMB_MGR *mgr, struct test_suite_context *ctx) #ifdef DEBUG if (!quiet_mode) printf("[64-bit %u] PF | HEC:\t0x%016llx", i + 1, - (unsigned long long)expected_out); + (unsigned long long) expected_out); #endif out = IMB_HEC_64(mgr, in_p); if (out != expected_out) { - printf("\tHEC 64 - mismatch!\t0x%016llx\n", - (unsigned long long) out); + printf("\tHEC 64 - mismatch!\t0x%016llx\n", (unsigned long long) out); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); diff --git a/test/kat-app/hmac_md5.json.c b/test/kat-app/hmac_md5.json.c index 18b60f5b..c7afcc8c 100644 --- a/test/kat-app/hmac_md5.json.c +++ b/test/kat-app/hmac_md5.json.c @@ -29,109 +29,96 @@ #include "mac_test.h" const struct mac_test hmac_md5_test_json[] = { - /* Vectors from https://tools.ietf.org/html/rfc2202 */ - {128, 128, 1, - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", - "\x48\x69\x20\x54\x68\x65\x72\x65", - "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d", 1, 64, - NULL, 0}, - {32, 128, 2, "\x4a\x65\x66\x65", - "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" - "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", - "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7\x38", 1, 224, - NULL, 0}, - {128, 128, 3, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", - "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6", 1, 400, - NULL, 0}, - {200, 128, 4, - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" - "\x13\x14\x15\x16\x17\x18\x19", - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", - "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47\x46\xff\xaa\x79", 1, 400, - NULL, 0}, - {128, 128, 5, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" - "\x6f\x6e", - "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95\x69\x0e\xfd\x4c", 1, 160, - NULL, 0}, - {640, 128, 6, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", - "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce\x61\xb9\xd0\xcd", 1, 432, - NULL, 0}, - {640, 128, 7, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" - "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" - "\x61", - "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e", 1, 584, - NULL, 0}, - {128, 96, 8, - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", - "\x48\x69\x20\x54\x68\x65\x72\x65", - "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8", 1, 64, NULL, 0}, - {32, 96, 9, "\x4a\x65\x66\x65", - "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" - "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", - "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31", 1, 224, NULL, 0}, - {128, 96, 10, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", - "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33", 1, 400, NULL, 0}, - {200, 96, 11, - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" - "\x13\x14\x15\x16\x17\x18\x19", - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", - "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47", 1, 400, NULL, 0}, - {128, 96, 12, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" - "\x6f\x6e", - "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95", 1, 160, NULL, 0}, - {640, 96, 13, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", - "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce", 1, 432, NULL, 0}, - {640, 96, 14, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" - "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" - "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" - "\x61", - "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62", 1, 584, NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + /* Vectors from https://tools.ietf.org/html/rfc2202 */ + { 128, 128, 1, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", + "\x48\x69\x20\x54\x68\x65\x72\x65", + "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d", 1, 64, NULL, 0 }, + { 32, 128, 2, "\x4a\x65\x66\x65", + "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" + "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", + "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7\x38", 1, 224, NULL, 0 }, + { 128, 128, 3, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", + "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6", 1, 400, NULL, 0 }, + { 200, 128, 4, + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" + "\x13\x14\x15\x16\x17\x18\x19", + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47\x46\xff\xaa\x79", 1, 400, NULL, 0 }, + { 128, 128, 5, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95\x69\x0e\xfd\x4c", 1, 160, NULL, 0 }, + { 640, 128, 6, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", + "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce\x61\xb9\xd0\xcd", 1, 432, NULL, 0 }, + { 640, 128, 7, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" + "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" + "\x61", + "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e", 1, 584, NULL, 0 }, + { 128, 96, 8, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", + "\x48\x69\x20\x54\x68\x65\x72\x65", "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8", 1, + 64, NULL, 0 }, + { 32, 96, 9, "\x4a\x65\x66\x65", + "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" + "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", + "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31", 1, 224, NULL, 0 }, + { 128, 96, 10, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", + "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33", 1, 400, NULL, 0 }, + { 200, 96, 11, + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" + "\x13\x14\x15\x16\x17\x18\x19", + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47", 1, 400, NULL, 0 }, + { 128, 96, 12, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95", 1, 160, NULL, 0 }, + { 640, 96, 13, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x2D\x20\x48\x61\x73\x68\x20\x4B\x65\x79\x20\x46\x69\x72\x73\x74", + "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce", 1, 432, NULL, 0 }, + { 640, 96, 14, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6E\x67\x20\x4C\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6E\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x4B\x65" + "\x79\x20\x61\x6E\x64\x20\x4C\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6E\x20" + "\x4F\x6E\x65\x20\x42\x6C\x6F\x63\x6B\x2D\x53\x69\x7A\x65\x20\x44\x61\x74" + "\x61", + "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62", 1, 584, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/kat-app/hmac_md5_test.c b/test/kat-app/hmac_md5_test.c index 66c90240..73e029c4 100644 --- a/test/kat-app/hmac_md5_test.c +++ b/test/kat-app/hmac_md5_test.c @@ -35,16 +35,14 @@ #include "utils.h" #include "mac_test.h" -int hmac_md5_test(struct IMB_MGR *mb_mgr); +int +hmac_md5_test(struct IMB_MGR *mb_mgr); extern const struct mac_test hmac_md5_test_json[]; static int -hmac_md5_job_ok(const struct mac_test *vec, - const struct IMB_JOB *job, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +hmac_md5_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const uint8_t *auth, + const uint8_t *padding, const size_t sizeof_padding) { if (job->status != IMB_STATUS_COMPLETED) { printf("line:%d job error status:%d ", __LINE__, job->status); @@ -52,11 +50,9 @@ hmac_md5_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + (vec->tagSize / 8)], + hexdump(stderr, "Target", &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding); return 0; } @@ -67,22 +63,17 @@ hmac_md5_job_ok(const struct mac_test *vec, return 0; } - if (memcmp(vec->tag, &auth[sizeof_padding], - vec->tagSize / 8)) { + if (memcmp(vec->tag, &auth[sizeof_padding], vec->tagSize / 8)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], - vec->tagSize / 8); - hexdump(stderr, "Expected", vec->tag, - vec->tagSize / 8); + hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); + hexdump(stderr, "Expected", vec->tag, vec->tagSize / 8); return 0; } return 1; } static int -test_hmac_md5(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const int num_jobs) +test_hmac_md5(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const int num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -92,16 +83,15 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, DECLARE_ALIGNED(uint8_t opad_hash[IMB_MD5_DIGEST_SIZE_IN_BYTES], 16); if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - (vec->tagSize / 8) + (sizeof(padding) * 2); + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -111,8 +101,7 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_MD5, vec->key, vec->keySize / 8, - ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_MD5, vec->key, vec->keySize / 8, ipad_hash, opad_hash); /* empty the manager */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -149,20 +138,17 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, * HMAC-MD5 requires 8 submissions to get one back */ if (num_jobs < 8) { - printf("%d Unexpected return from submit_job\n", - __LINE__); + printf("%d Unexpected return from submit_job\n", __LINE__); goto end; } - if (!hmac_md5_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!hmac_md5_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!hmac_md5_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!hmac_md5_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } @@ -172,7 +158,7 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: /* empty the manager before next tests */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -182,7 +168,7 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -190,25 +176,19 @@ test_hmac_md5(struct IMB_MGR *mb_mgr, } static void -test_hmac_md5_std_vectors(struct IMB_MGR *mb_mgr, - const int num_jobs, - struct test_suite_context *ts) +test_hmac_md5_std_vectors(struct IMB_MGR *mb_mgr, const int num_jobs, struct test_suite_context *ts) { const struct mac_test *v = hmac_md5_test_json; if (!quiet_mode) - printf("HMAC-MD5 standard test vectors (N jobs = %d):\n", - num_jobs); - for (; v->msg != NULL; v++) { + printf("HMAC-MD5 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("RFC2202 Test Case %zu key_len:%zu " "data_len:%zu digest_len:%zu\n", - v->tcId, - v->keySize / 8, - v->msgSize / 8, - v->tagSize / 8); + v->tcId, v->keySize / 8, v->msgSize / 8, v->tagSize / 8); #else printf("."); #endif @@ -229,7 +209,7 @@ test_hmac_md5_std_vectors(struct IMB_MGR *mb_mgr, } else { test_suite_update(ts, 1, 0); } - } + } if (!quiet_mode) printf("\n"); } @@ -245,5 +225,5 @@ hmac_md5_test(struct IMB_MGR *mb_mgr) test_hmac_md5_std_vectors(mb_mgr, num_jobs, &ts); errors = test_suite_end(&ts); - return errors; + return errors; } diff --git a/test/kat-app/hmac_sha1.json.c b/test/kat-app/hmac_sha1.json.c index 8c3e5407..bcd679a6 100644 --- a/test/kat-app/hmac_sha1.json.c +++ b/test/kat-app/hmac_sha1.json.c @@ -31,83 +31,83 @@ const struct mac_test hmac_sha1_test_kat_json[] = { /* * Test vectors from https://tools.ietf.org/html/rfc2202 */ - {160, 160, 1, - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b", - "\x48\x69\x20\x54\x68\x65\x72\x65", - "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46" - "\xbe\x00", - 1, 64, NULL, 0}, - {32, 160, 2, "\x4a\x65\x66\x65", - "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" - "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", - "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a" - "\x7c\x79", - 1, 224, NULL, 0}, - {160, 160, 3, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa", - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" - "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", - "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1" - "\x75\xd3", - 1, 400, NULL, 0}, - {200, 160, 4, - "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" - "\x13\x14\x15\x16\x17\x18\x19", - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", - "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72" - "\x35\xda", - 1, 400, NULL, 0}, - {160, 160, 5, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" - "\x6f\x6e", - "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a" - "\x5a\x04", - 1, 160, NULL, 0}, - {160, 96, 6, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c", - "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" - "\x6f\x6e", - "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1", 1, 160, NULL, 0}, - {640, 160, 7, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x4b\x65" - "\x79\x20\x2d\x20\x48\x61\x73\x68\x20\x4b\x65\x79\x20\x46\x69\x72\x73\x74", - "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40" - "\x21\x12", - 1, 432, NULL, 0}, - {640, 160, 8, - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", - "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72\x20" - "\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x4b\x65" - "\x79\x20\x61\x6e\x64\x20\x4c\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6e\x20" - "\x4f\x6e\x65\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x44\x61\x74" - "\x61", - "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff" - "\x1a\x91", - 1, 584, NULL, 0}, - /* Vectors from https://tools.ietf.org/html/rfc2202 */ - {392, 96, 9, - "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81" - "\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93" - "\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0", - "\x53\x61\x6d\x70\x6c\x65\x20\x23\x34", - "\x9e\xa8\x86\xef\xe2\x68\xdb\xec\xce\x42\x0c\x75", 1, 72, NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + { 160, 160, 1, + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" + "\x0b\x0b", + "\x48\x69\x20\x54\x68\x65\x72\x65", + "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46" + "\xbe\x00", + 1, 64, NULL, 0 }, + { 32, 160, 2, "\x4a\x65\x66\x65", + "\x77\x68\x61\x74\x20\x64\x6F\x20\x79\x61\x20\x77\x61\x6E\x74\x20\x66\x6F" + "\x72\x20\x6E\x6F\x74\x68\x69\x6E\x67\x3F", + "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a" + "\x7c\x79", + 1, 224, NULL, 0 }, + { 160, 160, 3, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa", + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" + "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", + "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1" + "\x75\xd3", + 1, 400, NULL, 0 }, + { 200, 160, 4, + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" + "\x13\x14\x15\x16\x17\x18\x19", + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72" + "\x35\xda", + 1, 400, NULL, 0 }, + { 160, 160, 5, + "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" + "\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a" + "\x5a\x04", + 1, 160, NULL, 0 }, + { 160, 96, 6, + "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" + "\x0c\x0c", + "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74\x69" + "\x6f\x6e", + "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1", 1, 160, NULL, 0 }, + { 640, 160, 7, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x4b\x65" + "\x79\x20\x2d\x20\x48\x61\x73\x68\x20\x4b\x65\x79\x20\x46\x69\x72\x73\x74", + "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40" + "\x21\x12", + 1, 432, NULL, 0 }, + { 640, 160, 8, + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" + "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", + "\x54\x65\x73\x74\x20\x55\x73\x69\x6e\x67\x20\x4c\x61\x72\x67\x65\x72\x20" + "\x54\x68\x61\x6e\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x4b\x65" + "\x79\x20\x61\x6e\x64\x20\x4c\x61\x72\x67\x65\x72\x20\x54\x68\x61\x6e\x20" + "\x4f\x6e\x65\x20\x42\x6c\x6f\x63\x6b\x2d\x53\x69\x7a\x65\x20\x44\x61\x74" + "\x61", + "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff" + "\x1a\x91", + 1, 584, NULL, 0 }, + /* Vectors from https://tools.ietf.org/html/rfc2202 */ + { 392, 96, 9, + "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81" + "\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93" + "\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0", + "\x53\x61\x6d\x70\x6c\x65\x20\x23\x34", + "\x9e\xa8\x86\xef\xe2\x68\xdb\xec\xce\x42\x0c\x75", 1, 72, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/kat-app/hmac_sha1_test.c b/test/kat-app/hmac_sha1_test.c index 130f3a39..21a71157 100644 --- a/test/kat-app/hmac_sha1_test.c +++ b/test/kat-app/hmac_sha1_test.c @@ -35,18 +35,16 @@ #include "utils.h" #include "mac_test.h" -int hmac_sha1_test(struct IMB_MGR *mb_mgr); +int +hmac_sha1_test(struct IMB_MGR *mb_mgr); -#define DIGEST96_SIZE 12 +#define DIGEST96_SIZE 12 #define MAX_BURST_JOBS 32 extern const struct mac_test hmac_sha1_test_kat_json[]; static int -hmac_sha1_job_ok(const struct mac_test *vec, - const struct IMB_JOB *job, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +hmac_sha1_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const uint8_t *auth, + const uint8_t *padding, const size_t sizeof_padding) { if (job->status != IMB_STATUS_COMPLETED) { printf("line:%d job error status:%d ", __LINE__, job->status); @@ -54,11 +52,9 @@ hmac_sha1_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + (vec->tagSize / 8)], + hexdump(stderr, "Target", &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding); return 0; } @@ -69,22 +65,17 @@ hmac_sha1_job_ok(const struct mac_test *vec, return 0; } - if (memcmp(vec->tag, &auth[sizeof_padding], - vec->tagSize / 8)) { + if (memcmp(vec->tag, &auth[sizeof_padding], vec->tagSize / 8)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], - vec->tagSize / 8); - hexdump(stderr, "Expected", vec->tag, - vec->tagSize / 8); + hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); + hexdump(stderr, "Expected", vec->tag, vec->tagSize / 8); return 0; } return 1; } static int -test_hmac_sha1(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const uint32_t num_jobs) +test_hmac_sha1(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const uint32_t num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -95,16 +86,15 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, DECLARE_ALIGNED(uint8_t opad_hash[IMB_SHA1_DIGEST_SIZE_IN_BYTES], 16); if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - (vec->tagSize / 8) + (sizeof(padding) * 2); + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -114,8 +104,8 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - vec->key, vec->keySize / 8, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, vec->key, vec->keySize / 8, ipad_hash, + opad_hash); for (i = 0; i < num_jobs; i++) { job = IMB_GET_NEXT_JOB(mb_mgr); @@ -149,20 +139,17 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, * job after 2nd submission */ if (num_jobs < 2) { - printf("%d Unexpected return from submit_job\n", - __LINE__); + printf("%d Unexpected return from submit_job\n", __LINE__); goto end; } - if (!hmac_sha1_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!hmac_sha1_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!hmac_sha1_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!hmac_sha1_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } @@ -172,7 +159,7 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: /* empty the manager before next tests */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -182,7 +169,7 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -190,11 +177,9 @@ test_hmac_sha1(struct IMB_MGR *mb_mgr, } static int -test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const uint32_t num_jobs) +test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const uint32_t num_jobs) { - struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = {NULL}; + struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; uint8_t padding[16]; uint8_t **auths = malloc(num_jobs * sizeof(void *)); uint32_t i = 0, jobs_rx = 0; @@ -204,16 +189,15 @@ test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, uint32_t completed_jobs = 0; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - (vec->tagSize / 8) + (sizeof(padding) * 2); + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -223,8 +207,8 @@ test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - vec->key, vec->keySize / 8, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, vec->key, vec->keySize / 8, ipad_hash, + opad_hash); while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < num_jobs) IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); @@ -260,8 +244,7 @@ test_hmac_sha1_burst(struct IMB_MGR *mb_mgr, err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } @@ -270,36 +253,32 @@ check_burst_jobs: job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); goto end; } - if (!hmac_sha1_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!hmac_sha1_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; jobs_rx++; } if (jobs_rx != num_jobs) { - completed_jobs = IMB_FLUSH_BURST(mb_mgr, - num_jobs - completed_jobs, - jobs); + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); if (completed_jobs == 0) { - printf("Expected %u jobs, received %u\n", - num_jobs, jobs_rx); + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); goto end; } goto check_burst_jobs; } ret = 0; - end: +end: for (i = 0; i < num_jobs; i++) { if (auths[i] != NULL) free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -307,11 +286,10 @@ check_burst_jobs: } static int -test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, +test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const uint32_t num_jobs) { - struct IMB_JOB *job, jobs[MAX_BURST_JOBS] = {0}; + struct IMB_JOB *job, jobs[MAX_BURST_JOBS] = { 0 }; uint8_t padding[16]; uint8_t **auths = malloc(num_jobs * sizeof(void *)); uint32_t i = 0, jobs_rx = 0; @@ -321,16 +299,15 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, uint32_t completed_jobs = 0; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - (vec->tagSize / 8) + (sizeof(padding) * 2); + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -340,8 +317,8 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, - vec->key, vec->keySize / 8, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SHA_1, vec->key, vec->keySize / 8, ipad_hash, + opad_hash); for (i = 0; i < num_jobs; i++) { job = &jobs[i]; @@ -366,17 +343,14 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, job->hash_alg = IMB_AUTH_HMAC_SHA_1; job->user_data = auths[i]; - } - completed_jobs = IMB_SUBMIT_HASH_BURST(mb_mgr, jobs, num_jobs, - IMB_AUTH_HMAC_SHA_1); + completed_jobs = IMB_SUBMIT_HASH_BURST(mb_mgr, jobs, num_jobs, IMB_AUTH_HMAC_SHA_1); if (completed_jobs != num_jobs) { int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } else { printf("submit_burst error: not enough " @@ -389,12 +363,11 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, job = &jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); goto end; } - if (!hmac_sha1_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!hmac_sha1_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; jobs_rx++; } @@ -405,13 +378,13 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: for (i = 0; i < num_jobs; i++) { if (auths[i] != NULL) free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -419,23 +392,19 @@ test_hmac_sha1_hash_burst(struct IMB_MGR *mb_mgr, } static void -test_hmac_sha1_std_vectors(struct IMB_MGR *mb_mgr, - const uint32_t num_jobs, +test_hmac_sha1_std_vectors(struct IMB_MGR *mb_mgr, const uint32_t num_jobs, struct test_suite_context *ts) { const struct mac_test *v = hmac_sha1_test_kat_json; if (!quiet_mode) - printf("HMAC-SHA1 standard test vectors (N jobs = %u):\n", num_jobs); - while (v->msg != NULL) { + printf("HMAC-SHA1 standard test vectors (N jobs = %u):\n", num_jobs); + while (v->msg != NULL) { if (!quiet_mode) { #ifdef DEBUG printf("RFC2202 Test Case %zu keySize:%zu " "msgSize:%zu tagSize:%zu\n", - v->tcId, - v->keySize / 8, - v->msgSize / 8, - v->tagSize / 8); + v->tcId, v->keySize / 8, v->msgSize / 8, v->tagSize / 8); #else printf("."); #endif @@ -447,15 +416,13 @@ test_hmac_sha1_std_vectors(struct IMB_MGR *mb_mgr, } else { test_suite_update(ts, 1, 0); } - if (test_hmac_sha1_burst(mb_mgr, v, - num_jobs)) { + if (test_hmac_sha1_burst(mb_mgr, v, num_jobs)) { printf("error #%zu - burst API\n", v->tcId); test_suite_update(ts, 0, 1); } else { test_suite_update(ts, 1, 0); } - if (test_hmac_sha1_hash_burst(mb_mgr, v, - num_jobs)) { + if (test_hmac_sha1_hash_burst(mb_mgr, v, num_jobs)) { printf("error #%zu - hash-only burst API\n", v->tcId); test_suite_update(ts, 0, 1); } else { @@ -463,7 +430,7 @@ test_hmac_sha1_std_vectors(struct IMB_MGR *mb_mgr, } v++; - } + } if (!quiet_mode) printf("\n"); } @@ -480,5 +447,5 @@ hmac_sha1_test(struct IMB_MGR *mb_mgr) test_hmac_sha1_std_vectors(mb_mgr, num_jobs, &ts); errors = test_suite_end(&ts); - return errors; + return errors; } diff --git a/test/kat-app/hmac_sha224.json.c b/test/kat-app/hmac_sha224.json.c index 2fe6ec8e..3ec7d4d6 100644 --- a/test/kat-app/hmac_sha224.json.c +++ b/test/kat-app/hmac_sha224.json.c @@ -65,8 +65,7 @@ const struct mac_test hmac_sha224_test_kat_json[] = { "\x0c\x0c\x0c", "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74" "\x69\x6f\x6e", - "\x0e\x2a\xea\x68\xa9\x0c\x8d\x37\xc9\x88\xbc\xdb\x9f\xca\x6f\xa8", - 1, 160, NULL, 0 }, + "\x0e\x2a\xea\x68\xa9\x0c\x8d\x37\xc9\x88\xbc\xdb\x9f\xca\x6f\xa8", 1, 160, NULL, 0 }, { 1048, 224, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" diff --git a/test/kat-app/hmac_sha256.json.c b/test/kat-app/hmac_sha256.json.c index b485a552..495feb3f 100644 --- a/test/kat-app/hmac_sha256.json.c +++ b/test/kat-app/hmac_sha256.json.c @@ -65,8 +65,7 @@ const struct mac_test hmac_sha256_test_kat_json[] = { "\x0c\x0c\x0c", "\x54\x65\x73\x74\x20\x57\x69\x74\x68\x20\x54\x72\x75\x6e\x63\x61\x74" "\x69\x6f\x6e", - "\xa3\xb6\x16\x74\x73\x10\x0e\xe0\x6e\x0c\x79\x6c\x29\x55\x55\x2b", - 1, 160, NULL, 0 }, + "\xa3\xb6\x16\x74\x73\x10\x0e\xe0\x6e\x0c\x79\x6c\x29\x55\x55\x2b", 1, 160, NULL, 0 }, { 1048, 256, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" diff --git a/test/kat-app/hmac_sha256_sha512_test.c b/test/kat-app/hmac_sha256_sha512_test.c index dc28428e..91fcf2e5 100644 --- a/test/kat-app/hmac_sha256_sha512_test.c +++ b/test/kat-app/hmac_sha256_sha512_test.c @@ -37,7 +37,8 @@ #define max_burst_jobs 32 -int hmac_sha256_sha512_test(struct IMB_MGR *mb_mgr); +int +hmac_sha256_sha512_test(struct IMB_MGR *mb_mgr); extern const struct mac_test hmac_sha224_test_kat_json[]; extern const struct mac_test hmac_sha256_test_kat_json[]; @@ -45,12 +46,8 @@ extern const struct mac_test hmac_sha384_test_kat_json[]; extern const struct mac_test hmac_sha512_test_kat_json[]; static int -hmac_shax_job_ok(const struct mac_test *vec, - const struct IMB_JOB *job, - const int sha_type, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +hmac_shax_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const int sha_type, + const uint8_t *auth, const uint8_t *padding, const size_t sizeof_padding) { const uint8_t *p_digest = NULL; @@ -73,11 +70,9 @@ hmac_shax_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + (vec->tagSize / 8)], + hexdump(stderr, "Target", &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding); return 0; } @@ -98,9 +93,7 @@ hmac_shax_job_ok(const struct mac_test *vec, } static int -test_hmac_shax(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const uint32_t num_jobs, +test_hmac_shax(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const uint32_t num_jobs, const int sha_type) { struct IMB_JOB *job; @@ -113,8 +106,8 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, IMB_HASH_ALG hash_type; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } switch (sha_type) { @@ -124,8 +117,7 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, case 512: break; default: - fprintf(stderr, "Wrong SHA type selection 'SHA-%d'!\n", - sha_type); + fprintf(stderr, "Wrong SHA type selection 'SHA-%d'!\n", sha_type); goto end2; } @@ -149,8 +141,7 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - (vec->tagSize / 8) + (sizeof(padding) * 2); + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -159,8 +150,7 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, } memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, - vec->keySize / 8, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, vec->keySize / 8, ipad_hash, opad_hash); /* empty the manager */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) @@ -213,22 +203,18 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, * job after 2nd submission */ if (num_jobs < 2) { - printf("%d Unexpected return from submit_job\n", - __LINE__); + printf("%d Unexpected return from submit_job\n", __LINE__); goto end; } - if (!hmac_shax_job_ok(vec, job, sha_type, - job->user_data, - padding, sizeof(padding))) + if (!hmac_shax_job_ok(vec, job, sha_type, job->user_data, padding, + sizeof(padding))) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!hmac_shax_job_ok(vec, job, sha_type, - job->user_data, - padding, sizeof(padding))) + if (!hmac_shax_job_ok(vec, job, sha_type, job->user_data, padding, sizeof(padding))) goto end; } @@ -238,13 +224,13 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: for (i = 0; i < num_jobs; i++) { if (auths[i] != NULL) free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -252,12 +238,10 @@ test_hmac_shax(struct IMB_MGR *mb_mgr, } static int -test_hmac_shax_burst(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const uint32_t num_jobs, +test_hmac_shax_burst(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const uint32_t num_jobs, const int sha_type) { - struct IMB_JOB *job, *jobs[max_burst_jobs] = {NULL}; + struct IMB_JOB *job, *jobs[max_burst_jobs] = { NULL }; uint8_t padding[16]; uint8_t **auths = malloc(num_jobs * sizeof(void *)); uint32_t i = 0, jobs_rx = 0, completed_jobs = 0; @@ -267,8 +251,8 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, IMB_HASH_ALG hash_type; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } switch (sha_type) { @@ -278,8 +262,7 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, case 512: break; default: - fprintf(stderr, "Wrong SHA type selection 'SHA-%d'!\n", - sha_type); + fprintf(stderr, "Wrong SHA type selection 'SHA-%d'!\n", sha_type); goto end2; } @@ -303,8 +286,7 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - (vec->tagSize / 8) + (sizeof(padding) * 2); + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -314,8 +296,7 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, - vec->keySize / 8, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, vec->keySize / 8, ipad_hash, opad_hash); while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < num_jobs) IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); @@ -366,47 +347,41 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } - check_burst_jobs: +check_burst_jobs: for (i = 0; i < completed_jobs; i++) { job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); goto end; } - if (!hmac_shax_job_ok(vec, job, sha_type, - job->user_data, - padding, sizeof(padding))) + if (!hmac_shax_job_ok(vec, job, sha_type, job->user_data, padding, sizeof(padding))) goto end; jobs_rx++; } if (jobs_rx != num_jobs) { - completed_jobs = IMB_FLUSH_BURST(mb_mgr, - num_jobs - completed_jobs, - jobs); + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); if (completed_jobs == 0) { - printf("Expected %u jobs, received %u\n", - num_jobs, jobs_rx); + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); goto end; } goto check_burst_jobs; } - ret = 0; + ret = 0; - end: +end: for (i = 0; i < num_jobs; i++) { if (auths[i] != NULL) free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -414,12 +389,10 @@ test_hmac_shax_burst(struct IMB_MGR *mb_mgr, } static int -test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const uint32_t num_jobs, - const int sha_type) +test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, const struct mac_test *vec, + const uint32_t num_jobs, const int sha_type) { - struct IMB_JOB *job, jobs[max_burst_jobs] = {0}; + struct IMB_JOB *job, jobs[max_burst_jobs] = { 0 }; uint8_t padding[16]; uint8_t **auths = NULL; uint32_t i = 0, jobs_rx = 0, completed_jobs = 0; @@ -433,8 +406,8 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, auths = malloc(num_jobs * sizeof(void *)); if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } switch (sha_type) { @@ -444,8 +417,7 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, case 512: break; default: - fprintf(stderr, "Wrong SHA type selection 'SHA-%d'!\n", - sha_type); + fprintf(stderr, "Wrong SHA type selection 'SHA-%d'!\n", sha_type); goto end2; } @@ -469,8 +441,7 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - (vec->tagSize / 8) + (sizeof(padding) * 2); + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -480,8 +451,7 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, memset(auths[i], -1, alloc_len); } - imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, - vec->keySize / 8, ipad_hash, opad_hash); + imb_hmac_ipad_opad(mb_mgr, hash_type, vec->key, vec->keySize / 8, ipad_hash, opad_hash); for (i = 0; i < num_jobs; i++) { job = &jobs[i]; @@ -521,17 +491,14 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, } job->user_data = auths[i]; - } - completed_jobs = IMB_SUBMIT_HASH_BURST(mb_mgr, jobs, num_jobs, - job->hash_alg); + completed_jobs = IMB_SUBMIT_HASH_BURST(mb_mgr, jobs, num_jobs, job->hash_alg); if (completed_jobs != num_jobs) { int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto end; } else { printf("submit_burst error: not enough " @@ -544,13 +511,11 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, job = &jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); goto end; } - if (!hmac_shax_job_ok(vec, job, sha_type, - job->user_data, - padding, sizeof(padding))) + if (!hmac_shax_job_ok(vec, job, sha_type, job->user_data, padding, sizeof(padding))) goto end; jobs_rx++; } @@ -561,13 +526,13 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: for (i = 0; i < num_jobs; i++) { if (auths[i] != NULL) free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -575,9 +540,7 @@ test_hmac_shax_hash_burst(struct IMB_MGR *mb_mgr, } static void -test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, - const int sha_type, - const uint32_t num_jobs, +test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, const int sha_type, const uint32_t num_jobs, struct test_suite_context *ts) { const struct mac_test *v; @@ -587,7 +550,7 @@ test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, v = hmac_sha224_test_kat_json; break; case 256: - v = hmac_sha256_test_kat_json; + v = hmac_sha256_test_kat_json; break; case 384: v = hmac_sha384_test_kat_json; @@ -597,16 +560,13 @@ test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, break; } if (!quiet_mode) - printf("HMAC-SHA%d standard test vectors (N jobs = %u):\n", - sha_type, num_jobs); - for (; v->msg != NULL; v++) { + printf("HMAC-SHA%d standard test vectors (N jobs = %u):\n", sha_type, num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("RFC4231 Test Case %zu key_len:%zu " "data_len:%zu\n", - v->tcId, - v->keySize / 8, - v->msgSize / 8); + v->tcId, v->keySize / 8, v->msgSize / 8); #else printf("."); #endif @@ -614,9 +574,9 @@ test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, /* @todo add truncation functionality to hmac_sha224 to hmac_sha 512*/ const int flag = ((sha_type == 224 && (v->tagSize / 8) != IMB_SHA224_DIGEST_SIZE_IN_BYTES) || - (sha_type == 256 && (v->tagSize / 8) != IMB_SHA256_DIGEST_SIZE_IN_BYTES) || - (sha_type == 384 && (v->tagSize / 8) != IMB_SHA384_DIGEST_SIZE_IN_BYTES) || - (sha_type == 512 && (v->tagSize / 8) != IMB_SHA512_DIGEST_SIZE_IN_BYTES)); + (sha_type == 256 && (v->tagSize / 8) != IMB_SHA256_DIGEST_SIZE_IN_BYTES) || + (sha_type == 384 && (v->tagSize / 8) != IMB_SHA384_DIGEST_SIZE_IN_BYTES) || + (sha_type == 512 && (v->tagSize / 8) != IMB_SHA512_DIGEST_SIZE_IN_BYTES)); if (flag) { #ifdef DEBUG @@ -653,12 +613,9 @@ test_hmac_shax_std_vectors(struct IMB_MGR *mb_mgr, int hmac_sha256_sha512_test(struct IMB_MGR *mb_mgr) { - const int sha_types_tab[] = { - 224, 256, 384, 512 - }; - static const char * const sha_names_tab[] = { - "HMAC-SHA224", "HMAC-SHA256", "HMAC-SHA384", "HMAC-SHA512" - }; + const int sha_types_tab[] = { 224, 256, 384, 512 }; + static const char *const sha_names_tab[] = { "HMAC-SHA224", "HMAC-SHA256", "HMAC-SHA384", + "HMAC-SHA512" }; unsigned i, num_jobs; int errors = 0; @@ -667,10 +624,9 @@ hmac_sha256_sha512_test(struct IMB_MGR *mb_mgr) test_suite_start(&ts, sha_names_tab[i]); for (num_jobs = 1; num_jobs <= max_burst_jobs; num_jobs++) - test_hmac_shax_std_vectors(mb_mgr, sha_types_tab[i], - num_jobs, &ts); + test_hmac_shax_std_vectors(mb_mgr, sha_types_tab[i], num_jobs, &ts); errors += test_suite_end(&ts); } - return errors; + return errors; } diff --git a/test/kat-app/hmac_sha384.json.c b/test/kat-app/hmac_sha384.json.c index 6cbb7360..c2950634 100644 --- a/test/kat-app/hmac_sha384.json.c +++ b/test/kat-app/hmac_sha384.json.c @@ -64,12 +64,11 @@ const struct mac_test hmac_sha384_test_kat_json[] = { "\x99\x81\x48\x08\x50\x00\x9c\xc5\x57\x7c\x6e\x1f\x57\x3b\x4e\x68\x01" "\xdd\x23\xc4\xa7\xd6\x79\xcc\xf8\xa3\x86\xc6\x74\xcf\xfb", 1, 400, NULL, 0 }, - { 160, 128, 5, - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c", - "\x3a\xbf\x34\xc3\x50\x3b\x2a\x23\xa4\x6e\xfc\x61\x9b\xae\xf8\x97", - "\xa3\xb6\x16\x74\x73\x10\x0e\xe0\x6e\x0c\x79\x6c\x29\x55\x55\x2b", - 1, 128, NULL, 0 }, + { 160, 128, 5, + "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" + "\x0c\x0c\x0c", + "\x3a\xbf\x34\xc3\x50\x3b\x2a\x23\xa4\x6e\xfc\x61\x9b\xae\xf8\x97", + "\xa3\xb6\x16\x74\x73\x10\x0e\xe0\x6e\x0c\x79\x6c\x29\x55\x55\x2b", 1, 128, NULL, 0 }, { 1048, 384, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" diff --git a/test/kat-app/hmac_sha512.json.c b/test/kat-app/hmac_sha512.json.c index 5f031df2..59041671 100644 --- a/test/kat-app/hmac_sha512.json.c +++ b/test/kat-app/hmac_sha512.json.c @@ -72,8 +72,7 @@ const struct mac_test hmac_sha512_test_kat_json[] = { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" "\x0c\x0c\x0c", "\x3a\xbf\x34\xc3\x50\x3b\x2a\x23\xa4\x6e\xfc\x61\x9b\xae\xf8\x97", - "\x41\x5f\xad\x62\x71\x58\x0a\x53\x1d\x41\x79\xbc\x89\x1d\x87\xa6", - 1, 128, NULL, 0 }, + "\x41\x5f\xad\x62\x71\x58\x0a\x53\x1d\x41\x79\xbc\x89\x1d\x87\xa6", 1, 128, NULL, 0 }, { 1048, 512, 6, "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" diff --git a/test/kat-app/kasumi_test.c b/test/kat-app/kasumi_test.c index ce54a96f..4b52819e 100644 --- a/test/kat-app/kasumi_test.c +++ b/test/kat-app/kasumi_test.c @@ -26,8 +26,8 @@ *****************************************************************************/ /*----------------------------------------------------------------------- -* KASUMI functional test -*-----------------------------------------------------------------------*/ + * KASUMI functional test + *-----------------------------------------------------------------------*/ #include #include @@ -41,16 +41,16 @@ #include "utils.h" #define KASUMIIVLEN 8 -#define PAD_LEN 16 +#define PAD_LEN 16 -int kasumi_test(struct IMB_MGR *mb_mgr); +int +kasumi_test(struct IMB_MGR *mb_mgr); static int validate_kasumi_f8_1_block(struct IMB_MGR *mb_mgr, const unsigned job_api); static int validate_kasumi_f8_1_bitblock(struct IMB_MGR *mb_mgr, const unsigned job_api); static int -validate_kasumi_f8_1_bitblock_offset(struct IMB_MGR *mb_mgr, - const unsigned job_api); +validate_kasumi_f8_1_bitblock_offset(struct IMB_MGR *mb_mgr, const unsigned job_api); static int validate_kasumi_f8_2_blocks(struct IMB_MGR *mb_mgr, const unsigned job_api); static int @@ -71,28 +71,24 @@ struct kasumi_test_case { /* kasumi f8 validation function pointer table */ struct kasumi_test_case kasumi_f8_func_tab[] = { - {validate_kasumi_f8_1_block, "validate_kasumi_f8_1_block"}, - {validate_kasumi_f8_1_bitblock, "validate_kasumi_f8_1_bitblock"}, - {validate_kasumi_f8_1_bitblock_offset, - "validate_kasumi_f8_1_bitblock_offset"}, - {validate_kasumi_f8_2_blocks, "validate_kasumi_f8_2_blocks"}, - {validate_kasumi_f8_3_blocks, "validate_kasumi_f8_3_blocks"}, - {validate_kasumi_f8_4_blocks, "validate_kasumi_f8_4_blocks"}, - {validate_kasumi_f8_n_blocks, "validate_kasumi_f8_n_blocks"} + { validate_kasumi_f8_1_block, "validate_kasumi_f8_1_block" }, + { validate_kasumi_f8_1_bitblock, "validate_kasumi_f8_1_bitblock" }, + { validate_kasumi_f8_1_bitblock_offset, "validate_kasumi_f8_1_bitblock_offset" }, + { validate_kasumi_f8_2_blocks, "validate_kasumi_f8_2_blocks" }, + { validate_kasumi_f8_3_blocks, "validate_kasumi_f8_3_blocks" }, + { validate_kasumi_f8_4_blocks, "validate_kasumi_f8_4_blocks" }, + { validate_kasumi_f8_n_blocks, "validate_kasumi_f8_n_blocks" } }; /* kasumi f9 validation function pointer table */ -struct kasumi_test_case kasumi_f9_func_tab[] = { - {validate_kasumi_f9, "validate_kasumi_f9"}, - {validate_kasumi_f9_user, "validate_kasumi_f9_user"} -}; +struct kasumi_test_case kasumi_f9_func_tab[] = { { validate_kasumi_f9, "validate_kasumi_f9" }, + { validate_kasumi_f9_user, + "validate_kasumi_f9_user" } }; static int -submit_kasumi_f8_jobs(struct IMB_MGR *mb_mgr, kasumi_key_sched_t **keys, - uint64_t **ivs, uint8_t ** const src, - uint8_t ** const dst, const uint32_t *bitlens, - const uint32_t *bit_offsets, const int dir, - const unsigned int num_jobs) +submit_kasumi_f8_jobs(struct IMB_MGR *mb_mgr, kasumi_key_sched_t **keys, uint64_t **ivs, + uint8_t **const src, uint8_t **const dst, const uint32_t *bitlens, + const uint32_t *bit_offsets, const int dir, const unsigned int num_jobs) { unsigned int i; unsigned int jobs_rx = 0; @@ -105,9 +101,9 @@ submit_kasumi_f8_jobs(struct IMB_MGR *mb_mgr, kasumi_key_sched_t **keys, job->cipher_mode = IMB_CIPHER_KASUMI_UEA1_BITLEN; job->src = src[i]; job->dst = dst[i]; - job->iv = (void *)ivs[i]; + job->iv = (void *) ivs[i]; job->iv_len_in_bytes = 8; - job->enc_keys = (uint8_t *)keys[i]; + job->enc_keys = (uint8_t *) keys[i]; job->key_len_in_bytes = 16; job->cipher_start_src_offset_in_bits = bit_offsets[i]; @@ -118,8 +114,7 @@ submit_kasumi_f8_jobs(struct IMB_MGR *mb_mgr, kasumi_key_sched_t **keys, if (job != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, i); + printf("%d error status:%d, job %u", __LINE__, job->status, i); return -1; } } else { @@ -137,8 +132,8 @@ submit_kasumi_f8_jobs(struct IMB_MGR *mb_mgr, kasumi_key_sched_t **keys, } static int -submit_kasumi_f9_job(struct IMB_MGR *mb_mgr, kasumi_key_sched_t *key, - uint8_t *src, uint8_t *tag, const uint32_t len) +submit_kasumi_f9_job(struct IMB_MGR *mb_mgr, kasumi_key_sched_t *key, uint8_t *src, uint8_t *tag, + const uint32_t len) { IMB_JOB *job; @@ -157,8 +152,7 @@ submit_kasumi_f9_job(struct IMB_MGR *mb_mgr, kasumi_key_sched_t *key, job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d", - __LINE__, job->status); + printf("%d error status:%d", __LINE__, job->status); return -1; } } else { @@ -169,7 +163,8 @@ submit_kasumi_f9_job(struct IMB_MGR *mb_mgr, kasumi_key_sched_t *key, return 0; } -static int validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) { int numKasumiTestVectors, i = 0; uint8_t *pKey = NULL; @@ -182,8 +177,7 @@ static int validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) uint8_t *pSrcBuff = srcBuff; uint64_t *pIV = &IV; - printf("Testing IMB_KASUMI_F8_1_BUFFER (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_1_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); kasumi_test_vectors = kasumi_f8_vectors; numKasumiTestVectors = numCipherTestVectors[0]; @@ -210,13 +204,12 @@ static int validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) uint32_t bitLen = byteLen * 8; uint32_t bitOffset = 0; - memcpy(pKey, kasumi_test_vectors[i].key, - kasumi_test_vectors[i].keyLenInBytes); + memcpy(pKey, kasumi_test_vectors[i].key, kasumi_test_vectors[i].keyLenInBytes); memcpy(srcBuff, kasumi_test_vectors[i].plaintext, kasumi_test_vectors[i].dataLenInBytes); memcpy(dstBuff, kasumi_test_vectors[i].ciphertext, kasumi_test_vectors[i].dataLenInBytes); - memcpy((uint8_t *)&IV, kasumi_test_vectors[i].iv, + memcpy((uint8_t *) &IV, kasumi_test_vectors[i].iv, kasumi_test_vectors[i].ivLenInBytes); /*setup the keysched to be used*/ @@ -229,22 +222,17 @@ static int validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) /* Validate Encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &pSrcBuff, - &pSrcBuff, &bitLen, &bitOffset, - IMB_DIR_ENCRYPT, 1); + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pSrcBuff, &pSrcBuff, &bitLen, + &bitOffset, IMB_DIR_ENCRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER(mgr, pKeySched, IV, srcBuff, - srcBuff, byteLen); + IMB_KASUMI_F8_1_BUFFER(mgr, pKeySched, IV, srcBuff, srcBuff, byteLen); /*check against the cipher test in the vector against the * encrypted * plaintext*/ - if (memcmp(srcBuff, dstBuff, - kasumi_test_vectors[i].dataLenInBytes) != 0) { + if (memcmp(srcBuff, dstBuff, kasumi_test_vectors[i].dataLenInBytes) != 0) { printf("kasumi_f8_1_block(Enc) vector:%d\n", i); - hexdump(stdout, "Actual:", srcBuff, - kasumi_test_vectors[i].dataLenInBytes); + hexdump(stdout, "Actual:", srcBuff, kasumi_test_vectors[i].dataLenInBytes); hexdump(stdout, "Expected:", dstBuff, kasumi_test_vectors[i].dataLenInBytes); free(pKey); @@ -257,19 +245,14 @@ static int validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) /*Validate Decrypt*/ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &pSrcBuff, - &pSrcBuff, &bitLen, + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pSrcBuff, &pSrcBuff, &bitLen, &bitOffset, IMB_DIR_DECRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER(mgr, pKeySched, IV, srcBuff, - srcBuff, byteLen); + IMB_KASUMI_F8_1_BUFFER(mgr, pKeySched, IV, srcBuff, srcBuff, byteLen); - if (memcmp(srcBuff, dstBuff, - kasumi_test_vectors[i].dataLenInBytes) != 0) { + if (memcmp(srcBuff, dstBuff, kasumi_test_vectors[i].dataLenInBytes) != 0) { printf("kasumi_f8_1_block(Dec) vector:%d\n", i); - hexdump(stdout, "Actual:", srcBuff, - kasumi_test_vectors[i].dataLenInBytes); + hexdump(stdout, "Actual:", srcBuff, kasumi_test_vectors[i].dataLenInBytes); hexdump(stdout, "Expected:", dstBuff, kasumi_test_vectors[i].dataLenInBytes); free(pKey); @@ -285,7 +268,8 @@ static int validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) } /* Shift right a buffer by "offset" bits, "offset" < 8 */ -static void buffer_shift_right(uint8_t *buffer, uint32_t length, uint8_t offset) +static void +buffer_shift_right(uint8_t *buffer, uint32_t length, uint8_t offset) { uint8_t prev_byte; const uint32_t length_in_bytes = (length + offset + 7) / CHAR_BIT; @@ -298,15 +282,14 @@ static void buffer_shift_right(uint8_t *buffer, uint32_t length, uint8_t offset) for (i = 0; i < length_in_bytes; i++) { const uint8_t curr_byte = buffer[i]; - buffer[i] = ((prev_byte & lower_byte_mask) << (8 - offset)) | - (curr_byte >> offset); + buffer[i] = ((prev_byte & lower_byte_mask) << (8 - offset)) | (curr_byte >> offset); prev_byte = curr_byte; } } -static void copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, - uint8_t *ciphBuff, const uint8_t *src_test, - const uint8_t *dst_test, const uint32_t byte_len) +static void +copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, uint8_t *ciphBuff, const uint8_t *src_test, + const uint8_t *dst_test, const uint32_t byte_len) { /* Reset all buffers to -1 (for padding check) and copy test vectors */ memset(wrkBuff, -1, (byte_len + PAD_LEN * 2)); @@ -316,14 +299,14 @@ static void copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, memcpy(ciphBuff + PAD_LEN, dst_test, byte_len); } -static int validate_kasumi_f8_1_bitblock(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f8_1_bitblock(IMB_MGR *mgr, const unsigned job_api) { int numKasumiTestVectors, i = 0; kasumi_key_sched_t *pKeySched = NULL; const cipherbit_test_vector_t *kasumi_bit_vectors = NULL; - printf("Testing IMB_KASUMI_F8_1_BUFFER_BIT (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_1_BUFFER_BIT (%s):\n", job_api ? "Job API" : "Direct API"); kasumi_bit_vectors = kasumi_f8_bitvectors; numKasumiTestVectors = numCipherTestVectors[1]; @@ -367,17 +350,14 @@ static int validate_kasumi_f8_1_bitblock(IMB_MGR *mgr, const unsigned job_api) uint8_t *ciphBufAftPad = ciphBuff + PAD_LEN; uint32_t bit_offset = 0; - const uint32_t byte_len = - (kasumi_bit_vectors[i].LenInBits + 7) / CHAR_BIT; + const uint32_t byte_len = (kasumi_bit_vectors[i].LenInBits + 7) / CHAR_BIT; const uint32_t bit_len = kasumi_bit_vectors[i].LenInBits; - memcpy(pKey, kasumi_bit_vectors[i].key, - kasumi_bit_vectors[i].keyLenInBytes); - memcpy((uint8_t *)&IV, kasumi_bit_vectors[i].iv, + memcpy(pKey, kasumi_bit_vectors[i].key, kasumi_bit_vectors[i].keyLenInBytes); + memcpy((uint8_t *) &IV, kasumi_bit_vectors[i].iv, kasumi_bit_vectors[i].ivLenInBytes); copy_test_bufs(plainBufBefPad, wrkBufBefPad, ciphBufBefPad, - kasumi_bit_vectors[i].plaintext, - kasumi_bit_vectors[i].ciphertext, + kasumi_bit_vectors[i].plaintext, kasumi_bit_vectors[i].ciphertext, byte_len); /* Setup the keysched to be used */ @@ -388,20 +368,16 @@ static int validate_kasumi_f8_1_bitblock(IMB_MGR *mgr, const unsigned job_api) /* Validate Encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &plainBufAftPad, - &wrkBufAftPad, &bit_len, - &bit_offset, IMB_DIR_ENCRYPT, 1); + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &plainBufAftPad, &wrkBufAftPad, + &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, - plainBufAftPad, wrkBufAftPad, + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, plainBufAftPad, wrkBufAftPad, bit_len, bit_offset); /* Check the ciphertext in the vector against the * encrypted plaintext */ if (membitcmp(wrkBufAftPad, ciphBufAftPad, 0, bit_len) != 0) { - printf("kasumi_f8_1_block(Enc) offset=0 vector:%d\n", - i); + printf("kasumi_f8_1_block(Enc) offset=0 vector:%d\n", i); hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); hexdump(stdout, "Expected:", ciphBufAftPad, byte_len); goto end; @@ -412,78 +388,60 @@ static int validate_kasumi_f8_1_bitblock(IMB_MGR *mgr, const unsigned job_api) hexdump(stdout, "Head", wrkBufBefPad, PAD_LEN); goto end; } - if (memcmp(wrkBufAftPad + byte_len - 1, - ciphBufAftPad + byte_len - 1, + if (memcmp(wrkBufAftPad + byte_len - 1, ciphBufAftPad + byte_len - 1, PAD_LEN + 1)) { printf("overwrite tail\n"); - hexdump(stdout, "Tail", wrkBufAftPad + byte_len - 1, - PAD_LEN + 1); + hexdump(stdout, "Tail", wrkBufAftPad + byte_len - 1, PAD_LEN + 1); goto end; } /* Validate Decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &ciphBufAftPad, - &wrkBufAftPad, &bit_len, - &bit_offset, IMB_DIR_DECRYPT, 1); + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &ciphBufAftPad, &wrkBufAftPad, + &bit_len, &bit_offset, IMB_DIR_DECRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, - ciphBufAftPad, wrkBufAftPad, + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, ciphBufAftPad, wrkBufAftPad, bit_len, bit_offset); - if (membitcmp(wrkBufAftPad, plainBufAftPad, - kasumi_bit_vectors[i].LenInBits, 0) != 0) { - printf("kasumi_f8_1_block(Dec) offset=0 vector:%d\n", - i); + if (membitcmp(wrkBufAftPad, plainBufAftPad, kasumi_bit_vectors[i].LenInBits, 0) != + 0) { + printf("kasumi_f8_1_block(Dec) offset=0 vector:%d\n", i); hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); hexdump(stdout, "Expected:", plainBufAftPad, byte_len); goto end; } copy_test_bufs(plainBufBefPad, wrkBufBefPad, ciphBufBefPad, - kasumi_bit_vectors[i].plaintext, - kasumi_bit_vectors[i].ciphertext, + kasumi_bit_vectors[i].plaintext, kasumi_bit_vectors[i].ciphertext, byte_len); - buffer_shift_right(plainBufBefPad, (byte_len + PAD_LEN * 2) * 8, - 4); - buffer_shift_right(ciphBufBefPad, (byte_len + PAD_LEN * 2) * 8, - 4); + buffer_shift_right(plainBufBefPad, (byte_len + PAD_LEN * 2) * 8, 4); + buffer_shift_right(ciphBufBefPad, (byte_len + PAD_LEN * 2) * 8, 4); bit_offset = 4; /* Validate Encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &plainBufAftPad, - &wrkBufAftPad, &bit_len, - &bit_offset, IMB_DIR_ENCRYPT, 1); + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &plainBufAftPad, &wrkBufAftPad, + &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, - plainBufAftPad, wrkBufAftPad, + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, plainBufAftPad, wrkBufAftPad, bit_len, bit_offset); /* Check the ciphertext in the vector against the * encrypted plaintext */ if (membitcmp(wrkBufAftPad, ciphBufAftPad, bit_len, 4) != 0) { - printf("kasumi_f8_1_block(Enc) offset=4 vector:%d\n", - i); + printf("kasumi_f8_1_block(Enc) offset=4 vector:%d\n", i); hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); hexdump(stdout, "Expected:", ciphBufAftPad, byte_len); goto end; } /*Validate Decrypt*/ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &ciphBufAftPad, - &wrkBufAftPad, &bit_len, - &bit_offset, IMB_DIR_DECRYPT, 1); + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &ciphBufAftPad, &wrkBufAftPad, + &bit_len, &bit_offset, IMB_DIR_DECRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, - ciphBufAftPad, wrkBufAftPad, + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, ciphBufAftPad, wrkBufAftPad, bit_len, bit_offset); - if (membitcmp(plainBufAftPad, plainBufAftPad, - bit_len, 4) != 0) { - printf("kasumi_f8_1_block(Dec) offset=4 vector:%d\n", - i); + if (membitcmp(plainBufAftPad, plainBufAftPad, bit_len, 4) != 0) { + printf("kasumi_f8_1_block(Dec) offset=4 vector:%d\n", i); hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); hexdump(stdout, "Expected:", plainBufAftPad, byte_len); goto end; @@ -498,8 +456,8 @@ end: return ret; } -static int validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, - const unsigned job_api) +static int +validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, const unsigned job_api) { int numKasumiTestVectors, i = 0; kasumi_key_sched_t *pKeySched = NULL; @@ -554,9 +512,8 @@ static int validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, for (i = 0, offset = 0, byteoffset = 0; i < numKasumiTestVectors; i++) { uint32_t bit_len = kasumi_bit_vectors->LenInBits[i]; - memcpy(pKey, &kasumi_bit_vectors->key[i][0], - kasumi_bit_vectors->keyLenInBytes); - memcpy((uint8_t *)&IV, &kasumi_bit_vectors->iv[i][0], + memcpy(pKey, &kasumi_bit_vectors->key[i][0], kasumi_bit_vectors->keyLenInBytes); + memcpy((uint8_t *) &IV, &kasumi_bit_vectors->iv[i][0], kasumi_bit_vectors->ivLenInBytes); /* Setup the keysched to be used */ @@ -569,28 +526,23 @@ static int validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, /* Validate Encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &pSrcBuff, - &pWrkBuff, &bit_len, + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pSrcBuff, &pWrkBuff, &bit_len, &offset, IMB_DIR_ENCRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, srcBuff, - wrkbuf, bit_len, offset); + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, srcBuff, wrkbuf, bit_len, + offset); /* Check against the ciphertext in the vector against the * encrypted plaintext */ - ret = membitcmp(wrkbuf, dstBuff, - kasumi_bit_vectors->LenInBits[i], offset); + ret = membitcmp(wrkbuf, dstBuff, kasumi_bit_vectors->LenInBits[i], offset); if (ret != 0) { printf("kasumi_f8_1_block_linear(Enc) vector:%d, " "index:%d\n", i, ret); hexdump(stdout, "Actual:", &wrkbuf[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / - CHAR_BIT); + (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); hexdump(stdout, "Expected:", &dstBuff[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / - CHAR_BIT); + (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); free(pKey); free(pKeySched); return 1; @@ -601,9 +553,8 @@ static int validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, for (i = 0, offset = 0, byteoffset = 0; i < numKasumiTestVectors; i++) { uint32_t bit_len = kasumi_bit_vectors->LenInBits[i]; - memcpy(pKey, &kasumi_bit_vectors->key[i][0], - kasumi_bit_vectors->keyLenInBytes); - memcpy((uint8_t *)&IV, &kasumi_bit_vectors->iv[i][0], + memcpy(pKey, &kasumi_bit_vectors->key[i][0], kasumi_bit_vectors->keyLenInBytes); + memcpy((uint8_t *) &IV, &kasumi_bit_vectors->iv[i][0], kasumi_bit_vectors->ivLenInBytes); /* Setup the keysched to be used */ @@ -616,26 +567,21 @@ static int validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, /* Validate Decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, - &pIV, &pDstBuff, - &pWrkBuff, &bit_len, + submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pDstBuff, &pWrkBuff, &bit_len, &offset, IMB_DIR_DECRYPT, 1); else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, dstBuff, - wrkbuf, bit_len, offset); + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, dstBuff, wrkbuf, bit_len, + offset); - ret = membitcmp(wrkbuf, srcBuff, - kasumi_bit_vectors->LenInBits[i], offset); + ret = membitcmp(wrkbuf, srcBuff, kasumi_bit_vectors->LenInBits[i], offset); if (ret != 0) { printf("kasumi_f8_1_block_linear(Dec) " "vector:%d,index:%d\n", i, ret); hexdump(stdout, "Actual:", &wrkbuf[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / - CHAR_BIT); + (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); hexdump(stdout, "Expected:", &srcBuff[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / - CHAR_BIT); + (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); free(pKey); free(pKeySched); return 1; @@ -650,26 +596,25 @@ static int validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, return 0; } -static int validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) { unsigned i = 0, numPackets = 2; - const cipher_test_vector_t *kasumi_test_vectors = - cipher_test_vectors[0]; - kasumi_key_sched_t *keySched[3] = {NULL}; + const cipher_test_vector_t *kasumi_test_vectors = cipher_test_vectors[0]; + kasumi_key_sched_t *keySched[3] = { NULL }; const int numKasumiTestVectors = numCipherTestVectors[0]; - uint8_t *key[3] = {NULL}; + uint8_t *key[3] = { NULL }; int keyLen = MAX_KEY_LEN; uint64_t iv[3]; - uint8_t *srcBuff[3] = {NULL}; - uint8_t *dstBuff[3] = {NULL}; + uint8_t *srcBuff[3] = { NULL }; + uint8_t *dstBuff[3] = { NULL }; uint32_t packetLen[3]; uint32_t bitLens[3]; uint32_t bitOffsets[3]; - uint64_t *pIV[3] = {NULL}; + uint64_t *pIV[3] = { NULL }; int ret = 1; - printf("Testing IMB_KASUMI_F8_2_BUFFER (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_2_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); if (!numKasumiTestVectors) { printf("No Kasumi vectors found !\n"); @@ -705,8 +650,7 @@ static int validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) goto exit; } - memcpy(key[i], kasumi_test_vectors[i].key, - kasumi_test_vectors[i].keyLenInBytes); + memcpy(key[i], kasumi_test_vectors[i].key, kasumi_test_vectors[i].keyLenInBytes); memcpy(srcBuff[i], kasumi_test_vectors[i].plaintext, kasumi_test_vectors[i].dataLenInBytes); @@ -714,38 +658,30 @@ static int validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) memcpy(dstBuff[i], kasumi_test_vectors[i].ciphertext, kasumi_test_vectors[i].dataLenInBytes); - memcpy(&iv[i], kasumi_test_vectors[i].iv, - kasumi_test_vectors[i].ivLenInBytes); + memcpy(&iv[i], kasumi_test_vectors[i].iv, kasumi_test_vectors[i].ivLenInBytes); /* init key schedule */ if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, key[i], keySched[i])) { printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); goto exit; } - } /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **)&pIV, - (uint8_t **)&srcBuff, - (uint8_t **)&srcBuff, - (uint32_t *)&bitLens, - (uint32_t *)&bitOffsets, - IMB_DIR_ENCRYPT, 2); + submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &srcBuff, + (uint8_t **) &srcBuff, (uint32_t *) &bitLens, + (uint32_t *) &bitOffsets, IMB_DIR_ENCRYPT, 2); else - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], - srcBuff[0], srcBuff[0], packetLen[0], - srcBuff[1], srcBuff[1], packetLen[1]); + IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], srcBuff[0], srcBuff[0], + packetLen[0], srcBuff[1], srcBuff[1], packetLen[1]); /* Compare the ciphertext with the encrypted plaintext */ for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], kasumi_test_vectors[i].ciphertext, - packetLen[i]) != 0) { + if (memcmp(srcBuff[i], kasumi_test_vectors[i].ciphertext, packetLen[i]) != 0) { printf("kasumi_f8_2_buffer(Enc) vector:%u\n", i); hexdump(stdout, "Actual:", srcBuff[i], packetLen[i]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[i].ciphertext, + hexdump(stdout, "Expected:", kasumi_test_vectors[i].ciphertext, packetLen[i]); goto exit; } @@ -756,21 +692,18 @@ static int validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the encrypt reverse order (direct API only) */ if (!job_api) { - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], - srcBuff[1], srcBuff[1], packetLen[1], - srcBuff[0], srcBuff[0], packetLen[0]); + IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], srcBuff[1], srcBuff[1], + packetLen[1], srcBuff[0], srcBuff[0], packetLen[0]); /* Compare the ciphertext with the encrypted plaintext */ for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], - kasumi_test_vectors[i].ciphertext, - packetLen[i]) != 0) { + if (memcmp(srcBuff[i], kasumi_test_vectors[i].ciphertext, packetLen[i]) != + 0) { printf("kasumi_f8_2_buffer(Enc) " - "vector:%u\n", i); - hexdump(stdout, "Actual:", srcBuff[i], - packetLen[i]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[i].ciphertext, + "vector:%u\n", + i); + hexdump(stdout, "Actual:", srcBuff[i], packetLen[i]); + hexdump(stdout, "Expected:", kasumi_test_vectors[i].ciphertext, packetLen[i]); goto exit; } @@ -780,23 +713,20 @@ static int validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) kasumi_test_vectors[i].dataLenInBytes); /* Test the encrypt reverse order (direct API only) */ - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], - srcBuff[0], srcBuff[0], packetLen[0], - srcBuff[2], srcBuff[2], packetLen[2]); + IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], srcBuff[0], srcBuff[0], + packetLen[0], srcBuff[2], srcBuff[2], packetLen[2]); /* Compare the ciphertext with the encrypted plaintext*/ for (i = 0; i < numPackets + 1; i++) { if (i == 1) continue; - if (memcmp(srcBuff[i], - kasumi_test_vectors[i].ciphertext, - packetLen[i]) != 0) { + if (memcmp(srcBuff[i], kasumi_test_vectors[i].ciphertext, packetLen[i]) != + 0) { printf("kasumi_f8_2_buffer(Enc) " - "vector:%u\n", i); - hexdump(stdout, "Actual:", srcBuff[i], - packetLen[i]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[i].ciphertext, + "vector:%u\n", + i); + hexdump(stdout, "Actual:", srcBuff[i], packetLen[i]); + hexdump(stdout, "Expected:", kasumi_test_vectors[i].ciphertext, packetLen[i]); goto exit; } @@ -804,25 +734,19 @@ static int validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) } /* Test the decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **)&pIV, - (uint8_t **)&dstBuff, - (uint8_t **)&dstBuff, - (uint32_t *)&bitLens, - (uint32_t *)&bitOffsets, - IMB_DIR_DECRYPT, 2); + submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &dstBuff, + (uint8_t **) &dstBuff, (uint32_t *) &bitLens, + (uint32_t *) &bitOffsets, IMB_DIR_DECRYPT, 2); else - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], - dstBuff[0], dstBuff[0], packetLen[0], - dstBuff[1], dstBuff[1], packetLen[1]); + IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], dstBuff[0], dstBuff[0], + packetLen[0], dstBuff[1], dstBuff[1], packetLen[1]); /* Compare the plaintext with the decrypted ciphertext */ for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[i].plaintext, - packetLen[i]) != 0) { + if (memcmp(dstBuff[i], kasumi_test_vectors[i].plaintext, packetLen[i]) != 0) { printf("kasumi_f8_2_buffer(Dec) vector:%u\n", i); hexdump(stdout, "Actual:", dstBuff[i], packetLen[i]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[i].plaintext, + hexdump(stdout, "Expected:", kasumi_test_vectors[i].plaintext, packetLen[i]); goto exit; } @@ -834,20 +758,18 @@ static int validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) memcpy(dstBuff[i], kasumi_test_vectors[i].ciphertext, kasumi_test_vectors[i].dataLenInBytes); - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], - dstBuff[1], dstBuff[1], packetLen[1], - dstBuff[0], dstBuff[0], packetLen[0]); + IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], dstBuff[1], dstBuff[1], + packetLen[1], dstBuff[0], dstBuff[0], packetLen[0]); /* Compare the plaintext with the decrypted ciphertext */ for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[i].plaintext, - packetLen[i]) != 0) { + if (memcmp(dstBuff[i], kasumi_test_vectors[i].plaintext, packetLen[i]) != + 0) { printf("kasumi_f8_2_buffer(Dec) " - "vector:%u\n", i); - hexdump(stdout, "Actual:", dstBuff[i], - packetLen[i]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[i].plaintext, + "vector:%u\n", + i); + hexdump(stdout, "Actual:", dstBuff[i], packetLen[i]); + hexdump(stdout, "Expected:", kasumi_test_vectors[i].plaintext, packetLen[i]); goto exit; } @@ -866,27 +788,27 @@ exit: return ret; } -static int validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) { unsigned i = 0, numPackets = 3; const cipher_test_vector_t *kasumi_test_vectors = NULL; - kasumi_key_sched_t *keySched[3] = {NULL}; + kasumi_key_sched_t *keySched[3] = { NULL }; - printf("Testing IMB_KASUMI_F8_3_BUFFER (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_3_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); kasumi_test_vectors = cipher_test_vectors[0]; const int numKasumiTestVectors = numCipherTestVectors[0]; - uint8_t *key[3] = {NULL}; + uint8_t *key[3] = { NULL }; int keyLen = MAX_KEY_LEN; uint64_t iv[3]; - uint8_t *srcBuff[3] = {NULL}; - uint8_t *dstBuff[3] = {NULL}; + uint8_t *srcBuff[3] = { NULL }; + uint8_t *dstBuff[3] = { NULL }; uint32_t packetLen[3]; uint32_t bitLens[3]; uint32_t bitOffsets[3]; - uint64_t *pIV[3] = {NULL}; + uint64_t *pIV[3] = { NULL }; int ret = 1; if (!numKasumiTestVectors) { @@ -923,8 +845,7 @@ static int validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) goto exit; } - memcpy(key[i], kasumi_test_vectors[0].key, - kasumi_test_vectors[0].keyLenInBytes); + memcpy(key[i], kasumi_test_vectors[0].key, kasumi_test_vectors[0].keyLenInBytes); memcpy(srcBuff[i], kasumi_test_vectors[0].plaintext, kasumi_test_vectors[0].dataLenInBytes); @@ -932,8 +853,7 @@ static int validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) memcpy(dstBuff[i], kasumi_test_vectors[0].ciphertext, kasumi_test_vectors[0].dataLenInBytes); - memcpy(&iv[i], kasumi_test_vectors[0].iv, - kasumi_test_vectors[0].ivLenInBytes); + memcpy(&iv[i], kasumi_test_vectors[0].iv, kasumi_test_vectors[0].ivLenInBytes); /* init key schedule */ if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, key[0], keySched[i])) { @@ -944,26 +864,20 @@ static int validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **)&pIV, - (uint8_t **)&srcBuff, - (uint8_t **)&srcBuff, - (uint32_t *)&bitLens, - (uint32_t *)&bitOffsets, - IMB_DIR_ENCRYPT, 3); + submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &srcBuff, + (uint8_t **) &srcBuff, (uint32_t *) &bitLens, + (uint32_t *) &bitOffsets, IMB_DIR_ENCRYPT, 3); else - IMB_KASUMI_F8_3_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], - srcBuff[0], srcBuff[0], srcBuff[1], - srcBuff[1], srcBuff[2], srcBuff[2], + IMB_KASUMI_F8_3_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], srcBuff[0], + srcBuff[0], srcBuff[1], srcBuff[1], srcBuff[2], srcBuff[2], packetLen[0]); /* Compare the ciphertext with the encrypted plaintext */ for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], kasumi_test_vectors[0].ciphertext, - packetLen[0]) != 0) { + if (memcmp(srcBuff[i], kasumi_test_vectors[0].ciphertext, packetLen[0]) != 0) { printf("kasumi_f8_3_buffer(Enc) vector:%u\n", i); hexdump(stdout, "Actual:", srcBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[0].ciphertext, + hexdump(stdout, "Expected:", kasumi_test_vectors[0].ciphertext, packetLen[0]); goto exit; } @@ -971,26 +885,20 @@ static int validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **)&pIV, - (uint8_t **)&dstBuff, - (uint8_t **)&dstBuff, - (uint32_t *)&bitLens, - (uint32_t *)&bitOffsets, - IMB_DIR_DECRYPT, 3); + submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &dstBuff, + (uint8_t **) &dstBuff, (uint32_t *) &bitLens, + (uint32_t *) &bitOffsets, IMB_DIR_DECRYPT, 3); else - IMB_KASUMI_F8_3_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], - dstBuff[0], dstBuff[0], dstBuff[1], - dstBuff[1], dstBuff[2], dstBuff[2], + IMB_KASUMI_F8_3_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], dstBuff[0], + dstBuff[0], dstBuff[1], dstBuff[1], dstBuff[2], dstBuff[2], packetLen[0]); /* Compare the plaintext with the decrypted ciphertext */ for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[0].plaintext, - packetLen[0]) != 0) { + if (memcmp(dstBuff[i], kasumi_test_vectors[0].plaintext, packetLen[0]) != 0) { printf("kasumi_f8_3_buffer(Dec) vector:%u\n", i); hexdump(stdout, "Actual:", dstBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[0].plaintext, + hexdump(stdout, "Expected:", kasumi_test_vectors[0].plaintext, packetLen[0]); goto exit; } @@ -1008,27 +916,27 @@ exit: return ret; } -static int validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) { unsigned i = 0, numPackets = 4; const cipher_test_vector_t *kasumi_test_vectors = NULL; - kasumi_key_sched_t *keySched[4] = {NULL}; + kasumi_key_sched_t *keySched[4] = { NULL }; - printf("Testing IMB_KASUMI_F8_4_BUFFER (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_4_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); kasumi_test_vectors = cipher_test_vectors[0]; const int numKasumiTestVectors = numCipherTestVectors[0]; - uint8_t *key[4] = {NULL}; + uint8_t *key[4] = { NULL }; int keyLen = MAX_KEY_LEN; uint64_t iv[4]; - uint8_t *srcBuff[4] = {NULL}; - uint8_t *dstBuff[4] = {NULL}; + uint8_t *srcBuff[4] = { NULL }; + uint8_t *dstBuff[4] = { NULL }; uint32_t packetLen[4]; uint32_t bitLens[4]; uint32_t bitOffsets[4]; - uint64_t *pIV[4] = {NULL}; + uint64_t *pIV[4] = { NULL }; int ret = 1; if (!numKasumiTestVectors) { @@ -1065,8 +973,7 @@ static int validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) goto exit; } - memcpy(key[i], kasumi_test_vectors[0].key, - kasumi_test_vectors[0].keyLenInBytes); + memcpy(key[i], kasumi_test_vectors[0].key, kasumi_test_vectors[0].keyLenInBytes); memcpy(srcBuff[i], kasumi_test_vectors[0].plaintext, kasumi_test_vectors[0].dataLenInBytes); @@ -1074,8 +981,7 @@ static int validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) memcpy(dstBuff[i], kasumi_test_vectors[0].ciphertext, kasumi_test_vectors[0].dataLenInBytes); - memcpy(&iv[i], kasumi_test_vectors[0].iv, - kasumi_test_vectors[0].ivLenInBytes); + memcpy(&iv[i], kasumi_test_vectors[0].iv, kasumi_test_vectors[0].ivLenInBytes); /* init key schedule */ if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, key[0], keySched[i])) { @@ -1086,27 +992,20 @@ static int validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **)&pIV, - (uint8_t **)&srcBuff, - (uint8_t **)&srcBuff, - (uint32_t *)&bitLens, - (uint32_t *)&bitOffsets, - IMB_DIR_ENCRYPT, 4); + submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &srcBuff, + (uint8_t **) &srcBuff, (uint32_t *) &bitLens, + (uint32_t *) &bitOffsets, IMB_DIR_ENCRYPT, 4); else - IMB_KASUMI_F8_4_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], - iv[3], srcBuff[0], srcBuff[0], - srcBuff[1], srcBuff[1], srcBuff[2], - srcBuff[2], srcBuff[3], srcBuff[3], - packetLen[0]); + IMB_KASUMI_F8_4_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], iv[3], srcBuff[0], + srcBuff[0], srcBuff[1], srcBuff[1], srcBuff[2], srcBuff[2], + srcBuff[3], srcBuff[3], packetLen[0]); /* Compare the ciphertext with the encrypted plaintext */ for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], kasumi_test_vectors[0].ciphertext, - packetLen[0]) != 0) { + if (memcmp(srcBuff[i], kasumi_test_vectors[0].ciphertext, packetLen[0]) != 0) { printf("kasumi_f8_4_buffer(Enc) vector:%u\n", i); hexdump(stdout, "Actual:", srcBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[0].ciphertext, + hexdump(stdout, "Expected:", kasumi_test_vectors[0].ciphertext, packetLen[0]); goto exit; } @@ -1114,27 +1013,20 @@ static int validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **)&pIV, - (uint8_t **)&dstBuff, - (uint8_t **)&dstBuff, - (uint32_t *)&bitLens, - (uint32_t *)&bitOffsets, - IMB_DIR_DECRYPT, 4); + submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &dstBuff, + (uint8_t **) &dstBuff, (uint32_t *) &bitLens, + (uint32_t *) &bitOffsets, IMB_DIR_DECRYPT, 4); else - IMB_KASUMI_F8_4_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], - iv[3], dstBuff[0], dstBuff[0], - dstBuff[1], dstBuff[1], dstBuff[2], - dstBuff[2], dstBuff[3], dstBuff[3], - packetLen[0]); + IMB_KASUMI_F8_4_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], iv[3], dstBuff[0], + dstBuff[0], dstBuff[1], dstBuff[1], dstBuff[2], dstBuff[2], + dstBuff[3], dstBuff[3], packetLen[0]); /*Compare the plaintext with the decrypted cipher text*/ for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[0].plaintext, - packetLen[0]) != 0) { + if (memcmp(dstBuff[i], kasumi_test_vectors[0].plaintext, packetLen[0]) != 0) { printf("kasumi_f8_4_buffer(Dec) vector:%u\n", i); hexdump(stdout, "Actual:", dstBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", - kasumi_test_vectors[0].plaintext, + hexdump(stdout, "Expected:", kasumi_test_vectors[0].plaintext, packetLen[0]); goto exit; } @@ -1152,23 +1044,23 @@ exit: return ret; } -static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) { - kasumi_key_sched_t *pKeySched[NUM_SUPPORTED_BUFFERS] = {NULL}; + kasumi_key_sched_t *pKeySched[NUM_SUPPORTED_BUFFERS] = { NULL }; uint64_t IV[NUM_SUPPORTED_BUFFERS]; uint64_t *pIV[NUM_SUPPORTED_BUFFERS]; uint32_t buffLenInBytes[NUM_SUPPORTED_BUFFERS]; - uint8_t *srcBuff[NUM_SUPPORTED_BUFFERS] = {NULL}; - uint8_t *refBuff[NUM_SUPPORTED_BUFFERS] = {NULL}; - uint8_t *key[NUM_SUPPORTED_BUFFERS] = {NULL}; + uint8_t *srcBuff[NUM_SUPPORTED_BUFFERS] = { NULL }; + uint8_t *refBuff[NUM_SUPPORTED_BUFFERS] = { NULL }; + uint8_t *key[NUM_SUPPORTED_BUFFERS] = { NULL }; uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; unsigned i = 0, j = 0; int ret = -1; - printf("Testing IMB_KASUMI_F8_N_BUFFER (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_N_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); /* Allocate memory for the buffers fill them with data */ for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { @@ -1203,7 +1095,7 @@ static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) goto exit; } - IV[i] = (uint64_t)i; + IV[i] = (uint64_t) i; pIV[i] = &IV[i]; } @@ -1222,19 +1114,14 @@ static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, - (uint64_t **)pIV, - (uint8_t **)srcBuff, - (uint8_t **)srcBuff, - (uint32_t *)bitLens, - (uint32_t *)bitOffsets, + submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, + (uint8_t **) srcBuff, (uint8_t **) srcBuff, + (uint32_t *) bitLens, (uint32_t *) bitOffsets, IMB_DIR_ENCRYPT, i + 1); else /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, - (const void * const *)srcBuff, - (void **)srcBuff, - buffLenInBytes, i + 1); + IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, + (void **) srcBuff, buffLenInBytes, i + 1); if (srcBuff[i] == NULL) { printf("N buffer failure\n"); goto exit; @@ -1242,33 +1129,26 @@ static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the Decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, - (uint64_t **)pIV, - (uint8_t **)srcBuff, - (uint8_t **)srcBuff, - (uint32_t *)bitLens, - (uint32_t *)bitOffsets, + submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, + (uint8_t **) srcBuff, (uint8_t **) srcBuff, + (uint32_t *) bitLens, (uint32_t *) bitOffsets, IMB_DIR_DECRYPT, i + 1); else /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, - (const void * const *)srcBuff, - (void **)srcBuff, - buffLenInBytes, i + 1); + IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, + (void **) srcBuff, buffLenInBytes, i + 1); if (srcBuff[i] == NULL) { printf("N buffer failure\n"); goto exit; } for (j = 0; j <= i; j++) { - if (memcmp(srcBuff[j], refBuff[j], - buffLenInBytes[j]) != 0) { + if (memcmp(srcBuff[j], refBuff[j], buffLenInBytes[j]) != 0) { printf("kasumi_f8_n_buffer equal sizes, " - "numBuffs:%u\n", i + 1); - hexdump(stdout, "Actual:", srcBuff[j], - buffLenInBytes[j]); - hexdump(stdout, "Expected:", refBuff[j], - buffLenInBytes[j]); + "numBuffs:%u\n", + i + 1); + hexdump(stdout, "Actual:", srcBuff[j], buffLenInBytes[j]); + hexdump(stdout, "Expected:", refBuff[j], buffLenInBytes[j]); goto exit; } } @@ -1291,19 +1171,14 @@ static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, - (uint64_t **)pIV, - (uint8_t **)srcBuff, - (uint8_t **)srcBuff, - (uint32_t *)bitLens, - (uint32_t *)bitOffsets, + submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, + (uint8_t **) srcBuff, (uint8_t **) srcBuff, + (uint32_t *) bitLens, (uint32_t *) bitOffsets, IMB_DIR_DECRYPT, i + 1); else /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, - (const void * const *)srcBuff, - (void **)srcBuff, - buffLenInBytes, i + 1); + IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, + (void **) srcBuff, buffLenInBytes, i + 1); if (srcBuff[i] == NULL) { printf("N buffer failure\n"); goto exit; @@ -1311,40 +1186,32 @@ static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the Decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, - (uint64_t **)pIV, - (uint8_t **)srcBuff, - (uint8_t **)srcBuff, - (uint32_t *)bitLens, - (uint32_t *)bitOffsets, + submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, + (uint8_t **) srcBuff, (uint8_t **) srcBuff, + (uint32_t *) bitLens, (uint32_t *) bitOffsets, IMB_DIR_DECRYPT, i + 1); else /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, - (const void * const *)srcBuff, - (void **)srcBuff, - buffLenInBytes, i + 1); + IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, + (void **) srcBuff, buffLenInBytes, i + 1); if (srcBuff[i] == NULL) { printf("N buffer failure\n"); goto exit; } for (j = 0; j <= i; j++) { - if (memcmp(srcBuff[j], refBuff[j], - buffLenInBytes[j]) != 0) { + if (memcmp(srcBuff[j], refBuff[j], buffLenInBytes[j]) != 0) { printf("kasumi_f8_n_buffer increasing sizes, " - "numBuffs:%u\n", i + 1); - hexdump(stdout, "Actual:", srcBuff[j], - buffLenInBytes[j]); - hexdump(stdout, "Expected:", refBuff[j], - buffLenInBytes[j]); + "numBuffs:%u\n", + i + 1); + hexdump(stdout, "Actual:", srcBuff[j], buffLenInBytes[j]); + hexdump(stdout, "Expected:", refBuff[j], buffLenInBytes[j]); goto exit; } } } - printf("[%s]: PASS, 1 to %u buffers of increasing size.\n", - __FUNCTION__, i); + printf("[%s]: PASS, 1 to %u buffers of increasing size.\n", __FUNCTION__, i); /* Testing multiple buffers of decreasing size */ for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { @@ -1362,18 +1229,13 @@ static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, - (uint64_t **)pIV, - (uint8_t **)srcBuff, - (uint8_t **)srcBuff, - (uint32_t *)bitLens, - (uint32_t *)bitOffsets, + submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, + (uint8_t **) srcBuff, (uint8_t **) srcBuff, + (uint32_t *) bitLens, (uint32_t *) bitOffsets, IMB_DIR_DECRYPT, i + 1); else - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, - (const void * const *)srcBuff, - (void **)srcBuff, - buffLenInBytes, i + 1); + IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, + (void **) srcBuff, buffLenInBytes, i + 1); if (srcBuff[i] == NULL) { printf("N buffer failure\n"); goto exit; @@ -1381,40 +1243,32 @@ static int validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) /* Test the Decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, - (uint64_t **)pIV, - (uint8_t **)srcBuff, - (uint8_t **)srcBuff, - (uint32_t *)bitLens, - (uint32_t *)bitOffsets, + submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, + (uint8_t **) srcBuff, (uint8_t **) srcBuff, + (uint32_t *) bitLens, (uint32_t *) bitOffsets, IMB_DIR_DECRYPT, i + 1); else - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, - (const void * const *)srcBuff, - (void **)srcBuff, - buffLenInBytes, i + 1); + IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, + (void **) srcBuff, buffLenInBytes, i + 1); if (srcBuff[i] == NULL) { printf("N buffer failure\n"); goto exit; } for (j = 0; j <= i; j++) { - if (memcmp(srcBuff[j], refBuff[j], - buffLenInBytes[j]) != 0) { + if (memcmp(srcBuff[j], refBuff[j], buffLenInBytes[j]) != 0) { printf("kasumi_f8_n_buffer decreasing sizes, " - "numBuffs:%u\n", i + 1); - hexdump(stdout, "Actual:", srcBuff[j], - buffLenInBytes[j]); - hexdump(stdout, "Expected:", refBuff[j], - buffLenInBytes[j]); + "numBuffs:%u\n", + i + 1); + hexdump(stdout, "Actual:", srcBuff[j], buffLenInBytes[j]); + hexdump(stdout, "Expected:", refBuff[j], buffLenInBytes[j]); goto exit; } } } ret = 0; - printf("[%s]: PASS, 1 to %u buffers of decreasing size.\n", - __FUNCTION__, i); + printf("[%s]: PASS, 1 to %u buffers of decreasing size.\n", __FUNCTION__, i); exit: /* free up test buffers */ for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { @@ -1427,7 +1281,8 @@ exit: return ret; } -static int validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) { kasumi_key_sched_t *pKeySched = NULL; uint8_t *pKey = NULL; @@ -1438,8 +1293,7 @@ static int validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) hash_test_vector_t *kasumiF9_test_vectors = NULL; int ret = 1; - printf("Testing IMB_KASUMI_F9_1_BUFFER (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F9_1_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); kasumiF9_test_vectors = kasumi_f9_vectors; numKasumiF9TestVectors = numHashTestVectors[0]; @@ -1464,13 +1318,11 @@ static int validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) for (i = 0; i < numKasumiF9TestVectors; i++) { uint32_t byteLen = kasumiF9_test_vectors[i].lengthInBytes; - memcpy(pKey, kasumiF9_test_vectors[i].key, - kasumiF9_test_vectors[i].keyLenInBytes); + memcpy(pKey, kasumiF9_test_vectors[i].key, kasumiF9_test_vectors[i].keyLenInBytes); memcpy(srcBuff, kasumiF9_test_vectors[i].input, byteLen); - memcpy(digest, kasumiF9_test_vectors[i].exp_out, - IMB_KASUMI_DIGEST_SIZE); + memcpy(digest, kasumiF9_test_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE); if (IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, pKey, pKeySched)) { printf("IMB_KASUMI_INIT_F9_KEY_SCHED()error\n"); @@ -1479,19 +1331,14 @@ static int validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) /* Test F9 integrity */ if (job_api) - submit_kasumi_f9_job(mgr, pKeySched, srcBuff, - digest, byteLen); + submit_kasumi_f9_job(mgr, pKeySched, srcBuff, digest, byteLen); else - IMB_KASUMI_F9_1_BUFFER(mgr, pKeySched, srcBuff, - byteLen, digest); + IMB_KASUMI_F9_1_BUFFER(mgr, pKeySched, srcBuff, byteLen, digest); /* Compare the digest with the expected in the vectors */ - if (memcmp(digest, kasumiF9_test_vectors[i].exp_out, - IMB_KASUMI_DIGEST_SIZE) != 0) { - hexdump(stdout, "Actual", digest, - IMB_KASUMI_DIGEST_SIZE); - hexdump(stdout, "Expected", - kasumiF9_test_vectors[i].exp_out, + if (memcmp(digest, kasumiF9_test_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE) != 0) { + hexdump(stdout, "Actual", digest, IMB_KASUMI_DIGEST_SIZE); + hexdump(stdout, "Expected", kasumiF9_test_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE); printf("F9 integrity %d Failed\n", i); goto exit; @@ -1499,15 +1346,15 @@ static int validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) } ret = 0; - printf("[%s]: PASS, for %d single buffers.\n", __FUNCTION__, - numKasumiF9TestVectors); + printf("[%s]: PASS, for %d single buffers.\n", __FUNCTION__, numKasumiF9TestVectors); exit: free(pKey); free(pKeySched); return ret; } -static int validate_kasumi_f9_user(IMB_MGR *mgr, const unsigned job_api) +static int +validate_kasumi_f9_user(IMB_MGR *mgr, const unsigned job_api) { int numKasumiF9IV_TestVectors = 0, i = 0; hash_iv_test_vector_t *kasumiF9_vectors = NULL; @@ -1525,7 +1372,7 @@ static int validate_kasumi_f9_user(IMB_MGR *mgr, const unsigned job_api) uint32_t direction; int ret = 1; - (void)job_api; /* unused parameter */ + (void) job_api; /* unused parameter */ if (!numKasumiF9IV_TestVectors) { printf("No Kasumi vectors found !\n"); @@ -1546,14 +1393,12 @@ static int validate_kasumi_f9_user(IMB_MGR *mgr, const unsigned job_api) /* Create the test data */ for (i = 0; i < numKasumiF9IV_TestVectors; i++) { - memcpy(pKey, kasumiF9_vectors[i].key, - kasumiF9_vectors[i].keyLenInBytes); + memcpy(pKey, kasumiF9_vectors[i].key, kasumiF9_vectors[i].keyLenInBytes); memcpy(srcBuff, kasumiF9_vectors[i].input, (kasumiF9_vectors[i].lengthInBits + 7 / CHAR_BIT)); - memcpy(iv, kasumiF9_vectors[i].iv, - kasumiF9_vectors[i].ivLenInBytes); + memcpy(iv, kasumiF9_vectors[i].iv, kasumiF9_vectors[i].ivLenInBytes); direction = kasumiF9_vectors[i].direction; @@ -1564,14 +1409,11 @@ static int validate_kasumi_f9_user(IMB_MGR *mgr, const unsigned job_api) } /* Test the integrity for f9_user with IV */ IMB_KASUMI_F9_1_BUFFER_USER(mgr, pKeySched, iv[0], srcBuff, - kasumiF9_vectors[i].lengthInBits, - digest, direction); + kasumiF9_vectors[i].lengthInBits, digest, direction); /* Compare the digest with the expected in the vectors */ - if (memcmp(digest, kasumiF9_vectors[i].exp_out, - IMB_KASUMI_DIGEST_SIZE) != 0) { - hexdump(stdout, "digest", digest, - IMB_KASUMI_DIGEST_SIZE); + if (memcmp(digest, kasumiF9_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE) != 0) { + hexdump(stdout, "digest", digest, IMB_KASUMI_DIGEST_SIZE); hexdump(stdout, "exp_out", kasumiF9_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE); printf("direction %u\n", direction); @@ -1588,7 +1430,8 @@ exit: return ret; } -int kasumi_test(struct IMB_MGR *mb_mgr) +int +kasumi_test(struct IMB_MGR *mb_mgr) { struct test_suite_context ts; int errors = 0; diff --git a/test/kat-app/kasumi_test_vectors.h b/test/kat-app/kasumi_test_vectors.h index c5bffe0d..d5ffc7b1 100644 --- a/test/kat-app/kasumi_test_vectors.h +++ b/test/kat-app/kasumi_test_vectors.h @@ -29,12 +29,12 @@ #ifndef __KASUMI_TEST_VECTORS_H__ #define __KASUMI_TEST_VECTORS_H__ -#define MAX_DATA_LEN (2500) -#define MAX_KEY_LEN (32) -#define MAX_IV_LEN (16) -#define NUM_SUPPORTED_BUFFERS (16) +#define MAX_DATA_LEN (2500) +#define MAX_KEY_LEN (32) +#define MAX_IV_LEN (16) +#define NUM_SUPPORTED_BUFFERS (16) #define MAX_SIZE_IN_BYTES_1024 (1024) -#define MAX_BIT_BUFFERS (6) +#define MAX_BIT_BUFFERS (6) typedef struct cipher_test_vector_s { uint32_t dataLenInBytes; @@ -85,1075 +85,978 @@ typedef struct hash_iv_test_vector_s { static const cipherbit_test_linear_vector_t kasumi_f8_linear_bitvectors = { - {798, 510, 253, 120, 837}, - 16, - 8, - {0x7e, 0xc6, 0x12, 0x72, 0x74, 0x3b, 0xf1, 0x61, 0x47, - 0x26, 0x44, 0x6a, 0x6c, 0x38, 0xce, 0xd1, 0x66, 0xf6, - 0xca, 0x76, 0xeb, 0x54, 0x30, 0x4, 0x42, 0x86, 0x34, - 0x6c, 0xef, 0x13, 0xf, 0x92, 0x92, 0x2b, 0x3, 0x45, - 0xd, 0x3a, 0x99, 0x75, 0xe5, 0xbd, 0x2e, 0xa0, 0xeb, - 0x55, 0xad, 0x8e, 0x1b, 0x19, 0x9e, 0x3e, 0xc4, 0x31, - 0x60, 0x20, 0xe9, 0xa1, 0xb2, 0x85, 0xe7, 0x62, 0x79, - 0x53, 0x59, 0xb7, 0xbd, 0xfd, 0x39, 0xbe, 0xf4, 0xb2, - 0x48, 0x45, 0x83, 0xd5, 0xaf, 0xe0, 0x82, 0xae, 0xe6, - 0x38, 0xbf, 0x5f, 0xd5, 0xa6, 0x6, 0x19, 0x39, 0x1, - 0xa0, 0x8f, 0x4a, 0xb4, 0x1a, 0xab, 0x9b, 0x13, 0x48, - 0x80, 0x40, 0x44, 0x48, 0xc7, 0x81, 0x80, 0x94, 0xe9, - 0xf, 0xf4, 0xfd, 0x5f, 0x8d, 0xd8, 0x1e, 0xac, 0xa0, - 0x9e, 0xd6, 0x66, 0xda, 0xc6, 0xef, 0x68, 0xde, 0xa2, - 0xaf, 0x31, 0x6a, 0x31, 0x54, 0x34, 0x6f, 0xec, 0xbd, - 0x25, 0x18, 0x93, 0xed, 0x40, 0xd9, 0xfe, 0x8d, 0xb3, - 0x8e, 0xf1, 0xa3, 0xc4, 0x73, 0xe4, 0xec, 0x54, 0x40, - 0xdd, 0xac, 0x8, 0x4c, 0x3e, 0x4, 0xaa, 0x7e, 0x85, - 0xa7, 0x69, 0x81, 0xba, 0x68, 0x24, 0xc1, 0xbf, 0xb1, - 0xab, 0x48, 0x54, 0x72, 0x2, 0x9b, 0x71, 0xd8, 0x8, - 0xce, 0x33, 0xe2, 0xcc, 0x3c, 0xb, 0x5f, 0xc1, 0xf3, - 0xde, 0x8a, 0x6d, 0xc6, 0x6b, 0x1f, 0x56, 0xce, 0x22, - 0xf, 0xc4, 0x85, 0x9c, 0x62, 0x2b, 0xd2, 0x4e, 0xa1, - 0xa, 0x3, 0xf4, 0x20, 0x4c, 0xd, 0xd3, 0x41, 0x26, - 0xd, 0xfd, 0xa1, 0x43, 0x59, 0x4c, 0xbc, 0x1e, 0xd7, - 0xa2, 0x16, 0x4, 0xcf, 0xbd, 0x58, 0x7a, 0xc6, 0xae, - 0x47, 0x23, 0x58, 0x82, 0x78, 0x47, 0x80, 0xda, 0xd, - 0x5a, 0x42, 0xa3, 0x90, 0x14, 0xdb, 0x8e, 0x9b, 0x5e, - 0x8d, 0x1e, 0xc8, 0x6e, 0x1d, 0x20, 0xda, 0x36, 0xa8, - 0xb3, 0x95, 0x62, 0x64, 0xb3, 0x1d, 0x15, 0xf0, 0x31, - 0xed, 0x25, 0xe4, 0x69, 0x40, 0x46, 0x71, 0x9f, 0x16, - 0x66, 0x5f, 0xe3, 0x1a, 0x70, 0xd9, 0x2c, 0x83, 0x4, - 0x3b, 0x50, 0x7d, 0xda, 0xd2, 0x1b, 0xf5, 0xe6, 0x46, - 0x98, 0xe0, 0xcf, 0x22, 0x2a, 0x18, 0xc3, 0xa2, 0xf1, - 0xcc, 0x3b, 0x22, 0xcc, 0x3d, 0x4c, 0x37, 0x96, 0x58, - 0x0}, - {0xd1, 0xe2, 0xde, 0x70, 0xee, 0xf8, 0x6c, 0x69, 0x64, 0xfb, 0x54, 0x2b, - 0xc2, 0xd4, 0x60, 0xaa, 0xbf, 0xaa, 0x10, 0xa4, 0xa0, 0x93, 0x26, 0x2b, - 0x7d, 0x19, 0x9e, 0x70, 0x6f, 0xc2, 0xd4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xf3, 0xa9, 0x73, 0x1, 0x26, 0x82, 0xe4, 0x1c, 0x4e, 0x2b, 0x2, - 0xbe, 0x20, 0x17, 0xb7, 0x25, 0x3b, 0xbf, 0x93, 0x9, 0xde, 0x58, 0x19, - 0xcb, 0x42, 0xe8, 0x19, 0x56, 0xf4, 0xc9, 0x9b, 0xc9, 0x76, 0x5c, 0xaf, - 0x53, 0xb1, 0xd0, 0xbb, 0x82, 0x79, 0x82, 0x6a, 0xdb, 0xbc, 0x55, 0x22, - 0xe9, 0x15, 0xc1, 0x20, 0xa6, 0x18, 0xa5, 0xa7, 0xf5, 0xe8, 0x97, 0x8, - 0x93, 0x39, 0x65, 0xc, 0xf7, 0xab, 0x31, 0xf0, 0x56, 0x8, 0x72, 0xaa, - 0x27, 0xbb, 0x2b, 0x7a, 0x6d, 0x6f, 0x4d, 0x85, 0x2f, 0x43, 0x21, 0x6, - 0x75, 0xc4, 0xe, 0x17, 0x76, 0xf9, 0x61, 0x27, 0xbc, 0x6e, 0xb1, 0x6b, - 0xa2, 0xc5, 0x29, 0x6c, 0x29, 0x9d, 0x5, 0x48, 0x7a, 0xd3, 0x80, 0x2e, - 0xe7, 0xb3, 0xcf, 0xa7, 0xdf, 0x32, 0xe7, 0x2b, 0x9d, 0x5, 0x4b, 0x5f, - 0xd3, 0x8a, 0x80, 0xd2, 0xdb, 0xa8, 0x3, 0xb5, 0xbb, 0x94, 0x31, 0xbb, - 0x1e, 0x98, 0xbd, 0x11, 0xb9, 0x3d, 0xb7, 0xc3, 0xd4, 0x51, 0x36, 0x55, - 0x9b, 0xb8, 0x6a, 0x29, 0x5a, 0xa2, 0x4, 0xec, 0xbe, 0xbf, 0x6f, 0x7a, - 0x51, 0x1, 0x51, 0x4d, 0xe4, 0x96, 0x54, 0x1, 0xe3, 0x3d, 0x94, 0x50, - 0x8d, 0x25, 0xf7, 0x2d, 0x6, 0x12, 0xee, 0xd9, 0xb2, 0x6e, 0x95, 0x57, - 0x61, 0x26, 0xff, 0x94, 0x8c, 0xab, 0xdb, 0xc5, 0xd6, 0x83, 0x1d, 0x62, - 0xbc, 0xe6, 0xc8, 0x20, 0xdd, 0x5f, 0x44, 0xfe, 0x8c, 0xae, 0x2, 0xbc, - 0x65, 0xcf, 0xef, 0x21, 0xb, 0xab, 0x30, 0xbc, 0x69, 0x1, 0x20, 0x10, - 0x36, 0x83, 0xe7, 0xd3, 0xc, 0xf6, 0x2, 0xcf, 0xb1, 0xa8, 0xa2, 0x2c, - 0xfe, 0x8, 0x6a, 0x16, 0xe4, 0xc9, 0xa7, 0x2b, 0x75, 0xe0, 0x65, 0xe3, - 0x6, 0xa6, 0x96, 0xf8, 0xba, 0x3b, 0xa6, 0x5e, 0xe6, 0xae, 0xd2, 0x51, - 0xa8, 0x18, 0xbd, 0x3f, 0x89, 0x70, 0xca, 0x4a, 0x38, 0xfc, 0x51, 0x4a, - 0xf9, 0x39, 0x73, 0x47, 0xe0, 0x38, 0xac, 0xd8, 0x3e, 0xc7, 0x16, 0x93, - 0x72, 0x2c, 0xcc, 0x0}, - { - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, 0x55, - 0xE9, 0x60, 0x56, 0x95}, - {0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, 0x68, - 0x0A, 0xF8, 0xC6, 0xD1}, - {0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, 0x45, - 0x10, 0x10, 0xD8, 0x52}, - {0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, 0x2B, - 0xE8, 0xE3, 0x65, 0x66}, - }, - { - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00}, - {0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00}, - {0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00}, - {0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00}, - {0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00}, - } + { 798, 510, 253, 120, 837 }, + 16, + 8, + { 0x7e, 0xc6, 0x12, 0x72, 0x74, 0x3b, 0xf1, 0x61, 0x47, 0x26, 0x44, 0x6a, 0x6c, 0x38, 0xce, + 0xd1, 0x66, 0xf6, 0xca, 0x76, 0xeb, 0x54, 0x30, 0x4, 0x42, 0x86, 0x34, 0x6c, 0xef, 0x13, + 0xf, 0x92, 0x92, 0x2b, 0x3, 0x45, 0xd, 0x3a, 0x99, 0x75, 0xe5, 0xbd, 0x2e, 0xa0, 0xeb, + 0x55, 0xad, 0x8e, 0x1b, 0x19, 0x9e, 0x3e, 0xc4, 0x31, 0x60, 0x20, 0xe9, 0xa1, 0xb2, 0x85, + 0xe7, 0x62, 0x79, 0x53, 0x59, 0xb7, 0xbd, 0xfd, 0x39, 0xbe, 0xf4, 0xb2, 0x48, 0x45, 0x83, + 0xd5, 0xaf, 0xe0, 0x82, 0xae, 0xe6, 0x38, 0xbf, 0x5f, 0xd5, 0xa6, 0x6, 0x19, 0x39, 0x1, + 0xa0, 0x8f, 0x4a, 0xb4, 0x1a, 0xab, 0x9b, 0x13, 0x48, 0x80, 0x40, 0x44, 0x48, 0xc7, 0x81, + 0x80, 0x94, 0xe9, 0xf, 0xf4, 0xfd, 0x5f, 0x8d, 0xd8, 0x1e, 0xac, 0xa0, 0x9e, 0xd6, 0x66, + 0xda, 0xc6, 0xef, 0x68, 0xde, 0xa2, 0xaf, 0x31, 0x6a, 0x31, 0x54, 0x34, 0x6f, 0xec, 0xbd, + 0x25, 0x18, 0x93, 0xed, 0x40, 0xd9, 0xfe, 0x8d, 0xb3, 0x8e, 0xf1, 0xa3, 0xc4, 0x73, 0xe4, + 0xec, 0x54, 0x40, 0xdd, 0xac, 0x8, 0x4c, 0x3e, 0x4, 0xaa, 0x7e, 0x85, 0xa7, 0x69, 0x81, + 0xba, 0x68, 0x24, 0xc1, 0xbf, 0xb1, 0xab, 0x48, 0x54, 0x72, 0x2, 0x9b, 0x71, 0xd8, 0x8, + 0xce, 0x33, 0xe2, 0xcc, 0x3c, 0xb, 0x5f, 0xc1, 0xf3, 0xde, 0x8a, 0x6d, 0xc6, 0x6b, 0x1f, + 0x56, 0xce, 0x22, 0xf, 0xc4, 0x85, 0x9c, 0x62, 0x2b, 0xd2, 0x4e, 0xa1, 0xa, 0x3, 0xf4, + 0x20, 0x4c, 0xd, 0xd3, 0x41, 0x26, 0xd, 0xfd, 0xa1, 0x43, 0x59, 0x4c, 0xbc, 0x1e, 0xd7, + 0xa2, 0x16, 0x4, 0xcf, 0xbd, 0x58, 0x7a, 0xc6, 0xae, 0x47, 0x23, 0x58, 0x82, 0x78, 0x47, + 0x80, 0xda, 0xd, 0x5a, 0x42, 0xa3, 0x90, 0x14, 0xdb, 0x8e, 0x9b, 0x5e, 0x8d, 0x1e, 0xc8, + 0x6e, 0x1d, 0x20, 0xda, 0x36, 0xa8, 0xb3, 0x95, 0x62, 0x64, 0xb3, 0x1d, 0x15, 0xf0, 0x31, + 0xed, 0x25, 0xe4, 0x69, 0x40, 0x46, 0x71, 0x9f, 0x16, 0x66, 0x5f, 0xe3, 0x1a, 0x70, 0xd9, + 0x2c, 0x83, 0x4, 0x3b, 0x50, 0x7d, 0xda, 0xd2, 0x1b, 0xf5, 0xe6, 0x46, 0x98, 0xe0, 0xcf, + 0x22, 0x2a, 0x18, 0xc3, 0xa2, 0xf1, 0xcc, 0x3b, 0x22, 0xcc, 0x3d, 0x4c, 0x37, 0x96, 0x58, + 0x0 }, + { 0xd1, 0xe2, 0xde, 0x70, 0xee, 0xf8, 0x6c, 0x69, 0x64, 0xfb, 0x54, 0x2b, 0xc2, 0xd4, 0x60, + 0xaa, 0xbf, 0xaa, 0x10, 0xa4, 0xa0, 0x93, 0x26, 0x2b, 0x7d, 0x19, 0x9e, 0x70, 0x6f, 0xc2, + 0xd4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xf3, 0xa9, 0x73, 0x1, 0x26, 0x82, 0xe4, 0x1c, + 0x4e, 0x2b, 0x2, 0xbe, 0x20, 0x17, 0xb7, 0x25, 0x3b, 0xbf, 0x93, 0x9, 0xde, 0x58, 0x19, + 0xcb, 0x42, 0xe8, 0x19, 0x56, 0xf4, 0xc9, 0x9b, 0xc9, 0x76, 0x5c, 0xaf, 0x53, 0xb1, 0xd0, + 0xbb, 0x82, 0x79, 0x82, 0x6a, 0xdb, 0xbc, 0x55, 0x22, 0xe9, 0x15, 0xc1, 0x20, 0xa6, 0x18, + 0xa5, 0xa7, 0xf5, 0xe8, 0x97, 0x8, 0x93, 0x39, 0x65, 0xc, 0xf7, 0xab, 0x31, 0xf0, 0x56, + 0x8, 0x72, 0xaa, 0x27, 0xbb, 0x2b, 0x7a, 0x6d, 0x6f, 0x4d, 0x85, 0x2f, 0x43, 0x21, 0x6, + 0x75, 0xc4, 0xe, 0x17, 0x76, 0xf9, 0x61, 0x27, 0xbc, 0x6e, 0xb1, 0x6b, 0xa2, 0xc5, 0x29, + 0x6c, 0x29, 0x9d, 0x5, 0x48, 0x7a, 0xd3, 0x80, 0x2e, 0xe7, 0xb3, 0xcf, 0xa7, 0xdf, 0x32, + 0xe7, 0x2b, 0x9d, 0x5, 0x4b, 0x5f, 0xd3, 0x8a, 0x80, 0xd2, 0xdb, 0xa8, 0x3, 0xb5, 0xbb, + 0x94, 0x31, 0xbb, 0x1e, 0x98, 0xbd, 0x11, 0xb9, 0x3d, 0xb7, 0xc3, 0xd4, 0x51, 0x36, 0x55, + 0x9b, 0xb8, 0x6a, 0x29, 0x5a, 0xa2, 0x4, 0xec, 0xbe, 0xbf, 0x6f, 0x7a, 0x51, 0x1, 0x51, + 0x4d, 0xe4, 0x96, 0x54, 0x1, 0xe3, 0x3d, 0x94, 0x50, 0x8d, 0x25, 0xf7, 0x2d, 0x6, 0x12, + 0xee, 0xd9, 0xb2, 0x6e, 0x95, 0x57, 0x61, 0x26, 0xff, 0x94, 0x8c, 0xab, 0xdb, 0xc5, 0xd6, + 0x83, 0x1d, 0x62, 0xbc, 0xe6, 0xc8, 0x20, 0xdd, 0x5f, 0x44, 0xfe, 0x8c, 0xae, 0x2, 0xbc, + 0x65, 0xcf, 0xef, 0x21, 0xb, 0xab, 0x30, 0xbc, 0x69, 0x1, 0x20, 0x10, 0x36, 0x83, 0xe7, + 0xd3, 0xc, 0xf6, 0x2, 0xcf, 0xb1, 0xa8, 0xa2, 0x2c, 0xfe, 0x8, 0x6a, 0x16, 0xe4, 0xc9, + 0xa7, 0x2b, 0x75, 0xe0, 0x65, 0xe3, 0x6, 0xa6, 0x96, 0xf8, 0xba, 0x3b, 0xa6, 0x5e, 0xe6, + 0xae, 0xd2, 0x51, 0xa8, 0x18, 0xbd, 0x3f, 0x89, 0x70, 0xca, 0x4a, 0x38, 0xfc, 0x51, 0x4a, + 0xf9, 0x39, 0x73, 0x47, 0xe0, 0x38, 0xac, 0xd8, 0x3e, 0xc7, 0x16, 0x93, 0x72, 0x2c, 0xcc, + 0x0 }, + { + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, + 0x81, 0xFF, 0x48 }, + { 0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, 0x55, 0xE9, + 0x60, 0x56, 0x95 }, + { 0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, 0x68, 0x0A, + 0xF8, 0xC6, 0xD1 }, + { 0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, 0x45, 0x10, + 0x10, 0xD8, 0x52 }, + { 0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, 0x2B, 0xE8, + 0xE3, 0x65, 0x66 }, + }, + { + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 }, + { 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00 }, + { 0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00 }, + { 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00 }, + } }; static const cipherbit_test_vector_t kasumi_f8_bitvectors[] = { - {798, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x83}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer0*/ - {510, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xDB}, + { 798, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x83 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer0*/ + { 510, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xDB }, - {0x3D, 0xEA, 0xCC, 0x7C, 0x15, 0x82, 0x1C, 0xAA, 0x89, 0xEE, 0xCA, - 0xDE, 0x9B, 0x5B, 0xD3, 0x61, 0x4B, 0xD0, 0xC8, 0x41, 0x9D, 0x71, - 0x03, 0x85, 0xDD, 0xBE, 0x58, 0x49, 0xEF, 0x1B, 0xAC, 0x5A, 0xE8, - 0xB1, 0x4A, 0x5B, 0x0A, 0x67, 0x41, 0x52, 0x1E, 0xB4, 0xE0, 0x0B, - 0xB9, 0xEC, 0xF3, 0xE9, 0xF7, 0xCC, 0xB9, 0xCA, 0xE7, 0x41, 0x52, - 0xD7, 0xF4, 0xE2, 0xA0, 0x34, 0xB6, 0xEA, 0x00, 0xEF}, + { 0x3D, 0xEA, 0xCC, 0x7C, 0x15, 0x82, 0x1C, 0xAA, 0x89, 0xEE, 0xCA, 0xDE, 0x9B, + 0x5B, 0xD3, 0x61, 0x4B, 0xD0, 0xC8, 0x41, 0x9D, 0x71, 0x03, 0x85, 0xDD, 0xBE, + 0x58, 0x49, 0xEF, 0x1B, 0xAC, 0x5A, 0xE8, 0xB1, 0x4A, 0x5B, 0x0A, 0x67, 0x41, + 0x52, 0x1E, 0xB4, 0xE0, 0x0B, 0xB9, 0xEC, 0xF3, 0xE9, 0xF7, 0xCC, 0xB9, 0xCA, + 0xE7, 0x41, 0x52, 0xD7, 0xF4, 0xE2, 0xA0, 0x34, 0xB6, 0xEA, 0x00, 0xEF }, - {0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, 0x55, - 0xE9, 0x60, 0x56, 0x95}, - {0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00} }, /*buffer1*/ - {253, - 16, - 8, - {0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, 0xB4, 0x85, 0x47, - 0x20, 0x29, 0xB7, 0x1D, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, 0xC0, - 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x66, 0xB1, 0xF7}, - {0x5B, 0xB9, 0x43, 0x1B, 0xB1, 0xE9, 0x8B, 0xD1, 0x1B, 0x93, 0xDB, - 0x7C, 0x3D, 0x45, 0x13, 0x65, 0x59, 0xBB, 0x86, 0xA2, 0x95, 0xAA, - 0x20, 0x4E, 0xCB, 0xEB, 0xF6, 0xF7, 0xA5, 0x10, 0x15, 0x17}, - {0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, 0x68, - 0x0A, 0xF8, 0xC6, 0xD1}, - {0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00} }, /*buffer2*/ - {120, - 16, - 8, - {0xAD, 0x9C, 0x44, 0x1F, 0x89, 0x0B, 0x38, 0xC4, 0x57, 0xA4, 0x9D, 0x42, - 0x14, 0x07, 0xE8}, - {0x9B, 0xC9, 0x2C, 0xA8, 0x03, 0xC6, 0x7B, 0x28, 0xA1, 0x1A, 0x4B, 0xEE, - 0x5A, 0x0C, 0x25}, - {0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, 0x45, - 0x10, 0x10, 0xD8, 0x52}, - {0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00} }, /*buffer3*/ - {837, - 16, - 8, - {0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x42, 0x86, 0xB2, 0x99, - 0x78, 0x3D, 0xAF, 0x44, 0x2C, 0x09, 0x9F, 0x7A, 0xB0, 0xF5, 0x8D, 0x5C, - 0x8E, 0x46, 0xB1, 0x04, 0xF0, 0x8F, 0x01, 0xB4, 0x1A, 0xB4, 0x85, 0x47, - 0x20, 0x29, 0xB7, 0x1D, 0x36, 0xBD, 0x1A, 0x3D, 0x90, 0xDC, 0x3A, 0x41, - 0xB4, 0x6D, 0x51, 0x67, 0x2A, 0xC4, 0xC9, 0x66, 0x3A, 0x2B, 0xE0, 0x63, - 0xDA, 0x4B, 0xC8, 0xD2, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xCC, 0xBF, 0xC6, - 0x34, 0xE1, 0xB2, 0x59, 0x06, 0x08, 0x76, 0xA0, 0xFB, 0xB5, 0xA4, 0x37, - 0xEB, 0xCC, 0x8D, 0x31, 0xC1, 0x9E, 0x44, 0x54, 0x31, 0x87, 0x45, 0xE3, - 0x98, 0x76, 0x45, 0x98, 0x7A, 0x98, 0x6F, 0x2C, 0xB7}, - {0xDD, 0xB3, 0x64, 0xDD, 0x2A, 0xAE, 0xC2, 0x4D, 0xFF, 0x29, 0x19, - 0x57, 0xB7, 0x8B, 0xAD, 0x06, 0x3A, 0xC5, 0x79, 0xCD, 0x90, 0x41, - 0xBA, 0xBE, 0x89, 0xFD, 0x19, 0x5C, 0x05, 0x78, 0xCB, 0x9F, 0xDE, - 0x42, 0x17, 0x56, 0x61, 0x78, 0xD2, 0x02, 0x40, 0x20, 0x6D, 0x07, - 0xCF, 0xA6, 0x19, 0xEC, 0x05, 0x9F, 0x63, 0x51, 0x44, 0x59, 0xFC, - 0x10, 0xD4, 0x2D, 0xC9, 0x93, 0x4E, 0x56, 0xEB, 0xC0, 0xCB, 0xC6, - 0x0D, 0x4D, 0x2D, 0xF1, 0x74, 0x77, 0x4C, 0xBD, 0xCD, 0x5D, 0xA4, - 0xA3, 0x50, 0x31, 0x7A, 0x7F, 0x12, 0xE1, 0x94, 0x94, 0x71, 0xF8, - 0xA2, 0x95, 0xF2, 0x72, 0xE6, 0x8F, 0xC0, 0x71, 0x59, 0xB0, 0x7D, - 0x8E, 0x2D, 0x26, 0xE4, 0x59, - 0x9F}, - {0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, 0x2B, - 0xE8, 0xE3, 0x65, 0x66}, - {0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00} }, /*buffer3*/ + { 0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, 0x55, 0xE9, 0x60, + 0x56, 0x95 }, + { 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00 } }, /*buffer1*/ + { 253, + 16, + 8, + { 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, 0xB4, 0x85, 0x47, + 0x20, 0x29, 0xB7, 0x1D, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, 0xC0, + 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x66, 0xB1, 0xF7 }, + { 0x5B, 0xB9, 0x43, 0x1B, 0xB1, 0xE9, 0x8B, 0xD1, 0x1B, 0x93, 0xDB, + 0x7C, 0x3D, 0x45, 0x13, 0x65, 0x59, 0xBB, 0x86, 0xA2, 0x95, 0xAA, + 0x20, 0x4E, 0xCB, 0xEB, 0xF6, 0xF7, 0xA5, 0x10, 0x15, 0x17 }, + { 0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, 0x68, 0x0A, 0xF8, + 0xC6, 0xD1 }, + { 0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00 } }, /*buffer2*/ + { 120, + 16, + 8, + { 0xAD, 0x9C, 0x44, 0x1F, 0x89, 0x0B, 0x38, 0xC4, 0x57, 0xA4, 0x9D, 0x42, 0x14, 0x07, + 0xE8 }, + { 0x9B, 0xC9, 0x2C, 0xA8, 0x03, 0xC6, 0x7B, 0x28, 0xA1, 0x1A, 0x4B, 0xEE, 0x5A, 0x0C, + 0x25 }, + { 0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, 0x45, 0x10, 0x10, + 0xD8, 0x52 }, + { 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00 } }, /*buffer3*/ + { 837, + 16, + 8, + { 0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x42, 0x86, 0xB2, 0x99, 0x78, 0x3D, + 0xAF, 0x44, 0x2C, 0x09, 0x9F, 0x7A, 0xB0, 0xF5, 0x8D, 0x5C, 0x8E, 0x46, 0xB1, 0x04, + 0xF0, 0x8F, 0x01, 0xB4, 0x1A, 0xB4, 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, 0x36, 0xBD, + 0x1A, 0x3D, 0x90, 0xDC, 0x3A, 0x41, 0xB4, 0x6D, 0x51, 0x67, 0x2A, 0xC4, 0xC9, 0x66, + 0x3A, 0x2B, 0xE0, 0x63, 0xDA, 0x4B, 0xC8, 0xD2, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xCC, + 0xBF, 0xC6, 0x34, 0xE1, 0xB2, 0x59, 0x06, 0x08, 0x76, 0xA0, 0xFB, 0xB5, 0xA4, 0x37, + 0xEB, 0xCC, 0x8D, 0x31, 0xC1, 0x9E, 0x44, 0x54, 0x31, 0x87, 0x45, 0xE3, 0x98, 0x76, + 0x45, 0x98, 0x7A, 0x98, 0x6F, 0x2C, 0xB7 }, + { 0xDD, 0xB3, 0x64, 0xDD, 0x2A, 0xAE, 0xC2, 0x4D, 0xFF, 0x29, 0x19, 0x57, 0xB7, 0x8B, + 0xAD, 0x06, 0x3A, 0xC5, 0x79, 0xCD, 0x90, 0x41, 0xBA, 0xBE, 0x89, 0xFD, 0x19, 0x5C, + 0x05, 0x78, 0xCB, 0x9F, 0xDE, 0x42, 0x17, 0x56, 0x61, 0x78, 0xD2, 0x02, 0x40, 0x20, + 0x6D, 0x07, 0xCF, 0xA6, 0x19, 0xEC, 0x05, 0x9F, 0x63, 0x51, 0x44, 0x59, 0xFC, 0x10, + 0xD4, 0x2D, 0xC9, 0x93, 0x4E, 0x56, 0xEB, 0xC0, 0xCB, 0xC6, 0x0D, 0x4D, 0x2D, 0xF1, + 0x74, 0x77, 0x4C, 0xBD, 0xCD, 0x5D, 0xA4, 0xA3, 0x50, 0x31, 0x7A, 0x7F, 0x12, 0xE1, + 0x94, 0x94, 0x71, 0xF8, 0xA2, 0x95, 0xF2, 0x72, 0xE6, 0x8F, 0xC0, 0x71, 0x59, 0xB0, + 0x7D, 0x8E, 0x2D, 0x26, 0xE4, 0x59, 0x9F }, + { 0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, 0x2B, 0xE8, 0xE3, + 0x65, 0x66 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00 } }, /*buffer3*/ }; static cipher_test_vector_t kasumi_f8_vectors[] = { - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer0*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer1*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer2*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer3*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer4*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer5*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer6*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer7*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer8*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer9*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer10*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer11*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer12*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer13*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer14*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer15*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer16*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer17*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer18*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer19*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer20*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer21*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer22*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer23*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer24*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer25*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer26*/ - {64, - 16, - 8, - {0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, - 0x57, 0xE3, 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, - 0xBB, 0xDA, 0x37, 0xA8, 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, - 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, 0x50, 0x36, 0x7F, 0xA3, 0x6C, - 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, - 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8}, - {0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, - 0x16, 0x4D, 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, - 0xAD, 0xF5, 0x08, 0x37, 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, - 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, 0x56, 0xD2, 0xE4, 0x0F, 0x28, - 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, 0xF1, 0x3D, 0xB4, - 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} }, /*buffer27*/ - {100, - 16, - 8, - {0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, - 0x6C, 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, - 0x42, 0x86, 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, - 0x0D, 0x3A, 0x99, 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, - 0x1B, 0x19, 0x9E, 0x3E, 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, - 0xE7, 0x62, 0x79, 0x53, 0x59, 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, - 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, - 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, - 0x9B, 0x13, 0x48, 0x80}, - {0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, - 0xC2, 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, - 0x7D, 0x19, 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, - 0x10, 0xF3, 0xA9, 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, - 0xBE, 0x20, 0x17, 0xB7, 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, - 0xCB, 0x42, 0xE8, 0x19, 0x56, 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, - 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, - 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, 0xA7, 0xF5, 0xE8, 0x97, 0x08, - 0x93, 0x39, 0x65, 0x0F}, - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - {0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00} } /*buffer28*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer0*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer1*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer2*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer3*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer4*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer5*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer6*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer7*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer8*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer9*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer10*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer11*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer12*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer13*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer14*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer15*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer16*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer17*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer18*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer19*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer20*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer21*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer22*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer23*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer24*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer25*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer26*/ + { 64, + 16, + 8, + { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, + 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, + 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, + 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, + 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, + { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, + 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, + 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, + 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, + 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer27*/ + { 100, + 16, + 8, + { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, + 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, + 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, + 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, + 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, + 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, + 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, + 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, + { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, + 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, + 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, + 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, + 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, + 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, + 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, + 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } } /*buffer28*/ }; static hash_test_vector_t kasumi_f9_vectors[] = { - {/*input*/ - {0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49, 0x6B, 0x22, 0x77, - 0x37, 0x29, 0x6F, 0x39, 0x3C, 0x80, 0x79, 0x35, 0x3E, 0xDC, 0x87, - 0xE2, 0xE8, 0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE2}, - /*inputlength*/ - 32, - /*key*/ - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - /*keylength*/ - 16, - /*expectedout*/ - {0xF6, 0x3B, 0xD7, 0x2C} }, - {{0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2, 0xB5, 0x92, - 0x43, 0x84, 0x32, 0x8A, 0x4A, 0xE0, 0x0B, 0x73, 0x71, 0x09, - 0xF8, 0xB6, 0xC8, 0xDD, 0x2B, 0x4D, 0xB6, 0x3D, 0xD5, 0x33, - 0x98, 0x1C, 0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC3}, - 40, - {0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF, 0xCD, 0x9F, 0x97, 0x94, - 0x5E, 0x6D, 0xE7, 0xB7}, - 16, - {0xA9, 0xDA, 0xF1, 0xFF} }, - {{0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, 0xD0, 0xA7, 0xD4, 0x63, - 0xDF, 0x9F, 0xB2, 0xB2, 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, - 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, 0x07, 0xFB, 0x64, 0x8B, - 0x65, 0x99, 0xAA, 0xA0, 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, - 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09, 0xC0}, - 57, - {0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, 0x1E, 0x26, 0x98, 0xD2, - 0xE2, 0x2A, 0xD5, 0x7E}, - 16, - {0xDD, 0x7D, 0xFA, 0xDD} }, - {{0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0xB3, 0xD3, - 0xC9, 0x17, 0x0A, 0x4E, 0x16, 0x32, 0xF6, 0x0F, 0x86, 0x10, - 0x13, 0xD2, 0x2D, 0x84, 0xB7, 0x26, 0xB6, 0xA2, 0x78, 0xD8, - 0x02, 0xD1, 0xEE, 0xAF, 0x13, 0x21, 0xBA, 0x59, 0x29, 0xDF}, - 40, - {0x7E, 0x5E, 0x94, 0x43, 0x1E, 0x11, 0xD7, 0x38, 0x28, 0xD7, 0x39, 0xCC, - 0x6C, 0xED, 0x45, 0x73}, - 16, - {0x2B, 0xEE, 0xF3, 0xAC} + { /*input*/ + { 0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49, 0x6B, 0x22, 0x77, + 0x37, 0x29, 0x6F, 0x39, 0x3C, 0x80, 0x79, 0x35, 0x3E, 0xDC, 0x87, + 0xE2, 0xE8, 0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE2 }, + /*inputlength*/ + 32, + /*key*/ + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, + 0xFF, 0x48 }, + /*keylength*/ + 16, + /*expectedout*/ + { 0xF6, 0x3B, 0xD7, 0x2C } }, + { { 0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2, 0xB5, 0x92, 0x43, 0x84, 0x32, 0x8A, + 0x4A, 0xE0, 0x0B, 0x73, 0x71, 0x09, 0xF8, 0xB6, 0xC8, 0xDD, 0x2B, 0x4D, 0xB6, 0x3D, + 0xD5, 0x33, 0x98, 0x1C, 0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC3 }, + 40, + { 0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF, 0xCD, 0x9F, 0x97, 0x94, 0x5E, 0x6D, + 0xE7, 0xB7 }, + 16, + { 0xA9, 0xDA, 0xF1, 0xFF } }, + { { 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, 0xD0, 0xA7, 0xD4, 0x63, + 0xDF, 0x9F, 0xB2, 0xB2, 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, 0x07, 0xFB, 0x64, 0x8B, + 0x65, 0x99, 0xAA, 0xA0, 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09, 0xC0 }, + 57, + { 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, + 0xD5, 0x7E }, + 16, + { 0xDD, 0x7D, 0xFA, 0xDD } }, + { { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0xB3, 0xD3, 0xC9, 0x17, 0x0A, 0x4E, + 0x16, 0x32, 0xF6, 0x0F, 0x86, 0x10, 0x13, 0xD2, 0x2D, 0x84, 0xB7, 0x26, 0xB6, 0xA2, + 0x78, 0xD8, 0x02, 0xD1, 0xEE, 0xAF, 0x13, 0x21, 0xBA, 0x59, 0x29, 0xDF }, + 40, + { 0x7E, 0x5E, 0x94, 0x43, 0x1E, 0x11, 0xD7, 0x38, 0x28, 0xD7, 0x39, 0xCC, 0x6C, 0xED, + 0x45, 0x73 }, + 16, + { 0x2B, 0xEE, 0xF3, 0xAC } - }, - {{0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0x59, 0x32, - 0xBC, 0x0A, 0xCE, 0x2B, 0x0A, 0xBA, 0x33, 0xD8, 0xAC, 0x18, - 0x8A, 0xC5, 0x4F, 0x34, 0x6F, 0xAD, 0x10, 0xBF, 0x9D, 0xEE, - 0x29, 0x20, 0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, 0x5C, 0xB7, - 0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF3, 0x80}, - 49, - {0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4, 0x83, 0xA3, 0x18, 0x69, - 0xD8, 0x1B, 0x8F, 0xAB}, - 16, - {0x15, 0x37, 0xD3, 0x16} }, - {{0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0xD3, 0xC5, 0x38, 0x39, - 0x62, 0x68, 0x20, 0x71, 0x77, 0x65, 0x66, 0x76, 0x20, 0x32, 0x38, 0x37, - 0x63, 0x62, 0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, 0xB4, - 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, - 0xC0, 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x80}, - 57, - {0x68, 0x32, 0xA6, 0x5C, 0xFF, 0x44, 0x73, 0x62, 0x1E, 0xBD, 0xD4, 0xBA, - 0x26, 0xA9, 0x21, 0xFE}, - 16, - {0x8B, 0x2D, 0x57, 0x0F} }, - {{0xC7, 0x59, 0x0E, 0xA9, 0x57, 0xD5, 0xDF, 0x7D, 0xBB, 0xB0, 0x57, - 0x03, 0x88, 0x09, 0x49, 0x6B, 0xCF, 0xF8, 0x6D, 0x6F, 0xBC, 0x8C, - 0xE5, 0xB1, 0x35, 0xA0, 0x6B, 0x16, 0x60, 0x54, 0xF2, 0xD5, 0x65, - 0xBE, 0x8A, 0xCE, 0x75, 0xDC, 0x85, 0x1E, 0x0B, 0xCD, 0xD8, 0xF0, - 0x71, 0x41, 0xC4, 0x95, 0x87, 0x2F, 0xB5, 0xD8, 0xC0, 0xC6, 0x6A, - 0x8B, 0x6D, 0xA5, 0x56, 0x66, 0x3E, 0x4E, 0x46, 0x12, 0x05, 0xD8, - 0x45, 0x80, 0xBE, 0xE5, 0xBC, 0x7E, 0x80}, - 73, - {0xD3, 0x41, 0x9B, 0xE8, 0x21, 0x08, 0x7A, 0xCD, 0x02, 0x12, 0x3A, 0x92, - 0x48, 0x03, 0x33, 0x59}, - 16, - {0x02, 0x15, 0x81, 0x70} }, - {{0x36, 0xAF, 0x61, 0x44, 0x4F, 0x30, 0x2A, 0xD2, 0x35, 0xC6, 0x87, 0x16, - 0x63, 0x3C, 0x66, 0xFB, 0x75, 0x0C, 0x26, 0x68, 0x65, 0xD5, 0x3C, 0x11, - 0xEA, 0x05, 0xB1, 0xE9, 0xFA, 0x49, 0xC8, 0x39, 0x8D, 0x48, 0xE1, 0xEF, - 0xA5, 0x90, 0x9D, 0x39, 0x47, 0x90, 0x28, 0x37, 0xF5, 0xAE, 0x96, 0xD5, - 0xA0, 0x5B, 0xC8, 0xD6, 0x1C, 0xA8, 0xDB, 0xEF, 0x1B, 0x13, 0xA4, 0xB4, - 0xAB, 0xFE, 0x4F, 0xB1, 0x00, 0x60, 0x45, 0xB6, 0x74, 0xBB, 0x54, 0x72, - 0x93, 0x04, 0xC3, 0x82, 0xBE, 0x53, 0xA5, 0xAF, 0x05, 0x55, 0x61, 0x76, - 0xF6, 0xEA, 0xA2, 0xEF, 0x1D, 0x05, 0xE4, 0xB0, 0x83, 0x18, 0x1E, 0xE6, - 0x74, 0xCD, 0xA5, 0xA4, 0x85, 0xF7, 0x4D, 0x7A, 0xC0}, - 105, - {0x83, 0xFD, 0x23, 0xA2, 0x44, 0xA7, 0x4C, 0xF3, 0x58, 0xDA, 0x30, 0x19, - 0xF1, 0x72, 0x26, 0x35}, - 16, - {0x95, 0xAE, 0x41, 0xBA} }, - {{0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37, 0x10, 0xBF, 0xFF, 0x83, - 0x9E, 0x0C, 0x71, 0x65, 0x8D, 0xBB, 0x2D, 0x17, 0x07, 0xE1, 0x45, 0x72, - 0x4F, 0x41, 0xC1, 0x6F, 0x48, 0xBF, 0x40, 0x3C, 0x3B, 0x18, 0xE3, 0x8F, - 0xD5, 0xD1, 0x66, 0x3B, 0x6F, 0x6D, 0x90, 0x01, 0x93, 0xE3, 0xCE, 0xA8, - 0xBB, 0x4F, 0x1B, 0x4F, 0x5B, 0xE8, 0x22, 0x03, 0x22, 0x32, 0xA7, 0x8D, - 0x7D, 0x75, 0x23, 0x8D, 0x5E, 0x6D, 0xAE, 0xCD, 0x3B, 0x43, 0x22, 0xCF, - 0x59, 0xBC, 0x7E, 0xA8, 0x4A, 0xB1, 0x88, 0x11, 0xB5, 0xBF, 0xB7, 0xBC, - 0x55, 0x3F, 0x4F, 0xE4, 0x44, 0x78, 0xCE, 0x28, 0x7A, 0x14, 0x87, 0x99, - 0x90, 0xD1, 0x8D, 0x12, 0xCA, 0x79, 0xD2, 0xC8, 0x55, 0x14, 0x90, 0x21, - 0xCD, 0x5C, 0xE8, 0xCA, 0x03, 0x71, 0xCA, 0x04, 0xFC, 0xCE, 0x14, 0x3E, - 0x3D, 0x7C, 0xFE, 0xE9, 0x45, 0x85, 0xB5, 0x88, 0x5C, 0xAC, 0x46, 0x06, - 0x8B, 0xC0}, - 134, - {0xF4, 0xEB, 0xEC, 0x69, 0xE7, 0x3E, 0xAF, 0x2E, 0xB2, 0xCF, 0x6A, 0xF4, - 0xB3, 0x12, 0x0F, 0xFD}, - 16, - {0xC3, 0x83, 0x83, 0x9D} }, - {{0x78, 0x27, 0xFA, 0xB2, 0xA5, 0x6C, 0x6C, 0xA2, 0x70, 0xDE, 0xDF, 0x2D, - 0xC4, 0x2C, 0x5C, 0xBD, 0x3A, 0x96, 0xF8, 0xA0, 0xB1, 0x14, 0x18, 0xB3, - 0x60, 0x8D, 0x57, 0x33, 0x60, 0x4A, 0x2C, 0xD3, 0x6A, 0xAB, 0xC7, 0x0C, - 0xE3, 0x19, 0x3B, 0xB5, 0x15, 0x3B, 0xE2, 0xD3, 0xC0, 0x6D, 0xFD, 0xB2, - 0xD1, 0x6E, 0x9C, 0x35, 0x71, 0x58, 0xBE, 0x6A, 0x41, 0xD6, 0xB8, 0x61, - 0xE4, 0x91, 0xDB, 0x3F, 0xBF, 0xEB, 0x51, 0x8E, 0xFC, 0xF0, 0x48, 0xD7, - 0xD5, 0x89, 0x53, 0x73, 0x0F, 0xF3, 0x0C, 0x9E, 0xC4, 0x70, 0xFF, 0xCD, - 0x66, 0x3D, 0xC3, 0x42, 0x01, 0xC3, 0x6A, 0xDD, 0xC0, 0x11, 0x1C, 0x35, - 0xB3, 0x8A, 0xFE, 0xE7, 0xCF, 0xDB, 0x58, 0x2E, 0x37, 0x31, 0xF8, 0xB4, - 0xBA, 0xA8, 0xD1, 0xA8, 0x9C, 0x06, 0xE8, 0x11, 0x99, 0xA9, 0x71, 0x62, - 0x27, 0xBE, 0x34, 0x4E, 0xFC, 0xB4, 0x36, 0xDD, 0xD0, 0xF0, 0x96, 0xC0, - 0x64, 0xC3, 0xB5, 0xE2, 0xC3, 0x99, 0x99, 0x3F, 0xC7, 0x73, 0x94, 0xF9, - 0xE0, 0x97, 0x20, 0xA8, 0x11, 0x85, 0x0E, 0xF2, 0x3B, 0x2E, 0xE0, 0x5D, - 0x9E, 0x61, 0x73, 0x60, 0x9D, 0x86, 0xE1, 0xC0, 0xC1, 0x8E, 0xA5, 0x1A, - 0x01, 0x2A, 0x00, 0xBB, 0x41, 0x3B, 0x9C, 0xB8, 0x18, 0x8A, 0x70, 0x3C, - 0xD6, 0xBA, 0xE3, 0x1C, 0xC6, 0x7B, 0x34, 0xB1, 0xB0, 0x00, 0x19, 0xE6, - 0xA2, 0xB2, 0xA6, 0x90, 0xF0, 0x26, 0x71, 0xFE, 0x7C, 0x9E, 0xF8, 0xDE, - 0xC0, 0x09, 0x4E, 0x53, 0x37, 0x63, 0x47, 0x8D, 0x58, 0xD2, 0xC5, 0xF5, - 0xB8, 0x27, 0xA0, 0x14, 0x8C, 0x59, 0x48, 0xA9, 0x69, 0x31, 0xAC, 0xF8, - 0x4F, 0x46, 0x5A, 0x64, 0xE6, 0x2C, 0xE7, 0x40, 0x07, 0xE9, 0x91, 0xE3, - 0x7E, 0xA8, 0x23, 0xFA, 0x0F, 0xB2, 0x19, 0x23, 0xB7, 0x99, 0x05, 0xB7, - 0x33, 0xB6, 0x31, 0xE6, 0xC7, 0xD6, 0x86, 0x0A, 0x38, 0x31, 0xAC, 0x35, - 0x1A, 0x9C, 0x73, 0x0C, 0x52, 0xFF, 0x72, 0xD9, 0xD3, 0x08, 0xEE, 0xDB, - 0xAB, 0x21, 0xFD, 0xE1, 0x43, 0xA0, 0xEA, 0x17, 0xE2, 0x3E, 0xDC, 0x1F, - 0x74, 0xCB, 0xB3, 0x63, 0x8A, 0x20, 0x33, 0xAA, 0xA1, 0x54, 0x64, 0xEA, - 0xA7, 0x33, 0x38, 0x5D, 0xBB, 0xEB, 0x6F, 0xD7, 0x35, 0x09, 0xB8, 0x57, - 0xE6, 0xA4, 0x19, 0xDC, 0xA1, 0xD8, 0x90, 0x7A, 0xF9, 0x77, 0xFB, 0xAC, - 0x4D, 0xFA, 0x35, 0xEF}, - 328, - {0x5D, 0x0A, 0x80, 0xD8, 0x13, 0x4A, 0xE1, 0x96, 0x77, 0x82, 0x4B, 0x67, - 0x1E, 0x83, 0x8A, 0xF4}, - 16, - {0x3A, 0xE4, 0xBF, 0xF3} } }; + }, + { { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0x59, 0x32, 0xBC, 0x0A, 0xCE, + 0x2B, 0x0A, 0xBA, 0x33, 0xD8, 0xAC, 0x18, 0x8A, 0xC5, 0x4F, 0x34, 0x6F, 0xAD, + 0x10, 0xBF, 0x9D, 0xEE, 0x29, 0x20, 0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, 0x5C, + 0xB7, 0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF3, 0x80 }, + 49, + { 0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4, 0x83, 0xA3, 0x18, 0x69, 0xD8, 0x1B, + 0x8F, 0xAB }, + 16, + { 0x15, 0x37, 0xD3, 0x16 } }, + { { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0xD3, 0xC5, 0x38, 0x39, + 0x62, 0x68, 0x20, 0x71, 0x77, 0x65, 0x66, 0x76, 0x20, 0x32, 0x38, 0x37, + 0x63, 0x62, 0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, 0xB4, + 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, + 0xC0, 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x80 }, + 57, + { 0x68, 0x32, 0xA6, 0x5C, 0xFF, 0x44, 0x73, 0x62, 0x1E, 0xBD, 0xD4, 0xBA, 0x26, 0xA9, + 0x21, 0xFE }, + 16, + { 0x8B, 0x2D, 0x57, 0x0F } }, + { { 0xC7, 0x59, 0x0E, 0xA9, 0x57, 0xD5, 0xDF, 0x7D, 0xBB, 0xB0, 0x57, 0x03, 0x88, + 0x09, 0x49, 0x6B, 0xCF, 0xF8, 0x6D, 0x6F, 0xBC, 0x8C, 0xE5, 0xB1, 0x35, 0xA0, + 0x6B, 0x16, 0x60, 0x54, 0xF2, 0xD5, 0x65, 0xBE, 0x8A, 0xCE, 0x75, 0xDC, 0x85, + 0x1E, 0x0B, 0xCD, 0xD8, 0xF0, 0x71, 0x41, 0xC4, 0x95, 0x87, 0x2F, 0xB5, 0xD8, + 0xC0, 0xC6, 0x6A, 0x8B, 0x6D, 0xA5, 0x56, 0x66, 0x3E, 0x4E, 0x46, 0x12, 0x05, + 0xD8, 0x45, 0x80, 0xBE, 0xE5, 0xBC, 0x7E, 0x80 }, + 73, + { 0xD3, 0x41, 0x9B, 0xE8, 0x21, 0x08, 0x7A, 0xCD, 0x02, 0x12, 0x3A, 0x92, 0x48, 0x03, + 0x33, 0x59 }, + 16, + { 0x02, 0x15, 0x81, 0x70 } }, + { { 0x36, 0xAF, 0x61, 0x44, 0x4F, 0x30, 0x2A, 0xD2, 0x35, 0xC6, 0x87, 0x16, 0x63, 0x3C, + 0x66, 0xFB, 0x75, 0x0C, 0x26, 0x68, 0x65, 0xD5, 0x3C, 0x11, 0xEA, 0x05, 0xB1, 0xE9, + 0xFA, 0x49, 0xC8, 0x39, 0x8D, 0x48, 0xE1, 0xEF, 0xA5, 0x90, 0x9D, 0x39, 0x47, 0x90, + 0x28, 0x37, 0xF5, 0xAE, 0x96, 0xD5, 0xA0, 0x5B, 0xC8, 0xD6, 0x1C, 0xA8, 0xDB, 0xEF, + 0x1B, 0x13, 0xA4, 0xB4, 0xAB, 0xFE, 0x4F, 0xB1, 0x00, 0x60, 0x45, 0xB6, 0x74, 0xBB, + 0x54, 0x72, 0x93, 0x04, 0xC3, 0x82, 0xBE, 0x53, 0xA5, 0xAF, 0x05, 0x55, 0x61, 0x76, + 0xF6, 0xEA, 0xA2, 0xEF, 0x1D, 0x05, 0xE4, 0xB0, 0x83, 0x18, 0x1E, 0xE6, 0x74, 0xCD, + 0xA5, 0xA4, 0x85, 0xF7, 0x4D, 0x7A, 0xC0 }, + 105, + { 0x83, 0xFD, 0x23, 0xA2, 0x44, 0xA7, 0x4C, 0xF3, 0x58, 0xDA, 0x30, 0x19, 0xF1, 0x72, + 0x26, 0x35 }, + 16, + { 0x95, 0xAE, 0x41, 0xBA } }, + { { 0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37, 0x10, 0xBF, 0xFF, 0x83, 0x9E, 0x0C, + 0x71, 0x65, 0x8D, 0xBB, 0x2D, 0x17, 0x07, 0xE1, 0x45, 0x72, 0x4F, 0x41, 0xC1, 0x6F, + 0x48, 0xBF, 0x40, 0x3C, 0x3B, 0x18, 0xE3, 0x8F, 0xD5, 0xD1, 0x66, 0x3B, 0x6F, 0x6D, + 0x90, 0x01, 0x93, 0xE3, 0xCE, 0xA8, 0xBB, 0x4F, 0x1B, 0x4F, 0x5B, 0xE8, 0x22, 0x03, + 0x22, 0x32, 0xA7, 0x8D, 0x7D, 0x75, 0x23, 0x8D, 0x5E, 0x6D, 0xAE, 0xCD, 0x3B, 0x43, + 0x22, 0xCF, 0x59, 0xBC, 0x7E, 0xA8, 0x4A, 0xB1, 0x88, 0x11, 0xB5, 0xBF, 0xB7, 0xBC, + 0x55, 0x3F, 0x4F, 0xE4, 0x44, 0x78, 0xCE, 0x28, 0x7A, 0x14, 0x87, 0x99, 0x90, 0xD1, + 0x8D, 0x12, 0xCA, 0x79, 0xD2, 0xC8, 0x55, 0x14, 0x90, 0x21, 0xCD, 0x5C, 0xE8, 0xCA, + 0x03, 0x71, 0xCA, 0x04, 0xFC, 0xCE, 0x14, 0x3E, 0x3D, 0x7C, 0xFE, 0xE9, 0x45, 0x85, + 0xB5, 0x88, 0x5C, 0xAC, 0x46, 0x06, 0x8B, 0xC0 }, + 134, + { 0xF4, 0xEB, 0xEC, 0x69, 0xE7, 0x3E, 0xAF, 0x2E, 0xB2, 0xCF, 0x6A, 0xF4, 0xB3, 0x12, + 0x0F, 0xFD }, + 16, + { 0xC3, 0x83, 0x83, 0x9D } }, + { { 0x78, 0x27, 0xFA, 0xB2, 0xA5, 0x6C, 0x6C, 0xA2, 0x70, 0xDE, 0xDF, 0x2D, 0xC4, 0x2C, + 0x5C, 0xBD, 0x3A, 0x96, 0xF8, 0xA0, 0xB1, 0x14, 0x18, 0xB3, 0x60, 0x8D, 0x57, 0x33, + 0x60, 0x4A, 0x2C, 0xD3, 0x6A, 0xAB, 0xC7, 0x0C, 0xE3, 0x19, 0x3B, 0xB5, 0x15, 0x3B, + 0xE2, 0xD3, 0xC0, 0x6D, 0xFD, 0xB2, 0xD1, 0x6E, 0x9C, 0x35, 0x71, 0x58, 0xBE, 0x6A, + 0x41, 0xD6, 0xB8, 0x61, 0xE4, 0x91, 0xDB, 0x3F, 0xBF, 0xEB, 0x51, 0x8E, 0xFC, 0xF0, + 0x48, 0xD7, 0xD5, 0x89, 0x53, 0x73, 0x0F, 0xF3, 0x0C, 0x9E, 0xC4, 0x70, 0xFF, 0xCD, + 0x66, 0x3D, 0xC3, 0x42, 0x01, 0xC3, 0x6A, 0xDD, 0xC0, 0x11, 0x1C, 0x35, 0xB3, 0x8A, + 0xFE, 0xE7, 0xCF, 0xDB, 0x58, 0x2E, 0x37, 0x31, 0xF8, 0xB4, 0xBA, 0xA8, 0xD1, 0xA8, + 0x9C, 0x06, 0xE8, 0x11, 0x99, 0xA9, 0x71, 0x62, 0x27, 0xBE, 0x34, 0x4E, 0xFC, 0xB4, + 0x36, 0xDD, 0xD0, 0xF0, 0x96, 0xC0, 0x64, 0xC3, 0xB5, 0xE2, 0xC3, 0x99, 0x99, 0x3F, + 0xC7, 0x73, 0x94, 0xF9, 0xE0, 0x97, 0x20, 0xA8, 0x11, 0x85, 0x0E, 0xF2, 0x3B, 0x2E, + 0xE0, 0x5D, 0x9E, 0x61, 0x73, 0x60, 0x9D, 0x86, 0xE1, 0xC0, 0xC1, 0x8E, 0xA5, 0x1A, + 0x01, 0x2A, 0x00, 0xBB, 0x41, 0x3B, 0x9C, 0xB8, 0x18, 0x8A, 0x70, 0x3C, 0xD6, 0xBA, + 0xE3, 0x1C, 0xC6, 0x7B, 0x34, 0xB1, 0xB0, 0x00, 0x19, 0xE6, 0xA2, 0xB2, 0xA6, 0x90, + 0xF0, 0x26, 0x71, 0xFE, 0x7C, 0x9E, 0xF8, 0xDE, 0xC0, 0x09, 0x4E, 0x53, 0x37, 0x63, + 0x47, 0x8D, 0x58, 0xD2, 0xC5, 0xF5, 0xB8, 0x27, 0xA0, 0x14, 0x8C, 0x59, 0x48, 0xA9, + 0x69, 0x31, 0xAC, 0xF8, 0x4F, 0x46, 0x5A, 0x64, 0xE6, 0x2C, 0xE7, 0x40, 0x07, 0xE9, + 0x91, 0xE3, 0x7E, 0xA8, 0x23, 0xFA, 0x0F, 0xB2, 0x19, 0x23, 0xB7, 0x99, 0x05, 0xB7, + 0x33, 0xB6, 0x31, 0xE6, 0xC7, 0xD6, 0x86, 0x0A, 0x38, 0x31, 0xAC, 0x35, 0x1A, 0x9C, + 0x73, 0x0C, 0x52, 0xFF, 0x72, 0xD9, 0xD3, 0x08, 0xEE, 0xDB, 0xAB, 0x21, 0xFD, 0xE1, + 0x43, 0xA0, 0xEA, 0x17, 0xE2, 0x3E, 0xDC, 0x1F, 0x74, 0xCB, 0xB3, 0x63, 0x8A, 0x20, + 0x33, 0xAA, 0xA1, 0x54, 0x64, 0xEA, 0xA7, 0x33, 0x38, 0x5D, 0xBB, 0xEB, 0x6F, 0xD7, + 0x35, 0x09, 0xB8, 0x57, 0xE6, 0xA4, 0x19, 0xDC, 0xA1, 0xD8, 0x90, 0x7A, 0xF9, 0x77, + 0xFB, 0xAC, 0x4D, 0xFA, 0x35, 0xEF }, + 328, + { 0x5D, 0x0A, 0x80, 0xD8, 0x13, 0x4A, 0xE1, 0x96, 0x77, 0x82, 0x4B, 0x67, 0x1E, 0x83, + 0x8A, 0xF4 }, + 16, + { 0x3A, 0xE4, 0xBF, 0xF3 } } +}; static hash_iv_test_vector_t kasumi_f9_IV_vectors[] = { - { - /* 3GPP specs Test Set 1 */ - /*input*/ - {0x6B, 0x22, 0x77, 0x37, 0x29, 0x6F, 0x39, 0x3C, - 0x80, 0x79, 0x35, 0x3E, 0xDC, 0x87, 0xE2, 0xE8, - 0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE0}, - /*length*/ - 189, - /*key*/ - {0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, - 0x48, 0x81, 0xFF, 0x48}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0xF6, 0x3B, 0xD7, 0x2C}, - /*iv*/ - {0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49}, - /*ivLeninbytes*/ - 8, - /*direction*/ - 0, - }, - { - /* 3GPP specs Test Set 2 */ - /*input*/ - {0xB5, 0x92, 0x43, 0x84, 0x32, 0x8A, 0x4A, 0xE0, 0x0B, 0x73, 0x71, - 0x09, 0xF8, 0xB6, 0xC8, 0xDD, 0x2B, 0x4D, 0xB6, 0x3D, 0xD5, 0x33, - 0x98, 0x1C, 0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC0}, - /*length*/ - 254, - /*key*/ - {0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF, 0xCD, 0x9F, 0x97, 0x94, - 0x5E, 0x6D, 0xE7, 0xB7}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0xA9, 0xDA, 0xF1, 0xFF}, - /*iv*/ - {0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2}, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - }, - { - /* 3GPP specs Test Set 3 */ - /*input*/ - {0x59, 0x32, 0xBC, 0x0A, 0xCE, 0x2B, 0x0A, 0xBA, 0x33, 0xD8, - 0xAC, 0x18, 0x8A, 0xC5, 0x4F, 0x34, 0x6F, 0xAD, 0x10, 0xBF, - 0x9D, 0xEE, 0x29, 0x20, 0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, - 0x5C, 0xB7, 0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF2}, - /*length*/ - 319, - /*key*/ - {0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4, 0x83, 0xA3, 0x18, 0x69, - 0xD8, 0x1B, 0x8F, 0xAB}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0x15, 0x37, 0xD3, 0x16}, - /*iv*/ - {0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A}, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - }, - { - /* 3GPP specs Test Set 4 */ - /*input*/ - {0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, 0x78, 0x83, - 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, 0x72, 0xBD, 0x97, 0x0C, - 0x14, 0x73, 0xE1, 0x29, 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, - 0xAA, 0xA0, 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, - 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09}, - /*length*/ - 384, - /*key*/ - {0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, 0x1E, 0x26, 0x98, 0xD2, - 0xE2, 0x2A, 0xD5, 0x7E}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0xDD, 0x7D, 0xFA, 0xDD}, - /*iv*/ - {0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD}, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - }, - { - /* 3GPP specs Test Set 5 */ - /*input*/ - {0x10, 0xBF, 0xFF, 0x83, 0x9E, 0x0C, 0x71, 0x65, 0x8D, 0xBB, 0x2D, 0x17, - 0x07, 0xE1, 0x45, 0x72, 0x4F, 0x41, 0xC1, 0x6F, 0x48, 0xBF, 0x40, 0x3C, - 0x3B, 0x18, 0xE3, 0x8F, 0xD5, 0xD1, 0x66, 0x3B, 0x6F, 0x6D, 0x90, 0x01, - 0x93, 0xE3, 0xCE, 0xA8, 0xBB, 0x4F, 0x1B, 0x4F, 0x5B, 0xE8, 0x22, 0x03, - 0x22, 0x32, 0xA7, 0x8D, 0x7D, 0x75, 0x23, 0x8D, 0x5E, 0x6D, 0xAE, 0xCD, - 0x3B, 0x43, 0x22, 0xCF, 0x59, 0xBC, 0x7E, 0xA8, 0x4A, 0xB1, 0x88, 0x11, - 0xB5, 0xBF, 0xB7, 0xBC, 0x55, 0x3F, 0x4F, 0xE4, 0x44, 0x78, 0xCE, 0x28, - 0x7A, 0x14, 0x87, 0x99, 0x90, 0xD1, 0x8D, 0x12, 0xCA, 0x79, 0xD2, 0xC8, - 0x55, 0x14, 0x90, 0x21, 0xCD, 0x5C, 0xE8, 0xCA, 0x03, 0x71, 0xCA, 0x04, - 0xFC, 0xCE, 0x14, 0x3E, 0x3D, 0x7C, 0xFE, 0xE9, 0x45, 0x85, 0xB5, 0x88, - 0x5C, 0xAC, 0x46, 0x06, 0x8B}, - /*length*/ - 1000, - /*key*/ - {0xF4, 0xEB, 0xEC, 0x69, 0xE7, 0x3E, 0xAF, 0x2E, 0xB2, 0xCF, 0x6A, 0xF4, - 0xB3, 0x12, 0x0F, 0xFD}, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - {0xC3, 0x83, 0x83, 0x9D}, - /*iv*/ - {0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37}, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - } }; + { + /* 3GPP specs Test Set 1 */ + /*input*/ + { 0x6B, 0x22, 0x77, 0x37, 0x29, 0x6F, 0x39, 0x3C, 0x80, 0x79, 0x35, 0x3E, + 0xDC, 0x87, 0xE2, 0xE8, 0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE0 }, + /*length*/ + 189, + /*key*/ + { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, + 0x81, 0xFF, 0x48 }, + /*KeyLeninBytes*/ + 16, + /*exp out*/ + { 0xF6, 0x3B, 0xD7, 0x2C }, + /*iv*/ + { 0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49 }, + /*ivLeninbytes*/ + 8, + /*direction*/ + 0, + }, + { + /* 3GPP specs Test Set 2 */ + /*input*/ + { 0xB5, 0x92, 0x43, 0x84, 0x32, 0x8A, 0x4A, 0xE0, 0x0B, 0x73, 0x71, + 0x09, 0xF8, 0xB6, 0xC8, 0xDD, 0x2B, 0x4D, 0xB6, 0x3D, 0xD5, 0x33, + 0x98, 0x1C, 0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC0 }, + /*length*/ + 254, + /*key*/ + { 0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF, 0xCD, 0x9F, 0x97, 0x94, 0x5E, + 0x6D, 0xE7, 0xB7 }, + /*KeyLeninBytes*/ + 16, + /*exp out*/ + { 0xA9, 0xDA, 0xF1, 0xFF }, + /*iv*/ + { 0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2 }, + /*ivLeninbytes*/ + 8, + /*direction*/ + 1, + }, + { + /* 3GPP specs Test Set 3 */ + /*input*/ + { 0x59, 0x32, 0xBC, 0x0A, 0xCE, 0x2B, 0x0A, 0xBA, 0x33, 0xD8, + 0xAC, 0x18, 0x8A, 0xC5, 0x4F, 0x34, 0x6F, 0xAD, 0x10, 0xBF, + 0x9D, 0xEE, 0x29, 0x20, 0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, + 0x5C, 0xB7, 0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF2 }, + /*length*/ + 319, + /*key*/ + { 0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4, 0x83, 0xA3, 0x18, 0x69, 0xD8, + 0x1B, 0x8F, 0xAB }, + /*KeyLeninBytes*/ + 16, + /*exp out*/ + { 0x15, 0x37, 0xD3, 0x16 }, + /*iv*/ + { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A }, + /*ivLeninbytes*/ + 8, + /*direction*/ + 1, + }, + { + /* 3GPP specs Test Set 4 */ + /*input*/ + { 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, 0x78, 0x83, 0x3F, 0xA0, + 0x2E, 0x23, 0x5A, 0xA1, 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, 0xB2, 0x4A, 0x03, 0x86, + 0x65, 0x42, 0x2B, 0x20, 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 }, + /*length*/ + 384, + /*key*/ + { 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, 0x1E, 0x26, 0x98, 0xD2, 0xE2, + 0x2A, 0xD5, 0x7E }, + /*KeyLeninBytes*/ + 16, + /*exp out*/ + { 0xDD, 0x7D, 0xFA, 0xDD }, + /*iv*/ + { 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD }, + /*ivLeninbytes*/ + 8, + /*direction*/ + 1, + }, + { + /* 3GPP specs Test Set 5 */ + /*input*/ + { 0x10, 0xBF, 0xFF, 0x83, 0x9E, 0x0C, 0x71, 0x65, 0x8D, 0xBB, 0x2D, 0x17, 0x07, + 0xE1, 0x45, 0x72, 0x4F, 0x41, 0xC1, 0x6F, 0x48, 0xBF, 0x40, 0x3C, 0x3B, 0x18, + 0xE3, 0x8F, 0xD5, 0xD1, 0x66, 0x3B, 0x6F, 0x6D, 0x90, 0x01, 0x93, 0xE3, 0xCE, + 0xA8, 0xBB, 0x4F, 0x1B, 0x4F, 0x5B, 0xE8, 0x22, 0x03, 0x22, 0x32, 0xA7, 0x8D, + 0x7D, 0x75, 0x23, 0x8D, 0x5E, 0x6D, 0xAE, 0xCD, 0x3B, 0x43, 0x22, 0xCF, 0x59, + 0xBC, 0x7E, 0xA8, 0x4A, 0xB1, 0x88, 0x11, 0xB5, 0xBF, 0xB7, 0xBC, 0x55, 0x3F, + 0x4F, 0xE4, 0x44, 0x78, 0xCE, 0x28, 0x7A, 0x14, 0x87, 0x99, 0x90, 0xD1, 0x8D, + 0x12, 0xCA, 0x79, 0xD2, 0xC8, 0x55, 0x14, 0x90, 0x21, 0xCD, 0x5C, 0xE8, 0xCA, + 0x03, 0x71, 0xCA, 0x04, 0xFC, 0xCE, 0x14, 0x3E, 0x3D, 0x7C, 0xFE, 0xE9, 0x45, + 0x85, 0xB5, 0x88, 0x5C, 0xAC, 0x46, 0x06, 0x8B }, + /*length*/ + 1000, + /*key*/ + { 0xF4, 0xEB, 0xEC, 0x69, 0xE7, 0x3E, 0xAF, 0x2E, 0xB2, 0xCF, 0x6A, 0xF4, 0xB3, + 0x12, 0x0F, 0xFD }, + /*KeyLeninBytes*/ + 16, + /*exp out*/ + { 0xC3, 0x83, 0x83, 0x9D }, + /*iv*/ + { 0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37 }, + /*ivLeninbytes*/ + 8, + /*direction*/ + 1, + } +}; -const cipher_test_vector_t *cipher_test_vectors[] = {kasumi_f8_vectors}; -const uint32_t numCipherTestVectors[] = { - sizeof(kasumi_f8_vectors) / sizeof(cipher_test_vector_t), - sizeof(kasumi_f8_bitvectors) / sizeof(cipherbit_test_vector_t)}; +const cipher_test_vector_t *cipher_test_vectors[] = { kasumi_f8_vectors }; +const uint32_t numCipherTestVectors[] = { sizeof(kasumi_f8_vectors) / sizeof(cipher_test_vector_t), + sizeof(kasumi_f8_bitvectors) / + sizeof(cipherbit_test_vector_t) }; -const uint32_t numHashTestVectors[] = { - sizeof(kasumi_f9_vectors) / sizeof(hash_test_vector_t), - sizeof(kasumi_f9_IV_vectors) / sizeof(hash_iv_test_vector_t)}; +const uint32_t numHashTestVectors[] = { sizeof(kasumi_f9_vectors) / sizeof(hash_test_vector_t), + sizeof(kasumi_f9_IV_vectors) / + sizeof(hash_iv_test_vector_t) }; #endif /*__KASUMI_TEST_VECTORS_H__*/ diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 0bd21d17..45dc0c64 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -35,40 +35,74 @@ #include "customop_test.h" #include "utils.h" -extern int des_test(struct IMB_MGR *mb_mgr); -extern int ccm_test(struct IMB_MGR *mb_mgr); -extern int cmac_test(struct IMB_MGR *mb_mgr); -extern int hmac_sha1_test(struct IMB_MGR *mb_mgr); -extern int hmac_sha256_sha512_test(struct IMB_MGR *mb_mgr); -extern int hmac_md5_test(struct IMB_MGR *mb_mgr); -extern int aes_test(struct IMB_MGR *mb_mgr); -extern int ecb_test(struct IMB_MGR *mb_mgr); -extern int sha_test(struct IMB_MGR *mb_mgr); -extern int chained_test(struct IMB_MGR *mb_mgr); -extern int api_test(struct IMB_MGR *mb_mgr); -extern int pon_test(struct IMB_MGR *mb_mgr); -extern int zuc_test(struct IMB_MGR *mb_mgr); -extern int kasumi_test(struct IMB_MGR *mb_mgr); -extern int snow3g_test(struct IMB_MGR *mb_mgr); -extern int direct_api_test(struct IMB_MGR *mb_mgr); -extern int clear_mem_test(struct IMB_MGR *mb_mgr); -extern int hec_test(struct IMB_MGR *mb_mgr); -extern int xcbc_test(struct IMB_MGR *mb_mgr); -extern int aes_cbcs_test(struct IMB_MGR *mb_mgr); -extern int crc_test(struct IMB_MGR *mb_mgr); -extern int chacha_test(struct IMB_MGR *mb_mgr); -extern int poly1305_test(struct IMB_MGR *mb_mgr); -extern int chacha20_poly1305_test(struct IMB_MGR *mb_mgr); -extern int null_test(struct IMB_MGR *mb_mgr); -extern int snow_v_test(struct IMB_MGR *mb_mgr); -extern int direct_api_param_test(struct IMB_MGR *mb_mgr); -extern int quic_ecb_test(struct IMB_MGR *mb_mgr); -extern int quic_chacha20_test(struct IMB_MGR *mb_mgr); -extern int gmac_test(struct IMB_MGR *mb_mgr); -extern int ghash_test(struct IMB_MGR *mb_mgr); -extern int cbc_test(struct IMB_MGR *mb_mg); -extern int cfb_test(struct IMB_MGR *mb_mg); -extern int ctr_test(struct IMB_MGR *mb_mg); +extern int +des_test(struct IMB_MGR *mb_mgr); +extern int +ccm_test(struct IMB_MGR *mb_mgr); +extern int +cmac_test(struct IMB_MGR *mb_mgr); +extern int +hmac_sha1_test(struct IMB_MGR *mb_mgr); +extern int +hmac_sha256_sha512_test(struct IMB_MGR *mb_mgr); +extern int +hmac_md5_test(struct IMB_MGR *mb_mgr); +extern int +aes_test(struct IMB_MGR *mb_mgr); +extern int +ecb_test(struct IMB_MGR *mb_mgr); +extern int +sha_test(struct IMB_MGR *mb_mgr); +extern int +chained_test(struct IMB_MGR *mb_mgr); +extern int +api_test(struct IMB_MGR *mb_mgr); +extern int +pon_test(struct IMB_MGR *mb_mgr); +extern int +zuc_test(struct IMB_MGR *mb_mgr); +extern int +kasumi_test(struct IMB_MGR *mb_mgr); +extern int +snow3g_test(struct IMB_MGR *mb_mgr); +extern int +direct_api_test(struct IMB_MGR *mb_mgr); +extern int +clear_mem_test(struct IMB_MGR *mb_mgr); +extern int +hec_test(struct IMB_MGR *mb_mgr); +extern int +xcbc_test(struct IMB_MGR *mb_mgr); +extern int +aes_cbcs_test(struct IMB_MGR *mb_mgr); +extern int +crc_test(struct IMB_MGR *mb_mgr); +extern int +chacha_test(struct IMB_MGR *mb_mgr); +extern int +poly1305_test(struct IMB_MGR *mb_mgr); +extern int +chacha20_poly1305_test(struct IMB_MGR *mb_mgr); +extern int +null_test(struct IMB_MGR *mb_mgr); +extern int +snow_v_test(struct IMB_MGR *mb_mgr); +extern int +direct_api_param_test(struct IMB_MGR *mb_mgr); +extern int +quic_ecb_test(struct IMB_MGR *mb_mgr); +extern int +quic_chacha20_test(struct IMB_MGR *mb_mgr); +extern int +gmac_test(struct IMB_MGR *mb_mgr); +extern int +ghash_test(struct IMB_MGR *mb_mgr); +extern int +cbc_test(struct IMB_MGR *mb_mg); +extern int +cfb_test(struct IMB_MGR *mb_mg); +extern int +ctr_test(struct IMB_MGR *mb_mg); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); @@ -90,208 +124,57 @@ struct imb_test { struct imb_test tests[] = { #ifndef __aarch64__ - { - .str = "KAT", - .fn = known_answer_test, - .enabled = 1 - }, - { - .str = "DO_TEST", - .fn = do_test, - .enabled = 1 - }, - { - .str = "CBC", - .fn = cbc_test, - .enabled = 1 - }, - { - .str = "CFB", - .fn = cfb_test, - .enabled = 1 - }, - { - .str = "CTR", - .fn = ctr_test, - .enabled = 1 - }, - { - .str = "PON", - .fn = pon_test, - .enabled = 1 - }, - { - .str = "XCBC", - .fn = xcbc_test, - .enabled = 1 - }, - { - .str = "GCM", - .fn = gcm_test, - .enabled = 1 - }, - { - .str = "GMAC", - .fn = gmac_test, - .enabled = 1 - }, - { - .str = "GHASH", - .fn = ghash_test, - .enabled = 1 - }, - { - .str = "CUSTOMOP", - .fn = customop_test, - .enabled = 1 - }, - { - .str = "DES", - .fn = des_test, - .enabled = 1 - }, - { - .str = "CCM", - .fn = ccm_test, - .enabled = 1 - }, - { - .str = "CMAC", - .fn = cmac_test, - .enabled = 1 - }, + { .str = "KAT", .fn = known_answer_test, .enabled = 1 }, + { .str = "DO_TEST", .fn = do_test, .enabled = 1 }, + { .str = "CBC", .fn = cbc_test, .enabled = 1 }, + { .str = "CFB", .fn = cfb_test, .enabled = 1 }, + { .str = "CTR", .fn = ctr_test, .enabled = 1 }, + { .str = "PON", .fn = pon_test, .enabled = 1 }, + { .str = "XCBC", .fn = xcbc_test, .enabled = 1 }, + { .str = "GCM", .fn = gcm_test, .enabled = 1 }, + { .str = "GMAC", .fn = gmac_test, .enabled = 1 }, + { .str = "GHASH", .fn = ghash_test, .enabled = 1 }, + { .str = "CUSTOMOP", .fn = customop_test, .enabled = 1 }, + { .str = "DES", .fn = des_test, .enabled = 1 }, + { .str = "CCM", .fn = ccm_test, .enabled = 1 }, + { .str = "CMAC", .fn = cmac_test, .enabled = 1 }, #endif /* __aarch64__ */ - { - .str = "ZUC", - .fn = zuc_test, - .enabled = 1 - }, + { .str = "ZUC", .fn = zuc_test, .enabled = 1 }, #ifndef __aarch64__ - { - .str = "KASUMI", - .fn = kasumi_test, - .enabled = 1 - }, + { .str = "KASUMI", .fn = kasumi_test, .enabled = 1 }, #endif /* __aarch64__ */ - { - .str = "SNOW3G", - .fn = snow3g_test, - .enabled = 1 - }, + { .str = "SNOW3G", .fn = snow3g_test, .enabled = 1 }, #ifndef __aarch64__ - { - .str = "HMAC_SHA1", - .fn = hmac_sha1_test, - .enabled = 1 - }, - { - .str = "HMAC_SHA256", - .fn = hmac_sha256_sha512_test, - .enabled = 1 - }, - { - .str = "HMAC_MD5", - .fn = hmac_md5_test, - .enabled = 1 - }, - { - .str = "AES", - .fn = aes_test, - .enabled = 1 - }, - { - .str = "ECB", - .fn = ecb_test, - .enabled = 1 - }, - { - .str = "SHA", - .fn = sha_test, - .enabled = 1 - }, - { - .str = "CHAINED", - .fn = chained_test, - .enabled = 1 - }, - { - .str = "HEC", - .fn = hec_test, - .enabled = 1 - }, - { - .str = "AES_CBCS", - .fn = aes_cbcs_test, - .enabled = 1 - }, - { - .str = "CHACHA", - .fn = chacha_test, - .enabled = 1 - }, - { - .str = "POLY1305", - .fn = poly1305_test, - .enabled = 1 - }, + { .str = "HMAC_SHA1", .fn = hmac_sha1_test, .enabled = 1 }, + { .str = "HMAC_SHA256", .fn = hmac_sha256_sha512_test, .enabled = 1 }, + { .str = "HMAC_MD5", .fn = hmac_md5_test, .enabled = 1 }, + { .str = "AES", .fn = aes_test, .enabled = 1 }, + { .str = "ECB", .fn = ecb_test, .enabled = 1 }, + { .str = "SHA", .fn = sha_test, .enabled = 1 }, + { .str = "CHAINED", .fn = chained_test, .enabled = 1 }, + { .str = "HEC", .fn = hec_test, .enabled = 1 }, + { .str = "AES_CBCS", .fn = aes_cbcs_test, .enabled = 1 }, + { .str = "CHACHA", .fn = chacha_test, .enabled = 1 }, + { .str = "POLY1305", .fn = poly1305_test, .enabled = 1 }, #endif /* __aarch64__ */ - { - .str = "API", - .fn = api_test, - .enabled = 1 - }, - { - .str = "DIRECT_API", - .fn = direct_api_test, - .enabled = 1 - }, - { - .str = "CLEAR_MEM", - .fn = clear_mem_test, - .enabled = 1 - }, + { .str = "API", .fn = api_test, .enabled = 1 }, + { .str = "DIRECT_API", .fn = direct_api_test, .enabled = 1 }, + { .str = "CLEAR_MEM", .fn = clear_mem_test, .enabled = 1 }, #ifndef __aarch64__ - { - .str = "CRC", - .fn = crc_test, - .enabled = 1 - }, - { - .str = "CHACHA20_POLY1305", - .fn = chacha20_poly1305_test, - .enabled = 1 - }, - { - .str = "NULL", - .fn = null_test, - .enabled = 1 - }, - { - .str = "SNOW_V", - .fn = snow_v_test, - .enabled = 1 - }, + { .str = "CRC", .fn = crc_test, .enabled = 1 }, + { .str = "CHACHA20_POLY1305", .fn = chacha20_poly1305_test, .enabled = 1 }, + { .str = "NULL", .fn = null_test, .enabled = 1 }, + { .str = "SNOW_V", .fn = snow_v_test, .enabled = 1 }, #endif /* __aarch64__ */ - { - .str = "DIRECT_API_PARAM", - .fn = direct_api_param_test, - .enabled = 1 - }, + { .str = "DIRECT_API_PARAM", .fn = direct_api_param_test, .enabled = 1 }, #ifndef __aarch64__ - { - .str = "QUIC-ECB", - .fn = quic_ecb_test, - .enabled = 1 - }, - { - .str = "QUIC-CHACHA20", - .fn = quic_chacha20_test, - .enabled = 1 - } + { .str = "QUIC-ECB", .fn = quic_ecb_test, .enabled = 1 }, + { .str = "QUIC-CHACHA20", .fn = quic_chacha20_test, .enabled = 1 } #endif /* __aarch64__ */ }; -static char *get_test_types(void) +static char * +get_test_types(void) { const size_t separator_length = 2; size_t buffer_sz = 1; /* 1 for NULL termination */ @@ -323,26 +206,26 @@ usage(const char *name) { char *test_types = get_test_types(); - fprintf(stderr, + fprintf(stderr, "Usage: %s [args], where args are zero or more\n" "--help: Prints this page\n" "--test-type : Run selected test type. is one of %s.\n" "--stop-on-fail: Stop test execution if a test fails\n" "--no-aesni-emu: Don't do AESNI emulation\n" "--no-avx512: Don't do AVX512\n" - "--no-avx2: Don't do AVX2\n" - "--no-avx: Don't do AVX\n" - "--no-sse: Don't do SSE\n" + "--no-avx2: Don't do AVX2\n" + "--no-avx: Don't do AVX\n" + "--no-sse: Don't do SSE\n" "--no-aarch64: Don't do AARCH64\n" - "--no-sve256: Don't do SVE256\n" + "--no-sve256: Don't do SVE256\n" "--auto-detect: Auto detects current architecture " "to run the tests\n Note: Auto detection " "option now run by default and will be removed in the future\n" "--gfni-on: Use Galois Field extensions, default: auto-detect\n" "--gfni-off: Don't use Galois Field extensions\n" - "--shani-on: Use SHA extensions, default: auto-detect\n" - "--shani-off: Don't use SHA extensions\n" - "--quiet: Enable quiet mode with reduced text output\n", + "--shani-on: Use SHA extensions, default: auto-detect\n" + "--shani-off: Don't use SHA extensions\n" + "--quiet: Enable quiet mode with reduced text output\n", name, test_types); free(test_types); @@ -355,22 +238,14 @@ print_hw_features(void) uint64_t feat_val; const char *feat_name; } feat_tab[] = { - { IMB_FEATURE_SHANI, "SHANI" }, - { IMB_FEATURE_AESNI, "AESNI" }, - { IMB_FEATURE_PCLMULQDQ, "PCLMULQDQ" }, - { IMB_FEATURE_CMOV, "CMOV" }, - { IMB_FEATURE_SSE4_2, "SSE4.2" }, - { IMB_FEATURE_AVX, "AVX" }, - { IMB_FEATURE_AVX2, "AVX2" }, - { IMB_FEATURE_AVX512_SKX, "AVX512(SKX)" }, - { IMB_FEATURE_VAES, "VAES" }, - { IMB_FEATURE_VPCLMULQDQ, "VPCLMULQDQ" }, - { IMB_FEATURE_GFNI, "GFNI" }, - { IMB_FEATURE_AVX512_IFMA, "AVX512-IFMA" }, - { IMB_FEATURE_AVX_IFMA, "AVX-IFMA" }, - { IMB_FEATURE_BMI2, "BMI2" }, - { IMB_FEATURE_AARCH64, "AARCH64" }, - { IMB_FEATURE_SVE256, "SVE256" }, + { IMB_FEATURE_SHANI, "SHANI" }, { IMB_FEATURE_AESNI, "AESNI" }, + { IMB_FEATURE_PCLMULQDQ, "PCLMULQDQ" }, { IMB_FEATURE_CMOV, "CMOV" }, + { IMB_FEATURE_SSE4_2, "SSE4.2" }, { IMB_FEATURE_AVX, "AVX" }, + { IMB_FEATURE_AVX2, "AVX2" }, { IMB_FEATURE_AVX512_SKX, "AVX512(SKX)" }, + { IMB_FEATURE_VAES, "VAES" }, { IMB_FEATURE_VPCLMULQDQ, "VPCLMULQDQ" }, + { IMB_FEATURE_GFNI, "GFNI" }, { IMB_FEATURE_AVX512_IFMA, "AVX512-IFMA" }, + { IMB_FEATURE_AVX_IFMA, "AVX-IFMA" }, { IMB_FEATURE_BMI2, "BMI2" }, + { IMB_FEATURE_AARCH64, "AARCH64" }, { IMB_FEATURE_SVE256, "SVE256" }, }; IMB_MGR *p_mgr = NULL; unsigned i; @@ -443,34 +318,29 @@ main(int argc, char **argv) memset(arch_select, 0xff, sizeof(arch_select)); - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-h") == 0 || - strcmp(argv[i], "--help") == 0) { - usage(argv[0]); - return EXIT_SUCCESS; - } else if (update_flags_and_archs(argv[i], - arch_select, - &flags)) - continue; - else if (strcmp(argv[i], "--auto-detect") == 0) + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { + usage(argv[0]); + return EXIT_SUCCESS; + } else if (update_flags_and_archs(argv[i], arch_select, &flags)) + continue; + else if (strcmp(argv[i], "--auto-detect") == 0) (void) auto_detect; /* legacy option - to be removed */ - else if (strcmp(argv[i], "--stop-on-fail") == 0) + else if (strcmp(argv[i], "--stop-on-fail") == 0) stop_on_fail = 1; - else if (strcmp(argv[i], "--quiet") == 0) + else if (strcmp(argv[i], "--quiet") == 0) quiet_mode = 1; else if (strcmp(argv[i], "--test-type") == 0) { unsigned selected_test; - selected_test = check_test_string_arg(argv[i], - argv[i+1]); + selected_test = check_test_string_arg(argv[i], argv[i + 1]); if (selected_test == DIM(tests)) return EXIT_FAILURE; else { /* Disable all tests except the one passed */ unsigned test_idx; - for (test_idx = 0; test_idx < DIM(tests); - test_idx++) + for (test_idx = 0; test_idx < DIM(tests); test_idx++) if (test_idx != selected_test) tests[test_idx].enabled = 0; } @@ -553,8 +423,7 @@ main(int argc, char **argv) if (p_mgr->features & IMB_FEATURE_SELF_TEST) printf("SELF-TEST: %s\n", - (p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) ? - "PASS" : "FAIL"); + (p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) ? "PASS" : "FAIL"); else printf("SELF-TEST: N/A (requires library >= v1.3)\n"); diff --git a/test/kat-app/null_test.c b/test/kat-app/null_test.c index 200d07fb..ecdccd22 100644 --- a/test/kat-app/null_test.c +++ b/test/kat-app/null_test.c @@ -36,23 +36,22 @@ #define PAD_SIZE 16 #define BUF_SIZE 32 -int null_test(struct IMB_MGR *mb_mgr); +int +null_test(struct IMB_MGR *mb_mgr); static void -test_null_hash(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - IMB_CIPHER_DIRECTION cipher_dir, - IMB_CHAIN_ORDER chain_order) +test_null_hash(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, + IMB_CIPHER_DIRECTION cipher_dir, IMB_CHAIN_ORDER chain_order) { - DECLARE_ALIGNED(uint8_t cipher_key[16], 16) = {0}; - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint8_t cipher_key[16], 16) = { 0 }; + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); DECLARE_ALIGNED(uint8_t iv[16], 16); - DECLARE_ALIGNED(uint8_t digest[16], 16) = {0}; - DECLARE_ALIGNED(uint8_t all_zeros[16], 16) = {0}; + DECLARE_ALIGNED(uint8_t digest[16], 16) = { 0 }; + DECLARE_ALIGNED(uint8_t all_zeros[16], 16) = { 0 }; struct IMB_JOB *job; uint8_t padding[PAD_SIZE]; - uint8_t target[BUF_SIZE + 2*PAD_SIZE]; + uint8_t target[BUF_SIZE + 2 * PAD_SIZE]; uint8_t in_text[BUF_SIZE]; int ret = -1; @@ -86,21 +85,19 @@ test_null_hash(struct IMB_MGR *mb_mgr, job = IMB_FLUSH_JOB(mb_mgr); if (!job) { - printf("%d Unexpected null return from submit/flush_job\n", - __LINE__); + printf("%d Unexpected null return from submit/flush_job\n", __LINE__); goto end; } /* Check that padding has not been changed */ if (memcmp(padding, target, PAD_SIZE)) { printf("overwrite head\n"); - hexdump(stderr, "Target", target, BUF_SIZE + PAD_SIZE*2); + hexdump(stderr, "Target", target, BUF_SIZE + PAD_SIZE * 2); goto end; } - if (memcmp(padding, target + PAD_SIZE + BUF_SIZE, - PAD_SIZE)) { + if (memcmp(padding, target + PAD_SIZE + BUF_SIZE, PAD_SIZE)) { printf("overwrite tail\n"); - hexdump(stderr, "Target", target, BUF_SIZE + PAD_SIZE*2); + hexdump(stderr, "Target", target, BUF_SIZE + PAD_SIZE * 2); goto end; } /* Check that authentication tag has not been modified */ @@ -121,19 +118,17 @@ end: } static void -test_null_cipher(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - IMB_CIPHER_DIRECTION cipher_dir, - IMB_CHAIN_ORDER chain_order) +test_null_cipher(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, + IMB_CIPHER_DIRECTION cipher_dir, IMB_CHAIN_ORDER chain_order) { DECLARE_ALIGNED(uint8_t auth_key[16], 16); - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint32_t skey1[4], skey2[4]; - DECLARE_ALIGNED(uint8_t digest[16], 16) = {0}; + DECLARE_ALIGNED(uint8_t digest[16], 16) = { 0 }; struct IMB_JOB *job; - uint8_t in_text[BUF_SIZE] = {0}; - DECLARE_ALIGNED(uint8_t all_zeros[BUF_SIZE], 16) = {0}; + uint8_t in_text[BUF_SIZE] = { 0 }; + DECLARE_ALIGNED(uint8_t all_zeros[BUF_SIZE], 16) = { 0 }; int ret = -1; memset(auth_key, 0x55, sizeof(auth_key)); @@ -164,8 +159,7 @@ test_null_cipher(struct IMB_MGR *mb_mgr, job = IMB_FLUSH_JOB(mb_mgr); if (!job) { - printf("%d Unexpected null return from submit/flush_job\n", - __LINE__); + printf("%d Unexpected null return from submit/flush_job\n", __LINE__); goto end; } if (job->status != IMB_STATUS_COMPLETED) { @@ -218,5 +212,5 @@ null_test(struct IMB_MGR *mb_mgr) test_null_cipher(mb_mgr, &ctx, IMB_DIR_DECRYPT, IMB_ORDER_HASH_CIPHER); errors += test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/poly1305_test.c b/test/kat-app/poly1305_test.c index a74c40a7..2e0a6f92 100644 --- a/test/kat-app/poly1305_test.c +++ b/test/kat-app/poly1305_test.c @@ -34,34 +34,29 @@ #include "utils.h" #include "mac_test.h" -int poly1305_test(struct IMB_MGR *mb_mgr); +int +poly1305_test(struct IMB_MGR *mb_mgr); extern const struct mac_test poly1305_test_json[]; static int -poly1305_job_ok(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const struct IMB_JOB *job, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +poly1305_job_ok(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const struct IMB_JOB *job, + const uint8_t *auth, const uint8_t *padding, const size_t sizeof_padding) { const size_t auth_len = job->auth_tag_output_len_in_bytes; if (job->status != IMB_STATUS_COMPLETED) { const int errcode = imb_get_errno(mb_mgr); - printf("Error!: job status %d, errno %d => %s\n", - job->status, errcode, imb_get_strerror(errcode)); + printf("Error!: job status %d, errno %d => %s\n", job->status, errcode, + imb_get_strerror(errcode)); return 0; } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + auth_len], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + auth_len], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + auth_len], sizeof_padding); + hexdump(stderr, "Target", &auth[sizeof_padding + auth_len], sizeof_padding); return 0; } @@ -73,20 +68,15 @@ poly1305_job_ok(struct IMB_MGR *mb_mgr, if (memcmp((const void *) vec->tag, &auth[sizeof_padding], auth_len)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], - auth_len); - hexdump(stderr, "Expected", (const void *) vec->tag, - auth_len); + hexdump(stderr, "Received", &auth[sizeof_padding], auth_len); + hexdump(stderr, "Expected", (const void *) vec->tag, auth_len); return 0; } return 1; } static int -test_poly1305(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const int dir, - const int num_jobs) +test_poly1305(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const int dir, const int num_jobs) { struct IMB_JOB *job; uint8_t padding[16]; @@ -94,8 +84,8 @@ test_poly1305(struct IMB_MGR *mb_mgr, int i = 0, jobs_rx = 0, ret = -1; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); @@ -111,7 +101,6 @@ test_poly1305(struct IMB_MGR *mb_mgr, memset(auths[i], -1, 16 + (sizeof(padding) * 2)); } - while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -137,8 +126,8 @@ test_poly1305(struct IMB_MGR *mb_mgr, job = IMB_SUBMIT_JOB(mb_mgr); if (job) { jobs_rx++; - if (!poly1305_job_ok(mb_mgr, vec, job, job->user_data, - padding, sizeof(padding))) + if (!poly1305_job_ok(mb_mgr, vec, job, job->user_data, padding, + sizeof(padding))) goto end; } } @@ -146,8 +135,7 @@ test_poly1305(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!poly1305_job_ok(mb_mgr, vec, job, job->user_data, - padding, sizeof(padding))) + if (!poly1305_job_ok(mb_mgr, vec, job, job->user_data, padding, sizeof(padding))) goto end; } @@ -156,10 +144,9 @@ test_poly1305(struct IMB_MGR *mb_mgr, goto end; } - ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -168,7 +155,7 @@ test_poly1305(struct IMB_MGR *mb_mgr, free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -176,24 +163,19 @@ test_poly1305(struct IMB_MGR *mb_mgr, } static void -test_poly1305_vectors(struct IMB_MGR *mb_mgr, - const int num_jobs, - struct test_suite_context *ctx, +test_poly1305_vectors(struct IMB_MGR *mb_mgr, const int num_jobs, struct test_suite_context *ctx, const char *banner) { - const struct mac_test *v = poly1305_test_json; + const struct mac_test *v = poly1305_test_json; if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (; v->msg != NULL; v++) { + printf("%s (N jobs = %d):\n", banner, num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("RFC7539 Test Case %zu key_len:%zu " - "data_len:%zu digest_len:%zu\n", - v->tcId, - v->keySize, - v->msgSize / 8, - v->tagSize); + "data_len:%zu digest_len:%zu\n", + v->tcId, v->keySize, v->msgSize / 8, v->tagSize); #else printf("."); #endif @@ -210,12 +192,11 @@ test_poly1305_vectors(struct IMB_MGR *mb_mgr, test_suite_update(ctx, 0, 1); } else test_suite_update(ctx, 1, 0); - } + } if (!quiet_mode) printf("\n"); } - int poly1305_test(struct IMB_MGR *mb_mgr) { @@ -227,5 +208,5 @@ poly1305_test(struct IMB_MGR *mb_mgr) test_poly1305_vectors(mb_mgr, i, &ctx, "Poly1305 RFC7539 vectors"); errors = test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/poly1305_test.json.c b/test/kat-app/poly1305_test.json.c index 28e3f293..dd1a9181 100644 --- a/test/kat-app/poly1305_test.json.c +++ b/test/kat-app/poly1305_test.json.c @@ -3,137 +3,125 @@ const struct mac_test poly1305_test_json[] = { /* Vectors from https://tools.ietf.org/html/rfc7539 */ - {256, 128, 1, - "\x85\xd6\xbe\x78\x57\x55\x6d\x33\x7f\x44\x52\xfe\x42\xd5\x06\xa8\x01\x03" - "\x80\x8a\xfb\x0d\xb2\xfd\x4a\xbf\xf6\xaf\x41\x49\xf5\x1b", - "\x43\x72\x79\x70\x74\x6f\x67\x72\x61\x70\x68\x69\x63\x20\x46\x6f\x72\x75" - "\x6d\x20\x52\x65\x73\x65\x61\x72\x63\x68\x20\x47\x72\x6f\x75\x70", - "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9", 1, 272, - NULL, 0}, - {256, 128, 2, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 512, - NULL, 0}, - {256, 128, 3, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\xe5" - "\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", - "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" - "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" - "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" - "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" - "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" - "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" - "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" - "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" - "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" - "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" - "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" - "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" - "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" - "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" - "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" - "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" - "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" - "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" - "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" - "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", - "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", 1, - 3000, NULL, 0}, - {256, 128, 4, - "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" - "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" - "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" - "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" - "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" - "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" - "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" - "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" - "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" - "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" - "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" - "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" - "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" - "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" - "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" - "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" - "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" - "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" - "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" - "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", - "\xf3\x47\x7e\x7c\xd9\x54\x17\xaf\x89\xa6\xb8\x79\x4c\x31\x0c\xf0", 1, - 3000, NULL, 0}, - {256, 128, 5, - "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a\xf3\x33\x88\x86\x04\xf6\xb5\xf0\x47\x39" - "\x17\xc1\x40\x2b\x80\x09\x9d\xca\x5c\xbc\x20\x70\x75\xc0", - "\x27\x54\x77\x61\x73\x20\x62\x72\x69\x6c\x6c\x69\x67\x2c\x20\x61\x6e\x64" - "\x20\x74\x68\x65\x20\x73\x6c\x69\x74\x68\x79\x20\x74\x6f\x76\x65\x73\x0a" - "\x44\x69\x64\x20\x67\x79\x72\x65\x20\x61\x6e\x64\x20\x67\x69\x6d\x62\x6c" - "\x65\x20\x69\x6e\x20\x74\x68\x65\x20\x77\x61\x62\x65\x3a\x0a\x41\x6c\x6c" - "\x20\x6d\x69\x6d\x73\x79\x20\x77\x65\x72\x65\x20\x74\x68\x65\x20\x62\x6f" - "\x72\x6f\x67\x6f\x76\x65\x73\x2c\x0a\x41\x6e\x64\x20\x74\x68\x65\x20\x6d" - "\x6f\x6d\x65\x20\x72\x61\x74\x68\x73\x20\x6f\x75\x74\x67\x72\x61\x62\x65" - "\x2e", - "\x45\x41\x66\x9a\x7e\xaa\xee\x61\xe7\x08\xdc\x7c\xbc\xc5\xeb\x62", 1, - 1016, NULL, 0}, - {256, 128, 6, - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, - NULL, 0}, - {256, 128, 7, - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, - NULL, 0}, - {256, 128, 8, - "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\xff" - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x11\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, - NULL, 0}, - {256, 128, 9, - "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xfe" - "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x01\x01\x01\x01" - "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, - NULL, 0}, - {256, 128, 10, - "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xfa\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, - NULL, 0}, - {256, 128, 11, - "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" - "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x14\x00\x00\x00\x00\x00\x00\x00\x55\x00\x00\x00\x00\x00\x00\x00", 1, 512, - NULL, 0}, - {256, 128, 12, - "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" - "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, - NULL, 0}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + { 256, 128, 1, + "\x85\xd6\xbe\x78\x57\x55\x6d\x33\x7f\x44\x52\xfe\x42\xd5\x06\xa8\x01\x03" + "\x80\x8a\xfb\x0d\xb2\xfd\x4a\xbf\xf6\xaf\x41\x49\xf5\x1b", + "\x43\x72\x79\x70\x74\x6f\x67\x72\x61\x70\x68\x69\x63\x20\x46\x6f\x72\x75" + "\x6d\x20\x52\x65\x73\x65\x61\x72\x63\x68\x20\x47\x72\x6f\x75\x70", + "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9", 1, 272, NULL, 0 }, + { 256, 128, 2, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 512, NULL, 0 }, + { 256, 128, 3, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\xe5" + "\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", + "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" + "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" + "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" + "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" + "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" + "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" + "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" + "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" + "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" + "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" + "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" + "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" + "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" + "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" + "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" + "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" + "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" + "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" + "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" + "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" + "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", + "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e", 1, 3000, NULL, 0 }, + { 256, 128, 4, + "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70\xf0\xef\xca\x96\x22\x7a\x86\x3e\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x41\x6e\x79\x20\x73\x75\x62\x6d\x69\x73\x73\x69\x6f\x6e\x20\x74\x6f\x20" + "\x74\x68\x65\x20\x49\x45\x54\x46\x20\x69\x6e\x74\x65\x6e\x64\x65\x64\x20" + "\x62\x79\x20\x74\x68\x65\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72" + "\x20\x66\x6f\x72\x20\x70\x75\x62\x6c\x69\x63\x61\x74\x69\x6f\x6e\x20\x61" + "\x73\x20\x61\x6c\x6c\x20\x6f\x72\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x61" + "\x6e\x20\x49\x45\x54\x46\x20\x49\x6e\x74\x65\x72\x6e\x65\x74\x2d\x44\x72" + "\x61\x66\x74\x20\x6f\x72\x20\x52\x46\x43\x20\x61\x6e\x64\x20\x61\x6e\x79" + "\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x20\x6d\x61\x64\x65\x20\x77\x69" + "\x74\x68\x69\x6e\x20\x74\x68\x65\x20\x63\x6f\x6e\x74\x65\x78\x74\x20\x6f" + "\x66\x20\x61\x6e\x20\x49\x45\x54\x46\x20\x61\x63\x74\x69\x76\x69\x74\x79" + "\x20\x69\x73\x20\x63\x6f\x6e\x73\x69\x64\x65\x72\x65\x64\x20\x61\x6e\x20" + "\x22\x49\x45\x54\x46\x20\x43\x6f\x6e\x74\x72\x69\x62\x75\x74\x69\x6f\x6e" + "\x22\x2e\x20\x53\x75\x63\x68\x20\x73\x74\x61\x74\x65\x6d\x65\x6e\x74\x73" + "\x20\x69\x6e\x63\x6c\x75\x64\x65\x20\x6f\x72\x61\x6c\x20\x73\x74\x61\x74" + "\x65\x6d\x65\x6e\x74\x73\x20\x69\x6e\x20\x49\x45\x54\x46\x20\x73\x65\x73" + "\x73\x69\x6f\x6e\x73\x2c\x20\x61\x73\x20\x77\x65\x6c\x6c\x20\x61\x73\x20" + "\x77\x72\x69\x74\x74\x65\x6e\x20\x61\x6e\x64\x20\x65\x6c\x65\x63\x74\x72" + "\x6f\x6e\x69\x63\x20\x63\x6f\x6d\x6d\x75\x6e\x69\x63\x61\x74\x69\x6f\x6e" + "\x73\x20\x6d\x61\x64\x65\x20\x61\x74\x20\x61\x6e\x79\x20\x74\x69\x6d\x65" + "\x20\x6f\x72\x20\x70\x6c\x61\x63\x65\x2c\x20\x77\x68\x69\x63\x68\x20\x61" + "\x72\x65\x20\x61\x64\x64\x72\x65\x73\x73\x65\x64\x20\x74\x6f", + "\xf3\x47\x7e\x7c\xd9\x54\x17\xaf\x89\xa6\xb8\x79\x4c\x31\x0c\xf0", 1, 3000, NULL, 0 }, + { 256, 128, 5, + "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a\xf3\x33\x88\x86\x04\xf6\xb5\xf0\x47\x39" + "\x17\xc1\x40\x2b\x80\x09\x9d\xca\x5c\xbc\x20\x70\x75\xc0", + "\x27\x54\x77\x61\x73\x20\x62\x72\x69\x6c\x6c\x69\x67\x2c\x20\x61\x6e\x64" + "\x20\x74\x68\x65\x20\x73\x6c\x69\x74\x68\x79\x20\x74\x6f\x76\x65\x73\x0a" + "\x44\x69\x64\x20\x67\x79\x72\x65\x20\x61\x6e\x64\x20\x67\x69\x6d\x62\x6c" + "\x65\x20\x69\x6e\x20\x74\x68\x65\x20\x77\x61\x62\x65\x3a\x0a\x41\x6c\x6c" + "\x20\x6d\x69\x6d\x73\x79\x20\x77\x65\x72\x65\x20\x74\x68\x65\x20\x62\x6f" + "\x72\x6f\x67\x6f\x76\x65\x73\x2c\x0a\x41\x6e\x64\x20\x74\x68\x65\x20\x6d" + "\x6f\x6d\x65\x20\x72\x61\x74\x68\x73\x20\x6f\x75\x74\x67\x72\x61\x62\x65" + "\x2e", + "\x45\x41\x66\x9a\x7e\xaa\xee\x61\xe7\x08\xdc\x7c\xbc\xc5\xeb\x62", 1, 1016, NULL, 0 }, + { 256, 128, 6, + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, NULL, 0 }, + { 256, 128, 7, + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, NULL, 0 }, + { 256, 128, 8, + "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x11\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, NULL, 0 }, + { 256, 128, 9, + "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xfe" + "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, NULL, 0 }, + { 256, 128, 10, + "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xfa\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, NULL, 0 }, + { 256, 128, 11, + "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" + "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x14\x00\x00\x00\x00\x00\x00\x00\x55\x00\x00\x00\x00\x00\x00\x00", 1, 512, NULL, 0 }, + { 256, 128, 12, + "\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x35\x94\xd7\x50\x5e\x43\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x33\x94" + "\xd7\x50\x5e\x43\x79\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 384, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/kat-app/pon_test.c b/test/kat-app/pon_test.c index 20a6319a..dbe1b7ab 100644 --- a/test/kat-app/pon_test.c +++ b/test/kat-app/pon_test.c @@ -34,19 +34,16 @@ #include "gcm_ctr_vectors_test.h" #include "utils.h" -int pon_test(struct IMB_MGR *mb_mgr); +int +pon_test(struct IMB_MGR *mb_mgr); /* === vector 1 */ -static const uint8_t KEY1_PON[] = { - 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, - 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00 -}; +static const uint8_t KEY1_PON[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, + 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00 }; -static const uint8_t IV1_PON[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 -}; +static const uint8_t IV1_PON[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 }; static const uint8_t IN1_PON[] = { 0x00, 0x20, 0x27, 0x11, 0x00, 0x00, 0x21, 0x23, /* XGEM header */ @@ -69,19 +66,17 @@ static const uint8_t OUT1_PON[] = { static const uint8_t IN2_PON[] = { 0x00, 0x40, 0x27, 0x11, 0x00, 0x00, 0x29, 0x3C, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* Ethernet frame */ - 0x01, 0x01, 0x01, 0x01, - 0x00, 0x14, 0xa9, 0x04 /* CRC value */ + 0x01, 0x01, 0x01, 0x01, 0x00, 0x14, 0xa9, 0x04 /* CRC value */ }; static const uint8_t OUT2_PON[] = { 0x00, 0x40, 0x27, 0x11, 0x00, 0x00, 0x29, 0x3C, /* XGEM header */ 0xC7, 0x62, 0x82, 0xCA, 0xF6, 0x6F, 0xF5, 0xED, - 0xB7, 0x90, 0x1E, 0x02, - 0xEA, 0x38, 0xA1, 0x78 + 0xB7, 0x90, 0x1E, 0x02, 0xEA, 0x38, 0xA1, 0x78 }; -#define KEY2_PON KEY1_PON -#define IV2_PON IV1_PON +#define KEY2_PON KEY1_PON +#define IV2_PON IV1_PON #define BIPOUT2_PON 0x70C6E56C #define OFFSET2_PON 8 #define LENBIP2_PON sizeof(IN2_PON) @@ -92,30 +87,22 @@ static const uint8_t OUT2_PON[] = { static const uint8_t IN3_PON[] = { 0x01, 0x00, 0x27, 0x11, 0x00, 0x00, 0x33, 0x0B, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* Ethernet frame */ - 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, - 0x08, 0x00, 0x45, 0x00, 0x00, 0x6A, 0xB0, 0x7E, - 0x00, 0x00, 0x04, 0x06, 0x83, 0xBD, 0xC0, 0xA8, - 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, 0x04, 0xD2, - 0x16, 0x2E, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, - 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xA6, 0x33, - 0x00, 0x00, 0x30, 0x31, - 0x53, 0xc1, 0xe6, 0x0c /* CRC value */ + 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, 0x00, 0x6A, 0xB0, + 0x7E, 0x00, 0x00, 0x04, 0x06, 0x83, 0xBD, 0xC0, 0xA8, 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, + 0x04, 0xD2, 0x16, 0x2E, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x90, 0x50, 0x10, 0x20, + 0x00, 0xA6, 0x33, 0x00, 0x00, 0x30, 0x31, 0x53, 0xc1, 0xe6, 0x0c /* CRC value */ }; static const uint8_t OUT3_PON[] = { 0x01, 0x00, 0x27, 0x11, 0x00, 0x00, 0x33, 0x0B, /* XGEM header */ - 0xC7, 0x62, 0x82, 0xCA, 0xF6, 0x6F, 0xF5, 0xED, - 0xB7, 0x90, 0x1E, 0x02, 0x6B, 0x2C, 0x08, 0x7D, - 0x3C, 0x90, 0xE8, 0x2C, 0x44, 0x30, 0x03, 0x29, - 0x5F, 0x88, 0xA9, 0xD6, 0x1E, 0xF9, 0xD1, 0xF1, - 0xD6, 0x16, 0x8C, 0x72, 0xA4, 0xCD, 0xD2, 0x8F, - 0x63, 0x26, 0xC9, 0x66, 0xB0, 0x65, 0x24, 0x9B, - 0x60, 0x5B, 0x18, 0x60, 0xBD, 0xD5, 0x06, 0x13, - 0x40, 0xC9, 0x60, 0x64, - 0x36, 0x5F, 0x86, 0x8C + 0xC7, 0x62, 0x82, 0xCA, 0xF6, 0x6F, 0xF5, 0xED, 0xB7, 0x90, 0x1E, 0x02, 0x6B, + 0x2C, 0x08, 0x7D, 0x3C, 0x90, 0xE8, 0x2C, 0x44, 0x30, 0x03, 0x29, 0x5F, 0x88, + 0xA9, 0xD6, 0x1E, 0xF9, 0xD1, 0xF1, 0xD6, 0x16, 0x8C, 0x72, 0xA4, 0xCD, 0xD2, + 0x8F, 0x63, 0x26, 0xC9, 0x66, 0xB0, 0x65, 0x24, 0x9B, 0x60, 0x5B, 0x18, 0x60, + 0xBD, 0xD5, 0x06, 0x13, 0x40, 0xC9, 0x60, 0x64, 0x36, 0x5F, 0x86, 0x8C }; -#define KEY3_PON KEY1_PON -#define IV3_PON IV1_PON +#define KEY3_PON KEY1_PON +#define IV3_PON IV1_PON #define BIPOUT3_PON 0xFBADE0DF #define OFFSET3_PON 8 #define LENBIP3_PON sizeof(IN3_PON) @@ -126,30 +113,23 @@ static const uint8_t OUT3_PON[] = { static const uint8_t IN4_PON[] = { 0x01, 0x10, 0x27, 0x11, 0x00, 0x00, 0x3C, 0x18, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* Ethernet frame */ - 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, - 0x08, 0x00, 0x45, 0x00, 0x00, 0x6A, 0x70, 0x63, - 0x00, 0x00, 0x04, 0x06, 0xC3, 0xD8, 0xC0, 0xA8, - 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, 0x04, 0xD2, - 0x16, 0x2E, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, - 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xA6, 0x33, - 0x00, 0x00, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, - 0x49, 0x0d, 0x52, 0xab /* CRC value */ + 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6A, 0x70, 0x63, 0x00, 0x00, 0x04, 0x06, 0xC3, 0xD8, 0xC0, 0xA8, + 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, 0x04, 0xD2, 0x16, 0x2E, 0x12, 0x34, + 0x56, 0x78, 0x12, 0x34, 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xA6, 0x33, + 0x00, 0x00, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x49, 0x0d, 0x52, 0xab /* CRC value */ }; static const uint8_t OUT4_PON[] = { 0x01, 0x10, 0x27, 0x11, 0x00, 0x00, 0x3C, 0x18, /* XGEM header */ 0xC7, 0x62, 0x82, 0xCA, 0xF6, 0x6F, 0xF5, 0xED, /* Ethernet frame */ - 0xB7, 0x90, 0x1E, 0x02, 0x6B, 0x2C, 0x08, 0x7D, - 0x3C, 0x90, 0xE8, 0x2C, 0x44, 0x30, 0xC3, 0x34, - 0x5F, 0x88, 0xA9, 0xD6, 0x5E, 0x9C, 0xD1, 0xF1, - 0xD6, 0x16, 0x8C, 0x72, 0xA4, 0xCD, 0xD2, 0x8F, - 0x63, 0x26, 0xC9, 0x66, 0xB0, 0x65, 0x24, 0x9B, - 0x60, 0x5B, 0x18, 0x60, 0xBD, 0xD5, 0x06, 0x13, - 0x40, 0xC9, 0x60, 0x64, 0x57, 0xAD, 0x54, 0xB5, - 0xD9, 0xEA, 0x01, 0xB2 + 0xB7, 0x90, 0x1E, 0x02, 0x6B, 0x2C, 0x08, 0x7D, 0x3C, 0x90, 0xE8, 0x2C, 0x44, 0x30, 0xC3, + 0x34, 0x5F, 0x88, 0xA9, 0xD6, 0x5E, 0x9C, 0xD1, 0xF1, 0xD6, 0x16, 0x8C, 0x72, 0xA4, 0xCD, + 0xD2, 0x8F, 0x63, 0x26, 0xC9, 0x66, 0xB0, 0x65, 0x24, 0x9B, 0x60, 0x5B, 0x18, 0x60, 0xBD, + 0xD5, 0x06, 0x13, 0x40, 0xC9, 0x60, 0x64, 0x57, 0xAD, 0x54, 0xB5, 0xD9, 0xEA, 0x01, 0xB2 }; -#define KEY4_PON KEY1_PON -#define IV4_PON IV1_PON +#define KEY4_PON KEY1_PON +#define IV4_PON IV1_PON #define BIPOUT4_PON 0x7EB18D27 #define OFFSET4_PON 8 #define LENBIP4_PON sizeof(IN4_PON) @@ -175,15 +155,13 @@ static const uint8_t OUT5_PON[] = { static const uint8_t IN6_PON[] = { 0x00, 0x40, 0x27, 0x11, 0x00, 0x00, 0x29, 0x3C, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* Ethernet frame */ - 0x01, 0x01, 0x01, 0x01, - 0x00, 0x14, 0xa9, 0x04 /* CRC value */ + 0x01, 0x01, 0x01, 0x01, 0x00, 0x14, 0xa9, 0x04 /* CRC value */ }; static const uint8_t OUT6_PON[] = { 0x00, 0x40, 0x27, 0x11, 0x00, 0x00, 0x29, 0x3C, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* Ethernet frame */ - 0x01, 0x01, 0x01, 0x01, - 0x00, 0x14, 0xa9, 0x04 + 0x01, 0x01, 0x01, 0x01, 0x00, 0x14, 0xa9, 0x04 }; #define BIPOUT6_PON 0x2DA45105 @@ -194,27 +172,19 @@ static const uint8_t OUT6_PON[] = { static const uint8_t IN7_PON[] = { 0x01, 0x00, 0x27, 0x11, 0x00, 0x00, 0x33, 0x0B, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* ethernet frame */ - 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, - 0x08, 0x00, 0x45, 0x00, 0x00, 0x6a, 0xb0, 0x7e, - 0x00, 0x00, 0x04, 0x06, 0x83, 0xbd, 0xc0, 0xa8, - 0x00, 0x01, 0xc0, 0xa8, 0x01, 0x01, 0x04, 0xd2, - 0x16, 0x2e, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, - 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xa6, 0x33, - 0x00, 0x00, 0x30, 0x31, - 0x53, 0xC1, 0xE6, 0x0C /* CRC value */ + 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, 0x00, 0x6a, 0xb0, + 0x7e, 0x00, 0x00, 0x04, 0x06, 0x83, 0xbd, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, 0x01, 0x01, + 0x04, 0xd2, 0x16, 0x2e, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x90, 0x50, 0x10, 0x20, + 0x00, 0xa6, 0x33, 0x00, 0x00, 0x30, 0x31, 0x53, 0xC1, 0xE6, 0x0C /* CRC value */ }; static const uint8_t OUT7_PON[] = { 0x01, 0x00, 0x27, 0x11, 0x00, 0x00, 0x33, 0x0B, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* ethernet frame */ - 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, - 0x08, 0x00, 0x45, 0x00, 0x00, 0x6a, 0xb0, 0x7e, - 0x00, 0x00, 0x04, 0x06, 0x83, 0xbd, 0xc0, 0xa8, - 0x00, 0x01, 0xc0, 0xa8, 0x01, 0x01, 0x04, 0xd2, - 0x16, 0x2e, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, - 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xa6, 0x33, - 0x00, 0x00, 0x30, 0x31, - 0x53, 0xC1, 0xE6, 0x0C + 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, 0x00, 0x6a, + 0xb0, 0x7e, 0x00, 0x00, 0x04, 0x06, 0x83, 0xbd, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, + 0x01, 0x01, 0x04, 0xd2, 0x16, 0x2e, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x90, + 0x50, 0x10, 0x20, 0x00, 0xa6, 0x33, 0x00, 0x00, 0x30, 0x31, 0x53, 0xC1, 0xE6, 0x0C }; #define BIPOUT7_PON 0xABC2D56A #define OFFSET7_PON 8 @@ -224,27 +194,21 @@ static const uint8_t OUT7_PON[] = { static const uint8_t IN8_PON[] = { 0x01, 0x10, 0x27, 0x11, 0x00, 0x00, 0x3C, 0x18, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* Ethernet frame */ - 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, - 0x08, 0x00, 0x45, 0x00, 0x00, 0x6A, 0x70, 0x63, - 0x00, 0x00, 0x04, 0x06, 0xC3, 0xD8, 0xC0, 0xA8, - 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, 0x04, 0xD2, - 0x16, 0x2E, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, - 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xA6, 0x33, - 0x00, 0x00, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, - 0x49, 0x0D, 0x52, 0xAB /* CRC value */ + 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6A, 0x70, 0x63, 0x00, 0x00, 0x04, 0x06, 0xC3, 0xD8, 0xC0, 0xA8, + 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, 0x04, 0xD2, 0x16, 0x2E, 0x12, 0x34, + 0x56, 0x78, 0x12, 0x34, 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xA6, 0x33, + 0x00, 0x00, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x49, 0x0D, 0x52, 0xAB /* CRC value */ }; static const uint8_t OUT8_PON[] = { 0x01, 0x10, 0x27, 0x11, 0x00, 0x00, 0x3C, 0x18, /* XGEM header */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x01, /* Ethernet frame */ - 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, - 0x08, 0x00, 0x45, 0x00, 0x00, 0x6A, 0x70, 0x63, - 0x00, 0x00, 0x04, 0x06, 0xC3, 0xD8, 0xC0, 0xA8, - 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, 0x04, 0xD2, - 0x16, 0x2E, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, - 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xA6, 0x33, - 0x00, 0x00, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, - 0x49, 0x0D, 0x52, 0xAB /* CRC value */ + 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6A, 0x70, 0x63, 0x00, 0x00, 0x04, 0x06, 0xC3, 0xD8, 0xC0, 0xA8, + 0x00, 0x01, 0xC0, 0xA8, 0x01, 0x01, 0x04, 0xD2, 0x16, 0x2E, 0x12, 0x34, + 0x56, 0x78, 0x12, 0x34, 0x56, 0x90, 0x50, 0x10, 0x20, 0x00, 0xA6, 0x33, + 0x00, 0x00, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x49, 0x0D, 0x52, 0xAB /* CRC value */ }; #define BIPOUT8_PON 0x378D5F02 #define OFFSET8_PON 8 @@ -254,27 +218,23 @@ static const uint8_t OUT8_PON[] = { /* Vectors with encryption and with padding */ /* === vector 9 */ static const uint8_t IN9_PON[] = { - 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* Ethernet frame */ - 0x10, 0x11, - 0x8c, 0xd0, 0x9a, 0x8b, /* CRC value */ - 0x55, 0x55 /* XGEM padding */ + 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* Ethernet frame */ + 0x10, 0x11, 0x8c, 0xd0, 0x9a, 0x8b, /* CRC value */ + 0x55, 0x55 /* XGEM padding */ }; static const uint8_t OUT9_PON[] = { - 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ - 0x73, 0xe0, 0x5d, 0x5d, 0x32, 0x9c, 0x3b, 0xfa, /* Ethernet frame */ - 0x6b, 0x66, - 0xf6, 0x8e, 0x5b, 0xd5, /* CRC value */ - 0xab, 0xcd /* XGEM padding */ + 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ + 0x73, 0xe0, 0x5d, 0x5d, 0x32, 0x9c, 0x3b, 0xfa, /* Ethernet frame */ + 0x6b, 0x66, 0xf6, 0x8e, 0x5b, 0xd5, /* CRC value */ + 0xab, 0xcd /* XGEM padding */ }; #define KEY9_PON KEY1_PON -static const uint8_t IV9_PON[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; +static const uint8_t IV9_PON[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; #define BIPOUT9_PON 0x738bf671 #define OFFSET9_PON 8 #define LENBIP9_PON sizeof(IN9_PON) @@ -287,19 +247,19 @@ static const uint8_t IV9_PON[] = { * - on encrypt CRC should not be written into the message */ static const uint8_t IN10_PON[] = { - 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ - 0x08, /* Ethernet frame */ - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ + 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ + 0x08, /* Ethernet frame */ + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ }; static const uint8_t OUT10_PON[] = { - 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ - 0x73, /* Ethernet frame */ - 0xbc, 0x02, 0x03, 0x6b, 0xc4, 0x60, 0xa0 /* XGEM padding */ + 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ + 0x73, /* Ethernet frame */ + 0xbc, 0x02, 0x03, 0x6b, 0xc4, 0x60, 0xa0 /* XGEM padding */ }; -#define KEY10_PON KEY1_PON -#define IV10_PON IV9_PON +#define KEY10_PON KEY1_PON +#define IV10_PON IV9_PON #define BIPOUT10_PON 0xead87d18 #define OFFSET10_PON 8 #define LENBIP10_PON sizeof(IN10_PON) @@ -308,22 +268,20 @@ static const uint8_t OUT10_PON[] = { /* Vectors with no encryption and with padding */ /* === vector 11 */ static const uint8_t IN11_PON[] = { - 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* Ethernet frame */ - 0x10, 0x11, - 0x8c, 0xd0, 0x9a, 0x8b, /* CRC value */ - 0x55, 0x55 /* XGEM padding */ + 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* Ethernet frame */ + 0x10, 0x11, 0x8c, 0xd0, 0x9a, 0x8b, /* CRC value */ + 0x55, 0x55 /* XGEM padding */ }; static const uint8_t OUT11_PON[] = { - 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* Ethernet frame */ - 0x10, 0x11, - 0x8c, 0xd0, 0x9a, 0x8b, /* CRC value */ - 0x55, 0x55 /* XGEM padding */ + 0x00, 0x39, 0x03, 0xfd, 0x00, 0x00, 0xb3, 0x6a, /* XGEM header */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* Ethernet frame */ + 0x10, 0x11, 0x8c, 0xd0, 0x9a, 0x8b, /* CRC value */ + 0x55, 0x55 /* XGEM padding */ }; -#define KEY11_PON KEY1_PON +#define KEY11_PON KEY1_PON #define BIPOUT11_PON 0x166da78e #define OFFSET11_PON 8 #define LENBIP11_PON sizeof(IN11_PON) @@ -336,18 +294,18 @@ static const uint8_t OUT11_PON[] = { * - on encrypt CRC should not be written into the message */ static const uint8_t IN12_PON[] = { - 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ - 0x08, /* Ethernet frame */ - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ + 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ + 0x08, /* Ethernet frame */ + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ }; static const uint8_t OUT12_PON[] = { - 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ - 0x08, /* Ethernet frame */ - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ + 0x00, 0x05, 0x03, 0xfd, 0x00, 0x00, 0xb9, 0xb4, /* XGEM header */ + 0x08, /* Ethernet frame */ + 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ }; -#define KEY12_PON KEY1_PON +#define KEY12_PON KEY1_PON #define BIPOUT12_PON 0x49ba055d #define OFFSET12_PON 8 #define LENBIP12_PON sizeof(IN12_PON) @@ -360,35 +318,35 @@ static const uint8_t OUT12_PON[] = { * - on encrypt CRC should not be written into the message */ static const uint8_t IN13_PON[] = { - 0x00, 0x11, 0x03, 0xfd, 0x00, 0x00, 0xbf, 0xff, /* XGEM header */ - 0x08, 0x09, 0x0a, 0x0b, /* Ethernet frame */ - 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ + 0x00, 0x11, 0x03, 0xfd, 0x00, 0x00, 0xbf, 0xff, /* XGEM header */ + 0x08, 0x09, 0x0a, 0x0b, /* Ethernet frame */ + 0x55, 0x55, 0x55, 0x55 /* XGEM padding */ }; static const uint8_t OUT13_PON[] = { - 0x00, 0x11, 0x03, 0xfd, 0x00, 0x00, 0xbf, 0xff, /* XGEM header */ - 0x73, 0xe0, 0x5d, 0x5d, /* Ethernet frame */ - 0x6b, 0xc4, 0x60, 0xa0 /* XGEM padding */ + 0x00, 0x11, 0x03, 0xfd, 0x00, 0x00, 0xbf, 0xff, /* XGEM header */ + 0x73, 0xe0, 0x5d, 0x5d, /* Ethernet frame */ + 0x6b, 0xc4, 0x60, 0xa0 /* XGEM padding */ }; -#define KEY13_PON KEY1_PON -#define IV13_PON IV9_PON +#define KEY13_PON KEY1_PON +#define IV13_PON IV9_PON #define BIPOUT13_PON 0xff813518 #define OFFSET13_PON 8 #define LENBIP13_PON sizeof(IN13_PON) #define LENCIPH13_PON (LENBIP13_PON - OFFSET13_PON) +#define ponvector(tname) \ + { \ + KEY##tname, IV##tname, IN##tname, OUT##tname, BIPOUT##tname, LENBIP##tname, \ + LENCIPH##tname, OFFSET##tname \ + } -#define ponvector(tname) \ - { KEY ## tname, IV ## tname, IN ## tname, OUT ## tname, \ - BIPOUT ## tname, LENBIP ## tname, \ - LENCIPH ## tname, OFFSET ## tname } - -#define pon_no_ctr_vector(tname) \ - { NULL, NULL, IN ## tname, OUT ## tname, \ - BIPOUT ## tname, LENBIP ## tname, \ - LENCIPH ## tname, OFFSET ## tname } - +#define pon_no_ctr_vector(tname) \ + { \ + NULL, NULL, IN##tname, OUT##tname, BIPOUT##tname, LENBIP##tname, LENCIPH##tname, \ + OFFSET##tname \ + } static const struct pon_test_vector { const uint8_t *key; @@ -400,33 +358,17 @@ static const struct pon_test_vector { size_t length_to_cipher; size_t offset_to_crc_cipher; } pon_vectors[] = { - ponvector(1_PON), - ponvector(2_PON), - ponvector(3_PON), - ponvector(4_PON), - pon_no_ctr_vector(5_PON), - pon_no_ctr_vector(6_PON), - pon_no_ctr_vector(7_PON), - pon_no_ctr_vector(8_PON), - ponvector(9_PON), - ponvector(10_PON), - pon_no_ctr_vector(11_PON), - pon_no_ctr_vector(12_PON), - ponvector(13_PON), + ponvector(1_PON), ponvector(2_PON), ponvector(3_PON), + ponvector(4_PON), pon_no_ctr_vector(5_PON), pon_no_ctr_vector(6_PON), + pon_no_ctr_vector(7_PON), pon_no_ctr_vector(8_PON), ponvector(9_PON), + ponvector(10_PON), pon_no_ctr_vector(11_PON), pon_no_ctr_vector(12_PON), + ponvector(13_PON), }; static int -test_pon(struct IMB_MGR *mb_mgr, - const void *expkey, - const void *iv, - const uint8_t *in_text, - const uint8_t *out_text, - const size_t len_to_cipher, - const size_t len_to_bip, - const size_t offset_to_cipher_crc, - const uint32_t bip_out, - const int dir, - const int order) +test_pon(struct IMB_MGR *mb_mgr, const void *expkey, const void *iv, const uint8_t *in_text, + const uint8_t *out_text, const size_t len_to_cipher, const size_t len_to_bip, + const size_t offset_to_cipher_crc, const uint32_t bip_out, const int dir, const int order) { struct IMB_JOB *job; uint8_t padding[16]; @@ -438,16 +380,16 @@ test_pon(struct IMB_MGR *mb_mgr, int err = 0; if (target == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - return ret; + fprintf(stderr, "Can't allocate buffer memory\n"); + return ret; } memset(target, -1, len_to_bip + (sizeof(padding) * 2)); memset(padding, -1, sizeof(padding)); if (dir == IMB_DIR_ENCRYPT) { - const uint16_t pli = ((((uint16_t) in_text[0]) << 8) | - ((uint16_t) in_text[1])) >> 2; + const uint16_t pli = + ((((uint16_t) in_text[0]) << 8) | ((uint16_t) in_text[1])) >> 2; memcpy(target + sizeof(padding), in_text, len_to_bip); @@ -537,12 +479,11 @@ test_pon(struct IMB_MGR *mb_mgr, #endif if (dir == IMB_DIR_DECRYPT) { - const uint16_t pli = ((((uint16_t) in_text[0]) << 8) | - ((uint16_t) in_text[1])) >> 2; + const uint16_t pli = + ((((uint16_t) in_text[0]) << 8) | ((uint16_t) in_text[1])) >> 2; if (pli > 4) { - const uint32_t crc_in_msg = - *((const uint32_t *)&in_text[8 + pli - 4]); + const uint32_t crc_in_msg = *((const uint32_t *) &in_text[8 + pli - 4]); if (crc_in_msg != crc_output) { printf("CRC mismatch on decrypt! " "expected 0x%08x, received 0x%08x\n", @@ -557,8 +498,7 @@ test_pon(struct IMB_MGR *mb_mgr, } if (bip_output != bip_out) { - printf("BIP mismatch! expected 0x%08x, received 0x%08x\n", - bip_out, bip_output); + printf("BIP mismatch! expected 0x%08x, received 0x%08x\n", bip_out, bip_output); #ifdef DEBUG is_error = 1; #else @@ -569,8 +509,7 @@ test_pon(struct IMB_MGR *mb_mgr, if (dir == IMB_DIR_ENCRYPT) { if (memcmp(out_text, target + sizeof(padding), len_to_bip)) { printf("output mismatch\n"); - hexdump(stderr, "Target", - target, len_to_bip + (2 * sizeof(padding))); + hexdump(stderr, "Target", target, len_to_bip + (2 * sizeof(padding))); #ifdef DEBUG is_error = 1; #else @@ -580,8 +519,7 @@ test_pon(struct IMB_MGR *mb_mgr, } else { if (memcmp(in_text, target + sizeof(padding), len_to_bip - 4)) { printf("output mismatch\n"); - hexdump(stderr, "Target", target, - len_to_bip + (2 * sizeof(padding))); + hexdump(stderr, "Target", target, len_to_bip + (2 * sizeof(padding))); #ifdef DEBUG is_error = 1; #else @@ -592,8 +530,7 @@ test_pon(struct IMB_MGR *mb_mgr, if (memcmp(padding, target, sizeof(padding))) { printf("overwrite head\n"); - hexdump(stderr, "Target", target, - len_to_bip + (2 * sizeof(padding))); + hexdump(stderr, "Target", target, len_to_bip + (2 * sizeof(padding))); #ifdef DEBUG is_error = 1; #else @@ -601,11 +538,9 @@ test_pon(struct IMB_MGR *mb_mgr, #endif } - if (memcmp(padding, target + sizeof(padding) + len_to_bip, - sizeof(padding))) { + if (memcmp(padding, target + sizeof(padding) + len_to_bip, sizeof(padding))) { printf("overwrite tail\n"); - hexdump(stderr, "Target", target, - len_to_bip + (2 * sizeof(padding))); + hexdump(stderr, "Target", target, len_to_bip + (2 * sizeof(padding))); #ifdef DEBUG is_error = 1; #else @@ -623,7 +558,7 @@ test_pon(struct IMB_MGR *mb_mgr, while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; - end: +end: if (target != NULL) free(target); @@ -633,19 +568,18 @@ test_pon(struct IMB_MGR *mb_mgr, static int test_pon_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx) { - const int vectors_cnt = sizeof(pon_vectors) / sizeof(pon_vectors[0]); - int vect; - int errors = 0; - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + const int vectors_cnt = sizeof(pon_vectors) / sizeof(pon_vectors[0]); + int vect; + int errors = 0; + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); - printf("PON (AES128-CTR/CRC/BIP) test vectors:\n"); + printf("PON (AES128-CTR/CRC/BIP) test vectors:\n"); - for (vect = 0; vect < vectors_cnt; vect++) { + for (vect = 0; vect < vectors_cnt; vect++) { if (!quiet_mode) { #ifdef DEBUG - printf("Vector %d/%d CIPHLen:%d BIPLen:%d\n", - vect + 1, vectors_cnt, + printf("Vector %d/%d CIPHLen:%d BIPLen:%d\n", vect + 1, vectors_cnt, (int) pon_vectors[vect].length_to_cipher, (int) pon_vectors[vect].length_to_bip); #else @@ -654,45 +588,35 @@ test_pon_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx) } if (pon_vectors[vect].key != NULL) - IMB_AES_KEYEXP_128(mb_mgr, pon_vectors[vect].key, - expkey, dust); - - if (test_pon(mb_mgr, - expkey, - pon_vectors[vect].iv, - pon_vectors[vect].in, - pon_vectors[vect].out, - pon_vectors[vect].length_to_cipher, + IMB_AES_KEYEXP_128(mb_mgr, pon_vectors[vect].key, expkey, dust); + + if (test_pon(mb_mgr, expkey, pon_vectors[vect].iv, pon_vectors[vect].in, + pon_vectors[vect].out, pon_vectors[vect].length_to_cipher, pon_vectors[vect].length_to_bip, - pon_vectors[vect].offset_to_crc_cipher, - pon_vectors[vect].bip_out, + pon_vectors[vect].offset_to_crc_cipher, pon_vectors[vect].bip_out, IMB_DIR_ENCRYPT, IMB_ORDER_HASH_CIPHER)) { printf("error #%d encrypt\n", vect + 1); test_suite_update(ctx, 0, 1); } else test_suite_update(ctx, 1, 0); - if (test_pon(mb_mgr, - expkey, - pon_vectors[vect].iv, - pon_vectors[vect].in, - pon_vectors[vect].out, - pon_vectors[vect].length_to_cipher, + if (test_pon(mb_mgr, expkey, pon_vectors[vect].iv, pon_vectors[vect].in, + pon_vectors[vect].out, pon_vectors[vect].length_to_cipher, pon_vectors[vect].length_to_bip, - pon_vectors[vect].offset_to_crc_cipher, - pon_vectors[vect].bip_out, + pon_vectors[vect].offset_to_crc_cipher, pon_vectors[vect].bip_out, IMB_DIR_DECRYPT, IMB_ORDER_CIPHER_HASH)) { printf("error #%d decrypt\n", vect + 1); test_suite_update(ctx, 0, 1); } else test_suite_update(ctx, 1, 0); - } + } if (!quiet_mode) printf("\n"); - return errors; + return errors; } -int pon_test(struct IMB_MGR *mb_mgr) +int +pon_test(struct IMB_MGR *mb_mgr) { int errors; struct test_suite_context ctx; @@ -701,5 +625,5 @@ int pon_test(struct IMB_MGR *mb_mgr) test_pon_std_vectors(mb_mgr, &ctx); errors = test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/quic_chacha20_test.c b/test/kat-app/quic_chacha20_test.c index 565592e1..4e5c5906 100644 --- a/test/kat-app/quic_chacha20_test.c +++ b/test/kat-app/quic_chacha20_test.c @@ -35,40 +35,31 @@ #include "utils.h" -int quic_chacha20_test(struct IMB_MGR *mb_mgr); +int +quic_chacha20_test(struct IMB_MGR *mb_mgr); struct quic_chacha20_vector { - const uint8_t *K; /* key */ - const uint8_t *P; /* plain text (16 bytes) */ - const uint8_t *C; /* cipher text - same length as plain text */ + const uint8_t *K; /* key */ + const uint8_t *P; /* plain text (16 bytes) */ + const uint8_t *C; /* cipher text - same length as plain text */ }; /* From section A.5 of https://www.rfc-editor.org/rfc/rfc9001.pdf */ -static const uint8_t chacha20_256_K1[] = { - 0x25, 0xa2, 0x82, 0xb9, 0xe8, 0x2f, 0x06, 0xf2, - 0x1f, 0x48, 0x89, 0x17, 0xa4, 0xfc, 0x8f, 0x1b, - 0x73, 0x57, 0x36, 0x85, 0x60, 0x85, 0x97, 0xd0, - 0xef, 0xcb, 0x07, 0x6b, 0x0a, 0xb7, 0xa7, 0xa4 -}; -static const uint8_t chacha20_256_P1[] = { - 0x5e, 0x5c, 0xd5, 0x5c, 0x41, 0xf6, 0x90, 0x80, - 0x57, 0x5d, 0x79, 0x99, 0xc2, 0x5a, 0x5b, 0xfb -}; -static const uint8_t chacha20_256_C1[] = { - 0xae, 0xfe, 0xfe, 0x7d, 0x03 -}; +static const uint8_t chacha20_256_K1[] = { 0x25, 0xa2, 0x82, 0xb9, 0xe8, 0x2f, 0x06, 0xf2, + 0x1f, 0x48, 0x89, 0x17, 0xa4, 0xfc, 0x8f, 0x1b, + 0x73, 0x57, 0x36, 0x85, 0x60, 0x85, 0x97, 0xd0, + 0xef, 0xcb, 0x07, 0x6b, 0x0a, 0xb7, 0xa7, 0xa4 }; +static const uint8_t chacha20_256_P1[] = { 0x5e, 0x5c, 0xd5, 0x5c, 0x41, 0xf6, 0x90, 0x80, + 0x57, 0x5d, 0x79, 0x99, 0xc2, 0x5a, 0x5b, 0xfb }; +static const uint8_t chacha20_256_C1[] = { 0xae, 0xfe, 0xfe, 0x7d, 0x03 }; static const struct quic_chacha20_vector quic_chacha20_vectors[] = { - {chacha20_256_K1, chacha20_256_P1, chacha20_256_C1}, + { chacha20_256_K1, chacha20_256_P1, chacha20_256_C1 }, }; static int -test_quic_chacha20_many(struct IMB_MGR *mb_mgr, - const void *key, - const uint8_t *in_text, - const uint8_t *out_text, - const int in_place, - const int num_jobs) +test_quic_chacha20_many(struct IMB_MGR *mb_mgr, const void *key, const uint8_t *in_text, + const uint8_t *out_text, const int in_place, const int num_jobs) { const unsigned text_len = 16; const unsigned out_len = 5; @@ -85,22 +76,17 @@ test_quic_chacha20_many(struct IMB_MGR *mb_mgr, } if (in_place) { - imb_quic_hp_chacha20(mb_mgr, key, - (void **) src_bufs, - (const void * const*) src_bufs, - num_jobs); + imb_quic_hp_chacha20(mb_mgr, key, (void **) src_bufs, + (const void *const *) src_bufs, num_jobs); } else { - imb_quic_hp_chacha20(mb_mgr, key, - (void **) dst_bufs, - (const void * const*) src_bufs, - num_jobs); + imb_quic_hp_chacha20(mb_mgr, key, (void **) dst_bufs, + (const void *const *) src_bufs, num_jobs); } const int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("QUIC CHACHA20 error status:%d, %s\n", err, - imb_get_strerror(err)); + printf("QUIC CHACHA20 error status:%d, %s\n", err, imb_get_strerror(err)); goto end; } @@ -109,17 +95,15 @@ test_quic_chacha20_many(struct IMB_MGR *mb_mgr, if (memcmp(d, out_text, out_len) != 0) { printf("QUIC CHACHA20 %d vector mismatched\n", i); - hexdump(stderr, "Expected", - out_text, out_len); - hexdump(stderr, "Received", - d, out_len); + hexdump(stderr, "Expected", out_text, out_len); + hexdump(stderr, "Received", d, out_len); goto end; } } ret = 0; - end: +end: for (i = 0; i < num_jobs; i++) { free(src_bufs[i]); free(dst_bufs[i]); @@ -131,42 +115,38 @@ test_quic_chacha20_many(struct IMB_MGR *mb_mgr, static void test_quic_chacha20_vectors(struct IMB_MGR *mb_mgr, const int vec_cnt, - const struct quic_chacha20_vector *vec_tab, const char *banner, - const int num_jobs, - struct test_suite_context *ts256) + const struct quic_chacha20_vector *vec_tab, const char *banner, + const int num_jobs, struct test_suite_context *ts256) { - int vect; + int vect; if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_cnt; vect++) { + printf("%s (N jobs = %d):\n", banner, num_jobs); + for (vect = 0; vect < vec_cnt; vect++) { if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector\n", - vect + 1, vec_cnt); + printf("[%d/%d] Standard vector\n", vect + 1, vec_cnt); #else printf("."); #endif } - if (test_quic_chacha20_many(mb_mgr, vec_tab[vect].K, - vec_tab[vect].P, vec_tab[vect].C, 0, - num_jobs)) { + if (test_quic_chacha20_many(mb_mgr, vec_tab[vect].K, vec_tab[vect].P, + vec_tab[vect].C, 0, num_jobs)) { printf("error #%d encrypt\n", vect + 1); test_suite_update(ts256, 0, 1); } else { test_suite_update(ts256, 1, 0); } - if (test_quic_chacha20_many(mb_mgr, vec_tab[vect].K, - vec_tab[vect].P, vec_tab[vect].C, 1, - num_jobs)) { + if (test_quic_chacha20_many(mb_mgr, vec_tab[vect].K, vec_tab[vect].P, + vec_tab[vect].C, 1, num_jobs)) { printf("error #%d encrypt in-place\n", vect + 1); test_suite_update(ts256, 0, 1); } else { test_suite_update(ts256, 1, 0); } - } + } if (!quiet_mode) printf("\n"); @@ -183,12 +163,10 @@ quic_chacha20_test(struct IMB_MGR *mb_mgr) for (i = 1; i <= 32; i++) test_quic_chacha20_vectors(mb_mgr, DIM(quic_chacha20_vectors), - quic_chacha20_vectors, - "QUIC-HP-CHACHA20 test vectors", - i, - &ts256); + quic_chacha20_vectors, "QUIC-HP-CHACHA20 test vectors", + i, &ts256); errors = test_suite_end(&ts256); - return errors; + return errors; } diff --git a/test/kat-app/quic_ecb_test.c b/test/kat-app/quic_ecb_test.c index c7c5e843..b03272fa 100644 --- a/test/kat-app/quic_ecb_test.c +++ b/test/kat-app/quic_ecb_test.c @@ -35,36 +35,31 @@ #include "utils.h" -int quic_ecb_test(struct IMB_MGR *mb_mgr); +int +quic_ecb_test(struct IMB_MGR *mb_mgr); struct quic_ecb_vector { - const uint8_t *K; /* key */ - const uint8_t *P; /* plain text (16 bytes) */ - const uint8_t *C; /* cipher text - same length as plain text */ - uint32_t Klen; /* key length */ + const uint8_t *K; /* key */ + const uint8_t *P; /* plain text (16 bytes) */ + const uint8_t *C; /* cipher text - same length as plain text */ + uint32_t Klen; /* key length */ }; /* 128-bit */ -static const uint8_t ecb_128_K1[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t ecb_128_P1[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a -}; +static const uint8_t ecb_128_K1[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; +static const uint8_t ecb_128_P1[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, + 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a }; static const uint8_t ecb_128_C1[] = { 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60, 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97, }; /* 256-bit */ -static const uint8_t ecb_256_K20[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; +static const uint8_t ecb_256_K20[] = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, + 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, + 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, + 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 }; static const uint8_t ecb_256_P20[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, @@ -77,10 +72,8 @@ static const uint8_t ecb_256_P22[] = { 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, }; -static const uint8_t ecb_256_P23[] = { - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 -}; +static const uint8_t ecb_256_P23[] = { 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, + 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; static const uint8_t ecb_256_C20[] = { 0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c, 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8, @@ -93,26 +86,20 @@ static const uint8_t ecb_256_C22[] = { 0xb6, 0xed, 0x21, 0xb9, 0x9c, 0xa6, 0xf4, 0xf9, 0xf1, 0x53, 0xe7, 0xb1, 0xbe, 0xaf, 0xed, 0x1d, }; -static const uint8_t ecb_256_C23[] = { - 0x23, 0x30, 0x4b, 0x7a, 0x39, 0xf9, 0xf3, 0xff, - 0x06, 0x7d, 0x8d, 0x8f, 0x9e, 0x24, 0xec, 0xc7 -}; +static const uint8_t ecb_256_C23[] = { 0x23, 0x30, 0x4b, 0x7a, 0x39, 0xf9, 0xf3, 0xff, + 0x06, 0x7d, 0x8d, 0x8f, 0x9e, 0x24, 0xec, 0xc7 }; static const struct quic_ecb_vector quic_ecb_vectors[] = { - {ecb_128_K1, ecb_128_P1, ecb_128_C1, sizeof(ecb_128_K1)}, - {ecb_256_K20, ecb_256_P20, ecb_256_C20, sizeof(ecb_256_K20)}, - {ecb_256_K20, ecb_256_P21, ecb_256_C21, sizeof(ecb_256_K20)}, - {ecb_256_K20, ecb_256_P22, ecb_256_C22, sizeof(ecb_256_K20)}, - {ecb_256_K20, ecb_256_P23, ecb_256_C23, sizeof(ecb_256_K20)}, + { ecb_128_K1, ecb_128_P1, ecb_128_C1, sizeof(ecb_128_K1) }, + { ecb_256_K20, ecb_256_P20, ecb_256_C20, sizeof(ecb_256_K20) }, + { ecb_256_K20, ecb_256_P21, ecb_256_C21, sizeof(ecb_256_K20) }, + { ecb_256_K20, ecb_256_P22, ecb_256_C22, sizeof(ecb_256_K20) }, + { ecb_256_K20, ecb_256_P23, ecb_256_C23, sizeof(ecb_256_K20) }, }; static int -test_quic_ecb_many(struct IMB_MGR *mb_mgr, - void *enc_keys, - const uint8_t *in_text, - const uint8_t *out_text, - const int in_place, - const int key_len, +test_quic_ecb_many(struct IMB_MGR *mb_mgr, void *enc_keys, const uint8_t *in_text, + const uint8_t *out_text, const int in_place, const int key_len, const int num_jobs) { const unsigned text_len = 16; @@ -130,22 +117,17 @@ test_quic_ecb_many(struct IMB_MGR *mb_mgr, } if (in_place) { - imb_quic_hp_aes_ecb(mb_mgr, enc_keys, - (void **) src_bufs, - (const void * const*) src_bufs, - num_jobs, key_len); + imb_quic_hp_aes_ecb(mb_mgr, enc_keys, (void **) src_bufs, + (const void *const *) src_bufs, num_jobs, key_len); } else { - imb_quic_hp_aes_ecb(mb_mgr, enc_keys, - (void **) dst_bufs, - (const void * const*) src_bufs, - num_jobs, key_len); + imb_quic_hp_aes_ecb(mb_mgr, enc_keys, (void **) dst_bufs, + (const void *const *) src_bufs, num_jobs, key_len); } const int err = imb_get_errno(mb_mgr); if (err != 0) { - printf("QUIC AES-ECB error status:%d, %s\n", err, - imb_get_strerror(err)); + printf("QUIC AES-ECB error status:%d, %s\n", err, imb_get_strerror(err)); goto end; } @@ -154,17 +136,15 @@ test_quic_ecb_many(struct IMB_MGR *mb_mgr, if (memcmp(d, out_text, out_len) != 0) { printf("QUIC AES-ECB %d vector mismatched\n", i); - hexdump(stderr, "Expected", - out_text, out_len); - hexdump(stderr, "Received", - d, out_len); + hexdump(stderr, "Expected", out_text, out_len); + hexdump(stderr, "Received", d, out_len); goto end; } } ret = 0; - end: +end: for (i = 0; i < num_jobs; i++) { free(src_bufs[i]); free(dst_bufs[i]); @@ -176,24 +156,21 @@ test_quic_ecb_many(struct IMB_MGR *mb_mgr, static void test_quic_ecb_vectors(struct IMB_MGR *mb_mgr, const int vec_cnt, - const struct quic_ecb_vector *vec_tab, const char *banner, - const int num_jobs, - struct test_suite_context *ts128, - struct test_suite_context *ts256) + const struct quic_ecb_vector *vec_tab, const char *banner, const int num_jobs, + struct test_suite_context *ts128, struct test_suite_context *ts256) { - int vect; - DECLARE_ALIGNED(uint32_t enc_keys[15*4], 16); - DECLARE_ALIGNED(uint32_t dec_keys[15*4], 16); + int vect; + DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); + DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); if (!quiet_mode) - printf("%s (N jobs = %d):\n", banner, num_jobs); - for (vect = 0; vect < vec_cnt; vect++) { + printf("%s (N jobs = %d):\n", banner, num_jobs); + for (vect = 0; vect < vec_cnt; vect++) { struct test_suite_context *ctx = NULL; if (!quiet_mode) { #ifdef DEBUG - printf("[%d/%d] Standard vector key_len:%d\n", - vect + 1, vec_cnt, + printf("[%d/%d] Standard vector key_len:%d\n", vect + 1, vec_cnt, (int) vec_tab[vect].Klen); #else printf("."); @@ -202,20 +179,17 @@ test_quic_ecb_vectors(struct IMB_MGR *mb_mgr, const int vec_cnt, switch (vec_tab[vect].Klen) { case 16: - IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, vec_tab[vect].K, enc_keys, dec_keys); ctx = ts128; break; case 32: default: - IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].K, enc_keys, - dec_keys); + IMB_AES_KEYEXP_256(mb_mgr, vec_tab[vect].K, enc_keys, dec_keys); ctx = ts256; break; } - if (test_quic_ecb_many(mb_mgr, enc_keys, - vec_tab[vect].P, vec_tab[vect].C, 0, + if (test_quic_ecb_many(mb_mgr, enc_keys, vec_tab[vect].P, vec_tab[vect].C, 0, vec_tab[vect].Klen, num_jobs)) { printf("error #%d encrypt\n", vect + 1); test_suite_update(ctx, 0, 1); @@ -223,15 +197,14 @@ test_quic_ecb_vectors(struct IMB_MGR *mb_mgr, const int vec_cnt, test_suite_update(ctx, 1, 0); } - if (test_quic_ecb_many(mb_mgr, enc_keys, - vec_tab[vect].P, vec_tab[vect].C, 1, + if (test_quic_ecb_many(mb_mgr, enc_keys, vec_tab[vect].P, vec_tab[vect].C, 1, vec_tab[vect].Klen, num_jobs)) { printf("error #%d encrypt in-place\n", vect + 1); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - } + } if (!quiet_mode) printf("\n"); @@ -241,9 +214,7 @@ int quic_ecb_test(struct IMB_MGR *mb_mgr) { struct test_suite_context ts128, ts256; - const int num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 - }; + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 }; unsigned i; int errors = 0; @@ -251,14 +222,12 @@ quic_ecb_test(struct IMB_MGR *mb_mgr) test_suite_start(&ts256, "QUIC-HP-AES-ECB-256"); for (i = 0; i < DIM(num_jobs_tab); i++) - test_quic_ecb_vectors(mb_mgr, DIM(quic_ecb_vectors), - quic_ecb_vectors, - "QUIC-HP-AES-ECB test vectors", - num_jobs_tab[i], - &ts128, &ts256); + test_quic_ecb_vectors(mb_mgr, DIM(quic_ecb_vectors), quic_ecb_vectors, + "QUIC-HP-AES-ECB test vectors", num_jobs_tab[i], &ts128, + &ts256); errors = test_suite_end(&ts128); errors += test_suite_end(&ts256); - return errors; + return errors; } diff --git a/test/kat-app/sha_test.c b/test/kat-app/sha_test.c index bc3bb580..5a63655c 100644 --- a/test/kat-app/sha_test.c +++ b/test/kat-app/sha_test.c @@ -35,16 +35,14 @@ #include "utils.h" #include "mac_test.h" -int sha_test(struct IMB_MGR *mb_mgr); +int +sha_test(struct IMB_MGR *mb_mgr); extern const struct mac_test sha_test_json[]; static int -sha_job_ok(const struct mac_test *vec, - const struct IMB_JOB *job, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +sha_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const uint8_t *auth, + const uint8_t *padding, const size_t sizeof_padding) { if (job->status != IMB_STATUS_COMPLETED) { printf("line:%d job error status:%d ", __LINE__, job->status); @@ -52,11 +50,9 @@ sha_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + (vec->tagSize / 8)], + hexdump(stderr, "Target", &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding); return 0; } @@ -67,23 +63,17 @@ sha_job_ok(const struct mac_test *vec, return 0; } - if (memcmp((const void *) vec->tag, &auth[sizeof_padding], - vec->tagSize / 8)) { + if (memcmp((const void *) vec->tag, &auth[sizeof_padding], vec->tagSize / 8)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], - vec->tagSize / 8); - hexdump(stderr, "Expected", (const void *) vec->tag, - vec->tagSize / 8); + hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); + hexdump(stderr, "Expected", (const void *) vec->tag, vec->tagSize / 8); return 0; } return 1; } static int -test_sha(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const int num_jobs, - const int sha_type) +test_sha(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const int num_jobs, const int sha_type) { struct IMB_JOB *job; uint8_t padding[16]; @@ -91,16 +81,15 @@ test_sha(struct IMB_MGR *mb_mgr, int i = 0, jobs_rx = 0, ret = -1; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); memset(auths, 0, num_jobs * sizeof(void *)); for (i = 0; i < num_jobs; i++) { - const size_t alloc_len = - vec->tagSize / 8 + (sizeof(padding) * 2); + const size_t alloc_len = vec->tagSize / 8 + (sizeof(padding) * 2); auths[i] = malloc(alloc_len); if (auths[i] == NULL) { @@ -149,16 +138,14 @@ test_sha(struct IMB_MGR *mb_mgr, job = IMB_SUBMIT_JOB(mb_mgr); if (job) { jobs_rx++; - if (!sha_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!sha_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } } while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!sha_job_ok(vec, job, job->user_data, - padding, sizeof(padding))) + if (!sha_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } @@ -168,7 +155,7 @@ test_sha(struct IMB_MGR *mb_mgr, } ret = 0; - end: +end: /* empty the manager before next tests */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -178,7 +165,7 @@ test_sha(struct IMB_MGR *mb_mgr, free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -186,12 +173,9 @@ test_sha(struct IMB_MGR *mb_mgr, } static void -test_sha_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *sha1_ctx, - struct test_suite_context *sha224_ctx, - struct test_suite_context *sha256_ctx, - struct test_suite_context *sha384_ctx, - struct test_suite_context *sha512_ctx, +test_sha_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *sha1_ctx, + struct test_suite_context *sha224_ctx, struct test_suite_context *sha256_ctx, + struct test_suite_context *sha384_ctx, struct test_suite_context *sha512_ctx, const int num_jobs) { struct test_suite_context *ctx; @@ -199,8 +183,8 @@ test_sha_vectors(struct IMB_MGR *mb_mgr, int sha_type; if (!quiet_mode) - printf("SHA standard test vectors (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("SHA standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { switch (v->tagSize) { case 160: @@ -232,8 +216,8 @@ test_sha_vectors(struct IMB_MGR *mb_mgr, #ifdef DEBUG if (!quiet_mode) { printf("SHA%d Test Case %zu " - "data_len:%zu digest_len:%zu\n", - sha_type, v->tcId, v->msgSize / 8, v->tagSize / 8); + "data_len:%zu digest_len:%zu\n", + sha_type, v->tcId, v->msgSize / 8, v->tagSize / 8); } #endif if (test_sha(mb_mgr, v, num_jobs, sha_type)) { @@ -242,7 +226,7 @@ test_sha_vectors(struct IMB_MGR *mb_mgr, } else { test_suite_update(ctx, 1, 0); } - } + } } int @@ -259,8 +243,8 @@ sha_test(struct IMB_MGR *mb_mgr) test_suite_start(&sha384_ctx, "SHA384"); test_suite_start(&sha512_ctx, "SHA512"); for (i = 1; i <= 17; i++) { - test_sha_vectors(mb_mgr, &sha1_ctx, &sha224_ctx, - &sha256_ctx, &sha384_ctx, &sha512_ctx, i); + test_sha_vectors(mb_mgr, &sha1_ctx, &sha224_ctx, &sha256_ctx, &sha384_ctx, + &sha512_ctx, i); } errors = test_suite_end(&sha1_ctx); errors += test_suite_end(&sha224_ctx); @@ -268,5 +252,5 @@ sha_test(struct IMB_MGR *mb_mgr) errors += test_suite_end(&sha384_ctx); errors += test_suite_end(&sha512_ctx); - return errors; + return errors; } diff --git a/test/kat-app/snow3g_test.c b/test/kat-app/snow3g_test.c index e070390e..87af9fdf 100644 --- a/test/kat-app/snow3g_test.c +++ b/test/kat-app/snow3g_test.c @@ -37,16 +37,17 @@ #include "cipher_test.h" #include "mac_test.h" -#define IMB_SNOW3G_PAD_LEN 16 -#define IMB_SNOW3G_MAX_DATA_LEN 3048 -#define IMB_SNOW3G_NUM_SUPPORTED_BUFFERS 16 +#define IMB_SNOW3G_PAD_LEN 16 +#define IMB_SNOW3G_MAX_DATA_LEN 3048 +#define IMB_SNOW3G_NUM_SUPPORTED_BUFFERS 16 extern const struct cipher_test snow3g_cipher_bit_test_vectors_json[]; extern const struct mac_test snow3g_hash_test_vectors_json[]; extern const struct cipher_test snow3g_cipher_test_vectors_json[]; extern const struct cipher_test snow3g_cipher_linear_test_vectors_json[]; -int snow3g_test(struct IMB_MGR *mb_mgr); +int +snow3g_test(struct IMB_MGR *mb_mgr); static void validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, unsigned int job_api, struct test_suite_context *uea2_ctx, @@ -68,8 +69,7 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx); static void -validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, - uint32_t job_api, +validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx); static void @@ -81,48 +81,34 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx); static void -validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, - uint32_t job_api, +validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx); static void -validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, - uint32_t job_api, +validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx); static void -validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, - struct test_suite_context *uea2_ctx, +validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx); /* snow3g validation function pointer table */ struct { - void (*func)(struct IMB_MGR *, uint32_t job_api, - struct test_suite_context *uea2_ctx, + void (*func)(struct IMB_MGR *, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx); const char *func_name; } snow3g_func_tab[] = { - {validate_snow3g_f8_1_bitblock, - "validate_snow3g_f8_1_bitblock"}, - {validate_snow3g_f8_1_block, - "validate_snow3g_f8_1_block"}, - {validate_snow3g_f8_2_blocks, - "validate_snow3g_f8_2_blocks"}, - {validate_snow3g_f8_4_blocks, - "validate_snow3g_f8_4_blocks"}, - {validate_snow3g_f8_8_blocks, - "validate_snow3g_f8_8_blocks"}, - {validate_snow3g_f8_8_blocks_multi_key, - "validate_snow3g_f8_8_blocks_multi_key"}, - {validate_snow3g_f8_n_blocks, - "validate_snow3g_f8_n_blocks"}, - {validate_snow3g_f8_n_blocks_linear, - "validate_snow3g_f8_n_blocks_linear"}, - {validate_snow3g_f8_n_blocks_linear_mkeys, - "validate_snow3g_f8_n_blocks_linear_multi_keys"}, - {validate_snow3g_f8_n_blocks_multi, - "validate_snow3g_f8_n_blocks_multi"}, - {validate_snow3g_f9, - "validate_snow3g_f9"} + { validate_snow3g_f8_1_bitblock, "validate_snow3g_f8_1_bitblock" }, + { validate_snow3g_f8_1_block, "validate_snow3g_f8_1_block" }, + { validate_snow3g_f8_2_blocks, "validate_snow3g_f8_2_blocks" }, + { validate_snow3g_f8_4_blocks, "validate_snow3g_f8_4_blocks" }, + { validate_snow3g_f8_8_blocks, "validate_snow3g_f8_8_blocks" }, + { validate_snow3g_f8_8_blocks_multi_key, "validate_snow3g_f8_8_blocks_multi_key" }, + { validate_snow3g_f8_n_blocks, "validate_snow3g_f8_n_blocks" }, + { validate_snow3g_f8_n_blocks_linear, "validate_snow3g_f8_n_blocks_linear" }, + { validate_snow3g_f8_n_blocks_linear_mkeys, + "validate_snow3g_f8_n_blocks_linear_multi_keys" }, + { validate_snow3g_f8_n_blocks_multi, "validate_snow3g_f8_n_blocks_multi" }, + { validate_snow3g_f9, "validate_snow3g_f9" } }; struct cipher_iv_gen_params { @@ -140,23 +126,23 @@ struct hash_iv_gen_params { }; const struct cipher_iv_gen_params snow3g_iv_params_f8_json[] = { -{ 1, "\x00\x00\x00\x00", "\x00", "\x00"}, -{ 2, "\x0f\xf2\xa4\x72", "\x0c", "\x01"}, -{ 3, "\x26\x6b\x55\xfa", "\x03", "\x01"}, -{ 4, "\x7b\xcf\x8b\xe2", "\x18", "\x00"}, -{ 5, "\xb4\x59\x8a\x39", "\x05", "\x01"}, -{ 6, "\x0f\xf2\xa4\x72", "\x09", "\x00"}, -{ 0, NULL, NULL, NULL} + { 1, "\x00\x00\x00\x00", "\x00", "\x00" }, + { 2, "\x0f\xf2\xa4\x72", "\x0c", "\x01" }, + { 3, "\x26\x6b\x55\xfa", "\x03", "\x01" }, + { 4, "\x7b\xcf\x8b\xe2", "\x18", "\x00" }, + { 5, "\xb4\x59\x8a\x39", "\x05", "\x01" }, + { 6, "\x0f\xf2\xa4\x72", "\x09", "\x00" }, + { 0, NULL, NULL, NULL } }; const struct hash_iv_gen_params snow3g_iv_params_f9_json[] = { -{ 1, "\x56\xf0\xa6\x38", "\x49\xec\xd2\x05", "\x00"}, -{ 2, "\xe2\x87\xdc\x3e", "\xe2\xd8\xf2\xa4", "\x01"}, -{ 3, "\x44\x61\xaf\x36", "\x3a\xf0\x38\x98", "\x01"}, -{ 4, "\x41\x3e\x79\x14", "\xfd\xe8\x97\x03", "\x01"}, -{ 5, "\x3c\x39\x6f\x29", "\x37\x77\x22\x6b", "\x01"}, -{ 6, "\x3c\x39\x6f\x29", "\x37\x77\x22\x6b", "\x01"}, -{ 0, NULL, NULL, NULL} + { 1, "\x56\xf0\xa6\x38", "\x49\xec\xd2\x05", "\x00" }, + { 2, "\xe2\x87\xdc\x3e", "\xe2\xd8\xf2\xa4", "\x01" }, + { 3, "\x44\x61\xaf\x36", "\x3a\xf0\x38\x98", "\x01" }, + { 4, "\x41\x3e\x79\x14", "\xfd\xe8\x97\x03", "\x01" }, + { 5, "\x3c\x39\x6f\x29", "\x37\x77\x22\x6b", "\x01" }, + { 6, "\x3c\x39\x6f\x29", "\x37\x77\x22\x6b", "\x01" }, + { 0, NULL, NULL, NULL } }; /****************************************************************************** @@ -166,8 +152,8 @@ const struct hash_iv_gen_params snow3g_iv_params_f9_json[] = { * @param ptr [IN] - pointer to beginning of buffer. * @param len [IN] - length of buffer. ******************************************************************************/ -static inline -void snow3g_hexdump(const char *message, const uint8_t *ptr, int len) +static inline void +snow3g_hexdump(const char *message, const uint8_t *ptr, int len) { int ctr; @@ -182,11 +168,9 @@ void snow3g_hexdump(const char *message, const uint8_t *ptr, int len) } static inline int -submit_uea2_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, - uint8_t ** const ivs, uint8_t ** const src, - uint8_t ** const dst, const uint32_t *bitlens, - const uint32_t *bit_offsets, const int dir, - const unsigned int num_jobs) +submit_uea2_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const ivs, + uint8_t **const src, uint8_t **const dst, const uint32_t *bitlens, + const uint32_t *bit_offsets, const int dir, const unsigned int num_jobs) { IMB_JOB *job; unsigned int i; @@ -212,8 +196,7 @@ submit_uea2_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, if (job != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, i); + printf("%d error status:%d, job %u", __LINE__, job->status, i); return -1; } } @@ -222,8 +205,7 @@ submit_uea2_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d\n", - __LINE__, job->status); + printf("%d error status:%d\n", __LINE__, job->status); return -1; } } @@ -237,9 +219,8 @@ submit_uea2_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, } static inline int -submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, - uint8_t *src, uint8_t *tag, const uint32_t bitlen, - const uint8_t *exp_out, const int num_jobs) +submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, uint8_t *src, uint8_t *tag, + const uint32_t bitlen, const uint8_t *exp_out, const int num_jobs) { int i, err, jobs_rx = 0; IMB_JOB *job; @@ -267,19 +248,17 @@ submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, /* got job back */ jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d", - __LINE__, job->status); + printf("%d error status:%d", __LINE__, job->status); goto end; } /*Compare the digest with the expected in the vectors*/ - if (memcmp(job->auth_tag_output, - exp_out, IMB_SNOW3G_DIGEST_LEN) != 0) { + if (memcmp(job->auth_tag_output, exp_out, IMB_SNOW3G_DIGEST_LEN) != 0) { printf("IMB_AUTH_SNOW3G_UIA2_BITLEN " - "job num:%d\n", i); + "job num:%d\n", + i); snow3g_hexdump("Actual:", job->auth_tag_output, IMB_SNOW3G_DIGEST_LEN); - snow3g_hexdump("Expected:", exp_out, - IMB_SNOW3G_DIGEST_LEN); + snow3g_hexdump("Expected:", exp_out, IMB_SNOW3G_DIGEST_LEN); goto end; } } else { @@ -304,8 +283,7 @@ submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, if (memcmp(job->auth_tag_output, exp_out, IMB_SNOW3G_DIGEST_LEN) != 0) { printf("IMB_AUTH_SNOW3G_UIA2_BITLEN job num:%d\n", i); - snow3g_hexdump("Actual:", job->auth_tag_output, - IMB_SNOW3G_DIGEST_LEN); + snow3g_hexdump("Actual:", job->auth_tag_output, IMB_SNOW3G_DIGEST_LEN); snow3g_hexdump("Expected:", exp_out, IMB_SNOW3G_DIGEST_LEN); goto end; } @@ -318,7 +296,7 @@ submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, return 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -327,8 +305,7 @@ submit_uia2_job(struct IMB_MGR *mb_mgr, uint8_t *key, uint8_t *iv, static void validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, - struct test_suite_context *uea2_ctx, - struct test_suite_context *uia2_ctx) + struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { int numVectors = 0, i; size_t size = 0; @@ -345,8 +322,7 @@ validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_1_BUFFER (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_1_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); #endif memset(srcBuff, 0, sizeof(srcBuff)); @@ -403,8 +379,8 @@ validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, uint32_t bit_len = length << 3; uint32_t bit_offset = 0; - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, &pIV, &pSrcBuff, &pSrcBuff, - &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, &pIV, &pSrcBuff, + &pSrcBuff, &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); } else IMB_SNOW3G_F8_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, srcBuff, length); @@ -424,8 +400,8 @@ validate_snow3g_f8_1_block(struct IMB_MGR *mb_mgr, uint32_t job_api, unsigned bit_len = length << 3; uint32_t bit_offset = 0; - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, &pIV, &pSrcBuff, &pSrcBuff, - &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, &pIV, &pSrcBuff, + &pSrcBuff, &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); } else IMB_SNOW3G_F8_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, srcBuff, length); @@ -452,9 +428,8 @@ snow3g_f8_1_buffer_exit: } /* Shift right a buffer by "offset" bits, "offset" < 8 */ -static void buffer_shift_right(uint8_t *buffer, - const uint32_t length, - const uint8_t offset) +static void +buffer_shift_right(uint8_t *buffer, const uint32_t length, const uint8_t offset) { uint8_t prev_byte; const uint32_t length_in_bytes = (length * 8 + offset + 7) / 8; @@ -467,15 +442,14 @@ static void buffer_shift_right(uint8_t *buffer, for (i = 1; i < length_in_bytes; i++) { const uint8_t curr_byte = buffer[i]; - buffer[i] = ((prev_byte & lower_byte_mask) << (8 - offset)) | - (curr_byte >> offset); + buffer[i] = ((prev_byte & lower_byte_mask) << (8 - offset)) | (curr_byte >> offset); prev_byte = curr_byte; } } -static void copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, - uint8_t *ciphBuff, const uint8_t *src_test, - const uint8_t *dst_test, const uint32_t byte_len) +static void +copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, uint8_t *ciphBuff, const uint8_t *src_test, + const uint8_t *dst_test, const uint32_t byte_len) { /* * Reset all buffers @@ -491,8 +465,7 @@ static void copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, } static void -validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, - uint32_t job_api, +validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { @@ -514,8 +487,7 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_1_BUFFER_BIT: (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_1_BUFFER_BIT: (%s):\n", job_api ? "Job API" : "Direct API"); #endif memset(padding, -1, sizeof(padding)); @@ -564,8 +536,7 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, uint32_t head_offset; for (head_offset = 0; head_offset < 8; head_offset++) { - uint32_t byte_len, bit_len, tail_offset, - final_byte_offset; + uint32_t byte_len, bit_len, tail_offset, final_byte_offset; memcpy(pKey, vect_bit[i].key, vect_bit[i].keySize / 8); memcpy(pIV, vect_bit[i].iv, vect_bit[i].ivSize / 8); @@ -604,17 +575,12 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, /*Validate Encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - &pIV, &srcBufAftPad, - &midBufAftPad, - &bit_len, &head_offset, - IMB_DIR_ENCRYPT, 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, &pIV, + &srcBufAftPad, &midBufAftPad, &bit_len, + &head_offset, IMB_DIR_ENCRYPT, 1); else - IMB_SNOW3G_F8_1_BUFFER_BIT(mb_mgr, pKeySched, - pIV, srcBufAftPad, - midBufAftPad, - bit_len, - head_offset); + IMB_SNOW3G_F8_1_BUFFER_BIT(mb_mgr, pKeySched, pIV, srcBufAftPad, + midBufAftPad, bit_len, head_offset); /* * Check against the ciphertext in the vector against @@ -627,10 +593,8 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, printf("Test1: snow3g_f8_1_bitbuffer(Enc) " "buffer:%zu size:%u bit offset:%u\n", vect_bit[i].tcId, bit_len, head_offset); - snow3g_hexdump("Actual:", midBufAftPad, - byte_len_with_offset); - snow3g_hexdump("Expected:", dstBufAftPad, - byte_len_with_offset); + snow3g_hexdump("Actual:", midBufAftPad, byte_len_with_offset); + snow3g_hexdump("Expected:", dstBufAftPad, byte_len_with_offset); goto snow3g_f8_1_buffer_bit_exit; } @@ -638,20 +602,17 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, * Check that data not to be ciphered wasn't * overwritten */ - if (membitcmp(midBufBefPad, padding, - (IMB_SNOW3G_PAD_LEN * 8) + head_offset, 0)) { + if (membitcmp(midBufBefPad, padding, (IMB_SNOW3G_PAD_LEN * 8) + head_offset, + 0)) { printf("overwrite head\n"); - snow3g_hexdump("Head", midBufBefPad, - IMB_SNOW3G_PAD_LEN + 1); + snow3g_hexdump("Head", midBufBefPad, IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } if (membitcmp(midBufAftPad + final_byte_offset, padding, - (IMB_SNOW3G_PAD_LEN * 8) - tail_offset, - tail_offset)) { + (IMB_SNOW3G_PAD_LEN * 8) - tail_offset, tail_offset)) { printf("overwrite tail\n"); - snow3g_hexdump("Tail", - midBufAftPad + final_byte_offset, + snow3g_hexdump("Tail", midBufAftPad + final_byte_offset, IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } @@ -661,30 +622,22 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, /*Validate Decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - &pIV, &dstBufAftPad, - &midBufAftPad, - &bit_len, &head_offset, - IMB_DIR_DECRYPT, 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, &pIV, + &dstBufAftPad, &midBufAftPad, &bit_len, + &head_offset, IMB_DIR_DECRYPT, 1); else - IMB_SNOW3G_F8_1_BUFFER_BIT(mb_mgr, pKeySched, - pIV, dstBufAftPad, - midBufAftPad, - bit_len, - head_offset); - - if (membitcmp(midBufAftPad, srcBufAftPad, bit_len, - head_offset) != 0) { + IMB_SNOW3G_F8_1_BUFFER_BIT(mb_mgr, pKeySched, pIV, dstBufAftPad, + midBufAftPad, bit_len, head_offset); + + if (membitcmp(midBufAftPad, srcBufAftPad, bit_len, head_offset) != 0) { const uint32_t byte_len_with_offset = (bit_len + head_offset + 7) / 8; printf("Test2: snow3g_f8_1_bitbuffer(Dec) " "buffer:%d size:%u bit offset:%u\n", i, bit_len, head_offset); - snow3g_hexdump("Actual:", midBufAftPad, - byte_len_with_offset); - snow3g_hexdump("Expected:", srcBufAftPad, - byte_len_with_offset); + snow3g_hexdump("Actual:", midBufAftPad, byte_len_with_offset); + snow3g_hexdump("Expected:", srcBufAftPad, byte_len_with_offset); goto snow3g_f8_1_buffer_bit_exit; } @@ -692,26 +645,23 @@ validate_snow3g_f8_1_bitblock(struct IMB_MGR *mb_mgr, * Check that data not to be ciphered was not * overwritten */ - if (membitcmp(midBufBefPad, padding, - (IMB_SNOW3G_PAD_LEN * 8) + head_offset, 0)) { + if (membitcmp(midBufBefPad, padding, (IMB_SNOW3G_PAD_LEN * 8) + head_offset, + 0)) { printf("overwrite head\n"); - snow3g_hexdump("Head", midBufBefPad, - IMB_SNOW3G_PAD_LEN + 1); + snow3g_hexdump("Head", midBufBefPad, IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } if (membitcmp(midBufAftPad + final_byte_offset, padding, - (IMB_SNOW3G_PAD_LEN * 8) - tail_offset, - tail_offset)) { + (IMB_SNOW3G_PAD_LEN * 8) - tail_offset, tail_offset)) { printf("overwrite tail\n"); - snow3g_hexdump("Tail", - midBufAftPad + final_byte_offset, + snow3g_hexdump("Tail", midBufAftPad + final_byte_offset, IMB_SNOW3G_PAD_LEN + 1); goto snow3g_f8_1_buffer_bit_exit; } } /* head_offset = 0..7 */ - } /* for numVectors */ + } /* for numVectors */ /* no errors detected */ status = 0; @@ -746,8 +696,7 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_2_BUFFER: (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_2_BUFFER: (%s):\n", job_api ? "Job API" : "Direct API"); #endif memset(pSrcBuff, 0, sizeof(pSrcBuff)); @@ -826,21 +775,19 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* TEST IN-PLACE ENCRYPTION/DECRYPTION */ /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pSrcBuff, - bitLens, bitOffsets, - IMB_DIR_ENCRYPT, 2); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pSrcBuff, + bitLens, bitOffsets, IMB_DIR_ENCRYPT, 2); else - IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], - pIV[1], pSrcBuff[0], pSrcBuff[0], - packetLen[0], pSrcBuff[1], - pSrcBuff[1], packetLen[1]); + IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pSrcBuff[0], + pSrcBuff[0], packetLen[0], pSrcBuff[1], pSrcBuff[1], + packetLen[1]); /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pSrcBuff[i], testVectors[j].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_2_BUFFER(Enc) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); @@ -855,21 +802,19 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Test the decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pSrcBuff, - bitLens, bitOffsets, - IMB_DIR_DECRYPT, 2); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pSrcBuff, + bitLens, bitOffsets, IMB_DIR_DECRYPT, 2); else - IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], - pIV[1], pSrcBuff[0], pSrcBuff[0], - packetLen[0], pSrcBuff[1], - pSrcBuff[1], packetLen[1]); + IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pSrcBuff[0], + pSrcBuff[0], packetLen[0], pSrcBuff[1], pSrcBuff[1], + packetLen[1]); /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_2_BUFFER(Dec) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); @@ -880,21 +825,19 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* TEST OUT-OF-PLACE ENCRYPTION/DECRYPTION */ /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_ENCRYPT, 2); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_ENCRYPT, 2); else - IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], - pIV[1], pSrcBuff[0], pDstBuff[0], - packetLen[0], pSrcBuff[1], - pDstBuff[1], packetLen[1]); + IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pSrcBuff[0], + pDstBuff[0], packetLen[0], pSrcBuff[1], pDstBuff[1], + packetLen[1]); /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_2_BUFFER(Enc) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); @@ -910,21 +853,19 @@ validate_snow3g_f8_2_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Test the decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_DECRYPT, 2); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_DECRYPT, 2); else - IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], - pIV[1], pSrcBuff[0], pDstBuff[0], - packetLen[0], pSrcBuff[1], - pDstBuff[1], packetLen[1]); + IMB_SNOW3G_F8_2_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pSrcBuff[0], + pDstBuff[0], packetLen[0], pSrcBuff[1], pDstBuff[1], + packetLen[1]); /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pDstBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_2_BUFFER(Dec) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); @@ -1000,8 +941,7 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_4_BUFFER: (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_4_BUFFER: (%s):\n", job_api ? "Job API" : "Direct API"); #endif memset(pSrcBuff, 0, sizeof(pSrcBuff)); @@ -1075,23 +1015,21 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* TEST IN-PLACE ENCRYPTION/DECRYPTION */ /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, pSrcBuff, pSrcBuff, + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pSrcBuff, bitLens, bitOffsets, IMB_DIR_ENCRYPT, 4); else - IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], - pIV[0], pIV[1], pIV[2], pIV[3], - pSrcBuff[0], pSrcBuff[0], - packetLen[0], pSrcBuff[1], - pSrcBuff[1], packetLen[1], - pSrcBuff[2], pSrcBuff[2], - packetLen[2], pSrcBuff[3], - pSrcBuff[3], packetLen[3]); + IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], + pSrcBuff[0], pSrcBuff[0], packetLen[0], pSrcBuff[1], + pSrcBuff[1], packetLen[1], pSrcBuff[2], pSrcBuff[2], + packetLen[2], pSrcBuff[3], pSrcBuff[3], + packetLen[3]); /* compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pSrcBuff[i], testVectors[j].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_4_BUFFER(Enc) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); @@ -1106,23 +1044,21 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Test the decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, pSrcBuff, pSrcBuff, + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pSrcBuff, bitLens, bitOffsets, IMB_DIR_DECRYPT, 4); else - IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], - pIV[0], pIV[1], pIV[2], pIV[3], - pSrcBuff[0], pSrcBuff[0], - packetLen[0], pSrcBuff[1], - pSrcBuff[1], packetLen[1], - pSrcBuff[2], pSrcBuff[2], - packetLen[2], pSrcBuff[3], - pSrcBuff[3], packetLen[3]); + IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], + pSrcBuff[0], pSrcBuff[0], packetLen[0], pSrcBuff[1], + pSrcBuff[1], packetLen[1], pSrcBuff[2], pSrcBuff[2], + packetLen[2], pSrcBuff[3], pSrcBuff[3], + packetLen[3]); /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_4_BUFFER(Dec) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); @@ -1132,25 +1068,21 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* TEST OUT-OF-PLACE ENCRYPTION/DECRYPTION */ /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_ENCRYPT, 4); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_ENCRYPT, 4); else - IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], - pIV[0], pIV[1], pIV[2], pIV[3], - pSrcBuff[0], pDstBuff[0], - packetLen[0], pSrcBuff[1], - pDstBuff[1], packetLen[1], - pSrcBuff[2], pDstBuff[2], - packetLen[2], pSrcBuff[3], - pDstBuff[3], packetLen[3]); + IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], + pSrcBuff[0], pDstBuff[0], packetLen[0], pSrcBuff[1], + pDstBuff[1], packetLen[1], pSrcBuff[2], pDstBuff[2], + packetLen[2], pSrcBuff[3], pDstBuff[3], + packetLen[3]); /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_4_BUFFER(Enc) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); @@ -1166,27 +1098,22 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, } /*Test the decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_DECRYPT, 4); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_DECRYPT, 4); else - IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], - pIV[0], pIV[1], pIV[2], pIV[3], - pSrcBuff[0], pDstBuff[0], - packetLen[0], pSrcBuff[1], - pDstBuff[1], packetLen[1], - pSrcBuff[2], pDstBuff[2], - packetLen[2], pSrcBuff[3], - pDstBuff[3], packetLen[3]); + IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], + pSrcBuff[0], pDstBuff[0], packetLen[0], pSrcBuff[1], + pDstBuff[1], packetLen[1], pSrcBuff[2], pDstBuff[2], + packetLen[2], pSrcBuff[3], pDstBuff[3], + packetLen[3]); /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pDstBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_4_BUFFER(Dec) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); - snow3g_hexdump("Actual:", pDstBuff[i], - packetLen[i]); + "buffer:%d\n", + testVectors[j].tcId, i); + snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); goto snow3g_f8_4_buffer_exit; @@ -1273,25 +1200,22 @@ validate_snow3g_f8_4_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Test the encrypt */ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, IMB_DIR_ENCRYPT, 4); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, bitLens, + bitOffsets, IMB_DIR_ENCRYPT, 4); else - IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], - pIV[2], pIV[3], pSrcBuff[0], pDstBuff[0], - packetLen[0], pSrcBuff[1], pDstBuff[1], - packetLen[1], pSrcBuff[2], pDstBuff[2], - packetLen[2], pSrcBuff[3], pDstBuff[3], - packetLen[3]); + IMB_SNOW3G_F8_4_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], + pSrcBuff[0], pDstBuff[0], packetLen[0], pSrcBuff[1], + pDstBuff[1], packetLen[1], pSrcBuff[2], pDstBuff[2], + packetLen[2], pSrcBuff[3], pDstBuff[3], packetLen[3]); /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pDstBuff[i], (const uint8_t *) testVectors[1].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_4_BUFFER(Enc, diff size) " - "vector:%d buffer:%d\n", 1, i); + "vector:%d buffer:%d\n", + 1, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); - snow3g_hexdump("Expected:", - (const uint8_t *) testVectors[1].ct, + snow3g_hexdump("Expected:", (const uint8_t *) testVectors[1].ct, packetLen[i]); goto snow3g_f8_4_buffer_exit; } @@ -1341,8 +1265,7 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_8_BUFFER: (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_8_BUFFER: (%s):\n", job_api ? "Job API" : "Direct API"); #endif memset(pSrcBuff, 0, sizeof(pSrcBuff)); @@ -1416,32 +1339,24 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_ENCRYPT, 8); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_ENCRYPT, 8); else - IMB_SNOW3G_F8_8_BUFFER(mb_mgr, pKeySched[0], pIV[0], - pIV[1], pIV[2], pIV[3], pIV[4], - pIV[5], pIV[6], pIV[7], - pSrcBuff[0], pDstBuff[0], - packetLen[0], pSrcBuff[1], - pDstBuff[1], packetLen[1], - pSrcBuff[2], pDstBuff[2], - packetLen[2], pSrcBuff[3], - pDstBuff[3], packetLen[3], - pSrcBuff[4], pDstBuff[4], - packetLen[4], pSrcBuff[5], - pDstBuff[5], packetLen[5], - pSrcBuff[6], pDstBuff[6], - packetLen[6], pSrcBuff[7], - pDstBuff[7], packetLen[7]); + IMB_SNOW3G_F8_8_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], + pIV[4], pIV[5], pIV[6], pIV[7], pSrcBuff[0], + pDstBuff[0], packetLen[0], pSrcBuff[1], pDstBuff[1], + packetLen[1], pSrcBuff[2], pDstBuff[2], packetLen[2], + pSrcBuff[3], pDstBuff[3], packetLen[3], pSrcBuff[4], + pDstBuff[4], packetLen[4], pSrcBuff[5], pDstBuff[5], + packetLen[5], pSrcBuff[6], pDstBuff[6], packetLen[6], + pSrcBuff[7], pDstBuff[7], packetLen[7]); /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_8_BUFFER(Enc) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); @@ -1451,32 +1366,24 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Test the decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pDstBuff, pSrcBuff, - bitLens, bitOffsets, - IMB_DIR_DECRYPT, 8); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pDstBuff, pSrcBuff, + bitLens, bitOffsets, IMB_DIR_DECRYPT, 8); else - IMB_SNOW3G_F8_8_BUFFER(mb_mgr, pKeySched[0], pIV[0], - pIV[1], pIV[2], pIV[3], pIV[4], - pIV[5], pIV[6], pIV[7], - pDstBuff[0], pSrcBuff[0], - packetLen[0], pDstBuff[1], - pSrcBuff[1], packetLen[1], - pDstBuff[2], pSrcBuff[2], - packetLen[2], pDstBuff[3], - pSrcBuff[3], packetLen[3], - pDstBuff[4], pSrcBuff[4], - packetLen[4], pDstBuff[5], - pSrcBuff[5], packetLen[5], - pDstBuff[6], pSrcBuff[6], - packetLen[6], pDstBuff[7], - pSrcBuff[7], packetLen[7]); + IMB_SNOW3G_F8_8_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], + pIV[4], pIV[5], pIV[6], pIV[7], pDstBuff[0], + pSrcBuff[0], packetLen[0], pDstBuff[1], pSrcBuff[1], + packetLen[1], pDstBuff[2], pSrcBuff[2], packetLen[2], + pDstBuff[3], pSrcBuff[3], packetLen[3], pDstBuff[4], + pSrcBuff[4], packetLen[4], pDstBuff[5], pSrcBuff[5], + packetLen[5], pDstBuff[6], pSrcBuff[6], packetLen[6], + pDstBuff[7], pSrcBuff[7], packetLen[7]); /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_8_BUFFER(Dec) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); @@ -1563,27 +1470,23 @@ validate_snow3g_f8_8_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /* Test the encrypt */ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, IMB_DIR_ENCRYPT, 8); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, bitLens, + bitOffsets, IMB_DIR_ENCRYPT, 8); else - IMB_SNOW3G_F8_8_BUFFER(mb_mgr, pKeySched[0], pIV[0], pIV[1], - pIV[2], pIV[3], pIV[4], pIV[5], pIV[6], - pIV[7], pSrcBuff[0], pDstBuff[0], - packetLen[0], pSrcBuff[1], pDstBuff[1], - packetLen[1], pSrcBuff[2], pDstBuff[2], - packetLen[2], pSrcBuff[3], pDstBuff[3], - packetLen[3], pSrcBuff[4], pDstBuff[4], - packetLen[4], pSrcBuff[5], pDstBuff[5], - packetLen[5], pSrcBuff[6], pDstBuff[6], - packetLen[6], pSrcBuff[7], pDstBuff[7], - packetLen[7]); + IMB_SNOW3G_F8_8_BUFFER( + mb_mgr, pKeySched[0], pIV[0], pIV[1], pIV[2], pIV[3], pIV[4], pIV[5], + pIV[6], pIV[7], pSrcBuff[0], pDstBuff[0], packetLen[0], pSrcBuff[1], + pDstBuff[1], packetLen[1], pSrcBuff[2], pDstBuff[2], packetLen[2], + pSrcBuff[3], pDstBuff[3], packetLen[3], pSrcBuff[4], pDstBuff[4], + packetLen[4], pSrcBuff[5], pDstBuff[5], packetLen[5], pSrcBuff[6], + pDstBuff[6], packetLen[6], pSrcBuff[7], pDstBuff[7], packetLen[7]); /*compare the ciphertext with the encryped plaintext*/ for (i = 0; i < numPackets; i++) { if (memcmp(pDstBuff[i], testVectors[1].ct, packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_8_BUFFER(Enc, diff size) " - "vector:%d buffer:%d\n", 1, i); + "vector:%d buffer:%d\n", + 1, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[1].ct, packetLen[i]); @@ -1614,8 +1517,7 @@ snow3g_f8_8_buffer_exit: } static void -validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, - uint32_t job_api, +validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { @@ -1713,17 +1615,13 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, pSrcBuff, - pDstBuff, bitLens, bitOffsets, - IMB_DIR_ENCRYPT, 8); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, bitLens, + bitOffsets, IMB_DIR_ENCRYPT, 8); else - IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(mb_mgr, - (const snow3g_key_schedule_t * const *) - pKeySched, - (const void * const *)pIV, - (const void * const *)pSrcBuff, - (void **)pDstBuff, - packetLen); + IMB_SNOW3G_F8_8_BUFFER_MULTIKEY( + mb_mgr, (const snow3g_key_schedule_t *const *) pKeySched, + (const void *const *) pIV, (const void *const *) pSrcBuff, + (void **) pDstBuff, packetLen); /*compare the ciphertext with the encrypted plaintext*/ for (i = 0; i < numPackets; i++) { @@ -1731,25 +1629,24 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, if (memcmp(pDstBuff[i], testVectors[j].ct, packetLen[i]) != 0) { printf("snow3g_f8_8_multi_buffer(Enc) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, - packetLen[i]); + packetLen[i]); goto snow3g_f8_8_buffer_multikey_exit; } } /*Test the decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, pSrcBuff, - pDstBuff, bitLens, bitOffsets, - IMB_DIR_DECRYPT, 8); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, bitLens, + bitOffsets, IMB_DIR_DECRYPT, 8); else - IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(mb_mgr, - (const snow3g_key_schedule_t * const *) pKeySched, - (const void * const *)pIV, - (const void * const *)pDstBuff, - (void **)pSrcBuff, packetLen); + IMB_SNOW3G_F8_8_BUFFER_MULTIKEY( + mb_mgr, (const snow3g_key_schedule_t *const *) pKeySched, + (const void *const *) pIV, (const void *const *) pDstBuff, + (void **) pSrcBuff, packetLen); /*Compare the plaintext with the decrypted ciphertext*/ for (i = 0; i < numPackets; i++) { @@ -1757,7 +1654,8 @@ validate_snow3g_f8_8_blocks_multi_key(struct IMB_MGR *mb_mgr, if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("snow3g_f8_8_multi_buffer(Dec) vector:%zu " - "buffer:%d\n", testVectors[j].tcId, i); + "buffer:%d\n", + testVectors[j].tcId, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); @@ -1809,8 +1707,7 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_N_BUFFER: (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_N_BUFFER: (%s):\n", job_api ? "Job API" : "Direct API"); #endif memset(pSrcBuff, 0, sizeof(pSrcBuff)); @@ -1884,18 +1781,14 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, } } - for (i = 0; i < IMB_SNOW3G_NUM_SUPPORTED_BUFFERS ; i++) { + for (i = 0; i < IMB_SNOW3G_NUM_SUPPORTED_BUFFERS; i++) { /*Test the encrypt*/ if (job_api) { - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_ENCRYPT, i + 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_ENCRYPT, i + 1); } else { - IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, - (const void * const *)pIV, - (const void * const *)pSrcBuff, - (void **)pDstBuff, + IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, (const void *const *) pIV, + (const void *const *) pSrcBuff, (void **) pDstBuff, packetLen, i + 1); if (pDstBuff[0] == NULL) { printf("N buffer failure\n"); @@ -1914,15 +1807,11 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Test the Decrypt*/ if (job_api) { - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_DECRYPT, i + 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_DECRYPT, i + 1); } else { - IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, - (const void * const *)pIV, - (const void * const *)pDstBuff, - (void **)pSrcBuff, + IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, (const void *const *) pIV, + (const void *const *) pDstBuff, (void **) pSrcBuff, packetLen, i + 1); if (pSrcBuff[0] == NULL) { printf("N buffer failure\n"); @@ -1931,10 +1820,8 @@ validate_snow3g_f8_n_blocks(struct IMB_MGR *mb_mgr, uint32_t job_api, } /*Compare the data in the pSrcBuff with the pDstBuff*/ - if (memcmp(pSrcBuff[i], testVectors[0].msg, - packetLen[i]) != 0) { - printf("snow3g_f8_n_buffer equal sizes, vector:%d\n", - i); + if (memcmp(pSrcBuff[i], testVectors[0].msg, packetLen[i]) != 0) { + printf("snow3g_f8_n_buffer equal sizes, vector:%d\n", i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[0].msg, packetLen[0]); @@ -1986,10 +1873,9 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, int keyLen = IMB_KEY_256_BYTES; int status = -1; - (void)uia2_ctx; + (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_N_BUFFER: (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_N_BUFFER: (%s):\n", job_api ? "Job API" : "Direct API"); #endif memset(pSrcBuff, 0, sizeof(pSrcBuff)); memset(pSrcBuff_const, 0, sizeof(pSrcBuff_const)); @@ -2073,8 +1959,7 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, } for (i = 0; i < numPackets; i++) { - const char *fn_name = job_api ? - "submit_uea2_jobs" : "IMB_SNOW3G_F8_N_BUFFER"; + const char *fn_name = job_api ? "submit_uea2_jobs" : "IMB_SNOW3G_F8_N_BUFFER"; const int length = (int) testVectors[0].msgSize / 8; @@ -2086,16 +1971,12 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Test the encrypt*/ if (job_api) { - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, - pSrcBuff_const, pDstBuff, bitLens, - bitOffsets, IMB_DIR_ENCRYPT, i + 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff_const, + pDstBuff, bitLens, bitOffsets, IMB_DIR_ENCRYPT, i + 1); } else { - IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, - (const void *const *)pIV, - (const void *const *) - pSrcBuff_const, - (void **)pDstBuff, packetLen, - i + 1); + IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, (const void *const *) pIV, + (const void *const *) pSrcBuff_const, + (void **) pDstBuff, packetLen, i + 1); if (pDstBuff[0] == NULL) { printf("N buffer failure\n"); goto snow3g_f8_n_buffer_linear_exit; @@ -2104,49 +1985,39 @@ validate_snow3g_f8_n_blocks_linear(struct IMB_MGR *mb_mgr, uint32_t job_api, /*Compare the data in the pDstBuff with the cipher pattern*/ for (j = 0; j < i; j++) { - if (memcmp(pDstBuff_const[j], pDstBuff[j], - packetLen[j]) != 0) { - printf("%s(Enc) %s nb_packets:%d vector:%d\n", - fn_name, __func__, i, j); - snow3g_hexdump("Actual:", pDstBuff[j], - packetLen[j]); - snow3g_hexdump("Expected:", pDstBuff_const[j], - packetLen[j]); + if (memcmp(pDstBuff_const[j], pDstBuff[j], packetLen[j]) != 0) { + printf("%s(Enc) %s nb_packets:%d vector:%d\n", fn_name, __func__, i, + j); + snow3g_hexdump("Actual:", pDstBuff[j], packetLen[j]); + snow3g_hexdump("Expected:", pDstBuff_const[j], packetLen[j]); } } /*Test the Decrypt*/ if (job_api) { - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, pIV, - pDstBuff_const, pSrcBuff, bitLens, - bitOffsets, IMB_DIR_DECRYPT, i + 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pDstBuff_const, + pSrcBuff, bitLens, bitOffsets, IMB_DIR_DECRYPT, i + 1); } else { - IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, - (const void *const *)pIV, - (const void *const *) - pDstBuff_const, - (void **)pSrcBuff, packetLen, - i + 1); + IMB_SNOW3G_F8_N_BUFFER(mb_mgr, *pKeySched, (const void *const *) pIV, + (const void *const *) pDstBuff_const, + (void **) pSrcBuff, packetLen, i + 1); if (pSrcBuff[0] == NULL) goto snow3g_f8_n_buffer_linear_exit; } /*Compare the data in the pSrcBuff with the pDstBuff*/ for (j = 0; j < i; j++) { - if (memcmp(pSrcBuff[j], pSrcBuff_const[j], - packetLen[j]) != 0) { - printf("%s(Dec) %s nb_packets:%d vector:%d\n", - fn_name, __func__, i, j); - snow3g_hexdump("Actual:", pSrcBuff[j], - packetLen[j]); - snow3g_hexdump("Expected:", pSrcBuff_const[j], - packetLen[j]); + if (memcmp(pSrcBuff[j], pSrcBuff_const[j], packetLen[j]) != 0) { + printf("%s(Dec) %s nb_packets:%d vector:%d\n", fn_name, __func__, i, + j); + snow3g_hexdump("Actual:", pSrcBuff[j], packetLen[j]); + snow3g_hexdump("Expected:", pSrcBuff_const[j], packetLen[j]); goto snow3g_f8_n_buffer_linear_exit; } } } - /* no errors detected */ + /* no errors detected */ status = 0; snow3g_f8_n_buffer_linear_exit: @@ -2174,8 +2045,7 @@ snow3g_f8_n_buffer_linear_exit: } static void -validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, - uint32_t job_api, +validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { @@ -2195,10 +2065,10 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, uint32_t *bitLens = NULL; int status = -1; - (void)uia2_ctx; + (void) uia2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F8_N_BUFFER_MULTI for usecase %s: (%s):\n", - __func__, job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F8_N_BUFFER_MULTI for usecase %s: (%s):\n", __func__, + job_api ? "Job API" : "Direct API"); #endif /* calculate number of vectors */ for (i = 0; testVectors[i].msg != NULL; i++) @@ -2220,9 +2090,8 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, bitOffsets = malloc(sizeof(*bitOffsets) * numVectors); bitLens = malloc(sizeof(*bitLens) * numVectors); - if (!pSrcBuff || !pSrcBuff_const || !pDstBuff || - !pDstBuff_const || !pIV || !pKey || !pKeySched || - !packetLen || !bitOffsets || !bitLens) + if (!pSrcBuff || !pSrcBuff_const || !pDstBuff || !pDstBuff_const || !pIV || !pKey || + !pKeySched || !packetLen || !bitOffsets || !bitLens) goto snow3g_f8_n_buff_linear_mkey_early_exit; memset(pSrcBuff, 0, sizeof(*pSrcBuff) * numVectors); @@ -2306,8 +2175,8 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, for (i = 0; i < numVectors; i++) { int nb_elem, nb_remain_elem = i + 1, idx = 0; - const char *fn_name = job_api ? - "submit_uea2_jobs" : "IMB_SNOW3G_F8_N_BUFFER_MULTIKEY"; + const char *fn_name = + job_api ? "submit_uea2_jobs" : "IMB_SNOW3G_F8_N_BUFFER_MULTIKEY"; for (j = 0; j <= i; j++) { /* Cleanup previous values */ @@ -2326,22 +2195,17 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, } if (job_api) { - submit_uea2_jobs(mb_mgr, - (uint8_t **)&pKeySched[idx], - &pIV[idx], - &pSrcBuff_const[idx], - &pDstBuff[idx], &bitLens[idx], - &bitOffsets[idx], - IMB_DIR_ENCRYPT, nb_elem); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched[idx], &pIV[idx], + &pSrcBuff_const[idx], &pDstBuff[idx], + &bitLens[idx], &bitOffsets[idx], IMB_DIR_ENCRYPT, + nb_elem); } else { IMB_SNOW3G_F8_N_BUFFER_MULTIKEY( - mb_mgr, - (const snow3g_key_schedule_t *const *) - &pKeySched[idx], - (const void *const *)&pIV[idx], - (const void *const *)&pSrcBuff_const[idx], - (void **)&pDstBuff[idx], &packetLen[idx], - nb_elem); + mb_mgr, + (const snow3g_key_schedule_t *const *) &pKeySched[idx], + (const void *const *) &pIV[idx], + (const void *const *) &pSrcBuff_const[idx], + (void **) &pDstBuff[idx], &packetLen[idx], nb_elem); if (pDstBuff[idx] == NULL) { printf("N buffer failure\n"); goto snow3g_f8_n_buff_linear_mkey_exit; @@ -2354,14 +2218,11 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, /*Compare the data in the pDstBuff with the cipher pattern*/ for (j = 0; j <= i; j++) { - if (memcmp(pDstBuff_const[j], pDstBuff[j], - packetLen[j]) != 0) { - printf("%s(Enc) %s nb_packets:%d vector: %d\n", - fn_name, __func__, i, j); - snow3g_hexdump("Actual:", pDstBuff[j], - packetLen[j]); - snow3g_hexdump("Expected:", pDstBuff_const[j], - packetLen[j]); + if (memcmp(pDstBuff_const[j], pDstBuff[j], packetLen[j]) != 0) { + printf("%s(Enc) %s nb_packets:%d vector: %d\n", fn_name, __func__, + i, j); + snow3g_hexdump("Actual:", pDstBuff[j], packetLen[j]); + snow3g_hexdump("Expected:", pDstBuff_const[j], packetLen[j]); goto snow3g_f8_n_buff_linear_mkey_exit; } } @@ -2378,22 +2239,17 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, } /*Test the Decrypt*/ if (job_api) { - submit_uea2_jobs(mb_mgr, - (uint8_t **)&pKeySched[idx], - &pIV[idx], - &pDstBuff_const[idx], - &pSrcBuff[idx], &bitLens[idx], - &bitOffsets[idx], - IMB_DIR_DECRYPT, nb_elem); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched[idx], &pIV[idx], + &pDstBuff_const[idx], &pSrcBuff[idx], + &bitLens[idx], &bitOffsets[idx], IMB_DIR_DECRYPT, + nb_elem); } else { IMB_SNOW3G_F8_N_BUFFER_MULTIKEY( - mb_mgr, - (const snow3g_key_schedule_t *const *) - &pKeySched[idx], - (const void *const *)&pIV[idx], - (const void *const *)&pDstBuff_const[idx], - (void **)&pSrcBuff[idx], &packetLen[idx], - nb_elem); + mb_mgr, + (const snow3g_key_schedule_t *const *) &pKeySched[idx], + (const void *const *) &pIV[idx], + (const void *const *) &pDstBuff_const[idx], + (void **) &pSrcBuff[idx], &packetLen[idx], nb_elem); if (pSrcBuff[idx] == NULL) goto snow3g_f8_n_buff_linear_mkey_exit; } @@ -2403,14 +2259,11 @@ validate_snow3g_f8_n_blocks_linear_mkeys(struct IMB_MGR *mb_mgr, } /*Compare the data in the pSrcBuff with the pDstBuff*/ for (j = 0; j <= i; j++) { - if (memcmp(pSrcBuff[j], pSrcBuff_const[j], - packetLen[j]) != 0) { - printf("%s(Dec) %s nb_packets:%d vector: %d\n", - fn_name, __func__, i, j); - snow3g_hexdump("Actual:", pSrcBuff[j], - packetLen[j]); - snow3g_hexdump("Expected:", pSrcBuff_const[j], - packetLen[j]); + if (memcmp(pSrcBuff[j], pSrcBuff_const[j], packetLen[j]) != 0) { + printf("%s(Dec) %s nb_packets:%d vector: %d\n", fn_name, __func__, + i, j); + snow3g_hexdump("Actual:", pSrcBuff[j], packetLen[j]); + snow3g_hexdump("Expected:", pSrcBuff_const[j], packetLen[j]); goto snow3g_f8_n_buff_linear_mkey_exit; } } @@ -2465,8 +2318,7 @@ snow3g_f8_n_buff_linear_mkey_early_exit: } static void -validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, - uint32_t job_api, +validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { @@ -2563,18 +2415,13 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, /*Test the encrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, - (uint8_t **)&pKeySched, - pIV, pSrcBuff, pDstBuff, - bitLens, bitOffsets, - IMB_DIR_ENCRYPT, i + 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pSrcBuff, pDstBuff, + bitLens, bitOffsets, IMB_DIR_ENCRYPT, i + 1); else - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mb_mgr, - (const snow3g_key_schedule_t * const *) - pKeySched, - (const void * const *)pIV, - (const void * const *)pSrcBuff, - (void **)pDstBuff, packetLen, i + 1); + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY( + mb_mgr, (const snow3g_key_schedule_t *const *) pKeySched, + (const void *const *) pIV, (const void *const *) pSrcBuff, + (void **) pDstBuff, packetLen, i + 1); if (pDstBuff[0] == NULL) { printf("N buffer failure\n"); @@ -2584,7 +2431,8 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, /*Compare the data in the pDstBuff with the cipher pattern*/ if (memcmp(testVectors[j].ct, pDstBuff[i], packetLen[i]) != 0) { printf("IMB_SNOW3G_F8_N_BUFFER(Enc) , vector:%d " - "buffer: %d\n", 0, i); + "buffer: %d\n", + 0, i); snow3g_hexdump("Actual:", pDstBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].ct, packetLen[i]); @@ -2593,17 +2441,13 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, /*Test the Decrypt*/ if (job_api) - submit_uea2_jobs(mb_mgr, (uint8_t **)&pKeySched, - pIV, pDstBuff, pSrcBuff, - bitLens, bitOffsets, - IMB_DIR_DECRYPT, i + 1); + submit_uea2_jobs(mb_mgr, (uint8_t **) &pKeySched, pIV, pDstBuff, pSrcBuff, + bitLens, bitOffsets, IMB_DIR_DECRYPT, i + 1); else - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(mb_mgr, - (const snow3g_key_schedule_t * const *) - pKeySched, - (const void * const *)pIV, - (const void * const *)pDstBuff, - (void **)pSrcBuff, packetLen, i + 1); + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY( + mb_mgr, (const snow3g_key_schedule_t *const *) pKeySched, + (const void *const *) pIV, (const void *const *) pDstBuff, + (void **) pSrcBuff, packetLen, i + 1); if (pSrcBuff[0] == NULL) { printf("N buffer failure\n"); @@ -2613,7 +2457,8 @@ validate_snow3g_f8_n_blocks_multi(struct IMB_MGR *mb_mgr, /*Compare the data in the pSrcBuff with the pDstBuff*/ if (memcmp(pSrcBuff[i], testVectors[j].msg, packetLen[i]) != 0) { printf("snow3g_f8_n_buffer equal sizes, vector:%d " - "buffer: %d\n", 0, i); + "buffer: %d\n", + 0, i); snow3g_hexdump("Actual:", pSrcBuff[i], packetLen[i]); snow3g_hexdump("Expected:", (const uint8_t *) testVectors[j].msg, packetLen[i]); @@ -2635,7 +2480,6 @@ snow3g_f8_n_buffer_multikey_exit: free(pKey[i]); if (pKeySched[i] != NULL) free(pKeySched[i]); - } if (status < 0) test_suite_update(uea2_ctx, 0, 1); @@ -2644,8 +2488,7 @@ snow3g_f8_n_buffer_multikey_exit: } static void -validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, - struct test_suite_context *uea2_ctx, +validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, struct test_suite_context *uea2_ctx, struct test_suite_context *uia2_ctx) { int numVectors = 0, i; @@ -2662,8 +2505,7 @@ validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, (void) uea2_ctx; #ifdef DEBUG - printf("Testing IMB_SNOW3G_F9_1_BUFFER: (%s):\n", - job_api ? "Job API" : "Direct API"); + printf("Testing IMB_SNOW3G_F9_1_BUFFER: (%s):\n", job_api ? "Job API" : "Direct API"); #endif /* calculate number of vectors */ @@ -2714,16 +2556,13 @@ validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, /*test the integrity for f9_user with IV*/ if (job_api) { unsigned j; - const unsigned num_jobs_tab[] = { - 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 - }; + const unsigned num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17 }; for (j = 0; j < DIM(num_jobs_tab); j++) { - int ret = submit_uia2_job(mb_mgr, (uint8_t *)pKeySched, pIV, - srcBuff, digest, - (const uint32_t) testVectors[i].msgSize, - (const uint8_t *) testVectors[i].tag, - num_jobs_tab[j]); + int ret = submit_uia2_job( + mb_mgr, (uint8_t *) pKeySched, pIV, srcBuff, digest, + (const uint32_t) testVectors[i].msgSize, + (const uint8_t *) testVectors[i].tag, num_jobs_tab[j]); if (ret < 0) { printf("IMB_SNOW3G_F9 JOB API vector num:%zu\n", testVectors[i].tcId); @@ -2732,8 +2571,7 @@ validate_snow3g_f9(struct IMB_MGR *mb_mgr, uint32_t job_api, } } else { IMB_SNOW3G_F9_1_BUFFER(mb_mgr, pKeySched, pIV, srcBuff, - testVectors[i].msgSize, - digest); + testVectors[i].msgSize, digest); /*Compare the digest with the expected in the vectors*/ if (memcmp(digest, testVectors[i].tag, IMB_SNOW3G_DIGEST_LEN) != 0) { @@ -2761,7 +2599,8 @@ snow3g_f9_1_buffer_exit: test_suite_update(uia2_ctx, 1, 0); } -static int validate_f8_iv_gen(void) +static int +validate_f8_iv_gen(void) { uint32_t i, numVectors = 0; uint8_t IV[16]; @@ -2795,8 +2634,7 @@ static int validate_f8_iv_gen(void) if (memcmp(IV, testVectors[i].iv, 16) != 0) { printf("snow3g_f8_iv_gen vector num: %zu\n", testVectors[i].tcId); snow3g_hexdump("Actual", IV, 16); - snow3g_hexdump("Expected", - (const uint8_t *)testVectors[i].iv, 16); + snow3g_hexdump("Expected", (const uint8_t *) testVectors[i].iv, 16); return 1; } } @@ -2804,7 +2642,8 @@ static int validate_f8_iv_gen(void) return 0; } -static int validate_f9_iv_gen(void) +static int +validate_f9_iv_gen(void) { uint32_t i, numVectors = 0; uint8_t IV[16]; @@ -2847,7 +2686,8 @@ static int validate_f9_iv_gen(void) return 0; } -int snow3g_test(struct IMB_MGR *mb_mgr) +int +snow3g_test(struct IMB_MGR *mb_mgr) { int errors = 0; uint32_t i; diff --git a/test/kat-app/snow3g_test_f8_vectors.json.c b/test/kat-app/snow3g_test_f8_vectors.json.c index 038b84cf..fc920e5f 100644 --- a/test/kat-app/snow3g_test_f8_vectors.json.c +++ b/test/kat-app/snow3g_test_f8_vectors.json.c @@ -29,399 +29,353 @@ /* SNOW3G_f8 */ #include "cipher_test.h" const struct cipher_test snow3g_cipher_bit_test_vectors_json[] = { - {128, 128, 1, - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x39\x8a\x59\xb4\xac\x00\x00\x00\x39\x8a\x59\xb4\xac\x00\x00\x00", - "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" - "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", - "\x5d\x5b\xfe\x75\xeb\x04\xf6\x8c\xe0\xa1\x23\x77\xea\x00\xb3\x7d\x47\xc6" - "\xa0\xba\x06\x30\x91\x55\x08\x6a\x85\x9c\x43\x41\xb3\x7c", - 1, 256}, - {128, 128, 2, - "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", - "\x72\xa4\xf2\x0f\x64\x00\x00\x00\x72\xa4\xf2\x0f\x64\x00\x00\x00", - "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" - "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" - "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" - "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" - "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" - "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", - "\x8c\xeb\xa6\x29\x43\xdc\xed\x3a\x09\x90\xb0\x6e\xa1\xb0\xa2\xc4\xfb\x3c" - "\xed\xc7\x1b\x36\x9f\x42\xba\x64\xc1\xeb\x66\x65\xe7\x2a\xa1\xc9\xbb\x0d" - "\xea\xa2\x0f\xe8\x60\x58\xb8\xba\xee\x2c\x2e\x7f\x0b\xec\xce\x48\xb5\x29" - "\x32\xa5\x3c\x9d\x5f\x93\x1a\x3a\x7c\x53\x22\x59\xaf\x43\x25\xe2\xa6\x5e" - "\x30\x84\xad\x5f\x6a\x51\x3b\x7b\xdd\xc1\xb6\x5f\x0a\xa0\xd9\x7a\x05\x3d" - "\xb5\x5a\x88\xc4\xc4\xf9\x60\x5e\x41\x40", - 1, 798}, - {128, 128, 3, - "\x5a\xcb\x1d\x64\x4c\x0d\x51\x20\x4e\xa5\xf1\x45\x10\x10\xd8\x52", - "\xfa\x55\x6b\x26\x1c\x00\x00\x00\xfa\x55\x6b\x26\x1c\x00\x00\x00", - "\xad\x9c\x44\x1f\x89\x0b\x38\xc4\x57\xa4\x9d\x42\x14\x07\xe8", - "\xba\x0f\x31\x30\x03\x34\xc5\x6b\x52\xa7\x49\x7c\xba\xc0\x46", 1, 120}, - {128, 128, 4, - "\xef\xa8\xb2\x22\x9e\x72\x0c\x2a\x7c\x36\xea\x55\xe9\x60\x56\x95", - "\xe2\x8b\xcf\x7b\xc0\x00\x00\x00\xe2\x8b\xcf\x7b\xc0\x00\x00\x00", - "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27" - "\xb5\x99\xb6\xb1\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49" - "\x46\x24\xfb\x50\x36\x7f\xa3\x6c\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37" - "\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", - "\xe0\xda\x15\xca\x8e\x25\x54\xf5\xe5\x6c\x94\x68\xdc\x6c\x7c\x12\x9c\x56" - "\x8a\xa5\x03\x23\x17\xe0\x4e\x07\x29\x64\x6c\xab\xef\xa6\x89\x86\x4c\x41" - "\x0f\x24\xf9\x19\xe6\x1e\x3d\xfd\xfa\xd7\x7e\x56\x0d\xb0\xa9\xcd\x36\xc3" - "\x4a\xe4\x18\x14\x90\xb2\x9f\x5f\xa2\xfc", - 1, 510}, - {128, 128, 5, - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x39\x8a\x59\xb4\x2c\x00\x00\x00\x39\x8a\x59\xb4\x2c\x00\x00\x00", - "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" - "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", - "\x98\x9b\x71\x9c\xdc\x33\xce\xb7\xcf\x27\x6a\x52\x82\x7c\xef\x94\xa5\x6c" - "\x40\xc0\xab\x9d\x81\xf7\xa2\xa9\xba\xc6\x0e\x11\xc4\xb0", - 1, 253}, - {128, 128, 6, - "\x60\x90\xea\xe0\x4c\x83\x70\x6e\xec\xbf\x65\x2b\xe8\xe3\x65\x66", - "\x72\xa4\xf2\x0f\x48\x00\x00\x00\x72\xa4\xf2\x0f\x48\x00\x00\x00", - "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" - "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" - "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" - "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" - "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" - "\x44\x54\x31\x87\x45\xe3\x98\x76\x45\x98\x7a\x98\x6f\x2c\xb0", - "\x58\x92\xbb\xa8\x8b\xbb\xca\xae\xae\x76\x9a\xa0\x6b\x68\x3d\x3a\x17\xcc" - "\x04\xa3\x69\x88\x16\x97\x43\x5e\x44\xfe\xd5\xff\x9a\xf5\x7b\x9e\x89\x0d" - "\x4d\x5c\x64\x70\x98\x85\xd4\x8a\xe4\x06\x90\xec\x04\x3b\xaa\xe9\x70\x57" - "\x96\xe4\xa9\xff\x5a\x4b\x8d\x8b\x36\xd7\xf3\xfe\x57\xcc\x6c\xfd\x6c\xd0" - "\x05\xcd\x38\x52\xa8\x5e\x94\xce\x6b\xcd\x90\xd0\xd0\x78\x39\xce\x09\x73" - "\x35\x44\xca\x8e\x35\x08\x43\x24\x85\x50\x92\x2a\xc1\x28\x18", - 1, 837}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 128, 128, 1, "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xac\x00\x00\x00\x39\x8a\x59\xb4\xac\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", + "\x5d\x5b\xfe\x75\xeb\x04\xf6\x8c\xe0\xa1\x23\x77\xea\x00\xb3\x7d\x47\xc6" + "\xa0\xba\x06\x30\x91\x55\x08\x6a\x85\x9c\x43\x41\xb3\x7c", + 1, 256 }, + { 128, 128, 2, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" + "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" + "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" + "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" + "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" + "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\x8c\xeb\xa6\x29\x43\xdc\xed\x3a\x09\x90\xb0\x6e\xa1\xb0\xa2\xc4\xfb\x3c" + "\xed\xc7\x1b\x36\x9f\x42\xba\x64\xc1\xeb\x66\x65\xe7\x2a\xa1\xc9\xbb\x0d" + "\xea\xa2\x0f\xe8\x60\x58\xb8\xba\xee\x2c\x2e\x7f\x0b\xec\xce\x48\xb5\x29" + "\x32\xa5\x3c\x9d\x5f\x93\x1a\x3a\x7c\x53\x22\x59\xaf\x43\x25\xe2\xa6\x5e" + "\x30\x84\xad\x5f\x6a\x51\x3b\x7b\xdd\xc1\xb6\x5f\x0a\xa0\xd9\x7a\x05\x3d" + "\xb5\x5a\x88\xc4\xc4\xf9\x60\x5e\x41\x40", + 1, 798 }, + { 128, 128, 3, "\x5a\xcb\x1d\x64\x4c\x0d\x51\x20\x4e\xa5\xf1\x45\x10\x10\xd8\x52", + "\xfa\x55\x6b\x26\x1c\x00\x00\x00\xfa\x55\x6b\x26\x1c\x00\x00\x00", + "\xad\x9c\x44\x1f\x89\x0b\x38\xc4\x57\xa4\x9d\x42\x14\x07\xe8", + "\xba\x0f\x31\x30\x03\x34\xc5\x6b\x52\xa7\x49\x7c\xba\xc0\x46", 1, 120 }, + { 128, 128, 4, "\xef\xa8\xb2\x22\x9e\x72\x0c\x2a\x7c\x36\xea\x55\xe9\x60\x56\x95", + "\xe2\x8b\xcf\x7b\xc0\x00\x00\x00\xe2\x8b\xcf\x7b\xc0\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27" + "\xb5\x99\xb6\xb1\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49" + "\x46\x24\xfb\x50\x36\x7f\xa3\x6c\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37" + "\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xe0\xda\x15\xca\x8e\x25\x54\xf5\xe5\x6c\x94\x68\xdc\x6c\x7c\x12\x9c\x56" + "\x8a\xa5\x03\x23\x17\xe0\x4e\x07\x29\x64\x6c\xab\xef\xa6\x89\x86\x4c\x41" + "\x0f\x24\xf9\x19\xe6\x1e\x3d\xfd\xfa\xd7\x7e\x56\x0d\xb0\xa9\xcd\x36\xc3" + "\x4a\xe4\x18\x14\x90\xb2\x9f\x5f\xa2\xfc", + 1, 510 }, + { 128, 128, 5, "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\x2c\x00\x00\x00\x39\x8a\x59\xb4\x2c\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", + "\x98\x9b\x71\x9c\xdc\x33\xce\xb7\xcf\x27\x6a\x52\x82\x7c\xef\x94\xa5\x6c" + "\x40\xc0\xab\x9d\x81\xf7\xa2\xa9\xba\xc6\x0e\x11\xc4\xb0", + 1, 253 }, + { 128, 128, 6, "\x60\x90\xea\xe0\x4c\x83\x70\x6e\xec\xbf\x65\x2b\xe8\xe3\x65\x66", + "\x72\xa4\xf2\x0f\x48\x00\x00\x00\x72\xa4\xf2\x0f\x48\x00\x00\x00", + "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" + "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" + "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" + "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" + "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" + "\x44\x54\x31\x87\x45\xe3\x98\x76\x45\x98\x7a\x98\x6f\x2c\xb0", + "\x58\x92\xbb\xa8\x8b\xbb\xca\xae\xae\x76\x9a\xa0\x6b\x68\x3d\x3a\x17\xcc" + "\x04\xa3\x69\x88\x16\x97\x43\x5e\x44\xfe\xd5\xff\x9a\xf5\x7b\x9e\x89\x0d" + "\x4d\x5c\x64\x70\x98\x85\xd4\x8a\xe4\x06\x90\xec\x04\x3b\xaa\xe9\x70\x57" + "\x96\xe4\xa9\xff\x5a\x4b\x8d\x8b\x36\xd7\xf3\xfe\x57\xcc\x6c\xfd\x6c\xd0" + "\x05\xcd\x38\x52\xa8\x5e\x94\xce\x6b\xcd\x90\xd0\xd0\x78\x39\xce\x09\x73" + "\x35\x44\xca\x8e\x35\x08\x43\x24\x85\x50\x92\x2a\xc1\x28\x18", + 1, 837 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; const struct cipher_test snow3g_cipher_linear_test_vectors_json[] = { - {128, 128, 1, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xea\xe9\x11\x49\x21\x58\x44\x59\xc6\xec\x77\x82\x71\x6f\x91\xd4\xe1\xf6" - "\xbf\xfa\x45\xfc\x80\x94\xc2\x3d\x5c\x5f\x17\x72\x44\x92", - 1, 256}, - {128, 128, 2, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x01\x1c\x00\x00\x00\x00\x00\x00\x01\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe3\x96\x7f\x63\x88\x74\x2d\x7c\x3b\x3d\x5a\x08\xc0\x8d\x1a\xc2\xa1\xf2" - "\x38\x96\xc7\x41\x1b\xc1\xde\xac\x24\x57\x9c\x45\x0d\xb0", - 1, 256}, - {128, 128, 3, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x02\x1c\x00\x00\x00\x00\x00\x00\x02\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x4d\x50\xd2\xe3\xa6\xe7\x97\xee\xf3\xe6\x2a\x32\xf3\x66\xea\x99\xbc\x54" - "\x24\xa6\x3f\xc3\xbb\x27\xc7\xba\x42\xd8\x2f\x86\xfc\xdf", - 1, 256}, - {128, 128, 4, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x00\x03\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x4a\x98\xa3\x04\xad\xcf\xb9\xfa\xdb\x3b\xe7\x7c\xd1\x69\x59\x6c\x7e\x44" - "\x73\x8d\x96\xd0\x51\x1f\x55\x32\x55\x59\xc2\xe9\x0a\x21", - 1, 256}, - {128, 128, 5, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x04\x1c\x00\x00\x00\x00\x00\x00\x04\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe4\xf5\x71\x42\xaf\x93\x5e\x6d\x7d\xb8\x44\xf7\xcb\x0d\x08\xd3\x3a\xe6" - "\x20\xcd\xc5\x33\xa3\x5a\x5e\x5a\x41\x92\x96\x44\x28\xc1", - 1, 256}, - {128, 128, 6, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x05\x1c\x00\x00\x00\x00\x00\x00\x05\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x1b\x6e\x3a\x76\x18\x77\x0b\x77\xf2\xda\xca\x1d\xd2\x9c\xa9\xc2\x10\x6b" - "\xe7\x4b\xdb\x30\x79\xc5\x56\xf4\xcb\xb7\x19\xdf\xe5\xcb", - 1, 256}, - {128, 128, 7, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x06\x1c\x00\x00\x00\x00\x00\x00\x06\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x10\x4e\x19\x91\x09\x91\xd0\x9d\x41\x99\x33\x1b\xfd\xa0\xe0\xf7\x80\x6c" - "\x1f\x7b\x12\x78\x3d\x46\x65\x86\x7e\xdf\x9f\xac\x31\x42", - 1, 256}, - {128, 128, 8, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x07\x1c\x00\x00\x00\x00\x00\x00\x07\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x59\x02\x9f\xe6\x98\x24\xe3\xc5\x1b\x19\x61\x08\x37\x79\xd0\xfe\xe4\xa1" - "\xd8\xd4\x04\xf2\x43\x60\xa4\x68\x08\x9b\x06\x9c\xb3\x51", - 1, 256}, - {128, 128, 9, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x08\x1c\x00\x00\x00\x00\x00\x00\x08\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x60\x59\x72\x8f\xd0\x0b\x69\x67\xdf\x89\xb0\xd1\xc3\x02\x3e\xe4\x5b\xde" - "\xe2\x0a\xea\x67\xc6\x05\x40\x4f\xe9\x38\xd4\x10\x1d\x5a", - 1, 256}, - {128, 128, 10, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x09\x1c\x00\x00\x00\x00\x00\x00\x09\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x46\x63\x8d\x94\x5a\xcc\x87\x2d\x57\x4f\xcb\x55\x71\xaa\x6c\x17\xcb\x7c" - "\x7a\x6d\x19\xbf\xba\xcd\xe1\x3c\x77\xed\x0f\x10\x4f\x38", - 1, 256}, - {128, 128, 11, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x00\x0a\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe5\xdd\xa1\x58\xbe\x47\x6e\xa6\x3b\xea\x90\x02\xf6\x87\xbd\x69\x1b\x15" - "\xb7\x3c\x6f\xa1\x28\xde\x0f\xf3\x80\xfb\xef\x89\xa5\xd5", - 1, 256}, - {128, 128, 12, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0b\x1c\x00\x00\x00\x00\x00\x00\x0b\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xae\x68\x9e\x4e\x8d\x49\x2a\x59\x5c\x02\x53\x73\x91\xb2\x92\x94\xc3\x7e" - "\x09\xae\xe3\x6d\x3c\xea\xac\x57\x34\x19\x82\x56\x10\x2e", - 1, 256}, - {128, 128, 13, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0c\x1c\x00\x00\x00\x00\x00\x00\x0c\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xd4\x35\x4b\x73\x1b\x6e\xa3\x4c\xd5\x9b\x10\xd0\x93\x64\xc9\xdf\xe0\xe5" - "\x2e\xa0\x8c\x2d\x85\x38\x53\xaa\x79\x92\xad\xae\x36\xb3", - 1, 256}, - {128, 128, 14, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0d\x1c\x00\x00\x00\x00\x00\x00\x0d\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xdb\x9b\x66\x28\xf7\x9d\x37\x32\xbe\x36\x78\x8d\xa3\xd0\xc2\x73\x68\x0d" - "\x47\xf7\x13\x8f\x3d\x83\x2a\xcf\x5e\xe1\xb8\x6d\x86\xb8", - 1, 256}, - {128, 128, 15, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" - "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", - 1, 256}, - {128, 128, 16, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", "", - "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" - "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", - 1, 0}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 128, 128, 1, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xea\xe9\x11\x49\x21\x58\x44\x59\xc6\xec\x77\x82\x71\x6f\x91\xd4\xe1\xf6" + "\xbf\xfa\x45\xfc\x80\x94\xc2\x3d\x5c\x5f\x17\x72\x44\x92", + 1, 256 }, + { 128, 128, 2, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x01\x1c\x00\x00\x00\x00\x00\x00\x01\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x96\x7f\x63\x88\x74\x2d\x7c\x3b\x3d\x5a\x08\xc0\x8d\x1a\xc2\xa1\xf2" + "\x38\x96\xc7\x41\x1b\xc1\xde\xac\x24\x57\x9c\x45\x0d\xb0", + 1, 256 }, + { 128, 128, 3, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x02\x1c\x00\x00\x00\x00\x00\x00\x02\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4d\x50\xd2\xe3\xa6\xe7\x97\xee\xf3\xe6\x2a\x32\xf3\x66\xea\x99\xbc\x54" + "\x24\xa6\x3f\xc3\xbb\x27\xc7\xba\x42\xd8\x2f\x86\xfc\xdf", + 1, 256 }, + { 128, 128, 4, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x00\x03\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4a\x98\xa3\x04\xad\xcf\xb9\xfa\xdb\x3b\xe7\x7c\xd1\x69\x59\x6c\x7e\x44" + "\x73\x8d\x96\xd0\x51\x1f\x55\x32\x55\x59\xc2\xe9\x0a\x21", + 1, 256 }, + { 128, 128, 5, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x04\x1c\x00\x00\x00\x00\x00\x00\x04\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe4\xf5\x71\x42\xaf\x93\x5e\x6d\x7d\xb8\x44\xf7\xcb\x0d\x08\xd3\x3a\xe6" + "\x20\xcd\xc5\x33\xa3\x5a\x5e\x5a\x41\x92\x96\x44\x28\xc1", + 1, 256 }, + { 128, 128, 6, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x05\x1c\x00\x00\x00\x00\x00\x00\x05\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x1b\x6e\x3a\x76\x18\x77\x0b\x77\xf2\xda\xca\x1d\xd2\x9c\xa9\xc2\x10\x6b" + "\xe7\x4b\xdb\x30\x79\xc5\x56\xf4\xcb\xb7\x19\xdf\xe5\xcb", + 1, 256 }, + { 128, 128, 7, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x06\x1c\x00\x00\x00\x00\x00\x00\x06\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x10\x4e\x19\x91\x09\x91\xd0\x9d\x41\x99\x33\x1b\xfd\xa0\xe0\xf7\x80\x6c" + "\x1f\x7b\x12\x78\x3d\x46\x65\x86\x7e\xdf\x9f\xac\x31\x42", + 1, 256 }, + { 128, 128, 8, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x07\x1c\x00\x00\x00\x00\x00\x00\x07\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x59\x02\x9f\xe6\x98\x24\xe3\xc5\x1b\x19\x61\x08\x37\x79\xd0\xfe\xe4\xa1" + "\xd8\xd4\x04\xf2\x43\x60\xa4\x68\x08\x9b\x06\x9c\xb3\x51", + 1, 256 }, + { 128, 128, 9, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x08\x1c\x00\x00\x00\x00\x00\x00\x08\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x60\x59\x72\x8f\xd0\x0b\x69\x67\xdf\x89\xb0\xd1\xc3\x02\x3e\xe4\x5b\xde" + "\xe2\x0a\xea\x67\xc6\x05\x40\x4f\xe9\x38\xd4\x10\x1d\x5a", + 1, 256 }, + { 128, 128, 10, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x09\x1c\x00\x00\x00\x00\x00\x00\x09\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x46\x63\x8d\x94\x5a\xcc\x87\x2d\x57\x4f\xcb\x55\x71\xaa\x6c\x17\xcb\x7c" + "\x7a\x6d\x19\xbf\xba\xcd\xe1\x3c\x77\xed\x0f\x10\x4f\x38", + 1, 256 }, + { 128, 128, 11, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x00\x0a\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe5\xdd\xa1\x58\xbe\x47\x6e\xa6\x3b\xea\x90\x02\xf6\x87\xbd\x69\x1b\x15" + "\xb7\x3c\x6f\xa1\x28\xde\x0f\xf3\x80\xfb\xef\x89\xa5\xd5", + 1, 256 }, + { 128, 128, 12, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0b\x1c\x00\x00\x00\x00\x00\x00\x0b\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xae\x68\x9e\x4e\x8d\x49\x2a\x59\x5c\x02\x53\x73\x91\xb2\x92\x94\xc3\x7e" + "\x09\xae\xe3\x6d\x3c\xea\xac\x57\x34\x19\x82\x56\x10\x2e", + 1, 256 }, + { 128, 128, 13, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0c\x1c\x00\x00\x00\x00\x00\x00\x0c\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd4\x35\x4b\x73\x1b\x6e\xa3\x4c\xd5\x9b\x10\xd0\x93\x64\xc9\xdf\xe0\xe5" + "\x2e\xa0\x8c\x2d\x85\x38\x53\xaa\x79\x92\xad\xae\x36\xb3", + 1, 256 }, + { 128, 128, 14, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0d\x1c\x00\x00\x00\x00\x00\x00\x0d\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xdb\x9b\x66\x28\xf7\x9d\x37\x32\xbe\x36\x78\x8d\xa3\xd0\xc2\x73\x68\x0d" + "\x47\xf7\x13\x8f\x3d\x83\x2a\xcf\x5e\xe1\xb8\x6d\x86\xb8", + 1, 256 }, + { 128, 128, 15, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" + "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", + 1, 256 }, + { 128, 128, 16, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", "", + "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" + "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", + 1, 0 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; const struct cipher_test snow3g_cipher_test_vectors_json[] = { - {128, 128, 1, - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x39\x8a\x59\xb4\xac\x00\x00\x00\x39\x8a\x59\xb4\xac\x00\x00\x00", - "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" - "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", - "\x5d\x5b\xfe\x75\xeb\x04\xf6\x8c\xe0\xa1\x23\x77\xea\x00\xb3\x7d\x47\xc6" - "\xa0\xba\x06\x30\x91\x55\x08\x6a\x85\x9c\x43\x41\xb3\x7c", - 1, 256}, - {128, 128, 2, - "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", - "\x72\xa4\xf2\x0f\x64\x00\x00\x00\x72\xa4\xf2\x0f\x64\x00\x00\x00", - "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" - "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" - "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" - "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" - "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" - "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48", - "\x8c\xeb\xa6\x29\x43\xdc\xed\x3a\x09\x90\xb0\x6e\xa1\xb0\xa2\xc4\xfb\x3c" - "\xed\xc7\x1b\x36\x9f\x42\xba\x64\xc1\xeb\x66\x65\xe7\x2a\xa1\xc9\xbb\x0d" - "\xea\xa2\x0f\xe8\x60\x58\xb8\xba\xee\x2c\x2e\x7f\x0b\xec\xce\x48\xb5\x29" - "\x32\xa5\x3c\x9d\x5f\x93\x1a\x3a\x7c\x53\x22\x59\xaf\x43\x25\xe2\xa6\x5e" - "\x30\x84\xad\x5f\x6a\x51\x3b\x7b\xdd\xc1\xb6\x5f\x0a\xa0\xd9\x7a\x05\x3d" - "\xb5\x5a\x88\xc4\xc4\xf9\x60\x5e\x41", - 1, 792}, - {128, 128, 3, - "\x5a\xcb\x1d\x64\x4c\x0d\x51\x20\x4e\xa5\xf1\x45\x10\x10\xd8\x52", - "\xfa\x55\x6b\x26\x1c\x00\x00\x00\xfa\x55\x6b\x26\x1c\x00\x00\x00", - "\xad\x9c\x44\x1f\x89\x0b\x38\xc4\x57\xa4\x9d\x42\x14\x07\xe8", - "\xba\x0f\x31\x30\x03\x34\xc5\x6b\x52\xa7\x49\x7c\xba\xc0\x46", 1, 120}, - {128, 128, 4, - "\xef\xa8\xb2\x22\x9e\x72\x0c\x2a\x7c\x36\xea\x55\xe9\x60\x56\x95", - "\xe2\x8b\xcf\x7b\xc0\x00\x00\x00\xe2\x8b\xcf\x7b\xc0\x00\x00\x00", - "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27" - "\xb5\x99\xb6\xb1\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49" - "\x46\x24\xfb\x50\x36\x7f\xa3\x6c\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37" - "\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69", - "\xe0\xda\x15\xca\x8e\x25\x54\xf5\xe5\x6c\x94\x68\xdc\x6c\x7c\x12\x9c\x56" - "\x8a\xa5\x03\x23\x17\xe0\x4e\x07\x29\x64\x6c\xab\xef\xa6\x89\x86\x4c\x41" - "\x0f\x24\xf9\x19\xe6\x1e\x3d\xfd\xfa\xd7\x7e\x56\x0d\xb0\xa9\xcd\x36\xc3" - "\x4a\xe4\x18\x14\x90\xb2\x9f\x5f\xa2", - 1, 504}, - {128, 128, 5, - "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", - "\x39\x8a\x59\xb4\x2c\x00\x00\x00\x39\x8a\x59\xb4\x2c\x00\x00\x00", - "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" - "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1", - "\x98\x9b\x71\x9c\xdc\x33\xce\xb7\xcf\x27\x6a\x52\x82\x7c\xef\x94\xa5\x6c" - "\x40\xc0\xab\x9d\x81\xf7\xa2\xa9\xba\xc6\x0e\x11\xc4\xb6", - 1, 248}, - {128, 128, 6, - "\x60\x90\xea\xe0\x4c\x83\x70\x6e\xec\xbf\x65\x2b\xe8\xe3\x65\x66", - "\x72\xa4\xf2\x0f\x48\x00\x00\x00\x72\xa4\xf2\x0f\x48\x00\x00\x00", - "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" - "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" - "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" - "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" - "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" - "\x44\x54\x31\x87\x45\xe3\x98\x76\x45\x98\x7a\x98\x6f\x2c", - "\x58\x92\xbb\xa8\x8b\xbb\xca\xae\xae\x76\x9a\xa0\x6b\x68\x3d\x3a\x17\xcc" - "\x04\xa3\x69\x88\x16\x97\x43\x5e\x44\xfe\xd5\xff\x9a\xf5\x7b\x9e\x89\x0d" - "\x4d\x5c\x64\x70\x98\x85\xd4\x8a\xe4\x06\x90\xec\x04\x3b\xaa\xe9\x70\x57" - "\x96\xe4\xa9\xff\x5a\x4b\x8d\x8b\x36\xd7\xf3\xfe\x57\xcc\x6c\xfd\x6c\xd0" - "\x05\xcd\x38\x52\xa8\x5e\x94\xce\x6b\xcd\x90\xd0\xd0\x78\x39\xce\x09\x73" - "\x35\x44\xca\x8e\x35\x08\x43\x24\x85\x50\x92\x2a\xc1\x28", - 1, 832}, - {128, 128, 7, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xea\xe9\x11\x49\x21\x58\x44\x59\xc6\xec\x77\x82\x71\x6f\x91\xd4\xe1\xf6" - "\xbf\xfa\x45\xfc\x80\x94\xc2\x3d\x5c\x5f\x17\x72\x44\x92", - 1, 256}, - {128, 128, 8, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x01\x1c\x00\x00\x00\x00\x00\x00\x01\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe3\x96\x7f\x63\x88\x74\x2d\x7c\x3b\x3d\x5a\x08\xc0\x8d\x1a\xc2\xa1\xf2" - "\x38\x96\xc7\x41\x1b\xc1\xde\xac\x24\x57\x9c\x45\x0d\xb0", - 1, 256}, - {128, 128, 9, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x02\x1c\x00\x00\x00\x00\x00\x00\x02\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x4d\x50\xd2\xe3\xa6\xe7\x97\xee\xf3\xe6\x2a\x32\xf3\x66\xea\x99\xbc\x54" - "\x24\xa6\x3f\xc3\xbb\x27\xc7\xba\x42\xd8\x2f\x86\xfc\xdf", - 1, 256}, - {128, 128, 10, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x00\x03\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x4a\x98\xa3\x04\xad\xcf\xb9\xfa\xdb\x3b\xe7\x7c\xd1\x69\x59\x6c\x7e\x44" - "\x73\x8d\x96\xd0\x51\x1f\x55\x32\x55\x59\xc2\xe9\x0a\x21", - 1, 256}, - {128, 128, 11, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x04\x1c\x00\x00\x00\x00\x00\x00\x04\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe4\xf5\x71\x42\xaf\x93\x5e\x6d\x7d\xb8\x44\xf7\xcb\x0d\x08\xd3\x3a\xe6" - "\x20\xcd\xc5\x33\xa3\x5a\x5e\x5a\x41\x92\x96\x44\x28\xc1", - 1, 256}, - {128, 128, 12, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x05\x1c\x00\x00\x00\x00\x00\x00\x05\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x1b\x6e\x3a\x76\x18\x77\x0b\x77\xf2\xda\xca\x1d\xd2\x9c\xa9\xc2\x10\x6b" - "\xe7\x4b\xdb\x30\x79\xc5\x56\xf4\xcb\xb7\x19\xdf\xe5\xcb", - 1, 256}, - {128, 128, 13, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x06\x1c\x00\x00\x00\x00\x00\x00\x06\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x10\x4e\x19\x91\x09\x91\xd0\x9d\x41\x99\x33\x1b\xfd\xa0\xe0\xf7\x80\x6c" - "\x1f\x7b\x12\x78\x3d\x46\x65\x86\x7e\xdf\x9f\xac\x31\x42", - 1, 256}, - {128, 128, 14, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x07\x1c\x00\x00\x00\x00\x00\x00\x07\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x59\x02\x9f\xe6\x98\x24\xe3\xc5\x1b\x19\x61\x08\x37\x79\xd0\xfe\xe4\xa1" - "\xd8\xd4\x04\xf2\x43\x60\xa4\x68\x08\x9b\x06\x9c\xb3\x51", - 1, 256}, - {128, 128, 15, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x08\x1c\x00\x00\x00\x00\x00\x00\x08\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x60\x59\x72\x8f\xd0\x0b\x69\x67\xdf\x89\xb0\xd1\xc3\x02\x3e\xe4\x5b\xde" - "\xe2\x0a\xea\x67\xc6\x05\x40\x4f\xe9\x38\xd4\x10\x1d\x5a", - 1, 256}, - {128, 128, 16, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x09\x1c\x00\x00\x00\x00\x00\x00\x09\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x46\x63\x8d\x94\x5a\xcc\x87\x2d\x57\x4f\xcb\x55\x71\xaa\x6c\x17\xcb\x7c" - "\x7a\x6d\x19\xbf\xba\xcd\xe1\x3c\x77\xed\x0f\x10\x4f\x38", - 1, 256}, - {128, 128, 17, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x00\x0a\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xe5\xdd\xa1\x58\xbe\x47\x6e\xa6\x3b\xea\x90\x02\xf6\x87\xbd\x69\x1b\x15" - "\xb7\x3c\x6f\xa1\x28\xde\x0f\xf3\x80\xfb\xef\x89\xa5\xd5", - 1, 256}, - {128, 128, 18, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0b\x1c\x00\x00\x00\x00\x00\x00\x0b\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xae\x68\x9e\x4e\x8d\x49\x2a\x59\x5c\x02\x53\x73\x91\xb2\x92\x94\xc3\x7e" - "\x09\xae\xe3\x6d\x3c\xea\xac\x57\x34\x19\x82\x56\x10\x2e", - 1, 256}, - {128, 128, 19, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0c\x1c\x00\x00\x00\x00\x00\x00\x0c\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xd4\x35\x4b\x73\x1b\x6e\xa3\x4c\xd5\x9b\x10\xd0\x93\x64\xc9\xdf\xe0\xe5" - "\x2e\xa0\x8c\x2d\x85\x38\x53\xaa\x79\x92\xad\xae\x36\xb3", - 1, 256}, - {128, 128, 20, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0d\x1c\x00\x00\x00\x00\x00\x00\x0d\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xdb\x9b\x66\x28\xf7\x9d\x37\x32\xbe\x36\x78\x8d\xa3\xd0\xc2\x73\x68\x0d" - "\x47\xf7\x13\x8f\x3d\x83\x2a\xcf\x5e\xe1\xb8\x6d\x86\xb8", - 1, 256}, - {128, 128, 21, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" - "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", - 1, 256}, - {128, 128, 22, - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x00\x00\x00\x0f\x1c\x00\x00\x00\x00\x00\x00\x0f\x1c\x00\x00\x00", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x62\x45\xff\xfa\x89\x47\x18\x63\x28\x4e\xd5\xf2\x94\xb0\x54\x43\xd5\xae" - "\xb5\x68\x2f\xf6\x7c\x81\xe3\xc5\x81\x32\x0e\x59\xc5\x60", - 1, 256}, - {0, 0, 0, NULL, NULL, NULL, NULL, 0, 0} + { 128, 128, 1, "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\xac\x00\x00\x00\x39\x8a\x59\xb4\xac\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf0", + "\x5d\x5b\xfe\x75\xeb\x04\xf6\x8c\xe0\xa1\x23\x77\xea\x00\xb3\x7d\x47\xc6" + "\xa0\xba\x06\x30\x91\x55\x08\x6a\x85\x9c\x43\x41\xb3\x7c", + 1, 256 }, + { 128, 128, 2, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6" + "\xca\x76\xeb\x54\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45" + "\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31" + "\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7\xbd\xfd\x39\xbe\xf4\xb2" + "\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19\x39\x01" + "\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48", + "\x8c\xeb\xa6\x29\x43\xdc\xed\x3a\x09\x90\xb0\x6e\xa1\xb0\xa2\xc4\xfb\x3c" + "\xed\xc7\x1b\x36\x9f\x42\xba\x64\xc1\xeb\x66\x65\xe7\x2a\xa1\xc9\xbb\x0d" + "\xea\xa2\x0f\xe8\x60\x58\xb8\xba\xee\x2c\x2e\x7f\x0b\xec\xce\x48\xb5\x29" + "\x32\xa5\x3c\x9d\x5f\x93\x1a\x3a\x7c\x53\x22\x59\xaf\x43\x25\xe2\xa6\x5e" + "\x30\x84\xad\x5f\x6a\x51\x3b\x7b\xdd\xc1\xb6\x5f\x0a\xa0\xd9\x7a\x05\x3d" + "\xb5\x5a\x88\xc4\xc4\xf9\x60\x5e\x41", + 1, 792 }, + { 128, 128, 3, "\x5a\xcb\x1d\x64\x4c\x0d\x51\x20\x4e\xa5\xf1\x45\x10\x10\xd8\x52", + "\xfa\x55\x6b\x26\x1c\x00\x00\x00\xfa\x55\x6b\x26\x1c\x00\x00\x00", + "\xad\x9c\x44\x1f\x89\x0b\x38\xc4\x57\xa4\x9d\x42\x14\x07\xe8", + "\xba\x0f\x31\x30\x03\x34\xc5\x6b\x52\xa7\x49\x7c\xba\xc0\x46", 1, 120 }, + { 128, 128, 4, "\xef\xa8\xb2\x22\x9e\x72\x0c\x2a\x7c\x36\xea\x55\xe9\x60\x56\x95", + "\xe2\x8b\xcf\x7b\xc0\x00\x00\x00\xe2\x8b\xcf\x7b\xc0\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27" + "\xb5\x99\xb6\xb1\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49" + "\x46\x24\xfb\x50\x36\x7f\xa3\x6c\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37" + "\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69", + "\xe0\xda\x15\xca\x8e\x25\x54\xf5\xe5\x6c\x94\x68\xdc\x6c\x7c\x12\x9c\x56" + "\x8a\xa5\x03\x23\x17\xe0\x4e\x07\x29\x64\x6c\xab\xef\xa6\x89\x86\x4c\x41" + "\x0f\x24\xf9\x19\xe6\x1e\x3d\xfd\xfa\xd7\x7e\x56\x0d\xb0\xa9\xcd\x36\xc3" + "\x4a\xe4\x18\x14\x90\xb2\x9f\x5f\xa2", + 1, 504 }, + { 128, 128, 5, "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\x2c\x00\x00\x00\x39\x8a\x59\xb4\x2c\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3" + "\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1", + "\x98\x9b\x71\x9c\xdc\x33\xce\xb7\xcf\x27\x6a\x52\x82\x7c\xef\x94\xa5\x6c" + "\x40\xc0\xab\x9d\x81\xf7\xa2\xa9\xba\xc6\x0e\x11\xc4\xb6", + 1, 248 }, + { 128, 128, 6, "\x60\x90\xea\xe0\x4c\x83\x70\x6e\xec\xbf\x65\x2b\xe8\xe3\x65\x66", + "\x72\xa4\xf2\x0f\x48\x00\x00\x00\x72\xa4\xf2\x0f\x48\x00\x00\x00", + "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09" + "\x9f\x7a\xb0\xf5\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47" + "\x20\x29\xb7\x1d\x36\xbd\x1a\x3d\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4" + "\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c\xe3\x3e\x2c\xcc\xbf\xc6" + "\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31\xc1\x9e" + "\x44\x54\x31\x87\x45\xe3\x98\x76\x45\x98\x7a\x98\x6f\x2c", + "\x58\x92\xbb\xa8\x8b\xbb\xca\xae\xae\x76\x9a\xa0\x6b\x68\x3d\x3a\x17\xcc" + "\x04\xa3\x69\x88\x16\x97\x43\x5e\x44\xfe\xd5\xff\x9a\xf5\x7b\x9e\x89\x0d" + "\x4d\x5c\x64\x70\x98\x85\xd4\x8a\xe4\x06\x90\xec\x04\x3b\xaa\xe9\x70\x57" + "\x96\xe4\xa9\xff\x5a\x4b\x8d\x8b\x36\xd7\xf3\xfe\x57\xcc\x6c\xfd\x6c\xd0" + "\x05\xcd\x38\x52\xa8\x5e\x94\xce\x6b\xcd\x90\xd0\xd0\x78\x39\xce\x09\x73" + "\x35\x44\xca\x8e\x35\x08\x43\x24\x85\x50\x92\x2a\xc1\x28", + 1, 832 }, + { 128, 128, 7, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xea\xe9\x11\x49\x21\x58\x44\x59\xc6\xec\x77\x82\x71\x6f\x91\xd4\xe1\xf6" + "\xbf\xfa\x45\xfc\x80\x94\xc2\x3d\x5c\x5f\x17\x72\x44\x92", + 1, 256 }, + { 128, 128, 8, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x01\x1c\x00\x00\x00\x00\x00\x00\x01\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe3\x96\x7f\x63\x88\x74\x2d\x7c\x3b\x3d\x5a\x08\xc0\x8d\x1a\xc2\xa1\xf2" + "\x38\x96\xc7\x41\x1b\xc1\xde\xac\x24\x57\x9c\x45\x0d\xb0", + 1, 256 }, + { 128, 128, 9, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x02\x1c\x00\x00\x00\x00\x00\x00\x02\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4d\x50\xd2\xe3\xa6\xe7\x97\xee\xf3\xe6\x2a\x32\xf3\x66\xea\x99\xbc\x54" + "\x24\xa6\x3f\xc3\xbb\x27\xc7\xba\x42\xd8\x2f\x86\xfc\xdf", + 1, 256 }, + { 128, 128, 10, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x00\x03\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x4a\x98\xa3\x04\xad\xcf\xb9\xfa\xdb\x3b\xe7\x7c\xd1\x69\x59\x6c\x7e\x44" + "\x73\x8d\x96\xd0\x51\x1f\x55\x32\x55\x59\xc2\xe9\x0a\x21", + 1, 256 }, + { 128, 128, 11, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x04\x1c\x00\x00\x00\x00\x00\x00\x04\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe4\xf5\x71\x42\xaf\x93\x5e\x6d\x7d\xb8\x44\xf7\xcb\x0d\x08\xd3\x3a\xe6" + "\x20\xcd\xc5\x33\xa3\x5a\x5e\x5a\x41\x92\x96\x44\x28\xc1", + 1, 256 }, + { 128, 128, 12, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x05\x1c\x00\x00\x00\x00\x00\x00\x05\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x1b\x6e\x3a\x76\x18\x77\x0b\x77\xf2\xda\xca\x1d\xd2\x9c\xa9\xc2\x10\x6b" + "\xe7\x4b\xdb\x30\x79\xc5\x56\xf4\xcb\xb7\x19\xdf\xe5\xcb", + 1, 256 }, + { 128, 128, 13, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x06\x1c\x00\x00\x00\x00\x00\x00\x06\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x10\x4e\x19\x91\x09\x91\xd0\x9d\x41\x99\x33\x1b\xfd\xa0\xe0\xf7\x80\x6c" + "\x1f\x7b\x12\x78\x3d\x46\x65\x86\x7e\xdf\x9f\xac\x31\x42", + 1, 256 }, + { 128, 128, 14, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x07\x1c\x00\x00\x00\x00\x00\x00\x07\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x59\x02\x9f\xe6\x98\x24\xe3\xc5\x1b\x19\x61\x08\x37\x79\xd0\xfe\xe4\xa1" + "\xd8\xd4\x04\xf2\x43\x60\xa4\x68\x08\x9b\x06\x9c\xb3\x51", + 1, 256 }, + { 128, 128, 15, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x08\x1c\x00\x00\x00\x00\x00\x00\x08\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x60\x59\x72\x8f\xd0\x0b\x69\x67\xdf\x89\xb0\xd1\xc3\x02\x3e\xe4\x5b\xde" + "\xe2\x0a\xea\x67\xc6\x05\x40\x4f\xe9\x38\xd4\x10\x1d\x5a", + 1, 256 }, + { 128, 128, 16, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x09\x1c\x00\x00\x00\x00\x00\x00\x09\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x46\x63\x8d\x94\x5a\xcc\x87\x2d\x57\x4f\xcb\x55\x71\xaa\x6c\x17\xcb\x7c" + "\x7a\x6d\x19\xbf\xba\xcd\xe1\x3c\x77\xed\x0f\x10\x4f\x38", + 1, 256 }, + { 128, 128, 17, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x00\x0a\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe5\xdd\xa1\x58\xbe\x47\x6e\xa6\x3b\xea\x90\x02\xf6\x87\xbd\x69\x1b\x15" + "\xb7\x3c\x6f\xa1\x28\xde\x0f\xf3\x80\xfb\xef\x89\xa5\xd5", + 1, 256 }, + { 128, 128, 18, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0b\x1c\x00\x00\x00\x00\x00\x00\x0b\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xae\x68\x9e\x4e\x8d\x49\x2a\x59\x5c\x02\x53\x73\x91\xb2\x92\x94\xc3\x7e" + "\x09\xae\xe3\x6d\x3c\xea\xac\x57\x34\x19\x82\x56\x10\x2e", + 1, 256 }, + { 128, 128, 19, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0c\x1c\x00\x00\x00\x00\x00\x00\x0c\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd4\x35\x4b\x73\x1b\x6e\xa3\x4c\xd5\x9b\x10\xd0\x93\x64\xc9\xdf\xe0\xe5" + "\x2e\xa0\x8c\x2d\x85\x38\x53\xaa\x79\x92\xad\xae\x36\xb3", + 1, 256 }, + { 128, 128, 20, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0d\x1c\x00\x00\x00\x00\x00\x00\x0d\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xdb\x9b\x66\x28\xf7\x9d\x37\x32\xbe\x36\x78\x8d\xa3\xd0\xc2\x73\x68\x0d" + "\x47\xf7\x13\x8f\x3d\x83\x2a\xcf\x5e\xe1\xb8\x6d\x86\xb8", + 1, 256 }, + { 128, 128, 21, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0e\x1c\x00\x00\x00\x00\x00\x00\x0e\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd5\xbf\x80\x07\x53\x33\xad\x71\x9a\x05\x70\xd9\xe7\xdd\x45\xf0\xd0\x2d" + "\xaf\xdc\xf1\x12\x67\x8f\x46\x20\xac\xb4\xd7\xf8\x98\x41", + 1, 256 }, + { 128, 128, 22, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x0f\x1c\x00\x00\x00\x00\x00\x00\x0f\x1c\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x62\x45\xff\xfa\x89\x47\x18\x63\x28\x4e\xd5\xf2\x94\xb0\x54\x43\xd5\xae" + "\xb5\x68\x2f\xf6\x7c\x81\xe3\xc5\x81\x32\x0e\x59\xc5\x60", + 1, 256 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - - diff --git a/test/kat-app/snow3g_test_f9_vectors.json.c b/test/kat-app/snow3g_test_f9_vectors.json.c index edaf6d3c..af2cda37 100644 --- a/test/kat-app/snow3g_test_f9_vectors.json.c +++ b/test/kat-app/snow3g_test_f9_vectors.json.c @@ -30,161 +30,155 @@ #include "mac_test.h" const struct mac_test snow3g_hash_test_vectors_json[] = { - {128, 32, 1, - "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", - "\x6b\x22\x77\x37\x29\x6f\x39\x3c\x80\x79\x35\x3e\xdc\x87\xe2\xe8\x05\xd2" - "\xec\x49\xa4\xf2\xd8\xe0", - "\x2b\xce\x18\x20", 1, 189, - "\x38\xa6\xf0\x56\x05\xd2\xec\x49\x38\xa6\xf0\x56\x05\xd2\xec\x49", 128}, - {128, 32, 2, - "\xd4\x2f\x68\x24\x28\x20\x1c\xaf\xcd\x9f\x97\x94\x5e\x6d\xe7\xb7", - "\xb5\x92\x43\x84\x32\x8a\x4a\xe0\x0b\x73\x71\x09\xf8\xb6\xc8\xdd\x2b\x4d" - "\xb6\x3d\xd5\x33\x98\x1c\xeb\x19\xaa\xd5\x2a\x5b\x2b\xc0", - "\xfc\x7b\x18\xbd", 1, 254, - "\x3e\xdc\x87\xe2\xa4\xf2\xd8\xe2\xbe\xdc\x87\xe2\xa4\xf2\x58\xe2", 128}, - {128, 32, 3, - "\xfd\xb9\xcf\xdf\x28\x93\x6c\xc4\x83\xa3\x18\x69\xd8\x1b\x8f\xab", - "\x59\x32\xbc\x0a\xce\x2b\x0a\xba\x33\xd8\xac\x18\x8a\xc5\x4f\x34\x6f\xad" - "\x10\xbf\x9d\xee\x29\x20\xb4\x3b\xd0\xc5\x3a\x91\x5c\xb7\xdf\x6c\xaa\x72" - "\x05\x3a\xbf\xf2", - "\x02\xf1\xfa\xaf", 1, 319, - "\x36\xaf\x61\x44\x98\x38\xf0\x3a\xb6\xaf\x61\x44\x98\x38\x70\x3a", 128}, - {128, 32, 4, - "\xc7\x36\xc6\xaa\xb2\x2b\xff\xf9\x1e\x26\x98\xd2\xe2\x2a\xd5\x7e", - "\xd0\xa7\xd4\x63\xdf\x9f\xb2\xb2\x78\x83\x3f\xa0\x2e\x23\x5a\xa1\x72\xbd" - "\x97\x0c\x14\x73\xe1\x29\x07\xfb\x64\x8b\x65\x99\xaa\xa0\xb2\x4a\x03\x86" - "\x65\x42\x2b\x20\xa4\x99\x27\x6a\x50\x42\x70\x09", - "\x38\xb5\x54\xc0", 1, 384, - "\x14\x79\x3e\x41\x03\x97\xe8\xfd\x94\x79\x3e\x41\x03\x97\x68\xfd", 128}, - {128, 32, 5, - "\xf4\xeb\xec\x69\xe7\x3e\xaf\x2e\xb2\xcf\x6a\xf4\xb3\x12\x0f\xfd", - "\x10\xbf\xff\x83\x9e\x0c\x71\x65\x8d\xbb\x2d\x17\x07\xe1\x45\x72\x4f\x41" - "\xc1\x6f\x48\xbf\x40\x3c\x3b\x18\xe3\x8f\xd5\xd1\x66\x3b\x6f\x6d\x90\x01" - "\x93\xe3\xce\xa8\xbb\x4f\x1b\x4f\x5b\xe8\x22\x03\x22\x32\xa7\x8d\x7d\x75" - "\x23\x8d\x5e\x6d\xae\xcd\x3b\x43\x22\xcf\x59\xbc\x7e\xa8\x4a\xb1\x88\x11" - "\xb5\xbf\xb7\xbc\x55\x3f\x4f\xe4\x44\x78\xce\x28\x7a\x14\x87\x99\x90\xd1" - "\x8d\x12\xca\x79\xd2\xc8\x55\x14\x90\x21\xcd\x5c\xe8\xca\x03\x71\xca\x04" - "\xfc\xce\x14\x3e\x3d\x7c\xfe\xe9\x45\x85\xb5\x88\x5c\xac\x46\x06\x8b", - "\x06\x17\x45\xae", 1, 1000, - "\x29\x6f\x39\x3c\x6b\x22\x77\x37\xa9\x6f\x39\x3c\x6b\x22\xf7\x37", 128}, - {128, 32, 6, - "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", - "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x01\x01\xe0\x95" - "\x80\x45\xf3\xa0\xbb\xa4\xe3\x96\x83\x46\xf0\xa3\xb8\xa7\xc0\x2a\x01\x8a" - "\xe6\x40\x76\x52\x26\xb9\x87\xc9\x13\xe6\xcb\xf0\x83\x57\x00\x16\xcf\x83" - "\xef\xbc\x61\xc0\x82\x51\x3e\x21\x56\x1a\x42\x7c\x00\x9d\x28\xc2\x98\xef" - "\xac\xe7\x8e\xd6\xd5\x6c\x2d\x45\x05\xad\x03\x2e\x9c\x04\xdc\x60\xe7\x3a" - "\x81\x69\x6d\xa6\x65\xc6\xc4\x86\x03\xa5\x7b\x45\xab\x33\x22\x15\x85\xe6" - "\x8e\xe3\x16\x91\x87\xfb\x02\x39\x52\x86\x32\xdd\x65\x6c\x80\x7e\xa3\x24" - "\x8b\x7b\x46\xd0\x02\xb2\xb5\xc7\x45\x8e\xb8\x5b\x9c\xe9\x58\x79\xe0\x34" - "\x08\x59\x05\x5e\x3b\x0a\xbb\xc3\xea\xce\x87\x19\xca\xa8\x02\x65\xc9\x72" - "\x05\xd5\xdc\x4b\xcc\x90\x2f\xe1\x83\x96\x29\xed\x71\x32\x8a\x0f\x04\x49" - "\xf5\x88\x55\x7e\x68\x98\x86\x0e\x04\x2a\xec\xd8\x4b\x24\x04\xc2\x12\xc9" - "\x22\x2d\xa5\xbf\x8a\x89\xef\x67\x97\x87\x0c\xf5\x07\x71\xa6\x0f\x66\xa2" - "\xee\x62\x85\x36\x57\xad\xdf\x04\xcd\xde\x07\xfa\x41\x4e\x11\xf1\x2b\x4d" - "\x81\xb9\xb4\xe8\xac\x53\x8e\xa3\x06\x66\x68\x8d\x88\x1f\x6c\x34\x84\x21" - "\x99\x2f\x31\xb9\x4f\x88\x06\xed\x8f\xcc\xff\x4c\x91\x23\xb8\x96\x42\x52" - "\x7a\xd6\x13\xb1\x09\xbf\x75\x16\x74\x85\xf1\x26\x8b\xf8\x84\xb4\xcd\x23" - "\xd2\x9a\x09\x34\x92\x57\x03\xd6\x34\x09\x8f\x77\x67\xf1\xbe\x74\x91\xe7" - "\x08\xa8\xbb\x94\x9a\x38\x73\x70\x8a\xef\x4a\x36\x23\x9e\x50\xcc\x08\x23" - "\x5c\xd5\xed\x6b\xbe\x57\x86\x68\xa1\x7b\x58\xc1\x17\x1d\x0b\x90\xe8\x13" - "\xa9\xe4\xf5\x8a\x89\xd7\x19\xb1\x10\x42\xd6\x36\x0b\x1b\x0f\x52\xde\xb7" - "\x30\xa5\x8d\x58\xfa\xf4\x63\x15\x95\x4b\x0a\x87\x26\x91\x47\x59\x77\xdc" - "\x88\xc0\xd7\x33\xfe\xff\x54\x60\x0a\x0c\xc1\xd0\x30\x0a\xaa\xeb\x94\x57" - "\x2c\x6e\x95\xb0\x1a\xe9\x0d\xe0\x4f\x1d\xce\x47\xf8\x7e\x8f\xa7\xbe\xbf" - "\x77\xe1\xdb\xc2\x0d\x6b\xa8\x5c\xb9\x14\x3d\x51\x8b\x28\x5d\xfa\x04\xb6" - "\x98\xbf\x0c\xf7\x81\x9f\x20\xfa\x7a\x28\x8e\xb0\x70\x3d\x99\x5c\x59\x94" - "\x0c\x7c\x66\xde\x57\xa9\xb7\x0f\x82\x37\x9b\x70\xe2\x03\x1e\x45\x0f\xcf" - "\xd2\x18\x13\x26\xfc\xd2\x8d\x88\x23\xba\xaa\x80\xdf\x6e\x0f\x44\x35\x59" - "\x64\x75\x39\xfd\x89\x07\xc0\xff\xd9\xd7\x9c\x13\x0e\xd8\x1c\x9a\xfd\x9b" - "\x7e\x84\x8c\x9f\xed\x38\x44\x3d\x5d\x38\x0e\x53\xfb\xdb\x8a\xc8\xc3\xd3" - "\xf0\x68\x76\x05\x4f\x12\x24\x61\x10\x7d\xe9\x2f\xea\x09\xc6\xf6\x92\x3a" - "\x18\x8d\x53\xaf\xe5\x4a\x10\xf6\x0e\x6e\x9d\x5a\x03\xd9\x96\xb5\xfb\xc8" - "\x20\xf8\xa6\x37\x11\x6a\x27\xad\x04\xb4\x44\xa0\x93\x2d\xd6\x0f\xbd\x12" - "\x67\x1c\x11\xe1\xc0\xec\x73\xe7\x89\x87\x9f\xaa\x3d\x42\xc6\x4d\x20\xcd" - "\x12\x52\x74\x2a\x37\x68\xc2\x5a\x90\x15\x85\x88\x8e\xce\xe1\xe6\x12\xd9" - "\x93\x6b\x40\x3b\x07\x75\x94\x9a\x66\xcd\xfd\x99\xa2\x9b\x13\x45\xba\xa8" - "\xd9\xd5\x40\x0c\x91\x02\x4b\x0a\x60\x73\x63\xb0\x13\xce\x5d\xe9\xae\x86" - "\x9d\x3b\x8d\x95\xb0\x57\x0b\x3c\x2d\x39\x14\x22\xd3\x24\x50\xcb\xcf\xae" - "\x96\x65\x22\x86\xe9\x6d\xec\x12\x14\xa9\x34\x65\x27\x98\x0a\x81\x92\xea" - "\xc1\xc3\x9a\x3a\xaf\x6f\x15\x35\x1d\xa6\xbe\x76\x4d\xf8\x97\x72\xec\x04" - "\x07\xd0\x6e\x44\x15\xbe\xfa\xe7\xc9\x25\x80\xdf\x9b\xf5\x07\x49\x7c\x8f" - "\x29\x95\x16\x0d\x4e\x21\x8d\xaa\xcb\x02\x94\x4a\xbf\x83\x34\x0c\xe8\xbe" - "\x16\x86\xa9\x60\xfa\xf9\x0e\x2d\x90\xc5\x5c\xc6\x47\x5b\xab\xc3\x17\x1a" - "\x80\xa3\x63\x17\x49\x54\x95\x5d\x71\x01\xda\xb1\x6a\xe8\x17\x91\x67\xe2" - "\x14\x44\xb4\x43\xa9\xea\xaa\x7c\x91\xde\x36\xd1\x18\xc3\x9d\x38\x9f\x8d" - "\xd4\x46\x9a\x84\x6c\x9a\x26\x2b\xf7\xfa\x18\x48\x7a\x79\xe8\xde\x11\x69" - "\x9e\x0b\x8f\xdf\x55\x7c\xb4\x87\x19\xd4\x53\xba\x71\x30\x56\x10\x9b\x93" - "\xa2\x18\xc8\x96\x75\xac\x19\x5f\xb4\xfb\x06\x63\x9b\x37\x97\x14\x49\x55" - "\xb3\xc9\x32\x7d\x1a\xec\x00\x3d\x42\xec\xd0\xea\x98\xab\xf1\x9f\xfb\x4a" - "\xf3\x56\x1a\x67\xe7\x7c\x35\xbf\x15\xc5\x9c\x24\x12\xda\x88\x1d\xb0\x2b" - "\x1b\xfb\xce\xbf\xac\x51\x52\xbc\x99\xbc\x3f\x1d\x15\xf7\x71\x00\x1b\x70" - "\x29\xfe\xdb\x02\x8f\x8b\x85\x2b\xc4\x40\x7e\xb8\x3f\x89\x1c\x9c\xa7\x33" - "\x25\x4f\xdd\x1e\x9e\xdb\x56\x91\x9c\xe9\xfe\xa2\x1c\x17\x40\x72\x52\x1c" - "\x18\x31\x9a\x54\xb5\xd4\xef\xbe\xbd\xdf\x1d\x8b\x69\xb1\xcb\xf2\x5f\x48" - "\x9f\xcc\x98\x13\x72\x54\x7c\xf4\x1d\x00\x8e\xf0\xbc\xa1\x92\x6f\x93\x4b" - "\x73\x5e\x09\x0b\x3b\x25\x1e\xb3\x3a\x36\xf8\x2e\xd9\xb2\x9c\xf4\xcb\x94" - "\x41\x88\xfa\x0e\x1e\x38\xdd\x77\x8f\x7d\x1c\x9d\x98\x7b\x28\xd1\x32\xdf" - "\xb9\x73\x1f\xa4\xf4\xb4\x16\x93\x5b\xe4\x9d\xe3\x05\x16\xaf\x35\x78\x58" - "\x1f\x2f\x13\xf5\x61\xc0\x66\x33\x61\x94\x1e\xab\x24\x9a\x4b\xc1\x23\xf8" - "\xd1\x5c\xd7\x11\xa9\x56\xa1\xbf\x20\xfe\x6e\xb7\x8a\xea\x23\x73\x36\x1d" - "\xa0\x42\x6c\x79\xa5\x30\xc3\xbb\x1d\xe0\xc9\x97\x22\xef\x1f\xde\x39\xac" - "\x2b\x00\xa0\xa8\xee\x7c\x80\x0a\x08\xbc\x22\x64\xf8\x9f\x4e\xff\xe6\x27" - "\xac\x2f\x05\x31\xfb\x55\x4f\x6d\x21\xd7\x4c\x59\x0a\x70\xad\xfa\xa3\x90" - "\xbd\xfb\xb3\xd6\x8e\x46\x21\x5c\xab\x18\x7d\x23\x68\xd5\xa7\x1f\x5e\xbe" - "\xc0\x81\xcd\x3b\x20\xc0\x82\xdb\xe4\xcd\x2f\xac\xa2\x87\x73\x79\x5d\x6b" - "\x0c\x10\x20\x4b\x65\x9a\x93\x9e\xf2\x9b\xbe\x10\x88\x24\x36\x24\x42\x99" - "\x27\xa7\xeb\x57\x6d\xd3\xa0\x0e\xa5\xe0\x1a\xf5\xd4\x75\x83\xb2\x27\x2c" - "\x0c\x16\x1a\x80\x65\x21\xa1\x6f\xf9\xb0\xa7\x22\xc0\xcf\x26\xb0\x25\xd5" - "\x83\x6e\x22\x58\xa4\xf7\xd4\x77\x3a\xc8\x01\xe4\x26\x3b\xc2\x94\xf4\x3d" - "\xef\x7f\xa8\x70\x3f\x3a\x41\x97\x46\x35\x25\x88\x76\x52\xb0\xb2\xa4\xa2" - "\xa7\xcf\x87\xf0\x09\x14\x87\x1e\x25\x03\x91\x13\xc7\xe1\x61\x8d\xa3\x40" - "\x64\xb5\x7a\x43\xc4\x63\x24\x9f\xb8\xd0\x5e\x0f\x26\xf4\xa6\xd8\x49\x72" - "\xe7\xa9\x05\x48\x24\x14\x5f\x91\x29\x5c\xdb\xe3\x9a\x6f\x92\x0f\xac\xc6" - "\x59\x71\x2b\x46\xa5\x4b\xa2\x95\xbb\xe6\xa9\x01\x54\xe9\x1b\x33\x98\x5a" - "\x2b\xcd\x42\x0a\xd5\xc6\x7e\xc9\xad\x8e\xb7\xac\x68\x64\xdb\x27\x2a\x51" - "\x6b\xc9\x4c\x28\x39\xb0\xa8\x16\x9a\x6b\xf5\x8e\x1a\x0c\x2a\xda\x8c\x88" - "\x3b\x7b\xf4\x97\xa4\x91\x71\x26\x8e\xd1\x5d\xdd\x29\x69\x38\x4e\x7f\xf4" - "\xbf\x4a\xab\x2e\xc9\xec\xc6\x52\x9c\xf6\x29\xe2\xdf\x0f\x08\xa7\x7a\x65" - "\xaf\xa1\x2a\xa9\xb5\x05\xdf\x8b\x28\x7e\xf6\xcc\x91\x49\x3d\x1c\xaa\x39" - "\x07\x6e\x28\xef\x1e\xa0\x28\xf5\x11\x8d\xe6\x1a\xe0\x2b\xb6\xae\xfc\x33" - "\x43\xa0\x50\x29\x2f\x19\x9f\x40\x18\x57\xb2\xbe\xad\x5e\x6e\xe2\xa1\xf1" - "\x91\x02\x2f\x92\x78\x01\x6f\x04\x77\x91\xa9\xd1\x8d\xa7\xd2\xa6\xd2\x7f" - "\x2e\x0e\x51\xc2\xf6\xea\x30\xe8\xac\x49\xa0\x60\x4f\x4c\x13\x54\x2e\x85" - "\xb6\x83\x81\xb9\xfd\xcf\xa0\xce\x4b\x2d\x34\x13\x54\x85\x2d\x36\x02\x45" - "\xc5\x36\xb6\x12\xaf\x71\xf3\xe7\x7c\x90\x95\xae\x2d\xbd\xe5\x04\xb2\x65" - "\x73\x3d\xab\xfe\x10\xa2\x0f\xc7\xd6\xd3\x2c\x21\xcc\xc7\x2b\x8b\x34\x44" - "\xae\x66\x3d\x65\x92\x2d\x17\xf8\x2c\xaa\x2b\x86\x5c\xd8\x89\x13\xd2\x91" - "\xa6\x58\x99\x02\x6e\xa1\x32\x84\x39\x72\x3c\x19\x8c\x36\xb0\xc3\xc8\xd0" - "\x85\xbf\xaf\x8a\x32\x0f\xde\x33\x4b\x4a\x49\x19\xb4\x4c\x2b\x95\xf6\xe8" - "\xec\xf7\x33\x93\xf7\xf0\xd2\xa4\x0e\x60\xb1\xd4\x06\x52\x6b\x02\x2d\xdc" - "\x33\x18\x10\xb1\xa5\xf7\xc3\x47\xbd\x53\xed\x1f\x10\x5d\x6a\x0d\x30\xab" - "\xa4\x77\xe1\x78\x88\x9a\xb2\xec\x55\xd5\x58\xde\xab\x26\x30\x20\x43\x36" - "\x96\x2b\x4d\xb5\xb6\x63\xb6\x90\x2b\x89\xe8\x5b\x31\xbc\x6a\xf5\x0f\xc5" - "\x0a\xcc\xb3\xfb\x9b\x57\xb6\x63\x29\x70\x31\x37\x8d\xb4\x78\x96\xd7\xfb" - "\xaf\x6c\x60\x0a\xdd\x2c\x67\xf9\x36\xdb\x03\x79\x86\xdb\x85\x6e\xb4\x9c" - "\xf2\xdb\x3f\x7d\xa6\xd2\x36\x50\xe4\x38\xf1\x88\x40\x41\xb0\x13\x11\x9e" - "\x4c\x2a\xe5\xaf\x37\xcc\xcd\xfb\x68\x66\x07\x38\xb5\x8b\x3c\x59\xd1\xc0" - "\x24\x84\x37\x47\x2a\xba\x1f\x35\xca\x1f\xb9\x0c\xd7\x14\xaa\x9f\x63\x55" - "\x34\xf4\x9e\x7c\x5b\xba\x81\xc2\xb6\xb3\x6f\xde\xe2\x1c\xa2\x7e\x34\x7f" - "\x79\x3d\x2c\xe9\x44\xed\xb2\x3c\x8c\x9b\x91\x4b\xe1\x03\x35\xe3\x50\xfe" - "\xb5\x07\x03\x94\xb7\xa4\xa1\x5c\x0c\xa1\x20\x28\x35\x68\xb7\xbf\xc2\x54" - "\xfe\x83\x8b\x13\x7a\x21\x47\xce\x7c\x11\x3a\x3a\x4d\x65\x49\x9d\x9e\x86" - "\xb8\x7d\xbc\xc7\xf0\x3b\xbd\x3a\x3a\xb1\xaa\x24\x3e\xce\x5b\xa9\xbc\xf2" - "\x5f\x82\x83\x6c\xfe\x47\x3b\x2d\x83\xe7\xa7\x20\x1c\xd0\xb9\x6a\x72\x45" - "\x1e\x86\x3f\x6c\x3b\xa6\x64\xa6\xd0\x73\xd1\xf7\xb5\xed\x99\x08\x65\xd9" - "\x78\xbd\x38\x15\xd0\x60\x94\xfc\x9a\x2a\xba\x52\x21\xc2\x2d\x5a\xb9\x96" - "\x38\x9e\x37\x21\xe3\xaf\x5f\x05\xbe\xdd\xc2\x87\x5e\x0d\xfa\xeb\x39\x02" - "\x1e\xe2\x7a\x41\x18\x7c\xbb\x45\xef\x40\xc3\xe7\x3b\xc0\x39\x89\xf9\xa3" - "\x0d\x12\xc5\x4b\xa7\xd2\x14\x1d\xa8\xa8\x75\x49\x3e\x65\x77\x6e\xf3\x5f" - "\x97\xde\xbc\x22\x86\xcc\x4a\xf9\xb4\x62\x3e\xee\x90\x2f\x84\x0c\x52\xf1" - "\xb8\xad\x65\x89\x39\xae\xf7\x1f\x3f\x72\xb9\xec\x1d\xe2\x15\x88\xbd\x35" - "\x48\x4e\xa4\x44\x36\x34\x3f\xf9\x5e\xad\x6a\xb1\xd8\xaf\xb1\xb2\xa3\x03" - "\xdf\x1b\x71\xe5\x3c\x4a\xea\x6b\x2e\x3e\x93\x72\xbe\x0d\x1b\xc9\x97\x98" - "\xb0\xce\x3c\xc1\x0d\x2a\x59\x6d\x56\x5d\xba\x82\xf8\x8c\xe4\xcf\xf3\xb3" - "\x3d\x5d\x24\xe9\xc0\x83\x11\x24\xbf\x1a\xd5\x4b\x79\x25\x32\x98\x3d\xd6" - "\xc3\xa8\xb7\xd0", - "\x17\x9f\x2f\xa6", 1, 16448, - "\x29\x6f\x39\x3c\x6b\x22\x77\x37\xa9\x6f\x39\x3c\x6b\x22\xf7\x37", 128}, - {0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0} + { 128, 32, 1, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x6b\x22\x77\x37\x29\x6f\x39\x3c\x80\x79\x35\x3e\xdc\x87\xe2\xe8\x05\xd2" + "\xec\x49\xa4\xf2\xd8\xe0", + "\x2b\xce\x18\x20", 1, 189, + "\x38\xa6\xf0\x56\x05\xd2\xec\x49\x38\xa6\xf0\x56\x05\xd2\xec\x49", 128 }, + { 128, 32, 2, "\xd4\x2f\x68\x24\x28\x20\x1c\xaf\xcd\x9f\x97\x94\x5e\x6d\xe7\xb7", + "\xb5\x92\x43\x84\x32\x8a\x4a\xe0\x0b\x73\x71\x09\xf8\xb6\xc8\xdd\x2b\x4d" + "\xb6\x3d\xd5\x33\x98\x1c\xeb\x19\xaa\xd5\x2a\x5b\x2b\xc0", + "\xfc\x7b\x18\xbd", 1, 254, + "\x3e\xdc\x87\xe2\xa4\xf2\xd8\xe2\xbe\xdc\x87\xe2\xa4\xf2\x58\xe2", 128 }, + { 128, 32, 3, "\xfd\xb9\xcf\xdf\x28\x93\x6c\xc4\x83\xa3\x18\x69\xd8\x1b\x8f\xab", + "\x59\x32\xbc\x0a\xce\x2b\x0a\xba\x33\xd8\xac\x18\x8a\xc5\x4f\x34\x6f\xad" + "\x10\xbf\x9d\xee\x29\x20\xb4\x3b\xd0\xc5\x3a\x91\x5c\xb7\xdf\x6c\xaa\x72" + "\x05\x3a\xbf\xf2", + "\x02\xf1\xfa\xaf", 1, 319, + "\x36\xaf\x61\x44\x98\x38\xf0\x3a\xb6\xaf\x61\x44\x98\x38\x70\x3a", 128 }, + { 128, 32, 4, "\xc7\x36\xc6\xaa\xb2\x2b\xff\xf9\x1e\x26\x98\xd2\xe2\x2a\xd5\x7e", + "\xd0\xa7\xd4\x63\xdf\x9f\xb2\xb2\x78\x83\x3f\xa0\x2e\x23\x5a\xa1\x72\xbd" + "\x97\x0c\x14\x73\xe1\x29\x07\xfb\x64\x8b\x65\x99\xaa\xa0\xb2\x4a\x03\x86" + "\x65\x42\x2b\x20\xa4\x99\x27\x6a\x50\x42\x70\x09", + "\x38\xb5\x54\xc0", 1, 384, + "\x14\x79\x3e\x41\x03\x97\xe8\xfd\x94\x79\x3e\x41\x03\x97\x68\xfd", 128 }, + { 128, 32, 5, "\xf4\xeb\xec\x69\xe7\x3e\xaf\x2e\xb2\xcf\x6a\xf4\xb3\x12\x0f\xfd", + "\x10\xbf\xff\x83\x9e\x0c\x71\x65\x8d\xbb\x2d\x17\x07\xe1\x45\x72\x4f\x41" + "\xc1\x6f\x48\xbf\x40\x3c\x3b\x18\xe3\x8f\xd5\xd1\x66\x3b\x6f\x6d\x90\x01" + "\x93\xe3\xce\xa8\xbb\x4f\x1b\x4f\x5b\xe8\x22\x03\x22\x32\xa7\x8d\x7d\x75" + "\x23\x8d\x5e\x6d\xae\xcd\x3b\x43\x22\xcf\x59\xbc\x7e\xa8\x4a\xb1\x88\x11" + "\xb5\xbf\xb7\xbc\x55\x3f\x4f\xe4\x44\x78\xce\x28\x7a\x14\x87\x99\x90\xd1" + "\x8d\x12\xca\x79\xd2\xc8\x55\x14\x90\x21\xcd\x5c\xe8\xca\x03\x71\xca\x04" + "\xfc\xce\x14\x3e\x3d\x7c\xfe\xe9\x45\x85\xb5\x88\x5c\xac\x46\x06\x8b", + "\x06\x17\x45\xae", 1, 1000, + "\x29\x6f\x39\x3c\x6b\x22\x77\x37\xa9\x6f\x39\x3c\x6b\x22\xf7\x37", 128 }, + { 128, 32, 6, "\xb3\x12\x0f\xfd\xb2\xcf\x6a\xf4\xe7\x3e\xaf\x2e\xf4\xeb\xec\x69", + "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x01\x01\xe0\x95" + "\x80\x45\xf3\xa0\xbb\xa4\xe3\x96\x83\x46\xf0\xa3\xb8\xa7\xc0\x2a\x01\x8a" + "\xe6\x40\x76\x52\x26\xb9\x87\xc9\x13\xe6\xcb\xf0\x83\x57\x00\x16\xcf\x83" + "\xef\xbc\x61\xc0\x82\x51\x3e\x21\x56\x1a\x42\x7c\x00\x9d\x28\xc2\x98\xef" + "\xac\xe7\x8e\xd6\xd5\x6c\x2d\x45\x05\xad\x03\x2e\x9c\x04\xdc\x60\xe7\x3a" + "\x81\x69\x6d\xa6\x65\xc6\xc4\x86\x03\xa5\x7b\x45\xab\x33\x22\x15\x85\xe6" + "\x8e\xe3\x16\x91\x87\xfb\x02\x39\x52\x86\x32\xdd\x65\x6c\x80\x7e\xa3\x24" + "\x8b\x7b\x46\xd0\x02\xb2\xb5\xc7\x45\x8e\xb8\x5b\x9c\xe9\x58\x79\xe0\x34" + "\x08\x59\x05\x5e\x3b\x0a\xbb\xc3\xea\xce\x87\x19\xca\xa8\x02\x65\xc9\x72" + "\x05\xd5\xdc\x4b\xcc\x90\x2f\xe1\x83\x96\x29\xed\x71\x32\x8a\x0f\x04\x49" + "\xf5\x88\x55\x7e\x68\x98\x86\x0e\x04\x2a\xec\xd8\x4b\x24\x04\xc2\x12\xc9" + "\x22\x2d\xa5\xbf\x8a\x89\xef\x67\x97\x87\x0c\xf5\x07\x71\xa6\x0f\x66\xa2" + "\xee\x62\x85\x36\x57\xad\xdf\x04\xcd\xde\x07\xfa\x41\x4e\x11\xf1\x2b\x4d" + "\x81\xb9\xb4\xe8\xac\x53\x8e\xa3\x06\x66\x68\x8d\x88\x1f\x6c\x34\x84\x21" + "\x99\x2f\x31\xb9\x4f\x88\x06\xed\x8f\xcc\xff\x4c\x91\x23\xb8\x96\x42\x52" + "\x7a\xd6\x13\xb1\x09\xbf\x75\x16\x74\x85\xf1\x26\x8b\xf8\x84\xb4\xcd\x23" + "\xd2\x9a\x09\x34\x92\x57\x03\xd6\x34\x09\x8f\x77\x67\xf1\xbe\x74\x91\xe7" + "\x08\xa8\xbb\x94\x9a\x38\x73\x70\x8a\xef\x4a\x36\x23\x9e\x50\xcc\x08\x23" + "\x5c\xd5\xed\x6b\xbe\x57\x86\x68\xa1\x7b\x58\xc1\x17\x1d\x0b\x90\xe8\x13" + "\xa9\xe4\xf5\x8a\x89\xd7\x19\xb1\x10\x42\xd6\x36\x0b\x1b\x0f\x52\xde\xb7" + "\x30\xa5\x8d\x58\xfa\xf4\x63\x15\x95\x4b\x0a\x87\x26\x91\x47\x59\x77\xdc" + "\x88\xc0\xd7\x33\xfe\xff\x54\x60\x0a\x0c\xc1\xd0\x30\x0a\xaa\xeb\x94\x57" + "\x2c\x6e\x95\xb0\x1a\xe9\x0d\xe0\x4f\x1d\xce\x47\xf8\x7e\x8f\xa7\xbe\xbf" + "\x77\xe1\xdb\xc2\x0d\x6b\xa8\x5c\xb9\x14\x3d\x51\x8b\x28\x5d\xfa\x04\xb6" + "\x98\xbf\x0c\xf7\x81\x9f\x20\xfa\x7a\x28\x8e\xb0\x70\x3d\x99\x5c\x59\x94" + "\x0c\x7c\x66\xde\x57\xa9\xb7\x0f\x82\x37\x9b\x70\xe2\x03\x1e\x45\x0f\xcf" + "\xd2\x18\x13\x26\xfc\xd2\x8d\x88\x23\xba\xaa\x80\xdf\x6e\x0f\x44\x35\x59" + "\x64\x75\x39\xfd\x89\x07\xc0\xff\xd9\xd7\x9c\x13\x0e\xd8\x1c\x9a\xfd\x9b" + "\x7e\x84\x8c\x9f\xed\x38\x44\x3d\x5d\x38\x0e\x53\xfb\xdb\x8a\xc8\xc3\xd3" + "\xf0\x68\x76\x05\x4f\x12\x24\x61\x10\x7d\xe9\x2f\xea\x09\xc6\xf6\x92\x3a" + "\x18\x8d\x53\xaf\xe5\x4a\x10\xf6\x0e\x6e\x9d\x5a\x03\xd9\x96\xb5\xfb\xc8" + "\x20\xf8\xa6\x37\x11\x6a\x27\xad\x04\xb4\x44\xa0\x93\x2d\xd6\x0f\xbd\x12" + "\x67\x1c\x11\xe1\xc0\xec\x73\xe7\x89\x87\x9f\xaa\x3d\x42\xc6\x4d\x20\xcd" + "\x12\x52\x74\x2a\x37\x68\xc2\x5a\x90\x15\x85\x88\x8e\xce\xe1\xe6\x12\xd9" + "\x93\x6b\x40\x3b\x07\x75\x94\x9a\x66\xcd\xfd\x99\xa2\x9b\x13\x45\xba\xa8" + "\xd9\xd5\x40\x0c\x91\x02\x4b\x0a\x60\x73\x63\xb0\x13\xce\x5d\xe9\xae\x86" + "\x9d\x3b\x8d\x95\xb0\x57\x0b\x3c\x2d\x39\x14\x22\xd3\x24\x50\xcb\xcf\xae" + "\x96\x65\x22\x86\xe9\x6d\xec\x12\x14\xa9\x34\x65\x27\x98\x0a\x81\x92\xea" + "\xc1\xc3\x9a\x3a\xaf\x6f\x15\x35\x1d\xa6\xbe\x76\x4d\xf8\x97\x72\xec\x04" + "\x07\xd0\x6e\x44\x15\xbe\xfa\xe7\xc9\x25\x80\xdf\x9b\xf5\x07\x49\x7c\x8f" + "\x29\x95\x16\x0d\x4e\x21\x8d\xaa\xcb\x02\x94\x4a\xbf\x83\x34\x0c\xe8\xbe" + "\x16\x86\xa9\x60\xfa\xf9\x0e\x2d\x90\xc5\x5c\xc6\x47\x5b\xab\xc3\x17\x1a" + "\x80\xa3\x63\x17\x49\x54\x95\x5d\x71\x01\xda\xb1\x6a\xe8\x17\x91\x67\xe2" + "\x14\x44\xb4\x43\xa9\xea\xaa\x7c\x91\xde\x36\xd1\x18\xc3\x9d\x38\x9f\x8d" + "\xd4\x46\x9a\x84\x6c\x9a\x26\x2b\xf7\xfa\x18\x48\x7a\x79\xe8\xde\x11\x69" + "\x9e\x0b\x8f\xdf\x55\x7c\xb4\x87\x19\xd4\x53\xba\x71\x30\x56\x10\x9b\x93" + "\xa2\x18\xc8\x96\x75\xac\x19\x5f\xb4\xfb\x06\x63\x9b\x37\x97\x14\x49\x55" + "\xb3\xc9\x32\x7d\x1a\xec\x00\x3d\x42\xec\xd0\xea\x98\xab\xf1\x9f\xfb\x4a" + "\xf3\x56\x1a\x67\xe7\x7c\x35\xbf\x15\xc5\x9c\x24\x12\xda\x88\x1d\xb0\x2b" + "\x1b\xfb\xce\xbf\xac\x51\x52\xbc\x99\xbc\x3f\x1d\x15\xf7\x71\x00\x1b\x70" + "\x29\xfe\xdb\x02\x8f\x8b\x85\x2b\xc4\x40\x7e\xb8\x3f\x89\x1c\x9c\xa7\x33" + "\x25\x4f\xdd\x1e\x9e\xdb\x56\x91\x9c\xe9\xfe\xa2\x1c\x17\x40\x72\x52\x1c" + "\x18\x31\x9a\x54\xb5\xd4\xef\xbe\xbd\xdf\x1d\x8b\x69\xb1\xcb\xf2\x5f\x48" + "\x9f\xcc\x98\x13\x72\x54\x7c\xf4\x1d\x00\x8e\xf0\xbc\xa1\x92\x6f\x93\x4b" + "\x73\x5e\x09\x0b\x3b\x25\x1e\xb3\x3a\x36\xf8\x2e\xd9\xb2\x9c\xf4\xcb\x94" + "\x41\x88\xfa\x0e\x1e\x38\xdd\x77\x8f\x7d\x1c\x9d\x98\x7b\x28\xd1\x32\xdf" + "\xb9\x73\x1f\xa4\xf4\xb4\x16\x93\x5b\xe4\x9d\xe3\x05\x16\xaf\x35\x78\x58" + "\x1f\x2f\x13\xf5\x61\xc0\x66\x33\x61\x94\x1e\xab\x24\x9a\x4b\xc1\x23\xf8" + "\xd1\x5c\xd7\x11\xa9\x56\xa1\xbf\x20\xfe\x6e\xb7\x8a\xea\x23\x73\x36\x1d" + "\xa0\x42\x6c\x79\xa5\x30\xc3\xbb\x1d\xe0\xc9\x97\x22\xef\x1f\xde\x39\xac" + "\x2b\x00\xa0\xa8\xee\x7c\x80\x0a\x08\xbc\x22\x64\xf8\x9f\x4e\xff\xe6\x27" + "\xac\x2f\x05\x31\xfb\x55\x4f\x6d\x21\xd7\x4c\x59\x0a\x70\xad\xfa\xa3\x90" + "\xbd\xfb\xb3\xd6\x8e\x46\x21\x5c\xab\x18\x7d\x23\x68\xd5\xa7\x1f\x5e\xbe" + "\xc0\x81\xcd\x3b\x20\xc0\x82\xdb\xe4\xcd\x2f\xac\xa2\x87\x73\x79\x5d\x6b" + "\x0c\x10\x20\x4b\x65\x9a\x93\x9e\xf2\x9b\xbe\x10\x88\x24\x36\x24\x42\x99" + "\x27\xa7\xeb\x57\x6d\xd3\xa0\x0e\xa5\xe0\x1a\xf5\xd4\x75\x83\xb2\x27\x2c" + "\x0c\x16\x1a\x80\x65\x21\xa1\x6f\xf9\xb0\xa7\x22\xc0\xcf\x26\xb0\x25\xd5" + "\x83\x6e\x22\x58\xa4\xf7\xd4\x77\x3a\xc8\x01\xe4\x26\x3b\xc2\x94\xf4\x3d" + "\xef\x7f\xa8\x70\x3f\x3a\x41\x97\x46\x35\x25\x88\x76\x52\xb0\xb2\xa4\xa2" + "\xa7\xcf\x87\xf0\x09\x14\x87\x1e\x25\x03\x91\x13\xc7\xe1\x61\x8d\xa3\x40" + "\x64\xb5\x7a\x43\xc4\x63\x24\x9f\xb8\xd0\x5e\x0f\x26\xf4\xa6\xd8\x49\x72" + "\xe7\xa9\x05\x48\x24\x14\x5f\x91\x29\x5c\xdb\xe3\x9a\x6f\x92\x0f\xac\xc6" + "\x59\x71\x2b\x46\xa5\x4b\xa2\x95\xbb\xe6\xa9\x01\x54\xe9\x1b\x33\x98\x5a" + "\x2b\xcd\x42\x0a\xd5\xc6\x7e\xc9\xad\x8e\xb7\xac\x68\x64\xdb\x27\x2a\x51" + "\x6b\xc9\x4c\x28\x39\xb0\xa8\x16\x9a\x6b\xf5\x8e\x1a\x0c\x2a\xda\x8c\x88" + "\x3b\x7b\xf4\x97\xa4\x91\x71\x26\x8e\xd1\x5d\xdd\x29\x69\x38\x4e\x7f\xf4" + "\xbf\x4a\xab\x2e\xc9\xec\xc6\x52\x9c\xf6\x29\xe2\xdf\x0f\x08\xa7\x7a\x65" + "\xaf\xa1\x2a\xa9\xb5\x05\xdf\x8b\x28\x7e\xf6\xcc\x91\x49\x3d\x1c\xaa\x39" + "\x07\x6e\x28\xef\x1e\xa0\x28\xf5\x11\x8d\xe6\x1a\xe0\x2b\xb6\xae\xfc\x33" + "\x43\xa0\x50\x29\x2f\x19\x9f\x40\x18\x57\xb2\xbe\xad\x5e\x6e\xe2\xa1\xf1" + "\x91\x02\x2f\x92\x78\x01\x6f\x04\x77\x91\xa9\xd1\x8d\xa7\xd2\xa6\xd2\x7f" + "\x2e\x0e\x51\xc2\xf6\xea\x30\xe8\xac\x49\xa0\x60\x4f\x4c\x13\x54\x2e\x85" + "\xb6\x83\x81\xb9\xfd\xcf\xa0\xce\x4b\x2d\x34\x13\x54\x85\x2d\x36\x02\x45" + "\xc5\x36\xb6\x12\xaf\x71\xf3\xe7\x7c\x90\x95\xae\x2d\xbd\xe5\x04\xb2\x65" + "\x73\x3d\xab\xfe\x10\xa2\x0f\xc7\xd6\xd3\x2c\x21\xcc\xc7\x2b\x8b\x34\x44" + "\xae\x66\x3d\x65\x92\x2d\x17\xf8\x2c\xaa\x2b\x86\x5c\xd8\x89\x13\xd2\x91" + "\xa6\x58\x99\x02\x6e\xa1\x32\x84\x39\x72\x3c\x19\x8c\x36\xb0\xc3\xc8\xd0" + "\x85\xbf\xaf\x8a\x32\x0f\xde\x33\x4b\x4a\x49\x19\xb4\x4c\x2b\x95\xf6\xe8" + "\xec\xf7\x33\x93\xf7\xf0\xd2\xa4\x0e\x60\xb1\xd4\x06\x52\x6b\x02\x2d\xdc" + "\x33\x18\x10\xb1\xa5\xf7\xc3\x47\xbd\x53\xed\x1f\x10\x5d\x6a\x0d\x30\xab" + "\xa4\x77\xe1\x78\x88\x9a\xb2\xec\x55\xd5\x58\xde\xab\x26\x30\x20\x43\x36" + "\x96\x2b\x4d\xb5\xb6\x63\xb6\x90\x2b\x89\xe8\x5b\x31\xbc\x6a\xf5\x0f\xc5" + "\x0a\xcc\xb3\xfb\x9b\x57\xb6\x63\x29\x70\x31\x37\x8d\xb4\x78\x96\xd7\xfb" + "\xaf\x6c\x60\x0a\xdd\x2c\x67\xf9\x36\xdb\x03\x79\x86\xdb\x85\x6e\xb4\x9c" + "\xf2\xdb\x3f\x7d\xa6\xd2\x36\x50\xe4\x38\xf1\x88\x40\x41\xb0\x13\x11\x9e" + "\x4c\x2a\xe5\xaf\x37\xcc\xcd\xfb\x68\x66\x07\x38\xb5\x8b\x3c\x59\xd1\xc0" + "\x24\x84\x37\x47\x2a\xba\x1f\x35\xca\x1f\xb9\x0c\xd7\x14\xaa\x9f\x63\x55" + "\x34\xf4\x9e\x7c\x5b\xba\x81\xc2\xb6\xb3\x6f\xde\xe2\x1c\xa2\x7e\x34\x7f" + "\x79\x3d\x2c\xe9\x44\xed\xb2\x3c\x8c\x9b\x91\x4b\xe1\x03\x35\xe3\x50\xfe" + "\xb5\x07\x03\x94\xb7\xa4\xa1\x5c\x0c\xa1\x20\x28\x35\x68\xb7\xbf\xc2\x54" + "\xfe\x83\x8b\x13\x7a\x21\x47\xce\x7c\x11\x3a\x3a\x4d\x65\x49\x9d\x9e\x86" + "\xb8\x7d\xbc\xc7\xf0\x3b\xbd\x3a\x3a\xb1\xaa\x24\x3e\xce\x5b\xa9\xbc\xf2" + "\x5f\x82\x83\x6c\xfe\x47\x3b\x2d\x83\xe7\xa7\x20\x1c\xd0\xb9\x6a\x72\x45" + "\x1e\x86\x3f\x6c\x3b\xa6\x64\xa6\xd0\x73\xd1\xf7\xb5\xed\x99\x08\x65\xd9" + "\x78\xbd\x38\x15\xd0\x60\x94\xfc\x9a\x2a\xba\x52\x21\xc2\x2d\x5a\xb9\x96" + "\x38\x9e\x37\x21\xe3\xaf\x5f\x05\xbe\xdd\xc2\x87\x5e\x0d\xfa\xeb\x39\x02" + "\x1e\xe2\x7a\x41\x18\x7c\xbb\x45\xef\x40\xc3\xe7\x3b\xc0\x39\x89\xf9\xa3" + "\x0d\x12\xc5\x4b\xa7\xd2\x14\x1d\xa8\xa8\x75\x49\x3e\x65\x77\x6e\xf3\x5f" + "\x97\xde\xbc\x22\x86\xcc\x4a\xf9\xb4\x62\x3e\xee\x90\x2f\x84\x0c\x52\xf1" + "\xb8\xad\x65\x89\x39\xae\xf7\x1f\x3f\x72\xb9\xec\x1d\xe2\x15\x88\xbd\x35" + "\x48\x4e\xa4\x44\x36\x34\x3f\xf9\x5e\xad\x6a\xb1\xd8\xaf\xb1\xb2\xa3\x03" + "\xdf\x1b\x71\xe5\x3c\x4a\xea\x6b\x2e\x3e\x93\x72\xbe\x0d\x1b\xc9\x97\x98" + "\xb0\xce\x3c\xc1\x0d\x2a\x59\x6d\x56\x5d\xba\x82\xf8\x8c\xe4\xcf\xf3\xb3" + "\x3d\x5d\x24\xe9\xc0\x83\x11\x24\xbf\x1a\xd5\x4b\x79\x25\x32\x98\x3d\xd6" + "\xc3\xa8\xb7\xd0", + "\x17\x9f\x2f\xa6", 1, 16448, + "\x29\x6f\x39\x3c\x6b\x22\x77\x37\xa9\x6f\x39\x3c\x6b\x22\xf7\x37", 128 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/kat-app/snow_v_test.c b/test/kat-app/snow_v_test.c index 63ce5eb6..11f02109 100644 --- a/test/kat-app/snow_v_test.c +++ b/test/kat-app/snow_v_test.c @@ -30,7 +30,7 @@ #include #include #include -#include /* for memcmp() */ +#include /* for memcmp() */ #include #include @@ -39,220 +39,124 @@ #define MAX_BUFFER_LENGTH_IN_BYTES 128 -int snow_v_test(IMB_MGR *p_mgr); +int +snow_v_test(IMB_MGR *p_mgr); /** * Test vectors for SNOW-V-GCM from 'A new SNOW stream cipher called SNOW-V', * Patrik Ekdahl1, Thomas Johansson2, Alexander Maximov1 and Jing Yang2 -**/ -static const uint8_t ZERO_KEY[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; -static const uint8_t ZERO_IV[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; -static const uint8_t MAX_KEY[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -}; -static const uint8_t MAX_IV[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -}; -static const uint8_t IV_spec[] = { - 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, - 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 -}; -static const uint8_t KEY_spec[] = { - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, - 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa -}; + **/ +static const uint8_t ZERO_KEY[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static const uint8_t ZERO_IV[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static const uint8_t MAX_KEY[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +static const uint8_t MAX_IV[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +static const uint8_t IV_spec[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; +static const uint8_t KEY_spec[] = { 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, + 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa }; static const uint8_t ZERO_PLAIN[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const uint8_t keystreams_from_spec[][128] = { - { - 0x69, 0xca, 0x6d, 0xaf, 0x9a, 0xe3, 0xb7, 0x2d, - 0xb1, 0x34, 0xa8, 0x5a, 0x83, 0x7e, 0x41, 0x9d, - 0xec, 0x08, 0xaa, 0xd3, 0x9d, 0x7b, 0x0f, 0x00, - 0x9b, 0x60, 0xb2, 0x8c, 0x53, 0x43, 0x00, 0xed, - 0x84, 0xab, 0xf5, 0x94, 0xfb, 0x08, 0xa7, 0xf1, - 0xf3, 0xa2, 0xdf, 0x18, 0xe6, 0x17, 0x68, 0x3b, - 0x48, 0x1f, 0xa3, 0x78, 0x07, 0x9d, 0xcf, 0x04, - 0xdb, 0x53, 0xb5, 0xd6, 0x29, 0xa9, 0xeb, 0x9d, - 0x03, 0x1c, 0x15, 0x9d, 0xcc, 0xd0, 0xa5, 0x0c, - 0x4d, 0x5d, 0xbf, 0x51, 0x15, 0xd8, 0x70, 0x39, - 0xc0, 0xd0, 0x3c, 0xa1, 0x37, 0x0c, 0x19, 0x40, - 0x03, 0x47, 0xa0, 0xb4, 0xd2, 0xe9, 0xdb, 0xe5, - 0xcb, 0xca, 0x60, 0x82, 0x14, 0xa2, 0x65, 0x82, - 0xcf, 0x68, 0x09, 0x16, 0xb3, 0x45, 0x13, 0x21, - 0x95, 0x4f, 0xdf, 0x30, 0x84, 0xaf, 0x02, 0xf6, - 0xa8, 0xe2, 0x48, 0x1d, 0xe6, 0xbf, 0x82, 0x79 - }, - { - 0x30, 0x76, 0x09, 0xfb, 0x10, 0x10, 0x12, 0x54, - 0x4b, 0xc1, 0x75, 0xe3, 0x17, 0xfb, 0x25, 0xff, - 0x33, 0x0d, 0x0d, 0xe2, 0x5a, 0xf6, 0xaa, 0xd1, - 0x05, 0x05, 0xb8, 0x9b, 0x1e, 0x09, 0xa8, 0xec, - 0xdd, 0x46, 0x72, 0xcc, 0xbb, 0x98, 0xc7, 0xf2, - 0xc4, 0xe2, 0x4a, 0xf5, 0x27, 0x28, 0x36, 0xc8, - 0x7c, 0xc7, 0x3a, 0x81, 0x76, 0xb3, 0x9c, 0xe9, - 0x30, 0x3b, 0x3e, 0x76, 0x4e, 0x9b, 0xe3, 0xe7, - 0x48, 0xf7, 0x65, 0x1a, 0x7c, 0x7e, 0x81, 0x3f, - 0xd5, 0x24, 0x90, 0x23, 0x1e, 0x56, 0xf7, 0xc1, - 0x44, 0xe4, 0x38, 0xe7, 0x77, 0x11, 0xa6, 0xb0, - 0xba, 0xfb, 0x60, 0x45, 0x0c, 0x62, 0xd7, 0xd9, - 0xb9, 0x24, 0x1d, 0x12, 0x44, 0xfc, 0xb4, 0x9d, - 0xa1, 0xe5, 0x2b, 0x80, 0x13, 0xde, 0xcd, 0xd4, - 0x86, 0x04, 0xff, 0xfc, 0x62, 0x67, 0x6e, 0x70, - 0x3b, 0x3a, 0xb8, 0x49, 0xcb, 0xa6, 0xea, 0x09 - }, - { - 0xaa, 0x81, 0xea, 0xfb, 0x8b, 0x86, 0x16, 0xce, - 0x3e, 0x5c, 0xe2, 0x22, 0x24, 0x61, 0xc5, 0x0a, - 0x6a, 0xb4, 0x48, 0x77, 0x56, 0xde, 0x4b, 0xd3, - 0x1c, 0x90, 0x4f, 0x3d, 0x97, 0x8a, 0xfe, 0x56, - 0x33, 0x4f, 0x10, 0xdd, 0xdf, 0x2b, 0x95, 0x31, - 0x76, 0x9a, 0x71, 0x05, 0x0b, 0xe4, 0x38, 0x5f, - 0xc2, 0xb6, 0x19, 0x2c, 0x7a, 0x85, 0x7b, 0xe8, - 0xb4, 0xfc, 0x28, 0xb7, 0x09, 0xf0, 0x8f, 0x11, - 0xf2, 0x06, 0x49, 0xe2, 0xee, 0xf2, 0x49, 0x80, - 0xf8, 0x6c, 0x4c, 0x11, 0x36, 0x41, 0xfe, 0xd2, - 0xf3, 0xf6, 0xfa, 0x2b, 0x91, 0x95, 0x12, 0x06, - 0xb8, 0x01, 0xdb, 0x15, 0x46, 0x65, 0x17, 0xa6, - 0x33, 0x0a, 0xdd, 0xa6, 0xb3, 0x5b, 0x26, 0x5e, - 0xfd, 0x72, 0x2e, 0x86, 0x77, 0xb4, 0x8b, 0xfc, - 0x15, 0xb4, 0x41, 0x18, 0xde, 0x52, 0xd0, 0x73, - 0xb0, 0xad, 0x0f, 0xe7, 0x59, 0x4d, 0x62, 0x91 - } + { 0x69, 0xca, 0x6d, 0xaf, 0x9a, 0xe3, 0xb7, 0x2d, 0xb1, 0x34, 0xa8, 0x5a, 0x83, 0x7e, 0x41, + 0x9d, 0xec, 0x08, 0xaa, 0xd3, 0x9d, 0x7b, 0x0f, 0x00, 0x9b, 0x60, 0xb2, 0x8c, 0x53, 0x43, + 0x00, 0xed, 0x84, 0xab, 0xf5, 0x94, 0xfb, 0x08, 0xa7, 0xf1, 0xf3, 0xa2, 0xdf, 0x18, 0xe6, + 0x17, 0x68, 0x3b, 0x48, 0x1f, 0xa3, 0x78, 0x07, 0x9d, 0xcf, 0x04, 0xdb, 0x53, 0xb5, 0xd6, + 0x29, 0xa9, 0xeb, 0x9d, 0x03, 0x1c, 0x15, 0x9d, 0xcc, 0xd0, 0xa5, 0x0c, 0x4d, 0x5d, 0xbf, + 0x51, 0x15, 0xd8, 0x70, 0x39, 0xc0, 0xd0, 0x3c, 0xa1, 0x37, 0x0c, 0x19, 0x40, 0x03, 0x47, + 0xa0, 0xb4, 0xd2, 0xe9, 0xdb, 0xe5, 0xcb, 0xca, 0x60, 0x82, 0x14, 0xa2, 0x65, 0x82, 0xcf, + 0x68, 0x09, 0x16, 0xb3, 0x45, 0x13, 0x21, 0x95, 0x4f, 0xdf, 0x30, 0x84, 0xaf, 0x02, 0xf6, + 0xa8, 0xe2, 0x48, 0x1d, 0xe6, 0xbf, 0x82, 0x79 }, + { 0x30, 0x76, 0x09, 0xfb, 0x10, 0x10, 0x12, 0x54, 0x4b, 0xc1, 0x75, 0xe3, 0x17, 0xfb, 0x25, + 0xff, 0x33, 0x0d, 0x0d, 0xe2, 0x5a, 0xf6, 0xaa, 0xd1, 0x05, 0x05, 0xb8, 0x9b, 0x1e, 0x09, + 0xa8, 0xec, 0xdd, 0x46, 0x72, 0xcc, 0xbb, 0x98, 0xc7, 0xf2, 0xc4, 0xe2, 0x4a, 0xf5, 0x27, + 0x28, 0x36, 0xc8, 0x7c, 0xc7, 0x3a, 0x81, 0x76, 0xb3, 0x9c, 0xe9, 0x30, 0x3b, 0x3e, 0x76, + 0x4e, 0x9b, 0xe3, 0xe7, 0x48, 0xf7, 0x65, 0x1a, 0x7c, 0x7e, 0x81, 0x3f, 0xd5, 0x24, 0x90, + 0x23, 0x1e, 0x56, 0xf7, 0xc1, 0x44, 0xe4, 0x38, 0xe7, 0x77, 0x11, 0xa6, 0xb0, 0xba, 0xfb, + 0x60, 0x45, 0x0c, 0x62, 0xd7, 0xd9, 0xb9, 0x24, 0x1d, 0x12, 0x44, 0xfc, 0xb4, 0x9d, 0xa1, + 0xe5, 0x2b, 0x80, 0x13, 0xde, 0xcd, 0xd4, 0x86, 0x04, 0xff, 0xfc, 0x62, 0x67, 0x6e, 0x70, + 0x3b, 0x3a, 0xb8, 0x49, 0xcb, 0xa6, 0xea, 0x09 }, + { 0xaa, 0x81, 0xea, 0xfb, 0x8b, 0x86, 0x16, 0xce, 0x3e, 0x5c, 0xe2, 0x22, 0x24, 0x61, 0xc5, + 0x0a, 0x6a, 0xb4, 0x48, 0x77, 0x56, 0xde, 0x4b, 0xd3, 0x1c, 0x90, 0x4f, 0x3d, 0x97, 0x8a, + 0xfe, 0x56, 0x33, 0x4f, 0x10, 0xdd, 0xdf, 0x2b, 0x95, 0x31, 0x76, 0x9a, 0x71, 0x05, 0x0b, + 0xe4, 0x38, 0x5f, 0xc2, 0xb6, 0x19, 0x2c, 0x7a, 0x85, 0x7b, 0xe8, 0xb4, 0xfc, 0x28, 0xb7, + 0x09, 0xf0, 0x8f, 0x11, 0xf2, 0x06, 0x49, 0xe2, 0xee, 0xf2, 0x49, 0x80, 0xf8, 0x6c, 0x4c, + 0x11, 0x36, 0x41, 0xfe, 0xd2, 0xf3, 0xf6, 0xfa, 0x2b, 0x91, 0x95, 0x12, 0x06, 0xb8, 0x01, + 0xdb, 0x15, 0x46, 0x65, 0x17, 0xa6, 0x33, 0x0a, 0xdd, 0xa6, 0xb3, 0x5b, 0x26, 0x5e, 0xfd, + 0x72, 0x2e, 0x86, 0x77, 0xb4, 0x8b, 0xfc, 0x15, 0xb4, 0x41, 0x18, 0xde, 0x52, 0xd0, 0x73, + 0xb0, 0xad, 0x0f, 0xe7, 0x59, 0x4d, 0x62, 0x91 } }; static const uint8_t KEYs[][32] = { - { - 0x67, 0xc6, 0x69, 0x73, 0x51, 0xff, 0x4a, 0xec, - 0x29, 0xcd, 0xba, 0xab, 0xf2, 0xfb, 0xe3, 0x46, - 0x7c, 0xc2, 0x54, 0xf8, 0x1b, 0xe8, 0xe7, 0x8d, - 0x76, 0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a - }, - { - 0xab, 0xb2, 0xcd, 0xc6, 0x9b, 0xb4, 0x54, 0x11, - 0x0e, 0x82, 0x74, 0x41, 0x21, 0x3d, 0xdc, 0x87, - 0x70, 0xe9, 0x3e, 0xa1, 0x41, 0xe1, 0xfc, 0x67, - 0x3e, 0x01, 0x7e, 0x97, 0xea, 0xdc, 0x6b, 0x96 - }, - { - 0x02, 0x1a, 0xfe, 0x43, 0xfb, 0xfa, 0xaa, 0x3a, - 0xfb, 0x29, 0xd1, 0xe6, 0x05, 0x3c, 0x7c, 0x94, - 0x75, 0xd8, 0xbe, 0x61, 0x89, 0xf9, 0x5c, 0xbb, - 0xa8, 0x99, 0x0f, 0x95, 0xb1, 0xeb, 0xf1, 0xb3 - }, - { - 0x1f, 0x23, 0x1e, 0xa8, 0x1c, 0x7b, 0x64, 0xc5, - 0x14, 0x73, 0x5a, 0xc5, 0x5e, 0x4b, 0x79, 0x63, - 0x3b, 0x70, 0x64, 0x24, 0x11, 0x9e, 0x09, 0xdc, - 0xaa, 0xd4, 0xac, 0xf2, 0x1b, 0x10, 0xaf, 0x3b - }, - { - 0x0b, 0xe1, 0x1a, 0x1c, 0x7f, 0x23, 0xf8, 0x29, - 0xf8, 0xa4, 0x1b, 0x13, 0xb5, 0xca, 0x4e, 0xe8, - 0x98, 0x32, 0x38, 0xe0, 0x79, 0x4d, 0x3d, 0x34, - 0xbc, 0x5f, 0x4e, 0x77, 0xfa, 0xcb, 0x6c, 0x05 - }, - { - 0x36, 0x94, 0xb3, 0xaf, 0xe2, 0xf0, 0xe4, 0x9e, - 0x4f, 0x32, 0x15, 0x49, 0xfd, 0x82, 0x4e, 0xa9, - 0x08, 0x70, 0xd4, 0xb2, 0x8a, 0x29, 0x54, 0x48, - 0x9a, 0x0a, 0xbc, 0xd5, 0x0e, 0x18, 0xa8, 0x44 - }, - { - 0xa3, 0x84, 0x7f, 0x2d, 0xad, 0xd4, 0x76, 0x47, - 0xde, 0x32, 0x1c, 0xec, 0x4a, 0xc4, 0x30, 0xf6, - 0x20, 0x23, 0x85, 0x6c, 0xfb, 0xb2, 0x07, 0x04, - 0xf4, 0xec, 0x0b, 0xb9, 0x20, 0xba, 0x86, 0xc3 - }, - { - 0xf7, 0x5e, 0xa0, 0xf2, 0x10, 0xa8, 0xf6, 0x05, - 0x94, 0x01, 0xbe, 0xb4, 0xbc, 0x44, 0x78, 0xfa, - 0x49, 0x69, 0xe6, 0x23, 0xd0, 0x1a, 0xda, 0x69, - 0x6a, 0x7e, 0x4c, 0x7e, 0x51, 0x25, 0xb3, 0x48 - }, - { - 0x25, 0xcf, 0x08, 0xf5, 0xe9, 0xe2, 0x5e, 0x53, - 0x60, 0xaa, 0xd2, 0xb2, 0xd0, 0x85, 0xfa, 0x54, - 0xd8, 0x35, 0xe8, 0xd4, 0x66, 0x82, 0x64, 0x98, - 0xd9, 0xa8, 0x87, 0x75, 0x65, 0x70, 0x5a, 0x8a - }, - { - 0x86, 0x95, 0x80, 0xec, 0x17, 0xe4, 0x85, 0xf1, - 0x8c, 0x0c, 0x66, 0xf1, 0x7c, 0xc0, 0x7c, 0xbb, - 0x22, 0xfc, 0xe4, 0x66, 0xda, 0x61, 0x0b, 0x63, - 0xaf, 0x62, 0xbc, 0x83, 0xb4, 0x69, 0x2f, 0x3a - }, + { 0x67, 0xc6, 0x69, 0x73, 0x51, 0xff, 0x4a, 0xec, 0x29, 0xcd, 0xba, + 0xab, 0xf2, 0xfb, 0xe3, 0x46, 0x7c, 0xc2, 0x54, 0xf8, 0x1b, 0xe8, + 0xe7, 0x8d, 0x76, 0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a }, + { 0xab, 0xb2, 0xcd, 0xc6, 0x9b, 0xb4, 0x54, 0x11, 0x0e, 0x82, 0x74, + 0x41, 0x21, 0x3d, 0xdc, 0x87, 0x70, 0xe9, 0x3e, 0xa1, 0x41, 0xe1, + 0xfc, 0x67, 0x3e, 0x01, 0x7e, 0x97, 0xea, 0xdc, 0x6b, 0x96 }, + { 0x02, 0x1a, 0xfe, 0x43, 0xfb, 0xfa, 0xaa, 0x3a, 0xfb, 0x29, 0xd1, + 0xe6, 0x05, 0x3c, 0x7c, 0x94, 0x75, 0xd8, 0xbe, 0x61, 0x89, 0xf9, + 0x5c, 0xbb, 0xa8, 0x99, 0x0f, 0x95, 0xb1, 0xeb, 0xf1, 0xb3 }, + { 0x1f, 0x23, 0x1e, 0xa8, 0x1c, 0x7b, 0x64, 0xc5, 0x14, 0x73, 0x5a, + 0xc5, 0x5e, 0x4b, 0x79, 0x63, 0x3b, 0x70, 0x64, 0x24, 0x11, 0x9e, + 0x09, 0xdc, 0xaa, 0xd4, 0xac, 0xf2, 0x1b, 0x10, 0xaf, 0x3b }, + { 0x0b, 0xe1, 0x1a, 0x1c, 0x7f, 0x23, 0xf8, 0x29, 0xf8, 0xa4, 0x1b, + 0x13, 0xb5, 0xca, 0x4e, 0xe8, 0x98, 0x32, 0x38, 0xe0, 0x79, 0x4d, + 0x3d, 0x34, 0xbc, 0x5f, 0x4e, 0x77, 0xfa, 0xcb, 0x6c, 0x05 }, + { 0x36, 0x94, 0xb3, 0xaf, 0xe2, 0xf0, 0xe4, 0x9e, 0x4f, 0x32, 0x15, + 0x49, 0xfd, 0x82, 0x4e, 0xa9, 0x08, 0x70, 0xd4, 0xb2, 0x8a, 0x29, + 0x54, 0x48, 0x9a, 0x0a, 0xbc, 0xd5, 0x0e, 0x18, 0xa8, 0x44 }, + { 0xa3, 0x84, 0x7f, 0x2d, 0xad, 0xd4, 0x76, 0x47, 0xde, 0x32, 0x1c, + 0xec, 0x4a, 0xc4, 0x30, 0xf6, 0x20, 0x23, 0x85, 0x6c, 0xfb, 0xb2, + 0x07, 0x04, 0xf4, 0xec, 0x0b, 0xb9, 0x20, 0xba, 0x86, 0xc3 }, + { 0xf7, 0x5e, 0xa0, 0xf2, 0x10, 0xa8, 0xf6, 0x05, 0x94, 0x01, 0xbe, + 0xb4, 0xbc, 0x44, 0x78, 0xfa, 0x49, 0x69, 0xe6, 0x23, 0xd0, 0x1a, + 0xda, 0x69, 0x6a, 0x7e, 0x4c, 0x7e, 0x51, 0x25, 0xb3, 0x48 }, + { 0x25, 0xcf, 0x08, 0xf5, 0xe9, 0xe2, 0x5e, 0x53, 0x60, 0xaa, 0xd2, + 0xb2, 0xd0, 0x85, 0xfa, 0x54, 0xd8, 0x35, 0xe8, 0xd4, 0x66, 0x82, + 0x64, 0x98, 0xd9, 0xa8, 0x87, 0x75, 0x65, 0x70, 0x5a, 0x8a }, + { 0x86, 0x95, 0x80, 0xec, 0x17, 0xe4, 0x85, 0xf1, 0x8c, 0x0c, 0x66, + 0xf1, 0x7c, 0xc0, 0x7c, 0xbb, 0x22, 0xfc, 0xe4, 0x66, 0xda, 0x61, + 0x0b, 0x63, 0xaf, 0x62, 0xbc, 0x83, 0xb4, 0x69, 0x2f, 0x3a }, }; /* KEYs */ static const uint8_t IVs[][16] = { - { - 0x66, 0x32, 0x0d, 0xb7, 0x31, 0x58, 0xa3, 0x5a, - 0x25, 0x5d, 0x05, 0x17, 0x58, 0xe9, 0x5e, 0xd4 - }, - { - 0x8f, 0x38, 0x5c, 0x2a, 0xec, 0xb0, 0x3b, 0xfb, - 0x32, 0xaf, 0x3c, 0x54, 0xec, 0x18, 0xdb, 0x5c - }, - { - 0x05, 0xef, 0xf7, 0x00, 0xe9, 0xa1, 0x3a, 0xe5, - 0xca, 0x0b, 0xcb, 0xd0, 0x48, 0x47, 0x64, 0xbd - }, - { - 0x33, 0xcd, 0xe3, 0x50, 0x48, 0x47, 0x15, 0x5c, - 0xbb, 0x6f, 0x22, 0x19, 0xba, 0x9b, 0x7d, 0xf5 - }, - { - 0xac, 0x86, 0x21, 0x2b, 0xaa, 0x1a, 0x55, 0xa2, - 0xbe, 0x70, 0xb5, 0x73, 0x3b, 0x04, 0x5c, 0xd3 - }, - { - 0xac, 0x5b, 0xf3, 0x8e, 0x4c, 0xd7, 0x2d, 0x9b, - 0x09, 0x42, 0xe5, 0x06, 0xc4, 0x33, 0xaf, 0xcd - }, - { - 0x3e, 0x05, 0xf1, 0xec, 0xd9, 0x67, 0x33, 0xb7, - 0x99, 0x50, 0xa3, 0xe3, 0x14, 0xd3, 0xd9, 0x34 - }, - { - 0x84, 0x53, 0x3a, 0x94, 0xfb, 0x31, 0x99, 0x90, - 0x32, 0x57, 0x44, 0xee, 0x9b, 0xbc, 0xe9, 0xe5 - }, - { - 0x3f, 0x62, 0x80, 0x29, 0x44, 0xde, 0x7c, 0xa5, - 0x89, 0x4e, 0x57, 0x59, 0xd3, 0x51, 0xad, 0xac - }, - { - 0xff, 0xaf, 0x27, 0x16, 0x93, 0xac, 0x07, 0x1f, - 0xb8, 0x6d, 0x11, 0x34, 0x2d, 0x8d, 0xef, 0x4f - }, + { 0x66, 0x32, 0x0d, 0xb7, 0x31, 0x58, 0xa3, 0x5a, 0x25, 0x5d, 0x05, 0x17, 0x58, 0xe9, 0x5e, + 0xd4 }, + { 0x8f, 0x38, 0x5c, 0x2a, 0xec, 0xb0, 0x3b, 0xfb, 0x32, 0xaf, 0x3c, 0x54, 0xec, 0x18, 0xdb, + 0x5c }, + { 0x05, 0xef, 0xf7, 0x00, 0xe9, 0xa1, 0x3a, 0xe5, 0xca, 0x0b, 0xcb, 0xd0, 0x48, 0x47, 0x64, + 0xbd }, + { 0x33, 0xcd, 0xe3, 0x50, 0x48, 0x47, 0x15, 0x5c, 0xbb, 0x6f, 0x22, 0x19, 0xba, 0x9b, 0x7d, + 0xf5 }, + { 0xac, 0x86, 0x21, 0x2b, 0xaa, 0x1a, 0x55, 0xa2, 0xbe, 0x70, 0xb5, 0x73, 0x3b, 0x04, 0x5c, + 0xd3 }, + { 0xac, 0x5b, 0xf3, 0x8e, 0x4c, 0xd7, 0x2d, 0x9b, 0x09, 0x42, 0xe5, 0x06, 0xc4, 0x33, 0xaf, + 0xcd }, + { 0x3e, 0x05, 0xf1, 0xec, 0xd9, 0x67, 0x33, 0xb7, 0x99, 0x50, 0xa3, 0xe3, 0x14, 0xd3, 0xd9, + 0x34 }, + { 0x84, 0x53, 0x3a, 0x94, 0xfb, 0x31, 0x99, 0x90, 0x32, 0x57, 0x44, 0xee, 0x9b, 0xbc, 0xe9, + 0xe5 }, + { 0x3f, 0x62, 0x80, 0x29, 0x44, 0xde, 0x7c, 0xa5, 0x89, 0x4e, 0x57, 0x59, 0xd3, 0x51, 0xad, + 0xac }, + { 0xff, 0xaf, 0x27, 0x16, 0x93, 0xac, 0x07, 0x1f, 0xb8, 0x6d, 0x11, 0x34, 0x2d, 0x8d, 0xef, + 0x4f }, }; /* IVs */ static const uint8_t PLAIN_1[] = { 0x89 }; @@ -263,634 +167,436 @@ static const uint8_t CIPHER_1_MAX_KEY_IV[] = { 0xb9 }; static const uint8_t CIPHER_1_ZERO_KEY_IV[] = { 0xe0 }; static const uint8_t CIPHER_1_MAX_IV[] = { 0x35 }; static const uint8_t CIPHER_1_ZERO_IV[] = { 0x03 }; -static const uint8_t PLAIN_8[] = { - 0xd4, 0xb6, 0x63, 0x35, 0xc1, 0xc7, 0xe4, 0x24 }; -static const uint8_t CIPHER_8[] = { - 0x46, 0xde, 0xc7, 0xed, 0xc3, 0xff, 0x4b, 0xd2 }; -static const uint8_t CIPHER_8_ZERO_KEY[] = { - 0xbc, 0xd6, 0xd0, 0x0d, 0x57, 0x36, 0x7d, 0x3b }; -static const uint8_t CIPHER_8_MAX_KEY[] = { - 0x7a, 0x47, 0x95, 0x16, 0xee, 0x25, 0xdd, 0x37 }; -static const uint8_t CIPHER_8_MAX_KEY_IV[] = { - 0xe4, 0xc0, 0x6a, 0xce, 0xd1, 0xd7, 0xf6, 0x70 }; -static const uint8_t CIPHER_8_ZERO_KEY_IV[] = { - 0xbd, 0x7c, 0x0e, 0x9a, 0x5b, 0x24, 0x53, 0x09 }; -static const uint8_t CIPHER_8_MAX_IV[] = { - 0xab, 0x8b, 0xf1, 0xb2, 0xa5, 0xfb, 0x20, 0xfc }; -static const uint8_t CIPHER_8_ZERO_IV[] = { - 0x70, 0xe9, 0x3f, 0x73, 0x20, 0xe0, 0xf6, 0xe5 }; -static const uint8_t PLAIN_15[] = { - 0x83, 0x67, 0xd8, 0xed, 0x96, 0x12, 0xec, 0x45, - 0x39, 0x02, 0xd8, 0xe5, 0x0a, 0xf8, 0x9d -}; -static const uint8_t CIPHER_15[] = { - 0xd3, 0x15, 0x8d, 0x06, 0x49, 0x58, 0xcc, 0x57, - 0xc4, 0xa7, 0x39, 0x38, 0x9b, 0x25, 0xb6 -}; -static const uint8_t CIPHER_15_ZERO_KEY[] = { - 0x6e, 0xdd, 0x4a, 0xda, 0xf2, 0x30, 0x33, 0x57, - 0x74, 0x59, 0xd1, 0xbc, 0xe8, 0x40, 0xd5 -}; -static const uint8_t CIPHER_15_MAX_KEY[] = { - 0xb3, 0xd5, 0xa1, 0x7e, 0x78, 0xa0, 0x13, 0xb5, - 0xa8, 0xa8, 0x22, 0x86, 0xfc, 0x83, 0xc1 -}; -static const uint8_t CIPHER_15_MAX_KEY_IV[] = { - 0xb3, 0x11, 0xd1, 0x16, 0x86, 0x02, 0xfe, 0x11, - 0x72, 0xc3, 0xad, 0x06, 0x1d, 0x03, 0xb8 -}; -static const uint8_t CIPHER_15_ZERO_KEY_IV[] = { - 0xea, 0xad, 0xb5, 0x42, 0x0c, 0xf1, 0x5b, 0x68, - 0x88, 0x36, 0x70, 0xbf, 0x89, 0x86, 0xdc -}; -static const uint8_t CIPHER_15_MAX_IV[] = { - 0x3e, 0x43, 0x7d, 0x8b, 0xaa, 0xc6, 0x2d, 0x78, - 0x37, 0x16, 0x0f, 0xe9, 0xdd, 0x09, 0xc8 -}; -static const uint8_t CIPHER_15_ZERO_IV[] = { - 0x8c, 0x30, 0x1f, 0x67, 0x2e, 0xcf, 0x0d, 0x6f, - 0xea, 0x8b, 0x83, 0x51, 0x8a, 0x4f, 0x32 -}; -static const uint8_t PLAIN_16[] = { - 0x77, 0x09, 0xd1, 0xa5, 0x96, 0xc1, 0xf4, 0x1f, - 0x95, 0xaa, 0x82, 0xca, 0x6c, 0x49, 0xae, 0x90 -}; -static const uint8_t CIPHER_16[] = { - 0x16, 0x4c, 0x52, 0xa5, 0xed, 0x36, 0x8f, 0xaf, - 0x34, 0x17, 0x3b, 0x25, 0xd7, 0xb9, 0x96, 0x86 -}; -static const uint8_t CIPHER_16_ZERO_KEY[] = { - 0xae, 0xb6, 0x70, 0x05, 0x7c, 0xc2, 0xc0, 0x2b, - 0xcd, 0x8b, 0xc3, 0x60, 0x80, 0x61, 0xe5, 0x50 -}; -static const uint8_t CIPHER_16_MAX_KEY[] = { - 0x96, 0x19, 0xac, 0xd2, 0x52, 0xbf, 0xfb, 0x24, - 0x34, 0x82, 0x0c, 0xd1, 0xd9, 0x21, 0x41, 0xe9 -}; -static const uint8_t CIPHER_16_MAX_KEY_IV[] = { - 0x47, 0x7f, 0xd8, 0x5e, 0x86, 0xd1, 0xe6, 0x4b, - 0xde, 0x6b, 0xf7, 0x29, 0x7b, 0xb2, 0x8b, 0x6f -}; -static const uint8_t CIPHER_16_ZERO_KEY_IV[] = { - 0x1e, 0xc3, 0xbc, 0x0a, 0x0c, 0x22, 0x43, 0x32, - 0x24, 0x9e, 0x2a, 0x90, 0xef, 0x37, 0xef, 0x0d -}; -static const uint8_t CIPHER_16_MAX_IV[] = { - 0x70, 0x3d, 0x33, 0xd6, 0xae, 0xc6, 0x27, 0x47, - 0x57, 0xf7, 0xfa, 0x57, 0x77, 0xab, 0x6b, 0x14 -}; -static const uint8_t CIPHER_16_ZERO_IV[] = { - 0x41, 0x1c, 0xe0, 0xe4, 0x41, 0x7c, 0x9a, 0xa6, - 0xff, 0x00, 0x00, 0x83, 0xe6, 0xf9, 0xea, 0x8a -}; -static const uint8_t PLAIN_17[] = { - 0xcd, 0x16, 0x68, 0xba, 0xac, 0x7a, 0xa6, 0xf2, - 0xb4, 0xa8, 0xca, 0x99, 0xb2, 0xc2, 0x37, 0x2a, - 0xcb -}; -static const uint8_t CIPHER_17[] = { - 0xd4, 0x61, 0x94, 0x70, 0x87, 0x9b, 0x83, 0xa8, - 0x1f, 0xc9, 0x94, 0xc4, 0x91, 0x4f, 0xa8, 0xe4, - 0x29 -}; -static const uint8_t CIPHER_17_ZERO_KEY[] = { - 0x02, 0x78, 0xe0, 0xce, 0xed, 0xab, 0xeb, 0xb0, - 0x19, 0x65, 0xf5, 0xac, 0x31, 0x21, 0x1e, 0x43, - 0xf0 -}; -static const uint8_t CIPHER_17_MAX_KEY[] = { - 0xbb, 0xce, 0x3a, 0x68, 0x13, 0x27, 0x79, 0xc9, - 0x45, 0x71, 0x2f, 0x6d, 0x20, 0xb4, 0x00, 0x06, - 0xd5 -}; -static const uint8_t CIPHER_17_MAX_KEY_IV[] = { - 0xfd, 0x60, 0x61, 0x41, 0xbc, 0x6a, 0xb4, 0xa6, - 0xff, 0x69, 0xbf, 0x7a, 0xa5, 0x39, 0x12, 0xd5, - 0xf8 -}; -static const uint8_t CIPHER_17_ZERO_KEY_IV[] = { - 0xa4, 0xdc, 0x05, 0x15, 0x36, 0x99, 0x11, 0xdf, - 0x05, 0x9c, 0x62, 0xc3, 0x31, 0xbc, 0x76, 0xb7, - 0x27 -}; -static const uint8_t CIPHER_17_MAX_IV[] = { - 0x6c, 0x12, 0x44, 0x15, 0x4d, 0x28, 0xf1, 0xdb, - 0x5f, 0x3c, 0x49, 0x88, 0xa1, 0xb6, 0xce, 0x84, - 0x5f -}; -static const uint8_t CIPHER_17_ZERO_IV[] = { - 0x0a, 0x61, 0x65, 0x53, 0x74, 0x0e, 0x7e, 0x01, - 0x61, 0xd2, 0xb2, 0xc9, 0x91, 0x3c, 0x80, 0x01, - 0xda -}; -static const uint8_t PLAIN_48[] = { - 0x08, 0xcf, 0x61, 0xc9, 0xc3, 0x80, 0x5e, 0x6e, - 0x03, 0x28, 0xda, 0x4c, 0xd7, 0x6a, 0x19, 0xed, - 0xd2, 0xd3, 0x99, 0x4c, 0x79, 0x8b, 0x00, 0x22, - 0x56, 0x9a, 0xd4, 0x18, 0xd1, 0xfe, 0xe4, 0xd9, - 0xcd, 0x45, 0xa3, 0x91, 0xc6, 0x01, 0xff, 0xc9, - 0x2a, 0xd9, 0x15, 0x01, 0x43, 0x2f, 0xee, 0x15 -}; -static const uint8_t CIPHER_48[] = { - 0xcd, 0x4a, 0x37, 0x9b, 0xc4, 0x8b, 0xa1, 0xd4, - 0xda, 0x27, 0x68, 0x12, 0xdf, 0xce, 0x9c, 0x32, - 0x8a, 0x59, 0x1e, 0x3e, 0x37, 0xe0, 0x04, 0xf7, - 0xae, 0x31, 0x2f, 0xed, 0xe6, 0x0d, 0x78, 0x7c, - 0xe6, 0xd1, 0x6a, 0xde, 0x99, 0xb3, 0x0e, 0x42, - 0xca, 0x83, 0x62, 0x60, 0x99, 0xa7, 0x6f, 0xcc -}; -static const uint8_t CIPHER_48_ZERO_KEY[] = { - 0xed, 0x78, 0x21, 0x2b, 0x90, 0xa3, 0xd4, 0x3d, - 0xe9, 0x84, 0x77, 0x37, 0xca, 0xa6, 0x16, 0xa9, - 0x5d, 0x84, 0x2f, 0x25, 0xb0, 0xb9, 0x38, 0x8b, - 0xde, 0x28, 0x66, 0xee, 0x35, 0xe0, 0x05, 0x56, - 0x16, 0x40, 0x68, 0xcf, 0xcd, 0x33, 0xdc, 0xb8, - 0xe4, 0x74, 0x23, 0xf9, 0xef, 0xcf, 0x92, 0xc5 -}; -static const uint8_t CIPHER_48_MAX_KEY[] = { - 0x92, 0x9a, 0xd1, 0x31, 0x54, 0x33, 0xdb, 0x09, - 0x18, 0x43, 0x31, 0xb9, 0x04, 0x6f, 0x2e, 0x32, - 0x82, 0x25, 0x2d, 0xbf, 0x9e, 0x7b, 0x56, 0xd3, - 0xc8, 0x20, 0xd7, 0x5f, 0xb4, 0x34, 0x13, 0x9e, - 0xc1, 0x55, 0x44, 0xc1, 0xd0, 0xac, 0x61, 0x5b, - 0x27, 0x59, 0xc8, 0x23, 0x2d, 0x00, 0xf2, 0x95 -}; -static const uint8_t CIPHER_48_MAX_KEY_IV[] = { - 0x38, 0xb9, 0x68, 0x32, 0xd3, 0x90, 0x4c, 0x3a, - 0x48, 0xe9, 0xaf, 0xaf, 0xc0, 0x91, 0x3c, 0x12, - 0xe1, 0xde, 0x94, 0xae, 0x23, 0x7d, 0xaa, 0xf3, - 0x53, 0x9f, 0x6c, 0x83, 0xcf, 0xf7, 0x4c, 0x35, - 0x10, 0x03, 0xd1, 0x5d, 0x7d, 0x99, 0x38, 0x3b, - 0xee, 0x3b, 0x5f, 0xf4, 0x64, 0x07, 0xd8, 0xdd -}; -static const uint8_t CIPHER_48_ZERO_KEY_IV[] = { - 0x61, 0x05, 0x0c, 0x66, 0x59, 0x63, 0xe9, 0x43, - 0xb2, 0x1c, 0x72, 0x16, 0x54, 0x14, 0x58, 0x70, - 0x3e, 0xdb, 0x33, 0x9f, 0xe4, 0xf0, 0x0f, 0x22, - 0xcd, 0xfa, 0x66, 0x94, 0x82, 0xbd, 0xe4, 0x34, - 0x49, 0xee, 0x56, 0x05, 0x3d, 0x09, 0x58, 0x38, - 0xd9, 0x7b, 0xca, 0x19, 0xa5, 0x38, 0x86, 0x2e -}; -static const uint8_t CIPHER_48_MAX_IV[] = { - 0xba, 0xf1, 0x73, 0xa1, 0x57, 0x58, 0xf1, 0xf1, - 0x6b, 0x9e, 0x41, 0xa8, 0xc7, 0xdd, 0xef, 0x13, - 0x1e, 0x91, 0xb1, 0x45, 0x70, 0x5b, 0x83, 0x40, - 0x42, 0x5d, 0x70, 0xcf, 0x01, 0x7c, 0x8a, 0x90, - 0x0c, 0x10, 0x3b, 0x6d, 0xdd, 0x81, 0x04, 0xa2, - 0x66, 0x6e, 0x0f, 0xaf, 0xf3, 0x75, 0x92, 0x1f -}; -static const uint8_t CIPHER_48_ZERO_IV[] = { - 0x23, 0x46, 0x9f, 0xcd, 0x94, 0xd4, 0x9a, 0x62, - 0x5e, 0x37, 0xe9, 0x11, 0xc2, 0x90, 0x22, 0x16, - 0xe3, 0x78, 0xaf, 0x06, 0x9e, 0xf8, 0x68, 0x43, - 0x85, 0x20, 0x28, 0xae, 0xc6, 0x2e, 0x71, 0x64, - 0x4d, 0x4b, 0xae, 0xbf, 0x94, 0x69, 0x4c, 0xf4, - 0x6c, 0x93, 0xb0, 0x81, 0x40, 0xaf, 0xf2, 0x27 -}; -static const uint8_t PLAIN_63[] = { - 0x02, 0x87, 0x61, 0x7c, 0x13, 0x62, 0x9e, 0x69, - 0xfc, 0x72, 0x81, 0xcd, 0x71, 0x65, 0xa6, 0x3e, - 0xab, 0x49, 0xcf, 0x71, 0x4b, 0xce, 0x3a, 0x75, - 0xa7, 0x4f, 0x76, 0xea, 0x7e, 0x64, 0xff, 0x81, - 0xeb, 0x61, 0xfd, 0xfe, 0xc3, 0x9b, 0x67, 0xbf, - 0x0d, 0xe9, 0x8c, 0x7e, 0x4e, 0x32, 0xbd, 0xf9, - 0x7c, 0x8c, 0x6a, 0xc7, 0x5b, 0xa4, 0x3c, 0x02, - 0xf4, 0xb2, 0xed, 0x72, 0x16, 0xec, 0xf3 -}; -static const uint8_t CIPHER_63[] = { - 0xbf, 0xc8, 0x9e, 0x4c, 0xcf, 0x93, 0x3e, 0x48, - 0x66, 0xe3, 0xc8, 0x15, 0x4d, 0xf9, 0x54, 0xcd, - 0x9a, 0x03, 0xae, 0xac, 0x2e, 0x8a, 0xa1, 0x83, - 0xfb, 0x25, 0xa1, 0xe3, 0x9b, 0xd0, 0x8f, 0x46, - 0x19, 0x0d, 0x25, 0x12, 0xd6, 0x97, 0x41, 0x79, - 0xe9, 0x7e, 0x57, 0x56, 0x9a, 0x27, 0xa2, 0x24, - 0x8e, 0x04, 0xf2, 0x20, 0x42, 0xcf, 0xff, 0x3e, - 0x15, 0x4a, 0x1b, 0x9b, 0x57, 0x2e, 0xf7 -}; +static const uint8_t PLAIN_8[] = { 0xd4, 0xb6, 0x63, 0x35, 0xc1, 0xc7, 0xe4, 0x24 }; +static const uint8_t CIPHER_8[] = { 0x46, 0xde, 0xc7, 0xed, 0xc3, 0xff, 0x4b, 0xd2 }; +static const uint8_t CIPHER_8_ZERO_KEY[] = { 0xbc, 0xd6, 0xd0, 0x0d, 0x57, 0x36, 0x7d, 0x3b }; +static const uint8_t CIPHER_8_MAX_KEY[] = { 0x7a, 0x47, 0x95, 0x16, 0xee, 0x25, 0xdd, 0x37 }; +static const uint8_t CIPHER_8_MAX_KEY_IV[] = { 0xe4, 0xc0, 0x6a, 0xce, 0xd1, 0xd7, 0xf6, 0x70 }; +static const uint8_t CIPHER_8_ZERO_KEY_IV[] = { 0xbd, 0x7c, 0x0e, 0x9a, 0x5b, 0x24, 0x53, 0x09 }; +static const uint8_t CIPHER_8_MAX_IV[] = { 0xab, 0x8b, 0xf1, 0xb2, 0xa5, 0xfb, 0x20, 0xfc }; +static const uint8_t CIPHER_8_ZERO_IV[] = { 0x70, 0xe9, 0x3f, 0x73, 0x20, 0xe0, 0xf6, 0xe5 }; +static const uint8_t PLAIN_15[] = { 0x83, 0x67, 0xd8, 0xed, 0x96, 0x12, 0xec, 0x45, + 0x39, 0x02, 0xd8, 0xe5, 0x0a, 0xf8, 0x9d }; +static const uint8_t CIPHER_15[] = { 0xd3, 0x15, 0x8d, 0x06, 0x49, 0x58, 0xcc, 0x57, + 0xc4, 0xa7, 0x39, 0x38, 0x9b, 0x25, 0xb6 }; +static const uint8_t CIPHER_15_ZERO_KEY[] = { 0x6e, 0xdd, 0x4a, 0xda, 0xf2, 0x30, 0x33, 0x57, + 0x74, 0x59, 0xd1, 0xbc, 0xe8, 0x40, 0xd5 }; +static const uint8_t CIPHER_15_MAX_KEY[] = { 0xb3, 0xd5, 0xa1, 0x7e, 0x78, 0xa0, 0x13, 0xb5, + 0xa8, 0xa8, 0x22, 0x86, 0xfc, 0x83, 0xc1 }; +static const uint8_t CIPHER_15_MAX_KEY_IV[] = { 0xb3, 0x11, 0xd1, 0x16, 0x86, 0x02, 0xfe, 0x11, + 0x72, 0xc3, 0xad, 0x06, 0x1d, 0x03, 0xb8 }; +static const uint8_t CIPHER_15_ZERO_KEY_IV[] = { 0xea, 0xad, 0xb5, 0x42, 0x0c, 0xf1, 0x5b, 0x68, + 0x88, 0x36, 0x70, 0xbf, 0x89, 0x86, 0xdc }; +static const uint8_t CIPHER_15_MAX_IV[] = { 0x3e, 0x43, 0x7d, 0x8b, 0xaa, 0xc6, 0x2d, 0x78, + 0x37, 0x16, 0x0f, 0xe9, 0xdd, 0x09, 0xc8 }; +static const uint8_t CIPHER_15_ZERO_IV[] = { 0x8c, 0x30, 0x1f, 0x67, 0x2e, 0xcf, 0x0d, 0x6f, + 0xea, 0x8b, 0x83, 0x51, 0x8a, 0x4f, 0x32 }; +static const uint8_t PLAIN_16[] = { 0x77, 0x09, 0xd1, 0xa5, 0x96, 0xc1, 0xf4, 0x1f, + 0x95, 0xaa, 0x82, 0xca, 0x6c, 0x49, 0xae, 0x90 }; +static const uint8_t CIPHER_16[] = { 0x16, 0x4c, 0x52, 0xa5, 0xed, 0x36, 0x8f, 0xaf, + 0x34, 0x17, 0x3b, 0x25, 0xd7, 0xb9, 0x96, 0x86 }; +static const uint8_t CIPHER_16_ZERO_KEY[] = { 0xae, 0xb6, 0x70, 0x05, 0x7c, 0xc2, 0xc0, 0x2b, + 0xcd, 0x8b, 0xc3, 0x60, 0x80, 0x61, 0xe5, 0x50 }; +static const uint8_t CIPHER_16_MAX_KEY[] = { 0x96, 0x19, 0xac, 0xd2, 0x52, 0xbf, 0xfb, 0x24, + 0x34, 0x82, 0x0c, 0xd1, 0xd9, 0x21, 0x41, 0xe9 }; +static const uint8_t CIPHER_16_MAX_KEY_IV[] = { 0x47, 0x7f, 0xd8, 0x5e, 0x86, 0xd1, 0xe6, 0x4b, + 0xde, 0x6b, 0xf7, 0x29, 0x7b, 0xb2, 0x8b, 0x6f }; +static const uint8_t CIPHER_16_ZERO_KEY_IV[] = { 0x1e, 0xc3, 0xbc, 0x0a, 0x0c, 0x22, 0x43, 0x32, + 0x24, 0x9e, 0x2a, 0x90, 0xef, 0x37, 0xef, 0x0d }; +static const uint8_t CIPHER_16_MAX_IV[] = { 0x70, 0x3d, 0x33, 0xd6, 0xae, 0xc6, 0x27, 0x47, + 0x57, 0xf7, 0xfa, 0x57, 0x77, 0xab, 0x6b, 0x14 }; +static const uint8_t CIPHER_16_ZERO_IV[] = { 0x41, 0x1c, 0xe0, 0xe4, 0x41, 0x7c, 0x9a, 0xa6, + 0xff, 0x00, 0x00, 0x83, 0xe6, 0xf9, 0xea, 0x8a }; +static const uint8_t PLAIN_17[] = { 0xcd, 0x16, 0x68, 0xba, 0xac, 0x7a, 0xa6, 0xf2, 0xb4, + 0xa8, 0xca, 0x99, 0xb2, 0xc2, 0x37, 0x2a, 0xcb }; +static const uint8_t CIPHER_17[] = { 0xd4, 0x61, 0x94, 0x70, 0x87, 0x9b, 0x83, 0xa8, 0x1f, + 0xc9, 0x94, 0xc4, 0x91, 0x4f, 0xa8, 0xe4, 0x29 }; +static const uint8_t CIPHER_17_ZERO_KEY[] = { 0x02, 0x78, 0xe0, 0xce, 0xed, 0xab, 0xeb, 0xb0, 0x19, + 0x65, 0xf5, 0xac, 0x31, 0x21, 0x1e, 0x43, 0xf0 }; +static const uint8_t CIPHER_17_MAX_KEY[] = { 0xbb, 0xce, 0x3a, 0x68, 0x13, 0x27, 0x79, 0xc9, 0x45, + 0x71, 0x2f, 0x6d, 0x20, 0xb4, 0x00, 0x06, 0xd5 }; +static const uint8_t CIPHER_17_MAX_KEY_IV[] = { 0xfd, 0x60, 0x61, 0x41, 0xbc, 0x6a, + 0xb4, 0xa6, 0xff, 0x69, 0xbf, 0x7a, + 0xa5, 0x39, 0x12, 0xd5, 0xf8 }; +static const uint8_t CIPHER_17_ZERO_KEY_IV[] = { 0xa4, 0xdc, 0x05, 0x15, 0x36, 0x99, + 0x11, 0xdf, 0x05, 0x9c, 0x62, 0xc3, + 0x31, 0xbc, 0x76, 0xb7, 0x27 }; +static const uint8_t CIPHER_17_MAX_IV[] = { 0x6c, 0x12, 0x44, 0x15, 0x4d, 0x28, 0xf1, 0xdb, 0x5f, + 0x3c, 0x49, 0x88, 0xa1, 0xb6, 0xce, 0x84, 0x5f }; +static const uint8_t CIPHER_17_ZERO_IV[] = { 0x0a, 0x61, 0x65, 0x53, 0x74, 0x0e, 0x7e, 0x01, 0x61, + 0xd2, 0xb2, 0xc9, 0x91, 0x3c, 0x80, 0x01, 0xda }; +static const uint8_t PLAIN_48[] = { 0x08, 0xcf, 0x61, 0xc9, 0xc3, 0x80, 0x5e, 0x6e, 0x03, 0x28, + 0xda, 0x4c, 0xd7, 0x6a, 0x19, 0xed, 0xd2, 0xd3, 0x99, 0x4c, + 0x79, 0x8b, 0x00, 0x22, 0x56, 0x9a, 0xd4, 0x18, 0xd1, 0xfe, + 0xe4, 0xd9, 0xcd, 0x45, 0xa3, 0x91, 0xc6, 0x01, 0xff, 0xc9, + 0x2a, 0xd9, 0x15, 0x01, 0x43, 0x2f, 0xee, 0x15 }; +static const uint8_t CIPHER_48[] = { 0xcd, 0x4a, 0x37, 0x9b, 0xc4, 0x8b, 0xa1, 0xd4, 0xda, 0x27, + 0x68, 0x12, 0xdf, 0xce, 0x9c, 0x32, 0x8a, 0x59, 0x1e, 0x3e, + 0x37, 0xe0, 0x04, 0xf7, 0xae, 0x31, 0x2f, 0xed, 0xe6, 0x0d, + 0x78, 0x7c, 0xe6, 0xd1, 0x6a, 0xde, 0x99, 0xb3, 0x0e, 0x42, + 0xca, 0x83, 0x62, 0x60, 0x99, 0xa7, 0x6f, 0xcc }; +static const uint8_t CIPHER_48_ZERO_KEY[] = { 0xed, 0x78, 0x21, 0x2b, 0x90, 0xa3, 0xd4, 0x3d, + 0xe9, 0x84, 0x77, 0x37, 0xca, 0xa6, 0x16, 0xa9, + 0x5d, 0x84, 0x2f, 0x25, 0xb0, 0xb9, 0x38, 0x8b, + 0xde, 0x28, 0x66, 0xee, 0x35, 0xe0, 0x05, 0x56, + 0x16, 0x40, 0x68, 0xcf, 0xcd, 0x33, 0xdc, 0xb8, + 0xe4, 0x74, 0x23, 0xf9, 0xef, 0xcf, 0x92, 0xc5 }; +static const uint8_t CIPHER_48_MAX_KEY[] = { 0x92, 0x9a, 0xd1, 0x31, 0x54, 0x33, 0xdb, 0x09, + 0x18, 0x43, 0x31, 0xb9, 0x04, 0x6f, 0x2e, 0x32, + 0x82, 0x25, 0x2d, 0xbf, 0x9e, 0x7b, 0x56, 0xd3, + 0xc8, 0x20, 0xd7, 0x5f, 0xb4, 0x34, 0x13, 0x9e, + 0xc1, 0x55, 0x44, 0xc1, 0xd0, 0xac, 0x61, 0x5b, + 0x27, 0x59, 0xc8, 0x23, 0x2d, 0x00, 0xf2, 0x95 }; +static const uint8_t CIPHER_48_MAX_KEY_IV[] = { 0x38, 0xb9, 0x68, 0x32, 0xd3, 0x90, 0x4c, 0x3a, + 0x48, 0xe9, 0xaf, 0xaf, 0xc0, 0x91, 0x3c, 0x12, + 0xe1, 0xde, 0x94, 0xae, 0x23, 0x7d, 0xaa, 0xf3, + 0x53, 0x9f, 0x6c, 0x83, 0xcf, 0xf7, 0x4c, 0x35, + 0x10, 0x03, 0xd1, 0x5d, 0x7d, 0x99, 0x38, 0x3b, + 0xee, 0x3b, 0x5f, 0xf4, 0x64, 0x07, 0xd8, 0xdd }; +static const uint8_t CIPHER_48_ZERO_KEY_IV[] = { 0x61, 0x05, 0x0c, 0x66, 0x59, 0x63, 0xe9, 0x43, + 0xb2, 0x1c, 0x72, 0x16, 0x54, 0x14, 0x58, 0x70, + 0x3e, 0xdb, 0x33, 0x9f, 0xe4, 0xf0, 0x0f, 0x22, + 0xcd, 0xfa, 0x66, 0x94, 0x82, 0xbd, 0xe4, 0x34, + 0x49, 0xee, 0x56, 0x05, 0x3d, 0x09, 0x58, 0x38, + 0xd9, 0x7b, 0xca, 0x19, 0xa5, 0x38, 0x86, 0x2e }; +static const uint8_t CIPHER_48_MAX_IV[] = { 0xba, 0xf1, 0x73, 0xa1, 0x57, 0x58, 0xf1, 0xf1, + 0x6b, 0x9e, 0x41, 0xa8, 0xc7, 0xdd, 0xef, 0x13, + 0x1e, 0x91, 0xb1, 0x45, 0x70, 0x5b, 0x83, 0x40, + 0x42, 0x5d, 0x70, 0xcf, 0x01, 0x7c, 0x8a, 0x90, + 0x0c, 0x10, 0x3b, 0x6d, 0xdd, 0x81, 0x04, 0xa2, + 0x66, 0x6e, 0x0f, 0xaf, 0xf3, 0x75, 0x92, 0x1f }; +static const uint8_t CIPHER_48_ZERO_IV[] = { 0x23, 0x46, 0x9f, 0xcd, 0x94, 0xd4, 0x9a, 0x62, + 0x5e, 0x37, 0xe9, 0x11, 0xc2, 0x90, 0x22, 0x16, + 0xe3, 0x78, 0xaf, 0x06, 0x9e, 0xf8, 0x68, 0x43, + 0x85, 0x20, 0x28, 0xae, 0xc6, 0x2e, 0x71, 0x64, + 0x4d, 0x4b, 0xae, 0xbf, 0x94, 0x69, 0x4c, 0xf4, + 0x6c, 0x93, 0xb0, 0x81, 0x40, 0xaf, 0xf2, 0x27 }; +static const uint8_t PLAIN_63[] = { 0x02, 0x87, 0x61, 0x7c, 0x13, 0x62, 0x9e, 0x69, 0xfc, + 0x72, 0x81, 0xcd, 0x71, 0x65, 0xa6, 0x3e, 0xab, 0x49, + 0xcf, 0x71, 0x4b, 0xce, 0x3a, 0x75, 0xa7, 0x4f, 0x76, + 0xea, 0x7e, 0x64, 0xff, 0x81, 0xeb, 0x61, 0xfd, 0xfe, + 0xc3, 0x9b, 0x67, 0xbf, 0x0d, 0xe9, 0x8c, 0x7e, 0x4e, + 0x32, 0xbd, 0xf9, 0x7c, 0x8c, 0x6a, 0xc7, 0x5b, 0xa4, + 0x3c, 0x02, 0xf4, 0xb2, 0xed, 0x72, 0x16, 0xec, 0xf3 }; +static const uint8_t CIPHER_63[] = { 0xbf, 0xc8, 0x9e, 0x4c, 0xcf, 0x93, 0x3e, 0x48, 0x66, + 0xe3, 0xc8, 0x15, 0x4d, 0xf9, 0x54, 0xcd, 0x9a, 0x03, + 0xae, 0xac, 0x2e, 0x8a, 0xa1, 0x83, 0xfb, 0x25, 0xa1, + 0xe3, 0x9b, 0xd0, 0x8f, 0x46, 0x19, 0x0d, 0x25, 0x12, + 0xd6, 0x97, 0x41, 0x79, 0xe9, 0x7e, 0x57, 0x56, 0x9a, + 0x27, 0xa2, 0x24, 0x8e, 0x04, 0xf2, 0x20, 0x42, 0xcf, + 0xff, 0x3e, 0x15, 0x4a, 0x1b, 0x9b, 0x57, 0x2e, 0xf7 }; static const uint8_t CIPHER_63_ZERO_KEY[] = { - 0xd6, 0xb0, 0xe9, 0xb6, 0x89, 0x0c, 0xd0, 0x21, - 0x15, 0x34, 0xf7, 0x47, 0xc2, 0xd9, 0xf9, 0x9c, - 0xcd, 0xec, 0x81, 0xa0, 0x06, 0x58, 0xe9, 0x0d, - 0x6e, 0x12, 0x1d, 0x0e, 0xb4, 0x4a, 0x02, 0xc2, - 0x1d, 0xca, 0x52, 0x69, 0xf1, 0xfd, 0xdc, 0x32, - 0x48, 0x80, 0x94, 0x0f, 0x0c, 0x49, 0xd9, 0x15, - 0x70, 0x87, 0xb0, 0x47, 0x0c, 0xd3, 0x6f, 0x5a, - 0x36, 0x5e, 0x5c, 0x4d, 0x6e, 0x39, 0x49 -}; -static const uint8_t CIPHER_63_MAX_KEY[] = { - 0xe2, 0xfe, 0x73, 0x01, 0x6a, 0xfe, 0x53, 0x9f, - 0xfd, 0x08, 0x83, 0x8c, 0xf5, 0x4f, 0x7a, 0x83, - 0xf2, 0x6d, 0xef, 0x53, 0xfd, 0xa0, 0xf6, 0xa3, - 0x6f, 0xf9, 0x6e, 0xd5, 0xf2, 0xdd, 0x41, 0x94, - 0x41, 0x81, 0x55, 0xe0, 0x6b, 0xdc, 0xf3, 0x77, - 0x8b, 0x1a, 0x8a, 0x69, 0xce, 0xa9, 0xb6, 0x58, - 0xb7, 0x61, 0x42, 0x17, 0x1a, 0xf2, 0x46, 0x42, - 0x78, 0xa8, 0x22, 0xeb, 0x29, 0x7c, 0xb8 -}; + 0xd6, 0xb0, 0xe9, 0xb6, 0x89, 0x0c, 0xd0, 0x21, 0x15, 0x34, 0xf7, 0x47, 0xc2, + 0xd9, 0xf9, 0x9c, 0xcd, 0xec, 0x81, 0xa0, 0x06, 0x58, 0xe9, 0x0d, 0x6e, 0x12, + 0x1d, 0x0e, 0xb4, 0x4a, 0x02, 0xc2, 0x1d, 0xca, 0x52, 0x69, 0xf1, 0xfd, 0xdc, + 0x32, 0x48, 0x80, 0x94, 0x0f, 0x0c, 0x49, 0xd9, 0x15, 0x70, 0x87, 0xb0, 0x47, + 0x0c, 0xd3, 0x6f, 0x5a, 0x36, 0x5e, 0x5c, 0x4d, 0x6e, 0x39, 0x49 +}; +static const uint8_t CIPHER_63_MAX_KEY[] = { 0xe2, 0xfe, 0x73, 0x01, 0x6a, 0xfe, 0x53, 0x9f, 0xfd, + 0x08, 0x83, 0x8c, 0xf5, 0x4f, 0x7a, 0x83, 0xf2, 0x6d, + 0xef, 0x53, 0xfd, 0xa0, 0xf6, 0xa3, 0x6f, 0xf9, 0x6e, + 0xd5, 0xf2, 0xdd, 0x41, 0x94, 0x41, 0x81, 0x55, 0xe0, + 0x6b, 0xdc, 0xf3, 0x77, 0x8b, 0x1a, 0x8a, 0x69, 0xce, + 0xa9, 0xb6, 0x58, 0xb7, 0x61, 0x42, 0x17, 0x1a, 0xf2, + 0x46, 0x42, 0x78, 0xa8, 0x22, 0xeb, 0x29, 0x7c, 0xb8 }; static const uint8_t CIPHER_63_MAX_KEY_IV[] = { - 0x32, 0xf1, 0x68, 0x87, 0x03, 0x72, 0x8c, 0x3d, - 0xb7, 0xb3, 0xf4, 0x2e, 0x66, 0x9e, 0x83, 0xc1, - 0x98, 0x44, 0xc2, 0x93, 0x11, 0x38, 0x90, 0xa4, - 0xa2, 0x4a, 0xce, 0x71, 0x60, 0x6d, 0x57, 0x6d, - 0x36, 0x27, 0x8f, 0x32, 0x78, 0x03, 0xa0, 0x4d, - 0xc9, 0x0b, 0xc6, 0x8b, 0x69, 0x1a, 0x8b, 0x31, - 0x00, 0x4b, 0x50, 0x46, 0x2d, 0x17, 0xa0, 0xeb, - 0xc4, 0x89, 0xd3, 0x04, 0x58, 0x77, 0x10 + 0x32, 0xf1, 0x68, 0x87, 0x03, 0x72, 0x8c, 0x3d, 0xb7, 0xb3, 0xf4, 0x2e, 0x66, + 0x9e, 0x83, 0xc1, 0x98, 0x44, 0xc2, 0x93, 0x11, 0x38, 0x90, 0xa4, 0xa2, 0x4a, + 0xce, 0x71, 0x60, 0x6d, 0x57, 0x6d, 0x36, 0x27, 0x8f, 0x32, 0x78, 0x03, 0xa0, + 0x4d, 0xc9, 0x0b, 0xc6, 0x8b, 0x69, 0x1a, 0x8b, 0x31, 0x00, 0x4b, 0x50, 0x46, + 0x2d, 0x17, 0xa0, 0xeb, 0xc4, 0x89, 0xd3, 0x04, 0x58, 0x77, 0x10 }; static const uint8_t CIPHER_63_ZERO_KEY_IV[] = { - 0x6b, 0x4d, 0x0c, 0xd3, 0x89, 0x81, 0x29, 0x44, - 0x4d, 0x46, 0x29, 0x97, 0xf2, 0x1b, 0xe7, 0xa3, - 0x47, 0x41, 0x65, 0xa2, 0xd6, 0xb5, 0x35, 0x75, - 0x3c, 0x2f, 0xc4, 0x66, 0x2d, 0x27, 0xff, 0x6c, - 0x6f, 0xca, 0x08, 0x6a, 0x38, 0x93, 0xc0, 0x4e, - 0xfe, 0x4b, 0x53, 0x66, 0xa8, 0x25, 0xd5, 0xc2, - 0x34, 0x93, 0xc9, 0xbf, 0x5c, 0x39, 0xf3, 0x06, - 0x2f, 0xe1, 0x58, 0xa4, 0x3f, 0x45, 0x18 -}; -static const uint8_t CIPHER_63_MAX_IV[] = { - 0x0c, 0xbc, 0x6e, 0x7c, 0x67, 0xa7, 0x49, 0x0f, - 0xd9, 0x0a, 0x6e, 0x5a, 0xe0, 0xe0, 0x82, 0xbd, - 0x32, 0x64, 0xdf, 0xe4, 0xec, 0x68, 0x94, 0xe4, - 0x7d, 0x77, 0x44, 0x0d, 0x7f, 0x64, 0xfd, 0xb0, - 0x51, 0xda, 0x68, 0x8a, 0x17, 0x08, 0xce, 0x5d, - 0x0d, 0x56, 0x38, 0x7d, 0x6a, 0xf5, 0x3d, 0x41, - 0x7a, 0xa1, 0xdd, 0xea, 0xd2, 0x58, 0xb0, 0x45, - 0xd0, 0xea, 0xcb, 0xd2, 0x43, 0x5e, 0x4d -}; -static const uint8_t CIPHER_63_ZERO_IV[] = { - 0x90, 0xfb, 0x35, 0x72, 0xf3, 0x45, 0x99, 0xed, - 0x9c, 0x72, 0x8d, 0xd7, 0x14, 0x38, 0xea, 0xd0, - 0xbd, 0xea, 0x2e, 0xd8, 0x27, 0x34, 0xc9, 0xa6, - 0x50, 0x56, 0xb5, 0xd0, 0x8c, 0x6f, 0xe9, 0x40, - 0xbb, 0x98, 0xd2, 0xba, 0xf3, 0x77, 0x1b, 0x79, - 0x8f, 0x8a, 0x88, 0x2b, 0x13, 0x91, 0x86, 0x20, - 0x77, 0x73, 0x5b, 0x7d, 0xef, 0x34, 0xfc, 0xde, - 0x9b, 0xed, 0xff, 0xe1, 0x3d, 0x1d, 0xf5 -}; -static const uint8_t PLAIN_64[] = { - 0x01, 0x4d, 0xf0, 0x00, 0x10, 0x8b, 0x67, 0xcf, - 0x99, 0x50, 0x5b, 0x17, 0x9f, 0x8e, 0xd4, 0x98, - 0x0a, 0x61, 0x03, 0xd1, 0xbc, 0xa7, 0x0d, 0xbe, - 0x9b, 0xbf, 0xab, 0x0e, 0xd5, 0x98, 0x01, 0xd6, - 0xe5, 0xf2, 0xd6, 0xf6, 0x7d, 0x3e, 0xc5, 0x16, - 0x8e, 0x21, 0x2e, 0x2d, 0xaf, 0x02, 0xc6, 0xb9, - 0x63, 0xc9, 0x8a, 0x1f, 0x70, 0x97, 0xde, 0x0c, - 0x56, 0x89, 0x1a, 0x2b, 0x21, 0x1b, 0x01, 0x07 -}; -static const uint8_t CIPHER_64[] = { - 0x34, 0x6c, 0xaa, 0xc1, 0xa3, 0x38, 0xad, 0x4e, - 0xcf, 0x42, 0x89, 0x2e, 0x30, 0xd4, 0x3d, 0xf5, - 0x99, 0xce, 0xeb, 0xe3, 0x15, 0x2d, 0xf4, 0xaa, - 0x51, 0x67, 0x10, 0x8e, 0x75, 0x09, 0xec, 0x45, - 0x31, 0xd6, 0x0d, 0xa3, 0x4d, 0x90, 0x35, 0x37, - 0xb1, 0x16, 0xcb, 0xb5, 0x5c, 0x57, 0xc3, 0x4f, - 0x04, 0x86, 0x07, 0x66, 0x39, 0xb8, 0xba, 0xdf, - 0x4b, 0x70, 0xaf, 0x84, 0x4e, 0x06, 0xd1, 0x8c -}; + 0x6b, 0x4d, 0x0c, 0xd3, 0x89, 0x81, 0x29, 0x44, 0x4d, 0x46, 0x29, 0x97, 0xf2, + 0x1b, 0xe7, 0xa3, 0x47, 0x41, 0x65, 0xa2, 0xd6, 0xb5, 0x35, 0x75, 0x3c, 0x2f, + 0xc4, 0x66, 0x2d, 0x27, 0xff, 0x6c, 0x6f, 0xca, 0x08, 0x6a, 0x38, 0x93, 0xc0, + 0x4e, 0xfe, 0x4b, 0x53, 0x66, 0xa8, 0x25, 0xd5, 0xc2, 0x34, 0x93, 0xc9, 0xbf, + 0x5c, 0x39, 0xf3, 0x06, 0x2f, 0xe1, 0x58, 0xa4, 0x3f, 0x45, 0x18 +}; +static const uint8_t CIPHER_63_MAX_IV[] = { 0x0c, 0xbc, 0x6e, 0x7c, 0x67, 0xa7, 0x49, 0x0f, 0xd9, + 0x0a, 0x6e, 0x5a, 0xe0, 0xe0, 0x82, 0xbd, 0x32, 0x64, + 0xdf, 0xe4, 0xec, 0x68, 0x94, 0xe4, 0x7d, 0x77, 0x44, + 0x0d, 0x7f, 0x64, 0xfd, 0xb0, 0x51, 0xda, 0x68, 0x8a, + 0x17, 0x08, 0xce, 0x5d, 0x0d, 0x56, 0x38, 0x7d, 0x6a, + 0xf5, 0x3d, 0x41, 0x7a, 0xa1, 0xdd, 0xea, 0xd2, 0x58, + 0xb0, 0x45, 0xd0, 0xea, 0xcb, 0xd2, 0x43, 0x5e, 0x4d }; +static const uint8_t CIPHER_63_ZERO_IV[] = { 0x90, 0xfb, 0x35, 0x72, 0xf3, 0x45, 0x99, 0xed, 0x9c, + 0x72, 0x8d, 0xd7, 0x14, 0x38, 0xea, 0xd0, 0xbd, 0xea, + 0x2e, 0xd8, 0x27, 0x34, 0xc9, 0xa6, 0x50, 0x56, 0xb5, + 0xd0, 0x8c, 0x6f, 0xe9, 0x40, 0xbb, 0x98, 0xd2, 0xba, + 0xf3, 0x77, 0x1b, 0x79, 0x8f, 0x8a, 0x88, 0x2b, 0x13, + 0x91, 0x86, 0x20, 0x77, 0x73, 0x5b, 0x7d, 0xef, 0x34, + 0xfc, 0xde, 0x9b, 0xed, 0xff, 0xe1, 0x3d, 0x1d, 0xf5 }; +static const uint8_t PLAIN_64[] = { 0x01, 0x4d, 0xf0, 0x00, 0x10, 0x8b, 0x67, 0xcf, 0x99, 0x50, + 0x5b, 0x17, 0x9f, 0x8e, 0xd4, 0x98, 0x0a, 0x61, 0x03, 0xd1, + 0xbc, 0xa7, 0x0d, 0xbe, 0x9b, 0xbf, 0xab, 0x0e, 0xd5, 0x98, + 0x01, 0xd6, 0xe5, 0xf2, 0xd6, 0xf6, 0x7d, 0x3e, 0xc5, 0x16, + 0x8e, 0x21, 0x2e, 0x2d, 0xaf, 0x02, 0xc6, 0xb9, 0x63, 0xc9, + 0x8a, 0x1f, 0x70, 0x97, 0xde, 0x0c, 0x56, 0x89, 0x1a, 0x2b, + 0x21, 0x1b, 0x01, 0x07 }; +static const uint8_t CIPHER_64[] = { 0x34, 0x6c, 0xaa, 0xc1, 0xa3, 0x38, 0xad, 0x4e, 0xcf, 0x42, + 0x89, 0x2e, 0x30, 0xd4, 0x3d, 0xf5, 0x99, 0xce, 0xeb, 0xe3, + 0x15, 0x2d, 0xf4, 0xaa, 0x51, 0x67, 0x10, 0x8e, 0x75, 0x09, + 0xec, 0x45, 0x31, 0xd6, 0x0d, 0xa3, 0x4d, 0x90, 0x35, 0x37, + 0xb1, 0x16, 0xcb, 0xb5, 0x5c, 0x57, 0xc3, 0x4f, 0x04, 0x86, + 0x07, 0x66, 0x39, 0xb8, 0xba, 0xdf, 0x4b, 0x70, 0xaf, 0x84, + 0x4e, 0x06, 0xd1, 0x8c }; static const uint8_t CIPHER_64_ZERO_KEY[] = { - 0x01, 0xcb, 0x4f, 0x84, 0x1a, 0xdd, 0x1e, 0x20, - 0x4f, 0x7b, 0xb6, 0xe0, 0x81, 0xbc, 0x6b, 0x17, - 0x2e, 0x0d, 0xce, 0x24, 0x64, 0xea, 0x5e, 0xce, - 0x75, 0x27, 0xb5, 0xbd, 0xa0, 0x79, 0x1d, 0x22, - 0xc5, 0xf3, 0xb0, 0x64, 0x65, 0x7c, 0x41, 0x4c, - 0x6a, 0xf7, 0xaf, 0x64, 0x3c, 0x31, 0x89, 0x5f, - 0xb1, 0x45, 0x6b, 0x5b, 0xbf, 0xc6, 0x82, 0x4e, - 0xb4, 0xc3, 0x5d, 0x5d, 0xac, 0x4b, 0x0c, 0xf2 + 0x01, 0xcb, 0x4f, 0x84, 0x1a, 0xdd, 0x1e, 0x20, 0x4f, 0x7b, 0xb6, 0xe0, 0x81, + 0xbc, 0x6b, 0x17, 0x2e, 0x0d, 0xce, 0x24, 0x64, 0xea, 0x5e, 0xce, 0x75, 0x27, + 0xb5, 0xbd, 0xa0, 0x79, 0x1d, 0x22, 0xc5, 0xf3, 0xb0, 0x64, 0x65, 0x7c, 0x41, + 0x4c, 0x6a, 0xf7, 0xaf, 0x64, 0x3c, 0x31, 0x89, 0x5f, 0xb1, 0x45, 0x6b, 0x5b, + 0xbf, 0xc6, 0x82, 0x4e, 0xb4, 0xc3, 0x5d, 0x5d, 0xac, 0x4b, 0x0c, 0xf2 }; static const uint8_t CIPHER_64_MAX_KEY[] = { - 0xa3, 0x4a, 0x7d, 0xdc, 0xb2, 0x9d, 0xab, 0xf3, - 0xf4, 0xb8, 0xa3, 0x48, 0x4a, 0xf3, 0x24, 0x45, - 0xd5, 0xa3, 0x19, 0xfc, 0xa4, 0x03, 0xdc, 0xc6, - 0xd4, 0x1f, 0x2d, 0xc4, 0xb4, 0xfc, 0xd6, 0xaf, - 0xf5, 0x01, 0x81, 0xfc, 0xfd, 0x13, 0x5d, 0x87, - 0x46, 0x1c, 0xf6, 0xfc, 0xeb, 0x56, 0xff, 0xaa, - 0xda, 0xaf, 0xdd, 0x7c, 0xd3, 0xd3, 0xd0, 0xa9, - 0x57, 0x16, 0x69, 0x1f, 0x41, 0xf0, 0x3d, 0x12 + 0xa3, 0x4a, 0x7d, 0xdc, 0xb2, 0x9d, 0xab, 0xf3, 0xf4, 0xb8, 0xa3, 0x48, 0x4a, + 0xf3, 0x24, 0x45, 0xd5, 0xa3, 0x19, 0xfc, 0xa4, 0x03, 0xdc, 0xc6, 0xd4, 0x1f, + 0x2d, 0xc4, 0xb4, 0xfc, 0xd6, 0xaf, 0xf5, 0x01, 0x81, 0xfc, 0xfd, 0x13, 0x5d, + 0x87, 0x46, 0x1c, 0xf6, 0xfc, 0xeb, 0x56, 0xff, 0xaa, 0xda, 0xaf, 0xdd, 0x7c, + 0xd3, 0xd3, 0xd0, 0xa9, 0x57, 0x16, 0x69, 0x1f, 0x41, 0xf0, 0x3d, 0x12 }; static const uint8_t CIPHER_64_MAX_KEY_IV[] = { - 0x31, 0x3b, 0xf9, 0xfb, 0x00, 0x9b, 0x75, 0x9b, - 0xd2, 0x91, 0x2e, 0xf4, 0x88, 0x75, 0xf1, 0x67, - 0x39, 0x6c, 0x0e, 0x33, 0xe6, 0x51, 0xa7, 0x6f, - 0x9e, 0xba, 0x13, 0x95, 0xcb, 0x91, 0xa9, 0x3a, - 0x38, 0xb4, 0xa4, 0x3a, 0xc6, 0xa6, 0x02, 0xe4, - 0x4a, 0xc3, 0x64, 0xd8, 0x88, 0x2a, 0xf0, 0x71, - 0x1f, 0x0e, 0xb0, 0x9e, 0x06, 0x24, 0x42, 0xe5, - 0x66, 0xb2, 0x24, 0x5d, 0x6f, 0x80, 0xe2, 0xe0 + 0x31, 0x3b, 0xf9, 0xfb, 0x00, 0x9b, 0x75, 0x9b, 0xd2, 0x91, 0x2e, 0xf4, 0x88, + 0x75, 0xf1, 0x67, 0x39, 0x6c, 0x0e, 0x33, 0xe6, 0x51, 0xa7, 0x6f, 0x9e, 0xba, + 0x13, 0x95, 0xcb, 0x91, 0xa9, 0x3a, 0x38, 0xb4, 0xa4, 0x3a, 0xc6, 0xa6, 0x02, + 0xe4, 0x4a, 0xc3, 0x64, 0xd8, 0x88, 0x2a, 0xf0, 0x71, 0x1f, 0x0e, 0xb0, 0x9e, + 0x06, 0x24, 0x42, 0xe5, 0x66, 0xb2, 0x24, 0x5d, 0x6f, 0x80, 0xe2, 0xe0 }; static const uint8_t CIPHER_64_ZERO_KEY_IV[] = { - 0x68, 0x87, 0x9d, 0xaf, 0x8a, 0x68, 0xd0, 0xe2, - 0x28, 0x64, 0xf3, 0x4d, 0x1c, 0xf0, 0x95, 0x05, - 0xe6, 0x69, 0xa9, 0x02, 0x21, 0xdc, 0x02, 0xbe, - 0x00, 0xdf, 0x19, 0x82, 0x86, 0xdb, 0x01, 0x3b, - 0x61, 0x59, 0x23, 0x62, 0x86, 0x36, 0x62, 0xe7, - 0x7d, 0x83, 0xf1, 0x35, 0x49, 0x15, 0xae, 0x82, - 0x2b, 0xd6, 0x29, 0x67, 0x77, 0x0a, 0x11, 0x08, - 0x8d, 0xda, 0xaf, 0xfd, 0x08, 0xb2, 0xea, 0x9a + 0x68, 0x87, 0x9d, 0xaf, 0x8a, 0x68, 0xd0, 0xe2, 0x28, 0x64, 0xf3, 0x4d, 0x1c, + 0xf0, 0x95, 0x05, 0xe6, 0x69, 0xa9, 0x02, 0x21, 0xdc, 0x02, 0xbe, 0x00, 0xdf, + 0x19, 0x82, 0x86, 0xdb, 0x01, 0x3b, 0x61, 0x59, 0x23, 0x62, 0x86, 0x36, 0x62, + 0xe7, 0x7d, 0x83, 0xf1, 0x35, 0x49, 0x15, 0xae, 0x82, 0x2b, 0xd6, 0x29, 0x67, + 0x77, 0x0a, 0x11, 0x08, 0x8d, 0xda, 0xaf, 0xfd, 0x08, 0xb2, 0xea, 0x9a }; static const uint8_t CIPHER_64_MAX_IV[] = { - 0x6a, 0xd5, 0xae, 0xcf, 0x9a, 0xb0, 0xa7, 0x9f, - 0xe4, 0xf7, 0xe9, 0x8c, 0x90, 0x51, 0x4d, 0x75, - 0x4b, 0xd6, 0x6c, 0xeb, 0xe4, 0xc3, 0x44, 0x9b, - 0xd2, 0x72, 0x23, 0xd5, 0xcb, 0xde, 0xd8, 0x7e, - 0x56, 0xbd, 0x53, 0x75, 0xd6, 0x22, 0xaa, 0x13, - 0x44, 0x74, 0xe6, 0x5b, 0x50, 0xb6, 0x03, 0xb3, - 0x29, 0x56, 0xa0, 0xc6, 0x15, 0x38, 0x26, 0x6a, - 0x32, 0xef, 0x44, 0xc3, 0x27, 0xdc, 0xf5, 0xe1 + 0x6a, 0xd5, 0xae, 0xcf, 0x9a, 0xb0, 0xa7, 0x9f, 0xe4, 0xf7, 0xe9, 0x8c, 0x90, + 0x51, 0x4d, 0x75, 0x4b, 0xd6, 0x6c, 0xeb, 0xe4, 0xc3, 0x44, 0x9b, 0xd2, 0x72, + 0x23, 0xd5, 0xcb, 0xde, 0xd8, 0x7e, 0x56, 0xbd, 0x53, 0x75, 0xd6, 0x22, 0xaa, + 0x13, 0x44, 0x74, 0xe6, 0x5b, 0x50, 0xb6, 0x03, 0xb3, 0x29, 0x56, 0xa0, 0xc6, + 0x15, 0x38, 0x26, 0x6a, 0x32, 0xef, 0x44, 0xc3, 0x27, 0xdc, 0xf5, 0xe1 }; static const uint8_t CIPHER_64_ZERO_IV[] = { - 0x11, 0x9b, 0x07, 0x7a, 0x35, 0x62, 0xb7, 0x71, - 0xbf, 0x1c, 0x06, 0x70, 0xc3, 0xc8, 0xac, 0xa6, - 0x57, 0x4f, 0xe1, 0x18, 0x04, 0xe2, 0x60, 0xe7, - 0x8c, 0x07, 0xf0, 0xd4, 0x14, 0xa0, 0xca, 0xb3, - 0xec, 0xc0, 0x22, 0x8b, 0xa5, 0xcc, 0xd1, 0x99, - 0xb3, 0x46, 0x07, 0x7e, 0x48, 0xfd, 0x36, 0xb3, - 0x06, 0x4e, 0x64, 0x9d, 0x3c, 0x5a, 0x7e, 0xdc, - 0x49, 0xbc, 0xc7, 0x2e, 0x4a, 0xad, 0x97, 0xd9 -}; -static const uint8_t PLAIN_65[] = { - 0x0d, 0xd8, 0xfd, 0x8b, 0x16, 0xc2, 0xa1, 0xa4, - 0xe3, 0xcf, 0xd2, 0x92, 0xd2, 0x98, 0x4b, 0x35, - 0x61, 0xd5, 0x55, 0xd1, 0x6c, 0x33, 0xdd, 0xc2, - 0xbc, 0xf7, 0xed, 0xde, 0x13, 0xef, 0xe5, 0x20, - 0xc7, 0xe2, 0xab, 0xdd, 0xa4, 0x4d, 0x81, 0x88, - 0x1c, 0x53, 0x1a, 0xee, 0xeb, 0x66, 0x24, 0x4c, - 0x3b, 0x79, 0x1e, 0xa8, 0xac, 0xfb, 0x6a, 0x68, - 0xf3, 0x58, 0x46, 0x06, 0x47, 0x2b, 0x26, 0x0e, - 0x0d -}; -static const uint8_t CIPHER_65[] = { - 0xcd, 0x39, 0xb4, 0x9c, 0xdf, 0x0c, 0x8a, 0xae, - 0x75, 0x31, 0x1d, 0x7c, 0xce, 0x09, 0x0b, 0x7d, - 0x3a, 0xf1, 0xc6, 0x9f, 0x6c, 0x86, 0x16, 0xea, - 0x51, 0x34, 0xe3, 0x79, 0x28, 0x91, 0x91, 0xc2, - 0x18, 0xf1, 0xd9, 0xc6, 0x6b, 0x3d, 0x78, 0xd4, - 0xbc, 0x1c, 0x78, 0x02, 0x21, 0x5e, 0x91, 0x4f, - 0x26, 0x75, 0x9b, 0xb9, 0xfd, 0xdd, 0xc5, 0xec, - 0xda, 0x2f, 0x94, 0x05, 0xeb, 0xe3, 0xd0, 0xc6, - 0xd9 -}; + 0x11, 0x9b, 0x07, 0x7a, 0x35, 0x62, 0xb7, 0x71, 0xbf, 0x1c, 0x06, 0x70, 0xc3, + 0xc8, 0xac, 0xa6, 0x57, 0x4f, 0xe1, 0x18, 0x04, 0xe2, 0x60, 0xe7, 0x8c, 0x07, + 0xf0, 0xd4, 0x14, 0xa0, 0xca, 0xb3, 0xec, 0xc0, 0x22, 0x8b, 0xa5, 0xcc, 0xd1, + 0x99, 0xb3, 0x46, 0x07, 0x7e, 0x48, 0xfd, 0x36, 0xb3, 0x06, 0x4e, 0x64, 0x9d, + 0x3c, 0x5a, 0x7e, 0xdc, 0x49, 0xbc, 0xc7, 0x2e, 0x4a, 0xad, 0x97, 0xd9 +}; +static const uint8_t PLAIN_65[] = { 0x0d, 0xd8, 0xfd, 0x8b, 0x16, 0xc2, 0xa1, 0xa4, 0xe3, 0xcf, + 0xd2, 0x92, 0xd2, 0x98, 0x4b, 0x35, 0x61, 0xd5, 0x55, 0xd1, + 0x6c, 0x33, 0xdd, 0xc2, 0xbc, 0xf7, 0xed, 0xde, 0x13, 0xef, + 0xe5, 0x20, 0xc7, 0xe2, 0xab, 0xdd, 0xa4, 0x4d, 0x81, 0x88, + 0x1c, 0x53, 0x1a, 0xee, 0xeb, 0x66, 0x24, 0x4c, 0x3b, 0x79, + 0x1e, 0xa8, 0xac, 0xfb, 0x6a, 0x68, 0xf3, 0x58, 0x46, 0x06, + 0x47, 0x2b, 0x26, 0x0e, 0x0d }; +static const uint8_t CIPHER_65[] = { 0xcd, 0x39, 0xb4, 0x9c, 0xdf, 0x0c, 0x8a, 0xae, 0x75, 0x31, + 0x1d, 0x7c, 0xce, 0x09, 0x0b, 0x7d, 0x3a, 0xf1, 0xc6, 0x9f, + 0x6c, 0x86, 0x16, 0xea, 0x51, 0x34, 0xe3, 0x79, 0x28, 0x91, + 0x91, 0xc2, 0x18, 0xf1, 0xd9, 0xc6, 0x6b, 0x3d, 0x78, 0xd4, + 0xbc, 0x1c, 0x78, 0x02, 0x21, 0x5e, 0x91, 0x4f, 0x26, 0x75, + 0x9b, 0xb9, 0xfd, 0xdd, 0xc5, 0xec, 0xda, 0x2f, 0x94, 0x05, + 0xeb, 0xe3, 0xd0, 0xc6, 0xd9 }; static const uint8_t CIPHER_65_ZERO_KEY[] = { - 0xfa, 0x27, 0x86, 0x2d, 0x1b, 0x12, 0x7d, 0x2f, - 0x8b, 0x89, 0x5c, 0x89, 0x0e, 0x3c, 0x31, 0xb1, - 0xdb, 0x7f, 0x5a, 0x41, 0xb0, 0xd7, 0x02, 0x18, - 0xc6, 0x75, 0xd6, 0x05, 0x54, 0xcc, 0x6f, 0xa4, - 0x36, 0x00, 0xec, 0x19, 0xe6, 0x76, 0x2c, 0x58, - 0x43, 0x0c, 0x7b, 0xea, 0xbd, 0x45, 0x92, 0x32, - 0x2a, 0xf4, 0xe6, 0x7b, 0x23, 0x75, 0x5a, 0xf9, - 0x38, 0x64, 0xd0, 0x95, 0x89, 0x48, 0x69, 0x07, - 0x4e + 0xfa, 0x27, 0x86, 0x2d, 0x1b, 0x12, 0x7d, 0x2f, 0x8b, 0x89, 0x5c, 0x89, 0x0e, + 0x3c, 0x31, 0xb1, 0xdb, 0x7f, 0x5a, 0x41, 0xb0, 0xd7, 0x02, 0x18, 0xc6, 0x75, + 0xd6, 0x05, 0x54, 0xcc, 0x6f, 0xa4, 0x36, 0x00, 0xec, 0x19, 0xe6, 0x76, 0x2c, + 0x58, 0x43, 0x0c, 0x7b, 0xea, 0xbd, 0x45, 0x92, 0x32, 0x2a, 0xf4, 0xe6, 0x7b, + 0x23, 0x75, 0x5a, 0xf9, 0x38, 0x64, 0xd0, 0x95, 0x89, 0x48, 0x69, 0x07, 0x4e }; static const uint8_t CIPHER_65_MAX_KEY[] = { - 0x7a, 0x88, 0x66, 0xab, 0x26, 0xbc, 0xff, 0x20, - 0xb1, 0xf8, 0x90, 0x45, 0xcc, 0xd3, 0x00, 0x94, - 0xcf, 0x73, 0xe2, 0xe5, 0x5e, 0x06, 0x43, 0xab, - 0xe6, 0x7a, 0x61, 0x3c, 0x76, 0x13, 0x62, 0x88, - 0x8c, 0x22, 0xf5, 0x29, 0x2e, 0x0a, 0x05, 0xf8, - 0x31, 0xdf, 0x28, 0xe1, 0xd7, 0x6b, 0x7f, 0x57, - 0xff, 0x67, 0x68, 0x15, 0x3c, 0x90, 0x56, 0x47, - 0x6d, 0x7f, 0x14, 0x3e, 0x45, 0x67, 0x69, 0x70, - 0xcb + 0x7a, 0x88, 0x66, 0xab, 0x26, 0xbc, 0xff, 0x20, 0xb1, 0xf8, 0x90, 0x45, 0xcc, + 0xd3, 0x00, 0x94, 0xcf, 0x73, 0xe2, 0xe5, 0x5e, 0x06, 0x43, 0xab, 0xe6, 0x7a, + 0x61, 0x3c, 0x76, 0x13, 0x62, 0x88, 0x8c, 0x22, 0xf5, 0x29, 0x2e, 0x0a, 0x05, + 0xf8, 0x31, 0xdf, 0x28, 0xe1, 0xd7, 0x6b, 0x7f, 0x57, 0xff, 0x67, 0x68, 0x15, + 0x3c, 0x90, 0x56, 0x47, 0x6d, 0x7f, 0x14, 0x3e, 0x45, 0x67, 0x69, 0x70, 0xcb }; static const uint8_t CIPHER_65_MAX_KEY_IV[] = { - 0x3d, 0xae, 0xf4, 0x70, 0x06, 0xd2, 0xb3, 0xf0, - 0xa8, 0x0e, 0xa7, 0x71, 0xc5, 0x63, 0x6e, 0xca, - 0x52, 0xd8, 0x58, 0x33, 0x36, 0xc5, 0x77, 0x13, - 0xb9, 0xf2, 0x55, 0x45, 0x0d, 0xe6, 0x4d, 0xcc, - 0x1a, 0xa4, 0xd9, 0x11, 0x1f, 0xd5, 0x46, 0x7a, - 0xd8, 0xb1, 0x50, 0x1b, 0xcc, 0x4e, 0x12, 0x84, - 0x47, 0xbe, 0x24, 0x29, 0xda, 0x48, 0xf6, 0x81, - 0xc3, 0x63, 0x78, 0x70, 0x09, 0xb0, 0xc5, 0xe9, - 0x45 + 0x3d, 0xae, 0xf4, 0x70, 0x06, 0xd2, 0xb3, 0xf0, 0xa8, 0x0e, 0xa7, 0x71, 0xc5, + 0x63, 0x6e, 0xca, 0x52, 0xd8, 0x58, 0x33, 0x36, 0xc5, 0x77, 0x13, 0xb9, 0xf2, + 0x55, 0x45, 0x0d, 0xe6, 0x4d, 0xcc, 0x1a, 0xa4, 0xd9, 0x11, 0x1f, 0xd5, 0x46, + 0x7a, 0xd8, 0xb1, 0x50, 0x1b, 0xcc, 0x4e, 0x12, 0x84, 0x47, 0xbe, 0x24, 0x29, + 0xda, 0x48, 0xf6, 0x81, 0xc3, 0x63, 0x78, 0x70, 0x09, 0xb0, 0xc5, 0xe9, 0x45 }; static const uint8_t CIPHER_65_ZERO_KEY_IV[] = { - 0x64, 0x12, 0x90, 0x24, 0x8c, 0x21, 0x16, 0x89, - 0x52, 0xfb, 0x7a, 0xc8, 0x51, 0xe6, 0x0a, 0xa8, - 0x8d, 0xdd, 0xff, 0x02, 0xf1, 0x48, 0xd2, 0xc2, - 0x27, 0x97, 0x5f, 0x52, 0x40, 0xac, 0xe5, 0xcd, - 0x43, 0x49, 0x5e, 0x49, 0x5f, 0x45, 0x26, 0x79, - 0xef, 0xf1, 0xc5, 0xf6, 0x0d, 0x71, 0x4c, 0x77, - 0x73, 0x66, 0xbd, 0xd0, 0xab, 0x66, 0xa5, 0x6c, - 0x28, 0x0b, 0xf3, 0xd0, 0x6e, 0x82, 0xcd, 0x93, - 0x0e + 0x64, 0x12, 0x90, 0x24, 0x8c, 0x21, 0x16, 0x89, 0x52, 0xfb, 0x7a, 0xc8, 0x51, + 0xe6, 0x0a, 0xa8, 0x8d, 0xdd, 0xff, 0x02, 0xf1, 0x48, 0xd2, 0xc2, 0x27, 0x97, + 0x5f, 0x52, 0x40, 0xac, 0xe5, 0xcd, 0x43, 0x49, 0x5e, 0x49, 0x5f, 0x45, 0x26, + 0x79, 0xef, 0xf1, 0xc5, 0xf6, 0x0d, 0x71, 0x4c, 0x77, 0x73, 0x66, 0xbd, 0xd0, + 0xab, 0x66, 0xa5, 0x6c, 0x28, 0x0b, 0xf3, 0xd0, 0x6e, 0x82, 0xcd, 0x93, 0x0e }; static const uint8_t CIPHER_65_MAX_IV[] = { - 0x13, 0xdb, 0x04, 0xcc, 0xdb, 0xd5, 0x09, 0x2e, - 0xf9, 0xfb, 0x32, 0xdc, 0x56, 0x28, 0x17, 0xfb, - 0xfb, 0x8f, 0x35, 0x76, 0xa9, 0x7a, 0x38, 0xf6, - 0xe2, 0xe5, 0x39, 0x7d, 0x1a, 0x0e, 0x0c, 0xcf, - 0x67, 0xe9, 0x37, 0xb4, 0x1e, 0x34, 0xeb, 0xb7, - 0x0e, 0x22, 0xed, 0x23, 0x72, 0xf9, 0xa0, 0xc1, - 0x8d, 0x4b, 0xb7, 0xa8, 0xf4, 0x47, 0xee, 0xa4, - 0x62, 0xf2, 0xa2, 0xbe, 0xff, 0x9f, 0x8d, 0x66, - 0xd4 + 0x13, 0xdb, 0x04, 0xcc, 0xdb, 0xd5, 0x09, 0x2e, 0xf9, 0xfb, 0x32, 0xdc, 0x56, + 0x28, 0x17, 0xfb, 0xfb, 0x8f, 0x35, 0x76, 0xa9, 0x7a, 0x38, 0xf6, 0xe2, 0xe5, + 0x39, 0x7d, 0x1a, 0x0e, 0x0c, 0xcf, 0x67, 0xe9, 0x37, 0xb4, 0x1e, 0x34, 0xeb, + 0xb7, 0x0e, 0x22, 0xed, 0x23, 0x72, 0xf9, 0xa0, 0xc1, 0x8d, 0x4b, 0xb7, 0xa8, + 0xf4, 0x47, 0xee, 0xa4, 0x62, 0xf2, 0xa2, 0xbe, 0xff, 0x9f, 0x8d, 0x66, 0xd4 }; static const uint8_t CIPHER_65_ZERO_IV[] = { - 0x09, 0xe6, 0xdb, 0x40, 0x1a, 0x5d, 0xf1, 0xbc, - 0x3a, 0xf1, 0x08, 0xb5, 0xe9, 0x9c, 0xc2, 0x5f, - 0xa3, 0x21, 0xec, 0xc8, 0x24, 0xb1, 0xe1, 0x8e, - 0x52, 0xf7, 0x2b, 0x4b, 0xec, 0x2f, 0x8c, 0x69, - 0xe9, 0x6a, 0x72, 0x54, 0xce, 0x98, 0x6b, 0xbe, - 0x85, 0x7e, 0xc0, 0xaf, 0x51, 0xf2, 0x1a, 0x3b, - 0xdd, 0x46, 0xc6, 0x05, 0xe2, 0x57, 0x95, 0xa0, - 0x60, 0xf1, 0x6e, 0xe2, 0x9e, 0x22, 0xe4, 0x21, - 0xcf + 0x09, 0xe6, 0xdb, 0x40, 0x1a, 0x5d, 0xf1, 0xbc, 0x3a, 0xf1, 0x08, 0xb5, 0xe9, + 0x9c, 0xc2, 0x5f, 0xa3, 0x21, 0xec, 0xc8, 0x24, 0xb1, 0xe1, 0x8e, 0x52, 0xf7, + 0x2b, 0x4b, 0xec, 0x2f, 0x8c, 0x69, 0xe9, 0x6a, 0x72, 0x54, 0xce, 0x98, 0x6b, + 0xbe, 0x85, 0x7e, 0xc0, 0xaf, 0x51, 0xf2, 0x1a, 0x3b, 0xdd, 0x46, 0xc6, 0x05, + 0xe2, 0x57, 0x95, 0xa0, 0x60, 0xf1, 0x6e, 0xe2, 0x9e, 0x22, 0xe4, 0x21, 0xcf }; typedef struct snow_v_test_vectors_s { - const uint8_t *KEY; - const uint8_t *IV; - uint64_t length_in_bytes; + const uint8_t *KEY; + const uint8_t *IV; + uint64_t length_in_bytes; const uint8_t *plaintext; - const uint8_t *ciphertext; + const uint8_t *ciphertext; } snow_v_test_vectors_t; static const snow_v_test_vectors_t snow_v_vectors_cov[] = { /* { key, iv, bytes, plain, cipher } */ /* == SNOW-V test vectors from spec #1, #2, #3 */ - { ZERO_KEY, ZERO_IV, 128, ZERO_PLAIN, keystreams_from_spec[0] }, - { MAX_KEY, MAX_IV, 128, ZERO_PLAIN, keystreams_from_spec[1] }, - { KEY_spec, IV_spec, 128, ZERO_PLAIN, keystreams_from_spec[2] }, + { ZERO_KEY, ZERO_IV, 128, ZERO_PLAIN, keystreams_from_spec[0] }, + { MAX_KEY, MAX_IV, 128, ZERO_PLAIN, keystreams_from_spec[1] }, + { KEY_spec, IV_spec, 128, ZERO_PLAIN, keystreams_from_spec[2] }, /* Vectors generated for better coverage*/ - { KEYs[0], IVs[0], 0, NULL, NULL }, - { KEYs[0], ZERO_IV, 0, NULL, NULL }, - { KEYs[0], MAX_IV, 0, NULL, NULL }, - { ZERO_KEY, IVs[0], 0, NULL, NULL }, - { ZERO_KEY, ZERO_IV, 0, NULL, NULL }, - { MAX_KEY, IVs[0], 0, NULL, NULL }, - { MAX_KEY, MAX_IV, 0, NULL, NULL }, - { KEYs[1], IVs[1], 1, PLAIN_1, CIPHER_1 }, - { KEYs[1], ZERO_IV, 1, PLAIN_1, CIPHER_1_ZERO_IV }, - { KEYs[1], MAX_IV, 1, PLAIN_1, CIPHER_1_MAX_IV }, - { ZERO_KEY, IVs[1], 1, PLAIN_1, CIPHER_1_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 1, PLAIN_1, CIPHER_1_ZERO_KEY_IV }, - { MAX_KEY, IVs[1], 1, PLAIN_1, CIPHER_1_MAX_KEY }, - { MAX_KEY, MAX_IV, 1, PLAIN_1, CIPHER_1_MAX_KEY_IV }, - { KEYs[2], IVs[2], 2, PLAIN_8, CIPHER_8 }, - { KEYs[2], ZERO_IV, 2, PLAIN_8, CIPHER_8_ZERO_IV }, - { KEYs[2], MAX_IV, 2, PLAIN_8, CIPHER_8_MAX_IV }, - { ZERO_KEY, IVs[2], 2, PLAIN_8, CIPHER_8_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 2, PLAIN_8, CIPHER_8_ZERO_KEY_IV }, - { MAX_KEY, IVs[2], 2, PLAIN_8, CIPHER_8_MAX_KEY }, - { MAX_KEY, MAX_IV, 2, PLAIN_8, CIPHER_8_MAX_KEY_IV }, - { KEYs[3], IVs[3], 3, PLAIN_15, CIPHER_15 }, - { KEYs[3], ZERO_IV, 3, PLAIN_15, CIPHER_15_ZERO_IV }, - { KEYs[3], MAX_IV, 3, PLAIN_15, CIPHER_15_MAX_IV }, - { ZERO_KEY, IVs[3], 3, PLAIN_15, CIPHER_15_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 3, PLAIN_15, CIPHER_15_ZERO_KEY_IV }, - { MAX_KEY, IVs[3], 3, PLAIN_15, CIPHER_15_MAX_KEY }, - { MAX_KEY, MAX_IV, 3, PLAIN_15, CIPHER_15_MAX_KEY_IV }, - { KEYs[4], IVs[4], 4, PLAIN_16, CIPHER_16 }, - { KEYs[4], ZERO_IV, 4, PLAIN_16, CIPHER_16_ZERO_IV }, - { KEYs[4], MAX_IV, 4, PLAIN_16, CIPHER_16_MAX_IV }, - { ZERO_KEY, IVs[4], 4, PLAIN_16, CIPHER_16_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 4, PLAIN_16, CIPHER_16_ZERO_KEY_IV }, - { MAX_KEY, IVs[4], 4, PLAIN_16, CIPHER_16_MAX_KEY }, - { MAX_KEY, MAX_IV, 4, PLAIN_16, CIPHER_16_MAX_KEY_IV }, - { KEYs[5], IVs[5], 5, PLAIN_17, CIPHER_17 }, - { KEYs[5], ZERO_IV, 5, PLAIN_17, CIPHER_17_ZERO_IV }, - { KEYs[5], MAX_IV, 5, PLAIN_17, CIPHER_17_MAX_IV }, - { ZERO_KEY, IVs[5], 5, PLAIN_17, CIPHER_17_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 5, PLAIN_17, CIPHER_17_ZERO_KEY_IV }, - { MAX_KEY, IVs[5], 5, PLAIN_17, CIPHER_17_MAX_KEY }, - { MAX_KEY, MAX_IV, 5, PLAIN_17, CIPHER_17_MAX_KEY_IV }, - { KEYs[6], IVs[6], 6, PLAIN_48, CIPHER_48 }, - { KEYs[6], ZERO_IV, 6, PLAIN_48, CIPHER_48_ZERO_IV }, - { KEYs[6], MAX_IV, 6, PLAIN_48, CIPHER_48_MAX_IV }, - { ZERO_KEY, IVs[6], 6, PLAIN_48, CIPHER_48_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 6, PLAIN_48, CIPHER_48_ZERO_KEY_IV }, - { MAX_KEY, IVs[6], 6, PLAIN_48, CIPHER_48_MAX_KEY }, - { MAX_KEY, MAX_IV, 6, PLAIN_48, CIPHER_48_MAX_KEY_IV }, - { KEYs[7], IVs[7], 7, PLAIN_63, CIPHER_63 }, - { KEYs[7], ZERO_IV, 7, PLAIN_63, CIPHER_63_ZERO_IV }, - { KEYs[7], MAX_IV, 7, PLAIN_63, CIPHER_63_MAX_IV }, - { ZERO_KEY, IVs[7], 7, PLAIN_63, CIPHER_63_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 7, PLAIN_63, CIPHER_63_ZERO_KEY_IV }, - { MAX_KEY, IVs[7], 7, PLAIN_63, CIPHER_63_MAX_KEY }, - { MAX_KEY, MAX_IV, 7, PLAIN_63, CIPHER_63_MAX_KEY_IV }, - { KEYs[8], IVs[8], 8, PLAIN_64, CIPHER_64 }, - { KEYs[8], ZERO_IV, 8, PLAIN_64, CIPHER_64_ZERO_IV }, - { KEYs[8], MAX_IV, 8, PLAIN_64, CIPHER_64_MAX_IV }, - { ZERO_KEY, IVs[8], 8, PLAIN_64, CIPHER_64_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 8, PLAIN_64, CIPHER_64_ZERO_KEY_IV }, - { MAX_KEY, IVs[8], 8, PLAIN_64, CIPHER_64_MAX_KEY }, - { MAX_KEY, MAX_IV, 8, PLAIN_64, CIPHER_64_MAX_KEY_IV }, - { KEYs[9], IVs[9], 9, PLAIN_65, CIPHER_65 }, - { KEYs[9], ZERO_IV, 9, PLAIN_65, CIPHER_65_ZERO_IV }, - { KEYs[9], MAX_IV, 9, PLAIN_65, CIPHER_65_MAX_IV }, - { ZERO_KEY, IVs[9], 9, PLAIN_65, CIPHER_65_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 9, PLAIN_65, CIPHER_65_ZERO_KEY_IV }, - { MAX_KEY, IVs[9], 9, PLAIN_65, CIPHER_65_MAX_KEY }, - { MAX_KEY, MAX_IV, 9, PLAIN_65, CIPHER_65_MAX_KEY_IV } + { KEYs[0], IVs[0], 0, NULL, NULL }, + { KEYs[0], ZERO_IV, 0, NULL, NULL }, + { KEYs[0], MAX_IV, 0, NULL, NULL }, + { ZERO_KEY, IVs[0], 0, NULL, NULL }, + { ZERO_KEY, ZERO_IV, 0, NULL, NULL }, + { MAX_KEY, IVs[0], 0, NULL, NULL }, + { MAX_KEY, MAX_IV, 0, NULL, NULL }, + { KEYs[1], IVs[1], 1, PLAIN_1, CIPHER_1 }, + { KEYs[1], ZERO_IV, 1, PLAIN_1, CIPHER_1_ZERO_IV }, + { KEYs[1], MAX_IV, 1, PLAIN_1, CIPHER_1_MAX_IV }, + { ZERO_KEY, IVs[1], 1, PLAIN_1, CIPHER_1_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 1, PLAIN_1, CIPHER_1_ZERO_KEY_IV }, + { MAX_KEY, IVs[1], 1, PLAIN_1, CIPHER_1_MAX_KEY }, + { MAX_KEY, MAX_IV, 1, PLAIN_1, CIPHER_1_MAX_KEY_IV }, + { KEYs[2], IVs[2], 2, PLAIN_8, CIPHER_8 }, + { KEYs[2], ZERO_IV, 2, PLAIN_8, CIPHER_8_ZERO_IV }, + { KEYs[2], MAX_IV, 2, PLAIN_8, CIPHER_8_MAX_IV }, + { ZERO_KEY, IVs[2], 2, PLAIN_8, CIPHER_8_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 2, PLAIN_8, CIPHER_8_ZERO_KEY_IV }, + { MAX_KEY, IVs[2], 2, PLAIN_8, CIPHER_8_MAX_KEY }, + { MAX_KEY, MAX_IV, 2, PLAIN_8, CIPHER_8_MAX_KEY_IV }, + { KEYs[3], IVs[3], 3, PLAIN_15, CIPHER_15 }, + { KEYs[3], ZERO_IV, 3, PLAIN_15, CIPHER_15_ZERO_IV }, + { KEYs[3], MAX_IV, 3, PLAIN_15, CIPHER_15_MAX_IV }, + { ZERO_KEY, IVs[3], 3, PLAIN_15, CIPHER_15_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 3, PLAIN_15, CIPHER_15_ZERO_KEY_IV }, + { MAX_KEY, IVs[3], 3, PLAIN_15, CIPHER_15_MAX_KEY }, + { MAX_KEY, MAX_IV, 3, PLAIN_15, CIPHER_15_MAX_KEY_IV }, + { KEYs[4], IVs[4], 4, PLAIN_16, CIPHER_16 }, + { KEYs[4], ZERO_IV, 4, PLAIN_16, CIPHER_16_ZERO_IV }, + { KEYs[4], MAX_IV, 4, PLAIN_16, CIPHER_16_MAX_IV }, + { ZERO_KEY, IVs[4], 4, PLAIN_16, CIPHER_16_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 4, PLAIN_16, CIPHER_16_ZERO_KEY_IV }, + { MAX_KEY, IVs[4], 4, PLAIN_16, CIPHER_16_MAX_KEY }, + { MAX_KEY, MAX_IV, 4, PLAIN_16, CIPHER_16_MAX_KEY_IV }, + { KEYs[5], IVs[5], 5, PLAIN_17, CIPHER_17 }, + { KEYs[5], ZERO_IV, 5, PLAIN_17, CIPHER_17_ZERO_IV }, + { KEYs[5], MAX_IV, 5, PLAIN_17, CIPHER_17_MAX_IV }, + { ZERO_KEY, IVs[5], 5, PLAIN_17, CIPHER_17_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 5, PLAIN_17, CIPHER_17_ZERO_KEY_IV }, + { MAX_KEY, IVs[5], 5, PLAIN_17, CIPHER_17_MAX_KEY }, + { MAX_KEY, MAX_IV, 5, PLAIN_17, CIPHER_17_MAX_KEY_IV }, + { KEYs[6], IVs[6], 6, PLAIN_48, CIPHER_48 }, + { KEYs[6], ZERO_IV, 6, PLAIN_48, CIPHER_48_ZERO_IV }, + { KEYs[6], MAX_IV, 6, PLAIN_48, CIPHER_48_MAX_IV }, + { ZERO_KEY, IVs[6], 6, PLAIN_48, CIPHER_48_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 6, PLAIN_48, CIPHER_48_ZERO_KEY_IV }, + { MAX_KEY, IVs[6], 6, PLAIN_48, CIPHER_48_MAX_KEY }, + { MAX_KEY, MAX_IV, 6, PLAIN_48, CIPHER_48_MAX_KEY_IV }, + { KEYs[7], IVs[7], 7, PLAIN_63, CIPHER_63 }, + { KEYs[7], ZERO_IV, 7, PLAIN_63, CIPHER_63_ZERO_IV }, + { KEYs[7], MAX_IV, 7, PLAIN_63, CIPHER_63_MAX_IV }, + { ZERO_KEY, IVs[7], 7, PLAIN_63, CIPHER_63_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 7, PLAIN_63, CIPHER_63_ZERO_KEY_IV }, + { MAX_KEY, IVs[7], 7, PLAIN_63, CIPHER_63_MAX_KEY }, + { MAX_KEY, MAX_IV, 7, PLAIN_63, CIPHER_63_MAX_KEY_IV }, + { KEYs[8], IVs[8], 8, PLAIN_64, CIPHER_64 }, + { KEYs[8], ZERO_IV, 8, PLAIN_64, CIPHER_64_ZERO_IV }, + { KEYs[8], MAX_IV, 8, PLAIN_64, CIPHER_64_MAX_IV }, + { ZERO_KEY, IVs[8], 8, PLAIN_64, CIPHER_64_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 8, PLAIN_64, CIPHER_64_ZERO_KEY_IV }, + { MAX_KEY, IVs[8], 8, PLAIN_64, CIPHER_64_MAX_KEY }, + { MAX_KEY, MAX_IV, 8, PLAIN_64, CIPHER_64_MAX_KEY_IV }, + { KEYs[9], IVs[9], 9, PLAIN_65, CIPHER_65 }, + { KEYs[9], ZERO_IV, 9, PLAIN_65, CIPHER_65_ZERO_IV }, + { KEYs[9], MAX_IV, 9, PLAIN_65, CIPHER_65_MAX_IV }, + { ZERO_KEY, IVs[9], 9, PLAIN_65, CIPHER_65_ZERO_KEY }, + { ZERO_KEY, ZERO_IV, 9, PLAIN_65, CIPHER_65_ZERO_KEY_IV }, + { MAX_KEY, IVs[9], 9, PLAIN_65, CIPHER_65_MAX_KEY }, + { MAX_KEY, MAX_IV, 9, PLAIN_65, CIPHER_65_MAX_KEY_IV } }; static const uint8_t SPEC_SNOW_V_GCM_AUTH_TAGs[][16] = { - { - 0x02, 0x9a, 0x62, 0x4c, 0xda, 0xa4, 0xd4, 0x6c, - 0xb9, 0xa0, 0xef, 0x40, 0x46, 0x95, 0x6c, 0x9f - }, - { - 0xfc, 0x7c, 0xac, 0x57, 0x4c, 0x49, 0xfe, 0xae, - 0x61, 0x50, 0x31, 0x5b, 0x96, 0x85, 0x42, 0x4c - }, - { - 0x5a, 0x5a, 0xa5, 0xfb, 0xd6, 0x35, 0xef, 0x1a, - 0xe1, 0x29, 0x61, 0x42, 0x03, 0xe1, 0x03, 0x84 - }, - { - 0x25, 0x0e, 0xc8, 0xd7, 0x7a, 0x02, 0x2c, 0x08, - 0x7a, 0xdf, 0x08, 0xb6, 0x5a, 0xdc, 0xbb, 0x1a - }, + { 0x02, 0x9a, 0x62, 0x4c, 0xda, 0xa4, 0xd4, 0x6c, 0xb9, 0xa0, 0xef, 0x40, 0x46, 0x95, 0x6c, + 0x9f }, + { 0xfc, 0x7c, 0xac, 0x57, 0x4c, 0x49, 0xfe, 0xae, 0x61, 0x50, 0x31, 0x5b, 0x96, 0x85, 0x42, + 0x4c }, + { 0x5a, 0x5a, 0xa5, 0xfb, 0xd6, 0x35, 0xef, 0x1a, 0xe1, 0x29, 0x61, 0x42, 0x03, 0xe1, 0x03, + 0x84 }, + { 0x25, 0x0e, 0xc8, 0xd7, 0x7a, 0x02, 0x2c, 0x08, 0x7a, 0xdf, 0x08, 0xb6, 0x5a, 0xdc, 0xbb, + 0x1a }, }; -static const uint8_t SPEC_SNOW_V_GCM_CIPHER[] = { - 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, 0xef, - 0x82, 0x50, - 0xdd, 0xfe, 0x4e, 0x31, 0xe7, 0xbf, 0xe6, 0x90, - 0x23, 0x31, 0xec, 0x5c, 0xe3, 0x19, 0xd9, 0x0d -}; +static const uint8_t SPEC_SNOW_V_GCM_CIPHER[] = { 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, + 0xef, 0x82, 0x50, 0xdd, 0xfe, 0x4e, 0x31, + 0xe7, 0xbf, 0xe6, 0x90, 0x23, 0x31, 0xec, + 0x5c, 0xe3, 0x19, 0xd9, 0x0d }; -static const uint8_t SPEC_SNOW_V_GCM_KEY[] = { - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, - 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa -}; +static const uint8_t SPEC_SNOW_V_GCM_KEY[] = { 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, + 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa }; -static const uint8_t SPEC_SNOW_V_GCM_IV[] = { - 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, - 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 -}; +static const uint8_t SPEC_SNOW_V_GCM_IV[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; -static const uint8_t SPEC_SNOW_V_GCM_AAD[] = { - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66 -}; +static const uint8_t SPEC_SNOW_V_GCM_AAD[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66 }; -static const uint8_t SPEC_SNOW_V_GCM_AAD_2[] = { - 0x41, 0x41, 0x44, 0x20, 0x74, 0x65, 0x73, 0x74, - 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x21 -}; +static const uint8_t SPEC_SNOW_V_GCM_AAD_2[] = { 0x41, 0x41, 0x44, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x21 }; -static const uint8_t SPEC_SNOW_V_GCM_PLAIN[] = { - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, - 0x20, 0x53, 0x6e, 0x6f, 0x77, 0x56, 0x2d, 0x41, - 0x45, 0x41, 0x44, 0x20, 0x6d, 0x6f, 0x64, 0x65, - 0x21 -}; +static const uint8_t SPEC_SNOW_V_GCM_PLAIN[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, + 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, + 0x65, 0x66, 0x20, 0x53, 0x6e, 0x6f, 0x77, + 0x56, 0x2d, 0x41, 0x45, 0x41, 0x44, 0x20, + 0x6d, 0x6f, 0x64, 0x65, 0x21 }; static const uint8_t SPEC_SNOW_V_GCM_CIPHER_V6[] = { - 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, 0xef, - 0x82, 0x50, 0x27, 0x07, 0xe8, 0x7a, 0x32, 0xc1, - 0x52, 0xb0, 0xd0, 0x18, 0x18, 0xfd, 0x7f, 0x12, - 0x24, 0x3e, 0xb5, 0xa1, 0x56, 0x59, 0xe9, 0x1b, - 0x4c, 0x90, 0x7e, 0xa6, 0xa5, 0xb7, 0x3a, 0x51, - 0xde, 0x74, 0x7c, 0x3e, 0x9a, 0xd9, 0xee, 0x02, - 0x9b + 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, 0xef, 0x82, 0x50, 0x27, 0x07, 0xe8, + 0x7a, 0x32, 0xc1, 0x52, 0xb0, 0xd0, 0x18, 0x18, 0xfd, 0x7f, 0x12, 0x24, 0x3e, + 0xb5, 0xa1, 0x56, 0x59, 0xe9, 0x1b, 0x4c, 0x90, 0x7e, 0xa6, 0xa5, 0xb7, 0x3a, + 0x51, 0xde, 0x74, 0x7c, 0x3e, 0x9a, 0xd9, 0xee, 0x02, 0x9b }; typedef struct snow_v_aead_test_vectors_s { - const uint8_t *KEY; - const uint8_t *IV; + const uint8_t *KEY; + const uint8_t *IV; const uint8_t *aad; uint64_t aad_length_in_bytes; - uint64_t length_in_bytes; + uint64_t length_in_bytes; const uint8_t *plaintext; - const uint8_t *ciphertext; + const uint8_t *ciphertext; } snow_v_aead_test_vectors_t; static const snow_v_aead_test_vectors_t snow_v_aead_test_vectors[] = { /* == SNOW-V-GCM test vectors from spec #1 - #6 */ - { - ZERO_KEY, ZERO_IV, NULL, 0, 0, ZERO_PLAIN, - SPEC_SNOW_V_GCM_AUTH_TAGs[0] - }, - { - SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, - NULL, 0, 0, ZERO_PLAIN, SPEC_SNOW_V_GCM_AUTH_TAGs[1] - }, - { - ZERO_KEY, ZERO_IV, SPEC_SNOW_V_GCM_AAD, 16, 0, - ZERO_PLAIN, SPEC_SNOW_V_GCM_AUTH_TAGs[2] - }, - { - SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, SPEC_SNOW_V_GCM_AAD, - 16, 0, ZERO_PLAIN, SPEC_SNOW_V_GCM_AUTH_TAGs[3] - }, - { - SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, NULL, 0, - 10, SPEC_SNOW_V_GCM_AAD, SPEC_SNOW_V_GCM_CIPHER - }, - { - SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, SPEC_SNOW_V_GCM_AAD_2, - sizeof(SPEC_SNOW_V_GCM_AAD_2), sizeof(SPEC_SNOW_V_GCM_PLAIN), - SPEC_SNOW_V_GCM_PLAIN, SPEC_SNOW_V_GCM_CIPHER_V6 - } -}; - -static uint32_t compare(const uint8_t *result, - const uint8_t *expected, - const size_t size) + { ZERO_KEY, ZERO_IV, NULL, 0, 0, ZERO_PLAIN, SPEC_SNOW_V_GCM_AUTH_TAGs[0] }, + { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, NULL, 0, 0, ZERO_PLAIN, + SPEC_SNOW_V_GCM_AUTH_TAGs[1] }, + { ZERO_KEY, ZERO_IV, SPEC_SNOW_V_GCM_AAD, 16, 0, ZERO_PLAIN, SPEC_SNOW_V_GCM_AUTH_TAGs[2] }, + { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, SPEC_SNOW_V_GCM_AAD, 16, 0, ZERO_PLAIN, + SPEC_SNOW_V_GCM_AUTH_TAGs[3] }, + { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, NULL, 0, 10, SPEC_SNOW_V_GCM_AAD, + SPEC_SNOW_V_GCM_CIPHER }, + { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, SPEC_SNOW_V_GCM_AAD_2, + sizeof(SPEC_SNOW_V_GCM_AAD_2), sizeof(SPEC_SNOW_V_GCM_PLAIN), SPEC_SNOW_V_GCM_PLAIN, + SPEC_SNOW_V_GCM_CIPHER_V6 } +}; + +static uint32_t +compare(const uint8_t *result, const uint8_t *expected, const size_t size) { if (memcmp(result, expected, size) != 0) { hexdump(stderr, "expected", expected, size); @@ -901,17 +607,15 @@ static uint32_t compare(const uint8_t *result, } /* check for buffer under/over-write */ -static uint32_t check_buffer_over_under_write(uint8_t *result, - const int pad_pattern, - const size_t pad_size, - const size_t alloc_size) +static uint32_t +check_buffer_over_under_write(uint8_t *result, const int pad_pattern, const size_t pad_size, + const size_t alloc_size) { uint8_t *pad_block = malloc(pad_size); uint8_t error = 0; if (pad_block == NULL) { - fprintf(stderr, "Error allocating %lu bytes!\n", - (unsigned long) pad_size); + fprintf(stderr, "Error allocating %lu bytes!\n", (unsigned long) pad_size); exit(EXIT_FAILURE); } @@ -919,15 +623,12 @@ static uint32_t check_buffer_over_under_write(uint8_t *result, memset(pad_block, pad_pattern, pad_size); if (memcmp(pad_block, result, pad_size) != 0) { - hexdump(stderr, "underwrite detected", result, - pad_size); + hexdump(stderr, "underwrite detected", result, pad_size); error = 1; } - if (memcmp(pad_block, &result[alloc_size - pad_size], - pad_size) != 0) { - hexdump(stderr, "overwrite detected", - &result[alloc_size - pad_size], pad_size); + if (memcmp(pad_block, &result[alloc_size - pad_size], pad_size) != 0) { + hexdump(stderr, "overwrite detected", &result[alloc_size - pad_size], pad_size); error = 1; } @@ -937,12 +638,8 @@ static uint32_t check_buffer_over_under_write(uint8_t *result, } static void -snow_v_single_test(IMB_MGR *p_mgr, - struct test_suite_context *ts, - const uint8_t *key, - const uint8_t *iv, - const uint8_t *plain, - const size_t size, +snow_v_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const uint8_t *key, + const uint8_t *iv, const uint8_t *plain, const size_t size, const uint8_t *expected) { const size_t pad_size = 16; @@ -953,8 +650,7 @@ snow_v_single_test(IMB_MGR *p_mgr, struct IMB_JOB *job; if (output == NULL) { - fprintf(stderr, "Error allocating %lu bytes!\n", - (unsigned long) alloc_size); + fprintf(stderr, "Error allocating %lu bytes!\n", (unsigned long) alloc_size); exit(EXIT_FAILURE); } @@ -992,9 +688,8 @@ snow_v_single_test(IMB_MGR *p_mgr, /* check for vector match */ fail_found = compare(dst_ptr, expected, size); - fail_found += check_buffer_over_under_write( - output, pad_pattern, - pad_size, alloc_size); + fail_found += + check_buffer_over_under_write(output, pad_pattern, pad_size, alloc_size); if (fail_found) fail++; @@ -1007,16 +702,10 @@ snow_v_single_test(IMB_MGR *p_mgr, } static void -snow_v_aead_single_test(IMB_MGR *p_mgr, - struct test_suite_context *ts, - const uint8_t *key, - const uint8_t *iv, - const uint8_t *aad, - const uint8_t *plain, - const size_t size, - const size_t aad_len, - const uint8_t *expected, - int dir_encrypt) /* 1-encrypt, 0-decrypt */ +snow_v_aead_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const uint8_t *key, + const uint8_t *iv, const uint8_t *aad, const uint8_t *plain, + const size_t size, const size_t aad_len, const uint8_t *expected, + int dir_encrypt) /* 1-encrypt, 0-decrypt */ { const size_t pad_size = 16; /* alloc space for auth tag after output */ @@ -1027,8 +716,7 @@ snow_v_aead_single_test(IMB_MGR *p_mgr, struct IMB_JOB *job; if (output == NULL) { - fprintf(stderr, "Error allocating %lu bytes!\n", - (unsigned long) alloc_size); + fprintf(stderr, "Error allocating %lu bytes!\n", (unsigned long) alloc_size); exit(EXIT_FAILURE); } @@ -1072,8 +760,7 @@ snow_v_aead_single_test(IMB_MGR *p_mgr, printf("Error: %s!\n", imb_get_strerror(err)); fail++; } else { - int fail_found = compare(job->auth_tag_output, - expected+size, 16); + int fail_found = compare(job->auth_tag_output, expected + size, 16); /* check for vector match */ if (dir_encrypt) @@ -1081,9 +768,8 @@ snow_v_aead_single_test(IMB_MGR *p_mgr, else fail_found += compare(dst_ptr, plain, size); - fail_found += check_buffer_over_under_write( - output, pad_pattern, - pad_size, alloc_size); + fail_found += + check_buffer_over_under_write(output, pad_pattern, pad_size, alloc_size); if (fail_found) fail++; else @@ -1094,8 +780,8 @@ snow_v_aead_single_test(IMB_MGR *p_mgr, free(output); } - -int snow_v_test(IMB_MGR *p_mgr) +int +snow_v_test(IMB_MGR *p_mgr) { struct test_suite_context ts_snow_v; struct test_suite_context ts_snow_v_aead; @@ -1110,12 +796,10 @@ int snow_v_test(IMB_MGR *p_mgr) printf("SNOW-V test vectors\n"); test_suite_start(&ts_snow_v, "SNOW-V"); for (i = 0; i < DIM(snow_v_vectors_cov); i++) - snow_v_single_test(p_mgr, &ts_snow_v, - snow_v_vectors_cov[i].KEY, - snow_v_vectors_cov[i].IV, - snow_v_vectors_cov[i].plaintext, - snow_v_vectors_cov[i].length_in_bytes, - snow_v_vectors_cov[i].ciphertext); + snow_v_single_test(p_mgr, &ts_snow_v, snow_v_vectors_cov[i].KEY, + snow_v_vectors_cov[i].IV, snow_v_vectors_cov[i].plaintext, + snow_v_vectors_cov[i].length_in_bytes, + snow_v_vectors_cov[i].ciphertext); errors += test_suite_end(&ts_snow_v); @@ -1124,27 +808,24 @@ int snow_v_test(IMB_MGR *p_mgr) test_suite_start(&ts_snow_v_aead, "SNOW-V-AEAD"); for (i = 0; i < DIM(snow_v_aead_test_vectors); i++) - snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, - snow_v_aead_test_vectors[i].KEY, - snow_v_aead_test_vectors[i].IV, - snow_v_aead_test_vectors[i].aad, - snow_v_aead_test_vectors[i].plaintext, - snow_v_aead_test_vectors[i].length_in_bytes, - snow_v_aead_test_vectors[i].aad_length_in_bytes, - snow_v_aead_test_vectors[i].ciphertext, 1); + snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, snow_v_aead_test_vectors[i].KEY, + snow_v_aead_test_vectors[i].IV, + snow_v_aead_test_vectors[i].aad, + snow_v_aead_test_vectors[i].plaintext, + snow_v_aead_test_vectors[i].length_in_bytes, + snow_v_aead_test_vectors[i].aad_length_in_bytes, + snow_v_aead_test_vectors[i].ciphertext, 1); printf("SNOW-V-AEAD test vectors - DECRYPT\n"); for (i = 0; i < DIM(snow_v_aead_test_vectors); i++) - snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, - snow_v_aead_test_vectors[i].KEY, - snow_v_aead_test_vectors[i].IV, - snow_v_aead_test_vectors[i].aad, - snow_v_aead_test_vectors[i].plaintext, - snow_v_aead_test_vectors[i].length_in_bytes, - snow_v_aead_test_vectors[i].aad_length_in_bytes, - snow_v_aead_test_vectors[i].ciphertext, 0); + snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, snow_v_aead_test_vectors[i].KEY, + snow_v_aead_test_vectors[i].IV, + snow_v_aead_test_vectors[i].aad, + snow_v_aead_test_vectors[i].plaintext, + snow_v_aead_test_vectors[i].length_in_bytes, + snow_v_aead_test_vectors[i].aad_length_in_bytes, + snow_v_aead_test_vectors[i].ciphertext, 0); errors += test_suite_end(&ts_snow_v_aead); - return errors; } diff --git a/test/kat-app/xcbc_test.c b/test/kat-app/xcbc_test.c index 8761b05a..c56e3fc3 100644 --- a/test/kat-app/xcbc_test.c +++ b/test/kat-app/xcbc_test.c @@ -35,16 +35,14 @@ #include "utils.h" #include "mac_test.h" -int xcbc_test(struct IMB_MGR *mb_mgr); +int +xcbc_test(struct IMB_MGR *mb_mgr); extern const struct mac_test xcbc_test_json[]; static int -xcbc_job_ok(const struct mac_test *vec, - const struct IMB_JOB *job, - const uint8_t *auth, - const uint8_t *padding, - const size_t sizeof_padding) +xcbc_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const uint8_t *auth, + const uint8_t *padding, const size_t sizeof_padding) { const size_t auth_len = job->auth_tag_output_len_in_bytes; @@ -54,11 +52,9 @@ xcbc_job_ok(const struct mac_test *vec, } /* hash checks */ - if (memcmp(padding, &auth[sizeof_padding + auth_len], - sizeof_padding)) { + if (memcmp(padding, &auth[sizeof_padding + auth_len], sizeof_padding)) { printf("hash overwrite tail\n"); - hexdump(stderr, "Target", - &auth[sizeof_padding + auth_len], sizeof_padding); + hexdump(stderr, "Target", &auth[sizeof_padding + auth_len], sizeof_padding); return 0; } @@ -70,22 +66,17 @@ xcbc_job_ok(const struct mac_test *vec, if (memcmp((const void *) vec->tag, &auth[sizeof_padding], auth_len)) { printf("hash mismatched\n"); - hexdump(stderr, "Received", &auth[sizeof_padding], - auth_len); - hexdump(stderr, "Expected", (const void *) vec->tag, - auth_len); + hexdump(stderr, "Received", &auth[sizeof_padding], auth_len); + hexdump(stderr, "Expected", (const void *) vec->tag, auth_len); return 0; } return 1; } static int -test_xcbc(struct IMB_MGR *mb_mgr, - const struct mac_test *vec, - const int dir, - const int num_jobs) +test_xcbc(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const int dir, const int num_jobs) { - DECLARE_ALIGNED(uint32_t k1_exp[4*11], 16); + DECLARE_ALIGNED(uint32_t k1_exp[4 * 11], 16); uint8_t k2[16], k3[16]; struct IMB_JOB *job; uint8_t padding[16]; @@ -93,8 +84,8 @@ test_xcbc(struct IMB_MGR *mb_mgr, int i = 0, jobs_rx = 0, ret = -1; if (auths == NULL) { - fprintf(stderr, "Can't allocate buffer memory\n"); - goto end2; + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; } memset(padding, -1, sizeof(padding)); @@ -139,12 +130,10 @@ test_xcbc(struct IMB_MGR *mb_mgr, if (job) { jobs_rx++; if (num_jobs < 4) { - printf("%d Unexpected return from submit_job\n", - __LINE__); + printf("%d Unexpected return from submit_job\n", __LINE__); goto end; } - if (!xcbc_job_ok(vec, job, job->user_data, padding, - sizeof(padding))) + if (!xcbc_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } } @@ -152,8 +141,7 @@ test_xcbc(struct IMB_MGR *mb_mgr, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; - if (!xcbc_job_ok(vec, job, job->user_data, padding, - sizeof(padding))) + if (!xcbc_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } @@ -197,15 +185,14 @@ test_xcbc(struct IMB_MGR *mb_mgr, printf("Invalid return job received\n"); goto end; } - if (!xcbc_job_ok(vec, job, job->user_data, padding, - sizeof(padding))) + if (!xcbc_job_ok(vec, job, job->user_data, padding, sizeof(padding))) goto end; } } ret = 0; - end: +end: while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; @@ -214,7 +201,7 @@ test_xcbc(struct IMB_MGR *mb_mgr, free(auths[i]); } - end2: +end2: if (auths != NULL) free(auths); @@ -222,45 +209,38 @@ test_xcbc(struct IMB_MGR *mb_mgr, } static void -test_xcbc_std_vectors(struct IMB_MGR *mb_mgr, - struct test_suite_context *ctx, - const int num_jobs) +test_xcbc_std_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) { const struct mac_test *v = xcbc_test_json; if (!quiet_mode) - printf("AES-XCBC-128 standard test vectors (N jobs = %d):\n", num_jobs); - for (; v->msg != NULL; v++) { + printf("AES-XCBC-128 standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { if (!quiet_mode) { #ifdef DEBUG printf("Standard XCBC-128 vector %zu Msg len: %zu, " "Tag len:%zu\n", - v->tcId, - v->msgSize / 8, - v->tagSize / 8); + v->tcId, v->msgSize / 8, v->tagSize / 8); #else printf("."); #endif } - if (test_xcbc(mb_mgr, v, - IMB_DIR_ENCRYPT, num_jobs)) { + if (test_xcbc(mb_mgr, v, IMB_DIR_ENCRYPT, num_jobs)) { printf("error #%zu encrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - if (test_xcbc(mb_mgr, v, - IMB_DIR_DECRYPT, num_jobs)) { + if (test_xcbc(mb_mgr, v, IMB_DIR_DECRYPT, num_jobs)) { printf("error #%zu decrypt\n", v->tcId); test_suite_update(ctx, 0, 1); } else { test_suite_update(ctx, 1, 0); } - - } + } if (!quiet_mode) printf("\n"); } @@ -277,5 +257,5 @@ xcbc_test(struct IMB_MGR *mb_mgr) test_xcbc_std_vectors(mb_mgr, &ctx, i); errors = test_suite_end(&ctx); - return errors; + return errors; } diff --git a/test/kat-app/zuc_test.c b/test/kat-app/zuc_test.c index 259e12e7..d4707921 100644 --- a/test/kat-app/zuc_test.c +++ b/test/kat-app/zuc_test.c @@ -25,14 +25,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ - /*----------------------------------------------------------------------- -* Zuc functional test -*----------------------------------------------------------------------- -* -* A simple functional test for ZUC -* -*-----------------------------------------------------------------------*/ + * Zuc functional test + *----------------------------------------------------------------------- + * + * A simple functional test for ZUC + * + *-----------------------------------------------------------------------*/ #include #include @@ -45,55 +44,55 @@ #include "gcm_ctr_vectors_test.h" #include "utils.h" -#define MAXBUFS 17 +#define MAXBUFS 17 #define PASS_STATUS 0 #define FAIL_STATUS -1 -#define DIM(_x) (sizeof(_x)/sizeof(_x[0])) +#define DIM(_x) (sizeof(_x) / sizeof(_x[0])) #define MAX_BURST_JOBS 32 -enum api_type { - TEST_DIRECT_API, - TEST_SINGLE_JOB_API, - TEST_BURST_JOB_API -}; +enum api_type { TEST_DIRECT_API, TEST_SINGLE_JOB_API, TEST_BURST_JOB_API }; -int zuc_test(struct IMB_MGR *mb_mgr); - -int validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV); -int validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, - const enum api_type type); -int validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, - uint8_t **pIV, enum api_type type); -int validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - uint32_t numBuffs, const enum api_type type); -int validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, - const enum api_type type); -int validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, - uint8_t **pIV, uint32_t numBuffs, - const enum api_type type); +int +zuc_test(struct IMB_MGR *mb_mgr); + +int +validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, + uint8_t *pIV); +int +validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type); +int +validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, enum api_type type); +int +validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, + const enum api_type type); +int +validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type); +int +validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, + const enum api_type type); #ifdef __aarch64__ -int validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, - const enum api_type type); -int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, - const enum api_type type); +int +validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type); +int +validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type); #endif -int validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - uint32_t numBuffs, const enum api_type type); -int validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - uint32_t numBuffs, const enum api_type type); +int +validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); +int +validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); -static void byte_hexdump(const char *message, const uint8_t *ptr, int len); +static void +byte_hexdump(const char *message, const uint8_t *ptr, int len); /****************************************************************************** * @ingroup zuc_functionalTest_app @@ -104,13 +103,13 @@ static void byte_hexdump(const char *message, const uint8_t *ptr, int len); * pSrcData = pointers to the new source buffers * numOfBuffs = number of buffers * ************************************************/ -static uint32_t createData(uint8_t *pSrcData[MAXBUFS], - uint32_t numOfBuffs) +static uint32_t +createData(uint8_t *pSrcData[MAXBUFS], uint32_t numOfBuffs) { uint32_t i = 0; for (i = 0; i < numOfBuffs; i++) { - pSrcData[i] = (uint8_t *)malloc(MAX_BUFFER_LENGTH_IN_BYTES); + pSrcData[i] = (uint8_t *) malloc(MAX_BUFFER_LENGTH_IN_BYTES); if (!pSrcData[i]) { uint32_t j; @@ -139,17 +138,17 @@ static uint32_t createData(uint8_t *pSrcData[MAXBUFS], * ivLen = vector length * pIV = array of pointers to the new vector buffers * numOfBuffs = number of buffers -************************************************/ -static uint32_t createKeyVecData(uint32_t keyLen, uint8_t *pKeys[MAXBUFS], - uint32_t ivLen, uint8_t *pIV[MAXBUFS], - uint32_t numOfBuffs) + ************************************************/ +static uint32_t +createKeyVecData(uint32_t keyLen, uint8_t *pKeys[MAXBUFS], uint32_t ivLen, uint8_t *pIV[MAXBUFS], + uint32_t numOfBuffs) { uint32_t i = 0; for (i = 0; i < numOfBuffs; i++) { uint32_t j; - pIV[i] = (uint8_t *)malloc(ivLen); + pIV[i] = (uint8_t *) malloc(ivLen); if (!pIV[i]) { printf("malloc(pIV[i]): failed!\n"); @@ -190,7 +189,8 @@ static uint32_t createKeyVecData(uint32_t keyLen, uint8_t *pKeys[MAXBUFS], * length = length of pointer array (or number of pointers whose buffers * should be freed) * ************************************************/ -static void freePtrArray(uint8_t *pArr[MAXBUFS], uint32_t arrayLength) +static void +freePtrArray(uint8_t *pArr[MAXBUFS], uint32_t arrayLength) { uint32_t i = 0; @@ -198,7 +198,8 @@ static void freePtrArray(uint8_t *pArr[MAXBUFS], uint32_t arrayLength) free(pArr[i]); } -static uint32_t bswap4(const uint32_t val) +static uint32_t +bswap4(const uint32_t val) { return ((val >> 24) | /**< A*/ ((val & 0xff0000) >> 8) | /**< B*/ @@ -206,16 +207,17 @@ static uint32_t bswap4(const uint32_t val) (val << 24)); /**< D*/ } -int zuc_test(struct IMB_MGR *mb_mgr) +int +zuc_test(struct IMB_MGR *mb_mgr) { - const uint32_t numBuffs[] = {4, 8, 9, 16, 17}; + const uint32_t numBuffs[] = { 4, 8, 9, 16, 17 }; uint32_t i; int errors = 0; - uint8_t *pKeys[MAXBUFS] = {0}; - uint8_t *pIV[MAXBUFS] = {0}; - uint8_t *pSrcData[MAXBUFS] = {0}; - uint8_t *pDstData[MAXBUFS] = {0}; + uint8_t *pKeys[MAXBUFS] = { 0 }; + uint8_t *pIV[MAXBUFS] = { 0 }; + uint8_t *pSrcData[MAXBUFS] = { 0 }; + uint8_t *pDstData[MAXBUFS] = { 0 }; struct test_suite_context eea3_ctx; struct test_suite_context eia3_ctx; struct test_suite_context eea3_256_ctx; @@ -242,8 +244,7 @@ int zuc_test(struct IMB_MGR *mb_mgr) } /* Create random keys and vectors */ - if (createKeyVecData(IMB_ZUC256_KEY_LEN_IN_BYTES, pKeys, - IMB_ZUC256_IV_LEN_IN_BYTES_MAX, + if (createKeyVecData(IMB_ZUC256_KEY_LEN_IN_BYTES, pKeys, IMB_ZUC256_IV_LEN_IN_BYTES_MAX, pIV, MAXBUFS)) { printf("createKeyVecData() error\n"); freePtrArray(pSrcData, MAXBUFS); @@ -253,42 +254,40 @@ int zuc_test(struct IMB_MGR *mb_mgr) goto exit_zuc_test; } - if (validate_zuc_algorithm(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], - pIV[0])) + if (validate_zuc_algorithm(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0])) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); /* Direct API tests */ - if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], - pIV[0], TEST_DIRECT_API)) + if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0], + TEST_DIRECT_API)) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); - if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, - TEST_DIRECT_API)) + if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, TEST_DIRECT_API)) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_DIRECT_API)) + if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_DIRECT_API)) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); } - if (validate_zuc_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], - pIV[0], TEST_DIRECT_API)) + if (validate_zuc_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], pIV[0], + TEST_DIRECT_API)) test_suite_update(&eia3_ctx, 0, 1); else test_suite_update(&eia3_ctx, 1, 0); for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EIA_n_block(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_DIRECT_API)) + if (validate_zuc_EIA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_DIRECT_API)) test_suite_update(&eia3_ctx, 0, 1); else test_suite_update(&eia3_ctx, 1, 0); @@ -325,51 +324,50 @@ int zuc_test(struct IMB_MGR *mb_mgr) #endif /* Job API tests */ - if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], - pIV[0], TEST_SINGLE_JOB_API)) + if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0], + TEST_SINGLE_JOB_API)) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); - if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, - TEST_SINGLE_JOB_API)) + if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, TEST_SINGLE_JOB_API)) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_SINGLE_JOB_API)) + if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_SINGLE_JOB_API)) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); } for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_SINGLE_JOB_API)) + if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_SINGLE_JOB_API)) test_suite_update(&eea3_256_ctx, 0, 1); else test_suite_update(&eea3_256_ctx, 1, 0); } - if (validate_zuc_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], - pIV[0], TEST_SINGLE_JOB_API)) + if (validate_zuc_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], pIV[0], + TEST_SINGLE_JOB_API)) test_suite_update(&eia3_ctx, 0, 1); else test_suite_update(&eia3_ctx, 1, 0); for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EIA_n_block(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_SINGLE_JOB_API)) + if (validate_zuc_EIA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_SINGLE_JOB_API)) test_suite_update(&eia3_ctx, 0, 1); else test_suite_update(&eia3_ctx, 1, 0); } for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc256_EIA3(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_SINGLE_JOB_API)) + if (validate_zuc256_EIA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_SINGLE_JOB_API)) test_suite_update(&eia3_256_ctx, 0, 1); else test_suite_update(&eia3_256_ctx, 1, 0); @@ -391,30 +389,29 @@ int zuc_test(struct IMB_MGR *mb_mgr) /* Burst job API tests */ for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_BURST_JOB_API)) + if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_BURST_JOB_API)) test_suite_update(&eea3_ctx, 0, 1); else test_suite_update(&eea3_ctx, 1, 0); } for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_BURST_JOB_API)) + if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_BURST_JOB_API)) test_suite_update(&eea3_256_ctx, 0, 1); else test_suite_update(&eea3_256_ctx, 1, 0); } for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc256_EIA3(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_BURST_JOB_API)) + if (validate_zuc256_EIA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_BURST_JOB_API)) test_suite_update(&eia3_256_ctx, 0, 1); else test_suite_update(&eia3_256_ctx, 1, 0); } - exit_zuc_test: freePtrArray(pKeys, MAXBUFS); /*Free the key buffers*/ freePtrArray(pIV, MAXBUFS); /*Free the vector buffers*/ @@ -430,14 +427,12 @@ exit_zuc_test: } static inline int -submit_burst_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, - uint8_t ** const ivs, uint8_t ** const src, - uint8_t ** const dst, const uint32_t *lens, - int dir, const unsigned int num_jobs, - const unsigned int key_len, +submit_burst_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const ivs, + uint8_t **const src, uint8_t **const dst, const uint32_t *lens, int dir, + const unsigned int num_jobs, const unsigned int key_len, const unsigned int *iv_lens) { - IMB_JOB *job, *jobs[MAX_BURST_JOBS] = {NULL}; + IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; unsigned int i; unsigned int jobs_rx = 0; uint32_t completed_jobs = 0; @@ -469,8 +464,7 @@ submit_burst_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); return -1; } @@ -479,7 +473,7 @@ check_eea3_burst_jobs: job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); return -1; } @@ -487,12 +481,9 @@ check_eea3_burst_jobs: } if (jobs_rx != num_jobs) { - completed_jobs = IMB_FLUSH_BURST(mb_mgr, - num_jobs - completed_jobs, - jobs); + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); if (completed_jobs == 0) { - printf("Expected %u jobs, received %u\n", - num_jobs, jobs_rx); + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); return -1; } goto check_eea3_burst_jobs; @@ -502,11 +493,9 @@ check_eea3_burst_jobs: } static inline int -submit_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, - uint8_t ** const ivs, uint8_t ** const src, - uint8_t ** const dst, const uint32_t *lens, - int dir, const unsigned int num_jobs, - const unsigned int key_len, +submit_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const ivs, + uint8_t **const src, uint8_t **const dst, const uint32_t *lens, int dir, + const unsigned int num_jobs, const unsigned int key_len, const unsigned int *iv_lens) { IMB_JOB *job; @@ -533,8 +522,7 @@ submit_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, if (job != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, i); + printf("%d error status:%d, job %u", __LINE__, job->status, i); return -1; } } @@ -543,8 +531,7 @@ submit_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, i); + printf("%d error status:%d, job %u", __LINE__, job->status, i); return -1; } } @@ -558,15 +545,12 @@ submit_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, } static inline int -submit_burst_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, - uint8_t ** const iv, uint8_t ** const src, - uint8_t ** const tags, const uint32_t *lens, - const unsigned int num_jobs, - const unsigned int key_sz, - const unsigned int tag_sz, - const unsigned int *iv_lens) +submit_burst_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const iv, + uint8_t **const src, uint8_t **const tags, const uint32_t *lens, + const unsigned int num_jobs, const unsigned int key_sz, + const unsigned int tag_sz, const unsigned int *iv_lens) { - IMB_JOB *job, *jobs[MAX_BURST_JOBS] = {NULL}; + IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; unsigned int i; unsigned int jobs_rx = 0; uint32_t completed_jobs = 0; @@ -605,8 +589,7 @@ submit_burst_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, err = imb_get_errno(mb_mgr); if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); return -1; } @@ -615,7 +598,7 @@ check_eia3_burst_jobs: job = jobs[i]; if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i+1); + printf("job %u status not complete!\n", i + 1); return -1; } @@ -623,12 +606,9 @@ check_eia3_burst_jobs: } if (jobs_rx != num_jobs) { - completed_jobs = IMB_FLUSH_BURST(mb_mgr, - num_jobs - completed_jobs, - jobs); + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); if (completed_jobs == 0) { - printf("Expected %u jobs, received %u\n", - num_jobs, jobs_rx); + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); return -1; } goto check_eia3_burst_jobs; @@ -637,12 +617,9 @@ check_eia3_burst_jobs: } static inline int -submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, - uint8_t ** const iv, uint8_t ** const src, - uint8_t ** const tags, const uint32_t *lens, - const unsigned int num_jobs, - const unsigned int key_sz, - const unsigned int tag_sz, +submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const iv, + uint8_t **const src, uint8_t **const tags, const uint32_t *lens, + const unsigned int num_jobs, const unsigned int key_sz, const unsigned int tag_sz, const unsigned int *iv_lens) { IMB_JOB *job; @@ -676,8 +653,7 @@ submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, if (job != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, i); + printf("%d error status:%d, job %u", __LINE__, job->status, i); return -1; } } @@ -686,8 +662,7 @@ submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { jobs_rx++; if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", - __LINE__, job->status, i); + printf("%d error status:%d, job %u", __LINE__, job->status, i); return -1; } } @@ -701,8 +676,8 @@ submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t ** const keys, } static int -test_output(const uint8_t *out, const uint8_t *ref, const uint32_t bytelen, - const uint32_t bitlen, const char *err_msg) +test_output(const uint8_t *out, const uint8_t *ref, const uint32_t bytelen, const uint32_t bitlen, + const char *err_msg) { int ret = 0; uint32_t byteResidue; @@ -720,19 +695,17 @@ test_output(const uint8_t *out, const uint8_t *ref, const uint32_t bytelen, byte_hexdump("Expected", ref, bytelen); byte_hexdump("Found", out, bytelen); ret = -1; - /* - * Check last partial byte if there is one and - * all previous full bytes are correct - */ + /* + * Check last partial byte if there is one and + * all previous full bytes are correct + */ } else if (bitlen % 8) { bitResidue = (0xFF00 >> (bitlen % 8)) & 0x00FF; byteResidue = (ref[bitlen / 8] ^ out[bitlen / 8]) & bitResidue; if (byteResidue) { printf("%s : FAIL\n", err_msg); - printf("Expected: 0x%02X (last byte)\n", - 0xFF & ref[bitlen / 8]); - printf("Found: 0x%02X (last byte)\n", - 0xFF & out[bitlen / 8]); + printf("Expected: 0x%02X (last byte)\n", 0xFF & ref[bitlen / 8]); + printf("Found: 0x%02X (last byte)\n", 0xFF & out[bitlen / 8]); ret = -1; } #ifdef DEBUG @@ -754,9 +727,8 @@ test_output(const uint8_t *out, const uint8_t *ref, const uint32_t bytelen, } int -validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, - const enum api_type type) +validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type) { uint32_t i; int ret = 0; @@ -769,26 +741,18 @@ validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, const unsigned int iv_len = IMB_ZUC_IV_LEN_IN_BYTES; memcpy(pKeys, testEEA3_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_iv_gen(testEEA3_vectors[i].count, - testEEA3_vectors[i].Bearer, - testEEA3_vectors[i].Direction, - pIV); + zuc_eea3_iv_gen(testEEA3_vectors[i].count, testEEA3_vectors[i].Bearer, + testEEA3_vectors[i].Direction, pIV); byteLength = (testEEA3_vectors[i].length_in_bits + 7) / 8; memcpy(pSrcData, testEEA3_vectors[i].plaintext, byteLength); if (type == TEST_SINGLE_JOB_API) - submit_eea3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, - &pDstData, &byteLength, - IMB_DIR_ENCRYPT, 1, - IMB_ZUC_KEY_LEN_IN_BYTES, - &iv_len); + submit_eea3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &byteLength, + IMB_DIR_ENCRYPT, 1, IMB_ZUC_KEY_LEN_IN_BYTES, &iv_len); else - IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, - pDstData, byteLength); + IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, byteLength); - snprintf(msg, sizeof(msg), - "Validate ZUC 1 block test %u (Enc):", i + 1); - retTmp = test_output(pDstData, testEEA3_vectors[i].ciphertext, - byteLength, + snprintf(msg, sizeof(msg), "Validate ZUC 1 block test %u (Enc):", i + 1); + retTmp = test_output(pDstData, testEEA3_vectors[i].ciphertext, byteLength, testEEA3_vectors[i].length_in_bits, msg); if (retTmp < 0) ret = retTmp; @@ -798,11 +762,10 @@ validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, }; static int -submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - const enum api_type type, IMB_CIPHER_DIRECTION dir, - const unsigned int var_bufs, - const unsigned int num_buffers, const uint32_t *buf_idx) +submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, + uint8_t **pIV, const enum api_type type, IMB_CIPHER_DIRECTION dir, + const unsigned int var_bufs, const unsigned int num_buffers, + const uint32_t *buf_idx) { unsigned int i; uint32_t packetLen[MAXBUFS]; @@ -814,8 +777,7 @@ submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, vector = &testEEA3_vectors[buf_idx[i]]; packetLen[i] = (vector->length_in_bits + 7) / 8; memcpy(pKeys[i], vector->CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_iv_gen(vector->count, vector->Bearer, - vector->Direction, pIV[i]); + zuc_eea3_iv_gen(vector->count, vector->Bearer, vector->Direction, pIV[i]); iv_lens[i] = IMB_ZUC_IV_LEN_IN_BYTES; if (dir == IMB_DIR_ENCRYPT) memcpy(pSrcData[i], vector->plaintext, packetLen[i]); @@ -824,58 +786,46 @@ submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, } if (type == TEST_SINGLE_JOB_API) - submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, - pDstData, packetLen, dir, num_buffers, - IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); + submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); else if (type == TEST_BURST_JOB_API) - submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, - pDstData, packetLen, dir, num_buffers, - IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); + submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); else { if (num_buffers == 4) - IMB_ZUC_EEA3_4_BUFFER(mb_mgr, - (const void * const *)pKeys, - (const void * const *)pIV, - (const void * const *)pSrcData, - (void **)pDstData, packetLen); + IMB_ZUC_EEA3_4_BUFFER( + mb_mgr, (const void *const *) pKeys, (const void *const *) pIV, + (const void *const *) pSrcData, (void **) pDstData, packetLen); else - IMB_ZUC_EEA3_N_BUFFER(mb_mgr, - (const void * const *)pKeys, - (const void * const *)pIV, - (const void * const *)pSrcData, - (void **)pDstData, packetLen, - num_buffers); + IMB_ZUC_EEA3_N_BUFFER(mb_mgr, (const void *const *) pKeys, + (const void *const *) pIV, + (const void *const *) pSrcData, (void **) pDstData, + packetLen, num_buffers); } for (i = 0; i < num_buffers; i++) { - uint8_t *pDst8 = (uint8_t *)pDstData[i]; + uint8_t *pDst8 = (uint8_t *) pDstData[i]; int retTmp; char msg_start[50]; char msg[100]; vector = &testEEA3_vectors[buf_idx[i]]; if (var_bufs) - snprintf(msg_start, sizeof(msg_start), - "Validate ZUC %c block multi-vector", + snprintf(msg_start, sizeof(msg_start), "Validate ZUC %c block multi-vector", num_buffers == 4 ? '4' : 'N'); else - snprintf(msg_start, sizeof(msg_start), - "Validate ZUC %c block", + snprintf(msg_start, sizeof(msg_start), "Validate ZUC %c block", num_buffers == 4 ? '4' : 'N'); if (dir == IMB_DIR_ENCRYPT) { - snprintf(msg, sizeof(msg), - "%s test %u, index %u (Enc):", - msg_start, buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->ciphertext, - packetLen[i], + snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], vector->length_in_bits, msg); } else { /* DECRYPT */ - snprintf(msg, sizeof(msg), - "%s test %u, index %u (Dec):", - msg_start, buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->plaintext, - packetLen[i], + snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->plaintext, packetLen[i], vector->length_in_bits, msg); } if (retTmp < 0) @@ -886,12 +836,10 @@ submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, } static int -submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - const enum api_type type, IMB_CIPHER_DIRECTION dir, - const unsigned int var_bufs, - const unsigned int num_buffers, - const uint32_t *buf_idx) +submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, const enum api_type type, + IMB_CIPHER_DIRECTION dir, const unsigned int var_bufs, + const unsigned int num_buffers, const uint32_t *buf_idx) { unsigned int i; uint32_t packetLen[MAXBUFS]; @@ -912,52 +860,40 @@ submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, } if (type == TEST_SINGLE_JOB_API) - submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, - pDstData, packetLen, dir, num_buffers, - IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); + submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); else if (type == TEST_BURST_JOB_API) - submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, - pDstData, packetLen, dir, num_buffers, - IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); + submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); #ifdef __aarch64__ else - IMB_ZUC256_EEA3_N_BUFFER(mb_mgr, - (const void * const *)pKeys, - (const void * const *)pIV, - iv_lens, - (const void * const *)pSrcData, - (void **)pDstData, - packetLen, - num_buffers); + IMB_ZUC256_EEA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, + (const void * const *)pIV, iv_lens, + (const void * const *)pSrcData, (void **)pDstData, + packetLen, num_buffers); #endif for (i = 0; i < num_buffers; i++) { - uint8_t *pDst8 = (uint8_t *)pDstData[i]; + uint8_t *pDst8 = (uint8_t *) pDstData[i]; int retTmp; char msg_start[50]; char msg[100]; vector = &test256EEA3_vectors[buf_idx[i]]; if (var_bufs) - snprintf(msg_start, sizeof(msg_start), - "Validate ZUC-256 multi-vector"); + snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256 multi-vector"); else - snprintf(msg_start, sizeof(msg_start), - "Validate ZUC-256"); + snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256"); if (dir == IMB_DIR_ENCRYPT) { - snprintf(msg, sizeof(msg), - "%s test %u, index %u (Enc):", - msg_start, buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->ciphertext, - packetLen[i], + snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], vector->length_in_bits, msg); } else { /* DECRYPT */ - snprintf(msg, sizeof(msg), - "%s test %u, index %u (Dec):", - msg_start, buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->plaintext, - packetLen[i], + snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->plaintext, packetLen[i], vector->length_in_bits, msg); } if (retTmp < 0) @@ -967,9 +903,9 @@ submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, return ret; } -int validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - const enum api_type type) +int +validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, const enum api_type type) { uint32_t i, j; int ret = 0; @@ -980,14 +916,12 @@ int validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, for (j = 0; j < 4; j++) buf_idx[j] = i; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_ENCRYPT, - 0, 4, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 0, 4, buf_idx); if (retTmp < 0) ret = retTmp; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_DECRYPT, - 0, 4, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 0, 4, buf_idx); if (retTmp < 0) ret = retTmp; } @@ -996,16 +930,14 @@ int validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, * in groups of 4 */ for (i = 0; i < (NUM_ZUC_EEA3_TESTS - 4); i++) { for (j = 0; j < 4; j++) - buf_idx[j] = i+j; + buf_idx[j] = i + j; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_ENCRYPT, - 1, 4, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 1, 4, buf_idx); if (retTmp < 0) ret = retTmp; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_DECRYPT, - 1, 4, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 1, 4, buf_idx); if (retTmp < 0) ret = retTmp; } @@ -1013,9 +945,10 @@ int validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, return ret; }; -int validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - uint32_t numBuffs, const enum api_type type) +int +validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, + const enum api_type type) { uint32_t i, j; int ret = 0; @@ -1027,16 +960,13 @@ int validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, for (j = 0; j < numBuffs; j++) buf_idx[j] = i; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, - IMB_DIR_ENCRYPT, - 0, numBuffs, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 0, numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_DECRYPT, - 0, numBuffs, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 0, numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; } @@ -1045,15 +975,13 @@ int validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, for (i = 0; i < numBuffs; i++) buf_idx[i] = i % NUM_ZUC_EEA3_TESTS; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_ENCRYPT, - 1, numBuffs, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_ENCRYPT, 1, + numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_DECRYPT, - 1, numBuffs, buf_idx); + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_DECRYPT, 1, + numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; @@ -1104,9 +1032,9 @@ validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, }; #endif -int validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - uint32_t numBuffs, const enum api_type type) +int +validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) { uint32_t i, j; int ret = 0; @@ -1118,15 +1046,13 @@ int validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, for (j = 0; j < numBuffs; j++) buf_idx[j] = i; - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, - pKeys, pIV, type, IMB_DIR_ENCRYPT, - 0, numBuffs, buf_idx); + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 0, numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, - pKeys, pIV, type, IMB_DIR_DECRYPT, - 0, numBuffs, buf_idx); + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 0, numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; } @@ -1135,24 +1061,22 @@ int validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, for (i = 0; i < numBuffs; i++) buf_idx[i] = i % NUM_ZUC_256_EEA3_TESTS; - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_ENCRYPT, - 1, numBuffs, buf_idx); + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 1, numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, - pIV, type, IMB_DIR_DECRYPT, - 1, numBuffs, buf_idx); + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 1, numBuffs, buf_idx); if (retTmp < 0) ret = retTmp; return ret; } -int validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, - const enum api_type type) +int +validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type) { uint32_t i; int ret = 0; @@ -1163,31 +1087,25 @@ int validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, memcpy(pKeys, testEIA3_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eia3_iv_gen(testEIA3_vectors[i].count, - testEIA3_vectors[i].Bearer, - testEIA3_vectors[i].Direction, - pIV); + zuc_eia3_iv_gen(testEIA3_vectors[i].count, testEIA3_vectors[i].Bearer, + testEIA3_vectors[i].Direction, pIV); bitLength = testEIA3_vectors[i].length_in_bits; const uint32_t byteLength = (bitLength + 7) / 8; memcpy(pSrcData, testEIA3_vectors[i].message, byteLength); if (type == TEST_SINGLE_JOB_API) - submit_eia3_jobs(mb_mgr, &pKeys, &pIV, - &pSrcData, &pDstData, - &bitLength, 1, IMB_ZUC_KEY_LEN_IN_BYTES, - IMB_ZUC_DIGEST_LEN_IN_BYTES, &iv_len); + submit_eia3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &bitLength, 1, + IMB_ZUC_KEY_LEN_IN_BYTES, IMB_ZUC_DIGEST_LEN_IN_BYTES, + &iv_len); else /* TEST_DIRECT_API */ - IMB_ZUC_EIA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, - bitLength, (uint32_t *)pDstData); - const int retTmp = - memcmp(pDstData, &testEIA3_vectors[i].mac, - sizeof(((struct test128EIA3_vectors_t *)0)->mac)); + IMB_ZUC_EIA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, bitLength, + (uint32_t *) pDstData); + const int retTmp = memcmp(pDstData, &testEIA3_vectors[i].mac, + sizeof(((struct test128EIA3_vectors_t *) 0)->mac)); if (retTmp) { - printf("Validate ZUC 1 block test %u (Int): FAIL\n", - i + 1); - byte_hexdump("Expected", - (const uint8_t *)&testEIA3_vectors[i].mac, + printf("Validate ZUC 1 block test %u (Int): FAIL\n", i + 1); + byte_hexdump("Expected", (const uint8_t *) &testEIA3_vectors[i].mac, IMB_ZUC_DIGEST_LEN_IN_BYTES); byte_hexdump("Found", pDstData, IMB_ZUC_DIGEST_LEN_IN_BYTES); ret = retTmp; @@ -1205,9 +1123,10 @@ int validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, return ret; }; -int validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - uint32_t numBuffs, const enum api_type type) +int +validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, + const enum api_type type) { uint32_t i, j; int retTmp, ret = 0; @@ -1221,46 +1140,35 @@ int validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, for (j = 0; j < numBuffs; j++) { memcpy(pKeys[j], vector.CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eia3_iv_gen(vector.count, vector.Bearer, - vector.Direction, pIV[j]); + zuc_eia3_iv_gen(vector.count, vector.Bearer, vector.Direction, pIV[j]); bitLength[j] = vector.length_in_bits; byteLength = (bitLength[j] + 7) / 8; memcpy(pSrcData[j], vector.message, byteLength); iv_lens[j] = IMB_ZUC_IV_LEN_IN_BYTES; } if (type == TEST_SINGLE_JOB_API) - submit_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC_KEY_LEN_IN_BYTES, - IMB_ZUC_DIGEST_LEN_IN_BYTES, - iv_lens); + submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, + numBuffs, IMB_ZUC_KEY_LEN_IN_BYTES, + IMB_ZUC_DIGEST_LEN_IN_BYTES, iv_lens); else if (type == TEST_BURST_JOB_API) - submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC_KEY_LEN_IN_BYTES, - IMB_ZUC_DIGEST_LEN_IN_BYTES, - iv_lens); + submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, + numBuffs, IMB_ZUC_KEY_LEN_IN_BYTES, + IMB_ZUC_DIGEST_LEN_IN_BYTES, iv_lens); else /* TEST_BURST_JOB_API */ - IMB_ZUC_EIA3_N_BUFFER(mb_mgr, - (const void * const *)pKeys, - (const void * const *)pIV, - (const void * const *)pSrcData, - bitLength, (uint32_t **)pDstData, - numBuffs); + IMB_ZUC_EIA3_N_BUFFER(mb_mgr, (const void *const *) pKeys, + (const void *const *) pIV, + (const void *const *) pSrcData, bitLength, + (uint32_t **) pDstData, numBuffs); for (j = 0; j < numBuffs; j++) { - retTmp = - memcmp(pDstData[j], &vector.mac, IMB_ZUC_DIGEST_LEN_IN_BYTES); + retTmp = memcmp(pDstData[j], &vector.mac, IMB_ZUC_DIGEST_LEN_IN_BYTES); if (retTmp) { printf("Validate ZUC n block test %u, index %u " - "(Int): FAIL\n", i + 1, j); - byte_hexdump("Expected", - (const uint8_t *)&vector.mac, - IMB_ZUC_DIGEST_LEN_IN_BYTES); - byte_hexdump("Found", pDstData[j], + "(Int): FAIL\n", + i + 1, j); + byte_hexdump("Expected", (const uint8_t *) &vector.mac, IMB_ZUC_DIGEST_LEN_IN_BYTES); + byte_hexdump("Found", pDstData[j], IMB_ZUC_DIGEST_LEN_IN_BYTES); ret = retTmp; } #ifdef DEBUG @@ -1279,11 +1187,9 @@ int validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, * grouping all available tests vectors in groups of N buffers */ for (i = 0; i < numBuffs; i++) { vector = testEIA3_vectors[i % NUM_ZUC_EIA3_TESTS]; - memcpy(pKeys[i], vector.CK, - IMB_ZUC_KEY_LEN_IN_BYTES); + memcpy(pKeys[i], vector.CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eia3_iv_gen(vector.count, vector.Bearer, - vector.Direction, pIV[i]); + zuc_eia3_iv_gen(vector.count, vector.Bearer, vector.Direction, pIV[i]); bitLength[i] = vector.length_in_bits; byteLength = (bitLength[i] + 7) / 8; memcpy(pSrcData[i], vector.message, byteLength); @@ -1291,38 +1197,26 @@ int validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, } if (type == TEST_SINGLE_JOB_API) - submit_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC_KEY_LEN_IN_BYTES, - IMB_ZUC_DIGEST_LEN_IN_BYTES, - iv_lens); + submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, + IMB_ZUC_KEY_LEN_IN_BYTES, IMB_ZUC_DIGEST_LEN_IN_BYTES, iv_lens); else if (type == TEST_BURST_JOB_API) - submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC_KEY_LEN_IN_BYTES, - IMB_ZUC_DIGEST_LEN_IN_BYTES, + submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, + IMB_ZUC_KEY_LEN_IN_BYTES, IMB_ZUC_DIGEST_LEN_IN_BYTES, iv_lens); else /* TEST_BURST_JOB_API */ - IMB_ZUC_EIA3_N_BUFFER(mb_mgr, - (const void * const *)pKeys, - (const void * const *)pIV, - (const void * const *)pSrcData, - bitLength, (uint32_t **)pDstData, - numBuffs); + IMB_ZUC_EIA3_N_BUFFER(mb_mgr, (const void *const *) pKeys, + (const void *const *) pIV, (const void *const *) pSrcData, + bitLength, (uint32_t **) pDstData, numBuffs); for (i = 0; i < numBuffs; i++) { vector = testEIA3_vectors[i % NUM_ZUC_EIA3_TESTS]; - retTmp = - memcmp(pDstData[i], &vector.mac, - sizeof(((struct test128EIA3_vectors_t *)0)->mac)); + retTmp = memcmp(pDstData[i], &vector.mac, + sizeof(((struct test128EIA3_vectors_t *) 0)->mac)); if (retTmp) { printf("Validate ZUC n block multi-vector test " "# jobs = %u, index %u (Int): FAIL\n", numBuffs, i); - byte_hexdump("Expected", - (const uint8_t *)&vector.mac, + byte_hexdump("Expected", (const uint8_t *) &vector.mac, IMB_ZUC_DIGEST_LEN_IN_BYTES); byte_hexdump("Found", pDstData[i], IMB_ZUC_DIGEST_LEN_IN_BYTES); ret = retTmp; @@ -1341,9 +1235,8 @@ int validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, }; static int -verify_tag_256(void *mac, const struct test256EIA3_vectors_t *vector, - const unsigned tag_sz, const uint32_t test_idx, - const uint32_t vector_idx, const int multi_vector) +verify_tag_256(void *mac, const struct test256EIA3_vectors_t *vector, const unsigned tag_sz, + const uint32_t test_idx, const uint32_t vector_idx, const int multi_vector) { const void *ref_mac = NULL; int ret; @@ -1367,9 +1260,7 @@ verify_tag_256(void *mac, const struct test256EIA3_vectors_t *vector, "index %u (Int - %u bytes): FAIL\n", test_idx + 1, vector_idx, tag_sz); } - byte_hexdump("Expected", - (const uint8_t *)ref_mac, - tag_sz); + byte_hexdump("Expected", (const uint8_t *) ref_mac, tag_sz); byte_hexdump("Found", mac, tag_sz); } #ifdef DEBUG @@ -1459,9 +1350,9 @@ int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, }; #endif -int validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, - uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, - uint32_t numBuffs, const enum api_type type) +int +validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) { uint32_t i, j; int retTmp, ret = 0; @@ -1483,31 +1374,23 @@ int validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, } for (tag_sz = 4; tag_sz <= 16; tag_sz *= 2) { if (type == TEST_SINGLE_JOB_API) - submit_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC256_KEY_LEN_IN_BYTES, - tag_sz, iv_lens); + submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, + numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, + iv_lens); #ifdef __aarch64__ else if (type == TEST_DIRECT_API) - IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, - (const void * const *)pKeys, - (const void * const *)pIV, - iv_lens, - (const void * const *)pSrcData, - bitLength, (uint32_t **)pDstData, - tag_sz, numBuffs); + IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, + (const void * const *)pIV, iv_lens, + (const void * const *)pSrcData, bitLength, + (uint32_t **)pDstData, tag_sz, numBuffs); #endif else /* TEST_BURST_JOB_API */ - submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC256_KEY_LEN_IN_BYTES, - tag_sz, iv_lens); + submit_burst_eia3_jobs( + mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, + IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, iv_lens); for (j = 0; j < numBuffs; j++) { - retTmp = verify_tag_256(pDstData[j], vector, - tag_sz, i, j, 0); + retTmp = verify_tag_256(pDstData[j], vector, tag_sz, i, j, 0); if (retTmp) ret = retTmp; } @@ -1529,34 +1412,25 @@ int validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, for (tag_sz = 4; tag_sz <= 16; tag_sz *= 2) { if (type == TEST_SINGLE_JOB_API) - submit_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC256_KEY_LEN_IN_BYTES, - tag_sz, iv_lens); + submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, + numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, iv_lens); #ifdef __aarch64__ else if (type == TEST_DIRECT_API) - IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, - (const void * const *)pKeys, - (const void * const *)pIV, - iv_lens, - (const void * const *)pSrcData, - bitLength, (uint32_t **)pDstData, - tag_sz, numBuffs); + IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, + (const void * const *)pIV, iv_lens, + (const void * const *)pSrcData, bitLength, + (uint32_t **)pDstData, tag_sz, numBuffs); #endif else /* TEST_BURST_JOB_API */ - submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, - pSrcData, pDstData, - bitLength, numBuffs, - IMB_ZUC256_KEY_LEN_IN_BYTES, - tag_sz, iv_lens); + submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, + numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, + iv_lens); for (i = 0; i < numBuffs; i++) { const uint32_t vector_idx = i % NUM_ZUC_256_EIA3_TESTS; vector = &test256EIA3_vectors[vector_idx]; - retTmp = verify_tag_256(pDstData[i], vector, - tag_sz, numBuffs, i, 1); + retTmp = verify_tag_256(pDstData[i], vector, tag_sz, numBuffs, i, 1); if (retTmp) ret = retTmp; } @@ -1564,8 +1438,9 @@ int validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, return ret; }; -int validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV) +int +validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, + uint8_t *pIV) { uint32_t i; int ret = 0; @@ -1578,8 +1453,7 @@ int validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, memcpy(pKeys, testZUC_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); memcpy(pIV, testZUC_vectors[i].IV, IMB_ZUC_IV_LEN_IN_BYTES); memset(pSrcData, 0, 8); - IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, - 8); + IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, 8); swapBytes.sbw[0] = bswap4(testZUC_vectors[i].Z[0]); swapBytes.sbw[1] = bswap4(testZUC_vectors[i].Z[1]); ret = memcmp(pDstData, swapBytes.sbb, 8); @@ -1601,7 +1475,8 @@ int validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, ** @param ptr [IN] - pointer to beginning of buffer.$ ** @param len [IN] - length of buffer.$ *****************************************************************************/ -static void byte_hexdump(const char *message, const uint8_t *ptr, int len) +static void +byte_hexdump(const char *message, const uint8_t *ptr, int len) { int ctr; diff --git a/test/kat-app/zuc_test_vectors.h b/test/kat-app/zuc_test_vectors.h index cf2f8e91..9664c559 100644 --- a/test/kat-app/zuc_test_vectors.h +++ b/test/kat-app/zuc_test_vectors.h @@ -28,62 +28,62 @@ #ifndef __ZUC_TEST_VECTORS_H__ #define __ZUC_TEST_VECTORS_H__ -#define MAX_BUFFER_LENGTH_IN_BITS 5670 /* biggest test is EIA test 5 */ -#define MAX_BUFFER_LENGTH_IN_BYTES ((MAX_BUFFER_LENGTH_IN_BITS) + 7)/8 -#define NUM_ZUC_ALG_TESTS 3 -#define NUM_ZUC_EEA3_TESTS 5 -#define NUM_ZUC_256_EEA3_TESTS 10 +#define MAX_BUFFER_LENGTH_IN_BITS 5670 /* biggest test is EIA test 5 */ +#define MAX_BUFFER_LENGTH_IN_BYTES ((MAX_BUFFER_LENGTH_IN_BITS) + 7) / 8 +#define NUM_ZUC_ALG_TESTS 3 +#define NUM_ZUC_EEA3_TESTS 5 +#define NUM_ZUC_256_EEA3_TESTS 10 #ifndef __aarch64__ -#define NUM_ZUC_256_EIA3_TESTS 12 +#define NUM_ZUC_256_EIA3_TESTS 12 #else -#define NUM_ZUC_256_EIA3_TESTS 15 +#define NUM_ZUC_256_EIA3_TESTS 15 #endif -#define NUM_ZUC_EIA3_TESTS 10 +#define NUM_ZUC_EIA3_TESTS 10 typedef struct testZUC_vectors_t { - uint8_t CK[16]; - uint8_t IV[16]; - uint32_t Z[2]; + uint8_t CK[16]; + uint8_t IV[16]; + uint32_t Z[2]; } testZUC_vectors_t; typedef struct test128EEA3_vectors_t { - uint8_t CK[16]; - uint32_t count; - uint8_t Bearer; - uint8_t Direction; - uint32_t length_in_bits; - uint8_t plaintext[MAX_BUFFER_LENGTH_IN_BYTES]; - uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; + uint8_t CK[16]; + uint32_t count; + uint8_t Bearer; + uint8_t Direction; + uint32_t length_in_bits; + uint8_t plaintext[MAX_BUFFER_LENGTH_IN_BYTES]; + uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; } test128EEA_vectors_t; typedef struct test256EEA3_vectors_t { - uint8_t CK[32]; - uint8_t IV[25]; - uint32_t length_in_bits; - uint32_t iv_length; - uint8_t plaintext[MAX_BUFFER_LENGTH_IN_BYTES]; - uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; + uint8_t CK[32]; + uint8_t IV[25]; + uint32_t length_in_bits; + uint32_t iv_length; + uint8_t plaintext[MAX_BUFFER_LENGTH_IN_BYTES]; + uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; } test256EEA_vectors_t; typedef struct test128EIA3_vectors_t { - uint8_t CK[16]; - uint32_t count; - uint8_t Bearer; - uint8_t Direction; - uint32_t length_in_bits; - uint8_t message[MAX_BUFFER_LENGTH_IN_BYTES]; - uint8_t mac[4]; + uint8_t CK[16]; + uint32_t count; + uint8_t Bearer; + uint8_t Direction; + uint32_t length_in_bits; + uint8_t message[MAX_BUFFER_LENGTH_IN_BYTES]; + uint8_t mac[4]; } test128EIA_vectors_t; typedef struct test256EIA3_vectors_t { - uint8_t CK[32]; - uint8_t IV[25]; - uint32_t length_in_bits; - uint32_t iv_length; - uint8_t message[MAX_BUFFER_LENGTH_IN_BYTES]; - uint8_t mac4[4]; - uint8_t mac8[8]; - uint8_t mac16[16]; + uint8_t CK[32]; + uint8_t IV[25]; + uint32_t length_in_bits; + uint32_t iv_length; + uint8_t message[MAX_BUFFER_LENGTH_IN_BYTES]; + uint8_t mac4[4]; + uint8_t mac8[8]; + uint8_t mac16[16]; } test256EIA_vectors_t; /* @@ -91,1662 +91,1084 @@ typedef struct test256EIA3_vectors_t { * Version 1.1 (4th Jan. 2011). */ const struct testZUC_vectors_t testZUC_vectors[] = { - { - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0x27BEDE74, 0x018082DA} - }, - { - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - {0x0657CFA0, 0x7096398B} - }, - { - {0x3D, 0x4C, 0x4B, 0xE9, 0x6A, 0x82, 0xFD, 0xAE, - 0xB5, 0x8F, 0x64, 0x1D, 0xB1, 0x7B, 0x45, 0x5B}, - {0x84, 0x31, 0x9A, 0xA8, 0xDE, 0x69, 0x15, 0xCA, - 0x1F, 0x6B, 0xDA, 0x6B, 0xFB, 0xD8, 0xC7, 0x66}, - {0x14F1C272, 0x3279C419} - }, - { - {0x4D, 0x32, 0x0B, 0xFA, 0xD4, 0xC2, 0x85, 0xBF, - 0xD6, 0xB8, 0xBD, 0x00, 0xF3, 0x9D, 0x8B, 0x41}, - {0x52, 0x95, 0x9D, 0xAB, 0xA0, 0xBF, 0x17, 0x6E, - 0xCE, 0x2D, 0xC3, 0x15, 0x04, 0x9E, 0xB5, 0x74}, - {0xED4400E7, 0x0633E5C5} - }, + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0x27BEDE74, 0x018082DA } }, + { { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF }, + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF }, + { 0x0657CFA0, 0x7096398B } }, + { { 0x3D, 0x4C, 0x4B, 0xE9, 0x6A, 0x82, 0xFD, 0xAE, 0xB5, 0x8F, 0x64, 0x1D, 0xB1, 0x7B, + 0x45, 0x5B }, + { 0x84, 0x31, 0x9A, 0xA8, 0xDE, 0x69, 0x15, 0xCA, 0x1F, 0x6B, 0xDA, 0x6B, 0xFB, 0xD8, + 0xC7, 0x66 }, + { 0x14F1C272, 0x3279C419 } }, + { { 0x4D, 0x32, 0x0B, 0xFA, 0xD4, 0xC2, 0x85, 0xBF, 0xD6, 0xB8, 0xBD, 0x00, 0xF3, 0x9D, + 0x8B, 0x41 }, + { 0x52, 0x95, 0x9D, 0xAB, 0xA0, 0xBF, 0x17, 0x6E, 0xCE, 0x2D, 0xC3, 0x15, 0x04, 0x9E, + 0xB5, 0x74 }, + { 0xED4400E7, 0x0633E5C5 } }, }; const struct test128EEA3_vectors_t testEEA3_vectors[] = { - /* TestSet1*/ - { - {0x17, 0x3D, 0x14, 0xBA, 0x50, 0x03, 0x73, 0x1D, - 0x7A, 0x60, 0x04, 0x94, 0x70, 0xF0, 0x0A, 0x29}, - 0x66035492, - 0x0F, - 0x0, - 193, - /* plaintext*/ - {0x6C, 0xF6, 0x53, 0x40, 0x73, 0x55, 0x52, 0xAB, - 0x0C, 0x97, 0x52, 0xFA, 0x6F, 0x90, 0x25, 0xFE, - 0x0B, 0xD6, 0x75, 0xD9, 0x00, 0x58, 0x75, 0xB2, - 0x00, 0x00, 0x00, 0x00}, - /*ciphertext*/ - {0xA6, 0xC8, 0x5F, 0xC6, 0x6A, 0xFB, 0x85, 0x33, - 0xAA, 0xFC, 0x25, 0x18, 0xDF, 0xE7, 0x84, 0x94, - 0x0E, 0xE1, 0xE4, 0xB0, 0x30, 0x23, 0x8C, 0xC8, - 0x00, 0x00, 0x00, 0x00} - }, - /*TestSet2*/ - { - {0xE5, 0xBD, 0x3E, 0xA0, 0xEB, 0x55, 0xAD, 0xE8, - 0x66, 0xC6, 0xAC, 0x58, 0xBD, 0x54, 0x30, 0x2A}, - 0x56823, - 0x18, - 0x1, - 800, - /*plaintext*/ - {0x14, 0xA8, 0xEF, 0x69, 0x3D, 0x67, 0x85, 0x07, - 0xBB, 0xE7, 0x27, 0x0A, 0x7F, 0x67, 0xFF, 0x50, - 0x06, 0xC3, 0x52, 0x5B, 0x98, 0x07, 0xE4, 0x67, - 0xC4, 0xE5, 0x60, 0x00, 0xBA, 0x33, 0x8F, 0x5D, - 0x42, 0x95, 0x59, 0x03, 0x67, 0x51, 0x82, 0x22, - 0x46, 0xC8, 0x0D, 0x3B, 0x38, 0xF0, 0x7F, 0x4B, - 0xE2, 0xD8, 0xFF, 0x58, 0x05, 0xF5, 0x13, 0x22, - 0x29, 0xBD, 0xE9, 0x3B, 0xBB, 0xDC, 0xAF, 0x38, - 0x2B, 0xF1, 0xEE, 0x97, 0x2F, 0xBF, 0x99, 0x77, - 0xBA, 0xDA, 0x89, 0x45, 0x84, 0x7A, 0x2A, 0x6C, - 0x9A, 0xD3, 0x4A, 0x66, 0x75, 0x54, 0xE0, 0x4D, - 0x1F, 0x7F, 0xA2, 0xC3, 0x32, 0x41, 0xBD, 0x8F, - 0x01, 0xBA, 0x22, 0x0D}, - /*ciphertext*/ - {0x13, 0x1D, 0x43, 0xE0, 0xDE, 0xA1, 0xBE, 0x5C, - 0x5A, 0x1B, 0xFD, 0x97, 0x1D, 0x85, 0x2C, 0xBF, - 0x71, 0x2D, 0x7B, 0x4F, 0x57, 0x96, 0x1F, 0xEA, - 0x32, 0x08, 0xAF, 0xA8, 0xBC, 0xA4, 0x33, 0xF4, - 0x56, 0xAD, 0x09, 0xC7, 0x41, 0x7E, 0x58, 0xBC, - 0x69, 0xCF, 0x88, 0x66, 0xD1, 0x35, 0x3F, 0x74, - 0x86, 0x5E, 0x80, 0x78, 0x1D, 0x20, 0x2D, 0xFB, - 0x3E, 0xCF, 0xF7, 0xFC, 0xBC, 0x3B, 0x19, 0x0F, - 0xE8, 0x2A, 0x20, 0x4E, 0xD0, 0xE3, 0x50, 0xFC, - 0x0F, 0x6F, 0x26, 0x13, 0xB2, 0xF2, 0xBC, 0xA6, - 0xDF, 0x5A, 0x47, 0x3A, 0x57, 0xA4, 0xA0, 0x0D, - 0x98, 0x5E, 0xBA, 0xD8, 0x80, 0xD6, 0xF2, 0x38, - 0x64, 0xA0, 0x7B, 0x01} - }, - /*TestSet3*/ - { - {0xD4, 0x55, 0x2A, 0x8F, 0xD6, 0xE6, 0x1C, 0xC8, - 0x1A, 0x20, 0x09, 0x14, 0x1A, 0x29, 0xC1, 0x0B}, - 0x76452EC1, - 0x2, - 0x1, - 1570, - /* plaintext*/ - {0x38, 0xF0, 0x7F, 0x4B, 0xE2, 0xD8, 0xFF, 0x58, - 0x05, 0xF5, 0x13, 0x22, 0x29, 0xBD, 0xE9, 0x3B, - 0xBB, 0xDC, 0xAF, 0x38, 0x2B, 0xF1, 0xEE, 0x97, - 0x2F, 0xBF, 0x99, 0x77, 0xBA, 0xDA, 0x89, 0x45, - 0x84, 0x7A, 0x2A, 0x6C, 0x9A, 0xD3, 0x4A, 0x66, - 0x75, 0x54, 0xE0, 0x4D, 0x1F, 0x7F, 0xA2, 0xC3, - 0x32, 0x41, 0xBD, 0x8F, 0x01, 0xBA, 0x22, 0x0D, - 0x3C, 0xA4, 0xEC, 0x41, 0xE0, 0x74, 0x59, 0x5F, - 0x54, 0xAE, 0x2B, 0x45, 0x4F, 0xD9, 0x71, 0x43, - 0x20, 0x43, 0x60, 0x19, 0x65, 0xCC, 0xA8, 0x5C, - 0x24, 0x17, 0xED, 0x6C, 0xBE, 0xC3, 0xBA, 0xDA, - 0x84, 0xFC, 0x8A, 0x57, 0x9A, 0xEA, 0x78, 0x37, - 0xB0, 0x27, 0x11, 0x77, 0x24, 0x2A, 0x64, 0xDC, - 0x0A, 0x9D, 0xE7, 0x1A, 0x8E, 0xDE, 0xE8, 0x6C, - 0xA3, 0xD4, 0x7D, 0x03, 0x3D, 0x6B, 0xF5, 0x39, - 0x80, 0x4E, 0xCA, 0x86, 0xC5, 0x84, 0xA9, 0x05, - 0x2D, 0xE4, 0x6A, 0xD3, 0xFC, 0xED, 0x65, 0x54, - 0x3B, 0xD9, 0x02, 0x07, 0x37, 0x2B, 0x27, 0xAF, - 0xB7, 0x92, 0x34, 0xF5, 0xFF, 0x43, 0xEA, 0x87, - 0x08, 0x20, 0xE2, 0xC2, 0xB7, 0x8A, 0x8A, 0xAE, - 0x61, 0xCC, 0xE5, 0x2A, 0x05, 0x15, 0xE3, 0x48, - 0xD1, 0x96, 0x66, 0x4A, 0x34, 0x56, 0xB1, 0x82, - 0xA0, 0x7C, 0x40, 0x6E, 0x4A, 0x20, 0x79, 0x12, - 0x71, 0xCF, 0xED, 0xA1, 0x65, 0xD5, 0x35, 0xEC, - 0x5E, 0xA2, 0xD4, 0xDF, 0x40, 0x00, 0x00, 0x00}, - /*ciphertext*/ - {0x83, 0x83, 0xB0, 0x22, 0x9F, 0xCC, 0x0B, 0x9D, - 0x22, 0x95, 0xEC, 0x41, 0xC9, 0x77, 0xE9, 0xC2, - 0xBB, 0x72, 0xE2, 0x20, 0x37, 0x81, 0x41, 0xF9, - 0xC8, 0x31, 0x8F, 0x3A, 0x27, 0x0D, 0xFB, 0xCD, - 0xEE, 0x64, 0x11, 0xC2, 0xB3, 0x04, 0x4F, 0x17, - 0x6D, 0xC6, 0xE0, 0x0F, 0x89, 0x60, 0xF9, 0x7A, - 0xFA, 0xCD, 0x13, 0x1A, 0xD6, 0xA3, 0xB4, 0x9B, - 0x16, 0xB7, 0xBA, 0xBC, 0xF2, 0xA5, 0x09, 0xEB, - 0xB1, 0x6A, 0x75, 0xDC, 0xAB, 0x14, 0xFF, 0x27, - 0x5D, 0xBE, 0xEE, 0xA1, 0xA2, 0xB1, 0x55, 0xF9, - 0xD5, 0x2C, 0x26, 0x45, 0x2D, 0x01, 0x87, 0xC3, - 0x10, 0xA4, 0xEE, 0x55, 0xBE, 0xAA, 0x78, 0xAB, - 0x40, 0x24, 0x61, 0x5B, 0xA9, 0xF5, 0xD5, 0xAD, - 0xC7, 0x72, 0x8F, 0x73, 0x56, 0x06, 0x71, 0xF0, - 0x13, 0xE5, 0xE5, 0x50, 0x08, 0x5D, 0x32, 0x91, - 0xDF, 0x7D, 0x5F, 0xEC, 0xED, 0xDE, 0xD5, 0x59, - 0x64, 0x1B, 0x6C, 0x2F, 0x58, 0x52, 0x33, 0xBC, - 0x71, 0xE9, 0x60, 0x2B, 0xD2, 0x30, 0x58, 0x55, - 0xBB, 0xD2, 0x5F, 0xFA, 0x7F, 0x17, 0xEC, 0xBC, - 0x04, 0x2D, 0xAA, 0xE3, 0x8C, 0x1F, 0x57, 0xAD, - 0x8E, 0x8E, 0xBD, 0x37, 0x34, 0x6F, 0x71, 0xBE, - 0xFD, 0xBB, 0x74, 0x32, 0xE0, 0xE0, 0xBB, 0x2C, - 0xFC, 0x09, 0xBC, 0xD9, 0x65, 0x70, 0xCB, 0x0C, - 0x0C, 0x39, 0xDF, 0x5E, 0x29, 0x29, 0x4E, 0x82, - 0x70, 0x3A, 0x63, 0x7F, 0x80, 0x00, 0x00, 0x00} - }, - /*TestSet4*/ - { - {0xDB, 0x84, 0xB4, 0xFB, 0xCC, 0xDA, 0x56, 0x3B, - 0x66, 0x22, 0x7B, 0xFE, 0x45, 0x6F, 0x0F, 0x77}, - 0xE4850FE1, - 0x10, - 0x1, - 2798, - /*plaintext*/ - {0xE5, 0x39, 0xF3, 0xB8, 0x97, 0x32, 0x40, 0xDA, - 0x03, 0xF2, 0xB8, 0xAA, 0x05, 0xEE, 0x0A, 0x00, - 0xDB, 0xAF, 0xC0, 0xE1, 0x82, 0x05, 0x5D, 0xFE, - 0x3D, 0x73, 0x83, 0xD9, 0x2C, 0xEF, 0x40, 0xE9, - 0x29, 0x28, 0x60, 0x5D, 0x52, 0xD0, 0x5F, 0x4F, - 0x90, 0x18, 0xA1, 0xF1, 0x89, 0xAE, 0x39, 0x97, - 0xCE, 0x19, 0x15, 0x5F, 0xB1, 0x22, 0x1D, 0xB8, - 0xBB, 0x09, 0x51, 0xA8, 0x53, 0xAD, 0x85, 0x2C, - 0xE1, 0x6C, 0xFF, 0x07, 0x38, 0x2C, 0x93, 0xA1, - 0x57, 0xDE, 0x00, 0xDD, 0xB1, 0x25, 0xC7, 0x53, - 0x9F, 0xD8, 0x50, 0x45, 0xE4, 0xEE, 0x07, 0xE0, - 0xC4, 0x3F, 0x9E, 0x9D, 0x6F, 0x41, 0x4F, 0xC4, - 0xD1, 0xC6, 0x29, 0x17, 0x81, 0x3F, 0x74, 0xC0, - 0x0F, 0xC8, 0x3F, 0x3E, 0x2E, 0xD7, 0xC4, 0x5B, - 0xA5, 0x83, 0x52, 0x64, 0xB4, 0x3E, 0x0B, 0x20, - 0xAF, 0xDA, 0x6B, 0x30, 0x53, 0xBF, 0xB6, 0x42, - 0x3B, 0x7F, 0xCE, 0x25, 0x47, 0x9F, 0xF5, 0xF1, - 0x39, 0xDD, 0x9B, 0x5B, 0x99, 0x55, 0x58, 0xE2, - 0xA5, 0x6B, 0xE1, 0x8D, 0xD5, 0x81, 0xCD, 0x01, - 0x7C, 0x73, 0x5E, 0x6F, 0x0D, 0x0D, 0x97, 0xC4, - 0xDD, 0xC1, 0xD1, 0xDA, 0x70, 0xC6, 0xDB, 0x4A, - 0x12, 0xCC, 0x92, 0x77, 0x8E, 0x2F, 0xBB, 0xD6, - 0xF3, 0xBA, 0x52, 0xAF, 0x91, 0xC9, 0xC6, 0xB6, - 0x4E, 0x8D, 0xA4, 0xF7, 0xA2, 0xC2, 0x66, 0xD0, - 0x2D, 0x00, 0x17, 0x53, 0xDF, 0x08, 0x96, 0x03, - 0x93, 0xC5, 0xD5, 0x68, 0x88, 0xBF, 0x49, 0xEB, - 0x5C, 0x16, 0xD9, 0xA8, 0x04, 0x27, 0xA4, 0x16, - 0xBC, 0xB5, 0x97, 0xDF, 0x5B, 0xFE, 0x6F, 0x13, - 0x89, 0x0A, 0x07, 0xEE, 0x13, 0x40, 0xE6, 0x47, - 0x6B, 0x0D, 0x9A, 0xA8, 0xF8, 0x22, 0xAB, 0x0F, - 0xD1, 0xAB, 0x0D, 0x20, 0x4F, 0x40, 0xB7, 0xCE, - 0x6F, 0x2E, 0x13, 0x6E, 0xB6, 0x74, 0x85, 0xE5, - 0x07, 0x80, 0x4D, 0x50, 0x45, 0x88, 0xAD, 0x37, - 0xFF, 0xD8, 0x16, 0x56, 0x8B, 0x2D, 0xC4, 0x03, - 0x11, 0xDF, 0xB6, 0x54, 0xCD, 0xEA, 0xD4, 0x7E, - 0x23, 0x85, 0xC3, 0x43, 0x62, 0x03, 0xDD, 0x83, - 0x6F, 0x9C, 0x64, 0xD9, 0x74, 0x62, 0xAD, 0x5D, - 0xFA, 0x63, 0xB5, 0xCF, 0xE0, 0x8A, 0xCB, 0x95, - 0x32, 0x86, 0x6F, 0x5C, 0xA7, 0x87, 0x56, 0x6F, - 0xCA, 0x93, 0xE6, 0xB1, 0x69, 0x3E, 0xE1, 0x5C, - 0xF6, 0xF7, 0xA2, 0xD6, 0x89, 0xD9, 0x74, 0x17, - 0x98, 0xDC, 0x1C, 0x23, 0x8E, 0x1B, 0xE6, 0x50, - 0x73, 0x3B, 0x18, 0xFB, 0x34, 0xFF, 0x88, 0x0E, - 0x16, 0xBB, 0xD2, 0x1B, 0x47, 0xAC, 0x00, 0x00}, - /*ciphertext*/ - {0x4B, 0xBF, 0xA9, 0x1B, 0xA2, 0x5D, 0x47, 0xDB, - 0x9A, 0x9F, 0x19, 0x0D, 0x96, 0x2A, 0x19, 0xAB, - 0x32, 0x39, 0x26, 0xB3, 0x51, 0xFB, 0xD3, 0x9E, - 0x35, 0x1E, 0x05, 0xDA, 0x8B, 0x89, 0x25, 0xE3, - 0x0B, 0x1C, 0xCE, 0x0D, 0x12, 0x21, 0x10, 0x10, - 0x95, 0x81, 0x5C, 0xC7, 0xCB, 0x63, 0x19, 0x50, - 0x9E, 0xC0, 0xD6, 0x79, 0x40, 0x49, 0x19, 0x87, - 0xE1, 0x3F, 0x0A, 0xFF, 0xAC, 0x33, 0x2A, 0xA6, - 0xAA, 0x64, 0x62, 0x6D, 0x3E, 0x9A, 0x19, 0x17, - 0x51, 0x9E, 0x0B, 0x97, 0xB6, 0x55, 0xC6, 0xA1, - 0x65, 0xE4, 0x4C, 0xA9, 0xFE, 0xAC, 0x07, 0x90, - 0xD2, 0xA3, 0x21, 0xAD, 0x3D, 0x86, 0xB7, 0x9C, - 0x51, 0x38, 0x73, 0x9F, 0xA3, 0x8D, 0x88, 0x7E, - 0xC7, 0xDE, 0xF4, 0x49, 0xCE, 0x8A, 0xBD, 0xD3, - 0xE7, 0xF8, 0xDC, 0x4C, 0xA9, 0xE7, 0xB7, 0x33, - 0x14, 0xAD, 0x31, 0x0F, 0x90, 0x25, 0xE6, 0x19, - 0x46, 0xB3, 0xA5, 0x6D, 0xC6, 0x49, 0xEC, 0x0D, - 0xA0, 0xD6, 0x39, 0x43, 0xDF, 0xF5, 0x92, 0xCF, - 0x96, 0x2A, 0x7E, 0xFB, 0x2C, 0x85, 0x24, 0xE3, - 0x5A, 0x2A, 0x6E, 0x78, 0x79, 0xD6, 0x26, 0x04, - 0xEF, 0x26, 0x86, 0x95, 0xFA, 0x40, 0x03, 0x02, - 0x7E, 0x22, 0xE6, 0x08, 0x30, 0x77, 0x52, 0x20, - 0x64, 0xBD, 0x4A, 0x5B, 0x90, 0x6B, 0x5F, 0x53, - 0x12, 0x74, 0xF2, 0x35, 0xED, 0x50, 0x6C, 0xFF, - 0x01, 0x54, 0xC7, 0x54, 0x92, 0x8A, 0x0C, 0xE5, - 0x47, 0x6F, 0x2C, 0xB1, 0x02, 0x0A, 0x12, 0x22, - 0xD3, 0x2C, 0x14, 0x55, 0xEC, 0xAE, 0xF1, 0xE3, - 0x68, 0xFB, 0x34, 0x4D, 0x17, 0x35, 0xBF, 0xBE, - 0xDE, 0xB7, 0x1D, 0x0A, 0x33, 0xA2, 0xA5, 0x4B, - 0x1D, 0xA5, 0xA2, 0x94, 0xE6, 0x79, 0x14, 0x4D, - 0xDF, 0x11, 0xEB, 0x1A, 0x3D, 0xE8, 0xCF, 0x0C, - 0xC0, 0x61, 0x91, 0x79, 0x74, 0xF3, 0x5C, 0x1D, - 0x9C, 0xA0, 0xAC, 0x81, 0x80, 0x7F, 0x8F, 0xCC, - 0xE6, 0x19, 0x9A, 0x6C, 0x77, 0x12, 0xDA, 0x86, - 0x50, 0x21, 0xB0, 0x4C, 0xE0, 0x43, 0x95, 0x16, - 0xF1, 0xA5, 0x26, 0xCC, 0xDA, 0x9F, 0xD9, 0xAB, - 0xBD, 0x53, 0xC3, 0xA6, 0x84, 0xF9, 0xAE, 0x1E, - 0x7E, 0xE6, 0xB1, 0x1D, 0xA1, 0x38, 0xEA, 0x82, - 0x6C, 0x55, 0x16, 0xB5, 0xAA, 0xDF, 0x1A, 0xBB, - 0xE3, 0x6F, 0xA7, 0xFF, 0xF9, 0x2E, 0x3A, 0x11, - 0x76, 0x06, 0x4E, 0x8D, 0x95, 0xF2, 0xE4, 0x88, - 0x2B, 0x55, 0x00, 0xB9, 0x32, 0x28, 0xB2, 0x19, - 0x4A, 0x47, 0x5C, 0x1A, 0x27, 0xF6, 0x3F, 0x9F, - 0xFD, 0x26, 0x49, 0x89, 0xA1, 0xBC, 0x00, 0x00} - }, - /*TestSet5*/ - { - {0xE1, 0x3F, 0xED, 0x21, 0xB4, 0x6E, 0x4E, 0x7E, - 0xC3, 0x12, 0x53, 0xB2, 0xBB, 0x17, 0xB3, 0xE0}, - 0x2738CDAA, - 0x1A, - 0x0, - 4019, - /*plaintext*/ - {0x8D, 0x74, 0xE2, 0x0D, 0x54, 0x89, 0x4E, 0x06, - 0xD3, 0xCB, 0x13, 0xCB, 0x39, 0x33, 0x06, 0x5E, - 0x86, 0x74, 0xBE, 0x62, 0xAD, 0xB1, 0xC7, 0x2B, - 0x3A, 0x64, 0x69, 0x65, 0xAB, 0x63, 0xCB, 0x7B, - 0x78, 0x54, 0xDF, 0xDC, 0x27, 0xE8, 0x49, 0x29, - 0xF4, 0x9C, 0x64, 0xB8, 0x72, 0xA4, 0x90, 0xB1, - 0x3F, 0x95, 0x7B, 0x64, 0x82, 0x7E, 0x71, 0xF4, - 0x1F, 0xBD, 0x42, 0x69, 0xA4, 0x2C, 0x97, 0xF8, - 0x24, 0x53, 0x70, 0x27, 0xF8, 0x6E, 0x9F, 0x4A, - 0xD8, 0x2D, 0x1D, 0xF4, 0x51, 0x69, 0x0F, 0xDD, - 0x98, 0xB6, 0xD0, 0x3F, 0x3A, 0x0E, 0xBE, 0x3A, - 0x31, 0x2D, 0x6B, 0x84, 0x0B, 0xA5, 0xA1, 0x82, - 0x0B, 0x2A, 0x2C, 0x97, 0x09, 0xC0, 0x90, 0xD2, - 0x45, 0xED, 0x26, 0x7C, 0xF8, 0x45, 0xAE, 0x41, - 0xFA, 0x97, 0x5D, 0x33, 0x33, 0xAC, 0x30, 0x09, - 0xFD, 0x40, 0xEB, 0xA9, 0xEB, 0x5B, 0x88, 0x57, - 0x14, 0xB7, 0x68, 0xB6, 0x97, 0x13, 0x8B, 0xAF, - 0x21, 0x38, 0x0E, 0xCA, 0x49, 0xF6, 0x44, 0xD4, - 0x86, 0x89, 0xE4, 0x21, 0x57, 0x60, 0xB9, 0x06, - 0x73, 0x9F, 0x0D, 0x2B, 0x3F, 0x09, 0x11, 0x33, - 0xCA, 0x15, 0xD9, 0x81, 0xCB, 0xE4, 0x01, 0xBA, - 0xF7, 0x2D, 0x05, 0xAC, 0xE0, 0x5C, 0xCC, 0xB2, - 0xD2, 0x97, 0xF4, 0xEF, 0x6A, 0x5F, 0x58, 0xD9, - 0x12, 0x46, 0xCF, 0xA7, 0x72, 0x15, 0xB8, 0x92, - 0xAB, 0x44, 0x1D, 0x52, 0x78, 0x45, 0x27, 0x95, - 0xCC, 0xB7, 0xF5, 0xD7, 0x90, 0x57, 0xA1, 0xC4, - 0xF7, 0x7F, 0x80, 0xD4, 0x6D, 0xB2, 0x03, 0x3C, - 0xB7, 0x9B, 0xED, 0xF8, 0xE6, 0x05, 0x51, 0xCE, - 0x10, 0xC6, 0x67, 0xF6, 0x2A, 0x97, 0xAB, 0xAF, - 0xAB, 0xBC, 0xD6, 0x77, 0x20, 0x18, 0xDF, 0x96, - 0xA2, 0x82, 0xEA, 0x73, 0x7C, 0xE2, 0xCB, 0x33, - 0x12, 0x11, 0xF6, 0x0D, 0x53, 0x54, 0xCE, 0x78, - 0xF9, 0x91, 0x8D, 0x9C, 0x20, 0x6C, 0xA0, 0x42, - 0xC9, 0xB6, 0x23, 0x87, 0xDD, 0x70, 0x96, 0x04, - 0xA5, 0x0A, 0xF1, 0x6D, 0x8D, 0x35, 0xA8, 0x90, - 0x6B, 0xE4, 0x84, 0xCF, 0x2E, 0x74, 0xA9, 0x28, - 0x99, 0x40, 0x36, 0x43, 0x53, 0x24, 0x9B, 0x27, - 0xB4, 0xC9, 0xAE, 0x29, 0xED, 0xDF, 0xC7, 0xDA, - 0x64, 0x18, 0x79, 0x1A, 0x4E, 0x7B, 0xAA, 0x06, - 0x60, 0xFA, 0x64, 0x51, 0x1F, 0x2D, 0x68, 0x5C, - 0xC3, 0xA5, 0xFF, 0x70, 0xE0, 0xD2, 0xB7, 0x42, - 0x92, 0xE3, 0xB8, 0xA0, 0xCD, 0x6B, 0x04, 0xB1, - 0xC7, 0x90, 0xB8, 0xEA, 0xD2, 0x70, 0x37, 0x08, - 0x54, 0x0D, 0xEA, 0x2F, 0xC0, 0x9C, 0x3D, 0xA7, - 0x70, 0xF6, 0x54, 0x49, 0xE8, 0x4D, 0x81, 0x7A, - 0x4F, 0x55, 0x10, 0x55, 0xE1, 0x9A, 0xB8, 0x50, - 0x18, 0xA0, 0x02, 0x8B, 0x71, 0xA1, 0x44, 0xD9, - 0x67, 0x91, 0xE9, 0xA3, 0x57, 0x79, 0x33, 0x50, - 0x4E, 0xEE, 0x00, 0x60, 0x34, 0x0C, 0x69, 0xD2, - 0x74, 0xE1, 0xBF, 0x9D, 0x80, 0x5D, 0xCB, 0xCC, - 0x1A, 0x6F, 0xAA, 0x97, 0x68, 0x00, 0xB6, 0xFF, - 0x2B, 0x67, 0x1D, 0xC4, 0x63, 0x65, 0x2F, 0xA8, - 0xA3, 0x3E, 0xE5, 0x09, 0x74, 0xC1, 0xC2, 0x1B, - 0xE0, 0x1E, 0xAB, 0xB2, 0x16, 0x74, 0x30, 0x26, - 0x9D, 0x72, 0xEE, 0x51, 0x1C, 0x9D, 0xDE, 0x30, - 0x79, 0x7C, 0x9A, 0x25, 0xD8, 0x6C, 0xE7, 0x4F, - 0x5B, 0x96, 0x1B, 0xE5, 0xFD, 0xFB, 0x68, 0x07, - 0x81, 0x40, 0x39, 0xE7, 0x13, 0x76, 0x36, 0xBD, - 0x1D, 0x7F, 0xA9, 0xE0, 0x9E, 0xFD, 0x20, 0x07, - 0x50, 0x59, 0x06, 0xA5, 0xAC, 0x45, 0xDF, 0xDE, - 0xED, 0x77, 0x57, 0xBB, 0xEE, 0x74, 0x57, 0x49, - 0xC2, 0x96, 0x33, 0x35, 0x0B, 0xEE, 0x0E, 0xA6, - 0xF4, 0x09, 0xDF, 0x45, 0x80, 0x16, 0x00, 0x00}, - /*ciphertext*/ - {0x94, 0xEA, 0xA4, 0xAA, 0x30, 0xA5, 0x71, 0x37, - 0xDD, 0xF0, 0x9B, 0x97, 0xB2, 0x56, 0x18, 0xA2, - 0x0A, 0x13, 0xE2, 0xF1, 0x0F, 0xA5, 0xBF, 0x81, - 0x61, 0xA8, 0x79, 0xCC, 0x2A, 0xE7, 0x97, 0xA6, - 0xB4, 0xCF, 0x2D, 0x9D, 0xF3, 0x1D, 0xEB, 0xB9, - 0x90, 0x5C, 0xCF, 0xEC, 0x97, 0xDE, 0x60, 0x5D, - 0x21, 0xC6, 0x1A, 0xB8, 0x53, 0x1B, 0x7F, 0x3C, - 0x9D, 0xA5, 0xF0, 0x39, 0x31, 0xF8, 0xA0, 0x64, - 0x2D, 0xE4, 0x82, 0x11, 0xF5, 0xF5, 0x2F, 0xFE, - 0xA1, 0x0F, 0x39, 0x2A, 0x04, 0x76, 0x69, 0x98, - 0x5D, 0xA4, 0x54, 0xA2, 0x8F, 0x08, 0x09, 0x61, - 0xA6, 0xC2, 0xB6, 0x2D, 0xAA, 0x17, 0xF3, 0x3C, - 0xD6, 0x0A, 0x49, 0x71, 0xF4, 0x8D, 0x2D, 0x90, - 0x93, 0x94, 0xA5, 0x5F, 0x48, 0x11, 0x7A, 0xCE, - 0x43, 0xD7, 0x08, 0xE6, 0xB7, 0x7D, 0x3D, 0xC4, - 0x6D, 0x8B, 0xC0, 0x17, 0xD4, 0xD1, 0xAB, 0xB7, - 0x7B, 0x74, 0x28, 0xC0, 0x42, 0xB0, 0x6F, 0x2F, - 0x99, 0xD8, 0xD0, 0x7C, 0x98, 0x79, 0xD9, 0x96, - 0x00, 0x12, 0x7A, 0x31, 0x98, 0x5F, 0x10, 0x99, - 0xBB, 0xD7, 0xD6, 0xC1, 0x51, 0x9E, 0xDE, 0x8F, - 0x5E, 0xEB, 0x4A, 0x61, 0x0B, 0x34, 0x9A, 0xC0, - 0x1E, 0xA2, 0x35, 0x06, 0x91, 0x75, 0x6B, 0xD1, - 0x05, 0xC9, 0x74, 0xA5, 0x3E, 0xDD, 0xB3, 0x5D, - 0x1D, 0x41, 0x00, 0xB0, 0x12, 0xE5, 0x22, 0xAB, - 0x41, 0xF4, 0xC5, 0xF2, 0xFD, 0xE7, 0x6B, 0x59, - 0xCB, 0x8B, 0x96, 0xD8, 0x85, 0xCF, 0xE4, 0x08, - 0x0D, 0x13, 0x28, 0xA0, 0xD6, 0x36, 0xCC, 0x0E, - 0xDC, 0x05, 0x80, 0x0B, 0x76, 0xAC, 0xCA, 0x8F, - 0xEF, 0x67, 0x20, 0x84, 0xD1, 0xF5, 0x2A, 0x8B, - 0xBD, 0x8E, 0x09, 0x93, 0x32, 0x09, 0x92, 0xC7, - 0xFF, 0xBA, 0xE1, 0x7C, 0x40, 0x84, 0x41, 0xE0, - 0xEE, 0x88, 0x3F, 0xC8, 0xA8, 0xB0, 0x5E, 0x22, - 0xF5, 0xFF, 0x7F, 0x8D, 0x1B, 0x48, 0xC7, 0x4C, - 0x46, 0x8C, 0x46, 0x7A, 0x02, 0x8F, 0x09, 0xFD, - 0x7C, 0xE9, 0x11, 0x09, 0xA5, 0x70, 0xA2, 0xD5, - 0xC4, 0xD5, 0xF4, 0xFA, 0x18, 0xC5, 0xDD, 0x3E, - 0x45, 0x62, 0xAF, 0xE2, 0x4E, 0xF7, 0x71, 0x90, - 0x1F, 0x59, 0xAF, 0x64, 0x58, 0x98, 0xAC, 0xEF, - 0x08, 0x8A, 0xBA, 0xE0, 0x7E, 0x92, 0xD5, 0x2E, - 0xB2, 0xDE, 0x55, 0x04, 0x5B, 0xB1, 0xB7, 0xC4, - 0x16, 0x4E, 0xF2, 0xD7, 0xA6, 0xCA, 0xC1, 0x5E, - 0xEB, 0x92, 0x6D, 0x7E, 0xA2, 0xF0, 0x8B, 0x66, - 0xE1, 0xF7, 0x59, 0xF3, 0xAE, 0xE4, 0x46, 0x14, - 0x72, 0x5A, 0xA3, 0xC7, 0x48, 0x2B, 0x30, 0x84, - 0x4C, 0x14, 0x3F, 0xF8, 0x5B, 0x53, 0xF1, 0xE5, - 0x83, 0xC5, 0x01, 0x25, 0x7D, 0xDD, 0xD0, 0x96, - 0xB8, 0x12, 0x68, 0xDA, 0xA3, 0x03, 0xF1, 0x72, - 0x34, 0xC2, 0x33, 0x35, 0x41, 0xF0, 0xBB, 0x8E, - 0x19, 0x06, 0x48, 0xC5, 0x80, 0x7C, 0x86, 0x6D, - 0x71, 0x93, 0x22, 0x86, 0x09, 0xAD, 0xB9, 0x48, - 0x68, 0x6F, 0x7D, 0xE2, 0x94, 0xA8, 0x02, 0xCC, - 0x38, 0xF7, 0xFE, 0x52, 0x08, 0xF5, 0xEA, 0x31, - 0x96, 0xD0, 0x16, 0x7B, 0x9B, 0xDD, 0x02, 0xF0, - 0xD2, 0xA5, 0x22, 0x1C, 0xA5, 0x08, 0xF8, 0x93, - 0xAF, 0x5C, 0x4B, 0x4B, 0xB9, 0xF4, 0xF5, 0x20, - 0xFD, 0x84, 0x28, 0x9B, 0x3D, 0xBE, 0x7E, 0x61, - 0x49, 0x7A, 0x7E, 0x2A, 0x58, 0x40, 0x37, 0xEA, - 0x63, 0x7B, 0x69, 0x81, 0x12, 0x71, 0x74, 0xAF, - 0x57, 0xB4, 0x71, 0xDF, 0x4B, 0x27, 0x68, 0xFD, - 0x79, 0xC1, 0x54, 0x0F, 0xB3, 0xED, 0xF2, 0xEA, - 0x22, 0xCB, 0x69, 0xBE, 0xC0, 0xCF, 0x8D, 0x93, - 0x3D, 0x9C, 0x6F, 0xDD, 0x64, 0x5E, 0x85, 0x05, - 0x91, 0xCC, 0xA3, 0xD6, 0x2C, 0x0C, 0xC0, 0x00} - }, + /* TestSet1*/ + { { 0x17, 0x3D, 0x14, 0xBA, 0x50, 0x03, 0x73, 0x1D, 0x7A, 0x60, 0x04, 0x94, 0x70, 0xF0, + 0x0A, 0x29 }, + 0x66035492, + 0x0F, + 0x0, + 193, + /* plaintext*/ + { 0x6C, 0xF6, 0x53, 0x40, 0x73, 0x55, 0x52, 0xAB, 0x0C, 0x97, 0x52, 0xFA, 0x6F, 0x90, + 0x25, 0xFE, 0x0B, 0xD6, 0x75, 0xD9, 0x00, 0x58, 0x75, 0xB2, 0x00, 0x00, 0x00, 0x00 }, + /*ciphertext*/ + { 0xA6, 0xC8, 0x5F, 0xC6, 0x6A, 0xFB, 0x85, 0x33, 0xAA, 0xFC, 0x25, 0x18, 0xDF, 0xE7, + 0x84, 0x94, 0x0E, 0xE1, 0xE4, 0xB0, 0x30, 0x23, 0x8C, 0xC8, 0x00, 0x00, 0x00, 0x00 } }, + /*TestSet2*/ + { { 0xE5, 0xBD, 0x3E, 0xA0, 0xEB, 0x55, 0xAD, 0xE8, 0x66, 0xC6, 0xAC, 0x58, 0xBD, 0x54, + 0x30, 0x2A }, + 0x56823, + 0x18, + 0x1, + 800, + /*plaintext*/ + { 0x14, 0xA8, 0xEF, 0x69, 0x3D, 0x67, 0x85, 0x07, 0xBB, 0xE7, 0x27, 0x0A, 0x7F, + 0x67, 0xFF, 0x50, 0x06, 0xC3, 0x52, 0x5B, 0x98, 0x07, 0xE4, 0x67, 0xC4, 0xE5, + 0x60, 0x00, 0xBA, 0x33, 0x8F, 0x5D, 0x42, 0x95, 0x59, 0x03, 0x67, 0x51, 0x82, + 0x22, 0x46, 0xC8, 0x0D, 0x3B, 0x38, 0xF0, 0x7F, 0x4B, 0xE2, 0xD8, 0xFF, 0x58, + 0x05, 0xF5, 0x13, 0x22, 0x29, 0xBD, 0xE9, 0x3B, 0xBB, 0xDC, 0xAF, 0x38, 0x2B, + 0xF1, 0xEE, 0x97, 0x2F, 0xBF, 0x99, 0x77, 0xBA, 0xDA, 0x89, 0x45, 0x84, 0x7A, + 0x2A, 0x6C, 0x9A, 0xD3, 0x4A, 0x66, 0x75, 0x54, 0xE0, 0x4D, 0x1F, 0x7F, 0xA2, + 0xC3, 0x32, 0x41, 0xBD, 0x8F, 0x01, 0xBA, 0x22, 0x0D }, + /*ciphertext*/ + { 0x13, 0x1D, 0x43, 0xE0, 0xDE, 0xA1, 0xBE, 0x5C, 0x5A, 0x1B, 0xFD, 0x97, 0x1D, + 0x85, 0x2C, 0xBF, 0x71, 0x2D, 0x7B, 0x4F, 0x57, 0x96, 0x1F, 0xEA, 0x32, 0x08, + 0xAF, 0xA8, 0xBC, 0xA4, 0x33, 0xF4, 0x56, 0xAD, 0x09, 0xC7, 0x41, 0x7E, 0x58, + 0xBC, 0x69, 0xCF, 0x88, 0x66, 0xD1, 0x35, 0x3F, 0x74, 0x86, 0x5E, 0x80, 0x78, + 0x1D, 0x20, 0x2D, 0xFB, 0x3E, 0xCF, 0xF7, 0xFC, 0xBC, 0x3B, 0x19, 0x0F, 0xE8, + 0x2A, 0x20, 0x4E, 0xD0, 0xE3, 0x50, 0xFC, 0x0F, 0x6F, 0x26, 0x13, 0xB2, 0xF2, + 0xBC, 0xA6, 0xDF, 0x5A, 0x47, 0x3A, 0x57, 0xA4, 0xA0, 0x0D, 0x98, 0x5E, 0xBA, + 0xD8, 0x80, 0xD6, 0xF2, 0x38, 0x64, 0xA0, 0x7B, 0x01 } }, + /*TestSet3*/ + { { 0xD4, 0x55, 0x2A, 0x8F, 0xD6, 0xE6, 0x1C, 0xC8, 0x1A, 0x20, 0x09, 0x14, 0x1A, 0x29, + 0xC1, 0x0B }, + 0x76452EC1, + 0x2, + 0x1, + 1570, + /* plaintext*/ + { 0x38, 0xF0, 0x7F, 0x4B, 0xE2, 0xD8, 0xFF, 0x58, 0x05, 0xF5, 0x13, 0x22, 0x29, 0xBD, + 0xE9, 0x3B, 0xBB, 0xDC, 0xAF, 0x38, 0x2B, 0xF1, 0xEE, 0x97, 0x2F, 0xBF, 0x99, 0x77, + 0xBA, 0xDA, 0x89, 0x45, 0x84, 0x7A, 0x2A, 0x6C, 0x9A, 0xD3, 0x4A, 0x66, 0x75, 0x54, + 0xE0, 0x4D, 0x1F, 0x7F, 0xA2, 0xC3, 0x32, 0x41, 0xBD, 0x8F, 0x01, 0xBA, 0x22, 0x0D, + 0x3C, 0xA4, 0xEC, 0x41, 0xE0, 0x74, 0x59, 0x5F, 0x54, 0xAE, 0x2B, 0x45, 0x4F, 0xD9, + 0x71, 0x43, 0x20, 0x43, 0x60, 0x19, 0x65, 0xCC, 0xA8, 0x5C, 0x24, 0x17, 0xED, 0x6C, + 0xBE, 0xC3, 0xBA, 0xDA, 0x84, 0xFC, 0x8A, 0x57, 0x9A, 0xEA, 0x78, 0x37, 0xB0, 0x27, + 0x11, 0x77, 0x24, 0x2A, 0x64, 0xDC, 0x0A, 0x9D, 0xE7, 0x1A, 0x8E, 0xDE, 0xE8, 0x6C, + 0xA3, 0xD4, 0x7D, 0x03, 0x3D, 0x6B, 0xF5, 0x39, 0x80, 0x4E, 0xCA, 0x86, 0xC5, 0x84, + 0xA9, 0x05, 0x2D, 0xE4, 0x6A, 0xD3, 0xFC, 0xED, 0x65, 0x54, 0x3B, 0xD9, 0x02, 0x07, + 0x37, 0x2B, 0x27, 0xAF, 0xB7, 0x92, 0x34, 0xF5, 0xFF, 0x43, 0xEA, 0x87, 0x08, 0x20, + 0xE2, 0xC2, 0xB7, 0x8A, 0x8A, 0xAE, 0x61, 0xCC, 0xE5, 0x2A, 0x05, 0x15, 0xE3, 0x48, + 0xD1, 0x96, 0x66, 0x4A, 0x34, 0x56, 0xB1, 0x82, 0xA0, 0x7C, 0x40, 0x6E, 0x4A, 0x20, + 0x79, 0x12, 0x71, 0xCF, 0xED, 0xA1, 0x65, 0xD5, 0x35, 0xEC, 0x5E, 0xA2, 0xD4, 0xDF, + 0x40, 0x00, 0x00, 0x00 }, + /*ciphertext*/ + { 0x83, 0x83, 0xB0, 0x22, 0x9F, 0xCC, 0x0B, 0x9D, 0x22, 0x95, 0xEC, 0x41, 0xC9, 0x77, + 0xE9, 0xC2, 0xBB, 0x72, 0xE2, 0x20, 0x37, 0x81, 0x41, 0xF9, 0xC8, 0x31, 0x8F, 0x3A, + 0x27, 0x0D, 0xFB, 0xCD, 0xEE, 0x64, 0x11, 0xC2, 0xB3, 0x04, 0x4F, 0x17, 0x6D, 0xC6, + 0xE0, 0x0F, 0x89, 0x60, 0xF9, 0x7A, 0xFA, 0xCD, 0x13, 0x1A, 0xD6, 0xA3, 0xB4, 0x9B, + 0x16, 0xB7, 0xBA, 0xBC, 0xF2, 0xA5, 0x09, 0xEB, 0xB1, 0x6A, 0x75, 0xDC, 0xAB, 0x14, + 0xFF, 0x27, 0x5D, 0xBE, 0xEE, 0xA1, 0xA2, 0xB1, 0x55, 0xF9, 0xD5, 0x2C, 0x26, 0x45, + 0x2D, 0x01, 0x87, 0xC3, 0x10, 0xA4, 0xEE, 0x55, 0xBE, 0xAA, 0x78, 0xAB, 0x40, 0x24, + 0x61, 0x5B, 0xA9, 0xF5, 0xD5, 0xAD, 0xC7, 0x72, 0x8F, 0x73, 0x56, 0x06, 0x71, 0xF0, + 0x13, 0xE5, 0xE5, 0x50, 0x08, 0x5D, 0x32, 0x91, 0xDF, 0x7D, 0x5F, 0xEC, 0xED, 0xDE, + 0xD5, 0x59, 0x64, 0x1B, 0x6C, 0x2F, 0x58, 0x52, 0x33, 0xBC, 0x71, 0xE9, 0x60, 0x2B, + 0xD2, 0x30, 0x58, 0x55, 0xBB, 0xD2, 0x5F, 0xFA, 0x7F, 0x17, 0xEC, 0xBC, 0x04, 0x2D, + 0xAA, 0xE3, 0x8C, 0x1F, 0x57, 0xAD, 0x8E, 0x8E, 0xBD, 0x37, 0x34, 0x6F, 0x71, 0xBE, + 0xFD, 0xBB, 0x74, 0x32, 0xE0, 0xE0, 0xBB, 0x2C, 0xFC, 0x09, 0xBC, 0xD9, 0x65, 0x70, + 0xCB, 0x0C, 0x0C, 0x39, 0xDF, 0x5E, 0x29, 0x29, 0x4E, 0x82, 0x70, 0x3A, 0x63, 0x7F, + 0x80, 0x00, 0x00, 0x00 } }, + /*TestSet4*/ + { { 0xDB, 0x84, 0xB4, 0xFB, 0xCC, 0xDA, 0x56, 0x3B, 0x66, 0x22, 0x7B, 0xFE, 0x45, 0x6F, + 0x0F, 0x77 }, + 0xE4850FE1, + 0x10, + 0x1, + 2798, + /*plaintext*/ + { 0xE5, 0x39, 0xF3, 0xB8, 0x97, 0x32, 0x40, 0xDA, 0x03, 0xF2, 0xB8, 0xAA, 0x05, 0xEE, + 0x0A, 0x00, 0xDB, 0xAF, 0xC0, 0xE1, 0x82, 0x05, 0x5D, 0xFE, 0x3D, 0x73, 0x83, 0xD9, + 0x2C, 0xEF, 0x40, 0xE9, 0x29, 0x28, 0x60, 0x5D, 0x52, 0xD0, 0x5F, 0x4F, 0x90, 0x18, + 0xA1, 0xF1, 0x89, 0xAE, 0x39, 0x97, 0xCE, 0x19, 0x15, 0x5F, 0xB1, 0x22, 0x1D, 0xB8, + 0xBB, 0x09, 0x51, 0xA8, 0x53, 0xAD, 0x85, 0x2C, 0xE1, 0x6C, 0xFF, 0x07, 0x38, 0x2C, + 0x93, 0xA1, 0x57, 0xDE, 0x00, 0xDD, 0xB1, 0x25, 0xC7, 0x53, 0x9F, 0xD8, 0x50, 0x45, + 0xE4, 0xEE, 0x07, 0xE0, 0xC4, 0x3F, 0x9E, 0x9D, 0x6F, 0x41, 0x4F, 0xC4, 0xD1, 0xC6, + 0x29, 0x17, 0x81, 0x3F, 0x74, 0xC0, 0x0F, 0xC8, 0x3F, 0x3E, 0x2E, 0xD7, 0xC4, 0x5B, + 0xA5, 0x83, 0x52, 0x64, 0xB4, 0x3E, 0x0B, 0x20, 0xAF, 0xDA, 0x6B, 0x30, 0x53, 0xBF, + 0xB6, 0x42, 0x3B, 0x7F, 0xCE, 0x25, 0x47, 0x9F, 0xF5, 0xF1, 0x39, 0xDD, 0x9B, 0x5B, + 0x99, 0x55, 0x58, 0xE2, 0xA5, 0x6B, 0xE1, 0x8D, 0xD5, 0x81, 0xCD, 0x01, 0x7C, 0x73, + 0x5E, 0x6F, 0x0D, 0x0D, 0x97, 0xC4, 0xDD, 0xC1, 0xD1, 0xDA, 0x70, 0xC6, 0xDB, 0x4A, + 0x12, 0xCC, 0x92, 0x77, 0x8E, 0x2F, 0xBB, 0xD6, 0xF3, 0xBA, 0x52, 0xAF, 0x91, 0xC9, + 0xC6, 0xB6, 0x4E, 0x8D, 0xA4, 0xF7, 0xA2, 0xC2, 0x66, 0xD0, 0x2D, 0x00, 0x17, 0x53, + 0xDF, 0x08, 0x96, 0x03, 0x93, 0xC5, 0xD5, 0x68, 0x88, 0xBF, 0x49, 0xEB, 0x5C, 0x16, + 0xD9, 0xA8, 0x04, 0x27, 0xA4, 0x16, 0xBC, 0xB5, 0x97, 0xDF, 0x5B, 0xFE, 0x6F, 0x13, + 0x89, 0x0A, 0x07, 0xEE, 0x13, 0x40, 0xE6, 0x47, 0x6B, 0x0D, 0x9A, 0xA8, 0xF8, 0x22, + 0xAB, 0x0F, 0xD1, 0xAB, 0x0D, 0x20, 0x4F, 0x40, 0xB7, 0xCE, 0x6F, 0x2E, 0x13, 0x6E, + 0xB6, 0x74, 0x85, 0xE5, 0x07, 0x80, 0x4D, 0x50, 0x45, 0x88, 0xAD, 0x37, 0xFF, 0xD8, + 0x16, 0x56, 0x8B, 0x2D, 0xC4, 0x03, 0x11, 0xDF, 0xB6, 0x54, 0xCD, 0xEA, 0xD4, 0x7E, + 0x23, 0x85, 0xC3, 0x43, 0x62, 0x03, 0xDD, 0x83, 0x6F, 0x9C, 0x64, 0xD9, 0x74, 0x62, + 0xAD, 0x5D, 0xFA, 0x63, 0xB5, 0xCF, 0xE0, 0x8A, 0xCB, 0x95, 0x32, 0x86, 0x6F, 0x5C, + 0xA7, 0x87, 0x56, 0x6F, 0xCA, 0x93, 0xE6, 0xB1, 0x69, 0x3E, 0xE1, 0x5C, 0xF6, 0xF7, + 0xA2, 0xD6, 0x89, 0xD9, 0x74, 0x17, 0x98, 0xDC, 0x1C, 0x23, 0x8E, 0x1B, 0xE6, 0x50, + 0x73, 0x3B, 0x18, 0xFB, 0x34, 0xFF, 0x88, 0x0E, 0x16, 0xBB, 0xD2, 0x1B, 0x47, 0xAC, + 0x00, 0x00 }, + /*ciphertext*/ + { 0x4B, 0xBF, 0xA9, 0x1B, 0xA2, 0x5D, 0x47, 0xDB, 0x9A, 0x9F, 0x19, 0x0D, 0x96, 0x2A, + 0x19, 0xAB, 0x32, 0x39, 0x26, 0xB3, 0x51, 0xFB, 0xD3, 0x9E, 0x35, 0x1E, 0x05, 0xDA, + 0x8B, 0x89, 0x25, 0xE3, 0x0B, 0x1C, 0xCE, 0x0D, 0x12, 0x21, 0x10, 0x10, 0x95, 0x81, + 0x5C, 0xC7, 0xCB, 0x63, 0x19, 0x50, 0x9E, 0xC0, 0xD6, 0x79, 0x40, 0x49, 0x19, 0x87, + 0xE1, 0x3F, 0x0A, 0xFF, 0xAC, 0x33, 0x2A, 0xA6, 0xAA, 0x64, 0x62, 0x6D, 0x3E, 0x9A, + 0x19, 0x17, 0x51, 0x9E, 0x0B, 0x97, 0xB6, 0x55, 0xC6, 0xA1, 0x65, 0xE4, 0x4C, 0xA9, + 0xFE, 0xAC, 0x07, 0x90, 0xD2, 0xA3, 0x21, 0xAD, 0x3D, 0x86, 0xB7, 0x9C, 0x51, 0x38, + 0x73, 0x9F, 0xA3, 0x8D, 0x88, 0x7E, 0xC7, 0xDE, 0xF4, 0x49, 0xCE, 0x8A, 0xBD, 0xD3, + 0xE7, 0xF8, 0xDC, 0x4C, 0xA9, 0xE7, 0xB7, 0x33, 0x14, 0xAD, 0x31, 0x0F, 0x90, 0x25, + 0xE6, 0x19, 0x46, 0xB3, 0xA5, 0x6D, 0xC6, 0x49, 0xEC, 0x0D, 0xA0, 0xD6, 0x39, 0x43, + 0xDF, 0xF5, 0x92, 0xCF, 0x96, 0x2A, 0x7E, 0xFB, 0x2C, 0x85, 0x24, 0xE3, 0x5A, 0x2A, + 0x6E, 0x78, 0x79, 0xD6, 0x26, 0x04, 0xEF, 0x26, 0x86, 0x95, 0xFA, 0x40, 0x03, 0x02, + 0x7E, 0x22, 0xE6, 0x08, 0x30, 0x77, 0x52, 0x20, 0x64, 0xBD, 0x4A, 0x5B, 0x90, 0x6B, + 0x5F, 0x53, 0x12, 0x74, 0xF2, 0x35, 0xED, 0x50, 0x6C, 0xFF, 0x01, 0x54, 0xC7, 0x54, + 0x92, 0x8A, 0x0C, 0xE5, 0x47, 0x6F, 0x2C, 0xB1, 0x02, 0x0A, 0x12, 0x22, 0xD3, 0x2C, + 0x14, 0x55, 0xEC, 0xAE, 0xF1, 0xE3, 0x68, 0xFB, 0x34, 0x4D, 0x17, 0x35, 0xBF, 0xBE, + 0xDE, 0xB7, 0x1D, 0x0A, 0x33, 0xA2, 0xA5, 0x4B, 0x1D, 0xA5, 0xA2, 0x94, 0xE6, 0x79, + 0x14, 0x4D, 0xDF, 0x11, 0xEB, 0x1A, 0x3D, 0xE8, 0xCF, 0x0C, 0xC0, 0x61, 0x91, 0x79, + 0x74, 0xF3, 0x5C, 0x1D, 0x9C, 0xA0, 0xAC, 0x81, 0x80, 0x7F, 0x8F, 0xCC, 0xE6, 0x19, + 0x9A, 0x6C, 0x77, 0x12, 0xDA, 0x86, 0x50, 0x21, 0xB0, 0x4C, 0xE0, 0x43, 0x95, 0x16, + 0xF1, 0xA5, 0x26, 0xCC, 0xDA, 0x9F, 0xD9, 0xAB, 0xBD, 0x53, 0xC3, 0xA6, 0x84, 0xF9, + 0xAE, 0x1E, 0x7E, 0xE6, 0xB1, 0x1D, 0xA1, 0x38, 0xEA, 0x82, 0x6C, 0x55, 0x16, 0xB5, + 0xAA, 0xDF, 0x1A, 0xBB, 0xE3, 0x6F, 0xA7, 0xFF, 0xF9, 0x2E, 0x3A, 0x11, 0x76, 0x06, + 0x4E, 0x8D, 0x95, 0xF2, 0xE4, 0x88, 0x2B, 0x55, 0x00, 0xB9, 0x32, 0x28, 0xB2, 0x19, + 0x4A, 0x47, 0x5C, 0x1A, 0x27, 0xF6, 0x3F, 0x9F, 0xFD, 0x26, 0x49, 0x89, 0xA1, 0xBC, + 0x00, 0x00 } }, + /*TestSet5*/ + { { 0xE1, 0x3F, 0xED, 0x21, 0xB4, 0x6E, 0x4E, 0x7E, 0xC3, 0x12, 0x53, 0xB2, 0xBB, 0x17, + 0xB3, 0xE0 }, + 0x2738CDAA, + 0x1A, + 0x0, + 4019, + /*plaintext*/ + { 0x8D, 0x74, 0xE2, 0x0D, 0x54, 0x89, 0x4E, 0x06, 0xD3, 0xCB, 0x13, 0xCB, 0x39, 0x33, + 0x06, 0x5E, 0x86, 0x74, 0xBE, 0x62, 0xAD, 0xB1, 0xC7, 0x2B, 0x3A, 0x64, 0x69, 0x65, + 0xAB, 0x63, 0xCB, 0x7B, 0x78, 0x54, 0xDF, 0xDC, 0x27, 0xE8, 0x49, 0x29, 0xF4, 0x9C, + 0x64, 0xB8, 0x72, 0xA4, 0x90, 0xB1, 0x3F, 0x95, 0x7B, 0x64, 0x82, 0x7E, 0x71, 0xF4, + 0x1F, 0xBD, 0x42, 0x69, 0xA4, 0x2C, 0x97, 0xF8, 0x24, 0x53, 0x70, 0x27, 0xF8, 0x6E, + 0x9F, 0x4A, 0xD8, 0x2D, 0x1D, 0xF4, 0x51, 0x69, 0x0F, 0xDD, 0x98, 0xB6, 0xD0, 0x3F, + 0x3A, 0x0E, 0xBE, 0x3A, 0x31, 0x2D, 0x6B, 0x84, 0x0B, 0xA5, 0xA1, 0x82, 0x0B, 0x2A, + 0x2C, 0x97, 0x09, 0xC0, 0x90, 0xD2, 0x45, 0xED, 0x26, 0x7C, 0xF8, 0x45, 0xAE, 0x41, + 0xFA, 0x97, 0x5D, 0x33, 0x33, 0xAC, 0x30, 0x09, 0xFD, 0x40, 0xEB, 0xA9, 0xEB, 0x5B, + 0x88, 0x57, 0x14, 0xB7, 0x68, 0xB6, 0x97, 0x13, 0x8B, 0xAF, 0x21, 0x38, 0x0E, 0xCA, + 0x49, 0xF6, 0x44, 0xD4, 0x86, 0x89, 0xE4, 0x21, 0x57, 0x60, 0xB9, 0x06, 0x73, 0x9F, + 0x0D, 0x2B, 0x3F, 0x09, 0x11, 0x33, 0xCA, 0x15, 0xD9, 0x81, 0xCB, 0xE4, 0x01, 0xBA, + 0xF7, 0x2D, 0x05, 0xAC, 0xE0, 0x5C, 0xCC, 0xB2, 0xD2, 0x97, 0xF4, 0xEF, 0x6A, 0x5F, + 0x58, 0xD9, 0x12, 0x46, 0xCF, 0xA7, 0x72, 0x15, 0xB8, 0x92, 0xAB, 0x44, 0x1D, 0x52, + 0x78, 0x45, 0x27, 0x95, 0xCC, 0xB7, 0xF5, 0xD7, 0x90, 0x57, 0xA1, 0xC4, 0xF7, 0x7F, + 0x80, 0xD4, 0x6D, 0xB2, 0x03, 0x3C, 0xB7, 0x9B, 0xED, 0xF8, 0xE6, 0x05, 0x51, 0xCE, + 0x10, 0xC6, 0x67, 0xF6, 0x2A, 0x97, 0xAB, 0xAF, 0xAB, 0xBC, 0xD6, 0x77, 0x20, 0x18, + 0xDF, 0x96, 0xA2, 0x82, 0xEA, 0x73, 0x7C, 0xE2, 0xCB, 0x33, 0x12, 0x11, 0xF6, 0x0D, + 0x53, 0x54, 0xCE, 0x78, 0xF9, 0x91, 0x8D, 0x9C, 0x20, 0x6C, 0xA0, 0x42, 0xC9, 0xB6, + 0x23, 0x87, 0xDD, 0x70, 0x96, 0x04, 0xA5, 0x0A, 0xF1, 0x6D, 0x8D, 0x35, 0xA8, 0x90, + 0x6B, 0xE4, 0x84, 0xCF, 0x2E, 0x74, 0xA9, 0x28, 0x99, 0x40, 0x36, 0x43, 0x53, 0x24, + 0x9B, 0x27, 0xB4, 0xC9, 0xAE, 0x29, 0xED, 0xDF, 0xC7, 0xDA, 0x64, 0x18, 0x79, 0x1A, + 0x4E, 0x7B, 0xAA, 0x06, 0x60, 0xFA, 0x64, 0x51, 0x1F, 0x2D, 0x68, 0x5C, 0xC3, 0xA5, + 0xFF, 0x70, 0xE0, 0xD2, 0xB7, 0x42, 0x92, 0xE3, 0xB8, 0xA0, 0xCD, 0x6B, 0x04, 0xB1, + 0xC7, 0x90, 0xB8, 0xEA, 0xD2, 0x70, 0x37, 0x08, 0x54, 0x0D, 0xEA, 0x2F, 0xC0, 0x9C, + 0x3D, 0xA7, 0x70, 0xF6, 0x54, 0x49, 0xE8, 0x4D, 0x81, 0x7A, 0x4F, 0x55, 0x10, 0x55, + 0xE1, 0x9A, 0xB8, 0x50, 0x18, 0xA0, 0x02, 0x8B, 0x71, 0xA1, 0x44, 0xD9, 0x67, 0x91, + 0xE9, 0xA3, 0x57, 0x79, 0x33, 0x50, 0x4E, 0xEE, 0x00, 0x60, 0x34, 0x0C, 0x69, 0xD2, + 0x74, 0xE1, 0xBF, 0x9D, 0x80, 0x5D, 0xCB, 0xCC, 0x1A, 0x6F, 0xAA, 0x97, 0x68, 0x00, + 0xB6, 0xFF, 0x2B, 0x67, 0x1D, 0xC4, 0x63, 0x65, 0x2F, 0xA8, 0xA3, 0x3E, 0xE5, 0x09, + 0x74, 0xC1, 0xC2, 0x1B, 0xE0, 0x1E, 0xAB, 0xB2, 0x16, 0x74, 0x30, 0x26, 0x9D, 0x72, + 0xEE, 0x51, 0x1C, 0x9D, 0xDE, 0x30, 0x79, 0x7C, 0x9A, 0x25, 0xD8, 0x6C, 0xE7, 0x4F, + 0x5B, 0x96, 0x1B, 0xE5, 0xFD, 0xFB, 0x68, 0x07, 0x81, 0x40, 0x39, 0xE7, 0x13, 0x76, + 0x36, 0xBD, 0x1D, 0x7F, 0xA9, 0xE0, 0x9E, 0xFD, 0x20, 0x07, 0x50, 0x59, 0x06, 0xA5, + 0xAC, 0x45, 0xDF, 0xDE, 0xED, 0x77, 0x57, 0xBB, 0xEE, 0x74, 0x57, 0x49, 0xC2, 0x96, + 0x33, 0x35, 0x0B, 0xEE, 0x0E, 0xA6, 0xF4, 0x09, 0xDF, 0x45, 0x80, 0x16, 0x00, 0x00 }, + /*ciphertext*/ + { 0x94, 0xEA, 0xA4, 0xAA, 0x30, 0xA5, 0x71, 0x37, 0xDD, 0xF0, 0x9B, 0x97, 0xB2, 0x56, + 0x18, 0xA2, 0x0A, 0x13, 0xE2, 0xF1, 0x0F, 0xA5, 0xBF, 0x81, 0x61, 0xA8, 0x79, 0xCC, + 0x2A, 0xE7, 0x97, 0xA6, 0xB4, 0xCF, 0x2D, 0x9D, 0xF3, 0x1D, 0xEB, 0xB9, 0x90, 0x5C, + 0xCF, 0xEC, 0x97, 0xDE, 0x60, 0x5D, 0x21, 0xC6, 0x1A, 0xB8, 0x53, 0x1B, 0x7F, 0x3C, + 0x9D, 0xA5, 0xF0, 0x39, 0x31, 0xF8, 0xA0, 0x64, 0x2D, 0xE4, 0x82, 0x11, 0xF5, 0xF5, + 0x2F, 0xFE, 0xA1, 0x0F, 0x39, 0x2A, 0x04, 0x76, 0x69, 0x98, 0x5D, 0xA4, 0x54, 0xA2, + 0x8F, 0x08, 0x09, 0x61, 0xA6, 0xC2, 0xB6, 0x2D, 0xAA, 0x17, 0xF3, 0x3C, 0xD6, 0x0A, + 0x49, 0x71, 0xF4, 0x8D, 0x2D, 0x90, 0x93, 0x94, 0xA5, 0x5F, 0x48, 0x11, 0x7A, 0xCE, + 0x43, 0xD7, 0x08, 0xE6, 0xB7, 0x7D, 0x3D, 0xC4, 0x6D, 0x8B, 0xC0, 0x17, 0xD4, 0xD1, + 0xAB, 0xB7, 0x7B, 0x74, 0x28, 0xC0, 0x42, 0xB0, 0x6F, 0x2F, 0x99, 0xD8, 0xD0, 0x7C, + 0x98, 0x79, 0xD9, 0x96, 0x00, 0x12, 0x7A, 0x31, 0x98, 0x5F, 0x10, 0x99, 0xBB, 0xD7, + 0xD6, 0xC1, 0x51, 0x9E, 0xDE, 0x8F, 0x5E, 0xEB, 0x4A, 0x61, 0x0B, 0x34, 0x9A, 0xC0, + 0x1E, 0xA2, 0x35, 0x06, 0x91, 0x75, 0x6B, 0xD1, 0x05, 0xC9, 0x74, 0xA5, 0x3E, 0xDD, + 0xB3, 0x5D, 0x1D, 0x41, 0x00, 0xB0, 0x12, 0xE5, 0x22, 0xAB, 0x41, 0xF4, 0xC5, 0xF2, + 0xFD, 0xE7, 0x6B, 0x59, 0xCB, 0x8B, 0x96, 0xD8, 0x85, 0xCF, 0xE4, 0x08, 0x0D, 0x13, + 0x28, 0xA0, 0xD6, 0x36, 0xCC, 0x0E, 0xDC, 0x05, 0x80, 0x0B, 0x76, 0xAC, 0xCA, 0x8F, + 0xEF, 0x67, 0x20, 0x84, 0xD1, 0xF5, 0x2A, 0x8B, 0xBD, 0x8E, 0x09, 0x93, 0x32, 0x09, + 0x92, 0xC7, 0xFF, 0xBA, 0xE1, 0x7C, 0x40, 0x84, 0x41, 0xE0, 0xEE, 0x88, 0x3F, 0xC8, + 0xA8, 0xB0, 0x5E, 0x22, 0xF5, 0xFF, 0x7F, 0x8D, 0x1B, 0x48, 0xC7, 0x4C, 0x46, 0x8C, + 0x46, 0x7A, 0x02, 0x8F, 0x09, 0xFD, 0x7C, 0xE9, 0x11, 0x09, 0xA5, 0x70, 0xA2, 0xD5, + 0xC4, 0xD5, 0xF4, 0xFA, 0x18, 0xC5, 0xDD, 0x3E, 0x45, 0x62, 0xAF, 0xE2, 0x4E, 0xF7, + 0x71, 0x90, 0x1F, 0x59, 0xAF, 0x64, 0x58, 0x98, 0xAC, 0xEF, 0x08, 0x8A, 0xBA, 0xE0, + 0x7E, 0x92, 0xD5, 0x2E, 0xB2, 0xDE, 0x55, 0x04, 0x5B, 0xB1, 0xB7, 0xC4, 0x16, 0x4E, + 0xF2, 0xD7, 0xA6, 0xCA, 0xC1, 0x5E, 0xEB, 0x92, 0x6D, 0x7E, 0xA2, 0xF0, 0x8B, 0x66, + 0xE1, 0xF7, 0x59, 0xF3, 0xAE, 0xE4, 0x46, 0x14, 0x72, 0x5A, 0xA3, 0xC7, 0x48, 0x2B, + 0x30, 0x84, 0x4C, 0x14, 0x3F, 0xF8, 0x5B, 0x53, 0xF1, 0xE5, 0x83, 0xC5, 0x01, 0x25, + 0x7D, 0xDD, 0xD0, 0x96, 0xB8, 0x12, 0x68, 0xDA, 0xA3, 0x03, 0xF1, 0x72, 0x34, 0xC2, + 0x33, 0x35, 0x41, 0xF0, 0xBB, 0x8E, 0x19, 0x06, 0x48, 0xC5, 0x80, 0x7C, 0x86, 0x6D, + 0x71, 0x93, 0x22, 0x86, 0x09, 0xAD, 0xB9, 0x48, 0x68, 0x6F, 0x7D, 0xE2, 0x94, 0xA8, + 0x02, 0xCC, 0x38, 0xF7, 0xFE, 0x52, 0x08, 0xF5, 0xEA, 0x31, 0x96, 0xD0, 0x16, 0x7B, + 0x9B, 0xDD, 0x02, 0xF0, 0xD2, 0xA5, 0x22, 0x1C, 0xA5, 0x08, 0xF8, 0x93, 0xAF, 0x5C, + 0x4B, 0x4B, 0xB9, 0xF4, 0xF5, 0x20, 0xFD, 0x84, 0x28, 0x9B, 0x3D, 0xBE, 0x7E, 0x61, + 0x49, 0x7A, 0x7E, 0x2A, 0x58, 0x40, 0x37, 0xEA, 0x63, 0x7B, 0x69, 0x81, 0x12, 0x71, + 0x74, 0xAF, 0x57, 0xB4, 0x71, 0xDF, 0x4B, 0x27, 0x68, 0xFD, 0x79, 0xC1, 0x54, 0x0F, + 0xB3, 0xED, 0xF2, 0xEA, 0x22, 0xCB, 0x69, 0xBE, 0xC0, 0xCF, 0x8D, 0x93, 0x3D, 0x9C, + 0x6F, 0xDD, 0x64, 0x5E, 0x85, 0x05, 0x91, 0xCC, 0xA3, 0xD6, 0x2C, 0x0C, 0xC0, 0x00 } }, }; /* ZUC-256 */ const struct test256EEA3_vectors_t test256EEA3_vectors[] = { - /* TestSet 1 */ - { - /* Key */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* IV */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }, - /* Message length */ - 640, - /* IV length */ - 25, - /* Plaintext */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* Ciphertext */ - {0x58, 0xD0, 0x3A, 0xD6, 0x2E, 0x03, 0x2C, 0xE2, - 0xDA, 0xFC, 0x68, 0x3A, 0x39, 0xBD, 0xCB, 0x03, - 0x52, 0xA2, 0xBC, 0x67, 0xF1, 0xB7, 0xDE, 0x74, - 0x16, 0x3C, 0xE3, 0xA1, 0x01, 0xEF, 0x55, 0x58, - 0x96, 0x39, 0xD7, 0x5B, 0x95, 0xFA, 0x68, 0x1B, - 0x7F, 0x09, 0x0D, 0xF7, 0x56, 0x39, 0x1C, 0xCC, - 0x90, 0x3B, 0x76, 0x12, 0x74, 0x4D, 0x54, 0x4C, - 0x17, 0xBC, 0x3F, 0xAD, 0x8B, 0x16, 0x3B, 0x08, - 0x21, 0x78, 0x7C, 0x0B, 0x97, 0x77, 0x5B, 0xB8, - 0x49, 0x43, 0xC6, 0xBB, 0xE8, 0xAD, 0x8A, 0xFD - } - }, - /* TestSet 2 */ - { - /* Key */ - {0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, - 0x23, 0x19, 0x48, 0x42, 0xcb, 0x5c, 0x6d, 0x98, - 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, 0xeb, 0xe0, - 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e - }, - /* IV */ - {0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, - 0x02, 0x2d, 0x24, 0xcd, 0x23, 0x3f, 0x4d, 0x0a, - 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 - }, - /* Message length */ - 1536, - /* IV length */ - 23, - /* Plaintext */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* Ciphertext */ - {0xc1, 0xce, 0x46, 0xd2, 0x4e, 0x78, 0x6f, 0x97, - 0xcf, 0xc0, 0xa5, 0x3c, 0xec, 0x50, 0x6e, 0x17, - 0xe0, 0x8c, 0x7e, 0x33, 0x84, 0x98, 0x2b, 0xc1, - 0x68, 0x97, 0x24, 0x83, 0x03, 0x7c, 0x0d, 0xc5, - 0x19, 0xa1, 0xe8, 0xb1, 0xb7, 0x53, 0x4f, 0x3b, - 0x8a, 0xa3, 0xce, 0x9b, 0x3d, 0xd0, 0x1a, 0xf7, - 0x7d, 0xae, 0x4c, 0x6b, 0xe4, 0xe3, 0x12, 0x70, - 0x63, 0xc9, 0x4c, 0xcf, 0x1f, 0xf7, 0x18, 0xdf, - 0xf1, 0x7d, 0x96, 0xe4, 0x60, 0xa8, 0x3b, 0xf5, - 0x71, 0x7d, 0x2a, 0x87, 0x1d, 0x82, 0xed, 0x92, - 0xc5, 0xe7, 0x6e, 0xd9, 0x3c, 0x01, 0x0d, 0x87, - 0x13, 0x3b, 0x1a, 0x92, 0xa2, 0x83, 0x1a, 0x5b, - 0x9a, 0xfb, 0x81, 0x1d, 0xdb, 0xbd, 0x82, 0x01, - 0x3b, 0x32, 0x0e, 0x2c, 0x67, 0x3c, 0x14, 0x13, - 0x9d, 0x58, 0xf1, 0x88, 0x9d, 0xe5, 0xd6, 0xe3, - 0x48, 0xaa, 0x43, 0xc2, 0x08, 0xa6, 0x64, 0xa8, - 0xad, 0x71, 0x26, 0x7e, 0xe7, 0xed, 0x0c, 0x58, - 0xd3, 0x27, 0x42, 0x5e, 0x10, 0xb0, 0x03, 0x62, - 0x18, 0x30, 0xde, 0xdb, 0x45, 0xcd, 0x78, 0xdd, - 0xee, 0x4f, 0xa1, 0x45, 0xa6, 0xbf, 0xc1, 0x37, - 0x3e, 0x47, 0x5c, 0x1b, 0xb6, 0x8b, 0x63, 0x87, - 0x49, 0xc4, 0x1b, 0x9e, 0xea, 0x01, 0x62, 0x2a, - 0x44, 0x65, 0x17, 0x0f, 0xee, 0xcc, 0x7f, 0xe6, - 0xab, 0x05, 0x46, 0x25, 0x7d, 0xdc, 0x40, 0x1e - } - }, - /* TestSet 3 */ - { - /* Key */ - {0x92, 0xf9, 0x27, 0xe8, 0xab, 0x48, 0x46, 0xdb, - 0x2f, 0xa3, 0x61, 0x36, 0x7e, 0x89, 0xe1, 0x17, - 0xc9, 0x99, 0x57, 0x63, 0xe0, 0xe4, 0x4c, 0xce, - 0x20, 0x03, 0x8a, 0x9c, 0x9a, 0x44, 0xca, 0x64 - }, - /* IV */ - {0x7d, 0x51, 0xfb, 0x42, 0xf8, 0x7e, 0x62, 0xfa, - 0x60, 0x25, 0xb9, 0x2b, 0x4e, 0xd6, 0x1c, 0x2e, - 0xcc, 0x6c, 0x65, 0x18, 0x1e, 0x9d, 0x04 - }, - /* Message length */ - 768, - /* IV length */ - 23, - /* Plaintext */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - /* Ciphertext */ - {0xe4, 0x14, 0xf9, 0x26, 0x45, 0xc6, 0x2e, 0x12, - 0xb0, 0xe1, 0x33, 0xf6, 0xa7, 0x96, 0x22, 0xfb, - 0x0f, 0xe0, 0x07, 0x5c, 0x6e, 0xbe, 0x10, 0x1b, - 0x37, 0xe4, 0xf7, 0x1c, 0x94, 0xcf, 0xf1, 0x73, - 0x02, 0x64, 0x61, 0x40, 0xb4, 0xf1, 0xfb, 0xcf, - 0x8c, 0xc6, 0xa2, 0xda, 0xd7, 0x3f, 0xb4, 0xcc, - 0xa8, 0x7b, 0x13, 0xaa, 0xd2, 0x6e, 0x2a, 0x1b, - 0x0a, 0x07, 0xef, 0x88, 0x41, 0xfb, 0x6c, 0x10, - 0x3f, 0x41, 0x60, 0xb3, 0x4c, 0x7d, 0x00, 0x9c, - 0x72, 0x2f, 0x4a, 0xa2, 0xc1, 0x0c, 0xf4, 0x6f, - 0xbf, 0xed, 0xec, 0xaf, 0xeb, 0xbc, 0xc8, 0x2a, - 0x54, 0x60, 0x48, 0x7d, 0xfe, 0x20, 0x38, 0x6a - } - }, - /* TestSet 4 */ - { - /* Key */ - {0xa7, 0x72, 0xf5, 0xfe, 0x9d, 0x81, 0xd1, 0xcf, - 0x22, 0x8e, 0x45, 0x53, 0x67, 0x75, 0xac, 0xc9, - 0x04, 0x19, 0x57, 0x55, 0x0f, 0x6c, 0x39, 0xf9, - 0xc5, 0x1b, 0x1e, 0x9e, 0xbb, 0x22, 0xa2, 0xf5 - }, - /* IV */ - {0xce, 0x51, 0x11, 0x83, 0x9b, 0x64, 0x4d, 0x20, - 0x51, 0x92, 0x71, 0x3b, 0x43, 0x47, 0xf9, 0x38, - 0x79, 0x0f, 0xd2, 0x59, 0xbc, 0x35, 0xd3 - }, - /* Message length */ - 384, - /* IV length */ - 23, - /* Plaintext */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - /* Ciphertext */ - {0x89, 0x63, 0x69, 0xca, 0x77, 0xd3, 0x05, 0xf7, - 0xa3, 0xcb, 0xf6, 0xba, 0xb3, 0x8c, 0x14, 0x4f, - 0xc3, 0x73, 0xf4, 0xf0, 0xf5, 0x0c, 0xf1, 0xad, - 0x0f, 0x41, 0x65, 0x48, 0x40, 0x47, 0x5e, 0xef, - 0xad, 0xea, 0x1c, 0x3c, 0x15, 0xa0, 0xd2, 0x72, - 0x25, 0x14, 0x1d, 0x6f, 0xa0, 0x0f, 0xe8, 0x9a - } - }, - /* TestSet 5 */ - { - /* Key */ - {0xf8, 0xa0, 0x45, 0x4f, 0x6d, 0xea, 0x74, 0x6e, - 0x4c, 0xd1, 0x6e, 0xb0, 0xc3, 0xa2, 0x1f, 0x57, - 0xeb, 0x6f, 0x35, 0x2d, 0x6a, 0x02, 0x5b, 0x35, - 0x32, 0xba, 0x47, 0x3f, 0x1f, 0x0e, 0xdd, 0xc9 - }, - /* IV */ - {0x07, 0x90, 0xeb, 0x7d, 0x09, 0x6d, 0xc1, 0xf1, - 0x86, 0x47, 0xea, 0x57, 0xe4, 0xb8, 0x92, 0xb1, - 0x4e, 0x3b, 0x2d, 0x62, 0xaa, 0x53, 0x6f - }, - /* Message length */ - 384, - /* IV length */ - 23, - /* Plaintext */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - /* Ciphertext */ - {0xc6, 0x02, 0x3c, 0x58, 0x53, 0xc9, 0xae, 0xba, - 0x0a, 0x47, 0x10, 0xdc, 0x85, 0x76, 0x13, 0x82, - 0x08, 0x66, 0xbc, 0x3e, 0x9c, 0x2d, 0xb2, 0x42, - 0x20, 0x3a, 0x0a, 0x0c, 0x49, 0x1d, 0xe9, 0x44, - 0x73, 0x87, 0xe5, 0x60, 0x9d, 0x98, 0xff, 0xf1, - 0x33, 0xc3, 0xd0, 0x3d, 0x49, 0xfc, 0x77, 0x07 - } - }, + /* TestSet 1 */ + { /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Message length */ + 640, + /* IV length */ + 25, + /* Plaintext */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Ciphertext */ + { 0x58, 0xD0, 0x3A, 0xD6, 0x2E, 0x03, 0x2C, 0xE2, 0xDA, 0xFC, 0x68, 0x3A, 0x39, 0xBD, + 0xCB, 0x03, 0x52, 0xA2, 0xBC, 0x67, 0xF1, 0xB7, 0xDE, 0x74, 0x16, 0x3C, 0xE3, 0xA1, + 0x01, 0xEF, 0x55, 0x58, 0x96, 0x39, 0xD7, 0x5B, 0x95, 0xFA, 0x68, 0x1B, 0x7F, 0x09, + 0x0D, 0xF7, 0x56, 0x39, 0x1C, 0xCC, 0x90, 0x3B, 0x76, 0x12, 0x74, 0x4D, 0x54, 0x4C, + 0x17, 0xBC, 0x3F, 0xAD, 0x8B, 0x16, 0x3B, 0x08, 0x21, 0x78, 0x7C, 0x0B, 0x97, 0x77, + 0x5B, 0xB8, 0x49, 0x43, 0xC6, 0xBB, 0xE8, 0xAD, 0x8A, 0xFD } }, + /* TestSet 2 */ + { /* Key */ + { 0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, 0x23, 0x19, 0x48, + 0x42, 0xcb, 0x5c, 0x6d, 0x98, 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, + 0xeb, 0xe0, 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e }, + /* IV */ + { 0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, 0x02, 0x2d, 0x24, 0xcd, + 0x23, 0x3f, 0x4d, 0x0a, 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 }, + /* Message length */ + 1536, + /* IV length */ + 23, + /* Plaintext */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Ciphertext */ + { 0xc1, 0xce, 0x46, 0xd2, 0x4e, 0x78, 0x6f, 0x97, 0xcf, 0xc0, 0xa5, 0x3c, 0xec, 0x50, + 0x6e, 0x17, 0xe0, 0x8c, 0x7e, 0x33, 0x84, 0x98, 0x2b, 0xc1, 0x68, 0x97, 0x24, 0x83, + 0x03, 0x7c, 0x0d, 0xc5, 0x19, 0xa1, 0xe8, 0xb1, 0xb7, 0x53, 0x4f, 0x3b, 0x8a, 0xa3, + 0xce, 0x9b, 0x3d, 0xd0, 0x1a, 0xf7, 0x7d, 0xae, 0x4c, 0x6b, 0xe4, 0xe3, 0x12, 0x70, + 0x63, 0xc9, 0x4c, 0xcf, 0x1f, 0xf7, 0x18, 0xdf, 0xf1, 0x7d, 0x96, 0xe4, 0x60, 0xa8, + 0x3b, 0xf5, 0x71, 0x7d, 0x2a, 0x87, 0x1d, 0x82, 0xed, 0x92, 0xc5, 0xe7, 0x6e, 0xd9, + 0x3c, 0x01, 0x0d, 0x87, 0x13, 0x3b, 0x1a, 0x92, 0xa2, 0x83, 0x1a, 0x5b, 0x9a, 0xfb, + 0x81, 0x1d, 0xdb, 0xbd, 0x82, 0x01, 0x3b, 0x32, 0x0e, 0x2c, 0x67, 0x3c, 0x14, 0x13, + 0x9d, 0x58, 0xf1, 0x88, 0x9d, 0xe5, 0xd6, 0xe3, 0x48, 0xaa, 0x43, 0xc2, 0x08, 0xa6, + 0x64, 0xa8, 0xad, 0x71, 0x26, 0x7e, 0xe7, 0xed, 0x0c, 0x58, 0xd3, 0x27, 0x42, 0x5e, + 0x10, 0xb0, 0x03, 0x62, 0x18, 0x30, 0xde, 0xdb, 0x45, 0xcd, 0x78, 0xdd, 0xee, 0x4f, + 0xa1, 0x45, 0xa6, 0xbf, 0xc1, 0x37, 0x3e, 0x47, 0x5c, 0x1b, 0xb6, 0x8b, 0x63, 0x87, + 0x49, 0xc4, 0x1b, 0x9e, 0xea, 0x01, 0x62, 0x2a, 0x44, 0x65, 0x17, 0x0f, 0xee, 0xcc, + 0x7f, 0xe6, 0xab, 0x05, 0x46, 0x25, 0x7d, 0xdc, 0x40, 0x1e } }, + /* TestSet 3 */ + { /* Key */ + { 0x92, 0xf9, 0x27, 0xe8, 0xab, 0x48, 0x46, 0xdb, 0x2f, 0xa3, 0x61, + 0x36, 0x7e, 0x89, 0xe1, 0x17, 0xc9, 0x99, 0x57, 0x63, 0xe0, 0xe4, + 0x4c, 0xce, 0x20, 0x03, 0x8a, 0x9c, 0x9a, 0x44, 0xca, 0x64 }, + /* IV */ + { 0x7d, 0x51, 0xfb, 0x42, 0xf8, 0x7e, 0x62, 0xfa, 0x60, 0x25, 0xb9, 0x2b, + 0x4e, 0xd6, 0x1c, 0x2e, 0xcc, 0x6c, 0x65, 0x18, 0x1e, 0x9d, 0x04 }, + /* Message length */ + 768, + /* IV length */ + 23, + /* Plaintext */ + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + /* Ciphertext */ + { 0xe4, 0x14, 0xf9, 0x26, 0x45, 0xc6, 0x2e, 0x12, 0xb0, 0xe1, 0x33, 0xf6, 0xa7, 0x96, + 0x22, 0xfb, 0x0f, 0xe0, 0x07, 0x5c, 0x6e, 0xbe, 0x10, 0x1b, 0x37, 0xe4, 0xf7, 0x1c, + 0x94, 0xcf, 0xf1, 0x73, 0x02, 0x64, 0x61, 0x40, 0xb4, 0xf1, 0xfb, 0xcf, 0x8c, 0xc6, + 0xa2, 0xda, 0xd7, 0x3f, 0xb4, 0xcc, 0xa8, 0x7b, 0x13, 0xaa, 0xd2, 0x6e, 0x2a, 0x1b, + 0x0a, 0x07, 0xef, 0x88, 0x41, 0xfb, 0x6c, 0x10, 0x3f, 0x41, 0x60, 0xb3, 0x4c, 0x7d, + 0x00, 0x9c, 0x72, 0x2f, 0x4a, 0xa2, 0xc1, 0x0c, 0xf4, 0x6f, 0xbf, 0xed, 0xec, 0xaf, + 0xeb, 0xbc, 0xc8, 0x2a, 0x54, 0x60, 0x48, 0x7d, 0xfe, 0x20, 0x38, 0x6a } }, + /* TestSet 4 */ + { /* Key */ + { 0xa7, 0x72, 0xf5, 0xfe, 0x9d, 0x81, 0xd1, 0xcf, 0x22, 0x8e, 0x45, + 0x53, 0x67, 0x75, 0xac, 0xc9, 0x04, 0x19, 0x57, 0x55, 0x0f, 0x6c, + 0x39, 0xf9, 0xc5, 0x1b, 0x1e, 0x9e, 0xbb, 0x22, 0xa2, 0xf5 }, + /* IV */ + { 0xce, 0x51, 0x11, 0x83, 0x9b, 0x64, 0x4d, 0x20, 0x51, 0x92, 0x71, 0x3b, + 0x43, 0x47, 0xf9, 0x38, 0x79, 0x0f, 0xd2, 0x59, 0xbc, 0x35, 0xd3 }, + /* Message length */ + 384, + /* IV length */ + 23, + /* Plaintext */ + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + /* Ciphertext */ + { 0x89, 0x63, 0x69, 0xca, 0x77, 0xd3, 0x05, 0xf7, 0xa3, 0xcb, 0xf6, 0xba, + 0xb3, 0x8c, 0x14, 0x4f, 0xc3, 0x73, 0xf4, 0xf0, 0xf5, 0x0c, 0xf1, 0xad, + 0x0f, 0x41, 0x65, 0x48, 0x40, 0x47, 0x5e, 0xef, 0xad, 0xea, 0x1c, 0x3c, + 0x15, 0xa0, 0xd2, 0x72, 0x25, 0x14, 0x1d, 0x6f, 0xa0, 0x0f, 0xe8, 0x9a } }, + /* TestSet 5 */ + { /* Key */ + { 0xf8, 0xa0, 0x45, 0x4f, 0x6d, 0xea, 0x74, 0x6e, 0x4c, 0xd1, 0x6e, + 0xb0, 0xc3, 0xa2, 0x1f, 0x57, 0xeb, 0x6f, 0x35, 0x2d, 0x6a, 0x02, + 0x5b, 0x35, 0x32, 0xba, 0x47, 0x3f, 0x1f, 0x0e, 0xdd, 0xc9 }, + /* IV */ + { 0x07, 0x90, 0xeb, 0x7d, 0x09, 0x6d, 0xc1, 0xf1, 0x86, 0x47, 0xea, 0x57, + 0xe4, 0xb8, 0x92, 0xb1, 0x4e, 0x3b, 0x2d, 0x62, 0xaa, 0x53, 0x6f }, + /* Message length */ + 384, + /* IV length */ + 23, + /* Plaintext */ + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + /* Ciphertext */ + { 0xc6, 0x02, 0x3c, 0x58, 0x53, 0xc9, 0xae, 0xba, 0x0a, 0x47, 0x10, 0xdc, + 0x85, 0x76, 0x13, 0x82, 0x08, 0x66, 0xbc, 0x3e, 0x9c, 0x2d, 0xb2, 0x42, + 0x20, 0x3a, 0x0a, 0x0c, 0x49, 0x1d, 0xe9, 0x44, 0x73, 0x87, 0xe5, 0x60, + 0x9d, 0x98, 0xff, 0xf1, 0x33, 0xc3, 0xd0, 0x3d, 0x49, 0xfc, 0x77, 0x07 } }, /* TestSet 6 */ - { - /* Key */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }, - /* IV */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, - 0x3F - }, - /* Message length */ - 640, - /* IV length */ - 25, - /* Plaintext*/ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* Ciphertext */ - {0x33, 0x56, 0xcb, 0xae, 0xd1, 0xa1, 0xc1, 0x8b, - 0x6b, 0xaa, 0x4f, 0xfe, 0x34, 0x3f, 0x77, 0x7c, - 0x9e, 0x15, 0x12, 0x8f, 0x25, 0x1a, 0xb6, 0x5b, - 0x94, 0x9f, 0x7b, 0x26, 0xef, 0x71, 0x57, 0xf2, - 0x96, 0xdd, 0x2f, 0xa9, 0xdf, 0x95, 0xe3, 0xee, - 0x7a, 0x5b, 0xe0, 0x2e, 0xc3, 0x2b, 0xa5, 0x85, - 0x50, 0x5a, 0xf3, 0x16, 0xc2, 0xf9, 0xde, 0xd2, - 0x7c, 0xdb, 0xd9, 0x35, 0xe4, 0x41, 0xce, 0x11, - 0x15, 0xfd, 0x0a, 0x80, 0xbb, 0x7a, 0xef, 0x67, - 0x68, 0x98, 0x94, 0x16, 0xb8, 0xfa, 0xc8, 0xc2 - } - }, + { /* Key */ + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, + /* IV */ + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F }, + /* Message length */ + 640, + /* IV length */ + 25, + /* Plaintext*/ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Ciphertext */ + { 0x33, 0x56, 0xcb, 0xae, 0xd1, 0xa1, 0xc1, 0x8b, 0x6b, 0xaa, 0x4f, 0xfe, 0x34, 0x3f, + 0x77, 0x7c, 0x9e, 0x15, 0x12, 0x8f, 0x25, 0x1a, 0xb6, 0x5b, 0x94, 0x9f, 0x7b, 0x26, + 0xef, 0x71, 0x57, 0xf2, 0x96, 0xdd, 0x2f, 0xa9, 0xdf, 0x95, 0xe3, 0xee, 0x7a, 0x5b, + 0xe0, 0x2e, 0xc3, 0x2b, 0xa5, 0x85, 0x50, 0x5a, 0xf3, 0x16, 0xc2, 0xf9, 0xde, 0xd2, + 0x7c, 0xdb, 0xd9, 0x35, 0xe4, 0x41, 0xce, 0x11, 0x15, 0xfd, 0x0a, 0x80, 0xbb, 0x7a, + 0xef, 0x67, 0x68, 0x98, 0x94, 0x16, 0xb8, 0xfa, 0xc8, 0xc2 } }, /* TestSet 7 */ - { - /* Key */ - {0x67, 0xc6, 0x69, 0x73, 0x51, 0xff, 0x4a, 0xec, - 0x29, 0xcd, 0xba, 0xab, 0xf2, 0xfb, 0xe3, 0x46, - 0x7c, 0xc2, 0x54, 0xf8, 0x1b, 0xe8, 0xe7, 0x8d, - 0x76, 0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a - }, - /* IV */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, - 0x3F - }, - /* Message length */ - 640, - /* IV length */ - 25, - /* Plaintext*/ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* Ciphertext */ - {0xB7, 0xA0, 0x40, 0x5E, 0xD0, 0xE5, 0xE4, 0x47, - 0xBA, 0x13, 0xF2, 0xB5, 0xA9, 0xED, 0x8A, 0x25, - 0xE4, 0x3E, 0x8E, 0x62, 0xD7, 0xB3, 0xE6, 0x46, - 0xC5, 0x71, 0xA1, 0xC6, 0xCD, 0x76, 0xEA, 0x59, - 0x3A, 0x49, 0x3D, 0xE2, 0xF9, 0x52, 0x91, 0x00, - 0xAF, 0x20, 0x69, 0x60, 0xCC, 0xE8, 0x4B, 0x38, - 0x0B, 0xB8, 0x42, 0xCD, 0x1B, 0x12, 0xAC, 0xD9, - 0x89, 0x50, 0x87, 0x46, 0x85, 0xD1, 0x57, 0x66, - 0xFA, 0x65, 0x85, 0x98, 0xFF, 0xB7, 0x89, 0x3F, - 0x34, 0xFF, 0x9F, 0xF1, 0x3D, 0x80, 0xE8, 0x54 - } - }, + { /* Key */ + { 0x67, 0xc6, 0x69, 0x73, 0x51, 0xff, 0x4a, 0xec, 0x29, 0xcd, 0xba, + 0xab, 0xf2, 0xfb, 0xe3, 0x46, 0x7c, 0xc2, 0x54, 0xf8, 0x1b, 0xe8, + 0xe7, 0x8d, 0x76, 0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a }, + /* IV */ + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F }, + /* Message length */ + 640, + /* IV length */ + 25, + /* Plaintext*/ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Ciphertext */ + { 0xB7, 0xA0, 0x40, 0x5E, 0xD0, 0xE5, 0xE4, 0x47, 0xBA, 0x13, 0xF2, 0xB5, 0xA9, 0xED, + 0x8A, 0x25, 0xE4, 0x3E, 0x8E, 0x62, 0xD7, 0xB3, 0xE6, 0x46, 0xC5, 0x71, 0xA1, 0xC6, + 0xCD, 0x76, 0xEA, 0x59, 0x3A, 0x49, 0x3D, 0xE2, 0xF9, 0x52, 0x91, 0x00, 0xAF, 0x20, + 0x69, 0x60, 0xCC, 0xE8, 0x4B, 0x38, 0x0B, 0xB8, 0x42, 0xCD, 0x1B, 0x12, 0xAC, 0xD9, + 0x89, 0x50, 0x87, 0x46, 0x85, 0xD1, 0x57, 0x66, 0xFA, 0x65, 0x85, 0x98, 0xFF, 0xB7, + 0x89, 0x3F, 0x34, 0xFF, 0x9F, 0xF1, 0x3D, 0x80, 0xE8, 0x54 } }, /* TestSet 8 */ - { - /* Key */ - {0xC2, 0x54, 0xF8, 0x1B, 0xE8, 0xE7, 0x8D, 0x76, - 0x5A, 0x2E, 0x63, 0x33, 0x9F, 0xC9, 0x9A, 0x66, - 0x32, 0x0D, 0xB7, 0x31, 0x58, 0xA3, 0x5A, 0x25, - 0x5D, 0x05, 0x17, 0x58, 0xE9, 0x5E, 0xD4, 0xAB - }, - /* IV */ - {0x67, 0xC6, 0x69, 0x73, 0x51, 0xFF, 0x4A, 0xEC, - 0x29, 0xCD, 0xBA, 0xAB, 0xF2, 0xFB, 0xE3, 0x46, - 0x7C, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, - 0x3F - }, - /* Message length */ - 640, - /* IV length */ - 25, - /* Plaintext*/ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* Ciphertext */ - {0x8D, 0x59, 0x00, 0x3C, 0xB9, 0x8F, 0xE2, 0x79, - 0xC7, 0xE8, 0x85, 0x35, 0xEF, 0xE5, 0xB5, 0x51, - 0xDE, 0xA5, 0xEC, 0xB1, 0xCA, 0xDC, 0x55, 0x5A, - 0x3C, 0xD3, 0xA9, 0xB4, 0x32, 0x22, 0x34, 0xD9, - 0x42, 0xE2, 0x99, 0x4A, 0x9B, 0x87, 0xFD, 0x46, - 0x73, 0x54, 0xDC, 0x68, 0xEA, 0xE8, 0xD4, 0xBA, - 0xDC, 0x1C, 0xB7, 0x44, 0x13, 0xA0, 0xA0, 0xA2, - 0x18, 0x86, 0x3F, 0x35, 0x92, 0xD1, 0x1C, 0x8C, - 0xAE, 0xFF, 0xA3, 0x1B, 0x4E, 0xE8, 0x6F, 0xC6, - 0x49, 0x37, 0xF9, 0x8A, 0xC6, 0x90, 0x7C, 0x36 - } - }, + { /* Key */ + { 0xC2, 0x54, 0xF8, 0x1B, 0xE8, 0xE7, 0x8D, 0x76, 0x5A, 0x2E, 0x63, + 0x33, 0x9F, 0xC9, 0x9A, 0x66, 0x32, 0x0D, 0xB7, 0x31, 0x58, 0xA3, + 0x5A, 0x25, 0x5D, 0x05, 0x17, 0x58, 0xE9, 0x5E, 0xD4, 0xAB }, + /* IV */ + { 0x67, 0xC6, 0x69, 0x73, 0x51, 0xFF, 0x4A, 0xEC, 0x29, 0xCD, 0xBA, 0xAB, 0xF2, + 0xFB, 0xE3, 0x46, 0x7C, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F }, + /* Message length */ + 640, + /* IV length */ + 25, + /* Plaintext*/ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Ciphertext */ + { 0x8D, 0x59, 0x00, 0x3C, 0xB9, 0x8F, 0xE2, 0x79, 0xC7, 0xE8, 0x85, 0x35, 0xEF, 0xE5, + 0xB5, 0x51, 0xDE, 0xA5, 0xEC, 0xB1, 0xCA, 0xDC, 0x55, 0x5A, 0x3C, 0xD3, 0xA9, 0xB4, + 0x32, 0x22, 0x34, 0xD9, 0x42, 0xE2, 0x99, 0x4A, 0x9B, 0x87, 0xFD, 0x46, 0x73, 0x54, + 0xDC, 0x68, 0xEA, 0xE8, 0xD4, 0xBA, 0xDC, 0x1C, 0xB7, 0x44, 0x13, 0xA0, 0xA0, 0xA2, + 0x18, 0x86, 0x3F, 0x35, 0x92, 0xD1, 0x1C, 0x8C, 0xAE, 0xFF, 0xA3, 0x1B, 0x4E, 0xE8, + 0x6F, 0xC6, 0x49, 0x37, 0xF9, 0x8A, 0xC6, 0x90, 0x7C, 0x36 } }, /* TestSet 9 */ - { - /* Key */ - {0x8D, 0x76, 0x5A, 0x2E, 0x63, 0x33, 0x9F, 0xC9, - 0x9A, 0x66, 0x32, 0x0D, 0xB7, 0x31, 0x58, 0xA3, - 0x5A, 0x25, 0x5D, 0x05, 0x17, 0x58, 0xE9, 0x5E, - 0xD4, 0xAB, 0xB2, 0xCD, 0xC6, 0x9B, 0xB4, 0x54 - }, - /* IV */ - {0x67, 0xC6, 0x69, 0x73, 0x51, 0xFF, 0x4A, 0xEC, - 0x29, 0xCD, 0xBA, 0xAB, 0xF2, 0xFB, 0xE3, 0x46, - 0x7C, 0x30, 0x25, 0x13, 0x38, 0x06, 0x3E, 0x23, - 0x27 - }, - /* Message length */ - 640, - /* IV length */ - 25, - /* Plaintext*/ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* Ciphertext */ - {0xD8, 0x2E, 0x40, 0x78, 0x2C, 0x03, 0xA7, 0x1A, - 0x90, 0xA5, 0x05, 0xC5, 0x8E, 0x61, 0x26, 0x8B, - 0xE2, 0x5F, 0x61, 0xF6, 0x1F, 0xD4, 0x6D, 0x04, - 0x0D, 0x9E, 0x48, 0x78, 0x38, 0xF3, 0x2F, 0x97, - 0x46, 0x00, 0x4E, 0xAC, 0xCC, 0x93, 0x09, 0x43, - 0x92, 0x1A, 0x17, 0x42, 0x38, 0xF8, 0x8C, 0x9B, - 0x7E, 0x90, 0xC2, 0x9F, 0x4A, 0x16, 0x0C, 0x2A, - 0x43, 0x3B, 0xBB, 0xD9, 0x50, 0xEE, 0x85, 0xD9, - 0x7D, 0x1E, 0x3A, 0xB5, 0x57, 0xFB, 0x56, 0xD8, - 0xB4, 0x34, 0x5C, 0x5C, 0x0B, 0x48, 0x67, 0x37 - } - }, + { /* Key */ + { 0x8D, 0x76, 0x5A, 0x2E, 0x63, 0x33, 0x9F, 0xC9, 0x9A, 0x66, 0x32, + 0x0D, 0xB7, 0x31, 0x58, 0xA3, 0x5A, 0x25, 0x5D, 0x05, 0x17, 0x58, + 0xE9, 0x5E, 0xD4, 0xAB, 0xB2, 0xCD, 0xC6, 0x9B, 0xB4, 0x54 }, + /* IV */ + { 0x67, 0xC6, 0x69, 0x73, 0x51, 0xFF, 0x4A, 0xEC, 0x29, 0xCD, 0xBA, 0xAB, 0xF2, + 0xFB, 0xE3, 0x46, 0x7C, 0x30, 0x25, 0x13, 0x38, 0x06, 0x3E, 0x23, 0x27 }, + /* Message length */ + 640, + /* IV length */ + 25, + /* Plaintext*/ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Ciphertext */ + { 0xD8, 0x2E, 0x40, 0x78, 0x2C, 0x03, 0xA7, 0x1A, 0x90, 0xA5, 0x05, 0xC5, 0x8E, 0x61, + 0x26, 0x8B, 0xE2, 0x5F, 0x61, 0xF6, 0x1F, 0xD4, 0x6D, 0x04, 0x0D, 0x9E, 0x48, 0x78, + 0x38, 0xF3, 0x2F, 0x97, 0x46, 0x00, 0x4E, 0xAC, 0xCC, 0x93, 0x09, 0x43, 0x92, 0x1A, + 0x17, 0x42, 0x38, 0xF8, 0x8C, 0x9B, 0x7E, 0x90, 0xC2, 0x9F, 0x4A, 0x16, 0x0C, 0x2A, + 0x43, 0x3B, 0xBB, 0xD9, 0x50, 0xEE, 0x85, 0xD9, 0x7D, 0x1E, 0x3A, 0xB5, 0x57, 0xFB, + 0x56, 0xD8, 0xB4, 0x34, 0x5C, 0x5C, 0x0B, 0x48, 0x67, 0x37 } }, /* TestSet 10 */ - { - /* Key */ - {0x67, 0xc6, 0x69, 0x73, 0x51, 0xff, 0x4a, 0xec, - 0x29, 0xcd, 0xba, 0xab, 0xf2, 0xfb, 0xe3, 0x46, - 0x7c, 0xc2, 0x54, 0xf8, 0x1b, 0xe8, 0xe7, 0x8d, - 0x76, 0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a - }, - /* IV */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }, - /* Message length */ - 640, - /* IV length */ - 23, - /* Plaintext*/ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* Ciphertext */ - {0xB7, 0xA0, 0x40, 0x5E, 0xD0, 0xE5, 0xE4, 0x47, - 0xBA, 0x13, 0xF2, 0xB5, 0xA9, 0xED, 0x8A, 0x25, - 0xE4, 0x3E, 0x8E, 0x62, 0xD7, 0xB3, 0xE6, 0x46, - 0xC5, 0x71, 0xA1, 0xC6, 0xCD, 0x76, 0xEA, 0x59, - 0x3A, 0x49, 0x3D, 0xE2, 0xF9, 0x52, 0x91, 0x00, - 0xAF, 0x20, 0x69, 0x60, 0xCC, 0xE8, 0x4B, 0x38, - 0x0B, 0xB8, 0x42, 0xCD, 0x1B, 0x12, 0xAC, 0xD9, - 0x89, 0x50, 0x87, 0x46, 0x85, 0xD1, 0x57, 0x66, - 0xFA, 0x65, 0x85, 0x98, 0xFF, 0xB7, 0x89, 0x3F, - 0x34, 0xFF, 0x9F, 0xF1, 0x3D, 0x80, 0xE8, 0x54 - } - }, + { /* Key */ + { 0x67, 0xc6, 0x69, 0x73, 0x51, 0xff, 0x4a, 0xec, 0x29, 0xcd, 0xba, + 0xab, 0xf2, 0xfb, 0xe3, 0x46, 0x7c, 0xc2, 0x54, 0xf8, 0x1b, 0xe8, + 0xe7, 0x8d, 0x76, 0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a }, + /* IV */ + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, + /* Message length */ + 640, + /* IV length */ + 23, + /* Plaintext*/ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* Ciphertext */ + { 0xB7, 0xA0, 0x40, 0x5E, 0xD0, 0xE5, 0xE4, 0x47, 0xBA, 0x13, 0xF2, 0xB5, 0xA9, 0xED, + 0x8A, 0x25, 0xE4, 0x3E, 0x8E, 0x62, 0xD7, 0xB3, 0xE6, 0x46, 0xC5, 0x71, 0xA1, 0xC6, + 0xCD, 0x76, 0xEA, 0x59, 0x3A, 0x49, 0x3D, 0xE2, 0xF9, 0x52, 0x91, 0x00, 0xAF, 0x20, + 0x69, 0x60, 0xCC, 0xE8, 0x4B, 0x38, 0x0B, 0xB8, 0x42, 0xCD, 0x1B, 0x12, 0xAC, 0xD9, + 0x89, 0x50, 0x87, 0x46, 0x85, 0xD1, 0x57, 0x66, 0xFA, 0x65, 0x85, 0x98, 0xFF, 0xB7, + 0x89, 0x3F, 0x34, 0xFF, 0x9F, 0xF1, 0x3D, 0x80, 0xE8, 0x54 } }, }; const struct test128EIA3_vectors_t testEIA3_vectors[] = { - { - /*Test 1*/ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - 0x00000000, - 0x0, - 0x0, - 1, - {0x00, 0x00, 0x00, 0x00}, - {0xC8, 0xA9, 0x59, 0x5E} - }, - { - /*Test 2*/ - {0x47, 0x05, 0x41, 0x25, 0x56, 0x1e, 0xb2, 0xdd, - 0xa9, 0x40, 0x59, 0xda, 0x05, 0x09, 0x78, 0x50}, - 0x561EB2DD, - 0x14, - 0, - 90, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00}, - {0x67, 0x19, 0xA0, 0x88} - }, - /*Test 3*/ - { - {0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, - 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, 0xAB, 0x0A}, - 0xA94059DA, - 0xA, - 0x1, - 577, - {0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, - 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, 0x03, 0x91, 0xB1, - 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, - 0xE7, 0xB7, 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, - 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, 0xF9, - 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, - 0x7F, 0x9F, 0x68, 0xAD, 0xB1, 0x6E, 0x5D, 0x7D, - 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C, - 0xEB, 0xDE, 0x3F, 0x40, 0x93, 0xC5, 0x38, 0x81, - 0x00, 0x00, 0x00, 0x00}, - {0xFA, 0xE8, 0xFF, 0x0B} - }, - /*Test 4*/ - { - {0xc8, 0xa4, 0x82, 0x62, 0xd0, 0xc2, 0xe2, 0xba, - 0xc4, 0xb9, 0x6e, 0xf7, 0x7e, 0x80, 0xca, 0x59}, - 0x5097850, - 0x10, - 0x1, - 2079, - {0xb5, 0x46, 0x43, 0x0b, 0xf8, 0x7b, 0x4f, 0x1e, - 0xe8, 0x34, 0x70, 0x4c, 0xd6, 0x95, 0x1c, 0x36, - 0xe2, 0x6f, 0x10, 0x8c, 0xf7, 0x31, 0x78, 0x8f, - 0x48, 0xdc, 0x34, 0xf1, 0x67, 0x8c, 0x05, 0x22, - 0x1c, 0x8f, 0xa7, 0xff, 0x2f, 0x39, 0xf4, 0x77, - 0xe7, 0xe4, 0x9e, 0xf6, 0x0a, 0x4e, 0xc2, 0xc3, - 0xde, 0x24, 0x31, 0x2a, 0x96, 0xaa, 0x26, 0xe1, - 0xcf, 0xba, 0x57, 0x56, 0x38, 0x38, 0xb2, 0x97, - 0xf4, 0x7e, 0x85, 0x10, 0xc7, 0x79, 0xfd, 0x66, - 0x54, 0xb1, 0x43, 0x38, 0x6f, 0xa6, 0x39, 0xd3, - 0x1e, 0xdb, 0xd6, 0xc0, 0x6e, 0x47, 0xd1, 0x59, - 0xd9, 0x43, 0x62, 0xf2, 0x6a, 0xee, 0xed, 0xee, - 0x0e, 0x4f, 0x49, 0xd9, 0xbf, 0x84, 0x12, 0x99, - 0x54, 0x15, 0xbf, 0xad, 0x56, 0xee, 0x82, 0xd1, - 0xca, 0x74, 0x63, 0xab, 0xf0, 0x85, 0xb0, 0x82, - 0xb0, 0x99, 0x04, 0xd6, 0xd9, 0x90, 0xd4, 0x3c, - 0xf2, 0xe0, 0x62, 0xf4, 0x08, 0x39, 0xd9, 0x32, - 0x48, 0xb1, 0xeb, 0x92, 0xcd, 0xfe, 0xd5, 0x30, - 0x0b, 0xc1, 0x48, 0x28, 0x04, 0x30, 0xb6, 0xd0, - 0xca, 0xa0, 0x94, 0xb6, 0xec, 0x89, 0x11, 0xab, - 0x7d, 0xc3, 0x68, 0x24, 0xb8, 0x24, 0xdc, 0x0a, - 0xf6, 0x68, 0x2b, 0x09, 0x35, 0xfd, 0xe7, 0xb4, - 0x92, 0xa1, 0x4d, 0xc2, 0xf4, 0x36, 0x48, 0x03, - 0x8d, 0xa2, 0xcf, 0x79, 0x17, 0x0d, 0x2d, 0x50, - 0x13, 0x3f, 0xd4, 0x94, 0x16, 0xcb, 0x6e, 0x33, - 0xbe, 0xa9, 0x0b, 0x8b, 0xf4, 0x55, 0x9b, 0x03, - 0x73, 0x2a, 0x01, 0xea, 0x29, 0x0e, 0x6d, 0x07, - 0x4f, 0x79, 0xbb, 0x83, 0xc1, 0x0e, 0x58, 0x00, - 0x15, 0xcc, 0x1a, 0x85, 0xb3, 0x6b, 0x55, 0x01, - 0x04, 0x6e, 0x9c, 0x4b, 0xdc, 0xae, 0x51, 0x35, - 0x69, 0x0b, 0x86, 0x66, 0xbd, 0x54, 0xb7, 0xa7, - 0x03, 0xea, 0x7b, 0x6f, 0x22, 0x0a, 0x54, 0x69, - 0xa5, 0x68, 0x02, 0x7e}, - {0x00, 0x4A, 0xC4, 0xD6} - }, - /*Test 5*/ - { - {0x6B, 0x8B, 0x08, 0xEE, 0x79, 0xE0, 0xB5, 0x98, - 0x2D, 0x6D, 0x12, 0x8E, 0xA9, 0xF2, 0x20, 0xCB}, - 0x561EB2DD, - 0x1C, - 0x0, - 5670, - {0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56, - 0xD5, 0xA3, 0x15, 0xF8, 0xD4, 0x0F, 0x6E, 0x09, - 0x37, 0x80, 0xBE, 0x8E, 0x8D, 0xE0, 0x7B, 0x69, - 0x92, 0x43, 0x20, 0x18, 0xE0, 0x8E, 0xD9, 0x6A, - 0x57, 0x34, 0xAF, 0x8B, 0xAD, 0x8A, 0x57, 0x5D, - 0x3A, 0x1F, 0x16, 0x2F, 0x85, 0x04, 0x5C, 0xC7, - 0x70, 0x92, 0x55, 0x71, 0xD9, 0xF5, 0xB9, 0x4E, - 0x45, 0x4A, 0x77, 0xC1, 0x6E, 0x72, 0x93, 0x6B, - 0xF0, 0x16, 0xAE, 0x15, 0x74, 0x99, 0xF0, 0x54, - 0x3B, 0x5D, 0x52, 0xCA, 0xA6, 0xDB, 0xEA, 0xB6, - 0x97, 0xD2, 0xBB, 0x73, 0xE4, 0x1B, 0x80, 0x75, - 0xDC, 0xE7, 0x9B, 0x4B, 0x86, 0x04, 0x4F, 0x66, - 0x1D, 0x44, 0x85, 0xA5, 0x43, 0xDD, 0x78, 0x60, - 0x6E, 0x04, 0x19, 0xE8, 0x05, 0x98, 0x59, 0xD3, - 0xCB, 0x2B, 0x67, 0xCE, 0x09, 0x77, 0x60, 0x3F, - 0x81, 0xFF, 0x83, 0x9E, 0x33, 0x18, 0x59, 0x54, - 0x4C, 0xFB, 0xC8, 0xD0, 0x0F, 0xEF, 0x1A, 0x4C, - 0x85, 0x10, 0xFB, 0x54, 0x7D, 0x6B, 0x06, 0xC6, - 0x11, 0xEF, 0x44, 0xF1, 0xBC, 0xE1, 0x07, 0xCF, - 0xA4, 0x5A, 0x06, 0xAA, 0xB3, 0x60, 0x15, 0x2B, - 0x28, 0xDC, 0x1E, 0xBE, 0x6F, 0x7F, 0xE0, 0x9B, - 0x05, 0x16, 0xF9, 0xA5, 0xB0, 0x2A, 0x1B, 0xD8, - 0x4B, 0xB0, 0x18, 0x1E, 0x2E, 0x89, 0xE1, 0x9B, - 0xD8, 0x12, 0x59, 0x30, 0xD1, 0x78, 0x68, 0x2F, - 0x38, 0x62, 0xDC, 0x51, 0xB6, 0x36, 0xF0, 0x4E, - 0x72, 0x0C, 0x47, 0xC3, 0xCE, 0x51, 0xAD, 0x70, - 0xD9, 0x4B, 0x9B, 0x22, 0x55, 0xFB, 0xAE, 0x90, - 0x65, 0x49, 0xF4, 0x99, 0xF8, 0xC6, 0xD3, 0x99, - 0x47, 0xED, 0x5E, 0x5D, 0xF8, 0xE2, 0xDE, 0xF1, - 0x13, 0x25, 0x3E, 0x7B, 0x08, 0xD0, 0xA7, 0x6B, - 0x6B, 0xFC, 0x68, 0xC8, 0x12, 0xF3, 0x75, 0xC7, - 0x9B, 0x8F, 0xE5, 0xFD, 0x85, 0x97, 0x6A, 0xA6, - 0xD4, 0x6B, 0x4A, 0x23, 0x39, 0xD8, 0xAE, 0x51, - 0x47, 0xF6, 0x80, 0xFB, 0xE7, 0x0F, 0x97, 0x8B, - 0x38, 0xEF, 0xFD, 0x7B, 0x2F, 0x78, 0x66, 0xA2, - 0x25, 0x54, 0xE1, 0x93, 0xA9, 0x4E, 0x98, 0xA6, - 0x8B, 0x74, 0xBD, 0x25, 0xBB, 0x2B, 0x3F, 0x5F, - 0xB0, 0xA5, 0xFD, 0x59, 0x88, 0x7F, 0x9A, 0xB6, - 0x81, 0x59, 0xB7, 0x17, 0x8D, 0x5B, 0x7B, 0x67, - 0x7C, 0xB5, 0x46, 0xBF, 0x41, 0xEA, 0xDC, 0xA2, - 0x16, 0xFC, 0x10, 0x85, 0x01, 0x28, 0xF8, 0xBD, - 0xEF, 0x5C, 0x8D, 0x89, 0xF9, 0x6A, 0xFA, 0x4F, - 0xA8, 0xB5, 0x48, 0x85, 0x56, 0x5E, 0xD8, 0x38, - 0xA9, 0x50, 0xFE, 0xE5, 0xF1, 0xC3, 0xB0, 0xA4, - 0xF6, 0xFB, 0x71, 0xE5, 0x4D, 0xFD, 0x16, 0x9E, - 0x82, 0xCE, 0xCC, 0x72, 0x66, 0xC8, 0x50, 0xE6, - 0x7C, 0x5E, 0xF0, 0xBA, 0x96, 0x0F, 0x52, 0x14, - 0x06, 0x0E, 0x71, 0xEB, 0x17, 0x2A, 0x75, 0xFC, - 0x14, 0x86, 0x83, 0x5C, 0xBE, 0xA6, 0x53, 0x44, - 0x65, 0xB0, 0x55, 0xC9, 0x6A, 0x72, 0xE4, 0x10, - 0x52, 0x24, 0x18, 0x23, 0x25, 0xD8, 0x30, 0x41, - 0x4B, 0x40, 0x21, 0x4D, 0xAA, 0x80, 0x91, 0xD2, - 0xE0, 0xFB, 0x01, 0x0A, 0xE1, 0x5C, 0x6D, 0xE9, - 0x08, 0x50, 0x97, 0x3B, 0xDF, 0x1E, 0x42, 0x3B, - 0xE1, 0x48, 0xA2, 0x37, 0xB8, 0x7A, 0x0C, 0x9F, - 0x34, 0xD4, 0xB4, 0x76, 0x05, 0xB8, 0x03, 0xD7, - 0x43, 0xA8, 0x6A, 0x90, 0x39, 0x9A, 0x4A, 0xF3, - 0x96, 0xD3, 0xA1, 0x20, 0x0A, 0x62, 0xF3, 0xD9, - 0x50, 0x79, 0x62, 0xE8, 0xE5, 0xBE, 0xE6, 0xD3, - 0xDA, 0x2B, 0xB3, 0xF7, 0x23, 0x76, 0x64, 0xAC, - 0x7A, 0x29, 0x28, 0x23, 0x90, 0x0B, 0xC6, 0x35, - 0x03, 0xB2, 0x9E, 0x80, 0xD6, 0x3F, 0x60, 0x67, - 0xBF, 0x8E, 0x17, 0x16, 0xAC, 0x25, 0xBE, 0xBA, - 0x35, 0x0D, 0xEB, 0x62, 0xA9, 0x9F, 0xE0, 0x31, - 0x85, 0xEB, 0x4F, 0x69, 0x93, 0x7E, 0xCD, 0x38, - 0x79, 0x41, 0xFD, 0xA5, 0x44, 0xBA, 0x67, 0xDB, - 0x09, 0x11, 0x77, 0x49, 0x38, 0xB0, 0x18, 0x27, - 0xBC, 0xC6, 0x9C, 0x92, 0xB3, 0xF7, 0x72, 0xA9, - 0xD2, 0x85, 0x9E, 0xF0, 0x03, 0x39, 0x8B, 0x1F, - 0x6B, 0xBA, 0xD7, 0xB5, 0x74, 0xF7, 0x98, 0x9A, - 0x1D, 0x10, 0xB2, 0xDF, 0x79, 0x8E, 0x0D, 0xBF, - 0x30, 0xD6, 0x58, 0x74, 0x64, 0xD2, 0x48, 0x78, - 0xCD, 0x00, 0xC0, 0xEA, 0xEE, 0x8A, 0x1A, 0x0C, - 0xC7, 0x53, 0xA2, 0x79, 0x79, 0xE1, 0x1B, 0x41, - 0xDB, 0x1D, 0xE3, 0xD5, 0x03, 0x8A, 0xFA, 0xF4, - 0x9F, 0x5C, 0x68, 0x2C, 0x37, 0x48, 0xD8, 0xA3, - 0xA9, 0xEC, 0x54, 0xE6, 0xA3, 0x71, 0x27, 0x5F, - 0x16, 0x83, 0x51, 0x0F, 0x8E, 0x4F, 0x90, 0x93, - 0x8F, 0x9A, 0xB6, 0xE1, 0x34, 0xC2, 0xCF, 0xDF, - 0x48, 0x41, 0xCB, 0xA8, 0x8E, 0x0C, 0xFF, 0x2B, - 0x0B, 0xCC, 0x8E, 0x6A, 0xDC, 0xB7, 0x11, 0x09, - 0xB5, 0x19, 0x8F, 0xEC, 0xF1, 0xBB, 0x7E, 0x5C, - 0x53, 0x1A, 0xCA, 0x50, 0xA5, 0x6A, 0x8A, 0x3B, - 0x6D, 0xE5, 0x98, 0x62, 0xD4, 0x1F, 0xA1, 0x13, - 0xD9, 0xCD, 0x95, 0x78, 0x08, 0xF0, 0x85, 0x71, - 0xD9, 0xA4, 0xBB, 0x79, 0x2A, 0xF2, 0x71, 0xF6, - 0xCC, 0x6D, 0xBB, 0x8D, 0xC7, 0xEC, 0x36, 0xE3, - 0x6B, 0xE1, 0xED, 0x30, 0x81, 0x64, 0xC3, 0x1C, - 0x7C, 0x0A, 0xFC, 0x54, 0x1C}, - {0x0C, 0xA1, 0x27, 0x92} - }, + { /*Test 1*/ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 }, + 0x00000000, + 0x0, + 0x0, + 1, + { 0x00, 0x00, 0x00, 0x00 }, + { 0xC8, 0xA9, 0x59, 0x5E } }, + { /*Test 2*/ + { 0x47, 0x05, 0x41, 0x25, 0x56, 0x1e, 0xb2, 0xdd, 0xa9, 0x40, 0x59, 0xda, 0x05, 0x09, + 0x78, 0x50 }, + 0x561EB2DD, + 0x14, + 0, + 90, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x67, 0x19, 0xA0, 0x88 } }, + /*Test 3*/ + { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, + 0xAB, 0x0A }, + 0xA94059DA, + 0xA, + 0x1, + 577, + { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, + 0x03, 0x91, 0xB1, 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, 0xE7, 0xB7, + 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, + 0xF9, 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, 0x7F, 0x9F, 0x68, 0xAD, + 0xB1, 0x6E, 0x5D, 0x7D, 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C, 0xEB, + 0xDE, 0x3F, 0x40, 0x93, 0xC5, 0x38, 0x81, 0x00, 0x00, 0x00, 0x00 }, + { 0xFA, 0xE8, 0xFF, 0x0B } }, + /*Test 4*/ + { { 0xc8, 0xa4, 0x82, 0x62, 0xd0, 0xc2, 0xe2, 0xba, 0xc4, 0xb9, 0x6e, 0xf7, 0x7e, 0x80, + 0xca, 0x59 }, + 0x5097850, + 0x10, + 0x1, + 2079, + { 0xb5, 0x46, 0x43, 0x0b, 0xf8, 0x7b, 0x4f, 0x1e, 0xe8, 0x34, 0x70, 0x4c, 0xd6, 0x95, + 0x1c, 0x36, 0xe2, 0x6f, 0x10, 0x8c, 0xf7, 0x31, 0x78, 0x8f, 0x48, 0xdc, 0x34, 0xf1, + 0x67, 0x8c, 0x05, 0x22, 0x1c, 0x8f, 0xa7, 0xff, 0x2f, 0x39, 0xf4, 0x77, 0xe7, 0xe4, + 0x9e, 0xf6, 0x0a, 0x4e, 0xc2, 0xc3, 0xde, 0x24, 0x31, 0x2a, 0x96, 0xaa, 0x26, 0xe1, + 0xcf, 0xba, 0x57, 0x56, 0x38, 0x38, 0xb2, 0x97, 0xf4, 0x7e, 0x85, 0x10, 0xc7, 0x79, + 0xfd, 0x66, 0x54, 0xb1, 0x43, 0x38, 0x6f, 0xa6, 0x39, 0xd3, 0x1e, 0xdb, 0xd6, 0xc0, + 0x6e, 0x47, 0xd1, 0x59, 0xd9, 0x43, 0x62, 0xf2, 0x6a, 0xee, 0xed, 0xee, 0x0e, 0x4f, + 0x49, 0xd9, 0xbf, 0x84, 0x12, 0x99, 0x54, 0x15, 0xbf, 0xad, 0x56, 0xee, 0x82, 0xd1, + 0xca, 0x74, 0x63, 0xab, 0xf0, 0x85, 0xb0, 0x82, 0xb0, 0x99, 0x04, 0xd6, 0xd9, 0x90, + 0xd4, 0x3c, 0xf2, 0xe0, 0x62, 0xf4, 0x08, 0x39, 0xd9, 0x32, 0x48, 0xb1, 0xeb, 0x92, + 0xcd, 0xfe, 0xd5, 0x30, 0x0b, 0xc1, 0x48, 0x28, 0x04, 0x30, 0xb6, 0xd0, 0xca, 0xa0, + 0x94, 0xb6, 0xec, 0x89, 0x11, 0xab, 0x7d, 0xc3, 0x68, 0x24, 0xb8, 0x24, 0xdc, 0x0a, + 0xf6, 0x68, 0x2b, 0x09, 0x35, 0xfd, 0xe7, 0xb4, 0x92, 0xa1, 0x4d, 0xc2, 0xf4, 0x36, + 0x48, 0x03, 0x8d, 0xa2, 0xcf, 0x79, 0x17, 0x0d, 0x2d, 0x50, 0x13, 0x3f, 0xd4, 0x94, + 0x16, 0xcb, 0x6e, 0x33, 0xbe, 0xa9, 0x0b, 0x8b, 0xf4, 0x55, 0x9b, 0x03, 0x73, 0x2a, + 0x01, 0xea, 0x29, 0x0e, 0x6d, 0x07, 0x4f, 0x79, 0xbb, 0x83, 0xc1, 0x0e, 0x58, 0x00, + 0x15, 0xcc, 0x1a, 0x85, 0xb3, 0x6b, 0x55, 0x01, 0x04, 0x6e, 0x9c, 0x4b, 0xdc, 0xae, + 0x51, 0x35, 0x69, 0x0b, 0x86, 0x66, 0xbd, 0x54, 0xb7, 0xa7, 0x03, 0xea, 0x7b, 0x6f, + 0x22, 0x0a, 0x54, 0x69, 0xa5, 0x68, 0x02, 0x7e }, + { 0x00, 0x4A, 0xC4, 0xD6 } }, + /*Test 5*/ + { { 0x6B, 0x8B, 0x08, 0xEE, 0x79, 0xE0, 0xB5, 0x98, 0x2D, 0x6D, 0x12, 0x8E, 0xA9, 0xF2, + 0x20, 0xCB }, + 0x561EB2DD, + 0x1C, + 0x0, + 5670, + { 0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56, 0xD5, 0xA3, 0x15, 0xF8, 0xD4, 0x0F, + 0x6E, 0x09, 0x37, 0x80, 0xBE, 0x8E, 0x8D, 0xE0, 0x7B, 0x69, 0x92, 0x43, 0x20, 0x18, + 0xE0, 0x8E, 0xD9, 0x6A, 0x57, 0x34, 0xAF, 0x8B, 0xAD, 0x8A, 0x57, 0x5D, 0x3A, 0x1F, + 0x16, 0x2F, 0x85, 0x04, 0x5C, 0xC7, 0x70, 0x92, 0x55, 0x71, 0xD9, 0xF5, 0xB9, 0x4E, + 0x45, 0x4A, 0x77, 0xC1, 0x6E, 0x72, 0x93, 0x6B, 0xF0, 0x16, 0xAE, 0x15, 0x74, 0x99, + 0xF0, 0x54, 0x3B, 0x5D, 0x52, 0xCA, 0xA6, 0xDB, 0xEA, 0xB6, 0x97, 0xD2, 0xBB, 0x73, + 0xE4, 0x1B, 0x80, 0x75, 0xDC, 0xE7, 0x9B, 0x4B, 0x86, 0x04, 0x4F, 0x66, 0x1D, 0x44, + 0x85, 0xA5, 0x43, 0xDD, 0x78, 0x60, 0x6E, 0x04, 0x19, 0xE8, 0x05, 0x98, 0x59, 0xD3, + 0xCB, 0x2B, 0x67, 0xCE, 0x09, 0x77, 0x60, 0x3F, 0x81, 0xFF, 0x83, 0x9E, 0x33, 0x18, + 0x59, 0x54, 0x4C, 0xFB, 0xC8, 0xD0, 0x0F, 0xEF, 0x1A, 0x4C, 0x85, 0x10, 0xFB, 0x54, + 0x7D, 0x6B, 0x06, 0xC6, 0x11, 0xEF, 0x44, 0xF1, 0xBC, 0xE1, 0x07, 0xCF, 0xA4, 0x5A, + 0x06, 0xAA, 0xB3, 0x60, 0x15, 0x2B, 0x28, 0xDC, 0x1E, 0xBE, 0x6F, 0x7F, 0xE0, 0x9B, + 0x05, 0x16, 0xF9, 0xA5, 0xB0, 0x2A, 0x1B, 0xD8, 0x4B, 0xB0, 0x18, 0x1E, 0x2E, 0x89, + 0xE1, 0x9B, 0xD8, 0x12, 0x59, 0x30, 0xD1, 0x78, 0x68, 0x2F, 0x38, 0x62, 0xDC, 0x51, + 0xB6, 0x36, 0xF0, 0x4E, 0x72, 0x0C, 0x47, 0xC3, 0xCE, 0x51, 0xAD, 0x70, 0xD9, 0x4B, + 0x9B, 0x22, 0x55, 0xFB, 0xAE, 0x90, 0x65, 0x49, 0xF4, 0x99, 0xF8, 0xC6, 0xD3, 0x99, + 0x47, 0xED, 0x5E, 0x5D, 0xF8, 0xE2, 0xDE, 0xF1, 0x13, 0x25, 0x3E, 0x7B, 0x08, 0xD0, + 0xA7, 0x6B, 0x6B, 0xFC, 0x68, 0xC8, 0x12, 0xF3, 0x75, 0xC7, 0x9B, 0x8F, 0xE5, 0xFD, + 0x85, 0x97, 0x6A, 0xA6, 0xD4, 0x6B, 0x4A, 0x23, 0x39, 0xD8, 0xAE, 0x51, 0x47, 0xF6, + 0x80, 0xFB, 0xE7, 0x0F, 0x97, 0x8B, 0x38, 0xEF, 0xFD, 0x7B, 0x2F, 0x78, 0x66, 0xA2, + 0x25, 0x54, 0xE1, 0x93, 0xA9, 0x4E, 0x98, 0xA6, 0x8B, 0x74, 0xBD, 0x25, 0xBB, 0x2B, + 0x3F, 0x5F, 0xB0, 0xA5, 0xFD, 0x59, 0x88, 0x7F, 0x9A, 0xB6, 0x81, 0x59, 0xB7, 0x17, + 0x8D, 0x5B, 0x7B, 0x67, 0x7C, 0xB5, 0x46, 0xBF, 0x41, 0xEA, 0xDC, 0xA2, 0x16, 0xFC, + 0x10, 0x85, 0x01, 0x28, 0xF8, 0xBD, 0xEF, 0x5C, 0x8D, 0x89, 0xF9, 0x6A, 0xFA, 0x4F, + 0xA8, 0xB5, 0x48, 0x85, 0x56, 0x5E, 0xD8, 0x38, 0xA9, 0x50, 0xFE, 0xE5, 0xF1, 0xC3, + 0xB0, 0xA4, 0xF6, 0xFB, 0x71, 0xE5, 0x4D, 0xFD, 0x16, 0x9E, 0x82, 0xCE, 0xCC, 0x72, + 0x66, 0xC8, 0x50, 0xE6, 0x7C, 0x5E, 0xF0, 0xBA, 0x96, 0x0F, 0x52, 0x14, 0x06, 0x0E, + 0x71, 0xEB, 0x17, 0x2A, 0x75, 0xFC, 0x14, 0x86, 0x83, 0x5C, 0xBE, 0xA6, 0x53, 0x44, + 0x65, 0xB0, 0x55, 0xC9, 0x6A, 0x72, 0xE4, 0x10, 0x52, 0x24, 0x18, 0x23, 0x25, 0xD8, + 0x30, 0x41, 0x4B, 0x40, 0x21, 0x4D, 0xAA, 0x80, 0x91, 0xD2, 0xE0, 0xFB, 0x01, 0x0A, + 0xE1, 0x5C, 0x6D, 0xE9, 0x08, 0x50, 0x97, 0x3B, 0xDF, 0x1E, 0x42, 0x3B, 0xE1, 0x48, + 0xA2, 0x37, 0xB8, 0x7A, 0x0C, 0x9F, 0x34, 0xD4, 0xB4, 0x76, 0x05, 0xB8, 0x03, 0xD7, + 0x43, 0xA8, 0x6A, 0x90, 0x39, 0x9A, 0x4A, 0xF3, 0x96, 0xD3, 0xA1, 0x20, 0x0A, 0x62, + 0xF3, 0xD9, 0x50, 0x79, 0x62, 0xE8, 0xE5, 0xBE, 0xE6, 0xD3, 0xDA, 0x2B, 0xB3, 0xF7, + 0x23, 0x76, 0x64, 0xAC, 0x7A, 0x29, 0x28, 0x23, 0x90, 0x0B, 0xC6, 0x35, 0x03, 0xB2, + 0x9E, 0x80, 0xD6, 0x3F, 0x60, 0x67, 0xBF, 0x8E, 0x17, 0x16, 0xAC, 0x25, 0xBE, 0xBA, + 0x35, 0x0D, 0xEB, 0x62, 0xA9, 0x9F, 0xE0, 0x31, 0x85, 0xEB, 0x4F, 0x69, 0x93, 0x7E, + 0xCD, 0x38, 0x79, 0x41, 0xFD, 0xA5, 0x44, 0xBA, 0x67, 0xDB, 0x09, 0x11, 0x77, 0x49, + 0x38, 0xB0, 0x18, 0x27, 0xBC, 0xC6, 0x9C, 0x92, 0xB3, 0xF7, 0x72, 0xA9, 0xD2, 0x85, + 0x9E, 0xF0, 0x03, 0x39, 0x8B, 0x1F, 0x6B, 0xBA, 0xD7, 0xB5, 0x74, 0xF7, 0x98, 0x9A, + 0x1D, 0x10, 0xB2, 0xDF, 0x79, 0x8E, 0x0D, 0xBF, 0x30, 0xD6, 0x58, 0x74, 0x64, 0xD2, + 0x48, 0x78, 0xCD, 0x00, 0xC0, 0xEA, 0xEE, 0x8A, 0x1A, 0x0C, 0xC7, 0x53, 0xA2, 0x79, + 0x79, 0xE1, 0x1B, 0x41, 0xDB, 0x1D, 0xE3, 0xD5, 0x03, 0x8A, 0xFA, 0xF4, 0x9F, 0x5C, + 0x68, 0x2C, 0x37, 0x48, 0xD8, 0xA3, 0xA9, 0xEC, 0x54, 0xE6, 0xA3, 0x71, 0x27, 0x5F, + 0x16, 0x83, 0x51, 0x0F, 0x8E, 0x4F, 0x90, 0x93, 0x8F, 0x9A, 0xB6, 0xE1, 0x34, 0xC2, + 0xCF, 0xDF, 0x48, 0x41, 0xCB, 0xA8, 0x8E, 0x0C, 0xFF, 0x2B, 0x0B, 0xCC, 0x8E, 0x6A, + 0xDC, 0xB7, 0x11, 0x09, 0xB5, 0x19, 0x8F, 0xEC, 0xF1, 0xBB, 0x7E, 0x5C, 0x53, 0x1A, + 0xCA, 0x50, 0xA5, 0x6A, 0x8A, 0x3B, 0x6D, 0xE5, 0x98, 0x62, 0xD4, 0x1F, 0xA1, 0x13, + 0xD9, 0xCD, 0x95, 0x78, 0x08, 0xF0, 0x85, 0x71, 0xD9, 0xA4, 0xBB, 0x79, 0x2A, 0xF2, + 0x71, 0xF6, 0xCC, 0x6D, 0xBB, 0x8D, 0xC7, 0xEC, 0x36, 0xE3, 0x6B, 0xE1, 0xED, 0x30, + 0x81, 0x64, 0xC3, 0x1C, 0x7C, 0x0A, 0xFC, 0x54, 0x1C }, + { 0x0C, 0xA1, 0x27, 0x92 } }, /*Custom test 1*/ - { - {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, - 0x01234567, - 0xA, - 0x0, - 63, - {0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56}, - {0x84, 0x9A, 0xCA, 0xDB} - }, + { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, + 0x0E, 0x0F }, + 0x01234567, + 0xA, + 0x0, + 63, + { 0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56 }, + { 0x84, 0x9A, 0xCA, 0xDB } }, /*Custom test 2*/ - { - {0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, - 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, 0xAB, 0x0A}, - 0xA94059DA, - 0xA, - 0x1, - 62, - {0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, - 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, 0x03, 0x91, 0xB1}, - {0x81, 0x17, 0x55, 0x81} - }, + { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, + 0xAB, 0x0A }, + 0xA94059DA, + 0xA, + 0x1, + 62, + { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, 0x03, + 0x91, 0xB1 }, + { 0x81, 0x17, 0x55, 0x81 } }, /*Custom test 3*/ - { - {0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, - 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, 0xAB, 0x0A}, - 0xA94059DA, - 0xA, - 0x0, - 512, - {0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, - 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, 0x03, 0x91, 0xB1, - 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, - 0xE7, 0xB7, 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, - 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, 0xF9, - 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, - 0x7F, 0x9F, 0x68, 0xAD, 0xB1, 0x6E, 0x5D, 0x7D, - 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C}, - {0xBB, 0xAF, 0x2F, 0xC3} - }, + { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, + 0xAB, 0x0A }, + 0xA94059DA, + 0xA, + 0x0, + 512, + { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, + 0x03, 0x91, 0xB1, 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, 0xE7, 0xB7, + 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, + 0xF9, 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, 0x7F, 0x9F, 0x68, 0xAD, + 0xB1, 0x6E, 0x5D, 0x7D, 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C }, + { 0xBB, 0xAF, 0x2F, 0xC3 } }, /*Custom test 4*/ - { - {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}, - 0x01234567, - 0xA, - 0x0, - 64, - {0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56}, - {0x1B, 0x3D, 0x0f, 0x74} - }, + { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, + 0x0E, 0x0F }, + 0x01234567, + 0xA, + 0x0, + 64, + { 0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56 }, + { 0x1B, 0x3D, 0x0f, 0x74 } }, /*Custom test 5*/ - { - {0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, - 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, 0xAB, 0x0A}, - 0xA94059DA, - 0xA, - 0x1, - 480, - {0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, - 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, 0x03, 0x91, 0xB1, - 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, - 0xE7, 0xB7, 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, - 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, 0xF9, - 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, - 0x7F, 0x9F, 0x68, 0xAD, 0xB1, 0x6E, 0x5D, 0x7D, - 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C}, - {0x39, 0x5C, 0x11, 0x92} - }, + { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, + 0xAB, 0x0A }, + 0xA94059DA, + 0xA, + 0x1, + 480, + { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, + 0x03, 0x91, 0xB1, 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, 0xE7, 0xB7, + 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, + 0xF9, 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, 0x7F, 0x9F, 0x68, 0xAD, + 0xB1, 0x6E, 0x5D, 0x7D, 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C }, + { 0x39, 0x5C, 0x11, 0x92 } }, }; const struct test256EIA3_vectors_t test256EIA3_vectors[] = { { - /* Test 1 */ + /* Test 1 */ /* Key */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* IV */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 400, /* IV length */ 25, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 - }, - {0x9B, 0x97, 0x2A, 0x74}, - {0x67, 0x3e, 0x54, 0x99, 0x00, 0x34, 0xd3, 0x8c}, - {0xd8, 0x5e, 0x54, 0xbb, 0xcb, 0x96, 0x00, 0x96, - 0x70, 0x84, 0xc9, 0x52, 0xa1, 0x65, 0x4b, 0x26 - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x9B, 0x97, 0x2A, 0x74 }, + { 0x67, 0x3e, 0x54, 0x99, 0x00, 0x34, 0xd3, 0x8c }, + { 0xd8, 0x5e, 0x54, 0xbb, 0xcb, 0x96, 0x00, 0x96, 0x70, 0x84, 0xc9, 0x52, 0xa1, + 0x65, 0x4b, 0x26 }, }, /* Test 2 */ - { - /* Key */ - {0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, - 0x23, 0x19, 0x48, 0x42, 0xcb, 0x5c, 0x6d, 0x98, - 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, 0xeb, 0xe0, - 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e - }, - /* IV */ - {0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, - 0x02, 0x2d, 0x24, 0xcd, 0x23, 0x3f, 0x4d, 0x0a, - 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 - }, - 1600, - /* IV length */ - 23, - {0x05, 0xa8, 0xc3, 0x4b, 0x70, 0x9c, 0x97, 0x71, - 0x67, 0x70, 0xa5, 0xa3, 0x08, 0x60, 0xca, 0x25, - 0x0a, 0x8b, 0xb5, 0xc1, 0xc9, 0xd5, 0x8c, 0x7d, - 0xfb, 0x00, 0x3b, 0xc0, 0x9d, 0xe1, 0x09, 0x9f, - 0xcc, 0x22, 0x8c, 0xf6, 0x12, 0x6f, 0xb9, 0x1e, - 0xc9, 0x45, 0x43, 0x43, 0x25, 0x7a, 0x2b, 0xba, - 0x64, 0x4b, 0x8c, 0x91, 0x77, 0xc8, 0xfd, 0xce, - 0x01, 0xcf, 0xab, 0x6b, 0xe6, 0xc2, 0x48, 0x80, - 0x82, 0x77, 0xad, 0xb8, 0xb9, 0x8d, 0x1f, 0xd7, - 0x48, 0x0b, 0x73, 0x4d, 0x98, 0x96, 0x12, 0xd5, - 0xf1, 0x86, 0xfd, 0xa1, 0x12, 0x50, 0x9a, 0x38, - 0x07, 0x37, 0xd5, 0xa3, 0xd0, 0x21, 0xfe, 0x55, - 0x7a, 0x8f, 0xff, 0xe0, 0x4f, 0x25, 0x9c, 0x73, - 0x01, 0x06, 0x66, 0xff, 0x10, 0xa4, 0xdd, 0xd4, - 0x2a, 0xbf, 0x0f, 0x5a, 0xa2, 0x29, 0x64, 0xd9, - 0x99, 0xc8, 0x46, 0xe6, 0x46, 0x48, 0x4d, 0x56, - 0xe9, 0x02, 0x17, 0xa8, 0x14, 0x28, 0x13, 0x22, - 0xf0, 0xd4, 0x43, 0xbe, 0xa0, 0x64, 0xd5, 0x28, - 0x99, 0x27, 0x24, 0x5d, 0x7c, 0x25, 0x46, 0xd6, - 0xdf, 0x2c, 0x05, 0x70, 0x5a, 0x55, 0xcd, 0xf6, - 0xe7, 0xdb, 0x3d, 0x94, 0x67, 0xfa, 0x67, 0x15, - 0xe3, 0x84, 0x96, 0x26, 0xee, 0xf4, 0x22, 0xaf, - 0x2f, 0xa4, 0x6e, 0xda, 0x2f, 0x4a, 0xa0, 0xcd, - 0x10, 0x72, 0x85, 0xb6, 0x45, 0x3b, 0x22, 0xb8, - 0x1f, 0xe0, 0x3c, 0xf9, 0x64, 0x29, 0xb4, 0x46 - }, - {0x8d, 0x74, 0x8b, 0x71}, - {0xe5, 0x1d, 0xf2, 0x0a, - 0x9e, 0x74, 0x06, 0xac}, - {0x4d, 0x40, 0x5d, 0x6e, - 0xf7, 0xf8, 0xaf, 0xad, - 0xd6, 0x71, 0x71, 0x03, - 0xdf, 0x92, 0x28, 0x20}, - }, { - /* Test 3 */ /* Key */ - {0x92, 0xf9, 0x27, 0xe8, 0xab, 0x48, 0x46, 0xdb, - 0x2f, 0xa3, 0x61, 0x36, 0x7e, 0x89, 0xe1, 0x17, - 0xc9, 0x99, 0x57, 0x63, 0xe0, 0xe4, 0x4c, 0xce, - 0x20, 0x03, 0x8a, 0x9c, 0x9a, 0x44, 0xca, 0x64 - }, + { 0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, 0x23, 0x19, 0x48, + 0x42, 0xcb, 0x5c, 0x6d, 0x98, 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, + 0xeb, 0xe0, 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e }, /* IV */ - {0x7d, 0x51, 0xfb, 0x42, 0xf8, 0x7e, 0x62, 0xfa, - 0x60, 0x25, 0xb9, 0x2b, 0x4e, 0xd6, 0x1c, 0x2e, - 0xcc, 0x6c, 0x65, 0x18, 0x1e, 0x9d, 0x04 - }, - 800, + { 0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, 0x02, 0x2d, 0x24, 0xcd, + 0x23, 0x3f, 0x4d, 0x0a, 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 }, + 1600, /* IV length */ 23, - {0xf6, 0x6e, 0x21, 0x54, 0xb9, 0x60, 0xb5, 0x90, - 0xdc, 0x35, 0xaf, 0xb9, 0x9d, 0x03, 0xf9, 0xbe, - 0x58, 0xf8, 0x7c, 0x5c, 0x03, 0xdb, 0x72, 0x2e, - 0xa6, 0x34, 0xff, 0x43, 0x8d, 0xcf, 0xd4, 0xa7, - 0x2a, 0x52, 0xae, 0x3a, 0xb8, 0xc7, 0x11, 0xd8, - 0x19, 0xd3, 0x94, 0x66, 0x84, 0x10, 0xf0, 0x81, - 0x45, 0xc5, 0x0b, 0x05, 0xe6, 0x89, 0xc6, 0xc9, - 0xb4, 0x25, 0x7b, 0xb7, 0x89, 0x42, 0xd4, 0x6c, - 0x1a, 0xfd, 0x00, 0x42, 0x80, 0x9d, 0x10, 0x5e, - 0x68, 0xd6, 0x02, 0x13, 0x07, 0x55, 0x08, 0x24, - 0xe5, 0x9e, 0x6b, 0xf3, 0xea, 0x04, 0xd7, 0xd7, - 0x8f, 0x0a, 0x48, 0x02, 0x8c, 0x98, 0xd5, 0x68, - 0xee, 0x11, 0x93, 0x22 - }, - {0xf2, 0xef, 0xfb, 0xf7}, - {0x5a, 0x99, 0xe9, 0x23, 0xfa, 0xf1, 0xec, 0xbb}, - {0x0b, 0xfb, 0x8f, 0xff, 0x65, 0xaf, 0x6a, 0x69, - 0xea, 0xde, 0xbd, 0x94, 0x79, 0x7b, 0x08, 0xa5}, + { 0x05, 0xa8, 0xc3, 0x4b, 0x70, 0x9c, 0x97, 0x71, 0x67, 0x70, 0xa5, 0xa3, 0x08, + 0x60, 0xca, 0x25, 0x0a, 0x8b, 0xb5, 0xc1, 0xc9, 0xd5, 0x8c, 0x7d, 0xfb, 0x00, + 0x3b, 0xc0, 0x9d, 0xe1, 0x09, 0x9f, 0xcc, 0x22, 0x8c, 0xf6, 0x12, 0x6f, 0xb9, + 0x1e, 0xc9, 0x45, 0x43, 0x43, 0x25, 0x7a, 0x2b, 0xba, 0x64, 0x4b, 0x8c, 0x91, + 0x77, 0xc8, 0xfd, 0xce, 0x01, 0xcf, 0xab, 0x6b, 0xe6, 0xc2, 0x48, 0x80, 0x82, + 0x77, 0xad, 0xb8, 0xb9, 0x8d, 0x1f, 0xd7, 0x48, 0x0b, 0x73, 0x4d, 0x98, 0x96, + 0x12, 0xd5, 0xf1, 0x86, 0xfd, 0xa1, 0x12, 0x50, 0x9a, 0x38, 0x07, 0x37, 0xd5, + 0xa3, 0xd0, 0x21, 0xfe, 0x55, 0x7a, 0x8f, 0xff, 0xe0, 0x4f, 0x25, 0x9c, 0x73, + 0x01, 0x06, 0x66, 0xff, 0x10, 0xa4, 0xdd, 0xd4, 0x2a, 0xbf, 0x0f, 0x5a, 0xa2, + 0x29, 0x64, 0xd9, 0x99, 0xc8, 0x46, 0xe6, 0x46, 0x48, 0x4d, 0x56, 0xe9, 0x02, + 0x17, 0xa8, 0x14, 0x28, 0x13, 0x22, 0xf0, 0xd4, 0x43, 0xbe, 0xa0, 0x64, 0xd5, + 0x28, 0x99, 0x27, 0x24, 0x5d, 0x7c, 0x25, 0x46, 0xd6, 0xdf, 0x2c, 0x05, 0x70, + 0x5a, 0x55, 0xcd, 0xf6, 0xe7, 0xdb, 0x3d, 0x94, 0x67, 0xfa, 0x67, 0x15, 0xe3, + 0x84, 0x96, 0x26, 0xee, 0xf4, 0x22, 0xaf, 0x2f, 0xa4, 0x6e, 0xda, 0x2f, 0x4a, + 0xa0, 0xcd, 0x10, 0x72, 0x85, 0xb6, 0x45, 0x3b, 0x22, 0xb8, 0x1f, 0xe0, 0x3c, + 0xf9, 0x64, 0x29, 0xb4, 0x46 }, + { 0x8d, 0x74, 0x8b, 0x71 }, + { 0xe5, 0x1d, 0xf2, 0x0a, 0x9e, 0x74, 0x06, 0xac }, + { 0x4d, 0x40, 0x5d, 0x6e, 0xf7, 0xf8, 0xaf, 0xad, 0xd6, 0x71, 0x71, 0x03, 0xdf, + 0x92, 0x28, 0x20 }, }, { - /* Test 4 */ + /* Test 3 */ /* Key */ - {0xa7, 0x72, 0xf5, 0xfe, 0x9d, 0x81, 0xd1, 0xcf, - 0x22, 0x8e, 0x45, 0x53, 0x67, 0x75, 0xac, 0xc9, - 0x04, 0x19, 0x57, 0x55, 0x0f, 0x6c, 0x39, 0xf9, - 0xc5, 0x1b, 0x1e, 0x9e, 0xbb, 0x22, 0xa2, 0xf5 - }, + { 0x92, 0xf9, 0x27, 0xe8, 0xab, 0x48, 0x46, 0xdb, 0x2f, 0xa3, 0x61, + 0x36, 0x7e, 0x89, 0xe1, 0x17, 0xc9, 0x99, 0x57, 0x63, 0xe0, 0xe4, + 0x4c, 0xce, 0x20, 0x03, 0x8a, 0x9c, 0x9a, 0x44, 0xca, 0x64 }, /* IV */ - {0xce, 0x51, 0x11, 0x83, 0x9b, 0x64, 0x4d, 0x20, - 0x51, 0x92, 0x71, 0x3b, 0x43, 0x47, 0xf9, 0x38, - 0x79, 0x0f, 0xd2, 0x59, 0xbc, 0x35, 0xd3 - }, - 400, + { 0x7d, 0x51, 0xfb, 0x42, 0xf8, 0x7e, 0x62, 0xfa, 0x60, 0x25, 0xb9, 0x2b, + 0x4e, 0xd6, 0x1c, 0x2e, 0xcc, 0x6c, 0x65, 0x18, 0x1e, 0x9d, 0x04 }, + 800, /* IV length */ 23, - {0xad, 0x2a, 0x9a, 0x9a, 0x7e, 0xb8, 0xb9, 0x72, - 0xc5, 0x50, 0xe8, 0x28, 0x5e, 0x17, 0xda, 0xa2, - 0x4c, 0x9a, 0xeb, 0x61, 0x72, 0xc6, 0xa7, 0x06, - 0x54, 0x32, 0xa6, 0x5b, 0xc5, 0x8b, 0xd7, 0xa2, - 0xe0, 0x5e, 0x18, 0xf5, 0x41, 0x8e, 0xa8, 0x6e, - 0x50, 0xd9, 0xde, 0x67, 0x28, 0x04, 0xee, 0x22, - 0xa5, 0x72 - }, - {0x18, 0x3d, 0xf5, 0xf7}, - {0x50, 0xa0, 0xc4, 0x24, 0xa9, 0x25, 0xf4, 0x5b}, - {0x4b, 0xde, 0xd3, 0x15, 0xa4, 0x80, 0xa7, 0xe4, - 0x02, 0xe4, 0xc4, 0x48, 0x90, 0xfe, 0x62, 0xf5}, + { 0xf6, 0x6e, 0x21, 0x54, 0xb9, 0x60, 0xb5, 0x90, 0xdc, 0x35, 0xaf, 0xb9, 0x9d, + 0x03, 0xf9, 0xbe, 0x58, 0xf8, 0x7c, 0x5c, 0x03, 0xdb, 0x72, 0x2e, 0xa6, 0x34, + 0xff, 0x43, 0x8d, 0xcf, 0xd4, 0xa7, 0x2a, 0x52, 0xae, 0x3a, 0xb8, 0xc7, 0x11, + 0xd8, 0x19, 0xd3, 0x94, 0x66, 0x84, 0x10, 0xf0, 0x81, 0x45, 0xc5, 0x0b, 0x05, + 0xe6, 0x89, 0xc6, 0xc9, 0xb4, 0x25, 0x7b, 0xb7, 0x89, 0x42, 0xd4, 0x6c, 0x1a, + 0xfd, 0x00, 0x42, 0x80, 0x9d, 0x10, 0x5e, 0x68, 0xd6, 0x02, 0x13, 0x07, 0x55, + 0x08, 0x24, 0xe5, 0x9e, 0x6b, 0xf3, 0xea, 0x04, 0xd7, 0xd7, 0x8f, 0x0a, 0x48, + 0x02, 0x8c, 0x98, 0xd5, 0x68, 0xee, 0x11, 0x93, 0x22 }, + { 0xf2, 0xef, 0xfb, 0xf7 }, + { 0x5a, 0x99, 0xe9, 0x23, 0xfa, 0xf1, 0xec, 0xbb }, + { 0x0b, 0xfb, 0x8f, 0xff, 0x65, 0xaf, 0x6a, 0x69, 0xea, 0xde, 0xbd, 0x94, 0x79, + 0x7b, 0x08, 0xa5 }, }, { - /* Test 5 */ + /* Test 4 */ /* Key */ - {0xf8, 0xa0, 0x45, 0x4f, 0x6d, 0xea, 0x74, 0x6e, - 0x4c, 0xd1, 0x6e, 0xb0, 0xc3, 0xa2, 0x1f, 0x57, - 0xeb, 0x6f, 0x35, 0x2d, 0x6a, 0x02, 0x5b, 0x35, - 0x32, 0xba, 0x47, 0x3f, 0x1f, 0x0e, 0xdd, 0xc9 - }, + { 0xa7, 0x72, 0xf5, 0xfe, 0x9d, 0x81, 0xd1, 0xcf, 0x22, 0x8e, 0x45, + 0x53, 0x67, 0x75, 0xac, 0xc9, 0x04, 0x19, 0x57, 0x55, 0x0f, 0x6c, + 0x39, 0xf9, 0xc5, 0x1b, 0x1e, 0x9e, 0xbb, 0x22, 0xa2, 0xf5 }, /* IV */ - {0x07, 0x90, 0xeb, 0x7d, 0x09, 0x6d, 0xc1, 0xf1, - 0x86, 0x47, 0xea, 0x57, 0xe4, 0xb8, 0x92, 0xb1, - 0x4e, 0x3b, 0x2d, 0x62, 0xaa, 0x53, 0x6f - }, + { 0xce, 0x51, 0x11, 0x83, 0x9b, 0x64, 0x4d, 0x20, 0x51, 0x92, 0x71, 0x3b, + 0x43, 0x47, 0xf9, 0x38, 0x79, 0x0f, 0xd2, 0x59, 0xbc, 0x35, 0xd3 }, 400, /* IV length */ 23, - {0xf7, 0xc3, 0xc4, 0x82, 0xe7, 0x20, 0x76, 0xa2, - 0x78, 0x5d, 0xe1, 0xcb, 0xa5, 0x3f, 0x7d, 0x7c, - 0xa3, 0x84, 0x0b, 0x69, 0xff, 0x3b, 0x19, 0xb5, - 0x6b, 0x9f, 0x25, 0x04, 0x35, 0xad, 0x89, 0x3b, - 0xad, 0xba, 0xa5, 0xe1, 0xe8, 0x4e, 0xa4, 0xf5, - 0x49, 0x84, 0x9a, 0x2c, 0x71, 0xb1, 0xd6, 0xc1, - 0x1b, 0xdc - }, - {0xb8, 0xbf, 0x02, 0x13}, - {0x2c, 0xfc, 0xa3, 0x59, 0x33, 0x50, 0xd8, 0xee}, - {0x9c, 0x6e, 0xd5, 0xf9, 0x63, 0x95, 0xa7, 0x28, - 0xe1, 0x6b, 0xb2, 0x8a, 0x0e, 0x5b, 0x90, 0x72} + { 0xad, 0x2a, 0x9a, 0x9a, 0x7e, 0xb8, 0xb9, 0x72, 0xc5, 0x50, 0xe8, 0x28, 0x5e, + 0x17, 0xda, 0xa2, 0x4c, 0x9a, 0xeb, 0x61, 0x72, 0xc6, 0xa7, 0x06, 0x54, 0x32, + 0xa6, 0x5b, 0xc5, 0x8b, 0xd7, 0xa2, 0xe0, 0x5e, 0x18, 0xf5, 0x41, 0x8e, 0xa8, + 0x6e, 0x50, 0xd9, 0xde, 0x67, 0x28, 0x04, 0xee, 0x22, 0xa5, 0x72 }, + { 0x18, 0x3d, 0xf5, 0xf7 }, + { 0x50, 0xa0, 0xc4, 0x24, 0xa9, 0x25, 0xf4, 0x5b }, + { 0x4b, 0xde, 0xd3, 0x15, 0xa4, 0x80, 0xa7, 0xe4, 0x02, 0xe4, 0xc4, 0x48, 0x90, + 0xfe, 0x62, 0xf5 }, }, + { /* Test 5 */ + /* Key */ + { 0xf8, 0xa0, 0x45, 0x4f, 0x6d, 0xea, 0x74, 0x6e, 0x4c, 0xd1, 0x6e, + 0xb0, 0xc3, 0xa2, 0x1f, 0x57, 0xeb, 0x6f, 0x35, 0x2d, 0x6a, 0x02, + 0x5b, 0x35, 0x32, 0xba, 0x47, 0x3f, 0x1f, 0x0e, 0xdd, 0xc9 }, + /* IV */ + { 0x07, 0x90, 0xeb, 0x7d, 0x09, 0x6d, 0xc1, 0xf1, 0x86, 0x47, 0xea, 0x57, + 0xe4, 0xb8, 0x92, 0xb1, 0x4e, 0x3b, 0x2d, 0x62, 0xaa, 0x53, 0x6f }, + 400, + /* IV length */ + 23, + { 0xf7, 0xc3, 0xc4, 0x82, 0xe7, 0x20, 0x76, 0xa2, 0x78, 0x5d, 0xe1, 0xcb, 0xa5, + 0x3f, 0x7d, 0x7c, 0xa3, 0x84, 0x0b, 0x69, 0xff, 0x3b, 0x19, 0xb5, 0x6b, 0x9f, + 0x25, 0x04, 0x35, 0xad, 0x89, 0x3b, 0xad, 0xba, 0xa5, 0xe1, 0xe8, 0x4e, 0xa4, + 0xf5, 0x49, 0x84, 0x9a, 0x2c, 0x71, 0xb1, 0xd6, 0xc1, 0x1b, 0xdc }, + { 0xb8, 0xbf, 0x02, 0x13 }, + { 0x2c, 0xfc, 0xa3, 0x59, 0x33, 0x50, 0xd8, 0xee }, + { 0x9c, 0x6e, 0xd5, 0xf9, 0x63, 0x95, 0xa7, 0x28, 0xe1, 0x6b, 0xb2, 0x8a, 0x0e, 0x5b, + 0x90, 0x72 } }, { - /* Test 6 */ + /* Test 6 */ /* Key */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* IV */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 4000, /* IV length */ 25, - {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11 - }, - {0x87, 0x54, 0xf5, 0xcf}, - {0x13, 0x0d, 0xc2, 0x25, 0xe7, 0x22, 0x40, 0xcc}, - {0xdf, 0x1e, 0x83, 0x07, 0xb3, 0x1c, 0xc6, 0x2b, - 0xec, 0xa1, 0xac, 0x6f, 0x81, 0x90, 0xc2, 0x2f - }, + { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }, + { 0x87, 0x54, 0xf5, 0xcf }, + { 0x13, 0x0d, 0xc2, 0x25, 0xe7, 0x22, 0x40, 0xcc }, + { 0xdf, 0x1e, 0x83, 0x07, 0xb3, 0x1c, 0xc6, 0x2b, 0xec, 0xa1, 0xac, 0x6f, 0x81, + 0x90, 0xc2, 0x2f }, }, - { - /* Test 7 */ + { + /* Test 7 */ /* Key */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, /* IV */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f - }, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, 400, /* IV length */ 25, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 - }, - {0x1f, 0x30, 0x79, 0xb4}, - {0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25}, - {0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, - 0x28, 0x31, 0x9f, 0x11, 0x1a, 0xf3, 0x4f, 0xbd - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x1f, 0x30, 0x79, 0xb4 }, + { 0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25 }, + { 0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, 0x28, 0x31, 0x9f, 0x11, 0x1a, + 0xf3, 0x4f, 0xbd }, }, - { - /* Test 8 */ + { + /* Test 8 */ /* Key */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, /* IV */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f - }, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, 4000, /* IV length */ 25, - {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11 - }, - {0x5c, 0x7c, 0x8b, 0x88}, - {0xea, 0x1d, 0xee, 0x54, 0x4b, 0xb6, 0x22, 0x3b}, - {0x3a, 0x83, 0xb5, 0x54, 0xbe, 0x40, 0x8c, 0xa5, - 0x49, 0x41, 0x24, 0xed, 0x9d, 0x47, 0x32, 0x05 - }, + { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }, + { 0x5c, 0x7c, 0x8b, 0x88 }, + { 0xea, 0x1d, 0xee, 0x54, 0x4b, 0xb6, 0x22, 0x3b }, + { 0x3a, 0x83, 0xb5, 0x54, 0xbe, 0x40, 0x8c, 0xa5, 0x49, 0x41, 0x24, 0xed, 0x9d, + 0x47, 0x32, 0x05 }, }, - { - /* Test 9 */ + { + /* Test 9 */ /* Key */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, /* IV */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, 400, /* IV length */ 23, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 - }, - {0x1f, 0x30, 0x79, 0xb4}, - {0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25}, - {0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, - 0x28, 0x31, 0x9f, 0x11, 0x1a, 0xf3, 0x4f, 0xbd - }, - }, - { - /* Test 10 */ - /* Key */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* IV */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }, - 272, - /* IV length */ - 25, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 - }, - {0xe7, 0x38, 0x1d, 0x2a}, - {0x03, 0xa6, 0xe4, 0xa4, 0x94, 0xe7, 0x26, 0x0c}, - {0x41, 0x07, 0x03, 0x9b, 0x7d, 0x83, 0xb8, 0xb6, - 0x57, 0xc2, 0x34, 0xb3, 0xd1, 0xa7, 0x20, 0x6a - } - }, - { - /* Test 11 */ - /* Key */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* IV */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }, - 272, - /* IV length */ - 25, - {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01 - }, - {0x56, 0x7b, 0x5, 0xfa}, - {0xdc, 0x6b, 0x62, 0x68, 0x7e, 0x90, 0xf1, 0x00}, - {0xdb, 0xc6, 0x76, 0xad, 0xd9, 0xb2, 0x23, 0x2d, - 0xa3, 0xc5, 0xf2, 0xfd, 0xf0, 0xfb, 0xe9, 0x8a - } + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x1f, 0x30, 0x79, 0xb4 }, + { 0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25 }, + { 0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, 0x28, 0x31, 0x9f, 0x11, 0x1a, + 0xf3, 0x4f, 0xbd }, }, + { /* Test 10 */ + /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 272, + /* IV length */ + 25, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xe7, 0x38, 0x1d, 0x2a }, + { 0x03, 0xa6, 0xe4, 0xa4, 0x94, 0xe7, 0x26, 0x0c }, + { 0x41, 0x07, 0x03, 0x9b, 0x7d, 0x83, 0xb8, 0xb6, 0x57, 0xc2, 0x34, 0xb3, 0xd1, 0xa7, + 0x20, 0x6a } }, + { /* Test 11 */ + /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 272, + /* IV length */ + 25, + { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x56, 0x7b, 0x5, 0xfa }, + { 0xdc, 0x6b, 0x62, 0x68, 0x7e, 0x90, 0xf1, 0x00 }, + { 0xdb, 0xc6, 0x76, 0xad, 0xd9, 0xb2, 0x23, 0x2d, 0xa3, 0xc5, 0xf2, 0xfd, 0xf0, 0xfb, + 0xe9, 0x8a } }, { - /* Test 12 */ + /* Test 12 */ /* Key */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* IV */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 5120, /* IV length */ 25, - {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - }, - {0x72, 0xc4, 0x7d, 0x50}, - {0xa5, 0x3b, 0x6c, 0xd6, 0x50, 0xef, 0xb5, 0x73}, - {0xe7, 0xbc, 0x9c, 0x1b, 0x02, 0x79, 0x27, 0x7b, - 0x23, 0x48, 0x4b, 0xcf, 0x2e, 0x70, 0xe9, 0x5b - }, + { + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, + }, + { 0x72, 0xc4, 0x7d, 0x50 }, + { 0xa5, 0x3b, 0x6c, 0xd6, 0x50, 0xef, 0xb5, 0x73 }, + { 0xe7, 0xbc, 0x9c, 0x1b, 0x02, 0x79, 0x27, 0x7b, 0x23, 0x48, 0x4b, 0xcf, 0x2e, + 0x70, 0xe9, 0x5b }, }, #ifdef __aarch64__ /* Add 3 cases, whose message length is not N*8 */ diff --git a/test/wycheproof-app/aes_ccm_test.json.c b/test/wycheproof-app/aes_ccm_test.json.c index e32985d5..af05dd1b 100644 --- a/test/wycheproof-app/aes_ccm_test.json.c +++ b/test/wycheproof-app/aes_ccm_test.json.c @@ -29,69 +29,50 @@ /* AES-CCM, 0.8r12 */ #include "aead_test.h" const struct aead_test aes_ccm_test_json[] = { - { 96, 128, 128, 1, - "\xbe\xdc\xfb\x5a\x01\x1e\xbc\x84\x60\x0f\xcb\x29\x6c\x15\xaf\x0d", + { 96, 128, 128, 1, "\xbe\xdc\xfb\x5a\x01\x1e\xbc\x84\x60\x0f\xcb\x29\x6c\x15\xaf\x0d", "\x43\x8a\x54\x7a\x94\xea\x88\xdc\xe4\x6c\x6c\x85", "", "", "", - "\x25\xd1\xa3\x84\x95\xa7\xde\xa4\x5b\xda\x04\x97\x05\x62\x7d\x10", 1, - 0, 0 }, - { 96, 128, 128, 2, - "\x38\x4e\xa4\x16\xac\x3c\x2f\x51\xa7\x6e\x7d\x82\x26\x34\x6d\x4e", - "\xb3\x0c\x08\x47\x27\xad\x1c\x59\x2a\xc2\x1d\x12", "", "\x35", - "\xd7", - "\x6b\xe3\xfd\x13\xb7\x06\x5a\xfc\x19\xe3\xb8\xa3\xb9\x6b\x39\xfb", 1, - 0, 8 }, - { 96, 128, 128, 3, - "\xca\xe3\x1c\xd9\xf5\x55\x26\xeb\x03\x82\x41\xfc\x44\xca\xc1\xe5", + "\x25\xd1\xa3\x84\x95\xa7\xde\xa4\x5b\xda\x04\x97\x05\x62\x7d\x10", 1, 0, 0 }, + { 96, 128, 128, 2, "\x38\x4e\xa4\x16\xac\x3c\x2f\x51\xa7\x6e\x7d\x82\x26\x34\x6d\x4e", + "\xb3\x0c\x08\x47\x27\xad\x1c\x59\x2a\xc2\x1d\x12", "", "\x35", "\xd7", + "\x6b\xe3\xfd\x13\xb7\x06\x5a\xfc\x19\xe3\xb8\xa3\xb9\x6b\x39\xfb", 1, 0, 8 }, + { 96, 128, 128, 3, "\xca\xe3\x1c\xd9\xf5\x55\x26\xeb\x03\x82\x41\xfc\x44\xca\xc1\xe5", "\xb5\xe0\x06\xde\xd5\x53\x11\x0e\x6d\xc5\x65\x29", "", - "\xd1\x09\x89\xf2\xc5\x2e\x94\xad", - "\xe6\x4d\x0b\x64\xeb\xb3\x81\xec", - "\x25\x40\x9c\x79\x5d\x49\x1d\x80\x4e\x58\x39\x17\x22\x7b\x73\xc7", 1, - 0, 64 }, - { 96, 128, 128, 4, - "\xff\xdf\x42\x28\x36\x1e\xa1\xf8\x16\x58\x52\x13\x6b\x34\x80\xf7", + "\xd1\x09\x89\xf2\xc5\x2e\x94\xad", "\xe6\x4d\x0b\x64\xeb\xb3\x81\xec", + "\x25\x40\x9c\x79\x5d\x49\x1d\x80\x4e\x58\x39\x17\x22\x7b\x73\xc7", 1, 0, 64 }, + { 96, 128, 128, 4, "\xff\xdf\x42\x28\x36\x1e\xa1\xf8\x16\x58\x52\x13\x6b\x34\x80\xf7", "\x0e\x16\x66\xf2\xdc\x65\x2f\x77\x08\xfb\x8f\x0d", "", "\x25\xb1\x2e\x28\xac\x0e\xf6\xea\xd0\x22\x6a\x3b\x22\x88\xc8\x00", "\xaa\xf5\x96\xfa\x5b\x00\xaa\xac\x27\x70\x01\x46\xae\xc9\x32\xa9", - "\x84\x8b\x67\x35\xd3\x2c\x96\xe4\xa0\x53\x2b\xcd\xfa\xf3\x35\x82", 1, - 0, 128 }, - { 96, 128, 128, 5, - "\xc1\x5e\xd2\x27\xdd\x2e\x23\x7e\xcd\x08\x7e\xaa\xaa\xd1\x9e\xa4", + "\x84\x8b\x67\x35\xd3\x2c\x96\xe4\xa0\x53\x2b\xcd\xfa\xf3\x35\x82", 1, 0, 128 }, + { 96, 128, 128, 5, "\xc1\x5e\xd2\x27\xdd\x2e\x23\x7e\xcd\x08\x7e\xaa\xaa\xd1\x9e\xa4", "\x96\x5f\xf6\x64\x31\x16\xac\x14\x43\xa2\xde\xc7", "", "\xfe\xe6\x2f\xde\x97\x3f\xe0\x25\xad\x6b\x32\x2d\xcd\xf3\xc6\x3f" "\xc7", "\x03\x33\xdf\x2a\x86\xd7\xf0\x94\xdd\x8b\xce\x75\xda\x6c\x38\xc5" "\xc1", - "\x41\x7d\xa2\x9d\xf8\x5a\x1d\x13\x4f\xee\xe8\xaa\x35\x56\x90\x81", 1, - 0, 136 }, - { 96, 128, 128, 6, - "\xa8\xee\x11\xb2\x6d\x7c\xeb\x7f\x17\xea\xa1\xe4\xb8\x3a\x2c\xf6", + "\x41\x7d\xa2\x9d\xf8\x5a\x1d\x13\x4f\xee\xe8\xaa\x35\x56\x90\x81", 1, 0, 136 }, + { 96, 128, 128, 6, "\xa8\xee\x11\xb2\x6d\x7c\xeb\x7f\x17\xea\xa1\xe4\xb8\x3a\x2c\xf6", "\xfb\xbc\x04\xfd\x6e\x02\x5b\x71\x93\xeb\x57\xf6", "", "\xc0\x8f\x08\x5e\x6a\x9e\x0e\xf3\x63\x62\x80\xc1\x1e\xcf\xad\xf0\xc1" "\xe7\x29\x19\xff\xc1\x7e\xaf", "\xfc\xaa\xa3\x8f\xed\xa3\xac\xa9\x75\xac\x76\x55\x3c\x3e\x7e\xf3\x6b" "\x88\x7a\x8c\x4d\x82\x41\xf9", - "\xc2\xc6\xdc\xae\xae\xb9\xf3\x8a\x3a\x42\xd2\xf4\xe8\xa1\x7d\xe4", 1, - 0, 192 }, - { 96, 128, 128, 7, - "\x16\x55\xbf\x66\x2f\x7e\xe6\x85\x61\x57\x01\xfd\x37\x79\xd6\x28", + "\xc2\xc6\xdc\xae\xae\xb9\xf3\x8a\x3a\x42\xd2\xf4\xe8\xa1\x7d\xe4", 1, 0, 192 }, + { 96, 128, 128, 7, "\x16\x55\xbf\x66\x2f\x7e\xe6\x85\x61\x57\x01\xfd\x37\x79\xd6\x28", "\x42\xb5\x13\x88\xf6\xf9\x04\x7a\x2a\x99\x45\x75", "", "\x85\x7b\x2f\x6c\xd6\x08\xc9\xce\xa0\x24\x6c\x74\x0c\xaa\x4c\xa1\x9c" "\x5f\x1c\x7d\x71\xcb\x92\x73\xf0\xd8\xc8\xbb\x65\xb7\x0a", "\xb3\xfb\x66\xd3\xf2\xcb\x75\x90\xad\x5e\xf5\x60\x48\x13\xc1\x25\x02" "\x0e\xe3\xd7\x91\xcb\x0e\xc6\x7e\xb5\xeb\x86\x70\x9b\x6b", - "\x15\x55\x77\xb9\x8a\x81\x1e\x45\x32\x46\x16\x04\x39\x97\xbc\x03", 1, - 0, 248 }, - { 96, 128, 128, 8, - "\x3f\xd5\x07\x41\xec\x47\xdd\xbf\xc2\xfc\x09\x09\x75\xd1\x54\xf0", + "\x15\x55\x77\xb9\x8a\x81\x1e\x45\x32\x46\x16\x04\x39\x97\xbc\x03", 1, 0, 248 }, + { 96, 128, 128, 8, "\x3f\xd5\x07\x41\xec\x47\xdd\xbf\xc2\xfc\x09\x09\x75\xd1\x54\xf0", "\xee\xf1\xa6\xe6\x51\x32\x18\x52\xf0\xb2\x5a\x31", "", "\xd6\xf6\xa9\xa2\x4d\xb6\xa7\xa6\x17\x6d\x43\x62\x63\x9c\x4f\xd7\x7f" "\x70\xf3\xe0\x89\xdd\x94\x00\x86\xe1\x2a\x9b\xec\xba\xf9\x7f\x82", "\x53\x26\x94\xbb\x28\x51\xea\x7f\x3b\xdd\x37\xc4\xe8\x06\xbe\x5b\x95" "\x3e\xa7\x9d\x08\x10\x0e\x74\xaf\x3f\xa6\x7e\xca\x88\x90\xdb\x28", - "\x9e\x1a\xce\xe6\x88\x84\x8b\xca\x45\x4c\x6d\x04\x75\x3d\x3c\x7d", 1, - 0, 264 }, - { 96, 128, 128, 9, - "\x42\xe3\x8a\xbe\xf2\xdd\x75\x73\x24\x8c\x5a\xef\xb3\xec\xca\x54", + "\x9e\x1a\xce\xe6\x88\x84\x8b\xca\x45\x4c\x6d\x04\x75\x3d\x3c\x7d", 1, 0, 264 }, + { 96, 128, 128, 9, "\x42\xe3\x8a\xbe\xf2\xdd\x75\x73\x24\x8c\x5a\xef\xb3\xec\xca\x54", "\x06\x4b\x3c\xfb\xe0\x4d\x94\xd4\xd5\xc1\x9b\x30", "", "\x2c\x76\x3b\x9e\xc8\x49\x03\xbc\xbb\x8a\xec\x15\xe6\x78\xa3\xa9\x55" "\xe4\x87\x0e\xdb\xf6\x2d\x9d\x3c\x81\xc4\xf9\xed\x61\x54\x87\x78\x75" @@ -101,164 +82,110 @@ const struct aead_test aes_ccm_test_json[] = { "\xe3\xee\x2e\x5c\x26\x8e\xfb\x34\x6f\xf9\x5b\x7d\xcd\x67\xf8\x6e\xd0" "\xf1\x1b\xb1\x7c\x1d\xd7\xfb\x51\x1d\x2f\x37\xb9\x68\x45\x50\xc0\xd8" "\x4b\xe0\xf1\x00\x30\xcc\xc4\xe0\xde\x5b\x74\xef\x92\xea\x54", - "\xc5\xa5\x7d\xd6\xfa\x16\xaa\x9d\xe8\xde\x20\xe6\xbd\x32\x13\x96", 1, - 0, 528 }, - { 96, 128, 128, 10, - "\x59\xab\x7e\xc1\xc0\x2b\xb2\x06\xaf\x5a\x91\x31\xf1\x13\x43\x11", - "\x55\x08\xf5\xce\xa1\x97\x38\x69\x86\xd9\x2d\xbe", - "\xa4\x3d\x39\xf7\x8a\x2e\x9a\x8a", "", "", - "\x09\xec\x70\xfa\xae\x33\x35\x37\xa7\x31\x49\x29\xdd\xfb\x52\x5b", 1, - 64, 0 }, - { 96, 128, 128, 11, - "\x94\x15\xf9\x25\xbc\xb4\x1d\xc2\x5e\x86\xc8\x26\xdb\xc8\xbf\x68", - "\xbd\xff\xaa\x76\x3b\x91\x6f\xf0\xee\x3f\x3c\xe4", - "\x70\x5d\x67\x6c\xd8\xa9\x44\x51", + "\xc5\xa5\x7d\xd6\xfa\x16\xaa\x9d\xe8\xde\x20\xe6\xbd\x32\x13\x96", 1, 0, 528 }, + { 96, 128, 128, 10, "\x59\xab\x7e\xc1\xc0\x2b\xb2\x06\xaf\x5a\x91\x31\xf1\x13\x43\x11", + "\x55\x08\xf5\xce\xa1\x97\x38\x69\x86\xd9\x2d\xbe", "\xa4\x3d\x39\xf7\x8a\x2e\x9a\x8a", + "", "", "\x09\xec\x70\xfa\xae\x33\x35\x37\xa7\x31\x49\x29\xdd\xfb\x52\x5b", 1, 64, 0 }, + { 96, 128, 128, 11, "\x94\x15\xf9\x25\xbc\xb4\x1d\xc2\x5e\x86\xc8\x26\xdb\xc8\xbf\x68", + "\xbd\xff\xaa\x76\x3b\x91\x6f\xf0\xee\x3f\x3c\xe4", "\x70\x5d\x67\x6c\xd8\xa9\x44\x51", "\xfe\xb3\x61\x67\xea\xfc\x02\xc8\xe2\xbd\x6e\x13\x81\x76\x86\xba", "\x08\xdb\x32\x7a\x88\xbe\x7b\x48\xf4\x30\xfd\x7b\xfc\xcd\xf5\x02", - "\xb7\xc2\x49\xf8\x10\xad\xac\xf9\x9a\xbd\xed\x1f\x3b\x91\x30\xf2", 1, - 64, 128 }, - { 96, 128, 128, 12, - "\xd9\x7c\x9b\x04\x3b\xdc\xcf\xd5\x94\x91\xa9\x95\xe7\x8f\x16\x96", - "\xef\x42\x32\x40\x35\x88\x30\xdf\x91\x55\x06\xa3", - "\x3d\xdb\xa7\xb3\xab\x69\xc8\xb2", + "\xb7\xc2\x49\xf8\x10\xad\xac\xf9\x9a\xbd\xed\x1f\x3b\x91\x30\xf2", 1, 64, 128 }, + { 96, 128, 128, 12, "\xd9\x7c\x9b\x04\x3b\xdc\xcf\xd5\x94\x91\xa9\x95\xe7\x8f\x16\x96", + "\xef\x42\x32\x40\x35\x88\x30\xdf\x91\x55\x06\xa3", "\x3d\xdb\xa7\xb3\xab\x69\xc8\xb2", "\xf0\x47\x59\x4a\x5c\xff\xda\x64\x30\x3a\x80\xb2\xfa\x6a\x95\x71" "\x69", "\xe0\xca\xf2\xa9\xd5\x0f\x70\xec\xaa\x43\xb4\xa2\x87\xc3\xb3\x4a" "\x99", - "\xcf\xf4\xc6\x18\x82\xb4\x13\xb6\x86\xff\x35\xb6\x3a\x3a\x73\xde", 1, - 64, 136 }, - { 96, 128, 128, 13, - "\x16\xbe\x38\xc0\x5c\x7b\xc5\xc6\x8e\xe6\x20\x38\x71\x79\x92\x40", + "\xcf\xf4\xc6\x18\x82\xb4\x13\xb6\x86\xff\x35\xb6\x3a\x3a\x73\xde", 1, 64, 136 }, + { 96, 128, 128, 13, "\x16\xbe\x38\xc0\x5c\x7b\xc5\xc6\x8e\xe6\x20\x38\x71\x79\x92\x40", "\xac\xca\x8a\xe9\x16\x11\x9e\x49\xd8\x7c\x33\xa7", "\x28", "", "", - "\x21\x7d\x40\xef\xd9\x72\x70\x1f\xcc\x33\xdf\x53\x62\xe1\xea\x9c", 1, - 8, 0 }, - { 96, 128, 128, 14, - "\x7c\x89\x68\x0b\x4b\xca\x11\xa6\x43\x14\xf4\xca\xc5\x7a\x95\xdf", - "\x07\xc8\xef\x98\x1b\xea\x99\x52\x57\xd3\xd6\x5a", "\xb8\xe8", "", - "", - "\xde\xa6\x36\xde\xd8\xb9\xef\x2a\x08\xff\xdf\x58\xa0\x5b\x78\x71", 1, - 16, 0 }, - { 96, 128, 128, 15, - "\x43\x9f\xd5\xc3\xb7\x65\x87\xd5\xa6\x01\xba\x6e\xf8\xfa\xd2\x14", - "\xed\x1d\x31\x6d\x08\x34\xd1\x74\xc1\xb5\xb4\x38", - "\xea\xe2\x52\xf4\x2d\x2c\x71", "", "", - "\xe8\x53\x04\x26\xcb\xab\xf6\x36\x33\xff\x37\x31\x59\x24\x7e\x38", 1, - 56, 0 }, - { 96, 128, 128, 16, - "\x1a\x44\xf3\x55\x06\x88\xfd\xdb\xc1\xe5\x04\x1d\xc9\x89\x52\xc0", + "\x21\x7d\x40\xef\xd9\x72\x70\x1f\xcc\x33\xdf\x53\x62\xe1\xea\x9c", 1, 8, 0 }, + { 96, 128, 128, 14, "\x7c\x89\x68\x0b\x4b\xca\x11\xa6\x43\x14\xf4\xca\xc5\x7a\x95\xdf", + "\x07\xc8\xef\x98\x1b\xea\x99\x52\x57\xd3\xd6\x5a", "\xb8\xe8", "", "", + "\xde\xa6\x36\xde\xd8\xb9\xef\x2a\x08\xff\xdf\x58\xa0\x5b\x78\x71", 1, 16, 0 }, + { 96, 128, 128, 15, "\x43\x9f\xd5\xc3\xb7\x65\x87\xd5\xa6\x01\xba\x6e\xf8\xfa\xd2\x14", + "\xed\x1d\x31\x6d\x08\x34\xd1\x74\xc1\xb5\xb4\x38", "\xea\xe2\x52\xf4\x2d\x2c\x71", "", + "", "\xe8\x53\x04\x26\xcb\xab\xf6\x36\x33\xff\x37\x31\x59\x24\x7e\x38", 1, 56, 0 }, + { 96, 128, 128, 16, "\x1a\x44\xf3\x55\x06\x88\xfd\xdb\xc1\xe5\x04\x1d\xc9\x89\x52\xc0", "\x5d\x29\x04\x29\x8f\x66\x8b\xa9\x5e\xaa\x17\x97", - "\xd5\x59\x08\x95\x8b\x70\xab\xee\x81\x05\x4c\xdf\x3d\x3d\xf5", "", - "", - "\x5c\x71\xb4\xf0\x69\xcf\xa1\x3b\x76\x34\xdb\x4b\x13\xe7\xbe\x7d", 1, - 120, 0 }, - { 96, 128, 128, 17, - "\x7d\xb6\xd8\xe5\x8e\x3c\x55\x2a\x64\x45\x20\xaa\x80\x5e\x2f\x48", + "\xd5\x59\x08\x95\x8b\x70\xab\xee\x81\x05\x4c\xdf\x3d\x3d\xf5", "", "", + "\x5c\x71\xb4\xf0\x69\xcf\xa1\x3b\x76\x34\xdb\x4b\x13\xe7\xbe\x7d", 1, 120, 0 }, + { 96, 128, 128, 17, "\x7d\xb6\xd8\xe5\x8e\x3c\x55\x2a\x64\x45\x20\xaa\x80\x5e\x2f\x48", "\xe9\x86\x93\xe9\xf6\x63\x2d\x11\x5b\x5d\x5a\x74", - "\x6f\xc1\xca\x24\xe6\x97\x86\xaa\x26\xbf\xb5\xd4\x6e\xf8\xcb\x56", - "", "", - "\xb9\xa8\xa6\xd4\x61\xa4\x41\xfb\xd5\xbb\x6a\x8a\xc0\xd4\x7e\x9d", 1, - 128, 0 }, - { 96, 128, 128, 18, - "\xde\x6e\xd1\x69\xd3\x96\xcf\xb7\x37\x8e\x89\x2c\x7f\xaf\x1d\x5d", + "\x6f\xc1\xca\x24\xe6\x97\x86\xaa\x26\xbf\xb5\xd4\x6e\xf8\xcb\x56", "", "", + "\xb9\xa8\xa6\xd4\x61\xa4\x41\xfb\xd5\xbb\x6a\x8a\xc0\xd4\x7e\x9d", 1, 128, 0 }, + { 96, 128, 128, 18, "\xde\x6e\xd1\x69\xd3\x96\xcf\xb7\x37\x8e\x89\x2c\x7f\xaf\x1d\x5d", "\xef\xc1\x87\x02\x82\xe7\x7c\xa8\x06\x3f\x1b\xeb", "\xee\xdf\x6e\x77\x6a\xd3\x7d\xc6\x10\x82\x5a\x61\x68\xe2\x13\x56" "\xc2", - "", "", - "\x0d\x65\x0a\x97\x4e\xbe\xa2\x2f\xed\x07\x7d\x22\x9e\x0c\x9e\x65", 1, - 136, 0 }, - { 96, 128, 128, 19, - "\x6c\xf0\x95\x99\x18\x1c\x07\xae\xb2\x1d\x78\x20\xbf\x70\x65\x95", + "", "", "\x0d\x65\x0a\x97\x4e\xbe\xa2\x2f\xed\x07\x7d\x22\x9e\x0c\x9e\x65", 1, 136, 0 }, + { 96, 128, 128, 19, "\x6c\xf0\x95\x99\x18\x1c\x07\xae\xb2\x1d\x78\x20\xbf\x70\x65\x95", "\x4c\x4c\x52\x5a\x8c\x7e\xe6\x87\x9a\xef\xa7\x9e", "\xbd\x91\x39\x67\xdb\x07\xb9\xeb\x59\x07\xf0\xbe\x71\xce\x88\x6c\x41" "\xff\x92\x3c\x29\x6c\x0e\xf3\xf7\x04\xe9\x8f\x64\x9e\x59", - "", "", - "\x80\x6e\x48\xe7\xd4\x52\xb6\x3b\x61\x26\xf5\x76\xef\xbd\xf4\xc4", 1, - 248, 0 }, - { 96, 128, 128, 20, - "\xef\x35\xb5\xc7\x97\xbb\x6b\xee\xdb\x51\x3b\xa3\xd8\xae\xbd\x25", + "", "", "\x80\x6e\x48\xe7\xd4\x52\xb6\x3b\x61\x26\xf5\x76\xef\xbd\xf4\xc4", 1, 248, 0 }, + { 96, 128, 128, 20, "\xef\x35\xb5\xc7\x97\xbb\x6b\xee\xdb\x51\x3b\xa3\xd8\xae\xbd\x25", "\x05\x76\xa1\x01\x7a\xc0\x0e\x49\x11\x0c\x4c\xac", "\xa3\x86\xd5\xc4\x4d\xe8\xc6\xa5\x06\x3a\xdf\x5b\xa9\xf0\xb7\x5e\x9a" "\xd1\xf2\x39\xa5\x30\xdd\x76\xd7\x97\x55\x4d\x7b\x03\x7d\x7d", - "", "", - "\x69\x66\xa1\xcf\x57\x29\x33\x2b\x26\xfd\x3e\x38\x50\xb7\x48\x65", 1, - 256, 0 }, - { 96, 128, 128, 21, - "\x64\x9f\x3d\xfd\xdb\xf1\xaf\x60\x87\x67\x45\x68\xe2\xe6\xd7\xc3", + "", "", "\x69\x66\xa1\xcf\x57\x29\x33\x2b\x26\xfd\x3e\x38\x50\xb7\x48\x65", 1, 256, 0 }, + { 96, 128, 128, 21, "\x64\x9f\x3d\xfd\xdb\xf1\xaf\x60\x87\x67\x45\x68\xe2\xe6\xd7\xc3", "\x6c\xa6\xf8\x7b\x7a\x85\x84\xdf\x4f\x46\x87\xb9", "\x35\x31\x2c\xa2\x3e\x4e\xb3\x6c\xb0\xa6\x6c\x6f\x38\x6b\x8e\xc2\x9f" "\x6d\x11\xe8\x2f\xbf\xca\xad\xfd\x6c\xbc\x9b\x59\xd5\x1a\x6c\x02\x70" "\x86\x82\x74\xd9\x1f\x60\x97\x8d\x1f\x0f\x37\x28\x09\x30\xd3\xfd\xcb" "\x3e\x90\xea\x46\x1e\xcc\xc8\x3f\xa0\xd9\x75\x54\x88\x16", - "", "", - "\x3d\xaa\x00\x03\xde\x38\x4d\x78\x44\x3f\xfd\x3a\x5e\xa4\x81\x79", 1, - 520, 0 }, - { 96, 128, 128, 22, - "\xa5\xb5\xb6\xba\xe4\x5b\x74\x1f\xe4\x66\x38\x90\x09\x8f\x32\x6a", + "", "", "\x3d\xaa\x00\x03\xde\x38\x4d\x78\x44\x3f\xfd\x3a\x5e\xa4\x81\x79", 1, 520, 0 }, + { 96, 128, 128, 22, "\xa5\xb5\xb6\xba\xe4\x5b\x74\x1f\xe4\x66\x38\x90\x09\x8f\x32\x6a", "\x4b\xad\x10\xc6\xd8\x4f\xd4\x3f\xd1\x3a\xd3\x6f", "\x30", "\x12\x7b\x15\x00\x80\xec\x0b\xc7\x70\x4e\x26\xf4\xab\x11\xab\xb6", "\x75\xe6\xff\xcb\x61\x14\x83\x3b\x67\xcd\x93\xbd\xf2\xc2\x2b\x55", - "\xc9\x0e\x18\xea\xf8\x10\xb7\xbc\xef\xe7\xa5\x26\xb1\x78\x3b\x20", 1, - 8, 128 }, - { 96, 128, 128, 23, - "\x0c\xec\xb9\xf5\x12\x93\x2d\x68\xe2\xc7\xc0\xbc\x4b\xd6\x21\xc8", + "\xc9\x0e\x18\xea\xf8\x10\xb7\xbc\xef\xe7\xa5\x26\xb1\x78\x3b\x20", 1, 8, 128 }, + { 96, 128, 128, 23, "\x0c\xec\xb9\xf5\x12\x93\x2d\x68\xe2\xc7\xc0\xbc\x4b\xd6\x21\xc8", "\x21\x86\xa3\x09\x12\x37\xad\xae\x83\x54\x0e\x24", "\x74\x3e", "\x43\x7a\xeb\x94\xd8\x42\x28\x3b\xa5\x7b\xb7\x58\xe3\xd2\x29\xf0", "\x64\x6c\xef\x72\x90\x6e\x2b\x8f\x69\xac\x31\x34\xb4\x96\x59\x8e", - "\x9d\xab\x1e\xe9\x31\x4a\x04\x30\xab\xf5\x4c\x37\xc8\x8c\x79\x0f", 1, - 16, 128 }, - { 96, 128, 128, 24, - "\xa3\xfd\x2f\xdc\xce\x8a\x63\xbf\xe4\xeb\x2d\xb7\xe4\x2a\xdb\xe1", - "\x69\x0e\x7a\xd1\xe0\x5d\x0d\x4a\xb4\x55\x2c\xf7", - "\xab\x91\xec\x8c\xc7\x33\x73", + "\x9d\xab\x1e\xe9\x31\x4a\x04\x30\xab\xf5\x4c\x37\xc8\x8c\x79\x0f", 1, 16, 128 }, + { 96, 128, 128, 24, "\xa3\xfd\x2f\xdc\xce\x8a\x63\xbf\xe4\xeb\x2d\xb7\xe4\x2a\xdb\xe1", + "\x69\x0e\x7a\xd1\xe0\x5d\x0d\x4a\xb4\x55\x2c\xf7", "\xab\x91\xec\x8c\xc7\x33\x73", "\xbe\x02\x31\xb5\xc7\x86\x1f\x0a\xf7\xb6\x38\x14\x79\xd2\x5b\x77", "\xa8\x84\xf7\x69\xfc\xc7\x27\x83\x9d\x59\x71\x1f\xa3\xcb\x5e\xe0", - "\xf2\x01\x7e\x3b\xd1\x0b\xb1\xb4\x3f\xdc\xc0\xfe\xef\xfc\x9c\x68", 1, - 56, 128 }, - { 96, 128, 128, 25, - "\x55\xe0\x4c\x12\x27\x80\xbe\x52\xed\x93\x28\x92\x80\x39\x00\x8c", + "\xf2\x01\x7e\x3b\xd1\x0b\xb1\xb4\x3f\xdc\xc0\xfe\xef\xfc\x9c\x68", 1, 56, 128 }, + { 96, 128, 128, 25, "\x55\xe0\x4c\x12\x27\x80\xbe\x52\xed\x93\x28\x92\x80\x39\x00\x8c", "\x0c\x90\x8e\x58\xcd\xda\xd6\x9d\xea\x1a\x32\xc3", "\x25\x59\x17\x07\xc0\x04\xf5\x06\xf4\xb5\x1e\x85\xe2\x9f\x6a", "\x26\xeb\x70\x67\x2e\xef\x03\x66\x7b\x34\xcc\x7d\x0d\xf0\x58\x72", "\x89\x16\x6d\xcd\x7d\x74\xa4\x45\xdf\xd3\x52\x6c\x51\x80\xd8\x25", - "\x8b\x8e\xd5\xf9\x7a\x16\x88\x81\xc3\xb6\xef\xe9\x1c\xfe\x70\x43", 1, - 120, 128 }, - { 96, 128, 128, 26, - "\x5f\x0a\x1b\x5f\x8f\x86\x73\xd5\x66\xec\x7f\x54\xe7\xdc\xa4\xf2", + "\x8b\x8e\xd5\xf9\x7a\x16\x88\x81\xc3\xb6\xef\xe9\x1c\xfe\x70\x43", 1, 120, 128 }, + { 96, 128, 128, 26, "\x5f\x0a\x1b\x5f\x8f\x86\x73\xd5\x66\xec\x7f\x54\xe7\xdc\xa4\xf2", "\xc3\x09\x68\xc9\x67\xe5\x35\x05\x62\x16\x28\xdb", "\xc0\x70\x92\xd7\x99\xda\xc2\xb4\xc0\x5f\xbd\xdd\x04\x74\x3c\x34", "\xf6\x53\x84\x76\xda\xf0\x45\x24\xcf\x13\x43\x09\xdd\x84\xe1\x87", "\x23\x15\x11\x0f\x7e\xc6\x4e\x7a\x23\xe5\xa7\x62\x82\x2f\x71\xab", - "\xdc\x7b\x12\xfa\x2d\xbf\xbd\xc6\xd8\x5f\xaa\x77\xa2\xeb\x76\x7e", 1, - 128, 128 }, - { 96, 128, 128, 27, - "\x67\x1a\x70\xe8\x83\xfb\x06\x11\xdf\xfd\x0b\x1d\xd9\xb8\xcc\xa2", + "\xdc\x7b\x12\xfa\x2d\xbf\xbd\xc6\xd8\x5f\xaa\x77\xa2\xeb\x76\x7e", 1, 128, 128 }, + { 96, 128, 128, 27, "\x67\x1a\x70\xe8\x83\xfb\x06\x11\xdf\xfd\x0b\x1d\xd9\xb8\xcc\xa2", "\xa5\x1c\x37\xf4\x67\x89\x3c\x16\x08\xe5\x62\x74", "\x3e\xa1\x2d\x80\xf4\x0f\x34\xf8\x12\x47\x9d\x2e\xcc\x13\xd2\xd6" "\xdf", "\x3b\xaf\x3e\xdf\x04\xdc\x0c\x97\xaa\xe0\x81\xcd\xeb\x08\x02\x1d", "\x5d\x56\x30\xfc\x72\x8f\xfb\x08\xce\x69\x3f\x72\x99\xe6\x72\x8b", - "\x00\x02\x3f\x11\xa0\x23\xc0\x78\x6c\x10\x5f\xe4\xc0\x03\xaf\x6e", 1, - 136, 128 }, - { 96, 128, 128, 28, - "\x20\xbb\xf7\x4c\x1e\x63\x98\x2c\x47\x2c\x47\x43\x56\x9e\x4c\x84", + "\x00\x02\x3f\x11\xa0\x23\xc0\x78\x6c\x10\x5f\xe4\xc0\x03\xaf\x6e", 1, 136, 128 }, + { 96, 128, 128, 28, "\x20\xbb\xf7\x4c\x1e\x63\x98\x2c\x47\x2c\x47\x43\x56\x9e\x4c\x84", "\x45\x9f\xc7\xc0\x04\xbf\x46\x32\x3a\x02\xd8\x46", "\x4f\x22\x85\xce\x3d\xaf\xa5\x28\xc6\x94\xa5\x27\x2d\x3b\x7b\x92\x90" "\x97\xdb\x39\x87\x72\x65\x3b\xd9\xbb\xbd\xb3\xb2\xc8\xe1", "\x6d\xb5\x09\x92\xe8\xfb\xbe\xe1\x5d\x49\x79\xd3\xe3\x22\xda\xcd", "\x87\x03\xe4\x46\x97\x13\x8c\x58\x53\x2d\x97\xee\x99\x23\x1d\x94", - "\xf1\x4c\x2f\x39\xa4\x87\x1a\x4a\x16\xc4\x2f\x6f\xe8\x78\xde\xef", 1, - 248, 128 }, - { 96, 128, 128, 29, - "\x63\xf0\x31\x72\x50\x5d\x90\xe9\x49\x00\x12\x5c\xb8\xa4\xb0\xdd", + "\xf1\x4c\x2f\x39\xa4\x87\x1a\x4a\x16\xc4\x2f\x6f\xe8\x78\xde\xef", 1, 248, 128 }, + { 96, 128, 128, 29, "\x63\xf0\x31\x72\x50\x5d\x90\xe9\x49\x00\x12\x5c\xb8\xa4\xb0\xdd", "\x52\xc2\x09\x79\xcd\xaa\xad\xe5\x73\xdb\xa6\x50", "\x51\x89\xea\x6f\x39\xb2\xa7\x8c\x02\x02\xfd\xff\x14\x6c\x5c\xc6\xbd" "\xc7\x49\x1d\x47\x86\xf8\x0c\x6c\x6a\xef\x65\x63\x4c\x05\xda", "\x60\x2c\x98\x99\x7e\xe0\x3f\xd1\x1c\xe0\x0e\x92\xde\x19\x39\x77", "\x55\x90\x15\x5f\x3e\x70\x1b\x4a\x96\x09\x89\xd0\x25\x1b\xac\x65", - "\xfd\x6a\x2c\x92\x73\xd1\x24\xb5\x55\x3b\xe4\x2e\x78\x93\x14\x65", 1, - 256, 128 }, - { 96, 128, 128, 30, - "\x5b\xf0\x08\xf6\xf2\x7c\xc2\x1f\x5a\xe8\x2f\xb7\x90\x7b\x1d\x92", + "\xfd\x6a\x2c\x92\x73\xd1\x24\xb5\x55\x3b\xe4\x2e\x78\x93\x14\x65", 1, 256, 128 }, + { 96, 128, 128, 30, "\x5b\xf0\x08\xf6\xf2\x7c\xc2\x1f\x5a\xe8\x2f\xb7\x90\x7b\x1d\x92", "\x58\x0a\xf4\x8b\xc1\x10\x86\x04\xd5\x55\x13\x43", "\x48\x2d\xa2\x4b\xb4\xfb\x9e\xaa\x0d\xbf\x40\x37\x33\x59\x7f\x5b\x3e" "\xe8\x33\x8b\x5d\x09\xa1\xd6\xf9\x07\x0b\xb0\x69\x26\x4a\xbb\xca\xcc" @@ -266,291 +193,213 @@ const struct aead_test aes_ccm_test_json[] = { "\x08\xe0\xda\x25\x8c\xbd\xb3\x9e\x98\x77\xc6\x8b\x4a\x75", "\xca\x89\xd6\xae\x28\x4a\xfb\x67\x92\xcd\x89\x4e\x07\xaa\x83\x36", "\x1b\x89\xc6\xbc\xdd\xef\xbe\x92\x33\xee\x40\x93\x46\x8a\x5f\x61", - "\xa4\x9c\x77\x47\xda\xd4\x2d\xf6\xd7\x29\xa0\x1f\x4c\x50\xcf\x34", 1, - 520, 128 }, - { 96, 128, 128, 31, - "\x30\xd8\x69\x2e\xb3\xb6\x2d\xb6\x14\x4f\x74\xee\x9d\xec\x52\x96", + "\xa4\x9c\x77\x47\xda\xd4\x2d\xf6\xd7\x29\xa0\x1f\x4c\x50\xcf\x34", 1, 520, 128 }, + { 96, 128, 128, 31, "\x30\xd8\x69\x2e\xb3\xb6\x2d\xb6\x14\x4f\x74\xee\x9d\xec\x52\x96", "\xfe\x9f\x6f\xb4\x41\x5c\xfb\x41\x89\xf9\xc7\x6d", "", "", "", - "\x80\x4f\x91\x5f\xc7\xfe\xa2\xca\x7d\x8b\xaf\x13\x50\xc5\x22\x7b", 1, - 0, 0 }, - { 96, 128, 128, 32, - "\x21\x51\x7f\xd9\xeb\xfd\x38\x7d\xff\x2a\x0c\x05\x18\xab\x82\x67", + "\x80\x4f\x91\x5f\xc7\xfe\xa2\xca\x7d\x8b\xaf\x13\x50\xc5\x22\x7b", 1, 0, 0 }, + { 96, 128, 128, 32, "\x21\x51\x7f\xd9\xeb\xfd\x38\x7d\xff\x2a\x0c\x05\x18\xab\x82\x67", "\x61\xf6\xc4\xec\x9e\x20\x91\xd4\xa0\x31\x80\x4a", - "\x76\xd3\x32\xba\x08\x1b\x3d\x3c\xfb\xa2\x71\x16\x7b\xa1\x08\xcd", - "", "", - "\x2c\xc4\xb9\x05\xa4\xd3\x9e\x35\xd4\xbe\xae\xbd\xed\x9b\x59\x66", 1, - 128, 0 }, - { 96, 128, 128, 33, - "\xa7\x16\xf9\x31\xc8\xf9\xd9\x77\xf7\xda\x85\x73\xbc\x65\xf2\xbf", + "\x76\xd3\x32\xba\x08\x1b\x3d\x3c\xfb\xa2\x71\x16\x7b\xa1\x08\xcd", "", "", + "\x2c\xc4\xb9\x05\xa4\xd3\x9e\x35\xd4\xbe\xae\xbd\xed\x9b\x59\x66", 1, 128, 0 }, + { 96, 128, 128, 33, "\xa7\x16\xf9\x31\xc8\xf9\xd9\x77\xf7\xda\x85\x73\xbc\x65\xf2\xbf", "\x91\x77\x36\x59\xad\xac\x8f\x12\xe5\x52\x63\x16", "", "\x9c\x98\x03\x8c\x5e\x8d\x1a\xf5\x97\xb3\xb9\x18\x8b\x36\x24\xfb", "\x99\xae\x76\xcf\xff\x55\x2c\xe3\x7b\x21\x0e\x26\xe8\x10\x78\x7c", - "\x2b\xda\xb5\xe6\xf0\x08\xb0\xcc\x75\x1d\x5b\x06\x74\x87\xeb\x2b", 1, - 0, 128 }, - { 96, 128, 128, 34, - "\x87\x5b\x0b\x4a\x84\x15\x05\x24\xeb\x1f\x50\xf9\xd8\xde\x13\x88", + "\x2b\xda\xb5\xe6\xf0\x08\xb0\xcc\x75\x1d\x5b\x06\x74\x87\xeb\x2b", 1, 0, 128 }, + { 96, 128, 128, 34, "\x87\x5b\x0b\x4a\x84\x15\x05\x24\xeb\x1f\x50\xf9\xd8\xde\x13\x88", "\xfd\xc5\x01\x4e\xd1\xad\x70\x61\x29\xd5\x73\x22", "\x35\xa6\xd9\x82\x9c\x84\x49\xc4\x40\x2e\x38\x5c\xc5\xc6\xfe\x98", "\x2f\x57\x5d\xfb\x2d\xbe\x9d\x23\x8d\xe5\x76\xfc\x63\xe4\xac\x32", "\x34\x69\xc3\xff\x73\x8a\xa3\x2a\xac\xc1\xac\x48\xd8\x9b\x1d\x75", - "\xfa\x68\x72\x0a\x31\x71\xa5\x4c\x4b\x36\x90\xbf\xfd\xe7\xb6\x10", 1, - 128, 128 }, - { 96, 128, 128, 35, - "\xd6\x29\x8f\xff\x67\xdb\xa1\xec\x25\x03\x08\xe0\xbc\x5f\x4f\xae", + "\xfa\x68\x72\x0a\x31\x71\xa5\x4c\x4b\x36\x90\xbf\xfd\xe7\xb6\x10", 1, 128, 128 }, + { 96, 128, 128, 35, "\xd6\x29\x8f\xff\x67\xdb\xa1\xec\x25\x03\x08\xe0\xbc\x5f\x4f\xae", "\xd9\x6f\x9b\xbb\xfa\x14\xe9\x61\x6c\x45\x8d\xf5", "", "\x8e\xeb\x44\x45\xa3\x4c\x81\xfd\xbc\x47\x8b\x83\xdf\x71\x11\x6c" "\xe6", "\x47\x68\x69\xa3\xdd\xb3\x86\xbf\x42\x47\x8d\x0c\x84\x17\x90\x45" "\xbe", - "\x91\x36\xd9\x94\xda\xa2\x2e\xad\x4d\x08\x27\xe5\x82\x50\x01\xac", 1, - 0, 136 }, - { 96, 128, 128, 36, - "\xe3\xd3\xec\x41\xf2\x8e\xb3\x5f\xb5\x3f\x5f\xa9\x18\x04\xe0\x51", + "\x91\x36\xd9\x94\xda\xa2\x2e\xad\x4d\x08\x27\xe5\x82\x50\x01\xac", 1, 0, 136 }, + { 96, 128, 128, 36, "\xe3\xd3\xec\x41\xf2\x8e\xb3\x5f\xb5\x3f\x5f\xa9\x18\x04\xe0\x51", "\x89\xd2\x70\xfc\x8b\x58\x3b\xc6\x31\xce\xfd\x39", "\x3d\x2f\x45\x8c\x67\xc5\xb6\xc7\x94\xb1\xf1\x2d\xad\x40\x9e\x0f", "\x84\x7a\xcf\x52\x19\x95\xb3\x3f\x8b\xc4\x74\xc8\xbe\xfb\xca\x3b" "\xb2", "\x28\xaa\xec\x53\x49\x3c\xd6\x25\x2c\xf6\x41\x0e\xd1\x41\xbd\xaf" "\xb7", - "\x47\xbf\x3e\x16\xc2\x27\xca\x11\xfd\x68\xa1\x6d\x40\x7c\x2c\xc3", 1, - 128, 136 }, - { 96, 128, 128, 37, - "\xfa\xf3\x6a\x66\xf8\xe5\x4f\x2f\xb2\xa0\x2f\x3a\x30\xf0\x18\x0b", + "\x47\xbf\x3e\x16\xc2\x27\xca\x11\xfd\x68\xa1\x6d\x40\x7c\x2c\xc3", 1, 128, 136 }, + { 96, 128, 128, 37, "\xfa\xf3\x6a\x66\xf8\xe5\x4f\x2f\xb2\xa0\x2f\x3a\x30\xf0\x18\x0b", "\x2f\xfa\x98\x2a\x47\x84\x79\x7c\xf4\x6b\x07\xab", "", "\x50\xa5\x9e\xdc\x01\xb7\xbd\x0d\xb6\xec\x43\xfe\x23\xf7\x2e\x70\xed" "\x4d\x42\x33\x7a\xb1\x92\x6c\xc6\x95\x6a\xa4\x4d\xbe\xbf", "\xa7\x89\x90\x7a\xeb\x23\x44\xf0\x25\xb1\xb4\x26\xc9\xde\xe5\x2b\x10" "\x6f\xf2\x11\x0c\xb2\x00\xcf\xb8\x5a\xea\x60\xfd\xdf\x6a", - "\x72\x2e\x5c\x45\x0c\x5e\xd9\x49\x28\x59\xa3\x23\x6a\x22\x0f\x76", 1, - 0, 248 }, - { 96, 128, 128, 38, - "\x2c\x9b\x9f\xf4\x7d\x74\x2c\x4a\xb2\x24\xe9\xca\x1e\xd5\x7c\x4c", + "\x72\x2e\x5c\x45\x0c\x5e\xd9\x49\x28\x59\xa3\x23\x6a\x22\x0f\x76", 1, 0, 248 }, + { 96, 128, 128, 38, "\x2c\x9b\x9f\xf4\x7d\x74\x2c\x4a\xb2\x24\xe9\xca\x1e\xd5\x7c\x4c", "\x91\x79\x62\xca\xf3\x93\x24\x41\xc2\x59\x28\x2f", "\x72\x17\x5b\xdf\xdb\x4a\x23\xe9\x7f\xdc\xbd\x26\x3b\xaf\x43\x16", "\xb5\x42\xc2\xf3\xf8\x16\x70\xdd\xf7\x4f\x15\x18\x4a\xb7\xde\x17\xe0" "\x57\xcd\xe9\xee\xf9\x2b\xab\xdb\x83\x75\x00\x77\x4c\x19", "\x32\x0a\xe0\xc1\x1e\x92\xd1\x0d\x5b\xf5\x48\x5c\x85\x4b\x2d\x8f\x63" "\x18\xe3\x3f\x16\xb5\x20\xcf\xfd\x35\xad\xa3\x81\xc9\x67", - "\xa4\x86\x69\x08\xe6\x64\xee\x14\x0c\x6a\xe2\xb9\xd2\xab\x84\x16", 1, - 128, 248 }, - { 96, 128, 128, 39, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xa4\x86\x69\x08\xe6\x64\xee\x14\x0c\x6a\xe2\xb9\xd2\xab\x84\x16", 1, 128, 248 }, + { 96, 128, 128, 39, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3d\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 40, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3d\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 40, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3e\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 41, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3e\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 41, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\xbc\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 42, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xbc\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 42, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6c\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 43, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6c\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 43, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\xe6\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 44, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\xe6\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 44, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x42\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 45, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x42\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 45, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x41\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 46, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x41\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 46, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\xdb\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 47, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\xdb\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 47, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb1\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 48, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb1\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 48, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\x30\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 49, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\x30\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 49, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x14\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 50, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x14\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 50, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x06\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 51, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x06\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 51, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x96\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 52, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x96\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 52, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x95\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 53, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x95\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 53, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x17\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 54, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x17\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 54, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9b", 0, - 0, 128 }, - { 96, 128, 128, 55, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x9b", 0, 0, 128 }, + { 96, 128, 128, 55, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x98", 0, - 0, 128 }, - { 96, 128, 128, 56, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x98", 0, 0, 128 }, + { 96, 128, 128, 56, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\xda", 0, - 0, 128 }, - { 96, 128, 128, 57, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\xda", 0, 0, 128 }, + { 96, 128, 128, 57, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x1a", 0, - 0, 128 }, - { 96, 128, 128, 58, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\x5b\xb0\x34\x07\x72\x97\xf0\x92\x1a", 0, 0, 128 }, + { 96, 128, 128, 58, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3d\x6d\x5f\x66\x43\x0a\xd6\x5b\xb1\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 59, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3d\x6d\x5f\x66\x43\x0a\xd6\x5b\xb1\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 59, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\xe6\x43\x0a\xd6\xdb\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, - 0, 128 }, - { 96, 128, 128, 60, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\xe6\x43\x0a\xd6\xdb\xb0\x34\x07\x72\x97\xf0\x92\x9a", 0, 0, 128 }, + { 96, 128, 128, 60, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3c\x6d\x5f\x66\x43\x0a\xd6\xdb\xb0\x34\x07\x72\x97\xf0\x92\x1a", 0, - 0, 128 }, - { 96, 128, 128, 61, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x3c\x6d\x5f\x66\x43\x0a\xd6\xdb\xb0\x34\x07\x72\x97\xf0\x92\x1a", 0, 0, 128 }, + { 96, 128, 128, 61, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\xc3\x92\xa0\x99\xbc\xf5\x29\xa4\x4f\xcb\xf8\x8d\x68\x0f\x6d\x65", 0, - 0, 128 }, - { 96, 128, 128, 62, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xc3\x92\xa0\x99\xbc\xf5\x29\xa4\x4f\xcb\xf8\x8d\x68\x0f\x6d\x65", 0, 0, 128 }, + { 96, 128, 128, 62, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, 128 }, - { 96, 128, 128, 63, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, 128 }, + { 96, 128, 128, 63, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, 128 }, - { 96, 128, 128, 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, 128 }, + { 96, 128, 128, 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\xbc\xed\xdf\xe6\xc3\x8a\x56\xdb\x30\xb4\x87\xf2\x17\x70\x12\x1a", 0, - 0, 128 }, - { 96, 128, 128, 65, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xbc\xed\xdf\xe6\xc3\x8a\x56\xdb\x30\xb4\x87\xf2\x17\x70\x12\x1a", 0, 0, 128 }, + { 96, 128, 128, 65, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3e\xe9\xf3\x43\x0f\x3e\x80\x3c\x0a\x46\xb7\xa8\x4c\xd8\x03\xde", - "\x3d\x6c\x5e\x67\x42\x0b\xd7\x5a\xb1\x35\x06\x73\x96\xf1\x93\x9b", 0, - 0, 128 }, + "\x3d\x6c\x5e\x67\x42\x0b\xd7\x5a\xb1\x35\x06\x73\x96\xf1\x93\x9b", 0, 0, 128 }, { 96, 192, 128, 66, "\x50\x19\xeb\x9f\xef\x82\xe5\x75\x0b\x63\x17\x58\xf0\x21\x3e\x3e\x5f" "\xcc\xa1\x27\x48\xb4\x0e\xb4", "\xff\x0d\xdb\x0a\x0d\x7b\x36\xd2\x19\xda\x12\xb5", "", "", "", - "\x2d\x03\xf5\xe8\xc2\xe5\xa1\xb4\x3c\x77\x08\xdd\x0c\xbf\x0a\xcd", 1, - 0, 0 }, + "\x2d\x03\xf5\xe8\xc2\xe5\xa1\xb4\x3c\x77\x08\xdd\x0c\xbf\x0a\xcd", 1, 0, 0 }, { 96, 192, 128, 67, "\x21\x21\x8a\xf7\x90\x42\x8f\x80\x24\xd3\xe7\xe1\x42\x8c\x9f\xcf\x57" "\x8c\x21\x66\x36\xd6\x0e\x73", - "\x34\x04\x7b\xc3\x9b\x9c\x60\x83\x84\xdf\xf5\xb8", "", "\xe3", - "\x39", - "\x74\x50\xf5\x5a\x21\xe7\x17\xa1\x10\x6e\xa0\xc1\x18\x71\xf5\xff", 1, - 0, 8 }, + "\x34\x04\x7b\xc3\x9b\x9c\x60\x83\x84\xdf\xf5\xb8", "", "\xe3", "\x39", + "\x74\x50\xf5\x5a\x21\xe7\x17\xa1\x10\x6e\xa0\xc1\x18\x71\xf5\xff", 1, 0, 8 }, { 96, 192, 128, 68, "\x3a\x8b\xf5\x43\xc4\x80\x92\x56\x32\x11\x82\x45\xbc\xbf\x5d\x01\x52" "\x2b\x98\x7a\x31\xa3\x3d\xa3", "\x4e\xbc\x13\xcf\x46\x36\xcc\x7c\x45\xe5\x60\xa7", "", - "\x53\xfc\x72\xe7\x1b\x59\xee\xb3", - "\x5d\x24\xd0\xe1\xa2\xee\x9f\xce", - "\xe7\x70\xf9\x1a\x51\xf5\xb5\x87\xa4\x4c\xd9\xd3\x63\x4b\x97\x06", 1, - 0, 64 }, + "\x53\xfc\x72\xe7\x1b\x59\xee\xb3", "\x5d\x24\xd0\xe1\xa2\xee\x9f\xce", + "\xe7\x70\xf9\x1a\x51\xf5\xb5\x87\xa4\x4c\xd9\xd3\x63\x4b\x97\x06", 1, 0, 64 }, { 96, 192, 128, 69, "\xbc\xb6\xbc\x5e\xe6\x74\x3d\xf1\x39\x6a\x34\x63\x93\x27\xb2\x58\x09" "\xec\x9c\x81\xdd\x6a\x0c\x0e", "\xbe\x03\x26\xd2\x3b\xdc\x2c\x64\x64\x8d\x13\xf4", "", "\x80\x47\x4a\x3a\x3b\x80\x95\x60\xee\xe2\xce\x7a\x7a\x33\xea\x07", "\xdb\x58\x93\xdc\x8d\xa3\x36\x61\x4a\xa0\xff\x76\x8d\x46\x95\x35", - "\x90\x2c\x2a\x83\x25\xcb\x55\xbc\x95\xf0\xe1\x3c\xaf\xe9\xaa\x8d", 1, - 0, 128 }, + "\x90\x2c\x2a\x83\x25\xcb\x55\xbc\x95\xf0\xe1\x3c\xaf\xe9\xaa\x8d", 1, 0, 128 }, { 96, 192, 128, 70, "\x5e\x1d\x28\x21\x3e\x09\x25\x36\x52\x5b\xba\xe0\x9e\x21\x4a\xf4\xc8" "\x91\xe2\x02\xb2\xb4\xfa\x4f", @@ -559,8 +408,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x65", "\x20\xeb\xc1\xf5\xa2\xc9\xf8\x8d\x1c\xdb\x18\x2e\x81\x32\x9c\xc0" "\x3e", - "\xbc\x54\x5e\x91\xc9\x74\xa7\x44\xba\xea\xb2\xdd\x8c\xe6\x09\x60", 1, - 0, 136 }, + "\xbc\x54\x5e\x91\xc9\x74\xa7\x44\xba\xea\xb2\xdd\x8c\xe6\x09\x60", 1, 0, 136 }, { 96, 192, 128, 71, "\x7f\x67\x2d\x85\xe1\x51\xaa\x49\x0b\xc0\xee\xc8\xf6\x6b\x5e\x5b\xee" "\x74\xaf\x11\x64\x2b\xe3\xff", @@ -569,8 +417,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x11\xc1\x1a\x84\x06\x5f\x80", "\x1b\xc9\x90\x29\xa0\x9c\x08\x01\x40\x60\x8a\x62\xc3\x3b\xc7\xae\x69" "\xff\x81\x1f\xef\xb2\x0b\x2d", - "\x80\xf0\x91\x03\x48\x5f\x95\xf8\x6a\xd1\xf0\x72\xa2\x14\xc5\x5e", 1, - 0, 192 }, + "\x80\xf0\x91\x03\x48\x5f\x95\xf8\x6a\xd1\xf0\x72\xa2\x14\xc5\x5e", 1, 0, 192 }, { 96, 192, 128, 72, "\xf7\xac\xe6\xc3\xc1\x0c\x3f\xf9\x77\xfe\xbe\x7d\xc8\x82\xb8\xe7\x79" "\xef\x3a\x17\xef\x93\x24\xa8", @@ -579,8 +426,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xc0\x5e\x04\x78\xf9\x9d\x5b\x62\xe7\x99\xf7\x32\xe4\x67", "\xb3\xce\xc7\x77\xf8\x07\xd1\x6b\x69\x71\x63\xd0\xc6\xa4\x5d\x00\x29" "\x36\x71\x4d\x60\x0a\x15\x6d\x7e\x53\x65\xd1\xaa\xca\xd0", - "\x11\xa5\x6e\xdb\xe2\xfb\xbb\xb2\xb0\x11\xc4\x3a\x62\x00\x08\x30", 1, - 0, 248 }, + "\x11\xa5\x6e\xdb\xe2\xfb\xbb\xb2\xb0\x11\xc4\x3a\x62\x00\x08\x30", 1, 0, 248 }, { 96, 192, 128, 73, "\xa9\x54\x1a\x96\xb8\x6d\x32\xb4\x52\x09\x2e\x8b\x92\x09\x9e\xa3\xf4" "\x5f\x98\xca\x05\xce\x69\x2b", @@ -589,8 +435,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xd6\xc5\xe0\x1d\xce\xb1\x96\x9f\x40\xc8\xe0\xdb\x6b\xb9\x02\x81", "\x0a\x6b\x84\xde\x44\xcc\xe1\x42\x55\xa9\xcb\x19\x16\x96\x95\xcf\x46" "\x60\x48\x9f\x1e\x3f\x60\x53\x34\x35\x58\x28\xc5\xc0\x9f\xb3\x0e", - "\xa1\x9a\x60\x10\x5f\xc7\xa0\x3b\xe1\x78\x3f\x55\x8e\xa2\x3e\x9c", 1, - 0, 264 }, + "\xa1\x9a\x60\x10\x5f\xc7\xa0\x3b\xe1\x78\x3f\x55\x8e\xa2\x3e\x9c", 1, 0, 264 }, { 96, 192, 128, 74, "\x23\x91\x95\xb5\x86\x68\xeb\x89\x63\x6b\x1e\xc2\xb3\x31\x33\x69\x46" "\x36\x9f\xc6\xc8\x7b\x88\x49", @@ -603,98 +448,76 @@ const struct aead_test aes_ccm_test_json[] = { "\x39\x3e\xa3\xbc\x1b\x4f\x8e\xa4\xaa\xd5\x97\x14\x7a\x7c\xa9\x4e\x26" "\x09\xfe\x6b\xf0\xab\x86\x1e\x06\x31\xa3\x12\x4e\xb1\x5d\x0d\xe2\x65" "\xef\x11\xa3\x3e\x45\x07\xe3\x07\x70\xce\x37\xbb\xb4\xb6\xc3", - "\xa4\x45\x68\x28\xb4\x9c\xdb\xf8\xf3\xc2\x00\x42\x9c\x33\x9a\x89", 1, - 0, 528 }, + "\xa4\x45\x68\x28\xb4\x9c\xdb\xf8\xf3\xc2\x00\x42\x9c\x33\x9a\x89", 1, 0, 528 }, { 96, 192, 128, 75, "\x03\xb4\x67\x58\x51\xb7\x8b\x69\xfb\x7b\x55\x89\x88\x2e\x71\x8b\x07" "\x5e\x9a\x54\x02\xb5\x20\xfb", - "\xc4\xca\x2d\x67\x8e\x51\x74\x2e\xc5\xe5\x60\xab", - "\x91\xe1\x0a\xc5\x63\x6f\xe9\x9b", "", "", - "\x93\x7f\x15\xff\xd1\xcc\xd6\x45\xd9\xc7\xcd\xd6\x67\x73\x11\xcd", 1, - 64, 0 }, + "\xc4\xca\x2d\x67\x8e\x51\x74\x2e\xc5\xe5\x60\xab", "\x91\xe1\x0a\xc5\x63\x6f\xe9\x9b", + "", "", "\x93\x7f\x15\xff\xd1\xcc\xd6\x45\xd9\xc7\xcd\xd6\x67\x73\x11\xcd", 1, 64, 0 }, { 96, 192, 128, 76, "\x40\x0e\xec\x9b\x06\xa8\x0a\x84\x03\xd4\x5d\xae\x5d\x58\xcc\x91\x7b" "\xc8\x54\xf5\x1c\xd3\xce\x0d", - "\x44\x7d\xd0\x9a\x23\x70\x8f\x3b\x66\x64\xe1\x5b", - "\x73\x20\x36\x7d\x5b\x07\x05\x59", + "\x44\x7d\xd0\x9a\x23\x70\x8f\x3b\x66\x64\xe1\x5b", "\x73\x20\x36\x7d\x5b\x07\x05\x59", "\xb7\x84\x92\x5a\x69\x5f\x0e\xd1\x4c\xa4\x02\x49\xc1\xfd\x5d\x1a", "\x91\x2d\x05\xc4\x02\x38\x39\x50\xe1\xc5\xa5\x18\x8e\x62\x41\xd8", - "\xab\x30\x9b\xe2\xc0\x5c\x94\x1f\xbf\xb3\x38\xba\x06\x4b\x19\xa1", 1, - 64, 128 }, + "\xab\x30\x9b\xe2\xc0\x5c\x94\x1f\xbf\xb3\x38\xba\x06\x4b\x19\xa1", 1, 64, 128 }, { 96, 192, 128, 77, "\xe2\x58\xb1\x17\xc2\xfd\xd7\x55\x87\xf0\x7b\x40\x0a\xe4\xaf\x3e\x67" "\x3a\x51\xdc\xf7\x61\xe4\xca", - "\x5e\xad\x03\xaa\x8c\x72\x0d\x21\xb7\x70\x75\xdb", - "\x27\x70\x29\x50\x96\x0b\x9c\x79", + "\x5e\xad\x03\xaa\x8c\x72\x0d\x21\xb7\x70\x75\xdb", "\x27\x70\x29\x50\x96\x0b\x9c\x79", "\xaf\xe9\x61\x13\xa6\x84\xbc\x52\xa6\xd9\x62\xcf\x27\x24\xf6\x79" "\x1d", "\x78\x30\x44\x6f\x33\x30\x57\xd9\x96\xa1\xa7\x9b\x21\xc6\x8d\x8b" "\x43", - "\x72\xac\x47\x8a\x66\xf5\x63\x75\x63\xf1\xf1\x2c\x1d\x02\x67\xca", 1, - 64, 136 }, + "\x72\xac\x47\x8a\x66\xf5\x63\x75\x63\xf1\xf1\x2c\x1d\x02\x67\xca", 1, 64, 136 }, { 96, 192, 128, 78, "\x6c\x2a\x03\xe9\xed\x8e\x42\x1e\x07\xdf\xc3\x6b\x99\xc0\xd0\xdc\x9b" "\xb8\x74\xea\x3a\xf8\xa8\xb7", "\x8f\x01\x5e\xce\x4e\x03\x38\xe7\x82\xfa\x3a\x2f", "\xf1", "", "", - "\x92\x26\xc4\xc3\x91\x66\xdf\x5a\xf4\xe0\xc9\x1b\x64\xb4\x63\xa2", 1, - 8, 0 }, + "\x92\x26\xc4\xc3\x91\x66\xdf\x5a\xf4\xe0\xc9\x1b\x64\xb4\x63\xa2", 1, 8, 0 }, { 96, 192, 128, 79, "\x14\x86\xb5\xf1\x50\x52\x4c\xc6\x01\xb2\xea\x7d\xa4\x7d\x7c\x8a\xfb" "\x06\xd6\x42\x0d\xd3\x3f\x8d", - "\x93\x07\x31\x7d\x2f\x42\x3b\x57\xb3\x72\x0f\x8f", "\x3c\x09", "", - "", - "\x36\x00\xe0\x6d\xef\x58\x5e\x20\x12\x35\x0e\xfe\x04\x78\x26\xe9", 1, - 16, 0 }, + "\x93\x07\x31\x7d\x2f\x42\x3b\x57\xb3\x72\x0f\x8f", "\x3c\x09", "", "", + "\x36\x00\xe0\x6d\xef\x58\x5e\x20\x12\x35\x0e\xfe\x04\x78\x26\xe9", 1, 16, 0 }, { 96, 192, 128, 80, "\xe0\x9c\x83\xff\x0f\xc0\xb6\xa3\x0f\x93\x8e\x50\xe2\x66\x85\x24\x7e" "\x9d\xed\x2e\x7d\x6d\xbc\x7c", - "\x3e\xc6\x1e\x9c\x16\x6d\x67\x83\x99\x23\x91\x52", - "\xc1\xa1\x3c\x74\xc1\x1c\xb8", "", "", - "\x9f\x5b\x3e\x48\xdd\xda\x9a\xf3\x75\x15\x01\x50\x9c\x94\x0a\xc1", 1, - 56, 0 }, + "\x3e\xc6\x1e\x9c\x16\x6d\x67\x83\x99\x23\x91\x52", "\xc1\xa1\x3c\x74\xc1\x1c\xb8", "", + "", "\x9f\x5b\x3e\x48\xdd\xda\x9a\xf3\x75\x15\x01\x50\x9c\x94\x0a\xc1", 1, 56, 0 }, { 96, 192, 128, 81, "\xd0\xc6\x88\xc5\x25\x80\xd8\xf8\x00\xac\xa3\x4f\xa7\x4c\xec\x48\x7b" "\x67\x1a\xaf\x85\x02\x7b\x9b", "\x9c\x46\x0a\xbf\x56\x29\x2d\xcb\x1b\x35\xb3\xb4", - "\x35\x96\xce\x98\x9f\xf9\x75\xf3\x25\x0e\x6c\x9e\xce\xd2\x5b", "", - "", - "\xcd\xa4\x34\xc2\x29\xe5\x4b\xf9\xbf\xd5\x4c\x8d\x8c\xe4\x73\x0c", 1, - 120, 0 }, + "\x35\x96\xce\x98\x9f\xf9\x75\xf3\x25\x0e\x6c\x9e\xce\xd2\x5b", "", "", + "\xcd\xa4\x34\xc2\x29\xe5\x4b\xf9\xbf\xd5\x4c\x8d\x8c\xe4\x73\x0c", 1, 120, 0 }, { 96, 192, 128, 82, "\x18\x92\xdb\xd7\xe6\xb3\xfe\x18\xeb\xdc\x81\xbb\x27\x1a\xb0\x3a\x8f" "\x32\xaf\x04\xf1\x33\x00\xd2", "\x0e\x87\x2d\xe5\x8a\xd1\x0d\xa2\x48\x40\x3f\x21", - "\xe8\xb1\xc6\xcc\x6c\x45\x10\x5e\x0c\x32\x58\x7a\x0d\xe3\x69\xe3", - "", "", - "\x0c\x7e\x14\xdc\x49\xa8\x1e\x6b\xe1\x23\xb9\xcf\xbb\x28\x17\x87", 1, - 128, 0 }, + "\xe8\xb1\xc6\xcc\x6c\x45\x10\x5e\x0c\x32\x58\x7a\x0d\xe3\x69\xe3", "", "", + "\x0c\x7e\x14\xdc\x49\xa8\x1e\x6b\xe1\x23\xb9\xcf\xbb\x28\x17\x87", 1, 128, 0 }, { 96, 192, 128, 83, "\xef\x79\x92\xb0\xf8\xec\x7a\x10\x1d\x34\x00\x01\x00\xeb\x7d\x9b\x2e" "\xae\xe3\x33\xd0\xaa\x2f\xf8", "\x31\x6d\x38\xa9\x00\x19\xb9\xa3\x7a\xd0\x80\xb7", "\x10\x14\xed\x78\x89\x69\x4c\xff\x76\x78\x76\xc0\x69\xae\x1f\x91" "\x85", - "", "", - "\x17\xff\x8e\x79\x97\x60\x55\x8f\x1d\x4c\xf8\x92\x7d\x5e\xc6\x99", 1, - 136, 0 }, + "", "", "\x17\xff\x8e\x79\x97\x60\x55\x8f\x1d\x4c\xf8\x92\x7d\x5e\xc6\x99", 1, 136, 0 }, { 96, 192, 128, 84, "\xe4\x57\x08\x15\xa1\x49\x59\x9d\x13\xbd\x8d\xca\xad\xbe\xc9\x3c\xf0" "\x90\x19\xba\xa2\xd4\x07\x0b", "\x5a\x31\xa3\xa0\x26\x78\x6c\x49\xdb\x9d\x09\x58", "\x90\xa7\x35\x75\x19\xe3\x5e\x8d\xbd\x89\x76\xd4\xb3\x67\x10\xff\xc1" "\xeb\x0d\x9a\x4a\xe7\xd5\x31\x5a\xe7\x32\x4e\xb1\xd1\x8c", - "", "", - "\x06\xcc\xbf\x76\x7e\x0a\x63\xc8\x9d\x50\xb8\x14\x11\x87\xa5\x55", 1, - 248, 0 }, + "", "", "\x06\xcc\xbf\x76\x7e\x0a\x63\xc8\x9d\x50\xb8\x14\x11\x87\xa5\x55", 1, 248, 0 }, { 96, 192, 128, 85, "\x9f\x0c\x07\x6b\x06\x30\xca\xa1\x0e\x7b\xdc\x07\xdc\xdc\x89\xa2\x70" "\xf0\x39\x30\x99\x7a\xde\x0b", "\x3f\x5d\xef\x08\x80\xb8\x89\xdb\x0b\x3f\x2b\xf0", "\xf5\x36\x8b\x9d\x8f\xdc\x1e\xfa\xb2\xb1\x7a\x45\xf4\x60\x42\x45\x98" "\x35\x72\xf8\xc1\x67\xaa\x31\xfa\x3f\x53\x0f\x1c\x5e\x17\x81", - "", "", - "\x33\x4c\x13\x25\xfa\x96\x9a\x07\x17\x90\x11\xd2\xf8\x61\x36\x36", 1, - 256, 0 }, + "", "", "\x33\x4c\x13\x25\xfa\x96\x9a\x07\x17\x90\x11\xd2\xf8\x61\x36\x36", 1, 256, 0 }, { 96, 192, 128, 86, "\x80\x3f\x4e\xbb\xed\x8b\x1a\x4f\x34\x87\x13\x46\x1c\x0e\xb0\xbd\x30" "\xca\xec\x55\xa1\xe7\x16\x28", @@ -703,34 +526,28 @@ const struct aead_test aes_ccm_test_json[] = { "\x2e\x4e\xa4\x74\x1f\xf6\x03\xab\xc9\x01\xfa\x02\x6b\xde\x7c\xe1\x10" "\x7e\x2f\xfb\xa0\xa0\xa0\xf2\x4f\x47\xee\x62\x78\x32\xee\x5b\xc2\x19" "\x2c\x18\x84\x56\x30\x00\x99\x10\xc0\x7f\x8d\x0a\xb4\x51", - "", "", - "\x2b\x71\xd2\xa8\x1f\x4c\x6e\xa2\x67\xa9\x86\x50\x94\xfe\x20\xe9", 1, - 520, 0 }, + "", "", "\x2b\x71\xd2\xa8\x1f\x4c\x6e\xa2\x67\xa9\x86\x50\x94\xfe\x20\xe9", 1, 520, 0 }, { 96, 192, 128, 87, "\xda\x6e\x3d\xf6\x73\x5f\x63\x2e\x03\x5a\xb8\xf1\x0c\x37\xb5\xf0\x0a" "\x40\xe1\x8b\x17\x77\x8a\x85", "\x80\x76\x5e\xac\x22\x81\x96\x9c\xba\x56\x9c\xe7", "\x6d", "\x3d\x87\x65\xdf\x3a\x06\xf5\x24\x8b\x1a\xaa\x54\x12\x3b\x86\xbd", "\xa4\x28\x63\xb9\x5a\xbe\xa3\x91\x94\x0a\xda\xc7\xfe\x0c\x41\x43", - "\x12\x2b\x46\xf8\x1a\x0b\x6e\x92\xcd\xa1\x95\x0c\xe6\xfe\x02\x6e", 1, - 8, 128 }, + "\x12\x2b\x46\xf8\x1a\x0b\x6e\x92\xcd\xa1\x95\x0c\xe6\xfe\x02\x6e", 1, 8, 128 }, { 96, 192, 128, 88, "\x54\xe1\x71\xcf\x90\x72\x9c\x77\xd5\x00\xe1\xd2\x53\x33\x60\xe8\x41" "\xe2\x60\x89\x45\x76\xb1\x29", "\x8b\x1e\x57\xf9\x8e\xa4\xe7\x7d\xea\xe4\x57\x6c", "\x27\xff", "\x2d\x71\x63\x66\xf2\x87\x38\x60\xd5\x04\x37\x00\xf1\xe9\xa9\xd8", "\x34\x18\x15\x4a\xfc\x95\xd0\x55\x69\xee\x6f\xe4\xdb\x82\xeb\x6e", - "\x0a\x73\x4b\xac\x17\x84\x3b\x85\x73\xfb\xfe\xba\x4a\x5f\xc5\xd4", 1, - 16, 128 }, + "\x0a\x73\x4b\xac\x17\x84\x3b\x85\x73\xfb\xfe\xba\x4a\x5f\xc5\xd4", 1, 16, 128 }, { 96, 192, 128, 89, "\x99\x2c\xab\xb6\x4f\x12\x21\x0c\x8b\x0b\x14\xd7\x3d\x39\x31\x7d\xdb" "\x2b\x8a\x62\x8a\xc3\x51\x06", - "\x57\xc8\x78\x6e\x66\xd8\xb0\xbe\xc3\x36\x04\xb0", - "\x06\x8d\x94\x0e\x26\xb6\x78", + "\x57\xc8\x78\x6e\x66\xd8\xb0\xbe\xc3\x36\x04\xb0", "\x06\x8d\x94\x0e\x26\xb6\x78", "\x9e\x76\x92\xf1\x21\x32\xcd\xd5\x3f\x50\x53\x16\x51\x41\x7b\xd2", "\xba\x34\x09\x26\xde\x50\x0d\x01\xae\x3d\xff\x2e\x90\x56\x08\x16", - "\xdb\x9d\xba\x31\xa0\x30\x19\xce\x88\xce\x74\x1c\x03\x94\x06\x60", 1, - 56, 128 }, + "\xdb\x9d\xba\x31\xa0\x30\x19\xce\x88\xce\x74\x1c\x03\x94\x06\x60", 1, 56, 128 }, { 96, 192, 128, 90, "\x89\xbe\x64\x95\xc9\x17\xbd\x7a\xf0\xa3\xb7\xa6\xc8\xa4\xc6\xb5\xca" "\xde\x76\x6d\x32\xde\x36\x04", @@ -738,8 +555,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xf6\xa2\x8d\x27\x68\x6a\xdc\xbf\x9f\xf8\xab\x80\xec\xc1\xc1", "\xc3\xc5\x0f\x4b\x38\xaa\x37\x51\xf4\x91\x0a\x44\x67\x5d\x37\xe5", "\xb1\x9b\xe8\xba\x6e\xbc\xdb\x74\xd3\x3c\x2d\xbd\xfd\xc0\x20\x74", - "\x93\xbb\x71\x70\x61\x33\x0a\xcc\xc7\x18\xb4\xa8\xef\x05\xab\x20", 1, - 120, 128 }, + "\x93\xbb\x71\x70\x61\x33\x0a\xcc\xc7\x18\xb4\xa8\xef\x05\xab\x20", 1, 120, 128 }, { 96, 192, 128, 91, "\x8e\xa9\x54\x55\x24\x17\x51\x6c\x97\x2e\x43\x11\x69\x2d\x65\x8d\xd7" "\xac\x9a\x7f\xd6\xf3\xd0\x2c", @@ -747,8 +563,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x7d\x4d\x7c\x27\x3a\x9a\xa0\xf3\x5d\x1f\x91\x57\x01\x41\xdb\x54", "\x0f\xc6\xcc\x80\x0a\x57\x86\xe6\x3a\x45\x46\xfb\x33\x88\x7a\xf9", "\xeb\x45\xae\x29\x80\xd9\x96\xf5\x02\x35\x93\xf7\x62\xd3\x70\x51", - "\x4a\xcc\x06\x24\x2c\xc4\xec\x4b\xa3\x6e\x8b\xfb\xe8\x4f\x3d\x5d", 1, - 128, 128 }, + "\x4a\xcc\x06\x24\x2c\xc4\xec\x4b\xa3\x6e\x8b\xfb\xe8\x4f\x3d\x5d", 1, 128, 128 }, { 96, 192, 128, 92, "\xdf\xa7\xef\x72\x30\x2d\xfb\xcd\x26\x48\xb8\x89\x58\xfe\x0f\x04\x9f" "\x1d\x60\x14\x3d\x86\xe3\x95", @@ -757,8 +572,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xe3", "\x20\xb3\x88\x32\x44\x30\x0a\x82\x09\x4d\xdb\x9b\x3d\x1e\xfb\x81", "\x5a\x83\x74\x39\x1a\xdc\x22\xe8\xc0\x66\x55\x7d\x9f\xf5\x86\xcf", - "\xd4\xa1\x11\xd6\x11\xef\xa6\x3f\x0c\x3f\x08\xb2\xfb\xb3\xb0\xac", 1, - 136, 128 }, + "\xd4\xa1\x11\xd6\x11\xef\xa6\x3f\x0c\x3f\x08\xb2\xfb\xb3\xb0\xac", 1, 136, 128 }, { 96, 192, 128, 93, "\xb6\x3b\x52\xd1\xd1\x59\xa1\x75\x96\xdf\xbd\x9b\xe5\xc5\x08\x86\x99" "\xd9\x4b\x9c\x5d\x95\xc2\x2d", @@ -767,8 +581,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x9f\x18\x98\xea\x05\x17\x0e\x31\x5c\x14\x49\x60\xd2\x63", "\xdf\xb4\x17\x90\x3c\x6d\x48\x27\x50\x0a\x3e\xca\x21\x84\xfe\x1c", "\xe8\x44\x71\x60\x1f\xb8\xb4\xdb\xbd\xc8\x0d\x56\xe3\x7f\x69\xb8", - "\x52\x08\x9c\xb4\xe6\xc1\x1b\xd7\x64\xae\x7d\x44\x38\xcf\xd1\xf8", 1, - 248, 128 }, + "\x52\x08\x9c\xb4\xe6\xc1\x1b\xd7\x64\xae\x7d\x44\x38\xcf\xd1\xf8", 1, 248, 128 }, { 96, 192, 128, 94, "\xaa\xf6\x40\x23\xf5\x76\x2c\x4a\x54\xc3\xeb\x0e\xf3\xbb\x2e\xbd\x23" "\xce\xaf\x38\xb3\xe0\x28\x5f", @@ -777,8 +590,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xa1\x69\x53\xbd\x97\x00\x75\x9b\x35\xa5\x03\x1a\x2d\x8b\xd0", "\x34\xae\xc5\xa6\x57\x95\xcb\xee\xda\xc2\xee\x6f\xd7\x76\x5c\x6f", "\xd1\x3c\xce\xb8\x37\x6e\xb4\x23\xf5\xb2\xea\x25\x7c\x11\x8f\xb5", - "\x7b\x6a\x3c\x76\xfd\x52\x93\x0a\x98\x9f\x03\x4e\x5d\xfe\x07\x4b", 1, - 256, 128 }, + "\x7b\x6a\x3c\x76\xfd\x52\x93\x0a\x98\x9f\x03\x4e\x5d\xfe\x07\x4b", 1, 256, 128 }, { 96, 192, 128, 95, "\xb5\x21\xe4\xfa\x92\xeb\x46\xfd\x49\x16\xc7\x1e\x3f\x99\x90\x27\xaa" "\xf2\x14\x66\xfa\xd5\xf9\x6e", @@ -789,30 +601,25 @@ const struct aead_test aes_ccm_test_json[] = { "\x93\x13\xd7\x41\x2b\x9c\x2d\x89\xca\xfd\x9c\xd5\xa7\x34", "\xa3\xa8\x0a\xc0\xf5\xb4\x65\x97\xa7\xf4\xa5\x83\xdd\xa0\x21\x24", "\x99\x4b\xb3\x44\x70\xd4\xdd\xb7\xbb\x7a\x3c\x3a\xbb\x5d\xa3\xc5", - "\x02\x55\x0e\x2b\x27\x8c\x72\x36\x72\xa0\x1e\x4b\x6a\x46\xaf\xc7", 1, - 520, 128 }, + "\x02\x55\x0e\x2b\x27\x8c\x72\x36\x72\xa0\x1e\x4b\x6a\x46\xaf\xc7", 1, 520, 128 }, { 96, 192, 128, 96, "\x77\x57\x75\x4a\xec\xcf\x85\xc9\x1e\x48\xe4\xd4\x97\x0d\x4d\x62\xda" "\xe9\x4c\xf4\x4f\x9f\xf0\x26", "\x3d\x92\x81\xc4\xac\xfc\x72\x38\x73\x46\xfd\x92", "", "", "", - "\xda\x9a\xe6\x0a\x12\xaa\x6f\x92\x6c\xf4\x6d\x2a\x33\x5f\xaa\xc7", 1, - 0, 0 }, + "\xda\x9a\xe6\x0a\x12\xaa\x6f\x92\x6c\xf4\x6d\x2a\x33\x5f\xaa\xc7", 1, 0, 0 }, { 96, 192, 128, 97, "\xa0\xca\xc7\xe8\x3c\x7e\xba\x22\x36\x52\x56\xcb\x8f\x23\x70\x39\xb9" "\x4f\x1a\x26\x92\x63\x64\x8e", "\x2d\x2a\x5c\x8b\x17\x21\x2d\x4c\x44\xce\xd4\x59", - "\x8b\x38\x8e\x2e\x72\x25\xc0\x87\x30\x00\x42\xf6\x02\x4a\x11\x1f", - "", "", - "\x84\x04\x34\x98\xce\x07\xd8\x74\x23\x30\xc6\x05\xd9\x6d\x96\x6c", 1, - 128, 0 }, + "\x8b\x38\x8e\x2e\x72\x25\xc0\x87\x30\x00\x42\xf6\x02\x4a\x11\x1f", "", "", + "\x84\x04\x34\x98\xce\x07\xd8\x74\x23\x30\xc6\x05\xd9\x6d\x96\x6c", 1, 128, 0 }, { 96, 192, 128, 98, "\xfa\x07\xaa\x39\x32\xb9\x01\x69\x62\x69\xc8\xf8\xbf\x56\x66\x2f\x82" "\xdf\xf2\x95\x7a\x4a\xca\x35", "\xec\x1b\x6d\x7f\x09\x7a\x2c\xad\x8c\xbc\x9f\xe9", "", "\xd9\xa6\x89\x79\x3c\x94\x79\x68\xf0\x7d\x4b\xa2\xeb\x1c\x25\xeb", "\xa3\x22\xf7\x58\x00\xfc\xaf\xf6\x91\x25\x17\x62\xed\x39\xfb\x39", - "\x8a\x73\x48\x92\x21\x33\x83\xac\x54\xdc\x2c\x1f\x48\x84\x19\x38", 1, - 0, 128 }, + "\x8a\x73\x48\x92\x21\x33\x83\xac\x54\xdc\x2c\x1f\x48\x84\x19\x38", 1, 0, 128 }, { 96, 192, 128, 99, "\xf9\x97\xa7\x9b\x63\xb1\xcf\x64\x14\x83\x70\x60\x97\xff\x4a\xbe\xeb" "\xa1\x39\x62\xdb\x05\x62\x06", @@ -820,8 +627,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xaa\x13\xc1\x09\xb2\xf5\x7f\x70\x0a\x89\x93\x1d\xe7\x5b\x70\x80", "\xf3\x76\x94\x34\x59\xb6\x04\x1e\xd5\x23\x2d\x7b\x9f\xb5\xe9\xe6", "\x98\x2b\x14\xf6\x64\x82\xd0\xc9\x83\x71\xe0\x80\x78\xef\xa0\x12", - "\x14\xf1\xb2\xb2\x45\x75\xa1\xa3\x32\x06\xac\xdf\x50\x0e\x9d\x46", 1, - 128, 128 }, + "\x14\xf1\xb2\xb2\x45\x75\xa1\xa3\x32\x06\xac\xdf\x50\x0e\x9d\x46", 1, 128, 128 }, { 96, 192, 128, 100, "\xd7\xc6\xea\x0a\x28\x5a\x5d\x8c\x59\x64\x77\x30\x80\x48\x89\x67\xe7" "\xe6\x59\x35\x89\x0c\x32\x65", @@ -830,8 +636,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x23", "\x34\x50\xa9\x92\xa6\xfb\xce\x9c\xe2\x9f\x6c\x4f\x9f\x41\xc3\x6e" "\xf6", - "\xed\x6c\xa1\xff\x3e\xa1\xa7\xca\x88\x19\x50\x11\x39\xf8\xa0\xb8", 1, - 0, 136 }, + "\xed\x6c\xa1\xff\x3e\xa1\xa7\xca\x88\x19\x50\x11\x39\xf8\xa0\xb8", 1, 0, 136 }, { 96, 192, 128, 101, "\xb2\x93\x46\xa9\x5c\x3b\x65\x3c\x9b\xed\x02\x3d\xf2\xe0\x3b\x6d\xe4" "\x5b\x8d\xe1\xa4\x06\x7d\x86", @@ -841,8 +646,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x4d", "\x6c\x26\x39\x28\x99\xe3\x65\x45\x00\x54\xbf\x0a\xb3\x3f\x98\x3f" "\x27", - "\xc4\x72\x40\xbb\x8d\x1d\xbb\x68\x7f\xab\x77\x7f\x72\xad\xbd\x2a", 1, - 128, 136 }, + "\xc4\x72\x40\xbb\x8d\x1d\xbb\x68\x7f\xab\x77\x7f\x72\xad\xbd\x2a", 1, 128, 136 }, { 96, 192, 128, 102, "\xa6\x1e\xd3\xb8\x1d\x78\x56\x06\x02\x77\x74\x07\x75\x9b\x1f\x2c\xa3" "\x4c\xd7\x0c\x6b\x57\x79\x1b", @@ -851,8 +655,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x31\xef\x14\xdb\xee\xa3\x36\x79\xd3\x1c\x48\x77\x7c\x88", "\xa0\xc1\x52\x6c\x88\xdc\xc2\x65\xf7\x5d\x4e\xf9\xb2\xa0\x00\xfb\x3c" "\xce\x9e\x5d\x99\x4c\x47\x2c\x46\xbf\xac\x38\x21\xd6\x11", - "\x9a\xa6\xcd\xb8\x5b\x12\x6e\x1f\x21\xd0\x66\xa3\xc0\x5e\x82\xf6", 1, - 0, 248 }, + "\x9a\xa6\xcd\xb8\x5b\x12\x6e\x1f\x21\xd0\x66\xa3\xc0\x5e\x82\xf6", 1, 0, 248 }, { 96, 192, 128, 103, "\x49\xf3\x3b\xc3\xc1\xa4\x0e\x1c\xa3\xb5\x6a\x49\x9e\x4c\x91\x37\xc1" "\x48\xd1\x25\x61\x55\xfd\xb6", @@ -862,253 +665,219 @@ const struct aead_test aes_ccm_test_json[] = { "\xb8\x41\x54\x97\x06\x3d\xd9\x69\x1a\x55\x23\x44\xd6\x42", "\x67\xad\xef\x99\x61\x1f\x34\x1d\x14\xea\x27\xe7\x2d\xa9\xb6\x58\xc9" "\xa7\x9e\x3b\x32\x8e\x79\x75\x8c\x9d\x34\xdb\x0b\xed\x06", - "\xb2\xa4\x4d\x0f\xc9\x46\x06\xc4\xe2\xb6\xc3\x9b\x24\x2b\x3a\xca", 1, - 128, 248 }, + "\xb2\xa4\x4d\x0f\xc9\x46\x06\xc4\xe2\xb6\xc3\x9b\x24\x2b\x3a\xca", 1, 128, 248 }, { 96, 192, 128, 104, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x74\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x74\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 105, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x77\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x77\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 106, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\xf5\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\xf5\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 107, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x54\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x54\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 108, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\x65\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\x65\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 109, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb4\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb4\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 110, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb7\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb7\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 111, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\x36\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\x36\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 112, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7b\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7b\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 113, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\xfa\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\xfa\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 114, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\x9e\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\x9e\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 115, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x94\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x94\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 116, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbf\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbf\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 117, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbc\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbc\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 118, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\x3e\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\x3e\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 119, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x85", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x85", 0, 0, 128 }, { 96, 192, 128, 120, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x86", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x86", 0, 0, 128 }, { 96, 192, 128, 121, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\xc4", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\xc4", 0, 0, 128 }, { 96, 192, 128, 122, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x04", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7a\xbe\x95\x75\xbe\x8e\x47\x04", 0, 0, 128 }, { 96, 192, 128, 123, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x74\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7b\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x74\x55\xdf\xe5\xb5\xe6\xf2\xb6\x7b\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 124, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\x65\xb5\xe6\xf2\x36\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, - 0, 128 }, + "\x75\x55\xdf\x65\xb5\xe6\xf2\x36\x7a\xbe\x95\x75\xbe\x8e\x47\x84", 0, 0, 128 }, { 96, 192, 128, 125, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x75\x55\xdf\xe5\xb5\xe6\xf2\x36\x7a\xbe\x95\x75\xbe\x8e\x47\x04", 0, - 0, 128 }, + "\x75\x55\xdf\xe5\xb5\xe6\xf2\x36\x7a\xbe\x95\x75\xbe\x8e\x47\x04", 0, 0, 128 }, { 96, 192, 128, 126, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x8a\xaa\x20\x1a\x4a\x19\x0d\x49\x85\x41\x6a\x8a\x41\x71\xb8\x7b", 0, - 0, 128 }, + "\x8a\xaa\x20\x1a\x4a\x19\x0d\x49\x85\x41\x6a\x8a\x41\x71\xb8\x7b", 0, 0, 128 }, { 96, 192, 128, 127, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, 128 }, { 96, 192, 128, 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, 128 }, { 96, 192, 128, 129, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\xf5\xd5\x5f\x65\x35\x66\x72\x36\xfa\x3e\x15\xf5\x3e\x0e\xc7\x04", 0, - 0, 128 }, + "\xf5\xd5\x5f\x65\x35\x66\x72\x36\xfa\x3e\x15\xf5\x3e\x0e\xc7\x04", 0, 0, 128 }, { 96, 192, 128, 130, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xef\x67\x20\x50\x90\x35\x75\x0e\xca\xfa\xc4\xb3\xe4\xfa\xc3\x56", - "\x74\x54\xde\xe4\xb4\xe7\xf3\xb7\x7b\xbf\x94\x74\xbf\x8f\x46\x85", 0, - 0, 128 }, + "\x74\x54\xde\xe4\xb4\xe7\xf3\xb7\x7b\xbf\x94\x74\xbf\x8f\x46\x85", 0, 0, 128 }, { 96, 256, 128, 131, "\x80\xba\x31\x92\xc8\x03\xce\x96\x5e\xa3\x71\xd5\xff\x07\x3c\xf0\xf4" "\x3b\x6a\x2a\xb5\x76\xb2\x08\x42\x6e\x11\x40\x9c\x09\xb9\xb0", "\x4d\xa5\xbf\x8d\xfd\x58\x52\xc1\xea\x12\x37\x9d", "", "", "", - "\x6d\xc4\xef\x59\xa7\x3e\xbc\xab\xb5\xe3\x4c\x0d\x34\xd9\xf2\xd7", 1, - 0, 0 }, + "\x6d\xc4\xef\x59\xa7\x3e\xbc\xab\xb5\xe3\x4c\x0d\x34\xd9\xf2\xd7", 1, 0, 0 }, { 96, 256, 128, 132, "\xcc\x56\xb6\x80\x55\x2e\xb7\x50\x08\xf5\x48\x4b\x4c\xb8\x03\xfa\x50" "\x63\xeb\xd6\xea\xb9\x1f\x6a\xb6\xae\xf4\x91\x6a\x76\x62\x73", - "\x99\xe2\x3e\xc4\x89\x85\xbc\xcd\xee\xab\x60\xf1", "", "\x2a", - "\x06", - "\x85\xca\x1f\x6c\x46\x28\x3c\xb5\xdd\x59\x60\xbd\x34\xa8\xdc\x36", 1, - 0, 8 }, + "\x99\xe2\x3e\xc4\x89\x85\xbc\xcd\xee\xab\x60\xf1", "", "\x2a", "\x06", + "\x85\xca\x1f\x6c\x46\x28\x3c\xb5\xdd\x59\x60\xbd\x34\xa8\xdc\x36", 1, 0, 8 }, { 96, 256, 128, 133, "\x51\xe4\xbf\x2b\xad\x92\xb7\xaf\xf1\xa4\xbc\x05\x55\x0b\xa8\x1d\xf4" "\xb9\x6f\xab\xf4\x1c\x12\xc7\xb0\x0e\x60\xe4\x8d\xb7\xe1\x52", "\x4f\x07\xaf\xed\xfd\xc3\xb6\xc2\x36\x18\x23\xd3", "", - "\xbe\x33\x08\xf7\x2a\x2c\x6a\xed", - "\x7f\xd4\xb5\xd3\x09\x52\x35\xa3", - "\xf6\x4d\x10\xb4\x1e\x3d\x69\x28\x74\x19\x47\xc5\x0c\xa0\x39\x1f", 1, - 0, 64 }, + "\xbe\x33\x08\xf7\x2a\x2c\x6a\xed", "\x7f\xd4\xb5\xd3\x09\x52\x35\xa3", + "\xf6\x4d\x10\xb4\x1e\x3d\x69\x28\x74\x19\x47\xc5\x0c\xa0\x39\x1f", 1, 0, 64 }, { 96, 256, 128, 134, "\x59\xd4\xea\xfb\x4d\xe0\xcf\xc7\xd3\xdb\x99\xa8\xf5\x4b\x15\xd7\xb3" "\x9f\x0a\xcc\x8d\xa6\x97\x63\xb0\x19\xc1\x69\x9f\x87\x67\x4a", "\x2f\xcb\x1b\x38\xa9\x9e\x71\xb8\x47\x40\xad\x9b", "", "\x54\x9b\x36\x5a\xf9\x13\xf3\xb0\x81\x13\x1c\xcb\x6b\x82\x55\x88", "\x48\xdd\x95\x89\xa4\x7e\x63\x8b\xbb\xc2\xaa\x3e\x23\x2f\xa5\x29", - "\xdf\x69\xfb\xe1\xf0\x99\xf0\x13\x4f\xe2\x86\x91\x56\xab\x07\xdb", 1, - 0, 128 }, + "\xdf\x69\xfb\xe1\xf0\x99\xf0\x13\x4f\xe2\x86\x91\x56\xab\x07\xdb", 1, 0, 128 }, { 96, 256, 128, 135, "\x3b\x24\x58\xd8\x17\x6e\x16\x21\xc0\xcc\x24\xc0\xc0\xe2\x4c\x1e\x80" "\xd7\x2f\x7e\xe9\x14\x9a\x4b\x16\x61\x76\x62\x96\x16\xd0\x11", @@ -1117,8 +886,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x1f", "\x20\x22\x97\xd3\x6c\xa6\x2c\x5a\x1d\x44\x37\xfa\xfc\x7b\x50\xe7" "\x64", - "\x66\x5f\x05\xa9\x6b\xf8\xde\x45\x36\x1d\xbf\x33\xc9\x8b\x09\x05", 1, - 0, 136 }, + "\x66\x5f\x05\xa9\x6b\xf8\xde\x45\x36\x1d\xbf\x33\xc9\x8b\x09\x05", 1, 0, 136 }, { 96, 256, 128, 136, "\x02\x12\xa8\xde\x50\x07\xed\x87\xb3\x3f\x1a\x70\x90\xb6\x11\x4f\x9e" "\x08\xce\xfd\x96\x07\xf2\xc2\x76\xbd\xcf\xdb\xc5\xce\x9c\xd7", @@ -1127,8 +895,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x7e\xea\x69\x16\xd2\xb1\x11", "\x3c\x0a\x0b\x34\x94\xd7\x5c\xcb\xcf\xfa\xa9\x17\xd6\x15\x92\x94\xfd" "\x93\xe8\xa2\xee\x66\x44\x7a", - "\xb0\xb0\x7b\xa0\x51\x67\xe8\x8c\x24\xe5\x48\x24\xa0\x70\x61\xb9", 1, - 0, 192 }, + "\xb0\xb0\x7b\xa0\x51\x67\xe8\x8c\x24\xe5\x48\x24\xa0\x70\x61\xb9", 1, 0, 192 }, { 96, 256, 128, 137, "\x2e\xb5\x1c\x46\x9a\xa8\xeb\x9e\x6c\x54\xa8\x34\x9b\xae\x50\xa2\x0f" "\x0e\x38\x27\x11\xbb\xa1\x15\x2c\x42\x4f\x03\xb6\x67\x1d\x71", @@ -1137,8 +904,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xa6\x85\xad\xcc\x2a\xd3\x26\x62\x55\x8e\x55\xa5\xc7\x29", "\x0e\x29\xb2\x33\x5b\x90\x07\x58\xfa\xd2\x78\xae\xfb\x9b\x3a\xfa\x07" "\xfd\x42\xb5\xd2\xf7\xd3\x87\xe3\xea\x0e\x0c\xa4\x16\xe0", - "\x6e\xd7\xe1\xe1\x27\x8c\x40\xce\x2e\x78\x1d\x10\x05\xde\x88\xdd", 1, - 0, 248 }, + "\x6e\xd7\xe1\xe1\x27\x8c\x40\xce\x2e\x78\x1d\x10\x05\xde\x88\xdd", 1, 0, 248 }, { 96, 256, 128, 138, "\x51\x55\xde\xe9\xaa\xde\x1c\xc6\x1e\xe7\xe3\xf9\x26\x60\xf7\x59\x0f" "\x5e\x5b\xa8\x2f\x1b\x59\xb8\x50\xe3\xfa\x45\x3d\x2f\xa6\xb3", @@ -1147,8 +913,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xaf\x1a\xd5\x12\x3f\xf8\x1f\x83\xf5\x00\xed\xf4\xed\xa0\x9e\xdf", "\xae\xd2\x4e\x00\x82\xe1\x3e\xe1\x5b\xa0\x50\x6a\x83\x6c\x78\xb9\x7e" "\xf2\xfa\xa3\xc6\xe8\xeb\x37\x8d\xc6\x4d\xd4\xad\xc9\x98\xad\x68", - "\x5b\xa1\xb4\x8a\x70\x16\x84\xd9\x40\xbe\x24\x4c\x3d\xe9\x38\xd2", 1, - 0, 264 }, + "\x5b\xa1\xb4\x8a\x70\x16\x84\xd9\x40\xbe\x24\x4c\x3d\xe9\x38\xd2", 1, 0, 264 }, { 96, 256, 128, 139, "\x95\xe8\x7e\xda\x64\xd0\xdc\x2d\x4e\x85\x10\x30\xc3\xe1\xb2\x7c\xca" "\x22\x65\xb3\x46\x4c\x2c\x57\x2b\xd8\xfc\x8c\xfb\x28\x2d\x1b", @@ -1161,98 +926,76 @@ const struct aead_test aes_ccm_test_json[] = { "\xfd\xcb\xa7\x28\xec\x12\x4d\x0f\x28\x49\x48\x4f\x63\x5a\x00\x0e\x73" "\x4c\x8c\x80\x94\x1b\x3d\xa3\x2d\x23\xee\xa5\x1e\xdc\xe8\xd6\x61\x7b" "\x16\xeb\xb4\x3a\xc8\x11\x3a\x09\x2e\x9d\xda\xa3\x72\x1a\xe9", - "\xa9\x25\x2a\x50\xdd\xbb\xf1\x8c\xd3\xe4\x3a\xdc\x0b\xa1\xa4\x81", 1, - 0, 528 }, + "\xa9\x25\x2a\x50\xdd\xbb\xf1\x8c\xd3\xe4\x3a\xdc\x0b\xa1\xa4\x81", 1, 0, 528 }, { 96, 256, 128, 140, "\x7a\x4c\xd7\x59\x17\x2e\x02\xeb\x20\x4d\xb2\xc3\xf5\xc7\x46\x22\x7d" "\xf5\x84\xfc\x13\x45\x19\x63\x91\xdb\xb9\x57\x7a\x25\x07\x42", - "\xa9\x2e\xf0\xac\x99\x1d\xd5\x16\xa3\xc6\xf6\x89", - "\xbd\x50\x67\x64\xf2\xd2\xc4\x10", "", "", - "\x56\x9d\x82\x69\x18\x92\xe1\x03\xe6\x27\x40\x7c\x95\xf0\x8a\x0e", 1, - 64, 0 }, + "\xa9\x2e\xf0\xac\x99\x1d\xd5\x16\xa3\xc6\xf6\x89", "\xbd\x50\x67\x64\xf2\xd2\xc4\x10", + "", "", "\x56\x9d\x82\x69\x18\x92\xe1\x03\xe6\x27\x40\x7c\x95\xf0\x8a\x0e", 1, 64, 0 }, { 96, 256, 128, 141, "\xb9\x07\xa4\x50\x75\x51\x3f\xe8\xa8\x01\x9e\xde\xe3\xf2\x59\x14\x87" "\xb2\xa0\x30\xb0\x3c\x6e\x1d\x77\x1c\x86\x25\x71\xd2\xea\x1e", - "\x11\x8a\x69\x64\xc2\xd3\xe3\x80\x07\x1f\x52\x66", - "\x03\x45\x85\x62\x1a\xf8\xd7\xff", + "\x11\x8a\x69\x64\xc2\xd3\xe3\x80\x07\x1f\x52\x66", "\x03\x45\x85\x62\x1a\xf8\xd7\xff", "\x55\xa4\x65\x64\x4f\x5b\x65\x09\x28\xcb\xee\x7c\x06\x32\x14\xd6", "\xab\x01\xf9\x2d\xb4\xf2\x10\xbd\xb5\xed\xaf\x0a\x1b\xd1\x9e\xba", - "\x62\x16\x30\xc5\x05\xd2\x4e\x3b\x29\x29\x49\x77\xd8\xff\xa4\xb4", 1, - 64, 128 }, + "\x62\x16\x30\xc5\x05\xd2\x4e\x3b\x29\x29\x49\x77\xd8\xff\xa4\xb4", 1, 64, 128 }, { 96, 256, 128, 142, "\xf6\x0c\x6a\x1b\x62\x57\x25\xf7\x6c\x70\x37\xb4\x8f\xe3\x57\x7f\xa7" "\xf7\xb8\x7b\x1b\xd5\xa9\x82\x17\x6d\x18\x23\x06\xff\xb8\x70", - "\xf0\x38\x4f\xb8\x76\x12\x14\x10\x63\x3d\x99\x3d", - "\x9a\xaf\x29\x9e\xee\xa7\x8f\x79", + "\xf0\x38\x4f\xb8\x76\x12\x14\x10\x63\x3d\x99\x3d", "\x9a\xaf\x29\x9e\xee\xa7\x8f\x79", "\x63\x85\x8c\xa3\xe2\xce\x69\x88\x7b\x57\x8a\x3c\x16\x7b\x42\x1c" "\x9c", "\xf0\x5e\x29\x0b\xbb\xc6\x19\x27\xfa\x65\x76\x06\x48\xdc\xca\x88" "\xb0", - "\xb7\x21\xbe\x96\xa6\xb9\x5c\x09\x31\xfb\x24\x3d\xd1\x28\x7c\x70", 1, - 64, 136 }, + "\xb7\x21\xbe\x96\xa6\xb9\x5c\x09\x31\xfb\x24\x3d\xd1\x28\x7c\x70", 1, 64, 136 }, { 96, 256, 128, 143, "\xaf\x1a\xc1\x9b\x3b\x84\xea\xaf\x26\x03\x37\x9c\xdd\x1d\xc1\xae\xe4" "\xa4\x84\xfd\xc2\xc1\x90\x69\x1a\xfc\xc5\xb7\x62\xf9\xb5\x26", "\xda\xf9\x8f\x1b\xd4\xc0\x71\xc6\xb1\x00\xf9\xc4", "\x14", "", "", - "\xe7\x72\xcc\x77\x14\xef\xce\xfb\xd1\x15\x08\xde\x48\x9f\x7c\x61", 1, - 8, 0 }, + "\xe7\x72\xcc\x77\x14\xef\xce\xfb\xd1\x15\x08\xde\x48\x9f\x7c\x61", 1, 8, 0 }, { 96, 256, 128, 144, "\x95\xfb\x78\x61\xf8\xc7\x5e\x14\x24\xd8\x40\x1c\xa3\xb3\x45\x2c\x56" "\x3b\x99\xb0\x02\xc2\x4a\xfa\xd4\xcf\x5e\x82\x8f\x23\x53\xed", - "\xc1\xac\x60\x8d\x1f\xda\x28\xeb\x40\x34\x07\x9c", "\xfb\xc8", "", - "", - "\x54\xf2\xd2\xa5\x4c\xbe\x6e\x95\x9d\x51\xba\x4f\xfa\x8e\x0e\x9e", 1, - 16, 0 }, + "\xc1\xac\x60\x8d\x1f\xda\x28\xeb\x40\x34\x07\x9c", "\xfb\xc8", "", "", + "\x54\xf2\xd2\xa5\x4c\xbe\x6e\x95\x9d\x51\xba\x4f\xfa\x8e\x0e\x9e", 1, 16, 0 }, { 96, 256, 128, 145, "\xd3\x0e\x68\x2b\x58\x4d\x41\x60\x88\xa8\x1b\xd6\xf8\x55\x51\xec\x1f" "\x2e\x11\x89\x38\x8a\x7a\x9c\x05\x21\xe2\x5b\x72\x5f\x7d\xbe", - "\x92\x72\x14\xf6\x43\x36\x70\x1a\x3b\x4d\xb6\x03", - "\x5c\xdb\x70\x70\x08\xb0\x65", "", "", - "\x2c\x6b\x6b\xef\x6b\xa0\x82\xba\xa7\x24\x15\xaa\xaa\x88\x3c\x75", 1, - 56, 0 }, + "\x92\x72\x14\xf6\x43\x36\x70\x1a\x3b\x4d\xb6\x03", "\x5c\xdb\x70\x70\x08\xb0\x65", "", + "", "\x2c\x6b\x6b\xef\x6b\xa0\x82\xba\xa7\x24\x15\xaa\xaa\x88\x3c\x75", 1, 56, 0 }, { 96, 256, 128, 146, "\xac\x5a\x03\x8c\xae\xa8\x47\x5e\x71\xca\x41\x03\x93\x88\xb8\x61\xf0" "\x08\xb6\x0c\x62\xff\x2e\x91\x4f\xf0\x83\x39\x86\x2f\xb8\x50", "\xac\x38\x11\x7b\x39\x6a\xa0\x68\x43\x31\xfe\x74", - "\x02\xd1\xd0\x0a\x8f\x1f\x05\x2c\x08\x35\x75\xeb\x0c\x2a\x09", "", - "", - "\xd2\xe3\xaa\xdf\x9e\xd6\x0d\x91\xda\x5a\x1d\xc1\x21\xdb\xfd\x24", 1, - 120, 0 }, + "\x02\xd1\xd0\x0a\x8f\x1f\x05\x2c\x08\x35\x75\xeb\x0c\x2a\x09", "", "", + "\xd2\xe3\xaa\xdf\x9e\xd6\x0d\x91\xda\x5a\x1d\xc1\x21\xdb\xfd\x24", 1, 120, 0 }, { 96, 256, 128, 147, "\xef\xa5\xc5\x05\x3b\x45\x20\x02\xfc\x34\x53\x12\xa3\xbe\x65\x0e\x9f" "\xf4\x24\x4a\x1e\x44\x55\x7d\x8a\x41\x55\x70\xd2\xdb\xe9\x02", "\x1a\xbf\xb6\xe3\x18\x99\x5e\xa0\x22\xb1\xd3\x69", - "\x01\xa1\x0b\xc7\x1a\x88\xc9\x4a\x3f\xf9\x24\xfe\x74\xcc\xa2\x29", - "", "", - "\x8e\x97\x80\xcc\xa8\x6d\x3c\xa4\x02\xe1\xdf\xaa\x03\xa7\x2d\x77", 1, - 128, 0 }, + "\x01\xa1\x0b\xc7\x1a\x88\xc9\x4a\x3f\xf9\x24\xfe\x74\xcc\xa2\x29", "", "", + "\x8e\x97\x80\xcc\xa8\x6d\x3c\xa4\x02\xe1\xdf\xaa\x03\xa7\x2d\x77", 1, 128, 0 }, { 96, 256, 128, 148, "\xbd\xf2\x99\x4d\xd0\xfe\xb3\xc8\x70\xb3\x9f\x52\xbc\xc7\x6d\x28\xee" "\xd7\x12\xd9\x11\xd9\x56\xc0\x42\xe4\x70\x1c\x4b\x20\xe5\xd5", "\x0a\x82\x3c\x80\x1d\x05\x7e\x84\x3a\xf7\xca\x55", "\x03\xf3\xd0\xfc\x23\xdd\x8f\x3e\x20\x88\x4d\x3c\x6f\xff\x26\x08" "\xb1", - "", "", - "\x36\x88\x6d\x89\xcd\xcc\xe1\x57\x49\x7f\xd0\x9d\xcd\x67\xf3\x29", 1, - 136, 0 }, + "", "", "\x36\x88\x6d\x89\xcd\xcc\xe1\x57\x49\x7f\xd0\x9d\xcd\x67\xf3\x29", 1, 136, 0 }, { 96, 256, 128, 149, "\x5a\xe3\xc3\xff\x78\xce\xdc\x19\x2c\xa7\x04\x4b\x3f\x41\xa2\x42\x43" "\x2b\x0e\xa7\xd3\x48\x8c\x68\x0c\xd4\x22\x51\x5b\x09\x3b\x5b", "\x7c\x62\x04\x28\x69\xa2\xe5\x97\x01\x48\x16\x14", "\x7b\xa3\xf3\xbb\xba\x5d\xff\x63\x74\x88\x06\x4b\x6a\x52\x49\xd2\xad" "\x46\x17\x17\x27\x87\x19\xfe\x71\xfe\xbf\x71\x00\x82\x8e", - "", "", - "\x3f\x8b\x8f\x90\x4c\xeb\x30\x45\x05\xf9\x42\xf3\x6c\xca\xc5\xf8", 1, - 248, 0 }, + "", "", "\x3f\x8b\x8f\x90\x4c\xeb\x30\x45\x05\xf9\x42\xf3\x6c\xca\xc5\xf8", 1, 248, 0 }, { 96, 256, 128, 150, "\xa8\x10\x8c\x33\xda\x05\x9f\xed\xf6\x02\x2a\x6e\xc4\x95\x27\xbe\x0a" "\xb6\x40\x02\x47\x2c\xb2\xf7\x03\xb9\x7e\x01\x79\xa3\x43\x12", "\xbc\xe6\x36\xca\x40\x1a\x88\xfa\xc2\x36\x1e\xd1", "\x35\xea\xc1\x65\x26\xc2\xf1\x0a\x12\x71\xb3\xa8\xf8\x10\xbb\xf2\x39" "\xee\xb9\x61\xe1\xa7\xe9\x20\x5b\xea\xe6\x00\x45\xf0\x08\xe6", - "", "", - "\x43\x0c\xcb\xb1\xf7\x5d\xe0\x6b\x71\x63\x7d\x1a\x76\xb3\x5c\xf5", 1, - 256, 0 }, + "", "", "\x43\x0c\xcb\xb1\xf7\x5d\xe0\x6b\x71\x63\x7d\x1a\x76\xb3\x5c\xf5", 1, 256, 0 }, { 96, 256, 128, 151, "\x4c\x8e\x95\xa7\x36\x1b\xb3\x78\x49\xb1\x6f\x0e\x5f\x9a\x6e\xab\x87" "\x39\x13\x39\xd9\x51\xd7\x40\x4f\xf5\xcd\x82\x9c\x08\x7a\x6b", @@ -1261,34 +1004,28 @@ const struct aead_test aes_ccm_test_json[] = { "\x4f\xf6\xdf\xa9\x4d\x82\xb7\x35\x9c\xb3\x87\xdd\x5e\x80\xc6\x18\x6f" "\xbf\x17\x48\xc1\x92\xbb\x0c\x68\x8e\xbb\x47\x1b\x90\x20\xfe\x8f\xbf" "\xae\xe3\xde\xe8\x78\x7a\xce\x3c\x20\xdd\x50\xbe\x08\x3e", - "", "", - "\xda\x7f\xe2\xa4\x46\x9e\x39\x1c\x20\x5b\x6d\xe8\xe1\x82\xa9\x14", 1, - 520, 0 }, + "", "", "\xda\x7f\xe2\xa4\x46\x9e\x39\x1c\x20\x5b\x6d\xe8\xe1\x82\xa9\x14", 1, 520, 0 }, { 96, 256, 128, 152, "\x7d\x00\xb4\x80\x95\xad\xfa\x32\x72\x05\x06\x07\xb2\x64\x18\x50\x02" "\xba\x99\x95\x7c\x49\x8b\xe0\x22\x77\x0f\x2c\xe2\xf3\x14\x3c", "\x87\x34\x5f\x10\x55\xfd\x9e\x21\x02\xd5\x06\x56", "\x02", "\xe5\xcc\xaa\x44\x1b\xc8\x14\x68\x8f\x8f\x6e\x8f\x28\xb5\x00\xb2", "\x6f\xe8\x78\x84\xb9\x4e\xac\x04\x1c\xb4\xc7\x8c\x23\xf2\x83\xa3", - "\x7e\xeb\x30\x08\x25\x49\x63\x72\x24\xe9\x26\xe5\x27\xb6\x9a\xea", 1, - 8, 128 }, + "\x7e\xeb\x30\x08\x25\x49\x63\x72\x24\xe9\x26\xe5\x27\xb6\x9a\xea", 1, 8, 128 }, { 96, 256, 128, 153, "\x64\x32\x71\x7f\x1d\xb8\x5e\x41\xac\x78\x36\xbc\xe2\x51\x85\xa0\x80" "\xd5\x76\x2b\x9e\x2b\x18\x44\x4b\x6e\xc7\x2c\x3b\xd8\xe4\xdc", "\x87\xa3\x16\x3e\xc0\x59\x8a\xd9\x5b\x3a\xa7\x13", "\xb6\x48", "\x02\xcd\xe1\x68\xfb\xa3\xf5\x44\xbb\xd0\x33\x2f\x7a\xde\xad\xa8", "\xe0\x17\xbf\x1d\xdd\x27\x98\x86\xf7\x54\x53\x65\xf1\x46\x5c\xc7", - "\x6d\xca\xb7\x9d\x1d\xda\xb4\xf3\xad\x8b\x4a\xf7\x23\x18\xeb\x1b", 1, - 16, 128 }, + "\x6d\xca\xb7\x9d\x1d\xda\xb4\xf3\xad\x8b\x4a\xf7\x23\x18\xeb\x1b", 1, 16, 128 }, { 96, 256, 128, 154, "\xda\xcd\x51\xa8\xa8\xe4\xd5\x90\x5b\x4c\xbb\x94\x7e\xf4\x01\x3e\xb2" "\x96\x88\x93\x53\xf3\xc9\xee\x35\xf5\x57\x7b\x26\x73\x7a\x51", - "\x3f\xa3\x78\xa1\xbe\xfd\xdd\xd6\x1a\xe6\x8c\xf4", - "\xbb\x5a\x38\x12\xf0\xae\xfd", + "\x3f\xa3\x78\xa1\xbe\xfd\xdd\xd6\x1a\xe6\x8c\xf4", "\xbb\x5a\x38\x12\xf0\xae\xfd", "\xe1\x48\x31\x38\x83\xa7\x7d\xa1\x21\x12\x4d\x06\xb1\xc7\x7d\xca", "\xdd\xf8\xad\xe1\x3d\x69\xf3\x64\x9e\x36\xc6\x69\xd2\x5b\x4d\x81", - "\x01\x86\x15\x57\xd4\x3a\xb0\x14\xc4\xed\xe1\x9f\xcd\x75\x48\xea", 1, - 56, 128 }, + "\x01\x86\x15\x57\xd4\x3a\xb0\x14\xc4\xed\xe1\x9f\xcd\x75\x48\xea", 1, 56, 128 }, { 96, 256, 128, 155, "\x8e\x34\xcf\x73\xd2\x45\xa1\x08\x2a\x92\x0b\x86\x36\x4e\xb8\x96\xc4" "\x94\x64\x67\xbc\xb3\xd5\x89\x29\xfc\xb3\x66\x90\xe6\x39\x4f", @@ -1296,8 +1033,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xbd\x4c\xd0\x2f\xc7\x50\x2b\xbd\xbd\xf6\xc9\xa3\xcb\xe8\xf0", "\x16\xdd\xd2\x3f\xf5\x3f\x3d\x23\xc0\x63\x34\x48\x70\x40\xeb\x47", "\xc6\x0d\x2a\x92\xe6\x0a\x1a\x73\xa9\xce\x4b\x22\x69\xe1\x3a\x45", - "\x71\xfa\x66\x5b\x61\x1f\xed\x6e\xf5\xe6\x7e\xe8\x27\xac\x20\x6d", 1, - 120, 128 }, + "\x71\xfa\x66\x5b\x61\x1f\xed\x6e\xf5\xe6\x7e\xe8\x27\xac\x20\x6d", 1, 120, 128 }, { 96, 256, 128, 156, "\xcb\x55\x75\xf5\xc7\xc4\x5c\x91\xcf\x32\x0b\x13\x9f\xb5\x94\x23\x75" "\x60\xd0\xa3\xe6\xf8\x65\xa6\x7d\x4f\x63\x3f\x2c\x08\xf0\x16", @@ -1305,8 +1041,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x89\xcc\xe9\xfb\x47\x44\x1d\x07\xe0\x24\x5a\x66\xfe\x8b\x77\x8b", "\x62\x3b\x78\x50\xc3\x21\xe2\xcf\x0c\x6f\xbc\xc8\xdf\xd1\xaf\xf2", "\x72\x2a\xc6\xa2\x26\xf4\x9c\x90\xab\x22\x52\x7a\x51\x38\xb4\x01", - "\x2e\x4e\xe9\x97\xc7\x52\x78\x3e\x74\x3b\x36\x6b\xb6\xb3\x50\xa5", 1, - 128, 128 }, + "\x2e\x4e\xe9\x97\xc7\x52\x78\x3e\x74\x3b\x36\x6b\xb6\xb3\x50\xa5", 1, 128, 128 }, { 96, 256, 128, 157, "\xa5\x56\x9e\x72\x9a\x69\xb2\x4b\xa6\xe0\xff\x15\xc4\x62\x78\x97\x43" "\x68\x24\xc9\x41\xe9\xd0\x0b\x2e\x93\xfd\xdc\x4b\xa7\x76\x57", @@ -1315,8 +1050,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x0e", "\x87\xb3\xa4\xd7\xb2\x6d\x8d\x32\x03\xa0\xde\x1d\x64\xef\x82\xe3", "\x2f\xad\xf1\x6a\xd1\x6a\x21\xc3\x17\xaf\x9d\x0b\xc1\x87\xf1\x36", - "\x88\xca\xf7\x0f\x6b\x5d\x8f\x3e\xf6\xa3\x9d\x1a\xe4\x13\x77\x2b", 1, - 136, 128 }, + "\x88\xca\xf7\x0f\x6b\x5d\x8f\x3e\xf6\xa3\x9d\x1a\xe4\x13\x77\x2b", 1, 136, 128 }, { 96, 256, 128, 158, "\x07\x74\x33\x02\x2a\xb3\x4d\x38\x0f\xc1\x92\xfc\x24\xc2\xed\xc6\x30" "\x1f\xec\x6f\x24\x44\x2f\x57\x2a\x10\x87\xff\x2e\x05\xb3\x9a", @@ -1325,8 +1059,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x5e\x75\x10\x7f\x6e\x23\x7c\x69\xe8\x29\x60\x05\x22\x70", "\x03\xc8\x74\xee\xaa\xa6\xfa\x9f\x0d\xa6\x2c\x75\x8f\xb0\xad\x04", "\x13\x6f\x04\x9e\xa8\x51\xc6\xdf\xd2\xe8\x73\x12\xd8\x2f\x08\x82", - "\xfd\xf9\xbc\x04\x12\xcf\xca\x2b\x03\x5c\x5a\xe6\x8a\xc6\xda\x79", 1, - 248, 128 }, + "\xfd\xf9\xbc\x04\x12\xcf\xca\x2b\x03\x5c\x5a\xe6\x8a\xc6\xda\x79", 1, 248, 128 }, { 96, 256, 128, 159, "\x39\x37\x98\x6a\xf8\x6d\xaf\xc1\xba\x0c\x46\x72\xd8\xab\xc4\x6c\x20" "\x70\x62\x68\x2d\x9c\x26\x4a\xb0\x6d\x6c\x58\x07\x20\x51\x30", @@ -1335,8 +1068,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x69\xab\xc1\x9b\x1d\x4d\x90\x49\xa5\x55\x1e\x86\xec\x2b\x37", "\xdc\x9e\x9e\xaf\x11\xe3\x14\x18\x2d\xf6\xa4\xeb\xa1\x7a\xec\x9c", "\x2c\xed\x0d\x04\x32\x3d\xb2\x0a\xa8\xb8\xb9\x00\x0d\x2c\x33\xa5", - "\x48\xb8\x1c\xb7\x0d\x55\x5b\x7c\x38\x49\x2b\xa2\xc0\xa3\xb1\xb8", 1, - 256, 128 }, + "\x48\xb8\x1c\xb7\x0d\x55\x5b\x7c\x38\x49\x2b\xa2\xc0\xa3\xb1\xb8", 1, 256, 128 }, { 96, 256, 128, 160, "\x3f\x49\x4f\xd8\xf1\xb5\x06\x92\xde\x9c\xe3\x3f\x6d\x45\x1e\xf0\xc5" "\x8c\x6b\x2c\x6f\xfb\xa3\xb4\x17\x10\xff\x63\xe6\x7e\xda\x68", @@ -1347,30 +1079,25 @@ const struct aead_test aes_ccm_test_json[] = { "\x4a\x19\x1d\xc1\x1a\xe6\x60\xf5\xa8\x66\x2a\x46\x51\xe9", "\xf2\xc4\x1a\x26\xa4\x38\xe9\xff\x73\x3b\x78\x28\xf2\x4a\x24\x49", "\x1d\x9f\x42\x56\xe0\x84\x66\x56\x0a\xb2\x71\xde\x36\x21\xa0\x3f", - "\x81\xdb\xe3\x8a\xc7\x51\x12\x7e\xfc\x11\xca\xed\xec\xa9\xc9\x3b", 1, - 520, 128 }, + "\x81\xdb\xe3\x8a\xc7\x51\x12\x7e\xfc\x11\xca\xed\xec\xa9\xc9\x3b", 1, 520, 128 }, { 96, 256, 128, 161, "\xc1\x80\xc1\x2e\x6a\xf8\xcc\x07\x19\x04\x9e\xfe\x99\xd4\xdf\x2d\xe2" "\x41\xef\xec\x5a\x01\x31\x45\xb2\xb7\x5e\x15\xdb\xa1\x6f\xe5", "\x12\x6f\xbb\xd6\x99\xbe\xb3\x74\xf6\x7b\xaa\x7b", "", "", "", - "\x15\xdc\x4b\x81\x22\xb0\xe5\xad\x13\xdb\xea\x70\x96\xe8\x18\x68", 1, - 0, 0 }, + "\x15\xdc\x4b\x81\x22\xb0\xe5\xad\x13\xdb\xea\x70\x96\xe8\x18\x68", 1, 0, 0 }, { 96, 256, 128, 162, "\x80\x03\xe6\x54\x7a\x96\x4c\xd5\xc2\x84\x41\xc9\xb1\xa3\xc0\x83\xcc" "\xb9\x6c\x7e\x13\x83\x85\xa5\x29\x4a\x1c\x30\x6b\x05\xf9\xf4", "\xf2\x51\xc4\xa2\x62\x5c\x61\x2f\x86\xec\x16\x50", - "\x8c\x6e\xea\x97\x56\x15\x5d\x6e\xa9\x59\x5c\xc4\x9e\x8a\x74\xe1", - "", "", - "\xe6\xe9\x1b\xfe\x55\x18\xb7\x6e\x0a\x2d\xca\x79\xc6\x4d\x23\x2b", 1, - 128, 0 }, + "\x8c\x6e\xea\x97\x56\x15\x5d\x6e\xa9\x59\x5c\xc4\x9e\x8a\x74\xe1", "", "", + "\xe6\xe9\x1b\xfe\x55\x18\xb7\x6e\x0a\x2d\xca\x79\xc6\x4d\x23\x2b", 1, 128, 0 }, { 96, 256, 128, 163, "\xa4\x20\xe4\xf9\xa6\x16\xbf\x63\x1a\x94\x9b\x32\x4a\xe9\x01\x6a\x77" "\xd9\x43\xa0\xfd\x1d\xa2\xb3\xe9\x74\x2e\x2e\xe5\x0f\xa0\x97", "\x77\xf6\x71\x99\xab\x7b\x96\xf6\xf4\x83\x2c\x01", "", "\xfc\xaf\x04\xe3\x33\xd8\x76\xae\x34\xfc\xab\x93\xaf\xd7\xba\xa7", "\x13\x55\xcd\x0e\x1b\x42\xb1\x78\x81\x83\x00\x9a\x11\xca\xd5\x38", - "\x59\xd3\x5f\x9a\x12\xbe\xd5\xb5\xca\x87\x0b\x28\xba\xdb\x27\xf4", 1, - 0, 128 }, + "\x59\xd3\x5f\x9a\x12\xbe\xd5\xb5\xca\x87\x0b\x28\xba\xdb\x27\xf4", 1, 0, 128 }, { 96, 256, 128, 164, "\x69\x05\xf2\xc4\xd6\x3a\x7b\xa7\xe9\x36\x6b\xa6\xc3\xbb\xf6\xe3\x55" "\x2d\x56\x9e\xb5\x53\x21\xbe\xba\x3f\x8d\x98\xa1\x82\xb9\x7d", @@ -1378,8 +1105,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xab\xa0\xc4\x4e\x9f\x93\x99\x74\x8f\x4a\x7e\x91\x9c\xeb\x8a\x62", "\xb5\x62\x54\xe2\x21\xcf\x55\x8e\xa7\xd9\x19\x4e\xec\xd6\x3e\xd5", "\x68\xe6\x6f\x43\x3c\x3c\xf9\xe4\x24\x72\x25\x68\x2f\x4c\x73\xa4", - "\x07\xf5\x3a\x76\xb8\x44\x60\xec\xf4\xaa\x18\x13\xe5\x17\x0b\x2f", 1, - 128, 128 }, + "\x07\xf5\x3a\x76\xb8\x44\x60\xec\xf4\xaa\x18\x13\xe5\x17\x0b\x2f", 1, 128, 128 }, { 96, 256, 128, 165, "\x77\x0b\x39\x74\x1c\x56\xd4\x67\x00\xa9\xf3\xcc\x23\x1d\x1a\xcb\x17" "\x44\x98\x70\x2c\x0f\x2d\x0e\xec\x20\xdb\x57\x49\x4b\xb4\x9e", @@ -1388,8 +1114,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x75", "\x40\x52\xc0\xfc\x81\x63\x46\xc8\x69\x21\xdb\x57\x64\x6f\xeb\x29" "\x43", - "\xa1\x9a\x58\x53\x10\xce\xb2\xdf\x76\x7e\xc1\x72\x4d\x52\xe3\x9d", 1, - 0, 136 }, + "\xa1\x9a\x58\x53\x10\xce\xb2\xdf\x76\x7e\xc1\x72\x4d\x52\xe3\x9d", 1, 0, 136 }, { 96, 256, 128, 166, "\x41\xd6\xc6\xba\xbb\x72\x41\x53\x9a\xc1\x66\x47\x48\xdd\x1c\xf2\x9c" "\xe7\x94\x0e\x29\x15\x3c\xd8\x18\x0e\xd1\x97\xda\xb5\xc7\x3f", @@ -1399,8 +1124,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xb4", "\x99\xa4\x9b\xde\x03\x72\x8c\x47\x9d\xaf\x4c\x67\xd3\x07\xf1\x28" "\x5e", - "\xf0\xf3\x85\x9d\x12\xcd\x41\x48\xb9\xe8\x4d\x22\xba\x7a\xd9\x66", 1, - 128, 136 }, + "\xf0\xf3\x85\x9d\x12\xcd\x41\x48\xb9\xe8\x4d\x22\xba\x7a\xd9\x66", 1, 128, 136 }, { 96, 256, 128, 167, "\xbc\x53\x6d\x8d\x9b\x43\x40\xcd\x14\x14\x7f\xca\x7c\xa3\x65\x73\xba" "\x45\xbf\xf5\xb0\xa7\xcb\x80\x91\xa5\x50\xcf\x2b\x4b\xb9\x45", @@ -1409,8 +1133,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x7a\x9a\xb7\x46\x5a\xe4\x5e\xc8\x7a\xb4\xbe\xfd\x7c\xc9", "\xb6\xce\x6d\x86\xab\x7e\xee\x1f\xdd\x7d\xcb\x95\x5b\x83\x24\x36\x08" "\x39\xeb\x2b\xdd\xd8\x21\xec\xc1\xef\xe1\x29\x18\x26\x89", - "\x72\xfd\x99\x7b\xf0\x58\x9a\xa2\xd6\x07\x21\x65\x4f\x55\x2e\x3a", 1, - 0, 248 }, + "\x72\xfd\x99\x7b\xf0\x58\x9a\xa2\xd6\x07\x21\x65\x4f\x55\x2e\x3a", 1, 0, 248 }, { 96, 256, 128, 168, "\xf5\x9a\xbc\xbf\x42\x18\xbd\x5c\x76\x01\xf0\x80\xb5\xfb\xd3\xae\x08" "\x87\x33\x70\x2c\x8f\xbe\xf0\xc5\x29\x6a\x40\x6f\x56\x38\x27", @@ -1420,521 +1143,403 @@ const struct aead_test aes_ccm_test_json[] = { "\xec\x3e\x6f\xb1\xf6\xc6\xeb\x95\xf1\xc9\x65\xfb\x1a\x13", "\xc0\xb2\x7e\xdd\x65\x33\xcf\xba\x81\x32\x3a\xc7\x8d\x0a\xeb\x03\x71" "\xb1\xd7\xb8\x99\x38\xe0\x4c\x31\x91\x48\x96\x15\x13\xfb", - "\x56\xaa\xbb\xde\x47\xab\x2c\x53\xdb\x48\x70\x30\x33\xf8\xca\x68", 1, - 128, 248 }, + "\x56\xaa\xbb\xde\x47\xab\x2c\x53\xdb\x48\x70\x30\x33\xf8\xca\x68", 1, 128, 248 }, { 96, 256, 128, 169, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8a\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8a\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 170, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x89\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x89\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 171, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x0b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x0b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 172, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc3\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc3\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 173, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\xf7\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\xf7\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 174, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0c\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0c\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 175, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0f\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0f\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 176, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x8b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x8b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 177, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x93\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x93\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 178, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x12\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x12\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 179, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\xa0\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\xa0\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 180, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2e\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2e\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 181, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb8\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb8\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 182, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xbb\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xbb\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 183, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\x39\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\x39\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 184, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x11", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x11", 0, 0, 128 }, { 96, 256, 128, 185, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x12", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x12", 0, 0, 128 }, { 96, 256, 128, 186, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x50", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x50", 0, 0, 128 }, { 96, 256, 128, 187, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x90", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x0b\x92\x80\x2f\xdc\xb9\xd7\xd4\x90", 0, 0, 128 }, { 96, 256, 128, 188, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8a\xc2\xdd\x77\x0d\xe5\x8f\x0b\x93\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8a\xc2\xdd\x77\x0d\xe5\x8f\x0b\x93\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 189, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\xf7\x0d\xe5\x8f\x8b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, - 0, 128 }, + "\x8b\xc2\xdd\xf7\x0d\xe5\x8f\x8b\x92\x80\x2f\xdc\xb9\xd7\xd4\x10", 0, 0, 128 }, { 96, 256, 128, 190, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x8b\x92\x80\x2f\xdc\xb9\xd7\xd4\x90", 0, - 0, 128 }, + "\x8b\xc2\xdd\x77\x0d\xe5\x8f\x8b\x92\x80\x2f\xdc\xb9\xd7\xd4\x90", 0, 0, 128 }, { 96, 256, 128, 191, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x74\x3d\x22\x88\xf2\x1a\x70\xf4\x6d\x7f\xd0\x23\x46\x28\x2b\xef", 0, - 0, 128 }, + "\x74\x3d\x22\x88\xf2\x1a\x70\xf4\x6d\x7f\xd0\x23\x46\x28\x2b\xef", 0, 0, 128 }, { 96, 256, 128, 192, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, 128 }, { 96, 256, 128, 193, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, 128 }, { 96, 256, 128, 194, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x0b\x42\x5d\xf7\x8d\x65\x0f\x8b\x12\x00\xaf\x5c\x39\x57\x54\x90", 0, - 0, 128 }, + "\x0b\x42\x5d\xf7\x8d\x65\x0f\x8b\x12\x00\xaf\x5c\x39\x57\x54\x90", 0, 0, 128 }, { 96, 256, 128, 195, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x9d\x2a\x30\xab\xc5\xe1\x78\xf7\xc6\x31\x7e\xc9\x49\x8d\xac\x39", - "\x8a\xc3\xdc\x76\x0c\xe4\x8e\x0a\x93\x81\x2e\xdd\xb8\xd6\xd5\x11", 0, - 0, 128 }, - { 56, 128, 128, 196, - "\x19\xd5\x32\xdb\xcc\x93\x4a\x00\x9c\xe1\xb9\x4a\x0b\x31\xdd\xc7", + "\x8a\xc3\xdc\x76\x0c\xe4\x8e\x0a\x93\x81\x2e\xdd\xb8\xd6\xd5\x11", 0, 0, 128 }, + { 56, 128, 128, 196, "\x19\xd5\x32\xdb\xcc\x93\x4a\x00\x9c\xe1\xb9\x4a\x0b\x31\xdd\xc7", "\xf0\xbf\x6a\x9b\xcf\x6c\x0d", "", "", "", - "\x7b\x12\x26\x3a\xaf\x1e\x4c\xb6\xe4\xb4\x06\xe0\x26\x69\x82\x09", 1, - 0, 0 }, - { 56, 128, 128, 197, - "\x8c\xdb\x7f\x67\x89\x27\x1a\x6e\xf3\xe0\x64\x61\xe9\x0e\xaa\x0e", - "\x7c\x0d\x6b\xce\xba\x28\x2e", "\xfb\xc4\xf4\xa5\x2e\xcb\x4c\xaa", - "", "", - "\x50\xb1\x2c\x1f\xa4\xdc\x4b\x2d\xc4\xdd\x0e\xb1\x52\xdb\x41\x9e", 1, - 64, 0 }, - { 56, 128, 128, 198, - "\x6b\xd7\x36\x3b\xe8\x1b\x3f\x80\x3c\x7f\xae\xe6\x07\x05\x02\x74", + "\x7b\x12\x26\x3a\xaf\x1e\x4c\xb6\xe4\xb4\x06\xe0\x26\x69\x82\x09", 1, 0, 0 }, + { 56, 128, 128, 197, "\x8c\xdb\x7f\x67\x89\x27\x1a\x6e\xf3\xe0\x64\x61\xe9\x0e\xaa\x0e", + "\x7c\x0d\x6b\xce\xba\x28\x2e", "\xfb\xc4\xf4\xa5\x2e\xcb\x4c\xaa", "", "", + "\x50\xb1\x2c\x1f\xa4\xdc\x4b\x2d\xc4\xdd\x0e\xb1\x52\xdb\x41\x9e", 1, 64, 0 }, + { 56, 128, 128, 198, "\x6b\xd7\x36\x3b\xe8\x1b\x3f\x80\x3c\x7f\xae\xe6\x07\x05\x02\x74", "\x30\x3d\xa6\x78\xd1\x67\x9e", "", "\x53\x9c\x7d\x6f\xcc\x0a\x69\x1b\xd3\x9b\xc4\x34\x22\xd4\xe1\x3c", "\x38\x33\x8e\x92\x4b\xf2\xec\xc3\xae\x0f\x5f\x75\xf2\xaf\x2d\x30", - "\xe4\x0b\xbb\xa6\x73\x49\x55\x22\x3f\xab\x6d\xdb\x3c\x7b\xba\x83", 1, - 0, 128 }, - { 56, 128, 128, 199, - "\x5b\x49\xd6\x7b\x0a\x74\xe3\xf3\x9e\x8d\x0b\xac\x6a\x00\x50\x40", + "\xe4\x0b\xbb\xa6\x73\x49\x55\x22\x3f\xab\x6d\xdb\x3c\x7b\xba\x83", 1, 0, 128 }, + { 56, 128, 128, 199, "\x5b\x49\xd6\x7b\x0a\x74\xe3\xf3\x9e\x8d\x0b\xac\x6a\x00\x50\x40", "\xb9\xbb\xb9\xae\x00\x3b\x08", "\xaa\xdc\xed\xa4\x4e\x5d\x23\x23", "\xfe\x66\xe3\x59\xd3\x40\xec\x00\x24\x17\x36\xc2\xa6\x78\x90\x02", "\xa4\x41\xe2\xeb\x45\x8f\x8a\x6f\x2a\xc7\x56\x27\xab\x10\x85\xef", - "\x5c\x54\x51\x81\x68\x52\x79\x65\x21\x87\x81\x9a\xa6\xd1\x5b\x86", 1, - 64, 128 }, - { 56, 128, 128, 200, - "\x6a\x5b\x3b\x57\xf8\x3c\xac\x23\xeb\xbb\x97\xa6\x0f\x9c\x13\xc3", + "\x5c\x54\x51\x81\x68\x52\x79\x65\x21\x87\x81\x9a\xa6\xd1\x5b\x86", 1, 64, 128 }, + { 56, 128, 128, 200, "\x6a\x5b\x3b\x57\xf8\x3c\xac\x23\xeb\xbb\x97\xa6\x0f\x9c\x13\xc3", "\x64\xc0\x18\x42\xe7\x3e\x74", "", "\x7d\xab\x0c\x47\x34\x73\xdf\x8d\x30\x12\xc3\xfd\xf0\x93\xf0\x07" "\x09", "\xfb\x8f\x96\x40\x65\x71\x8f\x93\x90\x10\xea\x5e\x5d\xa3\x27\xcd" "\xdb", - "\xed\xd3\x49\xc3\x74\xc3\xd0\xdb\x1a\xc3\x6f\x11\xb1\x50\x6d\x2c", 1, - 0, 136 }, - { 56, 128, 128, 201, - "\xeb\x26\x3b\x3a\x87\xfc\xf2\x32\x32\x7a\x05\xb2\x07\x92\x92\xab", + "\xed\xd3\x49\xc3\x74\xc3\xd0\xdb\x1a\xc3\x6f\x11\xb1\x50\x6d\x2c", 1, 0, 136 }, + { 56, 128, 128, 201, "\xeb\x26\x3b\x3a\x87\xfc\xf2\x32\x32\x7a\x05\xb2\x07\x92\x92\xab", "\x95\x54\x02\x3b\xad\xf3\xe2", "\xbe\x0d\xd7\x00\x2e\x2f\xe3\x58", "\x0c\xac\x1a\xfd\x57\x08\xab\x03\xc8\xd3\xfe\x1d\x7c\xc8\x3b\x26" "\xff", "\x81\x86\x0e\x45\xcb\x00\x9f\x57\x28\xf8\x0f\xd1\xdf\x21\x4f\x84" "\x49", - "\xa2\xcb\x64\x54\xa2\xa4\x9e\x96\xed\xca\x89\xb9\x4e\x49\xc5\x0c", 1, - 64, 136 }, - { 64, 128, 128, 202, - "\xf3\x43\x47\x25\xc8\x2a\x7f\x8b\xb0\x7d\xf1\xf8\x12\x2f\xb6\xc9", + "\xa2\xcb\x64\x54\xa2\xa4\x9e\x96\xed\xca\x89\xb9\x4e\x49\xc5\x0c", 1, 64, 136 }, + { 64, 128, 128, 202, "\xf3\x43\x47\x25\xc8\x2a\x7f\x8b\xb0\x7d\xf1\xf8\x12\x2f\xb6\xc9", "\x28\xe9\xb7\x85\x17\x24\xba\xe3", "", "", "", - "\x1c\x64\x58\x30\xe6\xee\x05\x58\x9b\x70\xf0\x23\x47\xe1\x1c\x93", 1, - 0, 0 }, - { 64, 128, 128, 203, - "\xea\xf5\xc7\xe3\x5b\x61\xc6\x4f\xd8\x99\xbf\x26\x50\x6c\xb8\x3c", - "\x07\x1f\xfe\xd7\x58\x5e\xb0\xb7", - "\xf0\xaf\x44\x31\xf3\x3e\x7e\x15", "", "", - "\xe5\xe1\x54\xd4\x3f\x32\x98\x89\x6b\x34\xbb\x4f\x76\xb7\x39\x9f", 1, - 64, 0 }, - { 64, 128, 128, 204, - "\xde\xb6\x22\x33\x55\x9b\x57\x47\x66\x02\xb5\xad\xac\x57\xc7\x7f", + "\x1c\x64\x58\x30\xe6\xee\x05\x58\x9b\x70\xf0\x23\x47\xe1\x1c\x93", 1, 0, 0 }, + { 64, 128, 128, 203, "\xea\xf5\xc7\xe3\x5b\x61\xc6\x4f\xd8\x99\xbf\x26\x50\x6c\xb8\x3c", + "\x07\x1f\xfe\xd7\x58\x5e\xb0\xb7", "\xf0\xaf\x44\x31\xf3\x3e\x7e\x15", "", "", + "\xe5\xe1\x54\xd4\x3f\x32\x98\x89\x6b\x34\xbb\x4f\x76\xb7\x39\x9f", 1, 64, 0 }, + { 64, 128, 128, 204, "\xde\xb6\x22\x33\x55\x9b\x57\x47\x66\x02\xb5\xad\xac\x57\xc7\x7f", "\xd0\x84\x54\x7d\xe5\x5b\xbc\x15", "", "\xd8\x98\x6d\xf0\x24\x1e\xd3\x29\x75\x82\xc0\xc2\x39\xc7\x24\xcb", "\x97\xbc\x3c\x09\xd5\xe3\x71\x78\xe7\xfd\xd3\x5d\x53\x23\x91\x80", - "\x3a\x2d\xc0\xbf\xde\x10\x24\x70\x29\xf5\xc4\x89\xe3\x06\xa3\x96", 1, - 0, 128 }, - { 64, 128, 128, 205, - "\x9e\xbe\x10\xef\x15\xeb\xcc\x60\x00\xed\x72\xd9\x74\x21\x9b\x97", - "\x28\xa8\x40\x39\xf2\xda\xe6\x51", - "\x1b\xab\x91\x6d\x21\xbc\xbb\x35", + "\x3a\x2d\xc0\xbf\xde\x10\x24\x70\x29\xf5\xc4\x89\xe3\x06\xa3\x96", 1, 0, 128 }, + { 64, 128, 128, 205, "\x9e\xbe\x10\xef\x15\xeb\xcc\x60\x00\xed\x72\xd9\x74\x21\x9b\x97", + "\x28\xa8\x40\x39\xf2\xda\xe6\x51", "\x1b\xab\x91\x6d\x21\xbc\xbb\x35", "\xd0\x73\xa8\x8d\x45\x36\x41\x51\x40\x87\x18\x78\x69\x30\xed\xfb", "\x6a\xdf\x7f\x96\xa3\x20\x22\x71\xb0\x37\x87\x37\x2f\x4c\xf3\xce", - "\x50\xbc\xdd\x15\x2a\xe3\x31\x55\x48\x78\xf9\xa2\xb8\x14\x0e\x72", 1, - 64, 128 }, - { 64, 128, 128, 206, - "\x74\xdf\xd2\x96\x3b\xc8\x14\x83\x38\x09\x44\x14\xe3\xfc\x2b\x8d", + "\x50\xbc\xdd\x15\x2a\xe3\x31\x55\x48\x78\xf9\xa2\xb8\x14\x0e\x72", 1, 64, 128 }, + { 64, 128, 128, 206, "\x74\xdf\xd2\x96\x3b\xc8\x14\x83\x38\x09\x44\x14\xe3\xfc\x2b\x8d", "\xd1\xef\x66\xef\x2e\xb7\x65\xb8", "", "\x17\x9c\x18\x65\xe2\xbc\x0f\x70\x24\x87\xc4\xe5\x4f\x83\x74\x45" "\x7e", "\xa4\xb7\xb9\xc9\xc9\x02\xed\xdb\x02\xfb\x64\x87\x31\x40\x25\x6e" "\x94", - "\x4b\xc1\xe9\x91\x48\xf6\xa4\x72\x2d\x4b\x92\x73\x4b\x08\x8d\x43", 1, - 0, 136 }, - { 64, 128, 128, 207, - "\x5b\xf0\x96\x5f\x14\x39\xed\x83\xee\xde\xaa\xd9\x46\x7f\x5f\x60", - "\xb9\x26\x8f\xec\xa7\x29\x68\x0f", - "\x31\xfb\x02\xa7\xf4\xeb\xe9\xaa", + "\x4b\xc1\xe9\x91\x48\xf6\xa4\x72\x2d\x4b\x92\x73\x4b\x08\x8d\x43", 1, 0, 136 }, + { 64, 128, 128, 207, "\x5b\xf0\x96\x5f\x14\x39\xed\x83\xee\xde\xaa\xd9\x46\x7f\x5f\x60", + "\xb9\x26\x8f\xec\xa7\x29\x68\x0f", "\x31\xfb\x02\xa7\xf4\xeb\xe9\xaa", "\xc8\x44\xb6\xc4\x57\xe1\xe5\xf4\x3f\x82\xb4\xe4\x84\xb4\x70\x9e" "\xf1", "\x61\x1e\xe7\xdf\x91\xb0\x62\xb7\x5d\xf8\x6b\x10\xa4\xce\xeb\x01" "\x34", - "\x9a\x56\x7c\x20\x65\xd7\x83\x2c\x35\xf6\x14\x3a\x41\x41\x46\x62", 1, - 64, 136 }, - { 72, 128, 128, 208, - "\x2e\xc7\xa4\x68\xe3\x64\x91\x86\xe1\xf9\xde\xcc\xdf\x95\xa2\x29", + "\x9a\x56\x7c\x20\x65\xd7\x83\x2c\x35\xf6\x14\x3a\x41\x41\x46\x62", 1, 64, 136 }, + { 72, 128, 128, 208, "\x2e\xc7\xa4\x68\xe3\x64\x91\x86\xe1\xf9\xde\xcc\xdf\x95\xa2\x29", "\x99\xfd\xb1\x58\xfb\x8e\xbc\xce\x64", "", "", "", - "\x65\x8f\x01\xf9\x0c\x35\x33\x1c\xdd\x69\x86\xf7\x36\xcc\x37\xda", 1, - 0, 0 }, - { 72, 128, 128, 209, - "\xc6\xbc\x09\x87\xb5\xdc\x94\x32\xda\x66\xbd\xb1\x53\x85\x9f\xda", - "\xd7\x68\xd1\xb8\x0a\x09\x45\x06\xb4", - "\x47\x13\xf8\x6a\x53\xce\xdd\x50", "", "", - "\x4e\xc3\x1d\xfe\xbf\xf4\xa9\x0d\x5e\xfb\xdb\x85\x04\xcd\x8c\x79", 1, - 64, 0 }, - { 72, 128, 128, 210, - "\x6a\x1c\x98\xe4\xd2\x0b\xc6\xad\x59\x48\x33\xd6\xe9\xaa\x47\x94", + "\x65\x8f\x01\xf9\x0c\x35\x33\x1c\xdd\x69\x86\xf7\x36\xcc\x37\xda", 1, 0, 0 }, + { 72, 128, 128, 209, "\xc6\xbc\x09\x87\xb5\xdc\x94\x32\xda\x66\xbd\xb1\x53\x85\x9f\xda", + "\xd7\x68\xd1\xb8\x0a\x09\x45\x06\xb4", "\x47\x13\xf8\x6a\x53\xce\xdd\x50", "", "", + "\x4e\xc3\x1d\xfe\xbf\xf4\xa9\x0d\x5e\xfb\xdb\x85\x04\xcd\x8c\x79", 1, 64, 0 }, + { 72, 128, 128, 210, "\x6a\x1c\x98\xe4\xd2\x0b\xc6\xad\x59\x48\x33\xd6\xe9\xaa\x47\x94", "\x3d\xe2\x9d\x92\xd3\x01\x8e\xaa\xfc", "", "\xf6\x23\x32\x2f\xef\x6d\x49\xcf\x7a\xbf\xa1\x6b\x5f\xd8\x39\x51", "\xaf\xcb\xf0\x38\x5f\x26\x89\x5b\xcd\x61\x26\x60\x06\xdc\x1d\x98", - "\x79\x14\xe3\x2d\x18\x10\x43\x32\x12\x34\xdc\x16\xd7\x9b\x35\x76", 1, - 0, 128 }, - { 72, 128, 128, 211, - "\x02\x2b\x66\x9b\x7d\x39\x1f\x0f\xf5\xfa\xb1\x23\xc2\xba\x88\x17", - "\x2e\x02\xb0\x4c\xe6\xb3\x48\xef\x86", - "\xf9\xc8\x62\x29\x17\x05\x51\x9b", + "\x79\x14\xe3\x2d\x18\x10\x43\x32\x12\x34\xdc\x16\xd7\x9b\x35\x76", 1, 0, 128 }, + { 72, 128, 128, 211, "\x02\x2b\x66\x9b\x7d\x39\x1f\x0f\xf5\xfa\xb1\x23\xc2\xba\x88\x17", + "\x2e\x02\xb0\x4c\xe6\xb3\x48\xef\x86", "\xf9\xc8\x62\x29\x17\x05\x51\x9b", "\xab\xb1\x8f\x46\x62\xc1\xbf\xa7\x98\x45\x60\xde\xac\x4a\x41\x5a", "\x45\xc3\xab\x70\xb1\xc8\x83\xc9\x8b\x53\xfc\x9c\x0b\xe7\x7e\xcb", - "\x2e\xce\xd5\xeb\x7d\x60\x43\x1c\x09\xd3\xba\x49\x23\x0b\x23\xd0", 1, - 64, 128 }, - { 72, 128, 128, 212, - "\x89\x65\xe6\x41\xf4\x6d\xbb\xb1\x6a\xa8\x3f\x94\x59\x37\x0d\xc9", + "\x2e\xce\xd5\xeb\x7d\x60\x43\x1c\x09\xd3\xba\x49\x23\x0b\x23\xd0", 1, 64, 128 }, + { 72, 128, 128, 212, "\x89\x65\xe6\x41\xf4\x6d\xbb\xb1\x6a\xa8\x3f\x94\x59\x37\x0d\xc9", "\x31\x0c\x4e\xe0\x82\xc4\x87\x0f\xc2", "", "\x5d\x22\x78\xc8\xb4\xed\x8a\x37\xc9\x54\x88\x93\x5c\x1d\xb0\x6e" "\x68", "\xdb\x91\xb9\x8d\xa5\x78\xd8\xe4\xeb\xf1\x8f\x65\xf2\x44\x57\x9e" "\xb7", - "\x21\x25\xef\x21\xfc\xba\x47\x10\x39\xc1\x31\x78\x6c\x99\xe7\x4e", 1, - 0, 136 }, - { 72, 128, 128, 213, - "\x22\xc9\x42\xb1\x21\x2a\x3c\xfa\x19\x6e\x9a\xd0\x6b\x03\xfb\x2b", - "\x71\xa2\xb8\x75\x40\xb1\x1d\x76\xa6", - "\xc0\xe0\x59\x60\xb8\x31\xe8\x75", + "\x21\x25\xef\x21\xfc\xba\x47\x10\x39\xc1\x31\x78\x6c\x99\xe7\x4e", 1, 0, 136 }, + { 72, 128, 128, 213, "\x22\xc9\x42\xb1\x21\x2a\x3c\xfa\x19\x6e\x9a\xd0\x6b\x03\xfb\x2b", + "\x71\xa2\xb8\x75\x40\xb1\x1d\x76\xa6", "\xc0\xe0\x59\x60\xb8\x31\xe8\x75", "\x4e\x3b\x6e\x3e\x2b\xa5\x66\x3e\xeb\xc5\xd8\x3d\xc2\x49\xea\xbc" "\xe1", "\x6f\xfa\x87\x5b\x85\x3c\xc4\xf6\xa4\x1a\xfd\x43\x0b\xd7\xc3\xce" "\xee", - "\x0b\x49\x64\x85\x6b\xb2\xb2\x7e\xda\x38\x26\xae\x12\x8f\x67\xb3", 1, - 64, 136 }, - { 80, 128, 128, 214, - "\x1e\x6c\x62\x14\xa6\xa5\xdd\x5b\x62\x8c\x71\xde\x07\x78\x81\x37", + "\x0b\x49\x64\x85\x6b\xb2\xb2\x7e\xda\x38\x26\xae\x12\x8f\x67\xb3", 1, 64, 136 }, + { 80, 128, 128, 214, "\x1e\x6c\x62\x14\xa6\xa5\xdd\x5b\x62\x8c\x71\xde\x07\x78\x81\x37", "\x40\xbc\xc3\x15\xde\xc8\x8b\xf3\x26\xcc", "", "", "", - "\xdf\xd7\x0e\x3e\x5a\x13\x16\x6b\x46\x06\x13\xab\xab\x92\x8f\x26", 1, - 0, 0 }, - { 80, 128, 128, 215, - "\xe4\x13\x43\xe5\xff\xe2\x0f\xe4\x8f\xf0\x10\xb1\x46\xce\xae\xad", - "\x5f\x17\x2f\xbe\x9f\x8e\xec\x0f\xbf\x79", - "\x9b\x46\x67\x59\x01\xa4\xbe\x0f", "", "", - "\x21\x04\xbc\x9e\xcb\x79\xb7\x1f\x32\xf2\x7c\x9e\xe4\xfe\xc6\x40", 1, - 64, 0 }, - { 80, 128, 128, 216, - "\xfc\x93\x58\x2f\xa1\xf8\xb5\x8c\xc9\xe8\x0d\xd5\x83\xe9\xbf\x8b", + "\xdf\xd7\x0e\x3e\x5a\x13\x16\x6b\x46\x06\x13\xab\xab\x92\x8f\x26", 1, 0, 0 }, + { 80, 128, 128, 215, "\xe4\x13\x43\xe5\xff\xe2\x0f\xe4\x8f\xf0\x10\xb1\x46\xce\xae\xad", + "\x5f\x17\x2f\xbe\x9f\x8e\xec\x0f\xbf\x79", "\x9b\x46\x67\x59\x01\xa4\xbe\x0f", "", "", + "\x21\x04\xbc\x9e\xcb\x79\xb7\x1f\x32\xf2\x7c\x9e\xe4\xfe\xc6\x40", 1, 64, 0 }, + { 80, 128, 128, 216, "\xfc\x93\x58\x2f\xa1\xf8\xb5\x8c\xc9\xe8\x0d\xd5\x83\xe9\xbf\x8b", "\x5d\x4b\xf5\x87\x98\xfa\xc3\x51\xa3\x99", "", "\x86\x6d\x5e\x1b\x0a\xa2\x90\x04\xe5\x1e\xa8\x7d\xe8\x6e\x3c\x05", "\xb6\x46\x50\xb6\x93\x5f\xb0\x4b\x97\x42\xf5\x72\x9f\x28\x6e\x03", - "\xb9\xd3\x94\x7c\x16\x05\xa2\xd5\x8e\xc3\xf3\x22\x18\x46\xc7\xda", 1, - 0, 128 }, - { 80, 128, 128, 217, - "\xdf\x2d\xb4\x8b\x19\x44\xfd\x9e\x24\x58\x9d\x14\x35\x7d\x0f\x80", - "\xf9\xa1\xbb\x32\xf5\x79\xb5\xf0\x27\x28", - "\x03\x92\x26\x00\xd7\xd0\x33\xdd", + "\xb9\xd3\x94\x7c\x16\x05\xa2\xd5\x8e\xc3\xf3\x22\x18\x46\xc7\xda", 1, 0, 128 }, + { 80, 128, 128, 217, "\xdf\x2d\xb4\x8b\x19\x44\xfd\x9e\x24\x58\x9d\x14\x35\x7d\x0f\x80", + "\xf9\xa1\xbb\x32\xf5\x79\xb5\xf0\x27\x28", "\x03\x92\x26\x00\xd7\xd0\x33\xdd", "\xea\xfb\x69\xe4\x02\x38\xa3\x4e\x39\x85\x23\xfb\x35\xbd\x66\x12", "\x9d\xe6\xac\x37\xf5\x2b\x81\x35\x04\x7a\xf8\xd5\xe5\x7f\xb3\x6e", - "\x05\x43\x35\x1a\xa8\x6f\xf8\xca\x58\x25\xbd\x7b\xb7\xc0\x25\x4e", 1, - 64, 128 }, - { 80, 128, 128, 218, - "\x3b\xf8\xc3\xc3\x01\x19\x0d\x23\xf7\x1a\xc8\x2c\x0c\x5b\x0f\x9b", + "\x05\x43\x35\x1a\xa8\x6f\xf8\xca\x58\x25\xbd\x7b\xb7\xc0\x25\x4e", 1, 64, 128 }, + { 80, 128, 128, 218, "\x3b\xf8\xc3\xc3\x01\x19\x0d\x23\xf7\x1a\xc8\x2c\x0c\x5b\x0f\x9b", "\xd5\x27\x44\x06\xa4\xf5\xa2\xe2\xd1\x01", "", "\x03\xca\x74\xe5\x8b\x8b\x38\x50\x0e\x1e\x65\xb8\x33\x2f\x41\xf0" "\x6c", "\x99\x9f\x47\x6b\x51\xce\x68\x6a\xf5\x9b\x0b\xbe\x22\x1c\xe4\xe8" "\xa4", - "\x2a\xc4\x83\x77\xd2\x39\xfa\x7f\xfb\xe3\xc5\x03\xe0\x27\x8f\x98", 1, - 0, 136 }, - { 80, 128, 128, 219, - "\x16\x94\x2e\xb8\x9d\x4f\x7f\xe6\x5b\xf9\xb4\x9c\x16\xf8\x30\xab", - "\x2b\xa7\x6d\x03\x99\x5c\x62\xdc\x7e\xd2", - "\x32\xc7\xc6\x07\x2d\xbd\x73\x5f", + "\x2a\xc4\x83\x77\xd2\x39\xfa\x7f\xfb\xe3\xc5\x03\xe0\x27\x8f\x98", 1, 0, 136 }, + { 80, 128, 128, 219, "\x16\x94\x2e\xb8\x9d\x4f\x7f\xe6\x5b\xf9\xb4\x9c\x16\xf8\x30\xab", + "\x2b\xa7\x6d\x03\x99\x5c\x62\xdc\x7e\xd2", "\x32\xc7\xc6\x07\x2d\xbd\x73\x5f", "\xb2\x38\x0e\x9e\xb5\x96\xd5\xaf\x69\x7c\x0b\xa1\xd3\x01\xa8\x33" "\xd9", "\xf5\x63\xca\xb1\xf5\xe5\x6f\x23\x7a\x60\xc2\xc2\x95\x0a\xb7\xa5" "\xc2", - "\x25\xc8\x9e\x41\x0c\x0a\x53\x5b\x94\xa3\x83\xad\x3c\x01\x44\x64", 1, - 64, 136 }, - { 88, 128, 128, 220, - "\x9d\x2f\xa7\x59\x29\x61\x2e\x12\x13\x46\x0f\x99\x89\x46\xdc\xec", + "\x25\xc8\x9e\x41\x0c\x0a\x53\x5b\x94\xa3\x83\xad\x3c\x01\x44\x64", 1, 64, 136 }, + { 88, 128, 128, 220, "\x9d\x2f\xa7\x59\x29\x61\x2e\x12\x13\x46\x0f\x99\x89\x46\xdc\xec", "\x0e\x94\x8a\x03\xdb\xfa\x10\x81\x7e\x88\x26", "", "", "", - "\x2f\x1f\xa3\x58\x5b\x9a\x11\xff\x47\xbd\x48\x6f\x95\x57\x22\x46", 1, - 0, 0 }, - { 88, 128, 128, 221, - "\x7a\x97\x04\x06\xa7\x47\xc2\x32\x7e\xcb\xc8\xb1\x07\xa1\x90\xcd", - "\x99\xb0\x79\xde\x95\x2d\x60\xda\x0d\x03\x4b", - "\x2f\x08\x0b\x2d\xeb\x66\x44\xef", "", "", - "\x9d\xca\x9b\xa4\x41\x01\x3c\xe9\xfc\x0a\xc3\xdb\xf4\x14\x62\x6d", 1, - 64, 0 }, - { 88, 128, 128, 222, - "\xac\xab\x31\x48\x3d\x9d\xe4\xad\x77\xf4\xe6\x3f\xe4\x1b\x57\xae", + "\x2f\x1f\xa3\x58\x5b\x9a\x11\xff\x47\xbd\x48\x6f\x95\x57\x22\x46", 1, 0, 0 }, + { 88, 128, 128, 221, "\x7a\x97\x04\x06\xa7\x47\xc2\x32\x7e\xcb\xc8\xb1\x07\xa1\x90\xcd", + "\x99\xb0\x79\xde\x95\x2d\x60\xda\x0d\x03\x4b", "\x2f\x08\x0b\x2d\xeb\x66\x44\xef", "", + "", "\x9d\xca\x9b\xa4\x41\x01\x3c\xe9\xfc\x0a\xc3\xdb\xf4\x14\x62\x6d", 1, 64, 0 }, + { 88, 128, 128, 222, "\xac\xab\x31\x48\x3d\x9d\xe4\xad\x77\xf4\xe6\x3f\xe4\x1b\x57\xae", "\x5c\x09\x39\xe7\x1b\xae\x1a\x9d\xe1\x67\xd4", "", "\xe4\xd7\x2b\x2f\x7c\xb6\x9b\xc5\x4a\x49\xf4\xd5\xce\xa4\xf2\x3a", "\x0c\x50\x68\x43\xba\x7b\xd2\xdc\x45\x78\xe6\xbb\x83\xfd\x0c\x8d", - "\xc2\x75\x37\x30\x37\x63\x5b\xae\x29\x4f\x99\xc8\xe4\x69\x64\xb3", 1, - 0, 128 }, - { 88, 128, 128, 223, - "\x82\x84\x1e\xf7\xfb\xae\x35\x54\x65\x25\xfb\xbe\xbf\x47\x18\xfb", - "\xb5\xcd\x81\x8f\x73\xa3\x6e\xd0\x25\xb6\xcf", - "\x44\xf4\x8c\x2a\x20\x45\x63\x58", + "\xc2\x75\x37\x30\x37\x63\x5b\xae\x29\x4f\x99\xc8\xe4\x69\x64\xb3", 1, 0, 128 }, + { 88, 128, 128, 223, "\x82\x84\x1e\xf7\xfb\xae\x35\x54\x65\x25\xfb\xbe\xbf\x47\x18\xfb", + "\xb5\xcd\x81\x8f\x73\xa3\x6e\xd0\x25\xb6\xcf", "\x44\xf4\x8c\x2a\x20\x45\x63\x58", "\x8c\x2c\x82\x3b\xb3\x99\x41\xb1\xc6\xb7\x5b\xbc\x82\xf0\x5b\xa4", "\xb2\x87\xc6\x37\xa7\x55\x43\x62\xc8\x0d\x6b\x24\xd5\x0d\xdf\xb3", - "\x39\x67\x27\x7d\xa0\xf8\x56\xf8\xf0\xad\x49\x28\x28\x94\xd2\xbb", 1, - 64, 128 }, - { 88, 128, 128, 224, - "\xf9\xc6\xd9\x62\x7f\xd2\xe7\x31\xe2\xf1\x15\xb3\xd0\xa5\x3b\xfd", + "\x39\x67\x27\x7d\xa0\xf8\x56\xf8\xf0\xad\x49\x28\x28\x94\xd2\xbb", 1, 64, 128 }, + { 88, 128, 128, 224, "\xf9\xc6\xd9\x62\x7f\xd2\xe7\x31\xe2\xf1\x15\xb3\xd0\xa5\x3b\xfd", "\x08\x45\x58\xeb\xfb\x65\x82\xf3\xd1\x87\x9a", "", "\x74\x63\xaf\x94\x62\x62\x79\xce\x01\x12\xf6\x70\xc3\x11\x50\x99" "\xfd", "\xd4\x6b\x6e\x96\x2b\x6b\x7a\x23\x52\xfc\x43\x79\x14\xd9\xc0\xd9" "\xc0", - "\xeb\xe3\x36\x17\x6e\x27\x04\x1a\xe7\x87\x91\xac\xa3\x45\x48\xc8", 1, - 0, 136 }, - { 88, 128, 128, 225, - "\x1d\x28\x6e\x52\x5e\xc2\x86\x4d\x9e\xa6\xe7\xad\xfb\xdc\x49\x70", - "\x1a\xd4\x48\x79\xf1\x94\x7a\xbd\x50\x3d\xce", - "\x1d\xb0\xea\xaa\xa1\xe2\xc8\x48", + "\xeb\xe3\x36\x17\x6e\x27\x04\x1a\xe7\x87\x91\xac\xa3\x45\x48\xc8", 1, 0, 136 }, + { 88, 128, 128, 225, "\x1d\x28\x6e\x52\x5e\xc2\x86\x4d\x9e\xa6\xe7\xad\xfb\xdc\x49\x70", + "\x1a\xd4\x48\x79\xf1\x94\x7a\xbd\x50\x3d\xce", "\x1d\xb0\xea\xaa\xa1\xe2\xc8\x48", "\x7b\x40\xe6\xc9\x87\x69\x2d\x02\x02\xcb\x6f\x44\xb4\x23\xc2\x67" "\xdd", "\x84\xf9\x1f\x9d\x35\xb9\x98\x59\x8e\x50\xfe\xb3\x4d\xca\xa0\xd2" "\x60", - "\xae\x4e\x38\xcc\x4b\x73\x09\x44\xbc\x45\x9d\xf8\x5a\x53\x6f\x4e", 1, - 64, 136 }, - { 104, 128, 128, 226, - "\x69\x4a\x2a\xe9\x4c\xc2\xfc\x6c\x82\xdc\xd1\x6c\x58\xa3\x41\x95", + "\xae\x4e\x38\xcc\x4b\x73\x09\x44\xbc\x45\x9d\xf8\x5a\x53\x6f\x4e", 1, 64, 136 }, + { 104, 128, 128, 226, "\x69\x4a\x2a\xe9\x4c\xc2\xfc\x6c\x82\xdc\xd1\x6c\x58\xa3\x41\x95", "\x8b\x4d\xe9\x49\x7e\x78\xd9\xc7\x3b\xdc\xb3\x74\xde", "", "", "", - "\x36\xb2\x0b\xcb\x06\x46\x09\xcb\xc0\x3a\xe3\x27\x86\xf7\x2e\xb5", 1, - 0, 0 }, - { 104, 128, 128, 227, - "\x26\x8c\x96\x1a\x4f\xa5\x4c\x21\x4a\x2a\xf8\xfe\x76\xa2\x77\xcc", + "\x36\xb2\x0b\xcb\x06\x46\x09\xcb\xc0\x3a\xe3\x27\x86\xf7\x2e\xb5", 1, 0, 0 }, + { 104, 128, 128, 227, "\x26\x8c\x96\x1a\x4f\xa5\x4c\x21\x4a\x2a\xf8\xfe\x76\xa2\x77\xcc", "\xf1\x34\x43\xda\x0e\x41\x2f\x1c\xc7\xa9\x01\x65\xc6", "\x4f\xad\x12\xb4\x02\xc5\x80\x29", "", "", - "\xbe\x58\x07\x13\x42\xc9\x34\x8b\xaf\x78\x10\x4e\x22\x58\xe6\x16", 1, - 64, 0 }, - { 104, 128, 128, 228, - "\x7c\x5a\xa1\xcd\x2f\xc1\x71\xd5\xbb\x91\xee\x74\xf3\x1e\x1a\x63", + "\xbe\x58\x07\x13\x42\xc9\x34\x8b\xaf\x78\x10\x4e\x22\x58\xe6\x16", 1, 64, 0 }, + { 104, 128, 128, 228, "\x7c\x5a\xa1\xcd\x2f\xc1\x71\xd5\xbb\x91\xee\x74\xf3\x1e\x1a\x63", "\x70\xa2\xa5\x30\x37\x34\x51\x78\x27\xfa\xa7\xee\x78", "", "\x4b\xd1\xd3\x42\x7e\x07\x35\xa0\x8f\x47\x5b\xc7\x3e\xc3\x64\x8c", "\x9a\xb6\x12\x14\xea\x66\x11\x51\x07\x06\x31\x5f\x0f\xc9\xbd\x65", - "\xa2\xb3\xfc\x3c\x13\x49\xcb\xfd\x9d\xed\x7c\xc3\x2e\xff\xb3\x89", 1, - 0, 128 }, - { 104, 128, 128, 229, - "\xe7\x4b\x73\xc2\xad\x93\xd3\x8d\xd4\x43\x2d\x6e\x51\xd3\xe3\xec", + "\xa2\xb3\xfc\x3c\x13\x49\xcb\xfd\x9d\xed\x7c\xc3\x2e\xff\xb3\x89", 1, 0, 128 }, + { 104, 128, 128, 229, "\xe7\x4b\x73\xc2\xad\x93\xd3\x8d\xd4\x43\x2d\x6e\x51\xd3\xe3\xec", "\x06\xee\x28\xea\x53\x2f\xf5\xaa\xe6\xb0\xf6\xa2\x8a", "\x10\xbc\x98\x64\xf1\x33\x2e\x41", "\xaa\xd5\xd7\x58\x04\x1e\x54\x43\xed\xe7\xe9\xbb\xac\x1d\xb4\x90", "\xd3\xed\x6b\xb5\x5d\x98\xb0\x0e\x1b\x76\x93\x8a\x1c\x6b\xd5\xed", - "\x22\x20\x1e\x4e\xb2\xa4\x22\x91\xa7\xd5\x7e\x35\x70\x82\xd7\x7e", 1, - 64, 128 }, - { 104, 128, 128, 230, - "\xbe\x70\x77\x74\xd9\xea\xb3\x70\xdb\x4e\x82\x50\x29\x7a\x74\x37", + "\x22\x20\x1e\x4e\xb2\xa4\x22\x91\xa7\xd5\x7e\x35\x70\x82\xd7\x7e", 1, 64, 128 }, + { 104, 128, 128, 230, "\xbe\x70\x77\x74\xd9\xea\xb3\x70\xdb\x4e\x82\x50\x29\x7a\x74\x37", "\x79\x44\xb4\x87\xd5\x9b\x6f\xfc\xc9\x6c\x9d\xf6\x2d", "", "\x28\xea\xb5\x68\x85\xe1\xe1\x2b\xd7\x2d\xef\x11\x38\x23\x7f\x0d" "\xbc", "\xee\x05\xff\xea\xab\x17\xbb\x4d\xe9\x45\x27\xe0\x29\x70\x58\xc4" "\x8b", - "\xff\x89\x9f\x92\x9b\x37\x16\x39\xd4\x8c\x3c\x44\x7f\x51\xc5\x77", 1, - 0, 136 }, - { 104, 128, 128, 231, - "\x30\x82\x94\x16\xd8\x0d\x4b\x6d\xd9\x1a\x16\xc4\x69\x4c\x5a\xcd", + "\xff\x89\x9f\x92\x9b\x37\x16\x39\xd4\x8c\x3c\x44\x7f\x51\xc5\x77", 1, 0, 136 }, + { 104, 128, 128, 231, "\x30\x82\x94\x16\xd8\x0d\x4b\x6d\xd9\x1a\x16\xc4\x69\x4c\x5a\xcd", "\x8b\xc7\xec\xd5\xbd\xe1\x96\xb7\x23\x19\xde\x6b\x77", "\x97\x0f\xe6\x5b\x77\x89\xa5\x55", "\x4a\x31\x22\xf8\x01\xd6\x63\x82\x28\xfa\x0e\x30\xaf\x3f\x36\x62" "\x7a", "\x51\x25\xed\x68\xaf\xbd\x34\xbc\x00\xc7\x31\x71\xad\xa3\x1e\xe8" "\x4a", - "\x1d\xa3\x20\xc8\xba\xb5\x25\xe3\x75\xf3\x7a\x3b\xba\x3e\x0e\xb9", 1, - 64, 136 }, + "\x1d\xa3\x20\xc8\xba\xb5\x25\xe3\x75\xf3\x7a\x3b\xba\x3e\x0e\xb9", 1, 64, 136 }, { 56, 192, 128, 232, "\xb4\x54\x4c\xae\x6b\x60\xb7\x72\x0f\x3a\xde\x71\xe9\x0e\x58\xc2\x1d" "\x6e\x48\x71\x83\xd4\x66\x6a", "\x2b\xa3\xda\x11\x2c\xf5\xe6", "", "", "", - "\x34\x15\x51\xf2\xc0\x5e\xe9\x31\x4f\x0e\xb5\x52\x93\x9e\x54\x86", 1, - 0, 0 }, + "\x34\x15\x51\xf2\xc0\x5e\xe9\x31\x4f\x0e\xb5\x52\x93\x9e\x54\x86", 1, 0, 0 }, { 56, 192, 128, 233, "\x26\xbd\xdb\x2e\xb2\xa7\x27\xe2\x91\x0d\xf9\x4a\xd3\xe1\x2a\xc1\x30" "\xa4\x9a\x8f\x7f\x41\x95\x1c", - "\xc6\xc0\xef\x48\x15\x1b\x32", "\x74\x43\xb9\x1e\x73\x47\x5d\xe1", - "", "", - "\xfd\x7a\xab\x59\x5d\xfe\xb3\xc8\xa1\x66\x0e\xab\x04\x3b\x3d\x01", 1, - 64, 0 }, + "\xc6\xc0\xef\x48\x15\x1b\x32", "\x74\x43\xb9\x1e\x73\x47\x5d\xe1", "", "", + "\xfd\x7a\xab\x59\x5d\xfe\xb3\xc8\xa1\x66\x0e\xab\x04\x3b\x3d\x01", 1, 64, 0 }, { 56, 192, 128, 234, "\x80\x6e\xd9\xcf\x33\xa1\xc2\xfa\x6a\x8b\xff\xad\x79\x37\xc3\xea\x22" "\x64\x08\xeb\xf2\x48\xd1\x76", "\x2b\xeb\xcc\x0a\xf6\x72\xbf", "", "\xbe\x17\x02\x41\x48\x68\xc9\x4a\xeb\x99\xc1\xa0\x88\xba\x8c\x48", "\x6e\x6f\x3d\x3b\x36\x48\x2c\x39\xa9\x9d\x59\x7e\xa5\x82\xf4\x30", - "\x7d\x11\xf5\x54\x9d\x87\xdd\xa7\xb0\x76\x22\x02\x27\x0a\x7e\x28", 1, - 0, 128 }, + "\x7d\x11\xf5\x54\x9d\x87\xdd\xa7\xb0\x76\x22\x02\x27\x0a\x7e\x28", 1, 0, 128 }, { 56, 192, 128, 235, "\x09\x5f\xa6\x78\xa1\x04\xe9\xc3\xd2\x46\x30\x4c\x5d\xdd\xee\x04\x5d" "\xda\xb3\xd7\x9e\xa8\xa7\x26", "\xfe\xbf\x6b\xf7\xdd\x16\xa7", "\x6a\x44\x90\xba\x9f\x61\xdb\x88", "\xd2\x5e\xcf\xa8\x77\x89\x60\x30\x05\x8d\xca\xca\xb3\x15\x9c\xb3", "\xf3\x57\x8a\xca\x6d\x3c\xcb\xc9\x16\xf5\xc1\xd7\x1a\x45\x87\x8e", - "\x8c\x73\x2f\x4a\x57\x1b\xf1\x05\xc6\xed\x1c\xef\x6f\xab\x28\x76", 1, - 64, 128 }, + "\x8c\x73\x2f\x4a\x57\x1b\xf1\x05\xc6\xed\x1c\xef\x6f\xab\x28\x76", 1, 64, 128 }, { 56, 192, 128, 236, "\x98\x98\x8d\xa4\x62\xa4\x6a\xb3\xdd\x61\x3b\xd3\x70\x69\xf4\xf4\x29" "\xa9\xa8\x18\x41\xe7\x6d\xd3", @@ -1943,8 +1548,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x60", "\x9b\x7b\xb3\x5d\xb7\x23\x71\x8c\x7f\x9f\xd8\xcd\x5c\x83\x12\x4e" "\x78", - "\xa5\x95\x67\x30\x75\x77\xc8\xe8\x31\xc2\x3a\xc0\x9a\x92\xc6\xa1", 1, - 0, 136 }, + "\xa5\x95\x67\x30\x75\x77\xc8\xe8\x31\xc2\x3a\xc0\x9a\x92\xc6\xa1", 1, 0, 136 }, { 56, 192, 128, 237, "\x71\xde\x00\x8c\xd8\x20\xfc\x03\x39\x74\xb6\xb1\x30\x8f\x66\x28\x74" "\x25\x9b\x19\x56\x2e\x70\xf3", @@ -1953,38 +1557,31 @@ const struct aead_test aes_ccm_test_json[] = { "\xa3", "\xc8\xea\xf9\x54\x6a\xf7\x22\x61\x72\x3c\xeb\x3a\xe3\xbb\xb7\x30" "\x3c", - "\x68\xd7\x28\x74\x4e\x59\x77\x34\x2d\x93\xaf\x81\x44\x58\x57\xed", 1, - 64, 136 }, + "\x68\xd7\x28\x74\x4e\x59\x77\x34\x2d\x93\xaf\x81\x44\x58\x57\xed", 1, 64, 136 }, { 64, 192, 128, 238, "\xd7\x45\x99\xb3\xd2\xdb\x81\x65\x3d\xe4\x3b\x52\xfc\x99\x4c\x50\xd0" "\xbe\x75\x9f\xab\x87\xc3\x3a", "\xd1\xc6\x1c\xf8\x53\x25\x31\xb5", "", "", "", - "\xbd\x78\xdf\xc8\x04\xa4\x20\xc1\x9f\xb1\x3b\x2f\x58\xd8\x2c\x5c", 1, - 0, 0 }, + "\xbd\x78\xdf\xc8\x04\xa4\x20\xc1\x9f\xb1\x3b\x2f\x58\xd8\x2c\x5c", 1, 0, 0 }, { 64, 192, 128, 239, "\x8f\xc2\x69\xef\x34\xd2\xc2\x12\x7c\x89\x49\x3c\x09\x60\xee\x08\x49" "\xfa\xdf\x76\x66\x78\x85\xd5", - "\x62\x6b\xf0\x0a\xcb\x93\x04\x80", - "\x13\xaa\x17\x48\xae\xc4\x10\x42", "", "", - "\x9c\x45\x32\x75\xaf\xb0\x06\xc7\x8f\x6f\x29\x07\x9c\x7c\x3e\xf1", 1, - 64, 0 }, + "\x62\x6b\xf0\x0a\xcb\x93\x04\x80", "\x13\xaa\x17\x48\xae\xc4\x10\x42", "", "", + "\x9c\x45\x32\x75\xaf\xb0\x06\xc7\x8f\x6f\x29\x07\x9c\x7c\x3e\xf1", 1, 64, 0 }, { 64, 192, 128, 240, "\x0b\x17\x71\x98\xc8\xb4\x19\xbf\x74\xac\xc3\xbc\x65\xb5\xfb\x3d\x09" "\xa9\x15\xff\x71\xad\xd7\x54", "\x8f\x07\x5c\xbc\xda\x98\x31\xc3", "", "\xc4\xb1\xe0\x5c\xa3\xd5\x91\xf9\x54\x3e\x64\xde\x3f\xc6\x82\xac", "\x01\x48\xcd\xf9\x0d\x56\x6a\x8e\xb6\x51\x40\x99\x56\xc3\x69\x5e", - "\xb1\x0d\x57\xdf\x83\xc4\xc7\x9b\x9f\x59\x0e\x3e\x5a\xa9\xe9\xb6", 1, - 0, 128 }, + "\xb1\x0d\x57\xdf\x83\xc4\xc7\x9b\x9f\x59\x0e\x3e\x5a\xa9\xe9\xb6", 1, 0, 128 }, { 64, 192, 128, 241, "\xdb\x86\x9e\x55\x57\x6f\x57\xc8\xf9\x26\x49\x65\x9e\x3c\xb8\xbe\x10" "\x65\x6b\xbf\xf4\xb6\x94\x60", - "\x67\xc0\x30\x53\x32\xe1\x31\x7b", - "\x93\xf5\x3a\xb3\x6f\x45\xcb\xa3", + "\x67\xc0\x30\x53\x32\xe1\x31\x7b", "\x93\xf5\x3a\xb3\x6f\x45\xcb\xa3", "\x00\x2f\xbd\x2e\x0f\x39\xd4\x9f\x25\x8b\x3f\x73\x98\x39\x1e\x2c", "\x0c\xe4\xb1\xf5\x39\x22\xea\x14\x8f\x26\xa6\x38\xd1\xc9\xe7\x85", - "\x9b\xe9\x41\x7b\x3f\xf9\xe8\xd5\xb2\x4e\x04\x14\x39\xb0\x2c\x86", 1, - 64, 128 }, + "\x9b\xe9\x41\x7b\x3f\xf9\xe8\xd5\xb2\x4e\x04\x14\x39\xb0\x2c\x86", 1, 64, 128 }, { 64, 192, 128, 242, "\x2a\xf9\x6f\x8c\xca\x1b\x56\x3d\x17\xe7\x96\x9e\x01\x64\x5e\xe7\xb9" "\xf5\x41\x3a\xc9\x3e\xa5\x70", @@ -1993,49 +1590,40 @@ const struct aead_test aes_ccm_test_json[] = { "\xdd", "\xfd\x66\xcd\x92\x6b\xea\xdb\xee\x33\xcd\xae\x43\x82\x4f\xba\xcf" "\xc0", - "\x8c\x8d\xaf\xb2\x02\x7f\x2b\x0c\x03\xf6\x2b\x5f\x9f\xcc\x0a\xd8", 1, - 0, 136 }, + "\x8c\x8d\xaf\xb2\x02\x7f\x2b\x0c\x03\xf6\x2b\x5f\x9f\xcc\x0a\xd8", 1, 0, 136 }, { 64, 192, 128, 243, "\x5e\xd7\x70\x86\xec\x0d\xa8\xf6\xac\x00\x56\x3a\xd6\xfc\xb8\x50\x05" "\xac\x40\xf3\x92\x11\xb0\xe4", - "\x4e\x70\xdf\xd4\x9c\xc2\xac\x76", - "\x29\xbf\x75\x6a\x2f\x77\x06\x6b", + "\x4e\x70\xdf\xd4\x9c\xc2\xac\x76", "\x29\xbf\x75\x6a\x2f\x77\x06\x6b", "\xc0\x49\xdc\xf1\x5a\xf3\xf9\x75\x98\x7d\x5f\x12\x50\xfe\xf5\x41" "\x4f", "\x36\x96\x0d\xa0\x29\xe6\x7a\xee\xb1\x45\xd5\x7d\xc0\xda\x68\xac" "\x27", - "\x09\x50\x5b\xad\xdf\x28\xcd\x84\x2f\xd7\xfa\x7c\x54\x4d\x0c\x48", 1, - 64, 136 }, + "\x09\x50\x5b\xad\xdf\x28\xcd\x84\x2f\xd7\xfa\x7c\x54\x4d\x0c\x48", 1, 64, 136 }, { 72, 192, 128, 244, "\xf1\x62\xa1\x09\x40\x12\xf6\xbf\xb1\x02\x70\xcd\x56\x09\xa2\x0d\xc2" "\x4d\xec\x37\x27\xf8\xe5\x98", "\x05\x62\xf0\x3f\x51\x24\x64\x2f\x40", "", "", "", - "\xa9\xee\xf8\xc9\xf9\x46\x00\x06\xb7\x3f\x2d\xa2\x31\x7c\x7b\x7d", 1, - 0, 0 }, + "\xa9\xee\xf8\xc9\xf9\x46\x00\x06\xb7\x3f\x2d\xa2\x31\x7c\x7b\x7d", 1, 0, 0 }, { 72, 192, 128, 245, "\x0f\xa5\x86\x1e\xf4\x39\x18\x42\x65\x11\x2c\xa6\xea\x78\x5d\x21\x4a" "\x5b\xb1\x2d\xd1\x08\xe4\x34", - "\x04\x1f\xfc\xd9\x55\xeb\x49\x39\xff", - "\xbe\xed\x0c\x76\x3b\x56\xc5\x82", "", "", - "\x39\xfd\x1a\x21\x07\x54\x0f\x9e\x6d\x33\xad\x23\xb4\x25\xdd\xef", 1, - 64, 0 }, + "\x04\x1f\xfc\xd9\x55\xeb\x49\x39\xff", "\xbe\xed\x0c\x76\x3b\x56\xc5\x82", "", "", + "\x39\xfd\x1a\x21\x07\x54\x0f\x9e\x6d\x33\xad\x23\xb4\x25\xdd\xef", 1, 64, 0 }, { 72, 192, 128, 246, "\x4f\x58\x9a\xaf\x03\xe1\x21\x95\x85\xf4\x11\x63\x1a\x2b\x28\x7f\x20" "\xe9\xcc\xa9\x33\x04\xd0\x04", "\xf0\xbd\x78\x63\xd3\x4b\x6c\x96\x3f", "", "\xca\x80\xf9\x13\x29\xf1\xcf\xd8\x78\x4b\xdb\x97\xdc\x0d\x5b\x01", "\x0c\x3f\x7b\x1e\x05\x85\xde\xaa\x80\x0a\x71\x05\xfc\x14\x13\x64", - "\x94\x27\xfd\x74\x87\x0e\x29\xdb\x52\x7f\x7d\xf2\x47\x47\x79\x39", 1, - 0, 128 }, + "\x94\x27\xfd\x74\x87\x0e\x29\xdb\x52\x7f\x7d\xf2\x47\x47\x79\x39", 1, 0, 128 }, { 72, 192, 128, 247, "\x07\x87\x9e\x22\xe8\xc3\xcb\x5b\x5f\xc2\x05\x7c\x39\x85\x90\x6c\x39" "\xaf\xf4\xe4\x0a\xae\x4e\x20", - "\x4e\xde\x0c\x3a\xf9\xc0\xde\xbb\x8a", - "\xcb\x33\x3d\x66\xbd\xe2\x47\x5d", + "\x4e\xde\x0c\x3a\xf9\xc0\xde\xbb\x8a", "\xcb\x33\x3d\x66\xbd\xe2\x47\x5d", "\xb9\xac\x42\xc5\xd3\x16\x90\x87\xa7\x21\x87\x9c\x19\x86\x59\x08", "\x6c\xf2\xcd\x3a\x10\x61\xd9\xb6\xfb\xe3\x62\x33\x77\xc6\xb4\x43", - "\xf7\x29\x7a\x72\x66\xd2\xf7\xf7\xaa\x7e\xc0\x5e\x0f\x9b\xf9\xa9", 1, - 64, 128 }, + "\xf7\x29\x7a\x72\x66\xd2\xf7\xf7\xaa\x7e\xc0\x5e\x0f\x9b\xf9\xa9", 1, 64, 128 }, { 72, 192, 128, 248, "\x0b\x14\x4f\x06\x68\xff\xd1\xa9\x7f\xf2\xd2\xbf\x93\x44\xef\x0e\x28" "\x48\x96\x4a\xec\xb2\x85\x0f", @@ -2044,49 +1632,40 @@ const struct aead_test aes_ccm_test_json[] = { "\x1f", "\x58\xd5\x76\x23\x17\xcf\x50\x24\x62\x71\x59\xac\xe6\xb4\x8f\x79" "\x7f", - "\x16\xee\x7c\x4a\xad\xf2\x58\x45\x80\x30\xe5\xaf\x1b\xdb\xed\x2d", 1, - 0, 136 }, + "\x16\xee\x7c\x4a\xad\xf2\x58\x45\x80\x30\xe5\xaf\x1b\xdb\xed\x2d", 1, 0, 136 }, { 72, 192, 128, 249, "\xa3\xbd\xd0\x65\xfe\x64\x75\xdf\x94\xa2\x09\x2c\x3f\x72\xb1\xdc\xd3" "\xd0\xf0\x41\x3b\x4f\x34\xdc", - "\xfe\xeb\x53\xf7\xcd\x16\xad\xc8\xe4", - "\x6b\xa7\x08\x2e\x39\x8b\xab\x61", + "\xfe\xeb\x53\xf7\xcd\x16\xad\xc8\xe4", "\x6b\xa7\x08\x2e\x39\x8b\xab\x61", "\xd1\xe7\x61\x64\x72\xca\x17\x01\x5e\xea\xea\xc3\x0b\x5b\x22\xf0" "\x07", "\x95\x38\xe5\xa7\x0a\xc3\x3a\xd0\x92\x4f\x03\x8b\x34\xd1\x99\x5b" "\x7b", - "\xcb\x45\x9d\x32\xbb\xfd\x20\x93\xeb\x4d\x79\x33\xd5\x0f\xfa\x27", 1, - 64, 136 }, + "\xcb\x45\x9d\x32\xbb\xfd\x20\x93\xeb\x4d\x79\x33\xd5\x0f\xfa\x27", 1, 64, 136 }, { 80, 192, 128, 250, "\x17\x2f\x22\xf2\xe5\x93\x64\xdc\x41\x8c\xd7\x51\xdf\xa8\x44\x4a\xe1" "\x86\x44\xc0\xf9\xa2\xbe\x84", "\xbf\x90\x26\xd3\xdd\xaa\x37\xe7\xf1\x80", "", "", "", - "\xb0\x77\xff\x4f\xad\x9f\xf4\xa9\x4b\x6d\xe8\xa6\x6b\xa5\xb1\x6c", 1, - 0, 0 }, + "\xb0\x77\xff\x4f\xad\x9f\xf4\xa9\x4b\x6d\xe8\xa6\x6b\xa5\xb1\x6c", 1, 0, 0 }, { 80, 192, 128, 251, "\x14\x3e\xfb\xf8\xe0\x29\x3d\xd4\xc1\x31\x59\xcf\x26\x0e\xc5\x91\xf5" "\xf9\x2b\xb3\xaf\x8d\xd8\x63", - "\x11\x1a\x95\xbb\xb6\x0f\x9a\x3b\xba\x53", - "\x51\xc1\x46\x78\xc4\x54\x47\x77", "", "", - "\x09\x9a\x7c\x50\x90\x44\x3c\xd4\x00\x0f\x97\x0d\x42\xbc\xd1\xd5", 1, - 64, 0 }, + "\x11\x1a\x95\xbb\xb6\x0f\x9a\x3b\xba\x53", "\x51\xc1\x46\x78\xc4\x54\x47\x77", "", "", + "\x09\x9a\x7c\x50\x90\x44\x3c\xd4\x00\x0f\x97\x0d\x42\xbc\xd1\xd5", 1, 64, 0 }, { 80, 192, 128, 252, "\x4c\x41\x10\x4d\x3f\x40\x26\x5f\x9e\x35\xc3\x20\xa0\x1e\x78\x76\xc3" "\x14\x00\xa0\xbd\x4d\x70\x92", "\x85\xfd\xc8\x1a\xfd\x9f\x48\x28\x17\x7e", "", "\xba\x7c\xd0\x7d\xfd\x8b\x5c\xf6\xff\xd3\xdd\xb7\x63\x56\x12\xc6", "\x38\x6b\x63\x4a\x5d\xef\x89\xdc\x73\x02\x72\x4a\xd1\x19\x21\xfe", - "\x4d\x79\x22\x01\xa9\x98\x88\x94\x57\xb4\xc8\x3c\xab\x0e\x5c\x35", 1, - 0, 128 }, + "\x4d\x79\x22\x01\xa9\x98\x88\x94\x57\xb4\xc8\x3c\xab\x0e\x5c\x35", 1, 0, 128 }, { 80, 192, 128, 253, "\x8b\xcd\xe5\x17\xdd\xc6\x3f\xed\xcc\xe8\xe3\x41\x81\xf2\x35\x30\xf4" "\x71\xd6\x85\x8c\x48\xdb\xf9", - "\xbc\x6d\x51\xde\x0c\x0b\xe7\xc4\x59\x11", - "\xe0\xb3\xfb\x36\xc7\xb1\x63\x41", + "\xbc\x6d\x51\xde\x0c\x0b\xe7\xc4\x59\x11", "\xe0\xb3\xfb\x36\xc7\xb1\x63\x41", "\x1b\x42\x19\x8b\x4a\xc0\x82\x24\xe1\xe7\x61\xa7\x72\x05\xe3\x92", "\xe8\x73\x99\x72\xe4\x18\x0e\x2e\x52\x01\x21\xd8\xe9\xaa\xd7\xc5", - "\x6c\xee\xbc\x4d\x20\x29\x45\x38\x3e\x51\x1b\x7c\xad\xde\x56\x95", 1, - 64, 128 }, + "\x6c\xee\xbc\x4d\x20\x29\x45\x38\x3e\x51\x1b\x7c\xad\xde\x56\x95", 1, 64, 128 }, { 80, 192, 128, 254, "\x37\xf0\xb2\xd5\x3d\x52\x40\x7e\xb9\xff\x33\x53\x0e\x74\xb4\xed\xf5" "\x82\x5a\x7b\xb3\x7c\x3d\xc5", @@ -2095,49 +1674,40 @@ const struct aead_test aes_ccm_test_json[] = { "\xea", "\x75\xa6\x0d\xf0\x77\x8e\xb9\x3a\x34\x07\x2e\x74\xfa\x3d\x6b\x02" "\x24", - "\xf2\x7b\x8c\xfc\x5b\xf5\xd2\xb4\xb4\xd9\x3f\xb5\x84\xd7\x19\xff", 1, - 0, 136 }, + "\xf2\x7b\x8c\xfc\x5b\xf5\xd2\xb4\xb4\xd9\x3f\xb5\x84\xd7\x19\xff", 1, 0, 136 }, { 80, 192, 128, 255, "\x10\xa7\x79\xb2\x45\x74\x1f\x1a\xb3\x12\x4e\x0e\x50\x4f\xdc\xd3\x15" "\x78\x4c\x67\xd0\x13\x6f\xcb", - "\x75\xa4\x46\x16\xee\x96\xb3\x0c\x9e\xca", - "\x4c\x5d\x64\x71\xac\x20\xdf\x18", + "\x75\xa4\x46\x16\xee\x96\xb3\x0c\x9e\xca", "\x4c\x5d\x64\x71\xac\x20\xdf\x18", "\x57\xd7\x58\xf9\x24\xa6\xea\xef\xe4\xd2\x62\x59\x31\xfc\x84\x71" "\x07", "\xab\x7b\x01\xba\x57\xed\xc0\xa4\x1b\x19\x0f\xb0\xf1\xd5\x18\x6c" "\xd5", - "\x3e\x93\xa4\x5f\x5c\xc5\xea\xca\x21\x50\xdb\x35\x34\xa8\x90\x3e", 1, - 64, 136 }, + "\x3e\x93\xa4\x5f\x5c\xc5\xea\xca\x21\x50\xdb\x35\x34\xa8\x90\x3e", 1, 64, 136 }, { 88, 192, 128, 256, "\x87\xc5\x5b\x2f\x18\x5f\x17\x7f\xaa\xf4\xb1\x6d\x93\xaf\x6d\xad\x47" "\x71\x46\x34\x5d\x0e\xa9\x92", "\x09\x46\xc6\x99\x53\xf4\xb9\x52\xbc\x7c\x23", "", "", "", - "\x25\x7b\x3c\x59\x7e\xcd\x1d\x67\xc3\xdd\x35\xdc\x70\xc6\x8e\x48", 1, - 0, 0 }, + "\x25\x7b\x3c\x59\x7e\xcd\x1d\x67\xc3\xdd\x35\xdc\x70\xc6\x8e\x48", 1, 0, 0 }, { 88, 192, 128, 257, "\x82\x07\xe8\xd5\x7d\xcc\xdf\x54\x80\xf7\x02\xc1\xfa\x72\xd0\xc6\xd0" "\x2f\x1b\xad\xc6\xfc\x08\xc5", - "\xc1\x8e\x46\xa7\x0c\x59\x29\x80\xa2\xcc\xc2", - "\xbd\x2e\x2a\x9d\xa3\x2a\x9d\x67", "", "", - "\x11\x45\xc2\x0b\x7f\x31\xd5\x7d\x45\x8a\xfc\x65\x0a\x6d\x45\x90", 1, - 64, 0 }, + "\xc1\x8e\x46\xa7\x0c\x59\x29\x80\xa2\xcc\xc2", "\xbd\x2e\x2a\x9d\xa3\x2a\x9d\x67", "", + "", "\x11\x45\xc2\x0b\x7f\x31\xd5\x7d\x45\x8a\xfc\x65\x0a\x6d\x45\x90", 1, 64, 0 }, { 88, 192, 128, 258, "\x2c\x2f\x7e\x8b\xb7\x5b\xa9\x31\xa7\x11\xec\xa4\xd3\x19\xe1\x9a\xd8" "\x97\x67\x24\x8f\xee\x53\x60", "\x21\xa1\x04\x56\x47\x0d\x08\x3c\xa7\xbd\x7c", "", "\x1e\x9f\x46\x74\x41\xe4\x87\xbf\x68\xd1\x0b\xe8\x53\xb2\x44\x79", "\x18\x6b\x50\xf0\xed\xf7\xb5\x23\x02\x13\x84\xf5\xd8\xc0\x90\x49", - "\x8d\xb0\x12\x36\xb7\x15\xa7\x64\x32\xfc\xb0\x2c\xff\x2f\x6b\xa6", 1, - 0, 128 }, + "\x8d\xb0\x12\x36\xb7\x15\xa7\x64\x32\xfc\xb0\x2c\xff\x2f\x6b\xa6", 1, 0, 128 }, { 88, 192, 128, 259, "\x0a\x3b\xf0\xa9\x26\xfb\x14\xa3\xb7\x16\xbf\xa0\x21\xa2\x08\xda\x03" "\x30\xe5\x7b\xed\x36\x82\x8a", - "\xa0\xba\x36\xed\xc4\x3d\x93\x5e\xe9\x42\x13", - "\x3f\xcd\x93\xcc\xb8\xe9\x79\x56", + "\xa0\xba\x36\xed\xc4\x3d\x93\x5e\xe9\x42\x13", "\x3f\xcd\x93\xcc\xb8\xe9\x79\x56", "\x9a\xb6\xc1\x09\xc8\x06\x9d\x05\x4c\xcb\xb5\xc3\x3c\x6e\x70\xd0", "\x27\xd1\xe3\x53\x23\x37\x55\xa2\xfe\x28\x23\x16\x37\x73\x9c\x46", - "\xb9\xb7\x47\x65\xed\x3d\x53\x03\x1b\xf3\xc7\x34\x9e\x74\x34\x0e", 1, - 64, 128 }, + "\xb9\xb7\x47\x65\xed\x3d\x53\x03\x1b\xf3\xc7\x34\x9e\x74\x34\x0e", 1, 64, 128 }, { 88, 192, 128, 260, "\xa6\x8d\xfe\x22\xce\xf2\xbf\xf0\xf2\x8d\x4b\x68\xc2\xa6\x93\x8b\x16" "\xdc\x21\x09\xba\xb0\x9c\x38", @@ -2146,40 +1716,34 @@ const struct aead_test aes_ccm_test_json[] = { "\x97", "\x34\x28\x2b\x16\x48\x9e\x7b\xc7\x13\x6a\x24\x98\x32\x8b\xd2\x2e" "\x76", - "\xe9\xb7\xae\x57\xe2\xb7\xf6\x0d\x09\xf5\x0b\xed\x23\xb9\x34\x38", 1, - 0, 136 }, + "\xe9\xb7\xae\x57\xe2\xb7\xf6\x0d\x09\xf5\x0b\xed\x23\xb9\x34\x38", 1, 0, 136 }, { 88, 192, 128, 261, "\xff\xe5\xd2\xad\x71\xd4\x32\xd6\xcd\x5f\x10\x72\xec\x2a\xcb\x7d\x7c" "\xde\x9c\x5c\x61\x5d\x0e\xb9", - "\xea\x21\x98\x30\x74\x02\xa1\x06\xea\x42\x93", - "\xf9\x3d\xb4\xf4\xae\xc8\xaf\xe8", + "\xea\x21\x98\x30\x74\x02\xa1\x06\xea\x42\x93", "\xf9\x3d\xb4\xf4\xae\xc8\xaf\xe8", "\xc9\xdb\x4d\x10\xd4\x23\x40\xac\x73\x62\x71\xed\xf9\xf6\x58\x1c" "\xe8", "\xbd\x96\x0c\x7f\x60\x39\x2e\x8d\x0a\xfb\x28\xba\x16\xea\x63\xaf" "\xd3", - "\xf2\xca\x88\xd5\x49\xdf\xf2\x07\xd9\x79\x75\x6d\x13\xe8\x65\xd9", 1, - 64, 136 }, + "\xf2\xca\x88\xd5\x49\xdf\xf2\x07\xd9\x79\x75\x6d\x13\xe8\x65\xd9", 1, 64, 136 }, { 104, 192, 128, 262, "\xd4\x65\x54\x4b\x5d\xb9\xeb\x1c\x49\x5c\xaf\xaf\x5d\x9a\xc7\xe1\x0f" "\xaa\xe7\x45\x41\xa0\xa7\x18", "\x95\x82\xaf\xc3\x05\x56\xca\x12\xd1\x54\xc4\x2f\x03", "", "", "", - "\x37\xf6\x18\xf8\xbb\x7f\xf8\x5e\xc6\x44\xb1\xcb\xcc\xa4\xc2\x8a", 1, - 0, 0 }, + "\x37\xf6\x18\xf8\xbb\x7f\xf8\x5e\xc6\x44\xb1\xcb\xcc\xa4\xc2\x8a", 1, 0, 0 }, { 104, 192, 128, 263, "\x6f\x1c\xce\x6a\x35\x3a\xa4\x5f\x92\x6f\xac\xbb\x68\x65\xd3\x59\x82" "\x60\xdb\x53\x90\xe9\x37\xad", "\xae\x0f\xe0\x77\x39\x85\x87\x74\x7a\x64\x2e\x54\x22", "\x32\x66\x99\xf5\x6a\xc2\x8d\xef", "", "", - "\x07\x52\x0b\x38\x4c\xcc\xbb\x80\xb9\x67\x9a\x0e\xf4\x8c\xb6\xa8", 1, - 64, 0 }, + "\x07\x52\x0b\x38\x4c\xcc\xbb\x80\xb9\x67\x9a\x0e\xf4\x8c\xb6\xa8", 1, 64, 0 }, { 104, 192, 128, 264, "\x36\xf9\x7a\x97\xd1\xdd\x67\xe5\xf8\x3c\xcb\x52\x9d\xa2\x5a\x60\x4b" "\x68\xb8\xda\x90\x4f\xe3\xf6", "\x23\x93\xa0\xa0\xe0\xb8\xef\xdd\x59\xdb\x34\x36\xdc", "", "\xc0\x2f\x28\x77\x32\x33\xff\xca\x81\x2e\xaf\x1c\x94\x6c\xd8\xd1", "\xd4\x12\x86\xc4\x61\xfb\x65\xd4\x10\x66\xa1\x03\x88\xeb\x69\xc8", - "\x07\x36\x96\xdf\xfa\x20\x71\x44\x00\x14\xdf\xac\x4c\x6c\xad\xb2", 1, - 0, 128 }, + "\x07\x36\x96\xdf\xfa\x20\x71\x44\x00\x14\xdf\xac\x4c\x6c\xad\xb2", 1, 0, 128 }, { 104, 192, 128, 265, "\xf2\x58\xd3\x3f\x1f\x1f\x3a\xad\xe5\x10\x3d\x56\xc4\x35\x7b\x7a\x4f" "\x8d\xd2\x05\xe4\x60\x65\x8e", @@ -2187,8 +1751,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xb6\x71\x96\xee\x87\x89\x0f\x55", "\xf2\x22\xfd\xfd\x34\x3b\x57\xa7\x0d\x00\x2d\x14\xa3\x9c\xae\x59", "\xd2\x7c\xda\x7a\xda\x56\x38\xdb\x59\x94\x5a\x31\xd9\x3e\xf2\x43", - "\xc2\xc6\x4d\xd8\xb0\x8e\x7b\x4b\x1c\xe6\x0d\x5b\x96\x83\x29\x89", 1, - 64, 128 }, + "\xc2\xc6\x4d\xd8\xb0\x8e\x7b\x4b\x1c\xe6\x0d\x5b\x96\x83\x29\x89", 1, 64, 128 }, { 104, 192, 128, 266, "\xee\x79\x41\x97\xf2\x0e\x64\x3c\x38\x77\xad\x08\x5f\x03\x1c\x75\x0f" "\xf2\x32\x56\x8e\x53\xd7\xc3", @@ -2197,8 +1760,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xb0", "\xe0\x6e\x98\xbf\x61\x2f\x13\x44\xfa\xc0\xc3\xef\x8d\x3a\x65\x6b" "\xa0", - "\xfc\x26\xa2\x6f\x23\x14\xe5\xa2\x79\xc2\xc7\xd0\x7c\x04\x45\x85", 1, - 0, 136 }, + "\xfc\x26\xa2\x6f\x23\x14\xe5\xa2\x79\xc2\xc7\xd0\x7c\x04\x45\x85", 1, 0, 136 }, { 104, 192, 128, 267, "\xb1\xbb\xea\xe5\xfb\xa3\x04\x41\xe1\x2b\x1a\xd2\xf7\x4e\x27\x2b\xc2" "\x05\x22\x1f\xe3\x4a\x34\x95", @@ -2208,37 +1770,31 @@ const struct aead_test aes_ccm_test_json[] = { "\x1e", "\xd1\x92\x8c\xe8\x58\x77\xf1\xd1\xfd\x56\x96\xe5\x6b\xb5\x05\x91" "\xe7", - "\x7b\x85\x27\xe9\x81\x92\xd7\x11\x1d\xaf\xff\x55\x17\x82\xf7\x01", 1, - 64, 136 }, + "\x7b\x85\x27\xe9\x81\x92\xd7\x11\x1d\xaf\xff\x55\x17\x82\xf7\x01", 1, 64, 136 }, { 56, 256, 128, 268, "\x49\x18\x28\xf2\xdd\xdc\xff\x5f\x96\x6e\x66\x27\xf4\xb6\xa8\x5a\x2e" "\xa7\x6f\xd1\xe0\xb6\x11\x7a\x13\xe9\x4d\x0e\x81\xc0\x63\xa5", "\x4f\xee\xdf\x9d\x9c\x07\xe0", "", "", "", - "\x1c\xa0\xa4\x18\xf3\x37\xa4\xc0\x4f\x21\x23\xfe\xfd\x31\x79\x6d", 1, - 0, 0 }, + "\x1c\xa0\xa4\x18\xf3\x37\xa4\xc0\x4f\x21\x23\xfe\xfd\x31\x79\x6d", 1, 0, 0 }, { 56, 256, 128, 269, "\xa5\x79\x05\xb9\xeb\x31\xfb\xb1\xcc\x53\x96\x39\xe6\x70\xb2\xf1\xd1" "\x2e\x27\x71\x39\xb5\x1a\x09\x8c\xfe\xbc\x18\x20\xfb\xa1\xa4", - "\x27\xcf\xf7\x6e\x28\xc6\x13", "\xdc\xd2\xf8\x4e\xd0\xea\xfa\xd0", - "", "", - "\x0b\x21\xf5\x0e\x20\x6c\x07\x21\xc6\xc0\x59\xf9\x20\x7e\x6d\x3a", 1, - 64, 0 }, + "\x27\xcf\xf7\x6e\x28\xc6\x13", "\xdc\xd2\xf8\x4e\xd0\xea\xfa\xd0", "", "", + "\x0b\x21\xf5\x0e\x20\x6c\x07\x21\xc6\xc0\x59\xf9\x20\x7e\x6d\x3a", 1, 64, 0 }, { 56, 256, 128, 270, "\x55\xfa\x96\xeb\x3c\x94\x5c\xab\x67\x6c\x42\xb8\xca\xac\x34\xa1\x71" "\x7d\x43\x37\xf4\xc9\x08\x06\xb2\x26\xd5\x68\x12\x1e\xc5\xe0", "\x20\x97\x98\x00\x6d\x01\x2c", "", "\x34\xef\x60\x3e\x3c\x8f\x93\xa0\xe4\xa4\x77\x3f\x7b\x57\xac\xea", "\x79\x7c\xa0\x5b\x20\xa1\x49\xd4\x2e\x5a\xb3\x38\x35\x85\x5b\x5c", - "\x81\x91\xbd\x25\x4a\x6e\x98\x6e\x3c\x22\xe8\x10\x68\x94\xd6\x4f", 1, - 0, 128 }, + "\x81\x91\xbd\x25\x4a\x6e\x98\x6e\x3c\x22\xe8\x10\x68\x94\xd6\x4f", 1, 0, 128 }, { 56, 256, 128, 271, "\xe0\xd8\x2f\x60\x88\xec\x67\x5d\x92\xec\x6b\x44\xa6\x7d\xc6\xeb\x66" "\x00\xf1\xb7\x42\xbd\xd5\xa8\x51\xb0\x36\xaf\x02\xee\xf8\x25", "\x06\xed\xf6\xab\x0c\x7a\x92", "\xe9\x8f\xdd\x29\x22\x91\xdd\x01", "\x5b\xb3\x63\x92\x65\xc8\x56\x3e\x6f\xb7\x38\xbe\xd8\xc8\x53\x2c", "\xcb\x25\x13\x41\x7f\x9c\xb5\x46\xd7\x38\x30\xb9\x19\xb2\xcb\x33", - "\xd3\xc0\x6c\x16\x14\xf7\xca\x3b\x09\x52\xd6\x7a\x5b\xd0\xd0\x17", 1, - 64, 128 }, + "\xd3\xc0\x6c\x16\x14\xf7\xca\x3b\x09\x52\xd6\x7a\x5b\xd0\xd0\x17", 1, 64, 128 }, { 56, 256, 128, 272, "\x12\x36\x80\xa3\x5c\x43\xcf\x61\x8c\x69\xf2\x81\x29\x81\x99\xe5\x4e" "\x40\x08\x0e\x16\x57\x7f\x31\x0f\x09\x6e\x36\x7e\xe3\xcd\x40", @@ -2247,8 +1803,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x1e", "\x0b\x9f\x38\xde\xa9\xdd\x82\x65\x6f\xc1\xc2\xe1\x65\x1b\x12\xe1" "\xc1", - "\x03\x79\x8b\x2b\xaa\xf5\xaf\x45\xe6\x7a\x71\x6c\x7b\x2a\x2a\x17", 1, - 0, 136 }, + "\x03\x79\x8b\x2b\xaa\xf5\xaf\x45\xe6\x7a\x71\x6c\x7b\x2a\x2a\x17", 1, 0, 136 }, { 56, 256, 128, 273, "\x7b\xeb\x1e\x06\xb5\x85\xfa\xda\x87\x5f\xc6\x10\xc3\xcb\xfb\x97\x88" "\xfe\xa2\x91\x43\x64\x10\x48\x7d\x8a\x84\x4c\x21\x7d\xfb\xb7", @@ -2257,38 +1812,31 @@ const struct aead_test aes_ccm_test_json[] = { "\x8c", "\x81\xf8\x49\x9c\x64\xed\x65\xe4\xd9\x96\xf8\xb2\xc6\x48\x4d\xe1" "\xe2", - "\x6d\xb4\xb7\xc5\x5f\xcc\xa5\xfe\xde\xe9\x71\xa4\xa1\x22\xbb\xfe", 1, - 64, 136 }, + "\x6d\xb4\xb7\xc5\x5f\xcc\xa5\xfe\xde\xe9\x71\xa4\xa1\x22\xbb\xfe", 1, 64, 136 }, { 64, 256, 128, 274, "\x61\xba\x69\x48\x97\x92\x5d\x1b\x41\x74\xd4\x04\x01\x46\x9c\x3e\xf2" "\x67\xcd\xb9\xf8\x29\xed\xb1\xa1\x06\x18\xc1\x6d\x66\x60\x59", "\x0d\x10\xc5\xc8\x4b\x88\xd6\x88", "", "", "", - "\x8e\xc7\x1f\x7d\xaf\x93\x5e\xdf\xac\x9d\xe9\x68\xf1\xd7\x64\x77", 1, - 0, 0 }, + "\x8e\xc7\x1f\x7d\xaf\x93\x5e\xdf\xac\x9d\xe9\x68\xf1\xd7\x64\x77", 1, 0, 0 }, { 64, 256, 128, 275, "\x30\xb7\x84\x51\x11\x93\x55\x5f\x16\x11\x23\xac\xad\x2f\x18\xae\x3b" "\xde\x91\x2e\xa9\xcc\x4a\x9e\x55\x31\x6d\x82\x2e\xce\x96\x52", - "\x0f\x1d\x38\xc6\xf3\x0b\x44\x75", - "\xd2\xcd\xd6\x22\x80\x88\x8f\xe5", "", "", - "\x02\xfc\xa4\x1f\x06\xb8\xc5\x43\x80\x84\x44\x0f\xf4\xce\xa5\xc8", 1, - 64, 0 }, + "\x0f\x1d\x38\xc6\xf3\x0b\x44\x75", "\xd2\xcd\xd6\x22\x80\x88\x8f\xe5", "", "", + "\x02\xfc\xa4\x1f\x06\xb8\xc5\x43\x80\x84\x44\x0f\xf4\xce\xa5\xc8", 1, 64, 0 }, { 64, 256, 128, 276, "\x11\x58\x84\xf6\x93\xb1\x55\x56\x3e\x9b\xfb\x3b\x07\xca\xcb\x2f\x7f" "\x7c\xaa\x9b\xfe\x51\xf8\x9e\x23\xfe\xb5\xa9\x46\x8b\xfd\xd0", "\x04\x10\x21\x99\xef\x21\xe1\xdf", "", "\x82\xe3\xe6\x04\xd2\xbe\x8f\xca\xb7\x4f\x63\x8d\x1e\x70\xf2\x4c", "\x74\xc3\xb0\x03\x22\xc0\x91\x60\x80\x37\xd4\xa8\xeb\x5a\xfb\xec", - "\xa0\x98\xb6\x7a\x2c\x79\xdd\x93\x94\x72\xa1\x85\x02\x63\x27\x01", 1, - 0, 128 }, + "\xa0\x98\xb6\x7a\x2c\x79\xdd\x93\x94\x72\xa1\x85\x02\x63\x27\x01", 1, 0, 128 }, { 64, 256, 128, 277, "\xa6\x74\x2d\xd3\x38\x7b\x1e\x11\xdc\x00\x48\x34\x71\x20\xf9\x17\x6d" "\xff\x30\x29\x5c\x03\x41\xd6\x9b\xc2\xde\xac\xe1\x93\x3f\xd8", - "\xbd\x3a\xbd\x10\x1a\x6c\x62\x5e", - "\x61\x51\x54\x63\xb6\x84\x95\xbd", + "\xbd\x3a\xbd\x10\x1a\x6c\x62\x5e", "\x61\x51\x54\x63\xb6\x84\x95\xbd", "\xb9\xbe\x89\xba\x08\xc5\x5a\xc0\x44\xb6\x10\x9b\xc4\xa1\xeb\x6b", "\x2f\xbb\xa1\xef\x88\x55\x54\x5c\x67\xcf\xc5\x3e\xd4\x9b\x37\x24", - "\x1a\x82\xcc\x39\x05\x01\xd2\x99\x15\xc2\xc1\x9a\xf0\xb5\xae\x53", 1, - 64, 128 }, + "\x1a\x82\xcc\x39\x05\x01\xd2\x99\x15\xc2\xc1\x9a\xf0\xb5\xae\x53", 1, 64, 128 }, { 64, 256, 128, 278, "\xc4\x3a\x2f\xa6\xd3\x71\x17\xc1\xad\x70\xcf\x07\xcd\x5d\x60\x7c\x91" "\x3c\xa8\xfa\x55\x84\x80\xaa\x0a\x24\x13\xe3\xd6\xe8\xb1\xaf", @@ -2297,49 +1845,40 @@ const struct aead_test aes_ccm_test_json[] = { "\x41", "\xdb\x8c\x02\xd3\x79\x87\x60\xbb\x40\x38\xd3\x70\xab\x6a\x93\xe4" "\x51", - "\x3d\xd4\x24\xa6\x17\x50\x2b\x64\x48\x4a\x88\x95\x7f\xf0\x94\xa7", 1, - 0, 136 }, + "\x3d\xd4\x24\xa6\x17\x50\x2b\x64\x48\x4a\x88\x95\x7f\xf0\x94\xa7", 1, 0, 136 }, { 64, 256, 128, 279, "\xf9\x48\x9d\xda\x8a\x08\xab\x83\x3f\x2a\x65\x8f\x3e\x42\x5a\xd6\x77" "\x07\xb0\xa5\x29\x11\x08\x16\x22\xe0\xe7\xef\x90\xa3\x3e\x84", - "\x6a\x1b\x55\x7a\x0f\x47\x08\x22", - "\xec\x6c\x76\xbc\xee\x1e\xbc\x6b", + "\x6a\x1b\x55\x7a\x0f\x47\x08\x22", "\xec\x6c\x76\xbc\xee\x1e\xbc\x6b", "\xa5\xd3\x97\xbe\xbe\x7a\xc5\x70\xd2\x39\x93\x90\xe8\xf0\xec\xb2" "\xb6", "\xa4\xe3\xe0\x95\xa2\x00\x41\xae\x21\x7a\xcf\xfd\x45\x5a\x74\x2d" "\xb5", - "\x31\x7b\xc9\xf1\xb5\x20\xe9\x8e\xd8\x82\x0d\xd2\x40\x29\xab\x52", 1, - 64, 136 }, + "\x31\x7b\xc9\xf1\xb5\x20\xe9\x8e\xd8\x82\x0d\xd2\x40\x29\xab\x52", 1, 64, 136 }, { 72, 256, 128, 280, "\x66\xf6\xd7\x9b\x72\x3c\xcd\x31\x36\xd2\xcf\x78\x8f\xc5\xb1\xc2\xf4" "\xb9\x84\x63\xa5\x7a\xe4\xdd\x29\xf3\x88\x8a\xba\x37\xd0\x86", "\x0a\x0a\xab\x42\x30\xfc\x3e\xe8\xca", "", "", "", - "\x2e\x59\xd7\xb1\xd1\xad\xa4\xc5\xf4\xc7\x4b\x35\x39\x66\x87\x99", 1, - 0, 0 }, + "\x2e\x59\xd7\xb1\xd1\xad\xa4\xc5\xf4\xc7\x4b\x35\x39\x66\x87\x99", 1, 0, 0 }, { 72, 256, 128, 281, "\xdf\x89\xe9\x4e\x19\x79\x57\x6e\xb8\x6b\x48\x19\xc9\x02\xaa\x5c\xdd" "\xfd\x14\xe0\x22\x45\x48\xc0\x35\x31\xea\xa7\x9e\x9a\x22\x64", - "\x39\xd9\x12\xcc\x1c\xd3\xde\x7f\x18", - "\xfb\x13\x08\xe9\x08\x2d\xba\x57", "", "", - "\xdd\x8b\x28\x4b\x1b\xa7\x18\xff\x14\x9b\x29\xc0\xbe\x62\xe7\x08", 1, - 64, 0 }, + "\x39\xd9\x12\xcc\x1c\xd3\xde\x7f\x18", "\xfb\x13\x08\xe9\x08\x2d\xba\x57", "", "", + "\xdd\x8b\x28\x4b\x1b\xa7\x18\xff\x14\x9b\x29\xc0\xbe\x62\xe7\x08", 1, 64, 0 }, { 72, 256, 128, 282, "\x3e\x67\x83\x07\x50\x9e\xa3\x1e\xd5\xf3\xbe\x53\x2b\xa6\x1a\x4f\x03" "\xbc\x8e\x13\x75\x11\x36\x41\xd1\x09\x98\xb5\x0d\x1e\x42\xe3", "\xc0\x63\x66\x67\xb3\x31\xa0\x81\x13", "", "\x32\x0d\x03\x28\xd2\x16\x4a\xfc\xfb\x89\x92\x65\x93\x8b\xae\x67", "\x7c\x56\x07\x16\x00\xb1\xa3\xc6\xd8\x7a\x4e\xd8\xbe\x56\x18\x7a", - "\x58\xc8\x51\x26\xd5\xa5\x29\x1b\x48\xa9\x39\x55\x6c\xa8\xf3\xd6", 1, - 0, 128 }, + "\x58\xc8\x51\x26\xd5\xa5\x29\x1b\x48\xa9\x39\x55\x6c\xa8\xf3\xd6", 1, 0, 128 }, { 72, 256, 128, 283, "\x7c\x9b\x18\x43\x5f\x55\x63\xe0\x35\x05\xa6\xf5\xed\xfc\xb1\x04\xde" "\xda\x40\xec\x89\x99\x8f\x68\x16\xe1\x08\xda\x97\x04\xcd\xda", - "\x98\x63\xce\x13\x79\xa0\x6a\x5d\xef", - "\xf0\x0d\xc0\x5b\xd0\x00\xfc\x70", + "\x98\x63\xce\x13\x79\xa0\x6a\x5d\xef", "\xf0\x0d\xc0\x5b\xd0\x00\xfc\x70", "\xb0\x37\x68\x45\xc0\x26\x97\x93\x5f\x91\x43\x98\x55\x5e\xc4\x27", "\x49\xd7\xd0\xb7\x96\xd1\x6d\xff\x6d\x0f\x7a\xab\x8c\x02\x27\x76", - "\x6a\x25\x90\xae\xc1\x3a\x76\x5e\xd7\x73\xf4\xde\xd0\xf1\x21\x86", 1, - 64, 128 }, + "\x6a\x25\x90\xae\xc1\x3a\x76\x5e\xd7\x73\xf4\xde\xd0\xf1\x21\x86", 1, 64, 128 }, { 72, 256, 128, 284, "\x94\x33\x11\xd4\xa1\xf7\xd2\x11\x08\xcc\xce\xe9\x40\x35\xdd\x71\x7f" "\xc3\xab\x41\xd7\x3c\x36\xc2\xff\xbc\x01\x7f\x82\x22\xe8\x57", @@ -2348,49 +1887,40 @@ const struct aead_test aes_ccm_test_json[] = { "\x89", "\xc7\xa2\xfe\x3a\x9f\xcf\x3b\x0b\x5a\xd8\xdc\xc3\x00\xc4\x9b\xa4" "\x85", - "\x26\xa6\xc3\x71\x43\x86\xa9\x70\x56\x02\x0d\x4b\xf2\x4f\x7a\xa4", 1, - 0, 136 }, + "\x26\xa6\xc3\x71\x43\x86\xa9\x70\x56\x02\x0d\x4b\xf2\x4f\x7a\xa4", 1, 0, 136 }, { 72, 256, 128, 285, "\xb3\x6a\x33\x80\xf9\xbf\xce\x99\x2d\x15\x5e\x18\x47\x3e\xef\x8c\x7e" "\xee\xd8\xc4\xfe\x8f\x54\x47\xa5\x5f\xfe\x88\xdd\xf3\xbb\x9e", - "\xa2\x15\x98\x49\xb3\x9d\x86\x28\x52", - "\xbd\x75\x19\x2f\xba\xcb\xef\xe6", + "\xa2\x15\x98\x49\xb3\x9d\x86\x28\x52", "\xbd\x75\x19\x2f\xba\xcb\xef\xe6", "\x3e\x27\x32\x60\x92\x43\x55\xf5\x94\x89\x64\x60\x80\x87\x0f\x19" "\xda", "\x19\x5b\xcb\x64\xad\x94\x74\xf8\x3d\xd1\x65\x9d\x47\xc2\x2a\x02" "\x82", - "\x80\xa8\x3e\x5a\x8c\xc7\x44\xbc\xb3\x22\xab\x07\x17\x39\x52\x93", 1, - 64, 136 }, + "\x80\xa8\x3e\x5a\x8c\xc7\x44\xbc\xb3\x22\xab\x07\x17\x39\x52\x93", 1, 64, 136 }, { 80, 256, 128, 286, "\x44\xab\x20\x4d\x15\x0a\xdb\x17\xf8\x3d\x1e\x52\x05\xb6\xe1\x41\x96" "\x73\xfa\xde\xe6\x10\xfb\x9a\x38\x18\x5a\x96\x74\x10\x21\xeb", "\xff\x39\x14\x98\x2b\xe3\x0b\x3b\x21\x12", "", "", "", - "\xf5\x00\xce\xf3\x10\x41\x0d\x89\x40\xcf\x34\x90\xf5\xf3\xb5\xd7", 1, - 0, 0 }, + "\xf5\x00\xce\xf3\x10\x41\x0d\x89\x40\xcf\x34\x90\xf5\xf3\xb5\xd7", 1, 0, 0 }, { 80, 256, 128, 287, "\xdd\xee\x6a\x7b\x13\x1d\x31\x27\x5e\xc1\xcb\x35\x65\x4f\x9d\x25\xc3" "\x94\x98\x0a\x1d\xda\x37\xf7\x0a\xf0\xfb\x62\xdd\x77\xa9\xde", - "\x06\xd8\x4b\xae\x11\x70\x8c\x42\x80\x23", - "\x04\xc1\x27\x1e\xf5\x2c\x04\x1b", "", "", - "\xba\xc4\x36\xba\x98\x5f\xdf\x3f\x14\x44\x6b\x92\xdd\xf3\x5d\xd1", 1, - 64, 0 }, + "\x06\xd8\x4b\xae\x11\x70\x8c\x42\x80\x23", "\x04\xc1\x27\x1e\xf5\x2c\x04\x1b", "", "", + "\xba\xc4\x36\xba\x98\x5f\xdf\x3f\x14\x44\x6b\x92\xdd\xf3\x5d\xd1", 1, 64, 0 }, { 80, 256, 128, 288, "\xd3\xb4\x4b\x8d\xfc\x35\x30\x40\x4a\x63\xb3\xca\x04\xcc\x71\xcf\xc7" "\x1a\x55\x38\x44\x8b\x26\x25\xc9\x81\x85\x6c\xb7\xda\xed\x0f", "\x7c\x3c\x42\xfa\x17\x34\x7e\x1d\xf7\x97", "", "\x1d\x17\x75\x57\x96\x56\xf7\xf6\xc6\x89\x14\x01\xd7\x33\xe2\xab", "\x61\xd6\xde\xba\x72\xb4\x1e\x9d\xa6\x25\x9f\xa8\x05\xd7\x7e\xb9", - "\x51\x3f\x57\x31\xbd\x00\x0c\xe6\x8a\x6e\xaa\xdf\x3c\x92\x53\x5a", 1, - 0, 128 }, + "\x51\x3f\x57\x31\xbd\x00\x0c\xe6\x8a\x6e\xaa\xdf\x3c\x92\x53\x5a", 1, 0, 128 }, { 80, 256, 128, 289, "\xfe\xec\xec\x22\x5f\xcf\x20\x09\x38\x18\x88\x09\x94\xfe\xda\xd5\x3d" "\xc0\xc1\x74\x3a\xa9\x96\x71\xce\xfe\x29\x29\xa5\x03\xe0\xc6", - "\xab\x8d\x23\x83\x0b\x91\xdc\x6a\x89\x8e", - "\x24\x88\x9b\x2e\xf1\x2a\x31\x8a", + "\xab\x8d\x23\x83\x0b\x91\xdc\x6a\x89\x8e", "\x24\x88\x9b\x2e\xf1\x2a\x31\x8a", "\x7b\x70\xe1\xbf\xe1\xa7\x76\xe8\xf4\x4c\xa4\x32\xdd\x9e\xf9\x99", "\x46\xf6\x07\x30\xdb\x04\x13\x36\xcc\x05\x1d\x4e\xf4\xde\x02\x9d", - "\x77\x17\xad\xcf\x7d\x3e\xd0\xf7\x87\x8e\x1a\xc3\x3a\x35\xcb\x47", 1, - 64, 128 }, + "\x77\x17\xad\xcf\x7d\x3e\xd0\xf7\x87\x8e\x1a\xc3\x3a\x35\xcb\x47", 1, 64, 128 }, { 80, 256, 128, 290, "\xcf\xb7\x33\x08\xa8\x30\x90\x16\x1f\xed\x74\x33\x68\xf5\x48\x08\x72" "\xea\xa6\x2d\xf5\xa8\xea\x07\x7d\xee\x54\x0f\xd5\xa2\xef\x15", @@ -2399,49 +1929,40 @@ const struct aead_test aes_ccm_test_json[] = { "\x47", "\xd9\x2c\x03\x75\xa4\xdc\xb1\x84\xbc\x90\x25\x15\x85\x06\x1d\xb0" "\x36", - "\xa0\xdd\xef\x0c\x6b\xd9\x4f\xcd\xec\x39\xa7\xf0\x7f\x0a\x2c\x13", 1, - 0, 136 }, + "\xa0\xdd\xef\x0c\x6b\xd9\x4f\xcd\xec\x39\xa7\xf0\x7f\x0a\x2c\x13", 1, 0, 136 }, { 80, 256, 128, 291, "\x81\x5b\xda\xab\x3c\x18\x7a\xd7\x3b\x12\x7c\x8d\x39\xa1\x33\xb4\x1b" "\x66\xe2\x99\xba\x24\xfb\x44\x6e\x35\xe3\xb1\x12\xdb\x8e\x66", - "\x0c\xd0\x55\x1f\x0c\x74\x17\x60\xb7\x47", - "\xc1\xd0\x1e\x47\x31\xf3\x60\x66", + "\x0c\xd0\x55\x1f\x0c\x74\x17\x60\xb7\x47", "\xc1\xd0\x1e\x47\x31\xf3\x60\x66", "\x55\x87\x69\xc6\xd4\xf5\x0a\x0d\xb6\x20\xc2\x3f\xe1\x07\xa7\xfb" "\xe4", "\xc1\xce\x19\x2f\xb6\x71\x89\x2b\xb8\x3b\xd2\x2d\xbc\x82\xd6\x40" "\x82", - "\x4e\x0a\x0b\xe1\xaa\x0e\x75\xcd\x7b\xb1\xdc\xb2\x7a\x01\x09\x10", 1, - 64, 136 }, + "\x4e\x0a\x0b\xe1\xaa\x0e\x75\xcd\x7b\xb1\xdc\xb2\x7a\x01\x09\x10", 1, 64, 136 }, { 88, 256, 128, 292, "\x46\x94\x8c\x6d\x69\x84\x54\x99\x10\x4d\x5d\xc2\xfa\xe4\x48\x80\xcf" "\xe7\xd0\xbc\xbc\xee\x57\xef\xc0\x13\x3c\x26\x6b\x6d\x26\x21", "\x05\xf7\x15\xfd\x0a\x56\x03\xdd\x84\xaf\x76", "", "", "", - "\x11\xe6\x78\xc0\xb2\x60\xc5\xa3\xea\x70\xf6\xa4\x6e\x4e\xf4\x36", 1, - 0, 0 }, + "\x11\xe6\x78\xc0\xb2\x60\xc5\xa3\xea\x70\xf6\xa4\x6e\x4e\xf4\x36", 1, 0, 0 }, { 88, 256, 128, 293, "\xe6\x89\xeb\x77\xa5\x78\x39\x9f\xa1\x7a\x75\x08\x3d\x25\x01\x8f\xfb" "\xb6\x8f\x24\xd7\x7a\x02\x97\x57\x54\x1d\x65\x39\xbf\xfb\xdf", - "\x4a\x41\x96\x18\xb2\x83\x2d\xe7\xa4\xf9\x9b", - "\xec\xf4\x6e\xac\xa8\x41\x76\x9f", "", "", - "\x4a\x26\x15\xd2\xd5\xf8\xe9\x7b\x92\x74\x3b\x0e\xf2\xf4\x86\xab", 1, - 64, 0 }, + "\x4a\x41\x96\x18\xb2\x83\x2d\xe7\xa4\xf9\x9b", "\xec\xf4\x6e\xac\xa8\x41\x76\x9f", "", + "", "\x4a\x26\x15\xd2\xd5\xf8\xe9\x7b\x92\x74\x3b\x0e\xf2\xf4\x86\xab", 1, 64, 0 }, { 88, 256, 128, 294, "\xaa\xcb\x13\x36\xd6\xee\x4d\x96\xa9\xa1\x2e\x5b\x8f\x25\xf0\x48\x00" "\xd4\xaa\xba\x55\xf3\x79\x21\x8d\x64\xed\xb3\x46\x0f\xe2\x15", "\x99\x4c\x19\x1e\x7a\x29\xc0\xef\xc1\xeb\x4d", "", "\x7b\xea\xd5\xab\xcc\xc8\x76\xef\xb0\x10\x9e\x41\x2f\x06\xc7\x51", "\x5a\xa3\x1a\xa5\xeb\x10\x36\x55\xb7\x8c\x4f\x7b\xcf\x08\xc9\x17", - "\x64\xe4\x1d\x31\xeb\x0d\xf8\x0a\xdc\xee\x32\x8f\x08\x1c\x4a\xeb", 1, - 0, 128 }, + "\x64\xe4\x1d\x31\xeb\x0d\xf8\x0a\xdc\xee\x32\x8f\x08\x1c\x4a\xeb", 1, 0, 128 }, { 88, 256, 128, 295, "\x60\xd6\x84\x1e\x9e\x62\x18\xa2\xc8\x60\x5a\x77\x94\xe7\x4f\xb2\x15" "\xdc\xf3\xa7\x0a\x00\x15\xd4\x97\xed\x16\x56\x4f\x2a\x83\xa0", - "\x4c\x93\xf5\x91\xaf\x92\xf1\x65\x96\x55\x4e", - "\x7c\xb0\xeb\x9a\xa2\x1f\xe8\x59", + "\x4c\x93\xf5\x91\xaf\x92\xf1\x65\x96\x55\x4e", "\x7c\xb0\xeb\x9a\xa2\x1f\xe8\x59", "\xc0\xd1\xe6\x35\x58\x6b\x0e\xf8\x35\xc0\x14\x79\xa3\x21\x75\xa3", "\x0c\x26\x61\x13\x54\x4d\x7a\x90\x1c\xe7\x21\xe1\xea\xd6\xd8\xf9", - "\x8a\x14\x9e\xaa\x05\xc8\x72\x2b\x26\x63\xc3\x45\xa6\xa5\x41\x8c", 1, - 64, 128 }, + "\x8a\x14\x9e\xaa\x05\xc8\x72\x2b\x26\x63\xc3\x45\xa6\xa5\x41\x8c", 1, 64, 128 }, { 88, 256, 128, 296, "\x9d\xcd\xe5\x7c\xec\x27\xde\x6b\x58\x4d\xb4\xbd\x81\x09\x35\xbd\x3b" "\x3c\x4e\xa8\xf2\x2a\x16\xa7\xb2\xa6\x2e\xf5\x16\x79\xa1\x3b", @@ -2450,40 +1971,34 @@ const struct aead_test aes_ccm_test_json[] = { "\xb5", "\x43\xf7\xd9\x9c\x1a\x0e\x50\x4a\xad\xd8\xf8\xb2\x98\x1b\x4a\xea" "\x52", - "\x95\x8e\x19\xb5\xc1\x4e\xeb\xd2\xd2\x55\x09\x33\x6a\xa6\xd4\xc2", 1, - 0, 136 }, + "\x95\x8e\x19\xb5\xc1\x4e\xeb\xd2\xd2\x55\x09\x33\x6a\xa6\xd4\xc2", 1, 0, 136 }, { 88, 256, 128, 297, "\xb3\xa0\x6e\x00\x10\x0f\xfc\x42\xdb\xdd\x53\x17\xf4\x3d\x2b\x48\xf8" "\xc1\x1e\x4b\xd6\xe9\xe3\xed\xab\x58\xe9\x94\x4c\x55\x92\x78", - "\xf3\xd2\x4b\x36\x2b\xf1\x2b\x84\xb8\xa6\x6a", - "\x02\x42\xb5\xe8\x04\xa7\x91\x88", + "\xf3\xd2\x4b\x36\x2b\xf1\x2b\x84\xb8\xa6\x6a", "\x02\x42\xb5\xe8\x04\xa7\x91\x88", "\x03\xb0\x3b\x45\xf6\xf3\x20\xb9\x9d\x81\x58\xff\x8b\x00\xf0\xad" "\x92", "\xd1\x27\xfd\x42\xb2\xca\x4b\xec\xa9\xf9\xac\x86\xb6\x3a\x16\x22" "\xef", - "\x8a\x49\x9a\xab\x9e\x8f\x40\x96\xda\x60\x3c\x6c\xcf\xb9\xac\x4a", 1, - 64, 136 }, + "\x8a\x49\x9a\xab\x9e\x8f\x40\x96\xda\x60\x3c\x6c\xcf\xb9\xac\x4a", 1, 64, 136 }, { 104, 256, 128, 298, "\xa4\x99\x4b\x65\x14\x35\x36\x70\x7b\x15\x1e\xe6\xe7\x9e\x69\xab\x9c" "\x6d\x73\x00\x08\x19\xfd\x29\x91\xdd\x28\xab\xed\xe6\xb3\xe8", "\xac\x64\x44\x49\x72\xd7\x78\xd5\x2f\x55\x31\xae\x88", "", "", "", - "\x8f\x35\x30\xc8\xad\xf8\x6e\xbc\x6c\x44\x97\xce\xde\x15\xcc\xd9", 1, - 0, 0 }, + "\x8f\x35\x30\xc8\xad\xf8\x6e\xbc\x6c\x44\x97\xce\xde\x15\xcc\xd9", 1, 0, 0 }, { 104, 256, 128, 299, "\xf9\x9f\x27\x20\xf0\x3e\xc3\xa9\xd0\xda\xd3\x7e\x3a\x91\x5b\xea\x3a" "\x11\xcb\xa4\xbb\x0f\x60\xcd\x8f\x54\x2b\x33\x01\x63\xbc\xd0", "\x7e\x0f\x99\xa0\x48\xb6\xe2\x87\x97\x20\xfe\x43\x18", "\x94\xba\x97\x7e\x74\x45\x5e\xd8", "", "", - "\xcd\xc3\xbe\xf3\x9e\xa5\x3a\xf6\x80\x19\x9e\x36\x26\x09\xdc\x29", 1, - 64, 0 }, + "\xcd\xc3\xbe\xf3\x9e\xa5\x3a\xf6\x80\x19\x9e\x36\x26\x09\xdc\x29", 1, 64, 0 }, { 104, 256, 128, 300, "\x50\x5b\x26\xd1\x66\xa6\xeb\xd3\xdb\x69\xcf\x12\xbe\xe2\x5b\x73\x65" "\x1d\x0d\x33\x2d\x0f\xb2\x48\xb5\x0c\xe9\xa1\xfb\x3a\x13\xf1", "\xfb\x04\xf7\xbb\x3c\xd3\x82\xcb\xc0\x89\x37\x19\xaa", "", "\xae\x8b\xb1\xcb\xc9\x2c\x73\xe7\x3e\x59\xa0\xd7\xa9\xd7\xf5\x28", "\x43\x35\xb7\x08\xf2\x7d\x1c\x1b\x4d\x6e\x98\x5f\x18\xab\xa7\xc5", - "\x06\x9e\xe6\xf5\x27\x9d\xab\x73\x59\x3e\x11\x44\x0d\x23\x9e\xb8", 1, - 0, 128 }, + "\x06\x9e\xe6\xf5\x27\x9d\xab\x73\x59\x3e\x11\x44\x0d\x23\x9e\xb8", 1, 0, 128 }, { 104, 256, 128, 301, "\xa6\x93\x8b\x2e\x56\xd5\xdc\x55\x66\x59\x56\x84\x0a\xc6\x90\xc8\xac" "\x9f\xf4\x21\xcc\x06\x2f\xc3\x42\x09\xf7\x71\x5f\x2d\x52\x6e", @@ -2491,8 +2006,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x0a\x38\x09\xbc\x56\x3c\x66\x75", "\x9d\x28\x6b\xcc\x11\x5f\x10\xb2\xca\xa8\xc5\xd8\xda\xa9\x1e\xc7", "\x4e\xd4\xdb\xc8\xaa\x8c\xf6\x37\x50\x21\xd1\x5e\x43\xc1\xf6\xc3", - "\xbf\xba\x9c\x41\xec\x63\xaa\x29\x6b\x14\x46\xb8\x88\xb6\x25\x1c", 1, - 64, 128 }, + "\xbf\xba\x9c\x41\xec\x63\xaa\x29\x6b\x14\x46\xb8\x88\xb6\x25\x1c", 1, 64, 128 }, { 104, 256, 128, 302, "\x45\xe5\x9f\x44\x29\x08\x73\x60\xb1\xb2\x40\xfb\x9b\x59\x1d\x86\x1a" "\xd4\x93\x68\x8b\x0a\x5e\x8f\x85\xff\xea\x2a\xcf\xf8\x39\x3a", @@ -2501,8 +2015,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x3c", "\x67\x63\x7f\x9c\x9f\x7d\xa4\x1d\x4b\x36\x37\xe3\xa0\x54\x36\x2b" "\x30", - "\xb3\x46\xd7\x00\xcf\xec\x0f\x2d\x8e\x17\x6d\x3e\xb9\xc5\xbe\xc9", 1, - 0, 136 }, + "\xb3\x46\xd7\x00\xcf\xec\x0f\x2d\x8e\x17\x6d\x3e\xb9\xc5\xbe\xc9", 1, 0, 136 }, { 104, 256, 128, 303, "\x00\x4c\x6c\xa0\x40\x78\xbd\xfd\x55\x7f\x91\x50\x25\xa8\xec\x93\xb5" "\x36\x8b\x86\xca\xf3\xd6\x57\x43\x2a\x5e\x1d\x1c\xef\x99\x17", @@ -2512,40 +2025,33 @@ const struct aead_test aes_ccm_test_json[] = { "\x5a", "\x5b\x47\x08\xb7\x2b\x68\x46\x66\x39\xe4\xb5\xf3\xd3\xda\x1d\x1e" "\x84", - "\xf7\xf0\xc0\xe0\xc0\x1b\xf7\x72\xcb\xd9\x0c\xb9\x80\x93\xdf\xb8", 1, - 64, 136 }, - { 96, 128, 32, 304, - "\x10\x3e\x85\x9d\x3a\x23\x87\x24\xbf\x85\xb2\x10\x0f\x44\x2f\x1d", - "\xf9\x1d\x64\x78\x41\x61\xfa\xbd\x6c\x96\x2e\x50", "", "", "", - "\x2b\x31\xc2\x1b", 1, 0, 0 }, - { 96, 128, 32, 305, - "\x71\x46\x6d\xc3\x04\x6b\x1e\x6c\x08\x38\xba\x6c\x9e\xf4\x1e\x79", + "\xf7\xf0\xc0\xe0\xc0\x1b\xf7\x72\xcb\xd9\x0c\xb9\x80\x93\xdf\xb8", 1, 64, 136 }, + { 96, 128, 32, 304, "\x10\x3e\x85\x9d\x3a\x23\x87\x24\xbf\x85\xb2\x10\x0f\x44\x2f\x1d", + "\xf9\x1d\x64\x78\x41\x61\xfa\xbd\x6c\x96\x2e\x50", "", "", "", "\x2b\x31\xc2\x1b", 1, 0, + 0 }, + { 96, 128, 32, 305, "\x71\x46\x6d\xc3\x04\x6b\x1e\x6c\x08\x38\xba\x6c\x9e\xf4\x1e\x79", "\x29\x28\x09\x5b\xd7\x96\x2e\x9e\x60\x24\xa2\xb9", - "\xa6\x17\xcc\xe7\x4d\x04\x39\x90\x05\x97\xcb\x3d\xdc\xfc\x25\xfb", - "", "", "\x38\x3f\x8a\xbc", 1, 128, 0 }, - { 96, 128, 32, 306, - "\x3c\xc9\x38\x04\xe2\xd6\x99\x61\x92\x78\xa9\x41\x38\x9c\xec\x3c", + "\xa6\x17\xcc\xe7\x4d\x04\x39\x90\x05\x97\xcb\x3d\xdc\xfc\x25\xfb", "", "", + "\x38\x3f\x8a\xbc", 1, 128, 0 }, + { 96, 128, 32, 306, "\x3c\xc9\x38\x04\xe2\xd6\x99\x61\x92\x78\xa9\x41\x38\x9c\xec\x3c", "\xc7\x75\xdd\xa3\x14\xaf\x64\xc3\x10\xa7\xc1\xd3", "", "\x12\x4c\xe7\x1e\x08\xc1\x32\x4f\x91\x65\x70\xd5\x33\x03\x29\x19", - "\xf2\x46\x75\x4c\xd3\x2a\x99\x60\xd3\xd5\xe5\x35\x2f\x1d\x73\xc7", - "\x60\xdb\xd6\x76", 1, 0, 128 }, - { 96, 128, 32, 307, - "\x90\x89\xe1\x78\xf3\xf9\x0b\xfc\x0f\x68\xe5\x59\xd3\x38\xc3\x9d", + "\xf2\x46\x75\x4c\xd3\x2a\x99\x60\xd3\xd5\xe5\x35\x2f\x1d\x73\xc7", "\x60\xdb\xd6\x76", 1, + 0, 128 }, + { 96, 128, 32, 307, "\x90\x89\xe1\x78\xf3\xf9\x0b\xfc\x0f\x68\xe5\x59\xd3\x38\xc3\x9d", "\x8b\x2b\xfc\xa6\x47\x75\xb5\x09\x35\xb4\x82\x21", "\xca\x9b\x40\x50\xb6\xbd\x0f\x0e\xba\xef\xfb\x78\xf2\x4a\x41\x1f", "\x33\xd9\x02\x09\x3b\xa5\x21\x69\x33\x23\x6c\x08\xfa\x5c\x0c\xb2", - "\xe0\x57\x18\x08\xbf\x38\x9c\x1a\x07\xca\x7e\x5b\xbf\x49\xa1\xff", - "\xcc\x34\x6e\x6d", 1, 128, 128 }, - { 96, 128, 32, 308, - "\x33\xcf\xf6\x80\x61\xe3\xf5\xf9\x41\xc8\xc2\x0c\x89\x60\x8b\x77", + "\xe0\x57\x18\x08\xbf\x38\x9c\x1a\x07\xca\x7e\x5b\xbf\x49\xa1\xff", "\xcc\x34\x6e\x6d", 1, + 128, 128 }, + { 96, 128, 32, 308, "\x33\xcf\xf6\x80\x61\xe3\xf5\xf9\x41\xc8\xc2\x0c\x89\x60\x8b\x77", "\xeb\x58\x1f\x66\xcc\xc7\xf1\xda\xa2\x35\xbf\x27", "", "\x24\xa9\xd8\x95\xf6\x04\x6b\x93\x68\xb0\xb6\xb0\xfb\x39\x6c\xd1" "\x0e", "\x12\x1f\x88\xe8\x1d\x27\xda\x5c\x5d\x5c\x9a\xb3\x97\xc7\xb2\x05" "\xf7", "\x2f\xa4\x51\x6d", 1, 0, 136 }, - { 96, 128, 32, 309, - "\xc0\x1b\x91\x5d\x2d\x21\x12\x28\x8e\xd0\x4d\x2c\xdd\x38\x9b\xd7", + { 96, 128, 32, 309, "\xc0\x1b\x91\x5d\x2d\x21\x12\x28\x8e\xd0\x4d\x2c\xdd\x38\x9b\xd7", "\x98\xac\xed\x46\x74\xfa\xeb\xe3\xfd\x48\x81\xcc", "\x20\x90\xbd\x59\x34\xb2\x0e\x26\xc7\x04\xaf\x9f\x85\xc9\xc4\x10", "\x63\xda\xb2\xe2\xa2\x2a\x63\xa7\xe5\x50\x46\x67\x63\x45\x55\x93" @@ -2553,16 +2059,14 @@ const struct aead_test aes_ccm_test_json[] = { "\x13\xef\xab\xa6\x39\x13\xe7\xa9\xd8\xa4\xfd\x89\xe3\x49\xc4\xa0" "\xa0", "\x65\x53\xc6\x47", 1, 128, 136 }, - { 96, 128, 32, 310, - "\xa9\x68\xcf\xd7\xf6\x3f\x3a\x27\x68\x71\xe3\x03\x83\x07\x7d\xe8", + { 96, 128, 32, 310, "\xa9\x68\xcf\xd7\xf6\x3f\x3a\x27\x68\x71\xe3\x03\x83\x07\x7d\xe8", "\x54\xbf\xc8\x2e\x1c\xb5\xc0\xb9\xa6\x5b\x25\x2c", "", "\x03\x0f\xa6\xb0\xed\xde\x45\xcb\x65\x88\x13\xd0\xd7\x97\xae\xdf\x1b" "\xa2\x7f\x43\x5d\xf4\xf4\x43\xa3\x46\x9e\xa0\xe4\x1e\x63", "\x60\xd5\x64\x55\x60\xb0\xfa\x0b\x29\x57\x0b\xaf\xd2\xb6\xe1\x8d\x83" "\x9c\xea\xf8\x82\x42\xcb\x6c\x7c\x60\x8d\x30\x01\xb7\xcd", "\xa9\x2b\x60\xf6", 1, 0, 248 }, - { 96, 128, 32, 311, - "\x76\x45\x87\x4c\xc7\xa9\xf0\xe7\x44\x32\x03\xab\xec\x23\x45\x5b", + { 96, 128, 32, 311, "\x76\x45\x87\x4c\xc7\xa9\xf0\xe7\x44\x32\x03\xab\xec\x23\x45\x5b", "\xce\x56\x6b\x86\x6e\xf0\xfd\x3b\x09\x6f\x3e\x9e", "\x1e\x00\x46\x9a\xd4\x5b\x2c\x24\xcd\xdb\xa5\x29\x85\x16\x9a\xab", "\xb6\xb0\x50\x21\xae\x99\xe4\xaf\xe0\xec\x92\xc0\x09\xd0\x6c\x42\x86" @@ -2570,38 +2074,32 @@ const struct aead_test aes_ccm_test_json[] = { "\xea\x62\xf4\x28\x31\x70\x94\x24\xf8\xa8\x13\x83\x02\x47\x7d\x51\x6b" "\x05\xe3\x1f\x23\xb4\x5e\xf3\x77\x03\x3b\x79\x23\x29\x2f", "\x77\x4a\xae\x96", 1, 128, 248 }, - { 96, 128, 48, 312, - "\x1a\x85\x2b\x34\x56\x35\x3c\xfd\x21\x72\x6d\x11\x22\x10\x9f\x1d", + { 96, 128, 48, 312, "\x1a\x85\x2b\x34\x56\x35\x3c\xfd\x21\x72\x6d\x11\x22\x10\x9f\x1d", "\xbd\xe9\x16\x5d\x65\xf3\x01\xa2\xe4\xff\x1d\x4a", "", "", "", "\xbd\x22\xf7\x19\x5c\x49", 1, 0, 0 }, - { 96, 128, 48, 313, - "\x44\xb5\x29\x8a\x67\x7b\xaf\xf5\xc3\xa6\x5d\x51\x2a\x65\x19\x92", + { 96, 128, 48, 313, "\x44\xb5\x29\x8a\x67\x7b\xaf\xf5\xc3\xa6\x5d\x51\x2a\x65\x19\x92", "\xcb\xb2\x50\x28\x3f\x75\xa6\x60\x82\xf1\xa7\x85", - "\x19\x03\x1c\x68\x8c\xee\xe8\x4e\x2d\x25\x25\x3a\xcc\xba\xe6\x8e", - "", "", "\x93\x10\xab\x0e\x0d\x1c", 1, 128, 0 }, - { 96, 128, 48, 314, - "\x63\xc7\x47\xbe\x2f\x30\x69\xd5\x00\x15\xf6\x9d\xba\xe0\x98\x76", + "\x19\x03\x1c\x68\x8c\xee\xe8\x4e\x2d\x25\x25\x3a\xcc\xba\xe6\x8e", "", "", + "\x93\x10\xab\x0e\x0d\x1c", 1, 128, 0 }, + { 96, 128, 48, 314, "\x63\xc7\x47\xbe\x2f\x30\x69\xd5\x00\x15\xf6\x9d\xba\xe0\x98\x76", "\xbc\x2c\x94\x05\x25\xe5\x14\x40\x98\x15\xab\x19", "", "\xad\x5c\xa7\x0a\x32\x53\x63\xc3\x4b\x2f\x3d\x5a\x85\x76\xb9\x64", "\xac\xb6\x2f\x8c\x47\x81\x27\x9d\x5c\x81\xcc\xae\xe4\xf6\x1e\xbe", "\xcb\xbc\xa0\x32\x69\x50", 1, 0, 128 }, - { 96, 128, 48, 315, - "\xa4\x65\xbe\x21\xf5\xb4\x20\xcd\x39\x00\x9b\x0e\xf8\x9d\xbe\xc2", + { 96, 128, 48, 315, "\xa4\x65\xbe\x21\xf5\xb4\x20\xcd\x39\x00\x9b\x0e\xf8\x9d\xbe\xc2", "\xd8\xb2\x87\xca\xee\x5a\xf6\x9b\xc8\x95\x45\xe9", "\xb4\x52\xe6\xc1\x12\x64\x7d\xe6\x74\x24\x9d\x1e\xec\x10\x9f\xfc", "\xc1\x90\xd1\x27\x03\x34\x01\x6d\xae\xeb\x12\xf0\xdd\xd5\x59\x05", "\xcd\x9e\x9c\xb0\x1e\x77\x37\xcf\x87\xa7\x36\xa5\x0a\x40\x69\x4b", "\xae\x86\xc7\x00\x51\x83", 1, 128, 128 }, - { 96, 128, 48, 316, - "\x1c\xb1\x73\xba\x47\x85\xbc\x6b\x72\x8c\x86\x29\x29\xda\xea\x5f", + { 96, 128, 48, 316, "\x1c\xb1\x73\xba\x47\x85\xbc\x6b\x72\x8c\x86\x29\x29\xda\xea\x5f", "\xd7\x6c\xdf\xb5\x95\xc3\xfe\x3d\x7c\xc0\x65\x4f", "", "\xee\xf6\x69\x1b\xa8\xe2\x28\xb7\xbd\xa4\xb2\x6f\xd3\x53\x95\x07" "\x57", "\xe8\xad\x83\x31\x15\x84\xd4\xb4\xbd\xb2\x1b\xa0\xf6\x2f\xbb\x13" "\xd2", "\x0f\x8f\x63\x95\x41\x3d", 1, 0, 136 }, - { 96, 128, 48, 317, - "\xa4\xa1\x07\xff\x7a\x4c\x09\x78\xaa\x17\xc5\x51\xff\x9f\x8a\x04", + { 96, 128, 48, 317, "\xa4\xa1\x07\xff\x7a\x4c\x09\x78\xaa\x17\xc5\x51\xff\x9f\x8a\x04", "\x50\x2d\x4b\xc4\x40\xc3\xf6\x6d\xb3\x9a\x09\xf4", "\x20\xd6\x43\xe0\xaf\x5c\x67\x3b\xe4\x54\xe5\x31\xd9\x29\x95\xc1", "\x51\x0d\x64\x55\x1a\x78\xca\x2c\xd8\xd3\x22\xf8\x2f\x6e\x2c\xd6" @@ -2609,16 +2107,14 @@ const struct aead_test aes_ccm_test_json[] = { "\x57\x85\x87\x6e\x6f\xd0\x45\xa0\xce\xa1\x85\xec\xb0\x75\x10\x2f" "\x97", "\x6c\x21\x04\x66\x57\xd9", 1, 128, 136 }, - { 96, 128, 48, 318, - "\xb7\x8d\xd7\x5d\x16\xec\xe4\x9b\xfd\x01\xe8\xf4\xbc\xd0\xd5\x2e", + { 96, 128, 48, 318, "\xb7\x8d\xd7\x5d\x16\xec\xe4\x9b\xfd\x01\xe8\xf4\xbc\xd0\xd5\x2e", "\x1f\xff\x0b\x5a\x56\x6f\x3d\x1b\x25\x2e\x51\x66", "", "\xf4\x38\x00\x03\x59\x44\x8e\xd5\xd7\x91\xbe\xab\x63\x72\x99\xa1\x8c" "\x9d\xf4\x5e\x6a\x03\x04\x28\xcc\xa6\xcc\x05\xb2\xc2\x5e", "\x65\xc3\x63\xa0\xcf\x88\xf9\xea\x74\xc4\x7f\x46\x98\x1f\xc9\xa8\x45" "\x40\x2c\x52\x05\xb1\xd0\xc1\xbd\xb4\x24\x9c\x78\x87\xfb", "\x39\xa8\x32\xac\x3b\x9f", 1, 0, 248 }, - { 96, 128, 48, 319, - "\x22\x8b\xf7\x86\xa9\x37\x1d\x98\x75\x18\x96\x78\xa4\x0f\x55\xa0", + { 96, 128, 48, 319, "\x22\x8b\xf7\x86\xa9\x37\x1d\x98\x75\x18\x96\x78\xa4\x0f\x55\xa0", "\x41\x48\xce\x9b\x64\x72\x28\x75\x1f\x31\x3c\x2d", "\x33\x90\xa6\x5d\x1a\xce\x02\xbf\x67\x26\x52\x54\xbe\x9c\x34\xd7", "\xa6\x0a\x55\x5b\xa4\x8a\x06\x5d\xa2\x99\x9a\x45\x26\xce\xce\x66\xe8" @@ -2626,38 +2122,32 @@ const struct aead_test aes_ccm_test_json[] = { "\xfd\x06\x73\x7f\x69\x5a\xd8\x7d\x70\x35\x4b\x67\xc2\x40\xcc\x80\xe4" "\x1e\xea\x60\xf3\x58\x34\xfa\x1c\x86\x43\x9a\x3a\x26\x93", "\x22\x28\x51\xc9\x6f\xc9", 1, 128, 248 }, - { 96, 128, 64, 320, - "\x5a\xfb\x73\xf3\x7d\x05\x14\x75\x66\xa7\xac\x97\x34\xeb\xa3\xff", + { 96, 128, 64, 320, "\x5a\xfb\x73\xf3\x7d\x05\x14\x75\x66\xa7\xac\x97\x34\xeb\xa3\xff", "\x02\x6d\xd1\x25\xc9\x8e\xf1\x50\x7f\x6d\x1d\x15", "", "", "", "\xa4\xc4\xb1\x36\x62\x5f\x02\x43", 1, 0, 0 }, - { 96, 128, 64, 321, - "\x3c\xf9\x38\x73\x3c\xb7\x6e\x43\x3a\x5b\x5c\xcb\x06\xbe\x34\x21", + { 96, 128, 64, 321, "\x3c\xf9\x38\x73\x3c\xb7\x6e\x43\x3a\x5b\x5c\xcb\x06\xbe\x34\x21", "\xa5\xbc\x5b\xd3\x83\xce\x11\x08\x10\x2c\x3c\x7b", - "\xbe\xfd\xff\x73\x13\xd3\x3c\xa6\x39\x8f\x84\xb3\x2e\xf7\x7c\x65", - "", "", "\xd6\x65\xa6\xea\x1a\xc4\x64\x9a", 1, 128, 0 }, - { 96, 128, 64, 322, - "\x22\xed\x64\xb5\xb9\x4a\x3c\x41\x16\xd0\x2b\x4f\xbd\x4e\x58\x81", + "\xbe\xfd\xff\x73\x13\xd3\x3c\xa6\x39\x8f\x84\xb3\x2e\xf7\x7c\x65", "", "", + "\xd6\x65\xa6\xea\x1a\xc4\x64\x9a", 1, 128, 0 }, + { 96, 128, 64, 322, "\x22\xed\x64\xb5\xb9\x4a\x3c\x41\x16\xd0\x2b\x4f\xbd\x4e\x58\x81", "\xf4\x98\xfd\x65\xda\xb2\x34\x52\x0d\xe5\x29\x20", "", "\x94\xb0\x3b\x07\x77\x2b\x70\x56\x2b\xc7\x29\x50\x5b\x4a\xd4\x26", "\x4c\x4d\xfe\x97\x11\xb3\x20\x26\x4f\x3a\x57\xec\xdc\xd5\x98\x50", "\xb1\x3a\xea\x29\x80\x76\x7f\xd7", 1, 0, 128 }, - { 96, 128, 64, 323, - "\xea\x5a\x91\x5f\xd7\xbe\x0a\xaf\x14\xb8\x8f\x5d\xc4\xfd\x71\x9a", + { 96, 128, 64, 323, "\xea\x5a\x91\x5f\xd7\xbe\x0a\xaf\x14\xb8\x8f\x5d\xc4\xfd\x71\x9a", "\xae\xec\xf1\x9f\x7d\x33\x79\xee\x55\xba\x64\x68", "\x13\x79\x1a\xad\x58\x12\xa3\x62\x29\x1a\x4f\x6d\x63\x68\x7d\x33", "\xd3\x13\xe0\x9c\xd4\x8b\x06\xf1\x6e\xf9\x17\x8e\x42\x62\x4b\xd0", "\xf9\xbc\x9a\x66\x18\x6b\x6a\x60\x03\x5d\x14\x4d\xfb\x34\xc4\xaf", "\x2f\xb6\x37\xff\x91\xd6\xfd\x9e", 1, 128, 128 }, - { 96, 128, 64, 324, - "\x89\x12\x11\x03\xc3\x50\xe2\x9f\x7c\xd5\x80\xf0\x5b\xbf\xea\xac", + { 96, 128, 64, 324, "\x89\x12\x11\x03\xc3\x50\xe2\x9f\x7c\xd5\x80\xf0\x5b\xbf\xea\xac", "\xf6\xd6\xe8\x02\xab\xdf\x43\x23\x00\x30\xa8\x96", "", "\x63\x68\x40\xff\xbc\x66\x19\x1b\xc3\x7b\xf2\xe6\xbd\xdf\x28\xbd" "\xa9", "\xc6\x91\x20\x62\x54\x8d\xba\x55\xe6\x18\x4e\x8f\x50\x7d\x7f\x9c" "\x7d", "\x1b\x30\x0d\xe3\x55\x38\xc2\x52", 1, 0, 136 }, - { 96, 128, 64, 325, - "\x03\xad\x5f\x47\x2b\x97\x8c\x5f\x72\xb7\xb1\xc2\x90\x80\x37\x4c", + { 96, 128, 64, 325, "\x03\xad\x5f\x47\x2b\x97\x8c\x5f\x72\xb7\xb1\xc2\x90\x80\x37\x4c", "\x77\x0d\xcc\x2e\xa1\xc2\xd9\xf6\xc9\x04\x94\x7d", "\x97\x2c\x90\xe3\x87\xf0\xaf\x93\x6b\x1c\x9d\xb0\xeb\xfe\xbb\xe9", "\x78\x47\x05\x11\xca\xf1\x2c\xb8\x82\x62\x80\x92\xbb\x57\x3b\xde" @@ -2665,16 +2155,14 @@ const struct aead_test aes_ccm_test_json[] = { "\x3f\xb2\x2c\x2c\x36\x6c\x0a\x46\xba\x16\x40\xec\xcb\x54\x4d\xbd" "\xd2", "\x3e\xc7\xc4\x88\x8a\x12\x88\xfc", 1, 128, 136 }, - { 96, 128, 64, 326, - "\x48\x56\xb1\x07\xdb\xbc\xe7\x02\xc7\xcd\xaa\x7e\xc1\x74\x0f\x35", + { 96, 128, 64, 326, "\x48\x56\xb1\x07\xdb\xbc\xe7\x02\xc7\xcd\xaa\x7e\xc1\x74\x0f\x35", "\x6f\x41\xac\xab\xda\x1e\x03\x48\xc4\x29\x0f\x0f", "", "\xd3\x2d\xec\xc5\x5d\xbd\x0c\x08\x91\x6c\x9a\x9e\x3d\x08\x46\xae\x2c" "\xac\xae\xb1\xba\x0e\x04\xeb\x02\x77\x2c\xf6\xa5\x0e\x46", "\x2f\x3f\x13\x3c\xa5\x44\xea\xa5\x15\xa1\x6f\x8b\x1c\xf1\x2e\x17\x4a" "\xa8\x0d\xb6\x08\x26\x8e\xad\x25\xac\xe1\xca\x4e\xef\xed", "\x2f\xfa\x78\x6a\xdc\x94\xae\x2a", 1, 0, 248 }, - { 96, 128, 64, 327, - "\xc0\x83\x39\xa6\xf8\x0b\x84\xe2\x01\xe3\xd6\x03\x0c\xdb\x3f\x02", + { 96, 128, 64, 327, "\xc0\x83\x39\xa6\xf8\x0b\x84\xe2\x01\xe3\xd6\x03\x0c\xdb\x3f\x02", "\x1c\xbf\x2c\xa3\x13\x30\xab\xe7\x49\xdb\x58\x8b", "\xb5\x35\xa8\x47\xdf\xc9\x62\x01\x2d\x91\x3a\x40\x76\xf5\x8f\x9f", "\x4f\x9f\xd6\xad\x16\x56\xcc\xe9\x9a\xf7\x46\x99\x60\x07\x3a\x24\x15" @@ -2682,38 +2170,32 @@ const struct aead_test aes_ccm_test_json[] = { "\xc9\x1d\x4c\x8b\xf7\xfd\xba\x49\xb8\x70\x01\xfc\x3e\xc9\x5f\x45\x5b" "\xa3\x2b\xc0\x5b\xa3\x36\xbc\x3d\x58\xf4\xad\x08\xb5\xbc", "\x34\xd6\x22\xfe\x4b\xa3\xca\xc5", 1, 128, 248 }, - { 96, 128, 80, 328, - "\x1f\xaf\x80\x05\xf7\x75\x53\xf5\xee\x26\x86\x5e\x31\xf5\x08\x7b", + { 96, 128, 80, 328, "\x1f\xaf\x80\x05\xf7\x75\x53\xf5\xee\x26\x86\x5e\x31\xf5\x08\x7b", "\x40\xdf\x77\xe5\x37\xc8\x95\xab\x71\x46\x4a\xcc", "", "", "", "\x22\xff\xed\x9c\x2d\xca\x19\xfa\x32\xef", 1, 0, 0 }, - { 96, 128, 80, 329, - "\xf2\x0c\x79\xf8\x45\xbe\xd4\x06\x46\x9c\xf1\xcd\x3f\x7d\xaa\xc5", + { 96, 128, 80, 329, "\xf2\x0c\x79\xf8\x45\xbe\xd4\x06\x46\x9c\xf1\xcd\x3f\x7d\xaa\xc5", "\xf7\xbc\xa6\x6e\xcc\xd7\xd4\x94\xde\xc7\x58\xf5", - "\x6e\x45\x36\x57\x58\x83\x92\x5a\x92\x9c\xed\x31\xad\x8f\xb6\xdd", - "", "", "\x2f\x25\xa1\xd0\x02\x61\x58\x9f\x3f\x00", 1, 128, 0 }, - { 96, 128, 80, 330, - "\xb8\xba\xe0\x12\x60\xce\xd6\x19\x4e\xf8\xdf\x72\x2d\x65\x9b\xe6", + "\x6e\x45\x36\x57\x58\x83\x92\x5a\x92\x9c\xed\x31\xad\x8f\xb6\xdd", "", "", + "\x2f\x25\xa1\xd0\x02\x61\x58\x9f\x3f\x00", 1, 128, 0 }, + { 96, 128, 80, 330, "\xb8\xba\xe0\x12\x60\xce\xd6\x19\x4e\xf8\xdf\x72\x2d\x65\x9b\xe6", "\x71\xd1\x0b\x7c\xbb\xbe\xcb\x84\x3e\x67\x8a\xb5", "", "\x38\x7c\x03\x24\xcd\x47\xd3\xf2\x2c\xc9\xd9\x68\xa7\x2e\x43\x4d", "\x0c\x36\xe3\x03\xe2\x95\xa2\x89\xbb\x13\x47\x40\xe2\x1a\x66\x64", "\xd3\x58\x7e\x21\x86\x55\x3f\xd9\xd4\x09", 1, 0, 128 }, - { 96, 128, 80, 331, - "\xb8\x00\x30\xb8\x3c\x4b\xca\xfd\x1b\x7e\xc9\xc7\x0a\xb9\x22\x4c", + { 96, 128, 80, 331, "\xb8\x00\x30\xb8\x3c\x4b\xca\xfd\x1b\x7e\xc9\xc7\x0a\xb9\x22\x4c", "\xa7\x89\x45\x7f\x80\xbd\xc5\xb8\xf1\x5f\xea\x91", "\x12\x30\x97\x7b\x9a\x5b\x12\xc8\xee\x10\xa3\xb4\xab\xb4\xf0\x6e", "\x19\x7a\x27\xed\xfc\x49\x95\x3b\x6d\xad\xfb\xe7\x17\x0f\xc7\x50", "\x2b\xc4\x76\x3b\xa5\xb4\x24\xa1\xf2\x6b\xb6\x25\xd9\xf6\xd5\x15", "\xd5\xbd\x4f\xa2\x3a\x45\x39\x5c\x71\x6f", 1, 128, 128 }, - { 96, 128, 80, 332, - "\x95\xe5\x17\x9e\xb1\x97\xf1\xa5\x15\xe1\x99\xbd\x93\x79\x48\xcd", + { 96, 128, 80, 332, "\x95\xe5\x17\x9e\xb1\x97\xf1\xa5\x15\xe1\x99\xbd\x93\x79\x48\xcd", "\x49\xd4\x07\x7a\xd5\xd8\xbb\x84\xee\xcc\xf7\x11", "", "\x45\xd9\x09\x5c\xf3\x20\xc5\x82\xc8\x97\xf0\xab\xb5\x3e\x3a\xed" "\xec", "\x36\xb3\xc9\xe7\xc2\x54\x39\xf2\x05\xff\x0e\x38\xff\x46\x79\x61" "\xb8", "\xc6\xb8\x39\xab\x6e\xe9\x97\x8e\xae\xdb", 1, 0, 136 }, - { 96, 128, 80, 333, - "\xfa\xc8\xd9\x8a\x8a\xf9\x32\x39\xb0\xd9\x55\x16\x57\xc5\x95\x1d", + { 96, 128, 80, 333, "\xfa\xc8\xd9\x8a\x8a\xf9\x32\x39\xb0\xd9\x55\x16\x57\xc5\x95\x1d", "\xff\x1f\x41\x9b\xed\x64\xbf\x4a\x02\xc3\x57\xe5", "\x2e\x3f\x10\x2d\xe4\x45\xb4\xec\x11\x7b\x63\xfb\xa7\x08\x9d\xe8", "\x11\x97\xd7\x6a\x46\x9c\x17\x43\x82\x01\xef\x40\x00\xfa\x05\xf0" @@ -2721,16 +2203,14 @@ const struct aead_test aes_ccm_test_json[] = { "\x96\xe2\x39\x10\xda\xa8\x64\xeb\x12\x68\xdb\xf2\x33\x9e\xd4\xbb" "\x62", "\xeb\xd1\x52\xd5\xf2\xd0\x0c\x60\xec\xd4", 1, 128, 136 }, - { 96, 128, 80, 334, - "\xde\x54\x50\x44\xb8\x14\xf3\x13\xc2\x3b\x5c\xb8\x54\xf7\x39\xa2", + { 96, 128, 80, 334, "\xde\x54\x50\x44\xb8\x14\xf3\x13\xc2\x3b\x5c\xb8\x54\xf7\x39\xa2", "\x99\xfc\xac\xe8\xe5\x9b\xdd\x6b\x88\xdd\x96\x0c", "", "\x83\x52\x5d\xbb\xb5\x4d\xe0\xfc\x1d\x24\x87\x49\xa7\x16\xd9\xde\xbc" "\x65\xfe\x44\xc7\x9b\x16\x3b\x36\x14\xfb\x8d\x62\xee\x2e", "\xa0\xe6\xe3\xd5\x31\xb8\x63\xb9\xe6\xf3\x8c\xf0\x3d\x60\xf1\xd6\x93" "\x0c\xb1\x7a\xa4\x1a\x78\xa6\x6d\x5b\x94\x9c\x5f\x7e\xc7", "\x01\x38\xc4\x33\x9b\xfe\xd8\x18\x96\x4b", 1, 0, 248 }, - { 96, 128, 80, 335, - "\xbb\xbf\xa9\x44\x44\x93\xdd\x2f\xbf\x72\xba\xf3\x87\xa4\x09\x00", + { 96, 128, 80, 335, "\xbb\xbf\xa9\x44\x44\x93\xdd\x2f\xbf\x72\xba\xf3\x87\xa4\x09\x00", "\x29\x35\x56\x7a\xa5\x72\x90\x8e\x49\x91\x71\x30", "\xc0\xdb\x66\x6f\x38\x14\xfd\xc2\xcf\x7c\xb3\xd4\xce\xfa\xf2\xd3", "\x59\xfc\x37\x65\x4b\x0a\x5e\x3b\x86\x87\xa3\xd8\x5b\x32\x64\x4d\xc7" @@ -2738,39 +2218,32 @@ const struct aead_test aes_ccm_test_json[] = { "\x46\x4f\x1d\x04\x17\x28\x0f\x22\xf0\x60\x53\xcb\xea\x16\xe2\x8e\xb0" "\xf7\x90\x82\xa6\x82\xb5\x8c\xb7\x19\x42\x36\x93\xe6\x6c", "\x19\x87\x01\x52\x03\x23\xf4\x61\x3b\x59", 1, 128, 248 }, - { 96, 128, 96, 336, - "\x0a\xd9\xda\x99\x4d\xb2\xed\x7b\x9e\x35\xe9\x88\x95\x19\x4c\x4b", + { 96, 128, 96, 336, "\x0a\xd9\xda\x99\x4d\xb2\xed\x7b\x9e\x35\xe9\x88\x95\x19\x4c\x4b", "\x57\xe3\x64\xc1\x6b\x36\x89\xbc\x15\x6b\x31\x15", "", "", "", "\x73\x58\x6e\xab\x8c\xed\x75\x40\x62\x0f\xea\x72", 1, 0, 0 }, - { 96, 128, 96, 337, - "\x97\x04\x95\xf7\x0d\xc6\x4f\x0f\xe4\xe8\xc1\x09\x46\xdf\x2e\xd1", + { 96, 128, 96, 337, "\x97\x04\x95\xf7\x0d\xc6\x4f\x0f\xe4\xe8\xc1\x09\x46\xdf\x2e\xd1", "\x69\xb1\xa3\x19\x5c\x16\x55\x17\xfe\xd6\x65\x95", - "\xbf\xe8\x73\x6a\x21\x13\xf7\x74\xc6\x82\x8e\x5b\x93\x0f\x1c\xb9", - "", "", "\x18\xd7\xc5\x4f\x8f\xcb\xec\x44\x2b\x31\x39\x87", 1, 128, - 0 }, - { 96, 128, 96, 338, - "\xf3\x63\xf1\xa7\xd3\x3c\x96\x94\x9f\xd0\x8f\x44\x0c\xfb\xa0\x00", + "\xbf\xe8\x73\x6a\x21\x13\xf7\x74\xc6\x82\x8e\x5b\x93\x0f\x1c\xb9", "", "", + "\x18\xd7\xc5\x4f\x8f\xcb\xec\x44\x2b\x31\x39\x87", 1, 128, 0 }, + { 96, 128, 96, 338, "\xf3\x63\xf1\xa7\xd3\x3c\x96\x94\x9f\xd0\x8f\x44\x0c\xfb\xa0\x00", "\x67\xb9\x20\x07\xf5\x7b\x83\xfd\x9f\x3e\xe6\xfa", "", "\xa6\x51\xd2\xca\x4b\x16\x98\x0b\x0e\x4a\x7a\x10\xc7\x5c\x47\xed", "\x20\xc2\xa2\xf1\x8d\x07\x53\xac\xd3\x6e\x20\x49\x85\x14\x95\x28", "\x4a\x44\x22\xd3\xb9\x9c\x8d\x77\xdb\xde\x2a\xb2", 1, 0, 128 }, - { 96, 128, 96, 339, - "\x6b\x74\x89\xd1\x58\xf3\x77\xe6\x69\x2d\x84\xa9\x77\x27\xff\x41", + { 96, 128, 96, 339, "\x6b\x74\x89\xd1\x58\xf3\x77\xe6\x69\x2d\x84\xa9\x77\x27\xff\x41", "\x9a\xc0\x91\xef\x05\xd0\xce\x74\x28\x82\x7e\xd3", "\x38\x46\x9f\x10\x49\xa7\xea\x3d\xa0\x55\x1c\xfb\x34\x01\x0b\xf6", "\x35\x2d\xbd\x5b\xb8\xab\xf0\xa0\x97\xb9\x29\x16\x0b\x8f\x8c\xec", "\x00\xd3\x94\x8b\xac\x85\x72\xed\x1e\xd5\x9c\x26\x55\xb7\x69\xf7", "\x32\x3b\xa1\xc8\x06\xf3\xea\xc6\x73\x01\x5a\x88", 1, 128, 128 }, - { 96, 128, 96, 340, - "\x38\xd4\xd2\x7c\x30\x83\x49\x68\xb5\x28\x5b\x99\xac\x18\x73\x4a", + { 96, 128, 96, 340, "\x38\xd4\xd2\x7c\x30\x83\x49\x68\xb5\x28\x5b\x99\xac\x18\x73\x4a", "\x18\x3a\xe3\x52\xd9\xc3\x40\xee\x61\x67\xc3\xb6", "", "\xf1\x53\xd0\x1c\x5b\x9a\xb2\x02\x45\x56\x87\x53\x7e\x83\x52\xd2" "\x94", "\x3c\xa2\x62\xd9\x2d\xb8\x40\x4d\x5d\xb0\xe5\x5c\xcc\xdd\xff\x06" "\x5b", "\xd2\x7a\xd6\x86\x6e\xa9\x2b\xa2\x68\x0d\xce\xef", 1, 0, 136 }, - { 96, 128, 96, 341, - "\x74\xb9\x75\x6c\xb2\xac\x63\x61\xce\x9d\x68\x44\x77\xb8\xd0\xc9", + { 96, 128, 96, 341, "\x74\xb9\x75\x6c\xb2\xac\x63\x61\xce\x9d\x68\x44\x77\xb8\xd0\xc9", "\xc2\x60\x6f\xc9\x64\xb6\x13\xa0\xb1\x53\xfc\x0f", "\xdc\xe9\x30\x9c\xf7\x1c\xed\x35\xeb\x22\x0c\x70\x9f\xdd\xc4\x14", "\x66\xf3\x21\x69\x11\x74\x80\x38\xf9\x14\x32\x34\x49\x14\xee\x8a" @@ -2778,16 +2251,14 @@ const struct aead_test aes_ccm_test_json[] = { "\xc8\xae\xe8\x33\x0a\x37\xca\x70\x6f\x47\x6f\x77\x4f\xf3\x57\x00" "\xca", "\xb3\x7e\x7e\x62\xd0\xb1\xae\xab\x26\x78\xbc\xf3", 1, 128, 136 }, - { 96, 128, 96, 342, - "\xe1\xe4\x5f\x35\x00\xa4\x05\xdf\x5a\xbd\xcb\x3b\x86\xbe\xa1\x4d", + { 96, 128, 96, 342, "\xe1\xe4\x5f\x35\x00\xa4\x05\xdf\x5a\xbd\xcb\x3b\x86\xbe\xa1\x4d", "\x59\x28\x9d\xa2\xd5\xf1\x3e\xea\x49\x95\x61\x1f", "", "\x5c\xda\x60\x60\xa7\xe1\x05\xcc\x57\xc7\x75\xa0\x2a\xf9\x21\x75\x73" "\x50\xc9\x69\x2b\xc4\xfa\x40\x4a\xce\x98\xeb\x1e\x61\x71", "\xf2\x67\x01\x4a\xc2\x64\x66\x05\x8b\x80\xd2\x8c\x0d\x82\x52\x1d\x69" "\xb2\x30\x2c\x36\x56\x74\x0c\x23\x78\x31\x85\x9a\x0f\x24", "\x9e\xdc\x28\x31\x74\x36\xd6\x6d\x75\x2a\xd9\xb7", 1, 0, 248 }, - { 96, 128, 96, 343, - "\xbc\xe5\x99\xcb\x75\xa2\x27\x10\x70\xe6\x19\x9c\xb0\x96\x65\x6b", + { 96, 128, 96, 343, "\xbc\xe5\x99\xcb\x75\xa2\x27\x10\x70\xe6\x19\x9c\xb0\x96\x65\x6b", "\xf9\xa8\x33\x3f\x46\x73\x68\x9e\x39\x59\xc9\xe0", "\xf6\x1e\x10\x35\x17\x1c\x92\xb0\x22\xae\x55\x9e\x86\x57\x93\x0e", "\x41\x89\x4a\xcc\x83\x8d\x4a\x8f\x62\xe6\xcc\x92\x71\xf1\xd6\x5d\xf7" @@ -2795,95 +2266,80 @@ const struct aead_test aes_ccm_test_json[] = { "\x0e\xb5\xc0\x3d\x69\x15\x3d\xbe\x79\x4c\x53\xcb\x29\x3b\x25\xd3\x8c" "\xaf\xa1\x36\x72\xc9\x15\x60\x68\xa4\x02\x6d\xb0\xd7\x08", "\xd4\x06\x38\x9c\xe2\x22\x8e\xbb\xbc\x40\x0b\xbf", 1, 128, 248 }, - { 96, 128, 112, 344, - "\xf2\x1f\x07\x00\xf1\x6a\xa0\x98\xd6\x61\x7c\xc3\x68\x30\x12\xc1", + { 96, 128, 112, 344, "\xf2\x1f\x07\x00\xf1\x6a\xa0\x98\xd6\x61\x7c\xc3\x68\x30\x12\xc1", "\x42\x39\x4a\x30\xfc\xd2\x52\x55\x6b\xf2\xcb\x36", "", "", "", "\x39\xd0\x70\x3d\xcf\x7d\x0c\x31\x62\x22\xd7\x16\xaf\xec", 1, 0, 0 }, - { 96, 128, 112, 345, - "\x7d\x28\x27\x73\x9a\xd3\xce\x2d\xc7\xf2\x7e\x35\xf6\xcd\x83\x7f", + { 96, 128, 112, 345, "\x7d\x28\x27\x73\x9a\xd3\xce\x2d\xc7\xf2\x7e\x35\xf6\xcd\x83\x7f", "\x09\xa2\x49\x07\x7d\xb1\xf8\x4e\x98\x4a\x98\x29", - "\xb5\xe5\x9d\x8c\x3f\x81\xda\xe7\x78\x9a\x82\x6a\x0d\x32\x00\xf9", - "", "", "\x45\x55\x3d\x58\x83\x9d\x45\xa3\x77\xbe\x85\xe9\x5a\x41", 1, - 128, 0 }, - { 96, 128, 112, 346, - "\x1e\x70\xde\x0c\xba\x8f\x88\x48\xdb\xc8\xdd\x9c\xfa\x53\xc1\x61", + "\xb5\xe5\x9d\x8c\x3f\x81\xda\xe7\x78\x9a\x82\x6a\x0d\x32\x00\xf9", "", "", + "\x45\x55\x3d\x58\x83\x9d\x45\xa3\x77\xbe\x85\xe9\x5a\x41", 1, 128, 0 }, + { 96, 128, 112, 346, "\x1e\x70\xde\x0c\xba\x8f\x88\x48\xdb\xc8\xdd\x9c\xfa\x53\xc1\x61", "\xd4\xe6\x77\xbd\xb0\x4b\xf9\x35\xd1\x30\xce\x15", "", "\x71\x02\xb7\x71\x0b\x1d\xb1\xa0\x74\x84\x74\xf8\xe3\x7b\x6d\xd8", "\x55\xdf\xe0\xe8\x8c\x81\xbf\xc5\x61\x97\x5d\xfa\xba\xa2\x1a\x12", - "\x02\x4e\x3b\xf1\x98\x5a\x7f\x7e\xcc\xda\xa0\xee\x2a\x18", 1, 0, - 128 }, - { 96, 128, 112, 347, - "\x0b\xb3\x80\xf7\x25\x73\xe6\xd4\x97\x17\x23\x81\xf5\xf4\xeb\x6a", + "\x02\x4e\x3b\xf1\x98\x5a\x7f\x7e\xcc\xda\xa0\xee\x2a\x18", 1, 0, 128 }, + { 96, 128, 112, 347, "\x0b\xb3\x80\xf7\x25\x73\xe6\xd4\x97\x17\x23\x81\xf5\xf4\xeb\x6a", "\xe7\x9f\x20\x84\x0e\x41\x82\xac\x6b\xf0\xf8\x48", "\x44\x9d\xce\xa2\x7c\xd6\x10\x31\xf9\xbf\xaf\x87\xd3\xbc\xf9\xc4", "\x4a\xbf\xe6\x0e\xd6\xbf\x24\x19\x0e\x41\x6e\x68\x09\x71\x8f\xa0", "\x12\xe6\x3d\x6d\x51\xc1\x4a\x2e\xe7\x81\x0a\x24\x0f\xfe\xbc\x13", - "\x5c\xfc\x7d\xf5\xf7\x0a\x81\xf9\x3a\x8f\x47\x14\xe1\x43", 1, 128, - 128 }, - { 96, 128, 112, 348, - "\xc4\x8d\xe4\xc9\x1e\xfd\xf7\xb2\x4c\x8f\x80\x07\x3f\x6f\x17\xd2", + "\x5c\xfc\x7d\xf5\xf7\x0a\x81\xf9\x3a\x8f\x47\x14\xe1\x43", 1, 128, 128 }, + { 96, 128, 112, 348, "\xc4\x8d\xe4\xc9\x1e\xfd\xf7\xb2\x4c\x8f\x80\x07\x3f\x6f\x17\xd2", "\xdd\xa7\x45\x36\x01\xd5\x16\xe0\x87\x32\x0e\xbf", "", "\x01\xbe\x64\x0c\xaf\xc9\xeb\x72\x88\x27\xfc\xf1\xc9\xcb\xa5\xe0" "\xcc", "\x23\x5b\x7e\xdd\x4b\x3d\xf0\x3c\x4a\xd8\xff\x11\x12\xcc\xb3\xd9" "\x28", - "\x7b\x95\xbc\x04\x20\xce\x86\xac\x2f\x2a\x37\x5d\x5f\xe0", 1, 0, - 136 }, - { 96, 128, 112, 349, - "\x21\xf8\x4c\x57\xb6\xd4\xa2\xd2\xd3\x0d\x4c\x37\xec\xf1\x10\x30", + "\x7b\x95\xbc\x04\x20\xce\x86\xac\x2f\x2a\x37\x5d\x5f\xe0", 1, 0, 136 }, + { 96, 128, 112, 349, "\x21\xf8\x4c\x57\xb6\xd4\xa2\xd2\xd3\x0d\x4c\x37\xec\xf1\x10\x30", "\xd3\xce\x63\xa1\xaf\x0b\xef\x6c\x9e\x0b\xbd\x81", "\x0f\x78\xdd\x2b\x4e\x56\x6c\x9d\x15\xd0\x52\xb0\x1f\x6f\x85\xba", "\x33\x58\x54\x3c\x39\xc1\x00\x25\xe0\x1c\xe8\x90\x06\xba\x00\x43" "\x26", "\xcb\xb9\x21\x40\x6c\xe9\xe4\x4c\x19\xb0\x19\xca\x26\x9a\x6b\x7b" "\x13", - "\xf6\xba\x3a\x6a\x43\x3a\x50\xc4\xab\xe0\x0d\xa2\x41\x1f", 1, 128, - 136 }, - { 96, 128, 112, 350, - "\xa0\x8b\xe6\x8d\x04\x4e\x76\xe4\x7d\x04\xd0\x93\xee\x54\x8e\x59", + "\xf6\xba\x3a\x6a\x43\x3a\x50\xc4\xab\xe0\x0d\xa2\x41\x1f", 1, 128, 136 }, + { 96, 128, 112, 350, "\xa0\x8b\xe6\x8d\x04\x4e\x76\xe4\x7d\x04\xd0\x93\xee\x54\x8e\x59", "\xf1\x7b\x6f\x94\xa8\x86\x42\x05\xc7\x57\xa6\x35", "", "\x05\xe4\x54\x20\x55\xfa\x84\xe2\xd3\x49\x83\x7d\xef\x40\x23\x53\xfe" "\xa7\xec\x56\xd3\xfd\x81\xa4\x48\x31\x40\x3f\x1f\x7f\x72", "\x60\x19\x8b\xdf\x8b\x37\x8d\xbe\x55\x32\xdb\x73\x29\xaa\xcc\x58\xba" "\x32\x5b\x82\x79\x65\xd4\x69\xb4\xec\x7d\x06\x98\xb9\xdf", - "\x05\x99\xec\x3c\x8c\x56\xae\x5d\x1e\xe6\xea\xc6\xca\x05", 1, 0, - 248 }, - { 96, 128, 112, 351, - "\xd9\x5f\x7f\x6a\x07\x53\x0e\xe3\xf9\x67\xfd\x1f\xf9\x90\x8a\xfe", + "\x05\x99\xec\x3c\x8c\x56\xae\x5d\x1e\xe6\xea\xc6\xca\x05", 1, 0, 248 }, + { 96, 128, 112, 351, "\xd9\x5f\x7f\x6a\x07\x53\x0e\xe3\xf9\x67\xfd\x1f\xf9\x90\x8a\xfe", "\xba\xbe\x02\x81\xf3\xcb\xa8\x06\x67\xc3\x65\xaf", "\xf4\x9c\x18\xd6\x5a\x19\x7b\x97\x3d\x26\xfd\x29\xa1\x43\x74\x60", "\xe0\x2f\xec\x4c\x11\x8b\xcc\x96\x67\x01\x58\x72\xd8\x96\xc8\x86\x8c" "\x15\x90\xf8\x47\x34\xce\xc6\x5c\xe9\x0b\x3d\xc0\x76\xd3", "\xbc\xd3\x79\xde\x4b\xd6\xea\x47\xf2\x93\xa2\x5c\x41\x1d\x14\xd0\x1f" "\x5d\xe7\x3a\x99\xc5\xe2\xe2\xe5\x93\x0f\xd3\xbb\x3b\x23", - "\x43\xb9\x4d\xf5\x7d\xf5\xf7\x6a\xc5\xa0\x1f\x52\x51\x38", 1, 128, - 248 }, + "\x43\xb9\x4d\xf5\x7d\xf5\xf7\x6a\xc5\xa0\x1f\x52\x51\x38", 1, 128, 248 }, { 96, 192, 32, 352, "\x85\xe0\x17\xfb\xc8\x60\x56\xc8\xc1\x89\x15\xb3\x69\xc0\xc9\x2d\xd3" "\xaf\x3f\xc6\x77\x78\x2f\x8c", - "\x3d\x57\x51\x1e\xaf\xfb\xe4\xe9\xe9\x0d\x6e\xc3", "", "", "", - "\x4f\xc4\x19\x2c", 1, 0, 0 }, + "\x3d\x57\x51\x1e\xaf\xfb\xe4\xe9\xe9\x0d\x6e\xc3", "", "", "", "\x4f\xc4\x19\x2c", 1, 0, + 0 }, { 96, 192, 32, 353, "\x0d\xf9\x7b\xa4\x0e\x5f\x24\xcd\x5f\x1b\xd0\xec\xf4\x74\xac\x9a\x4a" "\x8b\x4c\xf1\x38\x80\x65\x49", "\x70\x5b\xc1\xa6\xcb\x54\xc1\x43\xd4\xfa\x10\x02", - "\xdf\xf5\xca\xd8\xf5\xb6\xcc\x65\xdf\x4e\x4e\x12\x80\x2b\xd0\xe6", - "", "", "\x48\xde\xd0\x1f", 1, 128, 0 }, + "\xdf\xf5\xca\xd8\xf5\xb6\xcc\x65\xdf\x4e\x4e\x12\x80\x2b\xd0\xe6", "", "", + "\x48\xde\xd0\x1f", 1, 128, 0 }, { 96, 192, 32, 354, "\x79\x50\x63\x24\x8c\x61\x9c\x9c\xe6\x1b\x56\xc1\x7d\xb6\xc0\x23\xfa" "\xb1\x2c\xa6\x10\x31\x92\x5c", "\xd3\xaa\x2d\xfb\x01\x9b\x56\x46\x7f\xdb\x36\x8b", "", "\x01\x7e\x69\x0c\x00\x69\xbf\x92\xd6\x9f\x27\x0d\x32\xaf\x15\xef", - "\x3b\xf2\x4b\x2a\xda\x60\x4a\xd0\xad\x9f\xa5\x38\xe3\xb4\xe3\x8a", - "\x84\xd2\xcf\x30", 1, 0, 128 }, + "\x3b\xf2\x4b\x2a\xda\x60\x4a\xd0\xad\x9f\xa5\x38\xe3\xb4\xe3\x8a", "\x84\xd2\xcf\x30", 1, + 0, 128 }, { 96, 192, 32, 355, "\xa7\xac\xdc\x89\xa8\x6a\xda\x31\x90\xda\x95\x4e\x02\x9b\xd3\xd5\x8e" "\x05\xbb\xee\x02\x72\xcc\x94", "\x4a\xca\x59\x38\xa8\x8a\x69\x8e\xc7\x45\xb4\x43", "\x9c\xfc\xfd\x28\x4e\xd3\x5f\xa1\x11\x04\xe5\x28\x56\xfa\x3d\x08", "\x64\x18\x73\x87\xc7\xcf\x3b\x56\x20\x63\xab\x35\x45\xca\x71\xaa", - "\x97\x02\xe5\x11\x9a\x1b\x3a\x09\xe7\xc8\x0e\x65\xe8\x2b\xb8\xc8", - "\x46\x12\xd0\xbf", 1, 128, 128 }, + "\x97\x02\xe5\x11\x9a\x1b\x3a\x09\xe7\xc8\x0e\x65\xe8\x2b\xb8\xc8", "\x46\x12\xd0\xbf", 1, + 128, 128 }, { 96, 192, 32, 356, "\x63\x69\xc4\x28\x16\x2c\xd7\xc8\x61\xaa\xf2\x8c\x4c\x36\xb8\xe5\x38" "\x89\x5e\x46\x9e\x0d\x1f\x48", @@ -2931,8 +2387,8 @@ const struct aead_test aes_ccm_test_json[] = { "\xeb\x47\x0c\x2b\xe6\xb3\x25\x75\xc4\x2c\xf9\x08\x53\xbd\xbe\xd1\xe6" "\x41\x2c\xae\x16\x15\x33\x0f", "\x9e\xd7\x46\x01\x5a\xd7\x2f\x1f\x4a\x86\x88\x37", - "\xe8\x15\x4f\xb5\x03\xcb\xa6\x64\x91\xa7\xa9\xad\x2f\x31\x02\x82", - "", "", "\x8d\x8f\x8d\x39\x46\xb8", 1, 128, 0 }, + "\xe8\x15\x4f\xb5\x03\xcb\xa6\x64\x91\xa7\xa9\xad\x2f\x31\x02\x82", "", "", + "\x8d\x8f\x8d\x39\x46\xb8", 1, 128, 0 }, { 96, 192, 48, 362, "\xb7\x85\x8c\x86\xb3\x55\x19\xe9\xc4\x28\x62\x4c\x41\xf4\xda\x83\x79" "\xd0\xf8\x55\xb3\xdc\xd6\x22", @@ -2995,8 +2451,8 @@ const struct aead_test aes_ccm_test_json[] = { "\x5b\x04\xc3\x42\xef\xd5\xe8\x9a\xa5\xd3\x8e\xf3\x2e\xed\xea\xf2\xac" "\x03\x5f\x43\xb9\xb4\x20\x1d", "\x14\xd4\x78\x1e\x21\x59\x2e\xfc\x44\x09\xb9\x44", - "\x3f\xd3\xb6\x91\xd0\x51\x1d\x71\xf5\xdb\xec\x4f\x13\x20\xfc\x8c", - "", "", "\x2f\x84\xac\x2d\x50\xbe\xf7\x5e", 1, 128, 0 }, + "\x3f\xd3\xb6\x91\xd0\x51\x1d\x71\xf5\xdb\xec\x4f\x13\x20\xfc\x8c", "", "", + "\x2f\x84\xac\x2d\x50\xbe\xf7\x5e", 1, 128, 0 }, { 96, 192, 64, 370, "\x1a\x2f\x92\x13\xe6\x6c\x96\x93\x06\xb9\x8c\xe3\x3d\x32\xca\x91\x26" "\xe7\x65\x78\x35\x5a\x67\xab", @@ -3059,8 +2515,8 @@ const struct aead_test aes_ccm_test_json[] = { "\xc9\xb9\x28\x03\x80\x27\x6a\x99\xc7\xe8\xb0\x0b\x03\xa0\xac\x35\x93" "\x66\xa9\x25\x53\x2c\x4b\x08", "\x3d\x69\x75\x92\xa7\x80\x07\xee\x3f\xc9\xf8\x71", - "\x56\x6f\xce\xd9\xa2\x4e\x20\xae\x05\x5f\x03\x4d\xe8\x9f\x76\x2a", - "", "", "\x7e\x43\xc9\x45\xa8\x82\x6a\x9f\x71\x64", 1, 128, 0 }, + "\x56\x6f\xce\xd9\xa2\x4e\x20\xae\x05\x5f\x03\x4d\xe8\x9f\x76\x2a", "", "", + "\x7e\x43\xc9\x45\xa8\x82\x6a\x9f\x71\x64", 1, 128, 0 }, { 96, 192, 80, 378, "\x19\x90\x4b\xd0\xb5\x44\xa2\x9e\x2c\x0a\x30\x5a\x12\x43\x23\xa1\xde" "\x6f\xae\xb7\x1b\xdd\x0f\x87", @@ -3123,9 +2579,8 @@ const struct aead_test aes_ccm_test_json[] = { "\x0a\x12\x32\x6b\x7e\xfa\xc1\x79\x42\x1f\xdb\xce\xd8\x0d\x52\xf2\x40" "\x7e\x99\x3e\xf5\x04\x77\xf9", "\x34\x47\x21\x31\x54\x78\x40\x26\x3d\x9e\x9f\xd3", - "\x17\xbe\x4b\xb1\xe4\xa4\x0f\xac\x70\x68\x79\x38\x1a\x2d\x6f\x47", - "", "", "\x6f\xb7\x2e\x37\x68\x83\x2a\x7b\xab\x90\x7a\x75", 1, 128, - 0 }, + "\x17\xbe\x4b\xb1\xe4\xa4\x0f\xac\x70\x68\x79\x38\x1a\x2d\x6f\x47", "", "", + "\x6f\xb7\x2e\x37\x68\x83\x2a\x7b\xab\x90\x7a\x75", 1, 128, 0 }, { 96, 192, 96, 386, "\x56\xd5\xf5\xeb\x69\x7d\x96\xfa\x9c\x11\x52\x8b\x19\x1e\xaf\xc4\x15" "\x9c\x2c\xb2\x90\x2f\x06\x95", @@ -3188,17 +2643,15 @@ const struct aead_test aes_ccm_test_json[] = { "\x59\xb4\xb1\x81\x6f\x2a\x9f\xb6\x26\x6a\x39\xaf\x3e\x49\x7e\x2b\x89" "\xb1\xfa\x51\xfc\xb9\x65\xef", "\x99\x05\x97\x9f\x5b\x03\xa5\x0d\x54\x40\xaa\x08", - "\xe8\x2c\xb1\x13\x39\x72\x77\xe2\x20\x05\x2a\xc5\x53\x04\xd7\x93", - "", "", "\x67\xf6\xe8\xc4\x46\x5b\xb6\x47\xc0\x3e\xf4\xfc\x5f\x1d", 1, - 128, 0 }, + "\xe8\x2c\xb1\x13\x39\x72\x77\xe2\x20\x05\x2a\xc5\x53\x04\xd7\x93", "", "", + "\x67\xf6\xe8\xc4\x46\x5b\xb6\x47\xc0\x3e\xf4\xfc\x5f\x1d", 1, 128, 0 }, { 96, 192, 112, 394, "\x2d\xe7\xb9\x83\x7d\x63\xf5\x31\xdb\x27\x05\xc5\xe2\xc8\x00\xaf\xbf" "\x5c\xce\xf7\x3b\x80\xf7\x9d", "\x1a\x0c\xe3\xa2\xe9\x28\x3d\x06\x92\x85\x41\x6c", "", "\xc1\x26\x51\x83\xd4\x09\x5f\xbe\xa0\xbf\xa3\x5b\x27\x81\xd5\x2a", "\x34\x0b\x2f\xd7\xc3\x9b\xba\x1a\x1a\x93\x91\xb6\x01\x0e\xf8\xb4", - "\x99\xb1\x9c\x91\xeb\x23\x12\xff\x5c\x42\xbd\x88\x90\x68", 1, 0, - 128 }, + "\x99\xb1\x9c\x91\xeb\x23\x12\xff\x5c\x42\xbd\x88\x90\x68", 1, 0, 128 }, { 96, 192, 112, 395, "\x7f\xda\x00\x39\x31\xc5\xea\x09\xaf\xa3\xc9\x3b\xca\xa9\xcd\x33\xaf" "\xfa\x55\x06\x1d\xf3\xc4\xda", @@ -3206,8 +2659,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x32\x09\x2c\x8d\xc6\x2f\xf2\x57\x0f\xae\x6e\xcc\xcf\xd9\x2b\xe2", "\xc5\xbd\xa3\xc8\x6f\x31\x16\x0c\x96\x23\x98\x4d\xf8\x85\xf9\x2a", "\x50\x22\x4b\xff\x26\xb6\xb9\x66\x69\x32\x50\x37\xf1\x29\x4a\x2a", - "\xf1\xfe\x37\x1a\x39\x74\xcd\x23\x80\xda\xb2\xc7\xdb\x62", 1, 128, - 128 }, + "\xf1\xfe\x37\x1a\x39\x74\xcd\x23\x80\xda\xb2\xc7\xdb\x62", 1, 128, 128 }, { 96, 192, 112, 396, "\x0b\xb8\x9e\xe6\x66\xcc\x14\x3c\x89\x58\x3c\xe3\x05\x5d\x02\x80\xa3" "\xff\x65\xdd\x5b\x0a\xc9\xa8", @@ -3216,8 +2668,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xaa", "\x93\x18\x5d\xe9\x8b\x9b\x95\xa1\x18\x55\x09\x64\x40\x02\x7f\xf5" "\xd5", - "\x8e\xdf\x2a\x34\x08\x3c\xd4\xfc\x82\xee\x34\x90\x4d\x55", 1, 0, - 136 }, + "\x8e\xdf\x2a\x34\x08\x3c\xd4\xfc\x82\xee\x34\x90\x4d\x55", 1, 0, 136 }, { 96, 192, 112, 397, "\x44\xde\xf0\x2b\x19\xd8\xb7\x4b\x25\x80\x1e\xc2\x52\x73\xb6\x8f\x50" "\xde\xa1\x26\xec\x4a\x36\x66", @@ -3227,8 +2678,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x8d", "\xc5\x4f\xb9\xe5\x55\xfb\xcb\x5e\x1e\x70\xaa\xaa\xef\xbc\x12\x25" "\x00", - "\x1b\x59\x84\x53\x8b\xea\xfa\x71\x14\x2f\x0c\x0e\xc4\x2a", 1, 128, - 136 }, + "\x1b\x59\x84\x53\x8b\xea\xfa\x71\x14\x2f\x0c\x0e\xc4\x2a", 1, 128, 136 }, { 96, 192, 112, 398, "\xa2\x9a\x0c\x3f\x1e\x2e\x3e\xe8\x8d\xfd\x3f\x01\x9b\x42\x5a\x5f\x64" "\x75\x26\xd3\xf3\x68\xa1\xbe", @@ -3237,8 +2687,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x2c\x0d\xf2\xfd\xab\xa4\x3e\x4e\x45\x81\x43\x9b\xdf\xdb", "\xb0\x80\x13\x0f\x95\xe4\x6d\x79\xed\x5f\x67\xf0\xdc\x88\xa2\x3c\x34" "\xdc\xf7\x4f\x6e\x61\xb6\x56\x21\xb6\xef\x53\x75\x82\x79", - "\x67\x85\x6e\x34\x44\x53\xca\xb3\x35\xa8\xf0\x7b\x1f\x63", 1, 0, - 248 }, + "\x67\x85\x6e\x34\x44\x53\xca\xb3\x35\xa8\xf0\x7b\x1f\x63", 1, 0, 248 }, { 96, 192, 112, 399, "\x90\x95\x4f\xb2\x2a\xa8\x48\x60\xdd\x7c\x3f\xad\xb3\x19\xdd\x1d\x16" "\x85\x77\x23\xbd\x1b\xad\xb1", @@ -3248,34 +2697,33 @@ const struct aead_test aes_ccm_test_json[] = { "\xa4\x4a\x5a\x6f\xb7\xfa\x82\x44\x17\x18\x5d\x4a\x55\xce", "\x87\xb7\x53\xfa\x7c\xe3\xe7\xd1\x62\x92\x59\x46\xe8\x57\x19\x93\x3a" "\x0d\xd1\x0e\xaf\x72\xb5\x25\x9c\xba\xce\x8c\x41\xc5\x3b", - "\x2b\x55\x64\x55\xa6\x57\xee\x61\x71\xf4\xed\xe6\x43\xb5", 1, 128, - 248 }, + "\x2b\x55\x64\x55\xa6\x57\xee\x61\x71\xf4\xed\xe6\x43\xb5", 1, 128, 248 }, { 96, 256, 32, 400, "\x99\x48\xed\xf5\xcf\xb2\xf5\x33\x63\xed\x83\xbf\xb1\x5e\x7c\xb5\x02" "\xf0\x62\x8d\xc9\xf2\xb8\x72\x23\xf2\x23\x34\xc4\x0b\x89\x23", - "\x44\xe1\x54\xe9\xb3\xf7\xfd\x47\xa9\x7f\xc7\xbe", "", "", "", - "\x92\xa5\x99\x22", 1, 0, 0 }, + "\x44\xe1\x54\xe9\xb3\xf7\xfd\x47\xa9\x7f\xc7\xbe", "", "", "", "\x92\xa5\x99\x22", 1, 0, + 0 }, { 96, 256, 32, 401, "\x93\xb7\x5a\xc1\x29\xec\x19\x5f\x8c\x18\x0e\x9b\x91\xdf\xed\xaa\xe2" "\xb2\xfa\xcd\xc1\x55\x93\xb3\xe4\x25\x8c\x78\xd2\xff\x94\xd7", "\xdb\x53\x5f\xe7\x23\xba\x65\x0b\x66\xd2\x30\xfb", - "\x7b\x3d\xd4\x20\x60\x71\x39\xc1\x9c\x6d\xb7\xa4\xef\xe0\x9a\x0b", - "", "", "\x50\xe4\x2c\x1f", 1, 128, 0 }, + "\x7b\x3d\xd4\x20\x60\x71\x39\xc1\x9c\x6d\xb7\xa4\xef\xe0\x9a\x0b", "", "", + "\x50\xe4\x2c\x1f", 1, 128, 0 }, { 96, 256, 32, 402, "\xc7\x67\x91\x45\xa1\x5e\x53\xdb\x5c\xd6\x16\x61\x43\xa9\xfe\xfe\x67" "\x46\x71\x5f\x5d\x84\xd9\xdf\xa6\x04\xf1\xd3\xdc\x33\x7e\x6c", "\x6a\xc0\xd6\xaa\x44\x6e\x86\xff\x32\xf8\xfc\x76", "", "\x83\xb0\x83\x05\x52\x6f\xbc\xbc\xde\xeb\xb3\xd7\xa8\xac\x44\xf5", - "\xdc\xb5\x25\x05\x59\xa0\x3c\x8e\x70\xe5\xc0\x10\x71\x21\xcf\x58", - "\x00\x81\xc1\xfd", 1, 0, 128 }, + "\xdc\xb5\x25\x05\x59\xa0\x3c\x8e\x70\xe5\xc0\x10\x71\x21\xcf\x58", "\x00\x81\xc1\xfd", 1, + 0, 128 }, { 96, 256, 32, 403, "\xbc\x5c\xaa\x30\x6c\x42\x3e\x6f\x85\x0c\xd5\x64\x4b\x09\xdd\x4b\xa7" "\x76\xb3\x01\x71\xc7\x2e\x00\x50\xe5\xa6\x0a\xfe\x9c\xb7\x7c", "\xf9\x56\xd4\x14\x22\xd8\xeb\x63\x23\x1b\x38\x26", "\xfa\x6e\x34\x46\x33\x18\x23\x7e\x98\x5d\xd2\xf7\x2b\x0d\xd0\x14", "\x46\xc9\xda\x60\x2a\x54\xfe\x80\x37\xcf\x0b\xee\x72\xaf\xfc\x72", - "\xdb\xb6\xb4\xec\x70\xf9\x32\x4f\x4b\xc2\x2b\x59\x24\x09\xd4\xac", - "\x80\x3a\x69\x48", 1, 128, 128 }, + "\xdb\xb6\xb4\xec\x70\xf9\x32\x4f\x4b\xc2\x2b\x59\x24\x09\xd4\xac", "\x80\x3a\x69\x48", 1, + 128, 128 }, { 96, 256, 32, 404, "\xa9\x59\xc6\x10\xa8\xef\x46\x8b\xb8\xe8\x66\xa0\x9b\x26\x27\xa6\xc3" "\x9e\xe2\xed\x51\x0d\x22\xe8\x72\xaf\xa6\x3e\xba\xb7\xcf\xb0", @@ -3323,8 +2771,8 @@ const struct aead_test aes_ccm_test_json[] = { "\xed\xdc\xcd\x5e\xda\x6e\xaf\x42\x1b\xbf\x87\xd9\x19\x54\x9c\x1f\x3a" "\xc2\x04\x5c\x0a\xc2\xbc\xc2\xef\xa5\x0e\xc8\x40\x50\xb3\x6e", "\x30\xf3\xdb\x31\x2e\x76\xd2\x93\x45\xed\xde\x59", - "\x07\x8e\x76\xef\x2d\xee\xbd\xd8\xf2\xd5\x49\x08\x9f\x4a\x93\xe3", - "", "", "\x0d\xf6\xd2\xdc\x83\xdf", 1, 128, 0 }, + "\x07\x8e\x76\xef\x2d\xee\xbd\xd8\xf2\xd5\x49\x08\x9f\x4a\x93\xe3", "", "", + "\x0d\xf6\xd2\xdc\x83\xdf", 1, 128, 0 }, { 96, 256, 48, 410, "\x1c\x9b\x20\xe6\x4a\xd7\x83\xbf\x04\xf8\x01\xbe\x53\x2f\x6b\x08\x8e" "\x00\x4d\x3a\xa2\xd7\x2d\x77\xf3\x9e\xc8\xfe\x9d\xdc\x51\x89", @@ -3387,8 +2835,8 @@ const struct aead_test aes_ccm_test_json[] = { "\x88\x21\x07\xab\x29\x05\x3d\x4b\x44\xc8\x7b\x5b\xb9\x49\x37\x21\x1c" "\x20\x52\x8d\xa9\xac\x49\x0f\x6c\x57\x4c\xae\xcd\xcd\x2f\x17", "\xe6\xa1\x35\x37\xbb\x7f\x2a\xf7\x49\xb3\x18\x23", - "\xe9\xee\x32\xe6\xf1\x97\xe4\x02\x04\x68\x2d\xac\x42\xdd\x4c\x75", - "", "", "\x57\x73\xc7\x25\xf2\xf9\x46\x17", 1, 128, 0 }, + "\xe9\xee\x32\xe6\xf1\x97\xe4\x02\x04\x68\x2d\xac\x42\xdd\x4c\x75", "", "", + "\x57\x73\xc7\x25\xf2\xf9\x46\x17", 1, 128, 0 }, { 96, 256, 64, 418, "\xb9\x67\x09\x1c\x98\xbb\x64\x92\x24\x30\x83\x3d\x1b\x55\x33\x26\xb8" "\xe9\x1b\x6e\xf7\x14\x19\x71\xcc\x8e\x8c\xc5\xf6\xef\x61\x70", @@ -3451,8 +2899,8 @@ const struct aead_test aes_ccm_test_json[] = { "\xaa\x8a\x48\xf8\xb6\xd1\x86\x34\xec\x96\x33\x8e\x82\x0f\x7e\xb9\xf0" "\xfe\xa8\x86\x4b\xb9\x27\xa5\x7c\x65\xf8\x34\x49\x90\x19\x9b", "\xa0\xf7\x30\x46\x48\xf9\x7a\x30\x34\x91\x6d\x35", - "\xf4\xab\xe3\x08\x15\xce\x6a\xe9\xcf\x2f\x4e\xaa\x8b\xd0\x04\xcb", - "", "", "\xf7\x60\x5f\x52\x01\x93\x6d\xa1\x6d\x39", 1, 128, 0 }, + "\xf4\xab\xe3\x08\x15\xce\x6a\xe9\xcf\x2f\x4e\xaa\x8b\xd0\x04\xcb", "", "", + "\xf7\x60\x5f\x52\x01\x93\x6d\xa1\x6d\x39", 1, 128, 0 }, { 96, 256, 80, 426, "\x8a\xb5\x05\x16\xb0\x53\xa3\xed\x51\xb9\xf8\x4f\x76\xdb\xf9\x30\xbd" "\xe2\xb5\x5a\xa4\x99\xa0\x16\x19\x43\x50\x46\x1f\xf0\xc7\x08", @@ -3515,9 +2963,8 @@ const struct aead_test aes_ccm_test_json[] = { "\x8e\x4c\x13\xc9\x82\xa0\x6f\x3a\x98\x29\x59\xeb\x7c\x2e\x9f\x0e\x41" "\xa8\xe0\x54\x36\x0e\x5b\x93\x11\x1b\xc6\xd9\x39\x70\xee\x8d", "\x8c\x08\x1e\xb6\x0f\xa0\x90\x35\x95\x71\x3a\x73", - "\x24\xf1\xed\x7c\xad\x53\x54\x68\x02\xe2\xe5\xf5\xed\x51\x62\x47", - "", "", "\x97\xfe\xd4\x10\xc9\xfd\xb0\x6b\xcd\xb3\x85\x85", 1, 128, - 0 }, + "\x24\xf1\xed\x7c\xad\x53\x54\x68\x02\xe2\xe5\xf5\xed\x51\x62\x47", "", "", + "\x97\xfe\xd4\x10\xc9\xfd\xb0\x6b\xcd\xb3\x85\x85", 1, 128, 0 }, { 96, 256, 96, 434, "\x62\x7f\xfd\x55\x17\x6d\x65\x55\xda\x82\xb4\xeb\x87\xe6\x51\x90\x44" "\xb8\x81\x33\x4c\x95\x78\x9d\x67\x07\x29\xaf\x05\x84\x12\x8b", @@ -3580,17 +3027,15 @@ const struct aead_test aes_ccm_test_json[] = { "\x84\x95\x29\x8b\x9c\x20\x8e\x6c\x5b\x23\x4e\x85\x6e\xec\xff\x6a\x11" "\x4c\xd8\xb3\xae\xee\xb7\x45\xa1\x60\xff\xa3\x30\x5c\xf5\xef", "\xcc\xe0\x26\x35\xc3\x77\x1f\xb5\xb6\x73\xf8\x8c", - "\xcc\x9a\xf3\xcc\xa9\xf3\xc2\xc1\x21\x1b\x23\x58\x1e\xc5\xfd\xd1", - "", "", "\x0d\x34\x89\x6c\x64\xb6\x78\x7d\xa0\xac\x7c\x03\xfa\x93", 1, - 128, 0 }, + "\xcc\x9a\xf3\xcc\xa9\xf3\xc2\xc1\x21\x1b\x23\x58\x1e\xc5\xfd\xd1", "", "", + "\x0d\x34\x89\x6c\x64\xb6\x78\x7d\xa0\xac\x7c\x03\xfa\x93", 1, 128, 0 }, { 96, 256, 112, 442, "\x4f\x49\x65\x5c\x76\xa6\x29\xe5\x8c\xfb\x94\xc8\x51\xa9\x15\x10\xc2" "\xf1\x28\xdc\x4b\xce\x1f\x1f\x11\xc3\xdc\x99\x43\x6d\x26\x8c", "\x96\x7f\xde\x29\x67\x1d\x46\x54\xf9\xf6\x70\xc0", "", "\xb4\xd1\x2c\x3e\xdf\x38\x02\xe2\x1f\x62\x4b\x71\x8b\x63\xfd\x6c", "\x3b\xa4\xe2\xa4\x50\x7c\x0b\x6f\x5a\xe1\xbe\x29\xc3\x0b\x25\xe9", - "\x8c\xef\xa2\x49\x54\x73\xee\xe1\xb2\x2c\x3f\xa6\xef\x12", 1, 0, - 128 }, + "\x8c\xef\xa2\x49\x54\x73\xee\xe1\xb2\x2c\x3f\xa6\xef\x12", 1, 0, 128 }, { 96, 256, 112, 443, "\x4d\xac\x9a\x0c\xbf\xc3\xdd\x29\x1d\x40\x6e\x68\x38\x89\xfc\x10\xe2" "\xa0\xdd\x25\xd4\xd0\xb4\x3b\x11\x11\x1a\xa8\x28\x27\x39\xe9", @@ -3598,8 +3043,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x5d\xb8\xe0\x96\x97\xd1\xff\x79\xa8\x86\x39\x5e\x40\xfb\x1a\x1d", "\x5d\x2c\x63\x29\x60\xf8\x23\xcf\x72\x42\xbf\x61\xf9\x39\x13\x17", "\xfd\x80\xa3\x82\x7d\xb1\x72\x42\xb2\xdf\x0c\xd8\xca\x96\xd9\x97", - "\xdf\xb5\x8a\x6b\xe4\xe7\xe0\x01\x0f\x7c\x74\x04\xb4\x67", 1, 128, - 128 }, + "\xdf\xb5\x8a\x6b\xe4\xe7\xe0\x01\x0f\x7c\x74\x04\xb4\x67", 1, 128, 128 }, { 96, 256, 112, 444, "\x37\x76\xa8\x4b\x86\x9e\xc4\xa7\x1e\xd8\x4a\x74\xe6\xa9\x8c\x42\xc0" "\xff\xa2\x3f\x6e\xb2\xe2\x97\x0f\x13\x11\x21\xc5\xba\x69\xfe", @@ -3608,8 +3052,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xba", "\xdc\xd6\x2b\xdc\x23\xee\x8b\xdb\x7a\xfd\xec\xd4\x49\xcd\xb4\x99" "\x4a", - "\x9a\xa0\xf8\xf0\x32\xbe\x13\x42\xad\x5d\x40\x99\xc3\xae", 1, 0, - 136 }, + "\x9a\xa0\xf8\xf0\x32\xbe\x13\x42\xad\x5d\x40\x99\xc3\xae", 1, 0, 136 }, { 96, 256, 112, 445, "\x01\xfc\xbc\x4a\x3b\x2e\xe3\x21\x09\xcd\x0f\x27\xd8\x29\xe2\x0d\x1d" "\x92\x03\xd6\xff\x81\x2e\xd9\x84\x1e\xf9\x08\x90\x4d\x74\xa8", @@ -3619,8 +3062,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x28", "\xe1\x44\x0c\x49\x55\x62\xf6\xc8\x56\x28\x81\x83\x23\x4e\x0a\xd2" "\x2e", - "\xd9\x3e\x1c\x12\xbc\xc7\x66\x60\x12\x7d\xfd\x8c\x28\xa0", 1, 128, - 136 }, + "\xd9\x3e\x1c\x12\xbc\xc7\x66\x60\x12\x7d\xfd\x8c\x28\xa0", 1, 128, 136 }, { 96, 256, 112, 446, "\xa0\x17\x45\xf5\x2f\x1f\x35\x64\xda\x0a\xdf\x84\x5f\xdb\xd4\x7a\x5b" "\xd1\x86\x50\x92\x57\x95\x58\xf6\x7f\x67\xba\x07\xf2\x38\xa0", @@ -3629,8 +3071,7 @@ const struct aead_test aes_ccm_test_json[] = { "\xd3\x78\x6a\x84\xcc\x7c\xc0\x07\x06\x61\xa8\x1c\x1f\xbd", "\xcb\x07\xfc\x59\x62\xf7\xd3\x26\x86\x06\xf1\xd2\x24\xfd\x92\xb3\xc2" "\x30\x26\x20\xf0\x33\x20\x78\x4a\x71\x18\x0d\x72\x65\x01", - "\x7f\x64\xeb\xeb\x84\xbc\xad\x46\x34\x7f\xf1\xf2\x74\x47", 1, 0, - 248 }, + "\x7f\x64\xeb\xeb\x84\xbc\xad\x46\x34\x7f\xf1\xf2\x74\x47", 1, 0, 248 }, { 96, 256, 112, 447, "\x24\x0e\xf4\xec\x0a\x7b\x24\x01\x7c\x13\xe4\x61\x22\x7d\x11\xf6\x08" "\xc4\x16\x98\x45\x7e\x94\x8f\x65\x7d\x82\xa1\x9d\x97\x05\x44", @@ -3640,85 +3081,65 @@ const struct aead_test aes_ccm_test_json[] = { "\xc7\x15\x6a\x41\x88\x1b\x39\xd1\x3d\xae\xc1\xf9\xb0\xb1", "\xe9\x4e\x44\xb5\xe7\xbb\x26\xb2\x49\xb4\x8c\xaa\xf2\xa9\xab\x5a\x75" "\x06\xff\x39\x66\x8f\xfe\xa6\xf6\x2b\xb0\x30\xfe\x5c\x87", - "\x1a\x85\x9a\xa8\x06\x26\x04\x72\xa5\x39\x79\xcc\x4e\xaa", 1, 128, - 248 }, - { 0, 128, 96, 448, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "\x1a\x85\x9a\xa8\x06\x26\x04\x72\xa5\x39\x79\xcc\x4e\xaa", 1, 128, 248 }, + { 0, 128, 96, 448, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xbe\x17\x22\xa5\x81\x71\x95\xc5\x03\x81\x4b\xe1\xbd\x09\x31\x10", "\x6f\x79\xa8\xcf\x92\xc8\x56\xb8\xf1\x6d\xee\x92", 0, 0, 128 }, - { 8, 128, 96, 449, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x40", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + { 8, 128, 96, 449, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x40", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x21\x03\x89\x22\x69\x58\xde\xf4\xb4\x4f\x1e\x16\x86\x32\x11\x3c", "\xd4\xe9\x7a\x10\x08\x00\xa5\xc1\x6b\xea\x4f\xdf", 0, 0, 128 }, - { 16, 128, 96, 450, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x40\x41", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + { 16, 128, 96, 450, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x40\x41", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x95\xbf\x20\x8e\x86\x73\xb9\xf9\xa3\x8f\x96\x09\xb5\xe7\x8f\x2a", "\xdf\x81\x41\x91\x69\x6c\xf3\x12\x9f\xb4\x0d\xc0", 0, 0, 128 }, - { 32, 128, 96, 451, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 32, 128, 96, 451, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x40\x41\x42\x43", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xa7\xda\xb4\xbf\xcf\x3e\x2a\xfa\x4b\x31\x9c\xfd\xc1\x7f\x15\xf1", "\xc4\xe8\xb1\xfa\x0d\x79\x17\x77\x41\x7c\xe5\x2c", 0, 0, 128 }, - { 48, 128, 96, 452, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 48, 128, 96, 452, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x40\x41\x42\x43\x44\x45", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xa8\x9a\x23\xf4\xf3\x2b\xa0\x09\xc3\xaa\x8f\xa0\x19\x1f\x84\xc5", "\x65\x96\x21\xc2\xad\x5b\xc6\x1d\xe2\xce\x80\x46", 0, 0, 128 }, - { 112, 128, 96, 453, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 112, 128, 96, 453, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xf9\xd0\x07\x8b\xcd\x56\x8b\xf9\x79\x24\xe6\xd7\x1f\x40\x60\x87", "\x09\x5c\x0d\xa2\xea\x6d\xda\x5a\x87\x12\x1c\x2a", 0, 0, 128 }, - { 120, 128, 96, 454, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 120, 128, 96, 454, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x67\x0c\xd0\x68\xe6\x5b\x08\xfc\xef\xb9\xc0\xaf\xa7\xbb\x5c\x33", "\xda\xa0\x28\x10\xe9\x97\xe7\x97\xdd\xa9\x75\x5d", 0, 0, 128 }, - { 128, 128, 96, 455, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "", + { 128, 128, 96, 455, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x5e\xdb\xeb\xec\x6c\x53\x3d\xac\x8c\xa8\x9f\xaf\x60\xd8\xc1\x37", "\x94\x53\xd6\xa8\xff\x91\xb7\x14\xf3\x2c\x0b\x71", 0, 0, 128 }, - { 160, 128, 96, 456, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 160, 128, 96, 456, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x5e\xdb\xeb\xec\x6c\x53\x3d\xac\x8c\xa8\x9f\xaf\x60\xd8\xc1\x37", "\x94\x53\xd6\xa8\xff\x91\xb7\x14\xf3\x2c\x0b\x71", 0, 0, 128 }, - { 256, 128, 96, 457, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 256, 128, 96, 457, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x5e\xdb\xeb\xec\x6c\x53\x3d\xac\x8c\xa8\x9f\xaf\x60\xd8\xc1\x37", "\x94\x53\xd6\xa8\xff\x91\xb7\x14\xf3\x2c\x0b\x71", 0, 0, 128 }, - { 512, 128, 96, 458, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 512, 128, 96, 458, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" "\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xc3\x2a\x76\x43\xab\x0f\x6e\xa3\x45\x8d\x7e\x63\xb0\xed\x64\x99", "\x8f\xc9\xb6\xf4\x0b\x3a\x81\xfd\x5f\xd6\xc5\x3c", 0, 0, 128 }, - { 1024, 128, 96, 459, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 1024, 128, 96, 459, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" @@ -3727,12 +3148,10 @@ const struct aead_test aes_ccm_test_json[] = { "\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65" "\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76" "\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xc3\x2a\x76\x43\xab\x0f\x6e\xa3\x45\x8d\x7e\x63\xb0\xed\x64\x99", "\x8f\xc9\xb6\xf4\x0b\x3a\x81\xfd\x5f\xd6\xc5\x3c", 0, 0, 128 }, - { 2144, 128, 96, 460, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 2144, 128, 96, 460, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" @@ -3749,29 +3168,25 @@ const struct aead_test aes_ccm_test_json[] = { "\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed" "\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe" "\xff\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xc3\x2a\x76\x43\xab\x0f\x6e\xa3\x45\x8d\x7e\x63\xb0\xed\x64\x99", "\x8f\xc9\xb6\xf4\x0b\x3a\x81\xfd\x5f\xd6\xc5\x3c", 0, 0, 128 }, { 0, 192, 96, 461, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x15\x69\x9c\x20\x19\x86\x88\xb9\xe4\x88\x2a\x65\x42\x81\x1a\xda", "\xc6\x93\x17\xb9\x9b\x43\x08\x6b\x62\x1e\xb1\x4a", 0, 0, 128 }, { 8, 192, 96, 462, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "\x40", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "\x40", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x7e\x84\xb5\xaa\x41\xd2\x21\x2b\x3a\x5d\x73\x0d\xf5\xb2\x0e\xaa", "\x59\x24\xd8\xbd\x85\x31\x8b\x03\x3b\xf4\xf2\xfd", 0, 0, 128 }, { 16, 192, 96, 463, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "\x40\x41", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "\x40\x41", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x81\x33\x67\xe3\xd1\xfa\x4e\xe4\xc4\x02\x45\x0f\x29\x46\xd1", "\xcf\x6e\xee\x49\x5f\x94\xc0\x8f\xef\x7c\xe5\xb5", 0, 0, 128 }, { 32, 192, 96, 464, @@ -3805,8 +3220,7 @@ const struct aead_test aes_ccm_test_json[] = { { 128, 192, 96, 468, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "", + "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x17\xef\x53\xd9\x25\xbb\xa4\xe1\xf3\x35\xd0\x01\x86\xb7\xc3\x8e", "\x8f\x64\x77\xda\x94\xef\x6f\x63\xc4\xd1\xa0\x71", 0, 0, 128 }, @@ -3815,8 +3229,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x17\xef\x53\xd9\x25\xbb\xa4\xe1\xf3\x35\xd0\x01\x86\xb7\xc3\x8e", "\x8f\x64\x77\xda\x94\xef\x6f\x63\xc4\xd1\xa0\x71", 0, 0, 128 }, { 256, 192, 96, 470, @@ -3824,8 +3237,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x17\xef\x53\xd9\x25\xbb\xa4\xe1\xf3\x35\xd0\x01\x86\xb7\xc3\x8e", "\x8f\x64\x77\xda\x94\xef\x6f\x63\xc4\xd1\xa0\x71", 0, 0, 128 }, { 512, 192, 96, 471, @@ -3835,8 +3247,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" "\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x81\xa8\xa0\x87\xcf\x96\xd5\x8f\x64\x86\x8b\x18\x9e\xdd\x0b\xb4", "\xc5\xcc\x4f\x2b\x5a\x46\x0c\x1d\x22\x9a\x6b\xa8", 0, 0, 128 }, { 1024, 192, 96, 472, @@ -3850,8 +3261,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65" "\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76" "\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x81\xa8\xa0\x87\xcf\x96\xd5\x8f\x64\x86\x8b\x18\x9e\xdd\x0b\xb4", "\xc5\xcc\x4f\x2b\x5a\x46\x0c\x1d\x22\x9a\x6b\xa8", 0, 0, 128 }, { 2144, 192, 96, 473, @@ -3873,29 +3283,25 @@ const struct aead_test aes_ccm_test_json[] = { "\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed" "\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe" "\xff\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x81\xa8\xa0\x87\xcf\x96\xd5\x8f\x64\x86\x8b\x18\x9e\xdd\x0b\xb4", "\xc5\xcc\x4f\x2b\x5a\x46\x0c\x1d\x22\x9a\x6b\xa8", 0, 0, 128 }, { 0, 256, 96, 474, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3c\xd9\xba\xce\x5f\x5d\xc7\x7c\x89\xc2\xbc\x13\x90\x65\xe7\x97", "\x99\xf6\x05\x8e\xeb\x8e\x3a\x80\x36\xaa\xda\xb8", 0, 0, 128 }, { 8, 256, 96, 475, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x40", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "\x40", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb5\xf0\x44\x21\x1e\x18\xb1\x35\x72\xe2\xea\x70\xed\x17\x83\x53", "\x24\xcf\x3f\x3f\x36\x9b\x69\x2f\xe7\x30\x97\x0c", 0, 0, 128 }, { 16, 256, 96, 476, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x40\x41", "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "\x40\x41", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xc0\x00\x74\x6e\xd8\x24\x6d\x20\xed\xda\x90\xc0\x4f\x38\x0b\xa8", "\xaf\x82\x09\x34\x87\xd3\xa5\xd4\x87\x2f\xf9\xe2", 0, 0, 128 }, { 32, 256, 96, 477, @@ -3929,8 +3335,7 @@ const struct aead_test aes_ccm_test_json[] = { { 128, 256, 96, 481, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "", + "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x68\x18\x41\xa0\xa0\x13\x92\x39\x07\xc6\x69\xef\xd3\xff\xd0\x69", "\x05\x4c\xd6\xf1\xcd\xa1\xb1\xbf\x91\xe0\x10\x0f", 0, 0, 128 }, @@ -3939,8 +3344,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x68\x18\x41\xa0\xa0\x13\x92\x39\x07\xc6\x69\xef\xd3\xff\xd0\x69", "\x05\x4c\xd6\xf1\xcd\xa1\xb1\xbf\x91\xe0\x10\x0f", 0, 0, 128 }, { 256, 256, 96, 483, @@ -3948,8 +3352,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x68\x18\x41\xa0\xa0\x13\x92\x39\x07\xc6\x69\xef\xd3\xff\xd0\x69", "\x05\x4c\xd6\xf1\xcd\xa1\xb1\xbf\x91\xe0\x10\x0f", 0, 0, 128 }, { 512, 256, 96, 484, @@ -3959,8 +3362,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21" "\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32" "\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xe7\x3c\xc2\xee\x05\x0a\x0e\x7b\x34\x5a\xeb\x10\x00\xc4\x81\xc3", "\x18\x2d\xab\xaf\xf0\x40\x0d\xe7\x08\x74\x6b\x6a", 0, 0, 128 }, { 1024, 256, 96, 485, @@ -3974,8 +3376,7 @@ const struct aead_test aes_ccm_test_json[] = { "\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65" "\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76" "\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xe7\x3c\xc2\xee\x05\x0a\x0e\x7b\x34\x5a\xeb\x10\x00\xc4\x81\xc3", "\x18\x2d\xab\xaf\xf0\x40\x0d\xe7\x08\x74\x6b\x6a", 0, 0, 128 }, { 2144, 256, 96, 486, @@ -3997,73 +3398,63 @@ const struct aead_test aes_ccm_test_json[] = { "\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed" "\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe" "\xff\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", - "", - "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xe7\x3c\xc2\xee\x05\x0a\x0e\x7b\x34\x5a\xeb\x10\x00\xc4\x81\xc3", "\x18\x2d\xab\xaf\xf0\x40\x0d\xe7\x08\x74\x6b\x6a", 0, 0, 128 }, - { 96, 128, 16, 487, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 96, 128, 16, 487, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", - "\x19\x8c", 0, 0, 128 }, - { 96, 128, 24, 488, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", "\x19\x8c", 0, 0, + 128 }, + { 96, 128, 24, 488, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", - "\x19\x8c\x08", 0, 0, 128 }, - { 96, 128, 40, 489, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", "\x19\x8c\x08", 0, 0, + 128 }, + { 96, 128, 40, 489, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", "\x23\x1a\x2d\x8f\x6a", 0, 0, 128 }, - { 96, 128, 56, 490, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 96, 128, 56, 490, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", "\xb1\xbb\xf3\x88\x35\x07\xcd", 0, 0, 128 }, - { 96, 128, 72, 491, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 96, 128, 72, 491, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", "\xcd\x0a\xe6\x3f\x3a\x30\xf7\xfb\x5b", 0, 0, 128 }, - { 96, 128, 88, 492, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 96, 128, 88, 492, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", "\x53\x5e\x32\xac\x41\x68\x16\x61\x5e\x5a\x20", 0, 0, 128 }, - { 96, 128, 104, 493, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 96, 128, 104, 493, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", "\xa6\xc5\x84\x58\xd3\x96\x9d\xa9\xcb\x08\x49\xf9\x5e", 0, 0, 128 }, - { 96, 128, 120, 494, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + { 96, 128, 120, 494, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xd3\xda\xb1\xee\x49\x4c\xc2\x29\x09\x9d\x6c\xac\x7d\xf1\x4a\xdd", - "\xf7\x87\x9f\xb7\xfe\x88\xdd\x74\xcb\x8e\x96\xfd\xa1\xd2\xeb", 0, 0, - 128 }, + "\xf7\x87\x9f\xb7\xfe\x88\xdd\x74\xcb\x8e\x96\xfd\xa1\xd2\xeb", 0, 0, 128 }, { 96, 192, 16, 495, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "\x1c\x49\x32\x45\x15\xa3\x46\xd4\x24\xee\xd6\xfe\xd9\xbd\xdc\x17", - "\x95\xeb", 0, 0, 128 }, + "\x1c\x49\x32\x45\x15\xa3\x46\xd4\x24\xee\xd6\xfe\xd9\xbd\xdc\x17", "\x95\xeb", 0, 0, + 128 }, { 96, 192, 24, 496, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "\x1c\x49\x32\x45\x15\xa3\x46\xd4\x24\xee\xd6\xfe\xd9\xbd\xdc\x17", - "\x95\xeb\x98", 0, 0, 128 }, + "\x1c\x49\x32\x45\x15\xa3\x46\xd4\x24\xee\xd6\xfe\xd9\xbd\xdc\x17", "\x95\xeb\x98", 0, 0, + 128 }, { 96, 192, 40, 497, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", @@ -4105,22 +3496,21 @@ const struct aead_test aes_ccm_test_json[] = { "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x1c\x49\x32\x45\x15\xa3\x46\xd4\x24\xee\xd6\xfe\xd9\xbd\xdc\x17", - "\xf8\xf9\xbd\xc6\xb8\x50\x6a\xfd\x3a\xe5\x4a\x0a\x67\xe1\x85", 0, 0, - 128 }, + "\xf8\xf9\xbd\xc6\xb8\x50\x6a\xfd\x3a\xe5\x4a\x0a\x67\xe1\x85", 0, 0, 128 }, { 96, 256, 16, 503, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "\x3b\x68\x29\xd5\xde\xb4\x7c\xa9\xf1\x0a\xbf\x48\x15\x64\xae\xe1", - "\x8f\x8b", 0, 0, 128 }, + "\x3b\x68\x29\xd5\xde\xb4\x7c\xa9\xf1\x0a\xbf\x48\x15\x64\xae\xe1", "\x8f\x8b", 0, 0, + 128 }, { 96, 256, 24, 504, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", - "\x3b\x68\x29\xd5\xde\xb4\x7c\xa9\xf1\x0a\xbf\x48\x15\x64\xae\xe1", - "\x8f\x8b\x32", 0, 0, 128 }, + "\x3b\x68\x29\xd5\xde\xb4\x7c\xa9\xf1\x0a\xbf\x48\x15\x64\xae\xe1", "\x8f\x8b\x32", 0, 0, + 128 }, { 96, 256, 40, 505, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -4162,7 +3552,6 @@ const struct aead_test aes_ccm_test_json[] = { "\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x3b\x68\x29\xd5\xde\xb4\x7c\xa9\xf1\x0a\xbf\x48\x15\x64\xae\xe1", - "\xf2\xf6\xd8\xb6\xab\x69\xc8\xe1\x00\x39\xb5\x75\x4f\x55\x37", 0, 0, - 128 }, + "\xf2\xf6\xd8\xb6\xab\x69\xc8\xe1\x00\x39\xb5\x75\x4f\x55\x37", 0, 0, 128 }, { 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; diff --git a/test/wycheproof-app/aes_cmac_test.json.c b/test/wycheproof-app/aes_cmac_test.json.c index 5e13976f..d341b8ca 100644 --- a/test/wycheproof-app/aes_cmac_test.json.c +++ b/test/wycheproof-app/aes_cmac_test.json.c @@ -29,1738 +29,1247 @@ /* AES-CMAC, 0.8r12 */ #include "mac_test.h" const struct mac_test aes_cmac_test_json[] = { - { 128, 128, 1, - "\xe3\x4f\x15\xc7\xbd\x81\x99\x30\xfe\x9d\x66\xe0\xc1\x66\xe6\x1c", - "", - "\xd4\x7a\xfc\xa1\xd8\x57\xa5\x93\x34\x05\xb1\xeb\x7a\x5c\xb7\xaf", 1, - 0, NULL, 0 }, - { 128, 128, 2, - "\xe1\xe7\x26\x67\x7f\x48\x93\x89\x0f\x8c\x02\x7f\x9d\x8e\xf8\x0d", - "\x3f", - "\x15\xf8\x56\xbb\xed\x3b\x32\x19\x52\xa5\x84\xb3\xc4\x43\x7a\x63", 1, - 8, NULL, 0 }, - { 128, 128, 3, - "\xb1\x51\xf4\x91\xc4\xc0\x06\xd1\xf2\x82\x14\xaa\x3d\xa9\xa9\x85", - "\x27\xd9", - "\xbd\xbb\xeb\xac\x98\x2d\xd6\x2b\x9f\x68\x26\x18\xa6\xa6\x04\xe9", 1, - 16, NULL, 0 }, - { 128, 128, 4, - "\xc3\x6f\xf1\x5f\x72\x77\x7e\xe2\x1d\xee\xc0\x7b\x63\xc1\xa0\xcd", - "\x50\xb4\x28", - "\xbe\x0c\x3e\xde\x15\x75\x68\xaf\x39\x40\x23\xeb\x9a\x7c\xc9\x83", 1, - 24, NULL, 0 }, - { 128, 128, 5, - "\x32\xb9\xc5\xc7\x8c\x3a\x06\x89\xa8\x60\x52\x42\x0f\xa1\xe8\xfc", - "\x0b\x92\x62\xec", - "\x57\xe1\x50\x68\x56\xc5\x5d\xd3\x2c\xd9\xca\x82\x1a\xdb\x6c\x81", 1, + { 128, 128, 1, "\xe3\x4f\x15\xc7\xbd\x81\x99\x30\xfe\x9d\x66\xe0\xc1\x66\xe6\x1c", "", + "\xd4\x7a\xfc\xa1\xd8\x57\xa5\x93\x34\x05\xb1\xeb\x7a\x5c\xb7\xaf", 1, 0, NULL, 0 }, + { 128, 128, 2, "\xe1\xe7\x26\x67\x7f\x48\x93\x89\x0f\x8c\x02\x7f\x9d\x8e\xf8\x0d", "\x3f", + "\x15\xf8\x56\xbb\xed\x3b\x32\x19\x52\xa5\x84\xb3\xc4\x43\x7a\x63", 1, 8, NULL, 0 }, + { 128, 128, 3, "\xb1\x51\xf4\x91\xc4\xc0\x06\xd1\xf2\x82\x14\xaa\x3d\xa9\xa9\x85", + "\x27\xd9", "\xbd\xbb\xeb\xac\x98\x2d\xd6\x2b\x9f\x68\x26\x18\xa6\xa6\x04\xe9", 1, 16, + NULL, 0 }, + { 128, 128, 4, "\xc3\x6f\xf1\x5f\x72\x77\x7e\xe2\x1d\xee\xc0\x7b\x63\xc1\xa0\xcd", + "\x50\xb4\x28", "\xbe\x0c\x3e\xde\x15\x75\x68\xaf\x39\x40\x23\xeb\x9a\x7c\xc9\x83", 1, 24, + NULL, 0 }, + { 128, 128, 5, "\x32\xb9\xc5\xc7\x8c\x3a\x06\x89\xa8\x60\x52\x42\x0f\xa1\xe8\xfc", + "\x0b\x92\x62\xec", "\x57\xe1\x50\x68\x56\xc5\x5d\xd3\x2c\xd9\xca\x82\x1a\xdb\x6c\x81", 1, 32, NULL, 0 }, - { 128, 128, 6, - "\x43\x15\x1b\xba\xef\x36\x72\x77\xeb\xfc\x97\x50\x9d\x0a\xa4\x9c", + { 128, 128, 6, "\x43\x15\x1b\xba\xef\x36\x72\x77\xeb\xfc\x97\x50\x9d\x0a\xa4\x9c", "\xea\xa9\x12\x73\xe7", - "\xe0\x1a\xdc\x3b\xe6\xa7\x62\x18\x24\x23\x2c\x42\x85\xdd\x35\xb9", 1, - 40, NULL, 0 }, - { 128, 128, 7, - "\x48\x14\x40\x29\x85\x25\xcc\x26\x1f\x81\x59\x15\x9a\xed\xf6\x2d", + "\xe0\x1a\xdc\x3b\xe6\xa7\x62\x18\x24\x23\x2c\x42\x85\xdd\x35\xb9", 1, 40, NULL, 0 }, + { 128, 128, 7, "\x48\x14\x40\x29\x85\x25\xcc\x26\x1f\x81\x59\x15\x9a\xed\xf6\x2d", "\x61\x23\xc5\x56\xc5\xcc", - "\xa2\x81\xe0\xd2\xd5\x37\x8d\xfd\xcc\x13\x10\xfd\x97\x82\xca\x56", 1, - 48, NULL, 0 }, - { 128, 128, 8, - "\x9c\xa2\x6e\xb8\x87\x31\xef\xbf\x7f\x81\x0d\x5d\x95\xe1\x96\xac", + "\xa2\x81\xe0\xd2\xd5\x37\x8d\xfd\xcc\x13\x10\xfd\x97\x82\xca\x56", 1, 48, NULL, 0 }, + { 128, 128, 8, "\x9c\xa2\x6e\xb8\x87\x31\xef\xbf\x7f\x81\x0d\x5d\x95\xe1\x96\xac", "\x7e\x48\xf0\x61\x83\xaa\x40", - "\xfc\x81\x76\x1f\x2f\x7b\x4c\xe1\x3b\x53\xd3\x6e\x32\x67\x73\x32", 1, - 56, NULL, 0 }, - { 128, 128, 9, - "\x48\xf0\xd0\x3e\x41\xcc\x55\xc4\xb5\x8f\x73\x7b\x5a\xcd\xea\x32", + "\xfc\x81\x76\x1f\x2f\x7b\x4c\xe1\x3b\x53\xd3\x6e\x32\x67\x73\x32", 1, 56, NULL, 0 }, + { 128, 128, 9, "\x48\xf0\xd0\x3e\x41\xcc\x55\xc4\xb5\x8f\x73\x7b\x5a\xcd\xea\x32", "\xf4\xa1\x33\xaa\x6d\x59\x85\xa0", - "\x1f\x1c\xd0\x32\x7c\x02\xe6\xd0\x00\x86\x91\x59\x37\xdd\x61\xd9", 1, - 64, NULL, 0 }, - { 128, 128, 10, - "\x1c\x95\x88\x49\xf3\x19\x96\xb2\x89\x39\xce\x51\x30\x87\xd1\xbe", + "\x1f\x1c\xd0\x32\x7c\x02\xe6\xd0\x00\x86\x91\x59\x37\xdd\x61\xd9", 1, 64, NULL, 0 }, + { 128, 128, 10, "\x1c\x95\x88\x49\xf3\x19\x96\xb2\x89\x39\xce\x51\x30\x87\xd1\xbe", "\xb0\xd2\xfe\xe1\x1b\x8e\x2f\x86\xb7", - "\x55\x5f\x46\x21\x51\xf7\xdd\x16\xde\x69\x8d\x63\x9f\xb2\x67\x60", 1, - 72, NULL, 0 }, - { 128, 128, 11, - "\x39\xde\x0e\xbe\xa9\x7c\x09\xb2\x30\x1a\x90\x00\x9a\x42\x32\x53", + "\x55\x5f\x46\x21\x51\xf7\xdd\x16\xde\x69\x8d\x63\x9f\xb2\x67\x60", 1, 72, NULL, 0 }, + { 128, 128, 11, "\x39\xde\x0e\xbe\xa9\x7c\x09\xb2\x30\x1a\x90\x00\x9a\x42\x32\x53", "\x81\xe5\xc3\x3b\x4c\x62\x08\x52\xf0\x44", - "\x9b\x00\x4f\x15\xb7\xf6\xf3\x66\x37\x49\x54\xe6\x4b\xc5\x8f\x5f", 1, - 80, NULL, 0 }, - { 128, 128, 12, - "\x91\x65\x6d\x8f\xc0\xac\xed\x60\xdd\xb1\xc4\x00\x6d\x0d\xde\x53", + "\x9b\x00\x4f\x15\xb7\xf6\xf3\x66\x37\x49\x54\xe6\x4b\xc5\x8f\x5f", 1, 80, NULL, 0 }, + { 128, 128, 12, "\x91\x65\x6d\x8f\xc0\xac\xed\x60\xdd\xb1\xc4\x00\x6d\x0d\xde\x53", "\x7b\x3e\x44\x0f\xe5\x66\x79\x00\x64\xb2\xec", - "\x76\x67\x2e\xd1\x6c\x29\xbe\x44\x9e\x0c\x80\x78\x5c\xc3\x8e\x89", 1, - 88, NULL, 0 }, - { 128, 128, 13, - "\xaf\x7d\x51\x34\x72\x0b\x53\x86\x15\x8d\x51\xea\x12\x6e\x7c\xf9", + "\x76\x67\x2e\xd1\x6c\x29\xbe\x44\x9e\x0c\x80\x78\x5c\xc3\x8e\x89", 1, 88, NULL, 0 }, + { 128, 128, 13, "\xaf\x7d\x51\x34\x72\x0b\x53\x86\x15\x8d\x51\xea\x12\x6e\x7c\xf9", "\x7c\xc6\xfc\xc9\x25\xc2\x0f\x3c\x83\xb5\x56\x7c", - "\x2d\xc5\xc8\x8c\xf3\xb8\x0a\xb6\xc0\x19\x9f\x40\xbe\x90\x4a\xbc", 1, - 96, NULL, 0 }, - { 128, 128, 14, - "\x4e\xd5\x67\x53\xde\x6f\x75\xa0\x32\xeb\xab\xca\x3c\xe2\x79\x71", + "\x2d\xc5\xc8\x8c\xf3\xb8\x0a\xb6\xc0\x19\x9f\x40\xbe\x90\x4a\xbc", 1, 96, NULL, 0 }, + { 128, 128, 14, "\x4e\xd5\x67\x53\xde\x6f\x75\xa0\x32\xeb\xab\xca\x3c\xe2\x79\x71", "\x0c\x8c\x0f\x56\x19\xd9\xf8\xda\x53\x39\x28\x12\x85", - "\xea\xb4\x36\x6d\x97\xe9\x9a\x08\x50\xf0\x77\x32\x9a\xd0\x58\xc0", 1, - 104, NULL, 0 }, - { 128, 128, 15, - "\xbe\xba\x50\xc9\x36\xb6\x96\xc1\x5e\x25\x04\x6d\xff\xb2\x3a\x64", + "\xea\xb4\x36\x6d\x97\xe9\x9a\x08\x50\xf0\x77\x32\x9a\xd0\x58\xc0", 1, 104, NULL, 0 }, + { 128, 128, 15, "\xbe\xba\x50\xc9\x36\xb6\x96\xc1\x5e\x25\x04\x6d\xff\xb2\x3a\x64", "\x82\x1e\xa8\x53\x2f\xba\xbf\xfb\x6e\x3d\x21\x2e\x9b\x46", - "\x22\xf3\x3c\xab\x09\xc1\x73\xf7\x5d\x34\x01\xfe\x44\xef\xee\xad", 1, - 112, NULL, 0 }, - { 128, 128, 16, - "\x50\x1d\x81\xeb\xf9\x12\xdd\xb8\x7f\xbe\x3b\x7a\xac\x14\x37\xbc", + "\x22\xf3\x3c\xab\x09\xc1\x73\xf7\x5d\x34\x01\xfe\x44\xef\xee\xad", 1, 112, NULL, 0 }, + { 128, 128, 16, "\x50\x1d\x81\xeb\xf9\x12\xdd\xb8\x7f\xbe\x3b\x7a\xac\x14\x37\xbc", "\x23\x68\xe3\xc3\x63\x6b\x5e\x8e\x94\xd2\x08\x1a\xdb\xf7\x98", - "\xae\xb7\x84\xa3\x82\x51\x68\xdd\xd6\x1f\x72\xd0\x20\x21\x25\xe6", 1, - 120, NULL, 0 }, - { 128, 128, 17, - "\xe0\x9e\xaa\x5a\x3f\x5e\x56\xd2\x79\xd5\xe7\xa0\x33\x73\xf6\xea", + "\xae\xb7\x84\xa3\x82\x51\x68\xdd\xd6\x1f\x72\xd0\x20\x21\x25\xe6", 1, 120, NULL, 0 }, + { 128, 128, 17, "\xe0\x9e\xaa\x5a\x3f\x5e\x56\xd2\x79\xd5\xe7\xa0\x33\x73\xf6\xea", "\xef\x4e\xab\x37\x18\x1f\x98\x42\x3e\x53\xe9\x47\xe7\x05\x0f\xd0", - "\x40\xfa\xcf\x0e\x2f\xb5\x1b\x73\xa7\x47\x26\x81\xb0\x33\xd6\xdc", 1, - 128, NULL, 0 }, - { 128, 128, 18, - "\x83\x1e\x66\x4c\x9e\x3f\x0c\x30\x94\xc0\xb2\x7b\x9d\x90\x8e\xb2", + "\x40\xfa\xcf\x0e\x2f\xb5\x1b\x73\xa7\x47\x26\x81\xb0\x33\xd6\xdc", 1, 128, NULL, 0 }, + { 128, 128, 18, "\x83\x1e\x66\x4c\x9e\x3f\x0c\x30\x94\xc0\xb2\x7b\x9d\x90\x8e\xb2", "\x26\x60\x3b\xb7\x6d\xd0\xa0\x18\x07\x91\xc4\xed\x4d\x3b\x05\x88" "\x07", - "\xa8\x14\x4c\x8b\x24\xf2\xaa\x47\xd9\xc1\x60\xcf\xf4\xab\x17\x16", 1, - 136, NULL, 0 }, - { 128, 128, 19, - "\x54\x9b\xd2\x82\xee\x21\xb4\xd7\xc3\xb1\xd0\x2e\x3e\xe2\x0e\xf7", + "\xa8\x14\x4c\x8b\x24\xf2\xaa\x47\xd9\xc1\x60\xcf\xf4\xab\x17\x16", 1, 136, NULL, 0 }, + { 128, 128, 19, "\x54\x9b\xd2\x82\xee\x21\xb4\xd7\xc3\xb1\xd0\x2e\x3e\xe2\x0e\xf7", "\xd8\x4b\xf7\x3c\x5e\xec\xbd\x38\x44\x4f\x1a\x73\x55\x6e\x2f\xa3\x25" "\x3f\x4c\x54\xd6\x91\x65\x45", - "\x7e\xd4\x58\xaf\xe0\x2f\x4a\x51\x3f\x59\x71\x5b\x66\x4b\x1b\xbe", 1, - 192, NULL, 0 }, - { 128, 128, 20, - "\x9b\xd3\x90\x2e\xd0\x99\x6c\x86\x9b\x57\x22\x72\xe7\x6f\x38\x89", + "\x7e\xd4\x58\xaf\xe0\x2f\x4a\x51\x3f\x59\x71\x5b\x66\x4b\x1b\xbe", 1, 192, NULL, 0 }, + { 128, 128, 20, "\x9b\xd3\x90\x2e\xd0\x99\x6c\x86\x9b\x57\x22\x72\xe7\x6f\x38\x89", "\xa7\xba\x19\xd4\x9e\xe1\xea\x02\xf0\x98\xaa\x8e\x30\xc7\x40\xd8\x93" "\xa4\x45\x6c\xcc\x29\x40\x40\x48\x4e\xd8\xa0\x0a\x55\xf9\x3e", - "\x45\x08\x22\x18\xc2\xd0\x5e\xef\x32\x24\x7f\xeb\x11\x33\xd0\xa3", 1, - 256, NULL, 0 }, - { 128, 128, 21, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x96\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 22, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x45\x08\x22\x18\xc2\xd0\x5e\xef\x32\x24\x7f\xeb\x11\x33\xd0\xa3", 1, 256, NULL, 0 }, + { 128, 128, 21, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x96\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 22, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x43\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 23, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7a\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 24, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x95\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 25, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x43\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 23, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7a\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 24, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x95\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 25, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x40\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 26, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x79\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 27, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x17\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 28, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x40\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 26, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x79\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 27, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x17\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 28, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc2\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 29, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xfb\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 30, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdc\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 31, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xc2\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 29, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xfb\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 30, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdc\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 31, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x81\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 32, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xce\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 33, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\xda\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 34, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x81\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 32, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xce\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 33, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\xda\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 34, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\x31\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 35, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\x4a\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 36, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x89\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 37, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\x31\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 35, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\x4a\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 36, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x89\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 37, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x92\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 38, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7b\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 39, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x8a\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 40, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\xb1\x92\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 38, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7b\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 39, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x8a\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 40, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x91\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 41, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x78\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 42, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\xd6\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 43, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\xb1\x91\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 41, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x78\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 42, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\xd6\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 43, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\xb2\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 44, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x0b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 45, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4d\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 46, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\xb1\x93\x1f\x00\xb2\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 44, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x0b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 45, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4d\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 46, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xae\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 47, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x97\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 48, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\xcc\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 49, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xae\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 47, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x97\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 48, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\xcc\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 49, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\x2f\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 50, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x16\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 51, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x19\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 52, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\x2f\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 50, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x16\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 51, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x19\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 52, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xc9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 53, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x4f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 54, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xaf\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 55, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xc9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 53, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x4f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 54, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xaf\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 55, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x85\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 56, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc4\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 57, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1d\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 58, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x85\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 56, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc4\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 57, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1d\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 58, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x36\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 59, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9e\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 60, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1e\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 61, + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x36\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 59, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9e\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 60, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1e\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 61, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x35\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 62, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9d\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 63, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x9c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 64, + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x35\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 62, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9d\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 63, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x9c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\xb7\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 65, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x1f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 66, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xab", 0, - 0, NULL, 0 }, - { 128, 128, 67, + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\xb7\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 65, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x1f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 66, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xab", 0, 0, NULL, 0 }, + { 128, 128, 67, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x30", 0, - 64, NULL, 0 }, - { 128, 128, 68, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9f", 0, - 128, NULL, 0 }, - { 128, 128, 69, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xa8", 0, - 0, NULL, 0 }, - { 128, 128, 70, + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x30", 0, 64, NULL, 0 }, + { 128, 128, 68, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9f", 0, 128, NULL, 0 }, + { 128, 128, 69, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xa8", 0, 0, NULL, 0 }, + { 128, 128, 70, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x33", 0, - 64, NULL, 0 }, - { 128, 128, 71, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9c", 0, - 128, NULL, 0 }, - { 128, 128, 72, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xea", 0, - 0, NULL, 0 }, - { 128, 128, 73, + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x33", 0, 64, NULL, 0 }, + { 128, 128, 71, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x9c", 0, 128, NULL, 0 }, + { 128, 128, 72, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\xea", 0, 0, NULL, 0 }, + { 128, 128, 73, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x71", 0, - 64, NULL, 0 }, - { 128, 128, 74, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\xde", 0, - 128, NULL, 0 }, - { 128, 128, 75, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\x2a", 0, - 0, NULL, 0 }, - { 128, 128, 76, + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\x71", 0, 64, NULL, 0 }, + { 128, 128, 74, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\xde", 0, 128, NULL, 0 }, + { 128, 128, 75, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\x56\x4c\x39\xae\x7d\x1c\x5a\x31\x2a", 0, 0, NULL, 0 }, + { 128, 128, 76, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\xb1", 0, - 64, NULL, 0 }, - { 128, 128, 77, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x1e", 0, - 128, NULL, 0 }, - { 128, 128, 78, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x96\xdd\x6e\x5a\x88\x2c\xbd\x56\x4d\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 79, + "\x42\x80\x2e\xb1\x93\x1f\x00\x32\xaf\xe9\x84\x44\x37\x38\xcd\xb1", 0, 64, NULL, 0 }, + { 128, 128, 77, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x8b\x96\x6f\xc5\x39\x9f\x74\x80\x1e", 0, 128, NULL, 0 }, + { 128, 128, 78, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x96\xdd\x6e\x5a\x88\x2c\xbd\x56\x4d\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 79, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x43\x80\x2e\xb1\x93\x1f\x00\x32\xae\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 80, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7a\xcf\xbb\xca\x7a\x2e\xa6\x8b\x97\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 81, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\xda\x88\x2c\xbd\xd6\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, - 0, NULL, 0 }, - { 128, 128, 82, + "\x43\x80\x2e\xb1\x93\x1f\x00\x32\xae\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 80, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7a\xcf\xbb\xca\x7a\x2e\xa6\x8b\x97\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 81, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\xda\x88\x2c\xbd\xd6\x4c\x39\xae\x7d\x1c\x5a\x31\xaa", 0, 0, NULL, 0 }, + { 128, 128, 82, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\x31\x93\x1f\x00\xb2\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, - 64, NULL, 0 }, - { 128, 128, 83, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\x4a\x7a\x2e\xa6\x0b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, - 128, NULL, 0 }, - { 128, 128, 84, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x97\xdd\x6e\x5a\x88\x2c\xbd\xd6\x4c\x39\xae\x7d\x1c\x5a\x31\x2a", 0, - 0, NULL, 0 }, - { 128, 128, 85, + "\x42\x80\x2e\x31\x93\x1f\x00\xb2\xaf\xe9\x84\x44\x37\x38\xcd\x31", 0, 64, NULL, 0 }, + { 128, 128, 83, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\x4a\x7a\x2e\xa6\x0b\x96\x6f\xc5\x39\x9f\x74\x80\x9e", 0, 128, NULL, 0 }, + { 128, 128, 84, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x97\xdd\x6e\x5a\x88\x2c\xbd\xd6\x4c\x39\xae\x7d\x1c\x5a\x31\x2a", 0, 0, NULL, 0 }, + { 128, 128, 85, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x42\x80\x2e\xb1\x93\x1f\x00\xb2\xaf\xe9\x84\x44\x37\x38\xcd\xb1", 0, - 64, NULL, 0 }, - { 128, 128, 86, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x0b\x96\x6f\xc5\x39\x9f\x74\x80\x1e", 0, - 128, NULL, 0 }, - { 128, 128, 87, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x68\x22\x91\xa5\x77\xd3\x42\xa9\xb3\xc6\x51\x82\xe3\xa5\xce\x55", 0, - 0, NULL, 0 }, - { 128, 128, 88, + "\x42\x80\x2e\xb1\x93\x1f\x00\xb2\xaf\xe9\x84\x44\x37\x38\xcd\xb1", 0, 64, NULL, 0 }, + { 128, 128, 86, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7b\xcf\xbb\xca\x7a\x2e\xa6\x0b\x96\x6f\xc5\x39\x9f\x74\x80\x1e", 0, 128, NULL, 0 }, + { 128, 128, 87, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x68\x22\x91\xa5\x77\xd3\x42\xa9\xb3\xc6\x51\x82\xe3\xa5\xce\x55", 0, 0, NULL, 0 }, + { 128, 128, 88, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xbd\x7f\xd1\x4e\x6c\xe0\xff\xcd\x50\x16\x7b\xbb\xc8\xc7\x32\xce", 0, - 64, NULL, 0 }, - { 128, 128, 89, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x84\x30\x44\x35\x85\xd1\x59\x74\x69\x90\x3a\xc6\x60\x8b\x7f\x61", 0, - 128, NULL, 0 }, - { 128, 128, 90, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, NULL, 0 }, - { 128, 128, 91, + "\xbd\x7f\xd1\x4e\x6c\xe0\xff\xcd\x50\x16\x7b\xbb\xc8\xc7\x32\xce", 0, 64, NULL, 0 }, + { 128, 128, 89, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x84\x30\x44\x35\x85\xd1\x59\x74\x69\x90\x3a\xc6\x60\x8b\x7f\x61", 0, 128, NULL, 0 }, + { 128, 128, 90, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, NULL, 0 }, + { 128, 128, 91, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, NULL, 0 }, - { 128, 128, 92, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, NULL, 0 }, - { 128, 128, 93, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, NULL, 0 }, - { 128, 128, 94, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, NULL, 0 }, + { 128, 128, 92, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, NULL, 0 }, + { 128, 128, 93, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, NULL, 0 }, + { 128, 128, 94, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, NULL, 0 }, - { 128, 128, 95, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, NULL, 0 }, - { 128, 128, 96, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x17\x5d\xee\xda\x08\xac\x3d\xd6\xcc\xb9\x2e\xfd\x9c\xda\xb1\x2a", 0, - 0, NULL, 0 }, - { 128, 128, 97, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, NULL, 0 }, + { 128, 128, 95, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, NULL, 0 }, + { 128, 128, 96, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x17\x5d\xee\xda\x08\xac\x3d\xd6\xcc\xb9\x2e\xfd\x9c\xda\xb1\x2a", 0, 0, NULL, 0 }, + { 128, 128, 97, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc2\x00\xae\x31\x13\x9f\x80\xb2\x2f\x69\x04\xc4\xb7\xb8\x4d\xb1", 0, - 64, NULL, 0 }, - { 128, 128, 98, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xfb\x4f\x3b\x4a\xfa\xae\x26\x0b\x16\xef\x45\xb9\x1f\xf4\x00\x1e", 0, - 128, NULL, 0 }, - { 128, 128, 99, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", - "\x96\xdc\x6f\x5b\x89\x2d\xbc\x57\x4d\x38\xaf\x7c\x1d\x5b\x30\xab", 0, - 0, NULL, 0 }, - { 128, 128, 100, + "\xc2\x00\xae\x31\x13\x9f\x80\xb2\x2f\x69\x04\xc4\xb7\xb8\x4d\xb1", 0, 64, NULL, 0 }, + { 128, 128, 98, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xfb\x4f\x3b\x4a\xfa\xae\x26\x0b\x16\xef\x45\xb9\x1f\xf4\x00\x1e", 0, 128, NULL, 0 }, + { 128, 128, 99, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", + "\x96\xdc\x6f\x5b\x89\x2d\xbc\x57\x4d\x38\xaf\x7c\x1d\x5b\x30\xab", 0, 0, NULL, 0 }, + { 128, 128, 100, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x43\x81\x2f\xb0\x92\x1e\x01\x33\xae\xe8\x85\x45\x36\x39\xcc\x30", 0, - 64, NULL, 0 }, - { 128, 128, 101, + "\x43\x81\x2f\xb0\x92\x1e\x01\x33\xae\xe8\x85\x45\x36\x39\xcc\x30", 0, 64, NULL, 0 }, + { 128, 128, 101, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7a\xce\xba\xcb\x7b\x2f\xa7\x8a\x97\x6e\xc4\x38\x9e\x75\x81\x9f", 0, - 128, NULL, 0 }, + "\x7a\xce\xba\xcb\x7b\x2f\xa7\x8a\x97\x6e\xc4\x38\x9e\x75\x81\x9f", 0, 128, NULL, 0 }, { 192, 128, 102, "\x3d\x6b\xf9\xed\xae\x6d\x88\x1e\xad\xe0\xff\x8c\x70\x76\xa4\x83\x5b" "\x71\x32\x0c\x1f\x36\xb6\x31", - "", - "\xa8\xdd\x15\xfe\x2c\xe3\x49\x5e\xc5\xb6\x66\x74\x4e\xc2\x92\x20", 1, - 0, NULL, 0 }, + "", "\xa8\xdd\x15\xfe\x2c\xe3\x49\x5e\xc5\xb6\x66\x74\x4e\xc2\x92\x20", 1, 0, NULL, 0 }, { 192, 128, 103, "\x91\x54\x29\x74\x34\x35\xc2\x89\x97\xa3\x3b\x33\xb6\x57\x4a\x95\x3d" "\x81\xda\xe0\xe7\x03\x2e\x6a", - "\x58", - "\xe1\x3b\x3f\x7f\x7f\x51\x0c\x3a\x05\x9d\xf7\xa6\x8c\x7e\x2a\xd5", 1, - 8, NULL, 0 }, + "\x58", "\xe1\x3b\x3f\x7f\x7f\x51\x0c\x3a\x05\x9d\xf7\xa6\x8c\x7e\x2a\xd5", 1, 8, NULL, + 0 }, { 192, 128, 104, "\xf0\xc2\x88\xba\x26\xb2\x84\xf9\xfb\x32\x1b\x44\x4a\x65\x17\xb3\xcd" "\xda\x1a\x79\x9d\x55\xfd\xff", - "\x0f\x7e", - "\x06\xef\x84\x7f\x5f\x9d\xbf\x03\xa4\xf2\x83\xda\x8c\x40\x02\x20", 1, - 16, NULL, 0 }, + "\x0f\x7e", "\x06\xef\x84\x7f\x5f\x9d\xbf\x03\xa4\xf2\x83\xda\x8c\x40\x02\x20", 1, 16, + NULL, 0 }, { 192, 128, 105, "\x6b\x55\xe4\xd4\xfd\x68\x47\xa8\x0a\x6b\xfb\x0d\xcc\x0a\xa9\x3f\x9f" "\xd7\x97\xfc\x5c\x50\x29\x2e", - "\x33\xf5\x30", - "\xdd\x13\x50\x53\xa4\x7c\xa8\xf2\x82\xc2\x99\xe8\x3b\x8c\x57\xc4", 1, - 24, NULL, 0 }, + "\x33\xf5\x30", "\xdd\x13\x50\x53\xa4\x7c\xa8\xf2\x82\xc2\x99\xe8\x3b\x8c\x57\xc4", 1, 24, + NULL, 0 }, { 192, 128, 106, "\x1e\xb2\x1a\x9e\x99\x5a\x8e\x45\xc9\xe7\x1e\xcb\xd6\xfe\x61\x5b\x3e" "\x03\x18\x00\x7c\x64\xb6\x44", - "\x3a\xa7\x3c\x48", - "\x1e\x93\xff\xf8\x46\x93\x4a\x6e\xea\x05\x75\xee\xcb\x0f\x0e\x1f", 1, + "\x3a\xa7\x3c\x48", "\x1e\x93\xff\xf8\x46\x93\x4a\x6e\xea\x05\x75\xee\xcb\x0f\x0e\x1f", 1, 32, NULL, 0 }, { 192, 128, 107, "\x71\x0e\x2d\x5d\x4a\x9f\x0b\xc7\xe5\x07\x96\x65\x5e\x04\x6a\x18\xcc" "\x57\x69\xd7\x76\x43\x55\xda", "\x7e\x4c\x69\x0a\x88", - "\x01\x6d\x4d\xf0\x6c\x68\xa6\xa7\x88\xa9\xea\x05\x2e\x1b\x55\x0d", 1, - 40, NULL, 0 }, + "\x01\x6d\x4d\xf0\x6c\x68\xa6\xa7\x88\xa9\xea\x05\x2e\x1b\x55\x0d", 1, 40, NULL, 0 }, { 192, 128, 108, "\xd8\xc0\x9e\xa4\x00\x77\x9b\x63\xe7\x74\xbd\xac\xd0\xcb\x7b\x5d\xd6" "\xf7\x36\xca\x23\xd5\x2a\xcf", "\xe9\x52\x02\x80\x97\x3b", - "\x80\x30\xae\x9f\x98\xf5\xd2\x0c\x60\x89\xf6\xb1\xbd\x87\xc2\x9e", 1, - 48, NULL, 0 }, + "\x80\x30\xae\x9f\x98\xf5\xd2\x0c\x60\x89\xf6\xb1\xbd\x87\xc2\x9e", 1, 48, NULL, 0 }, { 192, 128, 109, "\x8e\x67\xe9\xa0\x86\x3b\x55\xbe\xd4\x08\x86\x6f\x1c\xbc\x05\x35\x7a" "\xbe\x3f\x9d\x79\xf4\x06\xf2", "\x48\x80\xb4\x12\x28\x7a\x0b", - "\xbc\xaf\x50\x78\x5f\x06\x2a\x8f\xb8\xdd\x3c\x2c\x4c\xea\xd2\xe1", 1, - 56, NULL, 0 }, + "\xbc\xaf\x50\x78\x5f\x06\x2a\x8f\xb8\xdd\x3c\x2c\x4c\xea\xd2\xe1", 1, 56, NULL, 0 }, { 192, 128, 110, "\x28\xd8\xda\x67\x80\x64\x10\xe5\x56\x5b\xcc\x5a\x9d\x7a\xb9\xfb\x35" "\x74\x13\xfa\x01\x58\x37\x8c", "\x00\x4e\x3f\x4a\x4e\x6d\xb9\x55", - "\xc4\xc2\xc0\x87\x6b\xe9\xea\xbe\xb5\xa9\x56\xda\x53\x84\x6b\x08", 1, - 64, NULL, 0 }, + "\xc4\xc2\xc0\x87\x6b\xe9\xea\xbe\xb5\xa9\x56\xda\x53\x84\x6b\x08", 1, 64, NULL, 0 }, { 192, 128, 111, "\xdc\x96\x8d\xd8\x9f\xd6\x02\xbb\x7e\xca\x6f\x3a\x8a\x13\xe4\xf5\x9c" "\x08\xd0\x2a\x51\x4b\x19\x34", "\x41\xa2\x53\x54\xef\xeb\x1b\xc3\xb8", - "\xf3\x3a\x62\xca\xf3\x97\xf9\xaf\xf7\x1f\xe4\x29\x41\xba\x41\xd8", 1, - 72, NULL, 0 }, + "\xf3\x3a\x62\xca\xf3\x97\xf9\xaf\xf7\x1f\xe4\x29\x41\xba\x41\xd8", 1, 72, NULL, 0 }, { 192, 128, 112, "\x76\x58\x95\x1c\x0f\x62\x0d\x82\xaf\xd9\x27\x56\xcc\x2d\x79\x83\xb7" "\x9d\xa3\xe5\x6f\xdd\x1b\x78", "\xf0\xe8\x2f\xb5\xc5\x66\x6f\x4a\xf4\x9f", - "\x4d\x72\x4d\x05\xf3\x40\x29\x67\xeb\x65\xae\x1e\x32\xd5\x46\x9e", 1, - 80, NULL, 0 }, + "\x4d\x72\x4d\x05\xf3\x40\x29\x67\xeb\x65\xae\x1e\x32\xd5\x46\x9e", 1, 80, NULL, 0 }, { 192, 128, 113, "\xd9\x57\x4c\x3a\x22\x1b\x98\x66\x90\x93\x1f\xaa\xc5\x25\x8d\x9d\x3c" "\x52\x36\x2b\x2c\xb9\xb0\x54", "\x17\x8e\xa8\x40\x4b\xa5\x4e\xe4\xe4\x52\x2c", - "\x64\xa0\xe0\xb6\x75\x73\x09\xab\x58\xd7\x4f\x72\xc3\x10\xe4\x73", 1, - 88, NULL, 0 }, + "\x64\xa0\xe0\xb6\x75\x73\x09\xab\x58\xd7\x4f\x72\xc3\x10\xe4\x73", 1, 88, NULL, 0 }, { 192, 128, 114, "\x70\x44\x09\xba\xb2\x80\x85\xc4\x49\x81\xf2\x8f\x75\xdd\x14\x3a\x4f" "\x74\x71\x06\xf6\x3f\x26\x2e", "\xcd\xa5\x70\x9e\x7f\x11\x56\x24\xe7\x4a\xb0\x31", - "\x6a\xb2\x07\x43\x34\xbe\x14\xa9\x5b\x6a\x24\x1f\x89\x7a\x43\xde", 1, - 96, NULL, 0 }, + "\x6a\xb2\x07\x43\x34\xbe\x14\xa9\x5b\x6a\x24\x1f\x89\x7a\x43\xde", 1, 96, NULL, 0 }, { 192, 128, 115, "\xd8\xd0\x6e\xf6\xa5\x3b\xbf\xf5\xc8\xf1\x2d\x79\x1b\x8f\x4c\x67\xe5" "\x74\xbf\x44\x07\x36\xd1\xcc", "\xa1\x17\x1e\xae\x19\x79\xf4\x83\x45\xdd\x94\x85\xa0", - "\x7a\xa5\x7c\xf9\x8b\x24\x89\x7c\xc9\x23\x0e\x33\x16\x75\x8e\x61", 1, - 104, NULL, 0 }, + "\x7a\xa5\x7c\xf9\x8b\x24\x89\x7c\xc9\x23\x0e\x33\x16\x75\x8e\x61", 1, 104, NULL, 0 }, { 192, 128, 116, "\x71\x12\x9e\x78\x16\x13\xf3\x9d\x9a\xc3\x9f\xbd\xe2\x62\x8b\x44\xc2" "\x50\xc1\x4d\xeb\x5e\xf9\xe2", "\x96\x75\x93\xcc\x64\xbc\xbf\x7f\x3c\x58\xd0\x4c\xb8\x2b", - "\x6c\xc4\x88\xb0\xa4\x0e\xad\xbe\x4b\xce\xe2\x62\x32\x39\xd1\x26", 1, - 112, NULL, 0 }, + "\x6c\xc4\x88\xb0\xa4\x0e\xad\xbe\x4b\xce\xe2\x62\x32\x39\xd1\x26", 1, 112, NULL, 0 }, { 192, 128, 117, "\x85\x0f\xc8\x59\xe9\xf7\xb8\x9a\x36\x76\x11\xde\xe6\x69\x8f\x33\x96" "\x2d\x82\x45\xca\x8d\xc3\x31", "\x58\x6f\x4f\x17\x1a\xf1\x16\x51\x90\x61\xa8\xe0\xe7\x79\x40", - "\xfb\x11\xa3\x60\xc9\x77\x69\x91\xd7\x3d\x6e\x41\xd0\x77\x10\xa2", 1, - 120, NULL, 0 }, + "\xfb\x11\xa3\x60\xc9\x77\x69\x91\xd7\x3d\x6e\x41\xd0\x77\x10\xa2", 1, 120, NULL, 0 }, { 192, 128, 118, "\xf4\xbf\xa5\xaa\x4f\x0f\x4d\x62\xcf\x73\x6c\xd2\x96\x9c\x43\xd5\x80" "\xfd\xb9\x2f\x27\x53\xbe\xdb", "\x0e\x23\x9f\x23\x97\x05\xb2\x82\xce\x22\x00\xfe\x20\xde\x11\x65", - "\xab\x20\xa6\xcf\x60\x87\x36\x65\xb1\xd6\x99\x9b\x05\xc7\xf9\xc6", 1, - 128, NULL, 0 }, + "\xab\x20\xa6\xcf\x60\x87\x36\x65\xb1\xd6\x99\x9b\x05\xc7\xf9\xc6", 1, 128, NULL, 0 }, { 192, 128, 119, "\xcf\xd3\xf6\x88\x73\xd8\x1a\x27\xd2\xbf\xce\x87\x6c\x79\xf6\xe6\x09" "\x07\x4d\xec\x39\xe3\x46\x14", "\xb1\x97\x3c\xb2\x5a\xa8\x7e\xf9\xd1\xa8\x88\x8b\x0a\x0f\x5c\x04" "\xc6", - "\xb9\x5a\x01\x6b\x83\xa0\xae\x41\x94\x02\x33\x33\xc8\xa7\x34\x5a", 1, - 136, NULL, 0 }, + "\xb9\x5a\x01\x6b\x83\xa0\xae\x41\x94\x02\x33\x33\xc8\xa7\x34\x5a", 1, 136, NULL, 0 }, { 192, 128, 120, "\x64\x8a\x44\x46\x8d\x67\xbb\x67\x44\xb2\x35\xee\x7a\x3f\xcd\x6e\xd4" "\xbd\xc2\x9e\xc5\xb5\xfa\x1a", "\xc5\x9d\x0d\x69\x81\xcc\xa1\xbe\x1d\x55\x19\xfc\x78\x81\xe6\xd2\x30" "\xf3\x9f\x6c\x12\xa9\xe8\x27", - "\xa1\xb9\x62\x72\xae\x7f\x9a\xef\x56\x72\x71\x79\x5f\x21\xd1\xd3", 1, - 192, NULL, 0 }, + "\xa1\xb9\x62\x72\xae\x7f\x9a\xef\x56\x72\x71\x79\x5f\x21\xd1\xd3", 1, 192, NULL, 0 }, { 192, 128, 121, "\x9d\x11\xab\xc1\xfc\xb2\x48\xa4\x36\x59\x8e\x69\x5b\xe1\x2c\x3c\x2e" "\xd9\x0a\x18\xba\x09\xd6\x2c", "\xaa\x51\x82\xca\xe2\xa8\xfb\x06\x8c\x0b\x3f\xb2\xbe\x3e\x57\xae\x52" "\x3d\x13\xdf\xfd\x1a\x94\x45\x87\x70\x7c\x2b\x67\x44\x7f\x3f", - "\x85\x97\xd9\xa0\x4d\x1c\x27\x1d\x61\xd4\x2f\x00\x7b\x43\x51\x75", 1, - 256, NULL, 0 }, + "\x85\x97\xd9\xa0\x4d\x1c\x27\x1d\x61\xd4\x2f\x00\x7b\x43\x51\x75", 1, 256, NULL, 0 }, { 192, 128, 122, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xed\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xed\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 123, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc8\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc8\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 124, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf9\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf9\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 125, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xee\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xee\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 126, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xcb\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xcb\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 127, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xfa\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xfa\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\x6c\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\x6c\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 129, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x49\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\x49\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 130, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x78\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\x78\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 131, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x13\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x13\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 132, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x12\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x12\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 133, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1a\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1a\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 134, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x8e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x8e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 135, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\x5f\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\x5f\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 136, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x80\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x80\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 137, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa1\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa1\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 138, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x61\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x61\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 139, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x68\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x68\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 140, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa2\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa2\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 141, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x62\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x62\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 142, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x6b\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x6b\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 143, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x95\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x95\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 144, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\x4b\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\x4b\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 145, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x09\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x09\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 146, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd8\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd8\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 147, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x90\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x90\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 148, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x56\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x56\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 149, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\x59\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\x59\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 150, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x11\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x11\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 151, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\xd7\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\xd7\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 152, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xf3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xf3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 153, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x3c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x3c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 154, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x1b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x1b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 155, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7b\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7b\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 156, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7a\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7a\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 157, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf1\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf1\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 158, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xcb\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xcb\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 159, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1a\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1a\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 160, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7d\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7d\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 161, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xc8\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xc8\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 162, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x19\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x19\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 163, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7e\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7e\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 164, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\x4a\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\x4a\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 165, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x9b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x9b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 166, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\xfc\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\xfc\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 167, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x91", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x91", 0, 0, NULL, 0 }, { 192, 128, 168, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x91", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x91", 0, 64, NULL, 0 }, { 192, 128, 169, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8d", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8d", 0, 128, NULL, 0 }, { 192, 128, 170, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x92", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x92", 0, 0, NULL, 0 }, { 192, 128, 171, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x92", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x92", 0, 64, NULL, 0 }, { 192, 128, 172, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8e", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x8e", 0, 128, NULL, 0 }, { 192, 128, 173, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\xd0", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\xd0", 0, 0, NULL, 0 }, { 192, 128, 174, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\xd0", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\xd0", 0, 64, NULL, 0 }, { 192, 128, 175, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\xcc", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\xcc", 0, 128, NULL, 0 }, { 192, 128, 176, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x10", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x15\xd9\xd3\x7a\x6e\xca\x1f\xc9\x10", 0, 0, NULL, 0 }, { 192, 128, 177, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x10", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\xcb\x91\x1c\x7b\xe6\x1b\xe7\xca\x10", 0, 64, NULL, 0 }, { 192, 128, 178, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x0c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x89\x57\x3b\xf0\x4e\x7c\xde\x68\x0c", 0, 128, NULL, 0 }, { 192, 128, 179, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xed\x12\x39\x0e\xa0\xa7\xed\x15\xd8\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xed\x12\x39\x0e\xa0\xa7\xed\x15\xd8\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 180, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc8\x13\x07\xdf\x60\x85\x9a\xcb\x90\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc8\x13\x07\xdf\x60\x85\x9a\xcb\x90\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 181, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf9\x1b\xde\x00\x69\xa6\xe3\x89\x56\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf9\x1b\xde\x00\x69\xa6\xe3\x89\x56\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 182, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x8e\xa0\xa7\xed\x95\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x8e\xa0\xa7\xed\x95\xd9\xd3\x7a\x6e\xca\x1f\xc9\x90", 0, 0, NULL, 0 }, { 192, 128, 183, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\x5f\x60\x85\x9a\x4b\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\x5f\x60\x85\x9a\x4b\x91\x1c\x7b\xe6\x1b\xe7\xca\x90", 0, 64, NULL, 0 }, { 192, 128, 184, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x80\x69\xa6\xe3\x09\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x80\x69\xa6\xe3\x09\x57\x3b\xf0\x4e\x7c\xde\x68\x8c", 0, 128, NULL, 0 }, { 192, 128, 185, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xec\x12\x39\x0e\xa0\xa7\xed\x95\xd9\xd3\x7a\x6e\xca\x1f\xc9\x10", 0, - 0, NULL, 0 }, + "", "\xec\x12\x39\x0e\xa0\xa7\xed\x95\xd9\xd3\x7a\x6e\xca\x1f\xc9\x10", 0, 0, NULL, 0 }, { 192, 128, 186, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc9\x13\x07\xdf\x60\x85\x9a\x4b\x91\x1c\x7b\xe6\x1b\xe7\xca\x10", 0, - 64, NULL, 0 }, + "\xc9\x13\x07\xdf\x60\x85\x9a\x4b\x91\x1c\x7b\xe6\x1b\xe7\xca\x10", 0, 64, NULL, 0 }, { 192, 128, 187, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf8\x1b\xde\x00\x69\xa6\xe3\x09\x57\x3b\xf0\x4e\x7c\xde\x68\x0c", 0, - 128, NULL, 0 }, + "\xf8\x1b\xde\x00\x69\xa6\xe3\x09\x57\x3b\xf0\x4e\x7c\xde\x68\x0c", 0, 128, NULL, 0 }, { 192, 128, 188, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\x13\xed\xc6\xf1\x5f\x58\x12\xea\x26\x2c\x85\x91\x35\xe0\x36\x6f", 0, - 0, NULL, 0 }, + "", "\x13\xed\xc6\xf1\x5f\x58\x12\xea\x26\x2c\x85\x91\x35\xe0\x36\x6f", 0, 0, NULL, 0 }, { 192, 128, 189, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x36\xec\xf8\x20\x9f\x7a\x65\x34\x6e\xe3\x84\x19\xe4\x18\x35\x6f", 0, - 64, NULL, 0 }, + "\x36\xec\xf8\x20\x9f\x7a\x65\x34\x6e\xe3\x84\x19\xe4\x18\x35\x6f", 0, 64, NULL, 0 }, { 192, 128, 190, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x07\xe4\x21\xff\x96\x59\x1c\x76\xa8\xc4\x0f\xb1\x83\x21\x97\x73", 0, - 128, NULL, 0 }, + "\x07\xe4\x21\xff\x96\x59\x1c\x76\xa8\xc4\x0f\xb1\x83\x21\x97\x73", 0, 128, NULL, 0 }, { 192, 128, 191, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, NULL, 0 }, + "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, NULL, 0 }, { 192, 128, 192, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, NULL, 0 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, NULL, 0 }, { 192, 128, 193, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, NULL, 0 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, NULL, 0 }, { 192, 128, 194, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, NULL, 0 }, + "", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, NULL, 0 }, { 192, 128, 195, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, NULL, 0 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, NULL, 0 }, { 192, 128, 196, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, NULL, 0 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, NULL, 0 }, { 192, 128, 197, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\x6c\x92\xb9\x8e\x20\x27\x6d\x95\x59\x53\xfa\xee\x4a\x9f\x49\x10", 0, - 0, NULL, 0 }, + "", "\x6c\x92\xb9\x8e\x20\x27\x6d\x95\x59\x53\xfa\xee\x4a\x9f\x49\x10", 0, 0, NULL, 0 }, { 192, 128, 198, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x49\x93\x87\x5f\xe0\x05\x1a\x4b\x11\x9c\xfb\x66\x9b\x67\x4a\x10", 0, - 64, NULL, 0 }, + "\x49\x93\x87\x5f\xe0\x05\x1a\x4b\x11\x9c\xfb\x66\x9b\x67\x4a\x10", 0, 64, NULL, 0 }, { 192, 128, 199, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x78\x9b\x5e\x80\xe9\x26\x63\x09\xd7\xbb\x70\xce\xfc\x5e\xe8\x0c", 0, - 128, NULL, 0 }, + "\x78\x9b\x5e\x80\xe9\x26\x63\x09\xd7\xbb\x70\xce\xfc\x5e\xe8\x0c", 0, 128, NULL, 0 }, { 192, 128, 200, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", - "", - "\xed\x13\x38\x0f\xa1\xa6\xec\x14\xd8\xd2\x7b\x6f\xcb\x1e\xc8\x91", 0, - 0, NULL, 0 }, + "", "\xed\x13\x38\x0f\xa1\xa6\xec\x14\xd8\xd2\x7b\x6f\xcb\x1e\xc8\x91", 0, 0, NULL, 0 }, { 192, 128, 201, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xc8\x12\x06\xde\x61\x84\x9b\xca\x90\x1d\x7a\xe7\x1a\xe6\xcb\x91", 0, - 64, NULL, 0 }, + "\xc8\x12\x06\xde\x61\x84\x9b\xca\x90\x1d\x7a\xe7\x1a\xe6\xcb\x91", 0, 64, NULL, 0 }, { 192, 128, 202, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf9\x1a\xdf\x01\x68\xa7\xe2\x88\x56\x3a\xf1\x4f\x7d\xdf\x69\x8d", 0, - 128, NULL, 0 }, + "\xf9\x1a\xdf\x01\x68\xa7\xe2\x88\x56\x3a\xf1\x4f\x7d\xdf\x69\x8d", 0, 128, NULL, 0 }, { 256, 128, 203, "\x7b\xf9\xe5\x36\xb6\x6a\x21\x5c\x22\x23\x3f\xe2\xda\xaa\x74\x3a\x89" "\x8b\x9a\xcb\x9f\x78\x02\xde\x70\xb4\x0e\x3d\x6e\x43\xef\x97", - "", - "\x73\x6c\x7b\x56\x95\x7d\xb7\x74\xc5\xdd\xf7\xc7\xa7\x0b\xa8\xa8", 1, - 0, NULL, 0 }, + "", "\x73\x6c\x7b\x56\x95\x7d\xb7\x74\xc5\xdd\xf7\xc7\xa7\x0b\xa8\xa8", 1, 0, NULL, 0 }, { 256, 128, 204, "\xe7\x54\x07\x6c\xea\xb3\xfd\xaf\x4f\x9b\xca\xb7\xd4\xf0\xdf\x0c\xbb" "\xaf\xbc\x87\x73\x1b\x8f\x9b\x7c\xd2\x16\x64\x72\xe8\xee\xbc", - "\x40", - "\x9d\x47\x48\x2c\x2d\x92\x52\xba\xce\x43\xa7\x5a\x83\x35\xb8\xb8", 1, - 8, NULL, 0 }, + "\x40", "\x9d\x47\x48\x2c\x2d\x92\x52\xba\xce\x43\xa7\x5a\x83\x35\xb8\xb8", 1, 8, NULL, + 0 }, { 256, 128, 205, "\xea\x3b\x01\x6b\xdd\x38\x7d\xd6\x4d\x83\x7c\x71\x68\x38\x08\xf3\x35" "\xdb\xdc\x53\x59\x8a\x4e\xa8\xc5\xf9\x52\x47\x3f\xaf\xaf\x5f", - "\x66\x01", - "\xc7\xc4\x4e\x31\xc4\x66\x33\x49\x92\xd6\xf9\xde\x3c\x77\x16\x34", 1, - 16, NULL, 0 }, + "\x66\x01", "\xc7\xc4\x4e\x31\xc4\x66\x33\x49\x92\xd6\xf9\xde\x3c\x77\x16\x34", 1, 16, + NULL, 0 }, { 256, 128, 206, "\x73\xd4\x70\x96\x37\x85\x7d\xaf\xab\x6a\xd8\xb2\xb0\xa5\x1b\x06\x52" "\x47\x17\xfe\xdf\x10\x02\x96\x64\x4f\x7c\xfd\xaa\xe1\x80\x5b", - "\xf1\xd3\x00", - "\xb7\x08\x66\x03\xa8\x5e\x11\xfc\xeb\x8c\xad\xea\x9b\xd3\x09\x39", 1, - 24, NULL, 0 }, + "\xf1\xd3\x00", "\xb7\x08\x66\x03\xa8\x5e\x11\xfc\xeb\x8c\xad\xea\x9b\xd3\x09\x39", 1, 24, + NULL, 0 }, { 256, 128, 207, "\xd5\xc8\x1b\x39\x9d\x4c\x0d\x15\x83\xa1\x3d\xa5\x6d\xe6\xd2\xdc\x45" "\xa6\x6e\x7b\x47\xc2\x4a\xb1\x19\x2e\x24\x6d\xc9\x61\xdd\x77", - "\x2a\xe6\x3c\xbf", - "\xba\x38\x3a\x3a\x15\xc9\xdf\x64\xbb\xa5\x0d\x61\x11\x13\xa0\x24", 1, + "\x2a\xe6\x3c\xbf", "\xba\x38\x3a\x3a\x15\xc9\xdf\x64\xbb\xa5\x0d\x61\x11\x13\xa0\x24", 1, 32, NULL, 0 }, { 256, 128, 208, "\x25\x21\x20\x3f\xa0\xdd\xdf\x59\xd8\x37\xb2\x83\x0f\x87\xb1\xaa\x61" "\xf9\x58\x15\x5d\xf3\xca\x4d\x1d\xf2\x45\x7c\xb4\x28\x4d\xc8", "\xaf\x3a\x01\x5e\xa1", - "\xb4\x57\x13\x7c\x54\x89\x08\xc6\x29\xf7\x14\xfe\x83\xb1\xed\x90", 1, - 40, NULL, 0 }, + "\xb4\x57\x13\x7c\x54\x89\x08\xc6\x29\xf7\x14\xfe\x83\xb1\xed\x90", 1, 40, NULL, 0 }, { 256, 128, 209, "\x66\x5a\x02\xbc\x26\x5a\x66\xd0\x17\x75\x09\x1d\xa5\x67\x26\xb6\x66" "\x8b\xfd\x90\x3c\xb7\xaf\x66\xfb\x1b\x78\xa8\xa0\x62\xe4\x3c", "\x3f\x56\x93\x5d\xef\x3f", - "\xb6\xd6\xfd\xe9\x3f\xc8\x5d\xe2\x89\xb3\x6b\x44\x6d\x77\xb4\x23", 1, - 48, NULL, 0 }, + "\xb6\xd6\xfd\xe9\x3f\xc8\x5d\xe2\x89\xb3\x6b\x44\x6d\x77\xb4\x23", 1, 48, NULL, 0 }, { 256, 128, 210, "\xfa\xcd\x75\xb2\x22\x21\x38\x00\x47\x30\x5b\xc9\x81\xf5\x70\xe2\xa1" "\xaf\x38\x92\x8e\xa7\xe2\x05\x9e\x3a\xf5\xfc\x6b\x82\xb4\x93", "\x57\xbb\x86\xbe\xed\x15\x6f", - "\x8b\x1e\xf7\x2d\x0a\x61\x27\x35\xb0\x8e\xfe\xf9\x81\xf2\x13\xc2", 1, - 56, NULL, 0 }, + "\x8b\x1e\xf7\x2d\x0a\x61\x27\x35\xb0\x8e\xfe\xf9\x81\xf2\x13\xc2", 1, 56, NULL, 0 }, { 256, 128, 211, "\x50\x5a\xa9\x88\x19\x80\x9e\xf6\x3b\x9a\x36\x8a\x1e\x8b\xc2\xe9\x22" "\xda\x45\xb0\x3c\xe0\x2d\x9a\x79\x66\xb1\x50\x06\xdb\xa2\xd5", "\x2e\x4e\x7e\xf7\x28\xfe\x11\xaf", - "\xf7\x96\x06\xb8\x3a\x77\x06\xa2\xa1\x9e\x06\x8b\xce\x81\x88\x98", 1, - 64, NULL, 0 }, + "\xf7\x96\x06\xb8\x3a\x77\x06\xa2\xa1\x9e\x06\x8b\xce\x81\x88\x98", 1, 64, NULL, 0 }, { 256, 128, 212, "\xf9\x42\x09\x38\x42\x80\x8b\xa4\x7f\x64\xe4\x27\xf7\x35\x1d\xde\x6b" "\x95\x46\xe6\x6d\xe4\xe7\xd6\x0a\xa6\xf3\x28\x18\x27\x12\xcf", "\x85\x2a\x21\xd9\x28\x48\xe6\x27\xc7", - "\xa5\xa8\x77\xf2\x2a\xc7\x43\xb7\xfb\x9e\x05\x0d\x2e\x3d\xdb\x02", 1, - 72, NULL, 0 }, + "\xa5\xa8\x77\xf2\x2a\xc7\x43\xb7\xfb\x9e\x05\x0d\x2e\x3d\xdb\x02", 1, 72, NULL, 0 }, { 256, 128, 213, "\x64\xbe\x16\x2b\x39\xc6\xe5\xf1\xfe\xd9\xc3\x2d\x9f\x67\x4d\x9a\x8c" "\xde\x6e\xaa\x24\x43\x21\x4d\x86\xbd\x4a\x1f\xb5\x3b\x81\xb4", "\x19\x5a\x3b\x29\x2f\x93\xba\xff\x0a\x2c", - "\x6e\xa1\x72\xe5\xc4\xd2\xfa\xc0\x75\xca\x60\x2d\xe5\x75\x7a\x62", 1, - 80, NULL, 0 }, + "\x6e\xa1\x72\xe5\xc4\xd2\xfa\xc0\x75\xca\x60\x2d\xe5\x75\x7a\x62", 1, 80, NULL, 0 }, { 256, 128, 214, "\xb2\x59\xa5\x55\xd4\x4b\x8a\x20\xc5\x48\x9e\x2f\x38\x39\x2d\xda\xa6" "\xbe\x9e\x35\xb9\x83\x3b\x67\xe1\xb5\xfd\xf6\xcb\x3e\x4c\x6c", "\xaf\xd7\x31\x17\x33\x0c\x6e\x85\x28\xa6\xe4", - "\x68\x02\x0b\xfc\x9b\xd7\x3f\xd8\x0d\x3c\xe5\x81\xba\x3b\x12\x08", 1, - 88, NULL, 0 }, + "\x68\x02\x0b\xfc\x9b\xd7\x3f\xd8\x0d\x3c\xe5\x81\xba\x3b\x12\x08", 1, 88, NULL, 0 }, { 256, 128, 215, "\x2c\x6f\xc6\x2d\xaa\x77\xba\x8c\x68\x81\xb3\xdd\x69\x89\x89\x8f\xef" "\x64\x66\x63\xcc\x7b\x0a\x3d\xb8\x22\x8a\x70\x7b\x85\xf2\xdc", "\x0f\xf5\x4d\x6b\x67\x59\x12\x0c\x2e\x8a\x51\xe3", - "\x11\x0e\xdd\x72\x7a\x9b\xf7\xfa\x11\xa6\x35\x8a\xfe\x61\x7d\x9d", 1, - 96, NULL, 0 }, + "\x11\x0e\xdd\x72\x7a\x9b\xf7\xfa\x11\xa6\x35\x8a\xfe\x61\x7d\x9d", 1, 96, NULL, 0 }, { 256, 128, 216, "\xab\xab\x81\x5d\x51\xdf\x29\xf7\x40\xe4\xe2\x07\x9f\xb7\x98\xe0\x15" "\x28\x36\xe6\xab\x57\xd1\x53\x6a\xe8\x92\x9e\x52\xc0\x6e\xb8", "\xf0\x05\x8d\x41\x2a\x10\x4e\x53\xd8\x20\xb9\x5a\x7f", - "\x1f\xa2\x4c\x66\x25\xa0\xf8\xe1\xfc\x37\x82\x7a\xc8\x4d\x3c\xc4", 1, - 104, NULL, 0 }, + "\x1f\xa2\x4c\x66\x25\xa0\xf8\xe1\xfc\x37\x82\x7a\xc8\x4d\x3c\xc4", 1, 104, NULL, 0 }, { 256, 128, 217, "\x3d\x5d\xa1\xaf\x83\xf7\x28\x74\x58\xbf\xf7\xa7\x65\x1e\xa5\xd8\xdb" "\x72\x25\x94\x01\x33\x3f\x6b\x82\x09\x69\x96\xdd\x7e\xaf\x19", "\xaa\xcc\x36\x97\x2f\x18\x30\x57\x91\x9f\xf5\x7b\x49\xe1", - "\x86\x87\x65\xa8\xfa\x6a\xa8\x98\xdd\xec\x0f\x41\x23\xe9\x96\xbe", 1, - 112, NULL, 0 }, + "\x86\x87\x65\xa8\xfa\x6a\xa8\x98\xdd\xec\x0f\x41\x23\xe9\x96\xbe", 1, 112, NULL, 0 }, { 256, 128, 218, "\xc1\x9b\xdf\x31\x4c\x6c\xf6\x43\x81\x42\x54\x67\xf4\x2a\xef\xa1\x7c" "\x1c\xc9\x35\x8b\xe1\x6c\xe3\x1b\x1d\x21\x48\x59\xce\x86\xaa", "\x5d\x06\x6a\x92\xc3\x00\xe9\xb6\xdd\xd6\x3a\x7c\x13\xae\x33", - "\xb9\x68\x18\xb7\xac\xaf\x87\x9c\x7a\x7f\x82\x71\x37\x5a\x69\x14", 1, - 120, NULL, 0 }, + "\xb9\x68\x18\xb7\xac\xaf\x87\x9c\x7a\x7f\x82\x71\x37\x5a\x69\x14", 1, 120, NULL, 0 }, { 256, 128, 219, "\x61\x2e\x83\x78\x43\xce\xae\x7f\x61\xd4\x96\x25\xfa\xa7\xe7\x49\x4f" "\x92\x53\xe2\x0c\xb3\xad\xce\xa6\x86\x51\x2b\x04\x39\x36\xcd", "\xcc\x37\xfa\xe1\x5f\x74\x5a\x2f\x40\xe2\xc8\xb1\x92\xf2\xb3\x8d", - "\x4b\x88\xe1\x93\x00\x0c\x5a\x4b\x23\xe9\x5c\x7f\x2b\x26\x53\x0b", 1, - 128, NULL, 0 }, + "\x4b\x88\xe1\x93\x00\x0c\x5a\x4b\x23\xe9\x5c\x7f\x2b\x26\x53\x0b", 1, 128, NULL, 0 }, { 256, 128, 220, "\x73\x21\x6f\xaf\xd0\x02\x2d\x0d\x6e\xe2\x71\x98\xb2\x27\x25\x78\xfa" "\x8f\x04\xdd\x9f\x44\x46\x7f\xbb\x64\x37\xaa\x45\x64\x1b\xf7", "\xd5\x24\x7b\x8f\x6c\x3e\xdc\xbf\xb1\xd5\x91\xd1\x3e\xce\x23\xd2" "\xf5", - "\x86\x91\x1c\x7d\xa5\x1d\xc0\x82\x3d\x6e\x93\xd4\x29\x0d\x1a\xd4", 1, - 136, NULL, 0 }, + "\x86\x91\x1c\x7d\xa5\x1d\xc0\x82\x3d\x6e\x93\xd4\x29\x0d\x1a\xd4", 1, 136, NULL, 0 }, { 256, 128, 221, "\x04\x27\xa7\x0e\x25\x75\x28\xf3\xab\x70\x64\x0b\xba\x1a\x5d\xe1\x2c" "\xf3\x88\x5d\xd4\xc8\xe2\x84\xfb\xbb\x55\xfe\xb3\x52\x94\xa5", "\x13\x93\x7f\x85\x44\xf4\x42\x70\xd0\x11\x75\xa0\x11\xf7\x67\x0e\x93" "\xfa\x6b\xa7\xef\x02\x33\x6e", - "\xcc\xb2\xc5\x1b\xfb\xe2\x59\x8f\x91\x09\xfc\x70\xed\x07\xf0\xeb", 1, - 192, NULL, 0 }, + "\xcc\xb2\xc5\x1b\xfb\xe2\x59\x8f\x91\x09\xfc\x70\xed\x07\xf0\xeb", 1, 192, NULL, 0 }, { 256, 128, 222, "\x96\xe1\xe4\x89\x6f\xb2\xcd\x05\xf1\x33\xa6\xa1\x00\xbc\x56\x09\xa7" "\xac\x3c\xa6\xd8\x17\x21\xe9\x22\xda\xdd\x69\xad\x07\xa8\x92", "\x91\xa1\x7e\x4d\xfc\xc3\x16\x6a\x1a\xdd\x26\xff\x0e\x7c\x12\x05\x6e" "\x8a\x65\x4f\x28\xa6\xde\x24\xf4\xba\x73\x9c\xeb\x5b\x5b\x18", - "\x92\x5f\x17\x7d\x85\xea\x29\x7e\xf1\x4b\x20\x3f\xe4\x09\xf9\xab", 1, - 256, NULL, 0 }, + "\x92\x5f\x17\x7d\x85\xea\x29\x7e\xf1\x4b\x20\x3f\xe4\x09\xf9\xab", 1, 256, NULL, 0 }, { 256, 128, 223, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6a\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6a\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 224, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd7\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd7\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 225, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x58\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x58\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 226, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x69\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x69\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 227, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd4\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd4\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 228, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x5b\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x5b\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 229, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xeb\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\xeb\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 230, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x56\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\x56\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 231, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd9\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\xd9\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 232, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf1\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf1\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 233, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x08\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x08\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 234, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xef\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xef\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 235, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x13\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x13\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 236, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\xfc\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\xfc\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 237, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\xbb\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\xbb\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 238, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd9\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd9\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 239, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3b\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3b\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 240, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5e\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5e\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 241, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xda\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xda\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 242, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x38\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x38\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 243, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5d\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5d\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 244, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x90\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x90\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 245, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\x22\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\x22\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 246, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x10\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x10\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 247, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1e\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1e\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 248, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xeb\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xeb\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 249, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xcb\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xcb\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 250, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x9f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x9f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 251, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\x6a\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\x6a\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 252, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\x4a\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\x4a\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 253, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x20\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x20\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 254, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x00\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x00\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 255, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xc2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xc2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 256, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x88\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x88\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 257, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0a\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0a\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 258, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6c\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6c\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 259, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x77\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x77\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 260, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7c\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7c\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 261, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x28\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x28\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 262, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x74\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x74\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 263, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7f\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7f\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 264, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x2b\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x2b\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 265, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\xf6\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\xf6\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 266, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\xfd\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\xfd\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 267, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\xa9\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\xa9\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 268, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfa", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xfa", 0, 0, NULL, 0 }, { 256, 128, 269, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xed", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xed", 0, 64, NULL, 0 }, { 256, 128, 270, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2c", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2c", 0, 128, NULL, 0 }, { 256, 128, 271, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xf9", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xf9", 0, 0, NULL, 0 }, { 256, 128, 272, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xee", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xee", 0, 64, NULL, 0 }, { 256, 128, 273, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2f", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x2f", 0, 128, NULL, 0 }, { 256, 128, 274, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xbb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\xbb", 0, 0, NULL, 0 }, { 256, 128, 275, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xac", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\xac", 0, 64, NULL, 0 }, { 256, 128, 276, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x6d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\x6d", 0, 128, NULL, 0 }, { 256, 128, 277, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\x7b", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x10\x1f\x00\x89\x72\x76\x91\xb7\x7b", 0, 0, NULL, 0 }, { 256, 128, 278, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\x6c", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\xa2\xea\x20\x0b\x29\x7d\x2a\xcc\x6c", 0, 64, NULL, 0 }, { 256, 128, 279, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\xad", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x90\xca\xe2\x6d\xad\x29\xbb\xa3\xad", 0, 128, NULL, 0 }, { 256, 128, 280, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6a\xf0\xa2\x93\xd8\xcb\xa0\x10\x1e\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6a\xf0\xa2\x93\xd8\xcb\xa0\x10\x1e\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 281, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd7\x09\x71\x7c\x3a\x4e\xf8\xa2\xeb\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd7\x09\x71\x7c\x3a\x4e\xf8\xa2\xeb\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 282, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x58\xee\x3f\x3b\x5f\x83\xe2\x90\xcb\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x58\xee\x3f\x3b\x5f\x83\xe2\x90\xcb\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 283, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x13\xd8\xcb\xa0\x90\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x13\xd8\xcb\xa0\x90\x1f\x00\x89\x72\x76\x91\xb7\xfb", 0, 0, NULL, 0 }, { 256, 128, 284, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\xfc\x3a\x4e\xf8\x22\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\xfc\x3a\x4e\xf8\x22\xea\x20\x0b\x29\x7d\x2a\xcc\xec", 0, 64, NULL, 0 }, { 256, 128, 285, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\xbb\x5f\x83\xe2\x10\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\xbb\x5f\x83\xe2\x10\xca\xe2\x6d\xad\x29\xbb\xa3\x2d", 0, 128, NULL, 0 }, { 256, 128, 286, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x90\x1f\x00\x89\x72\x76\x91\xb7\x7b", 0, - 0, NULL, 0 }, + "", "\x6b\xf0\xa2\x93\xd8\xcb\xa0\x90\x1f\x00\x89\x72\x76\x91\xb7\x7b", 0, 0, NULL, 0 }, { 256, 128, 287, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd6\x09\x71\x7c\x3a\x4e\xf8\x22\xea\x20\x0b\x29\x7d\x2a\xcc\x6c", 0, - 64, NULL, 0 }, + "\xd6\x09\x71\x7c\x3a\x4e\xf8\x22\xea\x20\x0b\x29\x7d\x2a\xcc\x6c", 0, 64, NULL, 0 }, { 256, 128, 288, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x59\xee\x3f\x3b\x5f\x83\xe2\x10\xca\xe2\x6d\xad\x29\xbb\xa3\xad", 0, - 128, NULL, 0 }, + "\x59\xee\x3f\x3b\x5f\x83\xe2\x10\xca\xe2\x6d\xad\x29\xbb\xa3\xad", 0, 128, NULL, 0 }, { 256, 128, 289, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x94\x0f\x5d\x6c\x27\x34\x5f\xef\xe0\xff\x76\x8d\x89\x6e\x48\x04", 0, - 0, NULL, 0 }, + "", "\x94\x0f\x5d\x6c\x27\x34\x5f\xef\xe0\xff\x76\x8d\x89\x6e\x48\x04", 0, 0, NULL, 0 }, { 256, 128, 290, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x29\xf6\x8e\x83\xc5\xb1\x07\x5d\x15\xdf\xf4\xd6\x82\xd5\x33\x13", 0, - 64, NULL, 0 }, + "\x29\xf6\x8e\x83\xc5\xb1\x07\x5d\x15\xdf\xf4\xd6\x82\xd5\x33\x13", 0, 64, NULL, 0 }, { 256, 128, 291, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xa6\x11\xc0\xc4\xa0\x7c\x1d\x6f\x35\x1d\x92\x52\xd6\x44\x5c\xd2", 0, - 128, NULL, 0 }, + "\xa6\x11\xc0\xc4\xa0\x7c\x1d\x6f\x35\x1d\x92\x52\xd6\x44\x5c\xd2", 0, 128, NULL, 0 }, { 256, 128, 292, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, NULL, 0 }, + "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, NULL, 0 }, { 256, 128, 293, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, NULL, 0 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, NULL, 0 }, { 256, 128, 294, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, NULL, 0 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, NULL, 0 }, { 256, 128, 295, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, NULL, 0 }, + "", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, NULL, 0 }, { 256, 128, 296, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, NULL, 0 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, NULL, 0 }, { 256, 128, 297, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, NULL, 0 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, NULL, 0 }, { 256, 128, 298, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xeb\x70\x22\x13\x58\x4b\x20\x90\x9f\x80\x09\xf2\xf6\x11\x37\x7b", 0, - 0, NULL, 0 }, + "", "\xeb\x70\x22\x13\x58\x4b\x20\x90\x9f\x80\x09\xf2\xf6\x11\x37\x7b", 0, 0, NULL, 0 }, { 256, 128, 299, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x56\x89\xf1\xfc\xba\xce\x78\x22\x6a\xa0\x8b\xa9\xfd\xaa\x4c\x6c", 0, - 64, NULL, 0 }, + "\x56\x89\xf1\xfc\xba\xce\x78\x22\x6a\xa0\x8b\xa9\xfd\xaa\x4c\x6c", 0, 64, NULL, 0 }, { 256, 128, 300, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd9\x6e\xbf\xbb\xdf\x03\x62\x10\x4a\x62\xed\x2d\xa9\x3b\x23\xad", 0, - 128, NULL, 0 }, + "\xd9\x6e\xbf\xbb\xdf\x03\x62\x10\x4a\x62\xed\x2d\xa9\x3b\x23\xad", 0, 128, NULL, 0 }, { 256, 128, 301, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x6a\xf1\xa3\x92\xd9\xca\xa1\x11\x1e\x01\x88\x73\x77\x90\xb6\xfa", 0, - 0, NULL, 0 }, + "", "\x6a\xf1\xa3\x92\xd9\xca\xa1\x11\x1e\x01\x88\x73\x77\x90\xb6\xfa", 0, 0, NULL, 0 }, { 256, 128, 302, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xd7\x08\x70\x7d\x3b\x4f\xf9\xa3\xeb\x21\x0a\x28\x7c\x2b\xcd\xed", 0, - 64, NULL, 0 }, + "\xd7\x08\x70\x7d\x3b\x4f\xf9\xa3\xeb\x21\x0a\x28\x7c\x2b\xcd\xed", 0, 64, NULL, 0 }, { 256, 128, 303, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x58\xef\x3e\x3a\x5e\x82\xe3\x91\xcb\xe3\x6c\xac\x28\xba\xa2\x2c", 0, - 128, NULL, 0 }, - { 0, 128, 304, "", "\x00\xb9\x44\x93\x26\xd3\x94\x16", "", 0, 64, NULL, - 0 }, - { 8, 128, 305, "\x0f", "\x45\x38\xb7\x9a\x13\x97\xe2\xaa", "", 0, 64, - NULL, 0 }, - { 64, 128, 306, "\xa8\x8e\x38\x5a\xf7\x18\x51\x48", - "\xdc\x63\xb7\xef\x08\x09\x6e\x4f", "", 0, 64, NULL, 0 }, + "\x58\xef\x3e\x3a\x5e\x82\xe3\x91\xcb\xe3\x6c\xac\x28\xba\xa2\x2c", 0, 128, NULL, 0 }, + { 0, 128, 304, "", "\x00\xb9\x44\x93\x26\xd3\x94\x16", "", 0, 64, NULL, 0 }, + { 8, 128, 305, "\x0f", "\x45\x38\xb7\x9a\x13\x97\xe2\xaa", "", 0, 64, NULL, 0 }, + { 64, 128, 306, "\xa8\x8e\x38\x5a\xf7\x18\x51\x48", "\xdc\x63\xb7\xef\x08\x09\x6e\x4f", "", + 0, 64, NULL, 0 }, { 160, 128, 307, "\x00\x3a\x22\x80\x08\xd3\x90\xb6\x45\x92\x9d\xf7\x3a\x2b\x2b\xdd\x82" "\x98\x91\x8d", diff --git a/test/wycheproof-app/aes_gcm_test.json.c b/test/wycheproof-app/aes_gcm_test.json.c index 3bc14666..8308a217 100644 --- a/test/wycheproof-app/aes_gcm_test.json.c +++ b/test/wycheproof-app/aes_gcm_test.json.c @@ -29,110 +29,79 @@ /* AES-GCM, 0.8r12 */ #include "aead_test.h" const struct aead_test aes_gcm_test_json[] = { - { 96, 128, 128, 1, - "\x5b\x96\x04\xfe\x14\xea\xdb\xa9\x31\xb0\xcc\xf3\x48\x43\xda\xb9", + { 96, 128, 128, 1, "\x5b\x96\x04\xfe\x14\xea\xdb\xa9\x31\xb0\xcc\xf3\x48\x43\xda\xb9", "\x02\x83\x18\xab\xc1\x82\x40\x29\x13\x81\x41\xa2", "", "\x00\x1d\x0c\x23\x12\x87\xc1\x18\x27\x84\x55\x4c\xa3\xa2\x19\x08", "\x26\x07\x3c\xc1\xd8\x51\xbe\xff\x17\x63\x84\xdc\x98\x96\xd5\xff", - "\x0a\x3e\xa7\xa5\x48\x7c\xb5\xf7\xd7\x0f\xb6\xc5\x8d\x03\x85\x54", 1, - 0, 128 }, - { 96, 128, 128, 2, - "\x5b\x96\x04\xfe\x14\xea\xdb\xa9\x31\xb0\xcc\xf3\x48\x43\xda\xb9", + "\x0a\x3e\xa7\xa5\x48\x7c\xb5\xf7\xd7\x0f\xb6\xc5\x8d\x03\x85\x54", 1, 0, 128 }, + { 96, 128, 128, 2, "\x5b\x96\x04\xfe\x14\xea\xdb\xa9\x31\xb0\xcc\xf3\x48\x43\xda\xb9", "\x92\x1d\x25\x07\xfa\x80\x07\xb7\xbd\x06\x7d\x34", "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", "\x00\x1d\x0c\x23\x12\x87\xc1\x18\x27\x84\x55\x4c\xa3\xa2\x19\x08", "\x49\xd8\xb9\x78\x3e\x91\x19\x13\xd8\x70\x94\xd1\xf6\x3c\xc7\x65", - "\x1e\x34\x8b\xa0\x7c\xca\x2c\xf0\x4c\x61\x8c\xb4\xd4\x3a\x5b\x92", 1, - 128, 128 }, - { 96, 128, 128, 3, - "\xaa\x02\x3d\x04\x78\xdc\xb2\xb2\x31\x24\x98\x29\x3d\x9a\x91\x29", - "\x04\x32\xbc\x49\xac\x34\x41\x20\x81\x28\x81\x27", - "\xaa\xc3\x92\x31\x12\x98\x72\xa2", + "\x1e\x34\x8b\xa0\x7c\xca\x2c\xf0\x4c\x61\x8c\xb4\xd4\x3a\x5b\x92", 1, 128, 128 }, + { 96, 128, 128, 3, "\xaa\x02\x3d\x04\x78\xdc\xb2\xb2\x31\x24\x98\x29\x3d\x9a\x91\x29", + "\x04\x32\xbc\x49\xac\x34\x41\x20\x81\x28\x81\x27", "\xaa\xc3\x92\x31\x12\x98\x72\xa2", "\x20\x35\xaf\x31\x3d\x13\x46\xab\x00\x15\x4f\xea\x78\x32\x21\x05", "\xee\xa9\x45\xf3\xd0\xf9\x8c\xc0\xfb\xab\x47\x2a\x0c\xf2\x4e\x87", - "\x4b\xb9\xb4\x81\x25\x19\xda\xdf\x9e\x12\x32\x01\x6d\x06\x81\x33", 1, - 64, 128 }, - { 96, 128, 128, 4, - "\xbe\xdc\xfb\x5a\x01\x1e\xbc\x84\x60\x0f\xcb\x29\x6c\x15\xaf\x0d", + "\x4b\xb9\xb4\x81\x25\x19\xda\xdf\x9e\x12\x32\x01\x6d\x06\x81\x33", 1, 64, 128 }, + { 96, 128, 128, 4, "\xbe\xdc\xfb\x5a\x01\x1e\xbc\x84\x60\x0f\xcb\x29\x6c\x15\xaf\x0d", "\x43\x8a\x54\x7a\x94\xea\x88\xdc\xe4\x6c\x6c\x85", "", "", "", - "\x96\x02\x47\xba\x5c\xde\x02\xe4\x1a\x31\x3c\x4c\x01\x36\xed\xc3", 1, - 0, 0 }, - { 96, 128, 128, 5, - "\x38\x4e\xa4\x16\xac\x3c\x2f\x51\xa7\x6e\x7d\x82\x26\x34\x6d\x4e", - "\xb3\x0c\x08\x47\x27\xad\x1c\x59\x2a\xc2\x1d\x12", "", "\x35", - "\x54", - "\x7c\x1e\x4a\xe8\x8b\xb2\x7e\x56\x38\x34\x3c\xb9\xfd\x3f\x63\x37", 1, - 0, 8 }, - { 96, 128, 128, 6, - "\xca\xe3\x1c\xd9\xf5\x55\x26\xeb\x03\x82\x41\xfc\x44\xca\xc1\xe5", + "\x96\x02\x47\xba\x5c\xde\x02\xe4\x1a\x31\x3c\x4c\x01\x36\xed\xc3", 1, 0, 0 }, + { 96, 128, 128, 5, "\x38\x4e\xa4\x16\xac\x3c\x2f\x51\xa7\x6e\x7d\x82\x26\x34\x6d\x4e", + "\xb3\x0c\x08\x47\x27\xad\x1c\x59\x2a\xc2\x1d\x12", "", "\x35", "\x54", + "\x7c\x1e\x4a\xe8\x8b\xb2\x7e\x56\x38\x34\x3c\xb9\xfd\x3f\x63\x37", 1, 0, 8 }, + { 96, 128, 128, 6, "\xca\xe3\x1c\xd9\xf5\x55\x26\xeb\x03\x82\x41\xfc\x44\xca\xc1\xe5", "\xb5\xe0\x06\xde\xd5\x53\x11\x0e\x6d\xc5\x65\x29", "", - "\xd1\x09\x89\xf2\xc5\x2e\x94\xad", - "\xa0\x36\xea\xd0\x31\x93\x90\x3f", - "\x3b\x62\x69\x40\xe0\xe9\xf0\xcb\xea\x8e\x18\xc4\x37\xfd\x60\x11", 1, - 0, 64 }, - { 96, 128, 128, 7, - "\xdd\x61\x97\xcd\x63\xc9\x63\x91\x9c\xf0\xc2\x73\xef\x6b\x28\xbf", + "\xd1\x09\x89\xf2\xc5\x2e\x94\xad", "\xa0\x36\xea\xd0\x31\x93\x90\x3f", + "\x3b\x62\x69\x40\xe0\xe9\xf0\xcb\xea\x8e\x18\xc4\x37\xfd\x60\x11", 1, 0, 64 }, + { 96, 128, 128, 7, "\xdd\x61\x97\xcd\x63\xc9\x63\x91\x9c\xf0\xc2\x73\xef\x6b\x28\xbf", "\xec\xb0\xc4\x2f\x70\x00\xef\x0e\x6f\x95\xf2\x4d", "", "\x4d\xcc\x14\x85\x36\x58\x66\xe2\x5a\xc3\xf2\xca\x6a\xba\x97", "\x8a\x99\x92\x38\x8e\x73\x5f\x80\xee\x18\xf4\xa6\x3c\x10\xad", - "\x14\x86\xa9\x1c\xcc\xf9\x2c\x9a\x5b\x00\xf7\xb0\xe0\x34\x89\x1c", 1, - 0, 120 }, - { 96, 128, 128, 8, - "\xff\xdf\x42\x28\x36\x1e\xa1\xf8\x16\x58\x52\x13\x6b\x34\x80\xf7", + "\x14\x86\xa9\x1c\xcc\xf9\x2c\x9a\x5b\x00\xf7\xb0\xe0\x34\x89\x1c", 1, 0, 120 }, + { 96, 128, 128, 8, "\xff\xdf\x42\x28\x36\x1e\xa1\xf8\x16\x58\x52\x13\x6b\x34\x80\xf7", "\x0e\x16\x66\xf2\xdc\x65\x2f\x77\x08\xfb\x8f\x0d", "", "\x25\xb1\x2e\x28\xac\x0e\xf6\xea\xd0\x22\x6a\x3b\x22\x88\xc8\x00", "\xf7\xbd\x37\x9d\x13\x04\x77\x17\x6b\x8b\xb3\xcb\x23\xdb\xbb\xaa", - "\x1e\xe6\x51\x3c\xe3\x0c\x78\x73\xf5\x9d\xd4\x35\x0a\x58\x8f\x42", 1, - 0, 128 }, - { 96, 128, 128, 9, - "\xc1\x5e\xd2\x27\xdd\x2e\x23\x7e\xcd\x08\x7e\xaa\xaa\xd1\x9e\xa4", + "\x1e\xe6\x51\x3c\xe3\x0c\x78\x73\xf5\x9d\xd4\x35\x0a\x58\x8f\x42", 1, 0, 128 }, + { 96, 128, 128, 9, "\xc1\x5e\xd2\x27\xdd\x2e\x23\x7e\xcd\x08\x7e\xaa\xaa\xd1\x9e\xa4", "\x96\x5f\xf6\x64\x31\x16\xac\x14\x43\xa2\xde\xc7", "", "\xfe\xe6\x2f\xde\x97\x3f\xe0\x25\xad\x6b\x32\x2d\xcd\xf3\xc6\x3f" "\xc7", "\x0d\xe5\x1f\xe4\xf7\xf2\xd1\xf0\xf9\x17\x56\x9f\x5c\x6d\x1b\x00" "\x9c", - "\x6c\xd8\x52\x14\x22\xc0\x17\x7e\x83\xef\x1b\x7a\x84\x5d\x97\xdb", 1, - 0, 136 }, - { 96, 128, 128, 10, - "\xa8\xee\x11\xb2\x6d\x7c\xeb\x7f\x17\xea\xa1\xe4\xb8\x3a\x2c\xf6", + "\x6c\xd8\x52\x14\x22\xc0\x17\x7e\x83\xef\x1b\x7a\x84\x5d\x97\xdb", 1, 0, 136 }, + { 96, 128, 128, 10, "\xa8\xee\x11\xb2\x6d\x7c\xeb\x7f\x17\xea\xa1\xe4\xb8\x3a\x2c\xf6", "\xfb\xbc\x04\xfd\x6e\x02\x5b\x71\x93\xeb\x57\xf6", "", "\xc0\x8f\x08\x5e\x6a\x9e\x0e\xf3\x63\x62\x80\xc1\x1e\xcf\xad\xf0\xc1" "\xe7\x29\x19\xff\xc1\x7e\xaf", "\x7c\xd9\xf4\xe4\xf3\x65\x70\x4f\xff\x3b\x99\x00\xaa\x93\xba\x54\xb6" "\x72\xba\xc5\x54\x27\x56\x50", - "\xf4\xeb\x19\x32\x41\x22\x6d\xb0\x17\xb3\x2e\xc3\x8c\xa4\x72\x17", 1, - 0, 192 }, - { 96, 128, 128, 11, - "\x28\xff\x3d\xef\x08\x17\x93\x11\xe2\x73\x4c\x6d\x1c\x4e\x28\x71", + "\xf4\xeb\x19\x32\x41\x22\x6d\xb0\x17\xb3\x2e\xc3\x8c\xa4\x72\x17", 1, 0, 192 }, + { 96, 128, 128, 11, "\x28\xff\x3d\xef\x08\x17\x93\x11\xe2\x73\x4c\x6d\x1c\x4e\x28\x71", "\x32\xbc\xb9\xb5\x69\xe3\xb8\x52\xd3\x7c\x76\x6a", "\xc3", "\xdf\xc6\x1a\x20\xdf\x85\x05\xb5\x3e\x3c\xd5\x9f\x25\x77\x0d\x50\x18" "\xad\xd3\xd6", "\xf5\x8d\x45\x32\x12\xc2\xc8\xa4\x36\xe9\x28\x36\x72\xf5\x79\xf1\x19" "\x12\x29\x78", - "\x59\x01\x13\x1d\x07\x60\xc8\x71\x59\x01\xd8\x81\xfd\xfd\x3b\xc0", 1, - 8, 160 }, - { 96, 128, 128, 12, - "\xe6\x3a\x43\x21\x6c\x08\x86\x72\x10\xe2\x48\x85\x9e\xb5\xe9\x9c", - "\x9c\x3a\x42\x63\xd9\x83\x45\x66\x58\xaa\xd4\xb1", - "\x83\x4a\xfd\xc5\xc7\x37\x18\x6b", + "\x59\x01\x13\x1d\x07\x60\xc8\x71\x59\x01\xd8\x81\xfd\xfd\x3b\xc0", 1, 8, 160 }, + { 96, 128, 128, 12, "\xe6\x3a\x43\x21\x6c\x08\x86\x72\x10\xe2\x48\x85\x9e\xb5\xe9\x9c", + "\x9c\x3a\x42\x63\xd9\x83\x45\x66\x58\xaa\xd4\xb1", "\x83\x4a\xfd\xc5\xc7\x37\x18\x6b", "\xb1\x4d\xa5\x6b\x04\x62\xdc\x05\xb8\x71\xfc\x81\x52\x73\xff\x48\x10" "\xf9\x2f\x4b", "\xbf\x86\x46\x16\xc2\x34\x75\x09\xca\x9b\x10\x44\x63\x79\xb9\xbd\xbb" "\x3b\x8f\x64", - "\xa9\x7d\x25\xb4\x90\x39\x0b\x53\xc5\xdb\x91\xf6\xee\x2a\x15\xb8", 1, - 64, 160 }, - { 96, 128, 128, 13, - "\x38\x44\x98\x90\x23\x4e\xb8\xaf\xab\x0b\xbf\x82\xe2\x38\x54\x54", + "\xa9\x7d\x25\xb4\x90\x39\x0b\x53\xc5\xdb\x91\xf6\xee\x2a\x15\xb8", 1, 64, 160 }, + { 96, 128, 128, 13, "\x38\x44\x98\x90\x23\x4e\xb8\xaf\xab\x0b\xbf\x82\xe2\x38\x54\x54", "\x33\xe9\x06\x58\x41\x6e\x7c\x1a\x7c\x00\x5f\x11", "\x40\x20\x85\x5c\x66\xac\x45\x95\x05\x83\x95\xf3\x67\x20\x1c\x4c", "\xf7\x62\x77\x6b\xf8\x31\x63\xb3\x23\xca\x63\xa6\xb3\xad\xea\xc1\xe1" "\x35\x72\x62", "\xa6\xf2\xef\x3c\x7e\xf7\x4a\x12\x6d\xd2\xd5\xf6\x67\x39\x64\xe2\x7d" "\x5b\x34\xb6", - "\xb8\xbb\xdc\x4f\x50\x14\xbc\x75\x2c\x8b\x4e\x9b\x87\xf6\x50\xa3", 1, - 128, 160 }, - { 96, 128, 128, 14, - "\x6a\x68\x67\x1d\xfe\x32\x3d\x41\x98\x94\x38\x1f\x85\xeb\x63\xfd", + "\xb8\xbb\xdc\x4f\x50\x14\xbc\x75\x2c\x8b\x4e\x9b\x87\xf6\x50\xa3", 1, 128, 160 }, + { 96, 128, 128, 14, "\x6a\x68\x67\x1d\xfe\x32\x3d\x41\x98\x94\x38\x1f\x85\xeb\x63\xfd", "\x9f\x0d\x85\xb6\x05\x71\x1f\x34\xcd\x2a\x35\xba", "\x76\xeb\x5f\x14\x72\x50\xfa\x3c\x12\xbf\xf0\xa6\xe3\x93\x4a\x0b\x16" "\x86\x0c\xf1\x16\x46\x77\x3b", @@ -140,10 +109,8 @@ const struct aead_test aes_gcm_test_json[] = { "\x30\xaa\x37", "\xbd\x64\x80\x2c\xfe\xba\xeb\x48\x7d\x3a\x8f\x76\xce\x94\x3a\x37\xb3" "\x47\x2d\xd5", - "\xfc\xe9\xa5\xb5\x30\xc7\xd7\xaf\x71\x8b\xe1\xec\x0a\xe9\xed\x4d", 1, - 192, 160 }, - { 96, 128, 128, 15, - "\xe1\x22\x60\xfc\xd3\x55\xa5\x1a\x0d\x01\xbb\x1f\x6f\xa5\x38\xc2", + "\xfc\xe9\xa5\xb5\x30\xc7\xd7\xaf\x71\x8b\xe1\xec\x0a\xe9\xed\x4d", 1, 192, 160 }, + { 96, 128, 128, 15, "\xe1\x22\x60\xfc\xd3\x55\xa5\x1a\x0d\x01\xbb\x1f\x6f\xa5\x38\xc2", "\x5d\xfc\x37\x36\x6f\x56\x88\x27\x51\x47\xd3\xf9", "", "\xd9\x02\xde\xea\xb1\x75\xc0\x08\x32\x9a\x33\xbf\xac\xcd\x5c\x0e\xb3" "\xa6\xa1\x52\xa1\x51\x0e\x7d\xb0\x4f\xa0\xaf\xf7\xce\x42\x88\x53\x0d" @@ -153,10 +120,8 @@ const struct aead_test aes_gcm_test_json[] = { "\x09\x59\xaa\x67\xec\x66\x86\x9d\xc3\x99\x6c\x67\xa2\xd5\x59\xe7\xd7" "\x7c\xe5\x95\x5f\x8c\xad\x2a\x4d\xf5\xfd\xc3\xac\xcc\xaf\xa7\xbc\x0d" "\xef\x53\xd8\x48\x11\x12\x56\x90\x3e\x5a\xdd\x04\x20", - "\x8b\xc8\x33\xde\x51\x08\x63\xb4\xb4\x32\xc3\xcb\xf4\x5a\xa7\xcc", 1, - 0, 512 }, - { 96, 128, 128, 16, - "\x3c\x55\xf8\x8e\x9f\xaa\x0d\x68\xab\x50\xd0\x2b\x47\x16\x12\x76", + "\x8b\xc8\x33\xde\x51\x08\x63\xb4\xb4\x32\xc3\xcb\xf4\x5a\xa7\xcc", 1, 0, 512 }, + { 96, 128, 128, 16, "\x3c\x55\xf8\x8e\x9f\xaa\x0d\x68\xab\x50\xd0\x2b\x47\x16\x12\x76", "\xd7\x67\xc4\x8d\x20\x37\xb4\xbd\x2c\x23\x1b\xbd", "", "\x5d\x6a\xdd\x48\xe7\xa5\x70\x4e\x54\xf9\xc2\x82\x9a\x9b\x42\x83\xdc" "\xe0\xd3\xa6\x5b\x13\x3e\xba\x37\x93\xc4\xfb\xfa\x1d\x8e\x3a\x25\x39" @@ -174,10 +139,8 @@ const struct aead_test aes_gcm_test_json[] = { "\x5d\x46\xe0\x35\x33\x04\x83\xd8\x09\x7e\x80\xc7\xde\x9b\xbb\x60\x6d" "\xdf\x72\x3f\x29\x09\x21\x7f\xfd\xd1\x8e\x8b\xdb\xd7\xb0\x80\x62\xf1" "\xdc\xba\x96\x0e\x5c\x0d\x29\x0f\x5f", - "\x09\x0b\x8c\x2e\xc9\x8e\x41\x16\x18\x6d\x0e\x5f\xbe\xfe\xb9\xc2", 1, - 0, 1024 }, - { 96, 128, 128, 17, - "\xa2\x94\xe7\x0f\xa2\xac\x10\xa1\xfb\x00\xc5\x88\xb8\x88\xb6\x73", + "\x09\x0b\x8c\x2e\xc9\x8e\x41\x16\x18\x6d\x0e\x5f\xbe\xfe\xb9\xc2", 1, 0, 1024 }, + { 96, 128, 128, 17, "\xa2\x94\xe7\x0f\xa2\xac\x10\xa1\xfb\x00\xc5\x88\xb8\x88\xb6\x73", "\xdf\xe2\x0d\x1c\x43\x50\xe6\x23\x5d\x98\x7a\xf1", "", "\x6e\xd1\xd7\xd6\x18\xd1\x58\x74\x1f\x52\x07\x80\x06\xf2\x84\x94\xba" "\x72\xa2\x45\x4f\x27\x16\x0a\xe8\x72\x27\x93\xfc\xeb\xc5\x38\xeb\xc2" @@ -211,10 +174,8 @@ const struct aead_test aes_gcm_test_json[] = { "\x6d\x5a\xd4\xeb\x78\x75\x68\x27\x35\x8c\x3e\xf1\xfd\xbd\x07\xc3\x38" "\x34\xf3\xd9\xec\xa3\xff\x13\xb7\x44\xa0\x10\x59\xa6\xc1\x7a\x31\x5a" "\x8f\xd4", - "\xc7\x58\x7e\x7d\xa4\x1b\xed\x68\x2c\x37\x37\x7e\xa4\x32\x40\x29", 1, - 0, 2056 }, - { 96, 128, 128, 18, - "\xc4\xb0\x34\x35\xb9\x1f\xc5\x2e\x09\xef\xf2\x7e\x4d\xc3\xfb\x42", + "\xc7\x58\x7e\x7d\xa4\x1b\xed\x68\x2c\x37\x37\x7e\xa4\x32\x40\x29", 1, 0, 2056 }, + { 96, 128, 128, 18, "\xc4\xb0\x34\x35\xb9\x1f\xc5\x2e\x09\xef\xf2\x7e\x4d\xc3\xfb\x42", "\x50\x46\xe7\xe0\x8f\x07\x47\xe1\xef\xcc\xb0\x9e", "\x75\xfc\x90\x78\xb4\x88\xe9\x50\x3d\xcb\x56\x8c\x88\x2c\x9e\xec\x24" "\xd8\x0b\x04\xf0\x95\x8c\x82\xaa\xc8\x48\x4f\x02\x5c\x90\x43\x41\x48" @@ -224,10 +185,8 @@ const struct aead_test aes_gcm_test_json[] = { "\x11\x11\xc7", "\xb6\x78\x68\x12\x57\x4a\x25\x4e\xb4\x3b\x1c\xb1\xd1\x75\x35\x64\xc6" "\xb5\x20\xe9", - "\xad\x8c\x09\x61\x0d\x50\x8f\x3d\x0f\x03\xcc\x52\x3c\x0d\x5f\xcc", 1, - 512, 160 }, - { 96, 128, 128, 19, - "\x7e\x37\xd5\x6e\x6b\x1d\x01\x72\xd4\x0d\x64\xd6\x11\x1d\xd4\x24", + "\xad\x8c\x09\x61\x0d\x50\x8f\x3d\x0f\x03\xcc\x52\x3c\x0d\x5f\xcc", 1, 512, 160 }, + { 96, 128, 128, 19, "\x7e\x37\xd5\x6e\x6b\x1d\x01\x72\xd4\x0d\x64\xd6\x11\x1d\xd4\x24", "\x51\x7c\x55\xc2\xec\x9b\xfe\xa9\x0a\xdd\xc2\xbd", "\x8e\xd8\xa9\xbe\x4c\x3d\x32\xa5\x09\x84\x34\xee\x5c\x0c\x4f\xc2\x0f" "\x78\xef\x5e\x25\xed\x8b\x72\xa8\x40\xa4\x63\xe3\x6b\x67\xb8\x81\xe0" @@ -241,10 +200,8 @@ const struct aead_test aes_gcm_test_json[] = { "\xa2\x74\x30", "\xcf\xb6\x31\x79\x07\x67\xd0\x64\x5d\x8e\xc6\xf2\x3b\xf7\xfa\x8b\x19" "\xce\x79\xee", - "\xc5\x76\x7d\xda\xa7\x47\x15\x84\x46\x23\x17\x66\xbd\x20\x49\x0c", 1, - 1024, 160 }, - { 96, 128, 128, 20, - "\x30\x76\x74\x14\x08\xf7\x34\xce\x25\xd4\x8f\x98\x2e\x8b\x84\x4b", + "\xc5\x76\x7d\xda\xa7\x47\x15\x84\x46\x23\x17\x66\xbd\x20\x49\x0c", 1, 1024, 160 }, + { 96, 128, 128, 20, "\x30\x76\x74\x14\x08\xf7\x34\xce\x25\xd4\x8f\x98\x2e\x8b\x84\x4b", "\xa2\x71\x2e\xac\x5e\x06\xd3\xcc\x28\x64\xaa\x8b", "\x18\x52\x6e\x4e\xfd\x99\x5a\x0b\xf6\x40\x5d\x9f\x90\x67\x25\xc2\x90" "\x27\x89\x58\xd4\x95\x54\x97\x4d\x8f\xe0\x25\xe7\x86\x0d\xaa\x22\x5c" @@ -266,233 +223,166 @@ const struct aead_test aes_gcm_test_json[] = { "\x4c\x12\x7c", "\xe4\xd3\xf4\x89\x8c\xb3\xd9\x73\x26\x41\xd1\xf8\xd9\xd8\x89\xb2\xc9" "\x8a\xf9\x30", - "\x76\xd4\xfb\xb6\x9d\x52\x9b\x64\x17\x5b\x32\x8b\xe0\x0b\x10\x68", 1, - 2056, 160 }, - { 96, 128, 128, 21, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x76\xd4\xfb\xb6\x9d\x52\x9b\x64\x17\x5b\x32\x8b\xe0\x0b\x10\x68", 1, 2056, 160 }, + { 96, 128, 128, 21, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "\xeb\xd4\xa3\xe1\x0c\xf6\xd4\x1c\x50\xae\xae\x00\x75\x63\xb0\x72", "\xf6\x2d\x84\xd6\x49\xe5\x6b\xc8\xcf\xed\xc5\xd7\x4a\x51\xe2\xf7", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 0, 128 }, - { 96, 128, 128, 22, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 0, 128 }, + { 96, 128, 128, 22, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "\xd5\x93\xc4\xd8\x22\x4f\x1b\x10\x0c\x35\xe4\xf6\xc4\x00\x65\x43", "\x43\x1f\x31\xe6\x84\x09\x31\xfd\x95\xf9\x4b\xf8\x82\x96\xff\x69", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 0, 128 }, - { 96, 128, 128, 23, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 0, 128 }, + { 96, 128, 128, 23, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd9\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 24, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd9\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 24, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xda\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 25, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xda\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 25, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\x58\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 26, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x58\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 26, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x85\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 27, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x85\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 27, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\x3c\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 28, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\x3c\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 28, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x33\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 29, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x33\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 29, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x30\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 30, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x30\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 30, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\x69\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 31, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\x69\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 31, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x89\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 32, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x89\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 32, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x08\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 33, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x08\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 33, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xe7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 34, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xe7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 34, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7b\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 35, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7b\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 35, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x87\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 36, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x87\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 36, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x84\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 37, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x84\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 37, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x06\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 38, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x06\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 38, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x82", 0, - 0, 128 }, - { 96, 128, 128, 39, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x82", 0, 0, 128 }, + { 96, 128, 128, 39, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x81", 0, - 0, 128 }, - { 96, 128, 128, 40, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x81", 0, 0, 128 }, + { 96, 128, 128, 40, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\xc3", 0, - 0, 128 }, - { 96, 128, 128, 41, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\xc3", 0, 0, 128 }, + { 96, 128, 128, 41, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x03", 0, - 0, 128 }, - { 96, 128, 128, 42, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\xe9\x88\xc7\x7a\xd3\x86\x3e\x60\x03", 0, 0, 128 }, + { 96, 128, 128, 42, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd9\x84\x7d\xbc\x32\x6a\x06\xe9\x89\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 43, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd9\x84\x7d\xbc\x32\x6a\x06\xe9\x89\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 43, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\x3c\x32\x6a\x06\x69\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, - 0, 128 }, - { 96, 128, 128, 44, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\x3c\x32\x6a\x06\x69\x88\xc7\x7a\xd3\x86\x3e\x60\x83", 0, 0, 128 }, + { 96, 128, 128, 44, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd8\x84\x7d\xbc\x32\x6a\x06\x69\x88\xc7\x7a\xd3\x86\x3e\x60\x03", 0, - 0, 128 }, - { 96, 128, 128, 45, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd8\x84\x7d\xbc\x32\x6a\x06\x69\x88\xc7\x7a\xd3\x86\x3e\x60\x03", 0, 0, 128 }, + { 96, 128, 128, 45, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\x27\x7b\x82\x43\xcd\x95\xf9\x16\x77\x38\x85\x2c\x79\xc1\x9f\x7c", 0, - 0, 128 }, - { 96, 128, 128, 46, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x27\x7b\x82\x43\xcd\x95\xf9\x16\x77\x38\x85\x2c\x79\xc1\x9f\x7c", 0, 0, 128 }, + { 96, 128, 128, 46, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, 128 }, - { 96, 128, 128, 47, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, 128 }, + { 96, 128, 128, 47, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, 128 }, - { 96, 128, 128, 48, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, 128 }, + { 96, 128, 128, 48, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\x58\x04\xfd\x3c\xb2\xea\x86\x69\x08\x47\xfa\x53\x06\xbe\xe0\x03", 0, - 0, 128 }, - { 96, 128, 128, 49, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x58\x04\xfd\x3c\xb2\xea\x86\x69\x08\x47\xfa\x53\x06\xbe\xe0\x03", 0, 0, 128 }, + { 96, 128, 128, 49, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xeb\x15\x6d\x08\x1e\xd6\xb6\xb5\x5f\x46\x12\xf0\x21\xd8\x7b\x39", - "\xd9\x85\x7c\xbd\x33\x6b\x07\xe8\x89\xc6\x7b\xd2\x87\x3f\x61\x82", 0, - 0, 128 }, - { 64, 128, 128, 50, - "\xaa\x02\x3d\x04\x78\xdc\xb2\xb2\x31\x24\x98\x29\x3d\x9a\x91\x29", - "\x04\x32\xbc\x49\xac\x34\x41\x20", - "\xaa\xc3\x92\x31\x12\x98\x72\xa2", + "\xd9\x85\x7c\xbd\x33\x6b\x07\xe8\x89\xc6\x7b\xd2\x87\x3f\x61\x82", 0, 0, 128 }, + { 64, 128, 128, 50, "\xaa\x02\x3d\x04\x78\xdc\xb2\xb2\x31\x24\x98\x29\x3d\x9a\x91\x29", + "\x04\x32\xbc\x49\xac\x34\x41\x20", "\xaa\xc3\x92\x31\x12\x98\x72\xa2", "\x20\x35\xaf\x31\x3d\x13\x46\xab\x00\x15\x4f\xea\x78\x32\x21\x05", "\x64\xc3\x6b\xb3\xb7\x32\x03\x4e\x3a\x7d\x04\xef\xc5\x19\x77\x85", - "\xb7\xd0\xdd\x70\xb0\x0d\x65\xb9\x7c\xfd\x08\x0f\xf4\xb8\x19\xd1", 1, - 64, 128 }, - { 64, 128, 128, 51, - "\xf3\x43\x47\x25\xc8\x2a\x7f\x8b\xb0\x7d\xf1\xf8\x12\x2f\xb6\xc9", + "\xb7\xd0\xdd\x70\xb0\x0d\x65\xb9\x7c\xfd\x08\x0f\xf4\xb8\x19\xd1", 1, 64, 128 }, + { 64, 128, 128, 51, "\xf3\x43\x47\x25\xc8\x2a\x7f\x8b\xb0\x7d\xf1\xf8\x12\x2f\xb6\xc9", "\x28\xe9\xb7\x85\x17\x24\xba\xe3", "", "", "", - "\x44\xac\xa0\x0f\x42\xe4\x19\x9b\x82\x9a\x55\xe6\x9b\x07\x3d\x9e", 1, - 0, 0 }, - { 64, 128, 128, 52, - "\xde\xb6\x22\x33\x55\x9b\x57\x47\x66\x02\xb5\xad\xac\x57\xc7\x7f", + "\x44\xac\xa0\x0f\x42\xe4\x19\x9b\x82\x9a\x55\xe6\x9b\x07\x3d\x9e", 1, 0, 0 }, + { 64, 128, 128, 52, "\xde\xb6\x22\x33\x55\x9b\x57\x47\x66\x02\xb5\xad\xac\x57\xc7\x7f", "\xd0\x84\x54\x7d\xe5\x5b\xbc\x15", "", "\xd8\x98\x6d\xf0\x24\x1e\xd3\x29\x75\x82\xc0\xc2\x39\xc7\x24\xcb", "\x03\xe1\xa1\x68\xa7\xe3\x77\xa9\x13\x87\x9b\x29\x6a\x1b\x5f\x9c", - "\x32\x90\xaa\x95\xaf\x50\x5a\x74\x2f\x51\x7f\xab\xcc\x9b\x20\x94", 1, - 0, 128 }, - { 128, 128, 128, 53, - "\x20\x34\xa8\x25\x47\x27\x6c\x83\xdd\x32\x12\xa8\x13\x57\x2b\xce", + "\x32\x90\xaa\x95\xaf\x50\x5a\x74\x2f\x51\x7f\xab\xcc\x9b\x20\x94", 1, 0, 128 }, + { 128, 128, 128, 53, "\x20\x34\xa8\x25\x47\x27\x6c\x83\xdd\x32\x12\xa8\x13\x57\x2b\xce", "\x32\x54\x20\x2d\x85\x47\x34\x81\x23\x98\x12\x7a\x3d\x13\x44\x21", "\x1a\x02\x93\xd8\xf9\x02\x19\x05\x89\x02\x13\x90\x13\x90\x81\x90\xbc" "\x49\x08\x90\xd3\xff\x12\xa3", @@ -500,258 +390,189 @@ const struct aead_test aes_gcm_test_json[] = { "\x27\x7c\xe0\x48\x46\x21\x93", "\x64\x06\x9c\x2d\x58\x69\x05\x61\xf2\x7e\xe1\x99\xe6\xb4\x79\xb6\x36" "\x9e\xec\x68\x86\x72\xbd\xe9", - "\x9b\x7a\xba\xdd\x6e\x69\xc1\xd9\xec\x92\x57\x86\x53\x4f\x50\x75", 1, - 192, 192 }, - { 128, 128, 128, 54, - "\xb6\x7b\x1a\x6e\xfd\xd4\x0d\x37\x08\x0f\xbe\x8f\x80\x47\xae\xb9", - "\xfa\x29\x4b\x12\x99\x72\xf7\xfc\x5b\xbd\x5b\x96\xbb\xa8\x37\xc9", - "", "", "", - "\xa2\xcf\x26\x48\x15\x17\xec\x25\x08\x5c\x5b\x17\xd0\x78\x61\x83", 1, - 0, 0 }, - { 128, 128, 128, 55, - "\x20\x9e\x6d\xbf\x2a\xd2\x6a\x10\x54\x45\xfc\x02\x07\xcd\x9e\x9a", - "\x94\x77\x84\x9d\x6c\xcd\xfc\xa1\x12\xd9\x2e\x53\xfa\xe4\xa7\xca", - "", "\x01", "\xfd", - "\x03\x2d\xf7\xbb\xa5\xd8\xea\x1a\x14\xf1\x6f\x70\xbd\x0e\x14\xec", 1, - 0, 8 }, - { 128, 128, 128, 56, - "\xa5\x49\x44\x2e\x35\x15\x40\x32\xd0\x7c\x86\x66\x00\x6a\xa6\xa2", - "\x51\x71\x52\x45\x68\xe8\x1d\x97\xe8\xc4\xde\x4b\xa5\x6c\x10\xa0", - "", "\x11\x82\xe9\x35\x96\xca\xc5\x60\x89\x46\x40\x0b\xc7\x3f\x3a", + "\x9b\x7a\xba\xdd\x6e\x69\xc1\xd9\xec\x92\x57\x86\x53\x4f\x50\x75", 1, 192, 192 }, + { 128, 128, 128, 54, "\xb6\x7b\x1a\x6e\xfd\xd4\x0d\x37\x08\x0f\xbe\x8f\x80\x47\xae\xb9", + "\xfa\x29\x4b\x12\x99\x72\xf7\xfc\x5b\xbd\x5b\x96\xbb\xa8\x37\xc9", "", "", "", + "\xa2\xcf\x26\x48\x15\x17\xec\x25\x08\x5c\x5b\x17\xd0\x78\x61\x83", 1, 0, 0 }, + { 128, 128, 128, 55, "\x20\x9e\x6d\xbf\x2a\xd2\x6a\x10\x54\x45\xfc\x02\x07\xcd\x9e\x9a", + "\x94\x77\x84\x9d\x6c\xcd\xfc\xa1\x12\xd9\x2e\x53\xfa\xe4\xa7\xca", "", "\x01", "\xfd", + "\x03\x2d\xf7\xbb\xa5\xd8\xea\x1a\x14\xf1\x6f\x70\xbd\x0e\x14\xec", 1, 0, 8 }, + { 128, 128, 128, 56, "\xa5\x49\x44\x2e\x35\x15\x40\x32\xd0\x7c\x86\x66\x00\x6a\xa6\xa2", + "\x51\x71\x52\x45\x68\xe8\x1d\x97\xe8\xc4\xde\x4b\xa5\x6c\x10\xa0", "", + "\x11\x82\xe9\x35\x96\xca\xc5\x60\x89\x46\x40\x0b\xc7\x3f\x3a", "\x2f\x33\x30\x87\xbd\xca\x58\x21\x9f\x9b\xfc\x27\x3e\x45\xcc", - "\xe0\x6d\x1e\xf4\x73\x13\x29\x57\xad\x37\xea\xef\x29\x73\x3c\xa0", 1, - 0, 120 }, - { 128, 128, 128, 57, - "\xcf\xb4\xc2\x6f\x12\x6f\x6a\x0a\xcb\x8e\x4e\x22\x0f\x6c\x56\xcd", - "\x12\x75\x11\x54\x99\xae\x72\x22\x68\x51\x5b\xf0\xc1\x64\xb4\x9c", - "", + "\xe0\x6d\x1e\xf4\x73\x13\x29\x57\xad\x37\xea\xef\x29\x73\x3c\xa0", 1, 0, 120 }, + { 128, 128, 128, 57, "\xcf\xb4\xc2\x6f\x12\x6f\x6a\x0a\xcb\x8e\x4e\x22\x0f\x6c\x56\xcd", + "\x12\x75\x11\x54\x99\xae\x72\x22\x68\x51\x5b\xf0\xc1\x64\xb4\x9c", "", "\x09\xdf\xd7\xf0\x80\x27\x52\x57\xcf\x97\xe7\x6f\x96\x6b\x1a\xd9", "\xa7\x80\xbd\x01\xc8\x08\x85\x15\x6c\x88\xa9\x73\x26\x4c\x8e\xe5", - "\x2a\xde\xff\xa6\x82\xc8\xd8\xa8\x1f\xad\xa7\xd9\xfc\xdd\x2e\xe2", 1, - 0, 128 }, - { 128, 128, 128, 58, - "\x0b\x11\xef\x3a\x08\xc0\x29\x70\xf7\x42\x81\xc8\x60\x69\x1c\x75", - "\x95\xc1\xdd\x8c\x0f\x17\x05\xec\xe6\x89\x37\x90\x1f\x7a\xdd\x7b", - "", + "\x2a\xde\xff\xa6\x82\xc8\xd8\xa8\x1f\xad\xa7\xd9\xfc\xdd\x2e\xe2", 1, 0, 128 }, + { 128, 128, 128, 58, "\x0b\x11\xef\x3a\x08\xc0\x29\x70\xf7\x42\x81\xc8\x60\x69\x1c\x75", + "\x95\xc1\xdd\x8c\x0f\x17\x05\xec\xe6\x89\x37\x90\x1f\x7a\xdd\x7b", "", "\xf6\x93\xd4\xed\xd8\x25\xdb\xb0\x61\x8d\x91\x11\x31\x28\x88\x0d\xbe" "\xbb\x23\xe2\x5d\x00\xed\x1f\x07\x7d\x87\x0b\xe9\xcc\x75\x36", "\x7e\x47\xe1\x0f\xe3\xc6\xfb\xfa\x38\x17\x70\xea\xf5\xd4\x8d\x14\x82" "\xe7\x1e\x0c\x44\xdf\xf1\xe3\x0c\xa6\xf9\x5d\x92\x05\x20\x84", - "\xd0\x14\x44\xfa\x5d\x9c\x49\x96\x29\xd1\x74\xff\x39\x27\xa1\xac", 1, - 0, 256 }, - { 128, 128, 128, 59, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\xf9\x5f\xde\x4a\x75\x19\x13\x20\x2a\xee\xee\x32\xa0\xb5\x57\x53", - "", + "\xd0\x14\x44\xfa\x5d\x9c\x49\x96\x29\xd1\x74\xff\x39\x27\xa1\xac", 1, 0, 256 }, + { 128, 128, 128, 59, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\xf9\x5f\xde\x4a\x75\x19\x13\x20\x2a\xee\xee\x32\xa0\xb5\x57\x53", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x00\x07\x8d\x10\x9d\x92\x14\x3f\xcd\x5d\xf5\x67\x21\xb8\x84\xfa\xc6" "\x4a\xc7\x76\x2c\xc0\x9e\xea\x2a\x3c\x68\xe9\x2a\x17\xbd\xb5\x75\xf8" "\x7b\xda\x18\xbe\x56\x4e", - "\x15\x2a\x65\x04\x5f\xe6\x74\xf9\x76\x27\x42\x7a\xf5\xbe\x22\xda", 1, - 0, 320 }, - { 128, 128, 128, 60, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x7b\x95\xb8\xc3\x56\x81\x0a\x84\x71\x1d\x68\x15\x0a\x1b\x77\x50", - "", + "\x15\x2a\x65\x04\x5f\xe6\x74\xf9\x76\x27\x42\x7a\xf5\xbe\x22\xda", 1, 0, 320 }, + { 128, 128, 128, 60, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x7b\x95\xb8\xc3\x56\x81\x0a\x84\x71\x1d\x68\x15\x0a\x1b\x77\x50", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x84\xd4\xc9\xc0\x8b\x4f\x48\x28\x61\xe3\xa9\xc6\xc3\x5b\xc4\xd9\x1d" "\xf9\x27\x37\x45\x13\xbf\xd4\x9f\x43\x6b\xd7\x3f\x32\x52\x85\xda\xef" "\x4f\xf7\xe1\x3d\x46\xa6", - "\x21\x3a\x3c\xb9\x38\x55\xd1\x8e\x69\x33\x7e\xee\x66\xae\xec\x07", 1, - 0, 320 }, - { 128, 128, 128, 61, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x1a\x55\x2e\x67\xcd\xc4\xdc\x1a\x33\xb8\x24\x87\x4e\xbf\x0b\xed", - "", + "\x21\x3a\x3c\xb9\x38\x55\xd1\x8e\x69\x33\x7e\xee\x66\xae\xec\x07", 1, 0, 320 }, + { 128, 128, 128, 61, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x1a\x55\x2e\x67\xcd\xc4\xdc\x1a\x33\xb8\x24\x87\x4e\xbf\x0b\xed", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x94\x8c\xa3\x7a\x8e\x66\x49\xe8\x8a\xef\xfb\x1c\x59\x8f\x36\x07\x00" "\x77\x02\x41\x7e\xa0\xe0\xbc\x3c\x60\xad\x5a\x94\x98\x86\xde\x96\x8c" "\xf5\x3e\xa6\x46\x2a\xed", - "\x99\xb3\x81\xbf\xa2\xaf\x97\x51\xc3\x9d\x1b\x6e\x86\xd1\xbe\x6a", 1, - 0, 320 }, - { 128, 128, 128, 62, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\xdd\x9d\x0b\x4a\x0c\x3d\x68\x15\x24\xbf\xfc\xa3\x1d\x90\x76\x61", - "", + "\x99\xb3\x81\xbf\xa2\xaf\x97\x51\xc3\x9d\x1b\x6e\x86\xd1\xbe\x6a", 1, 0, 320 }, + { 128, 128, 128, 62, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\xdd\x9d\x0b\x4a\x0c\x3d\x68\x15\x24\xbf\xfc\xa3\x1d\x90\x76\x61", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x64\xb1\x93\x14\xc3\x1a\xf4\x5a\xcc\xdf\x7e\x3c\x4d\xb7\x9f\x0d\x94" "\x8c\xa3\x7a\x8e\x66\x49\xe8\x8a\xef\xfb\x1c\x59\x8f\x36\x07\x00\x77" "\x02\x41\x7e\xa0\xe0\xbc", - "\x52\x81\xef\xc7\xf1\x3a\xc8\xe1\x4c\xcf\x5d\xca\x7b\xfb\xfd\xd1", 1, - 0, 320 }, - { 128, 128, 128, 63, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x57\xc5\x64\x3c\x4e\x37\xb4\x04\x1d\xb7\x94\xcf\xe8\xe1\xf0\xf4", - "", + "\x52\x81\xef\xc7\xf1\x3a\xc8\xe1\x4c\xcf\x5d\xca\x7b\xfb\xfd\xd1", 1, 0, 320 }, + { 128, 128, 128, 63, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x57\xc5\x64\x3c\x4e\x37\xb4\x04\x1d\xb7\x94\xcf\xe8\xe1\xf0\xf4", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x2b\xb6\x9c\x3e\x5d\x1f\x91\x81\x5c\x6b\x87\xa0\xd5\xbb\xea\x71\x64" "\xb1\x93\x14\xc3\x1a\xf4\x5a\xcc\xdf\x7e\x3c\x4d\xb7\x9f\x0d\x94\x8c" "\xa3\x7a\x8e\x66\x49\xe8", - "\xa3\xea\x2c\x09\xee\x4f\x8c\x8a\x12\xf4\x5c\xdd\xf9\xae\xff\x81", 1, - 0, 320 }, - { 128, 128, 128, 64, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x99\x82\x1c\x2d\xd5\xda\xec\xde\xd0\x73\x00\xf5\x77\xf7\xaf\xf1", - "", + "\xa3\xea\x2c\x09\xee\x4f\x8c\x8a\x12\xf4\x5c\xdd\xf9\xae\xff\x81", 1, 0, 320 }, + { 128, 128, 128, 64, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x99\x82\x1c\x2d\xd5\xda\xec\xde\xd0\x73\x00\xf5\x77\xf7\xaf\xf1", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x12\x7a\xf9\xb3\x9e\xcd\xfc\x57\xbb\x11\xa2\x84\x7c\x7c\x2d\x3d\x8f" "\x93\x8f\x40\xf8\x77\xe0\xc4\xaf\x37\xd0\xfe\x9a\xf0\x33\x05\x2b\xd5" "\x37\xc4\xae\x97\x8f\x60", - "\x07\xeb\x2f\xe4\xa9\x58\xf8\x43\x4d\x40\x68\x48\x99\x50\x7c\x7c", 1, - 0, 320 }, - { 128, 128, 128, 65, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x5e\x4a\x39\x00\x14\x23\x58\xd1\xc7\x74\xd8\xd1\x24\xd8\xd2\x7d", - "", + "\x07\xeb\x2f\xe4\xa9\x58\xf8\x43\x4d\x40\x68\x48\x99\x50\x7c\x7c", 1, 0, 320 }, + { 128, 128, 128, 65, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x5e\x4a\x39\x00\x14\x23\x58\xd1\xc7\x74\xd8\xd1\x24\xd8\xd2\x7d", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x0c\xf6\xae\x47\x15\x6b\x14\xdc\xe0\x3c\x8a\x07\xa2\xe1\x72\xb1\x12" "\x7a\xf9\xb3\x9e\xcd\xfc\x57\xbb\x11\xa2\x84\x7c\x7c\x2d\x3d\x8f\x93" "\x8f\x40\xf8\x77\xe0\xc4", - "\xf1\x45\xc2\xdc\xaf\x33\x9e\xed\xe4\x27\xbe\x93\x43\x57\xea\xc0", 1, - 0, 320 }, - { 128, 128, 128, 66, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\xd4\x12\x56\x76\x56\x29\x84\xc0\xfe\x7c\xb0\xbd\xd1\xa9\x54\xe8", - "", + "\xf1\x45\xc2\xdc\xaf\x33\x9e\xed\xe4\x27\xbe\x93\x43\x57\xea\xc0", 1, 0, 320 }, + { 128, 128, 128, 66, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\xd4\x12\x56\x76\x56\x29\x84\xc0\xfe\x7c\xb0\xbd\xd1\xa9\x54\xe8", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xf0\xc6\xff\xc1\x8b\xd4\x6d\xf5\x56\x91\x85\xa9\xaf\xd1\x69\xeb\x0c" "\xf6\xae\x47\x15\x6b\x14\xdc\xe0\x3c\x8a\x07\xa2\xe1\x72\xb1\x12\x7a" "\xf9\xb3\x9e\xcd\xfc\x57", - "\xfa\xcd\x0b\xfe\x87\x01\xb7\xb4\xa2\xba\x96\xd9\x8a\xf5\x2b\xd9", 1, - 0, 320 }, - { 128, 128, 128, 67, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\xb9\x7e\xc6\x2a\x5e\x59\x00\xcc\xf9\xe4\xbe\x33\x2e\x33\x60\x91", - "", + "\xfa\xcd\x0b\xfe\x87\x01\xb7\xb4\xa2\xba\x96\xd9\x8a\xf5\x2b\xd9", 1, 0, 320 }, + { 128, 128, 128, 67, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\xb9\x7e\xc6\x2a\x5e\x59\x00\xcc\xf9\xe4\xbe\x33\x2e\x33\x60\x91", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xd6\x92\x8e\x09\x4c\x06\xe0\xa7\xc4\xdb\x42\x18\x4c\xf7\x52\x9e\x95" "\xde\x88\xb7\x67\xed\xeb\xe9\xb3\x43\x00\x0b\xe3\xda\xb4\x7e\xa0\x8b" "\x74\x42\x93\xee\xd6\x98", - "\xa0\x3e\x72\x9d\xcf\xd7\xa0\x31\x55\x65\x5f\xec\xe8\xaf\xfd\x7e", 1, - 0, 320 }, - { 128, 128, 128, 68, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x7e\xb6\xe3\x07\x9f\xa0\xb4\xc3\xee\xe3\x66\x17\x7d\x1c\x1d\x1d", - "", + "\xa0\x3e\x72\x9d\xcf\xd7\xa0\x31\x55\x65\x5f\xec\xe8\xaf\xfd\x7e", 1, 0, 320 }, + { 128, 128, 128, 68, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x7e\xb6\xe3\x07\x9f\xa0\xb4\xc3\xee\xe3\x66\x17\x7d\x1c\x1d\x1d", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xd8\x2c\xe5\x87\x71\xbf\x64\x87\x11\x6b\xf8\xe9\x64\x21\x87\x7e\xd6" "\x92\x8e\x09\x4c\x06\xe0\xa7\xc4\xdb\x42\x18\x4c\xf7\x52\x9e\x95\xde" "\x88\xb7\x67\xed\xeb\xe9", - "\x1e\x43\x92\x68\x28\xbc\x9a\x16\x14\xc7\xb1\x63\x90\x96\xc1\x95", 1, - 0, 320 }, - { 128, 128, 128, 69, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x03\x14\xfc\xd1\x0f\xdd\x67\x5d\x3c\x61\x29\x62\xc9\x31\xf6\x35", - "", + "\x1e\x43\x92\x68\x28\xbc\x9a\x16\x14\xc7\xb1\x63\x90\x96\xc1\x95", 1, 0, 320 }, + { 128, 128, 128, 69, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x03\x14\xfc\xd1\x0f\xdd\x67\x5d\x3c\x61\x29\x62\xc9\x31\xf6\x35", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xa1\x97\xa3\x7a\x5d\x79\x69\x70\x78\x53\x6b\xc2\x7f\xe4\x6c\xd8\xd4" "\x75\x52\x6d\x90\x44\xaa\x94\xf0\x88\xa0\x54\xf8\xe3\x80\xc6\x4f\x79" "\x41\x47\x95\xc6\x14\x80", - "\xf0\x8b\xad\xdf\x0b\x52\x85\xc9\x1f\xc0\x6a\x67\xfe\x47\x08\xca", 1, - 0, 320 }, - { 128, 128, 128, 70, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\xc4\xdc\xd9\xfc\xce\x24\xd3\x52\x2b\x66\xf1\x46\x9a\x1e\x8b\xb9", - "", + "\xf0\x8b\xad\xdf\x0b\x52\x85\xc9\x1f\xc0\x6a\x67\xfe\x47\x08\xca", 1, 0, 320 }, + { 128, 128, 128, 70, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\xc4\xdc\xd9\xfc\xce\x24\xd3\x52\x2b\x66\xf1\x46\x9a\x1e\x8b\xb9", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x14\x9f\xde\x9a\xbb\xd3\xa4\x3c\x25\x48\x57\x5e\x0d\xb9\xfb\x84\xa1" "\x97\xa3\x7a\x5d\x79\x69\x70\x78\x53\x6b\xc2\x7f\xe4\x6c\xd8\xd4\x75" "\x52\x6d\x90\x44\xaa\x94", - "\x62\xa4\xb6\x87\x5c\x28\x83\x45\xd6\xa4\x54\x39\x9e\xac\x1a\xfa", 1, - 0, 320 }, - { 128, 128, 128, 71, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "", + "\x62\xa4\xb6\x87\x5c\x28\x83\x45\xd6\xa4\x54\x39\x9e\xac\x1a\xfa", 1, 0, 320 }, + { 128, 128, 128, 71, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "\xbe\xc6\xfa\x05\xc1\x71\x8b\x9b\x84\xc4\x73\x45\xbb\xed\x7d\xcb", "\x45\xa3\xf8\x9d\x02\x91\x8b\xfd\x0c\x81\x61\x65\x8c\xcc\x97\x95", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 0, 128 }, - { 128, 128, 128, 72, - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 0, 128 }, + { 128, 128, 128, 72, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "\x4d\x82\x63\x9c\x39\xd3\xf3\x49\x0e\xe9\x03\xdd\x0b\xe7\xaf\xcf", "\x1c\xd5\xa0\x62\x14\x23\x5c\xeb\x04\x4d\x4b\xad\x7b\x04\x73\x12", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 0, 128 }, { 96, 256, 128, 73, "\x92\xac\xe3\xe3\x48\xcd\x82\x10\x92\xcd\x92\x1a\xa3\x54\x63\x74\x29" "\x9a\xb4\x62\x09\x69\x1b\xc2\x8b\x87\x52\xd1\x7f\x12\x3c\x20", - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb", - "\x00\x00\x00\x00\xff\xff\xff\xff", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09", - "\xe2\x7a\xbd\xd2\xd2\xa5\x3d\x2f\x13\x6b", - "\x9a\x4a\x25\x79\x52\x93\x01\xbc\xfb\x71\xc7\x8d\x40\x60\xf5\x2c", 1, - 64, 80 }, + "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb", "\x00\x00\x00\x00\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09", "\xe2\x7a\xbd\xd2\xd2\xa5\x3d\x2f\x13\x6b", + "\x9a\x4a\x25\x79\x52\x93\x01\xbc\xfb\x71\xc7\x8d\x40\x60\xf5\x2c", 1, 64, 80 }, { 96, 256, 128, 74, "\x29\xd3\xa4\x4f\x87\x23\xdc\x64\x02\x39\x10\x0c\x36\x54\x23\xa3\x12" "\x93\x4a\xc8\x02\x39\x21\x2a\xc3\xdf\x34\x21\xa2\x09\x81\x23", - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb", - "\xaa\xbb\xcc\xdd\xee\xff", "", "", - "\x2a\x7d\x77\xfa\x52\x6b\x82\x50\xcb\x29\x60\x78\x92\x6b\x50\x20", 1, - 48, 0 }, + "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb", "\xaa\xbb\xcc\xdd\xee\xff", "", "", + "\x2a\x7d\x77\xfa\x52\x6b\x82\x50\xcb\x29\x60\x78\x92\x6b\x50\x20", 1, 48, 0 }, { 96, 256, 128, 75, "\x80\xba\x31\x92\xc8\x03\xce\x96\x5e\xa3\x71\xd5\xff\x07\x3c\xf0\xf4" "\x3b\x6a\x2a\xb5\x76\xb2\x08\x42\x6e\x11\x40\x9c\x09\xb9\xb0", "\x4d\xa5\xbf\x8d\xfd\x58\x52\xc1\xea\x12\x37\x9d", "", "", "", - "\x47\x71\xa7\xc4\x04\xa4\x72\x96\x6c\xea\x8f\x73\xc8\xbf\xe1\x7a", 1, - 0, 0 }, + "\x47\x71\xa7\xc4\x04\xa4\x72\x96\x6c\xea\x8f\x73\xc8\xbf\xe1\x7a", 1, 0, 0 }, { 96, 256, 128, 76, "\xcc\x56\xb6\x80\x55\x2e\xb7\x50\x08\xf5\x48\x4b\x4c\xb8\x03\xfa\x50" "\x63\xeb\xd6\xea\xb9\x1f\x6a\xb6\xae\xf4\x91\x6a\x76\x62\x73", - "\x99\xe2\x3e\xc4\x89\x85\xbc\xcd\xee\xab\x60\xf1", "", "\x2a", - "\x06", - "\x63\x3c\x1e\x97\x03\xef\x74\x4f\xff\xfb\x40\xed\xf9\xd1\x43\x55", 1, - 0, 8 }, + "\x99\xe2\x3e\xc4\x89\x85\xbc\xcd\xee\xab\x60\xf1", "", "\x2a", "\x06", + "\x63\x3c\x1e\x97\x03\xef\x74\x4f\xff\xfb\x40\xed\xf9\xd1\x43\x55", 1, 0, 8 }, { 96, 256, 128, 77, "\x51\xe4\xbf\x2b\xad\x92\xb7\xaf\xf1\xa4\xbc\x05\x55\x0b\xa8\x1d\xf4" "\xb9\x6f\xab\xf4\x1c\x12\xc7\xb0\x0e\x60\xe4\x8d\xb7\xe1\x52", "\x4f\x07\xaf\xed\xfd\xc3\xb6\xc2\x36\x18\x23\xd3", "", - "\xbe\x33\x08\xf7\x2a\x2c\x6a\xed", - "\xcf\x33\x2a\x12\xfd\xee\x80\x0b", - "\x60\x2e\x8d\x7c\x47\x99\xd6\x2c\x14\x0c\x9b\xb8\x34\x87\x6b\x09", 1, - 0, 64 }, + "\xbe\x33\x08\xf7\x2a\x2c\x6a\xed", "\xcf\x33\x2a\x12\xfd\xee\x80\x0b", + "\x60\x2e\x8d\x7c\x47\x99\xd6\x2c\x14\x0c\x9b\xb8\x34\x87\x6b\x09", 1, 0, 64 }, { 96, 256, 128, 78, "\x67\x11\x96\x27\xbd\x98\x8e\xda\x90\x62\x19\xe0\x8c\x0d\x0d\x77\x9a" "\x07\xd2\x08\xce\x8a\x4f\xe0\x70\x9a\xf7\x55\xee\xec\x6d\xcb", "\x68\xab\x7f\xdb\xf6\x19\x01\xda\xd4\x61\xd2\x3c", "", "\x51\xf8\xc1\xf7\x31\xea\x14\xac\xdb\x21\x0a\x6d\x97\x3e\x07", "\x43\xfc\x10\x1b\xff\x4b\x32\xbf\xad\xd3\xda\xf5\x7a\x59\x0e", - "\xec\x04\xaa\xcb\x71\x48\xa8\xb8\xbe\x44\xcb\x7e\xaf\x4e\xfa\x69", 1, - 0, 120 }, + "\xec\x04\xaa\xcb\x71\x48\xa8\xb8\xbe\x44\xcb\x7e\xaf\x4e\xfa\x69", 1, 0, 120 }, { 96, 256, 128, 79, "\x59\xd4\xea\xfb\x4d\xe0\xcf\xc7\xd3\xdb\x99\xa8\xf5\x4b\x15\xd7\xb3" "\x9f\x0a\xcc\x8d\xa6\x97\x63\xb0\x19\xc1\x69\x9f\x87\x67\x4a", "\x2f\xcb\x1b\x38\xa9\x9e\x71\xb8\x47\x40\xad\x9b", "", "\x54\x9b\x36\x5a\xf9\x13\xf3\xb0\x81\x13\x1c\xcb\x6b\x82\x55\x88", "\xf5\x8c\x16\x69\x01\x22\xd7\x53\x56\x90\x7f\xd9\x6b\x57\x0f\xca", - "\x28\x75\x2c\x20\x15\x30\x92\x81\x8f\xab\xa2\xa3\x34\x64\x0d\x6e", 1, - 0, 128 }, + "\x28\x75\x2c\x20\x15\x30\x92\x81\x8f\xab\xa2\xa3\x34\x64\x0d\x6e", 1, 0, 128 }, { 96, 256, 128, 80, "\x3b\x24\x58\xd8\x17\x6e\x16\x21\xc0\xcc\x24\xc0\xc0\xe2\x4c\x1e\x80" "\xd7\x2f\x7e\xe9\x14\x9a\x4b\x16\x61\x76\x62\x96\x16\xd0\x11", @@ -760,8 +581,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x1f", "\x73\xa6\xb6\xf4\x5f\x6c\xcc\x51\x31\xe0\x7f\x2c\xaa\x1f\x2e\x2f" "\x56", - "\x2d\x73\x79\xec\x1d\xb5\x95\x2d\x4e\x95\xd3\x0c\x34\x0b\x1b\x1d", 1, - 0, 136 }, + "\x2d\x73\x79\xec\x1d\xb5\x95\x2d\x4e\x95\xd3\x0c\x34\x0b\x1b\x1d", 1, 0, 136 }, { 96, 256, 128, 81, "\x02\x12\xa8\xde\x50\x07\xed\x87\xb3\x3f\x1a\x70\x90\xb6\x11\x4f\x9e" "\x08\xce\xfd\x96\x07\xf2\xc2\x76\xbd\xcf\xdb\xc5\xce\x9c\xd7", @@ -770,8 +590,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x7e\xea\x69\x16\xd2\xb1\x11", "\x08\x43\xff\xf5\x2d\x93\x4f\xc7\xa0\x71\xea\x62\xc0\xbd\x35\x1c\xe8" "\x56\x78\xcd\xe3\xea\x2c\x9e", - "\x73\x55\xfd\xe5\x99\x00\x67\x15\x05\x38\x13\xce\x69\x62\x37\xa8", 1, - 0, 192 }, + "\x73\x55\xfd\xe5\x99\x00\x67\x15\x05\x38\x13\xce\x69\x62\x37\xa8", 1, 0, 192 }, { 96, 256, 128, 82, "\xb2\x79\xf5\x7e\x19\xc8\xf5\x3f\x2f\x96\x3f\x5f\x25\x19\xfd\xb7\xc1" "\x77\x9b\xe2\xca\x2b\x3a\xe8\xe1\x12\x8b\x7d\x6c\x62\x7f\xc4", @@ -780,19 +599,16 @@ const struct aead_test aes_gcm_test_json[] = { "\x78\x46\xd1", "\xeb\x55\x00\xe3\x82\x59\x52\x86\x6d\x91\x12\x53\xf8\xde\x86\x0c\x00" "\x83\x1c\x81", - "\xec\xb6\x60\xe1\xfb\x05\x41\xec\x41\xe8\xd6\x8a\x64\x14\x1b\x3a", 1, - 8, 160 }, + "\xec\xb6\x60\xe1\xfb\x05\x41\xec\x41\xe8\xd6\x8a\x64\x14\x1b\x3a", 1, 8, 160 }, { 96, 256, 128, 83, "\xcd\xcc\xfe\x3f\x46\xd7\x82\xef\x47\xdf\x4e\x72\xf0\xc0\x2d\x9c\x7f" "\x77\x4d\xef\x97\x0d\x23\x48\x6f\x11\xa5\x7f\x54\x24\x7f\x17", - "\x37\x61\x87\x89\x46\x05\xa8\xd4\x5e\x30\xde\x51", - "\x95\x68\x46\xa2\x09\xe0\x87\xed", + "\x37\x61\x87\x89\x46\x05\xa8\xd4\x5e\x30\xde\x51", "\x95\x68\x46\xa2\x09\xe0\x87\xed", "\xe2\x8e\x0e\x9f\x9d\x22\x46\x3a\xc0\xe4\x26\x39\xb5\x30\xf4\x21\x02" "\xfd\xed\x75", "\xfe\xca\x44\x95\x24\x47\x01\x5b\x5d\xf1\xf4\x56\xdf\x8c\xa4\xbb\x4e" "\xee\x2c\xe2", - "\x08\x2e\x91\x92\x4d\xee\xb7\x78\x80\xe1\xb1\xc8\x4f\x9b\x8d\x30", 1, - 64, 160 }, + "\x08\x2e\x91\x92\x4d\xee\xb7\x78\x80\xe1\xb1\xc8\x4f\x9b\x8d\x30", 1, 64, 160 }, { 96, 256, 128, 84, "\xf3\x23\x64\xb1\xd3\x39\xd8\x2e\x4f\x13\x2d\x8f\x4a\x0e\xc1\xff\x7e" "\x74\x65\x17\xfa\x07\xef\x1a\x7f\x42\x2f\x4e\x25\xa4\x81\x94", @@ -802,8 +618,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xc2\xdf\x8e", "\x43\xdd\xa8\x32\xe9\x42\xe2\x86\xda\x31\x4d\xaa\x99\xbe\xf5\x07\x1d" "\x9d\x2c\x78", - "\xc3\x92\x25\x83\x47\x6c\xed\x57\x54\x04\xdd\xb8\x5d\xd8\xcd\x44", 1, - 128, 160 }, + "\xc3\x92\x25\x83\x47\x6c\xed\x57\x54\x04\xdd\xb8\x5d\xd8\xcd\x44", 1, 128, 160 }, { 96, 256, 128, 85, "\xff\x00\x89\xee\x87\x0a\x4a\x39\xf6\x45\xb0\xa5\xda\x77\x4f\x7a\x59" "\x11\xe9\x69\x6f\xc9\xca\xd6\x46\x45\x2c\x2a\xa8\x59\x5a\x12", @@ -814,8 +629,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xfc\x2f\xf3", "\xa9\x29\xee\x7e\x67\xc7\xa2\xf9\x1b\xbc\xec\x63\x89\xa3\xca\xf4\x3a" "\xb4\x93\x05", - "\xeb\xec\x67\x74\xb9\x55\xe7\x89\x59\x1c\x82\x2d\xab\x73\x9e\x12", 1, - 192, 160 }, + "\xeb\xec\x67\x74\xb9\x55\xe7\x89\x59\x1c\x82\x2d\xab\x73\x9e\x12", 1, 192, 160 }, { 96, 256, 128, 86, "\x5b\x1d\x10\x35\xc0\xb1\x7e\xe0\xb0\x44\x47\x67\xf8\x0a\x25\xb8\xc1" "\xb7\x41\xf4\xb5\x0a\x4d\x30\x52\x22\x6b\xaa\x1c\x6f\xb7\x01", @@ -828,8 +642,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x3a\xe4\x17\xbc\x12\x5c\x38\x1c\xdf\x1c\x4d\xac\x18\x4e\xd1\xd8\x4f" "\x11\x96\x20\x6d\x62\xca\xd1\x12\xb0\x38\x84\x57\x20\xe0\x2c\x06\x11" "\x79\xa8\x83\x6f\x02\xb9\x3f\xa7\x00\x83\x79\xa6\xbf", - "\xf1\x56\x12\xf6\xc4\x0f\x2e\x0d\xb6\xdc\x76\xfc\x48\x22\xfc\xfe", 1, - 0, 512 }, + "\xf1\x56\x12\xf6\xc4\x0f\x2e\x0d\xb6\xdc\x76\xfc\x48\x22\xfc\xfe", 1, 0, 512 }, { 96, 256, 128, 87, "\xd7\xad\xdd\x38\x89\xfa\xdf\x8c\x89\x3e\xee\x14\xba\x2b\x7e\xa5\xbf" "\x56\xb4\x49\x90\x48\x69\x61\x5b\xd0\x5d\x5f\x11\x4c\xf3\x77", @@ -850,8 +663,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x9f\x56\x66\xaf\x34\xcf\xfc\xa0\x65\x73\xff\xb4\xf4\x7b\x02\xf5\x9f" "\x21\xc6\x43\x63\xda\xec\xb9\x77\xb4\x41\x5f\x19\xfd\xda\x3c\x9a\xae" "\x50\x66\xa5\x7b\x66\x9f\xfa\xa2\x57", - "\x5e\x63\x37\x4b\x51\x9e\x6c\x36\x08\x32\x19\x43\xd7\x90\xcf\x9a", 1, - 0, 1024 }, + "\x5e\x63\x37\x4b\x51\x9e\x6c\x36\x08\x32\x19\x43\xd7\x90\xcf\x9a", 1, 0, 1024 }, { 96, 256, 128, 88, "\x31\x7b\xa3\x31\x30\x7f\x3a\x3d\x3d\x82\xee\x1f\xda\xb7\x0f\x62\xa1" "\x55\xaf\x14\xda\xf6\x31\x30\x7a\x61\xb1\x87\xd4\x13\xe5\x33", @@ -888,8 +700,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xef\x52\xf8\xe0\x36\x98\x0d\x00\x70\xe2\x2e\x17\x3c\x67\xc4\xbb\xcc" "\xa6\x1c\xc1\xee\xdb\xd6\x01\x65\x16\xc5\x92\x14\x48\x19\xdf\x13\x20" "\x4d\xee", - "\xbf\x05\x40\xd3\x4b\x20\xf7\x61\x10\x1b\xc6\x08\xb0\x24\x58\xf2", 1, - 0, 2056 }, + "\xbf\x05\x40\xd3\x4b\x20\xf7\x61\x10\x1b\xc6\x08\xb0\x24\x58\xf2", 1, 0, 2056 }, { 96, 256, 128, 89, "\x2c\xe6\xb4\xc1\x5f\x85\xfb\x2d\xa5\xcc\x6c\x26\x94\x91\xee\xf2\x81" "\x98\x03\x09\x18\x12\x49\xeb\xf2\x83\x2b\xd6\xd0\x73\x2d\x0b", @@ -902,8 +713,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x66\xea\x3c", "\xae\xd5\x8d\x8a\x25\x2f\x74\x0d\xba\x4b\xf6\xd3\x67\x73\xbd\x5b\x41" "\x23\x4b\xba", - "\x01\xf9\x3d\x74\x56\xaa\x18\x4e\xbb\x49\xbe\xa4\x72\xb6\xd6\x5d", 1, - 512, 160 }, + "\x01\xf9\x3d\x74\x56\xaa\x18\x4e\xbb\x49\xbe\xa4\x72\xb6\xd6\x5d", 1, 512, 160 }, { 96, 256, 128, 90, "\x44\xc8\xd0\xcd\xb8\xf7\xe7\x36\xcf\xd9\x97\xc8\x72\xa5\xd9\xc5\xef" "\x30\xaf\xbe\x44\xb6\x56\x66\x06\xb9\x0a\xa5\xe3\xe8\xb7\x97", @@ -920,8 +730,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xe1\x94\x32", "\xb4\x24\x28\xf8\x09\x4e\xf7\xe6\x5c\x9e\x8c\x45\xef\x3e\x95\xc2\x8c" "\xe0\x7d\x72", - "\x32\xb2\x5d\xfb\xb8\x96\xd0\xf9\xd7\x9c\x82\x3b\xdd\x8e\x5d\x06", 1, - 1024, 160 }, + "\x32\xb2\x5d\xfb\xb8\x96\xd0\xf9\xd7\x9c\x82\x3b\xdd\x8e\x5d\x06", 1, 1024, 160 }, { 96, 256, 128, 91, "\xe4\x00\x03\xd6\xe0\x8a\xb8\x0b\x4b\xfc\x84\x00\xef\x11\x29\x45\xa9" "\x01\xec\x64\xa1\xb6\x53\x6c\xa9\x26\x65\x09\x0d\x60\x8b\xc4", @@ -946,509 +755,433 @@ const struct aead_test aes_gcm_test_json[] = { "\xaf\x29\x8d", "\xd4\xa7\x9f\x72\x94\x87\x93\x59\x50\xec\x03\x2e\x69\x0a\xb8\xfe\x25" "\xc4\x15\x8e", - "\x87\x6d\x2f\x33\x4f\x47\x96\x8b\x10\xc1\x03\x85\x9d\x43\x6d\xb8", 1, - 2056, 160 }, + "\x87\x6d\x2f\x33\x4f\x47\x96\x8b\x10\xc1\x03\x85\x9d\x43\x6d\xb8", 1, 2056, 160 }, { 96, 256, 128, 92, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "\x56\x10\x08\xfa\x07\xa6\x8f\x5c\x61\x28\x5c\xd0\x13\x46\x4e\xaf", "\x23\x29\x3e\x9b\x07\xca\x7d\x1b\x0c\xae\x7c\xc4\x89\xa9\x73\xb3", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 0, 128 }, { 96, 256, 128, 93, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "\xc6\x15\x22\x44\xce\xa1\x97\x8d\x3e\x0b\xc2\x74\xcf\x8c\x0b\x3b", "\x7c\xb6\xfc\x7c\x6a\xbc\x00\x9e\xfe\x95\x51\xa9\x9f\x36\xa4\x21", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 0, 128 }, { 96, 256, 128, 94, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9d\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9d\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 95, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9e\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9e\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 96, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x1c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x1c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 97, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe9\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe9\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 98, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\x76\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\x76\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 99, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd9\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd9\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 100, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xda\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xda\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 101, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\x71\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\x71\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 102, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbe\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbe\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 103, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\x3f\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\x3f\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 104, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\xa8\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\xa8\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 105, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x73\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x73\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 106, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xeb\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xeb\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 107, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xe8\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xe8\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 108, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\x6a\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\x6a\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 109, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdc", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdc", 0, 0, 128 }, { 96, 256, 128, 110, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdf", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\xdf", 0, 0, 128 }, { 96, 256, 128, 111, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\x9d", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\x9d", 0, 0, 128 }, { 96, 256, 128, 112, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\x5d", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbf\x88\x72\x32\xea\xb5\x90\x5d", 0, 0, 128 }, { 96, 256, 128, 113, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9d\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbe\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9d\xe8\xfe\xf6\xd8\xab\x1b\xf1\xbe\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 114, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\x76\xd8\xab\x1b\x71\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, - 0, 128 }, + "\x9c\xe8\xfe\x76\xd8\xab\x1b\x71\xbf\x88\x72\x32\xea\xb5\x90\xdd", 0, 0, 128 }, { 96, 256, 128, 115, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9c\xe8\xfe\xf6\xd8\xab\x1b\x71\xbf\x88\x72\x32\xea\xb5\x90\x5d", 0, - 0, 128 }, + "\x9c\xe8\xfe\xf6\xd8\xab\x1b\x71\xbf\x88\x72\x32\xea\xb5\x90\x5d", 0, 0, 128 }, { 96, 256, 128, 116, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x63\x17\x01\x09\x27\x54\xe4\x0e\x40\x77\x8d\xcd\x15\x4a\x6f\x22", 0, - 0, 128 }, + "\x63\x17\x01\x09\x27\x54\xe4\x0e\x40\x77\x8d\xcd\x15\x4a\x6f\x22", 0, 0, 128 }, { 96, 256, 128, 117, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, 128 }, { 96, 256, 128, 118, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, 128 }, { 96, 256, 128, 119, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x1c\x68\x7e\x76\x58\x2b\x9b\x71\x3f\x08\xf2\xb2\x6a\x35\x10\x5d", 0, - 0, 128 }, + "\x1c\x68\x7e\x76\x58\x2b\x9b\x71\x3f\x08\xf2\xb2\x6a\x35\x10\x5d", 0, 0, 128 }, { 96, 256, 128, 120, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\xb2\x06\x14\x57\xc0\x75\x9f\xc1\x74\x9f\x17\x4e\xe1\xcc\xad\xfa", - "\x9d\xe9\xff\xf7\xd9\xaa\x1a\xf0\xbe\x89\x73\x33\xeb\xb4\x91\xdc", 0, - 0, 128 }, + "\x9d\xe9\xff\xf7\xd9\xaa\x1a\xf0\xbe\x89\x73\x33\xeb\xb4\x91\xdc", 0, 0, 128 }, { 128, 192, 128, 121, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\x02\x9e\x0e\x77\x7d\xb0\x92\xb1\x25\x35\xd0\x43\x01\x2f\x09\xba", - "", + "\x02\x9e\x0e\x77\x7d\xb0\x92\xb1\x25\x35\xd0\x43\x01\x2f\x09\xba", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xf8\x3c\xee\x46\x73\x36\xe1\xa0\x9b\x75\xf2\x4e\x9b\x43\x85\xc9\x9c" "\x13\xe6\xaf\x72\x22\x56\xa6\x61\x29\xec\xe9\x61\xfe\x80\x3b\x16\x7b" "\xad\x20\x6f\x50\x17\xfb", - "\x09\x33\x8a\x42\xf0\xac\xc1\x4f\x97\xc0\x64\xf5\x2f\x5f\x16\x88", 1, - 0, 320 }, + "\x09\x33\x8a\x42\xf0\xac\xc1\x4f\x97\xc0\x64\xf5\x2f\x5f\x16\x88", 1, 0, 320 }, { 128, 192, 128, 122, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\xf1\xbe\x3b\x06\xb7\xfe\xac\x07\xe7\xea\xb6\x29\xf5\x56\x04\x7b", - "", + "\xf1\xbe\x3b\x06\xb7\xfe\xac\x07\xe7\xea\xb6\x29\xf5\x56\x04\x7b", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x0b\x32\xb6\x48\xa2\xc2\x8e\x9e\xdd\x7c\xee\x08\xee\xeb\x90\x00\x34" "\xca\xe7\x21\x5e\x5a\xb1\xe2\x01\xbd\x2e\xed\x10\x32\xc5\xa9\x78\x66" "\xba\x58\x2a\x34\x58\xa4", - "\x90\xbe\x36\x06\xde\x58\xbd\x77\x8f\xa5\xbe\xff\x4a\x41\x02\xbd", 1, - 0, 320 }, + "\x90\xbe\x36\x06\xde\x58\xbd\x77\x8f\xa5\xbe\xff\x4a\x41\x02\xbd", 1, 0, 320 }, { 128, 192, 128, 123, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\xde\x9e\xb6\x3b\x1d\xae\xd3\x21\xa1\x1b\x75\x47\xcc\x9e\x22\x3c", - "", + "\xde\x9e\xb6\x3b\x1d\xae\xd3\x21\xa1\x1b\x75\x47\xcc\x9e\x22\x3c", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x57\x5e\x2e\xce\xc2\xb3\xc7\x2d\x4e\x80\x83\x0d\x0d\x85\x9a\xd9\xe4" "\x2c\x29\xc4\xa6\x8d\x8d\x9d\x8d\x23\x43\x4d\xe2\xcd\x07\x73\x3b\xe4" "\x9d\x62\xac\x1a\xe0\x85", - "\x6e\x4d\x63\x96\x12\x5a\x10\xdf\x54\x43\xbd\x0c\xbc\x85\x66\xd1", 1, - 0, 320 }, + "\x6e\x4d\x63\x96\x12\x5a\x10\xdf\x54\x43\xbd\x0c\xbc\x85\x66\xd1", 1, 0, 320 }, { 128, 192, 128, 124, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\x40\xbb\x0a\xbe\xbc\x48\x3f\xf6\xd5\x67\x12\x41\xff\x5d\x66\xc6", - "", + "\x40\xbb\x0a\xbe\xbc\x48\x3f\xf6\xd5\x67\x12\x41\xff\x5d\x66\xc6", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x2a\x81\x88\x88\xd1\xf0\x9f\x32\xaa\x7b\xee\xdd\x28\x69\xb4\x46\x57" "\x5e\x2e\xce\xc2\xb3\xc7\x2d\x4e\x80\x83\x0d\x0d\x85\x9a\xd9\xe4\x2c" "\x29\xc4\xa6\x8d\x8d\x9d", - "\xdc\x48\x1f\x17\x25\x45\x26\x8e\xff\x63\xab\x04\x90\x40\x3d\xc3", 1, - 0, 320 }, + "\xdc\x48\x1f\x17\x25\x45\x26\x8e\xff\x63\xab\x04\x90\x40\x3d\xc3", 1, 0, 320 }, { 128, 192, 128, 125, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\x20\xd5\xcf\x30\x5e\x63\x0a\x8f\x49\xe3\xbb\x4b\xab\x18\xab\xc9", - "", + "\x20\xd5\xcf\x30\x5e\x63\x0a\x8f\x49\xe3\xbb\x4b\xab\x18\xab\xc9", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x96\xd3\x6b\x79\x5f\x8e\x7e\xdf\x6a\x8e\x0d\xbc\xd2\x0d\x6c\x07\x2a" "\x81\x88\x88\xd1\xf0\x9f\x32\xaa\x7b\xee\xdd\x28\x69\xb4\x46\x57\x5e" "\x2e\xce\xc2\xb3\xc7\x2d", - "\x8a\x3a\x22\xbf\x25\x92\x95\x8b\x93\x02\x92\xaa\x47\xf5\x90\xe8", 1, - 0, 320 }, + "\x8a\x3a\x22\xbf\x25\x92\x95\x8b\x93\x02\x92\xaa\x47\xf5\x90\xe8", 1, 0, 320 }, { 128, 192, 128, 126, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\x25\x53\x58\xa7\x1a\x0e\x57\x31\xf6\xdd\x6c\xe2\x8e\x15\x8a\xe6", - "", + "\x25\x53\x58\xa7\x1a\x0e\x57\x31\xf6\xdd\x6c\xe2\x8e\x15\x8a\xe6", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xcf\xce\x3d\x92\x0f\x0e\x01\xf0\xbb\x49\xa7\x51\x95\x5b\x23\x6d\x1b" "\x88\x7b\xae\xfd\x25\xc4\x7f\x41\x30\x3c\x46\xd5\xc7\xbf\x9c\xa4\xc2" "\xc4\x5a\x8f\x1e\x66\x56", - "\x2d\xb9\xdc\x1b\x7f\xd3\x15\xdf\x1c\x95\x43\x24\x32\xfc\xf4\x74", 1, - 0, 320 }, + "\x2d\xb9\xdc\x1b\x7f\xd3\x15\xdf\x1c\x95\x43\x24\x32\xfc\xf4\x74", 1, 0, 320 }, { 128, 192, 128, 127, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\xbb\x76\xe4\x22\xbb\xe8\xbb\xe6\x82\xa1\x0b\xe4\xbd\xd6\xce\x1c", - "", + "\xbb\x76\xe4\x22\xbb\xe8\xbb\xe6\x82\xa1\x0b\xe4\xbd\xd6\xce\x1c", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x69\xa2\x41\x69\x79\x2e\x9a\x07\xf6\xe6\xf4\x73\x6f\xa9\x72\xdc\xcf" "\xce\x3d\x92\x0f\x0e\x01\xf0\xbb\x49\xa7\x51\x95\x5b\x23\x6d\x1b\x88" "\x7b\xae\xfd\x25\xc4\x7f", - "\x82\xad\x96\x7f\x7a\xc1\x90\x84\x35\x4f\x69\xa7\x51\x44\x3f\xb2", 1, - 0, 320 }, + "\x82\xad\x96\x7f\x7a\xc1\x90\x84\x35\x4f\x69\xa7\x51\x44\x3f\xb2", 1, 0, 320 }, { 128, 192, 128, 128, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\xdb\x18\x21\xac\x59\xc3\x8e\x9f\x1e\x25\xa2\xee\xe9\x93\x03\x13", - "", + "\xdb\x18\x21\xac\x59\xc3\x8e\x9f\x1e\x25\xa2\xee\xe9\x93\x03\x13", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x4e\x44\x17\xa8\x3b\xea\xc1\xeb\x7e\x24\x45\x6a\x05\xf6\xba\x55\x69" "\xa2\x41\x69\x79\x2e\x9a\x07\xf6\xe6\xf4\x73\x6f\xa9\x72\xdc\xcf\xce" "\x3d\x92\x0f\x0e\x01\xf0", - "\x47\x2d\x5d\xd5\x82\xdc\x05\xef\x5f\xc4\x96\xb6\x12\x02\x3c\xb2", 1, - 0, 320 }, + "\x47\x2d\x5d\xd5\x82\xdc\x05\xef\x5f\xc4\x96\xb6\x12\x02\x3c\xb2", 1, 0, 320 }, { 128, 192, 128, 129, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\xf7\xa0\x2e\xcc\xa0\x30\x64\xb2\xef\x3c\xce\x9f\xea\xb7\x9f\x07", - "", + "\xf7\xa0\x2e\xcc\xa0\x30\x64\xb2\xef\x3c\xce\x9f\xea\xb7\x9f\x07", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x6f\x8e\x17\x4e\xfc\xa3\x09\x72\x99\xf7\x84\xef\xd4\xca\xff\x0b\xf1" "\x68\xc3\xe5\x16\x5b\x9a\xd3\xd2\x00\x62\x00\x98\x48\x04\x4e\xef\x8f" "\x31\xf7\xd2\xfe\xad\x05", - "\xca\xff\x72\x38\x26\xdf\x15\x09\x34\xae\xe3\x20\x1b\xa1\x75\xe7", 1, - 0, 320 }, + "\xca\xff\x72\x38\x26\xdf\x15\x09\x34\xae\xe3\x20\x1b\xa1\x75\xe7", 1, 0, 320 }, { 128, 192, 128, 130, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\x69\x85\x92\x49\x01\xd6\x88\x65\x9b\x40\xa9\x99\xd9\x74\xdb\xfd", - "", + "\x69\x85\x92\x49\x01\xd6\x88\x65\x9b\x40\xa9\x99\xd9\x74\xdb\xfd", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xaf\x19\x30\x90\xce\x3d\x43\xa3\x88\xa1\xd2\x94\xa0\x96\x16\x90\x6f" "\x8e\x17\x4e\xfc\xa3\x09\x72\x99\xf7\x84\xef\xd4\xca\xff\x0b\xf1\x68" "\xc3\xe5\x16\x5b\x9a\xd3", - "\x3b\x08\x95\x8b\xe1\x28\x6c\x2b\x4a\xcb\xa0\x2b\x36\x74\xad\xb2", 1, - 0, 320 }, + "\x3b\x08\x95\x8b\xe1\x28\x6c\x2b\x4a\xcb\xa0\x2b\x36\x74\xad\xb2", 1, 0, 320 }, { 128, 192, 128, 131, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\x3f\x11\x88\x54\x6c\x65\xed\x0f\xc5\x5e\x75\x03\x2c\x68\xee\x44", - "", + "\x3f\x11\x88\x54\x6c\x65\xed\x0f\xc5\x5e\x75\x03\x2c\x68\xee\x44", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x5d\xec\xcf\x83\x8b\x2c\xf5\xf8\x69\xc9\x0d\x2a\x61\x11\x60\xb1\xe5" "\x78\xab\x81\x21\xb9\x37\x35\xcb\xa4\xa1\x93\x06\x47\xb8\xc4\xc8\x4b" "\xf7\x76\x33\x3e\xe4\x5a", - "\xc1\x4d\x52\x20\x8f\x0f\x51\xb8\x16\xa4\x89\x71\xea\xf8\xff\x7e", 1, - 0, 320 }, + "\xc1\x4d\x52\x20\x8f\x0f\x51\xb8\x16\xa4\x89\x71\xea\xf8\xff\x7e", 1, 0, 320 }, { 128, 192, 128, 132, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\xa1\x34\x34\xd1\xcd\x83\x01\xd8\xb1\x22\x12\x05\x1f\xab\xaa\xbe", - "", + "\xa1\x34\x34\xd1\xcd\x83\x01\xd8\xb1\x22\x12\x05\x1f\xab\xaa\xbe", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xd2\xca\xe1\x68\x4a\xa4\x07\xa1\x3a\x2e\x2d\xa5\x35\x7e\x29\xf5\x5d" "\xec\xcf\x83\x8b\x2c\xf5\xf8\x69\xc9\x0d\x2a\x61\x11\x60\xb1\xe5\x78" "\xab\x81\x21\xb9\x37\x35", - "\xea\x2d\x01\x80\x99\xcd\x79\x25\xc5\x07\xce\xf0\xce\xdd\xb0\xae", 1, - 0, 320 }, + "\xea\x2d\x01\x80\x99\xcd\x79\x25\xc5\x07\xce\xf0\xce\xdd\xb0\xae", 1, 0, 320 }, { 128, 192, 128, 133, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "\x5c\x7d\x3f\x81\xd4\xb5\x05\x5e\xd6\xf8\xdb\x53\x61\x45\x87\xa4", "\x54\x1b\x83\x5d\xc8\x28\xd5\x41\x07\x3f\x7d\x7d\x75\x04\xeb\xf5", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 0, 128 }, { 128, 192, 128, 134, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "\x6a\x34\x7a\xd1\x19\x0e\x72\xed\xe6\x11\x04\x4e\x74\x75\xf0\xeb", "\xa3\xf3\x61\x54\x33\x1c\x19\x66\x24\x56\x4b\xc3\x95\xe4\x9c\x3b", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 0, 128 }, { 128, 192, 128, 135, "\xfa\xe2\xa1\x41\x97\xc7\xd1\x14\x00\x61\xfe\x7c\x3d\x11\xd9\xf7\x7c" "\x79\x56\x2e\x35\x93\xa9\x9b", - "\xbc\x28\x43\x39\x53\x77\x2d\x57\xbb\xd9\x33\x10\x0c\xd4\x7a\x56", - "", "", "", - "\x1b\xb9\x43\x31\xf2\x6c\xad\x24\x03\x6c\xfe\xff\x34\xb8\x9a\xaf", 1, - 0, 0 }, + "\xbc\x28\x43\x39\x53\x77\x2d\x57\xbb\xd9\x33\x10\x0c\xd4\x7a\x56", "", "", "", + "\x1b\xb9\x43\x31\xf2\x6c\xad\x24\x03\x6c\xfe\xff\x34\xb8\x9a\xaf", 1, 0, 0 }, { 128, 192, 128, 136, "\xce\xe9\xab\xbc\x26\xb6\x3e\x16\x9f\x0c\xed\x62\x1f\xe2\x1d\x95\x90" "\x4e\x75\xb8\x81\xd9\x3e\x6b", - "\x1e\x82\x59\xe0\xa4\x3e\x57\x10\x68\xf7\x01\xcd\x20\x64\xfc\x0c", - "", "\x46", "\xdc", - "\xaf\x1f\x55\x35\xb1\x25\xb3\x4f\xc4\x66\x90\x2e\xa4\x0c\xb3\xa2", 1, - 0, 8 }, + "\x1e\x82\x59\xe0\xa4\x3e\x57\x10\x68\xf7\x01\xcd\x20\x64\xfc\x0c", "", "\x46", "\xdc", + "\xaf\x1f\x55\x35\xb1\x25\xb3\x4f\xc4\x66\x90\x2e\xa4\x0c\xb3\xa2", 1, 0, 8 }, { 128, 192, 128, 137, "\x18\x9f\x0b\xd3\x90\xba\x40\x63\x25\x86\xa4\x5c\x39\x73\x5c\x2b\x87" "\x11\x33\x29\xc8\x00\xf3\x94", - "\xc8\x44\x42\xd6\x97\x5f\x03\x59\x73\x7d\xe0\xfa\x82\x8f\x95\x8e", - "", "\xb4\xbc\xd7\xb8\xee\xca\x30\x50\xdd\x17\x68\x2c\x6a\x91\x4e", + "\xc8\x44\x42\xd6\x97\x5f\x03\x59\x73\x7d\xe0\xfa\x82\x8f\x95\x8e", "", + "\xb4\xbc\xd7\xb8\xee\xca\x30\x50\xdd\x17\x68\x2c\x6a\x91\x4e", "\x2a\xab\x5c\x87\xdc\xb4\xa4\xda\xe4\xe9\x75\xdd\xb6\x5a\xab", - "\x6b\x03\xb7\x55\x7c\x71\x31\xe2\x35\x2e\x49\x5d\x54\xe6\x1a\xef", 1, - 0, 120 }, + "\x6b\x03\xb7\x55\x7c\x71\x31\xe2\x35\x2e\x49\x5d\x54\xe6\x1a\xef", 1, 0, 120 }, { 128, 192, 128, 138, "\xb0\x72\x4f\x15\xdf\x5b\x79\x2c\x2f\x49\xbc\x51\xdf\x0a\xc5\xaa\xd6" "\x9b\xe0\x03\x09\x81\x61\x3c", - "\x13\xcd\x52\x6e\xc7\x7b\x58\xf6\x2d\x48\xd0\x3f\x8b\x88\xf2\xb8", - "", + "\x13\xcd\x52\x6e\xc7\x7b\x58\xf6\x2d\x48\xd0\x3f\x8b\x88\xf2\xb8", "", "\x8d\xa3\xab\x9c\x3d\x19\x5b\x04\xdf\x45\x2a\xd2\x39\x53\xda\x4d", "\xd1\x27\xfd\x2e\x67\xc0\x88\x7d\x90\xeb\x92\xb9\x1f\x35\x7d\x97", - "\xeb\x05\xbd\xa9\x37\xfa\xee\xd2\x7f\x88\x33\x29\x5d\x4b\xa5\x59", 1, - 0, 128 }, + "\xeb\x05\xbd\xa9\x37\xfa\xee\xd2\x7f\x88\x33\x29\x5d\x4b\xa5\x59", 1, 0, 128 }, { 128, 192, 128, 139, "\x99\x87\x50\xba\x78\x48\x41\xe4\x0a\x7c\x5b\x03\x98\x57\x32\xb6\x39" "\x7e\x54\x59\xa3\x84\x39\x54", - "\x1d\x3d\x62\xec\xcd\x8a\xc5\xe8\x96\xf2\x65\x4a\x7f\x60\x6f\xc9", - "", + "\x1d\x3d\x62\xec\xcd\x8a\xc5\xe8\x96\xf2\x65\x4a\x7f\x60\x6f\xc9", "", "\x2f\x60\xca\x34\x94\xa9\x58\xdc\x3e\x6e\xbe\xb5\xd0\xb4\xe6\xdd\xa0" "\xd0\xc4\x33\x1a\xb9\xc9\x57\xf6\x42\x2a\x51\x00\x87\x8e\xbf", "\x34\x4c\x2c\xea\x17\xb0\x6c\xb3\xda\x27\x2e\x22\xa2\x2a\x3a\x71\xee" "\x0e\xaa\x19\x59\xa7\xfa\xcf\xff\x46\x46\x60\xdd\xcc\xed\xd1", - "\xba\xb7\xfb\xf4\x99\xff\x06\xaa\xd5\xf7\x57\xb1\xc1\xa4\xfc\xc0", 1, - 0, 256 }, + "\xba\xb7\xfb\xf4\x99\xff\x06\xaa\xd5\xf7\x57\xb1\xc1\xa4\xfc\xc0", 1, 0, 256 }, { 96, 192, 128, 140, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "\x0b\x4d\xbb\xba\x89\x82\xe0\xf6\x49\xf8\xba\x85\xf3\xaa\x06\x1b", "\x3f\x87\x5c\x9b\xd7\xd8\x51\x14\x48\x45\x94\x68\xe3\x98\xc3\xb2", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 0, 128 }, { 96, 192, 128, 141, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "\x1a\xe9\x36\x88\xef\x7e\x26\x50\xa9\x34\x2a\xd4\x71\x8b\x27\x80", "\x21\x0d\xab\xea\x43\x64\xc6\xd5\xb3\x42\x9e\x77\x43\x32\x29\x36", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 0, 128 }, { 96, 192, 128, 142, "\x50\x19\xeb\x9f\xef\x82\xe5\x75\x0b\x63\x17\x58\xf0\x21\x3e\x3e\x5f" "\xcc\xa1\x27\x48\xb4\x0e\xb4", "\xff\x0d\xdb\x0a\x0d\x7b\x36\xd2\x19\xda\x12\xb5", "", "", "", - "\x79\x71\x28\x4e\x6c\x9e\x6a\xac\x34\x6f\xe2\xb7\xa0\xa0\x64\xc2", 1, - 0, 0 }, + "\x79\x71\x28\x4e\x6c\x9e\x6a\xac\x34\x6f\xe2\xb7\xa0\xa0\x64\xc2", 1, 0, 0 }, { 96, 192, 128, 143, "\x21\x21\x8a\xf7\x90\x42\x8f\x80\x24\xd3\xe7\xe1\x42\x8c\x9f\xcf\x57" "\x8c\x21\x66\x36\xd6\x0e\x73", - "\x34\x04\x7b\xc3\x9b\x9c\x60\x83\x84\xdf\xf5\xb8", "", "\xe3", - "\xfe", - "\x2e\x98\x2e\x24\xb8\x1c\xd1\x20\xd3\x5a\x70\xfe\x69\x35\xe6\x65", 1, - 0, 8 }, + "\x34\x04\x7b\xc3\x9b\x9c\x60\x83\x84\xdf\xf5\xb8", "", "\xe3", "\xfe", + "\x2e\x98\x2e\x24\xb8\x1c\xd1\x20\xd3\x5a\x70\xfe\x69\x35\xe6\x65", 1, 0, 8 }, { 96, 192, 128, 144, "\x3a\x8b\xf5\x43\xc4\x80\x92\x56\x32\x11\x82\x45\xbc\xbf\x5d\x01\x52" "\x2b\x98\x7a\x31\xa3\x3d\xa3", "\x4e\xbc\x13\xcf\x46\x36\xcc\x7c\x45\xe5\x60\xa7", "", - "\x53\xfc\x72\xe7\x1b\x59\xee\xb3", - "\x99\xf2\xff\x1c\x8a\x44\xe5\xf2", - "\x68\x70\xf1\x04\xdd\xc5\x14\x47\x7b\x40\x03\x36\xfb\x01\x86\x0e", 1, - 0, 64 }, + "\x53\xfc\x72\xe7\x1b\x59\xee\xb3", "\x99\xf2\xff\x1c\x8a\x44\xe5\xf2", + "\x68\x70\xf1\x04\xdd\xc5\x14\x47\x7b\x40\x03\x36\xfb\x01\x86\x0e", 1, 0, 64 }, { 96, 192, 128, 145, "\x92\xf4\xd2\x67\x2f\xce\xec\x43\x96\x3c\xcf\xfb\x17\xe6\xea\x75\x78" "\xb1\x14\x18\xb0\x6a\x3b\x82", "\x6e\x7f\xf7\xf0\x79\x76\x85\xcf\xc4\x4b\x05\xff", "", "\xc3\xec\x16\xad\xb1\x84\xaf\xfa\x8a\xe9\x73\x8b\xff\xb9\x16", "\xaf\xe8\xef\x41\x59\x1b\xfc\xc0\x0d\xb3\xc8\x80\xce\xb1\x86", - "\x29\xff\xf7\xf2\x85\x76\x86\x45\xc9\xc8\xbf\x7a\x47\x1c\x93\x93", 1, - 0, 120 }, + "\x29\xff\xf7\xf2\x85\x76\x86\x45\xc9\xc8\xbf\x7a\x47\x1c\x93\x93", 1, 0, 120 }, { 96, 192, 128, 146, "\xbc\xb6\xbc\x5e\xe6\x74\x3d\xf1\x39\x6a\x34\x63\x93\x27\xb2\x58\x09" "\xec\x9c\x81\xdd\x6a\x0c\x0e", "\xbe\x03\x26\xd2\x3b\xdc\x2c\x64\x64\x8d\x13\xf4", "", "\x80\x47\x4a\x3a\x3b\x80\x95\x60\xee\xe2\xce\x7a\x7a\x33\xea\x07", "\x90\x33\x9d\xca\x02\xef\x71\x7f\x16\x03\x99\x4a\xee\x6c\xf6\xd2", - "\xe3\xd3\x3e\x01\xce\x64\xf2\x71\x78\x31\x47\xde\x22\x62\x28\xbc", 1, - 0, 128 }, + "\xe3\xd3\x3e\x01\xce\x64\xf2\x71\x78\x31\x47\xde\x22\x62\x28\xbc", 1, 0, 128 }, { 96, 192, 128, 147, "\x5e\x1d\x28\x21\x3e\x09\x25\x36\x52\x5b\xba\xe0\x9e\x21\x4a\xf4\xc8" "\x91\xe2\x02\xb2\xb4\xfa\x4f", @@ -1457,8 +1190,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x65", "\xb9\x8e\xd6\x32\x16\x79\x94\x1a\x3e\x52\x18\x34\x29\x66\x86\xad" "\x98", - "\x9f\x50\xc0\x3e\x05\x5e\x51\x97\x12\xc5\x82\xec\x9d\xb3\x23\x5b", 1, - 0, 136 }, + "\x9f\x50\xc0\x3e\x05\x5e\x51\x97\x12\xc5\x82\xec\x9d\xb3\x23\x5b", 1, 0, 136 }, { 96, 192, 128, 148, "\x7f\x67\x2d\x85\xe1\x51\xaa\x49\x0b\xc0\xee\xc8\xf6\x6b\x5e\x5b\xee" "\x74\xaf\x11\x64\x2b\xe3\xff", @@ -1467,8 +1199,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x11\xc1\x1a\x84\x06\x5f\x80", "\xad\xdd\x30\x36\x51\x11\x9e\x52\xf6\x17\x0d\xfc\x7a\x91\x50\x64\x25" "\x3d\x57\x53\x29\x87\xb9\xab", - "\xfa\x04\x84\xf8\xba\xa9\x5f\x5b\x7a\x31\xc5\x6d\x1b\x34\xc5\x8b", 1, - 0, 192 }, + "\xfa\x04\x84\xf8\xba\xa9\x5f\x5b\x7a\x31\xc5\x6d\x1b\x34\xc5\x8b", 1, 0, 192 }, { 96, 192, 128, 149, "\x96\x9f\xed\x50\x68\x54\x1d\x65\x41\x8c\x2c\x1d\xe8\xfe\x1f\x84\x5e" "\x03\x60\x30\x49\x6e\x12\x72", @@ -1477,19 +1208,16 @@ const struct aead_test aes_gcm_test_json[] = { "\x84\x84\x58", "\x0d\x2c\x3a\x3c\x0c\xc4\xb4\x0e\x70\xed\x45\xe1\x88\xe3\x56\xa0\xe1" "\x53\x3b\x31", - "\x92\x90\x9a\x80\xe9\x05\x40\xe1\x87\x8a\xb5\x9e\xf3\x00\x07\x2b", 1, - 8, 160 }, + "\x92\x90\x9a\x80\xe9\x05\x40\xe1\x87\x8a\xb5\x9e\xf3\x00\x07\x2b", 1, 8, 160 }, { 96, 192, 128, 150, "\xfa\x5b\x9b\x41\xf9\x3f\x8b\x68\x2c\x04\xba\x81\x6c\x3f\xec\xc2\x4e" "\xec\x09\x5b\x04\xdd\x74\x97", - "\x62\xb9\xcf\x1e\x92\x3b\xc1\x13\x8d\x05\xd2\x05", - "\x2e\xd8\x48\x71\x53\xe2\x1b\x12", + "\x62\xb9\xcf\x1e\x92\x3b\xc1\x13\x8d\x05\xd2\x05", "\x2e\xd8\x48\x71\x53\xe2\x1b\x12", "\x18\x15\x98\x41\x81\x3a\x69\xfc\x0f\x8f\x42\x29\xe1\x67\x8d\xa7\xc9" "\x01\x67\x11", "\xc7\xc1\xcb\xb8\x5c\xe2\xa0\xa3\xf3\x2c\xb9\xef\x01\xad\x45\xec\x11" "\x18\xb6\x6d", - "\x25\x33\x17\xf9\x8b\xda\xb8\x75\x31\xec\xe2\x04\x75\xcd\x9e\xbb", 1, - 64, 160 }, + "\x25\x33\x17\xf9\x8b\xda\xb8\x75\x31\xec\xe2\x04\x75\xcd\x9e\xbb", 1, 64, 160 }, { 96, 192, 128, 151, "\xfb\xfb\x39\x56\x62\x78\x7e\x2d\x25\xa2\xe7\x51\x0f\x81\x8e\x82\x59" "\x36\xa3\x51\x14\xe2\x37\xc9", @@ -1499,8 +1227,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x2c\xf7\x2b", "\xec\xf5\xe4\x03\xf1\x9c\x00\x7c\x8d\xa7\xa4\x56\xca\xf0\xa6\xd7\x57" "\x62\x82\x9b", - "\xe0\x87\x7a\x10\x0f\x9d\xd9\xd6\x79\x5f\x0e\x74\xc5\x6a\x9f\xab", 1, - 128, 160 }, + "\xe0\x87\x7a\x10\x0f\x9d\xd9\xd6\x79\x5f\x0e\x74\xc5\x6a\x9f\xab", 1, 128, 160 }, { 96, 192, 128, 152, "\x5d\x8e\x9c\x22\x22\x31\x6c\x9e\xd5\xff\x94\x51\x3c\xc9\x57\x43\x6a" "\xe4\x47\xa6\xe1\xa7\x3a\x29", @@ -1511,8 +1238,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x79\x95\x6b", "\x94\xd8\x44\xd9\x8b\x94\x67\xda\xa7\xe8\xdd\xe7\xf4\x29\x00\x37\x35" "\x4d\x7f\xb2", - "\x62\x19\x66\x38\x59\x0c\xef\x42\x9d\x6b\x1d\x1a\x59\x83\x9c\x02", 1, - 192, 160 }, + "\x62\x19\x66\x38\x59\x0c\xef\x42\x9d\x6b\x1d\x1a\x59\x83\x9c\x02", 1, 192, 160 }, { 96, 192, 128, 153, "\xcc\xbd\x0f\x50\x98\x25\xa5\xf3\x58\xa1\x4a\xac\x04\x4a\xe2\x82\x6b" "\xb2\xc9\xea\xaa\xaa\x07\x7f", @@ -1525,8 +1251,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x15\xff\x1f\x34\xad\x6c\x0a\xcd\x74\xff\xca\x07\xc4\x53\xec\x3f\x3c" "\xe6\x90\x2d\x5f\xf3\x38\xc5\x88\xa3\x4a\x1c\x3b\x30\xef\x75\x3e\xc7" "\x00\x15\x72\xcb\xfe\xaf\xe6\x90\xfd\x00\xf5\x9b\x02", - "\xfb\xf1\x9b\x6b\x90\xe2\xd9\xdf\x7e\xad\x0c\x3b\xc6\xe3\x75\xa2", 1, - 0, 512 }, + "\xfb\xf1\x9b\x6b\x90\xe2\xd9\xdf\x7e\xad\x0c\x3b\xc6\xe3\x75\xa2", 1, 0, 512 }, { 96, 192, 128, 154, "\xd0\x45\xc6\xeb\x17\x3f\x44\x08\x43\xfa\xec\x3e\x93\x74\x60\x2a\x94" "\xee\x3f\x71\x76\x31\x22\x08", @@ -1547,8 +1272,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xaf\xac\x94\x4d\x1e\x97\xea\x78\x93\x67\x82\x1c\x33\x1f\x00\xb5\xd6" "\x18\x40\x2b\xfc\x57\x88\x4d\x18\xed\xbd\x60\xc4\xdf\xe2\x18\xc0\x80" "\x80\xb8\xe3\x47\x9f\xf8\x4b\xdf\xb5", - "\xfc\x2f\xf6\x2a\x41\xbd\xb7\x9a\xfc\x36\x98\x42\xe4\xec\xca\xbf", 1, - 0, 1024 }, + "\xfc\x2f\xf6\x2a\x41\xbd\xb7\x9a\xfc\x36\x98\x42\xe4\xec\xca\xbf", 1, 0, 1024 }, { 96, 192, 128, 155, "\xe6\x02\x18\x8a\xbf\x6a\x91\xf3\xe2\x58\x83\x8c\xea\x6b\xef\xef\xfc" "\xf6\x25\x7a\x50\x9c\x3e\x95", @@ -1585,8 +1309,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x15\x40\xef\xf4\x72\x87\x74\x4d\xac\x43\x37\x5c\x4f\x48\xa4\x6a\xf7" "\x01\x90\x45\x3a\x17\xc3\xc7\x8d\x73\x5b\xa1\xd1\xfc\x76\xa3\x30\xe6" "\xcb\xed", - "\xc7\x20\x35\x31\x4f\x43\xd2\x56\xf8\xd8\x45\xeb\x69\x6b\xd9\x43", 1, - 0, 2056 }, + "\xc7\x20\x35\x31\x4f\x43\xd2\x56\xf8\xd8\x45\xeb\x69\x6b\xd9\x43", 1, 0, 2056 }, { 96, 192, 128, 156, "\x55\xa4\xca\x52\x64\x43\x35\x7a\xc7\xc8\x96\xd9\xa6\x7c\xf7\xd4\x67" "\xf6\x92\x1d\x69\x00\x2d\x3a", @@ -1599,8 +1322,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x46\x55\x6c", "\x3f\x57\xec\x1b\x41\x4f\x74\x81\x8f\xea\xd9\xf3\x5a\xa1\x67\x94\x02" "\xc3\xe7\x50", - "\x97\xb8\x9b\x29\x14\x19\xe3\x2c\xf6\x54\xea\x63\x0a\x3a\xd0\x14", 1, - 512, 160 }, + "\x97\xb8\x9b\x29\x14\x19\xe3\x2c\xf6\x54\xea\x63\x0a\x3a\xd0\x14", 1, 512, 160 }, { 96, 192, 128, 157, "\xf3\x81\xd0\xff\xd3\x37\x3a\x1a\xa0\x2e\xdd\x1d\x7f\xa7\x48\xe9\x19" "\x08\xfe\x53\x4b\xef\x73\xd2", @@ -1617,8 +1339,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xb3\x60\xcb", "\x55\x65\xc6\xd0\x9c\x4c\x92\x4d\x61\xc0\xef\x80\x8f\xb0\xea\x14\x4f" "\xfb\x47\x38", - "\x12\xb7\x2e\xc1\xd9\xc3\x2f\xb2\x2c\x13\xc4\x0b\x33\x79\x6f\xa9", 1, - 1024, 160 }, + "\x12\xb7\x2e\xc1\xd9\xc3\x2f\xb2\x2c\x13\xc4\x0b\x33\x79\x6f\xa9", 1, 1024, 160 }, { 96, 192, 128, 158, "\x8f\x27\xb1\xc3\xb3\xd7\x02\x3c\x76\xee\x66\xc7\x68\xa3\xe9\x2d\x49" "\x71\xe2\x5f\x72\x9d\x87\x88", @@ -1643,463 +1364,393 @@ const struct aead_test aes_gcm_test_json[] = { "\x6e\xee\x21", "\xc6\x87\x7b\x03\x55\x2e\x97\xd9\xa1\xe6\x55\x7f\x90\xdc\x7a\xdd\xe1" "\x5a\x2f\x43", - "\x25\x36\x27\x2b\xee\x74\x46\x82\x00\x41\x85\x4e\x10\xb4\x9a\x03", 1, - 2056, 160 }, + "\x25\x36\x27\x2b\xee\x74\x46\x82\x00\x41\x85\x4e\x10\xb4\x9a\x03", 1, 2056, 160 }, { 96, 192, 128, 159, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb5\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb5\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 160, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb6\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb6\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 161, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\x34\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\x34\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 162, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe5\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe5\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 163, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\xdb\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\xdb\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 164, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2e\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2e\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 165, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2d\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2d\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 166, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\xcc\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\xcc\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 167, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x79\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x79\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 168, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\xf8\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\xf8\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 169, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xd3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xd3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 170, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x59\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x59\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 171, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0c\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0c\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 172, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0f\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0f\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 173, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x8d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x8d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 174, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x65", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x65", 0, 0, 128 }, { 96, 192, 128, 175, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x66", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x66", 0, 0, 128 }, { 96, 192, 128, 176, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x24", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\x24", 0, 0, 128 }, { 96, 192, 128, 177, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\xe4", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x78\xf3\x58\xda\x0d\x99\xcb\xe4", 0, 0, 128 }, { 96, 192, 128, 178, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb5\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x79\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb5\xe4\x4c\x5b\x2f\xe9\x0e\x4c\x79\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 179, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\xdb\x2f\xe9\x0e\xcc\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, - 0, 128 }, + "\xb4\xe4\x4c\xdb\x2f\xe9\x0e\xcc\x78\xf3\x58\xda\x0d\x99\xcb\x64", 0, 0, 128 }, { 96, 192, 128, 180, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\xcc\x78\xf3\x58\xda\x0d\x99\xcb\xe4", 0, - 0, 128 }, + "\xb4\xe4\x4c\x5b\x2f\xe9\x0e\xcc\x78\xf3\x58\xda\x0d\x99\xcb\xe4", 0, 0, 128 }, { 96, 192, 128, 181, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\x4b\x1b\xb3\xa4\xd0\x16\xf1\xb3\x87\x0c\xa7\x25\xf2\x66\x34\x9b", 0, - 0, 128 }, + "\x4b\x1b\xb3\xa4\xd0\x16\xf1\xb3\x87\x0c\xa7\x25\xf2\x66\x34\x9b", 0, 0, 128 }, { 96, 192, 128, 182, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, 128 }, { 96, 192, 128, 183, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, 128 }, { 96, 192, 128, 184, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\x34\x64\xcc\xdb\xaf\x69\x8e\xcc\xf8\x73\xd8\x5a\x8d\x19\x4b\xe4", 0, - 0, 128 }, + "\x34\x64\xcc\xdb\xaf\x69\x8e\xcc\xf8\x73\xd8\x5a\x8d\x19\x4b\xe4", 0, 0, 128 }, { 96, 192, 128, 185, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b", "", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", "\x45\x82\x56\x84\x2d\xfd\x29\x7f\x30\xbd\x2f\x8f\x15\xc9\x2d\xb0", - "\xb5\xe5\x4d\x5a\x2e\xe8\x0f\x4d\x79\xf2\x59\xdb\x0c\x98\xca\x65", 0, - 0, 128 }, + "\xb5\xe5\x4d\x5a\x2e\xe8\x0f\x4d\x79\xf2\x59\xdb\x0c\x98\xca\x65", 0, 0, 128 }, { 128, 256, 128, 186, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x5c\x2e\xa9\xb6\x95\xfc\xf6\xe2\x64\xb9\x60\x74\xd6\xbf\xa5\x72", - "", + "\x5c\x2e\xa9\xb6\x95\xfc\xf6\xe2\x64\xb9\x60\x74\xd6\xbf\xa5\x72", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x28\xe1\xc5\x23\x2f\x4e\xe8\x16\x1d\xbe\x4c\x03\x63\x09\xe0\xb3\x25" "\x4e\x92\x12\xbe\xf0\xa9\x34\x31\xce\x5e\x56\x04\xc8\xf6\xa7\x3c\x18" "\xa3\x18\x30\x18\xb7\x70", - "\xd5\x80\x8a\x1b\xd1\x1a\x01\x12\x9b\xf3\xc6\x91\x9a\xff\x23\x39", 1, - 0, 320 }, + "\xd5\x80\x8a\x1b\xd1\x1a\x01\x12\x9b\xf3\xc6\x91\x9a\xff\x23\x39", 1, 0, 320 }, { 128, 256, 128, 187, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x57\xb3\xa8\x1f\x2c\x36\xb6\xb0\x65\x77\xca\x0f\xba\xb8\xfa\x8e", - "", + "\x57\xb3\xa8\x1f\x2c\x36\xb6\xb0\x65\x77\xca\x0f\xba\xb8\xfa\x8e", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xcc\xee\xbe\xb4\xfe\x4c\xd9\x0c\x51\x4e\x52\xd2\x32\x7a\x2e\xcd\x75" "\x39\x36\x61\x00\x6c\xf2\x47\x6d\x86\x20\x14\x9a\xef\x3d\x1c\xdc\xe4" "\x91\xff\xf3\xe7\xa7\xa3", - "\x81\x32\xe8\x65\xb6\x9d\x64\xef\x37\xdb\x26\x1f\x80\xcb\xbe\x24", 1, - 0, 320 }, + "\x81\x32\xe8\x65\xb6\x9d\x64\xef\x37\xdb\x26\x1f\x80\xcb\xbe\x24", 1, 0, 320 }, { 128, 256, 128, 188, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\xce\x20\xa7\xe8\x70\x69\x6a\x5e\x68\x53\x3c\x46\x5b\xad\x2b\xa1", - "", + "\xce\x20\xa7\xe8\x70\x69\x6a\x5e\x68\x53\x3c\x46\x5b\xad\x2b\xa1", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x4f\x43\x50\x56\x5d\x91\xd9\xaa\x8c\x5f\x40\x48\x55\x04\x92\xad\x6d" "\x6f\xda\xbf\x66\xda\x5d\x1e\x2a\xf7\xbf\xe1\xa8\xaa\xda\xa0\xba\xa3" "\xde\x38\xa4\x1d\x97\x13", - "\x15\x5d\xa6\x44\x1e\xc0\x71\xef\x2d\x8e\x6c\xff\xba\xcc\x1c\x7c", 1, - 0, 320 }, + "\x15\x5d\xa6\x44\x1e\xc0\x71\xef\x2d\x8e\x6c\xff\xba\xcc\x1c\x7c", 1, 0, 320 }, { 128, 256, 128, 189, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x91\x8e\x3c\x19\xdb\xdf\xee\x2d\xb1\x81\x56\xc5\xb9\x3f\x3d\x75", - "", + "\x91\x8e\x3c\x19\xdb\xdf\xee\x2d\xb1\x81\x56\xc5\xb9\x3f\x3d\x75", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x83\x16\xa5\x31\x67\xb6\xde\x1a\x75\x75\x70\x06\x93\xff\xef\x27\x4f" "\x43\x50\x56\x5d\x91\xd9\xaa\x8c\x5f\x40\x48\x55\x04\x92\xad\x6d\x6f" "\xda\xbf\x66\xda\x5d\x1e", - "\x6c\x57\x4a\xa6\xa2\x49\x0c\xc3\xb2\xf2\xf8\xf0\xff\xbc\x56\xc4", 1, - 0, 320 }, + "\x6c\x57\x4a\xa6\xa2\x49\x0c\xc3\xb2\xf2\xf8\xf0\xff\xbc\x56\xc4", 1, 0, 320 }, { 128, 256, 128, 190, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x71\x7d\x90\x0b\x27\x04\x62\xb9\xdb\xf7\xe9\x41\x9e\x89\x06\x09", - "", + "\x71\x7d\x90\x0b\x27\x04\x62\xb9\xdb\xf7\xe9\x41\x9e\x89\x06\x09", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x51\x75\x92\x75\x13\xe7\x51\xeb\x30\x9f\x45\xbc\x2e\xf2\x25\xf2\x83" "\x16\xa5\x31\x67\xb6\xde\x1a\x75\x75\x70\x06\x93\xff\xef\x27\x4f\x43" "\x50\x56\x5d\x91\xd9\xaa", - "\x80\x82\xa7\x61\xe1\xd7\x55\x34\x4b\xf2\x96\x22\x14\x4e\x7d\x39", 1, - 0, 320 }, + "\x80\x82\xa7\x61\xe1\xd7\x55\x34\x4b\xf2\x96\x22\x14\x4e\x7d\x39", 1, 0, 320 }, { 128, 256, 128, 191, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\xec\xd5\x21\x20\xaf\x24\x0e\x9b\x4b\xf3\xb9\xd1\xee\xb4\x94\x34", - "", + "\xec\xd5\x21\x20\xaf\x24\x0e\x9b\x4b\xf3\xb9\xd1\xee\xb4\x94\x34", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x36\xb3\xfb\xec\xd0\x91\x78\xd0\x45\x27\xfb\x37\x54\x4f\x55\x79\xd2" "\x0d\x60\xa4\x12\x66\xf6\x85\xc4\x80\x98\xe1\xa5\x28\x04\xca\x38\x7d" "\x90\x70\x9d\x32\x68\xdd", - "\x03\x3e\x0e\xf2\x95\x3e\xbf\xd8\x42\x57\x37\xc7\xd3\x93\xf8\x9a", 1, - 0, 320 }, + "\x03\x3e\x0e\xf2\x95\x3e\xbf\xd8\x42\x57\x37\xc7\xd3\x93\xf8\x9a", 1, 0, 320 }, { 128, 256, 128, 192, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\xb3\x7b\xba\xd1\x04\x92\x8a\xe8\x92\x21\xd3\x52\x0c\x26\x82\xe0", - "", + "\xb3\x7b\xba\xd1\x04\x92\x8a\xe8\x92\x21\xd3\x52\x0c\x26\x82\xe0", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x16\x92\x9b\x77\x30\x51\xf1\x2b\x0a\xda\xc9\x5f\x65\xe2\x1a\x7f\x36" "\xb3\xfb\xec\xd0\x91\x78\xd0\x45\x27\xfb\x37\x54\x4f\x55\x79\xd2\x0d" "\x60\xa4\x12\x66\xf6\x85", - "\xca\x44\x8b\xb7\xe5\x2e\x89\x7e\xca\x23\x4e\xf3\x43\xd0\x57\xd0", 1, - 0, 320 }, + "\xca\x44\x8b\xb7\xe5\x2e\x89\x7e\xca\x23\x4e\xf3\x43\xd0\x57\xd0", 1, 0, 320 }, { 128, 256, 128, 193, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x53\x88\x16\xc3\xf8\x49\x06\x7c\xf8\x57\x6c\xd6\x2b\x90\xb9\x9c", - "", + "\x53\x88\x16\xc3\xf8\x49\x06\x7c\xf8\x57\x6c\xd6\x2b\x90\xb9\x9c", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x6d\x3f\xae\xfa\xf6\x91\xd5\x81\x63\x84\x6f\x8d\x4b\x9f\xfd\x59\x16" "\x92\x9b\x77\x30\x51\xf1\x2b\x0a\xda\xc9\x5f\x65\xe2\x1a\x7f\x36\xb3" "\xfb\xec\xd0\x91\x78\xd0", - "\x84\xf4\x97\x40\xe6\x75\x7f\x63\xdd\x0d\xf7\xcb\x76\x56\xd0\xef", 1, - 0, 320 }, + "\x84\xf4\x97\x40\xe6\x75\x7f\x63\xdd\x0d\xf7\xcb\x76\x56\xd0\xef", 1, 0, 320 }, { 128, 256, 128, 194, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\xd1\x0e\x63\x19\x43\xcd\x3b\xda\xba\xba\xb2\xbb\xd1\x39\x51\xc0", - "", + "\xd1\x0e\x63\x19\x43\xcd\x3b\xda\xba\xba\xb2\xbb\xd1\x39\x51\xc0", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xd6\x01\x96\xc2\xd1\x4f\xcf\x30\xc0\x99\x1d\x27\x21\xdd\xc5\x2d\x38" "\x5f\x40\x7a\x16\x69\x1d\xad\xe8\x2c\x90\x23\xc8\x55\xfd\x8e\x2e\x8f" "\xbb\x56\x21\x02\xf0\x18", - "\x87\x7e\x15\xd9\x88\x9e\x69\xa9\x9f\xcc\x6d\x72\x74\x65\xc3\x91", 1, - 0, 320 }, + "\x87\x7e\x15\xd9\x88\x9e\x69\xa9\x9f\xcc\x6d\x72\x74\x65\xc3\x91", 1, 0, 320 }, { 128, 256, 128, 195, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x8e\xa0\xf8\xe8\xe8\x7b\xbf\xa9\x63\x68\xd8\x38\x33\xab\x47\x14", - "", + "\x8e\xa0\xf8\xe8\xe8\x7b\xbf\xa9\x63\x68\xd8\x38\x33\xab\x47\x14", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x94\x8f\xbc\xec\xa1\x2a\x6e\x4f\xab\xb7\x9b\x6d\x96\x5e\x33\x6f\xd6" "\x01\x96\xc2\xd1\x4f\xcf\x30\xc0\x99\x1d\x27\x21\xdd\xc5\x2d\x38\x5f" "\x40\x7a\x16\x69\x1d\xad", - "\xcd\x57\x57\x62\x69\x45\x97\x6b\xa9\xf0\x26\x4b\xd6\xbe\xe8\x94", 1, - 0, 320 }, + "\xcd\x57\x57\x62\x69\x45\x97\x6b\xa9\xf0\x26\x4b\xd6\xbe\xe8\x94", 1, 0, 320 }, { 128, 256, 128, 196, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x7b\x2d\xf4\xfb\xed\x1d\xe2\x72\x7e\xb2\x48\x98\xe5\xde\xab\xb9", - "", + "\x7b\x2d\xf4\xfb\xed\x1d\xe2\x72\x7e\xb2\x48\x98\xe5\xde\xab\xb9", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\xa1\xa0\x12\x06\x60\xff\x52\xe6\xb1\x70\x0b\x12\xc5\x4d\x2d\x33\xb9" "\x4b\x00\xcd\x78\x82\xd8\x85\x7d\x84\xe6\xe1\x83\xa1\xde\xa6\xee\x85" "\xa7\xda\x84\xfb\xc3\x5d", - "\xb0\x15\xd7\x2d\xa6\x2c\x81\xcb\x4d\x26\x72\x53\xb2\x0d\xb9\xe5", 1, - 0, 320 }, + "\xb0\x15\xd7\x2d\xa6\x2c\x81\xcb\x4d\x26\x72\x53\xb2\x0d\xb9\xe5", 1, 0, 320 }, { 128, 256, 128, 197, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x24\x83\x6f\x0a\x46\xab\x66\x01\xa7\x60\x22\x1b\x07\x4c\xbd\x6d", - "", + "\x24\x83\x6f\x0a\x46\xab\x66\x01\xa7\x60\x22\x1b\x07\x4c\xbd\x6d", "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", "\x5e\x34\x34\xb4\x5e\xdb\xf0\xd1\xf6\xe0\x2d\x11\x44\xdb\xf8\x67\xa1" "\xa0\x12\x06\x60\xff\x52\xe6\xb1\x70\x0b\x12\xc5\x4d\x2d\x33\xb9\x4b" "\x00\xcd\x78\x82\xd8\x85", - "\xee\x74\xcc\xb3\x0d\x64\x9e\xbf\x69\x16\xd0\x5a\x7d\xbe\x56\x96", 1, - 0, 320 }, + "\xee\x74\xcc\xb3\x0d\x64\x9e\xbf\x69\x16\xd0\x5a\x7d\xbe\x56\x96", 1, 0, 320 }, { 128, 256, 128, 198, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "\x8d\x74\xf1\xc9\x72\x43\xd3\x62\x57\x7f\xf3\x76\xc3\x93\xd2\xdc", "\x26\x5c\x42\xe2\xb9\x6e\xa1\xde\x9c\x24\xf7\x18\x2e\x33\x73\x90", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 0, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 0, 128 }, { 128, 256, 128, 199, "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x10" "\x21\x32\x43\x54\x65\x76\x87\x98\xa9\xba\xcb\xdc\xed\xfe\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "\x88\x4d\xf0\xe7\x6f\x3c\xe2\x27\xbf\x95\x95\xd1\x03\x82\x5a\x46", "\x98\x8f\x47\x66\x8e\xa6\x50\xcb\xaa\x67\x14\x71\x1a\xbe\x26\x8d", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 0, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 0, 128 }, { 128, 256, 128, 200, "\xb4\xcd\x11\xdb\x0b\x3e\x0b\x9b\x34\xea\xfd\x9f\xe0\x27\x74\x69\x76" "\x37\x91\x55\xe7\x61\x16\xaf\xde\x1b\x96\xd2\x12\x98\xe3\x4f", - "\x00\xc4\x9f\x4e\xbb\x07\x39\x3f\x07\xeb\xc3\x82\x5f\x7b\x08\x30", - "", "", "", - "\x30\x6f\xe8\xc9\x64\x5c\xc8\x49\x82\x3e\x33\x3a\x68\x5b\x90\xb2", 1, - 0, 0 }, + "\x00\xc4\x9f\x4e\xbb\x07\x39\x3f\x07\xeb\xc3\x82\x5f\x7b\x08\x30", "", "", "", + "\x30\x6f\xe8\xc9\x64\x5c\xc8\x49\x82\x3e\x33\x3a\x68\x5b\x90\xb2", 1, 0, 0 }, { 128, 256, 128, 201, "\xb7\x79\x7e\xb0\xc1\xa6\x08\x9a\xd5\x45\x2d\x81\xfd\xb1\x48\x28\xc0" "\x40\xdd\xc4\x58\x9c\x32\xb5\x65\xaa\xd8\xcb\x4d\xe3\xe4\xa0", - "\x0a\xd5\x70\xd8\x86\x39\x18\xfe\x89\x12\x4e\x09\xd1\x25\xa2\x71", - "", "\xed", "\x3f", - "\xfd\x8f\x59\x3b\x83\x31\x4e\x33\xc5\xa7\x2e\xfb\xeb\x70\x95\xe8", 1, - 0, 8 }, + "\x0a\xd5\x70\xd8\x86\x39\x18\xfe\x89\x12\x4e\x09\xd1\x25\xa2\x71", "", "\xed", "\x3f", + "\xfd\x8f\x59\x3b\x83\x31\x4e\x33\xc5\xa7\x2e\xfb\xeb\x70\x95\xe8", 1, 0, 8 }, { 128, 256, 128, 202, "\x4c\x01\x0d\x95\x61\xc7\x23\x4c\x30\x8c\x01\xce\xa3\x04\x0c\x92\x5a" "\x9f\x32\x4d\xc9\x58\xff\x90\x4a\xe3\x9b\x37\xe6\x0e\x1e\x03", - "\x2a\x55\xca\xa1\x37\xc5\xb0\xb6\x6c\xf3\x80\x9e\xb8\xf7\x30\xc4", - "", "\x2a\x09\x3c\x9e\xd7\x2b\x8f\xf4\x99\x42\x01\xe9\xf9\xe0\x10", + "\x2a\x55\xca\xa1\x37\xc5\xb0\xb6\x6c\xf3\x80\x9e\xb8\xf7\x30\xc4", "", + "\x2a\x09\x3c\x9e\xd7\x2b\x8f\xf4\x99\x42\x01\xe9\xf9\xe0\x10", "\x04\x13\x41\x07\x8f\x04\x39\xe5\x0b\x43\xc9\x91\x63\x51\x17", - "\x5b\x8a\x2f\x2d\xa2\x0e\xf6\x57\xc9\x03\xda\x88\xef\x5f\x57\xbb", 1, - 0, 120 }, + "\x5b\x8a\x2f\x2d\xa2\x0e\xf6\x57\xc9\x03\xda\x88\xef\x5f\x57\xbb", 1, 0, 120 }, { 128, 256, 128, 203, "\xe7\xf7\xa4\x8d\xf9\x9e\xdd\x92\xb8\x1f\x50\x86\x18\xaa\x96\x52\x6b" "\x27\x9d\xeb\xd9\xdd\xb2\x92\xd3\x85\xdd\xba\xe8\x0b\x22\x59", - "\x7e\xe3\x76\x91\x0f\x08\xf4\x97\xaa\x6c\x3a\xa7\x11\x36\x97\xfd", - "", + "\x7e\xe3\x76\x91\x0f\x08\xf4\x97\xaa\x6c\x3a\xa7\x11\x36\x97\xfd", "", "\x5e\x51\xdb\xbb\x86\x1b\x5e\xc6\x07\x51\xc0\x99\x6e\x00\x52\x7f", "\x46\x94\x78\xd4\x48\xf7\xe9\x7d\x75\x55\x41\xaa\x09\xad\x95\xb0", - "\x25\x4a\xda\x5c\xf6\x62\xd9\x0c\x5e\x11\xb2\xbd\x9c\x4d\xb4\xc4", 1, - 0, 128 }, + "\x25\x4a\xda\x5c\xf6\x62\xd9\x0c\x5e\x11\xb2\xbd\x9c\x4d\xb4\xc4", 1, 0, 128 }, { 128, 256, 128, 204, "\x4f\x84\x78\x2b\xfb\xb6\x4a\x97\x3c\x3d\xe3\xdc\xfa\x34\x30\x36\x7f" "\xd6\x8b\xc0\xb4\xc3\xb3\x1e\x5d\x7c\x81\x41\xba\x3e\x6a\x67", - "\x5d\x1b\xde\x6f\xa0\x99\x4b\x33\xef\xd8\xf2\x3f\x53\x12\x48\xa7", - "", + "\x5d\x1b\xde\x6f\xa0\x99\x4b\x33\xef\xd8\xf2\x3f\x53\x12\x48\xa7", "", "\x78\xcb\x66\x50\xa1\x90\x8a\x84\x21\x01\xea\x85\x80\x4f\xed\x00\xcc" "\x56\xfb\xda\xfa\xfb\xa0\xef\x4d\x1c\xa6\x07\xdc\xae\x57\xb6", "\xcb\x96\x02\x01\xfa\x5a\xd4\x1d\x41\xd1\xc2\xc8\x03\x7c\x71\xd5\x2b" "\x72\xe7\x6b\x16\xb5\x89\xd7\x1b\x97\x66\x27\xc9\x73\x4c\x9d", - "\x8d\xfc\xe1\x64\x67\xc3\xa6\xeb\xb3\xe7\x24\x2c\x9a\x55\x19\x62", 1, - 0, 256 }, - { 120, 128, 128, 205, - "\x34\xc7\x4e\x28\x18\x29\x48\xe0\x3a\xf0\x2a\x01\xf4\x6e\xb4\xf7", + "\x8d\xfc\xe1\x64\x67\xc3\xa6\xeb\xb3\xe7\x24\x2c\x9a\x55\x19\x62", 1, 0, 256 }, + { 120, 128, 128, 205, "\x34\xc7\x4e\x28\x18\x29\x48\xe0\x3a\xf0\x2a\x01\xf4\x6e\xb4\xf7", "\xb0\xa7\x31\x19\xa9\x7d\x62\x38\x06\xb4\x9d\x45\xdd\xf4\xc7", "", "\xfe\x82\xba\x66\xcf\x2e\x26\x57\x41\xf2\xc8\x6c", "\x2b\xc3\xef\x8e\x74\x02\xb4\x63\x1f\x48\xe9\xbe", - "\x4b\x6f\x6f\x5b\xe2\x91\xa9\x0b\x9e\x93\xa8\xa8\x2d\xdb\xc8\xd8", 1, - 0, 96 }, - { 160, 128, 128, 206, - "\x55\xcb\x7c\xac\x77\xef\xe1\x8a\x1e\xa3\xb3\x0c\x65\xf3\xf3\x46", + "\x4b\x6f\x6f\x5b\xe2\x91\xa9\x0b\x9e\x93\xa8\xa8\x2d\xdb\xc8\xd8", 1, 0, 96 }, + { 160, 128, 128, 206, "\x55\xcb\x7c\xac\x77\xef\xe1\x8a\x1e\xa3\xb3\x0c\x65\xf3\xf3\x46", "\xe2\x2b\x6b\x14\x4a\xb2\x6b\x57\x81\x31\x6e\x7a\x42\xa7\x62\x02\xac" "\x4b\x22\x78", "", "\x2f\x3d\x11\xea\x32\xbf\x5b\xc7\x2c\xbe\x2b\x8d", "\x4f\xe1\x3e\xf2\x9f\x11\x8f\x85\xa6\x31\x88\xf8", - "\x05\x97\x5b\x17\x53\x16\xdf\x80\x45\x88\x9f\x43\xe0\xc8\x57\xe0", 1, - 0, 96 }, + "\x05\x97\x5b\x17\x53\x16\xdf\x80\x45\x88\x9f\x43\xe0\xc8\x57\xe0", 1, 0, 96 }, { 120, 192, 128, 207, "\x66\xf7\x5a\xcb\xd8\xd3\xac\xf7\xaf\x47\xd1\x3e\x83\x84\xc2\x80\x9d" "\x6b\x91\x50\x3a\x7f\x29\x4b", "\xed\xf9\x3e\x16\x29\x4f\x15\xed\xed\x83\x80\x8f\x09\x32\x0e", "", "\xa9\x00\xc8\x6b\x6b\x7e\x0e\x55\x63\xf8\xf8\x26", "\x9a\xf1\xa0\x22\xc6\x1c\x43\x15\xaa\x0e\x92\x3e", - "\x20\x52\x9b\xff\x3c\x59\x22\x2e\xc3\x33\x53\xaf\x33\x7b\x1d\x40", 1, - 0, 96 }, + "\x20\x52\x9b\xff\x3c\x59\x22\x2e\xc3\x33\x53\xaf\x33\x7b\x1d\x40", 1, 0, 96 }, { 160, 192, 128, 208, "\xef\x2e\x29\x9d\xd4\xec\xd7\xe3\xb9\xcc\x62\x78\x09\x22\xcc\x2c\x89" "\xf7\x88\x40\x56\x4d\x12\x76", @@ -2107,16 +1758,14 @@ const struct aead_test aes_gcm_test_json[] = { "\xe6\xb6\x5d", "", "\x03\xf5\x95\x79\xb1\x44\x37\x19\x95\x83\x27\x0e", "\x07\x3a\x52\x91\xb1\x1d\xf3\x79\xf3\x1b\x4f\x16", - "\x17\x20\x59\x99\x49\x1b\xd4\xc1\xd6\xc7\xec\x3e\x56\x77\x9c\x32", 1, - 0, 96 }, + "\x17\x20\x59\x99\x49\x1b\xd4\xc1\xd6\xc7\xec\x3e\x56\x77\x9c\x32", 1, 0, 96 }, { 120, 256, 128, 209, "\xe9\x8b\x06\x69\xa6\x45\xeb\x14\xcd\x06\xdf\x69\x68\xfc\x5f\x10\xed" "\xc9\xf5\x4f\xee\xd2\x64\xe3\xd4\x10\xcd\xc6\x1b\x72\xef\x51", "\x17\xca\x25\x0f\xb7\x33\x87\x75\x56\x26\x32\x23\xea\xdd\xe1", "", "\xf3\x84\xb3\xed\x7b\x27\x46\x41\xf5\xdb\x60\xcf", "\xfc\x21\x36\x02\xaa\x42\x3b\x87\xd7\xc2\xa8\x74", - "\x36\xb1\x5b\xab\x69\x23\xb1\x72\x18\xfe\x1c\x24\x04\x8e\x23\x91", 1, - 0, 96 }, + "\x36\xb1\x5b\xab\x69\x23\xb1\x72\x18\xfe\x1c\x24\x04\x8e\x23\x91", 1, 0, 96 }, { 160, 256, 128, 210, "\x84\x9b\x3e\x6b\x8c\xdd\x85\xbd\xcf\xb8\xeb\x70\x1a\xa5\x52\x2a\xe2" "\x34\x0f\xbe\x52\x14\xe3\x89\x62\x2c\xef\x76\x97\x92\x25\xc4", @@ -2124,28 +1773,22 @@ const struct aead_test aes_gcm_test_json[] = { "\xbd\x4e\xbf", "", "\x8c\x55\x64\xe5\x30\x51\xc0\xde\x27\x31\x99\xb4", "\xc1\xd7\x62\x33\xe8\xc5\x04\x2e\x92\xbf\x8d\x32", - "\x7c\xf0\x36\xd2\x35\xd3\xb2\xdd\x34\x9a\x8c\x80\x4b\x65\x14\x4a", 1, - 0, 96 }, - { 256, 128, 128, 211, - "\x59\x27\xba\xe7\x48\xbb\x69\xd8\x1b\x5a\x72\x4e\x0a\x16\x56\x52", + "\x7c\xf0\x36\xd2\x35\xd3\xb2\xdd\x34\x9a\x8c\x80\x4b\x65\x14\x4a", 1, 0, 96 }, + { 256, 128, 128, 211, "\x59\x27\xba\xe7\x48\xbb\x69\xd8\x1b\x5a\x72\x4e\x0a\x16\x56\x52", "\x36\x5e\x0b\x96\x93\x2b\x13\x30\x6f\x92\xe9\xbb\x23\x84\x71\x65\xbc" "\xbf\x5d\x35\xe4\x5a\x83\xd7\x5c\x86\xec\xca\x70\x13\x1f\x4c", "", "\x31\x6b\xf9\x9b\xfa\xfc\x76\xf1\xbf\xc0\xb0\x3c", "\x53\x48\xaf\x57\xfa\xfe\x24\x85\xb4\x3f\x2b\xc4", - "\x01\x9a\x96\xc5\x37\x3c\x03\x16\x26\xb6\xc0\x30\x0d\x4c\xf7\x8b", 1, - 0, 96 }, - { 512, 128, 128, 212, - "\xdb\xd3\x67\x6f\x29\x34\x09\x27\x3f\x27\xb3\x75\xe0\x37\x93\xa3", + "\x01\x9a\x96\xc5\x37\x3c\x03\x16\x26\xb6\xc0\x30\x0d\x4c\xf7\x8b", 1, 0, 96 }, + { 512, 128, 128, 212, "\xdb\xd3\x67\x6f\x29\x34\x09\x27\x3f\x27\xb3\x75\xe0\x37\x93\xa3", "\x96\x7f\xa7\xc9\x90\xeb\x2b\xec\xbd\x45\x08\x35\xe2\x8e\xa3\xa9\x00" "\x0c\x72\x16\x28\x5c\xfa\x76\x96\xe8\xc3\xda\xc3\xce\x95\x2a\x1f\xe6" "\x38\xd7\xc8\xc7\x3e\x1d\x70\x8d\xce\x01\xb5\xa2\x0f\xcc\x9a\xa0\x11" "\x94\x9d\x2a\x83\x5f\x77\x74\x23\xc1\x72\xfa\x3a\xa0", "", "\x62\x5e\xfe\xdb\x8b\x7f\x1a\xa6\x22\x38\xa8\xf2", "\xf5\x59\xb7\x0f\xe1\x14\x9c\xb3\x44\x06\xa2\xc7", - "\x94\x18\x0d\xdb\x7b\xb1\x99\x5a\xbe\x02\x19\xea\xb5\xce\x23\x2f", 1, - 0, 96 }, - { 1024, 128, 128, 213, - "\x7e\x5a\x39\xdc\xda\x7e\x06\x69\x88\xf1\x9a\xdf\x4d\xe4\xd5\x01", + "\x94\x18\x0d\xdb\x7b\xb1\x99\x5a\xbe\x02\x19\xea\xb5\xce\x23\x2f", 1, 0, 96 }, + { 1024, 128, 128, 213, "\x7e\x5a\x39\xdc\xda\x7e\x06\x69\x88\xf1\x9a\xdf\x4d\xe4\xd5\x01", "\x49\x43\x56\xc3\x45\x9d\x60\xe3\xa8\x34\x33\xc9\xbc\xf2\xc0\x45\x4a" "\x76\x3e\x49\x6e\x4e\xc9\x9b\xfb\xe4\xbb\xb8\x3a\x4f\xda\x76\xb5\x42" "\x21\x38\x99\xdc\xf5\x52\x1c\xd9\xbb\xbe\x5d\x11\x54\x5b\xda\x44\xa3" @@ -2156,10 +1799,8 @@ const struct aead_test aes_gcm_test_json[] = { "\x40\x54\xc0\xfa\x78\x70\x73\xd0\x67", "", "\xb0\x47\x29\xb4\xad\xba\xac\x63\xc2\xaa\xf8\xd8", "\x52\x91\xdd\x4d\xa9\x1c\xcc\x2e\x77\x30\x6d\x83", - "\xa7\xf7\xb2\x1a\x3b\x7e\xce\x50\x9e\x92\x26\x47\xfd\x90\x5f\x06", 1, - 0, 96 }, - { 2056, 128, 128, 214, - "\xea\xc3\xf2\x8c\xd9\x37\xff\x29\xeb\x61\x58\xa3\x72\x1b\x51\x45", + "\xa7\xf7\xb2\x1a\x3b\x7e\xce\x50\x9e\x92\x26\x47\xfd\x90\x5f\x06", 1, 0, 96 }, + { 2056, 128, 128, 214, "\xea\xc3\xf2\x8c\xd9\x37\xff\x29\xeb\x61\x58\xa3\x72\x1b\x51\x45", "\x6f\xd2\x60\xbb\xa8\x73\x39\x53\x9c\x37\xdc\x68\xfd\xc3\x65\x6f\x63" "\xc8\x30\x28\xcb\x8a\xdc\xb5\x31\x08\x5e\x98\xbd\x57\x0c\x6b\x73\x5d" "\x0c\xc4\xb4\xb9\x24\x69\x60\x00\xa2\xd8\x93\x62\x1a\xe6\x4d\xcc\xe9" @@ -2178,8 +1819,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xb6\x34", "", "\x09\x89\x12\xa3\x02\x77\x33\x77\xb9\xc2\x6a\xc3", "\xe3\xbe\x94\x71\x53\xa2\x6a\x3a\x54\xe3\x01\x5c", - "\xfd\x04\x2b\xdd\xe2\x2f\x67\xc4\xfd\x29\x8d\x5d\xc0\x86\x76\x06", 1, - 0, 96 }, + "\xfd\x04\x2b\xdd\xe2\x2f\x67\xc4\xfd\x29\x8d\x5d\xc0\x86\x76\x06", 1, 0, 96 }, { 256, 192, 128, 215, "\x8f\x9e\xbc\x67\xa9\xa6\x43\x0c\x2b\x0c\xee\xaf\x98\x3e\x13\x56\x96" "\x4b\xb9\x28\x63\x5b\x9c\xa4", @@ -2187,8 +1827,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xab\xd8\xb7\x73\xf1\x6b\x8a\xe8\x4d\x8f\x26\x03\xaa\xa4\x40", "", "\xa3\xa9\x6e\xe9\x4f\x94\xca\xa8\x1e\xbc\xd6\x6d", "\x8c\x2a\x98\x23\xa3\xb3\xd4\x13\xbe\x69\x63\x87", - "\xfa\xaf\x01\xce\xb4\x0a\x7e\x14\x5e\x8f\xe6\x5a\xa9\xaf\x58\xc0", 1, - 0, 96 }, + "\xfa\xaf\x01\xce\xb4\x0a\x7e\x14\x5e\x8f\xe6\x5a\xa9\xaf\x58\xc0", 1, 0, 96 }, { 512, 192, 128, 216, "\xf4\xbb\xdf\xd0\x6f\x7f\xb1\x43\x48\x80\xe4\x16\x6d\x38\xd5\x6e\x02" "\xa3\xf0\xdf\x0d\x53\x01\xce", @@ -2198,8 +1837,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x0e\x3a\x98\xff\x4f\x56\xc4\xf0\xa5\xeb\x4f\x0e\xac", "", "\x39\xd2\xab\xe6\x69\x7f\x17\xec\x27\xf2\xa3\x9c", "\xa6\x60\xea\x5b\xf0\x7a\x78\xfe\xa0\x12\x01\x73", - "\x74\x04\xfc\x7b\x73\x54\x69\x44\x28\x23\x6f\x20\x3c\x13\x02\x44", 1, - 0, 96 }, + "\x74\x04\xfc\x7b\x73\x54\x69\x44\x28\x23\x6f\x20\x3c\x13\x02\x44", 1, 0, 96 }, { 1024, 192, 128, 217, "\x17\x61\xc7\x77\x98\xef\x9c\xdf\xa4\x05\x53\xf3\x46\x14\xfe\x74\x02" "\x21\x20\x87\xf0\x50\x94\x11", @@ -2213,8 +1851,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xe0\x3e\x6b\x9d\xdf\xee\x0a\xbd\xc2", "", "\x35\xca\x4e\xb4\x63\xa2\x00\x01\x38\x21\x0b\x4d", "\xf4\x00\x13\x2f\xf3\x8c\x04\xed\x74\x7d\xde\x34", - "\xca\x15\x34\xe7\xdd\x03\x36\xbb\xb3\x2a\x79\x83\x0c\x71\xa4\x47", 1, - 0, 96 }, + "\xca\x15\x34\xe7\xdd\x03\x36\xbb\xb3\x2a\x79\x83\x0c\x71\xa4\x47", 1, 0, 96 }, { 2056, 192, 128, 218, "\xf7\x95\xec\xe7\xde\x18\x81\xfb\xc6\x84\x3e\xb7\x40\xf8\x12\xe4\x1e" "\x3f\xc4\x9f\xf6\xc7\xb9\x40", @@ -2236,8 +1873,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xc6\x02", "", "\x22\xdb\xd8\x03\x7a\xa0\x5b\x14\xcf\x81\xdd\x23", "\x13\xa9\x5a\x06\xc1\xbe\xd4\x84\x5a\xf9\xc7\x01", - "\x03\x37\x98\x36\xb0\xc8\x2f\x64\xa1\xbc\xcd\xcd\x76\x3a\xcb\xbc", 1, - 0, 96 }, + "\x03\x37\x98\x36\xb0\xc8\x2f\x64\xa1\xbc\xcd\xcd\x76\x3a\xcb\xbc", 1, 0, 96 }, { 256, 256, 128, 219, "\xee\x41\x71\x91\x7d\x23\x37\x49\x68\x12\xa2\x78\x4d\x6a\x71\x30\x0e" "\x6b\x8c\x1a\xc3\xb1\xef\x58\xce\xe7\x7c\x22\x9a\xea\xf2\xc5", @@ -2245,8 +1881,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x78\x53\xd5\xb2\x2f\xea\xa0\xc8\x89\x87\x5b\xd0\xd8\x7c\xd4", "", "\x94\xd2\xf8\x69\x7f\xac\xaa\xa1\x91\xba\x61\x7a", "\xa2\x95\xc2\xcb\x27\xce\x23\xd2\x68\x74\xad\xe1", - "\x04\x65\x0a\x78\xbb\xb6\x1d\xb3\x37\xc9\xc3\x2a\xa3\xe7\xb6\xfa", 1, - 0, 96 }, + "\x04\x65\x0a\x78\xbb\xb6\x1d\xb3\x37\xc9\xc3\x2a\xa3\xe7\xb6\xfa", 1, 0, 96 }, { 512, 256, 128, 220, "\x13\x2c\x59\xb4\xbc\xb8\xaf\xb3\x16\x37\x73\x4a\x81\x10\x5b\xb2\xc9" "\x87\x8f\x32\x0a\xce\x90\x76\xd5\xfd\x7c\x5d\x21\x6c\x8d\x12", @@ -2256,8 +1891,7 @@ const struct aead_test aes_gcm_test_json[] = { "\x94\xa5\x2d\xd5\xac\x3b\x93\x31\x11\x6c\x7c\x77\x5f", "", "\x12\xc7\xbe\x00\xfa\xcd\xa4\x95\x96\xe1\x91\x34", "\x9c\xdc\xfc\x3a\xaa\x8d\x46\x6f\x25\x58\x8e\x4b", - "\x7e\x80\xf5\x1e\x71\x80\xf1\xcd\x3b\xa8\x43\x49\x88\x8f\xcd\x5c", 1, - 0, 96 }, + "\x7e\x80\xf5\x1e\x71\x80\xf1\xcd\x3b\xa8\x43\x49\x88\x8f\xcd\x5c", 1, 0, 96 }, { 1024, 256, 128, 221, "\x7b\x0b\x12\x49\x19\x01\xd6\x2d\x09\x7f\xa2\x6d\xc7\x1e\x15\xcf\xac" "\xaf\xa3\x22\x67\x19\xe4\x71\x26\xd9\x9c\x79\xd9\x8e\xc2\x22", @@ -2271,8 +1905,7 @@ const struct aead_test aes_gcm_test_json[] = { "\xcf\x14\x32\x93\xac\x0b\xe6\x62\x29", "", "\xc8\x03\x12\x59\x07\x00\xc3\xbb\xfa\xcd\x1a\x40", "\x3f\x3c\x15\x1e\x98\x4d\x05\x94\x62\xf9\xe5\xa0", - "\xe5\x59\xf5\xf7\x55\xaa\x29\x21\x71\xcc\x35\xfb\xf9\x11\xa6\x4f", 1, - 0, 96 }, + "\xe5\x59\xf5\xf7\x55\xaa\x29\x21\x71\xcc\x35\xfb\xf9\x11\xa6\x4f", 1, 0, 96 }, { 2056, 256, 128, 222, "\x3b\xc3\xbf\x39\xd0\xd5\xff\xd9\x4c\xca\x2b\x45\xc6\x78\xa2\xd0\x49" "\x15\x1e\xd2\xba\xbc\x71\x3b\xe5\x3c\xb6\x6f\x54\xa1\x63\x37", @@ -2294,235 +1927,180 @@ const struct aead_test aes_gcm_test_json[] = { "\xeb\x4e", "", "\x81\x25\xee\x76\x37\xd7\xd0\xe0\x3b\xba\xcf\x35", "\x54\x96\xae\x94\xc3\x32\x2e\xbf\x95\x9e\xa9\xa9", - "\x70\x71\x7c\xc0\x0f\xd1\xff\xa5\x9b\xb0\x43\x29\x22\x6a\x0c\x0a", 1, - 0, 96 }, - { 0, 128, 128, 223, - "\x8f\x3f\x52\xe3\xc7\x5c\x58\xf5\xcb\x26\x1f\x51\x8f\x4a\xd3\x0a", - "", "", "", "", - "\xcf\x71\x97\x8f\xfc\xc7\x78\xf3\xc8\x5a\xc9\xc3\x1b\x6f\xe1\x91", 0, - 0, 0 }, - { 0, 128, 128, 224, - "\x2a\x4b\xf9\x0e\x56\xb7\x0f\xdd\x86\x49\xd7\x75\xc0\x89\xde\x3b", - "", "", - "\x32\x4c\xed\x6c\xd1\x5e\xcc\x5b\x37\x41\x54\x1e\x22\xc1\x8a\xd9", + "\x70\x71\x7c\xc0\x0f\xd1\xff\xa5\x9b\xb0\x43\x29\x22\x6a\x0c\x0a", 1, 0, 96 }, + { 0, 128, 128, 223, "\x8f\x3f\x52\xe3\xc7\x5c\x58\xf5\xcb\x26\x1f\x51\x8f\x4a\xd3\x0a", "", + "", "", "", "\xcf\x71\x97\x8f\xfc\xc7\x78\xf3\xc8\x5a\xc9\xc3\x1b\x6f\xe1\x91", 0, 0, 0 }, + { 0, 128, 128, 224, "\x2a\x4b\xf9\x0e\x56\xb7\x0f\xdd\x86\x49\xd7\x75\xc0\x89\xde\x3b", "", + "", "\x32\x4c\xed\x6c\xd1\x5e\xcc\x5b\x37\x41\x54\x1e\x22\xc1\x8a\xd9", "\x00\xa2\x9f\x0a\x5e\x2e\x74\x90\x27\x9d\x1f\xaf\x8b\x88\x1c\x7b", - "\xa2\xc7\xe8\xd7\xa1\x9b\x88\x4f\x74\x2d\xfe\xc3\xe7\x6c\x75\xee", 0, - 0, 128 }, + "\xa2\xc7\xe8\xd7\xa1\x9b\x88\x4f\x74\x2d\xfe\xc3\xe7\x6c\x75\xee", 0, 0, 128 }, { 0, 192, 128, 225, "\x0b\x18\xd2\x13\x37\x03\x5c\x7b\xaa\x08\x21\x1b\x70\x2f\xa7\x80\xac" "\x7c\x09\xbe\x8f\x9e\xd1\x1f", - "", "", "", "", - "\xca\x69\xa2\xeb\x3a\x09\x6e\xa3\x6b\x10\x15\xd5\xdf\xff\xf5\x32", 0, - 0, 0 }, + "", "", "", "", "\xca\x69\xa2\xeb\x3a\x09\x6e\xa3\x6b\x10\x15\xd5\xdf\xff\xf5\x32", 0, 0, + 0 }, { 0, 192, 128, 226, "\xba\x76\xd5\x94\xa6\xdf\x91\x5b\xb7\xab\x7e\x6d\x1a\x8d\x02\x4b\x27" "\x96\x33\x6c\x1b\x83\x28\xa9", - "", "", - "\xd6\x2f\x30\x27\x42\xd6\x1d\x82\x3e\xa9\x91\xb9\x34\x30\xd5\x89", + "", "", "\xd6\x2f\x30\x27\x42\xd6\x1d\x82\x3e\xa9\x91\xb9\x34\x30\xd5\x89", "\x50\x9b\x06\x58\xd0\x9f\x7a\x5b\xb9\xdb\x43\xb7\x0c\x83\x87\xf7", - "\x2c\x94\x88\xd5\x3a\x0b\x2b\x53\x08\xc2\x75\x7d\xfa\xc7\x21\x9f", 0, - 0, 128 }, + "\x2c\x94\x88\xd5\x3a\x0b\x2b\x53\x08\xc2\x75\x7d\xfa\xc7\x21\x9f", 0, 0, 128 }, { 0, 256, 128, 227, "\x3f\x8c\xa4\x7b\x9a\x94\x05\x82\x64\x4e\x8e\xcf\x9c\x2d\x44\xe8\x13" "\x83\x77\xa8\x37\x9c\x5c\x11\xaa\xfe\x7f\xec\x19\x85\x6c\xf1", - "", "", "", "", - "\x17\x26\xaa\x69\x5f\xba\xa2\x1a\x1d\xb8\x84\x55\xc6\x70\xa4\xb0", 0, - 0, 0 }, + "", "", "", "", "\x17\x26\xaa\x69\x5f\xba\xa2\x1a\x1d\xb8\x84\x55\xc6\x70\xa4\xb0", 0, 0, + 0 }, { 0, 256, 128, 228, "\x76\x60\xd1\x09\x66\xc6\x50\x39\x03\xa5\x52\xdd\xe2\xa8\x09\xed\xe9" "\xda\x49\x0e\x5e\x5c\xc3\xe3\x49\xda\x99\x96\x71\x80\x98\x83", - "", "", - "\xc3\x14\x23\x53\x41\xde\xbf\xaf\xa1\x52\x6b\xb6\x10\x44\xa7\xf1", + "", "", "\xc3\x14\x23\x53\x41\xde\xbf\xaf\xa1\x52\x6b\xb6\x10\x44\xa7\xf1", "\x77\x72\xea\x35\x89\x01\xf5\x71\xd3\xd3\x5c\x19\x49\x76\x39\xd9", - "\x8f\xe0\x52\x0a\xd7\x44\xa1\x1f\x0c\xcf\xd2\x28\x45\x43\x63\xfa", 0, - 0, 128 }, - { 8, 128, 128, 229, - "\x59\xa2\x84\xf5\x0a\xed\xd8\xd3\xe2\xa9\x16\x37\xd3\x81\x55\x79", - "\x80", "", "", "", - "\xaf\x49\x8f\x70\x1d\x24\x70\x69\x5f\x6e\x7c\x83\x27\xa2\x39\x8b", 1, + "\x8f\xe0\x52\x0a\xd7\x44\xa1\x1f\x0c\xcf\xd2\x28\x45\x43\x63\xfa", 0, 0, 128 }, + { 8, 128, 128, 229, "\x59\xa2\x84\xf5\x0a\xed\xd8\xd3\xe2\xa9\x16\x37\xd3\x81\x55\x79", + "\x80", "", "", "", "\xaf\x49\x8f\x70\x1d\x24\x70\x69\x5f\x6e\x7c\x83\x27\xa2\x39\x8b", 1, 0, 0 }, - { 8, 128, 128, 230, - "\xfe\xc5\x8a\xa8\xcf\x06\xbf\xe0\x5d\xe8\x29\xf2\x7e\xc7\x76\x93", - "\x9d", "", - "\xf2\xd9\x9a\x9f\x89\x33\x78\xe0\x75\x7d\x27\xc2\xe3\xa3\x10\x1b", + { 8, 128, 128, 230, "\xfe\xc5\x8a\xa8\xcf\x06\xbf\xe0\x5d\xe8\x29\xf2\x7e\xc7\x76\x93", + "\x9d", "", "\xf2\xd9\x9a\x9f\x89\x33\x78\xe0\x75\x7d\x27\xc2\xe3\xa3\x10\x1b", "\x0a\x24\x61\x2a\x9d\x1c\xbe\x96\x7d\xbf\xe8\x04\xbf\x84\x40\xe5", - "\x96\xe6\xfd\x2c\xdc\x70\x7e\x3e\xe0\xa1\xc9\x0d\x34\xc9\xc3\x6c", 1, - 0, 128 }, - { 16, 128, 128, 231, - "\x88\xa9\x72\xcc\xe9\xea\xf5\xa7\x81\x3c\xe8\x14\x9d\x0c\x1d\x0e", + "\x96\xe6\xfd\x2c\xdc\x70\x7e\x3e\xe0\xa1\xc9\x0d\x34\xc9\xc3\x6c", 1, 0, 128 }, + { 16, 128, 128, 231, "\x88\xa9\x72\xcc\xe9\xea\xf5\xa7\x81\x3c\xe8\x14\x9d\x0c\x1d\x0e", "\x0f\x2f", "", "", "", - "\x4c\xcf\x1e\xfb\x4d\xa0\x5b\x4a\xe4\x45\x2a\xea\x42\xf5\x42\x4b", 1, - 0, 0 }, - { 16, 128, 128, 232, - "\xb4\x39\x67\xee\x93\x3e\x46\x32\xbd\x65\x62\xba\x12\x01\xbf\x83", - "\x87\x60", "", - "\x5a\x6a\xd6\xdb\x70\x59\x1d\x1e\x52\x0b\x01\x22\xf0\x50\x21\xa0", + "\x4c\xcf\x1e\xfb\x4d\xa0\x5b\x4a\xe4\x45\x2a\xea\x42\xf5\x42\x4b", 1, 0, 0 }, + { 16, 128, 128, 232, "\xb4\x39\x67\xee\x93\x3e\x46\x32\xbd\x65\x62\xba\x12\x01\xbf\x83", + "\x87\x60", "", "\x5a\x6a\xd6\xdb\x70\x59\x1d\x1e\x52\x0b\x01\x22\xf0\x50\x21\xa0", "\xba\x3e\x7f\x8b\x29\x99\x99\x5c\x7f\xc4\x00\x6c\xa4\xf4\x75\xff", - "\x98\xf4\x7a\x52\x79\xce\xbb\xca\xc2\x14\x51\x57\x10\xf6\xcd\x8a", 1, - 0, 128 }, - { 32, 128, 128, 233, - "\x4e\x9a\x97\xd3\xed\x54\xc7\xb5\x46\x10\x79\x3a\xb0\x50\x52\xe1", + "\x98\xf4\x7a\x52\x79\xce\xbb\xca\xc2\x14\x51\x57\x10\xf6\xcd\x8a", 1, 0, 128 }, + { 32, 128, 128, 233, "\x4e\x9a\x97\xd3\xed\x54\xc7\xb5\x46\x10\x79\x3a\xb0\x50\x52\xe1", "\xcc\x85\x19\x57", "", "", "", - "\xe5\x74\xb3\x55\xbd\xa2\x98\x0e\x04\x7e\x58\x4f\xeb\x16\x76\xca", 1, - 0, 0 }, - { 32, 128, 128, 234, - "\xd8\x3c\x1d\x7a\x97\xc4\x3f\x18\x24\x09\xa4\xaa\x56\x09\xc1\xb1", + "\xe5\x74\xb3\x55\xbd\xa2\x98\x0e\x04\x7e\x58\x4f\xeb\x16\x76\xca", 1, 0, 0 }, + { 32, 128, 128, 234, "\xd8\x3c\x1d\x7a\x97\xc4\x3f\x18\x24\x09\xa4\xaa\x56\x09\xc1\xb1", "\x7b\x5f\xae\xb2", "", "\xc8\xf0\x7b\xa1\xd6\x55\x54\xa9\xbd\x40\x39\x0c\x30\xc5\x52\x9c", "\x1b\x84\xba\xea\x9d\xf1\xe6\x5b\xee\x7b\x49\xe4\xa8\xcd\xa1\xec", - "\x5c\x0b\xb7\x9d\x82\x40\x04\x1e\xdc\xe0\xf9\x4b\xd4\xbb\x38\x4f", 1, - 0, 128 }, - { 48, 128, 128, 235, - "\xc6\xa7\x05\x67\x7a\xff\xb4\x9e\x27\x6d\x95\x11\xca\xa4\x61\x45", + "\x5c\x0b\xb7\x9d\x82\x40\x04\x1e\xdc\xe0\xf9\x4b\xd4\xbb\x38\x4f", 1, 0, 128 }, + { 48, 128, 128, 235, "\xc6\xa7\x05\x67\x7a\xff\xb4\x9e\x27\x6d\x95\x11\xca\xa4\x61\x45", "\x4a\xd8\x0c\x28\x54\xfb", "", "", "", - "\x1e\x2e\xd7\x2a\xf5\x90\xca\xfb\x86\x47\xd1\x85\x86\x5f\x54\x63", 1, - 0, 0 }, - { 48, 128, 128, 236, - "\xeb\xa7\x69\x9b\x56\xcc\x0a\xa2\xf6\x6a\x2a\x5b\xe9\x94\x44\x13", + "\x1e\x2e\xd7\x2a\xf5\x90\xca\xfb\x86\x47\xd1\x85\x86\x5f\x54\x63", 1, 0, 0 }, + { 48, 128, 128, 236, "\xeb\xa7\x69\x9b\x56\xcc\x0a\xa2\xf6\x6a\x2a\x5b\xe9\x94\x44\x13", "\xd1\xda\xfc\x8d\xe3\xe3", "", "\xd0\x21\xe5\x3d\x90\x98\xa2\xdf\x3d\x6b\x90\x3c\xda\xd0\xcd\x9c", "\x18\x29\x1a\xa8\xdc\x7b\x07\x44\x8a\xa8\xf7\x1b\xb8\xe3\x80\xbf", - "\x9c\x0e\x22\xe5\xc4\x1b\x10\x39\xff\x56\x61\xff\xae\xfa\x8e\x0f", 1, - 0, 128 }, + "\x9c\x0e\x22\xe5\xc4\x1b\x10\x39\xff\x56\x61\xff\xae\xfa\x8e\x0f", 1, 0, 128 }, { 8, 192, 128, 237, "\xc7\x0c\xe3\x8e\x84\xe5\xf5\x3e\xd4\x1c\x3f\x0d\x2c\xa4\x93\x41\x2a" "\xd3\x2c\xb0\x4c\x6e\x2e\xfa", - "\xcb", "", "", "", - "\x08\xd9\x6e\xdb\x5e\x22\x87\x4c\xd1\x0c\xb2\x25\x6c\xa0\x4b\xc6", 1, + "\xcb", "", "", "", "\x08\xd9\x6e\xdb\x5e\x22\x87\x4c\xd1\x0c\xb2\x25\x6c\xa0\x4b\xc6", 1, 0, 0 }, { 8, 192, 128, 238, "\x74\xc8\x16\xb8\x3d\xfd\x28\x72\x10\xa3\xe2\xc6\xda\x8d\x30\x53\xbb" "\xfb\xd9\xb1\x56\xd3\xfd\xd8", - "\x0f", "", - "\xf2\xb7\xb2\xc9\xb3\x12\xcf\x2a\xf7\x8f\x00\x3d\xf1\x5c\x8e\x19", + "\x0f", "", "\xf2\xb7\xb2\xc9\xb3\x12\xcf\x2a\xf7\x8f\x00\x3d\xf1\x5c\x8e\x19", "\x6c\x5e\x79\x6b\xa9\xa3\xdd\xc6\x4f\x40\x1e\x68\xd1\x35\x10\x1d", - "\x96\xa1\x32\xed\x43\x92\x4e\x98\xfe\xb8\x88\xff\x68\x2b\xda\xef", 1, - 0, 128 }, + "\x96\xa1\x32\xed\x43\x92\x4e\x98\xfe\xb8\x88\xff\x68\x2b\xda\xef", 1, 0, 128 }, { 16, 192, 128, 239, "\xcb\xf4\x5b\xa4\x88\x93\x2a\xea\x1a\x10\xe5\x86\x2f\x92\xe4\xa7\xe2" "\x77\xbd\xa9\xf3\x4a\xf6\xd0", "\x75\xe5", "", "", "", - "\x1f\x0d\x23\x07\x0f\xcd\x74\x8e\x25\xbf\x64\x54\xf5\xc9\x13\x6e", 1, - 0, 0 }, + "\x1f\x0d\x23\x07\x0f\xcd\x74\x8e\x25\xbf\x64\x54\xf5\xc9\x13\x6e", 1, 0, 0 }, { 16, 192, 128, 240, "\xe1\xc0\x44\x6f\x11\xae\x6a\xa4\xfa\x25\x4f\x9a\x84\x6f\xc6\xe1\x3e" "\x45\xe5\x37\xe4\x7f\x20\x42", - "\x89\x89", "", - "\x3a\x2f\x5a\xd0\xeb\x21\x6e\x54\x6e\x0b\xca\xa3\x77\xb6\xcb\xc7", + "\x89\x89", "", "\x3a\x2f\x5a\xd0\xeb\x21\x6e\x54\x6e\x0b\xca\xa3\x77\xb6\xcb\xc7", "\x55\x0b\x48\xa4\x3e\x82\x1f\xd7\x6f\x49\xf0\xf1\xa8\x97\xae\xad", - "\xf6\xe0\xa9\x79\x48\x1f\x99\x57\xdd\xad\x0f\x21\xa7\x77\xa7\x3a", 1, - 0, 128 }, + "\xf6\xe0\xa9\x79\x48\x1f\x99\x57\xdd\xad\x0f\x21\xa7\x77\xa7\x3a", 1, 0, 128 }, { 32, 192, 128, 241, "\x56\x75\x63\xbf\x4c\xf1\x54\x90\x22\x75\xa5\x3b\xc5\x7c\xd6\xdd\x7b" "\x37\x0d\x27\x01\x1b\xda\xc8", "\x68\xd7\xfc\x38", "", "", "", - "\x14\x75\x56\x3e\x32\x12\xf3\xb5\xe4\x00\x62\x56\x9a\xfd\x71\xe3", 1, - 0, 0 }, + "\x14\x75\x56\x3e\x32\x12\xf3\xb5\xe4\x00\x62\x56\x9a\xfd\x71\xe3", 1, 0, 0 }, { 32, 192, 128, 242, "\x83\x4d\x0b\xb6\x01\x17\x08\x65\xa7\x81\x39\x42\x8a\x15\x03\x69\x5a" "\x6a\x29\x1e\xbd\x74\x7c\xd1", "\xbb\x9d\x2a\xa3", "", "\x6f\x79\xe1\x8b\x4a\xcd\x5a\x03\xd3\xa5\xf7\xe1\xa8\xd0\xf1\x83", "\x30\x91\x33\xe7\x61\x59\xfe\x8a\x41\xb2\x08\x43\x48\x65\x11\xab", - "\x03\xab\x26\x99\x3b\x70\x19\x10\xa2\xe8\xec\xcc\xd2\xba\x9e\x52", 1, - 0, 128 }, + "\x03\xab\x26\x99\x3b\x70\x19\x10\xa2\xe8\xec\xcc\xd2\xba\x9e\x52", 1, 0, 128 }, { 48, 192, 128, 243, "\x99\xfb\x18\xf5\xba\x43\x0b\xb9\xea\x94\x29\x68\xec\xb7\x99\xb4\x34" "\x06\xe1\xaf\x4b\x64\x25\xa1", "\xa9\x84\xbd\xcd\xca\xe2", "", "", "", - "\xd7\xb9\xa6\xb5\x8a\x97\x98\x29\x16\xe8\x32\x19\xfb\xf7\x1b\x1e", 1, - 0, 0 }, + "\xd7\xb9\xa6\xb5\x8a\x97\x98\x29\x16\xe8\x32\x19\xfb\xf7\x1b\x1e", 1, 0, 0 }, { 48, 192, 128, 244, "\xb7\x7b\x24\x2a\xa0\xd5\x1c\x92\xfd\xa0\x13\xe0\xcb\x0e\xf2\x43\x73" "\x99\xac\xe5\xd3\xf5\x07\xe4", "\x52\xaa\x01\xe0\xd0\xd6", "", "\x4b\xa5\x41\xa9\x91\x47\x29\x21\x61\x53\x80\x13\x40\xab\x17\x79", "\xe0\x82\x61\xe4\x6e\xaf\x90\xd9\x78\xea\x8f\x78\x89\xbc\xcd\x4f", - "\xc0\x52\xa5\x5d\xf3\x92\x6a\x50\x99\x0a\x53\x2e\xfe\x3d\x80\xec", 1, - 0, 128 }, + "\xc0\x52\xa5\x5d\xf3\x92\x6a\x50\x99\x0a\x53\x2e\xfe\x3d\x80\xec", 1, 0, 128 }, { 64, 192, 128, 245, "\xd7\x45\x99\xb3\xd2\xdb\x81\x65\x3d\xe4\x3b\x52\xfc\x99\x4c\x50\xd0" "\xbe\x75\x9f\xab\x87\xc3\x3a", "\xd1\xc6\x1c\xf8\x53\x25\x31\xb5", "", "", "", - "\xf9\x4f\x20\x49\xa6\x56\x0c\x47\x0b\x3a\x7c\xa7\xbb\xc3\x1a\x3d", 1, - 0, 0 }, + "\xf9\x4f\x20\x49\xa6\x56\x0c\x47\x0b\x3a\x7c\xa7\xbb\xc3\x1a\x3d", 1, 0, 0 }, { 64, 192, 128, 246, "\x0b\x17\x71\x98\xc8\xb4\x19\xbf\x74\xac\xc3\xbc\x65\xb5\xfb\x3d\x09" "\xa9\x15\xff\x71\xad\xd7\x54", "\x8f\x07\x5c\xbc\xda\x98\x31\xc3", "", "\xc4\xb1\xe0\x5c\xa3\xd5\x91\xf9\x54\x3e\x64\xde\x3f\xc6\x82\xac", "\x3c\x6e\xc0\xab\x1b\x82\x7b\xf2\x38\xa5\x38\x4f\xb7\xe2\x12\xce", - "\x7d\xb7\x40\x22\x24\xfd\x58\x3e\x31\x2b\xc0\xe6\x1c\xf1\x13\x66", 1, - 0, 128 }, + "\x7d\xb7\x40\x22\x24\xfd\x58\x3e\x31\x2b\xc0\xe6\x1c\xf1\x13\x66", 1, 0, 128 }, { 8, 256, 128, 247, "\x8f\x9a\x38\xc1\x01\x49\x66\xe4\xd9\xae\x73\x61\x39\xc5\xe7\x9b\x99" "\x34\x58\x74\xf4\x2d\x4c\x7d\x2c\x81\xaa\x67\x97\xc4\x17\xc0", - "\xa9", "", "", "", - "\x2a\x26\x8b\xf3\xa7\x5f\xd7\xb0\x0b\xa2\x30\xb9\x04\xbb\xb0\x14", 1, + "\xa9", "", "", "", "\x2a\x26\x8b\xf3\xa7\x5f\xd7\xb0\x0b\xa2\x30\xb9\x04\xbb\xb0\x14", 1, 0, 0 }, { 8, 256, 128, 248, "\x14\x4c\xd8\x27\x92\x29\xe8\xbb\x2d\xe9\x9d\x24\xe6\x15\x30\x66\x63" "\x91\x3f\xe9\x17\x7f\xcd\x27\x0f\xaf\xec\x49\x3d\x43\xbc\xa1", - "\xb3", "", - "\x97\x62\x29\xf5\x53\x8f\x96\x36\x47\x6d\x69\xf0\xc3\x28\xe2\x9d", + "\xb3", "", "\x97\x62\x29\xf5\x53\x8f\x96\x36\x47\x6d\x69\xf0\xc3\x28\xe2\x9d", "\x7b\xea\x30\xec\xc2\xf7\x3f\x8e\x12\x12\x63\xb3\x79\x66\x95\x4c", - "\x8b\xba\xd4\xad\xc5\x4b\x37\xa2\xb2\xf0\xf6\xe8\x61\x75\x48\xc9", 1, - 0, 128 }, + "\x8b\xba\xd4\xad\xc5\x4b\x37\xa2\xb2\xf0\xf6\xe8\x61\x75\x48\xc9", 1, 0, 128 }, { 16, 256, 128, 249, "\x7d\x31\x86\x1f\x9d\x35\x36\xe1\x40\x16\xa3\x21\x6b\x10\x42\xe0\xd2" "\xf7\xd4\x61\x43\x14\x26\x8b\x6f\x83\x4e\xc7\xf3\x8b\xbb\x65", "\xc3\x32", "", "", "", - "\x1d\x97\x8a\x69\x31\x20\xc1\x1f\x6d\x51\xa3\xed\x88\xcd\x4a\xce", 1, - 0, 0 }, + "\x1d\x97\x8a\x69\x31\x20\xc1\x1f\x6d\x51\xa3\xed\x88\xcd\x4a\xce", 1, 0, 0 }, { 16, 256, 128, 250, "\x22\xb3\x5f\xe9\x62\x3e\xe1\x1f\x8b\x60\xb6\xd2\x2d\xb3\x76\x5b\x66" "\x6e\xd9\x72\xfa\x7c\xcd\x92\xb4\x5f\x22\xde\xee\x02\xca\xb1", - "\xda\x6c", "", - "\x53\x41\xc7\x8e\x4c\xe5\xbf\x8f\xbc\x3e\x07\x7d\x19\x90\xdd\x5d", + "\xda\x6c", "", "\x53\x41\xc7\x8e\x4c\xe5\xbf\x8f\xbc\x3e\x07\x7d\x19\x90\xdd\x5d", "\x9c\x39\xf5\xb1\x10\x36\x1e\x9a\x77\x0c\xc5\xe8\xb0\xf4\x44\xbb", - "\xb6\x3f\xf4\x3c\x12\x07\x3e\xc5\x57\x2b\x1b\xe7\x0f\x17\xe2\x31", 1, - 0, 128 }, + "\xb6\x3f\xf4\x3c\x12\x07\x3e\xc5\x57\x2b\x1b\xe7\x0f\x17\xe2\x31", 1, 0, 128 }, { 32, 256, 128, 251, "\xc2\x24\xe0\xbb\xa3\xd7\xa9\x91\x65\xf7\x99\x6b\x67\xa0\xfc\xe3\xe1" "\x2f\x2c\x01\x17\x9b\x19\x7b\x69\xb7\xe6\x28\xbc\xa9\x20\x96", "\x6b\x30\x14\x5e", "", "", "", - "\xae\x6f\x7c\x9a\x29\xf0\xd8\x20\x4c\xa5\x0b\x14\xa1\xe0\xdc\xf2", 1, - 0, 0 }, + "\xae\x6f\x7c\x9a\x29\xf0\xd8\x20\x4c\xa5\x0b\x14\xa1\xe0\xdc\xf2", 1, 0, 0 }, { 32, 256, 128, 252, "\x09\x3e\xb1\x23\x43\x53\x7e\xe8\xe9\x1c\x1f\x71\x5b\x86\x26\x03\xf8" "\xda\xf9\xd4\xe1\xd7\xd6\x72\x12\xa9\xd6\x8e\x5a\xac\x93\x58", "\x51\x10\x60\x4c", "", "\x33\xef\xb5\x8c\x91\xe8\xc7\x02\x71\x87\x0e\xc0\x0f\xe2\xe2\x02", "\xf7\x3f\x72\xf9\x76\xa2\x96\xba\x3c\xa9\x4b\xc6\xeb\x08\xcd\x46", - "\xb8\x24\xc3\x3c\x13\xf2\x89\x42\x96\x59\xaa\x01\x7c\x63\x2f\x71", 1, - 0, 128 }, + "\xb8\x24\xc3\x3c\x13\xf2\x89\x42\x96\x59\xaa\x01\x7c\x63\x2f\x71", 1, 0, 128 }, { 48, 256, 128, 253, "\x98\xe6\xf8\xab\x67\x3e\x80\x4e\x86\x5e\x32\x40\x3a\x65\x51\xbf\x80" "\x7a\x95\x93\x43\xc6\x0d\x34\x55\x93\x60\xbc\x29\x5e\xcb\x5b", "\xd4\xd8\x57\x51\x08\x88", "", "", "", - "\x3d\xb1\x67\x25\xfa\xfc\x82\x8d\x41\x4a\xb6\x1c\x16\xa6\xc3\x8f", 1, - 0, 0 }, + "\x3d\xb1\x67\x25\xfa\xfc\x82\x8d\x41\x4a\xb6\x1c\x16\xa6\xc3\x8f", 1, 0, 0 }, { 48, 256, 128, 254, "\x0b\xd0\xe8\xe7\x78\x11\x66\xe1\xd8\x76\xde\xc8\xfa\xd3\x4b\xa9\x5b" "\x03\x2a\x27\xca\xc0\x55\x15\x95\x11\x60\x91\x00\x59\x47\xb7", "\x1b\xdc\xd4\x4b\x66\x3e", "", "\x91\x22\x22\x63\xb1\x2c\xf5\x61\x6a\x04\x9c\xbe\x29\xab\x9b\x5b", "\xed\x46\x3f\x4f\x43\x33\x6a\xf3\xf4\xd7\xe0\x87\x70\x20\x11\x45", - "\xc8\xfc\x39\x90\x6a\xca\x0c\x64\xe1\x4a\x43\xff\x75\x0a\xbd\x8a", 1, - 0, 128 }, + "\xc8\xfc\x39\x90\x6a\xca\x0c\x64\xe1\x4a\x43\xff\x75\x0a\xbd\x8a", 1, 0, 128 }, { 64, 256, 128, 255, "\x61\xba\x69\x48\x97\x92\x5d\x1b\x41\x74\xd4\x04\x01\x46\x9c\x3e\xf2" "\x67\xcd\xb9\xf8\x29\xed\xb1\xa1\x06\x18\xc1\x6d\x66\x60\x59", "\x0d\x10\xc5\xc8\x4b\x88\xd6\x88", "", "", "", - "\x13\x11\xf9\xf8\x30\xd7\x29\xc1\x89\xb7\x4e\xc4\xf9\x08\x0f\xa1", 1, - 0, 0 }, + "\x13\x11\xf9\xf8\x30\xd7\x29\xc1\x89\xb7\x4e\xc4\xf9\x08\x0f\xa1", 1, 0, 0 }, { 64, 256, 128, 256, "\x11\x58\x84\xf6\x93\xb1\x55\x56\x3e\x9b\xfb\x3b\x07\xca\xcb\x2f\x7f" "\x7c\xaa\x9b\xfe\x51\xf8\x9e\x23\xfe\xb5\xa9\x46\x8b\xfd\xd0", "\x04\x10\x21\x99\xef\x21\xe1\xdf", "", "\x82\xe3\xe6\x04\xd2\xbe\x8f\xca\xb7\x4f\x63\x8d\x1e\x70\xf2\x4c", "\x7e\x0d\xd6\xc7\x2a\xec\x49\xf8\x9c\xc6\xa8\x00\x60\xc0\xb1\x70", - "\xaf\x68\xa3\x7c\xfe\xfe\xcc\x4a\xb9\x9b\xa5\x0a\x53\x53\xed\xca", 1, - 0, 128 }, + "\xaf\x68\xa3\x7c\xfe\xfe\xcc\x4a\xb9\x9b\xa5\x0a\x53\x53\xed\xca", 1, 0, 128 }, { 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; diff --git a/test/wycheproof-app/chacha20_poly1305_test.json.c b/test/wycheproof-app/chacha20_poly1305_test.json.c index d78485ce..6e96ae9a 100644 --- a/test/wycheproof-app/chacha20_poly1305_test.json.c +++ b/test/wycheproof-app/chacha20_poly1305_test.json.c @@ -48,276 +48,218 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x2d\x77\x8b\x8c\x98\x03\xae\xe3\x28\x09\x1b\x58\xfa\xb3\x24\xe4\xfa" "\xd6\x75\x94\x55\x85\x80\x8b\x48\x31\xd7\xbc\x3f\xf4\xde\xf0\x8e\x4b" "\x7a\x9d\xe5\x76\xd2\x65\x86\xce\xc6\x4b\x61\x16", - "\x1a\xe1\x0b\x59\x4f\x09\xe2\x6a\x7e\x90\x2e\xcb\xd0\x60\x06\x91", 1, - 96, 912 }, + "\x1a\xe1\x0b\x59\x4f\x09\xe2\x6a\x7e\x90\x2e\xcb\xd0\x60\x06\x91", 1, 96, 912 }, { 96, 256, 128, 2, "\x80\xba\x31\x92\xc8\x03\xce\x96\x5e\xa3\x71\xd5\xff\x07\x3c\xf0\xf4" "\x3b\x6a\x2a\xb5\x76\xb2\x08\x42\x6e\x11\x40\x9c\x09\xb9\xb0", "\x4d\xa5\xbf\x8d\xfd\x58\x52\xc1\xea\x12\x37\x9d", "", "", "", - "\x76\xac\xb3\x42\xcf\x31\x66\xa5\xb6\x3c\x0c\x0e\xa1\x38\x3c\x8d", 1, - 0, 0 }, + "\x76\xac\xb3\x42\xcf\x31\x66\xa5\xb6\x3c\x0c\x0e\xa1\x38\x3c\x8d", 1, 0, 0 }, { 96, 256, 128, 3, "\x7a\x4c\xd7\x59\x17\x2e\x02\xeb\x20\x4d\xb2\xc3\xf5\xc7\x46\x22\x7d" "\xf5\x84\xfc\x13\x45\x19\x63\x91\xdb\xb9\x57\x7a\x25\x07\x42", - "\xa9\x2e\xf0\xac\x99\x1d\xd5\x16\xa3\xc6\xf6\x89", - "\xbd\x50\x67\x64\xf2\xd2\xc4\x10", "", "", - "\x90\x6f\xa6\x28\x4b\x52\xf8\x7b\x73\x59\xcb\xaa\x75\x63\xc7\x09", 1, - 64, 0 }, + "\xa9\x2e\xf0\xac\x99\x1d\xd5\x16\xa3\xc6\xf6\x89", "\xbd\x50\x67\x64\xf2\xd2\xc4\x10", + "", "", "\x90\x6f\xa6\x28\x4b\x52\xf8\x7b\x73\x59\xcb\xaa\x75\x63\xc7\x09", 1, 64, 0 }, { 96, 256, 128, 4, "\xcc\x56\xb6\x80\x55\x2e\xb7\x50\x08\xf5\x48\x4b\x4c\xb8\x03\xfa\x50" "\x63\xeb\xd6\xea\xb9\x1f\x6a\xb6\xae\xf4\x91\x6a\x76\x62\x73", - "\x99\xe2\x3e\xc4\x89\x85\xbc\xcd\xee\xab\x60\xf1", "", "\x2a", - "\x3a", - "\xca\xc2\x7d\xec\x09\x68\x80\x1e\x9f\x6e\xde\xd6\x9d\x80\x75\x22", 1, - 0, 8 }, + "\x99\xe2\x3e\xc4\x89\x85\xbc\xcd\xee\xab\x60\xf1", "", "\x2a", "\x3a", + "\xca\xc2\x7d\xec\x09\x68\x80\x1e\x9f\x6e\xde\xd6\x9d\x80\x75\x22", 1, 0, 8 }, { 96, 256, 128, 5, "\x46\xf0\x25\x49\x65\xf7\x69\xd5\x2b\xdb\x4a\x70\xb4\x43\x19\x9f\x8e" "\xf2\x07\x52\x0d\x12\x20\xc5\x5e\x4b\x70\xf0\xfd\xa6\x20\xee", - "\xab\x0d\xca\x71\x6e\xe0\x51\xd2\x78\x2f\x44\x03", - "\x91\xca\x6c\x59\x2c\xbc\xca\x53", "\x51", "\xc4", - "\x16\x83\x10\xca\x45\xb1\xf7\xc6\x6c\xad\x4e\x99\xe4\x3f\x72\xb9", 1, - 64, 8 }, + "\xab\x0d\xca\x71\x6e\xe0\x51\xd2\x78\x2f\x44\x03", "\x91\xca\x6c\x59\x2c\xbc\xca\x53", + "\x51", "\xc4", "\x16\x83\x10\xca\x45\xb1\xf7\xc6\x6c\xad\x4e\x99\xe4\x3f\x72\xb9", 1, 64, + 8 }, { 96, 256, 128, 6, "\x2f\x7f\x7e\x4f\x59\x2b\xb3\x89\x19\x49\x89\x74\x35\x07\xbf\x3e\xe9" "\xcb\xde\x17\x86\xb6\x69\x5f\xe6\xc0\x25\xfd\x9b\xa4\xc1\x00", - "\x46\x1a\xf1\x22\xe9\xf2\xe0\x34\x7e\x03\xf2\xdb", "", "\x5c\x60", - "\x4d\x13", - "\x91\xe8\xb6\x1e\xfb\x39\xc1\x22\x19\x54\x53\x07\x7b\x22\xe5\xe2", 1, - 0, 16 }, + "\x46\x1a\xf1\x22\xe9\xf2\xe0\x34\x7e\x03\xf2\xdb", "", "\x5c\x60", "\x4d\x13", + "\x91\xe8\xb6\x1e\xfb\x39\xc1\x22\x19\x54\x53\x07\x7b\x22\xe5\xe2", 1, 0, 16 }, { 96, 256, 128, 7, "\xc8\x83\x3d\xce\x5e\xa9\xf2\x48\xaa\x20\x30\xea\xcf\xe7\x2b\xff\xe6" "\x9a\x62\x0c\xaf\x79\x33\x44\xe5\x71\x8f\xe0\xd7\xab\x1a\x58", - "\x61\x54\x6b\xa5\xf1\x72\x05\x90\xb6\x04\x0a\xc6", - "\x88\x36\x4f\xc8\x06\x05\x18\xbf", "\xdd\xf2", "\xb6\x0d", - "\xea\xd0\xfd\x46\x97\xec\x2e\x55\x58\x23\x77\x19\xd0\x24\x37\xa2", 1, - 64, 16 }, + "\x61\x54\x6b\xa5\xf1\x72\x05\x90\xb6\x04\x0a\xc6", "\x88\x36\x4f\xc8\x06\x05\x18\xbf", + "\xdd\xf2", "\xb6\x0d", + "\xea\xd0\xfd\x46\x97\xec\x2e\x55\x58\x23\x77\x19\xd0\x24\x37\xa2", 1, 64, 16 }, { 96, 256, 128, 8, "\xbd\x8e\xd7\xfb\x0d\x60\x75\x22\xf0\x4d\x0b\x12\xd4\x2c\x92\x57\x0b" "\xcc\xc5\xba\x24\x86\x95\x3d\x70\xba\x2e\x81\x93\xf6\x22\x5a", - "\xd2\xab\x0a\xbb\x50\xa8\xe9\xfb\xa2\x54\x29\xe1", "", - "\x20\x12\x21", "\x3c\xf4\x70", - "\xa2\x7a\x69\xc9\xd7\xee\x84\x58\x6f\x11\x38\x8c\x68\x84\xe6\x3a", 1, - 0, 24 }, + "\xd2\xab\x0a\xbb\x50\xa8\xe9\xfb\xa2\x54\x29\xe1", "", "\x20\x12\x21", "\x3c\xf4\x70", + "\xa2\x7a\x69\xc9\xd7\xee\x84\x58\x6f\x11\x38\x8c\x68\x84\xe6\x3a", 1, 0, 24 }, { 96, 256, 128, 9, "\x1c\x8b\x59\xb1\x7a\x5c\xec\xed\x31\xbd\xe9\x7d\x4c\xef\xd9\xaa\xaa" "\x63\x36\x2e\x09\x6e\x86\x3e\xc1\xc8\x95\x80\xbc\xa7\x9b\x7a", - "\x94\xf3\x2a\x6d\xff\x58\x8f\x2b\x5a\x2e\xad\x45", - "\x6c\x8c\xf2\xab\x38\x20\xb6\x95", "\x45\x3f\x95", "\x61\x09\x25", - "\xa8\xa7\x88\x3e\xb7\xe4\x0b\xc4\x0e\x2e\x59\x22\xae\x95\xdd\xc3", 1, - 64, 24 }, + "\x94\xf3\x2a\x6d\xff\x58\x8f\x2b\x5a\x2e\xad\x45", "\x6c\x8c\xf2\xab\x38\x20\xb6\x95", + "\x45\x3f\x95", "\x61\x09\x25", + "\xa8\xa7\x88\x3e\xb7\xe4\x0b\xc4\x0e\x2e\x59\x22\xae\x95\xdd\xc3", 1, 64, 24 }, { 96, 256, 128, 10, "\xe4\x91\x2c\xb7\x5a\x11\x74\x34\x5f\x1a\x45\x73\x66\xf1\x88\x85\xfe" "\x84\x60\xb0\x64\x78\xe0\x4b\xe2\xf7\xfb\x4e\xc9\xc1\x13\xe5", - "\x7a\xa5\xad\x8b\xf5\x25\x47\x62\x17\x1e\xc8\x69", "", - "\x9e\x4c\x1d\x03", "\xfe\x68\x49\xaa", - "\x99\xad\x07\x87\x1b\x25\xc2\x7d\xef\xc3\x1a\x54\x1b\xd5\xc4\x18", 1, + "\x7a\xa5\xad\x8b\xf5\x25\x47\x62\x17\x1e\xc8\x69", "", "\x9e\x4c\x1d\x03", + "\xfe\x68\x49\xaa", "\x99\xad\x07\x87\x1b\x25\xc2\x7d\xef\xc3\x1a\x54\x1b\xd5\xc4\x18", 1, 0, 32 }, { 96, 256, 128, 11, "\xe0\x57\x77\xef\x3d\x98\x9a\xce\x7d\x2a\xbf\xba\x45\x2b\xfd\xed\x54" "\x80\x1d\xbd\x5c\x66\xe9\x1c\x0c\x2e\xf0\x04\x79\xd8\x55\x72", - "\xb7\xf5\x26\xe3\xfd\x71\xcf\x57\x20\x96\x1a\xec", - "\x15\xd9\x3a\x96\xd0\xe6\xc5\xa9", "\x17\xbf\xda\x03", - "\xf4\x71\x0e\x51", - "\xb9\x57\xc6\xa3\x7b\x6a\x4c\x94\x99\x6c\x00\x21\x86\xd6\x3b\x2b", 1, - 64, 32 }, + "\xb7\xf5\x26\xe3\xfd\x71\xcf\x57\x20\x96\x1a\xec", "\x15\xd9\x3a\x96\xd0\xe6\xc5\xa9", + "\x17\xbf\xda\x03", "\xf4\x71\x0e\x51", + "\xb9\x57\xc6\xa3\x7b\x6a\x4c\x94\x99\x6c\x00\x21\x86\xd6\x3b\x2b", 1, 64, 32 }, { 96, 256, 128, 12, "\x1a\x4c\x4f\x39\xab\xe8\x90\xe6\x23\x45\xc9\x47\xbc\xf7\xde\x7c\x2e" "\x33\xbd\x5c\xee\xda\x0a\x0a\xbf\x0e\x7e\xf9\x35\xdd\xf3\xee", - "\x94\x47\xbf\x85\xd5\xb9\x7d\x8a\xee\x0f\x8e\x51", "", - "\xc1\x5a\x59\x3b\xd0", "\xf7\x11\x64\x7f\xf1", - "\x22\xb1\x2d\xc3\x8c\xb7\x96\x29\xf8\x4c\xdb\xdc\x24\x25\xc0\x9d", 1, - 0, 40 }, + "\x94\x47\xbf\x85\xd5\xb9\x7d\x8a\xee\x0f\x8e\x51", "", "\xc1\x5a\x59\x3b\xd0", + "\xf7\x11\x64\x7f\xf1", + "\x22\xb1\x2d\xc3\x8c\xb7\x96\x29\xf8\x4c\xdb\xdc\x24\x25\xc0\x9d", 1, 0, 40 }, { 96, 256, 128, 13, "\x80\x0e\x9a\x24\x79\x17\x00\xc9\x60\x97\x36\x69\x5b\xa2\xa8\xb9\x9b" "\x2d\x57\xf1\xc3\xbf\xb6\x1e\xd4\x9d\xb1\xc6\xc5\x21\x95\x83", - "\x3d\xbe\x87\x6b\xd8\x80\xec\x8e\xa2\x01\x70\x43", - "\x96\x22\x48\x35\x61\x0b\x78\x2b", "\xa7\xbf\xd0\x41\xe3", - "\xd1\x71\xf0\x46\xea", - "\xd1\x79\xb1\xb9\xc4\x18\x43\x78\xdf\x00\x90\x19\xdb\xb8\xc2\x49", 1, - 64, 40 }, + "\x3d\xbe\x87\x6b\xd8\x80\xec\x8e\xa2\x01\x70\x43", "\x96\x22\x48\x35\x61\x0b\x78\x2b", + "\xa7\xbf\xd0\x41\xe3", "\xd1\x71\xf0\x46\xea", + "\xd1\x79\xb1\xb9\xc4\x18\x43\x78\xdf\x00\x90\x19\xdb\xb8\xc2\x49", 1, 64, 40 }, { 96, 256, 128, 14, "\x20\x8c\x2c\x37\x6c\x94\x30\x43\x3d\xb2\x0e\x1a\x6b\x7b\xa8\x17\xf8" "\xff\xbf\xa6\x82\x7f\x26\x75\x9c\xce\xde\x42\xe5\x91\xd3\xec", - "\x27\xfb\x58\xec\x6a\x21\xe8\x46\x96\xcb\x88\x30", "", - "\xaf\x10\x4b\x5c\xcd\x0e", "\x93\x51\xb1\xb1\xb0\x82", - "\x56\x07\x85\x50\x9f\x60\xf2\x6b\x68\x19\x33\xd9\xcd\xbf\xd2\x9f", 1, - 0, 48 }, + "\x27\xfb\x58\xec\x6a\x21\xe8\x46\x96\xcb\x88\x30", "", "\xaf\x10\x4b\x5c\xcd\x0e", + "\x93\x51\xb1\xb1\xb0\x82", + "\x56\x07\x85\x50\x9f\x60\xf2\x6b\x68\x19\x33\xd9\xcd\xbf\xd2\x9f", 1, 0, 48 }, { 96, 256, 128, 15, "\x2e\xb1\x68\xe5\x3b\x07\xab\x04\x35\x5e\xa7\x92\xfe\x11\xa6\xbe\x2c" "\xe9\xc3\x9c\xfe\x15\xa9\x97\x07\x6b\x1e\x38\xc1\x7a\xd6\x20", - "\xb5\x96\x54\x70\xc3\x83\xfd\x29\xfe\x7e\xae\xe7", - "\x6d\x52\xfe\xb2\x50\x9f\x7f\xbf", "\x6f\xdf\x29\x27\xe1\x69", - "\x41\xab\xff\x7b\x71\xcc", - "\x9b\x51\x74\x29\x7c\x03\xcf\x89\x02\xd1\xf7\x06\xfd\x00\x89\x02", 1, - 64, 48 }, + "\xb5\x96\x54\x70\xc3\x83\xfd\x29\xfe\x7e\xae\xe7", "\x6d\x52\xfe\xb2\x50\x9f\x7f\xbf", + "\x6f\xdf\x29\x27\xe1\x69", "\x41\xab\xff\x7b\x71\xcc", + "\x9b\x51\x74\x29\x7c\x03\xcf\x89\x02\xd1\xf7\x06\xfd\x00\x89\x02", 1, 64, 48 }, { 96, 256, 128, 16, "\x55\x56\x81\x58\xd3\xa6\x48\x3f\x1f\x70\x21\xea\xb6\x9b\x70\x3f\x61" "\x42\x51\xca\xdc\x1a\xf5\xd3\x4a\x37\x4f\xdb\xfc\x5a\xda\xc7", - "\x3c\x4e\x65\x4d\x66\x3f\xa4\x59\x6d\xc5\x5b\xb7", "", - "\xab\x85\xe9\xc1\x57\x17\x31", "\x5d\xfe\x34\x40\xdb\xb3\xc3", - "\xed\x7a\x43\x4e\x26\x02\xd3\x94\x28\x1e\x0a\xfa\x9f\xb7\xaa\x42", 1, - 0, 56 }, + "\x3c\x4e\x65\x4d\x66\x3f\xa4\x59\x6d\xc5\x5b\xb7", "", "\xab\x85\xe9\xc1\x57\x17\x31", + "\x5d\xfe\x34\x40\xdb\xb3\xc3", + "\xed\x7a\x43\x4e\x26\x02\xd3\x94\x28\x1e\x0a\xfa\x9f\xb7\xaa\x42", 1, 0, 56 }, { 96, 256, 128, 17, "\xe3\xc0\x9e\x7f\xab\x1a\xef\xb5\x16\xda\x6a\x33\x02\x2a\x1d\xd4\xeb" "\x27\x2c\x80\xd5\x40\xc5\xda\x52\xa7\x30\xf3\x4d\x84\x0d\x7f", - "\x58\x38\x93\x75\xc6\x9e\xe3\x98\xde\x94\x83\x96", - "\x84\xe4\x6b\xe8\xc0\x91\x90\x53", "\x4e\xe5\xcd\xa2\x0d\x42\x90", - "\x4b\xd4\x72\x12\x94\x1c\xe3", - "\x18\x5f\x14\x08\xee\x7f\xbf\x18\xf5\xab\xad\x6e\x22\x53\xa1\xba", 1, - 64, 56 }, + "\x58\x38\x93\x75\xc6\x9e\xe3\x98\xde\x94\x83\x96", "\x84\xe4\x6b\xe8\xc0\x91\x90\x53", + "\x4e\xe5\xcd\xa2\x0d\x42\x90", "\x4b\xd4\x72\x12\x94\x1c\xe3", + "\x18\x5f\x14\x08\xee\x7f\xbf\x18\xf5\xab\xad\x6e\x22\x53\xa1\xba", 1, 64, 56 }, { 96, 256, 128, 18, "\x51\xe4\xbf\x2b\xad\x92\xb7\xaf\xf1\xa4\xbc\x05\x55\x0b\xa8\x1d\xf4" "\xb9\x6f\xab\xf4\x1c\x12\xc7\xb0\x0e\x60\xe4\x8d\xb7\xe1\x52", "\x4f\x07\xaf\xed\xfd\xc3\xb6\xc2\x36\x18\x23\xd3", "", - "\xbe\x33\x08\xf7\x2a\x2c\x6a\xed", - "\x8e\x94\x39\xa5\x6e\xee\xc8\x17", - "\xfb\xe8\xa6\xed\x8f\xab\xb1\x93\x75\x39\xdd\x6c\x00\xe9\x00\x21", 1, - 0, 64 }, + "\xbe\x33\x08\xf7\x2a\x2c\x6a\xed", "\x8e\x94\x39\xa5\x6e\xee\xc8\x17", + "\xfb\xe8\xa6\xed\x8f\xab\xb1\x93\x75\x39\xdd\x6c\x00\xe9\x00\x21", 1, 0, 64 }, { 96, 256, 128, 19, "\x11\x31\xc1\x41\x85\x77\xa0\x54\xde\x7a\x4a\xc5\x51\x95\x0f\x1a\x05" "\x3f\x9a\xe4\x6e\x5b\x75\xfe\x4a\xbd\x56\x08\xd7\xcd\xda\xdd", - "\xb4\xea\x66\x6e\xe1\x19\x56\x33\x66\x48\x4a\x78", - "\x66\xc0\xae\x70\x07\x6c\xb1\x4d", - "\xa4\xc9\xc2\x80\x1b\x71\xf7\xdf", - "\xb9\xb9\x10\x43\x3a\xf0\x52\xb0", - "\x45\x30\xf5\x1a\xee\xe0\x24\xe0\xa4\x45\xa6\x32\x8f\xa6\x7a\x18", 1, - 64, 64 }, + "\xb4\xea\x66\x6e\xe1\x19\x56\x33\x66\x48\x4a\x78", "\x66\xc0\xae\x70\x07\x6c\xb1\x4d", + "\xa4\xc9\xc2\x80\x1b\x71\xf7\xdf", "\xb9\xb9\x10\x43\x3a\xf0\x52\xb0", + "\x45\x30\xf5\x1a\xee\xe0\x24\xe0\xa4\x45\xa6\x32\x8f\xa6\x7a\x18", 1, 64, 64 }, { 96, 256, 128, 20, "\xe1\x09\x49\x67\xf8\x6d\x89\x3c\xdf\xe2\xe2\xe6\xd5\xc7\xee\x4d\xfe" "\xf6\x7d\xa3\xc9\xc5\xd6\x4e\x6a\xd7\xc1\x57\x7d\xcb\x38\xc5", "\x80\x92\xfc\x24\x5b\x33\x26\xcd\xdb\xd1\x42\x4c", "", - "\xc3\x7a\xa7\x91\xdd\xd6\xac\xcf\x91", - "\xd9\xd8\x97\xa9\xc1\xc5\xbb\x9f\x01", - "\x08\x5a\x43\x03\x73\x05\x8f\x1a\x12\xa0\xd5\x89\xfd\x5b\xe6\x8b", 1, - 0, 72 }, + "\xc3\x7a\xa7\x91\xdd\xd6\xac\xcf\x91", "\xd9\xd8\x97\xa9\xc1\xc5\xbb\x9f\x01", + "\x08\x5a\x43\x03\x73\x05\x8f\x1a\x12\xa0\xd5\x89\xfd\x5b\xe6\x8b", 1, 0, 72 }, { 96, 256, 128, 21, "\x23\x6f\x9b\xae\xe4\xf9\xda\x15\xbe\xec\xa4\x0f\xf4\xaf\x7c\x76\x0f" "\x25\x4a\x64\xbc\x3a\x3d\x7f\x4f\xad\x55\x7e\x61\xb6\x85\x86", - "\xf1\xca\x81\x33\x86\x29\x58\x7a\xcf\x93\x72\xbf", - "\x8c\x32\xf4\x7a\x38\x61\x52\xec", - "\xd7\xf2\x6d\x52\x52\xe1\x76\x5f\x5b", - "\x8f\xdb\x42\x9d\x47\x76\x1c\xbf\x8e", - "\x8e\xf6\x47\xed\x33\x4f\xde\xbb\xc2\xbe\xf8\x0b\xe0\x28\x84\xe0", 1, - 64, 72 }, + "\xf1\xca\x81\x33\x86\x29\x58\x7a\xcf\x93\x72\xbf", "\x8c\x32\xf4\x7a\x38\x61\x52\xec", + "\xd7\xf2\x6d\x52\x52\xe1\x76\x5f\x5b", "\x8f\xdb\x42\x9d\x47\x76\x1c\xbf\x8e", + "\x8e\xf6\x47\xed\x33\x4f\xde\xbb\xc2\xbe\xf8\x0b\xe0\x28\x84\xe0", 1, 64, 72 }, { 96, 256, 128, 22, "\x4d\xe2\x07\xa3\xb7\x0c\x51\xe5\xf2\x30\x48\xee\xd5\xa5\xda\x9b\xb6" "\x5e\x91\x7a\x69\xaa\x93\xe7\xc8\xb4\xa8\x15\xcd\x97\x24\xde", "\x4c\x15\xa7\x1d\xc6\x79\x1a\x8c\x00\x5a\xd5\x02", "", - "\xf2\xc5\x4b\x6b\x5e\x49\x0d\xa1\x86\x59", - "\x70\x0d\x35\xad\xf5\x10\x0a\x22\xa1\xde", - "\x10\x2d\x99\x2f\xfa\xff\x59\x9b\x5b\xdd\xdd\xeb\x2d\xfb\x39\x9b", 1, - 0, 80 }, + "\xf2\xc5\x4b\x6b\x5e\x49\x0d\xa1\x86\x59", "\x70\x0d\x35\xad\xf5\x10\x0a\x22\xa1\xde", + "\x10\x2d\x99\x2f\xfa\xff\x59\x9b\x5b\xdd\xdd\xeb\x2d\xfb\x39\x9b", 1, 0, 80 }, { 96, 256, 128, 23, "\x6d\x66\x7f\xd7\x9e\x5f\xb7\x25\xf5\x03\x43\xdc\xcc\x48\x63\x22\x7c" "\x75\xee\x3f\x7a\x57\x84\x76\xe3\xe9\xf3\x25\x98\xd8\x15\x59", - "\x62\x20\x52\x7a\xba\x88\xe2\x7f\x76\x66\x58\xb2", - "\xe1\xe2\x7c\xcd\xdb\x3c\xb4\x07", - "\x0c\x8c\x5a\x25\x26\x81\xf2\xb5\xb4\xc0", - "\x04\xaa\xd6\x6c\x60\xe0\xbf\x8e\xbb\xa9", - "\xc1\x5f\x69\xa4\xd2\xae\xf9\x7d\x77\x48\x75\x6f\xf4\x9d\x89\x4b", 1, - 64, 80 }, + "\x62\x20\x52\x7a\xba\x88\xe2\x7f\x76\x66\x58\xb2", "\xe1\xe2\x7c\xcd\xdb\x3c\xb4\x07", + "\x0c\x8c\x5a\x25\x26\x81\xf2\xb5\xb4\xc0", "\x04\xaa\xd6\x6c\x60\xe0\xbf\x8e\xbb\xa9", + "\xc1\x5f\x69\xa4\xd2\xae\xf9\x7d\x77\x48\x75\x6f\xf4\x9d\x89\x4b", 1, 64, 80 }, { 96, 256, 128, 24, "\x8f\x4b\xd9\x4e\xf7\x3e\x75\xd1\xe0\x68\xc3\x0b\x37\xea\xd5\x76\xc5" "\x34\x4e\x09\x3e\xce\x13\x30\xe9\x10\x1c\x82\xf7\x93\xcf\x05", "\xec\x1e\x29\x67\xf0\xf6\x97\x9e\x5f\x5b\x07\xfb", "", "\xb8\x98\x12\xb3\x4d\x9b\xce\xd4\xa0\xba\x07", "\x1c\x3d\x53\xba\xaa\x36\xea\xa1\xd8\xec\x4d", - "\x4d\x94\xeb\xf9\x60\xf1\x24\x33\xbe\xc4\x3a\xa8\x6d\x7e\x6e\x6d", 1, - 0, 88 }, + "\x4d\x94\xeb\xf9\x60\xf1\x24\x33\xbe\xc4\x3a\xa8\x6d\x7e\x6e\x6d", 1, 0, 88 }, { 96, 256, 128, 25, "\x2a\xa3\xbc\x70\x33\x35\x1c\xac\x51\x36\x4c\xda\xf6\xff\xac\x2c\x20" "\xf6\x40\x46\xe1\x55\x0a\x7b\x1c\x65\xf4\x18\x00\x59\x90\x19", - "\x28\xcc\xe5\x7a\x5d\xb2\xcd\x20\x63\x21\xe3\x40", - "\xa9\xbc\x35\x0e\xaf\x2e\x6e\x3d", + "\x28\xcc\xe5\x7a\x5d\xb2\xcd\x20\x63\x21\xe3\x40", "\xa9\xbc\x35\x0e\xaf\x2e\x6e\x3d", "\x83\x01\x68\x23\x12\x34\x84\xb5\x60\x95\xb0", "\x1c\x85\x78\xf8\xe7\x52\x03\xd0\x33\x6a\x52", - "\x59\x10\xf7\xa9\xd5\xe4\xdf\x05\xd7\x24\x8b\xd7\xa8\xd6\x5e\x63", 1, - 64, 88 }, + "\x59\x10\xf7\xa9\xd5\xe4\xdf\x05\xd7\x24\x8b\xd7\xa8\xd6\x5e\x63", 1, 64, 88 }, { 96, 256, 128, 26, "\x99\xb6\x2b\xd5\xaf\xbe\x3f\xb0\x15\xbd\xe9\x3f\x0a\xbf\x48\x39\x57" "\xa1\xc3\xeb\x3c\xa5\x9c\xb5\x0b\x39\xf7\xf8\xa9\xcc\x51\xbe", "\x9a\x59\xfc\xe2\x6d\xf0\x00\x5e\x07\x53\x86\x56", "", "\x42\xba\xae\x59\x78\xfe\xaf\x5c\x36\x8d\x14\xe0", "\xff\x7d\xc2\x03\xb2\x6c\x46\x7a\x6b\x50\xdb\x33", - "\x57\x8c\x0f\x27\x58\xc2\xe1\x4e\x36\xd4\xfc\x10\x6d\xcb\x29\xb4", 1, - 0, 96 }, + "\x57\x8c\x0f\x27\x58\xc2\xe1\x4e\x36\xd4\xfc\x10\x6d\xcb\x29\xb4", 1, 0, 96 }, { 96, 256, 128, 27, "\x85\xf3\x5b\x62\x82\xcf\xf4\x40\xbc\x10\x20\xc8\x13\x6f\xf2\x70\x31" "\x11\x0f\xa6\x3e\xc1\x6f\x1e\x82\x51\x18\xb0\x06\xb9\x12\x57", - "\x58\xdb\xd4\xad\x2c\x4a\xd3\x5d\xd9\x06\xe9\xce", - "\xa5\x06\xe1\xa5\xc6\x90\x93\xf9", + "\x58\xdb\xd4\xad\x2c\x4a\xd3\x5d\xd9\x06\xe9\xce", "\xa5\x06\xe1\xa5\xc6\x90\x93\xf9", "\xfd\xc8\x5b\x94\xa4\xb2\xa6\xb7\x59\xb1\xa0\xda", "\x9f\x88\x16\xde\x09\x94\xe9\x38\xd9\xe5\x3f\x95", - "\xd0\x86\xfc\x6c\x9d\x8f\xa9\x15\xfd\x84\x23\xa7\xcf\x05\x07\x2f", 1, - 64, 96 }, + "\xd0\x86\xfc\x6c\x9d\x8f\xa9\x15\xfd\x84\x23\xa7\xcf\x05\x07\x2f", 1, 64, 96 }, { 96, 256, 128, 28, "\xfa\xf4\xbf\xe8\x01\x9a\x89\x1c\x74\x90\x1b\x17\xf4\xf4\x8c\xee\x5c" "\xd0\x65\xd5\x5f\xde\xa6\x01\x18\xaa\xf6\xc4\x31\x9a\x0e\xa5", "\xb7\x76\xc3\xfd\xdb\xa7\xc8\x13\x62\xce\x6e\x1b", "", "\x8d\xad\xff\x8d\x60\xc8\xe8\x8f\x60\x4f\x27\x48\x33", "\xe6\xb3\x3a\x74\xa4\xac\x44\x3b\xd9\x3f\x9c\x1b\x94", - "\x0c\x11\x51\x72\xbd\xb0\x2b\xba\xd3\x13\x0f\xff\x22\x79\x0d\x60", 1, - 0, 104 }, + "\x0c\x11\x51\x72\xbd\xb0\x2b\xba\xd3\x13\x0f\xff\x22\x79\x0d\x60", 1, 0, 104 }, { 96, 256, 128, 29, "\x84\x10\x20\xd1\x60\x6e\xdc\xfc\x53\x6a\xbf\xb1\xa6\x38\xa7\xb9\x58" "\xe2\x1e\xfc\x10\xc3\x86\xac\x45\xa1\x84\x93\x45\x0a\xfd\x5f", - "\x6d\x62\xf1\x59\x73\x1b\x14\x0e\xb1\x8c\xe0\x74", - "\x5a\x8e\x1c\x7a\xa3\x98\x10\xd5", + "\x6d\x62\xf1\x59\x73\x1b\x14\x0e\xb1\x8c\xe0\x74", "\x5a\x8e\x1c\x7a\xa3\x98\x10\xd5", "\xd6\xaf\x13\x8f\x70\x1b\x80\x1e\x60\xc8\x5f\xfd\x5c", "\xb0\xa7\x50\x0a\xca\x45\xbb\x15\xf0\x1e\xce\x43\x89", - "\x01\x60\xe8\x3a\xdb\xec\x7f\x6a\x2e\xe2\xff\x02\x15\xf9\xef\x00", 1, - 64, 104 }, + "\x01\x60\xe8\x3a\xdb\xec\x7f\x6a\x2e\xe2\xff\x02\x15\xf9\xef\x00", 1, 64, 104 }, { 96, 256, 128, 30, "\x47\x0f\x9c\xe3\xd2\x25\x0b\xd6\x0c\xbb\xef\xdb\x2e\x6a\x11\x78\xc0" "\x12\x29\x9b\x55\x90\x63\x9c\x77\x97\xb6\x02\x4f\xa7\x03\xd8", "\xa9\xea\x4d\x61\x9f\xe4\x05\xd0\x4c\xba\x7d\x7a", "", "\x6c\xa6\x7d\xd0\x23\xfb\xa6\x50\x7b\x9f\x9a\x1f\x66\x7e", "\xd3\x01\x7e\x0b\xb1\x70\x5b\x38\x0b\x34\xcc\x33\x34\x50", - "\x57\x08\xe7\x2c\xa2\xbd\x35\x4f\x48\x7f\x82\xf6\x7f\xbc\x3a\xcb", 1, - 0, 112 }, + "\x57\x08\xe7\x2c\xa2\xbd\x35\x4f\x48\x7f\x82\xf6\x7f\xbc\x3a\xcb", 1, 0, 112 }, { 96, 256, 128, 31, "\xe4\xb9\x7e\x91\xe4\xc8\xe8\x5e\xb7\xce\x0a\x7f\x30\xbf\x8a\x0a\xbf" "\x44\x68\x25\x1e\x4c\x63\x86\xc0\xe7\xaa\xcb\x8e\x87\x9a\xa8", - "\x0e\x23\xc9\x42\xa0\xc9\xfb\x52\x65\x86\xee\xad", - "\xea\xaa\xea\xb2\x69\x57\xf9\xa1", + "\x0e\x23\xc9\x42\xa0\xc9\xfb\x52\x65\x86\xee\xad", "\xea\xaa\xea\xb2\x69\x57\xf9\xa1", "\xb8\x4b\x3f\x74\xcd\x23\x06\x4b\xb4\x26\xfe\x2c\xed\x2b", "\x52\xe9\x67\x2b\x41\x6d\x84\xd9\x70\x33\x79\x60\x72\xd0", - "\xe8\x38\x39\xdc\x1f\xd9\xb8\xb9\xd1\x44\x4c\x40\xe4\x88\xd4\x93", 1, - 64, 112 }, + "\xe8\x38\x39\xdc\x1f\xd9\xb8\xb9\xd1\x44\x4c\x40\xe4\x88\xd4\x93", 1, 64, 112 }, { 96, 256, 128, 32, "\x67\x11\x96\x27\xbd\x98\x8e\xda\x90\x62\x19\xe0\x8c\x0d\x0d\x77\x9a" "\x07\xd2\x08\xce\x8a\x4f\xe0\x70\x9a\xf7\x55\xee\xec\x6d\xcb", "\x68\xab\x7f\xdb\xf6\x19\x01\xda\xd4\x61\xd2\x3c", "", "\x51\xf8\xc1\xf7\x31\xea\x14\xac\xdb\x21\x0a\x6d\x97\x3e\x07", "\x0b\x29\x63\x8e\x1f\xbd\xd6\xdf\x53\x97\x0b\xe2\x21\x00\x42", - "\x2a\x91\x34\x08\x7d\x67\xa4\x6e\x79\x17\x8d\x0a\x93\xf5\xe1\xd2", 1, - 0, 120 }, + "\x2a\x91\x34\x08\x7d\x67\xa4\x6e\x79\x17\x8d\x0a\x93\xf5\xe1\xd2", 1, 0, 120 }, { 96, 256, 128, 33, "\xe6\xf1\x11\x8d\x41\xe4\xb4\x3f\xb5\x82\x21\xb7\xed\x79\x67\x38\x34" "\xe0\xd8\xac\x5c\x4f\xa6\x0b\xbc\x8b\xc4\x89\x3a\x58\x89\x4d", - "\xd9\x5b\x32\x43\xaf\xae\xf7\x14\xc5\x03\x5b\x6a", - "\x64\x53\xa5\x33\x84\x63\x22\x12", + "\xd9\x5b\x32\x43\xaf\xae\xf7\x14\xc5\x03\x5b\x6a", "\x64\x53\xa5\x33\x84\x63\x22\x12", "\x97\x46\x9d\xa6\x67\xd6\x11\x0f\x9c\xbd\xa1\xd1\xa2\x06\x73", "\x32\xdb\x66\xc4\xa3\x81\x9d\x81\x55\x74\x55\xe5\x98\x0f\xed", - "\xfe\xae\x30\xde\xc9\x4e\x6a\xd3\xa9\xee\xa0\x6a\x0d\x70\x39\x17", 1, - 64, 120 }, + "\xfe\xae\x30\xde\xc9\x4e\x6a\xd3\xa9\xee\xa0\x6a\x0d\x70\x39\x17", 1, 64, 120 }, { 96, 256, 128, 34, "\x59\xd4\xea\xfb\x4d\xe0\xcf\xc7\xd3\xdb\x99\xa8\xf5\x4b\x15\xd7\xb3" "\x9f\x0a\xcc\x8d\xa6\x97\x63\xb0\x19\xc1\x69\x9f\x87\x67\x4a", "\x2f\xcb\x1b\x38\xa9\x9e\x71\xb8\x47\x40\xad\x9b", "", "\x54\x9b\x36\x5a\xf9\x13\xf3\xb0\x81\x13\x1c\xcb\x6b\x82\x55\x88", "\xe9\x11\x0e\x9f\x56\xab\x3c\xa4\x83\x50\x0c\xea\xba\xb6\x7a\x13", - "\x83\x6c\xca\xbf\x15\xa6\xa2\x2a\x51\xc1\x07\x1c\xfa\x68\xfa\x0c", 1, - 0, 128 }, + "\x83\x6c\xca\xbf\x15\xa6\xa2\x2a\x51\xc1\x07\x1c\xfa\x68\xfa\x0c", 1, 0, 128 }, { 96, 256, 128, 35, "\xb9\x07\xa4\x50\x75\x51\x3f\xe8\xa8\x01\x9e\xde\xe3\xf2\x59\x14\x87" "\xb2\xa0\x30\xb0\x3c\x6e\x1d\x77\x1c\x86\x25\x71\xd2\xea\x1e", - "\x11\x8a\x69\x64\xc2\xd3\xe3\x80\x07\x1f\x52\x66", - "\x03\x45\x85\x62\x1a\xf8\xd7\xff", + "\x11\x8a\x69\x64\xc2\xd3\xe3\x80\x07\x1f\x52\x66", "\x03\x45\x85\x62\x1a\xf8\xd7\xff", "\x55\xa4\x65\x64\x4f\x5b\x65\x09\x28\xcb\xee\x7c\x06\x32\x14\xd6", "\xe4\xb1\x13\xcb\x77\x59\x45\xf3\xd3\xa8\xae\x9e\xc1\x41\xc0\x0c", - "\x7c\x43\xf1\x6c\xe0\x96\xd0\xdc\x27\xc9\x58\x49\xdc\x38\x3b\x7d", 1, - 64, 128 }, + "\x7c\x43\xf1\x6c\xe0\x96\xd0\xdc\x27\xc9\x58\x49\xdc\x38\x3b\x7d", 1, 64, 128 }, { 96, 256, 128, 36, "\x3b\x24\x58\xd8\x17\x6e\x16\x21\xc0\xcc\x24\xc0\xc0\xe2\x4c\x1e\x80" "\xd7\x2f\x7e\xe9\x14\x9a\x4b\x16\x61\x76\x62\x96\x16\xd0\x11", @@ -326,19 +268,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x1f", "\x02\xcc\x3a\xcb\x5e\xe1\xfc\xdd\x12\xa0\x3b\xb8\x57\x97\x64\x74" "\xd3", - "\xd8\x3b\x74\x63\xa2\xc3\x80\x0f\xe9\x58\xc2\x8e\xaa\x29\x08\x13", 1, - 0, 136 }, + "\xd8\x3b\x74\x63\xa2\xc3\x80\x0f\xe9\x58\xc2\x8e\xaa\x29\x08\x13", 1, 0, 136 }, { 96, 256, 128, 37, "\xf6\x0c\x6a\x1b\x62\x57\x25\xf7\x6c\x70\x37\xb4\x8f\xe3\x57\x7f\xa7" "\xf7\xb8\x7b\x1b\xd5\xa9\x82\x17\x6d\x18\x23\x06\xff\xb8\x70", - "\xf0\x38\x4f\xb8\x76\x12\x14\x10\x63\x3d\x99\x3d", - "\x9a\xaf\x29\x9e\xee\xa7\x8f\x79", + "\xf0\x38\x4f\xb8\x76\x12\x14\x10\x63\x3d\x99\x3d", "\x9a\xaf\x29\x9e\xee\xa7\x8f\x79", "\x63\x85\x8c\xa3\xe2\xce\x69\x88\x7b\x57\x8a\x3c\x16\x7b\x42\x1c" "\x9c", "\x35\x76\x64\x88\xd2\xbc\x7c\x2b\x8d\x17\xcb\xbb\x9a\xbf\xad\x9e" "\x6d", - "\x1f\x39\x1e\x65\x7b\x27\x38\xdd\xa0\x84\x48\xcb\xa2\x81\x1c\xeb", 1, - 64, 136 }, + "\x1f\x39\x1e\x65\x7b\x27\x38\xdd\xa0\x84\x48\xcb\xa2\x81\x1c\xeb", 1, 64, 136 }, { 96, 256, 128, 38, "\x37\xce\xb5\x74\xcc\xb0\xb7\x01\xdd\x11\x36\x93\x88\xca\x27\x10\x17" "\x32\x33\x9f\x49\xd8\xd9\x08\xac\xe4\xb2\x3a\xf0\xb7\xce\x89", @@ -347,19 +286,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x6b", "\xb6\x21\xd7\x6a\x8d\xac\xff\x00\xb3\xf8\x40\xcd\xf2\x6c\x89\x4c\xc5" "\xd1", - "\xe0\xa2\x17\x16\xed\x94\xc0\x38\x2f\xa9\xb0\x90\x3d\x15\xbb\x68", 1, - 0, 144 }, + "\xe0\xa2\x17\x16\xed\x94\xc0\x38\x2f\xa9\xb0\x90\x3d\x15\xbb\x68", 1, 0, 144 }, { 96, 256, 128, 39, "\x68\x88\x83\x61\x91\x9b\xc1\x06\x22\xf4\x5d\xf1\x68\xe5\xf6\xa0\x3b" "\xd8\xe8\x84\xc0\x61\x1b\xea\x2f\x34\xc1\x88\x2e\xd9\x83\x2b", - "\xbf\xd6\xff\x40\xf2\xdf\x8c\xa7\x84\x59\x80\xcc", - "\xb8\x37\x34\x38\xdd\xb2\xd6\xc3", + "\xbf\xd6\xff\x40\xf2\xdf\x8c\xa7\x84\x59\x80\xcc", "\xb8\x37\x34\x38\xdd\xb2\xd6\xc3", "\xff\x97\xf2\xee\xfb\x34\x01\xac\x31\xfc\x8d\xc1\x59\x0d\x1a\x92\xcb" "\xc1", "\xe0\xa7\x45\x18\x6c\x1a\x7b\x14\x7f\x74\xfa\xff\x2a\x71\x5d\xf5\xc1" "\x9d", - "\x91\x7b\xaf\x70\x3e\x35\x5d\x4d\x95\x0e\x6c\x05\xfe\x8f\x34\x9f", 1, - 64, 144 }, + "\x91\x7b\xaf\x70\x3e\x35\x5d\x4d\x95\x0e\x6c\x05\xfe\x8f\x34\x9f", 1, 64, 144 }, { 96, 256, 128, 40, "\x1b\x35\xb8\x56\xb5\xa8\x6d\x34\x03\xd2\x8f\xc2\x10\x3a\x63\x1d\x42" "\xde\xca\x51\x75\xcd\xb0\x66\x9a\x5e\x5d\x90\xb2\xca\xaf\xc5", @@ -368,19 +304,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x78\x1d", "\xd6\xe0\xed\x54\xfc\xce\xf3\x0b\xd6\x05\xd7\x2d\xa3\x32\x0e\x24\x9a" "\x9c\xb5", - "\xc6\x8b\xc6\x72\x4e\xc8\x03\xc4\x39\x84\xce\x42\xf6\xbd\x09\xff", 1, - 0, 152 }, + "\xc6\x8b\xc6\x72\x4e\xc8\x03\xc4\x39\x84\xce\x42\xf6\xbd\x09\xff", 1, 0, 152 }, { 96, 256, 128, 41, "\xd6\x48\x4e\x39\x73\xf6\xbe\x8c\x83\xed\x32\x08\xd5\xbe\x5c\xfa\x06" "\xfd\xa7\x2f\xbf\xdc\x5b\x19\xd0\x9b\xe3\xf4\xe4\xeb\xa2\x9d", - "\x1a\xf1\xd9\x0e\x87\x7e\x11\xa4\x96\xef\xa3\xdf", - "\xcc\x4e\xfd\x83\x64\xfb\x11\x4a", + "\x1a\xf1\xd9\x0e\x87\x7e\x11\xa4\x96\xef\xa3\xdf", "\xcc\x4e\xfd\x83\x64\xfb\x11\x4a", "\x73\x35\xab\x04\xb0\x3e\x70\x61\x09\xec\x3e\xe8\x35\xdb\x9a\x24\x6e" "\xa0\xad", "\x29\xe5\x4d\x60\x82\x37\xc3\xc3\x60\x9d\xba\x16\xe6\xed\xf4\x38\x42" "\xd7\x2f", - "\xd3\x36\x5f\xdc\xd5\x06\xaa\xaa\x53\x68\x66\x1e\x80\xe9\xd9\x9b", 1, - 64, 152 }, + "\xd3\x36\x5f\xdc\xd5\x06\xaa\xaa\x53\x68\x66\x1e\x80\xe9\xd9\x9b", 1, 64, 152 }, { 96, 256, 128, 42, "\x42\x2a\xdd\x37\x84\x9d\x6e\x4c\x3d\xfd\x80\x20\xdc\x6a\x07\xe8\xa2" "\x49\x78\x8f\x3d\x6a\x83\xb9\xcb\x4d\x80\x23\x62\xc9\x75\x42", @@ -389,19 +322,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x0d\xc8\x7d", "\x7f\xe6\x06\x65\x2d\x85\x8f\x59\x5e\xc2\xe7\x06\x75\x4f\xa3\xd9\x33" "\xfc\xc8\x34", - "\x78\xd5\x92\x35\xaa\x5d\x03\xa4\xc3\x25\x90\xe5\x90\xc0\x4d\x22", 1, - 0, 160 }, + "\x78\xd5\x92\x35\xaa\x5d\x03\xa4\xc3\x25\x90\xe5\x90\xc0\x4d\x22", 1, 0, 160 }, { 96, 256, 128, 43, "\xcd\xcc\xfe\x3f\x46\xd7\x82\xef\x47\xdf\x4e\x72\xf0\xc0\x2d\x9c\x7f" "\x77\x4d\xef\x97\x0d\x23\x48\x6f\x11\xa5\x7f\x54\x24\x7f\x17", - "\x37\x61\x87\x89\x46\x05\xa8\xd4\x5e\x30\xde\x51", - "\x95\x68\x46\xa2\x09\xe0\x87\xed", + "\x37\x61\x87\x89\x46\x05\xa8\xd4\x5e\x30\xde\x51", "\x95\x68\x46\xa2\x09\xe0\x87\xed", "\xe2\x8e\x0e\x9f\x9d\x22\x46\x3a\xc0\xe4\x26\x39\xb5\x30\xf4\x21\x02" "\xfd\xed\x75", "\x14\xf7\x07\xc4\x46\x98\x8a\x49\x03\x77\x5e\xc7\xac\xec\x6d\xa1\x14" "\xd4\x31\x12", - "\x98\x7d\x4b\x14\x7c\x49\x0d\x43\xd3\x76\xa1\x98\xca\xb3\x83\xf0", 1, - 64, 160 }, + "\x98\x7d\x4b\x14\x7c\x49\x0d\x43\xd3\x76\xa1\x98\xca\xb3\x83\xf0", 1, 64, 160 }, { 96, 256, 128, 44, "\xe7\x9d\xfc\x6d\x2f\xc4\x65\xb8\x43\x9e\x1c\x5b\xac\xcb\x5d\x8e\xf2" "\x85\x38\x99\xfc\x19\x75\x3b\x39\x7e\x6c\x25\xb3\x5e\x97\x7e", @@ -410,19 +340,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x48\x16\x81\x3b", "\x10\x03\xf1\x3e\xa1\x32\x9c\xbb\x18\x73\x16\xf6\x4c\x3f\xf3\xa8\x7c" "\xf5\xb9\x66\x61", - "\xd2\x32\x3a\xd6\x25\x09\x4b\xec\x84\x79\x0d\x79\x58\xd5\x58\x3f", 1, - 0, 168 }, + "\xd2\x32\x3a\xd6\x25\x09\x4b\xec\x84\x79\x0d\x79\x58\xd5\x58\x3f", 1, 0, 168 }, { 96, 256, 128, 45, "\x1d\x7b\x8f\x1d\x96\xa1\x42\x49\x23\xae\xf8\xa9\x84\x86\x9d\x4a\x77" "\x7a\x11\x09\x90\xba\x46\x56\x27\xac\xf8\x03\x96\xc7\xf3\x76", - "\x50\xba\x19\x62\xcd\xc3\x2a\x5a\x2d\x36\xe6\x40", - "\x09\x30\x53\xe2\x02\x61\xda\xab", + "\x50\xba\x19\x62\xcd\xc3\x2a\x5a\x2d\x36\xe6\x40", "\x09\x30\x53\xe2\x02\x61\xda\xab", "\x5d\x3e\xfd\x57\x67\xf3\xc1\x2e\xfd\x08\xaf\x9a\x44\xe0\x28\xae\x68" "\xc9\xef\xf8\x43", "\x2d\x48\xb0\x83\x4e\x9f\xfe\x30\x46\x10\x3e\xf7\xa2\x14\xf0\x2e\x8e" "\x4d\x33\x36\x0e", - "\xd5\x33\xad\x08\x9b\xe2\x29\xea\x60\x6e\xc0\xf3\xfa\x22\xeb\x33", 1, - 64, 168 }, + "\xd5\x33\xad\x08\x9b\xe2\x29\xea\x60\x6e\xc0\xf3\xfa\x22\xeb\x33", 1, 64, 168 }, { 96, 256, 128, 46, "\xdd\x43\x3e\x28\xcf\xbc\xb5\xde\x4a\xb3\x6a\x02\xbf\x38\x68\x6d\x83" "\x20\x87\x71\xa0\xe6\x3d\xcd\x08\xb4\xdf\x1a\x07\xac\x47\xa1", @@ -431,19 +358,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x23\x73\x63\x24\x89", "\xe9\x91\x7f\xf3\xe6\x4b\xbe\x17\x83\x57\x93\x75\xe7\x5e\xa8\x23\x97" "\x6b\x35\x53\x99\x49", - "\x07\x4a\x89\x06\x69\xb2\x51\x05\x43\x4c\x75\xbe\xed\x32\x48\xdb", 1, - 0, 176 }, + "\x07\x4a\x89\x06\x69\xb2\x51\x05\x43\x4c\x75\xbe\xed\x32\x48\xdb", 1, 0, 176 }, { 96, 256, 128, 47, "\xa6\x09\x24\x10\x1b\x42\xac\x24\x15\x4a\x88\xde\x42\x14\x2b\x23\x34" "\xcf\x59\x91\x76\xca\xf4\xd1\x22\x6f\x71\x2d\xd9\x17\x29\x30", - "\x8b\xa7\x76\x44\xb0\x8d\x65\xd5\xe9\xf3\x19\x42", - "\xb2\xa4\xe1\x2a\x19\xa6\x1c\x75", + "\x8b\xa7\x76\x44\xb0\x8d\x65\xd5\xe9\xf3\x19\x42", "\xb2\xa4\xe1\x2a\x19\xa6\x1c\x75", "\xc9\x49\x95\x7e\x66\x43\x9d\xee\xe4\xb2\xac\x1d\x4a\x6c\x98\xa6\xc5" "\x27\xb9\x0f\x52\xab", "\xdb\x4c\x70\x05\x13\x81\x89\x72\xb0\xdc\x0e\x53\x1b\x1c\x28\x1c\xa0" "\x3e\x40\xc6\x0d\xea", - "\x63\xf4\x47\x8b\xba\x2a\xf4\x69\xa7\xa4\xdc\x3b\x4f\x14\x13\x60", 1, - 64, 176 }, + "\x63\xf4\x47\x8b\xba\x2a\xf4\x69\xa7\xa4\xdc\x3b\x4f\x14\x13\x60", 1, 64, 176 }, { 96, 256, 128, 48, "\x1a\xa4\x20\x27\x83\x69\x65\xb1\xe6\x08\x6f\xa1\x37\xf9\xcf\x7f\x1f" "\xf4\x86\x76\x69\x68\x29\xbd\x28\x1f\xf8\x1c\x8e\xa0\xa4\xa9", @@ -452,19 +376,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xd0\xa1\x9a\x4b\x9a\x47", "\xb5\xf1\x46\x17\x49\x1f\xc9\x23\xb6\x83\xe2\xcc\x95\x62\xd0\x43\xdd" "\x59\x86\xb9\x7d\xbd\xbd", - "\x97\x2c\xe5\x47\x13\xc0\x5c\x4b\xb4\xd0\x88\xc0\xa3\x0c\xac\xd3", 1, - 0, 184 }, + "\x97\x2c\xe5\x47\x13\xc0\x5c\x4b\xb4\xd0\x88\xc0\xa3\x0c\xac\xd3", 1, 0, 184 }, { 96, 256, 128, 49, "\x5d\x40\xdb\x0c\xc1\x8e\xf2\xe4\x28\x15\xd3\xb6\x24\x5a\x46\x6a\x0b" "\x30\xa0\xf9\x3e\x31\x8a\xc1\x0e\xdd\xe3\xbf\x8a\xd9\x81\x60", - "\xac\xad\x61\x80\x39\xb3\x17\x47\x0d\x21\x62\x1b", - "\x41\x30\x36\x41\x1a\xf7\x57\x45", + "\xac\xad\x61\x80\x39\xb3\x17\x47\x0d\x21\x62\x1b", "\x41\x30\x36\x41\x1a\xf7\x57\x45", "\x95\x9d\xde\x1e\xf3\x12\x9b\x27\x70\x2c\x55\x88\x49\xe4\x66\xf2\xba" "\xca\x1a\x45\xbd\xf4\xb2", "\xb7\xca\x38\x79\xf9\x51\x40\xbf\x6a\x97\xb3\x21\x22\x18\xb7\xbf\x86" "\x4a\x51\xe5\xbb\x0b\x3e", - "\xfe\x55\x8f\xb5\x70\x14\x54\x70\xea\x69\x3e\xb7\x6e\xb7\x31\x71", 1, - 64, 184 }, + "\xfe\x55\x8f\xb5\x70\x14\x54\x70\xea\x69\x3e\xb7\x6e\xb7\x31\x71", 1, 64, 184 }, { 96, 256, 128, 50, "\x02\x12\xa8\xde\x50\x07\xed\x87\xb3\x3f\x1a\x70\x90\xb6\x11\x4f\x9e" "\x08\xce\xfd\x96\x07\xf2\xc2\x76\xbd\xcf\xdb\xc5\xce\x9c\xd7", @@ -473,19 +394,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x7e\xea\x69\x16\xd2\xb1\x11", "\x42\xf2\x6c\x56\xcb\x4b\xe2\x1d\x9d\x8d\x0c\x80\xfc\x99\xdd\xe0\x0d" "\x75\xf3\x80\x74\xbf\xe7\x64", - "\x54\xaa\x7e\x13\xd4\x8f\xff\x7d\x75\x57\x03\x94\x57\x04\x0a\x3a", 1, - 0, 192 }, + "\x54\xaa\x7e\x13\xd4\x8f\xff\x7d\x75\x57\x03\x94\x57\x04\x0a\x3a", 1, 0, 192 }, { 96, 256, 128, 51, "\xc5\xbc\x09\x56\x56\x46\xe7\xed\xda\x95\x4f\x1f\x73\x92\x23\xda\xda" "\x20\xb9\x5c\x44\xab\x03\x3d\x0f\xae\x4b\x02\x83\xd1\x8b\xe3", - "\x6b\x28\x2e\xbe\xcc\x54\x1b\xcd\x78\x34\xed\x55", - "\x3e\x8b\xc5\xad\xe1\x82\xff\x08", + "\x6b\x28\x2e\xbe\xcc\x54\x1b\xcd\x78\x34\xed\x55", "\x3e\x8b\xc5\xad\xe1\x82\xff\x08", "\x92\x22\xf9\x01\x8e\x54\xfd\x6d\xe1\x20\x08\x06\xa9\xee\x8e\x4c\xc9" "\x04\xd2\x9f\x25\xcb\xa1\x93", "\x12\x30\x32\x43\x7b\x4b\xfd\x69\x20\xe8\xf7\xe7\xe0\x08\x7a\xe4\x88" "\x9e\xbe\x7a\x0a\xd0\xe9\x00", - "\x3c\xf6\x8f\x17\x95\x50\xda\x63\xd3\xb9\x6c\x2d\x55\x41\x18\x65", 1, - 64, 192 }, + "\x3c\xf6\x8f\x17\x95\x50\xda\x63\xd3\xb9\x6c\x2d\x55\x41\x18\x65", 1, 64, 192 }, { 96, 256, 128, 52, "\x94\x60\xb3\xc4\x4e\xd8\x6e\x70\xf3\xbd\xa6\x63\x85\xe1\xca\x10\xb0" "\xc1\x67\x7e\xf4\xf1\x36\x05\x32\x83\x0d\x17\x53\x5f\x99\x6f", @@ -494,19 +412,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x28\x0a\xda\x77\x8c\xca\x09\x53", "\x1d\x21\x8c\x9f\x1f\x9f\x02\xf2\x48\xa6\xf9\x76\xa7\x55\x70\x57\xf3" "\x7d\x93\x93\xd9\xf2\x13\xc1\xf3", - "\xbc\x88\x34\x4c\x6f\xdc\x89\x8f\xee\xd3\x94\xfb\x28\x51\x13\x16", 1, - 0, 200 }, + "\xbc\x88\x34\x4c\x6f\xdc\x89\x8f\xee\xd3\x94\xfb\x28\x51\x13\x16", 1, 0, 200 }, { 96, 256, 128, 53, "\xc1\x11\xd6\xd5\xd7\x8a\x07\x1b\x15\xab\x37\xcc\x8c\x38\x19\x19\x93" "\x87\xab\x7c\x19\x33\xaa\x97\xb1\x48\x9f\x65\x84\xba\x8e\x2a", - "\x85\xf1\x8a\xd8\xff\x72\xca\xfe\xe2\x45\x2a\xb8", - "\x84\xcd\xff\x93\x93\x91\xc0\x22", + "\x85\xf1\x8a\xd8\xff\x72\xca\xfe\xe2\x45\x2a\xb8", "\x84\xcd\xff\x93\x93\x91\xc0\x22", "\x69\x89\xc6\x46\xa1\x0b\x7c\x76\xf4\xd9\xf7\xd5\x74\xda\x40\xe1\x52" "\x01\x3c\xf0\xdd\x78\xf5\xaa\x8a", "\x97\x15\xd3\x44\xe8\xd3\xf3\xa3\xea\xa9\x8a\x9c\xea\x57\xc0\xcd\x71" "\x7c\x6e\xf5\x07\x60\x27\xc9\xec", - "\x30\x56\xff\x5e\xe0\xaa\x86\x36\xbb\x63\x99\x84\xed\xb5\x23\x6b", 1, - 64, 200 }, + "\x30\x56\xff\x5e\xe0\xaa\x86\x36\xbb\x63\x99\x84\xed\xb5\x23\x6b", 1, 64, 200 }, { 96, 256, 128, 54, "\x8a\x1b\x1e\x69\x9a\x0c\x4a\x3e\x61\x0b\x10\x90\x2d\xae\xda\xb1\xbf" "\x1e\xa0\xd5\x05\xc4\x7d\x78\x42\xcb\xce\xe0\xd3\xb1\xb6\xe6", @@ -515,19 +430,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xfc\x36\xe1\xc8\x34\x40\xf6\x6a\xad", "\x90\x89\xbb\xdb\x8b\xcf\xd1\x24\xe2\x27\xbf\x75\xc4\xbf\xe1\xcb\xa2" "\x00\x4a\x27\x4f\xc3\x1a\xa3\x23\x58", - "\xfd\x2e\x21\xc6\x4a\x01\x96\x21\xc6\x85\x94\x82\x6c\xd7\xb1\xcd", 1, - 0, 208 }, + "\xfd\x2e\x21\xc6\x4a\x01\x96\x21\xc6\x85\x94\x82\x6c\xd7\xb1\xcd", 1, 0, 208 }, { 96, 256, 128, 55, "\x74\xb3\x84\xe6\xe0\x13\xec\x41\x72\xed\x7a\x28\xa1\x0f\xb9\xbb\x79" "\xb4\xbe\x2a\x24\xf6\x99\x9e\x3d\x3c\xaa\x28\xe6\x4a\x86\x56", - "\xeb\xc1\x9f\xc9\xec\xb2\x33\x99\x08\xea\x38\x36", - "\x85\x07\x3f\x2e\xdc\x13\xd3\xa1", + "\xeb\xc1\x9f\xc9\xec\xb2\x33\x99\x08\xea\x38\x36", "\x85\x07\x3f\x2e\xdc\x13\xd3\xa1", "\x3a\xa9\xf7\x37\x2f\x05\x6e\x5a\x07\x29\x75\x2d\x9a\x37\x13\x2d\x6d" "\xd0\x7c\x56\x79\x2e\x1c\x75\x82\xa9", "\x79\x6f\xfb\x70\xab\x43\xe7\xfa\x79\xf9\x55\x83\xe3\x84\x52\x47\x27" "\xbb\x3e\x47\xfc\x45\xb9\x69\xf7\x14", - "\xc3\x32\x2b\x44\x45\xde\x5f\x3c\x9f\x18\xdc\xc8\x47\xcc\x94\xc3", 1, - 64, 208 }, + "\xc3\x32\x2b\x44\x45\xde\x5f\x3c\x9f\x18\xdc\xc8\x47\xcc\x94\xc3", 1, 64, 208 }, { 96, 256, 128, 56, "\x77\xd8\x24\x79\x5d\x20\x29\xf0\xeb\x0e\x0b\xaa\xb5\xcf\xeb\x32\xf7" "\xe9\x34\x74\x91\x3a\x7f\x95\xc7\x37\xa6\x67\xa3\xc3\x33\x14", @@ -536,19 +448,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x3b\x7c\x71\x83\x59\xcf\x10\x51\x8a\xee", "\x49\xc8\x1d\x17\xd6\x7d\x7b\xa9\x95\x4f\x49\x7d\x0b\x0d\xdc\x21\xf3" "\xf8\x39\xc9\xd2\xcc\x19\x8d\x30\xbc\x2c", - "\x50\x00\x98\x99\xe5\xb2\xa9\x72\x6c\x8f\x35\x56\xca\xdf\xbe\x84", 1, - 0, 216 }, + "\x50\x00\x98\x99\xe5\xb2\xa9\x72\x6c\x8f\x35\x56\xca\xdf\xbe\x84", 1, 0, 216 }, { 96, 256, 128, 57, "\xbe\xc5\xea\xc6\x8f\x89\x39\x51\xcb\xd7\xd1\xec\xd3\xee\x66\x11\x13" "\x0d\xd9\xc3\xf8\x0c\xdd\xf9\x51\x11\xd0\x7d\x5e\xdd\x76\xd1", - "\x34\x2a\xda\x4f\x0c\x11\x51\x24\xb2\x22\xdf\x80", - "\x73\x36\x5f\x6d\x80\xed\xb1\xd8", + "\x34\x2a\xda\x4f\x0c\x11\x51\x24\xb2\x22\xdf\x80", "\x73\x36\x5f\x6d\x80\xed\xb1\xd8", "\x48\x14\x33\xd8\xb1\xcd\x38\xaf\x4a\x75\x0e\x13\xa6\x4b\x7a\x4e\x85" "\x07\x68\x2b\x35\x17\x59\x59\x38\xa2\x0e", "\x4c\x12\x9f\xc1\x3c\xbd\xd9\xd3\xfe\x81\xac\x75\x5b\xf4\xfb\xea\x2f" "\xdd\x7e\x0a\xca\x05\x05\xa6\xee\x96\x37", - "\x9c\xed\xe1\xd3\x0a\x03\xdb\x5d\x55\x26\x5d\x36\x48\xbc\x40\xd4", 1, - 64, 216 }, + "\x9c\xed\xe1\xd3\x0a\x03\xdb\x5d\x55\x26\x5d\x36\x48\xbc\x40\xd4", 1, 64, 216 }, { 96, 256, 128, 58, "\xa5\x9c\x1e\x13\x06\x4d\xf8\xf2\xb8\xdf\x77\xa4\x92\xb0\xca\x2e\xae" "\x92\x1b\x52\xa8\x4b\x30\x5a\x3a\x9a\x51\x40\x8a\x9e\xcb\x69", @@ -557,19 +466,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x02\xb3\x84\x90\x21\x86\xcd\x69\xdf\xd2\x0e", "\xa6\xfa\x8f\x57\xdd\xc8\x1d\x60\x99\xf6\x67\xdd\x62\x40\x2b\x6a\x5d" "\x5b\x7d\x05\xa3\x29\x29\x80\x29\x11\x31\x69", - "\xbb\x24\xe3\x8b\x31\xdb\xbc\x3e\x57\x5b\x9e\x3e\xe0\x76\xaf\x2a", 1, - 0, 224 }, + "\xbb\x24\xe3\x8b\x31\xdb\xbc\x3e\x57\x5b\x9e\x3e\xe0\x76\xaf\x2a", 1, 0, 224 }, { 96, 256, 128, 59, "\x08\x4b\x5d\x73\x65\xf1\xa8\xfe\xc6\x36\x59\x39\xed\x74\x1e\x6e\xa5" "\x89\x3e\x03\x18\xd8\x2a\xb4\x75\x00\xa9\x7d\x77\xaa\xa0\x41", - "\x82\x9f\x00\x5e\x98\x0f\x0a\x6e\x2f\x98\x3e\xaa", - "\x77\x0f\x6e\x6e\x89\xa3\xfe\x8e", + "\x82\x9f\x00\x5e\x98\x0f\x0a\x6e\x2f\x98\x3e\xaa", "\x77\x0f\x6e\x6e\x89\xa3\xfe\x8e", "\x75\x10\x01\x6e\xfa\xdc\x38\x5a\x71\xed\x68\x9c\xeb\x59\x0c\x8e\xa9" "\xcc\x1e\x81\xb7\x93\x33\x8b\xdd\xf5\xf1\x0c", "\xfd\x42\xcb\x5c\xf8\x94\xf8\x79\xe3\xcf\x75\x16\x62\xaa\xa5\x8a\x22" "\x88\xcc\x53\x54\x88\x02\xbe\xca\xf4\x23\x59", - "\x18\x83\x29\x43\x8a\xfe\x1c\xd7\x22\x5d\x04\x78\xaa\x90\xc7\x73", 1, - 64, 224 }, + "\x18\x83\x29\x43\x8a\xfe\x1c\xd7\x22\x5d\x04\x78\xaa\x90\xc7\x73", 1, 64, 224 }, { 96, 256, 128, 60, "\x5a\x7f\x85\x0a\x1d\x9a\xaf\xa7\x7d\x59\xae\x1b\x73\x19\x65\xe8\xaa" "\xec\x63\x52\x28\x0f\xc7\x6a\x7b\x5e\x23\xef\x36\x10\xcf\xe4", @@ -578,19 +484,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xbe\x4c\xbd\x08\x9e\xba\xc4\x66\x27\xbc\xf0\x1d", "\x40\x23\x02\xb5\x61\x40\xc4\xdc\xc3\x97\x74\x73\x2c\x55\x88\x3d\xe1" "\x24\xce\x4b\xf0\xa0\x26\x1c\xfa\x15\x69\xe2\xcf", - "\xe8\x30\xbf\xe9\x33\xa9\x67\x86\xcf\xf2\xdd\x72\xb8\x2c\x4b\xd5", 1, - 0, 232 }, + "\xe8\x30\xbf\xe9\x33\xa9\x67\x86\xcf\xf2\xdd\x72\xb8\x2c\x4b\xd5", 1, 0, 232 }, { 96, 256, 128, 61, "\xe6\xd5\xa4\x24\x6f\x6f\x05\x61\x8b\x59\xc8\xf9\xec\x3a\xc8\x06\x8c" "\xc0\xd3\xf3\x51\xc5\x71\xaa\x52\xb0\x9c\xb2\x51\xf9\xc2\xf6", - "\x2f\x90\xa6\x5e\x9e\x48\x72\x5d\xe6\xff\xc7\x27", - "\xf2\x41\x53\x77\xad\x28\x3f\xd8", + "\x2f\x90\xa6\x5e\x9e\x48\x72\x5d\xe6\xff\xc7\x27", "\xf2\x41\x53\x77\xad\x28\x3f\xd8", "\x96\x4f\xc9\xe0\xe8\x35\x59\x47\xaa\x1c\x2c\xaa\xdd\x7b\x3d\xbe\xf8" "\x2a\x10\x24\xe6\x23\x60\x6f\xac\x43\x6e\xf5\x73", "\xd0\x52\x93\x2b\xad\x6e\x6c\x4f\x83\x5f\x02\x01\x9e\x52\xd7\xff\x80" "\x7d\xc2\xa5\xaa\xc2\x04\x08\x83\xc7\x9d\xd3\xd5", - "\x65\x5f\x93\x39\x6b\x4d\x75\x5d\xc4\x47\x57\x21\x66\x5f\xed\x91", 1, - 64, 232 }, + "\x65\x5f\x93\x39\x6b\x4d\x75\x5d\xc4\x47\x57\x21\x66\x5f\xed\x91", 1, 64, 232 }, { 96, 256, 128, 62, "\x09\xe8\x22\x12\x3a\xdb\xb1\xed\x89\xb7\x9a\x58\x61\x9c\x64\x85\x39" "\x92\xf8\x37\x1d\x46\x33\x87\x12\xf6\xc9\x1a\xb1\x1a\x68\xbb", @@ -599,19 +502,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x1d\x36\x7b\x43\x6f\xe9\xd2\xd3\x45\x4b\x62\xcf\xad", "\x83\xf5\xc7\x73\x96\xca\xbd\x28\xdf\xcc\x00\x2c\xba\x07\x56\xd4\xea" "\x54\x55\xe0\x26\x1d\x84\x7d\x57\x08\xaa\xc2\x1e\x8d", - "\x70\x5a\x05\x82\x0a\x21\xf3\x81\xd2\x44\xd4\x0e\x58\xd2\xf1\x6b", 1, - 0, 240 }, + "\x70\x5a\x05\x82\x0a\x21\xf3\x81\xd2\x44\xd4\x0e\x58\xd2\xf1\x6b", 1, 0, 240 }, { 96, 256, 128, 63, "\x62\x57\x35\xfe\x7f\x8f\xc8\x1b\x0c\x1e\xdc\x3d\x08\xa7\x8b\x41\x26" "\x8f\x87\xa3\xc6\x84\x88\xb6\x74\x22\x26\x30\xc1\xd5\x87\xa5", - "\x9d\x8c\xdf\x28\x9d\xdd\xd0\x9a\xfd\xc1\xb0\x2f", - "\x20\x0a\x9c\x95\x94\x6f\xf0\x5c", + "\x9d\x8c\xdf\x28\x9d\xdd\xd0\x9a\xfd\xc1\xb0\x2f", "\x20\x0a\x9c\x95\x94\x6f\xf0\x5c", "\x67\xae\x18\x82\xd0\xb1\xc1\xb2\x48\x5b\xec\x98\x11\x5e\xcf\x53\xb9" "\xb4\x38\xde\xb1\xd0\x40\x05\x31\x70\x50\x38\x87\x3a", "\x20\x9b\x75\x39\x38\x5c\x8b\x19\xec\xd0\xfd\x8b\x50\x11\xb2\x99\x6e" "\x31\x6f\x19\x42\x06\x4e\x68\xed\xfa\x36\x3a\xcb\xcd", - "\xfa\x2f\x45\x4b\x9f\xa2\x60\x8f\x78\x0f\x7c\x6f\x9b\x78\x0f\xe1", 1, - 64, 240 }, + "\xfa\x2f\x45\x4b\x9f\xa2\x60\x8f\x78\x0f\x7c\x6f\x9b\x78\x0f\xe1", 1, 64, 240 }, { 96, 256, 128, 64, "\x2e\xb5\x1c\x46\x9a\xa8\xeb\x9e\x6c\x54\xa8\x34\x9b\xae\x50\xa2\x0f" "\x0e\x38\x27\x11\xbb\xa1\x15\x2c\x42\x4f\x03\xb6\x67\x1d\x71", @@ -620,19 +520,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xa6\x85\xad\xcc\x2a\xd3\x26\x62\x55\x8e\x55\xa5\xc7\x29", "\x45\xc7\xd6\xb5\x3a\xca\xd4\xab\xb6\x88\x76\xa6\xe9\x6a\x48\xfb\x59" "\x52\x4d\x2c\x92\xc9\xd8\xa1\x89\xc9\xfd\x2d\xb9\x17\x46", - "\x56\x6d\x3c\xa1\x0e\x31\x1b\x69\x5f\x3e\xae\x15\x51\x65\x24\x93", 1, - 0, 248 }, + "\x56\x6d\x3c\xa1\x0e\x31\x1b\x69\x5f\x3e\xae\x15\x51\x65\x24\x93", 1, 0, 248 }, { 96, 256, 128, 65, "\x7f\x5b\x74\xc0\x7e\xd1\xb4\x0f\xd1\x43\x58\xfe\x2f\xf2\xa7\x40\xc1" "\x16\xc7\x70\x65\x10\xe6\xa4\x37\xf1\x9e\xa4\x99\x11\xce\xc4", - "\x47\x0a\x33\x9e\xcb\x32\x19\xb8\xb8\x1a\x1f\x8b", - "\x37\x46\x18\xa0\x6e\xa9\x8a\x48", + "\x47\x0a\x33\x9e\xcb\x32\x19\xb8\xb8\x1a\x1f\x8b", "\x37\x46\x18\xa0\x6e\xa9\x8a\x48", "\xf4\x52\x06\xab\xc2\x55\x52\xb2\xab\xc9\xab\x7f\xa2\x43\x03\x5f\xed" "\xaa\xdd\xc3\xb2\x29\x39\x56\xf1\xea\x6e\x71\x56\xe7\xeb", "\x46\xa8\x0c\x41\x87\x02\x47\x20\x08\x46\x27\x58\x00\x80\xdd\xe5\xa3" "\xf4\xa1\x10\x93\xa7\x07\x6e\xd6\xf3\xd3\x26\xbc\x7b\x70", - "\x53\x4d\x4a\xa2\x83\x5a\x52\xe7\x2d\x14\xdf\x0e\x4f\x47\xf2\x5f", 1, - 64, 248 }, + "\x53\x4d\x4a\xa2\x83\x5a\x52\xe7\x2d\x14\xdf\x0e\x4f\x47\xf2\x5f", 1, 64, 248 }, { 96, 256, 128, 66, "\xe1\x73\x1d\x58\x54\xe1\xb7\x0c\xb3\xff\xe8\xb7\x86\xa2\xb3\xeb\xf0" "\x99\x43\x70\x95\x47\x57\xb9\xdc\x8c\x7b\xc5\x35\x46\x34\xa3", @@ -641,19 +538,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x4e\xaf\xa1\x56\xbb\x60\xce\x2e\x5d\x48\xf0\x57\x15\xe6\x78", "\xea\x29\xaf\xa4\x9d\x36\xe8\x76\x0f\x5f\xe1\x97\x23\xb9\x81\x1e\xd5" "\xd5\x19\x93\x4a\x44\x0f\x50\x81\xac\x43\x0b\x95\x3b\x0e\x21", - "\x22\x25\x41\xaf\x46\xb8\x65\x33\xc6\xb6\x8d\x2f\xf1\x08\xa7\xea", 1, - 0, 256 }, + "\x22\x25\x41\xaf\x46\xb8\x65\x33\xc6\xb6\x8d\x2f\xf1\x08\xa7\xea", 1, 0, 256 }, { 96, 256, 128, 67, "\x27\xd8\x60\x63\x1b\x04\x85\xa4\x10\x70\x2f\xea\x61\xbc\x87\x3f\x34" "\x42\x26\x0c\xad\xed\x4a\xbd\xe2\x5b\x78\x6a\x2d\x97\xf1\x45", - "\x26\x28\x80\xd4\x75\xf3\xda\xc5\x34\x0d\xd1\xb8", - "\x23\x33\xe5\xce\x0f\x93\xb0\x59", + "\x26\x28\x80\xd4\x75\xf3\xda\xc5\x34\x0d\xd1\xb8", "\x23\x33\xe5\xce\x0f\x93\xb0\x59", "\x6b\x26\x04\x99\x6c\xd3\x0c\x14\xa1\x3a\x52\x57\xed\x6c\xff\xd3\xbc" "\x5e\x29\xd6\xb9\x7e\xb1\x79\x9e\xb3\x35\xe2\x81\xea\x45\x1e", "\x6d\xad\x63\x78\x97\x54\x4d\x8b\xf6\xbe\x95\x07\xed\x4d\x1b\xb2\xe9" "\x54\xbc\x42\x7e\x5d\xe7\x29\xda\xf5\x07\x62\x84\x6f\xf2\xf4", - "\x7b\x99\x7d\x93\xc9\x82\x18\x9d\x70\x95\xdc\x79\x4c\x74\x62\x32", 1, - 64, 256 }, + "\x7b\x99\x7d\x93\xc9\x82\x18\x9d\x70\x95\xdc\x79\x4c\x74\x62\x32", 1, 64, 256 }, { 96, 256, 128, 68, "\x51\x55\xde\xe9\xaa\xde\x1c\xc6\x1e\xe7\xe3\xf9\x26\x60\xf7\x59\x0f" "\x5e\x5b\xa8\x2f\x1b\x59\xb8\x50\xe3\xfa\x45\x3d\x2f\xa6\xb3", @@ -662,19 +556,16 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xaf\x1a\xd5\x12\x3f\xf8\x1f\x83\xf5\x00\xed\xf4\xed\xa0\x9e\xdf", "\xf5\x98\x2b\x60\x1c\x7a\x18\xfc\x72\xa6\x5b\x21\x8c\x44\x97\x4d\xc5" "\x64\xd8\x31\x4c\xbe\x6f\x87\xfc\xf6\xc6\xcf\xbe\x61\x8b\x34\xb1", - "\xc4\x36\x32\xf5\x57\x60\xb5\xd1\xed\x37\x55\x6a\x94\xd0\x49\xb5", 1, - 0, 264 }, + "\xc4\x36\x32\xf5\x57\x60\xb5\xd1\xed\x37\x55\x6a\x94\xd0\x49\xb5", 1, 0, 264 }, { 96, 256, 128, 69, "\x57\x3f\x08\xeb\xbe\x0c\xce\x4a\xc9\x61\x8e\x8c\x3b\x22\x4b\xea\x0a" "\x32\xf0\x55\xc6\x99\x68\x38\xa3\x2f\x52\x7c\xa3\xc3\xb6\x95", - "\xad\x80\x50\xdc\x6d\x12\x2d\xce\x3e\x56\x39\xed", - "\xe9\x96\x98\x24\x1c\x59\x9b\x5f", + "\xad\x80\x50\xdc\x6d\x12\x2d\xce\x3e\x56\x39\xed", "\xe9\x96\x98\x24\x1c\x59\x9b\x5f", "\x66\x8d\x5e\x3f\x95\xfe\x03\x0d\xaf\x43\x2a\x5f\xc5\x83\x7a\xf3\xa7" "\x9c\x81\xe9\x4b\x28\xd8\x20\x4c\x5e\xe2\x62\xab\x3c\x99\x08\xa7", "\xea\xf6\x81\x0e\x6e\xc1\xcb\x7a\x29\x18\x85\x62\x57\xd1\xaa\x3d\x51" "\xa8\x27\x87\x91\x46\xc6\x33\x7e\xcf\x53\x5e\x9c\x89\xb1\x49\xc5", - "\xa2\x95\x0c\x2f\x39\x4a\x34\x66\xc3\x45\xf7\x96\x32\x3c\x1a\xa7", 1, - 64, 264 }, + "\xa2\x95\x0c\x2f\x39\x4a\x34\x66\xc3\x45\xf7\x96\x32\x3c\x1a\xa7", 1, 64, 264 }, { 96, 256, 128, 70, "\xcf\x0d\x40\xa4\x64\x4e\x5f\x51\x81\x51\x65\xd5\x30\x1b\x22\x63\x1f" "\x45\x44\xc4\x9a\x18\x78\xe3\xa0\xa5\xe8\xe1\xaa\xe0\xf2\x64", @@ -685,21 +576,18 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xfb\xa7\x8a\xe4\xf9\xd8\x08\xa6\x2e\x3d\xa4\x0b\xe2\xcb\x77\x00\xc3" "\x61\x3d\x9e\xb2\xc5\x29\xc6\x52\xe7\x6a\x43\x2c\x65\x8d\x27\x09\x5f" "\x0e\xb8\xf9\x40\xc3\x24\x98\x1e\xa9\x35\xe5\x07\xf9", - "\x8f\x04\x69\x56\xdb\x3a\x51\x29\x08\xbd\x7a\xfc\x8f\x2a\xb0\xa9", 1, - 0, 376 }, + "\x8f\x04\x69\x56\xdb\x3a\x51\x29\x08\xbd\x7a\xfc\x8f\x2a\xb0\xa9", 1, 0, 376 }, { 96, 256, 128, 71, "\x6c\xbf\xd7\x1c\x64\x5d\x18\x4c\xf5\xd2\x3c\x40\x2b\xdb\x0d\x25\xec" "\x54\x89\x8c\x8a\x02\x73\xd4\x2e\xb5\xbe\x10\x9f\xdc\xb2\xac", - "\xd4\xd8\x07\x34\x16\x83\x82\x5b\x31\xcd\x4d\x95", - "\xb3\xe4\x06\x46\x83\xb0\x2d\x84", + "\xd4\xd8\x07\x34\x16\x83\x82\x5b\x31\xcd\x4d\x95", "\xb3\xe4\x06\x46\x83\xb0\x2d\x84", "\xa9\x89\x95\x50\x4d\xf1\x6f\x74\x8b\xfb\x77\x85\xff\x91\xee\xb3\xb6" "\x60\xea\x9e\xd3\x45\x0c\x3d\x5e\x7b\x0e\x79\xef\x65\x36\x59\xa9\x97" "\x8d\x75\x54\x2e\xf9\x1c\x45\x67\x62\x21\x56\x40\xb9", "\xa1\xff\xed\x80\x76\x18\x29\xec\xce\x24\x2e\x0e\x88\xb1\x38\x04\x90" "\x16\xbc\xa0\x18\xda\x2b\x6e\x19\x98\x6b\x3e\x31\x8c\xae\x8d\x80\x61" "\x98\xfb\x4c\x52\x7c\xc3\x93\x50\xeb\xdd\xea\xc5\x73", - "\xc4\xcb\xf0\xbe\xfd\xa0\xb7\x02\x42\xc6\x40\xd7\xcd\x02\xd7\xa3", 1, - 64, 376 }, + "\xc4\xcb\xf0\xbe\xfd\xa0\xb7\x02\x42\xc6\x40\xd7\xcd\x02\xd7\xa3", 1, 64, 376 }, { 96, 256, 128, 72, "\x5b\x1d\x10\x35\xc0\xb1\x7e\xe0\xb0\x44\x47\x67\xf8\x0a\x25\xb8\xc1" "\xb7\x41\xf4\xb5\x0a\x4d\x30\x52\x22\x6b\xaa\x1c\x6f\xb7\x01", @@ -712,13 +600,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xd4\xc1\x8a\x9c\xc2\x40\x5c\x12\xbb\x51\xbb\x18\x72\xc8\xe8\xb8\x77" "\x67\x8b\xec\x44\x2c\xfc\xbb\x0f\xf4\x64\xa6\x4b\x74\x33\x2c\xf0\x72" "\x89\x8c\x7e\x0e\xdd\xf6\x23\x2e\xa6\xe2\x7e\xfe\x50", - "\x9f\xf3\x42\x7a\x0f\x32\xfa\x56\x6d\x9c\xa0\xa7\x8a\xef\xc0\x13", 1, - 0, 512 }, + "\x9f\xf3\x42\x7a\x0f\x32\xfa\x56\x6d\x9c\xa0\xa7\x8a\xef\xc0\x13", 1, 0, 512 }, { 96, 256, 128, 73, "\x97\xd6\x35\xc4\xf4\x75\x74\xd9\x99\x8a\x90\x87\x5d\xa1\xd3\xa2\x84" "\xb7\x55\xb2\xd3\x92\x97\xa5\x72\x52\x35\x19\x0e\x10\xa9\x7e", - "\xd3\x1c\x21\xab\xa1\x75\xb7\x0d\xe4\xeb\xb1\x9c", - "\x71\x93\xf6\x23\x66\x33\x21\xa2", + "\xd3\x1c\x21\xab\xa1\x75\xb7\x0d\xe4\xeb\xb1\x9c", "\x71\x93\xf6\x23\x66\x33\x21\xa2", "\x94\xee\x16\x6d\x6d\x6e\xcf\x88\x32\x43\x71\x36\xb4\xae\x80\x5d\x42" "\x88\x64\x35\x95\x86\xd9\x19\x3a\x25\x01\x62\x93\xed\xba\x44\x3c\x58" "\xe0\x7e\x7b\x71\x95\xec\x5b\xd8\x45\x82\xa9\xd5\x6c\x8d\x4a\x10\x8c" @@ -727,8 +613,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xce\x3c\x79\xa1\x2c\xff\xd8\x71\xee\x8e\x73\x82\x0c\x82\x97\x49\xf1" "\xab\xb4\x29\x43\x67\x84\x9f\xb6\xc2\xaa\x56\xbd\xa8\xa3\x07\x8f\x72" "\x3d\x7c\x1c\x85\x20\x24\xb0\x17\xb5\x89\x73\xfb\x1e", - "\x09\x26\x3d\xa7\xb4\xcb\x92\x14\x52\xf9\x7d\xca\x40\xf5\x80\xec", 1, - 64, 512 }, + "\x09\x26\x3d\xa7\xb4\xcb\x92\x14\x52\xf9\x7d\xca\x40\xf5\x80\xec", 1, 64, 512 }, { 96, 256, 128, 74, "\xfe\x6e\x55\xbd\xae\xd1\xf7\x28\x4c\xa5\xfc\x0f\x8c\x5f\x2b\x8d\xf5" "\x6d\xc0\xf4\x9e\x8c\xa6\x6a\x41\x99\x5e\x78\x33\x51\xf9\x01", @@ -745,13 +630,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x24\x5f\x52\xae\x28\x66\xa5\xec\x83\xb1\x9f\x61\xbe\x1d\x30\xd5\xc5" "\xd9\xfe\xcc\x4c\xbb\xe0\x8f\xd3\x85\x81\x3a\x2a\xa3\x9a\x00\xff\x9c" "\x10\xf7\xf2\x37\x02\xad\xd1\xe4\xb2\xff\xa3\x1c", - "\x41\x86\x5f\xc7\x1d\xe1\x2b\x19\x61\x21\x27\xce\x49\x99\x3b\xb0", 1, - 0, 776 }, + "\x41\x86\x5f\xc7\x1d\xe1\x2b\x19\x61\x21\x27\xce\x49\x99\x3b\xb0", 1, 0, 776 }, { 96, 256, 128, 75, "\xaa\xbc\x06\x34\x74\xe6\x5c\x4c\x3e\x9b\xdc\x48\x0d\xea\x97\xb4\x51" "\x10\xc8\x61\x88\x46\xff\x6b\x15\xbd\xd2\xa4\xa5\x68\x2c\x4e", - "\x46\x36\x2f\x45\xd6\x37\x9e\x63\xe5\x22\x94\x60", - "\xa1\x1c\x40\xb6\x03\x76\x73\x30", + "\x46\x36\x2f\x45\xd6\x37\x9e\x63\xe5\x22\x94\x60", "\xa1\x1c\x40\xb6\x03\x76\x73\x30", "\xce\xb5\x34\xce\x50\xdc\x23\xff\x63\x8a\xce\x3e\xf6\x3a\xb2\xcc\x29" "\x73\xee\xad\xa8\x07\x85\xfc\x16\x5d\x06\xc2\xf5\x10\x0f\xf5\xe8\xab" "\x28\x82\xc4\x75\xaf\xcd\x05\xcc\xd4\x9f\x2e\x7d\x8f\x55\xef\x3a\x72" @@ -764,8 +647,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xe4\x2f\x95\x0b\xb3\x3d\x9e\x24\x24\xd0\x8a\x50\x5d\x89\x95\x63\x97" "\x3e\xd3\x88\x70\xf3\xde\x6e\xe2\xad\xc7\xfe\x07\x2c\x36\x6c\x14\xe2" "\xcf\x7c\xa6\x2f\xb3\xd3\x6b\xee\x11\x68\x54\x61", - "\xb7\x0d\x44\xef\x8c\x66\xc5\xc7\xbb\xf1\x0d\xca\xdd\x7f\xac\xf6", 1, - 64, 776 }, + "\xb7\x0d\x44\xef\x8c\x66\xc5\xc7\xbb\xf1\x0d\xca\xdd\x7f\xac\xf6", 1, 64, 776 }, { 96, 256, 128, 76, "\xd7\xad\xdd\x38\x89\xfa\xdf\x8c\x89\x3e\xee\x14\xba\x2b\x7e\xa5\xbf" "\x56\xb4\x49\x90\x48\x69\x61\x5b\xd0\x5d\x5f\x11\x4c\xf3\x77", @@ -786,13 +668,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x91\xac\x5c\x53\x0b\xd1\xa5\x32\x71\x84\x29\x96\xdc\xd0\x4d\x86\x53" "\x21\xb1\xec\xb6\xe7\x63\x01\x14\xfe\x78\x02\x91\xb8\xdc\x3e\x5d\x0a" "\xbc\x8e\x65\xb1\xc5\x49\x3e\x9a\xf0", - "\xf2\xb9\x74\xca\x0f\x14\xfb\x9f\x92\x01\x4b\xff\x18\x57\x3c\xff", 1, - 0, 1024 }, + "\xf2\xb9\x74\xca\x0f\x14\xfb\x9f\x92\x01\x4b\xff\x18\x57\x3c\xff", 1, 0, 1024 }, { 96, 256, 128, 77, "\x80\xbe\x86\xfb\x6f\xc4\x9b\xc7\x34\x28\xca\xb5\x76\xf6\xad\x72\xff" "\x6a\xca\x04\x00\x1b\x8b\x1c\x57\xa7\x12\x8b\xe7\x39\x00\xaa", - "\x90\x31\x88\x43\x3c\x1c\xe8\x97\x1a\xa1\x9b\x9d", - "\x05\x87\xaf\x85\x30\xad\x05\x47", + "\x90\x31\x88\x43\x3c\x1c\xe8\x97\x1a\xa1\x9b\x9d", "\x05\x87\xaf\x85\x30\xad\x05\x47", "\x67\xce\x49\x9c\xd8\xed\x68\xbd\x71\x7d\xfe\x61\xc6\x0f\x27\xd2\x60" "\xb1\xc1\x63\xa7\x2e\x8c\xc8\x59\x72\x53\xd3\xd9\x87\xc2\xdb\xe1\xbf" "\xf2\xe4\x4d\x9b\xd4\x76\x5d\x3e\x53\xd9\xc3\xf8\xeb\x3b\x90\xe7\x51" @@ -809,68 +689,56 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xcd\x8f\x22\x6c\x7c\x52\x26\x89\xd0\x82\xf0\x23\x89\x4d\x54\xac\xab" "\x0c\x4d\x60\x9f\x37\x46\xa6\x73\x69\xbb\x88\x76\x00\x8f\x7f\xd3\xdc" "\x66\x81\xc5\xfb\x9d\x72\x8c\x59\x11", - "\xf0\x05\xeb\xe1\xc1\xad\xa7\x5a\x9c\xee\x8d\x63\x08\x81\xd5\xb8", 1, - 64, 1024 }, + "\xf0\x05\xeb\xe1\xc1\xad\xa7\x5a\x9c\xee\x8d\x63\x08\x81\xd5\xb8", 1, 64, 1024 }, { 96, 256, 128, 78, "\x7d\x00\xb4\x80\x95\xad\xfa\x32\x72\x05\x06\x07\xb2\x64\x18\x50\x02" "\xba\x99\x95\x7c\x49\x8b\xe0\x22\x77\x0f\x2c\xe2\xf3\x14\x3c", "\x87\x34\x5f\x10\x55\xfd\x9e\x21\x02\xd5\x06\x56", "\x02", "\xe5\xcc\xaa\x44\x1b\xc8\x14\x68\x8f\x8f\x6e\x8f\x28\xb5\x00\xb2", "\x7e\x72\xf5\xa1\x85\xaf\x16\xa6\x11\x92\x1b\x43\x8f\x74\x9f\x0b", - "\x12\x42\xc6\x70\x73\x23\x34\x02\x9a\xdf\xe1\xc5\x00\x16\x51\xe4", 1, - 8, 128 }, + "\x12\x42\xc6\x70\x73\x23\x34\x02\x9a\xdf\xe1\xc5\x00\x16\x51\xe4", 1, 8, 128 }, { 96, 256, 128, 79, "\x64\x32\x71\x7f\x1d\xb8\x5e\x41\xac\x78\x36\xbc\xe2\x51\x85\xa0\x80" "\xd5\x76\x2b\x9e\x2b\x18\x44\x4b\x6e\xc7\x2c\x3b\xd8\xe4\xdc", "\x87\xa3\x16\x3e\xc0\x59\x8a\xd9\x5b\x3a\xa7\x13", "\xb6\x48", "\x02\xcd\xe1\x68\xfb\xa3\xf5\x44\xbb\xd0\x33\x2f\x7a\xde\xad\xa8", "\x85\xf2\x9a\x71\x95\x57\xcd\xd1\x4d\x1f\x8f\xff\xab\x6d\x9e\x60", - "\x73\x2c\xa3\x2b\xec\xd5\x15\xa1\xed\x35\x3f\x54\x2e\x99\x98\x58", 1, - 16, 128 }, + "\x73\x2c\xa3\x2b\xec\xd5\x15\xa1\xed\x35\x3f\x54\x2e\x99\x98\x58", 1, 16, 128 }, { 96, 256, 128, 80, "\x7a\xfa\x0f\x59\xdf\xcb\x5a\xd3\xa7\x64\x90\xc5\xc8\x04\x32\x7c\x8d" "\x05\x2b\xe7\x37\xa6\x0f\xa8\xbc\xbf\x0a\x2c\x36\x63\x0a\x43", "\x25\xb7\xbd\xf4\xa6\xdc\xbf\x7c\x9a\x3e\xc2\xb3", "\x8b\x71\xac", "\x62\x3e\x6b\xa6\xd3\x16\x6a\x33\x8b\xfc\xc7\xaf\x90\xa2\x30\xc8", "\xd4\x6e\x82\x65\xa8\xc6\xa2\x53\x93\xdd\x95\x6b\xb4\x43\x97\xad", - "\xe2\x8f\x3a\xd9\xe3\xef\x4a\x3d\x94\xee\x07\xbf\x53\x8e\xaa\xfb", 1, - 24, 128 }, + "\xe2\x8f\x3a\xd9\xe3\xef\x4a\x3d\x94\xee\x07\xbf\x53\x8e\xaa\xfb", 1, 24, 128 }, { 96, 256, 128, 81, "\x2e\xc2\x5b\x0e\xc7\xac\x24\x42\x24\xe9\xc7\xfc\x2f\xa5\xd3\xef\x17" "\x80\x9e\x19\xfd\x6e\x95\x41\x58\xdd\x0d\x72\x73\x8a\x4c\xc8", - "\x6f\xb0\xd1\x41\x7c\xdf\xff\x4d\xf3\x7d\xb0\x8c", - "\x3a\x5d\xdf\x40", + "\x6f\xb0\xd1\x41\x7c\xdf\xff\x4d\xf3\x7d\xb0\x8c", "\x3a\x5d\xdf\x40", "\xa1\xc9\x33\x76\x8a\x6d\x57\x3e\xbf\x68\xa9\x9e\x5e\x18\xda\xe8", "\x2d\x3c\xb2\xd9\x30\x34\x91\xe2\x64\xf2\x90\x4f\x0e\x07\x53\xf4", - "\x6c\x1d\xb9\x59\x36\x2d\x21\x7b\x23\x22\xb4\x66\x53\x6b\xfe\xa0", 1, - 32, 128 }, + "\x6c\x1d\xb9\x59\x36\x2d\x21\x7b\x23\x22\xb4\x66\x53\x6b\xfe\xa0", 1, 32, 128 }, { 96, 256, 128, 82, "\x0a\x2c\xf5\x23\x71\xcf\x9d\x9f\x95\xb1\x01\x08\xfc\x82\xb4\xfd\x61" "\x10\xa8\xba\x9a\x88\xa2\x60\x83\x68\x5a\xd2\x98\x26\x89\x1a", - "\x25\x38\xfc\x67\xaf\xb9\xea\xb3\x33\xf8\x32\x90", - "\x9e\xec\x54\x0b\xb0", + "\x25\x38\xfc\x67\xaf\xb9\xea\xb3\x33\xf8\x32\x90", "\x9e\xec\x54\x0b\xb0", "\x0d\x8c\x69\x1d\x04\x4a\x39\x78\xd7\x90\x43\x2d\xc7\x1d\x69\xf8", "\xa9\x88\xc0\x3c\x71\xb9\x56\xff\x08\x6d\x04\x70\xd7\x06\xbd\x34", - "\xb3\x5d\x7c\xbf\x2b\xeb\x89\x4b\x0c\x74\x6e\x07\x30\x42\x9e\x15", 1, - 40, 128 }, + "\xb3\x5d\x7c\xbf\x2b\xeb\x89\x4b\x0c\x74\x6e\x07\x30\x42\x9e\x15", 1, 40, 128 }, { 96, 256, 128, 83, "\x30\x7e\x88\x6b\x38\xbb\x18\xb4\x45\xf8\xa2\xc6\xd6\xf8\x93\x24\x92" "\xa9\xce\xa8\xd0\x41\xba\x72\xeb\x5e\xfd\xfa\x70\xd0\xb8\xd2", - "\xa0\x71\xbe\x99\x91\x51\xe2\xa1\xc4\x1c\x81\xe9", - "\x56\xe0\x14\xd9\x7c\x74", + "\xa0\x71\xbe\x99\x91\x51\xe2\xa1\xc4\x1c\x81\xe9", "\x56\xe0\x14\xd9\x7c\x74", "\x9a\xba\x22\xb4\x95\xcb\x7e\xc8\x87\xdd\xaa\x62\x01\x9a\xa1\x4d", "\x32\xbf\x95\xd4\xc1\x95\xdb\xaf\x58\xd9\xaf\x40\x01\xc6\xe5\x7d", - "\x43\x93\x80\x87\x03\xd6\x7a\x90\x87\x05\x78\x04\x6c\xd8\xb5\x25", 1, - 48, 128 }, + "\x43\x93\x80\x87\x03\xd6\x7a\x90\x87\x05\x78\x04\x6c\xd8\xb5\x25", 1, 48, 128 }, { 96, 256, 128, 84, "\xda\xcd\x51\xa8\xa8\xe4\xd5\x90\x5b\x4c\xbb\x94\x7e\xf4\x01\x3e\xb2" "\x96\x88\x93\x53\xf3\xc9\xee\x35\xf5\x57\x7b\x26\x73\x7a\x51", - "\x3f\xa3\x78\xa1\xbe\xfd\xdd\xd6\x1a\xe6\x8c\xf4", - "\xbb\x5a\x38\x12\xf0\xae\xfd", + "\x3f\xa3\x78\xa1\xbe\xfd\xdd\xd6\x1a\xe6\x8c\xf4", "\xbb\x5a\x38\x12\xf0\xae\xfd", "\xe1\x48\x31\x38\x83\xa7\x7d\xa1\x21\x12\x4d\x06\xb1\xc7\x7d\xca", "\x2a\x20\x7c\xa7\xe9\xda\x6b\x13\xa2\x29\x60\x43\x04\xd8\x7e\xb1", - "\x8a\x6b\x6a\xfe\xc8\x7d\x93\xec\x6e\x8d\xbe\x13\xd8\x4c\x0f\x8c", 1, - 56, 128 }, + "\x8a\x6b\x6a\xfe\xc8\x7d\x93\xec\x6e\x8d\xbe\x13\xd8\x4c\x0f\x8c", 1, 56, 128 }, { 96, 256, 128, 85, "\x7b\x5f\xbb\xb2\x02\xc1\x61\x08\xfd\x13\x06\x64\x46\x85\x3a\x85\x0d" "\x8b\x34\xe9\xda\x40\x51\x95\x80\xda\x44\x6a\x92\x2f\x91\x62", @@ -878,8 +746,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xf9\x4b\xb9\x2c\x1c\x66\x8a\x69\x5b", "\xda\x47\x1c\xd6\x93\x5a\x0c\xa8\x30\x7d\xde\xdc\x6b\x95\x99\x62", "\x54\x8a\x5c\xa0\xae\x49\x21\x1c\xdf\x30\xbb\xdc\xb1\x35\x2d\x31", - "\x20\x4d\xac\xb9\x8f\x8c\x89\x08\xcc\x5e\xa2\x2b\xb2\x3f\x90\x1f", 1, - 72, 128 }, + "\x20\x4d\xac\xb9\x8f\x8c\x89\x08\xcc\x5e\xa2\x2b\xb2\x3f\x90\x1f", 1, 72, 128 }, { 96, 256, 128, 86, "\x1f\xfd\x10\x1e\xb9\x75\x31\xf6\xfa\xa8\x21\xec\x4d\x5c\x57\x02\x72" "\x5d\xd0\x33\xd3\xb8\x30\xbb\x76\x0c\x4e\xf2\x7b\xa9\x83\xdf", @@ -887,8 +754,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x21\x55\x62\x7e\xc1\x5a\x97\x8f\xbc\xb2", "\x28\x66\x8c\xa8\xdb\x53\x5c\x7e\x8e\xb2\x74\x91\xad\x0f\xb7\xcb", "\x28\xce\xda\xc2\x4f\x14\xca\xa3\x26\xc7\xfe\x40\x1f\x68\xa8\x7c", - "\x2b\xf1\xb2\xc4\x3d\x30\x39\xf8\xf5\xce\x35\x9c\x11\x02\xf8\x79", 1, - 80, 128 }, + "\x2b\xf1\xb2\xc4\x3d\x30\x39\xf8\xf5\xce\x35\x9c\x11\x02\xf8\x79", 1, 80, 128 }, { 96, 256, 128, 87, "\xd2\xd0\xa9\x73\xd5\x95\x1a\xf3\x52\xcb\xee\x57\xac\x9d\xab\x1c\x28" "\x4c\x99\xaf\x3b\x99\x2c\xe0\x15\xf2\x19\x50\x6f\x64\x88\x8d", @@ -896,8 +762,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x37\xad\x66\x8d\x4d\x4f\xe8\x89\x94\x97\x63", "\x3f\x3f\x00\x76\x25\x03\x52\xe1\xb6\xb5\xc1\x2c\xfa\x12\x62\x5e", "\x72\x56\xe8\x56\x87\x2a\xd3\xa5\x4b\x34\xa2\xa6\xbd\xca\x88\x38", - "\x3b\x12\xe4\x58\x6e\x45\x22\x3f\x78\xa6\xee\xa8\x11\xef\xb8\x63", 1, - 88, 128 }, + "\x3b\x12\xe4\x58\x6e\x45\x22\x3f\x78\xa6\xee\xa8\x11\xef\xb8\x63", 1, 88, 128 }, { 96, 256, 128, 88, "\xad\xcc\x52\x0b\x38\x13\x82\x23\x7d\x05\xa6\x40\x0a\x7d\xfb\xcd\x07" "\x71\xb6\xaa\x9e\xdb\x79\x66\x13\x1d\xde\xf6\xaf\x21\xf1\xbe", @@ -905,8 +770,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xb3\x34\x37\x54\x15\xf6\x21\x5c\x0b\xf8\x9a\x9a", "\x95\x82\x95\x61\x9c\xf1\xb3\x6f\x0b\x47\x46\x63\xc0\xbc\x79\xeb", "\x85\x2c\x14\x1b\x42\x39\xa3\x1f\xee\xda\x03\x55\x0d\x70\xa2\xbe", - "\x5f\xc5\x92\x87\xb9\x2d\x3f\xcf\x7d\x66\xf1\x3d\xef\xb1\x1b\x0d", 1, - 96, 128 }, + "\x5f\xc5\x92\x87\xb9\x2d\x3f\xcf\x7d\x66\xf1\x3d\xef\xb1\x1b\x0d", 1, 96, 128 }, { 96, 256, 128, 89, "\xbd\x53\x4f\x7a\xde\xca\x46\x68\x44\xfb\x3b\xa3\x46\x58\xbe\x80\x7f" "\x15\xc5\x29\x1e\xd6\x02\x68\x60\xa2\x4f\x17\x9b\x71\x2c\x89", @@ -914,8 +778,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x28\x66\xaf\xff\x0b\xcc\x61\x35\xdc\x63\xaf\x88\xc8", "\xd9\x2f\x8c\xe5\xd8\xd0\xad\x2e\xb5\xf1\x1a\xf0\x2e\xf6\x39\x49", "\x89\xd6\xd0\x89\xc4\xa2\x55\x95\x2a\xca\x11\xb2\x4a\x01\xff\x95", - "\xf8\x8f\xa4\x53\x12\x04\xda\x31\x5e\x73\x17\x97\x02\x40\xce\x9e", 1, - 104, 128 }, + "\xf8\x8f\xa4\x53\x12\x04\xda\x31\x5e\x73\x17\x97\x02\x40\xce\x9e", 1, 104, 128 }, { 96, 256, 128, 90, "\x91\x0a\xde\x7d\x32\x4d\x2c\x96\x88\x43\x9e\x1f\x14\x2e\x0e\x5f\x9d" "\x13\x0f\xf8\x32\xe5\x07\xfe\x19\x85\xe5\xa2\x64\x52\xa6\xd0", @@ -923,8 +786,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xea\x25\x75\xf1\x23\x26\x8e\x93\x6c\x8e\x4c\x8c\x1b\xb8", "\x6e\x35\x60\x94\xed\x9d\x9a\x70\x53\xc7\x90\x6c\x48\xba\x3d\x9f", "\x01\xff\xb3\x43\xc7\x57\xb2\x78\x43\xd8\xa9\x00\xa3\x6c\xe3\x9d", - "\xa3\x15\x54\x1b\x7d\x63\x13\xc6\xfd\xdf\x64\xb3\x03\xd7\x1d\x60", 1, - 112, 128 }, + "\xa3\x15\x54\x1b\x7d\x63\x13\xc6\xfd\xdf\x64\xb3\x03\xd7\x1d\x60", 1, 112, 128 }, { 96, 256, 128, 91, "\x8e\x34\xcf\x73\xd2\x45\xa1\x08\x2a\x92\x0b\x86\x36\x4e\xb8\x96\xc4" "\x94\x64\x67\xbc\xb3\xd5\x89\x29\xfc\xb3\x66\x90\xe6\x39\x4f", @@ -932,8 +794,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xbd\x4c\xd0\x2f\xc7\x50\x2b\xbd\xbd\xf6\xc9\xa3\xcb\xe8\xf0", "\x16\xdd\xd2\x3f\xf5\x3f\x3d\x23\xc0\x63\x34\x48\x70\x40\xeb\x47", "\xc1\xb2\x95\x93\x6d\x56\xfa\xda\xc0\x3e\x5f\x74\x2b\xff\x73\xa1", - "\x39\xc4\x57\xdb\xab\x66\x38\x2b\xab\xb3\xb5\x58\x00\xcd\xa5\xb8", 1, - 120, 128 }, + "\x39\xc4\x57\xdb\xab\x66\x38\x2b\xab\xb3\xb5\x58\x00\xcd\xa5\xb8", 1, 120, 128 }, { 96, 256, 128, 92, "\xcb\x55\x75\xf5\xc7\xc4\x5c\x91\xcf\x32\x0b\x13\x9f\xb5\x94\x23\x75" "\x60\xd0\xa3\xe6\xf8\x65\xa6\x7d\x4f\x63\x3f\x2c\x08\xf0\x16", @@ -941,8 +802,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x89\xcc\xe9\xfb\x47\x44\x1d\x07\xe0\x24\x5a\x66\xfe\x8b\x77\x8b", "\x62\x3b\x78\x50\xc3\x21\xe2\xcf\x0c\x6f\xbc\xc8\xdf\xd1\xaf\xf2", "\xc8\x4c\x9b\xb7\xc6\x1c\x1b\xcb\x17\x77\x2a\x1c\x50\x0c\x50\x95", - "\xdb\xad\xf7\xa5\x13\x8c\xa0\x34\x59\xa2\xcd\x65\x83\x1e\x09\x2f", 1, - 128, 128 }, + "\xdb\xad\xf7\xa5\x13\x8c\xa0\x34\x59\xa2\xcd\x65\x83\x1e\x09\x2f", 1, 128, 128 }, { 96, 256, 128, 93, "\xa5\x56\x9e\x72\x9a\x69\xb2\x4b\xa6\xe0\xff\x15\xc4\x62\x78\x97\x43" "\x68\x24\xc9\x41\xe9\xd0\x0b\x2e\x93\xfd\xdc\x4b\xa7\x76\x57", @@ -951,8 +811,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x0e", "\x87\xb3\xa4\xd7\xb2\x6d\x8d\x32\x03\xa0\xde\x1d\x64\xef\x82\xe3", "\x94\xbc\x80\x62\x1e\xd1\xe7\x1b\x1f\xd2\xb5\xc3\xa1\x5e\x35\x68", - "\x33\x35\x11\x86\x17\x96\x97\x84\x01\x59\x8b\x96\x37\x22\xf5\xb3", 1, - 136, 128 }, + "\x33\x35\x11\x86\x17\x96\x97\x84\x01\x59\x8b\x96\x37\x22\xf5\xb3", 1, 136, 128 }, { 96, 256, 128, 94, "\x56\x20\x74\x65\xb4\xe4\x8e\x6d\x04\x63\x0f\x4a\x42\xf3\x5c\xfc\x16" "\x3a\xb2\x89\xc2\x2a\x2b\x47\x84\xf6\xf9\x29\x03\x30\xbe\xe0", @@ -961,8 +820,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xa2\xa4\xd3\x35\x2a\x4f\xf5\x60\xc0\x64\x0f\xdb\xda", "\xe6\x01\xb3\x85\x57\x79\x7d\xa2\xf8\xa4\x10\x6a\x08\x9d\x1d\xa6", "\x29\x9b\x5d\x3f\x3d\x03\xc0\x87\x20\x9a\x16\xe2\x85\x14\x31\x11", - "\x4b\x45\x4e\xd1\x98\xde\x11\x7e\x83\xec\x49\xfa\x8d\x85\x08\xd6", 1, - 240, 128 }, + "\x4b\x45\x4e\xd1\x98\xde\x11\x7e\x83\xec\x49\xfa\x8d\x85\x08\xd6", 1, 240, 128 }, { 96, 256, 128, 95, "\x07\x74\x33\x02\x2a\xb3\x4d\x38\x0f\xc1\x92\xfc\x24\xc2\xed\xc6\x30" "\x1f\xec\x6f\x24\x44\x2f\x57\x2a\x10\x87\xff\x2e\x05\xb3\x9a", @@ -971,8 +829,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x5e\x75\x10\x7f\x6e\x23\x7c\x69\xe8\x29\x60\x05\x22\x70", "\x03\xc8\x74\xee\xaa\xa6\xfa\x9f\x0d\xa6\x2c\x75\x8f\xb0\xad\x04", "\x1e\x96\x87\xb3\x5f\xbc\x8e\xaa\x18\x25\xed\x38\x47\x79\x8f\x76", - "\x07\x88\xbf\x70\xfd\x04\x03\x0e\xcd\x1c\x96\xd0\xbc\x1f\xcd\x5d", 1, - 248, 128 }, + "\x07\x88\xbf\x70\xfd\x04\x03\x0e\xcd\x1c\x96\xd0\xbc\x1f\xcd\x5d", 1, 248, 128 }, { 96, 256, 128, 96, "\x39\x37\x98\x6a\xf8\x6d\xaf\xc1\xba\x0c\x46\x72\xd8\xab\xc4\x6c\x20" "\x70\x62\x68\x2d\x9c\x26\x4a\xb0\x6d\x6c\x58\x07\x20\x51\x30", @@ -981,8 +838,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x69\xab\xc1\x9b\x1d\x4d\x90\x49\xa5\x55\x1e\x86\xec\x2b\x37", "\xdc\x9e\x9e\xaf\x11\xe3\x14\x18\x2d\xf6\xa4\xeb\xa1\x7a\xec\x9c", "\x60\x5b\xbf\x90\xae\xb9\x74\xf6\x60\x2b\xc7\x78\x05\x6f\x0d\xca", - "\x38\xea\x23\xd9\x90\x54\xb4\x6b\x42\xff\xe0\x04\x12\x9d\x22\x04", 1, - 256, 128 }, + "\x38\xea\x23\xd9\x90\x54\xb4\x6b\x42\xff\xe0\x04\x12\x9d\x22\x04", 1, 256, 128 }, { 96, 256, 128, 97, "\x36\x37\x2a\xbc\xdb\x78\xe0\x27\x96\x46\xac\x3d\x17\x6b\x96\x74\xe9" "\x15\x4e\xec\xf0\xd5\x46\x9c\x65\x1e\xc7\xe1\x6b\x4c\x11\x99", @@ -991,8 +847,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xcb\xc3\xb8\x0f\xcd\x56\x75\x05\x6b\x68\xbb\x59\xe6\x2e\x88\x73", "\x81\xce\x84\xed\xe9\xb3\x58\x59\xcc\x8c\x49\xa8\xf6\xbe\x7d\xc6", "\x7b\x7c\xe0\xd8\x24\x80\x9a\x70\xde\x32\x56\x2c\xcf\x2c\x2b\xbd", - "\x15\xd4\x4a\x00\xce\x0d\x19\xb4\x23\x1f\x92\x1e\x22\xbc\x0a\x43", 1, - 264, 128 }, + "\x15\xd4\x4a\x00\xce\x0d\x19\xb4\x23\x1f\x92\x1e\x22\xbc\x0a\x43", 1, 264, 128 }, { 96, 256, 128, 98, "\x9f\x14\x79\xed\x09\x7d\x7f\xe5\x29\xc1\x1f\x2f\x5a\xdd\x9a\xaf\xf4" "\xa1\xca\x0b\x68\x99\x7a\x2c\xb7\xf7\x97\x49\xbd\x90\xaa\xf4", @@ -1002,8 +857,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xca\x42\x05\x6a\x97\x92\xcc\x1b\x9f\xb3\xc7\xd2\x61", "\xa6\x67\x47\xc8\x9e\x85\x7a\xf3\xa1\x8e\x2c\x79\x50\x00\x87\xed", "\xca\x82\xbf\xf3\xe2\xf3\x10\xcc\xc9\x76\x67\x2c\x44\x15\xe6\x9b", - "\x57\x63\x8c\x62\xa5\xd8\x5d\xed\x77\x4f\x91\x3c\x81\x3e\xa0\x32", 1, - 376, 128 }, + "\x57\x63\x8c\x62\xa5\xd8\x5d\xed\x77\x4f\x91\x3c\x81\x3e\xa0\x32", 1, 376, 128 }, { 96, 256, 128, 99, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1013,8 +867,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x55\xdb\xe2\x25\x4d\x94\xa4\x3f\x1d\xe7\x48\xd3\xcc\x6f\x0d", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x39\xf4\xfc\xe3\x02\x6d\x83\x78\x9f\xfd\x1e\xe6\xf2\xcd\x7c\x4f", 1, - 128, 256 }, + "\x39\xf4\xfc\xe3\x02\x6d\x83\x78\x9f\xfd\x1e\xe6\xf2\xcd\x7c\x4f", 1, 128, 256 }, { 96, 256, 128, 100, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1028,8 +881,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\xf5\xea\xa8\x04\x60\x5c\x3a\x47\x85\xf9\xd7\xf1\x3b\x6f\x67\xd6", 1, - 128, 512 }, + "\xf5\xea\xa8\x04\x60\x5c\x3a\x47\x85\xf9\xd7\xf1\x3b\x6f\x67\xd6", 1, 128, 512 }, { 96, 256, 128, 101, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1051,8 +903,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00", - "\x9b\x5c\x43\xa7\x8d\x95\x4e\x8a\x3c\x65\x9e\xeb\xc1\x3d\x5d\x55", 1, - 128, 1024 }, + "\x9b\x5c\x43\xa7\x8d\x95\x4e\x8a\x3c\x65\x9e\xeb\xc1\x3d\x5d\x55", 1, 128, 1024 }, { 96, 256, 128, 102, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1062,8 +913,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xaa\x24\x1d\xda\xb2\x6b\x5b\xc0\xe2\x18\xb7\x2c\x33\x90\xf2", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x37\xe3\x39\x9d\x9c\xa6\x96\x79\x9f\x08\xf4\xf7\x2b\xc0\xcd\xd8", 1, - 128, 256 }, + "\x37\xe3\x39\x9d\x9c\xa6\x96\x79\x9f\x08\xf4\xf7\x2b\xc0\xcd\xd8", 1, 128, 256 }, { 96, 256, 128, 103, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1077,8 +927,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x3d\x52\x71\x0b\xec\x86\xd4\xea\x9f\xea\x2f\xf2\x69\x54\x91\x91", 1, - 128, 512 }, + "\x3d\x52\x71\x0b\xec\x86\xd4\xea\x9f\xea\x2f\xf2\x69\x54\x91\x91", 1, 128, 512 }, { 96, 256, 128, 104, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1100,8 +949,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x51\x35\x63\x29\xe2\x80\xb1\x2d\x55\xd3\xd9\x8f\x0a\x58\x0c\xbe", 1, - 128, 1024 }, + "\x51\x35\x63\x29\xe2\x80\xb1\x2d\x55\xd3\xd9\x8f\x0a\x58\x0c\xbe", 1, 128, 1024 }, { 96, 256, 128, 105, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1111,8 +959,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x55\xdb\x62\x25\x4d\x94\x24\x3f\x1d\xe7\xc8\xd3\xcc\x6f\x8d", "\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00" "\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80", - "\xc1\x52\xa4\xb9\x0c\x54\x8c\x71\xdc\x47\x9e\xde\xaf\x92\x11\xbf", 1, - 128, 256 }, + "\xc1\x52\xa4\xb9\x0c\x54\x8c\x71\xdc\x47\x9e\xde\xaf\x92\x11\xbf", 1, 128, 256 }, { 96, 256, 128, 106, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1126,8 +973,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00" "\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00" "\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80", - "\x40\xef\x63\x83\x05\x2d\x91\xc2\xe4\xb4\x61\x1b\x0e\x32\xc5\xff", 1, - 128, 512 }, + "\x40\xef\x63\x83\x05\x2d\x91\xc2\xe4\xb4\x61\x1b\x0e\x32\xc5\xff", 1, 128, 512 }, { 96, 256, 128, 107, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1149,8 +995,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00" "\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00" "\x80\x00\x00\x00\x80\x00\x00\x00\x80", - "\xae\x9b\x54\x25\x41\xe8\x4f\xc7\x45\x42\xee\xd6\xbe\x63\x8f\xee", 1, - 128, 1024 }, + "\xae\x9b\x54\x25\x41\xe8\x4f\xc7\x45\x42\xee\xd6\xbe\x63\x8f\xee", 1, 128, 1024 }, { 96, 256, 128, 108, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1160,8 +1005,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x55\xdb\xe2\xa5\x4d\x94\xa4\xbf\x1d\xe7\x48\x53\xcc\x6f\x0d", "\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80" "\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00", - "\x10\xfe\xe3\xec\xfb\xa9\xcd\xf7\x97\xba\xe3\x7a\x62\x6e\xc8\x3b", 1, - 128, 256 }, + "\x10\xfe\xe3\xec\xfb\xa9\xcd\xf7\x97\xba\xe3\x7a\x62\x6e\xc8\x3b", 1, 128, 256 }, { 96, 256, 128, 109, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1175,8 +1019,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00" "\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00" "\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00", - "\x74\x90\x79\x5b\xdb\xbb\xf5\xd0\xae\xcb\x9a\x4f\x65\xaa\x37\x9f", 1, - 128, 512 }, + "\x74\x90\x79\x5b\xdb\xbb\xf5\xd0\xae\xcb\x9a\x4f\x65\xaa\x37\x9f", 1, 128, 512 }, { 96, 256, 128, 110, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1198,8 +1041,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00" "\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00" "\x00\x80\x00\x00\x00\x80\x00\x00\x00", - "\x1d\x10\x96\xa8\xca\x9e\x2b\xda\x27\x62\xc4\x1d\x5b\x16\xf6\x2f", 1, - 128, 1024 }, + "\x1d\x10\x96\xa8\xca\x9e\x2b\xda\x27\x62\xc4\x1d\x5b\x16\xf6\x2f", 1, 128, 1024 }, { 96, 256, 128, 111, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1209,8 +1051,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xaa\x24\x9d\xda\xb2\x6b\xdb\xc0\xe2\x18\x37\x2c\x33\x90\x72", "\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff" "\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f", - "\xaf\x84\x92\xc7\x92\xbf\x8d\x80\x62\xbe\x74\xff\x6e\xfb\x38\x69", 1, - 128, 256 }, + "\xaf\x84\x92\xc7\x92\xbf\x8d\x80\x62\xbe\x74\xff\x6e\xfb\x38\x69", 1, 128, 256 }, { 96, 256, 128, 112, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1224,8 +1065,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff" "\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff" "\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f", - "\xf2\x4d\xb6\x8c\x46\xb6\x7d\x6f\x40\x2f\xa6\xc8\x97\x91\x33\x68", 1, - 128, 512 }, + "\xf2\x4d\xb6\x8c\x46\xb6\x7d\x6f\x40\x2f\xa6\xc8\x97\x91\x33\x68", 1, 128, 512 }, { 96, 256, 128, 113, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1247,8 +1087,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff" "\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff" "\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f", - "\x43\xf6\x51\xab\x2e\x2e\xb0\xf0\x4b\xf6\x89\xa4\x0d\x32\xda\x24", 1, - 128, 1024 }, + "\x43\xf6\x51\xab\x2e\x2e\xb0\xf0\x4b\xf6\x89\xa4\x0d\x32\xda\x24", 1, 128, 1024 }, { 96, 256, 128, 114, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1258,8 +1097,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xaa\x24\x1d\x5a\xb2\x6b\x5b\x40\xe2\x18\xb7\xac\x33\x90\xf2", "\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f" "\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff", - "\x60\xd9\x52\x94\xa3\x69\x4c\xfa\xa6\x4b\x2f\x63\xbc\x1f\x82\xec", 1, - 128, 256 }, + "\x60\xd9\x52\x94\xa3\x69\x4c\xfa\xa6\x4b\x2f\x63\xbc\x1f\x82\xec", 1, 128, 256 }, { 96, 256, 128, 115, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1273,8 +1111,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff" "\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff" "\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff", - "\xbe\xac\xa0\xb4\x70\x27\x19\x61\x76\x18\x6d\x94\x40\x19\xc1\xc8", 1, - 128, 512 }, + "\xbe\xac\xa0\xb4\x70\x27\x19\x61\x76\x18\x6d\x94\x40\x19\xc1\xc8", 1, 128, 512 }, { 96, 256, 128, 116, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1296,8 +1133,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff" "\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff" "\xff\x7f\xff\xff\xff\x7f\xff\xff\xff", - "\xd4\x81\x10\x28\xa5\x77\xd4\xdd\x69\xd6\xb3\x5d\x71\x7f\x73\xe3", 1, - 128, 1024 }, + "\xd4\x81\x10\x28\xa5\x77\xd4\xdd\x69\xd6\xb3\x5d\x71\x7f\x73\xe3", 1, 128, 1024 }, { 96, 256, 128, 117, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1307,8 +1143,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x55\xdb\xe2\xda\xb2\x6b\x5b\x3f\x1d\xe7\x48\x2c\x33\x90\xf2", "\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00" "\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff", - "\x10\xfb\x61\x27\x2b\x55\x5b\xee\x10\x4f\x5a\x71\x81\x87\x16\xd6", 1, - 128, 256 }, + "\x10\xfb\x61\x27\x2b\x55\x5b\xee\x10\x4f\x5a\x71\x81\x87\x16\xd6", 1, 128, 256 }, { 96, 256, 128, 118, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1322,8 +1157,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00" "\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00" "\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff", - "\x47\x56\x76\x4e\x59\x58\x35\x04\x18\x28\x77\xd8\xc3\x31\x20\xf0", 1, - 128, 512 }, + "\x47\x56\x76\x4e\x59\x58\x35\x04\x18\x28\x77\xd8\xc3\x31\x20\xf0", 1, 128, 512 }, { 96, 256, 128, 119, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1345,8 +1179,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff" "\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff" "\xff\x00\x00\x00\x00\xff\xff\xff\xff", - "\x95\xa2\xb1\x2a\x4a\x28\x00\x89\xd4\xbd\x4f\x90\x42\x53\xe7\x54", 1, - 128, 1024 }, + "\x95\xa2\xb1\x2a\x4a\x28\x00\x89\xd4\xbd\x4f\x90\x42\x53\xe7\x54", 1, 128, 1024 }, { 96, 256, 128, 120, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1356,8 +1189,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xaa\x24\x1d\x25\x4d\x94\xa4\xc0\xe2\x18\xb7\xd3\xcc\x6f\x0d", "\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff" "\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00", - "\x60\xdc\xd4\x59\x74\xbe\xbe\x03\x2e\xb7\xb8\x6c\x9d\x06\x34\x52", 1, - 128, 256 }, + "\x60\xdc\xd4\x59\x74\xbe\xbe\x03\x2e\xb7\xb8\x6c\x9d\x06\x34\x52", 1, 128, 256 }, { 96, 256, 128, 121, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1371,8 +1203,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff" "\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff" "\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00", - "\xf0\xe6\xa3\xc1\xf2\x8a\xd9\x2d\x0d\xbc\x90\x0b\xe2\x91\xd8\x77", 1, - 128, 512 }, + "\xf0\xe6\xa3\xc1\xf2\x8a\xd9\x2d\x0d\xbc\x90\x0b\xe2\x91\xd8\x77", 1, 128, 512 }, { 96, 256, 128, 122, "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", @@ -1394,308 +1225,247 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00" "\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00" "\x00\xff\xff\xff\xff\x00\x00\x00\x00", - "\x57\xef\xf4\xa5\x25\xee\xff\x2e\xbd\x7a\x28\xeb\x89\x42\x82\xbe", 1, - 128, 1024 }, + "\x57\xef\xf4\xa5\x25\xee\xff\x2e\xbd\x7a\x28\xeb\x89\x42\x82\xbe", 1, 128, 1024 }, { 96, 256, 128, 123, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf5\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf5\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 124, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf6\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf6\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 125, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\x74\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\x74\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 126, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x41\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x41\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 127, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\x37\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\x37\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 128, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x28\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x28\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 129, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x2b\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x2b\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 130, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x88\x14\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x88\x14\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 131, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x15\xac\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x15\xac\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 132, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\x8c\x51\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\x8c\x51\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 133, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x50\x40\x54\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x50\x40\x54\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 134, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x55\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x55\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 135, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x56\x32\x3f\x44", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x56\x32\x3f\x44", 0, 24, 0 }, { 96, 256, 128, 136, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x45", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x45", 0, 24, 0 }, { 96, 256, 128, 137, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x46", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x46", 0, 24, 0 }, { 96, 256, 128, 138, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x04", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\x04", 0, 24, 0 }, { 96, 256, 128, 139, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\xc4", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x08\x14\xac\x51\x40\x54\x32\x3f\xc4", 0, 24, 0 }, { 96, 256, 128, 140, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xf4\x40\x9b\xb7\x29\x03\x9d\x88\x14\xac\x51\x40\x54\x32\x3f\xc4", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xf4\x40\x9b\xb7\x29\x03\x9d\x88\x14\xac\x51\x40\x54\x32\x3f\xc4", 0, 24, 0 }, { 96, 256, 128, 141, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 24, 0 }, { 96, 256, 128, 142, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", - "", "", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 24, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "", "", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 24, 0 }, { 96, 256, 128, 143, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x28\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x28\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 144, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x2b\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x2b\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 145, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\xa9\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\xa9\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 146, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x90\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x90\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 147, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x87\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x87\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 148, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa7\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa7\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 149, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa4\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa4\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 150, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\x53\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\x53\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 151, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf0\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf0\x09\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 152, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x29\xbb\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x29\xbb\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 153, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xba\xa2\x1c\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xba\xa2\x1c\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 154, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1d\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1d\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 155, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1e\xe9\xa7\xd6", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1e\xe9\xa7\xd6", 0, 24, 128 }, { 96, 256, 128, 156, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd7", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd7", 0, 24, 128 }, { 96, 256, 128, 157, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd4", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\xd4", 0, 24, 128 }, { 96, 256, 128, 158, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\x96", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\x96", 0, 24, 128 }, { 96, 256, 128, 159, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\x56", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\xd3\xf1\x09\xbb\xa2\x1c\xe9\xa7\x56", 0, 24, 128 }, { 96, 256, 128, 160, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x29\x91\x40\x07\xa6\x11\x9d\x53\xf1\x09\xbb\xa2\x1c\xe9\xa7\x56", 0, - 24, 128 }, + "\x29\x91\x40\x07\xa6\x11\x9d\x53\xf1\x09\xbb\xa2\x1c\xe9\xa7\x56", 0, 24, 128 }, { 96, 256, 128, 161, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 24, 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 24, 128 }, { 96, 256, 128, 162, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", "\x00\x01\x02", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 24, 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 24, 128 }, { 96, 256, 128, 163, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1704,8 +1474,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x67\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x67\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 164, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1714,8 +1483,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x64\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x64\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 165, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1724,8 +1492,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\xe6\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\xe6\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 166, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1734,8 +1501,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x41\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x41\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 167, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1744,8 +1510,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x96\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x96\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 168, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1754,8 +1519,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe9\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe9\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 169, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1764,8 +1528,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xea\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xea\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 170, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1774,8 +1537,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\x3a\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\x3a\x92\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 171, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1784,8 +1546,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x93\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x93\xaa\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 172, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1794,8 +1555,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\x8a\x47\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\x8a\x47\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 173, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1804,8 +1564,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x46\xf5\xce\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x46\xf5\xce\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 174, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1814,8 +1573,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xcf\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xcf\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 175, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1824,8 +1582,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xcc\xa5\x2b\x7a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xcc\xa5\x2b\x7a", 0, 24, 264 }, { 96, 256, 128, 176, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1834,8 +1591,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7b", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x7b", 0, 24, 264 }, { 96, 256, 128, 177, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1844,8 +1600,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x78", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x78", 0, 24, 264 }, { 96, 256, 128, 178, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1854,8 +1609,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x3a", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\x3a", 0, 24, 264 }, { 96, 256, 128, 179, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1864,8 +1618,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\xfa", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\xba\x92\xaa\x47\xf5\xce\xa5\x2b\xfa", 0, 24, 264 }, { 96, 256, 128, 180, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1874,8 +1627,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x66\x40\x5a\x16\xe8\xb4\x4e\x3a\x92\xaa\x47\xf5\xce\xa5\x2b\xfa", 0, - 24, 264 }, + "\x66\x40\x5a\x16\xe8\xb4\x4e\x3a\x92\xaa\x47\xf5\xce\xa5\x2b\xfa", 0, 24, 264 }, { 96, 256, 128, 181, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1884,8 +1636,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 24, 264 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 24, 264 }, { 96, 256, 128, 182, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -1894,8 +1645,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20", "\xd0\x3b\xcb\x3c\xa5\x2d\x48\xd1\xd2\x03\xb1\xe7\xb1\xa5\x99\x5a\xf1" "\xa0\x46\x6a\x61\xbb\x38\x6a\x2e\x12\xd1\x89\xa2\xc4\xea\x15\xe9", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 24, 264 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 24, 264 }, { 96, 256, 128, 183, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -1920,8 +1670,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xc2\x96\x43\x62\x46\xc3\xa7\xc4\xb3\xba\x09\xab\x2a\x6a\x08\x89", 1, - 512, 1024 }, + "\xc2\x96\x43\x62\x46\xc3\xa7\xc4\xb3\xba\x09\xab\x2a\x6a\x08\x89", 1, 512, 1024 }, { 96, 256, 128, 184, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -1946,8 +1695,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x99\xa3\xb0\xff\xf6\xfd\xcb\xcc\xe9\xdc\x58\x20\xf2\xa6\x48\x61", 1, - 512, 1024 }, + "\x99\xa3\xb0\xff\xf6\xfd\xcb\xcc\xe9\xdc\x58\x20\xf2\xa6\x48\x61", 1, 512, 1024 }, { 96, 256, 128, 185, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -1972,8 +1720,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xea\xff\x8f\x47\xef\x92\x68\xfd\x0d\x94\xe8\xa9\xc4\xb7\x8d\x24", 1, - 512, 1024 }, + "\xea\xff\x8f\x47\xef\x92\x68\xfd\x0d\x94\xe8\xa9\xc4\xb7\x8d\x24", 1, 512, 1024 }, { 96, 256, 128, 186, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -1998,8 +1745,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x86\xed\x21\xfd\xa0\x80\xa7\xd1\x39\x81\x07\x8d\x86\xb3\xe3\xcd", 1, - 512, 1024 }, + "\x86\xed\x21\xfd\xa0\x80\xa7\xd1\x39\x81\x07\x8d\x86\xb3\xe3\xcd", 1, 512, 1024 }, { 96, 256, 128, 187, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -2024,8 +1770,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x34\xf9\xe0\xfa\xa5\x15\xee\xe0\xe7\x84\xe6\xef\x26\x78\xbe\xfa", 1, - 512, 1024 }, + "\x34\xf9\xe0\xfa\xa5\x15\xee\xe0\xe7\x84\xe6\xef\x26\x78\xbe\xfa", 1, 512, 1024 }, { 96, 256, 128, 188, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -2050,8 +1795,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x3c\x94\xb9\xfe\x60\xbd\xb3\x5c\x6b\x7b\x73\xb7\x65\x08\x34\x92", 1, - 512, 1024 }, + "\x3c\x94\xb9\xfe\x60\xbd\xb3\x5c\x6b\x7b\x73\xb7\x65\x08\x34\x92", 1, 512, 1024 }, { 96, 256, 128, 189, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -2076,8 +1820,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x2b\x11\xcf\x9f\x8d\xb8\x49\x0d\x40\x9f\xc6\x2a\xfd\x73\x79\xf3", 1, - 512, 1024 }, + "\x2b\x11\xcf\x9f\x8d\xb8\x49\x0d\x40\x9f\xc6\x2a\xfd\x73\x79\xf3", 1, 512, 1024 }, { 96, 256, 128, 190, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -2102,8 +1845,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xc9\xc8\x36\x69\x20\xf8\x83\x81\x40\x77\x12\xce\xc6\x1e\x66\x07", 1, - 512, 1024 }, + "\xc9\xc8\x36\x69\x20\xf8\x83\x81\x40\x77\x12\xce\xc6\x1e\x66\x07", 1, 512, 1024 }, { 96, 256, 128, 191, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -2128,8 +1870,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x23\x73\xcf\xa2\xab\x24\x44\x6a\xd5\xa2\x36\x16\x7b\x80\x27\xfe", 1, - 512, 1024 }, + "\x23\x73\xcf\xa2\xab\x24\x44\x6a\xd5\xa2\x36\x16\x7b\x80\x27\xfe", 1, 512, 1024 }, { 96, 256, 128, 192, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", @@ -2154,8 +1895,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x5f\x93\x94\x64\x78\xd8\x08\x1e\x72\x47\xf4\x14\xad\x39\xa5\x15", 1, - 512, 1024 }, + "\x5f\x93\x94\x64\x78\xd8\x08\x1e\x72\x47\xf4\x14\xad\x39\xa5\x15", 1, 512, 1024 }, { 96, 256, 128, 193, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2180,8 +1920,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\x13\x3f\xe6\x23\x91\x74\x4d\x11\xce\x44\x59\x4b\x96\xc5\x3b\xaf", 1, - 512, 1016 }, + "\x13\x3f\xe6\x23\x91\x74\x4d\x11\xce\x44\x59\x4b\x96\xc5\x3b\xaf", 1, 512, 1016 }, { 96, 256, 128, 194, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2206,8 +1945,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\xe3\x45\x1a\xdb\x9d\x23\xa7\x71\x0a\x1a\xaf\xba\x26\xf5\x63\x87", 1, - 512, 1016 }, + "\xe3\x45\x1a\xdb\x9d\x23\xa7\x71\x0a\x1a\xaf\xba\x26\xf5\x63\x87", 1, 512, 1016 }, { 96, 256, 128, 195, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2232,8 +1970,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\xb0\xbb\x8a\x55\xff\x5f\x52\xa5\x04\x3c\x6e\x77\x95\x84\x75\x57", 1, - 512, 1016 }, + "\xb0\xbb\x8a\x55\xff\x5f\x52\xa5\x04\x3c\x6e\x77\x95\x84\x75\x57", 1, 512, 1016 }, { 96, 256, 128, 196, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2258,8 +1995,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\xf4\xfc\x25\xf4\xc5\x54\x3a\x9a\xfe\xe9\x81\x9e\x29\x04\xfb\x68", 1, - 512, 1016 }, + "\xf4\xfc\x25\xf4\xc5\x54\x3a\x9a\xfe\xe9\x81\x9e\x29\x04\xfb\x68", 1, 512, 1016 }, { 96, 256, 128, 197, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2284,8 +2020,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\x5e\x67\xa7\xb8\x73\x3e\x0e\x4b\x01\xac\x21\x78\xa2\x05\xae\x7e", 1, - 512, 1016 }, + "\x5e\x67\xa7\xb8\x73\x3e\x0e\x4b\x01\xac\x21\x78\xa2\x05\xae\x7e", 1, 512, 1016 }, { 96, 256, 128, 198, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2310,8 +2045,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\x17\x7a\x77\xfc\xe1\x14\xa4\x34\x9c\x4f\x8d\x5e\xc8\x25\xd0\x6f", 1, - 512, 1016 }, + "\x17\x7a\x77\xfc\xe1\x14\xa4\x34\x9c\x4f\x8d\x5e\xc8\x25\xd0\x6f", 1, 512, 1016 }, { 96, 256, 128, 199, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2336,8 +2070,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\x62\x3c\x7d\x44\x24\xf5\x49\x7a\xed\xfd\x13\x39\xcf\x8c\xec\xce", 1, - 512, 1016 }, + "\x62\x3c\x7d\x44\x24\xf5\x49\x7a\xed\xfd\x13\x39\xcf\x8c\xec\xce", 1, 512, 1016 }, { 96, 256, 128, 200, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2362,8 +2095,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\x1c\x18\xb6\x93\x54\xb1\x89\x73\x1a\x1a\x83\xfe\x8f\x0d\x57\xc9", 1, - 512, 1016 }, + "\x1c\x18\xb6\x93\x54\xb1\x89\x73\x1a\x1a\x83\xfe\x8f\x0d\x57\xc9", 1, 512, 1016 }, { 96, 256, 128, 201, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2388,8 +2120,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\x20\x45\x81\x5b\x82\x11\xb9\xa2\x99\x5e\xff\xe0\xb8\xed\x98\x68", 1, - 512, 1016 }, + "\x20\x45\x81\x5b\x82\x11\xb9\xa2\x99\x5e\xff\xe0\xb8\xed\x98\x68", 1, 512, 1016 }, { 96, 256, 128, 202, "\x9d\xe8\x36\xaa\x57\x95\x85\x08\x1f\x33\x0a\x7c\x40\x36\xe2\x0e\x38" "\xef\x15\xef\xf3\x94\x51\x84\xd2\x31\x86\x7f\x50\x5f\xff\xdf", @@ -2414,8 +2145,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", - "\x1a\xe2\xed\x84\xea\x97\x74\xd7\x8d\x78\x2b\xf8\xd9\x72\xa8\xb8", 1, - 512, 1016 }, + "\x1a\xe2\xed\x84\xea\x97\x74\xd7\x8d\x78\x2b\xf8\xd9\x72\xa8\xb8", 1, 512, 1016 }, { 96, 256, 128, 203, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f", @@ -2430,8 +2160,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 1, - 256, 512 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 1, 256, 512 }, { 96, 256, 128, 204, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f", @@ -2446,8 +2175,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 256, 512 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 256, 512 }, { 96, 256, 128, 205, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f", @@ -2462,8 +2190,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 256, 512 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 256, 512 }, { 96, 256, 128, 206, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f", @@ -2478,8 +2205,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80", 1, - 256, 512 }, + "\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80", 1, 256, 512 }, { 96, 256, 128, 207, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f", @@ -2494,8 +2220,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f", 1, - 256, 512 }, + "\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f", 1, 256, 512 }, { 96, 256, 128, 208, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f", @@ -2510,8 +2235,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00", 1, - 256, 512 }, + "\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00", 1, 256, 512 }, { 96, 256, 128, 209, "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f", @@ -2526,13 +2250,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - "\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 256, 512 }, + "\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 256, 512 }, { 96, 256, 128, 210, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xc6\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x7b" "\xb6\x6f\x80\x90\xc1\x49\xe4\x52\xec\x7f\x20\x32\x7e\xb2\xea\x2e\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x0f\xf9\xbc" @@ -2545,13 +2267,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xe7\xa3\x30\x09\xef\x5f\xc6\x04\xea\x0f\x9a\x75\xe9\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe7\xa3" "\x30\x09\xef\x5f\xc6\x04\xea\x0f\x9a\x75\xe9", - "\x35\x72\x16\x27\x77\x26\x2c\x51\x8e\xef\x57\x3b\x72\x0e\x8e\x64", 1, - 32, 768 }, + "\x35\x72\x16\x27\x77\x26\x2c\x51\x8e\xef\x57\x3b\x72\x0e\x8e\x64", 1, 32, 768 }, { 96, 256, 128, 211, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xc7\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x76" "\x20\x9e\xef\x14\x16\x91\xfb\xa5\xd1\x0e\xaf\x58\x1a\xff\xe6\x2e\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x0e\x73\xd2" @@ -2564,13 +2284,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x18\x50\x1a\x43\xcd\xd6\xa2\x06\x4a\xa5\x20\xad\xc7\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x75\x91\x18\x50" "\x1a\x43\xcd\xd6\xa2\x06\x4a\xa5\x20\xad\xc7", - "\x34\x72\x16\x37\x5f\x5b\x7b\x5c\x4e\x6b\xff\x49\x12\xfd\x94\x73", 1, - 32, 768 }, + "\x34\x72\x16\x37\x5f\x5b\x7b\x5c\x4e\x6b\xff\x49\x12\xfd\x94\x73", 1, 32, 768 }, { 96, 256, 128, 212, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xfc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x8b" "\x79\x40\x3d\xfa\xab\xc0\xd8\xc1\x8d\x23\xa3\x46\x9c\x13\xe6\x2e\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x0a\x4b\x94" @@ -2583,13 +2301,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xda\x00\xc1\x2a\x46\xb2\x14\x0e\xca\xfa\x3a\x8b\x40\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x4d\xd7\xda\x00" "\xc1\x2a\x46\xb2\x14\x0e\xca\xfa\x3a\x8b\x40", - "\x30\x72\x16\x77\xff\x2e\xb8\x89\x4e\x5a\x9d\x84\x92\xb7\xb0\xaf", 1, - 32, 768 }, + "\x30\x72\x16\x77\xff\x2e\xb8\x89\x4e\x5a\x9d\x84\x92\xb7\xb0\xaf", 1, 32, 768 }, { 96, 256, 128, 213, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xfa\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x9b" "\xcb\xb8\xda\x47\x7d\x58\x0d\x77\x2d\xe4\x22\x9b\xba\x7d\xe2\x29\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x1e\x9d\xed" @@ -2602,13 +2318,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x3d\xb6\xc3\x76\xec\x44\xc5\xab\x10\x46\x62\xd1\x00\xf8\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xee\x9b\xae\x3d\xb6" "\xc3\x76\xec\x44\xc5\xab\x10\x46\x62\xd1\x00", - "\x2b\x72\x16\xc7\x87\x37\x44\xc2\x0e\xc5\xe2\xcd\xb2\x60\xd3\xfa", 1, - 32, 768 }, + "\x2b\x72\x16\xc7\x87\x37\x44\xc2\x0e\xc5\xe2\xcd\xb2\x60\xd3\xfa", 1, 32, 768 }, { 96, 256, 128, 214, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xee\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xb9" "\xf5\x5b\xd5\x6e\x0f\xd7\x4b\x46\x06\x3a\x96\x35\x4c\xfb\xee\x32\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x20\xc7\x88" @@ -2621,13 +2335,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x42\xcd\x51\xff\xa9\x33\xac\x79\xa4\xa7\xb0\x56\x0c\xe3\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd0\xc1\xcb\x42\xcd" "\x51\xff\xa9\x33\xac\x79\xa4\xa7\xb0\x56\x0c", - "\x22\x72\x16\x57\xb0\x13\x0d\x28\xcf\x1e\xc6\x51\x53\xc4\x11\x82", 1, - 32, 768 }, + "\x22\x72\x16\x57\xb0\x13\x0d\x28\xcf\x1e\xc6\x51\x53\xc4\x11\x82", 1, 32, 768 }, { 96, 256, 128, 215, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xef\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xb4" "\x6f\xca\x24\xd3\x53\xff\x5e\x49\xea\xc5\x15\x40\xe8\x40\xea\x30\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x3d\x31\x1e" @@ -2640,39 +2352,33 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x93\x49\xa5\xd7\x9e\x2a\x80\xca\x21\x7d\x14\x9c\x08\xe1\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcd\x37\x5d\x93\x49" "\xa5\xd7\x9e\x2a\x80\xca\x21\x7d\x14\x9c\x08", - "\x21\x72\x16\x67\x98\x48\x5c\x33\x8f\x9a\x6d\x60\xf3\xb2\x18\x91", 1, - 32, 768 }, + "\x21\x72\x16\x67\x98\x48\x5c\x33\x8f\x9a\x6d\x60\xf3\xb2\x18\x91", 1, 32, 768 }, { 96, 256, 128, 216, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf5\x9d\x56\x15\x1d\xe2\x8b\xef\x83\x50\x5f\x6d\x89\xc0\xb0\xf7\xf7" "\x5b\x2f\xa8\xe6\xdc\xe3\x86\x07\x5d\xb2\x83\xec\x85\xee\x62\x55\x5b" "\xaf\xfa\xd4\x23\xaf\x25\xf6\x60\x69\xbb\x69\xfb\x6f\x4d", "\xd6\xee\x4e\xe2\x5d\x3b\xde\xa8\x1e\x76\xde\x89\x34\xcc\x51\xfb\x84" "\x9c\xfc\xa7\x68\x57\x08\x57\x5d\xc6\xdf\x7a\x01\xe3\x6a\x81\x84\x9c" "\xfc\xa7\x68\x57\x08\x57\x5d\xc6\xdf\x7a\x01\xe3\x6a\x81", - "\x83\x13\x12\xcb\xb0\xf1\x65\xdc\x3e\x8f\xf5\x21\x25\xf4\x86\x40", 1, - 32, 384 }, + "\x83\x13\x12\xcb\xb0\xf1\x65\xdc\x3e\x8f\xf5\x21\x25\xf4\x86\x40", 1, 32, 384 }, { 96, 256, 128, 217, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf7\x17\xf8\xd5\xb2\x80\x32\xd5\xc8\xe8\x06\x1c\xd4\x4d\x71\xe4\xf2" "\xd5\x5d\xe7\x72\xfe\x7a\x91\xce\x85\xe4\x10\xdb\x3e\x2d\x8d\x50\xd5" "\xdd\xb5\x40\x01\x36\x32\x3f\xb8\x3f\x28\x5e\x40\xac\xa2", "\xd4\x64\xe0\x22\xf2\x59\x67\x92\x55\xce\x87\xf8\x69\x41\x90\xe8\x81" "\x12\x8e\xe8\xfc\x75\x91\x40\x94\x1e\x89\xe9\x36\x58\xa9\x6e\x81\x12" "\x8e\xe8\xfc\x75\x91\x40\x94\x1e\x89\xe9\x36\x58\xa9\x6e", - "\x82\x13\x12\xdb\x98\x26\xb5\xe7\xfe\x0a\x9d\x30\xc5\xe2\x8d\x4f", 1, - 32, 384 }, + "\x82\x13\x12\xdb\x98\x26\xb5\xe7\xfe\x0a\x9d\x30\xc5\xe2\x8d\x4f", 1, 32, 384 }, { 96, 256, 128, 218, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf2\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xe6" "\x8a\x92\x2c\x92\x19\xd3\x0f\x07\x55\x4d\x7d\x99\xf2\xbd\xe9\x2c\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\xe2\x4c\x07" @@ -2685,13 +2391,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x19\xf3\x5e\x64\xd7\xf4\x65\xb3\xf4\x89\xe2\x02\x0d\xfd\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x12\x4a\x44\x19\xf3" "\x5e\x64\xd7\xf4\x65\xb3\xf4\x89\xe2\x02\x0d", - "\xc1\x04\x57\x69\xd4\x87\xd5\x45\xce\xf3\xf0\xd3\x4b\x7a\x87\x33", 1, - 32, 768 }, + "\xc1\x04\x57\x69\xd4\x87\xd5\x45\xce\xf3\xf0\xd3\x4b\x7a\x87\x33", 1, 32, 768 }, { 96, 256, 128, 219, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xdc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x2e" "\x67\x84\xd8\x57\xdf\x07\x54\x3d\x0d\xc7\x2f\x17\x99\x35\xfb\xed\xe8" "\xc8\xba\xf0\x1e\xe2\x04\x4b\x16\x2c\xbb\x34\x3b\x35\x5a\xcc\x29\xd8" @@ -2700,13 +2404,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xa0\x57\xd7\xd9\x54\xec\x85\x67\x96\xaa\xd6\xfa\xff\xb1\x18\x3c\x2f" "\x9b\xe7\x4c\x6a\x45\x76\xe0\xb0\x9a\x7a\x5c\x23\x30\x96\x3c\x2f\x9b" "\xe7\x4c\x6a\x45\x76\xe0\xb0\x9a\x7a\x5c\x23\x30\x96", - "\x64\xe7\xef\xd2\x45\x16\xa8\x3e\x2c\x87\xe0\x6a\x76\xe2\xde\xa3", 1, - 32, 512 }, + "\x64\xe7\xef\xd2\x45\x16\xa8\x3e\x2c\x87\xe0\x6a\x76\xe2\xde\xa3", 1, 32, 512 }, { 96, 256, 128, 220, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf7\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x4c" "\x6e\xad\x26\xf8\x4a\x02\x25\xd5\x57\x74\x5d\x32\xfc\x72\xe7\x2c\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x64\xdb\x33" @@ -2719,13 +2421,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x8f\x02\x19\x33\xfd\x67\x57\xe3\xd7\x66\xda\x85\x07\xfd\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x94\xdd\x70\x8f\x02" "\x19\x33\xfd\x67\x57\xe3\xd7\x66\xda\x85\x07", - "\xe6\xcc\x67\x29\xd7\x9b\xa5\x58\xcd\x73\xb0\x3c\xba\x54\xd6\x60", 1, - 32, 768 }, + "\xe6\xcc\x67\x29\xd7\x9b\xa5\x58\xcd\x73\xb0\x3c\xba\x54\xd6\x60", 1, 32, 768 }, { 96, 256, 128, 221, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf0\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x4f" "\xd8\xc3\x75\x7c\x9f\x29\x38\xdc\x3b\x07\xd8\x58\x98\xbf\xe2\x2a\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x61\x55\x41" @@ -2738,13 +2438,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xe0\x7e\x6c\x0b\xf2\x5e\x2b\x34\x55\x3c\x3e\xcb\x03\xfb\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x91\x53\x02\xe0\x7e" "\x6c\x0b\xf2\x5e\x2b\x34\x55\x3c\x3e\xcb\x03", - "\xe5\xcc\x67\x39\xbf\xd0\xf4\x63\x8d\xef\x57\x4b\x5a\x43\xdd\x6f", 1, - 32, 768 }, + "\xe5\xcc\x67\x39\xbf\xd0\xf4\x63\x8d\xef\x57\x4b\x5a\x43\xdd\x6f", 1, 32, 768 }, { 96, 256, 128, 222, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf2\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xdf" "\x03\xca\x84\x08\x2f\x7f\x70\xad\x8e\x40\x04\xca\xbd\x2c\xe4\x2b\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x28\xfd\x41" @@ -2757,13 +2455,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xf8\xc1\x16\x06\xaf\xae\xaf\xd5\x2a\xb8\xdc\x27\x05\xfa\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd8\xfb\x02\xf8\xc1" "\x16\x06\xaf\xae\xaf\xd5\x2a\xb8\xdc\x27\x05", - "\x0f\xca\x70\x22\x28\x81\x7d\x53\xee\x64\xd1\x42\xb1\x92\xe6\x65", 1, - 32, 768 }, + "\x0f\xca\x70\x22\x28\x81\x7d\x53\xee\x64\xd1\x42\xb1\x92\xe6\x65", 1, 32, 768 }, { 96, 256, 128, 223, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf3\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x1f" "\xfc\x31\xae\x69\x39\x93\x94\xb8\xc3\x38\x67\x4c\x3d\xfd\xe9\x29\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x47\x7e\xc8" @@ -2776,26 +2472,22 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x0b\x55\x04\x02\x51\x88\x04\x07\xd4\x39\x89\xff\x04\xf8\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb7\x78\x8b\x0b\x55" "\x04\x02\x51\x88\x04\x07\xd4\x39\x89\xff\x04", - "\xef\xc3\xb0\x35\xde\xd6\xb4\x60\xbf\xce\x6f\x49\x49\x55\xe6\x77", 1, - 32, 768 }, + "\xef\xc3\xb0\x35\xde\xd6\xb4\x60\xbf\xce\x6f\x49\x49\x55\xe6\x77", 1, 32, 768 }, { 96, 256, 128, 224, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\x2b\xfd\x0d\x56\xec\xe9\x87\x71\x75\x6d\x60\xd9\xd9\x10\x6c\xd0\xc6" "\xfc\x10\x69\x36\xc7\xef\x34\x7c\x07\x8f\xd7\x1c\x54\x22\x81\x64\xfc" "\x90\x3b\x04\x38\xa3\x97\x8d\x3a\x54\xef\x99\x2a\xa3\xae", "\x08\x8e\x15\xa1\xac\x30\xd2\x36\xe8\x4b\xe1\x3d\x64\x1c\x8d\xdc\xb5" "\x3b\xc3\x66\xb8\x4c\x04\xe5\x26\x9c\xe2\x2e\xf1\x32\xa6\x62\xb5\x3b" "\xc3\x66\xb8\x4c\x04\xe5\x26\x9c\xe2\x2e\xf1\x32\xa6\x62", - "\x34\x5f\xc9\xfe\x57\x3c\x13\x6c\x1b\xe8\x37\x30\x50\x0c\xe6\x62", 1, - 32, 384 }, + "\x34\x5f\xc9\xfe\x57\x3c\x13\x6c\x1b\xe8\x37\x30\x50\x0c\xe6\x62", 1, 32, 384 }, { 96, 256, 128, 225, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf6\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x7c" "\xc2\x25\x5d\xec\xdf\x8e\x0f\xe1\x37\x35\x91\xda\x0e\x28\xe4\x28\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\xe2\x91\xfb" @@ -2808,13 +2500,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x8c\x53\xa6\x4a\xd5\x80\xde\x96\x6c\x07\x4d\xa7\x0d\xf9\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x12\x97\xb8\x8c\x53" "\xa6\x4a\xd5\x80\xde\x96\x6c\x07\x4d\xa7\x0d", - "\x33\x6f\x97\xa5\xfa\xa9\x95\xa2\xa0\x37\x81\xb5\x91\x58\x8d\xa8", 1, - 32, 768 }, + "\x33\x6f\x97\xa5\xfa\xa9\x95\xa2\xa0\x37\x81\xb5\x91\x58\x8d\xa8", 1, 32, 768 }, { 96, 256, 128, 226, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xc6\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x7a" "\xb6\x6f\x80\x90\xc1\x49\xe4\x52\xec\x7f\x20\x32\x7e\xb2\xea\x04\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x8d\x26\x13" @@ -2827,13 +2517,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x2e\x65\x5f\x60\xd2\xed\x2e\xb5\x47\xdc\x36\xe1\x00\xd5\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7d\x20\x50\x2e\x65" "\x5f\x60\xd2\xed\x2e\xb5\x47\xdc\x36\xe1\x00", - "\x93\x51\xc6\x80\xc8\xa5\xd3\x48\x82\xd4\x21\x45\xe8\x97\x45\xc4", 1, - 32, 768 }, + "\x93\x51\xc6\x80\xc8\xa5\xd3\x48\x82\xd4\x21\x45\xe8\x97\x45\xc4", 1, 32, 768 }, { 96, 256, 128, 227, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xc6\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x74" "\xb6\x6f\x80\x90\xc1\x49\xe4\x52\xec\x7f\x20\x32\x7e\xb2\xea\x2e\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\xac\xd9\xec" @@ -2846,13 +2534,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x41\xf5\xaf\xb0\xe6\x53\xab\xce\xf3\x85\x23\x2d\x49\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\xdf\xaf\x41\xf5" "\xaf\xb0\xe6\x53\xab\xce\xf3\x85\x23\x2d\x49", - "\xd7\x92\x66\xcd\x25\xa7\x84\x59\x9a\x0a\x8e\x31\xfc\x84\xd6\x04", 1, - 32, 768 }, + "\xd7\x92\x66\xcd\x25\xa7\x84\x59\x9a\x0a\x8e\x31\xfc\x84\xd6\x04", 1, 32, 768 }, { 96, 256, 128, 228, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf7\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x42" "\x51\xcd\x29\xb0\xaa\xa9\x60\x55\x7c\x9e\xa2\x82\x83\x34\xe4\xe4\xe2" "\x31\xdb\x0a\x27\xfa\xc9\xec\x9e\x74\x48\x86\xeb\x01\x33\xc5\x23\x21" @@ -2861,13 +2547,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x96\x1e\x26\x3e\x21\x42\xb1\x0f\xe7\xf3\x5b\x6f\xe5\xb0\x07\x35\x25" "\x62\x86\xb6\x53\x5d\xbb\x47\x38\xc2\x89\xee\xf3\x04\xff\x35\x25\x62" "\x86\xb6\x53\x5d\xbb\x47\x38\xc2\x89\xee\xf3\x04\xff", - "\x9d\x67\x1d\x40\x7d\x76\x60\x45\x9d\x5d\x58\x2d\x83\x91\x5e\xfe", 1, - 32, 512 }, + "\x9d\x67\x1d\x40\x7d\x76\x60\x45\x9d\x5d\x58\x2d\x83\x91\x5e\xfe", 1, 32, 512 }, { 96, 256, 128, 229, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xf5\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x73" "\xbd\x9f\x01\xbf\x33\x31\xb1\x2e\x31\xdd\x14\xcf\x11\xfe\xee\x1d\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x62\x5c\x69" @@ -2880,13 +2564,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xa1\x9d\xbd\xca\xb2\x4e\xe5\xf6\x09\x64\x23\x43\x0b\xcc\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x92\x5a\x2a\xa1\x9d" "\xbd\xca\xb2\x4e\xe5\xf6\x09\x64\x23\x43\x0b", - "\x7b\x20\x7c\x2c\x32\x78\xc6\x4f\x0d\x6b\x91\x3f\xe3\x71\xfe\x63", 1, - 32, 768 }, + "\x7b\x20\x7c\x2c\x32\x78\xc6\x4f\x0d\x6b\x91\x3f\xe3\x71\xfe\x63", 1, 32, 768 }, { 96, 256, 128, 230, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xdc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xec" "\x09\x33\xf0\xbf\xb9\x12\x18\xce\xa0\xd7\x4e\x06\x1f\x55\x9e\x2d\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x8d\x5b\x67" @@ -2899,13 +2581,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x24\xc7\x49\x85\xc8\xbd\xb0\xfb\x6d\x95\x47\x18\x0e\xfc\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7d\x5d\x24\x24\xc7" "\x49\x85\xc8\xbd\xb0\xfb\x6d\x95\x47\x18\x0e", - "\x36\x72\x16\x2b\xb1\xf3\xff\x53\x7e\xce\x01\x3f\x1a\xca\x4f\x68", 1, - 32, 768 }, + "\x36\x72\x16\x2b\xb1\xf3\xff\x53\x7e\xce\x01\x3f\x1a\xca\x4f\x68", 1, 32, 768 }, { 96, 256, 128, 231, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xdc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xee" "\x83\xa1\x4f\x48\xdb\x69\x62\x91\x08\x0e\xdf\xcc\x89\x8b\x88\x2b\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x8a\xd5\xf6" @@ -2918,13 +2598,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x74\x43\x9d\x5d\xbd\xb4\x84\x4c\xeb\x6a\xab\x5d\x0a\xfa\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7a\xd3\xb5\x74\x43" "\x9d\x5d\xbd\xb4\x84\x4c\xeb\x6a\xab\x5d\x0a", - "\x35\x72\x16\x3b\x99\x28\x4f\x5f\x3e\x4a\xa9\x4d\xba\xb8\x56\x77", 1, - 32, 768 }, + "\x35\x72\x16\x3b\x99\x28\x4f\x5f\x3e\x4a\xa9\x4d\xba\xb8\x56\x77", 1, 32, 768 }, { 96, 256, 128, 232, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xdc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xe8" "\x7d\xd0\x8e\xd4\xe4\xe0\x4c\x58\x77\x61\x6c\xbb\x02\xca\xbb\x29\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x87\x4f\x04" @@ -2937,13 +2615,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xc5\xbf\xf0\x35\xb2\xab\x58\x9d\x68\x40\x0f\xa3\x06\xf8\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x77\x49\x47\xc5\xbf" "\xf0\x35\xb2\xab\x58\x9d\x68\x40\x0f\xa3\x06", - "\x34\x72\x16\x4b\x81\x5d\x9e\x6a\xfe\xc5\x50\x5c\x5a\xa7\x5d\x86", 1, - 32, 768 }, + "\x34\x72\x16\x4b\x81\x5d\x9e\x6a\xfe\xc5\x50\x5c\x5a\xa7\x5d\x86", 1, 32, 768 }, { 96, 256, 128, 233, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xc8\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x6b" "\xe4\x36\xe3\x46\xf8\xf2\xb3\x2f\x4c\xbb\xae\xf9\x51\x50\xef\x04\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x2f\xb7\x6b" @@ -2956,13 +2632,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x95\x59\x4e\xe6\x72\x8f\xc5\x75\x71\x67\x1f\x83\x09\xd5\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xdf\xb1\x28\x95\x59" "\x4e\xe6\x72\x8f\xc5\x75\x71\x67\x1f\x83\x09", - "\x3a\x72\x16\xd7\xee\x1d\xa0\x18\xce\x84\x12\xf2\x51\x65\x6b\x19", 1, - 32, 768 }, + "\x3a\x72\x16\xd7\xee\x1d\xa0\x18\xce\x84\x12\xf2\x51\x65\x6b\x19", 1, 32, 768 }, { 96, 256, 128, 234, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xc5\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x78" "\x3c\xf9\x30\x2c\x7d\x22\x91\x4b\x38\xac\xa2\xe7\xd3\x74\xef\x1d\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x22\x8f\x2d" @@ -2975,13 +2649,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xe7\x32\xd1\x96\x51\x2b\x91\x60\x75\x5d\x9d\x9f\x09\xcc\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x89\x6e\xe7\x32" "\xd1\x96\x51\x2b\x91\x60\x75\x5d\x9d\x9f\x09", - "\x36\x72\x16\x17\x8f\xf1\xdc\x45\xce\x73\xb0\x2c\xd2\x1f\x87\x55", 1, - 32, 768 }, + "\x36\x72\x16\x17\x8f\xf1\xdc\x45\xce\x73\xb0\x2c\xd2\x1f\x87\x55", 1, 32, 768 }, { 96, 256, 128, 235, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xdc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x5d" "\xb7\x2f\x89\xd1\x40\x2b\x1a\x03\x73\xff\x0a\x9c\x5c\xd4\x4b\x6d\x67" "\xaf\x40\x79\x8f\x54\x55\x50\x17\x92\x95\x32\x48\xec\x23\x4c\xa6\xbf" @@ -2990,13 +2662,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x70\xfc\x86\x5f\xcb\xc0\xcb\x59\xe8\x92\xf3\x71\x3a\x50\xa8\xbc\xa0" "\xfc\x1d\xc5\xfb\xf3\x27\xfb\xb1\x24\x54\x5a\x50\xe9\xef\xbc\xa0\xfc" "\x1d\xc5\xfb\xf3\x27\xfb\xb1\x24\x54\x5a\x50\xe9\xef", - "\x0b\x49\x61\xc9\x52\x5e\xa2\xf2\xcd\xad\x62\x73\xe1\xc7\x82\x4c", 1, - 32, 512 }, + "\x0b\x49\x61\xc9\x52\x5e\xa2\xf2\xcd\xad\x62\x73\xe1\xc7\x82\x4c", 1, 32, 512 }, { 96, 256, 128, 236, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xdc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\x5f" "\x21\x5e\xc8\x7d\x62\xa2\x64\xca\xdb\x51\x9b\x4a\xc9\x0a\x76\x68\xd1" "\xdd\x03\xe5\x6e\xda\x63\x99\xac\x78\x03\xe7\xdd\x22\x11\x49\x10\xcd" @@ -3005,13 +2675,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xe6\x8d\xc7\xf3\xe9\x49\xb5\x90\x40\x3c\x62\xa7\xaf\x8e\x95\xb9\x16" "\x8e\x5e\x59\x1a\x7d\x11\x32\x0a\xce\xc2\x8f\xc5\x27\xdd\xb9\x16\x8e" "\x5e\x59\x1a\x7d\x11\x32\x0a\xce\xc2\x8f\xc5\x27\xdd", - "\x0a\x49\x61\xd9\x3a\x93\xf1\xfd\x8d\x29\x0a\x82\x81\xb6\x89\x5b", 1, - 32, 512 }, + "\x0a\x49\x61\xd9\x3a\x93\xf1\xfd\x8d\x29\x0a\x82\x81\xb6\x89\x5b", 1, 32, 512 }, { 96, 256, 128, 237, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x10\xab\xb1\x65", "\xff\xff\xff\xff", "\xdc\x8c\xe7\x08\xbf\x26\xaa\xb8\x62\xd9\x7e\x1b\x42\xf3\x1e\xf3\xd1" "\x5a\xd5\x90\xdd\x0f\x40\xba\x18\xac\xd1\x68\xf6\xac\x77\x7a\x0f\x38" "\xac\xa2\x43\x8b\x58\x8d\x54\x59\x49\x3e\x97\xe7\xfa\x33\x93\x2a\x09" @@ -3024,13 +2692,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xbb\x76\x9e\x76\xce\x8c\x66\x99\x15\x77\xf4\x94\x03\xde\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x63\x2c\x4a\xbb\x76" "\x9e\x76\xce\x8c\x66\x99\x15\x77\xf4\x94\x03", - "\x35\x72\x16\x13\x55\x24\x09\x43\xde\x94\x06\x29\x2a\x64\xc5\x51", 1, - 32, 768 }, + "\x35\x72\x16\x13\x55\x24\x09\x43\xde\x94\x06\x29\x2a\x64\xc5\x51", 1, 32, 768 }, { 96, 256, 128, 238, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x40\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x39" "\x0e\xf9\x3a\xeb\x61\xaa\x30\x7f\x14\x13\x23\xc3\x8e\x06\x85\xfa\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x25\x94\x45" @@ -3043,13 +2709,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x07\x15\xbc\x4b\x07\xc9\x2b\x97\x07\x37\x6d\xa1\x05\xed\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x5e\xf6\x07\x15" "\xbc\x4b\x07\xc9\x2b\x97\x07\x37\x6d\xa1\x05", - "\x19\x53\x2d\x9f\xa0\xb5\xfb\xd5\x82\xaa\xed\xa8\x30\x60\x2f\x1d", 1, - 32, 768 }, + "\x19\x53\x2d\x9f\xa0\xb5\xfb\xd5\x82\xaa\xed\xa8\x30\x60\x2f\x1d", 1, 32, 768 }, { 96, 256, 128, 239, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x49\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\xe0" "\x2b\x87\xae\xae\x8c\x3d\xa8\x89\x5f\x8c\xb0\xf6\xb9\xcc\x80\xf4\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\xcc\x4b\x7b" @@ -3062,26 +2726,22 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x73\xd0\x20\xdf\x8f\xda\xf5\x11\x7a\x61\x3e\xd7\x07\xe3\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x63\x81\xc8\x73\xd0" "\x20\xdf\x8f\xda\xf5\x11\x7a\x61\x3e\xd7\x07", - "\xad\xbd\x2c\xaf\xc8\xc8\xf0\xe5\x12\x50\xe7\xb8\x1c\x9d\x0a\x2d", 1, - 32, 768 }, + "\xad\xbd\x2c\xaf\xc8\xc8\xf0\xe5\x12\x50\xe7\xb8\x1c\x9d\x0a\x2d", 1, 32, 768 }, { 96, 256, 128, 240, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x43\xea\xda\xe0\x36\xf7\x33\xea\x9b\x5b\x7e\xb2\x2a\xee\x39\x5d\xb6" "\xf5\x1a\x4d\x10\xbc\x24\x60\x81\x0c\x22\x96\x51\x55\x6a\xcf\x38\x4a" "\xd8\x2e\x3e\x28\x0c\xad\x69\xf0\xdf\x25\xb4\x2b\x83\xb0", "\xda\x04\x7b\x78\x25\xdb\x18\x02\xe8\xe8\xe1\xaa\xc6\xba\x88\xfc\x2f" "\xf2\x34\x4b\x9e\x99\xcc\xdc\x04\xd8\x83\x6d\x55\x60\x83\x41\x2f\xf2" "\x34\x4b\x9e\x99\xcc\xdc\x04\xd8\x83\x6d\x55\x60\x83\x41", - "\x97\x3e\x27\x0a\x7a\xfc\xab\x75\x34\x8e\x14\xdb\xe1\x9c\x51\x56", 1, - 32, 384 }, + "\x97\x3e\x27\x0a\x7a\xfc\xab\x75\x34\x8e\x14\xdb\xe1\x9c\x51\x56", 1, 32, 384 }, { 96, 256, 128, 241, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x66\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x89" "\x1b\x79\x75\x21\xba\x92\x5b\x24\x09\x0a\xaf\x6c\x44\x82\xba\xe8\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x6d\x50\xc3" @@ -3094,13 +2754,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xde\xef\xd6\x16\x02\x11\xc0\x50\x23\x10\x84\xad\xcc\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x9a\x70\xde\xef" "\xd6\x16\x02\x11\xc0\x50\x23\x10\x84\xad\xcc", - "\xe1\x7c\x27\x3f\x31\x75\x8e\x75\x23\x22\xae\x48\x69\xc1\xbf\xbb", 1, - 32, 768 }, + "\xe1\x7c\x27\x3f\x31\x75\x8e\x75\x23\x22\xae\x48\x69\xc1\xbf\xbb", 1, 32, 768 }, { 96, 256, 128, 242, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x6a\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x51" "\x9c\xcc\xeb\xf7\x25\x73\xdb\xee\x8c\x12\xf7\x42\x55\xd1\x8c\x0a\xdd" "\x10\x35\x86\x1f\xfc\x0b\x7f\x40\x07\x9b\x96\x9f\x8c\x63\xb2\xaf\x4f" @@ -3109,26 +2767,22 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x9b\xe2\xed\x79\x00\x9b\x67\x6b\x58\xb3\x0c\x46\x60\x38\x02\x1d\x65" "\xfc\x50\x26\xae\x3c\x7a\x12\x68\x5b\xd3\x77\xd4\x8c\x92\x1d\x65\xfc" "\x50\x26\xae\x3c\x7a\x12\x68\x5b\xd3\x77\xd4\x8c\x92", - "\xa2\x23\x90\x22\x4c\x5d\xb0\xf0\x16\x96\x74\x3d\x87\x07\x25\xc5", 1, - 32, 512 }, + "\xa2\x23\x90\x22\x4c\x5d\xb0\xf0\x16\x96\x74\x3d\x87\x07\x25\xc5", 1, 32, 512 }, { 96, 256, 128, 243, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\xe2\x35\xb8\xc2\x13\x84\x55\x70\x85\xc3\xf2\xeb\x2a\x8f\xa3\x60\x58" "\xcf\xfd\x2a\xf7\x43\xda\xcf\x96\xb4\xae\x4d\x51\xb4\xe4\x88\xd6\x70" "\x3f\x49\xd9\xd7\xf2\x02\x7e\x48\x53\xfe\xb4\xca\x0d\xf7", "\x7b\xdb\x19\x5a\x00\xa8\x7e\x98\xf6\x70\x6d\xf3\xc6\xdb\x12\xc1\xc1" "\xc8\xd3\x2c\x79\x66\x32\x73\x13\x60\x0f\xb6\x55\x81\x0d\x06\xc1\xc8" "\xd3\x2c\x79\x66\x32\x73\x13\x60\x0f\xb6\x55\x81\x0d\x06", - "\x43\x7d\x1e\xfa\xd2\x1b\x08\x65\xa5\x41\xb5\xca\xb6\x2e\x2a\x44", 1, - 32, 384 }, + "\x43\x7d\x1e\xfa\xd2\x1b\x08\x65\xa5\x41\xb5\xca\xb6\x2e\x2a\x44", 1, 32, 384 }, { 96, 256, 128, 244, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x66\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x8f" "\xab\x58\x57\x4a\x32\x2b\xac\x6f\x39\x44\x74\xe4\xce\x7e\xae\xc3\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x71\x53\x2d" @@ -3141,13 +2795,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x08\xe4\xee\x11\x79\x94\xa9\x3e\xad\xc3\x42\x1f\x01\xd4\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xde\x99\x9e\x08\xe4" "\xee\x11\x79\x94\xa9\x3e\xad\xc3\x42\x1f\x01", - "\xac\xf4\xff\xa2\x0c\x0d\x06\xd6\x1a\x18\xe9\xa8\xd4\xc8\x4d\x1d", 1, - 32, 768 }, + "\xac\xf4\xff\xa2\x0c\x0d\x06\xd6\x1a\x18\xe9\xa8\xd4\xc8\x4d\x1d", 1, 32, 768 }, { 96, 256, 128, 245, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x61\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x5e" "\xfe\x67\x9b\xa1\x73\x84\xc5\x5e\xb8\xcc\x19\x36\x66\xfe\x8d\x04\x60" "\x8c\x35\x03\xd2\x17\xaa\x3f\x90\xa9\xb0\xe1\xb3\xb3\x13\xbc\x12\xd3" @@ -3156,13 +2808,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xf9\x49\x9d\x2f\x56\x6c\x79\xdb\x6c\x6d\xe2\x32\x53\x17\x03\x13\xd8" "\x60\x50\xa3\x63\xd7\xdb\x52\xb8\xf5\xf8\x00\xf8\xb3\xe2\x13\xd8\x60" "\x50\xa3\x63\xd7\xdb\x52\xb8\xf5\xf8\x00\xf8\xb3\xe2", - "\xcd\x46\x6d\x06\xe7\x5b\x7f\xd1\x8d\x5f\xe2\x1d\x92\x27\xd9\xa7", 1, - 32, 512 }, + "\xcd\x46\x6d\x06\xe7\x5b\x7f\xd1\x8d\x5f\xe2\x1d\x92\x27\xd9\xa7", 1, 32, 512 }, { 96, 256, 128, 246, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x90\x64\xb8\x8a\x28\x20\x52\xa1\xee\x44\xdf\x05\xad\x21\x3d\xa6\x79" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\x51\xb2" "\x65\x0e\xc9\x45\xfe\xc7\x05\x88\xbc\x65\xa6\x16\xa5\xf2\x4f\x35\x4c" @@ -3173,13 +2823,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x89\x6b\x69\xf4\x3e\xb6\x68\xa0\xe0\x2d\x47\x5d\xa5\x03\xe0\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x46\x0a\x89\x6b" "\x69\xf4\x3e\xb6\x68\xa0\xe0\x2d\x47\x5d\xa5\x03", - "\xce\x8a\x3d\x4d\x88\x7d\x95\x61\x3d\x82\x9b\x53\x8e\xd0\x11\x96", 1, - 32, 640 }, + "\xce\x8a\x3d\x4d\x88\x7d\x95\x61\x3d\x82\x9b\x53\x8e\xd0\x11\x96", 1, 32, 640 }, { 96, 256, 128, 247, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x43\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\xee" "\xf6\x7b\xd4\x79\x5b\x74\x01\x5a\x34\x93\x90\x5d\x54\x4a\x86\xe8\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x31\x97\xbe" @@ -3192,13 +2840,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xdb\x05\x87\x13\x90\xb6\xf2\xfb\x67\xb6\x44\xa0\xab\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x9e\x5d\x0d\xdb\x05" "\x87\x13\x90\xb6\xf2\xfb\x67\xb6\x44\xa0\xab", - "\x08\x28\x9f\x51\x99\xdf\x47\x6f\xe9\x04\x75\xcb\x95\x22\x55\x66", 1, - 32, 768 }, + "\x08\x28\x9f\x51\x99\xdf\x47\x6f\xe9\x04\x75\xcb\x95\x22\x55\x66", 1, 32, 768 }, { 96, 256, 128, 248, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x6b\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x1e" "\x34\x41\x2a\xb0\xa0\x56\xe8\x09\xd5\xd4\xb9\x2b\xe1\x12\x8a\x4b\x2a" "\x65\x1a\x62\xae\xab\x26\xcf\x43\x7f\xb1\x95\x40\x75\x74\xf3\x58\x3a" @@ -3207,13 +2853,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x33\x6f\x2c\x3e\x85\xbe\x54\x8c\x01\x75\x42\x2f\xd4\xfb\x04\x5c\x92" "\x89\x7f\xc2\x1f\x6b\x57\xa2\x6b\x23\xf9\x74\x0b\x75\x85\x5c\x92\x89" "\x7f\xc2\x1f\x6b\x57\xa2\x6b\x23\xf9\x74\x0b\x75\x85", - "\x06\xdf\x93\xf6\x51\xea\x5c\xc5\x69\x11\xf3\x0d\x3e\x58\xf9\x97", 1, - 32, 512 }, + "\x06\xdf\x93\xf6\x51\xea\x5c\xc5\x69\x11\xf3\x0d\x3e\x58\xf9\x97", 1, 32, 512 }, { 96, 256, 128, 249, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x3f\xe6\x06\x10\x8f\x35\x86\x9d\xf4\xc7\xaa\x01\x28\x46\x4a\x12\x65" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\xfd\xbe" "\x84\x3a\x0a\xd9\xbe\x25\x05\x59\x92\xab\x6d\xcb\xc9\xf1\x53\x35\x4c" @@ -3224,13 +2868,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x68\x5f\xaa\x68\x7e\x54\x68\x71\xce\xe3\x8c\x80\xc9\x00\xfc\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xea\x06\x68\x5f" "\xaa\x68\x7e\x54\x68\x71\xce\xe3\x8c\x80\xc9\x00", - "\x92\x64\xfc\x0f\x47\xfe\xbb\x30\x66\x12\x54\xda\xf9\xa0\x61\x89", 1, - 32, 640 }, + "\x92\x64\xfc\x0f\x47\xfe\xbb\x30\x66\x12\x54\xda\xf9\xa0\x61\x89", 1, 32, 640 }, { 96, 256, 128, 250, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x6e\x8e\xb9\x8c\xf7\xff\xfe\x4c\xd6\x83\x56\x8c\xf8\x92\x99\x15\x64" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\xc7\x0f" "\x5d\x8b\x30\xc6\x4b\xf2\xe6\xd1\xd6\x13\xf4\x0e\x0b\xf0\x52\x35\x4c" @@ -3241,13 +2883,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xb1\xee\x90\x77\x8b\x83\x8b\xf9\x8a\x5b\x15\x45\x0b\x01\xfd\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd0\xb7\xb1\xee" "\x90\x77\x8b\x83\x8b\xf9\x8a\x5b\x15\x45\x0b\x01", - "\x69\xa1\x24\xfc\x7f\x96\xe2\x20\xd1\xa0\x31\xce\xd5\x52\x72\x79", 1, - 32, 640 }, + "\x69\xa1\x24\xfc\x7f\x96\xe2\x20\xd1\xa0\x31\xce\xd5\x52\x72\x79", 1, 32, 640 }, { 96, 256, 128, 251, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x4f\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x41" "\x56\x26\x9f\xe3\xda\x10\x1e\xeb\x0a\xbf\x8d\xda\x20\xfe\x8f\xff\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x6a\xec\xe9" @@ -3260,13 +2900,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x70\x0c\x30\xc7\x2d\xa2\xdf\x2e\xb1\x29\x44\x7b\x0a\xe8\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc5\x26\x5a\x70\x0c" "\x30\xc7\x2d\xa2\xdf\x2e\xb1\x29\x44\x7b\x0a", - "\x3e\xa8\xf9\xb2\x01\x23\x21\xe6\x3d\x5f\xb5\xbc\x2c\x5d\x33\x2d", 1, - 32, 768 }, + "\x3e\xa8\xf9\xb2\x01\x23\x21\xe6\x3d\x5f\xb5\xbc\x2c\x5d\x33\x2d", 1, 32, 768 }, { 96, 256, 128, 252, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x66\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x18" "\xf1\x25\xef\x37\x4c\x14\x54\xb6\x80\xe2\x34\x27\xe7\xdc\x69\xe4\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x85\x8b\x08" @@ -3279,13 +2917,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x18\xf7\x27\x45\xb9\x3a\xe7\x19\xa2\xb8\xfb\xf4\x08\xf3\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2a\x41\xbb\x18\xf7" "\x27\x45\xb9\x3a\xe7\x19\xa2\xb8\xfb\xf4\x08", - "\xdf\xaf\x8a\x3a\x15\xd4\x5e\x7f\x4c\x34\x30\x04\x8d\x85\x89\xf0", 1, - 32, 768 }, + "\xdf\xaf\x8a\x3a\x15\xd4\x5e\x7f\x4c\x34\x30\x04\x8d\x85\x89\xf0", 1, 32, 768 }, { 96, 256, 128, 253, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\xb0\x2a\xb7\x47\xa3\x10\xd6\xa3\xbb\xdb\x97\x01\x8a\x3b\xe8\xb3\x41" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\xb7\xa3" "\x38\xbc\x34\x23\x89\x5f\x0f\xd9\x6c\xdb\x27\xa7\x87\xf2\x77\x35\x4c" @@ -3296,13 +2932,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xd4\xd9\x94\x92\x49\x2e\x62\xf1\x30\x93\xc6\xec\x87\x03\xd8\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xa0\x1b\xd4\xd9" "\x94\x92\x49\x2e\x62\xf1\x30\x93\xc6\xec\x87\x03", - "\x34\x08\xeb\x2b\x13\xa9\xb7\x6b\xef\xce\xdf\x69\x94\x22\xd6\x1f", 1, - 32, 640 }, + "\x34\x08\xeb\x2b\x13\xa9\xb7\x6b\xef\xce\xdf\x69\x94\x22\xd6\x1f", 1, 32, 640 }, { 96, 256, 128, 254, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x40\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x38" "\x0e\xf9\x3a\xeb\x61\xaa\x30\x7f\x14\x13\x23\xc3\x8e\x06\x85\xf6\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x3f\x76\x9a" @@ -3315,13 +2949,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xc3\x02\xea\x4f\x3b\x66\x1c\x58\x4d\x61\x3d\x5f\x03\xe1\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x90\xbc\x29\xc3\x02" "\xea\x4f\x3b\x66\x1c\x58\x4d\x61\x3d\x5f\x03", - "\x09\xf4\xf2\xa3\x93\x6d\x74\x61\xa6\x7c\xe0\x22\x17\x6b\xb8\xdd", 1, - 32, 768 }, + "\x09\xf4\xf2\xa3\x93\x6d\x74\x61\xa6\x7c\xe0\x22\x17\x6b\xb8\xdd", 1, 32, 768 }, { 96, 256, 128, 255, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x40\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x06" "\x0e\xf9\x3a\xeb\x61\xaa\x30\x7f\x14\x13\x23\xc3\x8e\x06\x85\xee\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x2b\xca\x70" @@ -3334,13 +2966,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x4c\x27\x8e\x47\xd3\x2b\x3b\xd6\xc1\x0c\x9d\xe3\x07\xf9\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x00\xc3\x4c\x27" "\x8e\x47\xd3\x2b\x3b\xd6\xc1\x0c\x9d\xe3\x07", - "\x2e\xb2\x67\x9a\xad\xfd\x82\x4a\x5f\xd8\xfa\x2e\x4a\x55\xa6\x5c", 1, - 32, 768 }, + "\x2e\xb2\x67\x9a\xad\xfd\x82\x4a\x5f\xd8\xfa\x2e\x4a\x55\xa6\x5c", 1, 32, 768 }, { 96, 256, 128, 256, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x56\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x6c" "\x7e\x13\x12\xc6\x77\x4f\xae\x7d\x1e\x5d\x0c\xc6\x09\x02\x8f\xf5\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x81\xc9\xe6" @@ -3353,13 +2983,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xef\x54\x91\x85\x9d\xf6\x36\xe2\x32\x1f\x32\x9b\x07\xe2\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x03\x55\xef\x54" "\x91\x85\x9d\xf6\x36\xe2\x32\x1f\x32\x9b\x07", - "\x5e\x89\x34\x9f\x6b\x01\x1c\xd6\xe2\x4e\xe6\xac\x2f\x59\x0c\x21", 1, - 32, 768 }, + "\x5e\x89\x34\x9f\x6b\x01\x1c\xd6\xe2\x4e\xe6\xac\x2f\x59\x0c\x21", 1, 32, 768 }, { 96, 256, 128, 257, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x2e\xa8\x41\x0b\x4d\xca\x8c\x9d\x53\x69\xa0\x33\xd8\xdb\x61\xe4\x6c" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\xf0\xf5" "\x8e\x8b\xba\x6c\xf1\xa5\x21\x46\x27\x3d\x8f\xe0\xc4\xfc\x5a\x35\x4c" @@ -3370,13 +2998,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x62\xee\x1a\xdd\x31\xd4\x4c\x6e\x7b\x75\x6e\xab\xc4\x0d\xf5\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe7\x4d\x62\xee" "\x1a\xdd\x31\xd4\x4c\x6e\x7b\x75\x6e\xab\xc4\x0d", - "\xb2\x45\x37\xfc\xb0\xdc\xb6\x20\x0b\x02\x85\xca\xfc\x9c\x3a\x7d", 1, - 32, 640 }, + "\xb2\x45\x37\xfc\xb0\xdc\xb6\x20\x0b\x02\x85\xca\xfc\x9c\x3a\x7d", 1, 32, 640 }, { 96, 256, 128, 258, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x17\x05\x9a\x7c\x88\x83\xa2\x8b\x90\xbd\x94\xae\x44\xd1\x54\x36\x62" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\xa2\x30" "\x18\xbf\x8e\x68\xe4\x13\xe9\x9a\xc2\xd4\xab\x3f\x8d\xf1\x54\x35\x4c" @@ -3387,13 +3013,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xf4\xda\x2e\xd9\x24\x62\x84\xb2\x9e\x9c\x4a\x74\x8d\x00\xfb\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb5\x88\xf4\xda" "\x2e\xd9\x24\x62\x84\xb2\x9e\x9c\x4a\x74\x8d\x00", - "\x43\x30\x04\x00\xea\x36\xe7\x20\x36\x11\x53\xce\x0c\x5d\x63\x7d", 1, - 32, 640 }, + "\x43\x30\x04\x00\xea\x36\xe7\x20\x36\x11\x53\xce\x0c\x5d\x63\x7d", 1, 32, 640 }, { 96, 256, 128, 259, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\xaa\xa1\xb2\x58\xfd\x4b\x54\xb4\x97\xb5\x20\x80\x6a\x66\xd7\xaa\x68" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\x99\x13" "\x2a\x23\x4a\x8c\x78\x9b\xf8\x54\x45\x47\x94\x0e\xc3\xf3\x5e\x35\x4c" @@ -3404,13 +3028,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xc6\x46\xea\x3d\xb8\xea\x95\x7c\x19\x0f\x75\x45\xc3\x02\xf1\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8e\xab\xc6\x46" "\xea\x3d\xb8\xea\x95\x7c\x19\x0f\x75\x45\xc3\x02", - "\xd7\x9a\x03\x10\x12\x4a\xdc\x30\xc6\xb6\x4c\xde\xf8\x99\x3e\x8d", 1, - 32, 640 }, + "\xd7\x9a\x03\x10\x12\x4a\xdc\x30\xc6\xb6\x4c\xde\xf8\x99\x3e\x8d", 1, 32, 640 }, { 96, 256, 128, 260, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x4c\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\xbb" "\x53\x57\xed\x31\x4a\xd7\x40\xb9\x91\x0f\xad\x6f\x01\xd7\x81\xf0\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\xc8\x04\x2b" @@ -3423,13 +3045,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xb2\xa5\xa2\x4b\x73\xa7\x46\x94\x81\x9f\x16\xf9\x04\xe7\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x67\xce\x98\xb2\xa5" "\xa2\x4b\x73\xa7\x46\x94\x81\x9f\x16\xf9\x04", - "\xe6\x02\x2c\xc3\xba\x20\xe3\xf9\x06\x5f\xdf\xcc\x43\xa9\xdc\x40", 1, - 32, 768 }, + "\xe6\x02\x2c\xc3\xba\x20\xe3\xf9\x06\x5f\xdf\xcc\x43\xa9\xdc\x40", 1, 32, 768 }, { 96, 256, 128, 261, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x66\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\xf6" "\x42\x96\x97\x5a\xf7\xfc\xed\x16\x81\x81\xf7\x6c\x65\x08\xe1\xc9\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x49\x75\x06" @@ -3442,13 +3062,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xfc\x97\xa1\xa4\x69\x05\x43\x94\xd9\x52\xcf\x3e\x01\xde\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe6\xbf\xb5\xfc\x97" "\xa1\xa4\x69\x05\x43\x94\xd9\x52\xcf\x3e\x01", - "\x35\x3e\x30\x4f\xd8\x55\x32\x86\xb2\x6e\x0d\x59\x94\x2f\xe7\xcd", 1, - 32, 768 }, + "\x35\x3e\x30\x4f\xd8\x55\x32\x86\xb2\x6e\x0d\x59\x94\x2f\xe7\xcd", 1, 32, 768 }, { 96, 256, 128, 262, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x98\x41\xcf\xc9\x27\xa5\x7d\xc4\x91\xab\x35\x42\x7f\xf9\x35\xe6\x6e" "\xf8\xd1\xf9\x71\xda\x17\x43\x7a\x2b\x5e\x04\xfb\xca\x16\x71\xa6\x83" "\xc8\xf9\xf9\xe6\x78\x0f\xda\x49\x40\xdd\xed\xd7\x6b\xf2\x58\x35\x4c" @@ -3459,13 +3077,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x24\x9c\x59\x57\xb8\x7e\xb7\x61\x1c\x95\x0c\x9c\x6b\x03\xf7\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb1\x3b\x24\x9c" "\x59\x57\xb8\x7e\xb7\x61\x1c\x95\x0c\x9c\x6b\x03", - "\x0a\xeb\x04\xec\xf7\xde\xf4\x0c\x42\x02\x5b\xba\xe5\x50\x91\x69", 1, - 32, 640 }, + "\x0a\xeb\x04\xec\xf7\xde\xf4\x0c\x42\x02\x5b\xba\xe5\x50\x91\x69", 1, 32, 640 }, { 96, 256, 128, 263, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x42\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x0b" "\x61\xbf\x9b\x7c\xaf\x83\xcc\x34\xda\x62\x55\x93\x51\x42\x89\xe8\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x69\x6a\x5c" @@ -3478,13 +3094,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x8c\x53\xa5\xcc\x1d\x3e\xb6\x82\x7b\xe9\xad\x35\x50\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\xa0\xef\x8c\x53" "\xa5\xcc\x1d\x3e\xb6\x82\x7b\xe9\xad\x35\x50", - "\x8f\xc4\xf7\x7a\x6e\xe0\x52\xa4\xc3\x14\x78\x0b\x8d\xf9\xa2\xd0", 1, - 32, 768 }, + "\x8f\xc4\xf7\x7a\x6e\xe0\x52\xa4\xc3\x14\x78\x0b\x8d\xf9\xa2\xd0", 1, 32, 768 }, { 96, 256, 128, 264, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x4b\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\xf2" "\x8e\x4d\x0f\x20\xca\x16\x44\x47\x0c\x9c\xda\xc6\x00\x08\x87\xed\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x14\x64\x77" @@ -3497,13 +3111,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xa8\x46\xaa\x96\x56\x7f\x44\x1d\x9e\x77\x4e\x23\x03\xfa\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xbb\xae\xc4\xa8\x46" "\xaa\x96\x56\x7f\x44\x1d\x9e\x77\x4e\x23\x03", - "\x23\x2f\xf7\x8a\x96\xf3\x47\xb4\x53\xba\x71\x1b\x79\x36\x7e\xe0", 1, - 32, 768 }, + "\x23\x2f\xf7\x8a\x96\xf3\x47\xb4\x53\xba\x71\x1b\x79\x36\x7e\xe0", 1, 32, 768 }, { 96, 256, 128, 265, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x2d\xd4\xcd\x40", "\xff\xff\xff\xff", "\x4d\x11\x5e\x67\xec\xd3\xd4\x17\x8c\x4c\x60\xe7\x13\xab\x4e\x5e\x6e" "\xe6\x28\xfc\x4b\x58\x30\x18\x4c\xd2\x93\x36\x4a\x21\x3e\x84\xfe\x47" "\x13\x9a\x5f\x4e\x3f\x8e\x92\xd7\xa3\xb7\x1e\xb4\xff\x0e\x29\xdb\x95" @@ -3516,13 +3128,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xc9\x3f\x3a\xdf\x23\xfc\xda\x14\x00\xf9\x94\x7f\x08\xe9\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x86\x11\x26\xc9\x3f" "\x3a\xdf\x23\xfc\xda\x14\x00\xf9\x94\x7f\x08", - "\xe0\x0d\x2e\x8b\xae\x5d\x09\xc2\x8e\x9b\xf5\x94\x09\x54\x5d\x09", 1, - 32, 768 }, + "\xe0\x0d\x2e\x8b\xae\x5d\x09\xc2\x8e\x9b\xf5\x94\x09\x54\x5d\x09", 1, 32, 768 }, { 96, 256, 128, 266, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x19\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xbc" "\x28\x6f\xd9\x79\x80\x79\x51\xb1\x83\xa1\x88\x93\x0a\xd1\x5e\xdc\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x89\x0e\x65" @@ -3535,13 +3145,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x5e\x1c\x04\x68\xcb\xaa\xd9\x9c\x8a\xbe\xff\xff\x07\xed\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x11\x0e\x5e\x1c" "\x04\x68\xcb\xaa\xd9\x9c\x8a\xbe\xff\xff\x07", - "\x47\xe5\xd4\x29\x42\x39\xdb\x73\xb8\x36\xc0\x40\x70\xff\x5b\x2d", 1, - 32, 768 }, + "\x47\xe5\xd4\x29\x42\x39\xdb\x73\xb8\x36\xc0\x40\x70\xff\x5b\x2d", 1, 32, 768 }, { 96, 256, 128, 267, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1f\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x83" "\x9f\x81\x1a\xd0\x31\x0c\x77\x05\x2f\x45\x32\x0b\x0d\x95\x60\xc4\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x70\xd6\xb1" @@ -3554,13 +3162,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x8e\x1d\x0f\x1a\x84\xc2\xa3\x4c\xd7\x31\xfa\xbb\x09\xf5\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd7\xc9\xda\x8e\x1d" "\x0f\x1a\x84\xc2\xa3\x4c\xd7\x31\xfa\xbb\x09", - "\x23\x2c\x88\x2f\x7a\x1a\x2f\x80\x8c\xcf\x26\x49\x6c\xff\x5b\x3d", 1, - 32, 768 }, + "\x23\x2c\x88\x2f\x7a\x1a\x2f\x80\x8c\xcf\x26\x49\x6c\xff\x5b\x3d", 1, 32, 768 }, { 96, 256, 128, 268, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x97\x31\x1c\xd6\xe2\xd2\x5a\x7b\x4e\xaa\x16\xf0\xa6\x1c\xa6\x24\x6b" "\x8a\x85\x43\x14\x30\xea\xda\x56\xa2\xc5\xdc\x94\x4b\x6a\xa6\x95\x13" "\x63\x10\xb6\xb6\xb5\xc1\x7c\x9f\x8c\x02\xba\x7d\x0a\xeb\x71\xe0\x94" @@ -3571,13 +3177,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x2c\xb9\xeb\xa7\x86\x6f\x50\x68\x4b\x1b\x05\xe3\xab\x00\xd6\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xa4\x1c\x2c\xb9" "\xeb\xa7\x86\x6f\x50\x68\x4b\x1b\x05\xe3\xab\x00", - "\xd7\x1b\xc7\x0d\x5a\xdc\x74\xe7\xdf\xd8\x94\x06\xfc\x15\xf0\x44", 1, - 32, 640 }, + "\xd7\x1b\xc7\x0d\x5a\xdc\x74\xe7\xdf\xd8\x94\x06\xfc\x15\xf0\x44", 1, 32, 640 }, { 96, 256, 128, 269, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x34\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x74" "\xcf\x7e\x9d\x82\xb7\xe8\xed\x9e\xc9\x65\xf6\xea\x31\x09\x51\xdc\x10" "\x49\x40\xe0\x8a\x42\x22\x55\x68\x28\xeb\xa4\x59\xf6\x5a\x4a\x00\x6d" @@ -3586,13 +3190,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xba\x04\x21\x69\x78\xfd\xc8\x37\x94\x5f\xd5\x81\x85\x9c\x08\xed\x1f" "\x06\xe9\xbd\x9b\x71\x8c\x79\x9f\xef\xf2\x1b\xc7\x57\xb1\xed\x1f\x06" "\xe9\xbd\x9b\x71\x8c\x79\x9f\xef\xf2\x1b\xc7\x57\xb1", - "\x21\xe6\x39\x87\xd4\x94\x67\x3f\x30\x40\xae\x9d\xe2\xbc\x0d\xa0", 1, - 32, 512 }, + "\x21\xe6\x39\x87\xd4\x94\x67\x3f\x30\x40\xae\x9d\xe2\xbc\x0d\xa0", 1, 32, 512 }, { 96, 256, 128, 270, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\xe7\x2b\x83\x51\x4e\x5e\x50\x50\x90\x70\x35\x9c\x1c\xac\x7e\x1c\x42" "\x8a\x85\x43\x14\x30\xea\xda\x56\xa2\xc5\xdc\x94\x4b\x6a\xa6\xda\xd3" "\x59\x50\xd8\xa9\xb5\x5a\x47\x2f\x9b\xb8\x86\x0a\x52\x63\x58\xe0\x94" @@ -3603,13 +3205,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x16\xf9\x85\xb8\x86\xf4\x6b\xd8\x5c\xa1\x39\x94\xf3\x88\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\xdc\x16\xf9" "\x85\xb8\x86\xf4\x6b\xd8\x5c\xa1\x39\x94\xf3\x88", - "\xe4\xfb\x94\x5d\x6a\x2d\x0b\x94\x78\x34\x31\x7c\xc4\x15\xf0\x24", 1, - 32, 640 }, + "\xe4\xfb\x94\x5d\x6a\x2d\x0b\x94\x78\x34\x31\x7c\xc4\x15\xf0\x24", 1, 32, 640 }, { 96, 256, 128, 271, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x8c\x61\x65\xf4\x45\x44\x35\x88\x04\x1b\x6e\x04\x4f\xb6\xba\xae\x72" "\x8a\x85\x43\x14\x30\xea\xda\x56\xa2\xc5\xdc\x94\x4b\x6a\xa6\x88\x1a" "\x54\xc0\x95\x16\xa1\xf1\xca\xe7\xb9\xdd\x71\x13\x0e\xe1\x68\xe0\x94" @@ -3620,13 +3220,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x1b\x69\xc8\x07\x92\x5f\xe6\x10\x7e\xc4\xce\x8d\xaf\x0a\xcf\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb9\x15\x1b\x69" "\xc8\x07\x92\x5f\xe6\x10\x7e\xc4\xce\x8d\xaf\x0a", - "\xc0\x42\x48\x63\xa2\x0e\x5f\xa0\x4c\xcd\x97\x84\xc0\x15\xf0\x34", 1, - 32, 640 }, + "\xc0\x42\x48\x63\xa2\x0e\x5f\xa0\x4c\xcd\x97\x84\xc0\x15\xf0\x34", 1, 32, 640 }, { 96, 256, 128, 272, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x18\xe3\x61\x74\x54\x5f\xa7\xec\x9e\xa9\xf0\x5d\x70\x57\xc5\xca\x63" "\x8a\x85\x43\x14\x30\xea\xda\x56\xa2\xc5\xdc\x94\x4b\x6a\xa6\x43\x4e" "\x1c\x5e\x71\x00\x5b\x69\x0c\xa5\xcb\x8d\x58\x0b\x89\xed\x79\xe0\x94" @@ -3637,13 +3235,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x53\xf7\x2c\x11\x68\xc7\x20\x52\x0c\x94\xe7\x95\x28\x06\xde\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x72\x41\x53\xf7" "\x2c\x11\x68\xc7\x20\x52\x0c\x94\xe7\x95\x28\x06", - "\xaa\x72\x93\xff\xe5\xdb\x30\xa3\x1f\x25\x81\xe0\xe7\xae\x56\xed", 1, - 32, 640 }, + "\xaa\x72\x93\xff\xe5\xdb\x30\xa3\x1f\x25\x81\xe0\xe7\xae\x56\xed", 1, 32, 640 }, { 96, 256, 128, 273, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x12\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x54" "\x30\x5d\xff\x6b\x61\xc4\x0b\x77\x5c\x35\x2d\x02\x5c\x1a\x56\xd7\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\xbc\xe5\x74" @@ -3656,13 +3252,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x28\x2e\x1c\x1a\x80\x38\x1c\xbc\xe0\x5a\x90\xe4\x07\xe6\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1b\xfa\x1f\x28\x2e" "\x1c\x1a\x80\x38\x1c\xbc\xe0\x5a\x90\xe4\x07", - "\x42\xe5\xd4\x3d\x1e\x80\x8e\x79\xf0\x17\x14\x4d\x44\x98\xc2\x35", 1, - 32, 768 }, + "\x42\xe5\xd4\x3d\x1e\x80\x8e\x79\xf0\x17\x14\x4d\x44\x98\xc2\x35", 1, 32, 768 }, { 96, 256, 128, 274, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1f\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xdf" "\x05\x99\x19\x4b\x0c\xe8\x90\xcc\x1d\x8e\xb3\x83\xb5\x7f\x38\xdc\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x35\xdf\x81" @@ -3675,13 +3269,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xc6\xb2\x00\x64\x2c\x2a\x3c\xc3\xa0\xf3\xdf\x04\x0c\xed\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x92\xc0\xea\xc6\xb2" "\x00\x64\x2c\x2a\x3c\xc3\xa0\xf3\xdf\x04\x0c", - "\x6c\xf2\xf9\x23\x0a\xf8\x67\x9e\x7e\xcb\x19\x42\x13\x62\xfc\xe3", 1, - 32, 768 }, + "\x6c\xf2\xf9\x23\x0a\xf8\x67\x9e\x7e\xcb\x19\x42\x13\x62\xfc\xe3", 1, 32, 768 }, { 96, 256, 128, 275, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x39\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x40" "\x92\xe1\xf9\xa2\x2c\x8b\x18\x18\x4d\x80\x5c\x12\x8a\xde\x57\xc7\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x64\xfe\x8b" @@ -3694,13 +3286,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x5a\x12\x27\xbe\x39\xed\xcf\x32\xfb\x9f\xba\xc5\x01\xf6\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\xe1\xe0\x5a\x12" "\x27\xbe\x39\xed\xcf\x32\xfb\x9f\xba\xc5\x01", - "\x6d\x46\xd2\x23\x0a\x98\x48\xd5\x18\xf9\xd9\x4b\xb2\xc4\x9c\xaa", 1, - 32, 768 }, + "\x6d\x46\xd2\x23\x0a\x98\x48\xd5\x18\xf9\xd9\x4b\xb2\xc4\x9c\xaa", 1, 32, 768 }, { 96, 256, 128, 276, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x12\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x32" "\x7f\x3a\x1b\xef\xb4\x28\x7c\x17\x45\x03\x91\xed\x0e\xb8\x54\xd6\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x14\x60\xd3" @@ -3713,13 +3303,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x95\x93\x2f\x39\x9c\x74\xcd\x86\x8b\x14\x1a\x95\x01\xe7\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb3\x7f\xb8\x95\x93" "\x2f\x39\x9c\x74\xcd\x86\x8b\x14\x1a\x95\x01", - "\x74\xdd\xa1\x2e\x05\x58\x87\x7b\xc0\xe4\x0c\x3e\xac\xe0\xaf\x29", 1, - 32, 768 }, + "\x74\xdd\xa1\x2e\x05\x58\x87\x7b\xc0\xe4\x0c\x3e\xac\xe0\xaf\x29", 1, 32, 768 }, { 96, 256, 128, 277, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1b\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x85" "\xb6\x76\x64\xee\x49\xfa\x34\x7f\xbf\xd2\xdd\x92\x00\x7c\x57\xde\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\xfb\x27\xee" @@ -3732,13 +3320,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xc6\x94\x3a\xeb\x54\x8c\x97\x36\xd8\x87\x14\x51\x03\xef\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x38\x85\xc6\x94" "\x3a\xeb\x54\x8c\x97\x36\xd8\x87\x14\x51\x03", - "\x50\x24\x55\x34\x3d\x39\xdb\x87\x94\x7d\x73\x46\xa8\xe0\xaf\x39", 1, - 32, 768 }, + "\x50\x24\x55\x34\x3d\x39\xdb\x87\x94\x7d\x73\x46\xa8\xe0\xaf\x39", 1, 32, 768 }, { 96, 256, 128, 278, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x36\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x11" "\x32\x81\x1b\x2f\x18\x32\x1b\xa9\x9b\x12\x43\x2c\x7f\x86\x5a\xa3\x35" "\x2c\xd2\xd7\xac\x70\xb4\xc6\xf5\x41\x97\x67\x92\x6e\x20\x35\x25\x08" @@ -3747,13 +3333,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x47\xfb\xa7\xc4\xd7\x27\x3e\x00\xc6\x28\x60\x47\xcb\x13\x03\x92\x3a" "\x63\x7b\x8a\xbd\x43\x1a\xea\x02\x86\x8e\xd8\x0c\xcf\xcb\x92\x3a\x63" "\x7b\x8a\xbd\x43\x1a\xea\x02\x86\x8e\xd8\x0c\xcf\xcb", - "\x14\xfb\xa1\x49\xd1\xc0\xed\xc8\xaa\x66\x58\x51\x12\x6b\x5a\xfd", 1, - 32, 512 }, + "\x14\xfb\xa1\x49\xd1\xc0\xed\xc8\xaa\x66\x58\x51\x12\x6b\x5a\xfd", 1, 32, 512 }, { 96, 256, 128, 279, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1f\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xf9" "\x99\x46\x10\x58\xf6\xd7\x73\x3e\x5c\xd0\xd1\x63\x9d\x90\x25\xcb\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x52\x0a\x0d" @@ -3766,13 +3350,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x64\xcb\x3f\x3f\x5b\x06\x35\x7c\x7c\x72\x6b\xfa\x0a\xfa\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\x15\x66\x64\xcb" "\x3f\x3f\x5b\x06\x35\x7c\x7c\x72\x6b\xfa\x0a", - "\xbf\x7f\xbd\x42\x2c\xbf\x0e\x70\x0f\xd1\x60\x5b\xe8\xfd\x21\x2f", 1, - 32, 768 }, + "\xbf\x7f\xbd\x42\x2c\xbf\x0e\x70\x0f\xd1\x60\x5b\xe8\xfd\x21\x2f", 1, 32, 768 }, { 96, 256, 128, 280, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x15\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xcc" "\x16\x29\xa4\x0c\xd1\x1e\xaf\xdf\x04\x13\x8b\x45\xaf\xe4\x58\xef\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x34\x0a\xc9" @@ -3785,13 +3367,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x75\x95\x5e\x72\xff\xfc\x14\x53\xed\x62\x07\xfb\x0b\xde\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x93\x15\xa2\x75\x95" "\x5e\x72\xff\xfc\x14\x53\xed\x62\x07\xfb\x0b", - "\xc6\xf2\x32\x04\x86\x5b\x0a\xdd\xe0\x07\x00\x37\xd6\x53\x8d\xd3", 1, - 32, 768 }, + "\xc6\xf2\x32\x04\x86\x5b\x0a\xdd\xe0\x07\x00\x37\xd6\x53\x8d\xd3", 1, 32, 768 }, { 96, 256, 128, 281, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x31\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xff" "\x74\x6e\xf5\x3e\xc3\x35\x7c\xbc\x3c\x3c\xe4\xab\x1d\x2d\x51\xed\x9e" "\xb4\x56\xdc\x9d\x9b\x59\xf6\x56\xa5\xd2\xd9\x74\xd2\x6a\x7b\x8e\x90" @@ -3800,13 +3380,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x01\x14\x49\xd5\x0c\x20\x59\x15\x61\x06\xc7\xc0\xa9\xb8\x08\xdc\x91" "\xfb\xff\x81\x8c\xa8\xf7\xda\xa1\x62\xcb\x66\xea\x73\x81\xdc\x91\xfb" "\xff\x81\x8c\xa8\xf7\xda\xa1\x62\xcb\x66\xea\x73\x81", - "\x8c\xff\x61\xb7\xb3\x91\x9e\xd6\xbd\xe7\x2b\x36\xe0\xd3\x13\x26", 1, - 32, 512 }, + "\x8c\xff\x61\xb7\xb3\x91\x9e\xd6\xbd\xe7\x2b\x36\xe0\xd3\x13\x26", 1, 32, 512 }, { 96, 256, 128, 282, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x19\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xbf" "\x28\x6f\xd9\x79\x80\x79\x51\xb1\x83\xa1\x88\x93\x0a\xd1\x5e\xce\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x64\x41\x3d" @@ -3819,13 +3397,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xb0\x5c\x9d\x78\xeb\x40\x6f\xb3\xf4\x74\xf3\x62\x94\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x5e\x56\xb0\x5c" "\x9d\x78\xeb\x40\x6f\xb3\xf4\x74\xf3\x62\x94", - "\x36\x9c\xf1\x70\x11\xca\xe4\x75\x39\xe2\x72\x3f\x01\x0c\xf9\x80", 1, - 32, 768 }, + "\x36\x9c\xf1\x70\x11\xca\xe4\x75\x39\xe2\x72\x3f\x01\x0c\xf9\x80", 1, 32, 768 }, { 96, 256, 128, 283, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x19\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xbd" "\x28\x6f\xd9\x79\x80\x79\x51\xb1\x83\xa1\x88\x93\x0a\xd1\x5e\xe3\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\xf2\x5e\x78" @@ -3838,13 +3414,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x3f\xd4\x55\x4a\x1a\x89\xa3\x21\x6c\xe4\x0b\x9d\x0b\xd2\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x41\x13\x3f\xd4" "\x55\x4a\x1a\x89\xa3\x21\x6c\xe4\x0b\x9d\x0b", - "\x53\x2e\xb8\xe2\x72\xa8\xd1\x71\x37\x8b\x0d\x42\xdf\xf2\xbe\xd9", 1, - 32, 768 }, + "\x53\x2e\xb8\xe2\x72\xa8\xd1\x71\x37\x8b\x0d\x42\xdf\xf2\xbe\xd9", 1, 32, 768 }, { 96, 256, 128, 284, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x32\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x25" "\x8d\x5d\x3e\x44\x16\x83\xf5\x46\xbe\xba\x2e\x23\x75\x5f\x5c\xce\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x9d\x13\xfd" @@ -3857,13 +3431,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x39\x35\x8f\x7c\x6d\x1e\xe0\xdc\x08\x2d\xe4\xd9\x6e\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x0c\x96\x39\x35" "\x8f\x7c\x6d\x1e\xe0\xdc\x08\x2d\xe4\xd9\x6e", - "\xd1\xbe\x74\x26\xcd\x12\x44\x6f\xe5\x2e\x8d\x45\x33\x1e\x08\x35", 1, - 32, 768 }, + "\xd1\xbe\x74\x26\xcd\x12\x44\x6f\xe5\x2e\x8d\x45\x33\x1e\x08\x35", 1, 32, 768 }, { 96, 256, 128, 285, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1f\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xd6" "\x4a\xdd\x2a\xa3\xc5\xa3\x0a\x31\xd9\xe6\x5e\x90\xf9\x3a\xd1\xcb\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\xde\x9a\xea" @@ -3876,13 +3448,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x79\xae\x42\x31\x1d\xac\xad\x2f\x32\x5a\x8d\x30\x07\xfa\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x79\x85\x81\x79\xae" "\x42\x31\x1d\xac\xad\x2f\x32\x5a\x8d\x30\x07", - "\x62\x63\x0c\x18\xde\x8c\x10\x87\x6a\xdb\x9f\x30\xf3\x00\x96\x3f", 1, - 32, 768 }, + "\x62\x63\x0c\x18\xde\x8c\x10\x87\x6a\xdb\x9f\x30\xf3\x00\x96\x3f", 1, 32, 768 }, { 96, 256, 128, 286, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1f\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xcc" "\x34\x92\x27\x2b\x8a\x4b\x11\x2a\x4e\x7d\x7c\xcf\x09\x26\x92\xce\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x30\xce\x67" @@ -3895,13 +3465,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x4f\x5c\x73\x56\xf4\xef\x3e\x5f\xd7\x9a\xfe\x6e\x08\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x97\xd1\x0c\x4f\x5c" "\x73\x56\xf4\xef\x3e\x5f\xd7\x9a\xfe\x6e\x08", - "\xfe\xb6\x41\x2b\x90\x31\xf0\x76\xed\xdc\xd9\x42\x6f\xff\x5b\x31", 1, - 32, 768 }, + "\xfe\xb6\x41\x2b\x90\x31\xf0\x76\xed\xdc\xd9\x42\x6f\xff\x5b\x31", 1, 32, 768 }, { 96, 256, 128, 287, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x34\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x72" "\x2b\x65\x49\xc9\xdf\x0f\x4b\x04\xb5\xf7\x43\x22\x03\xfa\x54\xce\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x87\xde\x18" @@ -3914,13 +3482,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xad\x1d\x88\xa7\x0f\xa8\xcf\x43\x67\xee\xf8\x2a\x8a\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\xc1\x73\xad\x1d" "\x88\xa7\x0f\xa8\xcf\x43\x67\xee\xf8\x2a\x8a", - "\xda\xfd\xf4\x30\xc8\x12\x44\x83\xc1\x75\x40\x4b\x6b\xff\x5b\x41", 1, - 32, 768 }, + "\xda\xfd\xf4\x30\xc8\x12\x44\x83\xc1\x75\x40\x4b\x6b\xff\x5b\x41", 1, 32, 768 }, { 96, 256, 128, 288, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x3d\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xc5" "\x62\x96\x99\xcf\xd4\xd9\x03\x6c\xef\x47\x8e\xd7\x05\xbe\x56\x50\xf5" "\x75\x88\x2c\x38\x00\xf7\x57\xea\x6e\x0f\x8c\x6d\x47\xac\xc6\xe5\x51" @@ -3929,13 +3495,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x17\xec\x25\x24\x1b\xcc\x26\xc5\xb2\x7d\xad\xbc\xb1\x2b\x0f\x61\xfa" "\x3a\x21\x71\x29\x33\x59\x7b\x1d\xa9\x16\x33\xf3\xe6\x47\x61\xfa\x3a" "\x21\x71\x29\x33\x59\x7b\x1d\xa9\x16\x33\xf3\xe6\x47", - "\xf8\x80\x0c\x5b\x62\x83\xdd\xdf\xc4\x1f\x93\x5c\x01\xbd\x0d\x24", 1, - 32, 512 }, + "\xf8\x80\x0c\x5b\x62\x83\xdd\xdf\xc4\x1f\x93\x5c\x01\xbd\x0d\x24", 1, 32, 512 }, { 96, 256, 128, 289, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1f\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x66" "\xd6\x24\xf2\x88\xf5\x29\x41\xca\x24\x86\x5c\xe9\x6f\x0d\x97\x36\xff" "\x33\xa2\x7c\x23\xf4\x97\x6f\xc7\x4f\x1f\xcd\x82\xf5\xcc\xa0\xef\x17" @@ -3944,13 +3508,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\xa3\x5e\x4e\x63\x3a\x3c\x64\x63\x79\xbc\x7f\x82\xdb\x98\xce\x07\xf0" "\x7c\x0b\x21\x32\xc7\x39\x43\x30\x88\x06\x72\x1c\x54\x27\x07\xf0\x7c" "\x0b\x21\x32\xc7\x39\x43\x30\x88\x06\x72\x1c\x54\x27", - "\x38\xbf\xb8\x31\x8c\x62\x7d\x86\xc3\x4b\xab\x1f\x1e\xbd\x0d\xb0", 1, - 32, 512 }, + "\x38\xbf\xb8\x31\x8c\x62\x7d\x86\xc3\x4b\xab\x1f\x1e\xbd\x0d\xb0", 1, 32, 512 }, { 96, 256, 128, 290, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\xf4\xeb\xbe\x3f\xca\x96\xbc\x48\x85\xb3\x55\x82\xc4\x3e\x0e\xb3\x58" "\x8a\x85\x43\x14\x30\xea\xda\x56\xa2\xc5\xdc\x94\x4b\x6a\xa6\xb4\x57" "\x0e\x84\x46\xe8\x86\xbc\xbf\xf8\x2a\x24\xf4\x9b\xe5\xed\x42\xe0\x94" @@ -3961,13 +3523,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x41\x2d\x1b\xf9\xb5\x12\x93\x0f\xed\x3d\x4b\x05\x44\x06\xe5\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x85\x58\x41\x2d" "\x1b\xf9\xb5\x12\x93\x0f\xed\x3d\x4b\x05\x44\x06", - "\xaf\x72\x93\xeb\x09\x95\x7d\x9d\xe7\x43\x2d\xd4\x13\x16\xf0\xe4", 1, - 32, 640 }, + "\xaf\x72\x93\xeb\x09\x95\x7d\x9d\xe7\x43\x2d\xd4\x13\x16\xf0\xe4", 1, 32, 640 }, { 96, 256, 128, 291, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1a\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x57" "\x1a\x3f\xca\x3c\xda\x7d\xef\x4c\x93\xd4\xa3\x82\xca\x3a\x57\xea\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\x76\xcd\xdb" @@ -3980,13 +3540,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x2f\xe0\x1e\xb3\x2d\xf3\xf3\xf0\xf6\xda\xcc\x4f\x05\xdb\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd1\xd2\xb0\x2f\xe0" "\x1e\xb3\x2d\xf3\xf3\xf0\xf6\xda\xcc\x4f\x05", - "\xe1\x78\xb0\xd5\xeb\x9b\xc5\x51\xfa\x64\x5c\x49\xf9\xf1\x76\x67", 1, - 32, 768 }, + "\xe1\x78\xb0\xd5\xeb\x9b\xc5\x51\xfa\x64\x5c\x49\xf9\xf1\x76\x67", 1, 32, 768 }, { 96, 256, 128, 292, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x1f\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\xbe" "\x31\xa5\x01\x53\x6a\x7c\x91\xe4\xa1\x02\xcc\x27\xcd\xfe\x09\xd2\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\xdd\x94\x16" @@ -3999,13 +3557,11 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x60\xe1\x29\x65\xe6\x0a\xbe\xa0\x43\x4e\xc7\x0b\x07\xe3\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7a\x8b\x7d\x60\xe1" "\x29\x65\xe6\x0a\xbe\xa0\x43\x4e\xc7\x0b\x07", - "\xbd\xbf\x63\xdb\x23\x7d\x19\x5e\xce\xfd\xc2\x51\xf5\xf1\x76\x77", 1, - 32, 768 }, + "\xbd\xbf\x63\xdb\x23\x7d\x19\x5e\xce\xfd\xc2\x51\xf5\xf1\x76\x77", 1, 32, 768 }, { 96, 256, 128, 293, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", - "\xff\xff\xff\xff", + "\x00\x01\x02\x03\x04\x05\x06\x07\x03\xe7\x6f\x6f", "\xff\xff\xff\xff", "\x3e\xde\x9b\x9e\xc8\xb2\x47\xd4\x2b\xbe\xe2\x01\x6d\x67\x15\xba\x85" "\x67\xa7\xfd\xe8\x12\xa3\xaa\x2f\x55\x2a\x33\xc1\x71\x8c\x58\xe2\xf0" "\xb0\x56\xa2\xee\xcc\x51\xd3\x08\x38\xe6\x40\x61\x5e\x14\xbb\x87\x29" @@ -4018,8 +3574,7 @@ const struct aead_test chacha20_poly1305_test_json[] = { "\x3c\xdb\x89\xc7\xe9\x4d\xaa\x2a\xf1\x6e\x06\xd5\x05\xd3\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x98\x42\x3c\xdb" "\x89\xc7\xe9\x4d\xaa\x2a\xf1\x6e\x06\xd5\x05", - "\xb4\xcc\xb4\x22\xbc\x5f\x72\x64\xaf\xf7\x3f\x36\x75\xff\x5b\x19", 1, - 32, 768 }, + "\xb4\xcc\xb4\x22\xbc\x5f\x72\x64\xaf\xf7\x3f\x36\x75\xff\x5b\x19", 1, 32, 768 }, { 0, 256, 128, 294, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", @@ -4031,23 +3586,20 @@ const struct aead_test chacha20_poly1305_test_json[] = { { 88, 256, 128, 296, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a", "", "", "", "", 0, 0, - 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a", "", "", "", "", 0, 0, 0 }, { 104, 256, 128, 297, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c", "", "", "", - "", 0, 0, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c", "", "", "", "", 0, 0, 0 }, { 112, 256, 128, 298, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d", "", "", - "", "", 0, 0, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d", "", "", "", "", 0, 0, 0 }, { 128, 256, 128, 299, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "", "", "", "", 0, 0, 0 }, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "", "", "", "", 0, 0, + 0 }, { 160, 256, 128, 300, "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", diff --git a/test/wycheproof-app/gmac_test.json.c b/test/wycheproof-app/gmac_test.json.c index f15bd259..e4bf84ef 100644 --- a/test/wycheproof-app/gmac_test.json.c +++ b/test/wycheproof-app/gmac_test.json.c @@ -29,60 +29,45 @@ /* AES-GMAC, 0.8r12 */ #include "mac_test.h" const struct mac_test gmac_test_json[] = { - { 128, 128, 1, - "\x98\xb0\x8a\x72\xff\xde\x0d\xed\x4b\xec\x9d\x2a\x8d\xb5\x72\x35", - "", - "\x51\x18\xcc\x71\x50\x1c\x82\x73\xa4\x36\x62\xb9\x81\x19\x17\x50", 1, - 0, "\x15\x95\x24\x87\x35\x31\x0e\xb7\x10\x51\x9c\x2b", 96 }, - { 128, 128, 2, - "\xf0\xcf\xce\x28\x06\x56\xfa\xbd\x93\xf6\x8b\xa6\xb3\xa3\xad\x6e", - "\x4b", - "\x86\x77\xa0\x16\x0a\x92\x3c\xe7\x43\x7c\xa9\x4b\x8d\xe9\x7d\xa5", 1, - 8, "\x0a\x38\xca\x62\x6b\x43\x0e\xd8\x4a\x2a\x8d\xfe", 96 }, - { 128, 128, 3, - "\xfd\x3c\x53\x81\xf5\x88\xbf\xe3\x32\x70\xe3\x36\xa5\xb0\x28\x96", - "\x02\x6f", - "\xeb\xc6\x96\x93\x10\x51\x0a\x2e\xb8\xac\xb9\xec\x3d\x63\x1f\x29", 1, - 16, "\x02\xd9\x16\x63\x1f\xba\xcf\x27\xc2\x74\xb7\x4c", 96 }, - { 128, 128, 4, - "\x53\x10\x7d\x29\xdc\x58\x4d\x32\xd3\xef\x32\x1a\x85\xee\xc2\x57", - "\x03\x9e\x0f\x5b", - "\x8c\x99\xcb\xf2\x8c\x43\xf9\x0f\xc3\x60\x91\x26\xbd\xf3\x0f\x4b", 1, + { 128, 128, 1, "\x98\xb0\x8a\x72\xff\xde\x0d\xed\x4b\xec\x9d\x2a\x8d\xb5\x72\x35", "", + "\x51\x18\xcc\x71\x50\x1c\x82\x73\xa4\x36\x62\xb9\x81\x19\x17\x50", 1, 0, + "\x15\x95\x24\x87\x35\x31\x0e\xb7\x10\x51\x9c\x2b", 96 }, + { 128, 128, 2, "\xf0\xcf\xce\x28\x06\x56\xfa\xbd\x93\xf6\x8b\xa6\xb3\xa3\xad\x6e", "\x4b", + "\x86\x77\xa0\x16\x0a\x92\x3c\xe7\x43\x7c\xa9\x4b\x8d\xe9\x7d\xa5", 1, 8, + "\x0a\x38\xca\x62\x6b\x43\x0e\xd8\x4a\x2a\x8d\xfe", 96 }, + { 128, 128, 3, "\xfd\x3c\x53\x81\xf5\x88\xbf\xe3\x32\x70\xe3\x36\xa5\xb0\x28\x96", + "\x02\x6f", "\xeb\xc6\x96\x93\x10\x51\x0a\x2e\xb8\xac\xb9\xec\x3d\x63\x1f\x29", 1, 16, + "\x02\xd9\x16\x63\x1f\xba\xcf\x27\xc2\x74\xb7\x4c", 96 }, + { 128, 128, 4, "\x53\x10\x7d\x29\xdc\x58\x4d\x32\xd3\xef\x32\x1a\x85\xee\xc2\x57", + "\x03\x9e\x0f\x5b", "\x8c\x99\xcb\xf2\x8c\x43\xf9\x0f\xc3\x60\x91\x26\xbd\xf3\x0f\x4b", 1, 32, "\xdd\x91\xa3\x3d\xce\x80\x9e\x7b\xfe\x68\xd8\x43", 96 }, - { 128, 128, 5, - "\x8e\x2c\x0c\xc6\x24\x72\x8a\xf2\x19\x5d\x46\x77\x55\x02\xec\x13", + { 128, 128, 5, "\x8e\x2c\x0c\xc6\x24\x72\x8a\xf2\x19\x5d\x46\x77\x55\x02\xec\x13", "\xf7\xef\xb0\x72\x10\x0c\xc6", - "\x2b\x4e\x06\xa5\x58\xa4\x05\x42\xc0\xfd\xc7\x14\x96\x78\xc8\xb8", 1, - 56, "\xe8\xd4\x3d\x56\x46\xbb\x7d\xde\x8a\x1e\x93\x74", 96 }, - { 128, 128, 6, - "\xf5\x43\xfb\x6a\x66\x73\xe9\xdf\x99\x8a\x30\x58\x08\x4d\xcc\xc1", + "\x2b\x4e\x06\xa5\x58\xa4\x05\x42\xc0\xfd\xc7\x14\x96\x78\xc8\xb8", 1, 56, + "\xe8\xd4\x3d\x56\x46\xbb\x7d\xde\x8a\x1e\x93\x74", 96 }, + { 128, 128, 6, "\xf5\x43\xfb\x6a\x66\x73\xe9\xdf\x99\x8a\x30\x58\x08\x4d\xcc\xc1", "\x80\x63\x71\x9e\x25\xc0\xbc\x9a", - "\xd3\x2c\x12\xb4\xb7\x84\x5a\xda\xca\xda\xbe\x23\x87\xe2\x43\xd4", 1, - 64, "\x0e\x78\xb2\xa2\x25\x0b\x5d\xd1\xda\xeb\xcb\x7b", 96 }, - { 128, 128, 7, - "\xfe\x3f\x26\x6f\x5f\x23\x66\x69\x58\x2b\xd8\x06\x18\x76\x05\x43", + "\xd3\x2c\x12\xb4\xb7\x84\x5a\xda\xca\xda\xbe\x23\x87\xe2\x43\xd4", 1, 64, + "\x0e\x78\xb2\xa2\x25\x0b\x5d\xd1\xda\xeb\xcb\x7b", 96 }, + { 128, 128, 7, "\xfe\x3f\x26\x6f\x5f\x23\x66\x69\x58\x2b\xd8\x06\x18\x76\x05\x43", "\xdc\x25\xf0\x4a\xcf\xbd\xbc\x98\x6a\x10\x70\x43\x28\x6e\xae", - "\x60\x39\x2a\xd4\x1d\xeb\xec\x0d\xb4\x3d\x97\xdf\xb3\x79\x8c\x91", 1, - 120, "\x01\x43\x13\x72\x3d\x18\x60\xbf\x8f\x4b\x11\xfd", 96 }, - { 128, 128, 8, - "\x1d\x4a\x92\x39\x4c\x73\x56\xa6\xf5\x28\xcf\xb3\xad\xb8\xf2\x53", + "\x60\x39\x2a\xd4\x1d\xeb\xec\x0d\xb4\x3d\x97\xdf\xb3\x79\x8c\x91", 1, 120, + "\x01\x43\x13\x72\x3d\x18\x60\xbf\x8f\x4b\x11\xfd", 96 }, + { 128, 128, 8, "\x1d\x4a\x92\x39\x4c\x73\x56\xa6\xf5\x28\xcf\xb3\xad\xb8\xf2\x53", "\x19\xb6\x9d\x41\x78\xd4\x9c\x20\xb4\xee\x58\x46\xcb\x44\x0c\x99", - "\x37\x90\xb3\x2d\x5c\xda\x9f\x8e\xf7\x2b\x64\x3d\x70\x10\x77\xd3", 1, - 128, "\x02\x19\x4e\xce\x3b\xc5\x0c\x51\xc5\x2b\xdd\x83", 96 }, - { 128, 128, 9, - "\xc9\x85\x9c\x8b\x39\xd8\xd7\xe8\x11\xd8\xae\x45\xd9\xb8\x58\x82", + "\x37\x90\xb3\x2d\x5c\xda\x9f\x8e\xf7\x2b\x64\x3d\x70\x10\x77\xd3", 1, 128, + "\x02\x19\x4e\xce\x3b\xc5\x0c\x51\xc5\x2b\xdd\x83", 96 }, + { 128, 128, 9, "\xc9\x85\x9c\x8b\x39\xd8\xd7\xe8\x11\xd8\xae\x45\xd9\xb8\x58\x82", "\x36\x71\x70\x76\x74\x8d\x93\x51\xe5\xa3\xcc\x67\xb9\xe8\x83\x3e" "\x07", - "\xf0\xb2\x6b\x17\xb2\x8e\xa9\x27\x08\xb1\x2b\x87\x1f\x3b\x30\x71", 1, - 136, "\x11\x0d\x55\x01\x19\xd7\x1a\x09\x45\xbf\xec\xbb", 96 }, - { 128, 128, 10, - "\x8b\x4f\xd3\xd3\x05\x57\x46\xcb\x2d\xcd\x9b\x08\xc2\x98\x38\x6f", + "\xf0\xb2\x6b\x17\xb2\x8e\xa9\x27\x08\xb1\x2b\x87\x1f\x3b\x30\x71", 1, 136, + "\x11\x0d\x55\x01\x19\xd7\x1a\x09\x45\xbf\xec\xbb", 96 }, + { 128, 128, 10, "\x8b\x4f\xd3\xd3\x05\x57\x46\xcb\x2d\xcd\x9b\x08\xc2\x98\x38\x6f", "\x83\xe5\xab\xbb\xfe\xd5\xee\xb3\x53\xb2\x5f\x36\xe4\xad\xc0\xf2\x90" "\x60\xc5\x5c\x08\xae\x4f\x80", - "\x2c\x9c\x99\xe0\x71\xf1\xd2\x78\x3a\x47\xc7\xa8\x47\xa3\xb7\x6a", 1, - 192, "\x1a\xac\x5c\xca\x3d\x02\xd4\x0f\x57\xfa\xbe\xcf", 96 }, - { 128, 128, 11, - "\x46\xc3\x3f\xff\x88\x98\xc4\xa4\x98\x55\x99\xcc\xc0\x5d\x05\x71", + "\x2c\x9c\x99\xe0\x71\xf1\xd2\x78\x3a\x47\xc7\xa8\x47\xa3\xb7\x6a", 1, 192, + "\x1a\xac\x5c\xca\x3d\x02\xd4\x0f\x57\xfa\xbe\xcf", 96 }, + { 128, 128, 11, "\x46\xc3\x3f\xff\x88\x98\xc4\xa4\x98\x55\x99\xcc\xc0\x5d\x05\x71", "\x03\x85\x37\xbf\x94\xe1\xd7\xe1\x4f\x68\xb8\xd5\x45\x82\x41\xe3\x4f" "\x51\x58\xde\xa6\xf8\x05\x20\x49\xb9\xda\xd8\xfb\x66\xcb\x6e\x0b\xa6" "\xcc\x22\x3f\x67\x56\x14\xe9\x5d\x15\x27\xc7\x46\xe6\x50\xe9\xfc\x6a" @@ -91,10 +76,9 @@ const struct mac_test gmac_test_json[] = { "\xc1\x62\x4f\xe3\xdb\xd0\xa8\xce\xa3\xb7\xc8\xf2\xd7\xc1\xcc\xa8\xb8" "\xe0\x86\xca\xb0\x21\x53\xbe\x76\x2d\x59\xe4\x9c\x53\x3c\xb3\x9e\x65" "\xab\x37\xf6\xca\xd2\x29\x0d\x0d\xfe\x2a", - "\xfe\xee\xc6\x27\x6f\x89\x39\x3b\x5a\x52\x22\xe0\xeb\xb1\x60\xfd", 1, - 1032, "\x01\xda\x1c\xa7\x2e\x26\xf6\xd6\xfa\x9c\xe2\x81", 96 }, - { 128, 128, 12, - "\xd0\x96\xbe\xd9\x70\xd1\x7a\x34\x00\xcd\x60\xce\xf5\x7b\x4e\x49", + "\xfe\xee\xc6\x27\x6f\x89\x39\x3b\x5a\x52\x22\xe0\xeb\xb1\x60\xfd", 1, 1032, + "\x01\xda\x1c\xa7\x2e\x26\xf6\xd6\xfa\x9c\xe2\x81", 96 }, + { 128, 128, 12, "\xd0\x96\xbe\xd9\x70\xd1\x7a\x34\x00\xcd\x60\xce\xf5\x7b\x4e\x49", "\x30\xf8\xa0\xee\xa9\x37\x56\x7b\xfe\xc3\xb1\x5d\x1c\x58\xa1\x70\xb4" "\xf8\xaa\xe9\x49\x17\x8a\xd0\x4d\x8e\xa4\x6b\x6e\x62\x5b\x50\xdc\xe2" "\x52\xdc\x38\x0e\x9e\xff\x53\xca\x20\x57\x22\x80\x39\xed\xd7\x8a\xe3" @@ -111,10 +95,9 @@ const struct mac_test gmac_test_json[] = { "\x23\x8a\x9c\x79\xc8\x36\xd9\xb7\x91\x54\x1e\xd5\x27\xa9\xd6\xef\x87" "\xbc\xef\x11\x42\x65\x3e\x73\x4e\x66\x60\x1d\x2a\x8a\x37\xdd\x20\x07" "\x16", - "\x01\x4c\x13\xda\x92\xa0\xe9\x93\x29\xa8\x8c\x9c\xc8\x4e\x08\xd4", 1, - 2048, "\x23\x18\x54\x32\x3b\xc9\x56\x13\xa1\x5d\xd7\xd5", 96 }, - { 128, 128, 13, - "\x6f\x8b\x47\x45\x2e\xf0\x25\x02\x85\x60\xf6\x16\x01\xb6\x4e\x46", + "\x01\x4c\x13\xda\x92\xa0\xe9\x93\x29\xa8\x8c\x9c\xc8\x4e\x08\xd4", 1, 2048, + "\x23\x18\x54\x32\x3b\xc9\x56\x13\xa1\x5d\xd7\xd5", 96 }, + { 128, 128, 13, "\x6f\x8b\x47\x45\x2e\xf0\x25\x02\x85\x60\xf6\x16\x01\xb6\x4e\x46", "\xf3\x6e\x40\x72\xc2\x04\x5b\x89\x95\xed\x8f\xb9\x90\x7b\xc9\x85\x60" "\x6b\x01\xd1\x92\x0b\x09\xe3\x93\xe3\x79\x26\x37\x7f\x89\x47\x8e\x6e" "\xd5\x53\x14\xc5\x4f\x29\xff\x0b\xd2\x5f\xf7\x5e\x99\xf1\xde\xa9\xeb" @@ -132,360 +115,271 @@ const struct mac_test gmac_test_json[] = { "\x28\x8b\x72\xbc\xc0\x4e\x8e\x53\x59\xb1\xae\x44\xc3\x34\x0c\x64\x04" "\x42\x6d\x9a\x3b\xa5\x05\x9c\xbb\xa0\x50\x6a\x3a\x69\x87\xa5\x9e\x9a" "\x0a\x2e\xac\x96\xf9", - "\x53\x7a\x54\x05\xae\x5d\xfd\x3a\x83\xad\x6e\x9e\x4b\x4d\x0a\x1d", 1, - 2216, "\xc8\x99\x82\xa6\xa7\x87\xca\xa3\x8f\x16\x6e\xc7", 96 }, - { 128, 128, 14, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x53\x7a\x54\x05\xae\x5d\xfd\x3a\x83\xad\x6e\x9e\x4b\x4d\x0a\x1d", 1, 2216, + "\xc8\x99\x82\xa6\xa7\x87\xca\xa3\x8f\x16\x6e\xc7", 96 }, + { 128, 128, 14, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8c\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 15, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7c\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 16, + "\x8c\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 15, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7c\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 16, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8f\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 17, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7f\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 18, + "\x8f\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 17, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7f\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 18, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x0d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 19, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xfd\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 20, + "\x0d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 19, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xfd\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 20, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf6\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 21, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x03\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 22, + "\x8d\xf6\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 21, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x03\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 22, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\x6d\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 23, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x03\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 24, + "\x8d\xf7\xd8\x6d\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 23, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x03\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 24, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb8\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 25, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb6\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 26, + "\x8d\xf7\xd8\xed\xb8\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 25, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb6\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 26, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xbb\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 27, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb5\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 28, + "\x8d\xf7\xd8\xed\xbb\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 27, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb5\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 28, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\x7a\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 29, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x12\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 30, + "\x8d\xf7\xd8\xed\xb9\x91\x65\x7a\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 29, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x12\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 30, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xac\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 31, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcd\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 32, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xac\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 31, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcd\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 32, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\x2d\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 33, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\x4c\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 34, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\x2d\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 33, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\x4c\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 34, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x3b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 35, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x41\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 36, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x3b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 35, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x41\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 36, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x02\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 37, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x53\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 38, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x02\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 37, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x53\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 38, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x52\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 39, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x49\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 40, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x52\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 39, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x49\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 40, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x51\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 41, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x4a\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 42, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x51\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 41, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x4a\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 42, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\xd3\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 43, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\xc8\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 44, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\xd3\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 43, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\xc8\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 44, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe9", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 45, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x05", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 46, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xe9", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 45, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x05", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 46, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xea", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 47, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x06", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 48, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xea", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 47, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x06", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 48, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xa8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 49, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x44", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 50, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\xa8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 49, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x44", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 50, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\x68", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 51, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x84", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 52, + "\x8d\xf7\xd8\xed\xb9\x91\x65\xfa\xad\x1b\x03\x8c\x53\xb3\x20\x68", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 51, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x92\xcc\x61\x52\x8e\x48\xcb\x02\x84", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 52, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8c\xf7\xd8\xed\xb9\x91\x65\xfa\xac\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 53, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7c\x02\x8e\x83\xb7\x27\xda\x92\xcd\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 54, + "\x8c\xf7\xd8\xed\xb9\x91\x65\xfa\xac\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 53, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7c\x02\x8e\x83\xb7\x27\xda\x92\xcd\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 54, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\x6d\xb9\x91\x65\x7a\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 55, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x03\xb7\x27\xda\x12\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 56, + "\x8d\xf7\xd8\x6d\xb9\x91\x65\x7a\xad\x1b\x03\x8c\x53\xb3\x20\xe8", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 55, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x03\xb7\x27\xda\x12\xcc\x61\x52\x8e\x48\xcb\x02\x04", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 56, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8d\xf7\xd8\xed\xb9\x91\x65\x7a\xad\x1b\x03\x8c\x53\xb3\x20\x68", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 57, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7d\x02\x8e\x83\xb7\x27\xda\x12\xcc\x61\x52\x8e\x48\xcb\x02\x84", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 58, + "\x8d\xf7\xd8\xed\xb9\x91\x65\x7a\xad\x1b\x03\x8c\x53\xb3\x20\x68", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 57, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x7d\x02\x8e\x83\xb7\x27\xda\x12\xcc\x61\x52\x8e\x48\xcb\x02\x84", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 58, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x72\x08\x27\x12\x46\x6e\x9a\x05\x52\xe4\xfc\x73\xac\x4c\xdf\x17", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 59, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x82\xfd\x71\x7c\x48\xd8\x25\x6d\x33\x9e\xad\x71\xb7\x34\xfd\xfb", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 60, + "\x72\x08\x27\x12\x46\x6e\x9a\x05\x52\xe4\xfc\x73\xac\x4c\xdf\x17", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 59, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x82\xfd\x71\x7c\x48\xd8\x25\x6d\x33\x9e\xad\x71\xb7\x34\xfd\xfb", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 60, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 61, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 62, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 61, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 62, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 63, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 64, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 63, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x0d\x77\x58\x6d\x39\x11\xe5\x7a\x2d\x9b\x83\x0c\xd3\x33\xa0\x68", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 65, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xfd\x82\x0e\x03\x37\xa7\x5a\x12\x4c\xe1\xd2\x0e\xc8\x4b\x82\x84", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 66, + "\x0d\x77\x58\x6d\x39\x11\xe5\x7a\x2d\x9b\x83\x0c\xd3\x33\xa0\x68", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 65, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xfd\x82\x0e\x03\x37\xa7\x5a\x12\x4c\xe1\xd2\x0e\xc8\x4b\x82\x84", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 66, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x8c\xf6\xd9\xec\xb8\x90\x64\xfb\xac\x1a\x02\x8d\x52\xb2\x21\xe9", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 67, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x8c\xf6\xd9\xec\xb8\x90\x64\xfb\xac\x1a\x02\x8d\x52\xb2\x21\xe9", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 67, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x7c\x03\x8f\x82\xb6\x26\xdb\x93\xcd\x60\x53\x8f\x49\xca\x03\x05", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, - { 128, 128, 68, - "\x82\x6b\xa4\x9b\x4a\xff\x2a\xdc\x6b\x22\xdd\x4a\x84\xf2\x99\x41", + "\x7c\x03\x8f\x82\xb6\x26\xdb\x93\xcd\x60\x53\x8f\x49\xca\x03\x05", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + { 128, 128, 68, "\x82\x6b\xa4\x9b\x4a\xff\x2a\xdc\x6b\x22\xdd\x4a\x84\xf2\x99\x41", "\x32\x72\x5b\xc6\x38\x59\x49\xb2\x98\x75\xf8\x39\xe7\x5c\x06\x71", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 128, "\xce\x88\xbe\x4f\x89\xc9\x46\x02\x7d\x7c\x54\x2a", 96 }, - { 128, 128, 69, - "\x82\x6b\xa4\x9b\x4a\xff\x2a\xdc\x6b\x22\xdd\x4a\x84\xf2\x99\x41", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + "\xce\x88\xbe\x4f\x89\xc9\x46\x02\x7d\x7c\x54\x2a", 96 }, + { 128, 128, 69, "\x82\x6b\xa4\x9b\x4a\xff\x2a\xdc\x6b\x22\xdd\x4a\x84\xf2\x99\x41", "\x4a\x41\x61\x2e\xec\x3b\x21\x56\x4f\xf6\x23\x91\xeb\xae\x07\x6c", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 128, "\xce\x88\xbe\x4f\x89\xc9\x46\x02\x7d\x7c\x54\x2a", 96 }, - { 128, 128, 70, - "\x82\x00\x8d\xa5\xb6\x5a\x6e\x99\xa3\xe9\x78\xab\x5a\x98\xe9\xb0", - "", - "\x82\xf2\xab\xe9\xa8\x97\xcc\xda\x3d\x2c\xbd\x39\x57\x97\xc8\x3e", 1, - 0, "\x63\x8c\x5f\x29\xff\x29\x23\x33\xab\x0e\xb7\xcd\x66\x56\xde\x69", - 128 }, - { 128, 128, 71, - "\x7c\x3f\x22\x46\xf4\xa3\x26\xae\x60\x05\x4f\x41\x7c\x20\xe9\xc1", - "\x2d", - "\xa0\x79\xf6\x04\x8f\xed\x16\xf0\x04\x1f\xa0\x4d\x7d\x70\x92\x5e", 1, - 8, "\x16\xa0\xff\x55\x39\xe1\x0a\x86\xec\x54\x33\x76\x4d\xa7\x1b\x59", - 128 }, - { 128, 128, 72, - "\x0f\x62\x4e\x31\x8b\x51\xa9\xcc\x6c\x30\xcf\x4e\x45\xa2\x87\xdb", - "\x0e\x45", - "\xd0\x7a\x83\xbb\xd5\x44\xf0\xb0\x79\xee\xc6\x32\xf8\x09\x74\xc9", 1, - 16, - "\x0d\x4d\xf0\x21\x63\x3d\xce\xbb\x58\xf2\xa3\x89\xe1\x91\x1b\x66", - 128 }, - { 128, 128, 73, - "\x57\x43\x6a\xb1\x0e\xe8\x28\x55\x2e\x63\xe1\xbf\xbf\x83\x81\xdd", - "\x95\x8a\x56\x55", - "\x66\x5b\x87\xde\x5e\x3e\xec\x09\x8f\x9e\x6a\xd7\x40\x12\xf2\x36", 1, - 32, - "\x0c\x5d\x7c\x05\xd7\x21\xf4\x22\xda\x93\xd6\x01\xe9\xfe\xbe\xf0", - 128 }, - { 128, 128, 74, - "\x18\xd6\xdf\x42\x42\xd1\x00\xb5\x71\x21\x57\xc7\x72\xc8\xe1\x28", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, + "\xce\x88\xbe\x4f\x89\xc9\x46\x02\x7d\x7c\x54\x2a", 96 }, + { 128, 128, 70, "\x82\x00\x8d\xa5\xb6\x5a\x6e\x99\xa3\xe9\x78\xab\x5a\x98\xe9\xb0", "", + "\x82\xf2\xab\xe9\xa8\x97\xcc\xda\x3d\x2c\xbd\x39\x57\x97\xc8\x3e", 1, 0, + "\x63\x8c\x5f\x29\xff\x29\x23\x33\xab\x0e\xb7\xcd\x66\x56\xde\x69", 128 }, + { 128, 128, 71, "\x7c\x3f\x22\x46\xf4\xa3\x26\xae\x60\x05\x4f\x41\x7c\x20\xe9\xc1", "\x2d", + "\xa0\x79\xf6\x04\x8f\xed\x16\xf0\x04\x1f\xa0\x4d\x7d\x70\x92\x5e", 1, 8, + "\x16\xa0\xff\x55\x39\xe1\x0a\x86\xec\x54\x33\x76\x4d\xa7\x1b\x59", 128 }, + { 128, 128, 72, "\x0f\x62\x4e\x31\x8b\x51\xa9\xcc\x6c\x30\xcf\x4e\x45\xa2\x87\xdb", + "\x0e\x45", "\xd0\x7a\x83\xbb\xd5\x44\xf0\xb0\x79\xee\xc6\x32\xf8\x09\x74\xc9", 1, 16, + "\x0d\x4d\xf0\x21\x63\x3d\xce\xbb\x58\xf2\xa3\x89\xe1\x91\x1b\x66", 128 }, + { 128, 128, 73, "\x57\x43\x6a\xb1\x0e\xe8\x28\x55\x2e\x63\xe1\xbf\xbf\x83\x81\xdd", + "\x95\x8a\x56\x55", "\x66\x5b\x87\xde\x5e\x3e\xec\x09\x8f\x9e\x6a\xd7\x40\x12\xf2\x36", 1, + 32, "\x0c\x5d\x7c\x05\xd7\x21\xf4\x22\xda\x93\xd6\x01\xe9\xfe\xbe\xf0", 128 }, + { 128, 128, 74, "\x18\xd6\xdf\x42\x42\xd1\x00\xb5\x71\x21\x57\xc7\x72\xc8\xe1\x28", "\xc9\xc7\xd4\x6f\xd7\x9e\x72", - "\x92\xe3\xc1\x24\xab\xdd\x0f\x9c\x10\xce\xbe\xa8\x4f\xd8\x5e\x0a", 1, - 56, - "\xee\xad\x99\xcd\xb2\x04\x42\x2d\xb1\xa0\x08\xfe\x6d\xea\x6a\x3a", - 128 }, - { 128, 128, 75, - "\xf9\x81\x9a\x0d\x58\x53\xfe\x80\x56\x45\x23\x1e\x43\x33\x62\xce", + "\x92\xe3\xc1\x24\xab\xdd\x0f\x9c\x10\xce\xbe\xa8\x4f\xd8\x5e\x0a", 1, 56, + "\xee\xad\x99\xcd\xb2\x04\x42\x2d\xb1\xa0\x08\xfe\x6d\xea\x6a\x3a", 128 }, + { 128, 128, 75, "\xf9\x81\x9a\x0d\x58\x53\xfe\x80\x56\x45\x23\x1e\x43\x33\x62\xce", "\x37\x4d\xd4\xb4\x66\xa5\x1b\xf5", - "\x56\xb0\x62\x73\x96\x08\xc6\x7a\xe6\xbd\x1a\xa6\x1e\x83\xbe\x2b", 1, - 64, - "\x23\x07\xa6\x4b\x29\xef\x75\xd4\x64\xc0\x51\x06\x1d\x06\x9b\xbe", - 128 }, - { 128, 128, 76, - "\x47\xff\x15\xa9\xa9\xf5\x65\xdf\x93\x25\x57\x74\xa1\x29\x6b\x11", + "\x56\xb0\x62\x73\x96\x08\xc6\x7a\xe6\xbd\x1a\xa6\x1e\x83\xbe\x2b", 1, 64, + "\x23\x07\xa6\x4b\x29\xef\x75\xd4\x64\xc0\x51\x06\x1d\x06\x9b\xbe", 128 }, + { 128, 128, 76, "\x47\xff\x15\xa9\xa9\xf5\x65\xdf\x93\x25\x57\x74\xa1\x29\x6b\x11", "\xf3\x5d\xf7\xb3\x38\x71\x7e\x4e\xc9\x97\x45\x48\xb9\x9f\x21", - "\x46\x08\xea\x9a\x7e\x40\xa7\x29\xd2\x62\x59\xa9\xc6\x2b\xc5\x86", 1, - 120, - "\xeb\xff\xd4\x1f\x0f\x5b\x3b\xdc\x64\x7d\xa8\x03\x6b\xe5\xe4\xdd", - 128 }, - { 128, 128, 77, - "\x75\x91\x85\xe9\x95\xfb\x6d\xee\xc8\x01\xba\x11\x9d\xb8\x7b\xcc", + "\x46\x08\xea\x9a\x7e\x40\xa7\x29\xd2\x62\x59\xa9\xc6\x2b\xc5\x86", 1, 120, + "\xeb\xff\xd4\x1f\x0f\x5b\x3b\xdc\x64\x7d\xa8\x03\x6b\xe5\xe4\xdd", 128 }, + { 128, 128, 77, "\x75\x91\x85\xe9\x95\xfb\x6d\xee\xc8\x01\xba\x11\x9d\xb8\x7b\xcc", "\xde\x69\xd4\x92\x6f\xbc\x7d\xaa\xc4\x1a\xdd\xdf\x69\x2f\xe1\x6b", - "\xd2\x12\xc3\xe2\x57\x83\x74\x81\xe9\x7b\x31\xe7\xa8\x99\xb1\x26", 1, - 128, - "\x80\x86\x24\x48\x2a\xd1\x9d\x2a\x8b\x76\xac\x96\xa3\x09\x05\x13", - 128 }, - { 128, 128, 78, - "\x77\x22\x74\xb7\x24\x0c\x3a\xda\x54\x68\xfa\x3f\x12\xbc\xe8\x1d", + "\xd2\x12\xc3\xe2\x57\x83\x74\x81\xe9\x7b\x31\xe7\xa8\x99\xb1\x26", 1, 128, + "\x80\x86\x24\x48\x2a\xd1\x9d\x2a\x8b\x76\xac\x96\xa3\x09\x05\x13", 128 }, + { 128, 128, 78, "\x77\x22\x74\xb7\x24\x0c\x3a\xda\x54\x68\xfa\x3f\x12\xbc\xe8\x1d", "\xdf\x69\x01\x0d\xc9\x2f\xc4\xaf\x5e\xc1\x9d\xd1\x65\xb0\xd2\x6a" "\x97", - "\xb6\x85\x46\x3b\xed\xda\xd5\x56\x68\xe4\x48\xb0\xc1\x3f\xb3\x2f", 1, - 136, - "\xd0\x7e\xfa\x93\xb8\x88\x8c\xd7\xf0\xd3\xfe\x53\xb3\x59\x2b\x62", - 128 }, - { 128, 128, 79, - "\xf2\xd0\xfd\x91\xee\xca\x7f\x55\xe5\xf7\xb5\xc5\x7f\x59\xc5\x77", + "\xb6\x85\x46\x3b\xed\xda\xd5\x56\x68\xe4\x48\xb0\xc1\x3f\xb3\x2f", 1, 136, + "\xd0\x7e\xfa\x93\xb8\x88\x8c\xd7\xf0\xd3\xfe\x53\xb3\x59\x2b\x62", 128 }, + { 128, 128, 79, "\xf2\xd0\xfd\x91\xee\xca\x7f\x55\xe5\xf7\xb5\xc5\x7f\x59\xc5\x77", "\x7c\x51\x95\x7d\x97\x4a\x84\x78\x77\xe8\xb7\xf7\x16\x5d\xe4\x6e\xc0" "\x50\xcb\x5c\xb0\x3c\xd5\x6f", - "\xa5\xbf\x64\x54\x74\x86\x54\xfb\xd9\x01\xca\x5c\x28\xc0\x09\xd6", 1, - 192, - "\x27\xbb\x91\x06\x32\x86\x93\x14\x97\x9d\xea\x4a\xa6\x80\x16\x13", - 128 }, - { 128, 128, 80, - "\x97\xca\xc4\x81\x2b\x0d\x1e\xbc\x7f\x26\xf2\xa7\xb8\x11\x81\x2b", + "\xa5\xbf\x64\x54\x74\x86\x54\xfb\xd9\x01\xca\x5c\x28\xc0\x09\xd6", 1, 192, + "\x27\xbb\x91\x06\x32\x86\x93\x14\x97\x9d\xea\x4a\xa6\x80\x16\x13", 128 }, + { 128, 128, 80, "\x97\xca\xc4\x81\x2b\x0d\x1e\xbc\x7f\x26\xf2\xa7\xb8\x11\x81\x2b", "\xa9\xd9\x97\xfa\x61\x44\x43\x93\xce\x45\xf9\xaa\xcb\x2c\x9d\xcc\x50" "\x98\xae\xdc\xc4\xd5\x69\xcd\x92\xa6\x75\x6b\x4e\x53\x9b\x28\x37\xf7" "\xec\x79\x8c\x05\x61\xf8\x93\xcf\xf8\x8b\x16\x0a\x68\xd2\xcd\xe2\xcb" @@ -494,12 +388,9 @@ const struct mac_test gmac_test_json[] = { "\x9f\x2d\x5b\x94\xd4\x00\x7b\xfa\xe0\xf9\x5f\xcb\xe6\x04\xe4\x22\x36" "\x01\xf6\x4b\xae\xe1\x50\xfa\xaa\xfd\x7e\x9c\xbc\xdc\x67\xbb\x9d\xfd" "\x8f\x70\x14\xd4\x91\xd9\xae\x5f\x67\x7a", - "\x03\x50\x77\x2a\x98\xaa\x49\xdf\x0a\x66\xc6\xd4\x6d\x4a\x60\x34", 1, - 1032, - "\xe1\x2b\x41\x5a\x79\x1b\x51\xdb\x9d\x35\xf7\x35\xac\x50\x78\xc6", - 128 }, - { 128, 128, 81, - "\xcb\xf3\x1f\xf2\x9c\x06\x80\x99\x32\x93\x50\x1c\x2e\x1f\xf3\x4c", + "\x03\x50\x77\x2a\x98\xaa\x49\xdf\x0a\x66\xc6\xd4\x6d\x4a\x60\x34", 1, 1032, + "\xe1\x2b\x41\x5a\x79\x1b\x51\xdb\x9d\x35\xf7\x35\xac\x50\x78\xc6", 128 }, + { 128, 128, 81, "\xcb\xf3\x1f\xf2\x9c\x06\x80\x99\x32\x93\x50\x1c\x2e\x1f\xf3\x4c", "\x7b\xfb\x18\x64\xf9\x2d\x4a\x92\x58\xf0\xac\x72\x1e\xb8\x74\xcf\xf7" "\xd7\x34\x27\x23\x7c\xea\x9f\x4d\x0e\x28\x39\x84\x85\xc4\xed\xa7\x83" "\x7c\x60\x44\xb1\x5d\x3d\x30\xe1\xea\x75\x07\x47\x0e\xdf\x0b\x46\x5a" @@ -516,12 +407,9 @@ const struct mac_test gmac_test_json[] = { "\x16\xa0\x76\xca\x65\x3a\xff\x91\x25\x7f\xc9\x48\x74\xbb\x56\x4b\xfd" "\xf3\x9e\xa4\xce\x06\x1f\x56\x2b\xaf\xbf\x67\x40\xe2\x45\x3d\xef\xae" "\x5f", - "\x40\x12\xf2\xc6\xf3\x12\x93\xc1\xd3\x90\x53\x5d\xfe\xbc\xa6\x18", 1, - 2048, - "\x85\x0a\xea\x39\xc6\x6d\x85\xc5\x9a\x4a\x65\xa0\x67\xe9\xd6\xfc", - 128 }, - { 128, 128, 82, - "\xde\x20\xc3\x9c\x12\x01\x1e\x61\xfb\x40\xc9\xd7\xdc\x1a\x26\xdb", + "\x40\x12\xf2\xc6\xf3\x12\x93\xc1\xd3\x90\x53\x5d\xfe\xbc\xa6\x18", 1, 2048, + "\x85\x0a\xea\x39\xc6\x6d\x85\xc5\x9a\x4a\x65\xa0\x67\xe9\xd6\xfc", 128 }, + { 128, 128, 82, "\xde\x20\xc3\x9c\x12\x01\x1e\x61\xfb\x40\xc9\xd7\xdc\x1a\x26\xdb", "\x2e\x11\xd7\x8f\x73\xc8\x30\xc1\xd3\xd3\xf7\x87\x47\x9b\xc3\x58\x48" "\x91\xdc\xe8\xae\xa3\x7c\x72\xcf\x87\x6f\x9f\x37\xc9\x25\x5d\x28\xd3" "\xad\x4e\xfb\xdf\xc9\x63\xf2\xc4\xec\x4d\xfa\xe4\xeb\x56\x8e\x1a\x3f" @@ -539,464 +427,290 @@ const struct mac_test gmac_test_json[] = { "\x86\x3d\x0f\xb0\x08\x7e\xcc\xc0\x45\x7d\x51\xe6\x20\x30\x6b\xaf\xea" "\x0a\xb3\xfb\x72\x82\x7e\xd5\x70\x51\xa8\xcf\x6f\x15\xe5\x4b\x2e\x84" "\xb3\xec\x8a\x33\xbb", - "\x10\x6a\x8b\x1d\x9a\xed\x24\x63\x87\x59\x5c\xe9\xae\xcf\x16\x3f", 1, - 2216, - "\xce\xb4\x9c\x91\xd2\x09\x42\x78\x86\x23\xc8\x56\xa5\xf4\x44\xd4", - 128 }, - { 128, 128, 83, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x10\x6a\x8b\x1d\x9a\xed\x24\x63\x87\x59\x5c\xe9\xae\xcf\x16\x3f", 1, 2216, + "\xce\xb4\x9c\x91\xd2\x09\x42\x78\x86\x23\xc8\x56\xa5\xf4\x44\xd4", 128 }, + { 128, 128, 83, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xdf\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 84, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2f\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 85, + "\xdf\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 84, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2f\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 85, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xdc\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 86, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2c\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 87, + "\xdc\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 86, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2c\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 87, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x5e\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 88, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xae\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 89, + "\x5e\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 88, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xae\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 89, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc6\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 90, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x33\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 91, + "\xde\xc6\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 90, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x33\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 91, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\xb8\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 92, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\xd6\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 93, + "\xde\xc7\xf8\xb8\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 92, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\xd6\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 93, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8b\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 94, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x85\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 95, + "\xde\xc7\xf8\x38\x8b\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 94, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x85\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 95, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x88\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 96, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x86\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 97, + "\xde\xc7\xf8\x38\x88\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 96, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x86\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 97, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\xd3\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 98, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\xbb\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 99, + "\xde\xc7\xf8\x38\x8a\x5a\x84\xd3\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 98, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\xbb\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 99, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xfe\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 100, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9f\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 101, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xfe\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 100, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9f\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 101, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\x7f\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 102, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x1e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 103, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\x7f\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 102, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x1e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 103, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x3f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 104, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x45\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 105, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x3f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 104, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x45\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 105, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x85\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 106, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd4\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 107, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x85\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 106, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd4\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 107, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x58\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 108, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x43\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 109, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x58\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 108, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x43\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 109, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x5b\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 110, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x40\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 111, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x5b\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 110, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x40\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 111, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\xd9\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 112, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\xc2\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 113, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\xd9\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 112, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\xc2\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 113, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf6", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 114, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1a", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 115, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf6", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 114, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x1a", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 115, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf5", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 116, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x19", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 117, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xf5", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 116, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x19", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 117, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xb7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 118, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x5b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 119, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\xb7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 118, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x5b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 119, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\x77", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 120, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 121, + "\xde\xc7\xf8\x38\x8a\x5a\x84\x53\xff\x1f\x84\xf1\x59\x99\x74\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 120, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\x3b\x9e\x65\xd5\xf3\x42\xe1\x56\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 121, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xdf\xc7\xf8\x38\x8a\x5a\x84\x53\xfe\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 122, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2f\x32\xae\x56\x84\xec\x3b\x3b\x9f\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 123, + "\xdf\xc7\xf8\x38\x8a\x5a\x84\x53\xfe\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 122, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2f\x32\xae\x56\x84\xec\x3b\x3b\x9f\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 123, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\xb8\x8a\x5a\x84\xd3\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 124, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\xd6\x84\xec\x3b\xbb\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 125, + "\xde\xc7\xf8\xb8\x8a\x5a\x84\xd3\xff\x1f\x84\xf1\x59\x99\x74\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 124, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\xd6\x84\xec\x3b\xbb\x9e\x65\xd5\xf3\x42\xe1\x56\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 125, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xde\xc7\xf8\x38\x8a\x5a\x84\xd3\xff\x1f\x84\xf1\x59\x99\x74\x77", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 126, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2e\x32\xae\x56\x84\xec\x3b\xbb\x9e\x65\xd5\xf3\x42\xe1\x56\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 127, + "\xde\xc7\xf8\x38\x8a\x5a\x84\xd3\xff\x1f\x84\xf1\x59\x99\x74\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 126, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x2e\x32\xae\x56\x84\xec\x3b\xbb\x9e\x65\xd5\xf3\x42\xe1\x56\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 127, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x21\x38\x07\xc7\x75\xa5\x7b\xac\x00\xe0\x7b\x0e\xa6\x66\x8b\x08", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd1\xcd\x51\xa9\x7b\x13\xc4\xc4\x61\x9a\x2a\x0c\xbd\x1e\xa9\xe4", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 129, + "\x21\x38\x07\xc7\x75\xa5\x7b\xac\x00\xe0\x7b\x0e\xa6\x66\x8b\x08", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xd1\xcd\x51\xa9\x7b\x13\xc4\xc4\x61\x9a\x2a\x0c\xbd\x1e\xa9\xe4", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 129, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 130, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 131, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 130, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 131, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 132, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 133, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 132, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 133, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x5e\x47\x78\xb8\x0a\xda\x04\xd3\x7f\x9f\x04\x71\xd9\x19\xf4\x77", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 134, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xae\xb2\x2e\xd6\x04\x6c\xbb\xbb\x1e\xe5\x55\x73\xc2\x61\xd6\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 135, + "\x5e\x47\x78\xb8\x0a\xda\x04\xd3\x7f\x9f\x04\x71\xd9\x19\xf4\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 134, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xae\xb2\x2e\xd6\x04\x6c\xbb\xbb\x1e\xe5\x55\x73\xc2\x61\xd6\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 135, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xdf\xc6\xf9\x39\x8b\x5b\x85\x52\xfe\x1e\x85\xf0\x58\x98\x75\xf6", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 136, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\xdf\xc6\xf9\x39\x8b\x5b\x85\x52\xfe\x1e\x85\xf0\x58\x98\x75\xf6", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 136, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x2f\x33\xaf\x57\x85\xed\x3a\x3a\x9f\x64\xd4\xf2\x43\xe0\x57\x1a", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, - { 128, 128, 137, - "\xb0\x91\x32\xf1\xb7\x5e\xef\x72\x9e\x4f\x61\x66\xc2\x64\x90\xdb", + "\x2f\x33\xaf\x57\x85\xed\x3a\x3a\x9f\x64\xd4\xf2\x43\xe0\x57\x1a", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, + { 128, 128, 137, "\xb0\x91\x32\xf1\xb7\x5e\xef\x72\x9e\x4f\x61\x66\xc2\x64\x90\xdb", "\x20\x08\xb1\x1d\x8a\x75\x6a\xfc\x3d\x63\x40\x14\x1d\xf6\x77\x5b", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 128, - "\x2a\xda\x15\x3c\x42\x3a\x82\xf8\x45\xdb\x0c\xaa\xa9\x4b\x96\x6d", - 128 }, - { 128, 128, 138, - "\xb0\x91\x32\xf1\xb7\x5e\xef\x72\x9e\x4f\x61\x66\xc2\x64\x90\xdb", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + "\x2a\xda\x15\x3c\x42\x3a\x82\xf8\x45\xdb\x0c\xaa\xa9\x4b\x96\x6d", 128 }, + { 128, 128, 138, "\xb0\x91\x32\xf1\xb7\x5e\xef\x72\x9e\x4f\x61\x66\xc2\x64\x90\xdb", "\x17\xc0\x16\x62\x31\x2d\x93\xbc\xe1\x5b\x1e\xcb\xa9\x68\x2b\x2d", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 128, - "\x2a\xda\x15\x3c\x42\x3a\x82\xf8\x45\xdb\x0c\xaa\xa9\x4b\x96\x6d", - 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, + "\x2a\xda\x15\x3c\x42\x3a\x82\xf8\x45\xdb\x0c\xaa\xa9\x4b\x96\x6d", 128 }, { 192, 128, 139, "\xde\xd6\xff\x22\x55\x65\x87\x32\xf0\xfe\xf0\x84\x07\x13\x68\x93\xf1" "\x2e\xdf\xeb\xdf\x86\xa2\x14", - "", - "\x59\xa1\x46\x0f\x62\x83\x16\x8b\x32\xc7\xf5\x27\xb7\xa7\x6f\x12", 1, - 0, "\x05\x36\xe9\xff\x30\x45\x94\xf2\xad\xfe\x5e\x02", 96 }, + "", "\x59\xa1\x46\x0f\x62\x83\x16\x8b\x32\xc7\xf5\x27\xb7\xa7\x6f\x12", 1, 0, + "\x05\x36\xe9\xff\x30\x45\x94\xf2\xad\xfe\x5e\x02", 96 }, { 192, 128, 140, "\x6a\xda\x91\xc9\x74\x2d\xc0\x1e\x95\x3e\xf1\x20\xb2\x2a\x26\x49\xc0" "\xbe\x93\x04\x38\x65\x15\xa2", - "\x0d", - "\xb1\xd2\xa3\xdb\x72\x4f\xf1\xef\x11\xaa\x76\x95\x4e\x39\x49\x8e", 1, - 8, "\xe1\x9f\xaa\x23\xf8\x71\xfc\x66\x58\xf5\xb5\x96", 96 }, + "\x0d", "\xb1\xd2\xa3\xdb\x72\x4f\xf1\xef\x11\xaa\x76\x95\x4e\x39\x49\x8e", 1, 8, + "\xe1\x9f\xaa\x23\xf8\x71\xfc\x66\x58\xf5\xb5\x96", 96 }, { 192, 128, 141, "\x9b\xee\x48\xdc\x40\xa8\xb5\x22\xbd\x7a\xbd\xe7\x99\x9a\xde\xdd\x70" "\xba\xb2\xef\xf8\x00\xa0\x50", - "\x94\xc8", - "\x36\xb0\x21\xf1\x9c\x12\x4c\x46\x50\x0e\x40\x7f\xc8\xe0\xcd\x5e", 1, - 16, "\x6f\xaa\xe4\x20\x1f\x79\xc9\xd5\x32\xf6\x3d\x85", 96 }, + "\x94\xc8", "\x36\xb0\x21\xf1\x9c\x12\x4c\x46\x50\x0e\x40\x7f\xc8\xe0\xcd\x5e", 1, 16, + "\x6f\xaa\xe4\x20\x1f\x79\xc9\xd5\x32\xf6\x3d\x85", 96 }, { 192, 128, 142, "\xf7\x9e\x59\x0f\x07\x38\x81\x24\xc8\x00\xdd\x4a\xda\xda\xc2\x54\x6c" "\x62\x67\x96\xc4\x6c\x3d\x2d", - "\xea\x09\x34\x8f", - "\x5f\xa2\x25\x2f\x2b\xbe\x35\x08\xc8\xa9\x19\xc2\x68\xb9\x51\x4a", 1, + "\xea\x09\x34\x8f", "\x5f\xa2\x25\x2f\x2b\xbe\x35\x08\xc8\xa9\x19\xc2\x68\xb9\x51\x4a", 1, 32, "\xc2\x36\x00\x65\x82\x07\xbf\x2d\xc3\x08\x08\x7c", 96 }, { 192, 128, 143, "\x35\x6a\xe8\x0d\x9f\xf5\x1f\x72\x92\x0a\x0b\xcc\x80\x78\x37\xcd\x79" "\x77\x68\xad\xba\x48\x75\x1c", "\xa8\xab\x4d\x4d\x07\xc7\x1e", - "\x04\x31\xff\x77\x84\xb4\x55\x6e\xc6\x31\x24\xce\xa0\x3e\xb0\x39", 1, - 56, "\xae\x0a\x4c\x45\x2d\x43\xa2\xc8\x41\xd6\xe0\xfd", 96 }, + "\x04\x31\xff\x77\x84\xb4\x55\x6e\xc6\x31\x24\xce\xa0\x3e\xb0\x39", 1, 56, + "\xae\x0a\x4c\x45\x2d\x43\xa2\xc8\x41\xd6\xe0\xfd", 96 }, { 192, 128, 144, "\x26\x8b\x5c\xb7\x84\x37\xe8\x7a\xf7\x5f\x27\xab\xc7\x53\x90\x9b\xda" "\xa2\x34\x1f\x88\x91\xd7\x7e", "\xc4\x2a\xb5\x35\xa8\x76\x94\x2b", - "\x93\xb3\xff\x81\x65\x4e\xe9\x57\x91\xc8\x66\x82\xdb\x37\x89\x4a", 1, - 64, "\xee\x1a\x14\xe5\x50\x24\x2a\x65\x3f\xd4\x50\x9f", 96 }, + "\x93\xb3\xff\x81\x65\x4e\xe9\x57\x91\xc8\x66\x82\xdb\x37\x89\x4a", 1, 64, + "\xee\x1a\x14\xe5\x50\x24\x2a\x65\x3f\xd4\x50\x9f", 96 }, { 192, 128, 145, "\x9c\x42\x6c\x09\xc0\xa0\xc5\x19\xa5\x54\x84\x1e\xb7\x69\x88\x6a\xa3" "\xd8\x27\x25\xe0\x1b\x25\x05", "\xe6\x56\x80\xb9\xae\xeb\x43\xbb\x41\x44\x90\x08\x00\xf3\xbd", - "\x0f\x39\x2a\x50\xfe\x0f\x18\x3a\xd9\x41\x1a\x61\x65\xd5\x4b\xda", 1, - 120, "\x8f\x64\x41\xff\xb9\x77\xde\x17\x6c\x4f\x53\x36", 96 }, + "\x0f\x39\x2a\x50\xfe\x0f\x18\x3a\xd9\x41\x1a\x61\x65\xd5\x4b\xda", 1, 120, + "\x8f\x64\x41\xff\xb9\x77\xde\x17\x6c\x4f\x53\x36", 96 }, { 192, 128, 146, "\x60\x31\xb3\xa1\x77\xb4\x30\x45\xae\x58\x7f\xfb\x0d\x22\x8b\x04\x14" "\xff\x26\xb7\x20\x6c\x30\xf5", "\xdc\x89\xf1\xdd\x15\xf3\x25\x8b\x7e\x92\x11\x73\x65\x0e\xb9\xba", - "\x68\xa1\x24\x9d\x64\x87\xf4\x6c\x10\x7b\xdb\x84\x17\x27\x1e\x26", 1, - 128, "\x8a\xf8\xef\x74\xbd\x25\x21\xf6\xe7\x11\x95\x0b", 96 }, + "\x68\xa1\x24\x9d\x64\x87\xf4\x6c\x10\x7b\xdb\x84\x17\x27\x1e\x26", 1, 128, + "\x8a\xf8\xef\x74\xbd\x25\x21\xf6\xe7\x11\x95\x0b", 96 }, { 192, 128, 147, "\x36\x42\x89\xec\xcf\xf5\x3e\xfb\x98\xda\x8e\xe4\x37\xd6\xd3\x89\x77" "\x5a\x3c\xf2\xb4\xc9\x70\xcd", "\x66\x47\xb5\xda\x47\xd1\x69\x83\x20\x5c\xe2\x44\x88\x0c\xa6\x05" "\x19", - "\x73\xb9\x8c\x93\x98\xc7\x0a\x83\x3e\x3d\xbe\xf4\x55\x6d\x8f\xa7", 1, - 136, "\x72\x45\xa5\x15\x65\x6a\x22\x36\xc3\x8c\x85\xaa", 96 }, + "\x73\xb9\x8c\x93\x98\xc7\x0a\x83\x3e\x3d\xbe\xf4\x55\x6d\x8f\xa7", 1, 136, + "\x72\x45\xa5\x15\x65\x6a\x22\x36\xc3\x8c\x85\xaa", 96 }, { 192, 128, 148, "\x4c\x41\xb2\xfe\x3e\x60\xbc\xe3\xa9\x45\xe2\xfa\xcd\x97\x54\xc4\xf6" "\x0b\x19\x2d\xa1\xfe\x11\x0e", "\x11\xc1\x07\xe4\xb3\x02\xfd\x91\xea\x92\x19\xd7\xfc\x00\x79\xe8\xac" "\x4b\xdc\xfc\x71\xff\x02\x7a", - "\xfa\xcd\x4d\x12\xdf\xaf\xd6\xbd\x1f\x42\x1a\x5c\x4c\x62\x17\xac", 1, - 192, "\x4a\xb5\x1f\xc4\x59\xe4\xf4\xa5\xb4\x4d\xcf\xa3", 96 }, + "\xfa\xcd\x4d\x12\xdf\xaf\xd6\xbd\x1f\x42\x1a\x5c\x4c\x62\x17\xac", 1, 192, + "\x4a\xb5\x1f\xc4\x59\xe4\xf4\xa5\xb4\x4d\xcf\xa3", 96 }, { 192, 128, 149, "\x22\x61\x96\x23\x65\xe2\xeb\x22\xe1\x20\x02\xe0\x53\x95\x0b\x14\x29" "\x53\xa6\xce\x60\x2d\x19\x59", @@ -1008,8 +722,8 @@ const struct mac_test gmac_test_json[] = { "\x3e\x57\xc2\xb9\x96\x8a\x64\xcf\x56\xde\x90\xcb\xac\x6b\x85\xb9\x67" "\x92\x96\xa3\x09\x7d\xfc\x76\xfb\xfd\x67\xcb\xc3\x37\x69\x7f\x93\x15" "\xc2\x3f\xe0\xa4\xc0\xd4\x4d\x79\xc4\x73", - "\x54\xb1\x0f\x53\xa3\x04\xfd\x1b\xee\x6f\x9f\xb2\x46\xca\x40\xef", 1, - 1032, "\x35\xcb\xde\x01\xe0\x7a\x10\xda\x05\xba\x2a\x34", 96 }, + "\x54\xb1\x0f\x53\xa3\x04\xfd\x1b\xee\x6f\x9f\xb2\x46\xca\x40\xef", 1, 1032, + "\x35\xcb\xde\x01\xe0\x7a\x10\xda\x05\xba\x2a\x34", 96 }, { 192, 128, 150, "\x5a\x94\x6c\x7e\x78\xad\x42\x7e\x00\xbc\x52\x91\x7f\xd2\x7f\x00\x9c" "\x98\x7a\x87\x1b\x22\xf6\xf8", @@ -1029,8 +743,8 @@ const struct mac_test gmac_test_json[] = { "\xf7\xbd\x73\x6b\x50\x27\x56\x5c\x1e\xb9\x8e\x54\xd9\xf0\x0b\x34\xc8" "\xf3\x89\x62\x6f\x83\xda\x9f\xfb\x9f\xd0\xfd\x48\x45\xab\x58\x41\x56" "\x37", - "\x5a\x79\xd3\x22\x8c\x67\x30\x5d\xfc\xf1\x5d\x68\xae\x03\x28\x60", 1, - 2048, "\xbf\x96\x93\x96\x00\x66\x0e\x86\x25\x42\x03\x62", 96 }, + "\x5a\x79\xd3\x22\x8c\x67\x30\x5d\xfc\xf1\x5d\x68\xae\x03\x28\x60", 1, 2048, + "\xbf\x96\x93\x96\x00\x66\x0e\x86\x25\x42\x03\x62", 96 }, { 192, 128, 151, "\x57\xc0\x7c\x71\xe6\x13\x61\xa2\xe7\x5a\xf1\x84\x82\xd9\xbd\xe5\x83" "\xff\x2b\x09\xb5\xc1\xda\x77", @@ -1051,424 +765,402 @@ const struct mac_test gmac_test_json[] = { "\x30\x87\x49\x4e\xad\xaa\xdb\x0b\x61\x98\x19\x4e\x1f\x5a\x5d\x9b\xcf" "\x1d\xe6\x08\xa5\x3f\x42\x2b\xae\x1a\x40\xc9\xa6\x6d\xfb\x47\xc2\x6e" "\xfa\x85\xb8\x46\xa2", - "\x8f\x13\x64\xd1\xd9\xe5\x82\x6a\x79\x25\x4c\xa6\x02\xbb\x1e\x4c", 1, - 2216, "\x7c\xc9\x7a\x3e\x4f\x65\x71\xae\xdd\x69\xee\x95", 96 }, + "\x8f\x13\x64\xd1\xd9\xe5\x82\x6a\x79\x25\x4c\xa6\x02\xbb\x1e\x4c", 1, 2216, + "\x7c\xc9\x7a\x3e\x4f\x65\x71\xae\xdd\x69\xee\x95", 96 }, { 192, 128, 152, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x35\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x35\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 153, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8d\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8d\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 154, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x36\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x36\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 155, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8e\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8e\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 156, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xb4\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xb4\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 157, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x0c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 158, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xec\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xec\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 159, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x76\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x76\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 160, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x98\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x98\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 161, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\x45\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\x45\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 162, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x01\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x01\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 163, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x57\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x57\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 164, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x02\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x02\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 165, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x54\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x54\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 166, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x8f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x8f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 167, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\x3e\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\x3e\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 168, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x10\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x10\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 169, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2a\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2a\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 170, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x91\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x91\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 171, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\xab\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\xab\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 172, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x34\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x34\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 173, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xfc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xfc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 174, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbd\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbd\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 175, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5b\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5b\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 176, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe2\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe2\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 177, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xce\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xce\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 178, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe1\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe1\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 179, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcd\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcd\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 180, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\x63\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\x63\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 181, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\x4f\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\x4f\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 182, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x76", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x76", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 183, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7e", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7e", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 184, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x75", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x75", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 185, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7d", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7d", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 186, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x37", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\x37", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 187, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x3f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\x3f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 188, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\xf7", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x0f\x11\x14\xbc\xd4\xe3\x4b\xab\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 189, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\xff", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\xbe\x2b\xdc\x5a\x8f\xcf\xc9\x38\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 190, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x35\xed\x91\x18\x00\xfd\xfa\x0f\x10\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x35\xed\x91\x18\x00\xfd\xfa\x0f\x10\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 191, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8d\x77\x1d\xc5\x56\x3b\x63\xbe\x2a\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8d\x77\x1d\xc5\x56\x3b\x63\xbe\x2a\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 192, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x98\x00\xfd\xfa\x8f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x98\x00\xfd\xfa\x8f\x11\x14\xbc\xd4\xe3\x4b\xab\x77", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 193, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\x45\x56\x3b\x63\x3e\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\x45\x56\x3b\x63\x3e\x2b\xdc\x5a\x8f\xcf\xc9\x38\x7f", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 194, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x34\xed\x91\x18\x00\xfd\xfa\x8f\x11\x14\xbc\xd4\xe3\x4b\xab\xf7", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x34\xed\x91\x18\x00\xfd\xfa\x8f\x11\x14\xbc\xd4\xe3\x4b\xab\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 195, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8c\x77\x1d\xc5\x56\x3b\x63\x3e\x2b\xdc\x5a\x8f\xcf\xc9\x38\xff", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8c\x77\x1d\xc5\x56\x3b\x63\x3e\x2b\xdc\x5a\x8f\xcf\xc9\x38\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 196, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xcb\x12\x6e\xe7\xff\x02\x05\xf0\xee\xeb\x43\x2b\x1c\xb4\x54\x88", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xcb\x12\x6e\xe7\xff\x02\x05\xf0\xee\xeb\x43\x2b\x1c\xb4\x54\x88", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 197, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x73\x88\xe2\x3a\xa9\xc4\x9c\x41\xd4\x23\xa5\x70\x30\x36\xc7\x80", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x73\x88\xe2\x3a\xa9\xc4\x9c\x41\xd4\x23\xa5\x70\x30\x36\xc7\x80", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 198, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 199, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 200, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 201, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 202, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xb4\x6d\x11\x98\x80\x7d\x7a\x8f\x91\x94\x3c\x54\x63\xcb\x2b\xf7", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xb4\x6d\x11\x98\x80\x7d\x7a\x8f\x91\x94\x3c\x54\x63\xcb\x2b\xf7", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 203, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0c\xf7\x9d\x45\xd6\xbb\xe3\x3e\xab\x5c\xda\x0f\x4f\x49\xb8\xff", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x0c\xf7\x9d\x45\xd6\xbb\xe3\x3e\xab\x5c\xda\x0f\x4f\x49\xb8\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 204, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x35\xec\x90\x19\x01\xfc\xfb\x0e\x10\x15\xbd\xd5\xe2\x4a\xaa\x76", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x35\xec\x90\x19\x01\xfc\xfb\x0e\x10\x15\xbd\xd5\xe2\x4a\xaa\x76", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 205, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8d\x76\x1c\xc4\x57\x3a\x62\xbf\x2a\xdd\x5b\x8e\xce\xc8\x39\x7e", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x8d\x76\x1c\xc4\x57\x3a\x62\xbf\x2a\xdd\x5b\x8e\xce\xc8\x39\x7e", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 192, 128, 206, "\x17\x5b\x5a\x75\xe4\xfd\x7f\x9c\x1f\x99\x77\x81\xb9\x76\xa7\x2a\x01" "\x0d\x69\x55\x9a\xbb\x0d\x1e", "\xfc\xcc\x74\x87\xa8\xae\x2a\x85\xf6\x05\x5f\x02\x11\xa7\x3d\x0b", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 128, "\x55\x0e\x0a\x2d\x5c\xb9\x87\xba\xf4\xb9\xc3\x24", 96 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + "\x55\x0e\x0a\x2d\x5c\xb9\x87\xba\xf4\xb9\xc3\x24", 96 }, { 192, 128, 207, "\x17\x5b\x5a\x75\xe4\xfd\x7f\x9c\x1f\x99\x77\x81\xb9\x76\xa7\x2a\x01" "\x0d\x69\x55\x9a\xbb\x0d\x1e", "\xc2\xeb\xff\x3f\x88\xc5\xd3\x7f\x41\x80\x02\x11\xd2\xbc\x60\xdd", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 128, "\x55\x0e\x0a\x2d\x5c\xb9\x87\xba\xf4\xb9\xc3\x24", 96 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, + "\x55\x0e\x0a\x2d\x5c\xb9\x87\xba\xf4\xb9\xc3\x24", 96 }, { 192, 128, 208, "\x9f\x93\x4f\xa4\xd1\xf3\xcc\xa7\x44\xc8\x1c\x87\x93\x72\x45\xd7\x20" "\x76\x25\xb6\xb2\xac\x3d\x84", - "", - "\x9c\x04\x53\x1b\xce\xaf\x43\x8d\xc1\x34\x2f\x3c\x5f\x7f\x62\xb8", 1, - 0, "\x19\x12\x4f\xf0\x81\x47\x17\xab\xea\xa2\xe1\xfc\x9f\xc8\x86\xed", - 128 }, + "", "\x9c\x04\x53\x1b\xce\xaf\x43\x8d\xc1\x34\x2f\x3c\x5f\x7f\x62\xb8", 1, 0, + "\x19\x12\x4f\xf0\x81\x47\x17\xab\xea\xa2\xe1\xfc\x9f\xc8\x86\xed", 128 }, { 192, 128, 209, "\x0a\xe0\xba\x46\x74\xc5\xc6\x85\x35\x4e\x24\x1b\xc8\x60\x34\xcb\xef" "\x80\xf8\x8a\xcf\x1f\x74\x88", - "\xc7", - "\xf2\xf5\xcd\xa5\x95\xfb\x7d\x7b\x0a\x7d\x69\x9b\x6a\xbc\x7f\x52", 1, - 8, "\x08\x32\x66\xeb\xda\x2b\x3d\xb8\xb1\x4c\x23\x5e\xb2\x97\x59\x88", - 128 }, + "\xc7", "\xf2\xf5\xcd\xa5\x95\xfb\x7d\x7b\x0a\x7d\x69\x9b\x6a\xbc\x7f\x52", 1, 8, + "\x08\x32\x66\xeb\xda\x2b\x3d\xb8\xb1\x4c\x23\x5e\xb2\x97\x59\x88", 128 }, { 192, 128, 210, "\x9f\x47\x9e\x91\x18\xe5\x60\x3b\xf1\x22\xfc\x5e\x2b\x8b\xf3\xe4\x48" "\xac\xb9\xfb\xde\x5e\x16\xdc", - "\x96\xaf", - "\x25\xfc\x87\x7b\xc2\xfd\x80\x04\x92\x84\x33\x16\xa0\x9b\x55\x82", 1, - 16, - "\xd2\x64\x27\xfc\xa9\xc8\xe1\x71\x7a\xcd\x34\xad\x3c\xc5\xd5\x42", - 128 }, + "\x96\xaf", "\x25\xfc\x87\x7b\xc2\xfd\x80\x04\x92\x84\x33\x16\xa0\x9b\x55\x82", 1, 16, + "\xd2\x64\x27\xfc\xa9\xc8\xe1\x71\x7a\xcd\x34\xad\x3c\xc5\xd5\x42", 128 }, { 192, 128, 211, "\x41\x9a\x56\xe8\xf4\x1f\x33\x7d\xee\x4a\x63\xed\x38\x6a\x8e\xd7\xe8" "\x5b\x25\x96\x44\x94\xb0\x75", - "\x8a\x3d\xc8\xad", - "\x3d\x13\x1a\xa1\x25\x38\xc6\x33\x22\x83\x2e\xfb\xc8\x35\x13\xdf", 1, - 32, - "\xab\x25\x03\x31\x65\xc6\xcf\x97\x60\xd1\xa5\xa4\x43\x91\xe7\x7a", - 128 }, + "\x8a\x3d\xc8\xad", "\x3d\x13\x1a\xa1\x25\x38\xc6\x33\x22\x83\x2e\xfb\xc8\x35\x13\xdf", 1, + 32, "\xab\x25\x03\x31\x65\xc6\xcf\x97\x60\xd1\xa5\xa4\x43\x91\xe7\x7a", 128 }, { 192, 128, 212, "\xee\xc6\x72\xd9\xe7\xb9\xbd\x93\x3e\x5e\xe3\x6a\xe3\x81\xe6\x5b\x87" "\x2a\xc8\x37\x3c\x3e\x56\x78", "\x80\x9d\xe8\xdb\xe2\x81\x47", - "\xb6\xb7\x69\xa1\x1d\x31\x9c\xb2\x2b\xe9\x2f\x1d\x33\xad\x8c\x4c", 1, - 56, - "\x51\xe0\x64\x2b\x8e\x49\x45\x81\xdd\x04\xc5\xb1\x6b\xd8\x8b\x89", - 128 }, + "\xb6\xb7\x69\xa1\x1d\x31\x9c\xb2\x2b\xe9\x2f\x1d\x33\xad\x8c\x4c", 1, 56, + "\x51\xe0\x64\x2b\x8e\x49\x45\x81\xdd\x04\xc5\xb1\x6b\xd8\x8b\x89", 128 }, { 192, 128, 213, "\x41\x5c\x12\xb7\x84\x05\xdc\x19\x16\xb9\xf6\x5c\xc1\xd9\x60\xb6\x41" "\x06\x2a\xb5\x89\x26\x09\x9a", "\xb5\xde\x1b\x30\xf7\x22\x9f\x1d", - "\x2d\x71\x22\xb7\x4f\xeb\xd2\xe5\x7b\xd7\xe1\xc0\xcc\xf7\x22\x9f", 1, - 64, - "\x80\xd3\x37\x0f\x38\xc8\xd9\xc6\x74\x16\x05\x00\xa3\x36\x27\xf3", - 128 }, + "\x2d\x71\x22\xb7\x4f\xeb\xd2\xe5\x7b\xd7\xe1\xc0\xcc\xf7\x22\x9f", 1, 64, + "\x80\xd3\x37\x0f\x38\xc8\xd9\xc6\x74\x16\x05\x00\xa3\x36\x27\xf3", 128 }, { 192, 128, 214, "\x8c\xf2\x66\x62\x23\x06\x0e\x2a\xde\xce\x28\x96\x9a\x8d\x88\x9e\xce" "\x7f\xe3\x2c\x0a\xe3\xb9\xc6", "\xfb\xfd\x57\x3c\x9f\x12\x14\xf7\xc6\x50\xbc\xf5\xe7\x2b\xac", - "\xbd\x53\xa4\xc7\xda\xa8\xd0\x8e\xe1\x01\xca\xc5\x86\x1c\x7f\xf9", 1, - 120, - "\xcf\x0b\xd9\xd8\x76\x7a\x3e\xae\x62\x15\xaf\x33\xb7\x21\x0f\x99", - 128 }, + "\xbd\x53\xa4\xc7\xda\xa8\xd0\x8e\xe1\x01\xca\xc5\x86\x1c\x7f\xf9", 1, 120, + "\xcf\x0b\xd9\xd8\x76\x7a\x3e\xae\x62\x15\xaf\x33\xb7\x21\x0f\x99", 128 }, { 192, 128, 215, "\x90\xd1\x19\x6f\xf0\x04\xc2\xc1\x84\xe6\x9f\xbe\x4c\x51\x2a\xfe\x5d" "\xd5\x30\x60\xd0\xaa\x29\xee", "\xe0\x3b\xa4\xce\x91\xba\xc7\x71\x50\xda\x73\x11\x25\xb4\x63\x4e", - "\xae\xc2\x77\x21\xe0\xe5\x51\x30\x75\xa6\x89\x53\xcc\x97\xca\xb1", 1, - 128, - "\xb1\x65\x71\x49\x8f\x84\x36\x8f\x1c\x24\xb6\x31\x78\xb8\x8a\x5b", - 128 }, + "\xae\xc2\x77\x21\xe0\xe5\x51\x30\x75\xa6\x89\x53\xcc\x97\xca\xb1", 1, 128, + "\xb1\x65\x71\x49\x8f\x84\x36\x8f\x1c\x24\xb6\x31\x78\xb8\x8a\x5b", 128 }, { 192, 128, 216, "\x2f\x08\x4b\x35\x67\xbe\xca\xf9\x1d\x1a\x9a\x39\x1a\xac\x5e\x45\x76" "\xf9\x03\x4e\x4a\x11\x5f\x8c", "\x8f\x86\x08\x47\xf1\x8d\x38\x7b\x64\x66\x1c\xec\x46\x20\x8c\x70" "\x50", - "\x28\x3b\x96\x34\x4c\x2d\xe9\x37\xf4\xa7\x27\x9a\x65\x98\xe6\xbd", 1, - 136, - "\x82\x5e\x71\x3c\x0b\xcb\xe7\x89\x2d\x61\x7d\xe7\x98\xab\x9b\xd9", - 128 }, + "\x28\x3b\x96\x34\x4c\x2d\xe9\x37\xf4\xa7\x27\x9a\x65\x98\xe6\xbd", 1, 136, + "\x82\x5e\x71\x3c\x0b\xcb\xe7\x89\x2d\x61\x7d\xe7\x98\xab\x9b\xd9", 128 }, { 192, 128, 217, "\xe4\xdb\x14\xa3\xfc\xdb\x48\xfa\x98\x49\xf0\x3b\xf5\x2a\x4b\x44\xd3" "\x9e\x9e\x6b\x33\x97\xdb\x59", "\xd7\xd6\x63\x79\x83\x17\x60\x3e\x56\xbc\x8b\x22\xfc\xec\x7a\xf3\xa6" "\xc1\x5a\x87\x92\x68\xcb\xc7", - "\x73\xc9\x5c\x43\x0d\x20\x7c\x1b\x53\x32\x68\x65\xb7\x98\x0c\x04", 1, - 192, - "\x5d\x53\x8b\x3a\xc4\x1f\xcf\xc5\x60\x65\xe3\xfa\x75\xc5\x33\x85", - 128 }, + "\x73\xc9\x5c\x43\x0d\x20\x7c\x1b\x53\x32\x68\x65\xb7\x98\x0c\x04", 1, 192, + "\x5d\x53\x8b\x3a\xc4\x1f\xcf\xc5\x60\x65\xe3\xfa\x75\xc5\x33\x85", 128 }, { 192, 128, 218, "\xa1\x4e\x5d\x0b\x28\x23\xed\x9e\x3a\x19\x1a\x3f\x89\x60\x05\xd9\xbf" "\x18\x65\x19\xdb\xb2\x61\xb5", @@ -1480,10 +1172,8 @@ const struct mac_test gmac_test_json[] = { "\x4c\x94\xd2\x00\x5b\x5f\xa3\x2e\x47\xc5\x0e\x9f\x91\x4f\x08\x4e\xec" "\x58\xf6\xe1\x08\xa9\xde\x3c\x29\xcc\xe5\xd9\x29\x80\xf4\xf4\x91\x1f" "\xc0\x0e\x96\x13\xb2\x63\xcc\xa8\xa5\x97", - "\x8a\xdb\x4c\x0c\x1d\xc1\x5e\xcb\xf6\x6b\x43\x1a\x03\x0e\xc5\x14", 1, - 1032, - "\x6d\xac\xfb\x15\xf7\xe6\xfb\x26\xe4\x23\xc0\xee\x05\xf6\x86\xba", - 128 }, + "\x8a\xdb\x4c\x0c\x1d\xc1\x5e\xcb\xf6\x6b\x43\x1a\x03\x0e\xc5\x14", 1, 1032, + "\x6d\xac\xfb\x15\xf7\xe6\xfb\x26\xe4\x23\xc0\xee\x05\xf6\x86\xba", 128 }, { 192, 128, 219, "\x0c\xf9\x1c\xfd\xf3\xb0\x64\x58\x1d\xd0\x15\x34\xa3\x04\x29\x67\x74" "\xc1\x7b\xa3\x0c\x5e\xa4\xee", @@ -1503,10 +1193,8 @@ const struct mac_test gmac_test_json[] = { "\xdc\xff\x3e\xeb\x3b\x99\xbd\x81\x81\xb4\x0e\x7c\xec\x75\x28\xbd\x48" "\x73\xe4\x27\xbb\x67\xc8\xfa\x8b\xc5\xf4\x7e\xba\x7e\x55\xc9\x05\xe2" "\x24", - "\xd5\xe0\x9f\x52\x98\x6b\x33\xaf\x35\x77\xe9\x75\xdd\x9a\x90\x16", 1, - 2048, - "\xa9\x8d\x89\x33\x2c\x05\xb1\x3d\xb1\x87\x48\x48\x11\x19\x8a\xb9", - 128 }, + "\xd5\xe0\x9f\x52\x98\x6b\x33\xaf\x35\x77\xe9\x75\xdd\x9a\x90\x16", 1, 2048, + "\xa9\x8d\x89\x33\x2c\x05\xb1\x3d\xb1\x87\x48\x48\x11\x19\x8a\xb9", 128 }, { 192, 128, 220, "\x93\xce\xcc\xe9\x6d\x37\x40\x62\x86\xa8\x81\xdb\x0d\x0d\x53\xce\x8f" "\x7b\xf5\x3f\x4b\xdc\x74\x6a", @@ -1527,520 +1215,402 @@ const struct mac_test gmac_test_json[] = { "\x93\xf8\x44\x09\x81\x69\x3b\x62\x5b\x30\x82\xe2\xba\x89\x8d\xcc\x79" "\x23\xa6\x0c\x8d\x95\x3c\xb3\x9f\xa5\xcb\xdd\x42\xea\xb1\x37\x33\x26" "\x12\x33\x8c\xe2\x0d", - "\x66\x0b\x84\x72\x7a\x22\x9e\x09\x22\xb5\x61\xe8\xd0\xdd\xbd\x5e", 1, - 2216, - "\xbf\x13\x68\xbb\x09\x37\x3b\x1e\x0e\xed\x89\xee\xea\x93\x21\xc1", - 128 }, + "\x66\x0b\x84\x72\x7a\x22\x9e\x09\x22\xb5\x61\xe8\xd0\xdd\xbd\x5e", 1, 2216, + "\xbf\x13\x68\xbb\x09\x37\x3b\x1e\x0e\xed\x89\xee\xea\x93\x21\xc1", 128 }, { 192, 128, 221, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa0\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa0\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 222, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x18\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x18\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 223, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa3\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa3\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 224, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x1b\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x1b\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 225, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x21\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x21\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 226, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x99\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x99\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 227, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1c\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1c\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 228, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x86\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x86\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 229, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x1a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x1a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 230, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\xc7\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\xc7\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 231, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x87\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x87\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 232, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd1\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd1\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 233, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x84\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x84\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 234, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd2\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd2\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 235, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\xfe\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\xfe\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 236, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\x4f\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\x4f\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 237, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbe\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbe\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 238, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x84\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x84\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 239, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\x3f\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\x3f\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 240, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x05\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x05\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 241, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x3c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x3c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 242, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xf4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xf4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 243, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb2\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb2\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 244, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x54\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x54\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 245, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf5\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf5\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 246, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd9\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd9\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 247, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf6\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf6\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 248, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xda\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xda\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 249, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\x74\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\x74\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 250, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\x58\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\x58\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 251, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x92", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x92", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 252, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9a", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x9a", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 253, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x91", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x91", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 254, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x99", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x99", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 255, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\xd3", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\xd3", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 256, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\xdb", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\xdb", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 257, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x13", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\x7e\xbf\x1c\xb3\x87\xf4\xcf\xdc\x13", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 258, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\xcf\x85\xd4\x55\xdc\xd8\x4d\x4f\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 259, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa0\x1d\xa3\x9a\x86\xf6\x46\x7e\xbe\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa0\x1d\xa3\x9a\x86\xf6\x46\x7e\xbe\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 260, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x18\x87\x2f\x47\xd0\x30\xdf\xcf\x84\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x18\x87\x2f\x47\xd0\x30\xdf\xcf\x84\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 261, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x1a\x86\xf6\x46\xfe\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x1a\x86\xf6\x46\xfe\xbf\x1c\xb3\x87\xf4\xcf\xdc\x93", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 262, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\xc7\xd0\x30\xdf\x4f\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\xc7\xd0\x30\xdf\x4f\x85\xd4\x55\xdc\xd8\x4d\x4f\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 263, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa1\x1d\xa3\x9a\x86\xf6\x46\xfe\xbf\x1c\xb3\x87\xf4\xcf\xdc\x13", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa1\x1d\xa3\x9a\x86\xf6\x46\xfe\xbf\x1c\xb3\x87\xf4\xcf\xdc\x13", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 264, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x19\x87\x2f\x47\xd0\x30\xdf\x4f\x85\xd4\x55\xdc\xd8\x4d\x4f\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x19\x87\x2f\x47\xd0\x30\xdf\x4f\x85\xd4\x55\xdc\xd8\x4d\x4f\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 265, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x5e\xe2\x5c\x65\x79\x09\xb9\x81\x40\xe3\x4c\x78\x0b\x30\x23\x6c", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x5e\xe2\x5c\x65\x79\x09\xb9\x81\x40\xe3\x4c\x78\x0b\x30\x23\x6c", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 266, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xe6\x78\xd0\xb8\x2f\xcf\x20\x30\x7a\x2b\xaa\x23\x27\xb2\xb0\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xe6\x78\xd0\xb8\x2f\xcf\x20\x30\x7a\x2b\xaa\x23\x27\xb2\xb0\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 267, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 268, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 269, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 270, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 271, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x21\x9d\x23\x1a\x06\x76\xc6\xfe\x3f\x9c\x33\x07\x74\x4f\x5c\x13", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x21\x9d\x23\x1a\x06\x76\xc6\xfe\x3f\x9c\x33\x07\x74\x4f\x5c\x13", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 272, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x99\x07\xaf\xc7\x50\xb0\x5f\x4f\x05\x54\xd5\x5c\x58\xcd\xcf\x1b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x99\x07\xaf\xc7\x50\xb0\x5f\x4f\x05\x54\xd5\x5c\x58\xcd\xcf\x1b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 273, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa0\x1c\xa2\x9b\x87\xf7\x47\x7f\xbe\x1d\xb2\x86\xf5\xce\xdd\x92", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xa0\x1c\xa2\x9b\x87\xf7\x47\x7f\xbe\x1d\xb2\x86\xf5\xce\xdd\x92", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 274, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x18\x86\x2e\x46\xd1\x31\xde\xce\x84\xd5\x54\xdd\xd9\x4c\x4e\x9a", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x18\x86\x2e\x46\xd1\x31\xde\xce\x84\xd5\x54\xdd\xd9\x4c\x4e\x9a", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 192, 128, 275, "\xdf\x23\xcd\x79\x69\x38\x87\x21\x43\x7b\xa1\x3d\x56\x2a\xc4\x59\x39" "\x2a\x8f\xb8\x8f\x51\x92\x5e", "\x3c\x11\x58\x1c\x4b\x96\x64\x92\x6d\x77\xe1\xa7\xd1\x87\xb0\x0a", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 128, - "\x73\x5c\xdb\x81\xfb\xbd\x61\x72\xcb\x7f\xc0\xca\xe1\x3b\x7a\xc9", - 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + "\x73\x5c\xdb\x81\xfb\xbd\x61\x72\xcb\x7f\xc0\xca\xe1\x3b\x7a\xc9", 128 }, { 192, 128, 276, "\xdf\x23\xcd\x79\x69\x38\x87\x21\x43\x7b\xa1\x3d\x56\x2a\xc4\x59\x39" "\x2a\x8f\xb8\x8f\x51\x92\x5e", "\x69\x58\xfb\xba\x11\x73\xef\xad\x3c\x90\x03\xba\xae\x27\x8d\x3d", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 128, - "\x73\x5c\xdb\x81\xfb\xbd\x61\x72\xcb\x7f\xc0\xca\xe1\x3b\x7a\xc9", - 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, + "\x73\x5c\xdb\x81\xfb\xbd\x61\x72\xcb\x7f\xc0\xca\xe1\x3b\x7a\xc9", 128 }, { 256, 128, 277, "\xd7\x96\xa0\x5c\xef\x10\x9d\x0e\xf3\xa8\x11\x07\xa1\x1b\xd3\x69\x15" "\x93\xc1\x1a\x0c\x98\xeb\x4d\x31\xad\x91\x3b\x1e\x4e\x93\xbe", - "", - "\x75\xb0\x98\xb6\x02\x51\x55\xfd\x69\x9e\x66\x90\x8c\x40\x01\x56", 1, - 0, "\x36\xdc\x70\x0a\xbd\x99\xd9\x9d\x8f\x5b\xc0\xce", 96 }, + "", "\x75\xb0\x98\xb6\x02\x51\x55\xfd\x69\x9e\x66\x90\x8c\x40\x01\x56", 1, 0, + "\x36\xdc\x70\x0a\xbd\x99\xd9\x9d\x8f\x5b\xc0\xce", 96 }, { 256, 128, 278, "\x31\xe3\x9f\x00\x79\xa1\x82\xc9\xb2\xba\x38\xb8\xbc\xc4\x85\x18\xa2" "\xdf\xf1\xdf\x88\x52\x85\xfc\x05\x42\xf8\x3b\x25\x5a\x52\x0c", - "\x45", - "\x1e\xe0\x76\xf7\x08\xe6\x4c\xc5\x5c\x71\xd8\x63\x3e\xc2\x92\x31", 1, - 8, "\x2c\xc7\x45\x9f\xa6\xa5\x3f\x8c\x9a\xf1\x41\x54", 96 }, + "\x45", "\x1e\xe0\x76\xf7\x08\xe6\x4c\xc5\x5c\x71\xd8\x63\x3e\xc2\x92\x31", 1, 8, + "\x2c\xc7\x45\x9f\xa6\xa5\x3f\x8c\x9a\xf1\x41\x54", 96 }, { 256, 128, 279, "\xcc\xa7\x77\xcf\x57\x59\x24\x60\x27\xd6\xe4\xc7\x3b\xaf\x3d\xb9\xb9" "\xd8\x34\xc3\x70\x32\x03\x57\xd1\x69\xe5\x31\x93\x60\x61\xf4", - "\xc0\x0b", - "\xeb\xe4\xe5\x69\x51\xe1\xef\x7c\x72\x1f\x42\x9e\xec\x78\xc1\x5e", 1, - 16, "\x5b\x48\x47\xb7\x7b\xab\x2a\x6e\x54\x60\xda\x65", 96 }, + "\xc0\x0b", "\xeb\xe4\xe5\x69\x51\xe1\xef\x7c\x72\x1f\x42\x9e\xec\x78\xc1\x5e", 1, 16, + "\x5b\x48\x47\xb7\x7b\xab\x2a\x6e\x54\x60\xda\x65", 96 }, { 256, 128, 280, "\xa2\x91\x2f\xfd\x04\xdd\x0c\x12\xf9\xb1\x44\x31\x9a\x46\x5a\xf5\x72" "\xb4\xbe\x8a\xa0\x91\x6b\xaa\xa6\xed\xb9\x62\x05\xee\x8b\xb1", - "\xff\xc2\xfd\x8c", - "\x2d\x8b\x37\x38\x32\xd0\x29\x3f\x10\x37\x40\x9f\x6a\xd0\xc4\xf1", 1, + "\xff\xc2\xfd\x8c", "\x2d\x8b\x37\x38\x32\xd0\x29\x3f\x10\x37\x40\x9f\x6a\xd0\xc4\xf1", 1, 32, "\xac\x26\xc6\xc0\x1e\xc2\xdf\x59\x07\xb7\x1a\xf2", 96 }, { 256, 128, 281, "\x45\x76\xc1\xe2\x47\x0b\x55\x7f\x85\xae\x2d\xef\xc0\x78\xcb\x9e\xea" "\xc5\x2b\x32\x35\x13\x7f\x8b\xce\xfd\x9c\x11\x6b\x80\x4d\x2c", "\x4e\x28\x4a\xb6\xf6\xe4\x9b", - "\xeb\x91\x0a\xfe\xc0\x79\xb3\xda\x46\x01\xfe\x6c\x9d\xe3\x29\x69", 1, - 56, "\x20\xd2\x9d\xd5\x28\xb2\x6a\x71\x6b\x11\x22\xd4", 96 }, + "\xeb\x91\x0a\xfe\xc0\x79\xb3\xda\x46\x01\xfe\x6c\x9d\xe3\x29\x69", 1, 56, + "\x20\xd2\x9d\xd5\x28\xb2\x6a\x71\x6b\x11\x22\xd4", 96 }, { 256, 128, 282, "\xbe\x85\x5e\x5f\x44\x77\xa5\xf0\x6e\x64\xe9\x69\xcf\x0f\x7a\xad\x23" "\x99\xd1\x0a\xc6\x30\x1b\xd2\x96\x18\xb5\x30\x31\x53\x04\xaa", "\xb3\x5e\xa0\x0e\x01\xf3\x04\x38", - "\xba\xdb\xcd\xfb\x66\xe6\x8b\x94\x9b\xcb\x31\x4b\x36\x7c\x82\xcf", 1, - 64, "\x1d\xc8\xf6\xcb\xa3\x82\x8c\xb8\x86\x2e\xa9\x0d", 96 }, + "\xba\xdb\xcd\xfb\x66\xe6\x8b\x94\x9b\xcb\x31\x4b\x36\x7c\x82\xcf", 1, 64, + "\x1d\xc8\xf6\xcb\xa3\x82\x8c\xb8\x86\x2e\xa9\x0d", 96 }, { 256, 128, 283, "\x30\xf1\x06\x09\xfc\xf8\xae\x39\x8f\xa5\x0f\xb2\x80\x7e\x0b\x60\x5f" "\xe1\xf5\x96\x2f\x7c\xd7\xd6\x63\xfa\x2c\x50\xbb\x0e\xd5\x37", "\xc6\x6f\x86\xfb\xee\x5e\xda\x6a\x0a\xc4\xf6\x4d\x7e\xf4\xb8", - "\xb7\xe5\xec\xd2\x35\xa4\x06\x15\x2e\xdd\x49\x09\xf1\x63\x52\x06", 1, - 120, "\xf2\x51\x34\x5f\x80\x11\xb4\xf7\xfd\xd5\x9a\xa2", 96 }, + "\xb7\xe5\xec\xd2\x35\xa4\x06\x15\x2e\xdd\x49\x09\xf1\x63\x52\x06", 1, 120, + "\xf2\x51\x34\x5f\x80\x11\xb4\xf7\xfd\xd5\x9a\xa2", 96 }, { 256, 128, 284, "\xb5\xca\x16\x87\x71\x37\xe3\x59\x5d\x05\x60\x01\xb1\x82\xeb\x16\x51" "\xe4\xae\x6a\xf0\x80\xce\x7e\xe0\xa0\xc5\x65\x1a\x09\x46\x03", "\xea\x94\xe0\x62\xb1\x0e\x5d\xfd\x2e\xa9\x93\xcb\x6a\x10\x3d\x98", - "\x21\x43\x9f\xb4\x07\x24\x7a\xc0\xa9\x8a\x30\x2d\x6c\xff\x4b\x0f", 1, - 128, "\x1f\xc2\x12\x8c\xf2\x47\xfe\xcb\x74\x68\x59\xfc", 96 }, + "\x21\x43\x9f\xb4\x07\x24\x7a\xc0\xa9\x8a\x30\x2d\x6c\xff\x4b\x0f", 1, 128, + "\x1f\xc2\x12\x8c\xf2\x47\xfe\xcb\x74\x68\x59\xfc", 96 }, { 256, 128, 285, "\xb5\x68\x42\x55\x46\x3e\x57\x88\xbe\xc2\xd7\x5c\x8c\x46\x3a\x65\x8c" "\x79\x42\x8d\x49\xfb\x2a\xf5\xf1\x25\x6c\x6b\xb1\x71\x1f\x33", "\x32\x9f\x30\x4b\x5d\x32\xe4\x81\x86\x82\x23\x06\xd6\x64\x1c\x09" "\x0a", - "\xff\x54\xec\xd2\x6a\xa9\x4a\xac\xd6\xd9\x2b\xd9\xf6\x32\x3f\xf9", 1, - 136, "\x93\x88\xc4\xbf\x74\x15\x7c\x59\x01\x80\xe0\xc1", 96 }, + "\xff\x54\xec\xd2\x6a\xa9\x4a\xac\xd6\xd9\x2b\xd9\xf6\x32\x3f\xf9", 1, 136, + "\x93\x88\xc4\xbf\x74\x15\x7c\x59\x01\x80\xe0\xc1", 96 }, { 256, 128, 286, "\x76\x07\x4f\xef\xee\x14\x8c\xd8\x87\x3d\x23\x51\x17\x5b\x8f\x0b\x46" "\xba\x38\x81\xf0\x7d\x5b\xd7\xe6\x7a\x65\x9e\x01\x83\x0a\x40", "\x8c\x03\x37\xfc\x94\x01\xe6\xa5\x8e\x40\x8a\x11\xdf\xf5\x7a\xb2\xdd" "\xc1\x7c\x16\x82\x77\x8f\xa9", - "\x36\x86\xf1\xf8\xc1\x8a\x94\x4c\xb9\x70\xf0\x89\xc9\x39\xcc\xd5", 1, - 192, "\x0c\x5b\x68\xa8\xc3\xfd\xf6\x45\xe3\xac\x1e\x56", 96 }, + "\x36\x86\xf1\xf8\xc1\x8a\x94\x4c\xb9\x70\xf0\x89\xc9\x39\xcc\xd5", 1, 192, + "\x0c\x5b\x68\xa8\xc3\xfd\xf6\x45\xe3\xac\x1e\x56", 96 }, { 256, 128, 287, "\xe2\xa7\x2f\x64\x30\x1e\x4d\xb6\xe8\xc0\x5c\x31\x2f\x2c\xea\x92\xfb" "\x8b\x06\x3e\xb7\xfe\xc2\x3e\xa4\xe9\x8c\x46\xfd\x04\x84\xd6", @@ -2052,8 +1622,8 @@ const struct mac_test gmac_test_json[] = { "\x27\x77\xcd\x65\xac\x4d\x2d\xb0\x8f\x21\x3c\x0f\x7a\x5b\xcc\xbc\x19" "\xb9\xbd\x42\xab\x64\x11\x61\x42\xf4\xd9\x4b\x09\x28\x0e\xe5\x84\x74" "\x40\x55\xf8\x1e\x2f\xef\x29\x1b\x36\xae", - "\x54\x54\x83\x20\xe2\x80\x1d\xad\x45\x68\x32\x97\x56\x58\x67\x06", 1, - 1032, "\x89\x98\xac\x05\xe1\x1c\x96\x4f\x22\x09\x0c\xe7", 96 }, + "\x54\x54\x83\x20\xe2\x80\x1d\xad\x45\x68\x32\x97\x56\x58\x67\x06", 1, 1032, + "\x89\x98\xac\x05\xe1\x1c\x96\x4f\x22\x09\x0c\xe7", 96 }, { 256, 128, 288, "\xd8\xd2\x86\xaf\x2b\x74\xab\x17\xbe\x1b\x23\x94\x84\x32\x82\xd2\x4a" "\x19\xa2\x72\xa7\x1b\x0a\xc9\xb0\x5a\xbe\x82\x6e\xc7\xb9\xcd", @@ -2073,8 +1643,8 @@ const struct mac_test gmac_test_json[] = { "\x8e\x5f\x16\xb8\x21\x9f\x15\x72\xf8\x39\x07\xc4\x46\x44\x25\xf1\x43" "\x3b\xec\xdc\xaf\x29\x09\xc5\xb6\x02\xf9\xe2\x82\x2e\x59\x5e\x8c\x9d" "\xfc", - "\x1c\xaf\x54\x2b\xee\xa4\xbb\x14\x6d\x98\x93\xa4\xf0\x44\xf6\x93", 1, - 2048, "\x14\x3e\x28\x5a\x5c\x31\x0a\xc1\xe9\xa0\x18\x1a", 96 }, + "\x1c\xaf\x54\x2b\xee\xa4\xbb\x14\x6d\x98\x93\xa4\xf0\x44\xf6\x93", 1, 2048, + "\x14\x3e\x28\x5a\x5c\x31\x0a\xc1\xe9\xa0\x18\x1a", 96 }, { 256, 128, 289, "\xdd\xba\xfd\xc9\x5b\x4c\x1c\x19\x2d\x3a\xc6\x8b\x03\xd5\x67\x4a\x36" "\xef\x50\x77\x17\x49\xf4\xfc\xef\x6d\xf9\xac\xaf\x2e\xd0\xc2", @@ -2095,424 +1665,402 @@ const struct mac_test gmac_test_json[] = { "\x6f\x03\x3d\xc0\x13\x0a\xda\x4b\x9a\xd3\xae\xe6\x97\xa7\x00\x36\xb5" "\xf3\x04\x83\xa0\xef\x8c\xfa\xe4\x9a\xb4\x91\xff\xee\x22\xf5\xad\xb0" "\x24\xed\x3a\x18\xea", - "\xd8\xee\x23\xf7\x79\xc0\xb5\x4b\x7a\xb3\x83\xcb\x10\x7b\x00\x98", 1, - 2216, "\xcb\x86\x6b\x2f\x56\x88\x38\xb9\x3c\xec\xec\x38", 96 }, + "\xd8\xee\x23\xf7\x79\xc0\xb5\x4b\x7a\xb3\x83\xcb\x10\x7b\x00\x98", 1, 2216, + "\xcb\x86\x6b\x2f\x56\x88\x38\xb9\x3c\xec\xec\x38", 96 }, { 256, 128, 290, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa6\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa6\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 291, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x50\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x50\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 292, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa5\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa5\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 293, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x53\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x53\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 294, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x27\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x27\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 295, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd1\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xd1\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 296, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc3\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc3\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 297, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x95\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x95\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 298, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x81\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x81\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 299, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x14\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x14\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 300, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd1\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd1\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 301, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x22\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x22\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 302, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd2\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd2\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 303, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x21\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x21\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 304, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x99\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x99\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 305, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\xb6\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\xb6\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 306, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x86\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x86\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 307, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd7\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd7\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 308, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x07\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x07\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 309, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\x56\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\x56\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 310, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\x89\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\x89\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 311, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x4e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x4e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 312, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa8\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa8\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 313, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x05\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x05\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 314, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8e\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8e\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 315, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x53\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x53\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 316, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8d\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8d\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 317, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x50\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x50\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 318, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x0f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x0f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 319, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\xd2\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\xd2\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 320, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x17", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x17", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 321, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x10", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x10", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 322, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x14", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x14", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 323, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x13", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x13", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 324, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x56", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x56", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 325, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x51", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x51", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 326, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x96", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x19\x87\xa9\xa9\xc6\x8f\xe6\x85\x96", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 327, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x91", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\x36\xd6\x6e\x04\xb3\x52\xa9\x63\x91", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 328, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa6\xc2\xf2\x01\xd0\xdf\xea\x19\x86\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa6\xc2\xf2\x01\xd0\xdf\xea\x19\x86\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 329, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x50\x94\xf6\x94\x23\x7f\x3f\x36\xd7\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x50\x94\xf6\x94\x23\x7f\x3f\x36\xd7\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 330, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x81\xd0\xdf\xea\x99\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x81\xd0\xdf\xea\x99\x87\xa9\xa9\xc6\x8f\xe6\x85\x16", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 331, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x14\x23\x7f\x3f\xb6\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x14\x23\x7f\x3f\xb6\xd6\x6e\x04\xb3\x52\xa9\x63\x11", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 332, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa7\xc2\xf2\x01\xd0\xdf\xea\x99\x87\xa9\xa9\xc6\x8f\xe6\x85\x96", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa7\xc2\xf2\x01\xd0\xdf\xea\x99\x87\xa9\xa9\xc6\x8f\xe6\x85\x96", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 333, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x51\x94\xf6\x94\x23\x7f\x3f\xb6\xd6\x6e\x04\xb3\x52\xa9\x63\x91", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x51\x94\xf6\x94\x23\x7f\x3f\xb6\xd6\x6e\x04\xb3\x52\xa9\x63\x91", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 334, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x58\x3d\x0d\xfe\x2f\x20\x15\xe6\x78\x56\x56\x39\x70\x19\x7a\xe9", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x58\x3d\x0d\xfe\x2f\x20\x15\xe6\x78\x56\x56\x39\x70\x19\x7a\xe9", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 335, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xae\x6b\x09\x6b\xdc\x80\xc0\xc9\x29\x91\xfb\x4c\xad\x56\x9c\xee", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xae\x6b\x09\x6b\xdc\x80\xc0\xc9\x29\x91\xfb\x4c\xad\x56\x9c\xee", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 336, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 337, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 338, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 339, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 340, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x27\x42\x72\x81\x50\x5f\x6a\x99\x07\x29\x29\x46\x0f\x66\x05\x96", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x27\x42\x72\x81\x50\x5f\x6a\x99\x07\x29\x29\x46\x0f\x66\x05\x96", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 341, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd1\x14\x76\x14\xa3\xff\xbf\xb6\x56\xee\x84\x33\xd2\x29\xe3\x91", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xd1\x14\x76\x14\xa3\xff\xbf\xb6\x56\xee\x84\x33\xd2\x29\xe3\x91", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 342, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xa6\xc3\xf3\x00\xd1\xde\xeb\x18\x86\xa8\xa8\xc7\x8e\xe7\x84\x17", 0, - 64, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\xa6\xc3\xf3\x00\xd1\xde\xeb\x18\x86\xa8\xa8\xc7\x8e\xe7\x84\x17", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 343, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x50\x95\xf7\x95\x22\x7e\x3e\x37\xd7\x6f\x05\xb2\x53\xa8\x62\x10", 0, - 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, + "\x50\x95\xf7\x95\x22\x7e\x3e\x37\xd7\x6f\x05\xb2\x53\xa8\x62\x10", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b", 96 }, { 256, 128, 344, "\x79\xed\xd4\x40\xcc\x8a\x32\xb8\xb6\xd4\x63\x05\xc4\xce\x36\x34\x65" "\x85\x0e\x28\xba\xc4\xb5\xf6\x40\x0f\xcc\xa9\x0e\x3a\xf0\xaf", "\x81\xdb\x9c\xba\x83\xd9\x70\x4f\x30\xdb\x67\x32\xa0\x08\x21\xbd", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 128, "\x30\x57\x26\x28\x5d\x7b\x1f\x62\x2a\x37\x91\x07", 96 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + "\x30\x57\x26\x28\x5d\x7b\x1f\x62\x2a\x37\x91\x07", 96 }, { 256, 128, 345, "\x79\xed\xd4\x40\xcc\x8a\x32\xb8\xb6\xd4\x63\x05\xc4\xce\x36\x34\x65" "\x85\x0e\x28\xba\xc4\xb5\xf6\x40\x0f\xcc\xa9\x0e\x3a\xf0\xaf", "\x37\x78\xdb\xc5\xc2\xe8\xc0\xe0\x62\x24\x9c\x79\x21\x1e\x64\x52", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 128, "\x30\x57\x26\x28\x5d\x7b\x1f\x62\x2a\x37\x91\x07", 96 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, + "\x30\x57\x26\x28\x5d\x7b\x1f\x62\x2a\x37\x91\x07", 96 }, { 256, 128, 346, "\x71\x08\x96\x35\xa9\xd7\xd3\x56\x6e\x8e\xe2\x22\x1c\xd1\x59\x60\xbd" "\x83\xd1\x8c\x30\x34\x52\x36\x01\xed\x51\x48\x3c\x79\x28\x10", - "", - "\x16\x7b\x6a\x32\xc4\xac\x98\xfe\x73\xbf\xaf\xe4\x64\xba\x8c\xd2", 1, - 0, "\xe7\xe2\xe5\x65\xcb\x4c\x29\x91\x6c\xf5\x23\xbf\x32\xf9\xc8\xf8", - 128 }, + "", "\x16\x7b\x6a\x32\xc4\xac\x98\xfe\x73\xbf\xaf\xe4\x64\xba\x8c\xd2", 1, 0, + "\xe7\xe2\xe5\x65\xcb\x4c\x29\x91\x6c\xf5\x23\xbf\x32\xf9\xc8\xf8", 128 }, { 256, 128, 347, "\x26\x2f\x1c\x95\x04\xff\x79\x67\xac\x50\x30\x15\xe3\x97\xff\x30\xab" "\x0e\x88\xff\x74\xbc\xd0\xdf\x34\x41\x1f\x11\x0f\x60\xcb\xae", - "\x2c", - "\x96\x6a\x58\x80\x2c\x30\x57\x28\x12\x78\xa8\x75\x20\x86\x21\x90", 1, - 8, "\xdb\xc0\x1d\xa6\xe5\x11\x48\x18\x7e\x95\x38\x36\x25\xec\xb0\xf1", - 128 }, + "\x2c", "\x96\x6a\x58\x80\x2c\x30\x57\x28\x12\x78\xa8\x75\x20\x86\x21\x90", 1, 8, + "\xdb\xc0\x1d\xa6\xe5\x11\x48\x18\x7e\x95\x38\x36\x25\xec\xb0\xf1", 128 }, { 256, 128, 348, "\xb8\x0e\x88\x77\xe3\xf0\x2e\x5a\x1b\x92\xee\x64\xb8\x0a\x7a\xeb\x1b" "\xe3\xb0\x18\x48\xaf\xbd\x8b\x10\xac\xf3\x46\x8f\xa7\x1c\x95", - "\x40\x12", - "\xa1\x57\x98\xc2\x75\x14\x59\xce\x9c\x1e\x7e\x35\x8e\xac\x0b\x06", 1, - 16, - "\x26\xba\x26\x1f\xd1\xe8\x95\x48\xd8\x19\x08\xe5\xa7\x4c\x11\x11", - 128 }, + "\x40\x12", "\xa1\x57\x98\xc2\x75\x14\x59\xce\x9c\x1e\x7e\x35\x8e\xac\x0b\x06", 1, 16, + "\x26\xba\x26\x1f\xd1\xe8\x95\x48\xd8\x19\x08\xe5\xa7\x4c\x11\x11", 128 }, { 256, 128, 349, "\x3a\x4a\xff\xa4\x4c\x51\xed\xb8\x1d\xe1\x67\x68\xdc\x8d\x6d\x99\xbd" "\x36\x42\x31\xc4\x45\xb0\xfa\xac\x6e\xa2\x87\x8d\x41\xf8\x25", - "\x33\x7c\x5b\xa3", - "\x86\x3f\x2e\x17\xd4\x14\x3a\x34\x88\x3e\x0f\x5c\xa9\xb0\xd6\xc5", 1, - 32, - "\x10\x80\x9d\xea\x9b\x6b\xf5\x9a\x16\xf7\x44\xe3\x69\x9e\x06\x82", - 128 }, + "\x33\x7c\x5b\xa3", "\x86\x3f\x2e\x17\xd4\x14\x3a\x34\x88\x3e\x0f\x5c\xa9\xb0\xd6\xc5", 1, + 32, "\x10\x80\x9d\xea\x9b\x6b\xf5\x9a\x16\xf7\x44\xe3\x69\x9e\x06\x82", 128 }, { 256, 128, 350, "\xc1\x14\x77\x48\x32\xbb\xec\x17\x02\x74\x55\x74\x54\x0b\xb1\xd0\x04" "\x48\x51\x94\xb8\xcb\x2c\x4c\x15\x9c\x26\xef\x21\x48\x18\xc6", "\xdd\x19\xd0\x7e\x15\xcc\xd8", - "\x5f\x94\xe8\xf4\x41\xc7\x22\xb8\x57\x74\x60\xd8\x31\x33\x93\x0d", 1, - 56, - "\xb6\x44\xc2\x94\xe1\x50\x21\xd1\xbc\x95\x44\x78\x59\xce\xc0\xbf", - 128 }, + "\x5f\x94\xe8\xf4\x41\xc7\x22\xb8\x57\x74\x60\xd8\x31\x33\x93\x0d", 1, 56, + "\xb6\x44\xc2\x94\xe1\x50\x21\xd1\xbc\x95\x44\x78\x59\xce\xc0\xbf", 128 }, { 256, 128, 351, "\x9e\x98\xbf\xfd\x38\x39\x22\x68\xa9\xea\x7c\x1b\x8a\xed\x18\x58\x66" "\x66\xcc\x41\x9c\x03\x86\x09\x0f\xf8\x70\xc4\x59\x7e\x1a\x51", "\x3f\x9c\x92\x3b\xf3\x83\x43\xa8", - "\xde\x5b\xa4\x4c\x9f\x61\x7a\x16\x32\x2f\x08\x7a\x49\x21\xad\x26", 1, - 64, - "\x9e\xc3\xb1\xf1\xcf\xa9\x7b\xa6\x0f\xae\xe6\xcf\x12\x02\x4f\x68", - 128 }, + "\xde\x5b\xa4\x4c\x9f\x61\x7a\x16\x32\x2f\x08\x7a\x49\x21\xad\x26", 1, 64, + "\x9e\xc3\xb1\xf1\xcf\xa9\x7b\xa6\x0f\xae\xe6\xcf\x12\x02\x4f\x68", 128 }, { 256, 128, 352, "\xe6\xd5\x91\x3e\x00\xcd\x10\xf2\xd1\x16\x8d\xc6\x6f\x45\xaf\x51\x1d" "\x16\x11\xcc\x17\x31\xc0\xc5\x38\x9a\x99\xaf\x8a\xd7\xc4\x06", "\xab\xb1\xbd\x62\x14\x0a\x6e\xeb\xff\x9a\x18\x62\xbc\x37\xd1", - "\xc4\x79\xcf\xd3\xc3\x41\x50\x94\x39\x76\xec\xdd\x53\x94\xd4\x92", 1, - 120, - "\x04\xf4\x49\xb5\xf0\x94\xc7\x21\xd9\xaa\x2f\x97\x02\xfe\x74\xb2", - 128 }, + "\xc4\x79\xcf\xd3\xc3\x41\x50\x94\x39\x76\xec\xdd\x53\x94\xd4\x92", 1, 120, + "\x04\xf4\x49\xb5\xf0\x94\xc7\x21\xd9\xaa\x2f\x97\x02\xfe\x74\xb2", 128 }, { 256, 128, 353, "\x84\x67\x5e\xd6\xeb\xa9\x25\x69\x0f\x1c\xc2\x1a\x69\xc8\x94\x3b\x82" "\xe3\x44\x3a\x0b\x28\x23\x01\xbc\x7b\x6b\xf2\xba\xf6\xb2\x29", "\x99\x22\x19\xd1\xbc\x60\xba\x0e\x1b\xa7\x2d\xb8\x57\xc9\xcf\x80", - "\x81\x3f\x5b\xe9\x5d\x2c\x66\x41\x2d\xf7\x12\x2f\xfc\xc9\x81\xa7", 1, - 128, - "\x02\x6e\xa8\x7e\x04\xe0\x4e\xad\xaf\xba\x49\xca\x4e\xac\x61\x0e", - 128 }, + "\x81\x3f\x5b\xe9\x5d\x2c\x66\x41\x2d\xf7\x12\x2f\xfc\xc9\x81\xa7", 1, 128, + "\x02\x6e\xa8\x7e\x04\xe0\x4e\xad\xaf\xba\x49\xca\x4e\xac\x61\x0e", 128 }, { 256, 128, 354, "\xaf\xf9\x02\xdd\xaf\x53\xdb\xb0\x7e\xc0\xd0\x61\xbb\x26\x66\xb7\x84" "\xdb\xf8\x38\x66\xa4\x0f\x09\x8d\x53\xbc\x6b\xa3\x21\xc2\x31", "\x60\x75\x42\xe0\xf7\x36\xfd\x4c\x8a\xd3\x49\xcf\xb1\x73\x07\xb1" "\xc6", - "\xd9\x1a\x6f\xc3\x11\x0c\x4f\x82\xad\x5f\x31\x78\xe0\x6e\x72\x4d", 1, - 136, - "\x8c\xb2\x53\xaf\x95\x90\x90\x83\xa5\x73\x6c\x71\x00\xc1\xf2\x97", - 128 }, + "\xd9\x1a\x6f\xc3\x11\x0c\x4f\x82\xad\x5f\x31\x78\xe0\x6e\x72\x4d", 1, 136, + "\x8c\xb2\x53\xaf\x95\x90\x90\x83\xa5\x73\x6c\x71\x00\xc1\xf2\x97", 128 }, { 256, 128, 355, "\x49\x07\x7e\xe5\x6e\x7a\xad\x04\xd9\x02\x75\xb6\x86\xd9\xcc\x3a\x99" "\xaf\xbb\xbf\xad\x5c\x0a\xf1\xd1\x18\xdb\xd9\xbb\x6b\x04\xbf", "\x8a\xfc\xba\xc9\x7b\xa9\xe9\x9c\xe0\x12\x6b\xa0\x18\x69\x93\x1d\x04" "\x1c\xa8\x1f\x49\xd8\x09\x3a", - "\xd9\x4e\x5c\x57\xfc\x36\x42\x22\xad\x35\xbe\x5b\x9e\x3d\x9a\x87", 1, - 192, - "\xa2\x0c\x60\xc2\x60\xf1\xae\xcb\xb2\xd2\x2e\xc8\x82\x9b\xf9\xf6", - 128 }, + "\xd9\x4e\x5c\x57\xfc\x36\x42\x22\xad\x35\xbe\x5b\x9e\x3d\x9a\x87", 1, 192, + "\xa2\x0c\x60\xc2\x60\xf1\xae\xcb\xb2\xd2\x2e\xc8\x82\x9b\xf9\xf6", 128 }, { 256, 128, 356, "\x7e\x4c\x3e\x47\xb9\x7f\xa6\x36\x2f\xe7\xf6\x60\xd2\x91\x67\x2e\x66" "\xb5\x53\x58\x9e\x19\x40\x4b\x5c\x90\xa2\xff\x43\x84\x69\x14", @@ -2524,10 +2072,8 @@ const struct mac_test gmac_test_json[] = { "\x98\x17\xdf\x26\x89\xac\x09\xa7\x59\xd3\xbe\x19\x5c\xd4\x56\x52\x8a" "\xbd\xef\x2f\x69\x38\xf8\x71\xe2\x55\xd0\xd0\x4e\x13\x0e\x19\x0b\x93" "\x45\x21\x98\xc8\x5b\x0e\x0b\x9f\xc0\xce", - "\xdd\x37\xb1\xcc\x99\xa4\x81\x45\x41\x63\x36\xb6\x1d\x3b\x1f\x39", 1, - 1032, - "\x28\x00\xc4\xab\x25\xd2\xb5\x62\xce\x76\xa3\x5c\x03\x54\x2f\x66", - 128 }, + "\xdd\x37\xb1\xcc\x99\xa4\x81\x45\x41\x63\x36\xb6\x1d\x3b\x1f\x39", 1, 1032, + "\x28\x00\xc4\xab\x25\xd2\xb5\x62\xce\x76\xa3\x5c\x03\x54\x2f\x66", 128 }, { 256, 128, 357, "\x3c\xfa\x7a\xe7\x45\x0c\xa9\xd5\x14\x50\xd4\x81\xf6\xa8\xd4\x2a\x42" "\x54\x07\x0d\xd8\x8d\xf3\x4e\x9d\x43\x02\x8f\xad\x1d\xad\x90", @@ -2547,10 +2093,8 @@ const struct mac_test gmac_test_json[] = { "\xcc\xd7\x19\xc5\x74\x1f\x57\xe6\xa9\x35\xfe\x3e\x95\xef\x47\xfd\xa7" "\xb0\x90\x72\x8f\x81\x1b\x0b\x06\x3e\x50\x87\x61\xd4\x9f\x26\x3f\xfc" "\xf2", - "\x3b\xf9\xef\xd9\x51\x02\xa4\x19\xd0\x6d\x75\xd3\xaf\x5d\xa6\x3c", 1, - 2048, - "\x8b\x71\x1c\x1b\x5b\x50\x14\xf3\x1c\x3f\xb5\x18\x3e\x09\x6f\xcd", - 128 }, + "\x3b\xf9\xef\xd9\x51\x02\xa4\x19\xd0\x6d\x75\xd3\xaf\x5d\xa6\x3c", 1, 2048, + "\x8b\x71\x1c\x1b\x5b\x50\x14\xf3\x1c\x3f\xb5\x18\x3e\x09\x6f\xcd", 128 }, { 256, 128, 358, "\x9c\xe7\xb1\xd9\x3f\x41\x1a\x38\xd4\x13\xf6\x33\xf9\x0c\xd4\x49\x34" "\xa0\x76\xd6\x46\x34\xb4\x7b\x9f\x1b\xcb\xed\xc4\x07\xe3\xb5", @@ -2571,499 +2115,370 @@ const struct mac_test gmac_test_json[] = { "\x82\xd2\xa1\x16\x2c\x5f\x65\xf8\x20\xce\x99\xad\x44\x32\x7d\xcf\xcb" "\x54\xbb\xd5\x89\xfa\xa3\x29\xad\x29\x57\x00\x72\x4b\xf7\x45\x5d\x97" "\xfe\xbf\xb2\x5d\xb9", - "\x97\x0b\xf2\x36\xc7\x57\x6c\x97\x7f\xdc\xf7\x2c\x5d\xb6\x27\x76", 1, - 2216, - "\x6e\xee\x90\x6c\x6f\xe2\x6b\xcb\x3e\x63\x0e\x49\xb7\x51\x76\x33", - 128 }, + "\x97\x0b\xf2\x36\xc7\x57\x6c\x97\x7f\xdc\xf7\x2c\x5d\xb6\x27\x76", 1, 2216, + "\x6e\xee\x90\x6c\x6f\xe2\x6b\xcb\x3e\x63\x0e\x49\xb7\x51\x76\x33", 128 }, { 256, 128, 359, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4d\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4d\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 360, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xbb\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xbb\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 361, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4e\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4e\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 362, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xb8\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xb8\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 363, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xcc\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xcc\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 364, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x3a\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x3a\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 365, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe3\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe3\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 366, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb5\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb5\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 367, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x19\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x19\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 368, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x8c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x8c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 369, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x74\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x74\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 370, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x87\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x87\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 371, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x77\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x77\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 372, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x84\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x84\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 373, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x86\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x86\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 374, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\xa9\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\xa9\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 375, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x51\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x51\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 376, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x00\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x00\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 377, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\xd0\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\xd0\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 378, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x81\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x81\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 379, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xe6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xe6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 380, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x21\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x21\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 381, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x40\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x40\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 382, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xed\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xed\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 383, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa7\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa7\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 384, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7a\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7a\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 385, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa4\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa4\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 386, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x79\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x79\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 387, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\x26\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\x26\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 388, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\xfb\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\xfb\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 389, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x62", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x62", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 390, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x65", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x65", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 391, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x61", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x61", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 392, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x66", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x66", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 393, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x23", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\x23", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 394, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x24", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\x24", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 395, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\xe3", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x06\x50\xc6\x41\xaa\xa6\x70\x63\xe3", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 396, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\xe4", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\x29\x01\x01\xec\xdf\x7b\x3f\x85\xe4", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 397, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4d\xe2\x08\x99\x75\xdb\xbd\x06\x51\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4d\xe2\x08\x99\x75\xdb\xbd\x06\x51\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 398, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xbb\xb4\x0c\x0c\x86\x7b\x68\x29\x00\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xbb\xb4\x0c\x0c\x86\x7b\x68\x29\x00\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 399, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x19\x75\xdb\xbd\x86\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x19\x75\xdb\xbd\x86\x50\xc6\x41\xaa\xa6\x70\x63\x63", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 400, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x8c\x86\x7b\x68\xa9\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x8c\x86\x7b\x68\xa9\x01\x01\xec\xdf\x7b\x3f\x85\x64", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 401, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4c\xe2\x08\x99\x75\xdb\xbd\x86\x50\xc6\x41\xaa\xa6\x70\x63\xe3", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4c\xe2\x08\x99\x75\xdb\xbd\x86\x50\xc6\x41\xaa\xa6\x70\x63\xe3", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 402, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xba\xb4\x0c\x0c\x86\x7b\x68\xa9\x01\x01\xec\xdf\x7b\x3f\x85\xe4", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xba\xb4\x0c\x0c\x86\x7b\x68\xa9\x01\x01\xec\xdf\x7b\x3f\x85\xe4", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 403, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xb3\x1d\xf7\x66\x8a\x24\x42\xf9\xaf\x39\xbe\x55\x59\x8f\x9c\x9c", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xb3\x1d\xf7\x66\x8a\x24\x42\xf9\xaf\x39\xbe\x55\x59\x8f\x9c\x9c", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 404, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x45\x4b\xf3\xf3\x79\x84\x97\xd6\xfe\xfe\x13\x20\x84\xc0\x7a\x9b", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x45\x4b\xf3\xf3\x79\x84\x97\xd6\xfe\xfe\x13\x20\x84\xc0\x7a\x9b", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 405, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 406, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 407, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 408, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 409, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\xcc\x62\x88\x19\xf5\x5b\x3d\x86\xd0\x46\xc1\x2a\x26\xf0\xe3\xe3", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xcc\x62\x88\x19\xf5\x5b\x3d\x86\xd0\x46\xc1\x2a\x26\xf0\xe3\xe3", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 410, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x3a\x34\x8c\x8c\x06\xfb\xe8\xa9\x81\x81\x6c\x5f\xfb\xbf\x05\xe4", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x3a\x34\x8c\x8c\x06\xfb\xe8\xa9\x81\x81\x6c\x5f\xfb\xbf\x05\xe4", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 411, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07", - "\x4d\xe3\x09\x98\x74\xda\xbc\x07\x51\xc7\x40\xab\xa7\x71\x62\x62", 0, - 64, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\x4d\xe3\x09\x98\x74\xda\xbc\x07\x51\xc7\x40\xab\xa7\x71\x62\x62", 0, 64, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 412, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xbb\xb5\x0d\x0d\x87\x7a\x69\x28\x00\x00\xed\xde\x7a\x3e\x84\x65", 0, - 128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - 128 }, + "\xbb\xb5\x0d\x0d\x87\x7a\x69\x28\x00\x00\xed\xde\x7a\x3e\x84\x65", 0, 128, + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 128 }, { 256, 128, 413, "\xaf\xb8\x06\x35\x37\x60\xe5\x9a\x08\xbd\x78\x70\xed\xeb\xce\xd4\xb8" "\x72\x3e\xe3\x1d\x7d\x4f\x96\x1e\x4e\xf2\x18\x6a\x7d\x3a\xbf", "\x9c\x33\xf8\x42\xdb\xa5\x15\x3e\x8d\x65\xb9\x17\x77\x11\x2c\x69", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, - 128, - "\x3b\x44\x52\xec\xb8\xa0\xb1\x77\x2c\x0e\x50\xc1\xf5\x94\x09\xbf", - 128 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 128, + "\x3b\x44\x52\xec\xb8\xa0\xb1\x77\x2c\x0e\x50\xc1\xf5\x94\x09\xbf", 128 }, { 256, 128, 414, "\xaf\xb8\x06\x35\x37\x60\xe5\x9a\x08\xbd\x78\x70\xed\xeb\xce\xd4\xb8" "\x72\x3e\xe3\x1d\x7d\x4f\x96\x1e\x4e\xf2\x18\x6a\x7d\x3a\xbf", "\xba\x32\xdf\xc0\x83\x55\xf8\xde\x70\xb6\xab\xf7\x32\xf2\x88\xd0", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, - 128, - "\x3b\x44\x52\xec\xb8\xa0\xb1\x77\x2c\x0e\x50\xc1\xf5\x94\x09\xbf", - 128 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 1, 128, + "\x3b\x44\x52\xec\xb8\xa0\xb1\x77\x2c\x0e\x50\xc1\xf5\x94\x09\xbf", 128 }, { 0, 128, 415, "", "\x62\xe8\xe0\xda\x60\x00\xc6\x42", "", 0, 64, "\xa2\x3c\xe8\xec\xb4\x4b\xab\x25\x46\xf3\x94\xc7", 96 }, - { 0, 128, 416, "", - "\x64\x46\xb9\xa0\x2b\x16\x76\xbe\x12\x46\x5f\xad\x38\x8e\x39\xfe", - "", 0, 128, "\xc9\xae\x3d\xc4\x39\xf2\xcd\x95\x4f\xff\xd0\xf8", 96 }, + { 0, 128, 416, "", "\x64\x46\xb9\xa0\x2b\x16\x76\xbe\x12\x46\x5f\xad\x38\x8e\x39\xfe", "", + 0, 128, "\xc9\xae\x3d\xc4\x39\xf2\xcd\x95\x4f\xff\xd0\xf8", 96 }, { 0, 128, 417, "", "\x43\xf6\x3d\x68\x0d\x70\x12\xfe", "", 0, 64, - "\xc8\x46\xfa\x33\x6e\x6c\xe3\xf2\x04\x2f\xc9\x1b\x4a\x27\xb0\xfb", - 128 }, - { 0, 128, 418, "", - "\x8a\x27\x59\xaf\xa8\xa7\x77\xc4\x15\x27\xa6\x0b\xc5\x45\x5e\xfd", - "", 0, 128, - "\xf3\x7b\x6d\x4c\x49\xbd\xda\xc0\xbc\xe7\xf7\xdf\xb2\x76\x06\x9f", - 128 }, + "\xc8\x46\xfa\x33\x6e\x6c\xe3\xf2\x04\x2f\xc9\x1b\x4a\x27\xb0\xfb", 128 }, + { 0, 128, 418, "", "\x8a\x27\x59\xaf\xa8\xa7\x77\xc4\x15\x27\xa6\x0b\xc5\x45\x5e\xfd", "", + 0, 128, "\xf3\x7b\x6d\x4c\x49\xbd\xda\xc0\xbc\xe7\xf7\xdf\xb2\x76\x06\x9f", 128 }, { 8, 128, 419, "\x64", "\x22\x8b\xd5\xce\x6a\x59\x3d\xcd", "", 0, 64, "\xf9\xd8\xb3\xd1\xaa\x47\x75\x5c\x9f\x31\x2a\x00", 96 }, - { 8, 128, 420, "\x23", - "\x8f\x5e\x20\x0b\x5c\x89\xad\x35\x8e\xed\xa4\xd0\xa3\xd4\x89\x17", + { 8, 128, 420, "\x23", "\x8f\x5e\x20\x0b\x5c\x89\xad\x35\x8e\xed\xa4\xd0\xa3\xd4\x89\x17", "", 0, 128, "\x1a\x72\x79\xd7\x41\x9a\x6a\xaa\x02\x64\x20\x4d", 96 }, { 8, 128, 421, "\x96", "\xc2\x58\x27\xed\xb2\xf2\xee\xeb", "", 0, 64, - "\xf7\xf4\x52\xbf\xc3\x1b\xe5\x01\x2f\xbc\xdc\x79\xbd\xb5\x77\x82", - 128 }, - { 8, 128, 422, "\x71", - "\x3e\xb1\x29\x97\x19\xb9\x14\x3e\xed\xf2\x38\xe4\xc2\xde\x30\xf4", - "", 0, 128, - "\x97\xf0\xfc\x55\x34\x07\xfb\x52\xfa\xc2\x5a\xb5\xc6\x46\xfc\xf8", - 128 }, - { 64, 128, 423, "\x20\x93\xeb\x4f\x07\x02\x15\x15", - "\x2b\x1c\x35\xc5\x9f\x83\x59\x10", "", 0, 64, - "\x7c\xaa\x60\x94\xbc\xc0\x3e\x30\xdc\xb6\x63\x8a", 96 }, + "\xf7\xf4\x52\xbf\xc3\x1b\xe5\x01\x2f\xbc\xdc\x79\xbd\xb5\x77\x82", 128 }, + { 8, 128, 422, "\x71", "\x3e\xb1\x29\x97\x19\xb9\x14\x3e\xed\xf2\x38\xe4\xc2\xde\x30\xf4", + "", 0, 128, "\x97\xf0\xfc\x55\x34\x07\xfb\x52\xfa\xc2\x5a\xb5\xc6\x46\xfc\xf8", 128 }, + { 64, 128, 423, "\x20\x93\xeb\x4f\x07\x02\x15\x15", "\x2b\x1c\x35\xc5\x9f\x83\x59\x10", "", + 0, 64, "\x7c\xaa\x60\x94\xbc\xc0\x3e\x30\xdc\xb6\x63\x8a", 96 }, { 64, 128, 424, "\x1d\x24\x5f\xe8\xb1\x2c\x12\x04", - "\x6c\xdc\x1a\xd1\x1e\x26\x57\x66\x20\x2b\xed\x63\x03\xf4\x5c\xc3", - "", 0, 128, "\xb0\x21\xda\x22\x34\xab\xde\x1c\x6e\x0b\xd4\x81", 96 }, - { 64, 128, 425, "\x8c\x4d\xcd\x56\xf3\x28\x0b\x42", - "\x65\xba\x8a\xb5\x45\xd1\xf7\xfb", "", 0, 64, - "\x62\x9c\x59\x6e\x66\x31\xcd\x62\x3d\xf9\x8f\x72\xcc\xf0\x94\xf1", - 128 }, + "\x6c\xdc\x1a\xd1\x1e\x26\x57\x66\x20\x2b\xed\x63\x03\xf4\x5c\xc3", "", 0, 128, + "\xb0\x21\xda\x22\x34\xab\xde\x1c\x6e\x0b\xd4\x81", 96 }, + { 64, 128, 425, "\x8c\x4d\xcd\x56\xf3\x28\x0b\x42", "\x65\xba\x8a\xb5\x45\xd1\xf7\xfb", "", + 0, 64, "\x62\x9c\x59\x6e\x66\x31\xcd\x62\x3d\xf9\x8f\x72\xcc\xf0\x94\xf1", 128 }, { 64, 128, 426, "\x5c\xda\xe7\x09\xce\x51\x7e\x61", - "\x9c\xa3\xd0\x42\xb9\xd9\x1c\x6a\xf0\xd2\x47\xcf\x28\x9f\x20\xd8", - "", 0, 128, - "\x1a\x96\x86\x28\xa0\x67\xbc\x3a\x1d\xc9\x5b\x06\x4d\x78\xbc\x3d", - 128 }, + "\x9c\xa3\xd0\x42\xb9\xd9\x1c\x6a\xf0\xd2\x47\xcf\x28\x9f\x20\xd8", "", 0, 128, + "\x1a\x96\x86\x28\xa0\x67\xbc\x3a\x1d\xc9\x5b\x06\x4d\x78\xbc\x3d", 128 }, { 160, 128, 427, "\x1e\x09\x98\x1a\xd6\x52\x0d\xf2\x78\x96\x2c\x22\x5d\x14\x65\x2a\x14" "\x4b\x04\x8b", @@ -3072,21 +2487,18 @@ const struct mac_test gmac_test_json[] = { { 160, 128, 428, "\x09\x7f\x44\x2a\xcb\xba\xc6\xe3\xa8\x58\xc9\xbd\xf7\x6a\x36\xf0\x6a" "\x10\x37\x06", - "\x6e\x9e\xb6\xa5\x8f\x91\xf9\x23\x1a\x94\x94\x3d\x78\x5c\x67\xa3", - "", 0, 128, "\x09\x8d\x00\xea\x1d\x92\x96\xd9\x3a\x03\x1d\x63", 96 }, + "\x6e\x9e\xb6\xa5\x8f\x91\xf9\x23\x1a\x94\x94\x3d\x78\x5c\x67\xa3", "", 0, 128, + "\x09\x8d\x00\xea\x1d\x92\x96\xd9\x3a\x03\x1d\x63", 96 }, { 160, 128, 429, "\xf1\xc1\x0c\x5a\x1c\x9a\x0a\x4a\x3c\x07\x43\x6f\xa6\xcf\xa9\xd4\xd8" "\x78\x85\xb2", "\x38\x05\x7f\x87\x9c\xa7\xcc\xe9", "", 0, 64, - "\x0a\xb9\xbb\xf8\xc2\xc3\xbf\xbd\xac\xd9\x56\xd8\x7b\xcb\xc5\x9c", - 128 }, + "\x0a\xb9\xbb\xf8\xc2\xc3\xbf\xbd\xac\xd9\x56\xd8\x7b\xcb\xc5\x9c", 128 }, { 160, 128, 430, "\x8e\x8d\x6c\x52\x26\xaa\x3c\x39\x83\xcb\x6a\x8e\x21\x1a\x5d\xca\x49" "\xcb\xb3\x70", - "\x7e\xb1\xcf\xab\x0d\x9d\xea\x4d\x04\x1f\xc5\x90\x58\x55\xa3\xe4", - "", 0, 128, - "\x25\x49\xf2\x0a\x79\xac\x25\x67\x21\x47\x20\x16\x3b\x6c\x68\xef", - 128 }, + "\x7e\xb1\xcf\xab\x0d\x9d\xea\x4d\x04\x1f\xc5\x90\x58\x55\xa3\xe4", "", 0, 128, + "\x25\x49\xf2\x0a\x79\xac\x25\x67\x21\x47\x20\x16\x3b\x6c\x68\xef", 128 }, { 320, 128, 431, "\x01\xe4\x6c\xc7\x91\x6f\xec\x9b\x53\x29\xb4\x22\xfc\xe3\x9b\x5e\xd1" "\x4d\x21\x50\x7d\x75\x66\xf4\x98\x9d\x08\x7d\x5b\x00\xe7\x5a\x9c\xfa" @@ -3097,71 +2509,56 @@ const struct mac_test gmac_test_json[] = { "\x0d\x4d\x91\x11\x88\x54\x34\x2e\x7c\x26\x18\x66\xe9\xd4\x9a\x22\xfd" "\xee\x0f\x28\xc5\xe5\xba\xa2\xcd\x74\xc9\xfd\x67\xbe\x9d\x3f\x14\xfa" "\xaf\x0c\x60\x7c\xea\x94", - "\x91\x23\x96\x98\xee\xd6\xa6\x67\x12\x3c\xd0\xd9\xae\x85\xba\xf8", - "", 0, 128, "\xd3\x61\xf8\xeb\xfd\x7f\xb3\x43\x76\x3f\x5e\xdd", 96 }, + "\x91\x23\x96\x98\xee\xd6\xa6\x67\x12\x3c\xd0\xd9\xae\x85\xba\xf8", "", 0, 128, + "\xd3\x61\xf8\xeb\xfd\x7f\xb3\x43\x76\x3f\x5e\xdd", 96 }, { 320, 128, 433, "\x72\xdf\x7d\x65\xab\xa3\xb9\x7d\x2b\x31\xec\x7f\x39\x6c\xf2\x98\x3f" "\x7b\x27\x97\xe3\x66\xb1\x3c\x5b\x0e\xf4\x46\x7b\xa7\xb7\xb8\x4a\xc7" "\xc1\x82\x64\x43\x75\xee", "\x9a\xdf\x89\x89\x56\x5b\xa6\x26", "", 0, 64, - "\x71\x08\x0a\xae\xef\x17\x2a\x0e\x3b\xf7\x32\xe5\xc4\x66\x60\x61", - 128 }, + "\x71\x08\x0a\xae\xef\x17\x2a\x0e\x3b\xf7\x32\xe5\xc4\x66\x60\x61", 128 }, { 320, 128, 434, "\x85\xc3\x62\xd4\xc0\x53\xef\xcb\x5a\x72\x89\xad\x80\xfa\xf2\xa2\x78" "\xf5\x1b\x83\x6b\x2a\x7d\x16\x41\x0b\x9f\xbc\xed\xe3\xea\xd6\x9a\x9b" "\x1d\x3c\x96\x65\xd8\x77", - "\x06\x4d\x36\x5c\xd0\x6b\xc6\xc3\x35\x23\x62\x32\xe7\x2e\xae\x49", - "", 0, 128, - "\x22\x0f\x44\xcb\xe8\x3b\x7f\x75\x70\x24\x14\x29\x3b\x4b\x97\xed", - 128 }, - { 128, 128, 435, - "\x1a\xbc\x93\x3c\x4f\xe2\x3a\x4b\x49\x60\x5c\x3a\x9d\x30\x99\x7d", + "\x06\x4d\x36\x5c\xd0\x6b\xc6\xc3\x35\x23\x62\x32\xe7\x2e\xae\x49", "", 0, 128, + "\x22\x0f\x44\xcb\xe8\x3b\x7f\x75\x70\x24\x14\x29\x3b\x4b\x97\xed", 128 }, + { 128, 128, 435, "\x1a\xbc\x93\x3c\x4f\xe2\x3a\x4b\x49\x60\x5c\x3a\x9d\x30\x99\x7d", "\x76\xc2\xb2\xb1\xd6\x92\xbc\xed\xe9\x11\x52\xb3\x45\xf6\x88\x15", - "\x36\x79\x73\xf1\x93\xfc\xc3\x9e\x23\x03\xca\x01\x93\x9b\x4e\x77", 0, - 128, "", 0 }, + "\x36\x79\x73\xf1\x93\xfc\xc3\x9e\x23\x03\xca\x01\x93\x9b\x4e\x77", 0, 128, "", 0 }, { 192, 128, 436, "\x1e\x39\xd9\x1e\xf4\xd0\x5e\xd9\xbd\x5d\x8d\x88\x6f\xbb\x93\x7e\x35" "\xa5\x44\x73\xdf\x5d\x0c\x25", "\xec\xf0\x19\x90\x48\x0f\xdc\xe0\xd2\x8c\x15\x53\xb8\x0e\xe1\x28", - "\x73\x2c\x22\x4d\x31\xb6\x1b\xe2\xe4\xdb\x36\x5d\x5a\x53\x3c\x1c", 0, - 128, "", 0 }, + "\x73\x2c\x22\x4d\x31\xb6\x1b\xe2\xe4\xdb\x36\x5d\x5a\x53\x3c\x1c", 0, 128, "", 0 }, { 256, 128, 437, "\xc2\x92\xbb\xa4\x54\xcc\x13\xfc\x32\x4e\x19\xff\xf7\xa4\x63\x53\x4b" "\xa9\x3a\xcb\x98\xe4\xc1\xb5\x1c\x21\xd5\xb7\xef\x53\x9f\x3a", "\xc1\x60\xf1\x7c\x5a\xa9\x2c\xa6\x8a\x83\x7d\xc7\x51\xc0\x6f\x10", - "\x5a\xb3\x90\xc6\x7b\xde\x51\x0c\xf2\x7f\x4c\x77\x42\x5b\xff\x5a", 0, - 128, "", 0 }, - { 128, 128, 438, - "\x4f\x5d\xcb\xc6\xa2\xd7\x74\x40\xba\x17\x98\xc9\xb7\xf3\x02\xeb", + "\x5a\xb3\x90\xc6\x7b\xde\x51\x0c\xf2\x7f\x4c\x77\x42\x5b\xff\x5a", 0, 128, "", 0 }, + { 128, 128, 438, "\x4f\x5d\xcb\xc6\xa2\xd7\x74\x40\xba\x17\x98\xc9\xb7\xf3\x02\xeb", "\xd1\x0d\x2a\x06\xb3\xaf\x2e\xc1\x3b\xff\x20\xaa\xb2\x93\x97\x3b", - "\x6e\x9d\xe0\xb3\x12\x89\x25\x40\x43\x6e\x93\x59\x09\xa3\xfb\x48", 1, - 128, + "\x6e\x9d\xe0\xb3\x12\x89\x25\x40\x43\x6e\x93\x59\x09\xa3\xfb\x48", 1, 128, "\xf1\xac\xc9\x29\x9a\xfe\x3c\x45\x48\x95\xfe\x6a\x42\x77\x11\xc0\x3f" "\x15\xd8\xaa", 160 }, - { 128, 128, 439, - "\x74\x00\xc7\x2f\xb3\x4b\x80\xd3\x45\xad\x4d\x17\x95\x7e\x7f\x96", + { 128, 128, 439, "\x74\x00\xc7\x2f\xb3\x4b\x80\xd3\x45\xad\x4d\x17\x95\x7e\x7f\x96", "\x6e\x0a\x7d\x3d\x9e\xda\x7d\x71\xdc\x47\x69\x81\x85\x24\x04\xdb", - "\x45\x27\x54\xf4\x89\x7f\x23\x58\xa0\xa4\xab\x02\x47\x67\xf3\x9c", 1, - 128, + "\x45\x27\x54\xf4\x89\x7f\x23\x58\xa0\xa4\xab\x02\x47\x67\xf3\x9c", 1, 128, "\xf8\xcb\x7e\x3d\xb0\x96\x2c\x17\xf9\x27\xde\x88\xfc\x90\xe4\xe6\xf8" "\x06\x4f\xf0\xaf\x0d\x9d\xa3\x9d\x59\xf1\x92\xdd\x56\x13\x7e", 256 }, - { 128, 128, 440, - "\xa9\xff\xf5\x5a\x0d\x06\x75\x32\xb2\x23\x36\xee\x01\xd2\xa7\xfc", + { 128, 128, 440, "\xa9\xff\xf5\x5a\x0d\x06\x75\x32\xb2\x23\x36\xee\x01\xd2\xa7\xfc", "\x7d\x77\xd4\x88\x4a\x13\x21\xd6\x58\x8d\xd1\xd4\x8d\x6e\x5b\xeb", - "\x68\xc9\xb2\x0e\xcf\x36\xd5\x66\xa4\x63\x07\x03\x57\x42\x39\x23", 1, - 128, + "\x68\xc9\xb2\x0e\xcf\x36\xd5\x66\xa4\x63\x07\x03\x57\x42\x39\x23", 1, 128, "\xef\x1d\xc5\xdc\x06\xc3\x21\x1a\x36\x66\xb6\xf1\xbc\xac\x32\xf0\x0d" "\x00\x0f\xa2\xce\x9f\x39\xfe\xb2\x94\xe3\x1f\xb6\xc9\xd9\x83\xfa\x9e" "\x4e\x2f\x24\x42\xf1\x79\xfa\x65\x28\xc4\x02\x64\x09\xd7\xd4\x62\x9a" "\xdf\x38\x14\x4d\xc0\x60\x88\x7e\xf7\x2b\x5a\xd6\x82", 512 }, - { 128, 128, 441, - "\x08\xfc\x93\x83\xee\x79\x86\xa1\xf0\xf3\x8d\xdd\x4e\x5b\xde\x90", + { 128, 128, 441, "\x08\xfc\x93\x83\xee\x79\x86\xa1\xf0\xf3\x8d\xdd\x4e\x5b\xde\x90", "\x72\xea\x2e\x0d\x0c\x5d\x7d\xc7\x63\x4e\xe0\x93\x59\xe9\xd9\x81", - "\xfb\x89\x5c\x06\xb6\xa7\xa5\x1e\xbc\x9e\xb1\x29\xd0\xeb\x9e\x1a", 1, - 128, + "\xfb\x89\x5c\x06\xb6\xa7\xa5\x1e\xbc\x9e\xb1\x29\xd0\xeb\x9e\x1a", 1, 128, "\xee\xf7\x29\xba\xec\xd8\x92\x78\xda\x7c\xb9\x39\xb3\x45\xc2\x87\x2e" "\xfc\x44\x3c\x22\xad\xdf\xb6\x8e\x42\x91\x63\x65\x6c\x56\xb3\xa3\x92" "\x00\xd9\xe0\x78\x71\x01\x33\x00\xbb\xa9\xf9\xb0\xad\xa6\xd3\x91\x64" @@ -3175,8 +2572,7 @@ const struct mac_test gmac_test_json[] = { "\x8e\xe3\x34\x45\x5b\xf9\x6b\x75\x1a\x6e\xbb\x9a\x97\x82\xfc\x0e\x46" "\x9f\x5c\x69\xc2\x42\xad\x23", "\x4b\xe6\x12\xa3\x5b\x8c\x98\x50\x2d\xad\x7c\x2d\x40\xc5\x1f\x34", - "\x59\xd3\x16\x61\xd8\xd4\x96\xa9\xea\x9b\xd3\x41\x2a\xe3\x3d\xa6", 1, - 128, + "\x59\xd3\x16\x61\xd8\xd4\x96\xa9\xea\x9b\xd3\x41\x2a\xe3\x3d\xa6", 1, 128, "\x15\xfc\xd4\x0d\x5d\x37\x43\x6e\xf3\x71\x4e\x25\x20\x6e\xfc\x23\xe4" "\x63\x47\xce", 160 }, @@ -3184,8 +2580,7 @@ const struct mac_test gmac_test_json[] = { "\x8a\x95\x0a\x59\x1d\xca\x1a\x24\x61\x50\x0c\x1b\xe5\x4a\x9f\x35\x40" "\xdd\x79\x30\x0c\xd3\x21\x0b", "\x59\x13\xaf\x7d\xe6\xbd\x1a\x2a\x64\xc6\x07\x37\x97\x8b\xfb\xaa", - "\x40\x76\x03\xda\x8b\x15\xea\x69\xc9\x51\xb2\xfb\x6d\xbf\xcb\x03", 1, - 128, + "\x40\x76\x03\xda\x8b\x15\xea\x69\xc9\x51\xb2\xfb\x6d\xbf\xcb\x03", 1, 128, "\xa5\xa6\xa2\xbc\xee\x80\x2e\x8d\x49\xa7\x2f\x53\x6a\x49\x2c\x1a\x0a" "\x9b\x8e\xf5\xd7\x9f\xe8\x11\x67\x24\x3f\xe0\x73\x04\xdd\xa4", 256 }, @@ -3193,8 +2588,7 @@ const struct mac_test gmac_test_json[] = { "\x6a\x7c\x14\xce\x86\x05\xc9\x97\x8a\x0a\x7d\x9e\xba\x80\xa3\xb3\x72" "\x39\xdb\x12\x9d\x2e\x0a\xbf", "\xce\xfd\x73\xac\xfa\x57\xf8\xd8\x7c\xa4\x7d\xc7\x38\xa3\x0c\xdb", - "\x1a\x33\x5a\x24\x69\xd1\x54\xb0\x43\xd8\xa3\x90\x40\xd0\x71\x23", 1, - 128, + "\x1a\x33\x5a\x24\x69\xd1\x54\xb0\x43\xd8\xa3\x90\x40\xd0\x71\x23", 1, 128, "\x04\x21\x59\xc9\xaa\xbe\xc0\x64\x41\xca\x01\xea\xc9\x27\x2d\xa4\xec" "\x40\xb3\x9a\xa9\x6a\x53\xf0\xad\xaf\xad\x5a\x6f\xff\x86\x3a\x12\x6d" "\xb9\x15\x0a\xd7\xa0\x26\x26\x72\xa4\xa5\x50\xfb\xcb\x10\x29\x95\xd4" @@ -3204,8 +2598,7 @@ const struct mac_test gmac_test_json[] = { "\x24\x37\x2b\xbb\x35\xd3\xe0\xda\xfc\xf4\x45\x5a\x47\xa0\x41\x2b\x15" "\x24\xcf\x8d\xbf\xdd\xa5\xf7", "\x12\x1b\xf5\xdb\xe3\x61\x0a\xd5\xa0\x68\xfb\xa0\xaa\x7f\x60\x5a", - "\x5b\x46\xdd\xbf\x3f\x1e\xc8\xb1\x63\xdf\x0c\x72\xff\x47\xa8\xdc", 1, - 128, + "\x5b\x46\xdd\xbf\x3f\x1e\xc8\xb1\x63\xdf\x0c\x72\xff\x47\xa8\xdc", 1, 128, "\xae\xd0\xf6\x78\x72\x17\xaa\x66\xb3\x8a\xac\x94\x8b\x57\x4d\x99\xf1" "\x99\x2b\x62\x1e\x6e\x6b\xa0\x1f\x9b\x3e\xa1\xe3\x1c\x90\x16\xb9\x75" "\x54\xca\x9a\xfd\xe1\x1d\xb8\x31\x02\xed\xbb\x76\xcd\x67\xeb\x13\x96" @@ -3219,8 +2612,7 @@ const struct mac_test gmac_test_json[] = { "\xa6\xe7\xfd\xbc\xd0\x72\x5e\x1d\x5d\x0f\x9d\xae\x2a\xa4\x4c\x0e\x8a" "\x54\x2f\x4b\xf6\x25\x08\xf4\xd4\x27\x75\x08\x70\xb9\xb0\x88", "\x91\x8d\x49\x1e\x78\x50\x2d\x60\x56\x22\x58\x25\xe7\xf7\x9f\x71", - "\xd2\x6d\x71\xab\x70\x69\x85\x52\x7a\x53\x56\xb9\xde\x56\x29\x77", 1, - 128, + "\xd2\x6d\x71\xab\x70\x69\x85\x52\x7a\x53\x56\xb9\xde\x56\x29\x77", 1, 128, "\xb4\x27\x89\x8e\xd3\xec\x7b\xf5\x2b\x62\x74\x06\x3d\xa8\x74\xc2\x5f" "\x7d\xb0\x60", 160 }, @@ -3228,8 +2620,7 @@ const struct mac_test gmac_test_json[] = { "\xb9\x42\x4e\xff\xc7\x76\x51\x0c\x1c\x49\x5a\x0a\x93\xd3\x7f\x3b\x1c" "\x23\xb5\x44\x1d\xd0\x23\x51\xf2\x8c\x13\x75\xd8\x49\xe3\x43", "\xea\x62\x21\xae\xc1\xe2\xb4\x35\x80\x65\xbf\xa1\xd8\xce\x1e\x9a", - "\xc3\x55\x60\x3c\x17\x89\x2b\x89\xd3\x0b\xed\x73\x91\x50\xad\xf1", 1, - 128, + "\xc3\x55\x60\x3c\x17\x89\x2b\x89\xd3\x0b\xed\x73\x91\x50\xad\xf1", 1, 128, "\xf6\xfd\xd3\x87\xe2\xec\x76\x89\xd7\x24\x18\xcb\xba\xa1\x40\x2f\x39" "\xd9\x19\x2f\x01\x73\x46\x75\xc0\x46\x59\x70\xb6\x61\xbd\x69", 256 }, @@ -3237,8 +2628,7 @@ const struct mac_test gmac_test_json[] = { "\x9b\xff\x9b\x26\xdc\xd6\xe6\x20\x72\x64\xea\x43\x3b\xfc\xb6\x13\xcf" "\xa0\x02\x70\x42\xac\x7e\xc1\xd9\x86\xbb\xfc\xf4\x65\x38\xa2", "\xc7\x7f\x51\xe5\x76\x66\xed\x25\xb4\x68\x4a\xa2\x0c\xef\x34\x91", - "\x05\xdc\x92\xc1\xe2\xc8\x0e\x0c\x7c\x9f\x1e\x82\xa8\x7d\x5b\x18", 1, - 128, + "\x05\xdc\x92\xc1\xe2\xc8\x0e\x0c\x7c\x9f\x1e\x82\xa8\x7d\x5b\x18", 1, 128, "\xa3\xc3\x85\xd0\x96\x88\x34\x4b\x76\x34\x8d\x17\xb0\x6a\xfc\x76\x4d" "\x27\xcd\xec\xd2\x79\xcb\x6f\xab\x5e\xd2\xbc\x3c\xad\x1d\xe6\x51\xc1" "\x43\x4b\xf3\x52\xe7\x02\xa4\x0f\x9b\x03\x38\x47\x74\x19\x93\x80\xcb" @@ -3248,8 +2638,7 @@ const struct mac_test gmac_test_json[] = { "\x27\xef\x59\x44\x06\xaf\xad\xb5\x72\x6d\x85\xa6\xba\x85\x49\x6e\xd7" "\xc2\xbc\xb6\xa1\xb1\x23\x65\x56\x55\xd0\xf6\xfe\x0e\x60\xb5", "\x97\x00\x3e\x85\x74\xcd\xaa\x71\x8d\x50\x9e\x53\x32\xf2\xa5\x18", - "\x46\x5d\x99\x83\xcd\x5f\x73\x2b\x47\x5a\x9f\x72\x79\x25\x44\x33", 1, - 128, + "\x46\x5d\x99\x83\xcd\x5f\x73\x2b\x47\x5a\x9f\x72\x79\x25\x44\x33", 1, 128, "\xe0\x74\xf3\x26\xd3\x42\x79\x9d\xec\xe4\xe1\xff\xed\xf5\x95\x4c\xd8" "\x0f\x4d\x45\x39\x41\x05\x06\xc3\x0c\x50\x97\x53\x45\x0e\x07\x30\x7e" "\xae\xb4\x20\x3a\x73\x71\x75\xf6\xad\x81\xd9\x3e\x62\x5b\xc6\x0d\x78" diff --git a/test/wycheproof-app/hmac_sha1_test.json.c b/test/wycheproof-app/hmac_sha1_test.json.c index db246e7c..a5e1cf2e 100644 --- a/test/wycheproof-app/hmac_sha1_test.json.c +++ b/test/wycheproof-app/hmac_sha1_test.json.c @@ -651,48 +651,43 @@ const struct mac_test hmac_sha1_test_json[] = { { 160, 80, 84, "\xdf\xee\xbe\x9a\x5c\x18\x1a\xfc\x60\x5f\xf6\x3b\x22\xbf\x34\x9e\xbd" "\xb6\xc7\xfb", - "\xa5\xf3", "\xc3\xb7\x15\x22\x30\xda\xca\xe4\xef\x48", 1, 16, NULL, - 0 }, + "\xa5\xf3", "\xc3\xb7\x15\x22\x30\xda\xca\xe4\xef\x48", 1, 16, NULL, 0 }, { 160, 80, 85, "\xc5\x14\x7e\xcd\x59\xb7\xd4\x23\x15\xd5\xe3\xa5\x5e\xc8\xb3\xa3\x20" "\xc8\xd6\x15", - "\x37\x17\x77", "\x0a\xbb\x78\xa2\xc6\x7c\x56\x5f\x89\xb1", 1, 24, - NULL, 0 }, + "\x37\x17\x77", "\x0a\xbb\x78\xa2\xc6\x7c\x56\x5f\x89\xb1", 1, 24, NULL, 0 }, { 160, 80, 86, "\xdb\x0d\xa5\x65\x9b\xa6\x9c\xe1\x95\xa6\x95\x24\x50\x8e\x43\x7c\x68" "\x8f\x71\x47", - "\x4e\xf4\xec\x44", "\x40\x62\xfa\xeb\x0b\x40\x66\x98\xb7\x40", 1, 32, - NULL, 0 }, + "\x4e\xf4\xec\x44", "\x40\x62\xfa\xeb\x0b\x40\x66\x98\xb7\x40", 1, 32, NULL, 0 }, { 160, 80, 87, "\x49\x5d\x6c\x11\x91\x85\x2e\xca\xf0\x57\x3e\x6a\x77\x61\x0c\x32\xac" "\xf5\xa1\x17", - "\x15\x66\xae\x63\xce", "\x45\xcb\xef\xcd\x9c\x7e\xee\xe3\x7a\xe5", 1, - 40, NULL, 0 }, + "\x15\x66\xae\x63\xce", "\x45\xcb\xef\xcd\x9c\x7e\xee\xe3\x7a\xe5", 1, 40, NULL, 0 }, { 160, 80, 88, "\xe5\xcf\xe7\xdc\x67\x51\x4c\x4c\x75\xd2\x8b\xb8\x05\xd0\x70\x0b\xde" "\xa0\xd6\x69", - "\xaf\x1a\x6b\x15\xb6\x22", - "\xe8\x67\x26\x9d\x50\x6a\x37\xe8\xa6\x2d", 1, 48, NULL, 0 }, + "\xaf\x1a\x6b\x15\xb6\x22", "\xe8\x67\x26\x9d\x50\x6a\x37\xe8\xa6\x2d", 1, 48, NULL, 0 }, { 160, 80, 89, "\xcf\x1b\x8b\x90\x25\x12\x18\x6e\x38\xc3\x81\x65\xd6\xe5\x87\xbc\xee" "\xca\xe8\x7f", - "\xa5\x95\x12\x15\x2c\x72\x21", - "\x1a\x12\x5b\x21\x41\x2c\xdc\x59\x68\x94", 1, 56, NULL, 0 }, + "\xa5\x95\x12\x15\x2c\x72\x21", "\x1a\x12\x5b\x21\x41\x2c\xdc\x59\x68\x94", 1, 56, NULL, + 0 }, { 160, 80, 90, "\xd0\x15\x7f\xb4\x0c\x77\x39\xae\x50\x6a\xad\x7d\xe6\x0f\x32\xcc\xc3" "\x32\x55\x83", - "\x12\x92\xdf\x8d\x53\xd1\x6f\x3c", - "\x92\x24\xf1\x1b\xff\x0e\x49\xb9\xaa\x95", 1, 64, NULL, 0 }, + "\x12\x92\xdf\x8d\x53\xd1\x6f\x3c", "\x92\x24\xf1\x1b\xff\x0e\x49\xb9\xaa\x95", 1, 64, + NULL, 0 }, { 160, 80, 91, "\xfd\x55\xb8\x1e\xdd\x55\xa1\x5b\xff\x40\x91\x29\xe9\x93\x0f\x1b\xa1" "\x76\x3c\x33", - "\x05\x22\x0a\x69\x97\x53\x3c\x69\x9b", - "\x3b\x2d\x07\xdc\x8c\xa2\x06\xba\x16\xc4", 1, 72, NULL, 0 }, + "\x05\x22\x0a\x69\x97\x53\x3c\x69\x9b", "\x3b\x2d\x07\xdc\x8c\xa2\x06\xba\x16\xc4", 1, 72, + NULL, 0 }, { 160, 80, 92, "\x07\x99\x37\xcf\x3b\xd4\x28\x64\xd5\xb1\x5c\x62\xbd\xd9\x2f\x27\x55" "\x97\x31\x6d", - "\x5a\xc1\x3c\xe1\xb1\xf7\x77\x24\xe2\x81", - "\x0c\x24\xaf\xcd\xad\xd8\x53\x89\x77\xb1", 1, 80, NULL, 0 }, + "\x5a\xc1\x3c\xe1\xb1\xf7\x77\x24\xe2\x81", "\x0c\x24\xaf\xcd\xad\xd8\x53\x89\x77\xb1", 1, + 80, NULL, 0 }, { 160, 80, 93, "\x54\x5b\x13\xe1\xf3\x9f\x0b\x7c\xa9\x25\x2b\xc5\x96\x27\x72\x78\x16" "\x6a\xd4\x10", diff --git a/test/wycheproof-app/hmac_sha224_test.json.c b/test/wycheproof-app/hmac_sha224_test.json.c index 72cc647e..a35949c4 100644 --- a/test/wycheproof-app/hmac_sha224_test.json.c +++ b/test/wycheproof-app/hmac_sha224_test.json.c @@ -643,148 +643,124 @@ const struct mac_test hmac_sha224_test_json[] = { { 224, 112, 82, "\x26\xf3\x14\x17\x0b\x05\x4d\xae\xf5\x34\x98\x04\xda\x18\xf9\x69\xc9" "\x41\x74\xba\xca\x2b\xee\xb0\x09\xd4\x7a\x23", - "", "\x81\x6d\x7a\xf2\x47\x5e\x94\x71\x3f\x2d\xc3\xaa\x30\x69", 1, 0, - NULL, 0 }, + "", "\x81\x6d\x7a\xf2\x47\x5e\x94\x71\x3f\x2d\xc3\xaa\x30\x69", 1, 0, NULL, 0 }, { 224, 112, 83, "\x17\x42\x9a\x62\x2d\xc1\x8d\x38\x71\x5b\x31\xf8\xf2\xb9\x63\x10\x8e" "\x95\x2a\x67\x08\xf3\xe5\x2d\x5b\x25\x84\x8a", - "\xda", "\x26\x63\x07\x77\xd8\x5f\x77\x71\x87\x63\x0b\xb9\x46\x74", 1, - 8, NULL, 0 }, + "\xda", "\x26\x63\x07\x77\xd8\x5f\x77\x71\x87\x63\x0b\xb9\x46\x74", 1, 8, NULL, 0 }, { 224, 112, 84, "\x0a\xcf\xe1\x2d\x89\xac\xd7\xd9\xca\x49\xba\xe6\x31\x8f\x35\xb2\xfb" "\xbf\xc8\x4e\x5d\x2c\x9d\x49\x54\xbe\xde\xd7", - "\x03\xa8", - "\xaa\x4c\x4b\xb6\x3c\xad\x66\xac\x67\x51\x50\xf7\x18\xb2", 1, 16, - NULL, 0 }, + "\x03\xa8", "\xaa\x4c\x4b\xb6\x3c\xad\x66\xac\x67\x51\x50\xf7\x18\xb2", 1, 16, NULL, 0 }, { 224, 112, 85, "\x5a\x06\x80\xf1\x12\x35\x4b\xd4\x67\x86\x5b\x19\xae\x95\x6b\x27\x19" "\xe2\x1e\xce\xe1\xa9\x13\xbd\xca\x29\x43\x39", - "\xa0\xfb\x73", - "\x36\xc7\xcd\x3f\x29\x0d\x1d\x7d\x33\x2b\x95\x1a\xa4\x71", 1, 24, - NULL, 0 }, + "\xa0\xfb\x73", "\x36\xc7\xcd\x3f\x29\x0d\x1d\x7d\x33\x2b\x95\x1a\xa4\x71", 1, 24, NULL, + 0 }, { 224, 112, 86, "\x46\xfa\x59\xaa\x52\x4f\xe3\x0a\x0f\x4e\x39\x56\x1b\x56\x66\x85\x44" "\x40\xdb\xd9\x70\xbb\x59\x92\x5c\xe0\xae\x1a", - "\xc8\xb2\xf5\x57", - "\xc1\xa8\xa7\xd4\x3d\xf3\x4d\x91\x7f\x0c\xb5\x12\xc5\x7d", 1, 32, + "\xc8\xb2\xf5\x57", "\xc1\xa8\xa7\xd4\x3d\xf3\x4d\x91\x7f\x0c\xb5\x12\xc5\x7d", 1, 32, NULL, 0 }, { 224, 112, 87, "\x29\xef\xc5\xab\x5d\x30\xe5\x35\x35\x76\x03\xf2\x71\x1b\x6e\x0a\xa6" "\xcf\x46\x13\x54\x6c\x23\x14\x44\x36\xd2\x13", - "\xc8\xd9\xf5\xb3\x73", - "\xa8\xcc\x7b\xeb\xef\x4c\xfc\xd5\xac\x2f\x40\x1a\x37\x2d", 1, 40, + "\xc8\xd9\xf5\xb3\x73", "\xa8\xcc\x7b\xeb\xef\x4c\xfc\xd5\xac\x2f\x40\x1a\x37\x2d", 1, 40, NULL, 0 }, { 224, 112, 88, "\xfe\x60\xe0\x32\x20\x35\x53\x8f\x2b\x1d\xe9\xde\x38\x0c\xde\x35\xf2" "\x91\xde\xeb\x6e\x02\x7b\x5d\x82\x9e\xcd\x1e", - "\x18\x5e\x4c\xad\xa4\xf4", - "\x32\xfa\xa1\x54\x39\x6b\x0b\x62\x43\x6e\x6b\xf9\x37\xee", 1, 48, - NULL, 0 }, + "\x18\x5e\x4c\xad\xa4\xf4", "\x32\xfa\xa1\x54\x39\x6b\x0b\x62\x43\x6e\x6b\xf9\x37\xee", 1, + 48, NULL, 0 }, { 224, 112, 89, "\x1b\xf7\xfc\xdf\x37\x42\xfa\x77\x99\x15\x28\xcc\x1c\x67\x8b\x98\xbe" "\x98\x76\xa8\xc8\xc5\xb8\x09\xbe\xab\x7d\x9c", "\x9c\x0f\x34\xa5\x65\x42\x79", - "\x08\x61\x70\xc4\x6d\x2b\x0a\x76\xc6\x15\x27\xc2\xd0\x52", 1, 56, - NULL, 0 }, + "\x08\x61\x70\xc4\x6d\x2b\x0a\x76\xc6\x15\x27\xc2\xd0\x52", 1, 56, NULL, 0 }, { 224, 112, 90, "\x32\x53\x3c\x16\xf7\x92\xed\x0a\xcf\x8e\x9e\x60\xf5\x4a\xa1\x73\x93" "\x7c\x71\x94\xb8\x82\xec\xc3\xe6\x71\x00\x9f", "\xf9\x68\xdc\x7a\x19\xaf\xe3\x39", - "\x3f\xb4\xeb\x44\x50\xac\x4b\x26\xa7\x14\xbc\xfb\x22\x4c", 1, 64, - NULL, 0 }, + "\x3f\xb4\xeb\x44\x50\xac\x4b\x26\xa7\x14\xbc\xfb\x22\x4c", 1, 64, NULL, 0 }, { 224, 112, 91, "\x3c\xf2\x8a\x47\x6c\xe7\xea\xec\xfc\x3f\xbf\x1b\x08\x59\xa0\x42\xa5" "\x68\x74\x0a\x58\x4c\x77\xcb\x8f\x96\x03\xac", "\xdb\xca\x9e\x4b\xdd\x84\xb3\x89\x34", - "\x2c\xf1\x4e\xb8\xf4\xc7\x53\x7e\x98\x31\x98\x3b\xb5\xaf", 1, 72, - NULL, 0 }, + "\x2c\xf1\x4e\xb8\xf4\xc7\x53\x7e\x98\x31\x98\x3b\xb5\xaf", 1, 72, NULL, 0 }, { 224, 112, 92, "\xa2\xa8\x09\x0a\xef\x69\x27\x7f\x92\x83\x0e\xc7\x40\x4c\x03\x2f\x8f" "\xde\xbf\xbc\xea\xbb\x9e\x59\x09\x68\xa7\x7f", "\x6b\x79\x0a\x94\x6a\x83\x36\x4c\x79\xd7", - "\xd4\x67\x20\x9f\x63\xa9\xbd\x3d\x2c\x53\x98\xc3\x05\xda", 1, 80, - NULL, 0 }, + "\xd4\x67\x20\x9f\x63\xa9\xbd\x3d\x2c\x53\x98\xc3\x05\xda", 1, 80, NULL, 0 }, { 224, 112, 93, "\x6f\x99\x99\x29\xe9\x16\x72\xba\xc3\x5e\xa7\x0f\x8f\xf8\xb9\xae\xef" "\xa5\x48\x94\x93\xc9\x9b\x0d\x27\x79\x72\x07", "\xb7\xda\xbb\x23\x7a\xea\xe2\xbe\x8b\x5e\x19", - "\x09\xb2\xbb\x6e\xae\xda\x5f\x02\x29\xb8\xc3\x5a\x2f\x54", 1, 88, - NULL, 0 }, + "\x09\xb2\xbb\x6e\xae\xda\x5f\x02\x29\xb8\xc3\x5a\x2f\x54", 1, 88, NULL, 0 }, { 224, 112, 94, "\x45\x25\xb9\x6c\x26\x3e\x4d\x2d\xab\x28\x90\xaa\x55\xf3\xcc\x50\x3d" "\xc1\x20\x6d\x9f\x19\x15\xa6\xfb\xa5\xae\x61", "\xef\x85\x8f\x49\x6f\xcb\x7c\x3f\xab\xbf\xb5\x2e", - "\x6f\x5c\xa7\xef\xcb\x9a\x70\xd0\xab\xf8\x42\x5f\x42\xca", 1, 96, - NULL, 0 }, + "\x6f\x5c\xa7\xef\xcb\x9a\x70\xd0\xab\xf8\x42\x5f\x42\xca", 1, 96, NULL, 0 }, { 224, 112, 95, "\xf8\x94\x01\xac\xb0\xa6\x0d\x07\xfd\x73\x3e\xd5\x63\xf2\xee\x24\x1f" "\x4e\xcf\xea\x81\x14\x58\x7a\x44\xdf\xdb\x0c", "\x7d\x3c\x09\x18\x08\x59\x84\xdf\x95\x09\x7a\xfa\x81", - "\xfc\x22\x7f\x29\xb5\x1f\x9c\x85\x53\x43\xdc\xd0\xea\x11", 1, 104, - NULL, 0 }, + "\xfc\x22\x7f\x29\xb5\x1f\x9c\x85\x53\x43\xdc\xd0\xea\x11", 1, 104, NULL, 0 }, { 224, 112, 96, "\x58\xbc\xe8\xc0\xd1\x7f\xc7\x13\x1d\x2f\xa2\x26\x24\x09\xbb\x14\x66" "\x3a\x6e\x68\x01\x9f\x88\x29\x99\x87\x89\x3e", "\x1c\xa5\x0c\xd6\xc3\xf1\x22\x5e\xb6\xc4\xec\x4d\x6a\x90", - "\x53\xe1\x03\xbb\xde\xd7\xb8\x25\xaf\xfa\x24\x0f\x85\x78", 1, 112, - NULL, 0 }, + "\x53\xe1\x03\xbb\xde\xd7\xb8\x25\xaf\xfa\x24\x0f\x85\x78", 1, 112, NULL, 0 }, { 224, 112, 97, "\x65\x8e\x51\x0f\xba\x4e\x22\x08\xaf\xac\x98\x33\x3f\x9e\x24\x2b\xc1" "\x18\xf6\xe7\x9e\xf0\x66\x1d\x61\x9d\xd3\x2b", "\x32\xc3\x85\xb7\x5a\xe8\x45\x58\xca\x30\x28\x81\xc5\x16\x39", - "\x48\x5f\x35\x1e\x2a\x9a\x82\x91\x0c\x3c\x94\x9e\x32\xb8", 1, 120, - NULL, 0 }, + "\x48\x5f\x35\x1e\x2a\x9a\x82\x91\x0c\x3c\x94\x9e\x32\xb8", 1, 120, NULL, 0 }, { 224, 112, 98, "\x6a\x41\xcc\x3c\xa7\x14\x2a\xe1\x4e\x6d\x97\x9a\x3f\x89\x0a\x33\x15" "\x97\xe5\x92\xdd\x74\x52\x0c\xe4\xea\x66\x0f", "\x78\xe3\xa7\x70\xa8\xaa\xaf\x03\x9f\xd4\xc9\xb6\xa1\x78\x04\x11", - "\x33\x1a\x58\xed\x96\xfc\x8b\x9e\x68\x4a\xb0\x5f\x63\x6c", 1, 128, - NULL, 0 }, + "\x33\x1a\x58\xed\x96\xfc\x8b\x9e\x68\x4a\xb0\x5f\x63\x6c", 1, 128, NULL, 0 }, { 224, 112, 99, "\xb8\x97\x2b\x93\xb6\x83\x02\xcb\xaa\x08\xd3\x29\x04\xea\xe6\x37\x5a" "\x66\xf3\x50\x8e\xce\x3c\x9b\x22\x38\x2c\x7e", "\x36\x87\xe6\x28\x7d\x73\xc9\xe3\xf6\x79\xa5\x0e\x76\x71\x24\x71" "\x27", - "\x27\xd8\x11\x39\x55\x02\x6d\x4d\x31\x80\x70\xfb\xfd\x8f", 1, 136, - NULL, 0 }, + "\x27\xd8\x11\x39\x55\x02\x6d\x4d\x31\x80\x70\xfb\xfd\x8f", 1, 136, NULL, 0 }, { 224, 112, 100, "\xbc\x57\x09\x32\xab\xfa\x11\x05\x0a\xd4\xfc\x80\xa6\xd5\xaf\xe3\x27" "\x1d\x86\xaa\x29\xdc\x62\x73\x8b\x20\x7d\x14", "\xd5\x32\x02\xac\xd2\xec\x74\xd7\x46\x53\x1b\xd9\xad\x30\x16\xd0\x98" "\x0e\x01\x66\xfb\x42\x7a\x08", - "\x02\x0e\x3e\x0c\x29\x40\xce\x15\xee\xb6\x73\x92\x57\x0f", 1, 192, - NULL, 0 }, + "\x02\x0e\x3e\x0c\x29\x40\xce\x15\xee\xb6\x73\x92\x57\x0f", 1, 192, NULL, 0 }, { 224, 112, 101, "\xc9\x2a\x06\x65\xc1\x2e\x87\x02\x6e\x1b\x34\x4f\x97\x1f\xdb\x0e\x47" "\x4d\x45\x0c\xba\x83\x4a\xae\x40\xe2\xd2\x1e", "\x4a\x3a\x85\xac\x09\xf5\x19\x0a\xb9\x4f\x73\xfd\x91\xd9\x8f\x05\x60" "\x15\x26\x3c\x89\xed\x5d\xa2\x23\xfc\x46\x75\xca\xb2\x5c\xdd", - "\x92\x28\x53\xf1\x59\xc4\x2b\x9e\x27\x4f\xce\xf7\xbd\xf3", 1, 256, - NULL, 0 }, + "\x92\x28\x53\xf1\x59\xc4\x2b\x9e\x27\x4f\xce\xf7\xbd\xf3", 1, 256, NULL, 0 }, { 224, 112, 102, "\x6f\xbe\xf6\x7c\xfb\xac\xc9\x8c\x63\x25\x2b\x1c\xa0\x09\xa6\x0e\x8e" "\x34\x79\x76\x9a\x2d\x44\x9f\xb4\x63\x90\x64", "\x00\x6e\x17\x9e\xac\xfa\x9e\x1e\x62\x8b\xb7\x82\x3e\xe9\x60\x9a\xe7" "\x96\x8b\x6d\xf9\x0e\x17\x6f\x77\x2a\x79\x08\x8d\x37\xe9\xb1\x5c\xab" "\x31\x29\x22\xaa\xf8\xfc\x65\x83\xa3\x41\x00\x2b\xda", - "\x0a\x27\xa1\x2a\xfb\xb9\xc3\x13\x62\x02\xe0\x2a\xe3\xb2", 1, 376, - NULL, 0 }, + "\x0a\x27\xa1\x2a\xfb\xb9\xc3\x13\x62\x02\xe0\x2a\xe3\xb2", 1, 376, NULL, 0 }, { 224, 112, 103, "\x70\x0b\x09\x90\x81\x74\xf1\x07\x2e\x31\xae\x8c\xcb\xda\x1c\x44\x60" "\xfc\xf2\x1f\xdf\x14\x6a\x11\x48\x2b\x21\x0d", "\xf7\x72\x56\x4e\xcb\x10\x9e\x80\xee\xfb\x1d\x5a\x7f\x1c\x95\xe2\x03" "\xba\x4c\x98\x02\x33\xdd\x8d\x13\xde\x30\x46\x07\x9a\x6b\x2c\xa2\x6d" "\xc3\x52\x1e\x5e\x0c\x80\x7e\xae\x7a\x79\x87\x7c\x73\xe9", - "\x04\xc7\x18\xa4\xcd\x8b\x58\x3d\x5f\xfb\x81\x70\x27\x6c", 1, 384, - NULL, 0 }, + "\x04\xc7\x18\xa4\xcd\x8b\x58\x3d\x5f\xfb\x81\x70\x27\x6c", 1, 384, NULL, 0 }, { 224, 112, 104, "\xe1\x8a\x20\x24\x6e\xbe\x1b\x57\x96\xdb\xfe\x35\x11\x0e\xfc\x76\x37" "\xd7\x4a\x35\x5f\x0a\x67\x58\xd4\xa0\x0b\x7d", "\x77\x72\x0d\xde\x53\x0e\x6e\xea\xa0\xe9\xaf\x33\x11\xf7\xe9\x91\x89" "\xd6\xc4\xf7\xd7\x1d\x0a\x42\x07\xd6\x2c\x76\x6b\xee\x32\x02\x0c\x92" "\xf5\xd5\xd2\x8d\x5d\xe4\xd0\xd9\xc9\x4b\x57\xec\x05\xf0\xc3", - "\x25\xeb\xc8\x61\x1f\x4b\x63\x6d\x89\x2f\x11\xdf\x2b\x29", 1, 392, - NULL, 0 }, + "\x25\xeb\xc8\x61\x1f\x4b\x63\x6d\x89\x2f\x11\xdf\x2b\x29", 1, 392, NULL, 0 }, { 224, 112, 105, "\x3c\x45\x85\xa7\x75\xbe\xc7\x6c\x7d\x8b\x27\xb8\x7e\x70\xa5\x86\x3a" "\x85\xe6\x11\x1f\x31\x61\xb3\x81\x5f\x59\xb4", @@ -795,8 +771,7 @@ const struct mac_test hmac_sha224_test_json[] = { "\xd5\xf6\xe9\x86\x37\x50\x62\xdb\xdd\x82\xf6\xe9\xe1\xd4\xad\x54\x7c" "\x31\x53\x0c\x2a\x31\x38\x3c\x25\xff\x57\xe8\x79\xea\xe9\x9d\x9b\x3a" "\x0d\xa1\xf3\xc1\xda\xcb\x97\x50\x67\xac", - "\xde\xb9\x4b\x2d\x43\xe9\x89\x26\xaf\x51\xfc\x0c\x88\xdc", 1, 896, - NULL, 0 }, + "\xde\xb9\x4b\x2d\x43\xe9\x89\x26\xaf\x51\xfc\x0c\x88\xdc", 1, 896, NULL, 0 }, { 224, 112, 106, "\xac\xaf\x94\xcb\x1a\x8f\xf4\x67\x7f\xc5\x86\xd2\xbd\xf9\x81\xac\x3a" "\x65\x6b\x20\x82\x15\xe0\xa7\x64\x7b\x42\x0f", @@ -808,8 +783,7 @@ const struct mac_test hmac_sha224_test_json[] = { "\x6e\xa1\x1a\xd6\x7d\x5f\xc2\x7f\x4a\x68\x16\xba\x45\xbe\x5d\x14\xf3" "\xba\x43\x15\xc7\x4d\x1e\xdb\x20\xf2\x17\xb1\x16\xbe\x85\x2b\x62\xa7" "\xf4\xe3\x2b\x3e\x70\x8f\xf9\xf7", - "\x5b\x0d\x7a\xec\x7f\xbd\x19\x6e\xe6\x9e\xd3\x73\xe1\x31", 1, 1016, - NULL, 0 }, + "\x5b\x0d\x7a\xec\x7f\xbd\x19\x6e\xe6\x9e\xd3\x73\xe1\x31", 1, 1016, NULL, 0 }, { 224, 112, 107, "\xe4\x90\x34\x8a\xd7\x8f\xd2\xcd\x5b\x51\xf2\x79\x5b\x79\xe5\x80\x5c" "\xe1\xd9\xba\xf1\x15\x1d\xbd\xf9\x95\xe1\xb0", @@ -821,8 +795,7 @@ const struct mac_test hmac_sha224_test_json[] = { "\x63\x12\x8d\x06\xe9\x7e\xd2\xee\xfd\xed\x2e\x1b\x5a\x03\x5f\x3b\xea" "\x68\x27\x3e\xfa\xc0\x3a\x89\x4d\xcf\x2f\xcc\x79\xa5\x69\x62\x18\x59" "\x54\x04\xb2\x75\x8d\xeb\x9a\x80\xee", - "\x59\x07\x27\xf3\x44\xd8\xa5\x40\xe5\xc5\xe0\xf4\xda\xe9", 1, 1024, - NULL, 0 }, + "\x59\x07\x27\xf3\x44\xd8\xa5\x40\xe5\xc5\xe0\xf4\xda\xe9", 1, 1024, NULL, 0 }, { 224, 112, 108, "\xc8\xe0\x99\xdb\xb6\x0a\x8f\x19\xd8\xb8\x68\x56\xb2\x1c\x55\xf3\x43" "\x7a\xe2\x7f\x77\xdf\xf9\x80\x8f\x12\xa1\xb5", @@ -842,327 +815,265 @@ const struct mac_test hmac_sha224_test_json[] = { "\xfa\x86\x52\xe9\xf0\x95\xca\x24\x0a\x44\x60\x67\x44\x68\x67\xf7\x8e" "\x83\x52\xc4\x11\x07\x94\xc2\xe3\x38\x3d\xfe\xdf\xb3\x5e\x74\xa3" "\x3e", - "\x33\xe7\xdc\xb0\xfd\xe3\xb1\xc5\xb9\x25\x06\xe6\x35\xeb", 1, 2040, - NULL, 0 }, + "\x33\xe7\xdc\xb0\xfd\xe3\xb1\xc5\xb9\x25\x06\xe6\x35\xeb", 1, 2040, NULL, 0 }, { 224, 112, 109, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6f\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6f\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 110, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0c\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0c\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 111, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6c\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6c\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 112, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0f\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0f\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 113, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\xee\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\xee\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 114, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x8d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 115, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x98\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x98\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 116, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x20\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x20\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 117, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\xe2\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\xe2\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 118, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\x2e\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\x2e\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 119, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe4\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe4\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 120, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xde\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xde\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 121, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe7\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe7\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 122, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdd\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdd\x30\x53\xcd\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 123, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x13\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x13\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 124, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\x4d\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\x4d\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 125, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6c\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6c\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 126, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x50\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x50\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 127, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\xed\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\xed\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\xd1\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\xd1\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 129, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x58\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x58\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 130, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xdc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xdc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 131, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb4\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb4\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 132, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xae\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xae\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 133, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x28\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x28\x09", 0, 0, NULL, 0 }, { 224, 112, 134, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x73\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x73\x22", 0, 128, NULL, 0 }, { 224, 112, 135, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x2b\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x2b\x09", 0, 0, NULL, 0 }, { 224, 112, 136, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x70\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x70\x22", 0, 128, NULL, 0 }, { 224, 112, 137, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\xa9\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\xa9\x09", 0, 0, NULL, 0 }, { 224, 112, 138, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\xf2\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\xf2\x22", 0, 128, NULL, 0 }, { 224, 112, 139, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x08", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x08", 0, 0, NULL, 0 }, { 224, 112, 140, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x23", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x23", 0, 128, NULL, 0 }, { 224, 112, 141, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x0b", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x0b", 0, 0, NULL, 0 }, { 224, 112, 142, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x20", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x20", 0, 128, NULL, 0 }, { 224, 112, 143, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x49", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x49", 0, 0, NULL, 0 }, { 224, 112, 144, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x62", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\x62", 0, 128, NULL, 0 }, { 224, 112, 145, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x89", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\x62\xe5\x32\xe8\x93\x6d\x78\xb5\xf0\x29\x89", 0, 0, NULL, 0 }, { 224, 112, 146, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\xa2", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\xae\xdf\x30\x53\xcd\x51\xfc\xaf\x41\x72\xa2", 0, 128, NULL, 0 }, { 224, 112, 147, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6f\x99\xe8\x62\xe5\x32\xe8\x93\x6c\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6f\x99\xe8\x62\xe5\x32\xe8\x93\x6c\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 148, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0c\x21\x6f\xae\xdf\x30\x53\xcd\x50\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0c\x21\x6f\xae\xdf\x30\x53\xcd\x50\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 149, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6e\x99\xe8\xe2\xe5\x32\xe8\x13\x6d\x78\xb5\xf0\x29\x09", 0, 0, - NULL, 0 }, + "", "\x6e\x99\xe8\xe2\xe5\x32\xe8\x13\x6d\x78\xb5\xf0\x29\x09", 0, 0, NULL, 0 }, { 224, 112, 150, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0d\x21\x6f\x2e\xdf\x30\x53\x4d\x51\xfc\xaf\x41\x72\x22", 0, 128, - NULL, 0 }, + "\x0d\x21\x6f\x2e\xdf\x30\x53\x4d\x51\xfc\xaf\x41\x72\x22", 0, 128, NULL, 0 }, { 224, 112, 151, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x91\x66\x17\x9d\x1a\xcd\x17\x6c\x92\x87\x4a\x0f\xd6\xf6", 0, 0, - NULL, 0 }, + "", "\x91\x66\x17\x9d\x1a\xcd\x17\x6c\x92\x87\x4a\x0f\xd6\xf6", 0, 0, NULL, 0 }, { 224, 112, 152, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xf2\xde\x90\x51\x20\xcf\xac\x32\xae\x03\x50\xbe\x8d\xdd", 0, 128, - NULL, 0 }, + "\xf2\xde\x90\x51\x20\xcf\xac\x32\xae\x03\x50\xbe\x8d\xdd", 0, 128, NULL, 0 }, { 224, 112, 153, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, - NULL, 0 }, + "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, NULL, 0 }, { 224, 112, 154, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, - NULL, 0 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, NULL, 0 }, { 224, 112, 155, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, - NULL, 0 }, + "", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, NULL, 0 }, { 224, 112, 156, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, - NULL, 0 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, NULL, 0 }, { 224, 112, 157, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\xee\x19\x68\xe2\x65\xb2\x68\x13\xed\xf8\x35\x70\xa9\x89", 0, 0, - NULL, 0 }, + "", "\xee\x19\x68\xe2\x65\xb2\x68\x13\xed\xf8\x35\x70\xa9\x89", 0, 0, NULL, 0 }, { 224, 112, 158, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x8d\xa1\xef\x2e\x5f\xb0\xd3\x4d\xd1\x7c\x2f\xc1\xf2\xa2", 0, 128, - NULL, 0 }, + "\x8d\xa1\xef\x2e\x5f\xb0\xd3\x4d\xd1\x7c\x2f\xc1\xf2\xa2", 0, 128, NULL, 0 }, { 224, 112, 159, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", - "", "\x6f\x98\xe9\x63\xe4\x33\xe9\x92\x6c\x79\xb4\xf1\x28\x08", 0, 0, - NULL, 0 }, + "", "\x6f\x98\xe9\x63\xe4\x33\xe9\x92\x6c\x79\xb4\xf1\x28\x08", 0, 0, NULL, 0 }, { 224, 112, 160, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x0c\x20\x6e\xaf\xde\x31\x52\xcc\x50\xfd\xae\x40\x73\x23", 0, 128, - NULL, 0 }, - { 112, 224, 161, - "\x77\xb0\xde\x54\xe8\x93\x64\x2c\xae\xac\x34\xbf\xd1\xab", "", + "\x0c\x20\x6e\xaf\xde\x31\x52\xcc\x50\xfd\xae\x40\x73\x23", 0, 128, NULL, 0 }, + { 112, 224, 161, "\x77\xb0\xde\x54\xe8\x93\x64\x2c\xae\xac\x34\xbf\xd1\xab", "", "\x20\x14\xa9\xf2\x72\x37\x8f\xa1\xc9\xf6\x74\x4d\x4d\xb4\x86\x1b\x52" "\xe6\x1a\x19\xeb\x28\x32\x0e\xbe\xe2\xd1\x74", 1, 0, NULL, 0 }, - { 112, 224, 162, - "\x73\x46\xc7\xe4\xb1\x18\xb2\x4e\x51\xf4\x51\x2f\x90\x6a", + { 112, 224, 162, "\x73\x46\xc7\xe4\xb1\x18\xb2\x4e\x51\xf4\x51\x2f\x90\x6a", "\x50\x6d\x4f\xaf\x62\x4f\x92\x96\x5a\xa6\xb5\xc0\x1e\x0c\x80\xa8", "\xc4\xe0\xad\x2f\x62\x27\x98\x98\xa7\xed\xe0\xf7\x09\xa1\xcc\xb8\xc1" "\x00\x49\x41\xf3\xc5\x07\x43\x92\xe7\x95\x33", 1, 128, NULL, 0 }, - { 112, 224, 163, - "\xca\xa8\x64\x17\x9f\x66\xe8\x26\xa0\xef\x3b\x5e\xdb\xe3", + { 112, 224, 163, "\xca\xa8\x64\x17\x9f\x66\xe8\x26\xa0\xef\x3b\x5e\xdb\xe3", "\x73\xf6\x42\x53\x70\x6c\xe6\xb5\x09\x4c\x24\xee\x01\x2e\xce\x9a\xc2" "\x49\x52\x83\xdc\xd8\xc7\xf1\x11\x4e\x81\xe4\x58\x7d\x8e\xa4", "\xa1\x22\x07\x45\xbb\x03\xd9\x82\x76\x3b\xfa\x7c\xe3\x52\xb8\xbc\x87" "\x57\x6a\x0a\xd5\xd4\x6a\x0d\xa0\x8f\xf2\xd6", 1, 256, NULL, 0 }, - { 112, 112, 164, - "\x66\x3a\x97\xd6\xb5\x49\x3d\xbf\xa6\x0c\x8d\xd0\x87\xed", "", - "\x0c\x6e\x21\xa8\x5e\x3c\xd2\xcd\x41\x3f\x36\x50\x7d\x6e", 1, 0, - NULL, 0 }, - { 112, 112, 165, - "\xb0\x8c\x34\x5a\x7c\x71\x66\xfd\xd3\x3c\xe7\x68\xc1\xdc", + { 112, 112, 164, "\x66\x3a\x97\xd6\xb5\x49\x3d\xbf\xa6\x0c\x8d\xd0\x87\xed", "", + "\x0c\x6e\x21\xa8\x5e\x3c\xd2\xcd\x41\x3f\x36\x50\x7d\x6e", 1, 0, NULL, 0 }, + { 112, 112, 165, "\xb0\x8c\x34\x5a\x7c\x71\x66\xfd\xd3\x3c\xe7\x68\xc1\xdc", "\x99\x64\xd8\x0e\xe2\x33\x8c\xff\xe2\x84\x83\xaa\x44\x6a\x6f\x76", - "\xaa\x00\x30\x15\x30\x9f\x2e\xd6\xfd\x77\x52\xe4\x9c\x31", 1, 128, - NULL, 0 }, - { 112, 112, 166, - "\xfc\x9d\x28\x83\xc6\x75\x34\xfe\xfb\xd6\xed\x4a\x97\x98", + "\xaa\x00\x30\x15\x30\x9f\x2e\xd6\xfd\x77\x52\xe4\x9c\x31", 1, 128, NULL, 0 }, + { 112, 112, 166, "\xfc\x9d\x28\x83\xc6\x75\x34\xfe\xfb\xd6\xed\x4a\x97\x98", "\xa4\x98\x20\xc1\x94\xa4\x3d\xee\xf1\x1f\x3a\x0f\x4e\xaa\x80\x42\x54" "\x39\xfc\xa9\xd9\xf1\xd7\xc8\xe6\x65\xd6\xb1\x30\xe4\xe9\x08", - "\x1c\x2b\x96\x62\x3c\x91\xca\x9c\x50\x27\xf8\xf8\x1e\xde", 1, 256, - NULL, 0 }, + "\x1c\x2b\x96\x62\x3c\x91\xca\x9c\x50\x27\xf8\xf8\x1e\xde", 1, 256, NULL, 0 }, { 520, 224, 167, "\xcf\xa6\x39\x65\x6c\xd4\x9f\x8d\x70\xf0\xb1\xa5\xa0\x56\xab\x4f\xc0" "\xae\xee\xbc\x91\x33\x8d\x06\x7f\x36\xc4\x7b\x60\x12\xdc\x8d\x85\x6b" @@ -1196,16 +1107,14 @@ const struct mac_test hmac_sha224_test_json[] = { "\xa3\xdb\xf8\x9a\x58\x17\xb7\x9d\x84\x72\xa1\x38\x3b\x8c\x9a\xfb\x27" "\xb3\x00\x61\x96\xce\x99\x66\x82\x9e\xae\x6a\x31\x3c\x2d\x72\x4d\x99" "\x5f\x4d\xef\x17\x11\x7c\x09\xed\xcf\xc8\xc0\xcb\xbc\x93", - "", "\x40\xbe\xb1\xd3\xaa\xab\x25\xa4\x03\x22\x4e\x57\x77\x70", 1, 0, - NULL, 0 }, + "", "\x40\xbe\xb1\xd3\xaa\xab\x25\xa4\x03\x22\x4e\x57\x77\x70", 1, 0, NULL, 0 }, { 520, 112, 171, "\x2b\xa9\x10\xbc\x0b\xca\x90\x64\x4c\xb2\x1e\x96\x06\x3e\x2c\xd8\x5f" "\x5d\xd0\x2f\xda\x75\xd3\x53\xc9\xb5\x1e\xaf\x45\xee\xe9\x4c\x16\x5c" "\xa6\x59\x2d\x6c\xfd\xd9\x87\xbf\xdc\x1c\xba\x66\x36\x3d\x53\x5a\x14" "\xb2\xf7\xea\xd8\x41\xb1\x7c\x4d\x76\xa5\x04\x91\x05\xf9", "\x7b\xa4\x61\x04\x0d\xe9\xea\x3c\xef\xd4\x80\x91\x24\xf7\x8b\x39", - "\x4d\x28\xa9\x26\xdf\x1b\x18\x8e\x85\xd0\x92\xba\xcf\x11", 1, 128, - NULL, 0 }, + "\x4d\x28\xa9\x26\xdf\x1b\x18\x8e\x85\xd0\x92\xba\xcf\x11", 1, 128, NULL, 0 }, { 520, 112, 172, "\x7f\xcf\x3c\xb1\xb1\xc5\xb5\x37\x49\x2a\xed\xe4\x68\x92\x84\xb5\x88" "\x19\x35\xe3\x53\x7b\xb7\x30\x71\x98\xd6\x51\x8e\x7a\x6a\xab\xf7\x0b" @@ -1213,7 +1122,6 @@ const struct mac_test hmac_sha224_test_json[] = { "\x72\x09\x39\x0f\xcd\x17\x1c\x62\x07\x5c\x6a\x8b\xf1\xeb", "\x83\xd2\x9c\x1c\x4d\x05\x9d\xdb\x0d\x2a\xca\x78\x7e\x5b\x70\x1b\xac" "\x39\x53\xfb\x9b\xc7\x2d\xc8\x7b\x1e\xf9\x2a\x58\x2e\x97\x48", - "\x39\x2c\xe3\x8f\x78\x38\xb2\xf8\x71\x63\xee\xa0\x0b\x86", 1, 256, - NULL, 0 }, + "\x39\x2c\xe3\x8f\x78\x38\xb2\xf8\x71\x63\xee\xa0\x0b\x86", 1, 256, NULL, 0 }, { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/wycheproof-app/hmac_sha256_test.json.c b/test/wycheproof-app/hmac_sha256_test.json.c index 2ec38002..771bd7a0 100644 --- a/test/wycheproof-app/hmac_sha256_test.json.c +++ b/test/wycheproof-app/hmac_sha256_test.json.c @@ -643,150 +643,126 @@ const struct mac_test hmac_sha256_test_json[] = { { 256, 128, 82, "\x7b\xf9\xe5\x36\xb6\x6a\x21\x5c\x22\x23\x3f\xe2\xda\xaa\x74\x3a\x89" "\x8b\x9a\xcb\x9f\x78\x02\xde\x70\xb4\x0e\x3d\x6e\x43\xef\x97", - "", - "\xf4\x60\x55\x85\x94\x97\x47\xde\x26\xf3\xee\x98\xa7\x38\xb1\x72", 1, - 0, NULL, 0 }, + "", "\xf4\x60\x55\x85\x94\x97\x47\xde\x26\xf3\xee\x98\xa7\x38\xb1\x72", 1, 0, NULL, 0 }, { 256, 128, 83, "\xe7\x54\x07\x6c\xea\xb3\xfd\xaf\x4f\x9b\xca\xb7\xd4\xf0\xdf\x0c\xbb" "\xaf\xbc\x87\x73\x1b\x8f\x9b\x7c\xd2\x16\x64\x72\xe8\xee\xbc", - "\x40", - "\x0d\xc0\x0d\x72\x17\xbb\xaf\xe8\xd7\x8b\xf9\x61\x18\x9b\x8f\xd2", 1, - 8, NULL, 0 }, + "\x40", "\x0d\xc0\x0d\x72\x17\xbb\xaf\xe8\xd7\x8b\xf9\x61\x18\x9b\x8f\xd2", 1, 8, NULL, + 0 }, { 256, 128, 84, "\xea\x3b\x01\x6b\xdd\x38\x7d\xd6\x4d\x83\x7c\x71\x68\x38\x08\xf3\x35" "\xdb\xdc\x53\x59\x8a\x4e\xa8\xc5\xf9\x52\x47\x3f\xaf\xaf\x5f", - "\x66\x01", - "\xff\x29\x6b\x36\x8d\x3b\xf0\x59\xcc\x48\x68\x2f\x69\x49\xcc\xaa", 1, - 16, NULL, 0 }, + "\x66\x01", "\xff\x29\x6b\x36\x8d\x3b\xf0\x59\xcc\x48\x68\x2f\x69\x49\xcc\xaa", 1, 16, + NULL, 0 }, { 256, 128, 85, "\x73\xd4\x70\x96\x37\x85\x7d\xaf\xab\x6a\xd8\xb2\xb0\xa5\x1b\x06\x52" "\x47\x17\xfe\xdf\x10\x02\x96\x64\x4f\x7c\xfd\xaa\xe1\x80\x5b", - "\xf1\xd3\x00", - "\x2d\x02\xbd\x1c\x25\xb1\xfe\x52\xb1\xea\xd0\x73\x74\xd6\xe8\x83", 1, - 24, NULL, 0 }, + "\xf1\xd3\x00", "\x2d\x02\xbd\x1c\x25\xb1\xfe\x52\xb1\xea\xd0\x73\x74\xd6\xe8\x83", 1, 24, + NULL, 0 }, { 256, 128, 86, "\xd5\xc8\x1b\x39\x9d\x4c\x0d\x15\x83\xa1\x3d\xa5\x6d\xe6\xd2\xdc\x45" "\xa6\x6e\x7b\x47\xc2\x4a\xb1\x19\x2e\x24\x6d\xc9\x61\xdd\x77", - "\x2a\xe6\x3c\xbf", - "\x4d\x9e\x8b\xdd\xf9\xb7\xa1\x21\x83\x09\xd5\x98\x8a\xa1\xb0\xd9", 1, + "\x2a\xe6\x3c\xbf", "\x4d\x9e\x8b\xdd\xf9\xb7\xa1\x21\x83\x09\xd5\x98\x8a\xa1\xb0\xd9", 1, 32, NULL, 0 }, { 256, 128, 87, "\x25\x21\x20\x3f\xa0\xdd\xdf\x59\xd8\x37\xb2\x83\x0f\x87\xb1\xaa\x61" "\xf9\x58\x15\x5d\xf3\xca\x4d\x1d\xf2\x45\x7c\xb4\x28\x4d\xc8", "\xaf\x3a\x01\x5e\xa1", - "\xcb\x8a\x4b\x41\x33\x50\xb4\x2f\x4a\xc3\x53\x3c\xc7\xf4\x78\x64", 1, - 40, NULL, 0 }, + "\xcb\x8a\x4b\x41\x33\x50\xb4\x2f\x4a\xc3\x53\x3c\xc7\xf4\x78\x64", 1, 40, NULL, 0 }, { 256, 128, 88, "\x66\x5a\x02\xbc\x26\x5a\x66\xd0\x17\x75\x09\x1d\xa5\x67\x26\xb6\x66" "\x8b\xfd\x90\x3c\xb7\xaf\x66\xfb\x1b\x78\xa8\xa0\x62\xe4\x3c", "\x3f\x56\x93\x5d\xef\x3f", - "\x1c\xfc\xe7\x45\xdb\x1c\xa7\xde\x9a\x1d\x44\x20\xe6\x12\xca\x55", 1, - 48, NULL, 0 }, + "\x1c\xfc\xe7\x45\xdb\x1c\xa7\xde\x9a\x1d\x44\x20\xe6\x12\xca\x55", 1, 48, NULL, 0 }, { 256, 128, 89, "\xfa\xcd\x75\xb2\x22\x21\x38\x00\x47\x30\x5b\xc9\x81\xf5\x70\xe2\xa1" "\xaf\x38\x92\x8e\xa7\xe2\x05\x9e\x3a\xf5\xfc\x6b\x82\xb4\x93", "\x57\xbb\x86\xbe\xed\x15\x6f", - "\x0b\xde\x0d\x0c\x75\x6d\xf0\x9d\x4f\x6d\xa8\x1b\x29\x9a\x3a\xdf", 1, - 56, NULL, 0 }, + "\x0b\xde\x0d\x0c\x75\x6d\xf0\x9d\x4f\x6d\xa8\x1b\x29\x9a\x3a\xdf", 1, 56, NULL, 0 }, { 256, 128, 90, "\x50\x5a\xa9\x88\x19\x80\x9e\xf6\x3b\x9a\x36\x8a\x1e\x8b\xc2\xe9\x22" "\xda\x45\xb0\x3c\xe0\x2d\x9a\x79\x66\xb1\x50\x06\xdb\xa2\xd5", "\x2e\x4e\x7e\xf7\x28\xfe\x11\xaf", - "\x40\x6a\x5c\x2b\xd3\xe6\xa9\x59\x5f\x9b\x7d\xff\x60\x8d\x59\xa7", 1, - 64, NULL, 0 }, + "\x40\x6a\x5c\x2b\xd3\xe6\xa9\x59\x5f\x9b\x7d\xff\x60\x8d\x59\xa7", 1, 64, NULL, 0 }, { 256, 128, 91, "\xf9\x42\x09\x38\x42\x80\x8b\xa4\x7f\x64\xe4\x27\xf7\x35\x1d\xde\x6b" "\x95\x46\xe6\x6d\xe4\xe7\xd6\x0a\xa6\xf3\x28\x18\x27\x12\xcf", "\x85\x2a\x21\xd9\x28\x48\xe6\x27\xc7", - "\x0b\x1b\xf9\xe9\x8d\x0a\x79\x4f\xa5\x5c\x09\xb6\x3e\x25\x79\x9f", 1, - 72, NULL, 0 }, + "\x0b\x1b\xf9\xe9\x8d\x0a\x79\x4f\xa5\x5c\x09\xb6\x3e\x25\x79\x9f", 1, 72, NULL, 0 }, { 256, 128, 92, "\x64\xbe\x16\x2b\x39\xc6\xe5\xf1\xfe\xd9\xc3\x2d\x9f\x67\x4d\x9a\x8c" "\xde\x6e\xaa\x24\x43\x21\x4d\x86\xbd\x4a\x1f\xb5\x3b\x81\xb4", "\x19\x5a\x3b\x29\x2f\x93\xba\xff\x0a\x2c", - "\x71\xf3\x3f\x60\x21\xd9\x08\x58\xca\xdb\x13\x53\xd7\xfb\xe8\xd7", 1, - 80, NULL, 0 }, + "\x71\xf3\x3f\x60\x21\xd9\x08\x58\xca\xdb\x13\x53\xd7\xfb\xe8\xd7", 1, 80, NULL, 0 }, { 256, 128, 93, "\xb2\x59\xa5\x55\xd4\x4b\x8a\x20\xc5\x48\x9e\x2f\x38\x39\x2d\xda\xa6" "\xbe\x9e\x35\xb9\x83\x3b\x67\xe1\xb5\xfd\xf6\xcb\x3e\x4c\x6c", "\xaf\xd7\x31\x17\x33\x0c\x6e\x85\x28\xa6\xe4", - "\x4b\x8d\x76\x37\x2e\xbe\x5e\x5c\xaa\x56\xca\x4e\x5c\x59\xcd\xd3", 1, - 88, NULL, 0 }, + "\x4b\x8d\x76\x37\x2e\xbe\x5e\x5c\xaa\x56\xca\x4e\x5c\x59\xcd\xd3", 1, 88, NULL, 0 }, { 256, 128, 94, "\x2c\x6f\xc6\x2d\xaa\x77\xba\x8c\x68\x81\xb3\xdd\x69\x89\x89\x8f\xef" "\x64\x66\x63\xcc\x7b\x0a\x3d\xb8\x22\x8a\x70\x7b\x85\xf2\xdc", "\x0f\xf5\x4d\x6b\x67\x59\x12\x0c\x2e\x8a\x51\xe3", - "\xc5\x80\xc5\x42\x84\x6a\x96\xe8\x4e\xa7\x77\x01\x77\x84\x55\xbf", 1, - 96, NULL, 0 }, + "\xc5\x80\xc5\x42\x84\x6a\x96\xe8\x4e\xa7\x77\x01\x77\x84\x55\xbf", 1, 96, NULL, 0 }, { 256, 128, 95, "\xab\xab\x81\x5d\x51\xdf\x29\xf7\x40\xe4\xe2\x07\x9f\xb7\x98\xe0\x15" "\x28\x36\xe6\xab\x57\xd1\x53\x6a\xe8\x92\x9e\x52\xc0\x6e\xb8", "\xf0\x05\x8d\x41\x2a\x10\x4e\x53\xd8\x20\xb9\x5a\x7f", - "\x13\xcd\xb0\x05\x05\x93\x38\xf0\xf2\x8e\x2d\x8c\xe1\xaf\x5d\x0a", 1, - 104, NULL, 0 }, + "\x13\xcd\xb0\x05\x05\x93\x38\xf0\xf2\x8e\x2d\x8c\xe1\xaf\x5d\x0a", 1, 104, NULL, 0 }, { 256, 128, 96, "\x3d\x5d\xa1\xaf\x83\xf7\x28\x74\x58\xbf\xf7\xa7\x65\x1e\xa5\xd8\xdb" "\x72\x25\x94\x01\x33\x3f\x6b\x82\x09\x69\x96\xdd\x7e\xaf\x19", "\xaa\xcc\x36\x97\x2f\x18\x30\x57\x91\x9f\xf5\x7b\x49\xe1", - "\xbd\x99\x3e\x44\x28\xcb\xc0\xe2\x75\xe4\xd8\x0b\x6f\x52\x03\x63", 1, - 112, NULL, 0 }, + "\xbd\x99\x3e\x44\x28\xcb\xc0\xe2\x75\xe4\xd8\x0b\x6f\x52\x03\x63", 1, 112, NULL, 0 }, { 256, 128, 97, "\xc1\x9b\xdf\x31\x4c\x6c\xf6\x43\x81\x42\x54\x67\xf4\x2a\xef\xa1\x7c" "\x1c\xc9\x35\x8b\xe1\x6c\xe3\x1b\x1d\x21\x48\x59\xce\x86\xaa", "\x5d\x06\x6a\x92\xc3\x00\xe9\xb6\xdd\xd6\x3a\x7c\x13\xae\x33", - "\x86\xc9\xf4\xdd\xe0\xb2\x57\xa7\x05\x3a\x7b\x03\xc7\x50\x44\x09", 1, - 120, NULL, 0 }, + "\x86\xc9\xf4\xdd\xe0\xb2\x57\xa7\x05\x3a\x7b\x03\xc7\x50\x44\x09", 1, 120, NULL, 0 }, { 256, 128, 98, "\x61\x2e\x83\x78\x43\xce\xae\x7f\x61\xd4\x96\x25\xfa\xa7\xe7\x49\x4f" "\x92\x53\xe2\x0c\xb3\xad\xce\xa6\x86\x51\x2b\x04\x39\x36\xcd", "\xcc\x37\xfa\xe1\x5f\x74\x5a\x2f\x40\xe2\xc8\xb1\x92\xf2\xb3\x8d", - "\xb9\x6b\xca\xca\xfa\xc3\x00\x94\xf1\x8a\xc5\x03\x9e\x7b\x36\x56", 1, - 128, NULL, 0 }, + "\xb9\x6b\xca\xca\xfa\xc3\x00\x94\xf1\x8a\xc5\x03\x9e\x7b\x36\x56", 1, 128, NULL, 0 }, { 256, 128, 99, "\x73\x21\x6f\xaf\xd0\x02\x2d\x0d\x6e\xe2\x71\x98\xb2\x27\x25\x78\xfa" "\x8f\x04\xdd\x9f\x44\x46\x7f\xbb\x64\x37\xaa\x45\x64\x1b\xf7", "\xd5\x24\x7b\x8f\x6c\x3e\xdc\xbf\xb1\xd5\x91\xd1\x3e\xce\x23\xd2" "\xf5", - "\x6e\x59\x7c\x4c\x38\x61\xa3\x80\xc0\x68\x54\xb4\x46\xfc\x2a\x87", 1, - 136, NULL, 0 }, + "\x6e\x59\x7c\x4c\x38\x61\xa3\x80\xc0\x68\x54\xb4\x46\xfc\x2a\x87", 1, 136, NULL, 0 }, { 256, 128, 100, "\x04\x27\xa7\x0e\x25\x75\x28\xf3\xab\x70\x64\x0b\xba\x1a\x5d\xe1\x2c" "\xf3\x88\x5d\xd4\xc8\xe2\x84\xfb\xbb\x55\xfe\xb3\x52\x94\xa5", "\x13\x93\x7f\x85\x44\xf4\x42\x70\xd0\x11\x75\xa0\x11\xf7\x67\x0e\x93" "\xfa\x6b\xa7\xef\x02\x33\x6e", - "\xf7\x31\xaa\xf2\xf0\x40\x23\xd6\x21\xf1\x04\x95\x34\x46\x79\xa0", 1, - 192, NULL, 0 }, + "\xf7\x31\xaa\xf2\xf0\x40\x23\xd6\x21\xf1\x04\x95\x34\x46\x79\xa0", 1, 192, NULL, 0 }, { 256, 128, 101, "\x96\xe1\xe4\x89\x6f\xb2\xcd\x05\xf1\x33\xa6\xa1\x00\xbc\x56\x09\xa7" "\xac\x3c\xa6\xd8\x17\x21\xe9\x22\xda\xdd\x69\xad\x07\xa8\x92", "\x91\xa1\x7e\x4d\xfc\xc3\x16\x6a\x1a\xdd\x26\xff\x0e\x7c\x12\x05\x6e" "\x8a\x65\x4f\x28\xa6\xde\x24\xf4\xba\x73\x9c\xeb\x5b\x5b\x18", - "\x95\x24\x3e\xb1\xa9\xd4\x48\x17\x4a\xe4\xfc\xcf\x4a\x53\xeb\xfe", 1, - 256, NULL, 0 }, + "\x95\x24\x3e\xb1\xa9\xd4\x48\x17\x4a\xe4\xfc\xcf\x4a\x53\xeb\xfe", 1, 256, NULL, 0 }, { 256, 128, 102, "\x41\x20\x15\x67\xbe\x4e\x6e\xa0\x6d\xe2\x29\x5f\xd0\xe6\xe8\xa7\xd8" "\x62\xbb\x57\x31\x18\x94\xf5\x25\xd8\xad\xea\xbb\xa4\xa3\xe4", "\x58\xc8\xc7\x3b\xdd\x3f\x35\x0c\x97\x47\x78\x16\xea\xe4\xd0\x78\x9c" "\x93\x69\xc0\xe9\x9c\x24\x89\x02\xc7\x00\xbc\x29\xed\x98\x64\x25\x98" "\x5e\xb3\xfa\x55\x70\x9b\x73\xbf\x62\x0c\xd9\xb1\xcb", - "\x34\x33\x67\x20\x7f\x71\x42\x5d\x8f\x81\xf3\x11\x0b\x04\x05\xf6", 1, - 376, NULL, 0 }, + "\x34\x33\x67\x20\x7f\x71\x42\x5d\x8f\x81\xf3\x11\x0b\x04\x05\xf6", 1, 376, NULL, 0 }, { 256, 128, 103, "\x64\x9e\x37\x3e\x68\x1e\xf5\x2e\x3c\x10\xac\x26\x54\x84\x75\x09\x32" "\xa9\x91\x8f\x28\xfb\x82\x4f\x7c\xb5\x0a\xda\xb3\x97\x81\xfe", "\x39\xb4\x47\xbd\x3a\x01\x98\x3c\x1c\xb7\x61\xb4\x56\xd6\x90\x00\x94" "\x8c\xeb\x87\x05\x62\xa5\x36\x12\x6a\x0d\x18\xa8\xe7\xe4\x9b\x16\xde" "\x8f\xe6\x72\xf1\x3d\x08\x08\xd8\xb7\xd9\x57\x89\x99\x17", - "\x15\x16\x18\xee\xc4\xf5\x03\xf3\xb6\x3b\x53\x9d\xe0\xa5\x89\x66", 1, - 384, NULL, 0 }, + "\x15\x16\x18\xee\xc4\xf5\x03\xf3\xb6\x3b\x53\x9d\xe0\xa5\x89\x66", 1, 384, NULL, 0 }, { 256, 128, 104, "\x7b\x0d\x23\x7f\x7b\x53\x6e\x2c\x69\x50\x99\x0e\x61\xb3\x61\xb3\x84" "\x33\x3d\xda\x69\x00\x45\xc5\x91\x32\x1a\x4e\x3f\x79\x74\x7f", "\x3d\x62\x83\xd1\x1c\x02\x19\xb5\x25\x62\x0e\x9b\xf5\xb9\xfd\x88\x7d" "\x3f\x0f\x70\x7a\xcb\x1f\xbd\xff\xab\x0d\x97\xa5\xc6\xd0\x7f\xc5\x47" "\x76\x2e\x0e\x7d\xd7\xc4\x3a\xd3\x5f\xab\x1c\x79\x0f\x80\x47", - "\xce\x20\x1c\x0d\xcf\xdc\x3f\x2b\xef\x36\x06\x09\xa3\x1f\xb1\x9e", 1, - 392, NULL, 0 }, + "\xce\x20\x1c\x0d\xcf\xdc\x3f\x2b\xef\x36\x06\x09\xa3\x1f\xb1\x9e", 1, 392, NULL, 0 }, { 256, 128, 105, "\x17\xc9\x26\x63\x74\x1f\x01\x2e\x5b\xb6\x71\x4e\x61\x4c\x2d\x15\x59" "\x48\x61\x7f\x10\x93\x62\x69\xd9\x54\xc5\x8a\xba\x2a\xe6\x2d", @@ -797,8 +773,7 @@ const struct mac_test hmac_sha256_test_json[] = { "\xa2\x01\x0b\xec\xac\x16\x30\x53\xf2\x11\x07\x0b\xdd\xa6\x21\xb8\xbd" "\x8a\xf7\x7e\x45\x02\x68\x60\x3b\x52\xdb\x34\xc9\x0b\xe8\x36\xdf\xeb" "\xdd\xef\x42\x30\x3f\x72\x4e\x63\xbf\x0f", - "\x76\xe8\xdf\xd9\x4d\xb4\xaf\x9d\x79\xd9\x71\x8e\xec\x46\xcb\x2d", 1, - 896, NULL, 0 }, + "\x76\xe8\xdf\xd9\x4d\xb4\xaf\x9d\x79\xd9\x71\x8e\xec\x46\xcb\x2d", 1, 896, NULL, 0 }, { 256, 128, 106, "\x42\x4c\x6b\x22\x60\x6f\xcc\x09\x4a\xe8\x2f\xc5\xd3\xcb\xe4\x84\x17" "\x4c\x22\x11\xb3\xec\x77\x80\x91\xca\xc3\x4a\x8e\x38\xa1\x52", @@ -810,8 +785,7 @@ const struct mac_test hmac_sha256_test_json[] = { "\x91\x0f\xce\xd3\x5e\xa0\x00\x40\x2e\x95\xfd\x3a\xc7\xaa\x6d\x5e\x0a" "\x6b\x53\x3b\x08\x79\xbc\x46\x60\x19\xb3\xa5\xe6\xb1\x6e\x4b\xd1\xea" "\x6c\xdf\xc9\xcc\xc1\xd6\xf0\xf0", - "\xed\xa7\x09\xc7\x00\x97\x14\xc3\x72\xd0\xd6\xa6\x3d\xfd\xe4\x69", 1, - 1016, NULL, 0 }, + "\xed\xa7\x09\xc7\x00\x97\x14\xc3\x72\xd0\xd6\xa6\x3d\xfd\xe4\x69", 1, 1016, NULL, 0 }, { 256, 128, 107, "\x15\xd5\x53\xc8\xda\x43\x3d\x53\xcd\xc7\xf1\x50\x87\xa7\x03\x49\xca" "\xab\x57\xb3\x79\xa4\x07\x89\x28\xce\x9b\x99\x30\x2e\x31\xa6", @@ -823,8 +797,7 @@ const struct mac_test hmac_sha256_test_json[] = { "\x8a\x4d\xca\x01\x7c\x57\x16\xac\x4d\x5b\x97\x65\xc5\xca\x2a\xb5\xf9" "\x86\x7e\x02\x79\x51\x98\xc0\xb9\x52\x7e\x07\xd0\x8a\xf5\x2d\xbc\xb9" "\x1c\xeb\x3d\x8b\x41\x2a\x2b\x24\x02", - "\x8c\xa1\x40\x2b\xf8\xfc\x23\x44\x2a\xc2\x06\x7b\xe9\x25\xb8\x28", 1, - 1024, NULL, 0 }, + "\x8c\xa1\x40\x2b\xf8\xfc\x23\x44\x2a\xc2\x06\x7b\xe9\x25\xb8\x28", 1, 1024, NULL, 0 }, { 256, 128, 108, "\xff\xe5\x59\x46\x8a\x10\x31\xdf\xb3\xce\xd2\xe3\x81\xe7\x4b\x58\x21" "\xa3\x6d\x9a\xbf\x5f\x2e\x59\x89\x5a\x7f\xdc\xa0\xfa\x56\xa0", @@ -844,367 +817,274 @@ const struct mac_test hmac_sha256_test_json[] = { "\x3b\xeb\xb0\xc6\x91\x8f\x43\x95\xd4\x00\x38\x17\x23\xfd\xae\x28\x32" "\xc3\x6e\xfc\x8e\x36\x8a\x68\xf3\x0f\x63\x51\xc3\xbc\x94\x2c\xd5" "\x60", - "\xa8\x30\xb3\x13\xf4\x93\x6d\xea\x56\xa3\xae\xfd\x6a\x3e\xbe\x7d", 1, - 2040, NULL, 0 }, + "\xa8\x30\xb3\x13\xf4\x93\x6d\xea\x56\xa3\xae\xfd\x6a\x3e\xbe\x7d", 1, 2040, NULL, 0 }, { 256, 128, 109, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd2\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd2\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 110, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd9\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd9\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 111, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd1\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd1\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 112, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xda\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xda\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 113, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x53\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\x53\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 114, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x58\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\x58\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 115, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8a\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8a\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 116, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb8\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb8\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 117, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x89\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x89\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 118, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\xa7\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\xa7\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 119, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6c\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6c\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 120, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x08\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x08\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 121, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6f\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6f\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 122, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x0b\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x0b\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 123, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\xdf\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\xdf\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 124, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\xf4\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\xf4\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 125, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x83\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x83\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 126, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x16\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x16\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 127, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x02\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x02\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 128, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x97\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x97\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 129, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x4b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x4b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 130, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x0c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x0c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 131, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x45\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x45\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 132, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbf\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbf\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 133, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd4\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd4\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 134, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x83\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x83\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 135, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd7\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd7\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 136, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x80\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x80\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 137, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\x55\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\x55\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 138, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x02\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x02\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 139, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe6", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe6", 0, 0, NULL, 0 }, { 256, 128, 140, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x28", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x28", 0, 128, NULL, 0 }, { 256, 128, 141, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe5", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xe5", 0, 0, NULL, 0 }, { 256, 128, 142, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x2b", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x2b", 0, 128, NULL, 0 }, { 256, 128, 143, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xa7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\xa7", 0, 0, NULL, 0 }, { 256, 128, 144, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x69", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\x69", 0, 128, NULL, 0 }, { 256, 128, 145, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\x67", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\x5f\x82\x6b\x44\xa9\xd5\x60\x7d\x67", 0, 0, NULL, 0 }, { 256, 128, 146, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\xa9", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\x74\x17\x2c\xbe\x93\x82\x4c\x1f\xa9", 0, 128, NULL, 0 }, { 256, 128, 147, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd2\x8b\x42\x09\x6d\x80\xf4\x5f\x83\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd2\x8b\x42\x09\x6d\x80\xf4\x5f\x83\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 148, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd9\xb9\x9f\x27\x09\xa3\xca\x74\x16\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd9\xb9\x9f\x27\x09\xa3\xca\x74\x16\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 149, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x89\x6d\x80\xf4\xdf\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x89\x6d\x80\xf4\xdf\x82\x6b\x44\xa9\xd5\x60\x7d\xe7", 0, 0, NULL, 0 }, { 256, 128, 150, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\xa7\x09\xa3\xca\xf4\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\xa7\x09\xa3\xca\xf4\x17\x2c\xbe\x93\x82\x4c\x1f\x29", 0, 128, NULL, 0 }, { 256, 128, 151, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd3\x8b\x42\x09\x6d\x80\xf4\xdf\x82\x6b\x44\xa9\xd5\x60\x7d\x67", 0, - 0, NULL, 0 }, + "", "\xd3\x8b\x42\x09\x6d\x80\xf4\xdf\x82\x6b\x44\xa9\xd5\x60\x7d\x67", 0, 0, NULL, 0 }, { 256, 128, 152, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd8\xb9\x9f\x27\x09\xa3\xca\xf4\x17\x2c\xbe\x93\x82\x4c\x1f\xa9", 0, - 128, NULL, 0 }, + "\xd8\xb9\x9f\x27\x09\xa3\xca\xf4\x17\x2c\xbe\x93\x82\x4c\x1f\xa9", 0, 128, NULL, 0 }, { 256, 128, 153, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x2c\x74\xbd\xf6\x92\x7f\x0b\xa0\x7d\x94\xbb\x56\x2a\x9f\x82\x18", 0, - 0, NULL, 0 }, + "", "\x2c\x74\xbd\xf6\x92\x7f\x0b\xa0\x7d\x94\xbb\x56\x2a\x9f\x82\x18", 0, 0, NULL, 0 }, { 256, 128, 154, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x27\x46\x60\xd8\xf6\x5c\x35\x8b\xe8\xd3\x41\x6c\x7d\xb3\xe0\xd6", 0, - 128, NULL, 0 }, + "\x27\x46\x60\xd8\xf6\x5c\x35\x8b\xe8\xd3\x41\x6c\x7d\xb3\xe0\xd6", 0, 128, NULL, 0 }, { 256, 128, 155, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 0, NULL, 0 }, + "", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 0, NULL, 0 }, { 256, 128, 156, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, - 128, NULL, 0 }, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0, 128, NULL, 0 }, { 256, 128, 157, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 0, NULL, 0 }, + "", "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 0, NULL, 0 }, { 256, 128, 158, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, - 128, NULL, 0 }, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0, 128, NULL, 0 }, { 256, 128, 159, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\x53\x0b\xc2\x89\xed\x00\x74\xdf\x02\xeb\xc4\x29\x55\xe0\xfd\x67", 0, - 0, NULL, 0 }, + "", "\x53\x0b\xc2\x89\xed\x00\x74\xdf\x02\xeb\xc4\x29\x55\xe0\xfd\x67", 0, 0, NULL, 0 }, { 256, 128, 160, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\x58\x39\x1f\xa7\x89\x23\x4a\xf4\x97\xac\x3e\x13\x02\xcc\x9f\xa9", 0, - 128, NULL, 0 }, + "\x58\x39\x1f\xa7\x89\x23\x4a\xf4\x97\xac\x3e\x13\x02\xcc\x9f\xa9", 0, 128, NULL, 0 }, { 256, 128, 161, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", - "", - "\xd2\x8a\x43\x08\x6c\x81\xf5\x5e\x83\x6a\x45\xa8\xd4\x61\x7c\xe6", 0, - 0, NULL, 0 }, + "", "\xd2\x8a\x43\x08\x6c\x81\xf5\x5e\x83\x6a\x45\xa8\xd4\x61\x7c\xe6", 0, 0, NULL, 0 }, { 256, 128, 162, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - "\xd9\xb8\x9e\x26\x08\xa2\xcb\x75\x16\x2d\xbf\x92\x83\x4d\x1e\x28", 0, - 128, NULL, 0 }, - { 128, 256, 163, - "\xa3\x49\xac\x0a\x9f\x9f\x74\xe4\x8e\x09\x9c\xc3\xdb\xf9\xa9\xc9", - "", + "\xd9\xb8\x9e\x26\x08\xa2\xcb\x75\x16\x2d\xbf\x92\x83\x4d\x1e\x28", 0, 128, NULL, 0 }, + { 128, 256, 163, "\xa3\x49\xac\x0a\x9f\x9f\x74\xe4\x8e\x09\x9c\xc3\xdb\xf9\xa9\xc9", "", "\x3a\x84\x37\xb8\x77\xb7\x5c\xc0\x8a\x4d\x8d\x75\x59\xa8\xfc\x68\x69" "\xa5\x8c\x71\x3d\xa6\x3d\x1d\x4b\x35\x0d\x59\xb5\x97\xe3\x0c", 1, 0, NULL, 0 }, - { 128, 256, 164, - "\xac\x68\x6b\xa0\xf1\xa5\x1b\x4e\xc4\xf0\xb3\x04\x92\xb7\xf5\x56", + { 128, 256, 164, "\xac\x68\x6b\xa0\xf1\xa5\x1b\x4e\xc4\xf0\xb3\x04\x92\xb7\xf5\x56", "\x2f\xa4\x3a\x14\xae\x50\x05\x07\xde\xb9\x5a\xb5\xbd\x32\xb0\xfe", "\x00\x85\x32\xa5\x3d\x0c\x0a\xb2\x20\x27\xae\x24\x90\x23\x37\x53\x74" "\xe2\x23\x9b\x95\x96\x09\xe8\x33\x9b\x05\xa1\x57\x42\xa6\x75", 1, 128, NULL, 0 }, - { 128, 256, 165, - "\x73\xef\x9e\xf1\xa4\x22\x5e\x51\xe3\xc1\xdb\x3a\xce\x1f\xa2\x4f", + { 128, 256, 165, "\x73\xef\x9e\xf1\xa4\x22\x5e\x51\xe3\xc1\xdb\x3a\xce\x1f\xa2\x4f", "\xff\xad\x38\x0d\x9a\xab\xb0\xac\xed\xe5\xc1\xbf\x11\x29\x25\xcd\xfc" "\x3d\x37\x9f\xc2\x37\x6a\x4f\xe2\x64\x44\x90\xd0\x43\x0a\xc3", "\x9c\x7c\xb9\xf7\xc2\x07\xec\x46\xd1\xe3\xc5\x57\x64\x73\x1c\x4a\xb5" "\xdd\xba\xe4\xe1\x40\x1e\x52\xa8\x95\xdf\x0c\xff\x47\x87\xc9", 1, 256, NULL, 0 }, - { 128, 128, 166, - "\xe3\x4f\x15\xc7\xbd\x81\x99\x30\xfe\x9d\x66\xe0\xc1\x66\xe6\x1c", - "", - "\x1d\x76\x5a\xb9\xe2\x98\x92\xf7\xbf\xec\x29\x75\xad\x4b\xc2\xdc", 1, - 0, NULL, 0 }, - { 128, 128, 167, - "\xe0\x9e\xaa\x5a\x3f\x5e\x56\xd2\x79\xd5\xe7\xa0\x33\x73\xf6\xea", + { 128, 128, 166, "\xe3\x4f\x15\xc7\xbd\x81\x99\x30\xfe\x9d\x66\xe0\xc1\x66\xe6\x1c", "", + "\x1d\x76\x5a\xb9\xe2\x98\x92\xf7\xbf\xec\x29\x75\xad\x4b\xc2\xdc", 1, 0, NULL, 0 }, + { 128, 128, 167, "\xe0\x9e\xaa\x5a\x3f\x5e\x56\xd2\x79\xd5\xe7\xa0\x33\x73\xf6\xea", "\xef\x4e\xab\x37\x18\x1f\x98\x42\x3e\x53\xe9\x47\xe7\x05\x0f\xd0", - "\xcf\xc1\x9e\xc0\x79\x02\xec\x8b\xe4\x89\x60\x6d\x8f\x40\xd1\x72", 1, - 128, NULL, 0 }, - { 128, 128, 168, - "\x9b\xd3\x90\x2e\xd0\x99\x6c\x86\x9b\x57\x22\x72\xe7\x6f\x38\x89", + "\xcf\xc1\x9e\xc0\x79\x02\xec\x8b\xe4\x89\x60\x6d\x8f\x40\xd1\x72", 1, 128, NULL, 0 }, + { 128, 128, 168, "\x9b\xd3\x90\x2e\xd0\x99\x6c\x86\x9b\x57\x22\x72\xe7\x6f\x38\x89", "\xa7\xba\x19\xd4\x9e\xe1\xea\x02\xf0\x98\xaa\x8e\x30\xc7\x40\xd8\x93" "\xa4\x45\x6c\xcc\x29\x40\x40\x48\x4e\xd8\xa0\x0a\x55\xf9\x3e", - "\xac\x50\xad\xad\x97\x85\xa8\x9c\x72\x82\xd8\xab\x88\x1d\xc6\x15", 1, - 256, NULL, 0 }, + "\xac\x50\xad\xad\x97\x85\xa8\x9c\x72\x82\xd8\xab\x88\x1d\xc6\x15", 1, 256, NULL, 0 }, { 520, 256, 169, "\x8a\x0c\x46\xeb\x8a\x29\x59\xe3\x98\x65\x33\x00\x79\x76\x33\x41\xe7" "\x43\x9d\xab\x14\x96\x94\xee\x57\xe0\xd6\x1e\xc7\x3d\x94\x7e\x1d\x53" @@ -1238,17 +1118,14 @@ const struct mac_test hmac_sha256_test_json[] = { "\xd2\xc2\x42\x35\x09\x88\xd0\x2e\xfa\x55\x0e\x05\xae\xcb\xe1\x00\xc1" "\xb8\xbf\x15\x4c\x93\x2c\xf9\xe5\x71\x77\x01\x5c\x81\x6c\x42\xbc\x7f" "\xbc\x71\xce\xaa\x53\x28\xc7\x31\x6b\x7f\x0f\x30\x33\x0f", - "", - "\xbb\x6a\xb6\x6f\x51\xe5\x3f\xa0\x86\xc9\xc6\x1a\x26\xca\x27\xe0", 1, - 0, NULL, 0 }, + "", "\xbb\x6a\xb6\x6f\x51\xe5\x3f\xa0\x86\xc9\xc6\x1a\x26\xca\x27\xe0", 1, 0, NULL, 0 }, { 520, 128, 173, "\x57\x13\x34\x30\x96\xb0\xaa\xf0\x56\x2a\x6b\x92\xc1\xa1\x55\x35\x92" "\x41\x60\x47\x5a\x4e\x42\x33\x58\x91\x59\x72\x8c\x56\x2e\x3b\x2a\xd9" "\x6f\x74\x0c\x6a\x4d\xa2\xbc\x3f\x76\x8c\xe9\x8c\x9b\xd6\x6b\xac\x28" "\xd1\x64\x6f\xf5\x92\x02\x8c\x94\x0d\x45\x5f\x35\xee\xb4", "\x71\x71\x2d\xe2\xfa\xc1\xfb\x85\x56\x73\xbf\xf7\x2a\xf6\x42\x57", - "\xc1\x81\x65\xb8\xb9\x7d\xb1\xca\x5e\x24\x86\xa3\x2b\x39\x73\x1e", 1, - 128, NULL, 0 }, + "\xc1\x81\x65\xb8\xb9\x7d\xb1\xca\x5e\x24\x86\xa3\x2b\x39\x73\x1e", 1, 128, NULL, 0 }, { 520, 128, 174, "\x72\x08\xaf\xbe\xcf\x5f\x1f\x34\x82\x8f\x98\xb7\x19\x41\x4e\x28\x07" "\x16\xde\x64\xf5\xed\xd1\xae\x1c\x77\x41\x53\xcd\x20\x22\x33\x7b\xb2" @@ -1256,7 +1133,6 @@ const struct mac_test hmac_sha256_test_json[] = { "\xf1\x69\x2e\xe9\x0d\x8c\x90\xb5\xfd\xf9\x53\xab\x01\xa5", "\x43\xb5\x33\x02\xb6\x04\xd6\x13\xe6\x2d\xb0\x02\x04\x4a\x47\x82\xd5" "\x72\xac\x8f\xbd\x3c\xd0\xec\xe9\x1b\x43\xbc\x52\xe1\x8e\x98", - "\x2f\xec\xfe\x45\xd7\x93\x39\xc5\x7d\xdd\xba\x68\xab\x34\xf5\xf1", 1, - 256, NULL, 0 }, + "\x2f\xec\xfe\x45\xd7\x93\x39\xc5\x7d\xdd\xba\x68\xab\x34\xf5\xf1", 1, 256, NULL, 0 }, { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; diff --git a/test/wycheproof-app/wycheproof.c b/test/wycheproof-app/wycheproof.c index 8cefdda3..37b8b9ed 100644 --- a/test/wycheproof-app/wycheproof.c +++ b/test/wycheproof-app/wycheproof.c @@ -41,7 +41,8 @@ static unsigned skip_vectors = 0; static unsigned total_run_vectors = 0; static unsigned total_skip_vectors = 0; -static int process_job(IMB_MGR *p_mgr) +static int +process_job(IMB_MGR *p_mgr) { IMB_JOB *job = IMB_SUBMIT_JOB(p_mgr); @@ -67,13 +68,14 @@ static int process_job(IMB_MGR *p_mgr) return 1; } -#define PUTS_ONCE(_s) { \ - static int _ran_already = 0; \ - \ - if (!_ran_already) { \ - _ran_already = 1; \ - printf("\t@note %s\n", _s); \ - } \ +#define PUTS_ONCE(_s) \ + { \ + static int _ran_already = 0; \ + \ + if (!_ran_already) { \ + _ran_already = 1; \ + printf("\t@note %s\n", _s); \ + } \ } /* @@ -81,7 +83,8 @@ static int process_job(IMB_MGR *p_mgr) * MAC TESTS * ============================================================================= */ -static void print_mac_test(const struct mac_test *v) +static void +print_mac_test(const struct mac_test *v) { if (v->iv != NULL) { printf("MAC vector details:\n" @@ -91,9 +94,8 @@ static void print_mac_test(const struct mac_test *v) " msgSize = %u [bits]\n" " ivSize = %u [bits]\n" " resultValid = %d\n", - (unsigned)v->tcId, (unsigned)v->keySize, - (unsigned)v->tagSize, (unsigned)v->msgSize, - (unsigned)v->ivSize, (int)v->resultValid); + (unsigned) v->tcId, (unsigned) v->keySize, (unsigned) v->tagSize, + (unsigned) v->msgSize, (unsigned) v->ivSize, (int) v->resultValid); } else { printf("MAC vector details:\n" " tcId = %u\n" @@ -101,18 +103,15 @@ static void print_mac_test(const struct mac_test *v) " tagSize = %u [bits]\n" " msgSize = %u [bits]\n" " resultValid = %d\n", - (unsigned)v->tcId, (unsigned)v->keySize, - (unsigned)v->tagSize, (unsigned)v->msgSize, - (int)v->resultValid); + (unsigned) v->tcId, (unsigned) v->keySize, (unsigned) v->tagSize, + (unsigned) v->msgSize, (int) v->resultValid); } } static int err_code = 0; static int -mac_submit_and_check(IMB_MGR *p_mgr, - const struct mac_test *v, - const void *res_tag, +mac_submit_and_check(IMB_MGR *p_mgr, const struct mac_test *v, const void *res_tag, const int job_api) { if (job_api) { @@ -121,8 +120,7 @@ mac_submit_and_check(IMB_MGR *p_mgr, if (v->resultValid) { print_mac_test(v); printf("JOB-API submit/flush error!\n"); - printf("ERROR: %s\n", - imb_get_strerror(imb_get_errno(p_mgr))); + printf("ERROR: %s\n", imb_get_strerror(imb_get_errno(p_mgr))); return 0; } else { /* error was expected */ @@ -134,8 +132,7 @@ mac_submit_and_check(IMB_MGR *p_mgr, if (v->resultValid) { print_mac_test(v); printf("DIRECT-API error!\n"); - printf("ERROR: %s\n", - imb_get_strerror(err_code)); + printf("ERROR: %s\n", imb_get_strerror(err_code)); return 0; } else { /* error was expected */ @@ -153,8 +150,7 @@ mac_submit_and_check(IMB_MGR *p_mgr, /* check for TAG mismatch */ if (tag_mismatch) { - printf("%s: TAG mismatch!\n", - job_api ? "JOB-API" : "DIRECT-API"); + printf("%s: TAG mismatch!\n", job_api ? "JOB-API" : "DIRECT-API"); print_mac_test(v); return 0; } @@ -162,7 +158,8 @@ mac_submit_and_check(IMB_MGR *p_mgr, return 1; } -static void errno_update(IMB_MGR *p_mgr) +static void +errno_update(IMB_MGR *p_mgr) { const int new_code = imb_get_errno(p_mgr); @@ -170,25 +167,27 @@ static void errno_update(IMB_MGR *p_mgr) err_code = new_code; } -static void errno_reset(void) +static void +errno_reset(void) { errno = 0; } extern const struct mac_test aes_cmac_test_json[]; -static int test_cmac(IMB_MGR *p_mgr) +static int +test_cmac(IMB_MGR *p_mgr) { const struct mac_test *v = aes_cmac_test_json; - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint32_t skey1[4], skey2[4]; uint8_t scratch[IMB_SHA_512_BLOCK_SIZE]; while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for ( ; v->msg != NULL; v++, run_vectors++) { + for (; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT((v->tagSize / 8) <= sizeof(scratch)); /* tag too long */ @@ -220,16 +219,14 @@ static int test_cmac(IMB_MGR *p_mgr) if ((v->keySize / 8) == IMB_KEY_128_BYTES) { job->hash_alg = IMB_AUTH_AES_CMAC; IMB_AES_KEYEXP_128(p_mgr, v->key, expkey, dust); - IMB_AES_CMAC_SUBKEY_GEN_128(p_mgr, expkey, skey1, - skey2); + IMB_AES_CMAC_SUBKEY_GEN_128(p_mgr, expkey, skey1, skey2); job->u.CMAC._key_expanded = expkey; job->u.CMAC._skey1 = skey1; job->u.CMAC._skey2 = skey2; } else if ((v->keySize / 8) == IMB_KEY_256_BYTES) { job->hash_alg = IMB_AUTH_AES_CMAC_256; IMB_AES_KEYEXP_256(p_mgr, v->key, expkey, dust); - IMB_AES_CMAC_SUBKEY_GEN_256(p_mgr, expkey, skey1, - skey2); + IMB_AES_CMAC_SUBKEY_GEN_256(p_mgr, expkey, skey1, skey2); job->u.CMAC._key_expanded = expkey; job->u.CMAC._skey1 = skey1; job->u.CMAC._skey2 = skey2; @@ -247,7 +244,8 @@ static int test_cmac(IMB_MGR *p_mgr) extern const struct mac_test gmac_test_json[]; -static int test_gmac(IMB_MGR *p_mgr) +static int +test_gmac(IMB_MGR *p_mgr) { const struct mac_test *v = gmac_test_json; struct gcm_key_data gmac_key; @@ -256,7 +254,7 @@ static int test_gmac(IMB_MGR *p_mgr) while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for ( ; v->msg != NULL; v++, run_vectors++) { + for (; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT((v->tagSize / 8) <= sizeof(scratch)); /* tag too long */ @@ -311,16 +309,13 @@ static int test_gmac(IMB_MGR *p_mgr) IMB_AES128_GCM_PRE(p_mgr, v->key, &gmac_key); errno_update(p_mgr); - IMB_AES128_GMAC_INIT(p_mgr, &gmac_key, &ctx, - (const void *) v->iv, + IMB_AES128_GMAC_INIT(p_mgr, &gmac_key, &ctx, (const void *) v->iv, v->ivSize / 8); errno_update(p_mgr); - IMB_AES128_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, - (const void *) v->msg, + IMB_AES128_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, (const void *) v->msg, v->msgSize / 8); errno_update(p_mgr); - IMB_AES128_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, - scratch, v->tagSize / 8); + IMB_AES128_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tagSize / 8); errno_update(p_mgr); } if ((v->keySize / 8) == IMB_KEY_192_BYTES) { @@ -328,16 +323,13 @@ static int test_gmac(IMB_MGR *p_mgr) IMB_AES192_GCM_PRE(p_mgr, v->key, &gmac_key); errno_update(p_mgr); - IMB_AES192_GMAC_INIT(p_mgr, &gmac_key, &ctx, - (const void *) v->iv, + IMB_AES192_GMAC_INIT(p_mgr, &gmac_key, &ctx, (const void *) v->iv, v->ivSize / 8); errno_update(p_mgr); - IMB_AES192_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, - (const void *) v->msg, + IMB_AES192_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, (const void *) v->msg, v->msgSize / 8); errno_update(p_mgr); - IMB_AES192_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, - scratch, v->tagSize / 8); + IMB_AES192_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tagSize / 8); errno_update(p_mgr); } if ((v->keySize / 8) == IMB_KEY_256_BYTES) { @@ -345,16 +337,13 @@ static int test_gmac(IMB_MGR *p_mgr) IMB_AES256_GCM_PRE(p_mgr, v->key, &gmac_key); errno_update(p_mgr); - IMB_AES256_GMAC_INIT(p_mgr, &gmac_key, &ctx, - (const void *) v->iv, + IMB_AES256_GMAC_INIT(p_mgr, &gmac_key, &ctx, (const void *) v->iv, v->ivSize / 8); errno_update(p_mgr); - IMB_AES256_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, - (const void *) v->msg, + IMB_AES256_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, (const void *) v->msg, v->msgSize / 8); errno_update(p_mgr); - IMB_AES256_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, - scratch, v->tagSize / 8); + IMB_AES256_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tagSize / 8); errno_update(p_mgr); } @@ -367,7 +356,8 @@ static int test_gmac(IMB_MGR *p_mgr) extern const struct mac_test hmac_sha1_test_json[]; -static int test_hmac_sha1(IMB_MGR *p_mgr) +static int +test_hmac_sha1(IMB_MGR *p_mgr) { const struct mac_test *v = hmac_sha1_test_json; DECLARE_ALIGNED(uint8_t hmac_ipad[IMB_SHA1_DIGEST_SIZE_IN_BYTES], 16); @@ -377,7 +367,7 @@ static int test_hmac_sha1(IMB_MGR *p_mgr) while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for ( ; v->msg != NULL; v++, run_vectors++) { + for (; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT((v->tagSize / 8) <= sizeof(tag)); @@ -408,15 +398,13 @@ static int test_hmac_sha1(IMB_MGR *p_mgr) job->auth_tag_output = tag; /* @note smaller tags sizes can be rejected */ - if ((v->tagSize / 8) > 0 && - (v->tagSize / 8) <= IMB_SHA1_DIGEST_SIZE_IN_BYTES) - job->auth_tag_output_len_in_bytes = - IMB_SHA1_DIGEST_SIZE_IN_BYTES; + if ((v->tagSize / 8) > 0 && (v->tagSize / 8) <= IMB_SHA1_DIGEST_SIZE_IN_BYTES) + job->auth_tag_output_len_in_bytes = IMB_SHA1_DIGEST_SIZE_IN_BYTES; else job->auth_tag_output_len_in_bytes = v->tagSize / 8; - imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_1, - v->key, v->keySize / 8, hmac_ipad, hmac_opad); + imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_1, v->key, v->keySize / 8, hmac_ipad, + hmac_opad); job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; @@ -433,7 +421,8 @@ static int test_hmac_sha1(IMB_MGR *p_mgr) extern const struct mac_test hmac_sha224_test_json[]; -static int test_hmac_sha224(IMB_MGR *p_mgr) +static int +test_hmac_sha224(IMB_MGR *p_mgr) { const struct mac_test *v = hmac_sha224_test_json; DECLARE_ALIGNED(uint8_t hmac_ipad[IMB_SHA256_DIGEST_SIZE_IN_BYTES], 16); @@ -443,7 +432,7 @@ static int test_hmac_sha224(IMB_MGR *p_mgr) while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for ( ; v->msg != NULL; v++, run_vectors++) { + for (; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT((v->tagSize / 8) <= sizeof(tag)); /* tag too long */ @@ -473,8 +462,8 @@ static int test_hmac_sha224(IMB_MGR *p_mgr) job->auth_tag_output = tag; job->auth_tag_output_len_in_bytes = v->tagSize / 8; - imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_224, - v->key, v->keySize / 8, hmac_ipad, hmac_opad); + imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_224, v->key, v->keySize / 8, hmac_ipad, + hmac_opad); job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; @@ -491,7 +480,8 @@ static int test_hmac_sha224(IMB_MGR *p_mgr) extern const struct mac_test hmac_sha256_test_json[]; -static int test_hmac_sha256(IMB_MGR *p_mgr) +static int +test_hmac_sha256(IMB_MGR *p_mgr) { const struct mac_test *v = hmac_sha256_test_json; DECLARE_ALIGNED(uint8_t hmac_ipad[IMB_SHA256_DIGEST_SIZE_IN_BYTES], 16); @@ -501,7 +491,7 @@ static int test_hmac_sha256(IMB_MGR *p_mgr) while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for ( ; v->msg != NULL; v++, run_vectors++) { + for (; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT((v->tagSize / 8) <= sizeof(tag)); /* tag too long */ @@ -531,8 +521,8 @@ static int test_hmac_sha256(IMB_MGR *p_mgr) job->auth_tag_output = tag; job->auth_tag_output_len_in_bytes = v->tagSize / 8; - imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_256, - v->key, v->keySize / 8, hmac_ipad, hmac_opad); + imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_256, v->key, v->keySize / 8, hmac_ipad, + hmac_opad); job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; @@ -549,7 +539,8 @@ static int test_hmac_sha256(IMB_MGR *p_mgr) extern const struct mac_test hmac_sha384_test_json[]; -static int test_hmac_sha384(IMB_MGR *p_mgr) +static int +test_hmac_sha384(IMB_MGR *p_mgr) { const struct mac_test *v = hmac_sha384_test_json; DECLARE_ALIGNED(uint8_t hmac_ipad[IMB_SHA512_DIGEST_SIZE_IN_BYTES], 16); @@ -559,7 +550,7 @@ static int test_hmac_sha384(IMB_MGR *p_mgr) while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for ( ; v->msg != NULL; v++, run_vectors++) { + for (; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT((v->tagSize / 8) <= sizeof(scratch)); /* tag too long */ @@ -589,8 +580,8 @@ static int test_hmac_sha384(IMB_MGR *p_mgr) job->auth_tag_output = scratch; job->auth_tag_output_len_in_bytes = v->tagSize / 8; - imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_384, - v->key, v->keySize / 8, hmac_ipad, hmac_opad); + imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_384, v->key, v->keySize / 8, hmac_ipad, + hmac_opad); job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; @@ -607,7 +598,8 @@ static int test_hmac_sha384(IMB_MGR *p_mgr) extern const struct mac_test hmac_sha512_test_json[]; -static int test_hmac_sha512(IMB_MGR *p_mgr) +static int +test_hmac_sha512(IMB_MGR *p_mgr) { const struct mac_test *v = hmac_sha512_test_json; DECLARE_ALIGNED(uint8_t hmac_ipad[IMB_SHA512_DIGEST_SIZE_IN_BYTES], 16); @@ -617,7 +609,7 @@ static int test_hmac_sha512(IMB_MGR *p_mgr) while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for ( ; v->msg != NULL; v++, run_vectors++) { + for (; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT((v->tagSize / 8) <= sizeof(scratch)); /* tag too long */ @@ -647,8 +639,8 @@ static int test_hmac_sha512(IMB_MGR *p_mgr) job->auth_tag_output = scratch; job->auth_tag_output_len_in_bytes = v->tagSize / 8; - imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_512, - v->key, v->keySize / 8, hmac_ipad, hmac_opad); + imb_hmac_ipad_opad(p_mgr, IMB_AUTH_HMAC_SHA_512, v->key, v->keySize / 8, hmac_ipad, + hmac_opad); job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; @@ -669,7 +661,8 @@ static int test_hmac_sha512(IMB_MGR *p_mgr) * ============================================================================= */ -static void print_aead_test(const struct aead_test *v) +static void +print_aead_test(const struct aead_test *v) { printf("AEAD vector details:\n" " tcId = %u\n" @@ -679,19 +672,14 @@ static void print_aead_test(const struct aead_test *v) " aadSize = %u [bits]\n" " msgSize = %u [bits]\n" " resultValid = %d\n", - (unsigned)v->tcId, (unsigned)v->ivSize, - (unsigned)v->keySize, (unsigned)v->tagSize, - (unsigned)v->aadSize, (unsigned)v->msgSize, - (int)v->resultValid); + (unsigned) v->tcId, (unsigned) v->ivSize, (unsigned) v->keySize, + (unsigned) v->tagSize, (unsigned) v->aadSize, (unsigned) v->msgSize, + (int) v->resultValid); } static int -aead_submit_and_check(IMB_MGR *p_mgr, - const struct aead_test *v, - const void *res_tag, - const void *res_text, - const int job_api, - const int is_encrypt) +aead_submit_and_check(IMB_MGR *p_mgr, const struct aead_test *v, const void *res_tag, + const void *res_text, const int job_api, const int is_encrypt) { if (job_api) { /* submit job and get it processed */ @@ -710,8 +698,7 @@ aead_submit_and_check(IMB_MGR *p_mgr, if (v->resultValid) { print_aead_test(v); printf("DIRECT-API error!\n"); - printf("ERROR: %s\n", - imb_get_strerror(err_code)); + printf("ERROR: %s\n", imb_get_strerror(err_code)); return 0; } else { /* error was expected */ @@ -722,17 +709,15 @@ aead_submit_and_check(IMB_MGR *p_mgr, } const int tag_mismatch = memcmp(res_tag, v->tag, v->tagSize / 8); - const int text_mismatch = is_encrypt ? - memcmp(res_text, v->ct, v->msgSize / 8) : - memcmp(res_text, v->msg, v->msgSize / 8); + const int text_mismatch = is_encrypt ? memcmp(res_text, v->ct, v->msgSize / 8) + : memcmp(res_text, v->msg, v->msgSize / 8); if (v->resultValid == 0 && (tag_mismatch || text_mismatch)) return 1; /* check for TAG mismatch */ if (tag_mismatch) { - printf("%s %s: TAG mismatch!\n", - job_api ? "JOB-API" : "DIRECT-API", + printf("%s %s: TAG mismatch!\n", job_api ? "JOB-API" : "DIRECT-API", is_encrypt ? "encrypt" : "decrypt"); print_aead_test(v); return 0; @@ -740,10 +725,8 @@ aead_submit_and_check(IMB_MGR *p_mgr, /* check for text mismatch */ if (text_mismatch) { - printf("%s %s mismatch!\n", - job_api ? "JOB-API" : "DIRECT-API", - is_encrypt ? "encrypt: cipher-text" : - "decrypt: plain-text"); + printf("%s %s mismatch!\n", job_api ? "JOB-API" : "DIRECT-API", + is_encrypt ? "encrypt: cipher-text" : "decrypt: plain-text"); print_aead_test(v); return 0; } @@ -753,7 +736,8 @@ aead_submit_and_check(IMB_MGR *p_mgr, extern const struct aead_test aes_gcm_test_json[]; -static int test_aead_gcm(IMB_MGR *p_mgr) +static int +test_aead_gcm(IMB_MGR *p_mgr) { const struct aead_test *v = NULL; struct gcm_key_data gcm_key; @@ -789,8 +773,7 @@ static int test_aead_gcm(IMB_MGR *p_mgr) IMB_AES256_GCM_PRE(p_mgr, v->key, &gcm_key); break; default: - printf("Invalid key size: %u bytes!\n", - (unsigned)v->keySize / 8); + printf("Invalid key size: %u bytes!\n", (unsigned) v->keySize / 8); print_aead_test(v); return 0; } @@ -861,53 +844,40 @@ static int test_aead_gcm(IMB_MGR *p_mgr) switch (v->keySize / 8) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - (const void *) v->iv, - v->ivSize / 8, - (const void *) v->aad, + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, (const void *) v->iv, + v->ivSize / 8, (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); IMB_AES128_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, - (const void *) v->msg, - v->msgSize / 8); + (const void *) v->msg, v->msgSize / 8); errno_update(p_mgr); - IMB_AES128_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tagSize / 8); + IMB_AES128_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - (const void *) v->iv, - v->ivSize / 8, - (const void *) v->aad, + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, (const void *) v->iv, + v->ivSize / 8, (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); IMB_AES192_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, - (const void *) v->msg, - v->msgSize / 8); + (const void *) v->msg, v->msgSize / 8); errno_update(p_mgr); - IMB_AES192_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tagSize / 8); + IMB_AES192_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); break; case IMB_KEY_256_BYTES: - IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - (const void *) v->iv, - v->ivSize / 8, - (const void *) v->aad, + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, (const void *) v->iv, + v->ivSize / 8, (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); IMB_AES256_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, - (const void *) v->msg, - v->msgSize / 8); + (const void *) v->msg, v->msgSize / 8); errno_update(p_mgr); - IMB_AES256_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tagSize / 8); + IMB_AES256_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); break; default: - printf("Invalid key size: %u bytes!\n", - (unsigned)v->keySize / 8); + printf("Invalid key size: %u bytes!\n", (unsigned) v->keySize / 8); print_aead_test(v); return 0; } @@ -921,53 +891,40 @@ static int test_aead_gcm(IMB_MGR *p_mgr) errno_reset(); switch (v->keySize / 8) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - (const void *) v->iv, - v->ivSize / 8, - (const void *) v->aad, + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, (const void *) v->iv, + v->ivSize / 8, (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); - IMB_AES128_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, - (const void *) v->ct, + IMB_AES128_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, (const void *) v->ct, v->msgSize / 8); errno_update(p_mgr); - IMB_AES128_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tagSize / 8); + IMB_AES128_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - (const void *) v->iv, - v->ivSize / 8, - (const void *) v->aad, + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, (const void *) v->iv, + v->ivSize / 8, (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); - IMB_AES192_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, - (const void *) v->ct, + IMB_AES192_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, (const void *) v->ct, v->msgSize / 8); errno_update(p_mgr); - IMB_AES192_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tagSize / 8); + IMB_AES192_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); break; case IMB_KEY_256_BYTES: - IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - (const void *) v->iv, - v->ivSize / 8, - (const void *) v->aad, + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, (const void *) v->iv, + v->ivSize / 8, (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); - IMB_AES256_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, - (const void *) v->ct, + IMB_AES256_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, (const void *) v->ct, v->msgSize / 8); errno_update(p_mgr); - IMB_AES256_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tagSize / 8); + IMB_AES256_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); break; default: - printf("Invalid key size: %u bytes!\n", - (unsigned)v->keySize / 8); + printf("Invalid key size: %u bytes!\n", (unsigned) v->keySize / 8); print_aead_test(v); return 0; } @@ -981,7 +938,8 @@ static int test_aead_gcm(IMB_MGR *p_mgr) extern const struct aead_test chacha20_poly1305_test_json[]; -static int test_aead_chacha20_poly1305(IMB_MGR *p_mgr) +static int +test_aead_chacha20_poly1305(IMB_MGR *p_mgr) { const struct aead_test *v = NULL; struct chacha20_poly1305_context_data ctx; @@ -990,8 +948,7 @@ static int test_aead_chacha20_poly1305(IMB_MGR *p_mgr) while (IMB_FLUSH_JOB(p_mgr) != NULL) ; - for (v = chacha20_poly1305_test_json; v->msg != NULL; - v++, run_vectors++) { + for (v = chacha20_poly1305_test_json; v->msg != NULL; v++, run_vectors++) { IMB_ASSERT(v->tagSize <= (sizeof(tag) * 8)); IMB_ASSERT(v->msgSize <= (sizeof(text) * 8)); @@ -1074,18 +1031,13 @@ static int test_aead_chacha20_poly1305(IMB_MGR *p_mgr) memset(tag, 0, sizeof(tag)); errno_reset(); - IMB_CHACHA20_POLY1305_INIT(p_mgr, (const void *) v->key, &ctx, - (const void *) v->iv, - (const void *) v->aad, - v->aadSize / 8); + IMB_CHACHA20_POLY1305_INIT(p_mgr, (const void *) v->key, &ctx, (const void *) v->iv, + (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); - IMB_CHACHA20_POLY1305_ENC_UPDATE(p_mgr, (const void *) v->key, - &ctx, text, - (const void *) v->msg, - v->msgSize / 8); + IMB_CHACHA20_POLY1305_ENC_UPDATE(p_mgr, (const void *) v->key, &ctx, text, + (const void *) v->msg, v->msgSize / 8); errno_update(p_mgr); - IMB_CHACHA20_POLY1305_ENC_FINALIZE(p_mgr, &ctx, tag, - v->tagSize / 8); + IMB_CHACHA20_POLY1305_ENC_FINALIZE(p_mgr, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); /* submit job and check */ @@ -1097,18 +1049,13 @@ static int test_aead_chacha20_poly1305(IMB_MGR *p_mgr) memset(tag, 0, sizeof(tag)); errno_reset(); - IMB_CHACHA20_POLY1305_INIT(p_mgr, (const void *) v->key, &ctx, - (const void *) v->iv, - (const void *) v->aad, - v->aadSize / 8); + IMB_CHACHA20_POLY1305_INIT(p_mgr, (const void *) v->key, &ctx, (const void *) v->iv, + (const void *) v->aad, v->aadSize / 8); errno_update(p_mgr); - IMB_CHACHA20_POLY1305_DEC_UPDATE(p_mgr, (const void *) v->key, - &ctx, text, - (const void *) v->ct, - v->msgSize / 8); + IMB_CHACHA20_POLY1305_DEC_UPDATE(p_mgr, (const void *) v->key, &ctx, text, + (const void *) v->ct, v->msgSize / 8); errno_update(p_mgr); - IMB_CHACHA20_POLY1305_DEC_FINALIZE(p_mgr, &ctx, tag, - v->tagSize / 8); + IMB_CHACHA20_POLY1305_DEC_FINALIZE(p_mgr, &ctx, tag, v->tagSize / 8); errno_update(p_mgr); /* submit job and check */ @@ -1121,11 +1068,12 @@ static int test_aead_chacha20_poly1305(IMB_MGR *p_mgr) extern const struct aead_test aes_ccm_test_json[]; -static int test_aead_ccm(IMB_MGR *p_mgr) +static int +test_aead_ccm(IMB_MGR *p_mgr) { const struct aead_test *v = NULL; - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint8_t text[512], tag[16]; while (IMB_FLUSH_JOB(p_mgr) != NULL) @@ -1168,8 +1116,7 @@ static int test_aead_ccm(IMB_MGR *p_mgr) skip_vectors++; continue; default: - printf("Invalid key size: %u bytes!\n", - (unsigned)v->keySize / 8); + printf("Invalid key size: %u bytes!\n", (unsigned) v->keySize / 8); print_aead_test(v); return 0; } @@ -1233,28 +1180,27 @@ static int test_aead_ccm(IMB_MGR *p_mgr) /* submit job and check */ if (!aead_submit_and_check(p_mgr, v, tag, text, 1, 0)) return 0; - } /* for(ccm_vectors) */ + } /* for(ccm_vectors) */ return 1; } -static int test_all(IMB_MGR *p_mgr) +static int +test_all(IMB_MGR *p_mgr) { const struct { int (*fn)(IMB_MGR *); const char *name; - } test_tab[] = { - { test_aead_gcm, "AEAD AES-GCM" }, - { test_aead_ccm, "AEAD AES-CCM" }, - { test_aead_chacha20_poly1305, "AEAD CHACHA20-POLY1305" }, - { test_cmac, "AES-CMAC" }, - { test_gmac, "GMAC" }, - { test_hmac_sha1, "HMAC-SHA1" }, - { test_hmac_sha224, "HMAC-SHA224" }, - { test_hmac_sha256, "HMAC-SHA256" }, - { test_hmac_sha384, "HMAC-SHA384" }, - { test_hmac_sha512, "HMAC-SHA512" } - }; + } test_tab[] = { { test_aead_gcm, "AEAD AES-GCM" }, + { test_aead_ccm, "AEAD AES-CCM" }, + { test_aead_chacha20_poly1305, "AEAD CHACHA20-POLY1305" }, + { test_cmac, "AES-CMAC" }, + { test_gmac, "GMAC" }, + { test_hmac_sha1, "HMAC-SHA1" }, + { test_hmac_sha224, "HMAC-SHA224" }, + { test_hmac_sha256, "HMAC-SHA256" }, + { test_hmac_sha384, "HMAC-SHA384" }, + { test_hmac_sha512, "HMAC-SHA512" } }; unsigned i; int ret = 1; @@ -1265,8 +1211,8 @@ static int test_all(IMB_MGR *p_mgr) printf("Testing %s: FAILED\n", test_tab[i].name); ret = 0; } else { - printf("Testing %s: PASSED (run: %u, skipped: %u)\n", - test_tab[i].name, run_vectors, skip_vectors); + printf("Testing %s: PASSED (run: %u, skipped: %u)\n", test_tab[i].name, + run_vectors, skip_vectors); } total_run_vectors += run_vectors; total_skip_vectors += skip_vectors; @@ -1274,7 +1220,6 @@ static int test_all(IMB_MGR *p_mgr) return ret; } - /* * ============================================================================= * MAIN @@ -1284,7 +1229,7 @@ static int test_all(IMB_MGR *p_mgr) static void usage(const char *name) { - printf("Usage: %s [args], where args are zero or more\n" + printf("Usage: %s [args], where args are zero or more\n" "--aesni-emu test AESNI emulation interface\n" "--avx512 test AVX512 interface\n" "--avx2 test AVX2 interface\n" @@ -1293,10 +1238,12 @@ usage(const char *name) "--shani-off don't use SHA extensions " "(auto-detect by default)\n" "--gfni-off don't use GFNI extensions " - "(auto-detect by default)\n", name); + "(auto-detect by default)\n", + name); } -int main(int argc, const char **argv) +int +main(int argc, const char **argv) { IMB_ARCH arch_to_run = IMB_ARCH_NUM; uint64_t flags = 0; @@ -1311,11 +1258,10 @@ int main(int argc, const char **argv) printf("Library version: %s\n", imb_get_version_str()); } - for (i = 1; i < argc; i++) { - if ((strcmp(argv[i], "-h") == 0) || - (strcmp(argv[i], "--help") == 0)) { - usage(argv[0]); - return EXIT_SUCCESS; + for (i = 1; i < argc; i++) { + if ((strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "--help") == 0)) { + usage(argv[0]); + return EXIT_SUCCESS; } else if (strcmp(argv[i], "--aesni-emu") == 0) { flags |= IMB_FLAG_AESNI_OFF; arch_to_run = IMB_ARCH_NOAESNI; @@ -1371,8 +1317,7 @@ int main(int argc, const char **argv) if (p_mgr->features & IMB_FEATURE_SELF_TEST) printf("SELF-TEST: %s\n", - (p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) ? - "PASS" : "FAIL"); + (p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) ? "PASS" : "FAIL"); else printf("SELF-TEST: N/A (requires library >= v1.3)\n"); @@ -1389,8 +1334,8 @@ int main(int argc, const char **argv) return EXIT_FAILURE; } - printf("Test complete: PASSED (run: %u, skipped: %u)\n", - total_run_vectors, total_skip_vectors); + printf("Test complete: PASSED (run: %u, skipped: %u)\n", total_run_vectors, + total_skip_vectors); free_mb_mgr(p_mgr); return EXIT_SUCCESS; diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 374a72b6..07f7965f 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -45,7 +45,7 @@ #ifdef _WIN32 #include -#define strdup _strdup +#define strdup _strdup #define BSWAP64 _byteswap_uint64 #define __func__ __FUNCTION__ #define strcasecmp _stricmp @@ -72,24 +72,24 @@ #define MAX_GCM_AAD_SIZE 1024 #define MAX_CCM_AAD_SIZE 46 -#define MAX_AAD_SIZE 1024 -#define NUM_TAG_SIZES 7 +#define MAX_AAD_SIZE 1024 +#define NUM_TAG_SIZES 7 -#define MAX_IV_SIZE 25 /* IV size for ZUC-256 */ +#define MAX_IV_SIZE 25 /* IV size for ZUC-256 */ #define MAX_TAG_SIZE 16 /* Max tag size for ZUC-256 */ #define MAX_NUM_JOBS 32 -#define IMIX_ITER 1000 +#define IMIX_ITER 1000 /* Maximum key and digest size for SHA-512 */ #define MAX_KEY_SIZE IMB_SHA_512_BLOCK_SIZE #define MAX_DIGEST_SIZE IMB_SHA512_DIGEST_SIZE_IN_BYTES -#define SEED 0xdeadcafe +#define SEED 0xdeadcafe #define STACK_DEPTH 8192 /* Max safe check retries to eliminate false positives */ -#define MAX_SAFE_RETRIES 100 +#define MAX_SAFE_RETRIES 100 #define DEFAULT_SAFE_RETRIES 2 static int pattern_auth_key; @@ -103,12 +103,12 @@ static uint64_t pattern8_plain_text; /* Struct storing cipher parameters */ struct params_s { - IMB_CIPHER_MODE cipher_mode; /* CBC, CNTR, DES, GCM etc. */ - IMB_HASH_ALG hash_alg; /* SHA-1 or others... */ - uint32_t key_size; - uint32_t buf_size; - uint64_t aad_size; - uint32_t num_sizes; + IMB_CIPHER_MODE cipher_mode; /* CBC, CNTR, DES, GCM etc. */ + IMB_HASH_ALG hash_alg; /* SHA-1 or others... */ + uint32_t key_size; + uint32_t buf_size; + uint64_t aad_size; + uint32_t num_sizes; }; /* Struct storing all expanded keys */ @@ -118,8 +118,8 @@ struct cipher_auth_keys { uint8_t ipad[IMB_SHA512_DIGEST_SIZE_IN_BYTES]; uint8_t opad[IMB_SHA512_DIGEST_SIZE_IN_BYTES]; DECLARE_ALIGNED(uint32_t k1_expanded[15 * 4], 16); - DECLARE_ALIGNED(uint8_t k2[32], 16); - DECLARE_ALIGNED(uint8_t k3[16], 16); + DECLARE_ALIGNED(uint8_t k2[32], 16); + DECLARE_ALIGNED(uint8_t k3[16], 16); DECLARE_ALIGNED(uint32_t enc_keys[15 * 4], 16); DECLARE_ALIGNED(uint32_t dec_keys[15 * 4], 16); DECLARE_ALIGNED(struct gcm_key_data gdata_key, 64); @@ -142,217 +142,97 @@ struct data { }; struct custom_job_params { - IMB_CIPHER_MODE cipher_mode; /* CBC, CNTR, DES, GCM etc. */ - IMB_HASH_ALG hash_alg; /* SHA-1 or others... */ - uint32_t key_size; + IMB_CIPHER_MODE cipher_mode; /* CBC, CNTR, DES, GCM etc. */ + IMB_HASH_ALG hash_alg; /* SHA-1 or others... */ + uint32_t key_size; }; union params { - IMB_ARCH arch_type; + IMB_ARCH arch_type; struct custom_job_params job_params; }; struct str_value_mapping { - const char *name; - union params values; + const char *name; + union params values; }; const struct str_value_mapping arch_str_map[] = { #ifndef __aarch64__ - {.name = "NONE", .values.arch_type = IMB_ARCH_NONE }, - {.name = "SSE", .values.arch_type = IMB_ARCH_SSE }, - {.name = "NO-AESNI", .values.arch_type = IMB_ARCH_NOAESNI }, - {.name = "AVX", .values.arch_type = IMB_ARCH_AVX }, - {.name = "AVX2", .values.arch_type = IMB_ARCH_AVX2 }, - {.name = "AVX512", .values.arch_type = IMB_ARCH_AVX512 } + { .name = "NONE", .values.arch_type = IMB_ARCH_NONE }, + { .name = "SSE", .values.arch_type = IMB_ARCH_SSE }, + { .name = "NO-AESNI", .values.arch_type = IMB_ARCH_NOAESNI }, + { .name = "AVX", .values.arch_type = IMB_ARCH_AVX }, + { .name = "AVX2", .values.arch_type = IMB_ARCH_AVX2 }, + { .name = "AVX512", .values.arch_type = IMB_ARCH_AVX512 } #else - {.name = "NONE", .values.arch_type = IMB_ARCH_NONE }, - {.name = "NO-AESNI", .values.arch_type = IMB_ARCH_NOAESNI }, - {.name = "AARCH64", .values.arch_type = IMB_ARCH_AARCH64 }, - {.name = "SVE256", .values.arch_type = IMB_ARCH_SVE256 } + { .name = "NONE", .values.arch_type = IMB_ARCH_NONE }, + { .name = "NO-AESNI", .values.arch_type = IMB_ARCH_NOAESNI }, + { .name = "AARCH64", .values.arch_type = IMB_ARCH_AARCH64 }, + { .name = "SVE256", .values.arch_type = IMB_ARCH_SVE256 } #endif }; struct str_value_mapping cipher_algo_str_map[] = { #ifndef __aarch64__ - { - .name = "AES-CBC-128", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CBC, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "AES-CBC-192", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CBC, - .key_size = IMB_KEY_192_BYTES - } - }, - { - .name = "AES-CBC-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CBC, - .key_size = IMB_KEY_256_BYTES - } - }, - { - .name = "AES-CTR-128", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CNTR, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "AES-CTR-192", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CNTR, - .key_size = IMB_KEY_192_BYTES - } - }, - { - .name = "AES-CTR-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CNTR, - .key_size = IMB_KEY_256_BYTES - } - }, - { - .name = "AES-CTR-128-BIT-LENGTH", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CNTR_BITLEN, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "AES-CTR-192-BIT-LENGTH", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CNTR_BITLEN, - .key_size = IMB_KEY_192_BYTES - } - }, - { - .name = "AES-CTR-256-BIT-LENGTH", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CNTR_BITLEN, - .key_size = IMB_KEY_256_BYTES - } - }, - { - .name = "AES-ECB-128", - .values.job_params = { - .cipher_mode = IMB_CIPHER_ECB, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "AES-ECB-192", - .values.job_params = { - .cipher_mode = IMB_CIPHER_ECB, - .key_size = IMB_KEY_192_BYTES - } - }, - { - .name = "AES-ECB-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_ECB, - .key_size = IMB_KEY_256_BYTES - } - }, - { - .name = "DOCSIS-SEC-128", - .values.job_params = { - .cipher_mode = IMB_CIPHER_DOCSIS_SEC_BPI, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "DOCSIS-SEC-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_DOCSIS_SEC_BPI, - .key_size = IMB_KEY_256_BYTES - } - }, - { - .name = "DOCSIS-DES-64", - .values.job_params = { - .cipher_mode = IMB_CIPHER_DOCSIS_DES, - .key_size = 8 - } - }, - { - .name = "DES-CBC-64", - .values.job_params = { - .cipher_mode = IMB_CIPHER_DES, - .key_size = 8 - } - }, - { - .name = "3DES-CBC-192", - .values.job_params = { - .cipher_mode = IMB_CIPHER_DES3, - .key_size = 24 - } - }, + { .name = "AES-CBC-128", + .values.job_params = { .cipher_mode = IMB_CIPHER_CBC, .key_size = IMB_KEY_128_BYTES } }, + { .name = "AES-CBC-192", + .values.job_params = { .cipher_mode = IMB_CIPHER_CBC, .key_size = IMB_KEY_192_BYTES } }, + { .name = "AES-CBC-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_CBC, .key_size = IMB_KEY_256_BYTES } }, + { .name = "AES-CTR-128", + .values.job_params = { .cipher_mode = IMB_CIPHER_CNTR, .key_size = IMB_KEY_128_BYTES } }, + { .name = "AES-CTR-192", + .values.job_params = { .cipher_mode = IMB_CIPHER_CNTR, .key_size = IMB_KEY_192_BYTES } }, + { .name = "AES-CTR-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_CNTR, .key_size = IMB_KEY_256_BYTES } }, + { .name = "AES-CTR-128-BIT-LENGTH", + .values.job_params = { .cipher_mode = IMB_CIPHER_CNTR_BITLEN, + .key_size = IMB_KEY_128_BYTES } }, + { .name = "AES-CTR-192-BIT-LENGTH", + .values.job_params = { .cipher_mode = IMB_CIPHER_CNTR_BITLEN, + .key_size = IMB_KEY_192_BYTES } }, + { .name = "AES-CTR-256-BIT-LENGTH", + .values.job_params = { .cipher_mode = IMB_CIPHER_CNTR_BITLEN, + .key_size = IMB_KEY_256_BYTES } }, + { .name = "AES-ECB-128", + .values.job_params = { .cipher_mode = IMB_CIPHER_ECB, .key_size = IMB_KEY_128_BYTES } }, + { .name = "AES-ECB-192", + .values.job_params = { .cipher_mode = IMB_CIPHER_ECB, .key_size = IMB_KEY_192_BYTES } }, + { .name = "AES-ECB-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_ECB, .key_size = IMB_KEY_256_BYTES } }, + { .name = "DOCSIS-SEC-128", + .values.job_params = { .cipher_mode = IMB_CIPHER_DOCSIS_SEC_BPI, + .key_size = IMB_KEY_128_BYTES } }, + { .name = "DOCSIS-SEC-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_DOCSIS_SEC_BPI, + .key_size = IMB_KEY_256_BYTES } }, + { .name = "DOCSIS-DES-64", + .values.job_params = { .cipher_mode = IMB_CIPHER_DOCSIS_DES, .key_size = 8 } }, + { .name = "DES-CBC-64", + .values.job_params = { .cipher_mode = IMB_CIPHER_DES, .key_size = 8 } }, + { .name = "3DES-CBC-192", + .values.job_params = { .cipher_mode = IMB_CIPHER_DES3, .key_size = 24 } }, #endif /* __aarch64__ */ - { - .name = "ZUC-EEA3", - .values.job_params = { - .cipher_mode = IMB_CIPHER_ZUC_EEA3, - .key_size = 16 - } - }, - { - .name = "ZUC-EEA3-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_ZUC_EEA3, - .key_size = 32 - } - }, - { - .name = "SNOW3G-UEA2", - .values.job_params = { - .cipher_mode = IMB_CIPHER_SNOW3G_UEA2_BITLEN, - .key_size = 16 - } - }, + { .name = "ZUC-EEA3", + .values.job_params = { .cipher_mode = IMB_CIPHER_ZUC_EEA3, .key_size = 16 } }, + { .name = "ZUC-EEA3-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_ZUC_EEA3, .key_size = 32 } }, + { .name = "SNOW3G-UEA2", + .values.job_params = { .cipher_mode = IMB_CIPHER_SNOW3G_UEA2_BITLEN, .key_size = 16 } }, #ifndef __aarch64__ - { - .name = "KASUMI-F8", - .values.job_params = { - .cipher_mode = IMB_CIPHER_KASUMI_UEA1_BITLEN, - .key_size = 16 - } - }, - { - .name = "AES-CBCS-128", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CBCS_1_9, - .key_size = 16 - } - }, - { - .name = "CHACHA20-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CHACHA20, - .key_size = 32 - } - }, - { - .name = "SNOW-V", - .values.job_params = { - .cipher_mode = IMB_CIPHER_SNOW_V, - .key_size = 32 - } - }, + { .name = "KASUMI-F8", + .values.job_params = { .cipher_mode = IMB_CIPHER_KASUMI_UEA1_BITLEN, .key_size = 16 } }, + { .name = "AES-CBCS-128", + .values.job_params = { .cipher_mode = IMB_CIPHER_CBCS_1_9, .key_size = 16 } }, + { .name = "CHACHA20-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_CHACHA20, .key_size = 32 } }, + { .name = "SNOW-V", + .values.job_params = { .cipher_mode = IMB_CIPHER_SNOW_V, .key_size = 32 } }, #endif /* __aarch64__ */ - { - .name = "NULL-CIPHER", - .values.job_params = { - .cipher_mode = IMB_CIPHER_NULL, - .key_size = 0 - } - } + { .name = "NULL-CIPHER", + .values.job_params = { .cipher_mode = IMB_CIPHER_NULL, .key_size = 0 } } }; struct str_value_mapping hash_algo_str_map[] = { @@ -582,78 +462,42 @@ struct str_value_mapping hash_algo_str_map[] = { struct str_value_mapping aead_algo_str_map[] = { #ifndef __aarch64__ - { - .name = "AES-GCM-128", - .values.job_params = { - .cipher_mode = IMB_CIPHER_GCM, - .hash_alg = IMB_AUTH_AES_GMAC, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "AES-GCM-192", - .values.job_params = { - .cipher_mode = IMB_CIPHER_GCM, - .hash_alg = IMB_AUTH_AES_GMAC, - .key_size = IMB_KEY_192_BYTES - } - }, - { - .name = "AES-GCM-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_GCM, - .hash_alg = IMB_AUTH_AES_GMAC, - .key_size = IMB_KEY_256_BYTES - } - }, - { - .name = "AES-CCM-128", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CCM, - .hash_alg = IMB_AUTH_AES_CCM, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "AES-CCM-256", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CCM, - .hash_alg = IMB_AUTH_AES_CCM, - .key_size = IMB_KEY_256_BYTES - } - }, - { - .name = "PON-128-BIP-CRC32", - .values.job_params = { - .cipher_mode = IMB_CIPHER_PON_AES_CNTR, - .hash_alg = IMB_AUTH_PON_CRC_BIP, - .key_size = IMB_KEY_128_BYTES - } - }, - { - .name = "PON-128-NO-CTR", - .values.job_params = { - .cipher_mode = IMB_CIPHER_PON_AES_CNTR, - .hash_alg = IMB_AUTH_PON_CRC_BIP, - .key_size = 0 - } - }, - { - .name = "AEAD-CHACHA20-256-POLY1305", - .values.job_params = { - .cipher_mode = IMB_CIPHER_CHACHA20_POLY1305, - .hash_alg = IMB_AUTH_CHACHA20_POLY1305, - .key_size = 32 - } - }, - { - .name = "SNOW-V-AEAD", - .values.job_params = { - .cipher_mode = IMB_CIPHER_SNOW_V_AEAD, - .hash_alg = IMB_AUTH_SNOW_V_AEAD, - .key_size = 32 - } - }, + { .name = "AES-GCM-128", + .values.job_params = { .cipher_mode = IMB_CIPHER_GCM, + .hash_alg = IMB_AUTH_AES_GMAC, + .key_size = IMB_KEY_128_BYTES } }, + { .name = "AES-GCM-192", + .values.job_params = { .cipher_mode = IMB_CIPHER_GCM, + .hash_alg = IMB_AUTH_AES_GMAC, + .key_size = IMB_KEY_192_BYTES } }, + { .name = "AES-GCM-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_GCM, + .hash_alg = IMB_AUTH_AES_GMAC, + .key_size = IMB_KEY_256_BYTES } }, + { .name = "AES-CCM-128", + .values.job_params = { .cipher_mode = IMB_CIPHER_CCM, + .hash_alg = IMB_AUTH_AES_CCM, + .key_size = IMB_KEY_128_BYTES } }, + { .name = "AES-CCM-256", + .values.job_params = { .cipher_mode = IMB_CIPHER_CCM, + .hash_alg = IMB_AUTH_AES_CCM, + .key_size = IMB_KEY_256_BYTES } }, + { .name = "PON-128-BIP-CRC32", + .values.job_params = { .cipher_mode = IMB_CIPHER_PON_AES_CNTR, + .hash_alg = IMB_AUTH_PON_CRC_BIP, + .key_size = IMB_KEY_128_BYTES } }, + { .name = "PON-128-NO-CTR", + .values.job_params = { .cipher_mode = IMB_CIPHER_PON_AES_CNTR, + .hash_alg = IMB_AUTH_PON_CRC_BIP, + .key_size = 0 } }, + { .name = "AEAD-CHACHA20-256-POLY1305", + .values.job_params = { .cipher_mode = IMB_CIPHER_CHACHA20_POLY1305, + .hash_alg = IMB_AUTH_CHACHA20_POLY1305, + .key_size = 32 } }, + { .name = "SNOW-V-AEAD", + .values.job_params = { .cipher_mode = IMB_CIPHER_SNOW_V_AEAD, + .hash_alg = IMB_AUTH_SNOW_V_AEAD, + .key_size = 32 } }, #endif /* __aarch64__ */ }; @@ -663,94 +507,88 @@ struct variant_s { }; const uint8_t auth_tag_len_bytes[] = { - 12, /* IMB_AUTH_HMAC_SHA_1 */ - 14, /* IMB_AUTH_HMAC_SHA_224 */ - 16, /* IMB_AUTH_HMAC_SHA_256 */ - 24, /* IMB_AUTH_HMAC_SHA_384 */ - 32, /* IMB_AUTH_HMAC_SHA_512 */ - 12, /* IMB_AUTH_AES_XCBC */ - 12, /* IMB_AUTH_MD5 */ - 0, /* IMB_AUTH_NULL */ - 16, /* IMB_AUTH_AES_GMAC */ - 0, /* IMB_AUTH_CUSTOM HASH */ - 16, /* IMB_AES_CCM */ - 16, /* IMB_AES_CMAC */ - 20, /* IMB_PLAIN_SHA1 */ - 28, /* IMB_PLAIN_SHA_224 */ - 32, /* IMB_PLAIN_SHA_256 */ - 48, /* IMB_PLAIN_SHA_384 */ - 64, /* IMB_PLAIN_SHA_512 */ - 4, /* IMB_AES_CMAC_BITLEN (3GPP) */ - 8, /* IMB_PON */ - 4, /* IMB_ZUC_EIA3_BITLEN */ - IMB_DOCSIS_CRC32_TAG_SIZE, /* IMB_AUTH_DOCSIS_CRC32 */ - 4, /* IMB_AUTH_SNOW3G_UIA2_BITLEN (3GPP) */ - 4, /* IMB_AUTH_KASUMI_UIA1 (3GPP) */ - 16, /* IMB_AUTH_AES_GMAC_128 */ - 16, /* IMB_AUTH_AES_GMAC_192 */ - 16, /* IMB_AUTH_AES_GMAC_256 */ - 16, /* IMB_AUTH_AES_CMAC_256 */ - 16, /* IMB_AUTH_POLY1305 */ - 16, /* IMB_AUTH_CHACHA20_POLY1305 */ - 16, /* IMB_AUTH_CHACHA20_POLY1305_SGL */ - 4, /* IMB_AUTH_ZUC256_EIA3_BITLEN */ - 16, /* IMB_AUTH_SNOW_V_AEAD */ - 16, /* IMB_AUTH_AES_GCM_SGL */ - 4, /* IMB_AUTH_CRC32_ETHERNET_FCS */ - 4, /* IMB_AUTH_CRC32_SCTP */ - 4, /* IMB_AUTH_CRC32_WIMAX_OFDMA_DATA */ - 4, /* IMB_AUTH_CRC24_LTE_A */ - 4, /* IMB_AUTH_CRC24_LTE_B */ - 4, /* IMB_AUTH_CRC16_X25 */ - 4, /* IMB_AUTH_CRC16_FP_DATA */ - 4, /* IMB_AUTH_CRC11_FP_HEADER */ - 4, /* IMB_AUTH_CRC10_IUUP_DATA */ - 4, /* IMB_AUTH_CRC8_WIMAX_OFDMA_HCS */ - 4, /* IMB_AUTH_CRC7_FP_HEADER */ - 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ - 16, /* IMB_AUTH_GHASH */ + 12, /* IMB_AUTH_HMAC_SHA_1 */ + 14, /* IMB_AUTH_HMAC_SHA_224 */ + 16, /* IMB_AUTH_HMAC_SHA_256 */ + 24, /* IMB_AUTH_HMAC_SHA_384 */ + 32, /* IMB_AUTH_HMAC_SHA_512 */ + 12, /* IMB_AUTH_AES_XCBC */ + 12, /* IMB_AUTH_MD5 */ + 0, /* IMB_AUTH_NULL */ + 16, /* IMB_AUTH_AES_GMAC */ + 0, /* IMB_AUTH_CUSTOM HASH */ + 16, /* IMB_AES_CCM */ + 16, /* IMB_AES_CMAC */ + 20, /* IMB_PLAIN_SHA1 */ + 28, /* IMB_PLAIN_SHA_224 */ + 32, /* IMB_PLAIN_SHA_256 */ + 48, /* IMB_PLAIN_SHA_384 */ + 64, /* IMB_PLAIN_SHA_512 */ + 4, /* IMB_AES_CMAC_BITLEN (3GPP) */ + 8, /* IMB_PON */ + 4, /* IMB_ZUC_EIA3_BITLEN */ + IMB_DOCSIS_CRC32_TAG_SIZE, /* IMB_AUTH_DOCSIS_CRC32 */ + 4, /* IMB_AUTH_SNOW3G_UIA2_BITLEN (3GPP) */ + 4, /* IMB_AUTH_KASUMI_UIA1 (3GPP) */ + 16, /* IMB_AUTH_AES_GMAC_128 */ + 16, /* IMB_AUTH_AES_GMAC_192 */ + 16, /* IMB_AUTH_AES_GMAC_256 */ + 16, /* IMB_AUTH_AES_CMAC_256 */ + 16, /* IMB_AUTH_POLY1305 */ + 16, /* IMB_AUTH_CHACHA20_POLY1305 */ + 16, /* IMB_AUTH_CHACHA20_POLY1305_SGL */ + 4, /* IMB_AUTH_ZUC256_EIA3_BITLEN */ + 16, /* IMB_AUTH_SNOW_V_AEAD */ + 16, /* IMB_AUTH_AES_GCM_SGL */ + 4, /* IMB_AUTH_CRC32_ETHERNET_FCS */ + 4, /* IMB_AUTH_CRC32_SCTP */ + 4, /* IMB_AUTH_CRC32_WIMAX_OFDMA_DATA */ + 4, /* IMB_AUTH_CRC24_LTE_A */ + 4, /* IMB_AUTH_CRC24_LTE_B */ + 4, /* IMB_AUTH_CRC16_X25 */ + 4, /* IMB_AUTH_CRC16_FP_DATA */ + 4, /* IMB_AUTH_CRC11_FP_HEADER */ + 4, /* IMB_AUTH_CRC10_IUUP_DATA */ + 4, /* IMB_AUTH_CRC8_WIMAX_OFDMA_HCS */ + 4, /* IMB_AUTH_CRC7_FP_HEADER */ + 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ + 16, /* IMB_AUTH_GHASH */ }; /* Minimum, maximum and step values of key sizes */ const uint8_t key_sizes[][3] = { - {16, 32, 8}, /* IMB_CIPHER_CBC */ - {16, 32, 8}, /* IMB_CIPHER_CNTR */ - {0, 0, 1}, /* IMB_CIPHER_NULL */ - {16, 32, 16}, /* IMB_CIPHER_DOCSIS_SEC_BPI */ - {16, 32, 8}, /* IMB_CIPHER_GCM */ - {0, 0, 1}, /* IMB_CIPHER_CUSTOM */ - {8, 8, 1}, /* IMB_CIPHER_DES */ - {8, 8, 1}, /* IMB_CIPHER_DOCSIS_DES */ - {16, 32, 16},/* IMB_CIPHER_CCM */ - {24, 24, 1}, /* IMB_CIPHER_DES3 */ - {16, 16, 1}, /* IMB_CIPHER_PON_AES_CNTR */ - {16, 32, 8}, /* IMB_CIPHER_ECB */ - {16, 32, 8}, /* IMB_CIPHER_CNTR_BITLEN */ - {16, 32, 16}, /* IMB_CIPHER_ZUC_EEA3 */ - {16, 16, 1}, /* IMB_CIPHER_SNOW3G_UEA2 */ - {16, 16, 1}, /* IMB_CIPHER_KASUMI_UEA1_BITLEN */ - {16, 16, 1}, /* IMB_CIPHER_CBCS_1_9 */ - {32, 32, 1}, /* IMB_CIPHER_CHACHA20 */ - {32, 32, 1}, /* IMB_CIPHER_CHACHA20_POLY1305 */ - {32, 32, 1}, /* IMB_CIPHER_CHACHA20_POLY1305_SGL */ - {32, 32, 1}, /* IMB_CIPHER_SNOW_V */ - {32, 32, 1}, /* IMB_CIPHER_SNOW_V_AEAD */ + { 16, 32, 8 }, /* IMB_CIPHER_CBC */ + { 16, 32, 8 }, /* IMB_CIPHER_CNTR */ + { 0, 0, 1 }, /* IMB_CIPHER_NULL */ + { 16, 32, 16 }, /* IMB_CIPHER_DOCSIS_SEC_BPI */ + { 16, 32, 8 }, /* IMB_CIPHER_GCM */ + { 0, 0, 1 }, /* IMB_CIPHER_CUSTOM */ + { 8, 8, 1 }, /* IMB_CIPHER_DES */ + { 8, 8, 1 }, /* IMB_CIPHER_DOCSIS_DES */ + { 16, 32, 16 }, /* IMB_CIPHER_CCM */ + { 24, 24, 1 }, /* IMB_CIPHER_DES3 */ + { 16, 16, 1 }, /* IMB_CIPHER_PON_AES_CNTR */ + { 16, 32, 8 }, /* IMB_CIPHER_ECB */ + { 16, 32, 8 }, /* IMB_CIPHER_CNTR_BITLEN */ + { 16, 32, 16 }, /* IMB_CIPHER_ZUC_EEA3 */ + { 16, 16, 1 }, /* IMB_CIPHER_SNOW3G_UEA2 */ + { 16, 16, 1 }, /* IMB_CIPHER_KASUMI_UEA1_BITLEN */ + { 16, 16, 1 }, /* IMB_CIPHER_CBCS_1_9 */ + { 32, 32, 1 }, /* IMB_CIPHER_CHACHA20 */ + { 32, 32, 1 }, /* IMB_CIPHER_CHACHA20_POLY1305 */ + { 32, 32, 1 }, /* IMB_CIPHER_CHACHA20_POLY1305_SGL */ + { 32, 32, 1 }, /* IMB_CIPHER_SNOW_V */ + { 32, 32, 1 }, /* IMB_CIPHER_SNOW_V_AEAD */ }; uint8_t custom_test = 0; uint8_t verbose = 0; uint32_t safe_retries = DEFAULT_SAFE_RETRIES; -enum range { - RANGE_MIN = 0, - RANGE_STEP, - RANGE_MAX, - NUM_RANGE -}; +enum range { RANGE_MIN = 0, RANGE_STEP, RANGE_MAX, NUM_RANGE }; -uint32_t job_sizes[NUM_RANGE] = {DEFAULT_JOB_SIZE_MIN, - DEFAULT_JOB_SIZE_STEP, - DEFAULT_JOB_SIZE_MAX}; +uint32_t job_sizes[NUM_RANGE] = { DEFAULT_JOB_SIZE_MIN, DEFAULT_JOB_SIZE_STEP, + DEFAULT_JOB_SIZE_MAX }; /* Max number of jobs to submit in IMIX testing */ uint32_t max_num_jobs = 17; /* IMIX disabled by default */ @@ -760,19 +598,17 @@ uint32_t cipher_iv_size = 0; uint32_t auth_iv_size = 0; uint8_t auth_tag_size = 0; -struct custom_job_params custom_job_params = { - .cipher_mode = IMB_CIPHER_NULL, - .hash_alg = IMB_AUTH_NULL, - .key_size = 0 -}; +struct custom_job_params custom_job_params = { .cipher_mode = IMB_CIPHER_NULL, + .hash_alg = IMB_AUTH_NULL, + .key_size = 0 }; /* AESNI_EMU disabled by default */ #ifndef __aarch64__ -uint8_t enc_archs[IMB_ARCH_NUM] = {0, 0, 1, 1, 1, 1}; -uint8_t dec_archs[IMB_ARCH_NUM] = {0, 0, 1, 1, 1, 1}; +uint8_t enc_archs[IMB_ARCH_NUM] = { 0, 0, 1, 1, 1, 1 }; +uint8_t dec_archs[IMB_ARCH_NUM] = { 0, 0, 1, 1, 1, 1 }; #else -uint8_t enc_archs[IMB_ARCH_NUM] = {0, 0, 1, 1}; -uint8_t dec_archs[IMB_ARCH_NUM] = {0, 0, 1, 1}; +uint8_t enc_archs[IMB_ARCH_NUM] = { 0, 0, 1, 1 }; +uint8_t dec_archs[IMB_ARCH_NUM] = { 0, 0, 1, 1 }; #endif uint64_t flags = 0; /* flags passed to alloc_mb_mgr() */ @@ -782,9 +618,7 @@ int is_avx_sse_check_possible = 0; #ifndef __aarch64__ static void -avx_sse_check(const char *ctx_str, - const IMB_HASH_ALG hash_alg, - const IMB_CIPHER_MODE cipher_mode) +avx_sse_check(const char *ctx_str, const IMB_HASH_ALG hash_alg, const IMB_CIPHER_MODE cipher_mode) { if (!is_avx_sse_check_possible) return; @@ -830,26 +664,21 @@ clear_data(struct data *data) } /** Generate random fill patterns */ -static void generate_patterns(void) +static void +generate_patterns(void) { /* randomize fill values - make sure they are unique and non-zero */ do { pattern_auth_key = rand() & 255; pattern_cipher_key = rand() & 255; pattern_plain_text = rand() & 255; - } while (pattern_auth_key == pattern_cipher_key || - pattern_auth_key == pattern_plain_text || - pattern_cipher_key == pattern_plain_text || - pattern_auth_key == 0 || - pattern_cipher_key == 0 || - pattern_plain_text == 0); - - nosimd_memset(&pattern8_auth_key, pattern_auth_key, - sizeof(pattern8_auth_key)); - nosimd_memset(&pattern8_cipher_key, pattern_cipher_key, - sizeof(pattern8_cipher_key)); - nosimd_memset(&pattern8_plain_text, pattern_plain_text, - sizeof(pattern8_plain_text)); + } while (pattern_auth_key == pattern_cipher_key || pattern_auth_key == pattern_plain_text || + pattern_cipher_key == pattern_plain_text || pattern_auth_key == 0 || + pattern_cipher_key == 0 || pattern_plain_text == 0); + + nosimd_memset(&pattern8_auth_key, pattern_auth_key, sizeof(pattern8_auth_key)); + nosimd_memset(&pattern8_cipher_key, pattern_cipher_key, sizeof(pattern8_cipher_key)); + nosimd_memset(&pattern8_plain_text, pattern_plain_text, sizeof(pattern8_plain_text)); printf(">>> Patterns: AUTH_KEY = 0x%02x, CIPHER_KEY = 0x%02x, " "PLAIN_TEXT = 0x%02x\n", @@ -896,14 +725,12 @@ search_patterns(const void *ptr, const size_t mem_size) if (ret != -1) { static uint8_t tb[64]; - const size_t len_to_print = - (mem_size - i) > sizeof(tb) ? sizeof(tb) : mem_size - i; + const size_t len_to_print = (mem_size - i) > sizeof(tb) ? sizeof(tb) : mem_size - i; nosimd_memcpy(tb, &ptr8[i], len_to_print); fprintf(stderr, "%s\n", err_str); - fprintf(stderr, "Offset = %zu bytes, Addr = %p, RSP = %p\n", - i, &ptr8[i], rdrsp()); + fprintf(stderr, "Offset = %zu bytes, Addr = %p, RSP = %p\n", i, &ptr8[i], rdrsp()); hexdump_ex(stderr, NULL, tb, len_to_print, &ptr8[i]); return 0; @@ -938,8 +765,7 @@ get_ooo_mgr_size(const void *ptr, const unsigned index) static size_t mgr_sz_tab[64]; if (index >= DIM(mgr_sz_tab)) { - fprintf(stderr, - "get_ooo_mgr_size() internal table too small!\n"); + fprintf(stderr, "get_ooo_mgr_size() internal table too small!\n"); exit(EXIT_FAILURE); } @@ -971,8 +797,7 @@ print_algo_info(const struct params_s *params) job_params = &cipher_algo_str_map[i].values.job_params; if (job_params->cipher_mode == params->cipher_mode && job_params->key_size == params->key_size) { - printf("Cipher algo = %s ", - cipher_algo_str_map[i].name); + printf("Cipher algo = %s ", cipher_algo_str_map[i].name); break; } } @@ -986,11 +811,9 @@ print_algo_info(const struct params_s *params) } static int -fill_job(IMB_JOB *job, const struct params_s *params, - uint8_t *buf, uint8_t *digest, const uint8_t *aad, - const uint32_t buf_size, const uint8_t tag_size, - IMB_CIPHER_DIRECTION cipher_dir, - struct cipher_auth_keys *keys, uint8_t *cipher_iv, +fill_job(IMB_JOB *job, const struct params_s *params, uint8_t *buf, uint8_t *digest, + const uint8_t *aad, const uint32_t buf_size, const uint8_t tag_size, + IMB_CIPHER_DIRECTION cipher_dir, struct cipher_auth_keys *keys, uint8_t *cipher_iv, uint8_t *auth_iv, const unsigned index, uint8_t *next_iv) { static const void *ks_ptr[3]; @@ -1013,7 +836,7 @@ fill_job(IMB_JOB *job, const struct params_s *params, job->hash_start_src_offset_in_bytes = 0; job->cipher_start_src_offset_in_bytes = 0; job->iv = cipher_iv; - job->user_data = (void *)((uintptr_t) index); + job->user_data = (void *) ((uintptr_t) index); if (params->cipher_mode == IMB_CIPHER_PON_AES_CNTR) { /* Subtract XGEM header */ @@ -1026,20 +849,16 @@ fill_job(IMB_JOB *job, const struct params_s *params, if (params->hash_alg == IMB_AUTH_DOCSIS_CRC32 && params->cipher_mode == IMB_CIPHER_DOCSIS_SEC_BPI) { - if (buf_size >= - (IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE + - IMB_DOCSIS_CRC32_TAG_SIZE)) { + if (buf_size >= (IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE + IMB_DOCSIS_CRC32_TAG_SIZE)) { const uint64_t cipher_adjust = /* SA + DA only */ IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE - 2; job->cipher_start_src_offset_in_bytes += cipher_adjust; job->msg_len_to_cipher_in_bytes -= cipher_adjust; - job->msg_len_to_hash_in_bytes -= - IMB_DOCSIS_CRC32_TAG_SIZE; + job->msg_len_to_hash_in_bytes -= IMB_DOCSIS_CRC32_TAG_SIZE; } else if (buf_size > IMB_DOCSIS_CRC32_TAG_SIZE) { job->msg_len_to_cipher_in_bytes = 0; - job->msg_len_to_hash_in_bytes -= - IMB_DOCSIS_CRC32_TAG_SIZE; + job->msg_len_to_hash_in_bytes -= IMB_DOCSIS_CRC32_TAG_SIZE; } else { job->msg_len_to_cipher_in_bytes = 0; job->msg_len_to_hash_in_bytes = 0; @@ -1073,8 +892,7 @@ fill_job(IMB_JOB *job, const struct params_s *params, * converted to bits and it is decreased by 4 bits, * to force the CMAC bitlen path) */ - job->msg_len_to_hash_in_bits = - (job->msg_len_to_hash_in_bytes * 8) - 4; + job->msg_len_to_hash_in_bits = (job->msg_len_to_hash_in_bytes * 8) - 4; break; case IMB_AUTH_AES_CMAC_256: job->u.CMAC._key_expanded = k1_expanded; @@ -1088,35 +906,30 @@ fill_job(IMB_JOB *job, const struct params_s *params, case IMB_AUTH_HMAC_SHA_512: case IMB_AUTH_MD5: /* HMAC hash alg is SHA1 or MD5 */ - job->u.HMAC._hashed_auth_key_xor_ipad = - (uint8_t *) ipad; - job->u.HMAC._hashed_auth_key_xor_opad = - (uint8_t *) opad; + job->u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) ipad; + job->u.HMAC._hashed_auth_key_xor_opad = (uint8_t *) opad; break; #endif /* __aarch64__ */ case IMB_AUTH_ZUC256_EIA3_BITLEN: - job->u.ZUC_EIA3._key = k2; + job->u.ZUC_EIA3._key = k2; if (auth_iv_size == 23) { job->u.ZUC_EIA3._iv23 = auth_iv; job->u.ZUC_EIA3._iv = NULL; } else { - job->u.ZUC_EIA3._iv = auth_iv; + job->u.ZUC_EIA3._iv = auth_iv; job->u.ZUC_EIA3._iv23 = NULL; } - job->msg_len_to_hash_in_bits = - (job->msg_len_to_hash_in_bytes * 8); + job->msg_len_to_hash_in_bits = (job->msg_len_to_hash_in_bytes * 8); break; case IMB_AUTH_ZUC_EIA3_BITLEN: - job->u.ZUC_EIA3._key = k2; - job->u.ZUC_EIA3._iv = auth_iv; - job->msg_len_to_hash_in_bits = - (job->msg_len_to_hash_in_bytes * 8); + job->u.ZUC_EIA3._key = k2; + job->u.ZUC_EIA3._iv = auth_iv; + job->msg_len_to_hash_in_bits = (job->msg_len_to_hash_in_bytes * 8); break; case IMB_AUTH_SNOW3G_UIA2_BITLEN: job->u.SNOW3G_UIA2._key = k2; job->u.SNOW3G_UIA2._iv = auth_iv; - job->msg_len_to_hash_in_bits = - (job->msg_len_to_hash_in_bytes * 8); + job->msg_len_to_hash_in_bits = (job->msg_len_to_hash_in_bytes * 8); break; #ifndef __aarch64__ case IMB_AUTH_KASUMI_UIA1: @@ -1175,8 +988,8 @@ fill_job(IMB_JOB *job, const struct params_s *params, #endif /* __aarch64__ */ break; default: - printf("Unsupported hash algorithm %u, line %d\n", - (unsigned) params->hash_alg, __LINE__); + printf("Unsupported hash algorithm %u, line %d\n", (unsigned) params->hash_alg, + __LINE__); return -1; } @@ -1270,8 +1083,7 @@ fill_job(IMB_JOB *job, const struct params_s *params, job->dec_keys = k2; job->iv_len_in_bytes = 16; job->cipher_start_src_offset_in_bits = 0; - job->msg_len_to_cipher_in_bits = - (job->msg_len_to_cipher_in_bytes * 8); + job->msg_len_to_cipher_in_bits = (job->msg_len_to_cipher_in_bytes * 8); break; #ifndef __aarch64__ case IMB_CIPHER_KASUMI_UEA1_BITLEN: @@ -1279,8 +1091,7 @@ fill_job(IMB_JOB *job, const struct params_s *params, job->dec_keys = k2; job->iv_len_in_bytes = 8; job->cipher_start_src_offset_in_bits = 0; - job->msg_len_to_cipher_in_bits = - (job->msg_len_to_cipher_in_bytes * 8); + job->msg_len_to_cipher_in_bits = (job->msg_len_to_cipher_in_bytes * 8); break; case IMB_CIPHER_CHACHA20: case IMB_CIPHER_CHACHA20_POLY1305: @@ -1315,9 +1126,8 @@ fill_job(IMB_JOB *job, const struct params_s *params, } static int -prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, - const uint8_t *ciph_key, const uint8_t *auth_key, - const struct params_s *params, +prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph_key, + const uint8_t *auth_key, const struct params_s *params, const unsigned int force_pattern) { uint32_t *dust = keys->dust; @@ -1336,20 +1146,17 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, switch (params->hash_alg) { #ifndef __aarch64__ case IMB_AUTH_AES_XCBC: - nosimd_memset(k1_expanded, pattern_auth_key, - sizeof(keys->k1_expanded)); + nosimd_memset(k1_expanded, pattern_auth_key, sizeof(keys->k1_expanded)); break; case IMB_AUTH_AES_CMAC: case IMB_AUTH_AES_CMAC_BITLEN: case IMB_AUTH_AES_CMAC_256: - nosimd_memset(k1_expanded, pattern_auth_key, - sizeof(keys->k1_expanded)); + nosimd_memset(k1_expanded, pattern_auth_key, sizeof(keys->k1_expanded)); nosimd_memset(k2, pattern_auth_key, sizeof(keys->k2)); nosimd_memset(k3, pattern_auth_key, sizeof(keys->k3)); break; case IMB_AUTH_POLY1305: - nosimd_memset(k1_expanded, pattern_auth_key, - sizeof(keys->k1_expanded)); + nosimd_memset(k1_expanded, pattern_auth_key, sizeof(keys->k1_expanded)); break; case IMB_AUTH_HMAC_SHA_1: case IMB_AUTH_HMAC_SHA_224: @@ -1357,10 +1164,8 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: case IMB_AUTH_MD5: - nosimd_memset(ipad, pattern_auth_key, - sizeof(keys->ipad)); - nosimd_memset(opad, pattern_auth_key, - sizeof(keys->opad)); + nosimd_memset(ipad, pattern_auth_key, sizeof(keys->ipad)); + nosimd_memset(opad, pattern_auth_key, sizeof(keys->opad)); break; #endif /* __aarch64__ */ case IMB_AUTH_ZUC_EIA3_BITLEN: @@ -1404,8 +1209,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, case IMB_AUTH_AES_GMAC_192: case IMB_AUTH_AES_GMAC_256: case IMB_AUTH_GHASH: - nosimd_memset(gdata_key, pattern_auth_key, - sizeof(keys->gdata_key)); + nosimd_memset(gdata_key, pattern_auth_key, sizeof(keys->gdata_key)); break; #else /* __aarch64__ */ case IMB_AUTH_NULL: @@ -1413,8 +1217,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, break; #endif /* __aarch64__ */ default: - fprintf(stderr, - "Unsupported hash algorithm %u, line %d\n", + fprintf(stderr, "Unsupported hash algorithm %u, line %d\n", (unsigned) params->hash_alg, __LINE__); return -1; } @@ -1422,8 +1225,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, switch (params->cipher_mode) { #ifndef __aarch64__ case IMB_CIPHER_GCM: - nosimd_memset(gdata_key, pattern_cipher_key, - sizeof(keys->gdata_key)); + nosimd_memset(gdata_key, pattern_cipher_key, sizeof(keys->gdata_key)); break; case IMB_CIPHER_PON_AES_CNTR: case IMB_CIPHER_CBC: @@ -1433,16 +1235,13 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, case IMB_CIPHER_DOCSIS_SEC_BPI: case IMB_CIPHER_ECB: case IMB_CIPHER_CBCS_1_9: - nosimd_memset(enc_keys, pattern_cipher_key, - sizeof(keys->enc_keys)); - nosimd_memset(dec_keys, pattern_cipher_key, - sizeof(keys->dec_keys)); + nosimd_memset(enc_keys, pattern_cipher_key, sizeof(keys->enc_keys)); + nosimd_memset(dec_keys, pattern_cipher_key, sizeof(keys->dec_keys)); break; case IMB_CIPHER_DES: case IMB_CIPHER_DES3: case IMB_CIPHER_DOCSIS_DES: - nosimd_memset(enc_keys, pattern_cipher_key, - sizeof(keys->enc_keys)); + nosimd_memset(enc_keys, pattern_cipher_key, sizeof(keys->enc_keys)); break; #endif /* __aarch64__ */ case IMB_CIPHER_SNOW3G_UEA2_BITLEN: @@ -1492,8 +1291,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: case IMB_AUTH_MD5: - imb_hmac_ipad_opad(mb_mgr, params->hash_alg, auth_key, - MAX_KEY_SIZE, ipad, opad); + imb_hmac_ipad_opad(mb_mgr, params->hash_alg, auth_key, MAX_KEY_SIZE, ipad, opad); break; #endif /* __aarch64__ */ case IMB_AUTH_ZUC_EIA3_BITLEN: @@ -1580,8 +1378,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, case IMB_CIPHER_PON_AES_CNTR: switch (params->key_size) { case 16: - IMB_AES_KEYEXP_128(mb_mgr, ciph_key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, ciph_key, enc_keys, dec_keys); break; case 0: break; @@ -1599,16 +1396,13 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, case IMB_CIPHER_CBCS_1_9: switch (params->key_size) { case IMB_KEY_128_BYTES: - IMB_AES_KEYEXP_128(mb_mgr, ciph_key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_128(mb_mgr, ciph_key, enc_keys, dec_keys); break; case IMB_KEY_192_BYTES: - IMB_AES_KEYEXP_192(mb_mgr, ciph_key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_192(mb_mgr, ciph_key, enc_keys, dec_keys); break; case IMB_KEY_256_BYTES: - IMB_AES_KEYEXP_256(mb_mgr, ciph_key, enc_keys, - dec_keys); + IMB_AES_KEYEXP_256(mb_mgr, ciph_key, enc_keys, dec_keys); break; default: fprintf(stderr, "Wrong key size\n"); @@ -1657,9 +1451,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, /* Modify the test buffer to set the HEC value and CRC, so the final * decrypted message can be compared against the test buffer */ static int -modify_pon_test_buf(uint8_t *test_buf, - const IMB_JOB *job, - const uint32_t pli, +modify_pon_test_buf(uint8_t *test_buf, const IMB_JOB *job, const uint32_t pli, const uint64_t xgem_hdr) { /* Set plaintext CRC in test buffer for PON */ @@ -1667,7 +1459,7 @@ modify_pon_test_buf(uint8_t *test_buf, uint64_t *buf64 = (uint64_t *) test_buf; const uint32_t *tag32 = (uint32_t *) job->auth_tag_output; const uint64_t hec_mask = BSWAP64(0xfffffffffffe000); - const uint64_t xgem_hdr_out = ((const uint64_t *)job->src)[0]; + const uint64_t xgem_hdr_out = ((const uint64_t *) job->src)[0]; /* Update CRC if PLI > 4 */ if (pli > 4) @@ -1676,10 +1468,8 @@ modify_pon_test_buf(uint8_t *test_buf, /* Check if any bits apart from HEC are modified */ if ((xgem_hdr_out & hec_mask) != (xgem_hdr & hec_mask)) { fprintf(stderr, "XGEM header overwritten outside HEC\n"); - fprintf(stderr, "Original XGEM header: %"PRIx64"\n", - xgem_hdr & hec_mask); - fprintf(stderr, "Output XGEM header: %"PRIx64"\n", - xgem_hdr_out & hec_mask); + fprintf(stderr, "Original XGEM header: %" PRIx64 "\n", xgem_hdr & hec_mask); + fprintf(stderr, "Output XGEM header: %" PRIx64 "\n", xgem_hdr_out & hec_mask); return -1; } @@ -1692,14 +1482,12 @@ modify_pon_test_buf(uint8_t *test_buf, /* Modify the test buffer to set the CRC value, so the final * decrypted message can be compared against the test buffer */ static void -modify_docsis_crc32_test_buf(uint8_t *test_buf, - const IMB_JOB *job, const uint32_t buf_size) +modify_docsis_crc32_test_buf(uint8_t *test_buf, const IMB_JOB *job, const uint32_t buf_size) { - if (buf_size >= - (IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE + IMB_DOCSIS_CRC32_TAG_SIZE)) { + if (buf_size >= (IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE + IMB_DOCSIS_CRC32_TAG_SIZE)) { /* Set plaintext CRC32 in the test buffer */ - nosimd_memcpy(&test_buf[buf_size - IMB_DOCSIS_CRC32_TAG_SIZE], - job->auth_tag_output, IMB_DOCSIS_CRC32_TAG_SIZE); + nosimd_memcpy(&test_buf[buf_size - IMB_DOCSIS_CRC32_TAG_SIZE], job->auth_tag_output, + IMB_DOCSIS_CRC32_TAG_SIZE); } } @@ -1750,19 +1538,15 @@ perform_safe_checks(IMB_MGR *mgr, const IMB_ARCH arch, const char *dir) break; #endif default: - fprintf(stderr, - "Error getting the architecture\n"); + fprintf(stderr, "Error getting the architecture\n"); return -1; } if (search_patterns(gps, GP_MEM_SIZE) == 0) { - fprintf(stderr, "Pattern found in GP registers after %s data\n", - dir); + fprintf(stderr, "Pattern found in GP registers after %s data\n", dir); return -1; } if (search_patterns(simd_regs, simd_size) == 0) { - fprintf(stderr, - "Pattern found in SIMD registers after %s data\n", - dir); + fprintf(stderr, "Pattern found in SIMD registers after %s data\n", dir); return -1; } rsp_ptr = rdrsp(); @@ -1777,37 +1561,52 @@ perform_safe_checks(IMB_MGR *mgr, const IMB_ARCH arch, const char *dir) } /* search OOO managers */ - for (ooo_ptr = &mgr->aes128_ooo, i = 0; - ooo_ptr < &mgr->end_ooo; - ooo_ptr++, i++) { - static const char * const ooo_names[] = { - "aes128_ooo", "aes192_ooo", "aes256_ooo", - "docsis128_sec_ooo", "docsis128_crc32_sec_ooo", - "docsis256_sec_ooo", "docsis256_crc32_sec_ooo", - "des_enc_ooo", "des_dec_ooo", - "des3_enc_ooo", "des3_dec_ooo", - "docsis_des_enc_ooo", "docsis_des_dec_ooo", + for (ooo_ptr = &mgr->aes128_ooo, i = 0; ooo_ptr < &mgr->end_ooo; ooo_ptr++, i++) { + static const char *const ooo_names[] = { + "aes128_ooo", + "aes192_ooo", + "aes256_ooo", + "docsis128_sec_ooo", + "docsis128_crc32_sec_ooo", + "docsis256_sec_ooo", + "docsis256_crc32_sec_ooo", + "des_enc_ooo", + "des_dec_ooo", + "des3_enc_ooo", + "des3_dec_ooo", + "docsis_des_enc_ooo", + "docsis_des_dec_ooo", "hmac_sha_1_ooo", - "hmac_sha_224_ooo", "hmac_sha_256_ooo", - "hmac_sha_384_ooo", "hmac_sha_512_ooo", + "hmac_sha_224_ooo", + "hmac_sha_256_ooo", + "hmac_sha_384_ooo", + "hmac_sha_512_ooo", "hmac_md5_ooo", - "aes_xcbc_ooo", "aes_ccm_ooo", "aes_cmac_ooo", - "zuc_eea3_ooo", "zuc_eia3_ooo", + "aes_xcbc_ooo", + "aes_ccm_ooo", + "aes_cmac_ooo", + "zuc_eea3_ooo", + "zuc_eia3_ooo", "aes128_cbcs_ooo", - "zuc256_eea3_ooo", "zuc256_eia3_ooo", - "aes256_ccm_ooo", "aes256_cmac_ooo", - "snow3g_uea2_ooo", "snow3g_uia2_ooo", - "sha_1_ooo", "sha_224_ooo", "sha_256_ooo", - "sha_384_ooo", "sha_512_ooo", + "zuc256_eea3_ooo", + "zuc256_eia3_ooo", + "aes256_ccm_ooo", + "aes256_cmac_ooo", + "snow3g_uea2_ooo", + "snow3g_uia2_ooo", + "sha_1_ooo", + "sha_224_ooo", + "sha_256_ooo", + "sha_384_ooo", + "sha_512_ooo", "end_ooo" /* add new ooo manager above this line */ }; void *ooo_mgr_p = *ooo_ptr; - if (search_patterns(ooo_mgr_p, - get_ooo_mgr_size(ooo_mgr_p, i)) == 0) { + if (search_patterns(ooo_mgr_p, get_ooo_mgr_size(ooo_mgr_p, i)) == 0) { fprintf(stderr, - "Pattern found in OOO MGR (index=%u,\"%s\") after %s data\n", - i, ooo_names[i], dir); + "Pattern found in OOO MGR (index=%u,\"%s\") after %s data\n", i, + ooo_names[i], dir); return -1; } } @@ -1817,16 +1616,14 @@ perform_safe_checks(IMB_MGR *mgr, const IMB_ARCH arch, const char *dir) /* Performs test using AES_HMAC or DOCSIS */ static int -do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, - IMB_MGR *dec_mb_mgr, const IMB_ARCH dec_arch, - const struct params_s *params, struct data *data, - const unsigned safe_check, const unsigned imix, - const unsigned num_jobs) +do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const IMB_ARCH dec_arch, + const struct params_s *params, struct data *data, const unsigned safe_check, + const unsigned imix, const unsigned num_jobs) { IMB_JOB *job; uint32_t i, imix_job_idx = 0; int ret = -1; - uint64_t xgem_hdr[MAX_NUM_JOBS] = {0}; + uint64_t xgem_hdr[MAX_NUM_JOBS] = { 0 }; uint8_t tag_size_to_check[MAX_NUM_JOBS]; struct cipher_auth_keys *enc_keys = &data->enc_keys; struct cipher_auth_keys *dec_keys = &data->dec_keys; @@ -1835,9 +1632,9 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, uint8_t *auth_iv = data->auth_iv; uint8_t *in_digest[MAX_NUM_JOBS]; uint8_t *out_digest[MAX_NUM_JOBS]; - uint8_t *test_buf[MAX_NUM_JOBS] = {NULL}; + uint8_t *test_buf[MAX_NUM_JOBS] = { NULL }; uint8_t *src_dst_buf[MAX_NUM_JOBS]; - uint32_t buf_sizes[MAX_NUM_JOBS] = {0}; + uint32_t buf_sizes[MAX_NUM_JOBS] = { 0 }; uint8_t *ciph_key = data->ciph_key; uint8_t *auth_key = data->auth_key; unsigned int num_processed_jobs = 0; @@ -1925,17 +1722,14 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, if (params->hash_alg == IMB_AUTH_DOCSIS_CRC32) { if (buf_sizes[i] >= - (IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE + - IMB_DOCSIS_CRC32_TAG_SIZE)) - tag_size_to_check[i] = - IMB_DOCSIS_CRC32_TAG_SIZE; + (IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE + IMB_DOCSIS_CRC32_TAG_SIZE)) + tag_size_to_check[i] = IMB_DOCSIS_CRC32_TAG_SIZE; else tag_size_to_check[i] = 0; } if (safe_check) - nosimd_memset(test_buf[i], pattern_plain_text, - buf_sizes[i]); + nosimd_memset(test_buf[i], pattern_plain_text, buf_sizes[i]); else generate_random_buf(test_buf[i], buf_sizes[i]); @@ -1943,10 +1737,9 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, if (params->hash_alg == IMB_AUTH_PON_CRC_BIP) { /* create XGEM header template */ const uint16_t shifted_pli = (pli << 2) & 0xffff; - uint64_t *p_src = (uint64_t *)test_buf[i]; + uint64_t *p_src = (uint64_t *) test_buf[i]; - xgem_hdr[i] = ((shifted_pli >> 8) & 0xff) | - ((shifted_pli & 0xff) << 8); + xgem_hdr[i] = ((shifted_pli >> 8) & 0xff) | ((shifted_pli & 0xff) << 8); p_src[0] = xgem_hdr[i]; } } @@ -1966,27 +1759,23 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, /* Clear scratch registers before expanding keys to prevent * other functions from storing sensitive data in stack */ - if (prepare_keys(enc_mb_mgr, enc_keys, ciph_key, auth_key, - params, 0) < 0) + if (prepare_keys(enc_mb_mgr, enc_keys, ciph_key, auth_key, params, 0) < 0) goto exit; rsp_ptr = rdrsp(); - if (search_patterns((rsp_ptr - STACK_DEPTH), - STACK_DEPTH) == 0) { + if (search_patterns((rsp_ptr - STACK_DEPTH), STACK_DEPTH) == 0) { fprintf(stderr, "Pattern found in stack after " - "expanding encryption keys\n"); + "expanding encryption keys\n"); goto exit; } - if (prepare_keys(dec_mb_mgr, dec_keys, ciph_key, auth_key, - params, 0) < 0) + if (prepare_keys(dec_mb_mgr, dec_keys, ciph_key, auth_key, params, 0) < 0) goto exit; rsp_ptr = rdrsp(); - if (search_patterns((rsp_ptr - STACK_DEPTH), - STACK_DEPTH) == 0) { + if (search_patterns((rsp_ptr - STACK_DEPTH), STACK_DEPTH) == 0) { fprintf(stderr, "Pattern found in stack after " - "expanding decryption keys\n"); + "expanding decryption keys\n"); goto exit; } @@ -1995,43 +1784,31 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, * it is time to setup the keys and key schedules filled * with specific patterns. */ - if (prepare_keys(enc_mb_mgr, enc_keys, ciph_key, auth_key, - params, 1) < 0) + if (prepare_keys(enc_mb_mgr, enc_keys, ciph_key, auth_key, params, 1) < 0) goto exit; - if (prepare_keys(dec_mb_mgr, dec_keys, ciph_key, auth_key, - params, 1) < 0) + if (prepare_keys(dec_mb_mgr, dec_keys, ciph_key, auth_key, params, 1) < 0) goto exit; } else { - if (prepare_keys(enc_mb_mgr, enc_keys, ciph_key, auth_key, - params, 0) < 0) + if (prepare_keys(enc_mb_mgr, enc_keys, ciph_key, auth_key, params, 0) < 0) goto exit; - if (prepare_keys(dec_mb_mgr, dec_keys, ciph_key, auth_key, - params, 0) < 0) + if (prepare_keys(dec_mb_mgr, dec_keys, ciph_key, auth_key, params, 0) < 0) goto exit; } #ifdef PIN_BASED_CEC - PinBasedCEC_MarkSecret((uintptr_t) enc_keys->enc_keys, - sizeof(enc_keys->enc_keys)); - PinBasedCEC_MarkSecret((uintptr_t) enc_keys->dec_keys, - sizeof(enc_keys->dec_keys)); - PinBasedCEC_MarkSecret((uintptr_t) &enc_keys->gdata_key, - sizeof(enc_keys->gdata_key)); - PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k1_expanded, - sizeof(enc_keys->k1_expanded)); + PinBasedCEC_MarkSecret((uintptr_t) enc_keys->enc_keys, sizeof(enc_keys->enc_keys)); + PinBasedCEC_MarkSecret((uintptr_t) enc_keys->dec_keys, sizeof(enc_keys->dec_keys)); + PinBasedCEC_MarkSecret((uintptr_t) &enc_keys->gdata_key, sizeof(enc_keys->gdata_key)); + PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k1_expanded, sizeof(enc_keys->k1_expanded)); PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k2, sizeof(enc_keys->k2)); PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k3, sizeof(enc_keys->k3)); - PinBasedCEC_MarkSecret((uintptr_t) dec_keys->enc_keys, - sizeof(dec_keys->enc_keys)); - PinBasedCEC_MarkSecret((uintptr_t) dec_keys->dec_keys, - sizeof(dec_keys->dec_keys)); - PinBasedCEC_MarkSecret((uintptr_t) &dec_keys->gdata_key, - sizeof(dec_keys->gdata_key)); - PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k1_expanded, - sizeof(dec_keys->k1_expanded)); + PinBasedCEC_MarkSecret((uintptr_t) dec_keys->enc_keys, sizeof(dec_keys->enc_keys)); + PinBasedCEC_MarkSecret((uintptr_t) dec_keys->dec_keys, sizeof(dec_keys->dec_keys)); + PinBasedCEC_MarkSecret((uintptr_t) &dec_keys->gdata_key, sizeof(dec_keys->gdata_key)); + PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k1_expanded, sizeof(dec_keys->k1_expanded)); PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k2, sizeof(dec_keys->k2)); PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k3, sizeof(dec_keys->k3)); #endif @@ -2045,9 +1822,8 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, * using architecture under test */ nosimd_memcpy(src_dst_buf[i], test_buf[i], buf_sizes[i]); - if (fill_job(job, params, src_dst_buf[i], in_digest[i], aad, - buf_sizes[i], tag_size, IMB_DIR_ENCRYPT, enc_keys, - cipher_iv, auth_iv, i, next_iv) < 0) + if (fill_job(job, params, src_dst_buf[i], in_digest[i], aad, buf_sizes[i], tag_size, + IMB_DIR_ENCRYPT, enc_keys, cipher_iv, auth_iv, i, next_iv) < 0) goto exit; /* Randomize memory for input digest */ @@ -2063,7 +1839,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, #endif if (job) { - const unsigned idx = (unsigned)((uintptr_t) job->user_data); + const unsigned idx = (unsigned) ((uintptr_t) job->user_data); if (job->status != IMB_STATUS_COMPLETED) { int errc = imb_get_errno(enc_mb_mgr); @@ -2071,8 +1847,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, fprintf(stderr, "failed job, status:%d, " "error code:%d '%s'\n", - job->status, errc, - imb_get_strerror(errc)); + job->status, errc, imb_get_strerror(errc)); goto exit; } if (idx != num_processed_jobs) { @@ -2085,15 +1860,12 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, num_processed_jobs++; if (params->hash_alg == IMB_AUTH_PON_CRC_BIP) { - if (modify_pon_test_buf(test_buf[idx], job, - pli, - xgem_hdr[idx]) < 0) + if (modify_pon_test_buf(test_buf[idx], job, pli, xgem_hdr[idx]) < 0) goto exit; } if (params->hash_alg == IMB_AUTH_DOCSIS_CRC32) - modify_docsis_crc32_test_buf(test_buf[idx], job, - buf_sizes[idx]); + modify_docsis_crc32_test_buf(test_buf[idx], job, buf_sizes[idx]); } } /* Flush rest of the jobs, if there are outstanding jobs */ @@ -2106,7 +1878,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, #endif while (job != NULL) { - const unsigned idx = (unsigned)((uintptr_t) job->user_data); + const unsigned idx = (unsigned) ((uintptr_t) job->user_data); if (job->status != IMB_STATUS_COMPLETED) { int errc = imb_get_errno(enc_mb_mgr); @@ -2114,8 +1886,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, fprintf(stderr, "failed job, status:%d, " "error code:%d '%s'\n", - job->status, errc, - imb_get_strerror(errc)); + job->status, errc, imb_get_strerror(errc)); goto exit; } if (idx != num_processed_jobs) { @@ -2128,8 +1899,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, num_processed_jobs++; if (params->hash_alg == IMB_AUTH_DOCSIS_CRC32) - modify_docsis_crc32_test_buf(test_buf[idx], job, - buf_sizes[idx]); + modify_docsis_crc32_test_buf(test_buf[idx], job, buf_sizes[idx]); /* Get more completed jobs */ job = IMB_GET_COMPLETED_JOB(enc_mb_mgr); @@ -2144,30 +1914,21 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, /* Check that the registers, stack and MB_MGR do not contain any * sensitive information after job is returned */ if (safe_check) - if (perform_safe_checks(enc_mb_mgr, enc_arch, - "encrypting") < 0) + if (perform_safe_checks(enc_mb_mgr, enc_arch, "encrypting") < 0) goto exit; #ifdef PIN_BASED_CEC - PinBasedCEC_MarkSecret((uintptr_t) enc_keys->enc_keys, - sizeof(enc_keys->enc_keys)); - PinBasedCEC_MarkSecret((uintptr_t) enc_keys->dec_keys, - sizeof(enc_keys->dec_keys)); - PinBasedCEC_MarkSecret((uintptr_t) &enc_keys->gdata_key, - sizeof(enc_keys->gdata_key)); - PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k1_expanded, - sizeof(enc_keys->k1_expanded)); + PinBasedCEC_MarkSecret((uintptr_t) enc_keys->enc_keys, sizeof(enc_keys->enc_keys)); + PinBasedCEC_MarkSecret((uintptr_t) enc_keys->dec_keys, sizeof(enc_keys->dec_keys)); + PinBasedCEC_MarkSecret((uintptr_t) &enc_keys->gdata_key, sizeof(enc_keys->gdata_key)); + PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k1_expanded, sizeof(enc_keys->k1_expanded)); PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k2, sizeof(enc_keys->k2)); PinBasedCEC_MarkSecret((uintptr_t) enc_keys->k3, sizeof(enc_keys->k3)); - PinBasedCEC_MarkSecret((uintptr_t) dec_keys->enc_keys, - sizeof(dec_keys->enc_keys)); - PinBasedCEC_MarkSecret((uintptr_t) dec_keys->dec_keys, - sizeof(dec_keys->dec_keys)); - PinBasedCEC_MarkSecret((uintptr_t) &dec_keys->gdata_key, - sizeof(dec_keys->gdata_key)); - PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k1_expanded, - sizeof(dec_keys->k1_expanded)); + PinBasedCEC_MarkSecret((uintptr_t) dec_keys->enc_keys, sizeof(dec_keys->enc_keys)); + PinBasedCEC_MarkSecret((uintptr_t) dec_keys->dec_keys, sizeof(dec_keys->dec_keys)); + PinBasedCEC_MarkSecret((uintptr_t) &dec_keys->gdata_key, sizeof(dec_keys->gdata_key)); + PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k1_expanded, sizeof(dec_keys->k1_expanded)); PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k2, sizeof(dec_keys->k2)); PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k3, sizeof(dec_keys->k3)); #endif @@ -2184,9 +1945,9 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, * Generate digest from encrypted message and decrypt * using reference architecture */ - if (fill_job(job, params, src_dst_buf[i], out_digest[i], aad, - buf_sizes[i], tag_size, IMB_DIR_DECRYPT, dec_keys, - cipher_iv, auth_iv, i, next_iv) < 0) + if (fill_job(job, params, src_dst_buf[i], out_digest[i], aad, buf_sizes[i], + tag_size, IMB_DIR_DECRYPT, dec_keys, cipher_iv, auth_iv, i, + next_iv) < 0) goto exit; /* Clear scratch registers before submitting job to prevent @@ -2199,7 +1960,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, #endif if (job != NULL) { - const unsigned idx = (unsigned)((uintptr_t) job->user_data); + const unsigned idx = (unsigned) ((uintptr_t) job->user_data); if (job->status != IMB_STATUS_COMPLETED) { int errc = imb_get_errno(dec_mb_mgr); @@ -2207,8 +1968,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, fprintf(stderr, "failed job, status:%d, " "error code:%d '%s'\n", - job->status, errc, - imb_get_strerror(errc)); + job->status, errc, imb_get_strerror(errc)); goto exit; } @@ -2233,7 +1993,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, #endif while (job != NULL) { - const unsigned idx = (unsigned)((uintptr_t) job->user_data); + const unsigned idx = (unsigned) ((uintptr_t) job->user_data); if (job->status != IMB_STATUS_COMPLETED) { int errc = imb_get_errno(enc_mb_mgr); @@ -2241,8 +2001,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, fprintf(stderr, "failed job, status:%d, " "error code:%d '%s'\n", - job->status, errc, - imb_get_strerror(errc)); + job->status, errc, imb_get_strerror(errc)); goto exit; } if (idx != num_processed_jobs) { @@ -2264,8 +2023,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, /* Check that the registers, stack and MB_MGR do not contain any * sensitive information after job is returned */ if (safe_check) { - if (perform_safe_checks(dec_mb_mgr, dec_arch, - "decrypting") < 0) + if (perform_safe_checks(dec_mb_mgr, dec_arch, "decrypting") < 0) goto exit; } else { for (i = 0; i < num_jobs; i++) { @@ -2274,41 +2032,32 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, imix_job_idx = i; if (params->hash_alg != IMB_AUTH_NULL && - memcmp(in_digest[i], out_digest[i], - tag_size_to_check[i]) != 0) { + memcmp(in_digest[i], out_digest[i], tag_size_to_check[i]) != 0) { fprintf(stderr, "\nInput and output tags " "don't match\n"); - hexdump(stdout, "Input digest", in_digest[i], - tag_size_to_check[i]); + hexdump(stdout, "Input digest", in_digest[i], tag_size_to_check[i]); hexdump(stdout, "Output digest", out_digest[i], tag_size_to_check[i]); goto_exit = 1; } if (params->cipher_mode != IMB_CIPHER_NULL && - memcmp(src_dst_buf[i], test_buf[i], - buf_sizes[i]) != 0) { + memcmp(src_dst_buf[i], test_buf[i], buf_sizes[i]) != 0) { fprintf(stderr, "\nDecrypted text and " "plaintext don't match\n"); - hexdump(stdout, "Plaintext (orig)", test_buf[i], - buf_sizes[i]); - hexdump(stdout, "Decrypted msg", src_dst_buf[i], - buf_sizes[i]); + hexdump(stdout, "Plaintext (orig)", test_buf[i], buf_sizes[i]); + hexdump(stdout, "Decrypted msg", src_dst_buf[i], buf_sizes[i]); goto_exit = 1; } - if ((params->hash_alg == IMB_AUTH_PON_CRC_BIP) && - (pli > 4)) { + if ((params->hash_alg == IMB_AUTH_PON_CRC_BIP) && (pli > 4)) { const uint64_t plen = 8 + pli - 4; - if (memcmp(src_dst_buf[i] + plen, - out_digest[i] + 4, 4) != 0) { + if (memcmp(src_dst_buf[i] + plen, out_digest[i] + 4, 4) != 0) { fprintf(stderr, "\nDecrypted CRC and " - "calculated CRC don't match\n"); - hexdump(stdout, "Decrypted CRC", - src_dst_buf[i] + plen, 4); - hexdump(stdout, "Calculated CRC", - out_digest[i] + 4, 4); + "calculated CRC don't match\n"); + hexdump(stdout, "Decrypted CRC", src_dst_buf[i] + plen, 4); + hexdump(stdout, "Calculated CRC", out_digest[i] + 4, 4); goto_exit = 1; } } @@ -2332,8 +2081,8 @@ exit: printf("Decrypting "); print_tested_arch(dec_mb_mgr->features, dec_arch); if (imix) { - printf("Job #%u, buffer size = %u\n", - imix_job_idx, buf_sizes[imix_job_idx]); + printf("Job #%u, buffer size = %u\n", imix_job_idx, + buf_sizes[imix_job_idx]); for (i = 0; i < num_jobs; i++) printf("Other sizes = %u\n", buf_sizes[i]); @@ -2348,10 +2097,8 @@ exit: } static void -test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, - IMB_MGR *dec_mgr, const IMB_ARCH dec_arch, - struct params_s *params, struct data *variant_data, - const uint32_t buf_size, +test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mgr, const IMB_ARCH dec_arch, + struct params_s *params, struct data *variant_data, const uint32_t buf_size, const unsigned int safe_check) { unsigned int i; @@ -2384,7 +2131,7 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, if (params->hash_alg == IMB_AUTH_AES_CCM) { for (i = 4; i <= 16; i += 2) tag_sizes[num_tag_sizes++] = i; - /* If ZUC-EIA3-256, test all tag sizes supported (4,8,16) */ + /* If ZUC-EIA3-256, test all tag sizes supported (4,8,16) */ } else if (params->hash_alg == IMB_AUTH_ZUC256_EIA3_BITLEN) { for (i = 4; i <= 16; i *= 2) tag_sizes[num_tag_sizes++] = i; @@ -2408,12 +2155,12 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, if (params->cipher_mode == IMB_CIPHER_CBC || params->cipher_mode == IMB_CIPHER_ECB || params->cipher_mode == IMB_CIPHER_CBCS_1_9) - if ((buf_size % IMB_AES_BLOCK_SIZE) != 0) + if ((buf_size % IMB_AES_BLOCK_SIZE) != 0) continue; if (params->cipher_mode == IMB_CIPHER_DES || params->cipher_mode == IMB_CIPHER_DES3) - if ((buf_size % IMB_DES_BLOCK_SIZE) != 0) + if ((buf_size % IMB_DES_BLOCK_SIZE) != 0) continue; /* @@ -2430,8 +2177,7 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, if (safe_check) { int result; - result = do_test(enc_mgr, enc_arch, dec_mgr, - dec_arch, params, + result = do_test(enc_mgr, enc_arch, dec_mgr, dec_arch, params, variant_data, 1, 0, 1); if (result < 0) { uint32_t j; @@ -2440,13 +2186,9 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, printf("=== Issue found. " "Checking again...\n"); generate_patterns(); - result = do_test(enc_mgr, - enc_arch, - dec_mgr, - dec_arch, - params, - variant_data, - 1, 0, 1); + result = do_test(enc_mgr, enc_arch, dec_mgr, + dec_arch, params, variant_data, 1, + 0, 1); if (result == 0) break; } @@ -2460,8 +2202,8 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, } } - if (do_test(enc_mgr, enc_arch, dec_mgr, dec_arch, - params, variant_data, 0, 0, 1) < 0) + if (do_test(enc_mgr, enc_arch, dec_mgr, dec_arch, params, variant_data, 0, + 0, 1) < 0) exit(EXIT_FAILURE); } } @@ -2469,9 +2211,8 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, /* Runs test for each buffer size */ static void -process_variant(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, - IMB_MGR *dec_mgr, const IMB_ARCH dec_arch, - struct params_s *params, struct data *variant_data, +process_variant(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mgr, + const IMB_ARCH dec_arch, struct params_s *params, struct data *variant_data, const unsigned int safe_check) { #ifdef PIN_BASED_CEC @@ -2493,13 +2234,11 @@ process_variant(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, #ifdef PIN_BASED_CEC const uint32_t buf_size = job_sizes[RANGE_MIN]; #else - const uint32_t buf_size = job_sizes[RANGE_MIN] + - (sz * job_sizes[RANGE_STEP]); + const uint32_t buf_size = job_sizes[RANGE_MIN] + (sz * job_sizes[RANGE_STEP]); #endif - test_single(enc_mgr, enc_arch, dec_mgr, - dec_arch, params, variant_data, - buf_size, safe_check); + test_single(enc_mgr, enc_arch, dec_mgr, dec_arch, params, variant_data, buf_size, + safe_check); } /* Perform IMIX tests */ @@ -2510,9 +2249,8 @@ process_variant(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, for (i = 2; i <= max_num_jobs; i++) { for (j = 0; j < IMIX_ITER; j++) { - if (do_test(enc_mgr, enc_arch, dec_mgr, - dec_arch, params, variant_data, - 0, 1, i) < 0) { + if (do_test(enc_mgr, enc_arch, dec_mgr, dec_arch, params, + variant_data, 0, 1, i) < 0) { if (verbose) printf("FAIL\n"); exit(EXIT_FAILURE); @@ -2526,9 +2264,8 @@ process_variant(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, /* Sets cipher direction and key size */ static void -run_test(const IMB_ARCH enc_arch, const IMB_ARCH dec_arch, - struct params_s *params, struct data *variant_data, - const unsigned int safe_check) +run_test(const IMB_ARCH enc_arch, const IMB_ARCH dec_arch, struct params_s *params, + struct data *variant_data, const unsigned int safe_check) { IMB_MGR *enc_mgr = NULL; IMB_MGR *dec_mgr = NULL; @@ -2652,15 +2389,14 @@ run_test(const IMB_ARCH enc_arch, const IMB_ARCH dec_arch, params->key_size = custom_job_params.key_size; params->cipher_mode = custom_job_params.cipher_mode; params->hash_alg = custom_job_params.hash_alg; - process_variant(enc_mgr, enc_arch, dec_mgr, dec_arch, params, - variant_data, safe_check); + process_variant(enc_mgr, enc_arch, dec_mgr, dec_arch, params, variant_data, + safe_check); goto exit; } IMB_CIPHER_MODE c_mode; - for (c_mode = IMB_CIPHER_CBC; c_mode < IMB_CIPHER_NUM; - c_mode++) { + for (c_mode = IMB_CIPHER_CBC; c_mode < IMB_CIPHER_NUM; c_mode++) { IMB_HASH_ALG hash_alg; /* Skip IMB_CIPHER_CUSTOM */ @@ -2675,9 +2411,7 @@ run_test(const IMB_ARCH enc_arch, const IMB_ARCH dec_arch, #endif params->cipher_mode = c_mode; - for (hash_alg = IMB_AUTH_HMAC_SHA_1; - hash_alg < IMB_AUTH_NUM; - hash_alg++) { + for (hash_alg = IMB_AUTH_HMAC_SHA_1; hash_alg < IMB_AUTH_NUM; hash_alg++) { /* Skip IMB_AUTH_CUSTOM */ if (hash_alg == IMB_AUTH_CUSTOM) continue; @@ -2690,24 +2424,18 @@ run_test(const IMB_ARCH enc_arch, const IMB_ARCH dec_arch, continue; #endif /* Skip not supported combinations */ - if ((c_mode == IMB_CIPHER_GCM && - hash_alg != IMB_AUTH_AES_GMAC) || - (c_mode != IMB_CIPHER_GCM && - hash_alg == IMB_AUTH_AES_GMAC)) + if ((c_mode == IMB_CIPHER_GCM && hash_alg != IMB_AUTH_AES_GMAC) || + (c_mode != IMB_CIPHER_GCM && hash_alg == IMB_AUTH_AES_GMAC)) continue; - if ((c_mode == IMB_CIPHER_CCM && - hash_alg != IMB_AUTH_AES_CCM) || - (c_mode != IMB_CIPHER_CCM && - hash_alg == IMB_AUTH_AES_CCM)) + if ((c_mode == IMB_CIPHER_CCM && hash_alg != IMB_AUTH_AES_CCM) || + (c_mode != IMB_CIPHER_CCM && hash_alg == IMB_AUTH_AES_CCM)) continue; if ((c_mode == IMB_CIPHER_PON_AES_CNTR && - hash_alg != IMB_AUTH_PON_CRC_BIP) || - (c_mode != IMB_CIPHER_PON_AES_CNTR && - hash_alg == IMB_AUTH_PON_CRC_BIP)) + hash_alg != IMB_AUTH_PON_CRC_BIP) || + (c_mode != IMB_CIPHER_PON_AES_CNTR && hash_alg == IMB_AUTH_PON_CRC_BIP)) continue; if (c_mode == IMB_CIPHER_DOCSIS_SEC_BPI && - (hash_alg != IMB_AUTH_NULL && - hash_alg != IMB_AUTH_DOCSIS_CRC32)) + (hash_alg != IMB_AUTH_NULL && hash_alg != IMB_AUTH_DOCSIS_CRC32)) continue; if (c_mode != IMB_CIPHER_DOCSIS_SEC_BPI && hash_alg == IMB_AUTH_DOCSIS_CRC32) @@ -2720,17 +2448,15 @@ run_test(const IMB_ARCH enc_arch, const IMB_ARCH dec_arch, if ((c_mode == IMB_CIPHER_SNOW_V_AEAD && hash_alg != IMB_AUTH_SNOW_V_AEAD) || - (c_mode != IMB_CIPHER_SNOW_V_AEAD && - hash_alg == IMB_AUTH_SNOW_V_AEAD)) + (c_mode != IMB_CIPHER_SNOW_V_AEAD && hash_alg == IMB_AUTH_SNOW_V_AEAD)) continue; /* This test app does not support SGL yet */ if ((c_mode == IMB_CIPHER_CHACHA20_POLY1305_SGL) || - (hash_alg == IMB_AUTH_CHACHA20_POLY1305_SGL)) + (hash_alg == IMB_AUTH_CHACHA20_POLY1305_SGL)) continue; - if ((c_mode == IMB_CIPHER_GCM_SGL) || - (hash_alg == IMB_AUTH_GCM_SGL)) + if ((c_mode == IMB_CIPHER_GCM_SGL) || (hash_alg == IMB_AUTH_GCM_SGL)) continue; params->hash_alg = hash_alg; @@ -2740,12 +2466,10 @@ run_test(const IMB_ARCH enc_arch, const IMB_ARCH dec_arch, uint8_t step_sz = key_sizes[c_mode - 1][2]; uint8_t key_sz; - for (key_sz = min_sz; key_sz <= max_sz; - key_sz += step_sz) { + for (key_sz = min_sz; key_sz <= max_sz; key_sz += step_sz) { params->key_size = key_sz; - process_variant(enc_mgr, enc_arch, dec_mgr, - dec_arch, params, variant_data, - safe_check); + process_variant(enc_mgr, enc_arch, dec_mgr, dec_arch, params, + variant_data, safe_check); } } } @@ -2787,8 +2511,7 @@ run_tests(const unsigned int safe_check) if (verbose) { #ifdef PIN_BASED_CEC - printf("Testing buffer size = %u bytes, %u times\n", - pkt_size, num_iter); + printf("Testing buffer size = %u bytes, %u times\n", pkt_size, num_iter); #else if (min_size == max_size) printf("Testing buffer size = %u bytes\n", min_size); @@ -2799,16 +2522,13 @@ run_tests(const unsigned int safe_check) #endif } /* Performing tests for each selected architecture */ - for (enc_arch = IMB_ARCH_NOAESNI; enc_arch < IMB_ARCH_NUM; - enc_arch++) { + for (enc_arch = IMB_ARCH_NOAESNI; enc_arch < IMB_ARCH_NUM; enc_arch++) { if (enc_archs[enc_arch] == 0) continue; - for (dec_arch = IMB_ARCH_NOAESNI; dec_arch < IMB_ARCH_NUM; - dec_arch++) { + for (dec_arch = IMB_ARCH_NOAESNI; dec_arch < IMB_ARCH_NUM; dec_arch++) { if (dec_archs[dec_arch] == 0) continue; - run_test(enc_arch, dec_arch, ¶ms, variant_data, - safe_check); + run_test(enc_arch, dec_arch, ¶ms, variant_data, safe_check); } } /* end for run */ @@ -2816,9 +2536,11 @@ run_tests(const unsigned int safe_check) free(variant_data); } -static void usage(const char *app_name) +static void +usage(const char *app_name) { - fprintf(stderr, "Usage: %s [args], " + fprintf(stderr, + "Usage: %s [args], " "where args are zero or more\n" "-h: print this message\n" "-v: verbose, prints extra information\n" @@ -2876,8 +2598,8 @@ static void usage(const char *app_name) } static int -get_next_num_arg(const char * const *argv, const int index, const int argc, - void *dst, const size_t dst_size) +get_next_num_arg(const char *const *argv, const int index, const int argc, void *dst, + const size_t dst_size) { char *endptr = NULL; uint64_t val; @@ -2898,27 +2620,26 @@ get_next_num_arg(const char * const *argv, const int index, const int argc, val = strtoull(argv[index + 1], &endptr, 0); #endif if (endptr == argv[index + 1] || (endptr != NULL && *endptr != '\0')) { - fprintf(stderr, "Error converting '%s' as value for '%s'!\n", - argv[index + 1], argv[index]); + fprintf(stderr, "Error converting '%s' as value for '%s'!\n", argv[index + 1], + argv[index]); exit(EXIT_FAILURE); } switch (dst_size) { case (sizeof(uint8_t)): - *((uint8_t *)dst) = (uint8_t) val; + *((uint8_t *) dst) = (uint8_t) val; break; case (sizeof(uint16_t)): - *((uint16_t *)dst) = (uint16_t) val; + *((uint16_t *) dst) = (uint16_t) val; break; case (sizeof(uint32_t)): - *((uint32_t *)dst) = (uint32_t) val; + *((uint32_t *) dst) = (uint32_t) val; break; case (sizeof(uint64_t)): - *((uint64_t *)dst) = val; + *((uint64_t *) dst) = val; break; default: - fprintf(stderr, "%s() invalid dst_size %u!\n", - __func__, (unsigned) dst_size); + fprintf(stderr, "%s() invalid dst_size %u!\n", __func__, (unsigned) dst_size); exit(EXIT_FAILURE); break; } @@ -2931,8 +2652,7 @@ get_next_num_arg(const char * const *argv, const int index, const int argc, * with it. */ static const union params * -check_string_arg(const char *param, const char *arg, - const struct str_value_mapping *map, +check_string_arg(const char *param, const char *arg, const struct str_value_mapping *map, const unsigned int num_avail_opts) { unsigned int i; @@ -2958,14 +2678,13 @@ exit: } static int -parse_range(const char * const *argv, const int index, const int argc, +parse_range(const char *const *argv, const int index, const int argc, uint32_t range_values[NUM_RANGE]) { char *token; uint32_t number; unsigned int i; - if (range_values == NULL || argv == NULL || index < 0 || argc < 0) { fprintf(stderr, "%s() internal error!\n", __func__); exit(EXIT_FAILURE); @@ -3006,7 +2725,7 @@ parse_range(const char * const *argv, const int index, const int argc, #ifndef PIN_BASED_CEC if (range_values[RANGE_MAX] < range_values[RANGE_MIN]) { fprintf(stderr, "Maximum value of range cannot be lower " - "than minimum value\n"); + "than minimum value\n"); exit(EXIT_FAILURE); } @@ -3018,18 +2737,17 @@ parse_range(const char * const *argv, const int index, const int argc, goto end_range; no_range: /* Try parsing as single value */ - get_next_num_arg(argv, index, argc, &job_sizes[RANGE_MIN], - sizeof(job_sizes[RANGE_MIN])); + get_next_num_arg(argv, index, argc, &job_sizes[RANGE_MIN], sizeof(job_sizes[RANGE_MIN])); job_sizes[RANGE_MAX] = job_sizes[RANGE_MIN]; end_range: free(copy_arg); return (index + 1); - } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { int i; unsigned int arch_id; @@ -3046,21 +2764,15 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } else if (strcmp(argv[i], "-v") == 0) { verbose = 1; - } else if (update_flags_and_archs(argv[i], - enc_archs, - &flags)) { - if (!update_flags_and_archs(argv[i], - dec_archs, - &flags)) { - fprintf(stderr, - "Same archs should be available\n"); + } else if (update_flags_and_archs(argv[i], enc_archs, &flags)) { + if (!update_flags_and_archs(argv[i], dec_archs, &flags)) { + fprintf(stderr, "Same archs should be available\n"); return EXIT_FAILURE; } } else if (strcmp(argv[i], "--enc-arch") == 0) { /* Use index 1 to skip arch_str_map.name = "NONE" */ - values = check_string_arg(argv[i], argv[i+1], - arch_str_map + 1, + values = check_string_arg(argv[i], argv[i + 1], arch_str_map + 1, DIM(arch_str_map) - 1); if (values == NULL) return EXIT_FAILURE; @@ -3074,8 +2786,7 @@ int main(int argc, char *argv[]) i++; } else if (strcmp(argv[i], "--dec-arch") == 0) { /* Use index 1 to skip arch_str_map.name = "NONE" */ - values = check_string_arg(argv[i], argv[i+1], - arch_str_map + 1, + values = check_string_arg(argv[i], argv[i + 1], arch_str_map + 1, DIM(arch_str_map) - 1); if (values == NULL) return EXIT_FAILURE; @@ -3088,103 +2799,96 @@ int main(int argc, char *argv[]) dec_archs[values->arch_type] = 1; i++; } else if (strcmp(argv[i], "--cipher-algo") == 0) { - values = check_string_arg(argv[i], argv[i+1], - cipher_algo_str_map, - DIM(cipher_algo_str_map)); + values = check_string_arg(argv[i], argv[i + 1], cipher_algo_str_map, + DIM(cipher_algo_str_map)); if (values == NULL) return EXIT_FAILURE; - custom_job_params.cipher_mode = - values->job_params.cipher_mode; - custom_job_params.key_size = - values->job_params.key_size; + custom_job_params.cipher_mode = values->job_params.cipher_mode; + custom_job_params.key_size = values->job_params.key_size; custom_test = 1; cipher_algo_set = 1; i++; } else if (strcmp(argv[i], "--hash-algo") == 0) { - values = check_string_arg(argv[i], argv[i+1], - hash_algo_str_map, - DIM(hash_algo_str_map)); + values = check_string_arg(argv[i], argv[i + 1], hash_algo_str_map, + DIM(hash_algo_str_map)); if (values == NULL) return EXIT_FAILURE; - custom_job_params.hash_alg = - values->job_params.hash_alg; + custom_job_params.hash_alg = values->job_params.hash_alg; custom_test = 1; hash_algo_set = 1; i++; } else if (strcmp(argv[i], "--aead-algo") == 0) { - values = check_string_arg(argv[i], argv[i+1], - aead_algo_str_map, - DIM(aead_algo_str_map)); + values = check_string_arg(argv[i], argv[i + 1], aead_algo_str_map, + DIM(aead_algo_str_map)); if (values == NULL) return EXIT_FAILURE; - custom_job_params.cipher_mode = - values->job_params.cipher_mode; - custom_job_params.key_size = - values->job_params.key_size; - custom_job_params.hash_alg = - values->job_params.hash_alg; + custom_job_params.cipher_mode = values->job_params.cipher_mode; + custom_job_params.key_size = values->job_params.key_size; + custom_job_params.hash_alg = values->job_params.hash_alg; custom_test = 1; aead_algo_set = 1; i++; } else if (strcmp(argv[i], "--job-size") == 0) { /* Try parsing the argument as a range first */ - i = parse_range((const char * const *)argv, i, argc, - job_sizes); + i = parse_range((const char *const *) argv, i, argc, job_sizes); if (job_sizes[RANGE_MAX] > JOB_SIZE_TOP) { - fprintf(stderr, - "Invalid job size %u (max %d)\n", - (unsigned) job_sizes[RANGE_MAX], - JOB_SIZE_TOP); + fprintf(stderr, "Invalid job size %u (max %d)\n", + (unsigned) job_sizes[RANGE_MAX], JOB_SIZE_TOP); return EXIT_FAILURE; } } else if (strcmp(argv[i], "--cipher-iv-size") == 0) { - i = get_next_num_arg((const char * const *)argv, i, - argc, &cipher_iv_size, + i = get_next_num_arg((const char *const *) argv, i, argc, &cipher_iv_size, sizeof(cipher_iv_size)); if (cipher_iv_size > MAX_IV_SIZE) { - fprintf(stderr, "IV size cannot be " - "higher than %d\n", MAX_IV_SIZE); + fprintf(stderr, + "IV size cannot be " + "higher than %d\n", + MAX_IV_SIZE); return EXIT_FAILURE; } } else if (strcmp(argv[i], "--auth-iv-size") == 0) { - i = get_next_num_arg((const char * const *)argv, i, - argc, &auth_iv_size, + i = get_next_num_arg((const char *const *) argv, i, argc, &auth_iv_size, sizeof(auth_iv_size)); if (auth_iv_size > MAX_IV_SIZE) { - fprintf(stderr, "IV size cannot be " - "higher than %d\n", MAX_IV_SIZE); + fprintf(stderr, + "IV size cannot be " + "higher than %d\n", + MAX_IV_SIZE); return EXIT_FAILURE; } } else if (strcmp(argv[i], "--tag-size") == 0) { - i = get_next_num_arg((const char * const *)argv, i, - argc, &auth_tag_size, + i = get_next_num_arg((const char *const *) argv, i, argc, &auth_tag_size, sizeof(auth_tag_size)); if (auth_tag_size > MAX_TAG_SIZE) { - fprintf(stderr, "Tag size cannot be " - "higher than %d\n", MAX_TAG_SIZE); + fprintf(stderr, + "Tag size cannot be " + "higher than %d\n", + MAX_TAG_SIZE); return EXIT_FAILURE; } } else if (strcmp(argv[i], "--num-jobs") == 0) { - i = get_next_num_arg((const char * const *)argv, i, - argc, &max_num_jobs, + i = get_next_num_arg((const char *const *) argv, i, argc, &max_num_jobs, sizeof(max_num_jobs)); if (max_num_jobs > MAX_NUM_JOBS) { - fprintf(stderr, "Number of jobs cannot be " - "higher than %d\n", MAX_NUM_JOBS); + fprintf(stderr, + "Number of jobs cannot be " + "higher than %d\n", + MAX_NUM_JOBS); return EXIT_FAILURE; } } else if (strcmp(argv[i], "--safe-check") == 0) { safe_check = 1; } else if (strcmp(argv[i], "--safe-retries") == 0) { - i = get_next_num_arg((const char * const *)argv, i, - argc, &safe_retries, + i = get_next_num_arg((const char *const *) argv, i, argc, &safe_retries, sizeof(safe_retries)); if (safe_retries > MAX_SAFE_RETRIES) { - fprintf(stderr, "Number of retries cannot be " - "higher than %d\n", MAX_SAFE_RETRIES); + fprintf(stderr, + "Number of retries cannot be " + "higher than %d\n", + MAX_SAFE_RETRIES); return EXIT_FAILURE; } } else if (strcmp(argv[i], "--imix") == 0) { @@ -3224,10 +2928,8 @@ int main(int argc, char *argv[]) if (arch_support[arch_id] == 0) { enc_archs[arch_id] = 0; dec_archs[arch_id] = 0; - fprintf(stderr, - "%s not supported. Disabling %s tests\n", - arch_str_map[arch_id].name, - arch_str_map[arch_id].name); + fprintf(stderr, "%s not supported. Disabling %s tests\n", + arch_str_map[arch_id].name, arch_str_map[arch_id].name); } } diff --git a/test/xvalid-app/misc.h b/test/xvalid-app/misc.h index e3762b18..760e2a5e 100644 --- a/test/xvalid-app/misc.h +++ b/test/xvalid-app/misc.h @@ -32,48 +32,60 @@ #ifndef __aarch64__ /* RAX, RBX, RCX, RDX, RDI, RSI, R8-R15 */ -#define GP_MEM_SIZE 14*8 +#define GP_MEM_SIZE 14 * 8 -#define XMM_MEM_SIZE 16*16 -#define YMM_MEM_SIZE 16*32 -#define ZMM_MEM_SIZE 32*64 +#define XMM_MEM_SIZE 16 * 16 +#define YMM_MEM_SIZE 16 * 32 +#define ZMM_MEM_SIZE 32 * 64 /* Memory allocated in BSS section in misc.asm */ extern uint8_t gps[GP_MEM_SIZE]; extern uint8_t simd_regs[ZMM_MEM_SIZE]; /* Read RSP pointer */ -void *rdrsp(void); +void * +rdrsp(void); /* Functions to dump all registers into predefined memory */ -void dump_gps(void); -void dump_xmms_sse(void); -void dump_xmms_avx(void); -void dump_ymms(void); -void dump_zmms(void); +void +dump_gps(void); +void +dump_xmms_sse(void); +void +dump_xmms_avx(void); +void +dump_ymms(void); +void +dump_zmms(void); /* Functions to clear all scratch SIMD registers */ -void clr_scratch_xmms_sse(void); -void clr_scratch_xmms_avx(void); -void clr_scratch_ymms(void); -void clr_scratch_zmms(void); +void +clr_scratch_xmms_sse(void); +void +clr_scratch_xmms_avx(void); +void +clr_scratch_ymms(void); +void +clr_scratch_zmms(void); /* custom replacement for memset() */ -void *nosimd_memset(void *p, int c, size_t n); +void * +nosimd_memset(void *p, int c, size_t n); /* custom replacement for memcpy() */ -void *nosimd_memcpy(void *dst, const void *src, size_t n); +void * +nosimd_memcpy(void *dst, const void *src, size_t n); /* * Detects if SIMD registers are in the state that * can cause AVX-SSE transition penalty */ -uint32_t avx_sse_transition_check(void); +uint32_t +avx_sse_transition_check(void); -#define MISC_AVX_SSE_YMM0_15_ISSUE (1 << 2) -#define MISC_AVX_SSE_ZMM0_15_ISSUE (1 << 6) -#define MISC_AVX_SSE_ISSUE (MISC_AVX_SSE_YMM0_15_ISSUE | \ - MISC_AVX_SSE_ZMM0_15_ISSUE) +#define MISC_AVX_SSE_YMM0_15_ISSUE (1 << 2) +#define MISC_AVX_SSE_ZMM0_15_ISSUE (1 << 6) +#define MISC_AVX_SSE_ISSUE (MISC_AVX_SSE_YMM0_15_ISSUE | MISC_AVX_SSE_ZMM0_15_ISSUE) /* CPUID feature detection code follows here */ @@ -91,8 +103,8 @@ struct misc_cpuid_regs { * @param subleaf[in] CPUID sub-leaf number (ECX) * @param out[out] registers structure to store results of CPUID into */ -void misc_cpuid(const unsigned leaf, const unsigned subleaf, - struct misc_cpuid_regs *out); +void +misc_cpuid(const unsigned leaf, const unsigned subleaf, struct misc_cpuid_regs *out); /** * @brief Detects if XGETBV instruction is available to use. @@ -101,7 +113,8 @@ void misc_cpuid(const unsigned leaf, const unsigned subleaf, * @retval 0 XGETBV NOT available * @retval 1 XGETBV available */ -static int avx_sse_detectability(void) +static int +avx_sse_detectability(void) { struct misc_cpuid_regs r; @@ -121,7 +134,8 @@ static int avx_sse_detectability(void) } /* decodes cipher mode to string */ -static const char *misc_cipher_mode_to_str(const IMB_CIPHER_MODE mode) +static const char * +misc_cipher_mode_to_str(const IMB_CIPHER_MODE mode) { static char cb[64]; @@ -183,7 +197,8 @@ static const char *misc_cipher_mode_to_str(const IMB_CIPHER_MODE mode) } /* decodes hash algorithm to string */ -static const char *misc_hash_alg_to_str(const IMB_HASH_ALG mode) +static const char * +misc_hash_alg_to_str(const IMB_HASH_ALG mode) { static char cb[64]; -- GitLab From 33a20afb5156515934576eb527b925383622c36a Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Fri, 8 Sep 2023 17:58:31 +0100 Subject: [PATCH 066/204] test: [xvalid] align CRC algorithm names with KAT application --- test/xvalid-app/ipsec_xvalid.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 07f7965f..20520e73 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -397,62 +397,62 @@ struct str_value_mapping hash_algo_str_map[] = { .hash_alg = IMB_AUTH_GHASH, } }, - { .name = "CRC32-ETHERNET-FCS", + { .name = "ETH-CRC32", .values.job_params = { .hash_alg = IMB_AUTH_CRC32_ETHERNET_FCS, } }, - { .name = "CRC32-SCTP", + { .name = "SCTP-CRC32", .values.job_params = { .hash_alg = IMB_AUTH_CRC32_SCTP, } }, - { .name = "CRC32-WIMAX-OFDMA-DATA", + { .name = "WIMAX-OFDMA-CRC32", .values.job_params = { .hash_alg = IMB_AUTH_CRC32_WIMAX_OFDMA_DATA, } }, - { .name = "CRC24-LTE-A", + { .name = "LTE-A-CRC24", .values.job_params = { .hash_alg = IMB_AUTH_CRC24_LTE_A, } }, - { .name = "CRC24-LTE-B", + { .name = "LTE-B-CRC24", .values.job_params = { .hash_alg = IMB_AUTH_CRC24_LTE_B, } }, - { .name = "CRC16-X25", + { .name = "X25-CRC16", .values.job_params = { .hash_alg = IMB_AUTH_CRC16_X25, } }, - { .name = "CRC16-FP-DATA", + { .name = "FP-CRC16", .values.job_params = { .hash_alg = IMB_AUTH_CRC16_FP_DATA, } }, - { .name = "CRC11-FP-HEADER", + { .name = "FP-CRC11", .values.job_params = { .hash_alg = IMB_AUTH_CRC11_FP_HEADER, } }, - { .name = "CRC10-IUUP-DATA", + { .name = "IUUP-CRC10", .values.job_params = { .hash_alg = IMB_AUTH_CRC10_IUUP_DATA, } }, - { .name = "CRC8-WIMAX-OFDMA-HCS", + { .name = "WIMAX-OFDMA-CRC8", .values.job_params = { .hash_alg = IMB_AUTH_CRC8_WIMAX_OFDMA_HCS, } }, - { .name = "CRC7-FP-HEADER", + { .name = "FP-CRC7", .values.job_params = { .hash_alg = IMB_AUTH_CRC7_FP_HEADER, } }, - { .name = "CRC6-IUUP-HEADER", + { .name = "IUUP-CRC6", .values.job_params = { .hash_alg = IMB_AUTH_CRC6_IUUP_HEADER, } -- GitLab From 654ca501e360cb33bd40dc1cd186a4d19aa7870d Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 8 Sep 2023 14:35:16 +0100 Subject: [PATCH 067/204] lib: reformat .c and .h files using clang-format --- lib/avx2_t1/mb_mgr_avx2.c | 27 +- lib/avx2_t1/mb_mgr_avx2_t1.c | 396 +++--- lib/avx2_t1/sha_avx2.c | 46 +- lib/avx2_t1/sha_mb_avx2.c | 92 +- lib/avx2_t1/snow3g_avx2.c | 19 +- lib/avx2_t1/zuc_top_avx2.c | 426 +++--- lib/avx2_t2/mb_mgr_avx2_t2.c | 390 +++--- lib/avx2_t3/mb_mgr_avx2_t3.c | 402 +++--- lib/avx512_t1/mb_mgr_avx512.c | 24 +- lib/avx512_t1/mb_mgr_avx512_t1.c | 466 +++---- lib/avx512_t1/sha_avx512.c | 45 +- lib/avx512_t1/sha_mb_avx512.c | 93 +- lib/avx512_t1/snow3g_avx512.c | 19 +- lib/avx512_t1/zuc_top_avx512.c | 367 ++--- lib/avx512_t2/mb_mgr_avx512_t2.c | 454 +++--- lib/avx_t1/kasumi_avx.c | 125 +- lib/avx_t1/mb_mgr_avx.c | 24 +- lib/avx_t1/mb_mgr_avx_t1.c | 400 +++--- lib/avx_t1/sha_avx.c | 45 +- lib/avx_t1/sha_mb_avx.c | 92 +- lib/avx_t1/snow3g_avx.c | 20 +- lib/avx_t1/zuc_top_avx.c | 358 ++--- lib/avx_t2/mb_mgr_avx_t2.c | 398 +++--- lib/include/aesni_emu.h | 46 +- lib/include/arch_avx2_type1.h | 214 +-- lib/include/arch_avx2_type2.h | 57 +- lib/include/arch_avx2_type3.h | 6 +- lib/include/arch_avx512_type1.h | 243 ++-- lib/include/arch_avx512_type2.h | 278 ++-- lib/include/arch_avx_type1.h | 497 ++++--- lib/include/arch_avx_type2.h | 3 +- lib/include/arch_noaesni.h | 306 +++-- lib/include/arch_sse_type1.h | 495 ++++--- lib/include/arch_sse_type2.h | 78 +- lib/include/arch_sse_type3.h | 134 +- lib/include/arch_x86_64.h | 44 +- lib/include/chacha20_poly1305.h | 299 ++-- lib/include/clear_regs_mem.h | 18 +- lib/include/constant_lookup.h | 48 +- lib/include/constants.h | 74 +- lib/include/cpu_feature.h | 3 +- lib/include/des.h | 53 +- lib/include/des_utils.h | 33 +- lib/include/docsis_common.h | 169 +-- lib/include/error.h | 4 +- lib/include/gcm.h | 706 ++++------ lib/include/ipsec_ooo_mgr.h | 458 +++--- lib/include/job_api_docsis.h | 45 +- lib/include/job_api_gcm.h | 289 ++-- lib/include/job_api_kasumi.h | 18 +- lib/include/job_api_snowv.h | 26 +- lib/include/kasumi_interface.h | 194 ++- lib/include/kasumi_internal.h | 908 ++++++------ lib/include/mb_mgr_burst.h | 204 +-- lib/include/mb_mgr_burst_async.h | 21 +- lib/include/mb_mgr_code.h | 17 +- lib/include/mb_mgr_job_api.h | 1661 ++++++++++++---------- lib/include/mb_mgr_job_check.h | 204 +-- lib/include/memcpy.h | 12 +- lib/include/noaesni.h | 92 +- lib/include/ooo_mgr_reset.h | 39 +- lib/include/save_xmms.h | 14 +- lib/include/sha_generic.h | 140 +- lib/include/sha_mb_mgr.h | 387 +++--- lib/include/snow3g.h | 758 ++++------ lib/include/snow3g_common.h | 1298 +++++++---------- lib/include/snow3g_submit.h | 9 +- lib/include/snow3g_tables.h | 2 +- lib/include/wireless_common.h | 111 +- lib/include/zuc_internal.h | 1188 +++++++--------- lib/ipsec-mb.h | 1988 ++++++++++++--------------- lib/no-aesni/aesni_emu.c | 256 ++-- lib/no-aesni/mb_mgr_sse_no_aesni.c | 459 +++---- lib/no-aesni/snow3g_sse_no_aesni.c | 20 +- lib/no-aesni/zuc_top_sse_no_aesni.c | 426 +++--- lib/sse_t1/kasumi_sse.c | 117 +- lib/sse_t1/mb_mgr_sse.c | 22 +- lib/sse_t1/mb_mgr_sse_t1.c | 396 +++--- lib/sse_t1/sha_mb_sse.c | 76 +- lib/sse_t1/sha_sse.c | 45 +- lib/sse_t1/snow3g_sse.c | 23 +- lib/sse_t1/zuc_top_sse.c | 552 +++----- lib/sse_t2/mb_mgr_sse_t2.c | 390 +++--- lib/sse_t2/sha_ni_mb_sse.c | 48 +- lib/sse_t2/sha_ni_sse.c | 29 +- lib/sse_t3/mb_mgr_sse_t3.c | 390 +++--- lib/x86_64/aes_xcbc_expand_key.c | 24 +- lib/x86_64/alloc.c | 116 +- lib/x86_64/chacha20_poly1305.c | 573 ++++---- lib/x86_64/cipher_suite_id.c | 8 +- lib/x86_64/cpu_feature.c | 68 +- lib/x86_64/des_basic.c | 517 +++---- lib/x86_64/des_key.c | 81 +- lib/x86_64/error.c | 124 +- lib/x86_64/gcm.c | 305 ++-- lib/x86_64/hmac_ipad_opad.c | 33 +- lib/x86_64/kasumi_iv.c | 8 +- lib/x86_64/mb_mgr_auto.c | 5 +- lib/x86_64/md5_one_block.c | 58 +- lib/x86_64/ooo_mgr_reset.c | 102 +- lib/x86_64/quic_aes_gcm.c | 110 +- lib/x86_64/quic_chacha20_poly1305.c | 17 +- lib/x86_64/quic_hp_aes_ecb.c | 13 +- lib/x86_64/quic_hp_chacha20.c | 7 +- lib/x86_64/self_test.c | 1266 +++++++---------- lib/x86_64/snow3g_iv.c | 8 +- lib/x86_64/snow3g_tables.c | 515 +++---- lib/x86_64/version.c | 6 +- lib/x86_64/zuc_iv.c | 10 +- 109 files changed, 11724 insertions(+), 14118 deletions(-) mode change 100755 => 100644 lib/include/kasumi_internal.h mode change 100755 => 100644 lib/include/zuc_internal.h diff --git a/lib/avx2_t1/mb_mgr_avx2.c b/lib/avx2_t1/mb_mgr_avx2.c index 76ba8ed0..28508d51 100644 --- a/lib/avx2_t1/mb_mgr_avx2.c +++ b/lib/avx2_t1/mb_mgr_avx2.c @@ -50,18 +50,15 @@ init_mb_mgr_avx2_internal(IMB_MGR *state, const int reset_mgrs) /* reset error status */ imb_set_errno(state, 0); - state->features = cpu_feature_adjust(state->flags, - cpu_feature_detect()); + state->features = cpu_feature_adjust(state->flags, cpu_feature_detect()); #ifdef AVX_IFMA - if ((state->features & IMB_CPUFLAGS_AVX2_T3) == - IMB_CPUFLAGS_AVX2_T3) { + if ((state->features & IMB_CPUFLAGS_AVX2_T3) == IMB_CPUFLAGS_AVX2_T3) { init_mb_mgr_avx2_t3_internal(state, reset_mgrs); return; } #endif - if ((state->features & IMB_CPUFLAGS_AVX2_T2) == - IMB_CPUFLAGS_AVX2_T2) { + if ((state->features & IMB_CPUFLAGS_AVX2_T2) == IMB_CPUFLAGS_AVX2_T2) { init_mb_mgr_avx2_t2_internal(state, reset_mgrs); return; } @@ -78,32 +75,38 @@ init_mb_mgr_avx2(IMB_MGR *state) imb_set_errno(state, IMB_ERR_SELFTEST); } -IMB_JOB *submit_job_avx2(IMB_MGR *state) +IMB_JOB * +submit_job_avx2(IMB_MGR *state) { return IMB_SUBMIT_JOB(state); } -IMB_JOB *flush_job_avx2(IMB_MGR *state) +IMB_JOB * +flush_job_avx2(IMB_MGR *state) { return IMB_FLUSH_JOB(state); } -uint32_t queue_size_avx2(IMB_MGR *state) +uint32_t +queue_size_avx2(IMB_MGR *state) { return IMB_QUEUE_SIZE(state); } -IMB_JOB *submit_job_nocheck_avx2(IMB_MGR *state) +IMB_JOB * +submit_job_nocheck_avx2(IMB_MGR *state) { return IMB_SUBMIT_JOB_NOCHECK(state); } -IMB_JOB *get_next_job_avx2(IMB_MGR *state) +IMB_JOB * +get_next_job_avx2(IMB_MGR *state) { return IMB_GET_NEXT_JOB(state); } -IMB_JOB *get_completed_job_avx2(IMB_MGR *state) +IMB_JOB * +get_completed_job_avx2(IMB_MGR *state) { return IMB_GET_COMPLETED_JOB(state); } diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index 7d3c7656..23ff6e33 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -53,29 +53,29 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx /* JOB API */ -#define SUBMIT_JOB submit_job_avx2_t1 -#define FLUSH_JOB flush_job_avx2_t1 -#define QUEUE_SIZE queue_size_avx2_t1 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx2_t1 -#define GET_NEXT_JOB get_next_job_avx2_t1 -#define GET_COMPLETED_JOB get_completed_job_avx2_t1 -#define GET_NEXT_BURST get_next_burst_avx2_t1 -#define SUBMIT_BURST submit_burst_avx2_t1 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx2_t1 -#define FLUSH_BURST flush_burst_avx2_t1 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx2_t1 +#define SUBMIT_JOB submit_job_avx2_t1 +#define FLUSH_JOB flush_job_avx2_t1 +#define QUEUE_SIZE queue_size_avx2_t1 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx2_t1 +#define GET_NEXT_JOB get_next_job_avx2_t1 +#define GET_COMPLETED_JOB get_completed_job_avx2_t1 +#define GET_NEXT_BURST get_next_burst_avx2_t1 +#define SUBMIT_BURST submit_burst_avx2_t1 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx2_t1 +#define FLUSH_BURST flush_burst_avx2_t1 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx2_t1 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx2_t1 -#define SUBMIT_HASH_BURST submit_hash_burst_avx2_t1 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx2_t1 -#define SET_SUITE_ID_FN set_suite_id_avx2_t1 +#define SUBMIT_HASH_BURST submit_hash_burst_avx2_t1 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx2_t1 +#define SET_SUITE_ID_FN set_suite_id_avx2_t1 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX2 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX2 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX2 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX2 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_AVX2 @@ -83,12 +83,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 #define SUBMIT_JOB_AES_GCM_DEC submit_job_gcm_dec_avx2 #define SUBMIT_JOB_AES_GCM_ENC submit_job_gcm_enc_avx2 @@ -106,9 +106,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_avx #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_avx -#define AES_CBC_DEC_128 aes_cbc_dec_128_avx -#define AES_CBC_DEC_192 aes_cbc_dec_192_avx -#define AES_CBC_DEC_256 aes_cbc_dec_256_avx +#define AES_CBC_DEC_128 aes_cbc_dec_128_avx +#define AES_CBC_DEC_192 aes_cbc_dec_192_avx +#define AES_CBC_DEC_256 aes_cbc_dec_256_avx /* AES-CBCS */ #define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_avx @@ -124,45 +124,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_avx2 #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_avx2 -#define AES_ECB_ENC_128 aes_ecb_enc_128_avx -#define AES_ECB_ENC_192 aes_ecb_enc_192_avx -#define AES_ECB_ENC_256 aes_ecb_enc_256_avx -#define AES_ECB_DEC_128 aes_ecb_dec_128_avx -#define AES_ECB_DEC_192 aes_ecb_dec_192_avx -#define AES_ECB_DEC_256 aes_ecb_dec_256_avx +#define AES_ECB_ENC_128 aes_ecb_enc_128_avx +#define AES_ECB_ENC_192 aes_ecb_enc_192_avx +#define AES_ECB_ENC_256 aes_ecb_enc_256_avx +#define AES_ECB_DEC_128 aes_ecb_dec_128_avx +#define AES_ECB_DEC_192 aes_ecb_dec_192_avx +#define AES_ECB_DEC_256 aes_ecb_dec_256_avx /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_avx -#define AES_CTR_192 aes_cntr_192_avx -#define AES_CTR_256 aes_cntr_256_avx -#define AES_CTR_128_BIT aes_cntr_bit_128_avx -#define AES_CTR_192_BIT aes_cntr_bit_192_avx -#define AES_CTR_256_BIT aes_cntr_bit_256_avx +#define AES_CTR_128 aes_cntr_128_avx +#define AES_CTR_192 aes_cntr_192_avx +#define AES_CTR_256 aes_cntr_256_avx +#define AES_CTR_128_BIT aes_cntr_bit_128_avx +#define AES_CTR_192_BIT aes_cntr_bit_192_avx +#define AES_CTR_256_BIT aes_cntr_bit_256_avx /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_avx2 -#define AES_CFB_256_ONE aes_cfb_256_one_avx2 +#define AES_CFB_128_ONE aes_cfb_128_one_avx2 +#define AES_CFB_256_ONE aes_cfb_256_one_avx2 /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_avx @@ -171,30 +171,30 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_avx /* SHA1/224/256/384/512 */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_avx2 -#define FLUSH_JOB_SHA1 flush_job_sha1_avx2 -#define SUBMIT_JOB_SHA224 submit_job_sha224_avx2 -#define FLUSH_JOB_SHA224 flush_job_sha224_avx2 -#define SUBMIT_JOB_SHA256 submit_job_sha256_avx2 -#define FLUSH_JOB_SHA256 flush_job_sha256_avx2 -#define SUBMIT_JOB_SHA384 submit_job_sha384_avx2 -#define FLUSH_JOB_SHA384 flush_job_sha384_avx2 -#define SUBMIT_JOB_SHA512 submit_job_sha512_avx2 -#define FLUSH_JOB_SHA512 flush_job_sha512_avx2 +#define SUBMIT_JOB_SHA1 submit_job_sha1_avx2 +#define FLUSH_JOB_SHA1 flush_job_sha1_avx2 +#define SUBMIT_JOB_SHA224 submit_job_sha224_avx2 +#define FLUSH_JOB_SHA224 flush_job_sha224_avx2 +#define SUBMIT_JOB_SHA256 submit_job_sha256_avx2 +#define FLUSH_JOB_SHA256 flush_job_sha256_avx2 +#define SUBMIT_JOB_SHA384 submit_job_sha384_avx2 +#define FLUSH_JOB_SHA384 flush_job_sha384_avx2 +#define SUBMIT_JOB_SHA512 submit_job_sha512_avx2 +#define FLUSH_JOB_SHA512 flush_job_sha512_avx2 /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_avx2 -#define FLUSH_JOB_HMAC flush_job_hmac_avx2 -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx2 -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx2 -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx2 -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx2 -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx2 -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx2 -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx2 -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx2 -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 +#define SUBMIT_JOB_HMAC submit_job_hmac_avx2 +#define FLUSH_JOB_HMAC flush_job_hmac_avx2 +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx2 +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx2 +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx2 +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx2 +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx2 +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx2 +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx2 +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx2 +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 /* CHACHA20 & POLY1305 */ #define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx2 @@ -203,14 +203,14 @@ #define POLY1305_MAC poly1305_mac_scalar /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_avx2 -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_avx2 -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_avx2 -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_avx2 -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_avx2 -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_avx2 -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_avx2 -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_avx2 +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_avx2 +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_avx2 +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_avx2 +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_avx2 +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_avx2 +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_avx2 +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_avx2 +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_avx2 /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_avx @@ -222,8 +222,7 @@ submit_snow3g_uea2_job_avx2_t1(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -246,7 +245,8 @@ flush_snow3g_uea2_job_avx2_t1(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 8); @@ -271,20 +271,16 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX2_NUM_SHA1_LANES); /* Init HMAC/SHA224 out-of-order fields */ - ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, - AVX2_NUM_SHA256_LANES); + ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, AVX2_NUM_SHA256_LANES); /* Init HMAC/SHA256 out-of-order fields */ - ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, - AVX2_NUM_SHA256_LANES); + ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, AVX2_NUM_SHA256_LANES); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - AVX2_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, AVX2_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - AVX2_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, AVX2_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, AVX2_NUM_MD5_LANES); @@ -346,90 +342,90 @@ init_mb_mgr_avx2_t1_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_avx2; - state->keyexp_192 = aes_keyexp_192_avx2; - state->keyexp_256 = aes_keyexp_256_avx2; + state->keyexp_128 = aes_keyexp_128_avx2; + state->keyexp_192 = aes_keyexp_192_avx2; + state->keyexp_256 = aes_keyexp_256_avx2; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_avx2; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_avx2; - state->xcbc_keyexp = aes_xcbc_expand_key_avx2; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_avx2; - state->sha1 = sha1_avx2; - state->sha224_one_block = sha224_one_block_avx2; - state->sha224 = sha224_avx2; - state->sha256_one_block = sha256_one_block_avx2; - state->sha256 = sha256_avx2; - state->sha384_one_block = sha384_one_block_avx2; - state->sha384 = sha384_avx2; - state->sha512_one_block = sha512_one_block_avx2; - state->sha512 = sha512_avx2; - state->md5_one_block = md5_one_block_avx2; - - state->aes128_cfb_one = aes_cfb_128_one_avx2; - state->aes256_cfb_one = aes_cfb_256_one_avx2; - - state->eea3_1_buffer = zuc_eea3_1_buffer_avx2; - state->eea3_4_buffer = zuc_eea3_4_buffer_avx; - state->eea3_n_buffer = zuc_eea3_n_buffer_avx2; - state->eia3_1_buffer = zuc_eia3_1_buffer_avx2; - state->eia3_n_buffer = zuc_eia3_n_buffer_avx2; - - state->f8_1_buffer = kasumi_f8_1_buffer_avx; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; - state->f8_2_buffer = kasumi_f8_2_buffer_avx; - state->f8_3_buffer = kasumi_f8_3_buffer_avx; - state->f8_4_buffer = kasumi_f8_4_buffer_avx; - state->f8_n_buffer = kasumi_f8_n_buffer_avx; - state->f9_1_buffer = kasumi_f9_1_buffer_avx; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; + state->xcbc_keyexp = aes_xcbc_expand_key_avx2; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_avx2; + state->sha1 = sha1_avx2; + state->sha224_one_block = sha224_one_block_avx2; + state->sha224 = sha224_avx2; + state->sha256_one_block = sha256_one_block_avx2; + state->sha256 = sha256_avx2; + state->sha384_one_block = sha384_one_block_avx2; + state->sha384 = sha384_avx2; + state->sha512_one_block = sha512_one_block_avx2; + state->sha512 = sha512_avx2; + state->md5_one_block = md5_one_block_avx2; + + state->aes128_cfb_one = aes_cfb_128_one_avx2; + state->aes256_cfb_one = aes_cfb_256_one_avx2; + + state->eea3_1_buffer = zuc_eea3_1_buffer_avx2; + state->eea3_4_buffer = zuc_eea3_4_buffer_avx; + state->eea3_n_buffer = zuc_eea3_n_buffer_avx2; + state->eia3_1_buffer = zuc_eia3_1_buffer_avx2; + state->eia3_n_buffer = zuc_eia3_n_buffer_avx2; + + state->f8_1_buffer = kasumi_f8_1_buffer_avx; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; + state->f8_2_buffer = kasumi_f8_2_buffer_avx; + state->f8_3_buffer = kasumi_f8_3_buffer_avx; + state->f8_4_buffer = kasumi_f8_4_buffer_avx; + state->f8_n_buffer = kasumi_f8_n_buffer_avx; + state->f9_1_buffer = kasumi_f9_1_buffer_avx; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_avx; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_avx; state->kasumi_key_sched_size = kasumi_key_sched_size_avx; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_avx2; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx2; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx2; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx2; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx2; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx2; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx2; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx2; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx2; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx2; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx2; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_avx2; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_avx2; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_avx2; state->snow3g_init_key_sched = snow3g_init_key_sched_avx2; state->snow3g_key_sched_size = snow3g_key_sched_size_avx2; - state->hec_32 = hec_32_avx; - state->hec_64 = hec_64_avx; - - state->crc32_ethernet_fcs = ethernet_fcs_avx; - state->crc16_x25 = crc16_x25_avx; - state->crc32_sctp = crc32_sctp_avx; - state->crc24_lte_a = crc24_lte_a_avx; - state->crc24_lte_b = crc24_lte_b_avx; - state->crc16_fp_data = crc16_fp_data_avx; - state->crc11_fp_header = crc11_fp_header_avx; - state->crc7_fp_header = crc7_fp_header_avx; - state->crc10_iuup_data = crc10_iuup_data_avx; - state->crc6_iuup_header = crc6_iuup_header_avx; + state->hec_32 = hec_32_avx; + state->hec_64 = hec_64_avx; + + state->crc32_ethernet_fcs = ethernet_fcs_avx; + state->crc16_x25 = crc16_x25_avx; + state->crc32_sctp = crc32_sctp_avx; + state->crc24_lte_a = crc24_lte_a_avx; + state->crc24_lte_b = crc24_lte_b_avx; + state->crc16_fp_data = crc16_fp_data_avx; + state->crc11_fp_header = crc11_fp_header_avx; + state->crc7_fp_header = crc7_fp_header_avx; + state->crc10_iuup_data = crc10_iuup_data_avx; + state->crc6_iuup_header = crc6_iuup_header_avx; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_avx; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_avx; @@ -438,55 +434,55 @@ init_mb_mgr_avx2_t1_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_avx2; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_avx; - state->gcm128_enc = aes_gcm_enc_128_avx_gen4; - state->gcm192_enc = aes_gcm_enc_192_avx_gen4; - state->gcm256_enc = aes_gcm_enc_256_avx_gen4; - state->gcm128_dec = aes_gcm_dec_128_avx_gen4; - state->gcm192_dec = aes_gcm_dec_192_avx_gen4; - state->gcm256_dec = aes_gcm_dec_256_avx_gen4; - state->gcm128_init = aes_gcm_init_128_avx_gen4; - state->gcm192_init = aes_gcm_init_192_avx_gen4; - state->gcm256_init = aes_gcm_init_256_avx_gen4; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; - state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; - state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; - state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; - state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; - state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; - state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; + state->gcm128_enc = aes_gcm_enc_128_avx_gen4; + state->gcm192_enc = aes_gcm_enc_192_avx_gen4; + state->gcm256_enc = aes_gcm_enc_256_avx_gen4; + state->gcm128_dec = aes_gcm_dec_128_avx_gen4; + state->gcm192_dec = aes_gcm_dec_192_avx_gen4; + state->gcm256_dec = aes_gcm_dec_256_avx_gen4; + state->gcm128_init = aes_gcm_init_128_avx_gen4; + state->gcm192_init = aes_gcm_init_192_avx_gen4; + state->gcm256_init = aes_gcm_init_256_avx_gen4; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; + state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; + state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; + state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; + state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; + state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; + state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx_gen4; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx_gen4; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx_gen4; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx_gen4; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx_gen4; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx_gen4; - state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; - state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; - state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; - state->gcm128_pre = aes_gcm_pre_128_avx_gen4; - state->gcm192_pre = aes_gcm_pre_192_avx_gen4; - state->gcm256_pre = aes_gcm_pre_256_avx_gen4; - - state->ghash = ghash_avx_gen4; - state->ghash_pre = ghash_pre_avx_gen4; - - state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; - state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; - state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; - state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; - state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; - state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; - state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; - state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; - state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; + state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; + state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; + state->gcm128_pre = aes_gcm_pre_128_avx_gen4; + state->gcm192_pre = aes_gcm_pre_192_avx_gen4; + state->gcm256_pre = aes_gcm_pre_256_avx_gen4; + + state->ghash = ghash_avx_gen4; + state->ghash_pre = ghash_pre_avx_gen4; + + state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; + state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; + state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; + state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; + state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; + state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; + state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; + state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; + state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_avx2; + state->chacha20_hp_quic = quic_chacha20_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t1/sha_avx2.c b/lib/avx2_t1/sha_avx2.c index 69f77b75..9ce5c32c 100644 --- a/lib/avx2_t1/sha_avx2.c +++ b/lib/avx2_t1/sha_avx2.c @@ -30,7 +30,8 @@ /* ========================================================================== */ /* One block SHA1 computation for IPAD / OPAD usage only */ -void sha1_one_block_avx2(const void *data, void *digest) +void +sha1_one_block_avx2(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 1 /* SHA1 */); } @@ -39,15 +40,16 @@ void sha1_one_block_avx2(const void *data, void *digest) /* * SHA1 API for use in HMAC-SHA1 when key is longer than the block size */ -void sha1_avx2(const void *data, const uint64_t length, void *digest) +void +sha1_avx2(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 1, IMB_SHA1_BLOCK_SIZE, - SHA1_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE); } /* ========================================================================== */ /* One block SHA224 computation for IPAD / OPAD usage only */ -void sha224_one_block_avx2(const void *data, void *digest) +void +sha224_one_block_avx2(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 224 /* SHA224 */); } @@ -56,15 +58,16 @@ void sha224_one_block_avx2(const void *data, void *digest) /* * SHA224 API for use in HMAC-SHA224 when key is longer than the block size */ -void sha224_avx2(const void *data, const uint64_t length, void *digest) +void +sha224_avx2(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 224, IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); } /* ========================================================================== */ /* One block SHA256 computation for IPAD / OPAD usage only */ -void sha256_one_block_avx2(const void *data, void *digest) +void +sha256_one_block_avx2(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 256 /* SHA256 */); } @@ -73,16 +76,16 @@ void sha256_one_block_avx2(const void *data, void *digest) /* * SHA256 API for use in HMAC-SHA256 when key is longer than the block size */ -void sha256_avx2(const void *data, const uint64_t length, void *digest) +void +sha256_avx2(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 256, IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); } - /* ========================================================================== */ /* One block SHA384 computation for IPAD / OPAD usage only */ -void sha384_one_block_avx2(const void *data, void *digest) +void +sha384_one_block_avx2(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 384 /* SHA384 */); } @@ -91,15 +94,16 @@ void sha384_one_block_avx2(const void *data, void *digest) /* * SHA384 API for use in HMAC-SHA384 when key is longer than the block size */ -void sha384_avx2(const void *data, const uint64_t length, void *digest) +void +sha384_avx2(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 384, - IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 384, IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); } /* ========================================================================== */ /* One block SHA512 computation for IPAD / OPAD usage only */ -void sha512_one_block_avx2(const void *data, void *digest) +void +sha512_one_block_avx2(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 512 /* SHA512 */); } @@ -108,8 +112,8 @@ void sha512_one_block_avx2(const void *data, void *digest) /* * SHA512 API for use in HMAC-SHA512 when key is longer than the block size */ -void sha512_avx2(const void *data, const uint64_t length, void *digest) +void +sha512_avx2(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 512, IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); } diff --git a/lib/avx2_t1/sha_mb_avx2.c b/lib/avx2_t1/sha_mb_avx2.c index e97193d8..eee83390 100644 --- a/lib/avx2_t1/sha_mb_avx2.c +++ b/lib/avx2_t1/sha_mb_avx2.c @@ -28,11 +28,15 @@ #include "include/sha_mb_mgr.h" #include "include/arch_avx2_type1.h" -IMB_JOB *submit_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); /* ========================================================================== */ /* @@ -40,19 +44,19 @@ IMB_JOB *flush_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 8, 1, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_x8_avx2_from_c, 0); + return submit_flush_job_sha_1(state, job, 8, 1, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_x8_avx2_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 8, 0, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_x8_avx2_from_c, 0); + return submit_flush_job_sha_1(state, job, 8, 0, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_x8_avx2_from_c, 0); } /* ========================================================================== */ @@ -61,19 +65,19 @@ IMB_JOB *flush_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 8, 1, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha256_oct_avx2_from_c, 0); + return submit_flush_job_sha_256(state, job, 8, 1, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha256_oct_avx2_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 8, 0, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha256_oct_avx2_from_c, 0); + return submit_flush_job_sha_256(state, job, 8, 0, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha256_oct_avx2_from_c, 0); } /* ========================================================================== */ @@ -82,19 +86,19 @@ IMB_JOB *flush_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 8, 1, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha256_oct_avx2_from_c, 0); + return submit_flush_job_sha_256(state, job, 8, 1, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha256_oct_avx2_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 8, 0, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha256_oct_avx2_from_c, 0); + return submit_flush_job_sha_256(state, job, 8, 0, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha256_oct_avx2_from_c, 0); } /* ========================================================================== */ @@ -103,19 +107,19 @@ IMB_JOB *flush_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 4, 1, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x4_avx2_from_c); + return submit_flush_job_sha_512(state, job, 4, 1, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x4_avx2_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 4, 0, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x4_avx2_from_c); + return submit_flush_job_sha_512(state, job, 4, 0, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x4_avx2_from_c); } /* ========================================================================== */ @@ -124,17 +128,17 @@ IMB_JOB *flush_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 4, 1, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x4_avx2_from_c); + return submit_flush_job_sha_512(state, job, 4, 1, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x4_avx2_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 4, 0, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x4_avx2_from_c); + return submit_flush_job_sha_512(state, job, 4, 0, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x4_avx2_from_c); } diff --git a/lib/avx2_t1/snow3g_avx2.c b/lib/avx2_t1/snow3g_avx2.c index 8daad666..db596780 100644 --- a/lib/avx2_t1/snow3g_avx2.c +++ b/lib/avx2_t1/snow3g_avx2.c @@ -25,7 +25,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ - #ifdef _WIN32 /* use AVX implementation on Windows for now */ #define AVX @@ -34,16 +33,16 @@ #define AVX2 #define CLEAR_SCRATCH_SIMD_REGS clear_scratch_ymms #endif -#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_avx2 -#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_avx2 -#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_avx2 -#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_avx2 -#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_avx2 -#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_avx2 +#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_avx2 +#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_avx2 +#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_avx2 +#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_avx2 +#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_avx2 +#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_avx2 #define SNOW3G_F8_8_BUFFER_MULTIKEY snow3g_f8_8_buffer_multikey_avx2 #define SNOW3G_F8_N_BUFFER_MULTIKEY snow3g_f8_n_buffer_multikey_avx2 -#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_avx2 -#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_avx2 -#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_avx2 +#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_avx2 +#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_avx2 +#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_avx2 #include "include/snow3g_common.h" diff --git a/lib/avx2_t1/zuc_top_avx2.c b/lib/avx2_t1/zuc_top_avx2.c index 9e0f8ed2..74dce610 100644 --- a/lib/avx2_t1/zuc_top_avx2.c +++ b/lib/avx2_t1/zuc_top_avx2.c @@ -26,12 +26,12 @@ *******************************************************************************/ /*----------------------------------------------------------------------- -* zuc_avx.c -*----------------------------------------------------------------------- -* An implementation of ZUC, the core algorithm for the -* 3GPP Confidentiality and Integrity algorithms. -* -*-----------------------------------------------------------------------*/ + * zuc_avx.c + *----------------------------------------------------------------------- + * An implementation of ZUC, the core algorithm for the + * 3GPP Confidentiality and Integrity algorithms. + * + *-----------------------------------------------------------------------*/ #include @@ -51,9 +51,8 @@ #define NUM_AVX2_BUFS 8 static inline void -init_8(ZucKey8_t *keys, const uint8_t *ivs, ZucState8_t *state, - const uint64_t key_sz, const uint64_t tag_sz, - void *T, const unsigned use_gfni) +init_8(ZucKey8_t *keys, const uint8_t *ivs, ZucState8_t *state, const uint64_t key_sz, + const uint64_t tag_sz, void *T, const unsigned use_gfni) { if (key_sz == 128) { if (use_gfni) @@ -62,17 +61,15 @@ init_8(ZucKey8_t *keys, const uint8_t *ivs, ZucState8_t *state, asm_ZucInitialization_8_avx2(keys, ivs, state); } else { if (use_gfni) - asm_Zuc256Initialization_8_gfni_avx2(keys, ivs, - state, T, tag_sz); + asm_Zuc256Initialization_8_gfni_avx2(keys, ivs, state, T, tag_sz); else - asm_Zuc256Initialization_8_avx2(keys, ivs, state, T, - tag_sz); + asm_Zuc256Initialization_8_avx2(keys, ivs, state, T, tag_sz); } } static inline void -keygen_8(ZucState8_t *state, uint32_t **pKeyStrArr, - const uint64_t numKeyStrBytes, const unsigned use_gfni) +keygen_8(ZucState8_t *state, uint32_t **pKeyStrArr, const uint64_t numKeyStrBytes, + const unsigned use_gfni) { if (use_gfni) { if (numKeyStrBytes == 4) @@ -96,15 +93,12 @@ keygen_8(ZucState8_t *state, uint32_t **pKeyStrArr, } static inline uint16_t -find_min_length16(const uint16_t length[NUM_AVX2_BUFS], - unsigned int *allCommonBits) +find_min_length16(const uint16_t length[NUM_AVX2_BUFS], unsigned int *allCommonBits) { - static const uint16_t bcast_mask[8] = { - 0x0001, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0001, 0x0001 - }; + static const uint16_t bcast_mask[8] = { 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001 }; - __m128i xmm_lengths = _mm_loadu_si128((const __m128i *)length); + __m128i xmm_lengths = _mm_loadu_si128((const __m128i *) length); __m128i shuf_mask = _mm_loadu_si128((const __m128i *) bcast_mask); /* Broadcast first word of the array */ __m128i bcast_first = _mm_shuffle_epi8(xmm_lengths, shuf_mask); @@ -118,13 +112,10 @@ find_min_length16(const uint16_t length[NUM_AVX2_BUFS], } static inline uint16_t -find_min_length32(const uint32_t length[NUM_AVX2_BUFS], - unsigned int *allCommonBits) +find_min_length32(const uint32_t length[NUM_AVX2_BUFS], unsigned int *allCommonBits) { - static const uint16_t bcast_mask[8] = { - 0x0001, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0001, 0x0001 - }; + static const uint16_t bcast_mask[8] = { 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001 }; /* Calculate the minimum input packet size */ __m128i length1 = _mm_loadu_si128((const __m128i *) length); @@ -152,12 +143,9 @@ find_min_length32(const uint32_t length[NUM_AVX2_BUFS], return _mm_extract_epi16(length1, 0); } -static inline -void _zuc_eea3_1_buffer_avx2(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +static inline void +_zuc_eea3_1_buffer_avx2(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t length) { DECLARE_ALIGNED(ZucState_t zucState, 64); DECLARE_ALIGNED(uint8_t keyStream[32], 64); @@ -166,7 +154,7 @@ void _zuc_eea3_1_buffer_avx2(const void *pKey, uint64_t *pOut64 = NULL, *pKeyStream64 = NULL; uint64_t *pTemp64 = NULL, *pdstTemp64 = NULL; - uint32_t numKeyStreamsPerPkt = length/ KEYSTR_ROUND_LEN; + uint32_t numKeyStreamsPerPkt = length / KEYSTR_ROUND_LEN; uint32_t numBytesLeftOver = length % KEYSTR_ROUND_LEN; /* initialize the zuc state */ @@ -179,8 +167,7 @@ void _zuc_eea3_1_buffer_avx2(const void *pKey, while (numKeyStreamsPerPkt--) { /* Generate the key stream 32 bytes at a time */ - asm_ZucGenKeystream32B_avx((uint32_t *) &keyStream[0], - &zucState); + asm_ZucGenKeystream32B_avx((uint32_t *) &keyStream[0], &zucState); /* XOR The Keystream generated with the input buffer here */ pKeyStream64 = (uint64_t *) keyStream; @@ -198,22 +185,19 @@ void _zuc_eea3_1_buffer_avx2(const void *pKey, uint8_t *pOut8 = (uint8_t *) pBufferOut; const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_avx((uint32_t *) &keyStream[0], - &zucState, num4BRounds); + asm_ZucGenKeystream_avx((uint32_t *) &keyStream[0], &zucState, num4BRounds); /* copy the remaining bytes into temporary buffer and XOR with * the 32 bytes of keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], - numBytesLeftOver); + memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStream[0]; pTemp64 = (uint64_t *) &tempSrc[0]; pdstTemp64 = (uint64_t *) &tempDst[0]; asm_XorKeyStream32B_avx2(pTemp64, pdstTemp64, pKeyStream64); - memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], - numBytesLeftOver); + memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); @@ -228,27 +212,26 @@ void _zuc_eea3_1_buffer_avx2(const void *pKey, } IMB_DLL_LOCAL -void _zuc_eea3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], - const void * const pIv[NUM_AVX2_BUFS], - const void * const pBufferIn[NUM_AVX2_BUFS], - void *pBufferOut[NUM_AVX2_BUFS], - const uint32_t length[NUM_AVX2_BUFS]) +void +_zuc_eea3_8_buffer_avx2(const void *const pKey[NUM_AVX2_BUFS], const void *const pIv[NUM_AVX2_BUFS], + const void *const pBufferIn[NUM_AVX2_BUFS], void *pBufferOut[NUM_AVX2_BUFS], + const uint32_t length[NUM_AVX2_BUFS]) { DECLARE_ALIGNED(ZucState8_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); unsigned int i = 0; uint16_t bytes = (uint16_t) find_min_length32(length, &i); - DECLARE_ALIGNED(uint16_t remainBytes[NUM_AVX2_BUFS], 16) = {0}; + DECLARE_ALIGNED(uint16_t remainBytes[NUM_AVX2_BUFS], 16) = { 0 }; DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX2_BUFS][KEYSTR_ROUND_LEN], 64); /* structure to store the 8 keys */ DECLARE_ALIGNED(ZucKey8_t keys, 64); /* structure to store the 8 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_AVX2_BUFS*32], 16); + DECLARE_ALIGNED(uint8_t ivs[NUM_AVX2_BUFS * 32], 16); const uint8_t *pTempBufInPtr = NULL; uint8_t *pTempBufOutPtr = NULL; - DECLARE_ALIGNED(const uint64_t *pIn64[NUM_AVX2_BUFS], 32) = {NULL}; - DECLARE_ALIGNED(uint64_t *pOut64[NUM_AVX2_BUFS], 32) = {NULL}; + DECLARE_ALIGNED(const uint64_t *pIn64[NUM_AVX2_BUFS], 32) = { NULL }; + DECLARE_ALIGNED(uint64_t * pOut64[NUM_AVX2_BUFS], 32) = { NULL }; uint64_t *pKeyStream64 = NULL; /* @@ -258,7 +241,7 @@ void _zuc_eea3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], for (i = 0; i < NUM_AVX2_BUFS; i++) { remainBytes[i] = length[i]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } asm_ZucInitialization_8_avx2(&keys, ivs, &state); @@ -294,34 +277,26 @@ void _zuc_eea3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], singlePktState.fR1 = state.fR1[i]; singlePktState.fR2 = state.fR2[i]; - uint32_t numKeyStreamsPerPkt = - remainBytes[i] / KEYSTR_ROUND_LEN; - const uint32_t numBytesLeftOver = - remainBytes[i] % KEYSTR_ROUND_LEN; + uint32_t numKeyStreamsPerPkt = remainBytes[i] / KEYSTR_ROUND_LEN; + const uint32_t numBytesLeftOver = remainBytes[i] % KEYSTR_ROUND_LEN; pTempBufInPtr = pBufferIn[i]; pTempBufOutPtr = pBufferOut[i]; /* update the output and input pointers here to point * to the i'th buffers */ - pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - - remainBytes[i]]; - pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - - remainBytes[i]]; + pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - remainBytes[i]]; + pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - remainBytes[i]]; while (numKeyStreamsPerPkt--) { /* Generate the key stream 32 bytes at a time */ - asm_ZucGenKeystream32B_avx( - (uint32_t *) keyStr[0], - &singlePktState); + asm_ZucGenKeystream32B_avx((uint32_t *) keyStr[0], &singlePktState); pKeyStream64 = (uint64_t *) keyStr[0]; - asm_XorKeyStream32B_avx2(pIn64[0], pOut64[0], - pKeyStream64); + asm_XorKeyStream32B_avx2(pIn64[0], pOut64[0], pKeyStream64); pIn64[0] += 4; pOut64[0] += 4; } - /* Check for remaining 0 to 31 bytes */ if (numBytesLeftOver) { DECLARE_ALIGNED(uint8_t tempSrc[32], 64); @@ -329,29 +304,23 @@ void _zuc_eea3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], uint64_t *pTempSrc64; uint64_t *pTempDst64; uint32_t offset = length[i] - numBytesLeftOver; - const uint64_t num4BRounds = - ((numBytesLeftOver - 1) / 4) + 1; + const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_avx((uint32_t *)&keyStr[0], - &singlePktState, + asm_ZucGenKeystream_avx((uint32_t *) &keyStr[0], &singlePktState, num4BRounds); /* copy the remaining bytes into temporary * buffer and XOR with the 32 bytes of * keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pTempBufInPtr[offset], - numBytesLeftOver); - memset(&tempSrc[numBytesLeftOver], 0, - 32 - numBytesLeftOver); + memcpy(&tempSrc[0], &pTempBufInPtr[offset], numBytesLeftOver); + memset(&tempSrc[numBytesLeftOver], 0, 32 - numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStr[0][0]; pTempSrc64 = (uint64_t *) &tempSrc[0]; pTempDst64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream32B_avx2(pTempSrc64, pTempDst64, - pKeyStream64); + asm_XorKeyStream32B_avx2(pTempSrc64, pTempDst64, pKeyStream64); - memcpy(&pTempBufOutPtr[offset], - &tempDst[0], numBytesLeftOver); + memcpy(&pTempBufOutPtr[offset], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); clear_mem(tempDst, sizeof(tempDst)); @@ -368,11 +337,9 @@ void _zuc_eea3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], #endif } -void zuc_eea3_1_buffer_avx2(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +void +zuc_eea3_1_buffer_avx2(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t length) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -420,10 +387,10 @@ void zuc_eea3_1_buffer_avx2(const void *pKey, #endif } -void zuc_eea3_n_buffer_avx2(const void * const pKey[], const void * const pIv[], - const void * const pBufferIn[], void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers) +void +zuc_eea3_n_buffer_avx2(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t length[], + const uint32_t numBuffers) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -486,8 +453,7 @@ void zuc_eea3_n_buffer_avx2(const void * const pKey[], const void * const pIv[], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -495,32 +461,22 @@ void zuc_eea3_n_buffer_avx2(const void * const pKey[], const void * const pIv[], #endif i = 0; - while(packetCount >= 8) { - packetCount -=8; - _zuc_eea3_8_buffer_avx2(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], + while (packetCount >= 8) { + packetCount -= 8; + _zuc_eea3_8_buffer_avx2(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], &length[i]); - i+=8; + i += 8; } if (packetCount >= 4) { packetCount -= 4; - _zuc_eea3_4_buffer_avx(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], + _zuc_eea3_4_buffer_avx(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], &length[i]); i += 4; } - while(packetCount--) { - _zuc_eea3_1_buffer_avx2(pKey[i], - pIv[i], - pBufferIn[i], - pBufferOut[i], - length[i]); + while (packetCount--) { + _zuc_eea3_1_buffer_avx2(pKey[i], pIv[i], pBufferIn[i], pBufferOut[i], length[i]); i++; } #ifdef SAFE_DATA @@ -533,12 +489,9 @@ void zuc_eea3_n_buffer_avx2(const void * const pKey[], const void * const pIv[], #endif } -static inline -void _zuc_eia3_1_buffer_avx2(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +static inline void +_zuc_eia3_1_buffer_avx2(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { DECLARE_ALIGNED(ZucState_t zucState, 64); DECLARE_ALIGNED(uint32_t keyStream[8 * 2], 64); @@ -554,7 +507,7 @@ void _zuc_eia3_1_buffer_avx2(const void *pKey, /* loop over the message bits */ while (remainingBits >= keyStreamLengthInBits) { - remainingBits -= keyStreamLengthInBits; + remainingBits -= keyStreamLengthInBits; /* Generate the next key stream 8 bytes or 32 bytes */ if (!remainingBits) asm_ZucGenKeystream8B_avx(&keyStream[8], &zucState); @@ -581,41 +534,39 @@ void _zuc_eia3_1_buffer_avx2(const void *pKey, } IMB_DLL_LOCAL -void _zuc_eia3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], - const void * const pIv[NUM_AVX2_BUFS], - const void * const pBufferIn[NUM_AVX2_BUFS], - const uint32_t lengthInBits[NUM_AVX2_BUFS], - uint32_t *pMacI[NUM_AVX2_BUFS]) +void +_zuc_eia3_8_buffer_avx2(const void *const pKey[NUM_AVX2_BUFS], const void *const pIv[NUM_AVX2_BUFS], + const void *const pBufferIn[NUM_AVX2_BUFS], + const uint32_t lengthInBits[NUM_AVX2_BUFS], uint32_t *pMacI[NUM_AVX2_BUFS]) { unsigned int i = 0; DECLARE_ALIGNED(ZucState8_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX2_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX2_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 8 keys */ DECLARE_ALIGNED(ZucKey8_t keys, 64); /* structure to store the 8 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_AVX2_BUFS*32], 16); - const uint8_t *pIn8[NUM_AVX2_BUFS] = {NULL}; + DECLARE_ALIGNED(uint8_t ivs[NUM_AVX2_BUFS * 32], 16); + const uint8_t *pIn8[NUM_AVX2_BUFS] = { NULL }; uint32_t numKeyStr = 0; uint32_t T[NUM_AVX2_BUFS]; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_AVX2_BUFS], 32) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_AVX2_BUFS], 32) = { NULL }; unsigned int allCommonBits; - uint32_t remainCommonBits = find_min_length32(lengthInBits, - &allCommonBits); + uint32_t remainCommonBits = find_min_length32(lengthInBits, &allCommonBits); memset(T, 0, sizeof(T)); for (i = 0; i < NUM_AVX2_BUFS; i++) { pIn8[i] = (const uint8_t *) pBufferIn[i]; pKeyStrArr[i] = (uint32_t *) &keyStr[i][0]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } asm_ZucInitialization_8_avx2(&keys, ivs, &state); /* Generate 32 bytes at a time */ - asm_ZucGenKeystream32B_8_avx2(&state, (uint32_t **)pKeyStrArr); + asm_ZucGenKeystream32B_8_avx2(&state, (uint32_t **) pKeyStrArr); /* Point at the next 32 bytes of the key */ for (i = 0; i < NUM_AVX2_BUFS; i++) @@ -626,11 +577,9 @@ void _zuc_eia3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], numKeyStr++; /* Generate the next key stream 8 bytes or 32 bytes */ if (!remainCommonBits && allCommonBits) - asm_ZucGenKeystream8B_8_avx2(&state, - (uint32_t **)pKeyStrArr); + asm_ZucGenKeystream8B_8_avx2(&state, (uint32_t **) pKeyStrArr); else - asm_ZucGenKeystream32B_8_avx2(&state, - (uint32_t **)pKeyStrArr); + asm_ZucGenKeystream32B_8_avx2(&state, (uint32_t **) pKeyStrArr); for (i = 0; i < NUM_AVX2_BUFS; i++) { asm_Eia3Round32B_avx(&T[i], &keyStr[i][0], pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; @@ -639,14 +588,13 @@ void _zuc_eia3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_AVX2_BUFS; i++) { - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; /* If remaining bits are more than 24 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (6*32)) { + if (remainBits > (6 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -673,11 +621,9 @@ void _zuc_eia3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], /* Generate the next key stream 8 bytes or 32 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_avx(&keyStr32[8], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[8], &singlePktState); else - asm_ZucGenKeystream32B_avx(&keyStr32[8], - &singlePktState); + asm_ZucGenKeystream32B_avx(&keyStr32[8], &singlePktState); asm_Eia3Round32B_avx(&T[i], &keyStr32[0], pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } @@ -688,11 +634,9 @@ void _zuc_eia3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], */ if (remainBits > (6 * 32)) - asm_ZucGenKeystream8B_avx(&keyStr32[8], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[8], &singlePktState); - asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, - 128, 4); + asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, 128, 4); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; } @@ -706,11 +650,9 @@ void _zuc_eia3_8_buffer_avx2(const void * const pKey[NUM_AVX2_BUFS], #endif } -void zuc_eia3_1_buffer_avx2(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +void +zuc_eia3_1_buffer_avx2(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -758,29 +700,25 @@ void zuc_eia3_1_buffer_avx2(const void *pKey, #endif } -static inline -void _zuc_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_AVX2_BUFS], - uint32_t *pMacI[NUM_AVX2_BUFS], - const uint16_t lengthInBits[NUM_AVX2_BUFS], - const void * const job_in_lane[NUM_AVX2_BUFS], - const unsigned use_gfni) +static inline void +_zuc_eia3_8_buffer_job(const void *const pKey[NUM_AVX2_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_AVX2_BUFS], uint32_t *pMacI[NUM_AVX2_BUFS], + const uint16_t lengthInBits[NUM_AVX2_BUFS], + const void *const job_in_lane[NUM_AVX2_BUFS], const unsigned use_gfni) { unsigned int i = 0; DECLARE_ALIGNED(ZucState8_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX2_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX2_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 8 keys */ DECLARE_ALIGNED(ZucKey8_t keys, 64); - const uint8_t *pIn8[NUM_AVX2_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_AVX2_BUFS] = { NULL }; uint32_t numKeyStr = 0; uint32_t T[NUM_AVX2_BUFS]; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_AVX2_BUFS], 32) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_AVX2_BUFS], 32) = { NULL }; unsigned int allCommonBits; - uint32_t remainCommonBits = find_min_length16(lengthInBits, - &allCommonBits); + uint32_t remainCommonBits = find_min_length16(lengthInBits, &allCommonBits); memset(T, 0, sizeof(T)); for (i = 0; i < NUM_AVX2_BUFS; i++) { @@ -821,14 +759,13 @@ void _zuc_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], if (job_in_lane[i] == NULL) continue; - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; /* If remaining bits are more than 24 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (6*32)) { + if (remainBits > (6 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -855,11 +792,9 @@ void _zuc_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], /* Generate the next key stream 8 bytes or 32 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_avx(&keyStr32[8], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[8], &singlePktState); else - asm_ZucGenKeystream32B_avx(&keyStr32[8], - &singlePktState); + asm_ZucGenKeystream32B_avx(&keyStr32[8], &singlePktState); asm_Eia3Round32B_avx(&T[i], &keyStr32[0], pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } @@ -870,11 +805,9 @@ void _zuc_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], */ if (remainBits > (6 * 32)) - asm_ZucGenKeystream8B_avx(&keyStr32[8], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[8], &singlePktState); - asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, - 128, 4); + asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, 128, 4); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; @@ -889,52 +822,46 @@ void _zuc_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], #endif } -void zuc_eia3_8_buffer_job_avx2(const void * const pKey[NUM_AVX2_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_AVX2_BUFS], - uint32_t *pMacI[NUM_AVX2_BUFS], - const uint16_t lengthInBits[NUM_AVX2_BUFS], - const void * const job_in_lane[NUM_AVX2_BUFS]) +void +zuc_eia3_8_buffer_job_avx2(const void *const pKey[NUM_AVX2_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_AVX2_BUFS], + uint32_t *pMacI[NUM_AVX2_BUFS], + const uint16_t lengthInBits[NUM_AVX2_BUFS], + const void *const job_in_lane[NUM_AVX2_BUFS]) { - _zuc_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, 0); + _zuc_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, 0); } -void zuc_eia3_8_buffer_job_gfni_avx2(const void * const pKey[NUM_AVX2_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_AVX2_BUFS], - uint32_t *pMacI[NUM_AVX2_BUFS], - const uint16_t lengthInBits[NUM_AVX2_BUFS], - const void * const job_in_lane[NUM_AVX2_BUFS]) +void +zuc_eia3_8_buffer_job_gfni_avx2(const void *const pKey[NUM_AVX2_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_AVX2_BUFS], + uint32_t *pMacI[NUM_AVX2_BUFS], + const uint16_t lengthInBits[NUM_AVX2_BUFS], + const void *const job_in_lane[NUM_AVX2_BUFS]) { - _zuc_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, 1); + _zuc_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, 1); } -static inline -void _zuc256_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_AVX2_BUFS], - void *pMacI[NUM_AVX2_BUFS], - const uint16_t lengthInBits[NUM_AVX2_BUFS], - const void * const job_in_lane[NUM_AVX2_BUFS], - const uint64_t tag_size, - const unsigned use_gfni) +static inline void +_zuc256_eia3_8_buffer_job(const void *const pKey[NUM_AVX2_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_AVX2_BUFS], void *pMacI[NUM_AVX2_BUFS], + const uint16_t lengthInBits[NUM_AVX2_BUFS], + const void *const job_in_lane[NUM_AVX2_BUFS], const uint64_t tag_size, + const unsigned use_gfni) { unsigned int i = 0; DECLARE_ALIGNED(ZucState8_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX2_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX2_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 8 keys */ DECLARE_ALIGNED(ZucKey8_t keys, 64); - const uint8_t *pIn8[NUM_AVX2_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_AVX2_BUFS] = { NULL }; uint32_t numKeyStr = 0; - DECLARE_ALIGNED(uint8_t T[NUM_AVX2_BUFS*16], 32); + DECLARE_ALIGNED(uint8_t T[NUM_AVX2_BUFS * 16], 32); const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_AVX2_BUFS], 32) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_AVX2_BUFS], 32) = { NULL }; unsigned int allCommonBits; - uint32_t remainCommonBits = find_min_length16(lengthInBits, - &allCommonBits); + uint32_t remainCommonBits = find_min_length16(lengthInBits, &allCommonBits); memset(T, 0, sizeof(T)); for (i = 0; i < NUM_AVX2_BUFS; i++) { @@ -959,28 +886,26 @@ void _zuc256_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], if (!remainCommonBits && allCommonBits) keygen_8(&state, pKeyStrArr, tag_size, use_gfni); else - keygen_8(&state, (uint32_t **)pKeyStrArr, 32, use_gfni); + keygen_8(&state, (uint32_t **) pKeyStrArr, 32, use_gfni); for (i = 0; i < NUM_AVX2_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; - asm_Eia3Round32B_avx(tag, &keyStr[i][0], pIn8[i], - tag_size); + asm_Eia3Round32B_avx(tag, &keyStr[i][0], pIn8[i], tag_size); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } } /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_AVX2_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; const uint32_t N = remainBits + ((uint32_t) tag_size << 3); @@ -1018,26 +943,21 @@ void _zuc256_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], /* Generate the next key stream (32 bytes max) */ if (L > 7) { - asm_ZucGenKeystream32B_avx(&keyStr32[8], - &singlePktState); + asm_ZucGenKeystream32B_avx(&keyStr32[8], &singlePktState); L -= 8; } else { - asm_ZucGenKeystream_avx(&keyStr32[8], - &singlePktState, L); + asm_ZucGenKeystream_avx(&keyStr32[8], &singlePktState, L); L = 0; } - asm_Eia3Round32B_avx(tag, &keyStr32[0], pIn8[i], - tag_size); + asm_Eia3Round32B_avx(tag, &keyStr32[0], pIn8[i], tag_size); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } /* Generate final keystream if needed */ if (L > 0) - asm_ZucGenKeystream_avx(&keyStr32[8], - &singlePktState, L); + asm_ZucGenKeystream_avx(&keyStr32[8], &singlePktState, L); - asm_Eia3Remainder_avx(tag, keyStr32, pIn8[i], remainBits, - 256, tag_size); + asm_Eia3Remainder_avx(tag, keyStr32, pIn8[i], remainBits, 256, tag_size); /* save the final MAC-I result */ memcpy(pMacI[i], tag, tag_size); @@ -1052,36 +972,33 @@ void _zuc256_eia3_8_buffer_job(const void * const pKey[NUM_AVX2_BUFS], #endif } -void zuc256_eia3_8_buffer_job_avx2(const void * const pKey[NUM_AVX2_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_AVX2_BUFS], - void *pMacI[NUM_AVX2_BUFS], - const uint16_t lengthInBits[NUM_AVX2_BUFS], - const void * const job_in_lane[NUM_AVX2_BUFS], - const uint64_t tag_size) +void +zuc256_eia3_8_buffer_job_avx2(const void *const pKey[NUM_AVX2_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_AVX2_BUFS], + void *pMacI[NUM_AVX2_BUFS], + const uint16_t lengthInBits[NUM_AVX2_BUFS], + const void *const job_in_lane[NUM_AVX2_BUFS], const uint64_t tag_size) { - _zuc256_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, tag_size, 0); + _zuc256_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, tag_size, + 0); } -void zuc256_eia3_8_buffer_job_gfni_avx2(const void * const pKey[NUM_AVX2_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_AVX2_BUFS], - void *pMacI[NUM_AVX2_BUFS], - const uint16_t lengthInBits[NUM_AVX2_BUFS], - const void * const job_in_lane[NUM_AVX2_BUFS], - const uint64_t tag_size) +void +zuc256_eia3_8_buffer_job_gfni_avx2(const void *const pKey[NUM_AVX2_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_AVX2_BUFS], + void *pMacI[NUM_AVX2_BUFS], + const uint16_t lengthInBits[NUM_AVX2_BUFS], + const void *const job_in_lane[NUM_AVX2_BUFS], + const uint64_t tag_size) { - _zuc256_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, tag_size, 1); + _zuc256_eia3_8_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, tag_size, + 1); } -void zuc_eia3_n_buffer_avx2(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers) +void +zuc_eia3_n_buffer_avx2(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -1144,8 +1061,7 @@ void zuc_eia3_n_buffer_avx2(const void * const pKey[], } /* Check input data is in range of supported length */ - if (lengthInBits[i] < ZUC_MIN_BITLEN || - lengthInBits[i] > ZUC_MAX_BITLEN) { + if (lengthInBits[i] < ZUC_MIN_BITLEN || lengthInBits[i] > ZUC_MAX_BITLEN) { imb_set_errno(NULL, IMB_ERR_AUTH_LEN); return; } @@ -1153,32 +1069,22 @@ void zuc_eia3_n_buffer_avx2(const void * const pKey[], #endif i = 0; - while(packetCount >= 8) { + while (packetCount >= 8) { packetCount -= 8; - _zuc_eia3_8_buffer_avx2(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], + _zuc_eia3_8_buffer_avx2(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], &pMacI[i]); i += 8; } if (packetCount >= 4) { packetCount -= 4; - _zuc_eia3_4_buffer_avx(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], + _zuc_eia3_4_buffer_avx(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], &pMacI[i]); i += 4; } - while(packetCount--) { - _zuc_eia3_1_buffer_avx2(pKey[i], - pIv[i], - pBufferIn[i], - lengthInBits[i], - pMacI[i]); + while (packetCount--) { + _zuc_eia3_1_buffer_avx2(pKey[i], pIv[i], pBufferIn[i], lengthInBits[i], pMacI[i]); i++; } diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index 7fc8a318..4d0f5692 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -55,29 +55,29 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx /* JOB API */ -#define SUBMIT_JOB submit_job_avx2_t2 -#define FLUSH_JOB flush_job_avx2_t2 -#define QUEUE_SIZE queue_size_avx2_t2 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx2_t2 -#define GET_NEXT_JOB get_next_job_avx2_t2 -#define GET_COMPLETED_JOB get_completed_job_avx2_t2 -#define GET_NEXT_BURST get_next_burst_avx2_t2 -#define SUBMIT_BURST submit_burst_avx2_t2 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx2_t2 -#define FLUSH_BURST flush_burst_avx2_t2 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx2_t2 +#define SUBMIT_JOB submit_job_avx2_t2 +#define FLUSH_JOB flush_job_avx2_t2 +#define QUEUE_SIZE queue_size_avx2_t2 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx2_t2 +#define GET_NEXT_JOB get_next_job_avx2_t2 +#define GET_COMPLETED_JOB get_completed_job_avx2_t2 +#define GET_NEXT_BURST get_next_burst_avx2_t2 +#define SUBMIT_BURST submit_burst_avx2_t2 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx2_t2 +#define FLUSH_BURST flush_burst_avx2_t2 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx2_t2 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx2_t2 -#define SUBMIT_HASH_BURST submit_hash_burst_avx2_t2 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx2_t2 -#define SET_SUITE_ID_FN set_suite_id_avx2_t2 +#define SUBMIT_HASH_BURST submit_hash_burst_avx2_t2 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx2_t2 +#define SET_SUITE_ID_FN set_suite_id_avx2_t2 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX2 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX2 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX2 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX2 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_AVX2 @@ -85,12 +85,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 #define SUBMIT_JOB_AES_GCM_DEC submit_job_gcm_dec_avx2 #define SUBMIT_JOB_AES_GCM_ENC submit_job_gcm_enc_avx2 @@ -108,9 +108,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_avx #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_avx -#define AES_CBC_DEC_128 aes_cbc_dec_128_avx -#define AES_CBC_DEC_192 aes_cbc_dec_192_avx -#define AES_CBC_DEC_256 aes_cbc_dec_256_avx +#define AES_CBC_DEC_128 aes_cbc_dec_128_avx +#define AES_CBC_DEC_192 aes_cbc_dec_192_avx +#define AES_CBC_DEC_256 aes_cbc_dec_256_avx /* AES-CBCS */ #define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_avx @@ -126,45 +126,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_vaes_avx2 #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_vaes_avx2 -#define AES_ECB_ENC_128 aes_ecb_enc_128_vaes_avx2 -#define AES_ECB_ENC_192 aes_ecb_enc_192_vaes_avx2 -#define AES_ECB_ENC_256 aes_ecb_enc_256_vaes_avx2 -#define AES_ECB_DEC_128 aes_ecb_dec_128_vaes_avx2 -#define AES_ECB_DEC_192 aes_ecb_dec_192_vaes_avx2 -#define AES_ECB_DEC_256 aes_ecb_dec_256_vaes_avx2 +#define AES_ECB_ENC_128 aes_ecb_enc_128_vaes_avx2 +#define AES_ECB_ENC_192 aes_ecb_enc_192_vaes_avx2 +#define AES_ECB_ENC_256 aes_ecb_enc_256_vaes_avx2 +#define AES_ECB_DEC_128 aes_ecb_dec_128_vaes_avx2 +#define AES_ECB_DEC_192 aes_ecb_dec_192_vaes_avx2 +#define AES_ECB_DEC_256 aes_ecb_dec_256_vaes_avx2 /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_avx -#define AES_CTR_192 aes_cntr_192_avx -#define AES_CTR_256 aes_cntr_256_avx -#define AES_CTR_128_BIT aes_cntr_bit_128_avx -#define AES_CTR_192_BIT aes_cntr_bit_192_avx -#define AES_CTR_256_BIT aes_cntr_bit_256_avx +#define AES_CTR_128 aes_cntr_128_avx +#define AES_CTR_192 aes_cntr_192_avx +#define AES_CTR_256 aes_cntr_256_avx +#define AES_CTR_128_BIT aes_cntr_bit_128_avx +#define AES_CTR_192_BIT aes_cntr_bit_192_avx +#define AES_CTR_256_BIT aes_cntr_bit_256_avx /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_avx2 -#define AES_CFB_256_ONE aes_cfb_256_one_avx2 +#define AES_CFB_128_ONE aes_cfb_128_one_avx2 +#define AES_CFB_256_ONE aes_cfb_256_one_avx2 /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_avx @@ -174,30 +174,30 @@ /* SHA1/224/256/384/512 */ /* note: SHA1 MB is better than SHANI on Xeon processors */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_avx2 -#define FLUSH_JOB_SHA1 flush_job_sha1_avx2 -#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse -#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse -#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse -#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse -#define SUBMIT_JOB_SHA384 submit_job_sha384_avx2 -#define FLUSH_JOB_SHA384 flush_job_sha384_avx2 -#define SUBMIT_JOB_SHA512 submit_job_sha512_avx2 -#define FLUSH_JOB_SHA512 flush_job_sha512_avx2 +#define SUBMIT_JOB_SHA1 submit_job_sha1_avx2 +#define FLUSH_JOB_SHA1 flush_job_sha1_avx2 +#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse +#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse +#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse +#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse +#define SUBMIT_JOB_SHA384 submit_job_sha384_avx2 +#define FLUSH_JOB_SHA384 flush_job_sha384_avx2 +#define SUBMIT_JOB_SHA512 submit_job_sha512_avx2 +#define FLUSH_JOB_SHA512 flush_job_sha512_avx2 /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_avx2 -#define FLUSH_JOB_HMAC flush_job_hmac_avx2 -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx2 -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx2 -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx2 -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx2 -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 +#define SUBMIT_JOB_HMAC submit_job_hmac_avx2 +#define FLUSH_JOB_HMAC flush_job_hmac_avx2 +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx2 +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx2 +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx2 +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx2 +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 /* CHACHA20 & POLY1305 */ #define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx2 @@ -206,14 +206,14 @@ #define POLY1305_MAC poly1305_mac_scalar /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_avx2 -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_avx2 -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_avx2 -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_avx2 -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_avx2 -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_avx2 -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_avx2 -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_avx2 +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_avx2 +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_avx2 +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_avx2 +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_avx2 +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_avx2 +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_avx2 +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_avx2 +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_avx2 /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_avx @@ -225,8 +225,7 @@ submit_snow3g_uea2_job_avx2_t2(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -249,7 +248,8 @@ flush_snow3g_uea2_job_avx2_t2(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 8); @@ -280,12 +280,10 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, 2); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - AVX2_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, AVX2_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - AVX2_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, AVX2_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, AVX2_NUM_MD5_LANES); @@ -347,90 +345,90 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_avx2; - state->keyexp_192 = aes_keyexp_192_avx2; - state->keyexp_256 = aes_keyexp_256_avx2; + state->keyexp_128 = aes_keyexp_128_avx2; + state->keyexp_192 = aes_keyexp_192_avx2; + state->keyexp_256 = aes_keyexp_256_avx2; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_avx2; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_avx2; - state->xcbc_keyexp = aes_xcbc_expand_key_avx2; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_sse_shani; - state->sha1 = sha1_sse_shani; - state->sha224_one_block = sha224_one_block_sse_shani; - state->sha224 = sha224_sse_shani; - state->sha256_one_block = sha256_one_block_sse_shani; - state->sha256 = sha256_sse_shani; - state->sha384_one_block = sha384_one_block_avx2; - state->sha384 = sha384_avx2; - state->sha512_one_block = sha512_one_block_avx2; - state->sha512 = sha512_avx2; - state->md5_one_block = md5_one_block_avx2; - - state->aes128_cfb_one = aes_cfb_128_one_avx2; - state->aes256_cfb_one = aes_cfb_256_one_avx2; - - state->eea3_1_buffer = zuc_eea3_1_buffer_avx2; - state->eea3_4_buffer = zuc_eea3_4_buffer_avx; - state->eea3_n_buffer = zuc_eea3_n_buffer_avx2; - state->eia3_1_buffer = zuc_eia3_1_buffer_avx2; - state->eia3_n_buffer = zuc_eia3_n_buffer_avx2; - - state->f8_1_buffer = kasumi_f8_1_buffer_avx; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; - state->f8_2_buffer = kasumi_f8_2_buffer_avx; - state->f8_3_buffer = kasumi_f8_3_buffer_avx; - state->f8_4_buffer = kasumi_f8_4_buffer_avx; - state->f8_n_buffer = kasumi_f8_n_buffer_avx; - state->f9_1_buffer = kasumi_f9_1_buffer_avx; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; + state->xcbc_keyexp = aes_xcbc_expand_key_avx2; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_sse_shani; + state->sha1 = sha1_sse_shani; + state->sha224_one_block = sha224_one_block_sse_shani; + state->sha224 = sha224_sse_shani; + state->sha256_one_block = sha256_one_block_sse_shani; + state->sha256 = sha256_sse_shani; + state->sha384_one_block = sha384_one_block_avx2; + state->sha384 = sha384_avx2; + state->sha512_one_block = sha512_one_block_avx2; + state->sha512 = sha512_avx2; + state->md5_one_block = md5_one_block_avx2; + + state->aes128_cfb_one = aes_cfb_128_one_avx2; + state->aes256_cfb_one = aes_cfb_256_one_avx2; + + state->eea3_1_buffer = zuc_eea3_1_buffer_avx2; + state->eea3_4_buffer = zuc_eea3_4_buffer_avx; + state->eea3_n_buffer = zuc_eea3_n_buffer_avx2; + state->eia3_1_buffer = zuc_eia3_1_buffer_avx2; + state->eia3_n_buffer = zuc_eia3_n_buffer_avx2; + + state->f8_1_buffer = kasumi_f8_1_buffer_avx; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; + state->f8_2_buffer = kasumi_f8_2_buffer_avx; + state->f8_3_buffer = kasumi_f8_3_buffer_avx; + state->f8_4_buffer = kasumi_f8_4_buffer_avx; + state->f8_n_buffer = kasumi_f8_n_buffer_avx; + state->f9_1_buffer = kasumi_f9_1_buffer_avx; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_avx; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_avx; state->kasumi_key_sched_size = kasumi_key_sched_size_avx; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_avx2; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx2; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx2; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx2; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx2; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx2; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx2; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx2; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx2; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx2; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx2; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_avx2; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_avx2; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_avx2; state->snow3g_init_key_sched = snow3g_init_key_sched_avx2; state->snow3g_key_sched_size = snow3g_key_sched_size_avx2; - state->hec_32 = hec_32_avx; - state->hec_64 = hec_64_avx; - - state->crc32_ethernet_fcs = ethernet_fcs_avx; - state->crc16_x25 = crc16_x25_avx; - state->crc32_sctp = crc32_sctp_avx; - state->crc24_lte_a = crc24_lte_a_avx; - state->crc24_lte_b = crc24_lte_b_avx; - state->crc16_fp_data = crc16_fp_data_avx; - state->crc11_fp_header = crc11_fp_header_avx; - state->crc7_fp_header = crc7_fp_header_avx; - state->crc10_iuup_data = crc10_iuup_data_avx; - state->crc6_iuup_header = crc6_iuup_header_avx; + state->hec_32 = hec_32_avx; + state->hec_64 = hec_64_avx; + + state->crc32_ethernet_fcs = ethernet_fcs_avx; + state->crc16_x25 = crc16_x25_avx; + state->crc32_sctp = crc32_sctp_avx; + state->crc24_lte_a = crc24_lte_a_avx; + state->crc24_lte_b = crc24_lte_b_avx; + state->crc16_fp_data = crc16_fp_data_avx; + state->crc11_fp_header = crc11_fp_header_avx; + state->crc7_fp_header = crc7_fp_header_avx; + state->crc10_iuup_data = crc10_iuup_data_avx; + state->crc6_iuup_header = crc6_iuup_header_avx; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_avx; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_avx; @@ -439,55 +437,55 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_avx2; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_avx; - state->gcm128_enc = aes_gcm_enc_128_avx_gen4; - state->gcm192_enc = aes_gcm_enc_192_avx_gen4; - state->gcm256_enc = aes_gcm_enc_256_avx_gen4; - state->gcm128_dec = aes_gcm_dec_128_avx_gen4; - state->gcm192_dec = aes_gcm_dec_192_avx_gen4; - state->gcm256_dec = aes_gcm_dec_256_avx_gen4; - state->gcm128_init = aes_gcm_init_128_avx_gen4; - state->gcm192_init = aes_gcm_init_192_avx_gen4; - state->gcm256_init = aes_gcm_init_256_avx_gen4; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; - state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; - state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; - state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; - state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; - state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; - state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; + state->gcm128_enc = aes_gcm_enc_128_avx_gen4; + state->gcm192_enc = aes_gcm_enc_192_avx_gen4; + state->gcm256_enc = aes_gcm_enc_256_avx_gen4; + state->gcm128_dec = aes_gcm_dec_128_avx_gen4; + state->gcm192_dec = aes_gcm_dec_192_avx_gen4; + state->gcm256_dec = aes_gcm_dec_256_avx_gen4; + state->gcm128_init = aes_gcm_init_128_avx_gen4; + state->gcm192_init = aes_gcm_init_192_avx_gen4; + state->gcm256_init = aes_gcm_init_256_avx_gen4; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; + state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; + state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; + state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; + state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; + state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; + state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx_gen4; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx_gen4; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx_gen4; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx_gen4; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx_gen4; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx_gen4; - state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; - state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; - state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; - state->gcm128_pre = aes_gcm_pre_128_avx_gen4; - state->gcm192_pre = aes_gcm_pre_192_avx_gen4; - state->gcm256_pre = aes_gcm_pre_256_avx_gen4; - - state->ghash = ghash_avx_gen4; - state->ghash_pre = ghash_pre_avx_gen4; - - state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; - state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; - state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; - state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; - state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; - state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; - state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; - state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; - state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; + state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; + state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; + state->gcm128_pre = aes_gcm_pre_128_avx_gen4; + state->gcm192_pre = aes_gcm_pre_192_avx_gen4; + state->gcm256_pre = aes_gcm_pre_256_avx_gen4; + + state->ghash = ghash_avx_gen4; + state->ghash_pre = ghash_pre_avx_gen4; + + state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; + state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; + state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; + state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; + state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; + state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; + state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; + state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; + state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_avx2; + state->chacha20_hp_quic = quic_chacha20_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index 41ebe194..fc89fa28 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -56,29 +56,29 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx /* JOB API */ -#define SUBMIT_JOB submit_job_avx2_t3 -#define FLUSH_JOB flush_job_avx2_t3 -#define QUEUE_SIZE queue_size_avx2_t3 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx2_t3 -#define GET_NEXT_JOB get_next_job_avx2_t3 -#define GET_COMPLETED_JOB get_completed_job_avx2_t3 -#define GET_NEXT_BURST get_next_burst_avx2_t3 -#define SUBMIT_BURST submit_burst_avx2_t3 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx2_t3 -#define FLUSH_BURST flush_burst_avx2_t3 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx2_t3 +#define SUBMIT_JOB submit_job_avx2_t3 +#define FLUSH_JOB flush_job_avx2_t3 +#define QUEUE_SIZE queue_size_avx2_t3 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx2_t3 +#define GET_NEXT_JOB get_next_job_avx2_t3 +#define GET_COMPLETED_JOB get_completed_job_avx2_t3 +#define GET_NEXT_BURST get_next_burst_avx2_t3 +#define SUBMIT_BURST submit_burst_avx2_t3 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx2_t3 +#define FLUSH_BURST flush_burst_avx2_t3 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx2_t3 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx2_t3 -#define SUBMIT_HASH_BURST submit_hash_burst_avx2_t3 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx2_t3 -#define SET_SUITE_ID_FN set_suite_id_avx2_t3 +#define SUBMIT_HASH_BURST submit_hash_burst_avx2_t3 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx2_t3 +#define SET_SUITE_ID_FN set_suite_id_avx2_t3 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX2 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX2 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX2 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX2 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_AVX2 @@ -86,12 +86,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 #define SUBMIT_JOB_AES_GCM_DEC submit_job_gcm_dec_avx2 #define SUBMIT_JOB_AES_GCM_ENC submit_job_gcm_enc_avx2 @@ -109,9 +109,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_avx #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_avx -#define AES_CBC_DEC_128 aes_cbc_dec_128_avx -#define AES_CBC_DEC_192 aes_cbc_dec_192_avx -#define AES_CBC_DEC_256 aes_cbc_dec_256_avx +#define AES_CBC_DEC_128 aes_cbc_dec_128_avx +#define AES_CBC_DEC_192 aes_cbc_dec_192_avx +#define AES_CBC_DEC_256 aes_cbc_dec_256_avx /* AES-CBCS */ #define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_avx @@ -127,45 +127,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_vaes_avx2 #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_vaes_avx2 -#define AES_ECB_ENC_128 aes_ecb_enc_128_vaes_avx2 -#define AES_ECB_ENC_192 aes_ecb_enc_192_vaes_avx2 -#define AES_ECB_ENC_256 aes_ecb_enc_256_vaes_avx2 -#define AES_ECB_DEC_128 aes_ecb_dec_128_vaes_avx2 -#define AES_ECB_DEC_192 aes_ecb_dec_192_vaes_avx2 -#define AES_ECB_DEC_256 aes_ecb_dec_256_vaes_avx2 +#define AES_ECB_ENC_128 aes_ecb_enc_128_vaes_avx2 +#define AES_ECB_ENC_192 aes_ecb_enc_192_vaes_avx2 +#define AES_ECB_ENC_256 aes_ecb_enc_256_vaes_avx2 +#define AES_ECB_DEC_128 aes_ecb_dec_128_vaes_avx2 +#define AES_ECB_DEC_192 aes_ecb_dec_192_vaes_avx2 +#define AES_ECB_DEC_256 aes_ecb_dec_256_vaes_avx2 /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_avx -#define AES_CTR_192 aes_cntr_192_avx -#define AES_CTR_256 aes_cntr_256_avx -#define AES_CTR_128_BIT aes_cntr_bit_128_avx -#define AES_CTR_192_BIT aes_cntr_bit_192_avx -#define AES_CTR_256_BIT aes_cntr_bit_256_avx +#define AES_CTR_128 aes_cntr_128_avx +#define AES_CTR_192 aes_cntr_192_avx +#define AES_CTR_256 aes_cntr_256_avx +#define AES_CTR_128_BIT aes_cntr_bit_128_avx +#define AES_CTR_192_BIT aes_cntr_bit_192_avx +#define AES_CTR_256_BIT aes_cntr_bit_256_avx /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_avx2 -#define AES_CFB_256_ONE aes_cfb_256_one_avx2 +#define AES_CFB_128_ONE aes_cfb_128_one_avx2 +#define AES_CFB_256_ONE aes_cfb_256_one_avx2 /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_avx @@ -175,30 +175,30 @@ /* SHA1/224/256/384/512 */ /* note: SHA1 MB is better than SHANI on Xeon processors */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_avx2 -#define FLUSH_JOB_SHA1 flush_job_sha1_avx2 -#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse -#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse -#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse -#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse -#define SUBMIT_JOB_SHA384 submit_job_sha384_avx2 -#define FLUSH_JOB_SHA384 flush_job_sha384_avx2 -#define SUBMIT_JOB_SHA512 submit_job_sha512_avx2 -#define FLUSH_JOB_SHA512 flush_job_sha512_avx2 +#define SUBMIT_JOB_SHA1 submit_job_sha1_avx2 +#define FLUSH_JOB_SHA1 flush_job_sha1_avx2 +#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse +#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse +#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse +#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse +#define SUBMIT_JOB_SHA384 submit_job_sha384_avx2 +#define FLUSH_JOB_SHA384 flush_job_sha384_avx2 +#define SUBMIT_JOB_SHA512 submit_job_sha512_avx2 +#define FLUSH_JOB_SHA512 flush_job_sha512_avx2 /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_avx2 -#define FLUSH_JOB_HMAC flush_job_hmac_avx2 -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx2 -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx2 -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx2 -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx2 -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 +#define SUBMIT_JOB_HMAC submit_job_hmac_avx2 +#define FLUSH_JOB_HMAC flush_job_hmac_avx2 +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx2 +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx2 +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx2 +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx2 +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 /* CHACHA20 & POLY1305 */ #define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx2 @@ -207,14 +207,14 @@ #define POLY1305_MAC poly1305_mac_fma_avx2 /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_avx2 -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_avx2 -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_avx2 -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_avx2 -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_avx2 -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_avx2 -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_avx2 -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_avx2 +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_avx2 +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_avx2 +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_avx2 +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_avx2 +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_avx2 +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_avx2 +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_avx2 +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_avx2 /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_avx @@ -226,8 +226,7 @@ submit_snow3g_uea2_job_avx2_t2(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -250,7 +249,8 @@ flush_snow3g_uea2_job_avx2_t2(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 8); @@ -281,12 +281,10 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, 2); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - AVX2_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, AVX2_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - AVX2_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, AVX2_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, AVX2_NUM_MD5_LANES); @@ -348,153 +346,149 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_avx2; - state->keyexp_192 = aes_keyexp_192_avx2; - state->keyexp_256 = aes_keyexp_256_avx2; + state->keyexp_128 = aes_keyexp_128_avx2; + state->keyexp_192 = aes_keyexp_192_avx2; + state->keyexp_256 = aes_keyexp_256_avx2; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_avx2; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_avx2; - state->xcbc_keyexp = aes_xcbc_expand_key_avx2; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_sse_shani; - state->sha1 = sha1_sse_shani; - state->sha224_one_block = sha224_one_block_sse_shani; - state->sha224 = sha224_sse_shani; - state->sha256_one_block = sha256_one_block_sse_shani; - state->sha256 = sha256_sse_shani; - state->sha384_one_block = sha384_one_block_avx2; - state->sha384 = sha384_avx2; - state->sha512_one_block = sha512_one_block_avx2; - state->sha512 = sha512_avx2; - state->md5_one_block = md5_one_block_avx2; - - state->aes128_cfb_one = aes_cfb_128_one_avx2; - state->aes256_cfb_one = aes_cfb_256_one_avx2; - - state->eea3_1_buffer = zuc_eea3_1_buffer_avx2; - state->eea3_4_buffer = zuc_eea3_4_buffer_avx; - state->eea3_n_buffer = zuc_eea3_n_buffer_avx2; - state->eia3_1_buffer = zuc_eia3_1_buffer_avx2; - state->eia3_n_buffer = zuc_eia3_n_buffer_avx2; - - state->f8_1_buffer = kasumi_f8_1_buffer_avx; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; - state->f8_2_buffer = kasumi_f8_2_buffer_avx; - state->f8_3_buffer = kasumi_f8_3_buffer_avx; - state->f8_4_buffer = kasumi_f8_4_buffer_avx; - state->f8_n_buffer = kasumi_f8_n_buffer_avx; - state->f9_1_buffer = kasumi_f9_1_buffer_avx; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; + state->xcbc_keyexp = aes_xcbc_expand_key_avx2; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_sse_shani; + state->sha1 = sha1_sse_shani; + state->sha224_one_block = sha224_one_block_sse_shani; + state->sha224 = sha224_sse_shani; + state->sha256_one_block = sha256_one_block_sse_shani; + state->sha256 = sha256_sse_shani; + state->sha384_one_block = sha384_one_block_avx2; + state->sha384 = sha384_avx2; + state->sha512_one_block = sha512_one_block_avx2; + state->sha512 = sha512_avx2; + state->md5_one_block = md5_one_block_avx2; + + state->aes128_cfb_one = aes_cfb_128_one_avx2; + state->aes256_cfb_one = aes_cfb_256_one_avx2; + + state->eea3_1_buffer = zuc_eea3_1_buffer_avx2; + state->eea3_4_buffer = zuc_eea3_4_buffer_avx; + state->eea3_n_buffer = zuc_eea3_n_buffer_avx2; + state->eia3_1_buffer = zuc_eia3_1_buffer_avx2; + state->eia3_n_buffer = zuc_eia3_n_buffer_avx2; + + state->f8_1_buffer = kasumi_f8_1_buffer_avx; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; + state->f8_2_buffer = kasumi_f8_2_buffer_avx; + state->f8_3_buffer = kasumi_f8_3_buffer_avx; + state->f8_4_buffer = kasumi_f8_4_buffer_avx; + state->f8_n_buffer = kasumi_f8_n_buffer_avx; + state->f9_1_buffer = kasumi_f9_1_buffer_avx; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_avx; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_avx; state->kasumi_key_sched_size = kasumi_key_sched_size_avx; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_avx2; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx2; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx2; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx2; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx2; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx2; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx2; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx2; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx2; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx2; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx2; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_avx2; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_avx2; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_avx2; state->snow3g_init_key_sched = snow3g_init_key_sched_avx2; state->snow3g_key_sched_size = snow3g_key_sched_size_avx2; - state->hec_32 = hec_32_avx; - state->hec_64 = hec_64_avx; - - state->crc32_ethernet_fcs = ethernet_fcs_avx; - state->crc16_x25 = crc16_x25_avx; - state->crc32_sctp = crc32_sctp_avx; - state->crc24_lte_a = crc24_lte_a_avx; - state->crc24_lte_b = crc24_lte_b_avx; - state->crc16_fp_data = crc16_fp_data_avx; - state->crc11_fp_header = crc11_fp_header_avx; - state->crc7_fp_header = crc7_fp_header_avx; - state->crc10_iuup_data = crc10_iuup_data_avx; - state->crc6_iuup_header = crc6_iuup_header_avx; + state->hec_32 = hec_32_avx; + state->hec_64 = hec_64_avx; + + state->crc32_ethernet_fcs = ethernet_fcs_avx; + state->crc16_x25 = crc16_x25_avx; + state->crc32_sctp = crc32_sctp_avx; + state->crc24_lte_a = crc24_lte_a_avx; + state->crc24_lte_b = crc24_lte_b_avx; + state->crc16_fp_data = crc16_fp_data_avx; + state->crc11_fp_header = crc11_fp_header_avx; + state->crc7_fp_header = crc7_fp_header_avx; + state->crc10_iuup_data = crc10_iuup_data_avx; + state->crc6_iuup_header = crc6_iuup_header_avx; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_avx; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_avx; #ifdef AVX_IFMA - state->chacha20_poly1305_init = - init_chacha20_poly1305_fma_avx2; - state->chacha20_poly1305_enc_update = - update_enc_chacha20_poly1305_fma_avx2; - state->chacha20_poly1305_dec_update = - update_dec_chacha20_poly1305_fma_avx2; - state->chacha20_poly1305_finalize = - finalize_chacha20_poly1305_fma_avx2; + state->chacha20_poly1305_init = init_chacha20_poly1305_fma_avx2; + state->chacha20_poly1305_enc_update = update_enc_chacha20_poly1305_fma_avx2; + state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_fma_avx2; + state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_fma_avx2; #endif - state->gcm128_enc = aes_gcm_enc_128_avx_gen4; - state->gcm192_enc = aes_gcm_enc_192_avx_gen4; - state->gcm256_enc = aes_gcm_enc_256_avx_gen4; - state->gcm128_dec = aes_gcm_dec_128_avx_gen4; - state->gcm192_dec = aes_gcm_dec_192_avx_gen4; - state->gcm256_dec = aes_gcm_dec_256_avx_gen4; - state->gcm128_init = aes_gcm_init_128_avx_gen4; - state->gcm192_init = aes_gcm_init_192_avx_gen4; - state->gcm256_init = aes_gcm_init_256_avx_gen4; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; - state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; - state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; - state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; - state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; - state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; - state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; + state->gcm128_enc = aes_gcm_enc_128_avx_gen4; + state->gcm192_enc = aes_gcm_enc_192_avx_gen4; + state->gcm256_enc = aes_gcm_enc_256_avx_gen4; + state->gcm128_dec = aes_gcm_dec_128_avx_gen4; + state->gcm192_dec = aes_gcm_dec_192_avx_gen4; + state->gcm256_dec = aes_gcm_dec_256_avx_gen4; + state->gcm128_init = aes_gcm_init_128_avx_gen4; + state->gcm192_init = aes_gcm_init_192_avx_gen4; + state->gcm256_init = aes_gcm_init_256_avx_gen4; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; + state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; + state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; + state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; + state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; + state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; + state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx_gen4; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx_gen4; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx_gen4; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx_gen4; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx_gen4; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx_gen4; - state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; - state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; - state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; - state->gcm128_pre = aes_gcm_pre_128_avx_gen4; - state->gcm192_pre = aes_gcm_pre_192_avx_gen4; - state->gcm256_pre = aes_gcm_pre_256_avx_gen4; - - state->ghash = ghash_avx_gen4; - state->ghash_pre = ghash_pre_avx_gen4; - - state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; - state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; - state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; - state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; - state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; - state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; - state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; - state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; - state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; + state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; + state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; + state->gcm128_pre = aes_gcm_pre_128_avx_gen4; + state->gcm192_pre = aes_gcm_pre_192_avx_gen4; + state->gcm256_pre = aes_gcm_pre_256_avx_gen4; + + state->ghash = ghash_avx_gen4; + state->ghash_pre = ghash_pre_avx_gen4; + + state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; + state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; + state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; + state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; + state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; + state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; + state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; + state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; + state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_avx2; + state->chacha20_hp_quic = quic_chacha20_avx2; } #include "mb_mgr_code.h" diff --git a/lib/avx512_t1/mb_mgr_avx512.c b/lib/avx512_t1/mb_mgr_avx512.c index 9c3c64b7..657db13b 100644 --- a/lib/avx512_t1/mb_mgr_avx512.c +++ b/lib/avx512_t1/mb_mgr_avx512.c @@ -51,11 +51,9 @@ init_mb_mgr_avx512_internal(IMB_MGR *state, const int reset_mgrs) /* reset error status */ imb_set_errno(state, 0); - state->features = cpu_feature_adjust(state->flags, - cpu_feature_detect()); + state->features = cpu_feature_adjust(state->flags, cpu_feature_detect()); - if ((state->features & IMB_CPUFLAGS_AVX512_T2) == - IMB_CPUFLAGS_AVX512_T2) + if ((state->features & IMB_CPUFLAGS_AVX512_T2) == IMB_CPUFLAGS_AVX512_T2) init_mb_mgr_avx512_t2_internal(state, reset_mgrs); else init_mb_mgr_avx512_t1_internal(state, reset_mgrs); @@ -70,32 +68,38 @@ init_mb_mgr_avx512(IMB_MGR *state) imb_set_errno(state, IMB_ERR_SELFTEST); } -IMB_JOB *submit_job_avx512(IMB_MGR *state) +IMB_JOB * +submit_job_avx512(IMB_MGR *state) { return IMB_SUBMIT_JOB(state); } -IMB_JOB *flush_job_avx512(IMB_MGR *state) +IMB_JOB * +flush_job_avx512(IMB_MGR *state) { return IMB_FLUSH_JOB(state); } -uint32_t queue_size_avx512(IMB_MGR *state) +uint32_t +queue_size_avx512(IMB_MGR *state) { return IMB_QUEUE_SIZE(state); } -IMB_JOB *submit_job_nocheck_avx512(IMB_MGR *state) +IMB_JOB * +submit_job_nocheck_avx512(IMB_MGR *state) { return IMB_SUBMIT_JOB_NOCHECK(state); } -IMB_JOB *get_next_job_avx512(IMB_MGR *state) +IMB_JOB * +get_next_job_avx512(IMB_MGR *state) { return IMB_GET_NEXT_JOB(state); } -IMB_JOB *get_completed_job_avx512(IMB_MGR *state) +IMB_JOB * +get_completed_job_avx512(IMB_MGR *state) { return IMB_GET_COMPLETED_JOB(state); } diff --git a/lib/avx512_t1/mb_mgr_avx512_t1.c b/lib/avx512_t1/mb_mgr_avx512_t1.c index 820b840f..f91ef0b0 100644 --- a/lib/avx512_t1/mb_mgr_avx512_t1.c +++ b/lib/avx512_t1/mb_mgr_avx512_t1.c @@ -48,7 +48,7 @@ #include "include/aesni_emu.h" #include "include/error.h" -#include "include/arch_avx_type1.h" /* AESNI */ +#include "include/arch_avx_type1.h" /* AESNI */ #include "include/arch_avx2_type1.h" /* MD5 */ #include "include/arch_avx512_type1.h" #include "include/arch_avx512_type2.h" @@ -56,29 +56,29 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx /* JOB API */ -#define SUBMIT_JOB submit_job_avx512_t1 -#define FLUSH_JOB flush_job_avx512_t1 -#define QUEUE_SIZE queue_size_avx512_t1 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx512_t1 -#define GET_NEXT_JOB get_next_job_avx512_t1 -#define GET_COMPLETED_JOB get_completed_job_avx512_t1 -#define GET_NEXT_BURST get_next_burst_avx512_t1 -#define SUBMIT_BURST submit_burst_avx512_t1 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx512_t1 -#define FLUSH_BURST flush_burst_avx512_t1 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx512_t1 +#define SUBMIT_JOB submit_job_avx512_t1 +#define FLUSH_JOB flush_job_avx512_t1 +#define QUEUE_SIZE queue_size_avx512_t1 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx512_t1 +#define GET_NEXT_JOB get_next_job_avx512_t1 +#define GET_COMPLETED_JOB get_completed_job_avx512_t1 +#define GET_NEXT_BURST get_next_burst_avx512_t1 +#define SUBMIT_BURST submit_burst_avx512_t1 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx512_t1 +#define FLUSH_BURST flush_burst_avx512_t1 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx512_t1 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx512_t1 -#define SUBMIT_HASH_BURST submit_hash_burst_avx512_t1 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx512_t1 -#define SET_SUITE_ID_FN set_suite_id_avx512_t1 +#define SUBMIT_HASH_BURST submit_hash_burst_avx512_t1 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx512_t1 +#define SET_SUITE_ID_FN set_suite_id_avx512_t1 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX512 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX512 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX512 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX512 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_AVX512 @@ -86,12 +86,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX512 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx512 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx512 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx512 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx512 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx512 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx512 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx512 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx512 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx512 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx512 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx512 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx512 #define SUBMIT_JOB_AES_GCM_DEC submit_job_gcm_dec_avx512 #define SUBMIT_JOB_AES_GCM_ENC submit_job_gcm_enc_avx512 @@ -109,9 +109,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_avx #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_avx -#define AES_CBC_DEC_128 aes_cbc_dec_128_avx -#define AES_CBC_DEC_192 aes_cbc_dec_192_avx -#define AES_CBC_DEC_256 aes_cbc_dec_256_avx +#define AES_CBC_DEC_128 aes_cbc_dec_128_avx +#define AES_CBC_DEC_192 aes_cbc_dec_192_avx +#define AES_CBC_DEC_256 aes_cbc_dec_256_avx /* AES-CBCS */ #define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_avx @@ -127,45 +127,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_avx512 #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_avx512 -#define AES_ECB_ENC_128 aes_ecb_enc_128_avx -#define AES_ECB_ENC_192 aes_ecb_enc_192_avx -#define AES_ECB_ENC_256 aes_ecb_enc_256_avx -#define AES_ECB_DEC_128 aes_ecb_dec_128_avx -#define AES_ECB_DEC_192 aes_ecb_dec_192_avx -#define AES_ECB_DEC_256 aes_ecb_dec_256_avx +#define AES_ECB_ENC_128 aes_ecb_enc_128_avx +#define AES_ECB_ENC_192 aes_ecb_enc_192_avx +#define AES_ECB_ENC_256 aes_ecb_enc_256_avx +#define AES_ECB_DEC_128 aes_ecb_dec_128_avx +#define AES_ECB_DEC_192 aes_ecb_dec_192_avx +#define AES_ECB_DEC_256 aes_ecb_dec_256_avx /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_avx -#define AES_CTR_192 aes_cntr_192_avx -#define AES_CTR_256 aes_cntr_256_avx -#define AES_CTR_128_BIT aes_cntr_bit_128_avx -#define AES_CTR_192_BIT aes_cntr_bit_192_avx -#define AES_CTR_256_BIT aes_cntr_bit_256_avx +#define AES_CTR_128 aes_cntr_128_avx +#define AES_CTR_192 aes_cntr_192_avx +#define AES_CTR_256 aes_cntr_256_avx +#define AES_CTR_128_BIT aes_cntr_bit_128_avx +#define AES_CTR_192_BIT aes_cntr_bit_192_avx +#define AES_CTR_256_BIT aes_cntr_bit_256_avx /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_avx512 -#define AES_CFB_256_ONE aes_cfb_256_one_avx512 +#define AES_CFB_128_ONE aes_cfb_128_one_avx512 +#define AES_CFB_256_ONE aes_cfb_256_one_avx512 /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_avx @@ -174,50 +174,50 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_avx /* SHA1/224/256/384/512 */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_avx512 -#define FLUSH_JOB_SHA1 flush_job_sha1_avx512 -#define SUBMIT_JOB_SHA224 submit_job_sha224_avx512 -#define FLUSH_JOB_SHA224 flush_job_sha224_avx512 -#define SUBMIT_JOB_SHA256 submit_job_sha256_avx512 -#define FLUSH_JOB_SHA256 flush_job_sha256_avx512 -#define SUBMIT_JOB_SHA384 submit_job_sha384_avx512 -#define FLUSH_JOB_SHA384 flush_job_sha384_avx512 -#define SUBMIT_JOB_SHA512 submit_job_sha512_avx512 -#define FLUSH_JOB_SHA512 flush_job_sha512_avx512 +#define SUBMIT_JOB_SHA1 submit_job_sha1_avx512 +#define FLUSH_JOB_SHA1 flush_job_sha1_avx512 +#define SUBMIT_JOB_SHA224 submit_job_sha224_avx512 +#define FLUSH_JOB_SHA224 flush_job_sha224_avx512 +#define SUBMIT_JOB_SHA256 submit_job_sha256_avx512 +#define FLUSH_JOB_SHA256 flush_job_sha256_avx512 +#define SUBMIT_JOB_SHA384 submit_job_sha384_avx512 +#define FLUSH_JOB_SHA384 flush_job_sha384_avx512 +#define SUBMIT_JOB_SHA512 submit_job_sha512_avx512 +#define FLUSH_JOB_SHA512 flush_job_sha512_avx512 /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_avx512 -#define FLUSH_JOB_HMAC flush_job_hmac_avx512 -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx512 -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx512 -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx512 -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx512 -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx512 -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx512 -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx512 -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx512 -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 +#define SUBMIT_JOB_HMAC submit_job_hmac_avx512 +#define FLUSH_JOB_HMAC flush_job_hmac_avx512 +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx512 +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx512 +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx512 +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx512 +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx512 +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx512 +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx512 +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx512 +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 /* DES & 3DES */ #define SUBMIT_JOB_DES_CBC_ENC submit_job_des_cbc_enc_avx512 #define FLUSH_JOB_DES_CBC_ENC flush_job_des_cbc_enc_avx512 #define SUBMIT_JOB_DES_CBC_DEC submit_job_des_cbc_dec_avx512 -#define FLUSH_JOB_DES_CBC_DEC flush_job_des_cbc_dec_avx512 +#define FLUSH_JOB_DES_CBC_DEC flush_job_des_cbc_dec_avx512 #define SUBMIT_JOB_3DES_CBC_ENC submit_job_3des_cbc_enc_avx512 #define FLUSH_JOB_3DES_CBC_ENC flush_job_3des_cbc_enc_avx512 #define SUBMIT_JOB_3DES_CBC_DEC submit_job_3des_cbc_dec_avx512 -#define FLUSH_JOB_3DES_CBC_DEC flush_job_3des_cbc_dec_avx512 +#define FLUSH_JOB_3DES_CBC_DEC flush_job_3des_cbc_dec_avx512 /* DES-DOCSIS */ #define SUBMIT_JOB_DOCSIS_DES_ENC submit_job_docsis_des_enc_avx512 #define FLUSH_JOB_DOCSIS_DES_ENC flush_job_docsis_des_enc_avx512 #define SUBMIT_JOB_DOCSIS_DES_DEC submit_job_docsis_des_dec_avx512 -#define FLUSH_JOB_DOCSIS_DES_DEC flush_job_docsis_des_dec_avx512 +#define FLUSH_JOB_DOCSIS_DES_DEC flush_job_docsis_des_dec_avx512 /* CHACHA20 & POLY1305 */ #define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx512 @@ -226,32 +226,33 @@ #define POLY1305_MAC poly1305_mac_plain_avx512 /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_no_gfni_avx512 -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_no_gfni_avx512 -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_no_gfni_avx512 -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_no_gfni_avx512 -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_no_gfni_avx512 -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_no_gfni_avx512 -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_no_gfni_avx512 -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_no_gfni_avx512 +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_no_gfni_avx512 +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_no_gfni_avx512 +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_no_gfni_avx512 +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_no_gfni_avx512 +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_no_gfni_avx512 +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_no_gfni_avx512 +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_no_gfni_avx512 +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_no_gfni_avx512 /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_avx #define SUBMIT_JOB_SNOW_V_AEAD snow_v_aead_init_avx /* SNOW3G UE2 & UIA2 */ -static IMB_JOB *submit_snow3g_uea2_job_avx512(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_snow3g_uea2_job_avx512(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_avx512(snow3g_uea2_ooo, job); } -static IMB_JOB *flush_snow3g_uea2_job_avx512(IMB_MGR *state) +static IMB_JOB * +flush_snow3g_uea2_job_avx512(IMB_MGR *state) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; @@ -267,31 +268,22 @@ static IMB_JOB *flush_snow3g_uea2_job_avx512(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size); -__forceinline -IMB_JOB * -FLUSH_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, - const uint64_t key_size); - -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size); - -__forceinline -IMB_JOB * +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size); +__forceinline IMB_JOB * +FLUSH_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, const uint64_t key_size); + +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size); + +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS128_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); -__forceinline -IMB_JOB * +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS256_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); static IMB_JOB * -submit_aes_docsis128_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +submit_aes_docsis128_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { (void) state; @@ -313,8 +305,7 @@ submit_aes_docsis128_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, } static IMB_JOB * -submit_aes_docsis256_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +submit_aes_docsis256_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { (void) state; @@ -335,18 +326,12 @@ submit_aes_docsis256_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, return job; } -#define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC \ - submit_job_aes_docsis128_enc_crc32_avx512 -#define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC \ - submit_job_aes_docsis256_enc_crc32_avx512 -#define FLUSH_JOB_DOCSIS128_SEC_CRC_ENC \ - flush_job_aes_docsis128_enc_crc32_avx512 -#define FLUSH_JOB_DOCSIS256_SEC_CRC_ENC \ - flush_job_aes_docsis256_enc_crc32_avx512 -#define SUBMIT_JOB_DOCSIS128_SEC_CRC_DEC \ - submit_aes_docsis128_dec_crc32_avx512 -#define SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC \ - submit_aes_docsis256_dec_crc32_avx512 +#define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC submit_job_aes_docsis128_enc_crc32_avx512 +#define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC submit_job_aes_docsis256_enc_crc32_avx512 +#define FLUSH_JOB_DOCSIS128_SEC_CRC_ENC flush_job_aes_docsis128_enc_crc32_avx512 +#define FLUSH_JOB_DOCSIS256_SEC_CRC_ENC flush_job_aes_docsis256_enc_crc32_avx512 +#define SUBMIT_JOB_DOCSIS128_SEC_CRC_DEC submit_aes_docsis128_dec_crc32_avx512 +#define SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC submit_aes_docsis256_dec_crc32_avx512 /* ====================================================================== */ @@ -384,20 +369,16 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX512_NUM_SHA1_LANES); /* Init HMAC/SHA224 out-of-order fields */ - ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, - AVX512_NUM_SHA256_LANES); + ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, AVX512_NUM_SHA256_LANES); /* Init HMAC/SHA256 out-of-order fields */ - ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, - AVX512_NUM_SHA256_LANES); + ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, AVX512_NUM_SHA256_LANES); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - AVX512_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, AVX512_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - AVX512_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, AVX512_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, AVX2_NUM_MD5_LANES); @@ -457,146 +438,143 @@ init_mb_mgr_avx512_t1_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_avx512; - state->keyexp_192 = aes_keyexp_192_avx512; - state->keyexp_256 = aes_keyexp_256_avx512; + state->keyexp_128 = aes_keyexp_128_avx512; + state->keyexp_192 = aes_keyexp_192_avx512; + state->keyexp_256 = aes_keyexp_256_avx512; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_avx512; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_avx512; - state->xcbc_keyexp = aes_xcbc_expand_key_avx512; - state->des_key_sched = des_key_schedule; - state->sha1_one_block = sha1_one_block_avx512; - state->sha1 = sha1_avx512; - state->sha224_one_block = sha224_one_block_avx512; - state->sha224 = sha224_avx512; - state->sha256_one_block = sha256_one_block_avx512; - state->sha256 = sha256_avx512; - state->sha384_one_block = sha384_one_block_avx512; - state->sha384 = sha384_avx512; - state->sha512_one_block = sha512_one_block_avx512; - state->sha512 = sha512_avx512; - state->md5_one_block = md5_one_block_avx512; - - state->aes128_cfb_one = aes_cfb_128_one_avx512; - state->aes256_cfb_one = aes_cfb_256_one_avx512; - - state->eea3_1_buffer = zuc_eea3_1_buffer_avx512; - state->eea3_4_buffer = zuc_eea3_4_buffer_avx; - state->eia3_1_buffer = zuc_eia3_1_buffer_avx512; - state->eea3_n_buffer = zuc_eea3_n_buffer_avx512; - state->eia3_n_buffer = zuc_eia3_n_buffer_avx512; - - state->f8_1_buffer = kasumi_f8_1_buffer_avx; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; - state->f8_2_buffer = kasumi_f8_2_buffer_avx; - state->f8_3_buffer = kasumi_f8_3_buffer_avx; - state->f8_4_buffer = kasumi_f8_4_buffer_avx; - state->f8_n_buffer = kasumi_f8_n_buffer_avx; - state->f9_1_buffer = kasumi_f9_1_buffer_avx; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; + state->xcbc_keyexp = aes_xcbc_expand_key_avx512; + state->des_key_sched = des_key_schedule; + state->sha1_one_block = sha1_one_block_avx512; + state->sha1 = sha1_avx512; + state->sha224_one_block = sha224_one_block_avx512; + state->sha224 = sha224_avx512; + state->sha256_one_block = sha256_one_block_avx512; + state->sha256 = sha256_avx512; + state->sha384_one_block = sha384_one_block_avx512; + state->sha384 = sha384_avx512; + state->sha512_one_block = sha512_one_block_avx512; + state->sha512 = sha512_avx512; + state->md5_one_block = md5_one_block_avx512; + + state->aes128_cfb_one = aes_cfb_128_one_avx512; + state->aes256_cfb_one = aes_cfb_256_one_avx512; + + state->eea3_1_buffer = zuc_eea3_1_buffer_avx512; + state->eea3_4_buffer = zuc_eea3_4_buffer_avx; + state->eia3_1_buffer = zuc_eia3_1_buffer_avx512; + state->eea3_n_buffer = zuc_eea3_n_buffer_avx512; + state->eia3_n_buffer = zuc_eia3_n_buffer_avx512; + + state->f8_1_buffer = kasumi_f8_1_buffer_avx; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; + state->f8_2_buffer = kasumi_f8_2_buffer_avx; + state->f8_3_buffer = kasumi_f8_3_buffer_avx; + state->f8_4_buffer = kasumi_f8_4_buffer_avx; + state->f8_n_buffer = kasumi_f8_n_buffer_avx; + state->f9_1_buffer = kasumi_f9_1_buffer_avx; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_avx; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_avx; state->kasumi_key_sched_size = kasumi_key_sched_size_avx; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_avx512; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx512; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx512; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx512; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx512; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx512; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx512; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx512; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx512; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx512; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx512; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_avx512; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_avx512; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_avx512; state->snow3g_init_key_sched = snow3g_init_key_sched_avx512; state->snow3g_key_sched_size = snow3g_key_sched_size_avx512; - state->hec_32 = hec_32_avx; - state->hec_64 = hec_64_avx; - - state->crc32_ethernet_fcs = ethernet_fcs_avx; - state->crc16_x25 = crc16_x25_avx; - state->crc32_sctp = crc32_sctp_avx; - state->crc24_lte_a = crc24_lte_a_avx; - state->crc24_lte_b = crc24_lte_b_avx; - state->crc16_fp_data = crc16_fp_data_avx; - state->crc11_fp_header = crc11_fp_header_avx; - state->crc7_fp_header = crc7_fp_header_avx; - state->crc10_iuup_data = crc10_iuup_data_avx; - state->crc6_iuup_header = crc6_iuup_header_avx; + state->hec_32 = hec_32_avx; + state->hec_64 = hec_64_avx; + + state->crc32_ethernet_fcs = ethernet_fcs_avx; + state->crc16_x25 = crc16_x25_avx; + state->crc32_sctp = crc32_sctp_avx; + state->crc24_lte_a = crc24_lte_a_avx; + state->crc24_lte_b = crc24_lte_b_avx; + state->crc16_fp_data = crc16_fp_data_avx; + state->crc11_fp_header = crc11_fp_header_avx; + state->crc7_fp_header = crc7_fp_header_avx; + state->crc10_iuup_data = crc10_iuup_data_avx; + state->crc6_iuup_header = crc6_iuup_header_avx; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_avx; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_avx; state->chacha20_poly1305_init = init_chacha20_poly1305_avx512; - state->chacha20_poly1305_enc_update = - update_enc_chacha20_poly1305_avx512; - state->chacha20_poly1305_dec_update = - update_dec_chacha20_poly1305_avx512; - state->chacha20_poly1305_finalize = - finalize_chacha20_poly1305_avx512; - - state->gcm128_enc = aes_gcm_enc_128_avx512; - state->gcm192_enc = aes_gcm_enc_192_avx512; - state->gcm256_enc = aes_gcm_enc_256_avx512; - state->gcm128_dec = aes_gcm_dec_128_avx512; - state->gcm192_dec = aes_gcm_dec_192_avx512; - state->gcm256_dec = aes_gcm_dec_256_avx512; - state->gcm128_init = aes_gcm_init_128_avx512; - state->gcm192_init = aes_gcm_init_192_avx512; - state->gcm256_init = aes_gcm_init_256_avx512; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx512; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx512; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx512; - state->gcm128_enc_update = aes_gcm_enc_128_update_avx512; - state->gcm192_enc_update = aes_gcm_enc_192_update_avx512; - state->gcm256_enc_update = aes_gcm_enc_256_update_avx512; - state->gcm128_dec_update = aes_gcm_dec_128_update_avx512; - state->gcm192_dec_update = aes_gcm_dec_192_update_avx512; - state->gcm256_dec_update = aes_gcm_dec_256_update_avx512; + state->chacha20_poly1305_enc_update = update_enc_chacha20_poly1305_avx512; + state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_avx512; + state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_avx512; + + state->gcm128_enc = aes_gcm_enc_128_avx512; + state->gcm192_enc = aes_gcm_enc_192_avx512; + state->gcm256_enc = aes_gcm_enc_256_avx512; + state->gcm128_dec = aes_gcm_dec_128_avx512; + state->gcm192_dec = aes_gcm_dec_192_avx512; + state->gcm256_dec = aes_gcm_dec_256_avx512; + state->gcm128_init = aes_gcm_init_128_avx512; + state->gcm192_init = aes_gcm_init_192_avx512; + state->gcm256_init = aes_gcm_init_256_avx512; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx512; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx512; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx512; + state->gcm128_enc_update = aes_gcm_enc_128_update_avx512; + state->gcm192_enc_update = aes_gcm_enc_192_update_avx512; + state->gcm256_enc_update = aes_gcm_enc_256_update_avx512; + state->gcm128_dec_update = aes_gcm_dec_128_update_avx512; + state->gcm192_dec_update = aes_gcm_dec_192_update_avx512; + state->gcm256_dec_update = aes_gcm_dec_256_update_avx512; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx512; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx512; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx512; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx512; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx512; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx512; - state->gcm128_precomp = aes_gcm_precomp_128_avx512; - state->gcm192_precomp = aes_gcm_precomp_192_avx512; - state->gcm256_precomp = aes_gcm_precomp_256_avx512; - state->gcm128_pre = aes_gcm_pre_128_avx512; - state->gcm192_pre = aes_gcm_pre_192_avx512; - state->gcm256_pre = aes_gcm_pre_256_avx512; - - state->ghash = ghash_avx512; - state->ghash_pre = ghash_pre_avx512; - - state->gmac128_init = imb_aes_gmac_init_128_avx512; - state->gmac192_init = imb_aes_gmac_init_192_avx512; - state->gmac256_init = imb_aes_gmac_init_256_avx512; - state->gmac128_update = imb_aes_gmac_update_128_avx512; - state->gmac192_update = imb_aes_gmac_update_192_avx512; - state->gmac256_update = imb_aes_gmac_update_256_avx512; - state->gmac128_finalize = imb_aes_gmac_finalize_128_avx512; - state->gmac192_finalize = imb_aes_gmac_finalize_192_avx512; - state->gmac256_finalize = imb_aes_gmac_finalize_256_avx512; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + state->gcm128_precomp = aes_gcm_precomp_128_avx512; + state->gcm192_precomp = aes_gcm_precomp_192_avx512; + state->gcm256_precomp = aes_gcm_precomp_256_avx512; + state->gcm128_pre = aes_gcm_pre_128_avx512; + state->gcm192_pre = aes_gcm_pre_192_avx512; + state->gcm256_pre = aes_gcm_pre_256_avx512; + + state->ghash = ghash_avx512; + state->ghash_pre = ghash_pre_avx512; + + state->gmac128_init = imb_aes_gmac_init_128_avx512; + state->gmac192_init = imb_aes_gmac_init_192_avx512; + state->gmac256_init = imb_aes_gmac_init_256_avx512; + state->gmac128_update = imb_aes_gmac_update_128_avx512; + state->gmac192_update = imb_aes_gmac_update_192_avx512; + state->gmac256_update = imb_aes_gmac_update_256_avx512; + state->gmac128_finalize = imb_aes_gmac_finalize_128_avx512; + state->gmac192_finalize = imb_aes_gmac_finalize_192_avx512; + state->gmac256_finalize = imb_aes_gmac_finalize_256_avx512; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; state->chacha20_hp_quic = quic_chacha20_avx512; diff --git a/lib/avx512_t1/sha_avx512.c b/lib/avx512_t1/sha_avx512.c index 39014b21..51507930 100644 --- a/lib/avx512_t1/sha_avx512.c +++ b/lib/avx512_t1/sha_avx512.c @@ -30,7 +30,8 @@ /* ========================================================================== */ /* One block SHA1 computation for IPAD / OPAD usage only */ -void sha1_one_block_avx512(const void *data, void *digest) +void +sha1_one_block_avx512(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 1 /* SHA1 */); } @@ -39,15 +40,16 @@ void sha1_one_block_avx512(const void *data, void *digest) /* * SHA1 API for use in HMAC-SHA1 when key is longer than the block size */ -void sha1_avx512(const void *data, const uint64_t length, void *digest) +void +sha1_avx512(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 1, IMB_SHA1_BLOCK_SIZE, - SHA1_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE); } /* ========================================================================== */ /* One block SHA224 computation for IPAD / OPAD usage only */ -void sha224_one_block_avx512(const void *data, void *digest) +void +sha224_one_block_avx512(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 224 /* SHA224 */); } @@ -56,15 +58,16 @@ void sha224_one_block_avx512(const void *data, void *digest) /* * SHA224 API for use in HMAC-SHA224 when key is longer than the block size */ -void sha224_avx512(const void *data, const uint64_t length, void *digest) +void +sha224_avx512(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 224, IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); } /* ========================================================================== */ /* One block SHA256 computation for IPAD / OPAD usage only */ -void sha256_one_block_avx512(const void *data, void *digest) +void +sha256_one_block_avx512(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 256 /* SHA256 */); } @@ -73,15 +76,16 @@ void sha256_one_block_avx512(const void *data, void *digest) /* * SHA256 API for use in HMAC-SHA256 when key is longer than the block size */ -void sha256_avx512(const void *data, const uint64_t length, void *digest) +void +sha256_avx512(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 256, IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); } /* ========================================================================== */ /* One block SHA384 computation for IPAD / OPAD usage only */ -void sha384_one_block_avx512(const void *data, void *digest) +void +sha384_one_block_avx512(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 384 /* SHA384 */); } @@ -90,15 +94,16 @@ void sha384_one_block_avx512(const void *data, void *digest) /* * SHA384 API for use in HMAC-SHA384 when key is longer than the block size */ -void sha384_avx512(const void *data, const uint64_t length, void *digest) +void +sha384_avx512(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 384, - IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 384, IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); } /* ========================================================================== */ /* One block SHA512 computation for IPAD / OPAD usage only */ -void sha512_one_block_avx512(const void *data, void *digest) +void +sha512_one_block_avx512(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 512 /* SHA512 */); } @@ -107,8 +112,8 @@ void sha512_one_block_avx512(const void *data, void *digest) /* * SHA512 API for use in HMAC-SHA512 when key is longer than the block size */ -void sha512_avx512(const void *data, const uint64_t length, void *digest) +void +sha512_avx512(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 512, IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); } diff --git a/lib/avx512_t1/sha_mb_avx512.c b/lib/avx512_t1/sha_mb_avx512.c index 85ae8b40..4c2cfc07 100644 --- a/lib/avx512_t1/sha_mb_avx512.c +++ b/lib/avx512_t1/sha_mb_avx512.c @@ -28,11 +28,15 @@ #include "include/sha_mb_mgr.h" #include "include/arch_avx512_type1.h" -IMB_JOB *submit_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); /* ========================================================================== */ /* @@ -40,19 +44,19 @@ IMB_JOB *flush_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 16, 1, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_x16_avx512_from_c, 0); + return submit_flush_job_sha_1(state, job, 16, 1, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_x16_avx512_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 16, 0, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_x16_avx512_from_c, 0); + return submit_flush_job_sha_1(state, job, 16, 0, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_x16_avx512_from_c, 0); } /* ========================================================================== */ @@ -61,41 +65,40 @@ IMB_JOB *flush_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 16, 1, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha256_x16_avx512_from_c, 0); + return submit_flush_job_sha_256(state, job, 16, 1, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha256_x16_avx512_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 16, 0, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha256_x16_avx512_from_c, 0); + return submit_flush_job_sha_256(state, job, 16, 0, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha256_x16_avx512_from_c, 0); } - /* ========================================================================== */ /* * SHA256 MB API */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 16, 1, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha256_x16_avx512_from_c, 0); + return submit_flush_job_sha_256(state, job, 16, 1, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha256_x16_avx512_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 16, 0, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha256_x16_avx512_from_c, 0); + return submit_flush_job_sha_256(state, job, 16, 0, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha256_x16_avx512_from_c, 0); } /* ========================================================================== */ @@ -104,19 +107,19 @@ IMB_JOB *flush_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 8, 1, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x8_avx512_from_c); + return submit_flush_job_sha_512(state, job, 8, 1, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x8_avx512_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 8, 0, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x8_avx512_from_c); + return submit_flush_job_sha_512(state, job, 8, 0, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x8_avx512_from_c); } /* ========================================================================== */ @@ -125,17 +128,17 @@ IMB_JOB *flush_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 8, 1, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x8_avx512_from_c); + return submit_flush_job_sha_512(state, job, 8, 1, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x8_avx512_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 8, 0, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x8_avx512_from_c); + return submit_flush_job_sha_512(state, job, 8, 0, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x8_avx512_from_c); } diff --git a/lib/avx512_t1/snow3g_avx512.c b/lib/avx512_t1/snow3g_avx512.c index 188b2c1f..3f873c22 100644 --- a/lib/avx512_t1/snow3g_avx512.c +++ b/lib/avx512_t1/snow3g_avx512.c @@ -25,7 +25,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ - #ifdef _WIN32 /* use AVX implementation on Windows for now */ #define AVX @@ -37,16 +36,16 @@ #define CLEAR_SCRATCH_SIMD_REGS clear_scratch_zmms #endif -#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_avx512 -#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_avx512 -#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_avx512 -#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_avx512 -#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_avx512 -#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_avx512 +#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_avx512 +#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_avx512 +#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_avx512 +#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_avx512 +#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_avx512 +#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_avx512 #define SNOW3G_F8_8_BUFFER_MULTIKEY snow3g_f8_8_buffer_multikey_avx512 #define SNOW3G_F8_N_BUFFER_MULTIKEY snow3g_f8_n_buffer_multikey_avx512 -#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_avx512 -#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_avx512 -#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_avx512 +#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_avx512 +#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_avx512 +#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_avx512 #include "include/snow3g_common.h" diff --git a/lib/avx512_t1/zuc_top_avx512.c b/lib/avx512_t1/zuc_top_avx512.c index 79ed2b8c..d96c93c0 100644 --- a/lib/avx512_t1/zuc_top_avx512.c +++ b/lib/avx512_t1/zuc_top_avx512.c @@ -26,12 +26,12 @@ *******************************************************************************/ /*----------------------------------------------------------------------- -* zuc_avx512_top.c -*----------------------------------------------------------------------- -* An implementation of ZUC, the core algorithm for the -* 3GPP Confidentiality and Integrity algorithms. -* -*-----------------------------------------------------------------------*/ + * zuc_avx512_top.c + *----------------------------------------------------------------------- + * An implementation of ZUC, the core algorithm for the + * 3GPP Confidentiality and Integrity algorithms. + * + *-----------------------------------------------------------------------*/ #include @@ -52,16 +52,10 @@ static inline uint32_t find_min_length32(const uint32_t length[NUM_AVX512_BUFS]) { /* Calculate the minimum input packet size */ - static const uint64_t lo_mask[2] = { - 0x0d0c090805040100UL, 0xFFFFFFFFFFFFFFFFUL - }; - static const uint64_t hi_mask[2] = { - 0xFFFFFFFFFFFFFFFFUL, 0x0d0c090805040100UL - }; - const __m128i shuf_hi_mask = - _mm_loadu_si128((const __m128i *) hi_mask); - const __m128i shuf_lo_mask = - _mm_loadu_si128((const __m128i *) lo_mask); + static const uint64_t lo_mask[2] = { 0x0d0c090805040100UL, 0xFFFFFFFFFFFFFFFFUL }; + static const uint64_t hi_mask[2] = { 0xFFFFFFFFFFFFFFFFUL, 0x0d0c090805040100UL }; + const __m128i shuf_hi_mask = _mm_loadu_si128((const __m128i *) hi_mask); + const __m128i shuf_lo_mask = _mm_loadu_si128((const __m128i *) lo_mask); __m128i xmm_lengths1, xmm_lengths2; /* Calculate the minimum input packet size from packets 0-7 */ @@ -76,8 +70,7 @@ find_min_length32(const uint32_t length[NUM_AVX512_BUFS]) xmm_lengths1 = _mm_minpos_epu16(xmm_lengths1); - const uint32_t min_length1 = - (const uint32_t) _mm_extract_epi16(xmm_lengths1, 0); + const uint32_t min_length1 = (const uint32_t) _mm_extract_epi16(xmm_lengths1, 0); /* Calculate the minimum input packet size from packets 8-15 */ xmm_lengths1 = _mm_loadu_si128((const __m128i *) &length[8]); @@ -91,27 +84,25 @@ find_min_length32(const uint32_t length[NUM_AVX512_BUFS]) xmm_lengths1 = _mm_minpos_epu16(xmm_lengths1); - const uint32_t min_length2 = - (const uint32_t) _mm_extract_epi16(xmm_lengths1, 0); + const uint32_t min_length2 = (const uint32_t) _mm_extract_epi16(xmm_lengths1, 0); /* Calculate the minimum input packet size from all packets */ return (min_length1 < min_length2) ? min_length1 : min_length2; } static inline void -init_16(ZucKey16_t *keys, const uint8_t *ivs, ZucState16_t *state, - const uint16_t lane_mask, const unsigned use_gfni) +init_16(ZucKey16_t *keys, const uint8_t *ivs, ZucState16_t *state, const uint16_t lane_mask, + const unsigned use_gfni) { if (use_gfni) - asm_ZucInitialization_16_gfni_avx512(keys, ivs, state, - lane_mask); + asm_ZucInitialization_16_gfni_avx512(keys, ivs, state, lane_mask); else asm_ZucInitialization_16_avx512(keys, ivs, state, lane_mask); } static inline void -keystr_64B_gen_16(ZucState16_t *state, uint32_t *pKeyStr, - const unsigned key_off, const unsigned use_gfni) +keystr_64B_gen_16(ZucState16_t *state, uint32_t *pKeyStr, const unsigned key_off, + const unsigned use_gfni) { if (use_gfni) asm_ZucGenKeystream64B_16_gfni_avx512(state, pKeyStr, key_off); @@ -120,8 +111,7 @@ keystr_64B_gen_16(ZucState16_t *state, uint32_t *pKeyStr, } static inline void -keystr_8B_gen_16(ZucState16_t *state, uint32_t *pKeyStr, - const unsigned key_off, +keystr_8B_gen_16(ZucState16_t *state, uint32_t *pKeyStr, const unsigned key_off, const unsigned use_gfni) { if (use_gfni) @@ -132,20 +122,17 @@ keystr_8B_gen_16(ZucState16_t *state, uint32_t *pKeyStr, static inline void cipher_16(ZucState16_t *pState, const uint64_t *pIn[16], uint64_t *pOut[16], - const uint16_t lengths[16], const uint64_t minLength, - const unsigned use_gfni) + const uint16_t lengths[16], const uint64_t minLength, const unsigned use_gfni) { if (use_gfni) - asm_ZucCipher_16_gfni_avx512(pState, pIn, pOut, lengths, - minLength); + asm_ZucCipher_16_gfni_avx512(pState, pIn, pOut, lengths, minLength); else - asm_ZucCipher_16_avx512(pState, pIn, pOut, lengths, - minLength); + asm_ZucCipher_16_avx512(pState, pIn, pOut, lengths, minLength); } static inline void -round64B_16(uint32_t *T, const uint32_t *ks, const void **data, - uint16_t *lens, const unsigned use_gfni, const uint64_t tag_sz) +round64B_16(uint32_t *T, const uint32_t *ks, const void **data, uint16_t *lens, + const unsigned use_gfni, const uint64_t tag_sz) { if (use_gfni) asm_Eia3Round64B_16_VPCLMUL(T, ks, data, lens, tag_sz); @@ -153,12 +140,9 @@ round64B_16(uint32_t *T, const uint32_t *ks, const void **data, asm_Eia3Round64BAVX512_16(T, ks, data, lens, tag_sz); } -static inline -void _zuc_eea3_1_buffer_avx512(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +static inline void +_zuc_eea3_1_buffer_avx512(const void *pKey, const void *pIv, const void *pBufferIn, + void *pBufferOut, const uint32_t length) { DECLARE_ALIGNED(ZucState_t zucState, 64); DECLARE_ALIGNED(uint8_t keyStream[64], 64); @@ -167,7 +151,7 @@ void _zuc_eea3_1_buffer_avx512(const void *pKey, uint64_t *pOut64 = NULL, *pKeyStream64 = NULL; uint64_t *pTemp64 = NULL, *pdstTemp64 = NULL; - uint32_t numKeyStreamsPerPkt = length/ ZUC_KEYSTR_LEN; + uint32_t numKeyStreamsPerPkt = length / ZUC_KEYSTR_LEN; uint32_t numBytesLeftOver = length % ZUC_KEYSTR_LEN; /* initialize the zuc state */ @@ -180,8 +164,7 @@ void _zuc_eea3_1_buffer_avx512(const void *pKey, while (numKeyStreamsPerPkt--) { /* Generate the key stream 64 bytes at a time */ - asm_ZucGenKeystream64B_avx((uint32_t *) &keyStream[0], - &zucState); + asm_ZucGenKeystream64B_avx((uint32_t *) &keyStream[0], &zucState); /* XOR The Keystream generated with the input buffer here */ pKeyStream64 = (uint64_t *) keyStream; @@ -199,22 +182,19 @@ void _zuc_eea3_1_buffer_avx512(const void *pKey, uint8_t *pOut8 = (uint8_t *) pBufferOut; const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_avx((uint32_t *) &keyStream[0], - &zucState, num4BRounds); + asm_ZucGenKeystream_avx((uint32_t *) &keyStream[0], &zucState, num4BRounds); /* copy the remaining bytes into temporary buffer and XOR with * the 64-bytes of keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], - numBytesLeftOver); + memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStream[0]; pTemp64 = (uint64_t *) &tempSrc[0]; pdstTemp64 = (uint64_t *) &tempDst[0]; asm_XorKeyStream64B_avx512(pTemp64, pdstTemp64, pKeyStream64); - memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], - numBytesLeftOver); + memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); @@ -228,13 +208,12 @@ void _zuc_eea3_1_buffer_avx512(const void *pKey, #endif } -static inline -void _zuc_eea3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], - const void * const pIv[NUM_AVX512_BUFS], - const void * const pBufferIn[NUM_AVX512_BUFS], - void *pBufferOut[NUM_AVX512_BUFS], - const uint32_t length[NUM_AVX512_BUFS], - const unsigned use_gfni) +static inline void +_zuc_eea3_16_buffer_avx512(const void *const pKey[NUM_AVX512_BUFS], + const void *const pIv[NUM_AVX512_BUFS], + const void *const pBufferIn[NUM_AVX512_BUFS], + void *pBufferOut[NUM_AVX512_BUFS], + const uint32_t length[NUM_AVX512_BUFS], const unsigned use_gfni) { DECLARE_ALIGNED(ZucState16_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); @@ -242,17 +221,17 @@ void _zuc_eea3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], /* Calculate the minimum input packet size from all packets */ uint16_t bytes = (uint16_t) find_min_length32(length); - DECLARE_ALIGNED(uint16_t remainBytes[NUM_AVX512_BUFS], 32) = {0}; + DECLARE_ALIGNED(uint16_t remainBytes[NUM_AVX512_BUFS], 32) = { 0 }; DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX512_BUFS][64], 64); /* structure to store the 16 keys */ DECLARE_ALIGNED(ZucKey16_t keys, 64); /* structure to store the 16 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_AVX512_BUFS*32], 16); + DECLARE_ALIGNED(uint8_t ivs[NUM_AVX512_BUFS * 32], 16); const uint8_t *pTempBufInPtr = NULL; uint8_t *pTempBufOutPtr = NULL; - DECLARE_ALIGNED(const uint64_t *pIn64[NUM_AVX512_BUFS], 64) = {NULL}; - DECLARE_ALIGNED(uint64_t *pOut64[NUM_AVX512_BUFS], 64) = {NULL}; + DECLARE_ALIGNED(const uint64_t *pIn64[NUM_AVX512_BUFS], 64) = { NULL }; + DECLARE_ALIGNED(uint64_t * pOut64[NUM_AVX512_BUFS], 64) = { NULL }; uint64_t *pKeyStream64 = NULL; /* @@ -262,7 +241,7 @@ void _zuc_eea3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], for (i = 0; i < NUM_AVX512_BUFS; i++) { remainBytes[i] = length[i]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } init_16(&keys, ivs, &state, 0xFFFF, use_gfni); @@ -298,34 +277,26 @@ void _zuc_eea3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], singlePktState.fR1 = state.fR1[i]; singlePktState.fR2 = state.fR2[i]; - uint32_t numKeyStreamsPerPkt = - remainBytes[i] / ZUC_KEYSTR_LEN; - const uint32_t numBytesLeftOver = - remainBytes[i] % ZUC_KEYSTR_LEN; + uint32_t numKeyStreamsPerPkt = remainBytes[i] / ZUC_KEYSTR_LEN; + const uint32_t numBytesLeftOver = remainBytes[i] % ZUC_KEYSTR_LEN; pTempBufInPtr = pBufferIn[i]; pTempBufOutPtr = pBufferOut[i]; /* update the output and input pointers here to point * to the i'th buffers */ - pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - - remainBytes[i]]; - pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - - remainBytes[i]]; + pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - remainBytes[i]]; + pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - remainBytes[i]]; while (numKeyStreamsPerPkt--) { /* Generate the key stream 64 bytes at a time */ - asm_ZucGenKeystream64B_avx( - (uint32_t *) keyStr[0], - &singlePktState); + asm_ZucGenKeystream64B_avx((uint32_t *) keyStr[0], &singlePktState); pKeyStream64 = (uint64_t *) keyStr[0]; - asm_XorKeyStream64B_avx512(pIn64[0], pOut64[0], - pKeyStream64); + asm_XorKeyStream64B_avx512(pIn64[0], pOut64[0], pKeyStream64); pIn64[0] += 8; pOut64[0] += 8; } - /* Check for remaining 0 to 63 bytes */ if (numBytesLeftOver) { DECLARE_ALIGNED(uint8_t tempSrc[64], 64); @@ -333,30 +304,23 @@ void _zuc_eea3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], uint64_t *pTempSrc64; uint64_t *pTempDst64; uint32_t offset = length[i] - numBytesLeftOver; - const uint64_t num4BRounds = - ((numBytesLeftOver - 1) / 4) + 1; + const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_avx((uint32_t *)&keyStr[0], - &singlePktState, + asm_ZucGenKeystream_avx((uint32_t *) &keyStr[0], &singlePktState, num4BRounds); /* copy the remaining bytes into temporary * buffer and XOR with the 64-bytes of * keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pTempBufInPtr[offset], - numBytesLeftOver); - memset(&tempSrc[numBytesLeftOver], 0, - 64 - numBytesLeftOver); + memcpy(&tempSrc[0], &pTempBufInPtr[offset], numBytesLeftOver); + memset(&tempSrc[numBytesLeftOver], 0, 64 - numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStr[0][0]; pTempSrc64 = (uint64_t *) &tempSrc[0]; pTempDst64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream64B_avx512(pTempSrc64, - pTempDst64, - pKeyStream64); + asm_XorKeyStream64B_avx512(pTempSrc64, pTempDst64, pKeyStream64); - memcpy(&pTempBufOutPtr[offset], - &tempDst[0], numBytesLeftOver); + memcpy(&pTempBufOutPtr[offset], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); clear_mem(tempDst, sizeof(tempDst)); @@ -373,11 +337,9 @@ void _zuc_eea3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], #endif } -void zuc_eea3_1_buffer_avx512(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +void +zuc_eea3_1_buffer_avx512(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t length) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -425,14 +387,10 @@ void zuc_eea3_1_buffer_avx512(const void *pKey, #endif } -static inline -void _zuc_eea3_n_buffer(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers, - const unsigned use_gfni) +static inline void +_zuc_eea3_n_buffer(const void *const pKey[], const void *const pIv[], const void *const pBufferIn[], + void *pBufferOut[], const uint32_t length[], const uint32_t numBuffers, + const unsigned use_gfni) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -495,8 +453,7 @@ void _zuc_eea3_n_buffer(const void * const pKey[], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -504,43 +461,29 @@ void _zuc_eea3_n_buffer(const void * const pKey[], #endif i = 0; - while(packetCount >= 16) { + while (packetCount >= 16) { packetCount -= 16; - _zuc_eea3_16_buffer_avx512(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], - &length[i], - use_gfni); + _zuc_eea3_16_buffer_avx512(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], + &length[i], use_gfni); i += 16; } - while(packetCount >= 8) { + while (packetCount >= 8) { packetCount -= 8; - _zuc_eea3_8_buffer_avx2(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], + _zuc_eea3_8_buffer_avx2(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], &length[i]); i += 8; } - while(packetCount >= 4) { + while (packetCount >= 4) { packetCount -= 4; - _zuc_eea3_4_buffer_avx(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], + _zuc_eea3_4_buffer_avx(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], &length[i]); i += 4; } - while(packetCount--) { - _zuc_eea3_1_buffer_avx512(pKey[i], - pIv[i], - pBufferIn[i], - pBufferOut[i], - length[i]); + while (packetCount--) { + _zuc_eea3_1_buffer_avx512(pKey[i], pIv[i], pBufferIn[i], pBufferOut[i], length[i]); i++; } #ifdef SAFE_DATA @@ -554,34 +497,25 @@ void _zuc_eea3_n_buffer(const void * const pKey[], #endif } -void zuc_eea3_n_buffer_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers) +void +zuc_eea3_n_buffer_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t length[], + const uint32_t numBuffers) { - _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, - length, numBuffers, 0); + _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, length, numBuffers, 0); } -void zuc_eea3_n_buffer_gfni_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers) +void +zuc_eea3_n_buffer_gfni_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t length[], const uint32_t numBuffers) { - _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, - length, numBuffers, 1); + _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, length, numBuffers, 1); } -static inline -void _zuc_eia3_1_buffer_avx512(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +static inline void +_zuc_eia3_1_buffer_avx512(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { DECLARE_ALIGNED(ZucState_t zucState, 64); DECLARE_ALIGNED(uint32_t keyStream[16 * 2], 64); @@ -597,7 +531,7 @@ void _zuc_eia3_1_buffer_avx512(const void *pKey, /* loop over the message bits */ while (remainingBits >= keyStreamLengthInBits) { - remainingBits -= keyStreamLengthInBits; + remainingBits -= keyStreamLengthInBits; /* Generate the next key stream 8 bytes or 64 bytes */ if (!remainingBits) asm_ZucGenKeystream8B_avx(&keyStream[16], &zucState); @@ -644,44 +578,43 @@ void _zuc_eia3_1_buffer_avx512(const void *pKey, * B_1[127:112] B_5[127:112] B_9[127:112] B_13[127:112] * ... ] */ -static inline -unsigned get_start_key_addr(const unsigned buf_idx) +static inline unsigned +get_start_key_addr(const unsigned buf_idx) { const unsigned idx_l = buf_idx & 0x3; const unsigned idx_h = buf_idx >> 2; - return idx_l*128 + idx_h*4; + return idx_l * 128 + idx_h * 4; } -static inline -void _zuc_eia3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], - const void * const pIv[NUM_AVX512_BUFS], - const void * const pBufferIn[NUM_AVX512_BUFS], - const uint32_t lengthInBits[NUM_AVX512_BUFS], - uint32_t *pMacI[NUM_AVX512_BUFS], - const unsigned use_gfni) +static inline void +_zuc_eia3_16_buffer_avx512(const void *const pKey[NUM_AVX512_BUFS], + const void *const pIv[NUM_AVX512_BUFS], + const void *const pBufferIn[NUM_AVX512_BUFS], + const uint32_t lengthInBits[NUM_AVX512_BUFS], + uint32_t *pMacI[NUM_AVX512_BUFS], const unsigned use_gfni) { unsigned int i = 0; DECLARE_ALIGNED(ZucState16_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); /* Calculate the minimum input packet size from all packets */ uint32_t commonBits = find_min_length32(lengthInBits); - DECLARE_ALIGNED(uint32_t keyStr[NUM_AVX512_BUFS*2*16], 64); + DECLARE_ALIGNED(uint32_t keyStr[NUM_AVX512_BUFS * 2 * 16], 64); /* structure to store the 16 keys */ DECLARE_ALIGNED(ZucKey16_t keys, 64); /* structure to store the 16 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_AVX512_BUFS*32], 16); - const uint8_t *pIn8[NUM_AVX512_BUFS] = {NULL}; + DECLARE_ALIGNED(uint8_t ivs[NUM_AVX512_BUFS * 32], 16); + const uint8_t *pIn8[NUM_AVX512_BUFS] = { NULL }; uint32_t remainCommonBits = commonBits; uint32_t numKeyStr = 0; - uint32_t T[NUM_AVX512_BUFS] = {0}; + uint32_t T[NUM_AVX512_BUFS] = { 0 }; const uint32_t keyStreamLengthInBits = ZUC_KEYSTR_LEN * 8; DECLARE_ALIGNED(uint16_t lens[NUM_AVX512_BUFS], 32); for (i = 0; i < NUM_AVX512_BUFS; i++) { pIn8[i] = (const uint8_t *) pBufferIn[i]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); lens[i] = (uint16_t) lengthInBits[i]; } @@ -695,19 +628,16 @@ void _zuc_eia3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], numKeyStr++; /* Generate the next key stream 8 bytes or 64 bytes */ if (!remainCommonBits) - keystr_8B_gen_16(&state, keyStr, - 64, use_gfni); + keystr_8B_gen_16(&state, keyStr, 64, use_gfni); else keystr_64B_gen_16(&state, keyStr, 64, use_gfni); - round64B_16(T, keyStr, - (const void **)pIn8, lens, use_gfni, 4); + round64B_16(T, keyStr, (const void **) pIn8, lens, use_gfni, 4); } /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_AVX512_BUFS; i++) { - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; - uint32_t keyStr32[16*2]; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; + uint32_t keyStr32[16 * 2]; unsigned j; /* @@ -715,13 +645,12 @@ void _zuc_eia3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], * to be in contiguous memory */ for (j = 0; j < 8; j++) - memmove(keyStr32 + j*4, - &keyStr[get_start_key_addr(i) + j*16], 16); + memmove(keyStr32 + j * 4, &keyStr[get_start_key_addr(i) + j * 16], 16); /* If remaining bits are more than 56 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (14*32)) { + if (remainBits > (14 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -748,11 +677,9 @@ void _zuc_eia3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], /* Generate the next key stream 8 bytes or 64 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_avx(&keyStr32[16], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[16], &singlePktState); else - asm_ZucGenKeystream64B_avx(&keyStr32[16], - &singlePktState); + asm_ZucGenKeystream64B_avx(&keyStr32[16], &singlePktState); asm_Eia3Round64BAVX512(&T[i], &keyStr32[0], pIn8[i]); /* Copy the last keystream generated * to the first 64 bytes */ @@ -766,8 +693,7 @@ void _zuc_eia3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], */ if (remainBits > (14 * 32)) - asm_ZucGenKeystream8B_avx(&keyStr32[16], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[16], &singlePktState); asm_Eia3RemainderAVX512(&T[i], keyStr32, pIn8[i], remainBits); *(pMacI[i]) = T[i]; @@ -782,11 +708,9 @@ void _zuc_eia3_16_buffer_avx512(const void * const pKey[NUM_AVX512_BUFS], #endif } -void zuc_eia3_1_buffer_avx512(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +void +zuc_eia3_1_buffer_avx512(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -834,14 +758,10 @@ void zuc_eia3_1_buffer_avx512(const void *pKey, #endif } -static inline -void _zuc_eia3_n_buffer(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers, - const unsigned use_gfni) +static inline void +_zuc_eia3_n_buffer(const void *const pKey[], const void *const pIv[], const void *const pBufferIn[], + const uint32_t lengthInBits[], uint32_t *pMacI[], const uint32_t numBuffers, + const unsigned use_gfni) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -904,8 +824,7 @@ void _zuc_eia3_n_buffer(const void * const pKey[], } /* Check input data is in range of supported length */ - if (lengthInBits[i] < ZUC_MIN_BITLEN || - lengthInBits[i] > ZUC_MAX_BITLEN) { + if (lengthInBits[i] < ZUC_MIN_BITLEN || lengthInBits[i] > ZUC_MAX_BITLEN) { imb_set_errno(NULL, IMB_ERR_AUTH_LEN); return; } @@ -913,42 +832,28 @@ void _zuc_eia3_n_buffer(const void * const pKey[], #endif i = 0; - while(packetCount >= 16) { + while (packetCount >= 16) { packetCount -= 16; - _zuc_eia3_16_buffer_avx512(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], - &pMacI[i], - use_gfni); + _zuc_eia3_16_buffer_avx512(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], + &pMacI[i], use_gfni); i += 16; } if (packetCount >= 8) { packetCount -= 8; - _zuc_eia3_8_buffer_avx2(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], + _zuc_eia3_8_buffer_avx2(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], &pMacI[i]); i += 8; } if (packetCount >= 4) { packetCount -= 4; - _zuc_eia3_4_buffer_avx(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], + _zuc_eia3_4_buffer_avx(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], &pMacI[i]); i += 4; } - while(packetCount--) { - _zuc_eia3_1_buffer_avx512(pKey[i], - pIv[i], - pBufferIn[i], - lengthInBits[i], - pMacI[i]); + while (packetCount--) { + _zuc_eia3_1_buffer_avx512(pKey[i], pIv[i], pBufferIn[i], lengthInBits[i], pMacI[i]); i++; } @@ -964,24 +869,18 @@ void _zuc_eia3_n_buffer(const void * const pKey[], #endif } -void zuc_eia3_n_buffer_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers) +void +zuc_eia3_n_buffer_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers) { - _zuc_eia3_n_buffer(pKey, pIv, pBufferIn, lengthInBits, - pMacI, numBuffers, 0); + _zuc_eia3_n_buffer(pKey, pIv, pBufferIn, lengthInBits, pMacI, numBuffers, 0); } -void zuc_eia3_n_buffer_gfni_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers) +void +zuc_eia3_n_buffer_gfni_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers) { - _zuc_eia3_n_buffer(pKey, pIv, pBufferIn, lengthInBits, - pMacI, numBuffers, 1); + _zuc_eia3_n_buffer(pKey, pIv, pBufferIn, lengthInBits, pMacI, numBuffers, 1); } diff --git a/lib/avx512_t2/mb_mgr_avx512_t2.c b/lib/avx512_t2/mb_mgr_avx512_t2.c index 6dc86adf..66b0bfad 100644 --- a/lib/avx512_t2/mb_mgr_avx512_t2.c +++ b/lib/avx512_t2/mb_mgr_avx512_t2.c @@ -48,43 +48,43 @@ #include "include/aesni_emu.h" #include "include/error.h" -#include "include/arch_sse_type2.h" /* SHA-NI */ -#include "include/arch_avx_type1.h" /* AESNI */ +#include "include/arch_sse_type2.h" /* SHA-NI */ +#include "include/arch_avx_type1.h" /* AESNI */ #include "include/arch_avx2_type1.h" /* MD5 */ #include "include/arch_avx512_type1.h" #include "include/arch_avx512_type2.h" #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx /* JOB API */ -#define SUBMIT_JOB submit_job_avx512_t2 -#define FLUSH_JOB flush_job_avx512_t2 -#define QUEUE_SIZE queue_size_avx512_t2 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx512_t2 -#define GET_NEXT_JOB get_next_job_avx512_t2 -#define GET_COMPLETED_JOB get_completed_job_avx512_t2 -#define SUBMIT_BURST submit_burst_avx512_t2 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx512_t2 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx512_t2 +#define SUBMIT_JOB submit_job_avx512_t2 +#define FLUSH_JOB flush_job_avx512_t2 +#define QUEUE_SIZE queue_size_avx512_t2 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx512_t2 +#define GET_NEXT_JOB get_next_job_avx512_t2 +#define GET_COMPLETED_JOB get_completed_job_avx512_t2 +#define SUBMIT_BURST submit_burst_avx512_t2 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx512_t2 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx512_t2 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx512_t2 -#define SUBMIT_HASH_BURST submit_hash_burst_avx512_t2 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx512_t2 -#define GET_NEXT_BURST get_next_burst_avx512_t2 -#define SUBMIT_BURST submit_burst_avx512_t2 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx512_t2 -#define FLUSH_BURST flush_burst_avx512_t2 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx512_t2 +#define SUBMIT_HASH_BURST submit_hash_burst_avx512_t2 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx512_t2 +#define GET_NEXT_BURST get_next_burst_avx512_t2 +#define SUBMIT_BURST submit_burst_avx512_t2 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx512_t2 +#define FLUSH_BURST flush_burst_avx512_t2 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx512_t2 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx512_t2 -#define SUBMIT_HASH_BURST submit_hash_burst_avx512_t2 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx512_t2 -#define SET_SUITE_ID_FN set_suite_id_avx512_t2 +#define SUBMIT_HASH_BURST submit_hash_burst_avx512_t2 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx512_t2 +#define SET_SUITE_ID_FN set_suite_id_avx512_t2 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX512_T2 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX512_T2 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX512_T2 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX512_T2 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_AVX512_T2 @@ -115,18 +115,15 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_vaes_avx512 #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_vaes_avx512 -#define AES_CBC_DEC_128 aes_cbc_dec_128_vaes_avx512 -#define AES_CBC_DEC_192 aes_cbc_dec_192_vaes_avx512 -#define AES_CBC_DEC_256 aes_cbc_dec_256_vaes_avx512 +#define AES_CBC_DEC_128 aes_cbc_dec_128_vaes_avx512 +#define AES_CBC_DEC_192 aes_cbc_dec_192_vaes_avx512 +#define AES_CBC_DEC_256 aes_cbc_dec_256_vaes_avx512 /* AES-CBCS */ -#define SUBMIT_JOB_AES128_CBCS_1_9_ENC \ - submit_job_aes128_cbcs_1_9_enc_vaes_avx512 -#define FLUSH_JOB_AES128_CBCS_1_9_ENC \ - flush_job_aes128_cbcs_1_9_enc_vaes_avx512 -#define SUBMIT_JOB_AES128_CBCS_1_9_DEC \ - submit_job_aes128_cbcs_1_9_dec_vaes_avx512 -#define AES_CBCS_1_9_DEC_128 aes_cbcs_1_9_dec_128_vaes_avx512 +#define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_vaes_avx512 +#define FLUSH_JOB_AES128_CBCS_1_9_ENC flush_job_aes128_cbcs_1_9_enc_vaes_avx512 +#define SUBMIT_JOB_AES128_CBCS_1_9_DEC submit_job_aes128_cbcs_1_9_dec_vaes_avx512 +#define AES_CBCS_1_9_DEC_128 aes_cbcs_1_9_dec_128_vaes_avx512 /* AES-ECB */ #define SUBMIT_JOB_AES_ECB_128_ENC submit_job_aes_ecb_128_enc_avx512 @@ -136,12 +133,12 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_avx512 #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_avx512 -#define AES_ECB_ENC_128 aes_ecb_enc_128_vaes_avx512 -#define AES_ECB_ENC_192 aes_ecb_enc_192_vaes_avx512 -#define AES_ECB_ENC_256 aes_ecb_enc_256_vaes_avx512 -#define AES_ECB_DEC_128 aes_ecb_dec_128_vaes_avx512 -#define AES_ECB_DEC_192 aes_ecb_dec_192_vaes_avx512 -#define AES_ECB_DEC_256 aes_ecb_dec_256_vaes_avx512 +#define AES_ECB_ENC_128 aes_ecb_enc_128_vaes_avx512 +#define AES_ECB_ENC_192 aes_ecb_enc_192_vaes_avx512 +#define AES_ECB_ENC_256 aes_ecb_enc_256_vaes_avx512 +#define AES_ECB_DEC_128 aes_ecb_dec_128_vaes_avx512 +#define AES_ECB_DEC_192 aes_ecb_dec_192_vaes_avx512 +#define AES_ECB_DEC_256 aes_ecb_dec_256_vaes_avx512 /* AES-CTR */ #define SUBMIT_JOB_AES_CTR_128 aes_cntr_128_submit_vaes_avx512 @@ -152,29 +149,29 @@ #define SUBMIT_JOB_AES_CTR_256_BIT aes_cntr_bit_256_submit_vaes_avx512 /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_vaes_avx512 -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_vaes_avx512 +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_vaes_avx512 +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_vaes_avx512 -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_vaes_avx512 -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_vaes_avx512 +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_vaes_avx512 +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_vaes_avx512 -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_vaes_avx512 -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_vaes_avx512 +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_vaes_avx512 +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_vaes_avx512 /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_vaes_avx512 -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_vaes_avx512 +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_vaes_avx512 +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_vaes_avx512 -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_vaes_avx512 -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_vaes_avx512 +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_vaes_avx512 +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_vaes_avx512 /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_avx512 -#define AES_CFB_256_ONE aes_cfb_256_one_avx512 +#define AES_CFB_128_ONE aes_cfb_128_one_avx512 +#define AES_CFB_256_ONE aes_cfb_256_one_avx512 /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_vaes_avx512 -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_vaes_avx512 +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_vaes_avx512 +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_vaes_avx512 /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_vaes_avx512 @@ -183,84 +180,85 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_vaes_avx512 /* SHA1/224/256/384/512 */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_avx512 -#define FLUSH_JOB_SHA1 flush_job_sha1_avx512 -#define SUBMIT_JOB_SHA224 submit_job_sha224_avx512 -#define FLUSH_JOB_SHA224 flush_job_sha224_avx512 -#define SUBMIT_JOB_SHA256 submit_job_sha256_avx512 -#define FLUSH_JOB_SHA256 flush_job_sha256_avx512 -#define SUBMIT_JOB_SHA384 submit_job_sha384_avx512 -#define FLUSH_JOB_SHA384 flush_job_sha384_avx512 -#define SUBMIT_JOB_SHA512 submit_job_sha512_avx512 -#define FLUSH_JOB_SHA512 flush_job_sha512_avx512 +#define SUBMIT_JOB_SHA1 submit_job_sha1_avx512 +#define FLUSH_JOB_SHA1 flush_job_sha1_avx512 +#define SUBMIT_JOB_SHA224 submit_job_sha224_avx512 +#define FLUSH_JOB_SHA224 flush_job_sha224_avx512 +#define SUBMIT_JOB_SHA256 submit_job_sha256_avx512 +#define FLUSH_JOB_SHA256 flush_job_sha256_avx512 +#define SUBMIT_JOB_SHA384 submit_job_sha384_avx512 +#define FLUSH_JOB_SHA384 flush_job_sha384_avx512 +#define SUBMIT_JOB_SHA512 submit_job_sha512_avx512 +#define FLUSH_JOB_SHA512 flush_job_sha512_avx512 /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_avx512 -#define FLUSH_JOB_HMAC flush_job_hmac_avx512 -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx512 -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx512 -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx512 -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx512 -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx512 -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx512 -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx512 -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx512 -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 +#define SUBMIT_JOB_HMAC submit_job_hmac_avx512 +#define FLUSH_JOB_HMAC flush_job_hmac_avx512 +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx512 +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx512 +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx512 +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx512 +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx512 +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx512 +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx512 +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx512 +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx2 +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx2 /* DES & 3DES */ #define SUBMIT_JOB_DES_CBC_ENC submit_job_des_cbc_enc_avx512 #define FLUSH_JOB_DES_CBC_ENC flush_job_des_cbc_enc_avx512 #define SUBMIT_JOB_DES_CBC_DEC submit_job_des_cbc_dec_avx512 -#define FLUSH_JOB_DES_CBC_DEC flush_job_des_cbc_dec_avx512 +#define FLUSH_JOB_DES_CBC_DEC flush_job_des_cbc_dec_avx512 #define SUBMIT_JOB_3DES_CBC_ENC submit_job_3des_cbc_enc_avx512 #define FLUSH_JOB_3DES_CBC_ENC flush_job_3des_cbc_enc_avx512 #define SUBMIT_JOB_3DES_CBC_DEC submit_job_3des_cbc_dec_avx512 -#define FLUSH_JOB_3DES_CBC_DEC flush_job_3des_cbc_dec_avx512 +#define FLUSH_JOB_3DES_CBC_DEC flush_job_3des_cbc_dec_avx512 /* DES-DOCSIS */ #define SUBMIT_JOB_DOCSIS_DES_ENC submit_job_docsis_des_enc_avx512 #define FLUSH_JOB_DOCSIS_DES_ENC flush_job_docsis_des_enc_avx512 #define SUBMIT_JOB_DOCSIS_DES_DEC submit_job_docsis_des_dec_avx512 -#define FLUSH_JOB_DOCSIS_DES_DEC flush_job_docsis_des_dec_avx512 +#define FLUSH_JOB_DOCSIS_DES_DEC flush_job_docsis_des_dec_avx512 /* CHACHA20 & POLY1305 */ -#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx512 -#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_avx512 +#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx512 +#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_avx512 #define SUBMIT_JOB_CHACHA20_POLY1305_SGL aead_chacha20_poly1305_sgl_avx512 -#define POLY1305_MAC poly1305_mac_fma_avx512 +#define POLY1305_MAC poly1305_mac_fma_avx512 /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_avx512 -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_avx512 -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_avx512 -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_avx512 -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_avx512 -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_avx512 -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_avx512 -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_avx512 +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_avx512 +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_avx512 +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_avx512 +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_avx512 +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_avx512 +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_avx512 +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_avx512 +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_avx512 /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_avx #define SUBMIT_JOB_SNOW_V_AEAD snow_v_aead_init_avx /* SNOW3G UE2 & UIA2 */ -static IMB_JOB *submit_snow3g_uea2_job_vaes_avx512(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_snow3g_uea2_job_vaes_avx512(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_vaes_avx512(snow3g_uea2_ooo, job); } -static IMB_JOB *flush_snow3g_uea2_job_vaes_avx512(IMB_MGR *state) +static IMB_JOB * +flush_snow3g_uea2_job_vaes_avx512(IMB_MGR *state) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; @@ -276,31 +274,22 @@ static IMB_JOB *flush_snow3g_uea2_job_vaes_avx512(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size); -__forceinline -IMB_JOB * -FLUSH_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, - const uint64_t key_size); - -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size); - -__forceinline -IMB_JOB * +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size); +__forceinline IMB_JOB * +FLUSH_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, const uint64_t key_size); + +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size); + +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS128_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); -__forceinline -IMB_JOB * +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS256_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); static IMB_JOB * -submit_job_docsis128_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +submit_job_docsis128_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { (void) state; @@ -322,8 +311,7 @@ submit_job_docsis128_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, } static IMB_JOB * -submit_job_docsis256_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +submit_job_docsis256_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { (void) state; @@ -344,18 +332,12 @@ submit_job_docsis256_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, return job; } -#define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC \ - submit_job_aes_docsis128_enc_crc32_vaes_avx512 -#define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC \ - submit_job_aes_docsis256_enc_crc32_vaes_avx512 -#define FLUSH_JOB_DOCSIS128_SEC_CRC_ENC \ - flush_job_aes_docsis128_enc_crc32_vaes_avx512 -#define FLUSH_JOB_DOCSIS256_SEC_CRC_ENC \ - flush_job_aes_docsis256_enc_crc32_vaes_avx512 -#define SUBMIT_JOB_DOCSIS128_SEC_CRC_DEC \ - submit_job_docsis128_sec_crc_dec_vaes_avx512 -#define SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC \ - submit_job_docsis256_sec_crc_dec_vaes_avx512 +#define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC submit_job_aes_docsis128_enc_crc32_vaes_avx512 +#define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC submit_job_aes_docsis256_enc_crc32_vaes_avx512 +#define FLUSH_JOB_DOCSIS128_SEC_CRC_ENC flush_job_aes_docsis128_enc_crc32_vaes_avx512 +#define FLUSH_JOB_DOCSIS256_SEC_CRC_ENC flush_job_aes_docsis256_enc_crc32_vaes_avx512 +#define SUBMIT_JOB_DOCSIS128_SEC_CRC_DEC submit_job_docsis128_sec_crc_dec_vaes_avx512 +#define SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC submit_job_docsis256_sec_crc_dec_vaes_avx512 /* ====================================================================== */ @@ -393,20 +375,16 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX512_NUM_SHA1_LANES); /* Init HMAC/SHA224 out-of-order fields */ - ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, - AVX512_NUM_SHA256_LANES); + ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, AVX512_NUM_SHA256_LANES); /* Init HMAC/SHA256 out-of-order fields */ - ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, - AVX512_NUM_SHA256_LANES); + ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, AVX512_NUM_SHA256_LANES); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - AVX512_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, AVX512_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - AVX512_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, AVX512_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, AVX2_NUM_MD5_LANES); @@ -449,8 +427,7 @@ IMB_DLL_LOCAL void init_mb_mgr_avx512_t2_internal(IMB_MGR *state, const int reset_mgrs) { /* Check if CPU flags needed for AVX512 interface are present */ - if ((state->features & IMB_CPUFLAGS_AVX512_T2) != - IMB_CPUFLAGS_AVX512_T2) { + if ((state->features & IMB_CPUFLAGS_AVX512_T2) != IMB_CPUFLAGS_AVX512_T2) { imb_set_errno(state, IMB_ERR_MISSING_CPUFLAGS_INIT_MGR); return; } @@ -467,72 +444,72 @@ init_mb_mgr_avx512_t2_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_avx512; - state->keyexp_192 = aes_keyexp_192_avx512; - state->keyexp_256 = aes_keyexp_256_avx512; + state->keyexp_128 = aes_keyexp_128_avx512; + state->keyexp_192 = aes_keyexp_192_avx512; + state->keyexp_256 = aes_keyexp_256_avx512; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_avx512; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_avx512; - state->xcbc_keyexp = aes_xcbc_expand_key_avx512; - - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_sse_shani; - state->sha1 = sha1_sse_shani; - state->sha224_one_block = sha224_one_block_sse_shani; - state->sha224 = sha224_sse_shani; - state->sha256_one_block = sha256_one_block_sse_shani; - state->sha256 = sha256_sse_shani; - state->sha384_one_block = sha384_one_block_avx512; - state->sha384 = sha384_avx512; - state->sha512_one_block = sha512_one_block_avx512; - state->sha512 = sha512_avx512; - state->md5_one_block = md5_one_block_avx512; - - state->aes128_cfb_one = aes_cfb_128_one_avx512; - state->aes256_cfb_one = aes_cfb_256_one_avx512; - - state->eea3_1_buffer = zuc_eea3_1_buffer_avx512; - state->eea3_4_buffer = zuc_eea3_4_buffer_avx; - state->eia3_1_buffer = zuc_eia3_1_buffer_avx512; - state->eea3_n_buffer = zuc_eea3_n_buffer_gfni_avx512; - state->eia3_n_buffer = zuc_eia3_n_buffer_gfni_avx512; - - state->f8_1_buffer = kasumi_f8_1_buffer_avx; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; - state->f8_2_buffer = kasumi_f8_2_buffer_avx; - state->f8_3_buffer = kasumi_f8_3_buffer_avx; - state->f8_4_buffer = kasumi_f8_4_buffer_avx; - state->f8_n_buffer = kasumi_f8_n_buffer_avx; - state->f9_1_buffer = kasumi_f9_1_buffer_avx; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; + state->xcbc_keyexp = aes_xcbc_expand_key_avx512; + + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_sse_shani; + state->sha1 = sha1_sse_shani; + state->sha224_one_block = sha224_one_block_sse_shani; + state->sha224 = sha224_sse_shani; + state->sha256_one_block = sha256_one_block_sse_shani; + state->sha256 = sha256_sse_shani; + state->sha384_one_block = sha384_one_block_avx512; + state->sha384 = sha384_avx512; + state->sha512_one_block = sha512_one_block_avx512; + state->sha512 = sha512_avx512; + state->md5_one_block = md5_one_block_avx512; + + state->aes128_cfb_one = aes_cfb_128_one_avx512; + state->aes256_cfb_one = aes_cfb_256_one_avx512; + + state->eea3_1_buffer = zuc_eea3_1_buffer_avx512; + state->eea3_4_buffer = zuc_eea3_4_buffer_avx; + state->eia3_1_buffer = zuc_eia3_1_buffer_avx512; + state->eea3_n_buffer = zuc_eea3_n_buffer_gfni_avx512; + state->eia3_n_buffer = zuc_eia3_n_buffer_gfni_avx512; + + state->f8_1_buffer = kasumi_f8_1_buffer_avx; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; + state->f8_2_buffer = kasumi_f8_2_buffer_avx; + state->f8_3_buffer = kasumi_f8_3_buffer_avx; + state->f8_4_buffer = kasumi_f8_4_buffer_avx; + state->f8_n_buffer = kasumi_f8_n_buffer_avx; + state->f9_1_buffer = kasumi_f9_1_buffer_avx; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_avx; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_avx; state->kasumi_key_sched_size = kasumi_key_sched_size_avx; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_avx512; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx512; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx512; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx512; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx512; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx512; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx512; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx512; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx512; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx512; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx512; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_avx512; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_avx512; #ifndef _WIN32 @@ -546,67 +523,64 @@ init_mb_mgr_avx512_t2_internal(IMB_MGR *state, const int reset_mgrs) state->hec_32 = hec_32_avx; state->hec_64 = hec_64_avx; - state->crc32_ethernet_fcs = ethernet_fcs_avx512; - state->crc16_x25 = crc16_x25_avx512; - state->crc32_sctp = crc32_sctp_avx512; - state->crc24_lte_a = crc24_lte_a_avx512; - state->crc24_lte_b = crc24_lte_b_avx512; - state->crc16_fp_data = crc16_fp_data_avx512; - state->crc11_fp_header = crc11_fp_header_avx512; - state->crc7_fp_header = crc7_fp_header_avx512; - state->crc10_iuup_data = crc10_iuup_data_avx512; - state->crc6_iuup_header = crc6_iuup_header_avx512; + state->crc32_ethernet_fcs = ethernet_fcs_avx512; + state->crc16_x25 = crc16_x25_avx512; + state->crc32_sctp = crc32_sctp_avx512; + state->crc24_lte_a = crc24_lte_a_avx512; + state->crc24_lte_b = crc24_lte_b_avx512; + state->crc16_fp_data = crc16_fp_data_avx512; + state->crc11_fp_header = crc11_fp_header_avx512; + state->crc7_fp_header = crc7_fp_header_avx512; + state->crc10_iuup_data = crc10_iuup_data_avx512; + state->crc6_iuup_header = crc6_iuup_header_avx512; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_avx512; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_avx512; state->chacha20_poly1305_init = init_chacha20_poly1305_fma_avx512; - state->chacha20_poly1305_enc_update = - update_enc_chacha20_poly1305_fma_avx512; - state->chacha20_poly1305_dec_update = - update_dec_chacha20_poly1305_fma_avx512; - state->chacha20_poly1305_finalize = - finalize_chacha20_poly1305_fma_avx512; - - state->gcm128_enc = aes_gcm_enc_128_vaes_avx512; - state->gcm192_enc = aes_gcm_enc_192_vaes_avx512; - state->gcm256_enc = aes_gcm_enc_256_vaes_avx512; - state->gcm128_dec = aes_gcm_dec_128_vaes_avx512; - state->gcm192_dec = aes_gcm_dec_192_vaes_avx512; - state->gcm256_dec = aes_gcm_dec_256_vaes_avx512; - state->gcm128_init = aes_gcm_init_128_vaes_avx512; - state->gcm192_init = aes_gcm_init_192_vaes_avx512; - state->gcm256_init = aes_gcm_init_256_vaes_avx512; + state->chacha20_poly1305_enc_update = update_enc_chacha20_poly1305_fma_avx512; + state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_fma_avx512; + state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_fma_avx512; + + state->gcm128_enc = aes_gcm_enc_128_vaes_avx512; + state->gcm192_enc = aes_gcm_enc_192_vaes_avx512; + state->gcm256_enc = aes_gcm_enc_256_vaes_avx512; + state->gcm128_dec = aes_gcm_dec_128_vaes_avx512; + state->gcm192_dec = aes_gcm_dec_192_vaes_avx512; + state->gcm256_dec = aes_gcm_dec_256_vaes_avx512; + state->gcm128_init = aes_gcm_init_128_vaes_avx512; + state->gcm192_init = aes_gcm_init_192_vaes_avx512; + state->gcm256_init = aes_gcm_init_256_vaes_avx512; state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_vaes_avx512; state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_vaes_avx512; state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_vaes_avx512; - state->gcm128_enc_update = aes_gcm_enc_128_update_vaes_avx512; - state->gcm192_enc_update = aes_gcm_enc_192_update_vaes_avx512; - state->gcm256_enc_update = aes_gcm_enc_256_update_vaes_avx512; - state->gcm128_dec_update = aes_gcm_dec_128_update_vaes_avx512; - state->gcm192_dec_update = aes_gcm_dec_192_update_vaes_avx512; - state->gcm256_dec_update = aes_gcm_dec_256_update_vaes_avx512; + state->gcm128_enc_update = aes_gcm_enc_128_update_vaes_avx512; + state->gcm192_enc_update = aes_gcm_enc_192_update_vaes_avx512; + state->gcm256_enc_update = aes_gcm_enc_256_update_vaes_avx512; + state->gcm128_dec_update = aes_gcm_dec_128_update_vaes_avx512; + state->gcm192_dec_update = aes_gcm_dec_192_update_vaes_avx512; + state->gcm256_dec_update = aes_gcm_dec_256_update_vaes_avx512; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_vaes_avx512; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_vaes_avx512; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_vaes_avx512; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_vaes_avx512; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_vaes_avx512; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_vaes_avx512; - state->gcm128_precomp = aes_gcm_precomp_128_vaes_avx512; - state->gcm192_precomp = aes_gcm_precomp_192_vaes_avx512; - state->gcm256_precomp = aes_gcm_precomp_256_vaes_avx512; - state->gcm128_pre = aes_gcm_pre_128_vaes_avx512; - state->gcm192_pre = aes_gcm_pre_192_vaes_avx512; - state->gcm256_pre = aes_gcm_pre_256_vaes_avx512; - - state->ghash = ghash_vaes_avx512; - state->ghash_pre = ghash_pre_vaes_avx512; - - state->gmac128_init = imb_aes_gmac_init_128_vaes_avx512; - state->gmac192_init = imb_aes_gmac_init_192_vaes_avx512; - state->gmac256_init = imb_aes_gmac_init_256_vaes_avx512; - state->gmac128_update = imb_aes_gmac_update_128_vaes_avx512; - state->gmac192_update = imb_aes_gmac_update_192_vaes_avx512; - state->gmac256_update = imb_aes_gmac_update_256_vaes_avx512; + state->gcm128_precomp = aes_gcm_precomp_128_vaes_avx512; + state->gcm192_precomp = aes_gcm_precomp_192_vaes_avx512; + state->gcm256_precomp = aes_gcm_precomp_256_vaes_avx512; + state->gcm128_pre = aes_gcm_pre_128_vaes_avx512; + state->gcm192_pre = aes_gcm_pre_192_vaes_avx512; + state->gcm256_pre = aes_gcm_pre_256_vaes_avx512; + + state->ghash = ghash_vaes_avx512; + state->ghash_pre = ghash_pre_vaes_avx512; + + state->gmac128_init = imb_aes_gmac_init_128_vaes_avx512; + state->gmac192_init = imb_aes_gmac_init_192_vaes_avx512; + state->gmac256_init = imb_aes_gmac_init_256_vaes_avx512; + state->gmac128_update = imb_aes_gmac_update_128_vaes_avx512; + state->gmac192_update = imb_aes_gmac_update_192_vaes_avx512; + state->gmac256_update = imb_aes_gmac_update_256_vaes_avx512; state->gmac128_finalize = imb_aes_gmac_finalize_128_vaes_avx512; state->gmac192_finalize = imb_aes_gmac_finalize_192_vaes_avx512; state->gmac256_finalize = imb_aes_gmac_finalize_256_vaes_avx512; diff --git a/lib/avx_t1/kasumi_avx.c b/lib/avx_t1/kasumi_avx.c index eb2f6bac..d2e564d0 100644 --- a/lib/avx_t1/kasumi_avx.c +++ b/lib/avx_t1/kasumi_avx.c @@ -35,13 +35,12 @@ #include "include/clear_regs_mem.h" #include "include/error.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx void -kasumi_f8_1_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pBufferIn, void *pBufferOut, - const uint32_t cipherLengthInBytes) +kasumi_f8_1_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBytes) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -51,7 +50,7 @@ kasumi_f8_1_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, #ifdef SAFE_PARAM /* Check for NULL pointers */ imb_set_errno(NULL, 0); - if (pCtx == NULL) { + if (pCtx == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } @@ -64,14 +63,12 @@ kasumi_f8_1_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, return; } /* Check input data is in range of supported length */ - if (cipherLengthInBytes == 0 || - cipherLengthInBytes > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (cipherLengthInBytes == 0 || cipherLengthInBytes > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } #endif - kasumi_f8_1_buffer(pCtx, IV, pBufferIn, pBufferOut, - cipherLengthInBytes); + kasumi_f8_1_buffer(pCtx, IV, pBufferIn, pBufferOut, cipherLengthInBytes); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -83,10 +80,8 @@ kasumi_f8_1_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, } void -kasumi_f8_1_buffer_bit_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t cipherLengthInBits, +kasumi_f8_1_buffer_bit_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBits, const uint32_t offsetInBits) { #ifndef LINUX @@ -97,7 +92,7 @@ kasumi_f8_1_buffer_bit_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, #ifdef SAFE_PARAM /* Check for NULL pointers */ imb_set_errno(NULL, 0); - if (pCtx == NULL) { + if (pCtx == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } @@ -110,14 +105,12 @@ kasumi_f8_1_buffer_bit_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, return; } /* Check input data is in range of supported length */ - if (cipherLengthInBits == 0 || - cipherLengthInBits > KASUMI_MAX_LEN) { + if (cipherLengthInBits == 0 || cipherLengthInBits > KASUMI_MAX_LEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } #endif - kasumi_f8_1_buffer_bit(pCtx, IV, pBufferIn, pBufferOut, - cipherLengthInBits, offsetInBits); + kasumi_f8_1_buffer_bit(pCtx, IV, pBufferIn, pBufferOut, cipherLengthInBits, offsetInBits); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -129,11 +122,9 @@ kasumi_f8_1_buffer_bit_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, } void -kasumi_f8_2_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, - const uint64_t IV2, const void *pBufferIn1, - void *pBufferOut1, const uint32_t lengthInBytes1, - const void *pBufferIn2, void *pBufferOut2, - const uint32_t lengthInBytes2) +kasumi_f8_2_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -143,7 +134,7 @@ kasumi_f8_2_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, #ifdef SAFE_PARAM /* Check for NULL pointers */ imb_set_errno(NULL, 0); - if (pCtx == NULL) { + if (pCtx == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } @@ -156,21 +147,18 @@ kasumi_f8_2_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, return; } /* Check input data is in range of supported length */ - if (lengthInBytes1 == 0 || - lengthInBytes1 > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (lengthInBytes1 == 0 || lengthInBytes1 > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } - if (lengthInBytes2 == 0 || - lengthInBytes2 > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (lengthInBytes2 == 0 || lengthInBytes2 > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } #endif - kasumi_f8_2_buffer(pCtx, IV1, IV2, - pBufferIn1, pBufferOut1, lengthInBytes1, - pBufferIn2, pBufferOut2, lengthInBytes2); + kasumi_f8_2_buffer(pCtx, IV1, IV2, pBufferIn1, pBufferOut1, lengthInBytes1, pBufferIn2, + pBufferOut2, lengthInBytes2); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -182,12 +170,10 @@ kasumi_f8_2_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, } void -kasumi_f8_3_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, - const uint64_t IV2, const uint64_t IV3, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const uint32_t lengthInBytes) +kasumi_f8_3_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const void *pBufferIn1, void *pBufferOut1, + const void *pBufferIn2, void *pBufferOut2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -197,7 +183,7 @@ kasumi_f8_3_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, #ifdef SAFE_PARAM /* Check for NULL pointers */ imb_set_errno(NULL, 0); - if (pCtx == NULL) { + if (pCtx == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } @@ -215,9 +201,7 @@ kasumi_f8_3_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, return; } #endif - kasumi_f8_3_buffer(pCtx, IV1, IV2, IV3, - pBufferIn1, pBufferOut1, - pBufferIn2, pBufferOut2, + kasumi_f8_3_buffer(pCtx, IV1, IV2, IV3, pBufferIn1, pBufferOut1, pBufferIn2, pBufferOut2, pBufferIn3, pBufferOut3, lengthInBytes); #ifdef SAFE_DATA /* Clear sensitive data in registers */ @@ -230,14 +214,11 @@ kasumi_f8_3_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, } void -kasumi_f8_4_buffer_avx(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, - const uint64_t IV3, const uint64_t IV4, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const void *pBufferIn4, void *pBufferOut4, - const uint32_t lengthInBytes) +kasumi_f8_4_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const uint64_t IV4, const void *pBufferIn1, + void *pBufferOut1, const void *pBufferIn2, void *pBufferOut2, + const void *pBufferIn3, void *pBufferOut3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -247,12 +228,11 @@ kasumi_f8_4_buffer_avx(const kasumi_key_sched_t *pCtx, #ifdef SAFE_PARAM /* Check for NULL pointers */ imb_set_errno(NULL, 0); - if (pCtx == NULL) { + if (pCtx == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } - if (pBufferIn1 == NULL || pBufferIn2 == NULL || pBufferIn3 == NULL || - pBufferIn4 == NULL) { + if (pBufferIn1 == NULL || pBufferIn2 == NULL || pBufferIn3 == NULL || pBufferIn4 == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_SRC); return; } @@ -267,11 +247,8 @@ kasumi_f8_4_buffer_avx(const kasumi_key_sched_t *pCtx, return; } #endif - kasumi_f8_4_buffer(pCtx, IV1, IV2, IV3, IV4, - pBufferIn1, pBufferOut1, - pBufferIn2, pBufferOut2, - pBufferIn3, pBufferOut3, - pBufferIn4, pBufferOut4, + kasumi_f8_4_buffer(pCtx, IV1, IV2, IV3, IV4, pBufferIn1, pBufferOut1, pBufferIn2, + pBufferOut2, pBufferIn3, pBufferOut3, pBufferIn4, pBufferOut4, lengthInBytes); #ifdef SAFE_DATA /* Clear sensitive data in registers */ @@ -284,10 +261,9 @@ kasumi_f8_4_buffer_avx(const kasumi_key_sched_t *pCtx, } void -kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, - const uint64_t IV[], - const void * const pDataIn[], void *pDataOut[], - const uint32_t dataLen[], const uint32_t dataCount) +kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], + const void *const pDataIn[], void *pDataOut[], const uint32_t dataLen[], + const uint32_t dataCount) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -324,7 +300,7 @@ kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, for (i = 0; i < dataCount; i++) { /* Check for NULL pointers */ - if (pDataIn[i] == NULL ) { + if (pDataIn[i] == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_SRC); return; } @@ -333,8 +309,7 @@ kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, return; } /* Check input data is in range of supported length */ - if (dataLen[i] == 0 || - dataLen[i] > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (dataLen[i] == 0 || dataLen[i] > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -346,13 +321,13 @@ kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, /* KASUMI F8 n buffer function can handle up to 16 buffers */ while (numLeft > 0) { const uint64_t *IVPtr = &IV[i]; - const void * const *pDataInPtr = &pDataIn[i]; + const void *const *pDataInPtr = &pDataIn[i]; void **pDataOutPtr = &pDataOut[i]; const uint32_t *dataLenPtr = &dataLen[i]; const uint32_t numBuffs = (numLeft > 16) ? 16 : numLeft; - kasumi_f8_n_buffer(pKeySchedule, IVPtr, pDataInPtr, pDataOutPtr, - dataLenPtr, numBuffs); + kasumi_f8_n_buffer(pKeySchedule, IVPtr, pDataInPtr, pDataOutPtr, dataLenPtr, + numBuffs); i += numBuffs; numLeft -= numBuffs; } @@ -366,7 +341,6 @@ kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, #endif } - void kasumi_f9_1_buffer_avx(const kasumi_key_sched_t *pCtx, const void *pBufferIn, const uint32_t lengthInBytes, void *pDigest) @@ -412,8 +386,8 @@ kasumi_f9_1_buffer_avx(const kasumi_key_sched_t *pCtx, const void *pBufferIn, void kasumi_f9_1_buffer_user_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pBufferIn, const uint32_t lengthInBits, - void *pDigest, const uint32_t direction) + const void *pBufferIn, const uint32_t lengthInBits, void *pDigest, + const uint32_t direction) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -443,8 +417,7 @@ kasumi_f9_1_buffer_user_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, return; } #endif - kasumi_f9_1_buffer_user(pCtx, IV, pBufferIn, lengthInBits, - pDigest, direction); + kasumi_f9_1_buffer_user(pCtx, IV, pBufferIn, lengthInBits, pDigest, direction); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -456,15 +429,13 @@ kasumi_f9_1_buffer_user_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, } int -kasumi_init_f8_key_sched_avx(const void *const pKey, - kasumi_key_sched_t *pCtx) +kasumi_init_f8_key_sched_avx(const void *const pKey, kasumi_key_sched_t *pCtx) { return kasumi_init_f8_key_sched(pKey, pCtx); } int -kasumi_init_f9_key_sched_avx(const void *const pKey, - kasumi_key_sched_t *pCtx) +kasumi_init_f9_key_sched_avx(const void *const pKey, kasumi_key_sched_t *pCtx) { return kasumi_init_f9_key_sched(pKey, pCtx); } diff --git a/lib/avx_t1/mb_mgr_avx.c b/lib/avx_t1/mb_mgr_avx.c index e0a8fe02..124b9476 100644 --- a/lib/avx_t1/mb_mgr_avx.c +++ b/lib/avx_t1/mb_mgr_avx.c @@ -50,11 +50,9 @@ init_mb_mgr_avx_internal(IMB_MGR *state, const int reset_mgrs) /* reset error status */ imb_set_errno(state, 0); - state->features = cpu_feature_adjust(state->flags, - cpu_feature_detect()); + state->features = cpu_feature_adjust(state->flags, cpu_feature_detect()); - if ((state->features & IMB_CPUFLAGS_AVX_T2) == - IMB_CPUFLAGS_AVX_T2) + if ((state->features & IMB_CPUFLAGS_AVX_T2) == IMB_CPUFLAGS_AVX_T2) init_mb_mgr_avx_t2_internal(state, reset_mgrs); else init_mb_mgr_avx_t1_internal(state, reset_mgrs); @@ -69,32 +67,38 @@ init_mb_mgr_avx(IMB_MGR *state) imb_set_errno(state, IMB_ERR_SELFTEST); } -IMB_JOB *submit_job_avx(IMB_MGR *state) +IMB_JOB * +submit_job_avx(IMB_MGR *state) { return IMB_SUBMIT_JOB(state); } -IMB_JOB *flush_job_avx(IMB_MGR *state) +IMB_JOB * +flush_job_avx(IMB_MGR *state) { return IMB_FLUSH_JOB(state); } -uint32_t queue_size_avx(IMB_MGR *state) +uint32_t +queue_size_avx(IMB_MGR *state) { return IMB_QUEUE_SIZE(state); } -IMB_JOB *submit_job_nocheck_avx(IMB_MGR *state) +IMB_JOB * +submit_job_nocheck_avx(IMB_MGR *state) { return IMB_SUBMIT_JOB_NOCHECK(state); } -IMB_JOB *get_next_job_avx(IMB_MGR *state) +IMB_JOB * +get_next_job_avx(IMB_MGR *state) { return IMB_GET_NEXT_JOB(state); } -IMB_JOB *get_completed_job_avx(IMB_MGR *state) +IMB_JOB * +get_completed_job_avx(IMB_MGR *state) { return IMB_GET_COMPLETED_JOB(state); } diff --git a/lib/avx_t1/mb_mgr_avx_t1.c b/lib/avx_t1/mb_mgr_avx_t1.c index c4862042..a1e29ec1 100644 --- a/lib/avx_t1/mb_mgr_avx_t1.c +++ b/lib/avx_t1/mb_mgr_avx_t1.c @@ -48,29 +48,29 @@ #include "include/arch_avx_type1.h" #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx /* JOB API */ -#define SUBMIT_JOB submit_job_avx_t1 -#define FLUSH_JOB flush_job_avx_t1 -#define QUEUE_SIZE queue_size_avx_t1 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx_t1 -#define GET_NEXT_JOB get_next_job_avx_t1 -#define GET_COMPLETED_JOB get_completed_job_avx_t1 -#define GET_NEXT_BURST get_next_burst_avx_t1 -#define SUBMIT_BURST submit_burst_avx_t1 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx_t1 -#define FLUSH_BURST flush_burst_avx_t1 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx_t1 +#define SUBMIT_JOB submit_job_avx_t1 +#define FLUSH_JOB flush_job_avx_t1 +#define QUEUE_SIZE queue_size_avx_t1 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx_t1 +#define GET_NEXT_JOB get_next_job_avx_t1 +#define GET_COMPLETED_JOB get_completed_job_avx_t1 +#define GET_NEXT_BURST get_next_burst_avx_t1 +#define SUBMIT_BURST submit_burst_avx_t1 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx_t1 +#define FLUSH_BURST flush_burst_avx_t1 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx_t1 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx_t1 -#define SUBMIT_HASH_BURST submit_hash_burst_avx_t1 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx_t1 -#define SET_SUITE_ID_FN set_suite_id_avx_t1 +#define SUBMIT_HASH_BURST submit_hash_burst_avx_t1 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx_t1 +#define SET_SUITE_ID_FN set_suite_id_avx_t1 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_AVX @@ -78,12 +78,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse #define SUBMIT_JOB_AES_GCM_DEC submit_job_aes_gcm_dec_avx #define SUBMIT_JOB_AES_GCM_ENC submit_job_aes_gcm_enc_avx @@ -101,9 +101,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_avx #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_avx -#define AES_CBC_DEC_128 aes_cbc_dec_128_avx -#define AES_CBC_DEC_192 aes_cbc_dec_192_avx -#define AES_CBC_DEC_256 aes_cbc_dec_256_avx +#define AES_CBC_DEC_128 aes_cbc_dec_128_avx +#define AES_CBC_DEC_192 aes_cbc_dec_192_avx +#define AES_CBC_DEC_256 aes_cbc_dec_256_avx #define SUBMIT_JOB_AES128_DEC submit_job_aes128_dec_avx #define SUBMIT_JOB_AES192_DEC submit_job_aes192_dec_avx @@ -123,45 +123,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_avx #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_avx -#define AES_ECB_ENC_128 aes_ecb_enc_128_avx -#define AES_ECB_ENC_192 aes_ecb_enc_192_avx -#define AES_ECB_ENC_256 aes_ecb_enc_256_avx -#define AES_ECB_DEC_128 aes_ecb_dec_128_avx -#define AES_ECB_DEC_192 aes_ecb_dec_192_avx -#define AES_ECB_DEC_256 aes_ecb_dec_256_avx +#define AES_ECB_ENC_128 aes_ecb_enc_128_avx +#define AES_ECB_ENC_192 aes_ecb_enc_192_avx +#define AES_ECB_ENC_256 aes_ecb_enc_256_avx +#define AES_ECB_DEC_128 aes_ecb_dec_128_avx +#define AES_ECB_DEC_192 aes_ecb_dec_192_avx +#define AES_ECB_DEC_256 aes_ecb_dec_256_avx /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_avx -#define AES_CTR_192 aes_cntr_192_avx -#define AES_CTR_256 aes_cntr_256_avx -#define AES_CTR_128_BIT aes_cntr_bit_128_avx -#define AES_CTR_192_BIT aes_cntr_bit_192_avx -#define AES_CTR_256_BIT aes_cntr_bit_256_avx +#define AES_CTR_128 aes_cntr_128_avx +#define AES_CTR_192 aes_cntr_192_avx +#define AES_CTR_256 aes_cntr_256_avx +#define AES_CTR_128_BIT aes_cntr_bit_128_avx +#define AES_CTR_192_BIT aes_cntr_bit_192_avx +#define AES_CTR_256_BIT aes_cntr_bit_256_avx /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_avx -#define AES_CFB_256_ONE aes_cfb_256_one_avx +#define AES_CFB_128_ONE aes_cfb_128_one_avx +#define AES_CFB_256_ONE aes_cfb_256_one_avx /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_avx @@ -172,47 +172,47 @@ /* SHA1/224/256/384/512 */ #define SUBMIT_JOB_SHA1 submit_job_sha1_avx #define FLUSH_JOB_SHA1 flush_job_sha1_avx -#define SUBMIT_JOB_SHA224 submit_job_sha224_avx -#define FLUSH_JOB_SHA224 flush_job_sha224_avx -#define SUBMIT_JOB_SHA256 submit_job_sha256_avx -#define FLUSH_JOB_SHA256 flush_job_sha256_avx -#define SUBMIT_JOB_SHA384 submit_job_sha384_avx -#define FLUSH_JOB_SHA384 flush_job_sha384_avx -#define SUBMIT_JOB_SHA512 submit_job_sha512_avx -#define FLUSH_JOB_SHA512 flush_job_sha512_avx +#define SUBMIT_JOB_SHA224 submit_job_sha224_avx +#define FLUSH_JOB_SHA224 flush_job_sha224_avx +#define SUBMIT_JOB_SHA256 submit_job_sha256_avx +#define FLUSH_JOB_SHA256 flush_job_sha256_avx +#define SUBMIT_JOB_SHA384 submit_job_sha384_avx +#define FLUSH_JOB_SHA384 flush_job_sha384_avx +#define SUBMIT_JOB_SHA512 submit_job_sha512_avx +#define FLUSH_JOB_SHA512 flush_job_sha512_avx /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_avx -#define FLUSH_JOB_HMAC flush_job_hmac_avx -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx +#define SUBMIT_JOB_HMAC submit_job_hmac_avx +#define FLUSH_JOB_HMAC flush_job_hmac_avx +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_avx +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_avx +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_avx +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_avx +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx /* CHACHA20 & POLY1305 */ -#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx -#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_avx +#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx +#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_avx #define SUBMIT_JOB_CHACHA20_POLY1305_SGL aead_chacha20_poly1305_sgl_avx -#define POLY1305_MAC poly1305_mac_scalar +#define POLY1305_MAC poly1305_mac_scalar /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_avx -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_avx -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_avx -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_avx -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_avx -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_avx -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_avx -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_avx +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_avx +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_avx +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_avx +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_avx +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_avx +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_avx +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_avx +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_avx /* SNOW-V */ -#define SUBMIT_JOB_SNOW_V snow_v_avx +#define SUBMIT_JOB_SNOW_V snow_v_avx #define SUBMIT_JOB_SNOW_V_AEAD snow_v_aead_init_avx /* SNOW3G UE2 & UIA2 */ @@ -221,8 +221,7 @@ submit_snow3g_uea2_job_avx_t1(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -245,7 +244,8 @@ flush_snow3g_uea2_job_avx_t1(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 8); @@ -270,20 +270,16 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX_NUM_SHA1_LANES); /* Init HMAC/SHA224 out-of-order fields */ - ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, - AVX_NUM_SHA256_LANES); + ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, AVX_NUM_SHA256_LANES); /* Init HMAC/SHA256 out-of-order fields */ - ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, - AVX_NUM_SHA256_LANES); + ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, AVX_NUM_SHA256_LANES); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - AVX_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, AVX_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - AVX_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, AVX_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, AVX_NUM_MD5_LANES); @@ -345,90 +341,90 @@ init_mb_mgr_avx_t1_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_avx; - state->keyexp_192 = aes_keyexp_192_avx; - state->keyexp_256 = aes_keyexp_256_avx; + state->keyexp_128 = aes_keyexp_128_avx; + state->keyexp_192 = aes_keyexp_192_avx; + state->keyexp_256 = aes_keyexp_256_avx; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_avx; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_avx; - state->xcbc_keyexp = aes_xcbc_expand_key_avx; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_avx; - state->sha1 = sha1_avx; - state->sha224_one_block = sha224_one_block_avx; - state->sha224 = sha224_avx; - state->sha256_one_block = sha256_one_block_avx; - state->sha256 = sha256_avx; - state->sha384_one_block = sha384_one_block_avx; - state->sha384 = sha384_avx; - state->sha512_one_block = sha512_one_block_avx; - state->sha512 = sha512_avx; - state->md5_one_block = md5_one_block_avx; - - state->aes128_cfb_one = aes_cfb_128_one_avx; - state->aes256_cfb_one = aes_cfb_256_one_avx; - - state->eea3_1_buffer = zuc_eea3_1_buffer_avx; - state->eea3_4_buffer = zuc_eea3_4_buffer_avx; - state->eea3_n_buffer = zuc_eea3_n_buffer_avx; - state->eia3_1_buffer = zuc_eia3_1_buffer_avx; - state->eia3_n_buffer = zuc_eia3_n_buffer_avx; - - state->f8_1_buffer = kasumi_f8_1_buffer_avx; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; - state->f8_2_buffer = kasumi_f8_2_buffer_avx; - state->f8_3_buffer = kasumi_f8_3_buffer_avx; - state->f8_4_buffer = kasumi_f8_4_buffer_avx; - state->f8_n_buffer = kasumi_f8_n_buffer_avx; - state->f9_1_buffer = kasumi_f9_1_buffer_avx; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; + state->xcbc_keyexp = aes_xcbc_expand_key_avx; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_avx; + state->sha1 = sha1_avx; + state->sha224_one_block = sha224_one_block_avx; + state->sha224 = sha224_avx; + state->sha256_one_block = sha256_one_block_avx; + state->sha256 = sha256_avx; + state->sha384_one_block = sha384_one_block_avx; + state->sha384 = sha384_avx; + state->sha512_one_block = sha512_one_block_avx; + state->sha512 = sha512_avx; + state->md5_one_block = md5_one_block_avx; + + state->aes128_cfb_one = aes_cfb_128_one_avx; + state->aes256_cfb_one = aes_cfb_256_one_avx; + + state->eea3_1_buffer = zuc_eea3_1_buffer_avx; + state->eea3_4_buffer = zuc_eea3_4_buffer_avx; + state->eea3_n_buffer = zuc_eea3_n_buffer_avx; + state->eia3_1_buffer = zuc_eia3_1_buffer_avx; + state->eia3_n_buffer = zuc_eia3_n_buffer_avx; + + state->f8_1_buffer = kasumi_f8_1_buffer_avx; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; + state->f8_2_buffer = kasumi_f8_2_buffer_avx; + state->f8_3_buffer = kasumi_f8_3_buffer_avx; + state->f8_4_buffer = kasumi_f8_4_buffer_avx; + state->f8_n_buffer = kasumi_f8_n_buffer_avx; + state->f9_1_buffer = kasumi_f9_1_buffer_avx; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_avx; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_avx; state->kasumi_key_sched_size = kasumi_key_sched_size_avx; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_avx; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_avx; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_avx; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_avx; state->snow3g_init_key_sched = snow3g_init_key_sched_avx; state->snow3g_key_sched_size = snow3g_key_sched_size_avx; - state->hec_32 = hec_32_avx; - state->hec_64 = hec_64_avx; - - state->crc32_ethernet_fcs = ethernet_fcs_avx; - state->crc16_x25 = crc16_x25_avx; - state->crc32_sctp = crc32_sctp_avx; - state->crc24_lte_a = crc24_lte_a_avx; - state->crc24_lte_b = crc24_lte_b_avx; - state->crc16_fp_data = crc16_fp_data_avx; - state->crc11_fp_header = crc11_fp_header_avx; - state->crc7_fp_header = crc7_fp_header_avx; - state->crc10_iuup_data = crc10_iuup_data_avx; - state->crc6_iuup_header = crc6_iuup_header_avx; + state->hec_32 = hec_32_avx; + state->hec_64 = hec_64_avx; + + state->crc32_ethernet_fcs = ethernet_fcs_avx; + state->crc16_x25 = crc16_x25_avx; + state->crc32_sctp = crc32_sctp_avx; + state->crc24_lte_a = crc24_lte_a_avx; + state->crc24_lte_b = crc24_lte_b_avx; + state->crc16_fp_data = crc16_fp_data_avx; + state->crc11_fp_header = crc11_fp_header_avx; + state->crc7_fp_header = crc7_fp_header_avx; + state->crc10_iuup_data = crc10_iuup_data_avx; + state->crc6_iuup_header = crc6_iuup_header_avx; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_avx; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_avx; @@ -437,55 +433,55 @@ init_mb_mgr_avx_t1_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_avx; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_avx; - state->gcm128_enc = aes_gcm_enc_128_sse; - state->gcm192_enc = aes_gcm_enc_192_sse; - state->gcm256_enc = aes_gcm_enc_256_sse; - state->gcm128_dec = aes_gcm_dec_128_sse; - state->gcm192_dec = aes_gcm_dec_192_sse; - state->gcm256_dec = aes_gcm_dec_256_sse; - state->gcm128_init = aes_gcm_init_128_sse; - state->gcm192_init = aes_gcm_init_192_sse; - state->gcm256_init = aes_gcm_init_256_sse; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; - state->gcm128_enc_update = aes_gcm_enc_128_update_sse; - state->gcm192_enc_update = aes_gcm_enc_192_update_sse; - state->gcm256_enc_update = aes_gcm_enc_256_update_sse; - state->gcm128_dec_update = aes_gcm_dec_128_update_sse; - state->gcm192_dec_update = aes_gcm_dec_192_update_sse; - state->gcm256_dec_update = aes_gcm_dec_256_update_sse; + state->gcm128_enc = aes_gcm_enc_128_sse; + state->gcm192_enc = aes_gcm_enc_192_sse; + state->gcm256_enc = aes_gcm_enc_256_sse; + state->gcm128_dec = aes_gcm_dec_128_sse; + state->gcm192_dec = aes_gcm_dec_192_sse; + state->gcm256_dec = aes_gcm_dec_256_sse; + state->gcm128_init = aes_gcm_init_128_sse; + state->gcm192_init = aes_gcm_init_192_sse; + state->gcm256_init = aes_gcm_init_256_sse; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; + state->gcm128_enc_update = aes_gcm_enc_128_update_sse; + state->gcm192_enc_update = aes_gcm_enc_192_update_sse; + state->gcm256_enc_update = aes_gcm_enc_256_update_sse; + state->gcm128_dec_update = aes_gcm_dec_128_update_sse; + state->gcm192_dec_update = aes_gcm_dec_192_update_sse; + state->gcm256_dec_update = aes_gcm_dec_256_update_sse; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_sse; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_sse; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_sse; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_sse; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_sse; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_sse; - state->gcm128_precomp = aes_gcm_precomp_128_sse; - state->gcm192_precomp = aes_gcm_precomp_192_sse; - state->gcm256_precomp = aes_gcm_precomp_256_sse; - state->gcm128_pre = aes_gcm_pre_128_sse; - state->gcm192_pre = aes_gcm_pre_192_sse; - state->gcm256_pre = aes_gcm_pre_256_sse; - - state->ghash = ghash_sse; - state->ghash_pre = ghash_pre_sse; - - state->gmac128_init = imb_aes_gmac_init_128_sse; - state->gmac192_init = imb_aes_gmac_init_192_sse; - state->gmac256_init = imb_aes_gmac_init_256_sse; - state->gmac128_update = imb_aes_gmac_update_128_sse; - state->gmac192_update = imb_aes_gmac_update_192_sse; - state->gmac256_update = imb_aes_gmac_update_256_sse; - state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; - state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; - state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + state->gcm128_precomp = aes_gcm_precomp_128_sse; + state->gcm192_precomp = aes_gcm_precomp_192_sse; + state->gcm256_precomp = aes_gcm_precomp_256_sse; + state->gcm128_pre = aes_gcm_pre_128_sse; + state->gcm192_pre = aes_gcm_pre_192_sse; + state->gcm256_pre = aes_gcm_pre_256_sse; + + state->ghash = ghash_sse; + state->ghash_pre = ghash_pre_sse; + + state->gmac128_init = imb_aes_gmac_init_128_sse; + state->gmac192_init = imb_aes_gmac_init_192_sse; + state->gmac256_init = imb_aes_gmac_init_256_sse; + state->gmac128_update = imb_aes_gmac_update_128_sse; + state->gmac192_update = imb_aes_gmac_update_192_sse; + state->gmac256_update = imb_aes_gmac_update_256_sse; + state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; + state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; + state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx_t1/sha_avx.c b/lib/avx_t1/sha_avx.c index b0c7845e..1b1426a4 100644 --- a/lib/avx_t1/sha_avx.c +++ b/lib/avx_t1/sha_avx.c @@ -31,7 +31,8 @@ /* ========================================================================== */ /* One block SHA1 computation for IPAD / OPAD usage only */ -void sha1_one_block_avx(const void *data, void *digest) +void +sha1_one_block_avx(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 1 /* SHA1 */); } @@ -41,16 +42,17 @@ void sha1_one_block_avx(const void *data, void *digest) * SHA1 API for use in HMAC-SHA1 when key is longer than the block size */ -void sha1_avx(const void *data, const uint64_t length, void *digest) +void +sha1_avx(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 1, IMB_SHA1_BLOCK_SIZE, - SHA1_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE); } /* ========================================================================== */ /* One block SHA224 computation for IPAD / OPAD usage only */ -void sha224_one_block_avx(const void *data, void *digest) +void +sha224_one_block_avx(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 224 /* SHA224 */); } @@ -59,15 +61,16 @@ void sha224_one_block_avx(const void *data, void *digest) /* * SHA224 API for use in HMAC-SHA224 when key is longer than the block size */ -void sha224_avx(const void *data, const uint64_t length, void *digest) +void +sha224_avx(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 224, IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); } /* ========================================================================== */ /* One block SHA256 computation for IPAD / OPAD usage only */ -void sha256_one_block_avx(const void *data, void *digest) +void +sha256_one_block_avx(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 256 /* SHA256 */); } @@ -76,15 +79,16 @@ void sha256_one_block_avx(const void *data, void *digest) /* * SHA256 API for use in HMAC-SHA256 when key is longer than the block size */ -void sha256_avx(const void *data, const uint64_t length, void *digest) +void +sha256_avx(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 256, IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); } /* ========================================================================== */ /* One block SHA384 computation for IPAD / OPAD usage only */ -void sha384_one_block_avx(const void *data, void *digest) +void +sha384_one_block_avx(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 384 /* SHA384 */); } @@ -93,15 +97,16 @@ void sha384_one_block_avx(const void *data, void *digest) /* * SHA384 API for use in HMAC-SHA384 when key is longer than the block size */ -void sha384_avx(const void *data, const uint64_t length, void *digest) +void +sha384_avx(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 384, - IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 384, IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); } /* ========================================================================== */ /* One block SHA512 computation for IPAD / OPAD usage only */ -void sha512_one_block_avx(const void *data, void *digest) +void +sha512_one_block_avx(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_AVX, 512 /* SHA512 */); } @@ -110,8 +115,8 @@ void sha512_one_block_avx(const void *data, void *digest) /* * SHA512 API for use in HMAC-SHA512 when key is longer than the block size */ -void sha512_avx(const void *data, const uint64_t length, void *digest) +void +sha512_avx(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_AVX, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); + sha_generic(data, length, digest, ARCH_AVX, 512, IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); } diff --git a/lib/avx_t1/sha_mb_avx.c b/lib/avx_t1/sha_mb_avx.c index b156999d..e452f132 100644 --- a/lib/avx_t1/sha_mb_avx.c +++ b/lib/avx_t1/sha_mb_avx.c @@ -28,11 +28,15 @@ #include "include/sha_mb_mgr.h" #include "include/arch_avx_type1.h" -IMB_JOB *submit_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); /* ========================================================================== */ /* @@ -40,19 +44,19 @@ IMB_JOB *flush_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha1_avx(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha1_avx(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 4, 1, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_mult_avx_from_c, 0); + return submit_flush_job_sha_1(state, job, 4, 1, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_mult_avx_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha1_avx(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha1_avx(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 4, 0, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_mult_avx_from_c, 0); + return submit_flush_job_sha_1(state, job, 4, 0, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_mult_avx_from_c, 0); } /* ========================================================================== */ @@ -61,19 +65,19 @@ IMB_JOB *flush_job_sha1_avx(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha224_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha224_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 1, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha_256_mult_avx_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 1, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha_256_mult_avx_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha224_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha224_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 0, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha_256_mult_avx_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 0, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha_256_mult_avx_from_c, 0); } /* ========================================================================== */ @@ -82,19 +86,19 @@ IMB_JOB *flush_job_sha224_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha256_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha256_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 1, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha_256_mult_avx_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 1, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha_256_mult_avx_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha256_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha256_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 0, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha_256_mult_avx_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 0, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha_256_mult_avx_from_c, 0); } /* ========================================================================== */ @@ -103,19 +107,19 @@ IMB_JOB *flush_job_sha256_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 1, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x2_avx_from_c); + return submit_flush_job_sha_512(state, job, 2, 1, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x2_avx_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 0, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x2_avx_from_c); + return submit_flush_job_sha_512(state, job, 2, 0, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x2_avx_from_c); } /* ========================================================================== */ @@ -124,17 +128,17 @@ IMB_JOB *flush_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 1, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x2_avx_from_c); + return submit_flush_job_sha_512(state, job, 2, 1, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x2_avx_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 0, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x2_avx_from_c); + return submit_flush_job_sha_512(state, job, 2, 0, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x2_avx_from_c); } diff --git a/lib/avx_t1/snow3g_avx.c b/lib/avx_t1/snow3g_avx.c index f1285b06..ebabd302 100644 --- a/lib/avx_t1/snow3g_avx.c +++ b/lib/avx_t1/snow3g_avx.c @@ -26,17 +26,17 @@ *******************************************************************************/ #define AVX -#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_avx -#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_avx -#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_avx -#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_avx -#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_avx -#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_avx +#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_avx +#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_avx +#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_avx +#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_avx +#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_avx +#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_avx #define SNOW3G_F8_8_BUFFER_MULTIKEY snow3g_f8_8_buffer_multikey_avx #define SNOW3G_F8_N_BUFFER_MULTIKEY snow3g_f8_n_buffer_multikey_avx -#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_avx -#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_avx -#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_avx -#define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_avx +#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_avx +#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_avx +#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_avx +#define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_avx #include "include/snow3g_common.h" diff --git a/lib/avx_t1/zuc_top_avx.c b/lib/avx_t1/zuc_top_avx.c index 33f833ad..22fdf4d7 100644 --- a/lib/avx_t1/zuc_top_avx.c +++ b/lib/avx_t1/zuc_top_avx.c @@ -26,12 +26,12 @@ *******************************************************************************/ /*----------------------------------------------------------------------- -* zuc_avx.c -*----------------------------------------------------------------------- -* An implementation of ZUC, the core algorithm for the -* 3GPP Confidentiality and Integrity algorithms. -* -*-----------------------------------------------------------------------*/ + * zuc_avx.c + *----------------------------------------------------------------------- + * An implementation of ZUC, the core algorithm for the + * 3GPP Confidentiality and Integrity algorithms. + * + *-----------------------------------------------------------------------*/ #include @@ -46,15 +46,12 @@ #define RESTORE_XMMS restore_xmms_avx #define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_avx -#define NUM_AVX_BUFS 4 +#define NUM_AVX_BUFS 4 #define KEYSTR_ROUND_LEN 16 -static inline -void _zuc_eea3_1_buffer_avx(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +static inline void +_zuc_eea3_1_buffer_avx(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t length) { DECLARE_ALIGNED(ZucState_t zucState, 16); DECLARE_ALIGNED(uint8_t keyStream[KEYSTR_ROUND_LEN], 16); @@ -62,7 +59,7 @@ void _zuc_eea3_1_buffer_avx(const void *pKey, uint64_t *pOut64 = NULL, *pKeyStream64 = NULL; uint64_t *pTemp64 = NULL, *pdstTemp64 = NULL; - uint32_t numKeyStreamsPerPkt = length/ KEYSTR_ROUND_LEN; + uint32_t numKeyStreamsPerPkt = length / KEYSTR_ROUND_LEN; const uint32_t numBytesLeftOver = length % KEYSTR_ROUND_LEN; /* initialize the zuc state */ @@ -75,8 +72,7 @@ void _zuc_eea3_1_buffer_avx(const void *pKey, while (numKeyStreamsPerPkt--) { /* Generate the key stream 16 bytes at a time */ - asm_ZucGenKeystream16B_avx((uint32_t *) &keyStream[0], - &zucState); + asm_ZucGenKeystream16B_avx((uint32_t *) &keyStream[0], &zucState); /* XOR The Keystream generated with the input buffer here */ pKeyStream64 = (uint64_t *) keyStream; @@ -94,23 +90,19 @@ void _zuc_eea3_1_buffer_avx(const void *pKey, uint8_t *pOut8 = (uint8_t *) pBufferOut; const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_avx((uint32_t *) &keyStream[0], - &zucState, num4BRounds); + asm_ZucGenKeystream_avx((uint32_t *) &keyStream[0], &zucState, num4BRounds); /* copy the remaining bytes into temporary buffer and XOR with * the 16-bytes of keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], - numBytesLeftOver); + memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStream[0]; pTemp64 = (uint64_t *) &tempSrc[0]; pdstTemp64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream16B_avx(pTemp64, pdstTemp64, - pKeyStream64); - memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], - numBytesLeftOver); + asm_XorKeyStream16B_avx(pTemp64, pdstTemp64, pKeyStream64); + memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); @@ -125,42 +117,39 @@ void _zuc_eea3_1_buffer_avx(const void *pKey, } IMB_DLL_LOCAL -void _zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], - const void * const pIv[NUM_AVX_BUFS], - const void * const pBufferIn[NUM_AVX_BUFS], - void *pBufferOut[NUM_AVX_BUFS], - const uint32_t length[NUM_AVX_BUFS]) +void +_zuc_eea3_4_buffer_avx(const void *const pKey[NUM_AVX_BUFS], const void *const pIv[NUM_AVX_BUFS], + const void *const pBufferIn[NUM_AVX_BUFS], void *pBufferOut[NUM_AVX_BUFS], + const uint32_t length[NUM_AVX_BUFS]) { DECLARE_ALIGNED(ZucState4_t state, 16); DECLARE_ALIGNED(ZucState_t singlePktState, 16); unsigned int i; /* Calculate the minimum input packet size */ - uint32_t bytes1 = (length[0] < length[1] ? - length[0] : length[1]); - uint32_t bytes2 = (length[2] < length[3] ? - length[2] : length[3]); + uint32_t bytes1 = (length[0] < length[1] ? length[0] : length[1]); + uint32_t bytes2 = (length[2] < length[3] ? length[2] : length[3]); /* min number of bytes */ uint32_t bytes = (bytes1 < bytes2) ? bytes1 : bytes2; - DECLARE_ALIGNED(uint16_t remainBytes[NUM_AVX_BUFS], 16) = {0}; + DECLARE_ALIGNED(uint16_t remainBytes[NUM_AVX_BUFS], 16) = { 0 }; DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX_BUFS][KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); /* structure to store the 4 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_AVX_BUFS*32], 16); + DECLARE_ALIGNED(uint8_t ivs[NUM_AVX_BUFS * 32], 16); const uint8_t *pTempBufInPtr = NULL; uint8_t *pTempBufOutPtr = NULL; - DECLARE_ALIGNED(const uint64_t *pIn64[NUM_AVX_BUFS], 16) = {NULL}; - DECLARE_ALIGNED(uint64_t *pOut64[NUM_AVX_BUFS], 16) = {NULL}; + DECLARE_ALIGNED(const uint64_t *pIn64[NUM_AVX_BUFS], 16) = { NULL }; + DECLARE_ALIGNED(uint64_t * pOut64[NUM_AVX_BUFS], 16) = { NULL }; uint64_t *pKeyStream64 = NULL; /* * Calculate the number of bytes left over for each packet, * and setup the Keys and IVs */ - for (i = 0; i< NUM_AVX_BUFS; i++) { + for (i = 0; i < NUM_AVX_BUFS; i++) { remainBytes[i] = length[i]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } asm_ZucInitialization_4_avx(&keys, ivs, &state); @@ -171,8 +160,7 @@ void _zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], } /* Encrypt common length of all buffers */ - asm_ZucCipher_4_avx(&state, pIn64, pOut64, remainBytes, - (uint16_t) bytes); + asm_ZucCipher_4_avx(&state, pIn64, pOut64, remainBytes, (uint16_t) bytes); /* process each packet separately for the remaining bytes */ for (i = 0; i < NUM_AVX_BUFS; i++) { @@ -198,29 +186,22 @@ void _zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], singlePktState.fR1 = state.fR1[i]; singlePktState.fR2 = state.fR2[i]; - uint32_t numKeyStreamsPerPkt = - remainBytes[i] / KEYSTR_ROUND_LEN; - const uint32_t numBytesLeftOver = - remainBytes[i] % KEYSTR_ROUND_LEN; + uint32_t numKeyStreamsPerPkt = remainBytes[i] / KEYSTR_ROUND_LEN; + const uint32_t numBytesLeftOver = remainBytes[i] % KEYSTR_ROUND_LEN; pTempBufInPtr = pBufferIn[i]; pTempBufOutPtr = pBufferOut[i]; /* update the output and input pointers here to point * to the i'th buffers */ - pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - - remainBytes[i]]; - pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - - remainBytes[i]]; + pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - remainBytes[i]]; + pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - remainBytes[i]]; while (numKeyStreamsPerPkt--) { /* Generate the key stream 16 bytes at a time */ - asm_ZucGenKeystream16B_avx( - (uint32_t *) keyStr[0], - &singlePktState); + asm_ZucGenKeystream16B_avx((uint32_t *) keyStr[0], &singlePktState); pKeyStream64 = (uint64_t *) keyStr[0]; - asm_XorKeyStream16B_avx(pIn64[0], pOut64[0], - pKeyStream64); + asm_XorKeyStream16B_avx(pIn64[0], pOut64[0], pKeyStream64); pIn64[0] += 2; pOut64[0] += 2; } @@ -232,29 +213,23 @@ void _zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], uint64_t *pTempSrc64; uint64_t *pTempDst64; uint32_t offset = length[i] - numBytesLeftOver; - const uint64_t num4BRounds = - ((numBytesLeftOver - 1) / 4) + 1; + const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_avx((uint32_t *)&keyStr[0], - &singlePktState, + asm_ZucGenKeystream_avx((uint32_t *) &keyStr[0], &singlePktState, num4BRounds); /* copy the remaining bytes into temporary * buffer and XOR with the 16 bytes of * keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pTempBufInPtr[offset], - numBytesLeftOver); - memset(&tempSrc[numBytesLeftOver], 0, - 16 - numBytesLeftOver); + memcpy(&tempSrc[0], &pTempBufInPtr[offset], numBytesLeftOver); + memset(&tempSrc[numBytesLeftOver], 0, 16 - numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStr[0][0]; pTempSrc64 = (uint64_t *) &tempSrc[0]; pTempDst64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream16B_avx(pTempSrc64, pTempDst64, - pKeyStream64); + asm_XorKeyStream16B_avx(pTempSrc64, pTempDst64, pKeyStream64); - memcpy(&pTempBufOutPtr[offset], - &tempDst[0], numBytesLeftOver); + memcpy(&pTempBufOutPtr[offset], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); clear_mem(tempDst, sizeof(tempDst)); @@ -271,11 +246,9 @@ void _zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], #endif } -void zuc_eea3_1_buffer_avx(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +void +zuc_eea3_1_buffer_avx(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t length) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -306,8 +279,7 @@ void zuc_eea3_1_buffer_avx(const void *pKey, } /* Check input data is in range of supported length */ - if (length < ZUC_MIN_BYTELEN || - length > ZUC_MAX_BYTELEN) { + if (length < ZUC_MIN_BYTELEN || length > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -324,11 +296,10 @@ void zuc_eea3_1_buffer_avx(const void *pKey, #endif } -void zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], - const void * const pIv[NUM_AVX_BUFS], - const void * const pBufferIn[NUM_AVX_BUFS], - void *pBufferOut[NUM_AVX_BUFS], - const uint32_t length[NUM_AVX_BUFS]) +void +zuc_eea3_4_buffer_avx(const void *const pKey[NUM_AVX_BUFS], const void *const pIv[NUM_AVX_BUFS], + const void *const pBufferIn[NUM_AVX_BUFS], void *pBufferOut[NUM_AVX_BUFS], + const uint32_t length[NUM_AVX_BUFS]) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -389,8 +360,7 @@ void zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -409,10 +379,10 @@ void zuc_eea3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], #endif } -void zuc_eea3_n_buffer_avx(const void * const pKey[], const void * const pIv[], - const void * const pBufferIn[], void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers) +void +zuc_eea3_n_buffer_avx(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t length[], + const uint32_t numBuffers) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -475,8 +445,7 @@ void zuc_eea3_n_buffer_avx(const void * const pKey[], const void * const pIv[], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -484,22 +453,15 @@ void zuc_eea3_n_buffer_avx(const void * const pKey[], const void * const pIv[], #endif i = 0; - while(packetCount >= 4) { - packetCount -=4; - _zuc_eea3_4_buffer_avx(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], + while (packetCount >= 4) { + packetCount -= 4; + _zuc_eea3_4_buffer_avx(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], &length[i]); - i+=4; + i += 4; } - while(packetCount--) { - _zuc_eea3_1_buffer_avx(pKey[i], - pIv[i], - pBufferIn[i], - pBufferOut[i], - length[i]); + while (packetCount--) { + _zuc_eea3_1_buffer_avx(pKey[i], pIv[i], pBufferIn[i], pBufferOut[i], length[i]); i++; } #ifdef SAFE_DATA @@ -512,12 +474,9 @@ void zuc_eea3_n_buffer_avx(const void * const pKey[], const void * const pIv[], #endif } -static inline -void _zuc_eia3_1_buffer_avx(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +static inline void +_zuc_eia3_1_buffer_avx(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { DECLARE_ALIGNED(ZucState_t zucState, 64); DECLARE_ALIGNED(uint32_t keyStream[4 * 2], 64); @@ -535,7 +494,7 @@ void _zuc_eia3_1_buffer_avx(const void *pKey, /* loop over the message bits */ while (remainingBits >= keyStreamLengthInBits) { - remainingBits -= keyStreamLengthInBits; + remainingBits -= keyStreamLengthInBits; /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainingBits) @@ -564,43 +523,41 @@ void _zuc_eia3_1_buffer_avx(const void *pKey, } IMB_DLL_LOCAL -void _zuc_eia3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], - const void * const pIv[NUM_AVX_BUFS], - const void * const pBufferIn[NUM_AVX_BUFS], - const uint32_t lengthInBits[NUM_AVX_BUFS], - uint32_t *pMacI[NUM_AVX_BUFS]) +void +_zuc_eia3_4_buffer_avx(const void *const pKey[NUM_AVX_BUFS], const void *const pIv[NUM_AVX_BUFS], + const void *const pBufferIn[NUM_AVX_BUFS], + const uint32_t lengthInBits[NUM_AVX_BUFS], uint32_t *pMacI[NUM_AVX_BUFS]) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); /* structure to store the 4 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_AVX_BUFS*32], 16); - const uint8_t *pIn8[NUM_AVX_BUFS] = {NULL}; + DECLARE_ALIGNED(uint8_t ivs[NUM_AVX_BUFS * 32], 16); + const uint8_t *pIn8[NUM_AVX_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t numKeyStr = 0; uint32_t T[NUM_AVX_BUFS]; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_AVX_BUFS], 16) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_AVX_BUFS], 16) = { NULL }; unsigned int allCommonBits; memset(keyStr, 0, sizeof(keyStr)); memset(T, 0, sizeof(T)); /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -610,7 +567,7 @@ void _zuc_eia3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], pIn8[i] = (const uint8_t *) pBufferIn[i]; pKeyStrArr[i] = (uint32_t *) &keyStr[i][0]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } asm_ZucInitialization_4_avx(&keys, ivs, &state); @@ -639,14 +596,13 @@ void _zuc_eia3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_AVX_BUFS; i++) { - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; /* If remaining bits are more than 8 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (2*32)) { + if (remainBits > (2 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -673,11 +629,9 @@ void _zuc_eia3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_avx(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[4], &singlePktState); else - asm_ZucGenKeystream16B_avx(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream16B_avx(&keyStr32[4], &singlePktState); asm_Eia3Round16B_avx(&T[i], keyStr32, pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } @@ -688,11 +642,9 @@ void _zuc_eia3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], */ if (remainBits > (2 * 32)) - asm_ZucGenKeystream8B_avx(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[4], &singlePktState); - asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, - 128, 4); + asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, 128, 4); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; } @@ -706,11 +658,9 @@ void _zuc_eia3_4_buffer_avx(const void * const pKey[NUM_AVX_BUFS], #endif } -void zuc_eia3_1_buffer_avx(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +void +zuc_eia3_1_buffer_avx(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -758,41 +708,39 @@ void zuc_eia3_1_buffer_avx(const void *pKey, #endif } -void zuc_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_AVX_BUFS], - uint32_t *pMacI[NUM_AVX_BUFS], - const uint16_t lengthInBits[NUM_AVX_BUFS], - const void * const job_in_lane[NUM_AVX_BUFS]) +void +zuc_eia3_4_buffer_job_avx(const void *const pKey[NUM_AVX_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_AVX_BUFS], uint32_t *pMacI[NUM_AVX_BUFS], + const uint16_t lengthInBits[NUM_AVX_BUFS], + const void *const job_in_lane[NUM_AVX_BUFS]) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); - const uint8_t *pIn8[NUM_AVX_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_AVX_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t numKeyStr = 0; - uint32_t T[NUM_AVX_BUFS] = {0}; + uint32_t T[NUM_AVX_BUFS] = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_AVX_BUFS], 16) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_AVX_BUFS], 16) = { NULL }; unsigned int allCommonBits; memset(keyStr, 0, sizeof(keyStr)); /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -835,14 +783,13 @@ void zuc_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], if (job_in_lane[i] == NULL) continue; - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; /* If remaining bits are more than 8 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (2*32)) { + if (remainBits > (2 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -869,11 +816,9 @@ void zuc_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_avx(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[4], &singlePktState); else - asm_ZucGenKeystream16B_avx(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream16B_avx(&keyStr32[4], &singlePktState); asm_Eia3Round16B_avx(&T[i], keyStr32, pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } @@ -883,11 +828,9 @@ void zuc_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], * keystream needs to have up to another 2 ZUC WORDS (8B) */ if (remainBits > (2 * 32)) - asm_ZucGenKeystream8B_avx(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_avx(&keyStr32[4], &singlePktState); - asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, - 128, 4); + asm_Eia3Remainder_avx(&T[i], keyStr32, pIn8[i], remainBits, 128, 4); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; } @@ -901,42 +844,39 @@ void zuc_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], #endif } -void zuc256_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_AVX_BUFS], - void *pMacI[NUM_AVX_BUFS], - const uint16_t lengthInBits[NUM_AVX_BUFS], - const void * const job_in_lane[NUM_AVX_BUFS], - const uint64_t tag_size) +void +zuc256_eia3_4_buffer_job_avx(const void *const pKey[NUM_AVX_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_AVX_BUFS], void *pMacI[NUM_AVX_BUFS], + const uint16_t lengthInBits[NUM_AVX_BUFS], + const void *const job_in_lane[NUM_AVX_BUFS], const uint64_t tag_size) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_AVX_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); - const uint8_t *pIn8[NUM_AVX_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_AVX_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t numKeyStr = 0; - DECLARE_ALIGNED(uint8_t T[NUM_AVX_BUFS*16], 16) = {0}; + DECLARE_ALIGNED(uint8_t T[NUM_AVX_BUFS * 16], 16) = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_AVX_BUFS], 16) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_AVX_BUFS], 16) = { NULL }; unsigned int allCommonBits; memset(keyStr, 0, sizeof(keyStr)); /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - const uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - const uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + const uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + const uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -968,12 +908,11 @@ void zuc256_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], else if (tag_size == 8) asm_ZucGenKeystream8B_4_avx(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_avx(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_avx(&state, pKeyStrArr); } else asm_ZucGenKeystream16B_4_avx(&state, pKeyStrArr); for (i = 0; i < NUM_AVX_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; @@ -985,13 +924,12 @@ void zuc256_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_AVX_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; const uint32_t N = remainBits + ((uint32_t) tag_size << 3); uint32_t L = ((N + 31) / ZUC_WORD_BITS); @@ -1028,12 +966,10 @@ void zuc256_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], /* Generate the next key stream (16 bytes max) */ if (L > 3) { - asm_ZucGenKeystream16B_avx(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream16B_avx(&keyStr32[4], &singlePktState); L -= 4; } else { - asm_ZucGenKeystream_avx(&keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_avx(&keyStr32[4], &singlePktState, L); L = 0; } asm_Eia3Round16B_avx(tag, keyStr32, pIn8[i], tag_size); @@ -1042,11 +978,9 @@ void zuc256_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], /* Generate final keystream if needed */ if (L > 0) - asm_ZucGenKeystream_avx(&keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_avx(&keyStr32[4], &singlePktState, L); - asm_Eia3Remainder_avx(tag, keyStr32, pIn8[i], remainBits, - 256, tag_size); + asm_Eia3Remainder_avx(tag, keyStr32, pIn8[i], remainBits, 256, tag_size); /* save the final MAC-I result */ memcpy(pMacI[i], tag, tag_size); } @@ -1060,12 +994,10 @@ void zuc256_eia3_4_buffer_job_avx(const void * const pKey[NUM_AVX_BUFS], #endif } -void zuc_eia3_n_buffer_avx(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers) +void +zuc_eia3_n_buffer_avx(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -1128,8 +1060,7 @@ void zuc_eia3_n_buffer_avx(const void * const pKey[], } /* Check input data is in range of supported length */ - if (lengthInBits[i] < ZUC_MIN_BITLEN || - lengthInBits[i] > ZUC_MAX_BITLEN) { + if (lengthInBits[i] < ZUC_MIN_BITLEN || lengthInBits[i] > ZUC_MAX_BITLEN) { imb_set_errno(NULL, IMB_ERR_AUTH_LEN); return; } @@ -1137,22 +1068,15 @@ void zuc_eia3_n_buffer_avx(const void * const pKey[], #endif i = 0; - while(packetCount >= 4) { - packetCount -=4; - _zuc_eia3_4_buffer_avx(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], + while (packetCount >= 4) { + packetCount -= 4; + _zuc_eia3_4_buffer_avx(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], &pMacI[i]); - i+=4; + i += 4; } - while(packetCount--) { - _zuc_eia3_1_buffer_avx(pKey[i], - pIv[i], - pBufferIn[i], - lengthInBits[i], - pMacI[i]); + while (packetCount--) { + _zuc_eia3_1_buffer_avx(pKey[i], pIv[i], pBufferIn[i], lengthInBits[i], pMacI[i]); i++; } diff --git a/lib/avx_t2/mb_mgr_avx_t2.c b/lib/avx_t2/mb_mgr_avx_t2.c index d6037ee0..6abc7b73 100644 --- a/lib/avx_t2/mb_mgr_avx_t2.c +++ b/lib/avx_t2/mb_mgr_avx_t2.c @@ -53,29 +53,29 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms_avx -#define RESTORE_XMMS restore_xmms_avx +#define SAVE_XMMS save_xmms_avx +#define RESTORE_XMMS restore_xmms_avx /* JOB API */ -#define SUBMIT_JOB submit_job_avx_t2 -#define FLUSH_JOB flush_job_avx_t2 -#define QUEUE_SIZE queue_size_avx_t2 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx_t2 -#define GET_NEXT_JOB get_next_job_avx_t2 -#define GET_COMPLETED_JOB get_completed_job_avx_t2 -#define GET_NEXT_BURST get_next_burst_avx_t2 -#define SUBMIT_BURST submit_burst_avx_t2 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx_t2 -#define FLUSH_BURST flush_burst_avx_t2 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx_t2 +#define SUBMIT_JOB submit_job_avx_t2 +#define FLUSH_JOB flush_job_avx_t2 +#define QUEUE_SIZE queue_size_avx_t2 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_avx_t2 +#define GET_NEXT_JOB get_next_job_avx_t2 +#define GET_COMPLETED_JOB get_completed_job_avx_t2 +#define GET_NEXT_BURST get_next_burst_avx_t2 +#define SUBMIT_BURST submit_burst_avx_t2 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_avx_t2 +#define FLUSH_BURST flush_burst_avx_t2 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_avx_t2 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_avx_t2 -#define SUBMIT_HASH_BURST submit_hash_burst_avx_t2 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx_t2 -#define SET_SUITE_ID_FN set_suite_id_avx_t2 +#define SUBMIT_HASH_BURST submit_hash_burst_avx_t2 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_avx_t2 +#define SET_SUITE_ID_FN set_suite_id_avx_t2 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX_T2 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX_T2 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_AVX_T2 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_AVX_T2 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_AVX_T2 @@ -83,12 +83,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX_T2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 #define SUBMIT_JOB_AES_GCM_DEC submit_job_aes_gcm_dec_avx #define SUBMIT_JOB_AES_GCM_ENC submit_job_aes_gcm_enc_avx @@ -106,9 +106,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_avx #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_avx -#define AES_CBC_DEC_128 aes_cbc_dec_128_avx -#define AES_CBC_DEC_192 aes_cbc_dec_192_avx -#define AES_CBC_DEC_256 aes_cbc_dec_256_avx +#define AES_CBC_DEC_128 aes_cbc_dec_128_avx +#define AES_CBC_DEC_192 aes_cbc_dec_192_avx +#define AES_CBC_DEC_256 aes_cbc_dec_256_avx #define SUBMIT_JOB_AES128_DEC submit_job_aes128_dec_avx_t2 #define SUBMIT_JOB_AES192_DEC submit_job_aes192_dec_avx_t2 @@ -128,45 +128,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_avx_t2 #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_avx_t2 -#define AES_ECB_ENC_128 aes_ecb_enc_128_avx -#define AES_ECB_ENC_192 aes_ecb_enc_192_avx -#define AES_ECB_ENC_256 aes_ecb_enc_256_avx -#define AES_ECB_DEC_128 aes_ecb_dec_128_avx -#define AES_ECB_DEC_192 aes_ecb_dec_192_avx -#define AES_ECB_DEC_256 aes_ecb_dec_256_avx +#define AES_ECB_ENC_128 aes_ecb_enc_128_avx +#define AES_ECB_ENC_192 aes_ecb_enc_192_avx +#define AES_ECB_ENC_256 aes_ecb_enc_256_avx +#define AES_ECB_DEC_128 aes_ecb_dec_128_avx +#define AES_ECB_DEC_192 aes_ecb_dec_192_avx +#define AES_ECB_DEC_256 aes_ecb_dec_256_avx /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_avx -#define AES_CTR_192 aes_cntr_192_avx -#define AES_CTR_256 aes_cntr_256_avx -#define AES_CTR_128_BIT aes_cntr_bit_128_avx -#define AES_CTR_192_BIT aes_cntr_bit_192_avx -#define AES_CTR_256_BIT aes_cntr_bit_256_avx +#define AES_CTR_128 aes_cntr_128_avx +#define AES_CTR_192 aes_cntr_192_avx +#define AES_CTR_256 aes_cntr_256_avx +#define AES_CTR_128_BIT aes_cntr_bit_128_avx +#define AES_CTR_192_BIT aes_cntr_bit_192_avx +#define AES_CTR_256_BIT aes_cntr_bit_256_avx /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_avx +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_avx -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_avx +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_avx -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_avx +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_avx /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_avx +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_avx -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_avx +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_avx /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_avx -#define AES_CFB_256_ONE aes_cfb_256_one_avx +#define AES_CFB_128_ONE aes_cfb_128_one_avx +#define AES_CFB_256_ONE aes_cfb_256_one_avx /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_avx +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_avx /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_avx @@ -175,49 +175,49 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_avx /* SHA1/224/256/384/512 */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_ni_sse -#define FLUSH_JOB_SHA1 flush_job_sha1_ni_sse -#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse -#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse -#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse -#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse -#define SUBMIT_JOB_SHA384 submit_job_sha384_avx -#define FLUSH_JOB_SHA384 flush_job_sha384_avx -#define SUBMIT_JOB_SHA512 submit_job_sha512_avx -#define FLUSH_JOB_SHA512 flush_job_sha512_avx +#define SUBMIT_JOB_SHA1 submit_job_sha1_ni_sse +#define FLUSH_JOB_SHA1 flush_job_sha1_ni_sse +#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse +#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse +#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse +#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse +#define SUBMIT_JOB_SHA384 submit_job_sha384_avx +#define FLUSH_JOB_SHA384 flush_job_sha384_avx +#define SUBMIT_JOB_SHA512 submit_job_sha512_avx +#define FLUSH_JOB_SHA512 flush_job_sha512_avx /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_ni_sse -#define FLUSH_JOB_HMAC flush_job_hmac_ni_sse -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx +#define SUBMIT_JOB_HMAC submit_job_hmac_ni_sse +#define FLUSH_JOB_HMAC flush_job_hmac_ni_sse +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_avx +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_avx +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_avx +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_avx +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_avx +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_avx /* CHACHA20 & POLY1305 */ -#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx -#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_avx +#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_avx +#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_avx #define SUBMIT_JOB_CHACHA20_POLY1305_SGL aead_chacha20_poly1305_sgl_avx -#define POLY1305_MAC poly1305_mac_scalar +#define POLY1305_MAC poly1305_mac_scalar /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_avx -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_avx -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_avx -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_avx -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_avx -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_avx -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_avx -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_avx +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_avx +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_avx +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_avx +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_avx +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_avx +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_avx +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_avx +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_avx /* SNOW-V */ -#define SUBMIT_JOB_SNOW_V snow_v_avx +#define SUBMIT_JOB_SNOW_V snow_v_avx #define SUBMIT_JOB_SNOW_V_AEAD snow_v_aead_init_avx /* SNOW3G UE2 & UIA2 */ @@ -226,8 +226,7 @@ submit_snow3g_uea2_job_avx_t2(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -250,7 +249,8 @@ flush_snow3g_uea2_job_avx_t2(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 8); @@ -281,12 +281,10 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, 2); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - AVX_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, AVX_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - AVX_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, AVX_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, AVX_NUM_MD5_LANES); @@ -348,90 +346,90 @@ init_mb_mgr_avx_t2_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_avx; - state->keyexp_192 = aes_keyexp_192_avx; - state->keyexp_256 = aes_keyexp_256_avx; + state->keyexp_128 = aes_keyexp_128_avx; + state->keyexp_192 = aes_keyexp_192_avx; + state->keyexp_256 = aes_keyexp_256_avx; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_avx; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_avx; - state->xcbc_keyexp = aes_xcbc_expand_key_avx; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_sse_shani; - state->sha1 = sha1_sse_shani; - state->sha224_one_block = sha224_one_block_sse_shani; - state->sha224 = sha224_sse_shani; - state->sha256_one_block = sha256_one_block_sse_shani; - state->sha256 = sha256_sse_shani; - state->sha384_one_block = sha384_one_block_avx; - state->sha384 = sha384_avx; - state->sha512_one_block = sha512_one_block_avx; - state->sha512 = sha512_avx; - state->md5_one_block = md5_one_block_avx; - - state->aes128_cfb_one = aes_cfb_128_one_avx; - state->aes256_cfb_one = aes_cfb_256_one_avx; - - state->eea3_1_buffer = zuc_eea3_1_buffer_avx; - state->eea3_4_buffer = zuc_eea3_4_buffer_avx; - state->eea3_n_buffer = zuc_eea3_n_buffer_avx; - state->eia3_1_buffer = zuc_eia3_1_buffer_avx; - state->eia3_n_buffer = zuc_eia3_n_buffer_avx; - - state->f8_1_buffer = kasumi_f8_1_buffer_avx; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; - state->f8_2_buffer = kasumi_f8_2_buffer_avx; - state->f8_3_buffer = kasumi_f8_3_buffer_avx; - state->f8_4_buffer = kasumi_f8_4_buffer_avx; - state->f8_n_buffer = kasumi_f8_n_buffer_avx; - state->f9_1_buffer = kasumi_f9_1_buffer_avx; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; + state->xcbc_keyexp = aes_xcbc_expand_key_avx; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_sse_shani; + state->sha1 = sha1_sse_shani; + state->sha224_one_block = sha224_one_block_sse_shani; + state->sha224 = sha224_sse_shani; + state->sha256_one_block = sha256_one_block_sse_shani; + state->sha256 = sha256_sse_shani; + state->sha384_one_block = sha384_one_block_avx; + state->sha384 = sha384_avx; + state->sha512_one_block = sha512_one_block_avx; + state->sha512 = sha512_avx; + state->md5_one_block = md5_one_block_avx; + + state->aes128_cfb_one = aes_cfb_128_one_avx; + state->aes256_cfb_one = aes_cfb_256_one_avx; + + state->eea3_1_buffer = zuc_eea3_1_buffer_avx; + state->eea3_4_buffer = zuc_eea3_4_buffer_avx; + state->eea3_n_buffer = zuc_eea3_n_buffer_avx; + state->eia3_1_buffer = zuc_eia3_1_buffer_avx; + state->eia3_n_buffer = zuc_eia3_n_buffer_avx; + + state->f8_1_buffer = kasumi_f8_1_buffer_avx; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_avx; + state->f8_2_buffer = kasumi_f8_2_buffer_avx; + state->f8_3_buffer = kasumi_f8_3_buffer_avx; + state->f8_4_buffer = kasumi_f8_4_buffer_avx; + state->f8_n_buffer = kasumi_f8_n_buffer_avx; + state->f9_1_buffer = kasumi_f9_1_buffer_avx; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_avx; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_avx; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_avx; state->kasumi_key_sched_size = kasumi_key_sched_size_avx; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_avx; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_avx; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_avx; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_avx; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_avx; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_avx; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_avx; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_avx; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_avx; state->snow3g_init_key_sched = snow3g_init_key_sched_avx; state->snow3g_key_sched_size = snow3g_key_sched_size_avx; - state->hec_32 = hec_32_avx; - state->hec_64 = hec_64_avx; - - state->crc32_ethernet_fcs = ethernet_fcs_avx; - state->crc16_x25 = crc16_x25_avx; - state->crc32_sctp = crc32_sctp_avx; - state->crc24_lte_a = crc24_lte_a_avx; - state->crc24_lte_b = crc24_lte_b_avx; - state->crc16_fp_data = crc16_fp_data_avx; - state->crc11_fp_header = crc11_fp_header_avx; - state->crc7_fp_header = crc7_fp_header_avx; - state->crc10_iuup_data = crc10_iuup_data_avx; - state->crc6_iuup_header = crc6_iuup_header_avx; + state->hec_32 = hec_32_avx; + state->hec_64 = hec_64_avx; + + state->crc32_ethernet_fcs = ethernet_fcs_avx; + state->crc16_x25 = crc16_x25_avx; + state->crc32_sctp = crc32_sctp_avx; + state->crc24_lte_a = crc24_lte_a_avx; + state->crc24_lte_b = crc24_lte_b_avx; + state->crc16_fp_data = crc16_fp_data_avx; + state->crc11_fp_header = crc11_fp_header_avx; + state->crc7_fp_header = crc7_fp_header_avx; + state->crc10_iuup_data = crc10_iuup_data_avx; + state->crc6_iuup_header = crc6_iuup_header_avx; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_avx; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_avx; @@ -440,55 +438,55 @@ init_mb_mgr_avx_t2_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_avx; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_avx; - state->gcm128_enc = aes_gcm_enc_128_avx_gen4; - state->gcm192_enc = aes_gcm_enc_192_avx_gen4; - state->gcm256_enc = aes_gcm_enc_256_avx_gen4; - state->gcm128_dec = aes_gcm_dec_128_avx_gen4; - state->gcm192_dec = aes_gcm_dec_192_avx_gen4; - state->gcm256_dec = aes_gcm_dec_256_avx_gen4; - state->gcm128_init = aes_gcm_init_128_avx_gen4; - state->gcm192_init = aes_gcm_init_192_avx_gen4; - state->gcm256_init = aes_gcm_init_256_avx_gen4; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; - state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; - state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; - state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; - state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; - state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; - state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; + state->gcm128_enc = aes_gcm_enc_128_avx_gen4; + state->gcm192_enc = aes_gcm_enc_192_avx_gen4; + state->gcm256_enc = aes_gcm_enc_256_avx_gen4; + state->gcm128_dec = aes_gcm_dec_128_avx_gen4; + state->gcm192_dec = aes_gcm_dec_192_avx_gen4; + state->gcm256_dec = aes_gcm_dec_256_avx_gen4; + state->gcm128_init = aes_gcm_init_128_avx_gen4; + state->gcm192_init = aes_gcm_init_192_avx_gen4; + state->gcm256_init = aes_gcm_init_256_avx_gen4; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; + state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; + state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; + state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; + state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; + state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; + state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx_gen4; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx_gen4; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx_gen4; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx_gen4; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx_gen4; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx_gen4; - state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; - state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; - state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; - state->gcm128_pre = aes_gcm_pre_128_avx_gen4; - state->gcm192_pre = aes_gcm_pre_192_avx_gen4; - state->gcm256_pre = aes_gcm_pre_256_avx_gen4; - - state->ghash = ghash_avx_gen4; - state->ghash_pre = ghash_pre_avx_gen4; - - state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; - state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; - state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; - state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; - state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; - state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; - state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; - state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; - state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; + state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; + state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; + state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; + state->gcm128_pre = aes_gcm_pre_128_avx_gen4; + state->gcm192_pre = aes_gcm_pre_192_avx_gen4; + state->gcm256_pre = aes_gcm_pre_256_avx_gen4; + + state->ghash = ghash_avx_gen4; + state->ghash_pre = ghash_pre_avx_gen4; + + state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; + state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; + state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; + state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; + state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; + state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; + state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; + state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; + state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/include/aesni_emu.h b/lib/include/aesni_emu.h index 4c5ef3a0..7df6afa9 100644 --- a/lib/include/aesni_emu.h +++ b/lib/include/aesni_emu.h @@ -37,13 +37,13 @@ /* XMM type definitions and constants */ -#define MAX_BYTES_PER_XMM 16 -#define MAX_WORDS_PER_XMM 8 -#define MAX_DWORDS_PER_XMM 4 -#define MAX_QWORDS_PER_XMM 2 +#define MAX_BYTES_PER_XMM 16 +#define MAX_WORDS_PER_XMM 8 +#define MAX_DWORDS_PER_XMM 4 +#define MAX_QWORDS_PER_XMM 2 union xmm_reg { - uint8_t byte[MAX_BYTES_PER_XMM]; + uint8_t byte[MAX_BYTES_PER_XMM]; uint16_t word[MAX_WORDS_PER_XMM]; uint32_t dword[MAX_DWORDS_PER_XMM]; uint64_t qword[MAX_QWORDS_PER_XMM]; @@ -61,9 +61,8 @@ union xmm_reg { * @param src pointer to 128 bit src key * @param imm8 round constant used to generate key */ -IMB_DLL_LOCAL void emulate_AESKEYGENASSIST(union xmm_reg *dst, - const union xmm_reg *src, - const uint32_t imm8); +IMB_DLL_LOCAL void +emulate_AESKEYGENASSIST(union xmm_reg *dst, const union xmm_reg *src, const uint32_t imm8); /** * @brief AESENC instruction emulation function @@ -73,8 +72,8 @@ IMB_DLL_LOCAL void emulate_AESKEYGENASSIST(union xmm_reg *dst, * @param dst pointer to 128 bit data (state) to operate on * @param src pointer to 128 bit round key */ -IMB_DLL_LOCAL void emulate_AESENC(union xmm_reg *dst, - const union xmm_reg *src); +IMB_DLL_LOCAL void +emulate_AESENC(union xmm_reg *dst, const union xmm_reg *src); /** * @brief AESENCLAST instruction emulation function @@ -84,8 +83,8 @@ IMB_DLL_LOCAL void emulate_AESENC(union xmm_reg *dst, * @param dst pointer to 128 bit data (state) to operate on * @param src pointer to 128 bit round key */ -IMB_DLL_LOCAL void emulate_AESENCLAST(union xmm_reg *dst, - const union xmm_reg *src); +IMB_DLL_LOCAL void +emulate_AESENCLAST(union xmm_reg *dst, const union xmm_reg *src); /** * @brief AESDEC instruction emulation function @@ -95,8 +94,8 @@ IMB_DLL_LOCAL void emulate_AESENCLAST(union xmm_reg *dst, * @param dst pointer to 128 bit data (state) to operate on * @param src pointer to 128 bit round key */ -IMB_DLL_LOCAL void emulate_AESDEC(union xmm_reg *dst, - const union xmm_reg *src); +IMB_DLL_LOCAL void +emulate_AESDEC(union xmm_reg *dst, const union xmm_reg *src); /** * @brief AESDECLAST instruction emulation function @@ -106,8 +105,8 @@ IMB_DLL_LOCAL void emulate_AESDEC(union xmm_reg *dst, * @param dst pointer to 128 bit data (state) to operate on * @param src pointer to 128 bit round key */ -IMB_DLL_LOCAL void emulate_AESDECLAST(union xmm_reg *dst, - const union xmm_reg *src); +IMB_DLL_LOCAL void +emulate_AESDECLAST(union xmm_reg *dst, const union xmm_reg *src); /** * @brief AESIMC instruction emulation function @@ -118,8 +117,8 @@ IMB_DLL_LOCAL void emulate_AESDECLAST(union xmm_reg *dst, * @param dst pointer to 128 bit buffer to store result * @param src pointer to 128 bit round key */ -IMB_DLL_LOCAL void emulate_AESIMC(union xmm_reg *dst, - const union xmm_reg *src); +IMB_DLL_LOCAL void +emulate_AESIMC(union xmm_reg *dst, const union xmm_reg *src); /** * @brief PCLMULQDQ instruction emulation function @@ -131,19 +130,18 @@ IMB_DLL_LOCAL void emulate_AESIMC(union xmm_reg *dst, * @param src2 pointer to 128 bit input number * @param imm8 constant for selecting quadword */ -IMB_DLL_LOCAL void emulate_PCLMULQDQ(union xmm_reg *src1_dst, - const union xmm_reg *src2, - const uint32_t imm8); +IMB_DLL_LOCAL void +emulate_PCLMULQDQ(union xmm_reg *src1_dst, const union xmm_reg *src2, const uint32_t imm8); #endif /* AESNI_EMU */ static inline void fallback_no_aesni(IMB_MGR *state, const int reset_mgrs) { #ifdef AESNI_EMU - init_mb_mgr_sse_no_aesni_internal(state, reset_mgrs); + init_mb_mgr_sse_no_aesni_internal(state, reset_mgrs); #else - (void) reset_mgrs; /* Unused */ - imb_set_errno(state, IMB_ERR_NO_AESNI_EMU); + (void) reset_mgrs; /* Unused */ + imb_set_errno(state, IMB_ERR_NO_AESNI_EMU); #endif } #endif /* _AESNI_EMU_H_ */ diff --git a/lib/include/arch_avx2_type1.h b/lib/include/arch_avx2_type1.h index 97263599..1f96a0bd 100644 --- a/lib/include/arch_avx2_type1.h +++ b/lib/include/arch_avx2_type1.h @@ -34,108 +34,124 @@ #include "ipsec_ooo_mgr.h" /* SHA */ -void call_sha1_x8_avx2_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); -void call_sha256_oct_avx2_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); -void call_sha512_x4_avx2_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); - -IMB_DLL_EXPORT void sha1_avx2(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha1_one_block_avx2(const void *data, void *digest); -IMB_DLL_EXPORT void sha224_avx2(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha224_one_block_avx2(const void *data, void *digest); -IMB_DLL_EXPORT void sha256_avx2(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha256_one_block_avx2(const void *data, void *digest); -IMB_DLL_EXPORT void sha384_avx2(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha384_one_block_avx2(const void *data, void *digest); -IMB_DLL_EXPORT void sha512_avx2(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha512_one_block_avx2(const void *data, void *digest); +void +call_sha1_x8_avx2_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); +void +call_sha256_oct_avx2_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); +void +call_sha512_x4_avx2_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); + +IMB_DLL_EXPORT void +sha1_avx2(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha1_one_block_avx2(const void *data, void *digest); +IMB_DLL_EXPORT void +sha224_avx2(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha224_one_block_avx2(const void *data, void *digest); +IMB_DLL_EXPORT void +sha256_avx2(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha256_one_block_avx2(const void *data, void *digest); +IMB_DLL_EXPORT void +sha384_avx2(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha384_one_block_avx2(const void *data, void *digest); +IMB_DLL_EXPORT void +sha512_avx2(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha512_one_block_avx2(const void *data, void *digest); /*AES-CFB*/ -IMB_DLL_EXPORT void aes_cfb_128_one_avx2(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); -IMB_DLL_EXPORT void aes_cfb_256_one_avx2(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_128_one_avx2(void *out, const void *in, const void *iv, const void *keys, uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_256_one_avx2(void *out, const void *in, const void *iv, const void *keys, uint64_t len); /* moved from MB MGR */ -IMB_JOB *submit_job_zuc_eea3_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_avx2(MB_MGR_ZUC_OOO *state); - -IMB_JOB *flush_job_zuc256_eea3_avx2(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eea3_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_zuc_eia3_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_avx2(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eia3_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_avx2(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); - -IMB_JOB *submit_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); - -void aes_cmac_256_subkey_gen_avx2(const void *key_exp, - void *key1, void *key2); - -IMB_JOB *submit_job_chacha20_enc_dec_avx2(IMB_JOB *job); - -IMB_JOB *submit_job_hmac_avx2(MB_MGR_HMAC_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_avx2(MB_MGR_HMAC_SHA_1_OOO *state); - -IMB_JOB *submit_job_hmac_sha_224_avx2(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_224_avx2(MB_MGR_HMAC_SHA_256_OOO *state); - -IMB_JOB *submit_job_hmac_sha_256_avx2(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_256_avx2(MB_MGR_HMAC_SHA_256_OOO *state); - -IMB_JOB *submit_job_hmac_sha_384_avx2(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_384_avx2(MB_MGR_HMAC_SHA_512_OOO *state); - -IMB_JOB *submit_job_hmac_sha_512_avx2(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_512_avx2(MB_MGR_HMAC_SHA_512_OOO *state); - -IMB_JOB *submit_job_hmac_md5_avx2(MB_MGR_HMAC_MD5_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_md5_avx2(MB_MGR_HMAC_MD5_OOO *state); - -IMB_DLL_EXPORT void set_suite_id_avx2_t1(IMB_MGR *state, IMB_JOB *job); +IMB_JOB * +submit_job_zuc_eea3_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_avx2(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +flush_job_zuc256_eea3_avx2(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eea3_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_zuc_eia3_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_avx2(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eia3_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_avx2(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); + +IMB_JOB * +submit_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha1_avx2(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha224_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha256_avx2(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha384_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha512_avx2(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); + +void +aes_cmac_256_subkey_gen_avx2(const void *key_exp, void *key1, void *key2); + +IMB_JOB * +submit_job_chacha20_enc_dec_avx2(IMB_JOB *job); + +IMB_JOB * +submit_job_hmac_avx2(MB_MGR_HMAC_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_avx2(MB_MGR_HMAC_SHA_1_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_224_avx2(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_224_avx2(MB_MGR_HMAC_SHA_256_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_256_avx2(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_256_avx2(MB_MGR_HMAC_SHA_256_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_384_avx2(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_384_avx2(MB_MGR_HMAC_SHA_512_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_512_avx2(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_512_avx2(MB_MGR_HMAC_SHA_512_OOO *state); + +IMB_JOB * +submit_job_hmac_md5_avx2(MB_MGR_HMAC_MD5_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_md5_avx2(MB_MGR_HMAC_MD5_OOO *state); + +IMB_DLL_EXPORT void +set_suite_id_avx2_t1(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_AVX2_T1_H */ diff --git a/lib/include/arch_avx2_type2.h b/lib/include/arch_avx2_type2.h index 02241d0d..a1e37f8e 100644 --- a/lib/include/arch_avx2_type2.h +++ b/lib/include/arch_avx2_type2.h @@ -34,40 +34,43 @@ #include "ipsec_ooo_mgr.h" /* AES-ECB */ -void aes_ecb_enc_256_vaes_avx2(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_192_vaes_avx2(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_128_vaes_avx2(const void *in, const void *keys, - void *out, uint64_t len_bytes); +void +aes_ecb_enc_256_vaes_avx2(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_192_vaes_avx2(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_128_vaes_avx2(const void *in, const void *keys, void *out, uint64_t len_bytes); -void aes_ecb_dec_256_vaes_avx2(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_192_vaes_avx2(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_128_vaes_avx2(const void *in, const void *keys, - void *out, uint64_t len_bytes); +void +aes_ecb_dec_256_vaes_avx2(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_192_vaes_avx2(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_128_vaes_avx2(const void *in, const void *keys, void *out, uint64_t len_bytes); /* moved from MB MGR */ -IMB_JOB *submit_job_zuc_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state); -IMB_JOB *flush_job_zuc256_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state); +IMB_JOB * +flush_job_zuc256_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc256_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_zuc256_eea3_gfni_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_zuc_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc256_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); +IMB_JOB * +submit_job_zuc256_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); -IMB_DLL_EXPORT void set_suite_id_avx2_t2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_avx2_t2(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_AVX2_T2_H */ diff --git a/lib/include/arch_avx2_type3.h b/lib/include/arch_avx2_type3.h index 91f451a6..acb8f968 100644 --- a/lib/include/arch_avx2_type3.h +++ b/lib/include/arch_avx2_type3.h @@ -33,8 +33,10 @@ #include "ipsec-mb.h" #include "ipsec_ooo_mgr.h" -void poly1305_mac_fma_avx2(IMB_JOB *job); +void +poly1305_mac_fma_avx2(IMB_JOB *job); -IMB_DLL_EXPORT void set_suite_id_avx2_t3(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_avx2_t3(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_AVX2_T3_H */ diff --git a/lib/include/arch_avx512_type1.h b/lib/include/arch_avx512_type1.h index 700cb65d..f2d32d12 100644 --- a/lib/include/arch_avx512_type1.h +++ b/lib/include/arch_avx512_type1.h @@ -33,154 +33,177 @@ #include "ipsec-mb.h" #include "ipsec_ooo_mgr.h" -IMB_JOB *submit_job_des_cbc_enc_avx512(MB_MGR_DES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_des_cbc_enc_avx512(MB_MGR_DES_OOO *state); +IMB_JOB * +submit_job_des_cbc_enc_avx512(MB_MGR_DES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_des_cbc_enc_avx512(MB_MGR_DES_OOO *state); -IMB_JOB *submit_job_des_cbc_dec_avx512(MB_MGR_DES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_des_cbc_dec_avx512(MB_MGR_DES_OOO *state); +IMB_JOB * +submit_job_des_cbc_dec_avx512(MB_MGR_DES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_des_cbc_dec_avx512(MB_MGR_DES_OOO *state); -IMB_JOB *submit_job_3des_cbc_enc_avx512(MB_MGR_DES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_3des_cbc_enc_avx512(MB_MGR_DES_OOO *state); +IMB_JOB * +submit_job_3des_cbc_enc_avx512(MB_MGR_DES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_3des_cbc_enc_avx512(MB_MGR_DES_OOO *state); -IMB_JOB *submit_job_3des_cbc_dec_avx512(MB_MGR_DES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_3des_cbc_dec_avx512(MB_MGR_DES_OOO *state); +IMB_JOB * +submit_job_3des_cbc_dec_avx512(MB_MGR_DES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_3des_cbc_dec_avx512(MB_MGR_DES_OOO *state); -IMB_JOB *submit_job_docsis_des_enc_avx512(MB_MGR_DES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_docsis_des_enc_avx512(MB_MGR_DES_OOO *state); +IMB_JOB * +submit_job_docsis_des_enc_avx512(MB_MGR_DES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_docsis_des_enc_avx512(MB_MGR_DES_OOO *state); -IMB_JOB *submit_job_docsis_des_dec_avx512(MB_MGR_DES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_docsis_des_dec_avx512(MB_MGR_DES_OOO *state); +IMB_JOB * +submit_job_docsis_des_dec_avx512(MB_MGR_DES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_docsis_des_dec_avx512(MB_MGR_DES_OOO *state); -IMB_JOB *submit_job_zuc_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc256_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc256_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc256_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc256_eea3_no_gfni_avx512(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc256_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); +IMB_JOB * +submit_job_zuc256_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_no_gfni_avx512(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); -IMB_JOB *submit_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha1_avx512(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha224_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha256_avx512(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha384_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha512_avx512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_snow3g_uea2_avx512(MB_MGR_SNOW3G_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_snow3g_uea2_avx512(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_snow3g_uea2_avx512(MB_MGR_SNOW3G_OOO *state); +IMB_JOB * +flush_job_snow3g_uea2_avx512(MB_MGR_SNOW3G_OOO *state); -IMB_JOB *submit_job_snow3g_uia2_avx512(MB_MGR_SNOW3G_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_snow3g_uia2_avx512(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_snow3g_uia2_avx512(MB_MGR_SNOW3G_OOO *state); +IMB_JOB * +flush_job_snow3g_uia2_avx512(MB_MGR_SNOW3G_OOO *state); -void aes_cmac_256_subkey_gen_avx512(const void *key_exp, - void *key1, void *key2); +void +aes_cmac_256_subkey_gen_avx512(const void *key_exp, void *key1, void *key2); -IMB_JOB *submit_job_hmac_avx512(MB_MGR_HMAC_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_avx512(MB_MGR_HMAC_SHA_1_OOO *state); +IMB_JOB * +submit_job_hmac_avx512(MB_MGR_HMAC_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_avx512(MB_MGR_HMAC_SHA_1_OOO *state); -IMB_JOB *submit_job_hmac_sha_224_avx512(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_224_avx512(MB_MGR_HMAC_SHA_256_OOO *state); +IMB_JOB * +submit_job_hmac_sha_224_avx512(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_224_avx512(MB_MGR_HMAC_SHA_256_OOO *state); -IMB_JOB *submit_job_hmac_sha_256_avx512(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_256_avx512(MB_MGR_HMAC_SHA_256_OOO *state); +IMB_JOB * +submit_job_hmac_sha_256_avx512(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_256_avx512(MB_MGR_HMAC_SHA_256_OOO *state); -IMB_JOB *submit_job_hmac_sha_384_avx512(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_384_avx512(MB_MGR_HMAC_SHA_512_OOO *state); +IMB_JOB * +submit_job_hmac_sha_384_avx512(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_384_avx512(MB_MGR_HMAC_SHA_512_OOO *state); -IMB_JOB *submit_job_hmac_sha_512_avx512(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_512_avx512(MB_MGR_HMAC_SHA_512_OOO *state); +IMB_JOB * +submit_job_hmac_sha_512_avx512(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_512_avx512(MB_MGR_HMAC_SHA_512_OOO *state); -void poly1305_mac_plain_avx512(IMB_JOB *job); +void +poly1305_mac_plain_avx512(IMB_JOB *job); -IMB_JOB *submit_job_chacha20_enc_dec_avx512(IMB_JOB *job); +IMB_JOB * +submit_job_chacha20_enc_dec_avx512(IMB_JOB *job); -void aes_docsis128_dec_crc32_avx512(IMB_JOB *job); -void aes_docsis256_dec_crc32_avx512(IMB_JOB *job); +void +aes_docsis128_dec_crc32_avx512(IMB_JOB *job); +void +aes_docsis256_dec_crc32_avx512(IMB_JOB *job); IMB_JOB * -submit_job_aes_docsis128_enc_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job); +submit_job_aes_docsis128_enc_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); IMB_JOB * flush_job_aes_docsis128_enc_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state); IMB_JOB * -submit_job_aes_docsis256_enc_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job); +submit_job_aes_docsis256_enc_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); IMB_JOB * flush_job_aes_docsis256_enc_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state); /* SHA */ -void call_sha1_x16_avx512_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); -void call_sha256_x16_avx512_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); -void call_sha512_x8_avx512_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); - -IMB_DLL_EXPORT void sha1_avx512(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha1_one_block_avx512(const void *data, void *digest); -IMB_DLL_EXPORT void sha224_avx512(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha224_one_block_avx512(const void *data, void *digest); -IMB_DLL_EXPORT void sha256_avx512(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha256_one_block_avx512(const void *data, void *digest); -IMB_DLL_EXPORT void sha384_avx512(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha384_one_block_avx512(const void *data, void *digest); -IMB_DLL_EXPORT void sha512_avx512(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha512_one_block_avx512(const void *data, void *digest); +void +call_sha1_x16_avx512_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); +void +call_sha256_x16_avx512_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); +void +call_sha512_x8_avx512_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); + +IMB_DLL_EXPORT void +sha1_avx512(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha1_one_block_avx512(const void *data, void *digest); +IMB_DLL_EXPORT void +sha224_avx512(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha224_one_block_avx512(const void *data, void *digest); +IMB_DLL_EXPORT void +sha256_avx512(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha256_one_block_avx512(const void *data, void *digest); +IMB_DLL_EXPORT void +sha384_avx512(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha384_one_block_avx512(const void *data, void *digest); +IMB_DLL_EXPORT void +sha512_avx512(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha512_one_block_avx512(const void *data, void *digest); /* AES-CFB */ -IMB_DLL_EXPORT void aes_cfb_128_one_avx512(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); -IMB_DLL_EXPORT void aes_cfb_256_one_avx512(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_128_one_avx512(void *out, const void *in, const void *iv, const void *keys, uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_256_one_avx512(void *out, const void *in, const void *iv, const void *keys, uint64_t len); -IMB_DLL_EXPORT void set_suite_id_avx512_t1(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_avx512_t1(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_AVX512_T1_H */ - diff --git a/lib/include/arch_avx512_type2.h b/lib/include/arch_avx512_type2.h index af7afdce..1cae9c69 100644 --- a/lib/include/arch_avx512_type2.h +++ b/lib/include/arch_avx512_type2.h @@ -36,173 +36,209 @@ /* Define interface to base asm code */ /* AES-CBC */ -void aes_cbc_dec_128_vaes_avx512(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes); -void aes_cbc_dec_192_vaes_avx512(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes); -void aes_cbc_dec_256_vaes_avx512(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes); +void +aes_cbc_dec_128_vaes_avx512(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_192_vaes_avx512(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_256_vaes_avx512(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); /* AES-CTR */ -void aes_cntr_128_submit_vaes_avx512(IMB_JOB *job); -void aes_cntr_192_submit_vaes_avx512(IMB_JOB *job); -void aes_cntr_256_submit_vaes_avx512(IMB_JOB *job); +void +aes_cntr_128_submit_vaes_avx512(IMB_JOB *job); +void +aes_cntr_192_submit_vaes_avx512(IMB_JOB *job); +void +aes_cntr_256_submit_vaes_avx512(IMB_JOB *job); /* AES-CTR-BITLEN */ -void aes_cntr_bit_128_submit_vaes_avx512(IMB_JOB *job); -void aes_cntr_bit_192_submit_vaes_avx512(IMB_JOB *job); -void aes_cntr_bit_256_submit_vaes_avx512(IMB_JOB *job); +void +aes_cntr_bit_128_submit_vaes_avx512(IMB_JOB *job); +void +aes_cntr_bit_192_submit_vaes_avx512(IMB_JOB *job); +void +aes_cntr_bit_256_submit_vaes_avx512(IMB_JOB *job); /* AES-ECB */ -void aes_ecb_enc_256_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_192_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_128_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_dec_256_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_192_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_128_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_quic_enc_128_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t num_buffers); -void aes_ecb_quic_enc_256_vaes_avx512(const void *in, const void *keys, - void *out, uint64_t num_buffers); +void +aes_ecb_enc_256_vaes_avx512(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_192_vaes_avx512(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_128_vaes_avx512(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_dec_256_vaes_avx512(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_192_vaes_avx512(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_128_vaes_avx512(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_quic_enc_128_vaes_avx512(const void *in, const void *keys, void *out, uint64_t num_buffers); +void +aes_ecb_quic_enc_256_vaes_avx512(const void *in, const void *keys, void *out, uint64_t num_buffers); /* AES-CBCS */ -void aes_cbcs_1_9_dec_128_vaes_avx512(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes, void *next_iv); +void +aes_cbcs_1_9_dec_128_vaes_avx512(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes, void *next_iv); /* moved from MB MGR */ -IMB_JOB *submit_job_pon_enc_vaes_avx512(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_vaes_avx512(IMB_JOB *job); - -IMB_JOB *submit_job_pon_enc_no_ctr_vaes_avx512(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_no_ctr_vaes_avx512(IMB_JOB *job); - -IMB_JOB *submit_job_aes_xcbc_vaes_avx512(MB_MGR_AES_XCBC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes_xcbc_vaes_avx512(MB_MGR_AES_XCBC_OOO *state); - -IMB_JOB *submit_job_aes128_enc_vaes_avx512(MB_MGR_AES_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes128_enc_vaes_avx512(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes192_enc_vaes_avx512(MB_MGR_AES_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_pon_enc_vaes_avx512(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_vaes_avx512(IMB_JOB *job); -IMB_JOB *flush_job_aes192_enc_vaes_avx512(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_pon_enc_no_ctr_vaes_avx512(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_no_ctr_vaes_avx512(IMB_JOB *job); -IMB_JOB *submit_job_aes256_enc_vaes_avx512(MB_MGR_AES_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_aes_xcbc_vaes_avx512(MB_MGR_AES_XCBC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes_xcbc_vaes_avx512(MB_MGR_AES_XCBC_OOO *state); -IMB_JOB *flush_job_aes256_enc_vaes_avx512(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_aes128_enc_vaes_avx512(MB_MGR_AES_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_zuc_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state); +IMB_JOB * +flush_job_aes128_enc_vaes_avx512(MB_MGR_AES_OOO *state); -IMB_JOB *submit_job_zuc_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_aes192_enc_vaes_avx512(MB_MGR_AES_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_zuc256_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc256_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state); +IMB_JOB * +flush_job_aes192_enc_vaes_avx512(MB_MGR_AES_OOO *state); -IMB_JOB *aes_cntr_ccm_128_vaes_avx512(IMB_JOB *job); +IMB_JOB * +submit_job_aes256_enc_vaes_avx512(MB_MGR_AES_OOO *state, IMB_JOB *job); -IMB_JOB *aes_cntr_ccm_256_vaes_avx512(IMB_JOB *job); +IMB_JOB * +flush_job_aes256_enc_vaes_avx512(MB_MGR_AES_OOO *state); -IMB_JOB *submit_job_zuc256_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); +IMB_JOB * +submit_job_zuc_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_aes128_cbcs_1_9_enc_vaes_avx512(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_cbcs_1_9_enc_vaes_avx512(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_zuc_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_snow3g_uea2_vaes_avx512(MB_MGR_SNOW3G_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_zuc256_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc256_eea3_gfni_avx512(MB_MGR_ZUC_OOO *state); -IMB_JOB *flush_job_snow3g_uea2_vaes_avx512(MB_MGR_SNOW3G_OOO *state); +IMB_JOB * +aes_cntr_ccm_128_vaes_avx512(IMB_JOB *job); -IMB_JOB *submit_job_snow3g_uia2_vaes_avx512(MB_MGR_SNOW3G_OOO *state, - IMB_JOB *job); +IMB_JOB * +aes_cntr_ccm_256_vaes_avx512(IMB_JOB *job); -IMB_JOB *flush_job_snow3g_uia2_vaes_avx512(MB_MGR_SNOW3G_OOO *state); +IMB_JOB * +submit_job_zuc256_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_gfni_avx512(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); -IMB_JOB *submit_job_aes128_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_aes128_cbcs_1_9_enc_vaes_avx512(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_cbcs_1_9_enc_vaes_avx512(MB_MGR_AES_OOO *state); -IMB_JOB *flush_job_aes128_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state); +IMB_JOB * +submit_job_snow3g_uea2_vaes_avx512(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_aes256_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); +IMB_JOB * +flush_job_snow3g_uea2_vaes_avx512(MB_MGR_SNOW3G_OOO *state); -IMB_JOB *flush_job_aes256_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state); +IMB_JOB * +submit_job_snow3g_uia2_vaes_avx512(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_aes128_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state, - IMB_JOB *job); +IMB_JOB * +flush_job_snow3g_uia2_vaes_avx512(MB_MGR_SNOW3G_OOO *state); -IMB_JOB *flush_job_aes128_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state); +IMB_JOB * +submit_job_aes128_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_aes256_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state, - IMB_JOB *job); +IMB_JOB * +flush_job_aes128_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state); -IMB_JOB *flush_job_aes256_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state); +IMB_JOB * +submit_job_aes256_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state, IMB_JOB *job); -void poly1305_mac_fma_avx512(IMB_JOB *job); +IMB_JOB * +flush_job_aes256_cmac_auth_vaes_avx512(MB_MGR_CMAC_OOO *state); -uint32_t ethernet_fcs_avx512(const void *msg, const uint64_t len); -uint32_t ethernet_fcs_avx512_local(const void *msg, const uint64_t len, - const void *tag_ouput); -uint32_t crc16_x25_avx512(const void *msg, const uint64_t len); -uint32_t crc32_sctp_avx512(const void *msg, const uint64_t len); -uint32_t crc24_lte_a_avx512(const void *msg, const uint64_t len); -uint32_t crc24_lte_b_avx512(const void *msg, const uint64_t len); -uint32_t crc16_fp_data_avx512(const void *msg, const uint64_t len); -uint32_t crc11_fp_header_avx512(const void *msg, const uint64_t len); -uint32_t crc7_fp_header_avx512(const void *msg, const uint64_t len); -uint32_t crc10_iuup_data_avx512(const void *msg, const uint64_t len); -uint32_t crc6_iuup_header_avx512(const void *msg, const uint64_t len); -uint32_t crc32_wimax_ofdma_data_avx512(const void *msg, const uint64_t len); -uint32_t crc8_wimax_ofdma_hcs_avx512(const void *msg, const uint64_t len); +IMB_JOB * +submit_job_aes128_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state, IMB_JOB *job); -void snow3g_f9_1_buffer_vaes_avx512(const snow3g_key_schedule_t *pHandle, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest); +IMB_JOB * +flush_job_aes128_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state); +IMB_JOB * +submit_job_aes256_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state, IMB_JOB *job); -void aes_docsis128_dec_crc32_vaes_avx512(IMB_JOB *job); -void aes_docsis256_dec_crc32_vaes_avx512(IMB_JOB *job); +IMB_JOB * +flush_job_aes256_ccm_auth_vaes_avx512(MB_MGR_CCM_OOO *state); + +void +poly1305_mac_fma_avx512(IMB_JOB *job); + +uint32_t +ethernet_fcs_avx512(const void *msg, const uint64_t len); +uint32_t +ethernet_fcs_avx512_local(const void *msg, const uint64_t len, const void *tag_ouput); +uint32_t +crc16_x25_avx512(const void *msg, const uint64_t len); +uint32_t +crc32_sctp_avx512(const void *msg, const uint64_t len); +uint32_t +crc24_lte_a_avx512(const void *msg, const uint64_t len); +uint32_t +crc24_lte_b_avx512(const void *msg, const uint64_t len); +uint32_t +crc16_fp_data_avx512(const void *msg, const uint64_t len); +uint32_t +crc11_fp_header_avx512(const void *msg, const uint64_t len); +uint32_t +crc7_fp_header_avx512(const void *msg, const uint64_t len); +uint32_t +crc10_iuup_data_avx512(const void *msg, const uint64_t len); +uint32_t +crc6_iuup_header_avx512(const void *msg, const uint64_t len); +uint32_t +crc32_wimax_ofdma_data_avx512(const void *msg, const uint64_t len); +uint32_t +crc8_wimax_ofdma_hcs_avx512(const void *msg, const uint64_t len); + +void +snow3g_f9_1_buffer_vaes_avx512(const snow3g_key_schedule_t *pHandle, const void *pIV, + const void *pBufferIn, const uint64_t lengthInBits, void *pDigest); + +void +aes_docsis128_dec_crc32_vaes_avx512(IMB_JOB *job); +void +aes_docsis256_dec_crc32_vaes_avx512(IMB_JOB *job); IMB_JOB * -submit_job_aes_docsis128_enc_crc32_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job); +submit_job_aes_docsis128_enc_crc32_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); IMB_JOB * flush_job_aes_docsis128_enc_crc32_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state); IMB_JOB * -submit_job_aes_docsis256_enc_crc32_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job); +submit_job_aes_docsis256_enc_crc32_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job); IMB_JOB * flush_job_aes_docsis256_enc_crc32_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state); -IMB_DLL_EXPORT void set_suite_id_avx512_t2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_avx512_t2(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_AVX512_T2_H */ diff --git a/lib/include/arch_avx_type1.h b/lib/include/arch_avx_type1.h index 843b0508..b621c31e 100644 --- a/lib/include/arch_avx_type1.h +++ b/lib/include/arch_avx_type1.h @@ -33,244 +33,305 @@ #include "ipsec-mb.h" #include "ipsec_ooo_mgr.h" - /* AES-CBC */ -void aes_cbc_enc_128_x8(AES_ARGS *args, uint64_t len_in_bytes); -void aes_cbc_enc_192_x8(AES_ARGS *args, uint64_t len_in_bytes); -void aes_cbc_enc_256_x8(AES_ARGS *args, uint64_t len_in_bytes); - -void aes_cbc_dec_128_avx(const void *in, const uint8_t *IV, const void *keys, - void *out, uint64_t len_bytes); -void aes_cbc_dec_192_avx(const void *in, const uint8_t *IV, const void *keys, - void *out, uint64_t len_bytes); -void aes_cbc_dec_256_avx(const void *in, const uint8_t *IV, const void *keys, - void *out, uint64_t len_bytes); +void +aes_cbc_enc_128_x8(AES_ARGS *args, uint64_t len_in_bytes); +void +aes_cbc_enc_192_x8(AES_ARGS *args, uint64_t len_in_bytes); +void +aes_cbc_enc_256_x8(AES_ARGS *args, uint64_t len_in_bytes); + +void +aes_cbc_dec_128_avx(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_192_avx(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_256_avx(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); /* AES-CTR */ -void aes_cntr_256_avx(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); -void aes_cntr_192_avx(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); -void aes_cntr_128_avx(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); +void +aes_cntr_256_avx(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bytes, + uint64_t IV_len); +void +aes_cntr_192_avx(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bytes, + uint64_t IV_len); +void +aes_cntr_128_avx(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bytes, + uint64_t IV_len); /* AES-CTR-BITLEN */ -void aes_cntr_bit_256_avx(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bits, uint64_t IV_len); -void aes_cntr_bit_192_avx(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bits, uint64_t IV_len); -void aes_cntr_bit_128_avx(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bits, uint64_t IV_len); +void +aes_cntr_bit_256_avx(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bits, + uint64_t IV_len); +void +aes_cntr_bit_192_avx(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bits, + uint64_t IV_len); +void +aes_cntr_bit_128_avx(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bits, + uint64_t IV_len); /* AES-CCM */ -IMB_JOB *aes_cntr_ccm_128_avx(IMB_JOB *job); -IMB_JOB *aes_cntr_ccm_256_avx(IMB_JOB *job); +IMB_JOB * +aes_cntr_ccm_128_avx(IMB_JOB *job); +IMB_JOB * +aes_cntr_ccm_256_avx(IMB_JOB *job); /* AES-ECB */ -void aes_ecb_enc_256_avx(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_192_avx(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_128_avx(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_dec_256_avx(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_192_avx(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_128_avx(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_quic_enc_128_avx(const void *in, const void *keys, - void *out, uint64_t num_buffers); -void aes_ecb_quic_enc_256_avx(const void *in, const void *keys, - void *out, uint64_t num_buffers); +void +aes_ecb_enc_256_avx(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_192_avx(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_128_avx(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_dec_256_avx(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_192_avx(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_128_avx(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_quic_enc_128_avx(const void *in, const void *keys, void *out, uint64_t num_buffers); +void +aes_ecb_quic_enc_256_avx(const void *in, const void *keys, void *out, uint64_t num_buffers); /* AES128-ECBENC */ -void aes128_ecbenc_x3_avx(const void *in, void *keys, - void *out1, void *out2, void *out3); +void +aes128_ecbenc_x3_avx(const void *in, void *keys, void *out1, void *out2, void *out3); /* AES-CBCS */ -void aes_cbcs_1_9_dec_128_avx(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes, void *next_iv); +void +aes_cbcs_1_9_dec_128_avx(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes, void *next_iv); /* AES-CFB */ -IMB_DLL_EXPORT void aes_cfb_128_one_avx(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); -IMB_DLL_EXPORT void aes_cfb_256_one_avx(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_128_one_avx(void *out, const void *in, const void *iv, const void *keys, uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_256_one_avx(void *out, const void *in, const void *iv, const void *keys, uint64_t len); /* stitched AES128-CNTR, CRC32 and BIP */ -IMB_JOB *submit_job_pon_enc_avx(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_avx(IMB_JOB *job); +IMB_JOB * +submit_job_pon_enc_avx(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_avx(IMB_JOB *job); -IMB_JOB *submit_job_pon_enc_no_ctr_avx(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_no_ctr_avx(IMB_JOB *job); +IMB_JOB * +submit_job_pon_enc_no_ctr_avx(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_no_ctr_avx(IMB_JOB *job); /* moved from MB MGR */ -IMB_JOB *submit_job_aes128_enc_avx(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_enc_avx(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes192_enc_avx(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes192_enc_avx(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes256_enc_avx(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes256_enc_avx(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes_xcbc_avx(MB_MGR_AES_XCBC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes_xcbc_avx(MB_MGR_AES_XCBC_OOO *state); - -IMB_JOB *submit_job_aes_cntr_avx(IMB_JOB *job); - -IMB_JOB *submit_job_aes_cntr_bit_avx(IMB_JOB *job); - -IMB_JOB *submit_job_zuc_eea3_avx(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_avx(MB_MGR_ZUC_OOO *state); - -IMB_JOB *flush_job_zuc256_eea3_avx(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eea3_avx(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_zuc_eia3_avx(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_avx(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eia3_avx(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_avx(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); - -IMB_JOB *submit_job_sha1_avx(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha1_avx(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha224_avx(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha224_avx(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha256_avx(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha256_avx(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha384_avx(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha384_avx(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha512_avx(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha512_avx(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); - -uint32_t hec_32_avx(const uint8_t *in); -uint64_t hec_64_avx(const uint8_t *in); - -IMB_JOB *submit_job_aes128_cbcs_1_9_enc_avx(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_cbcs_1_9_enc_avx(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_chacha20_enc_dec_avx(IMB_JOB *job); - -IMB_JOB *snow_v_avx(IMB_JOB *job); -IMB_JOB *snow_v_aead_init_avx(IMB_JOB *job); - -IMB_JOB *submit_job_hmac_avx(MB_MGR_HMAC_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_avx(MB_MGR_HMAC_SHA_1_OOO *state); - -IMB_JOB *submit_job_hmac_sha_224_avx(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_224_avx(MB_MGR_HMAC_SHA_256_OOO *state); - -IMB_JOB *submit_job_hmac_sha_256_avx(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_256_avx(MB_MGR_HMAC_SHA_256_OOO *state); - -IMB_JOB *submit_job_hmac_sha_384_avx(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_384_avx(MB_MGR_HMAC_SHA_512_OOO *state); - -IMB_JOB *submit_job_hmac_sha_512_avx(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_512_avx(MB_MGR_HMAC_SHA_512_OOO *state); - -IMB_JOB *submit_job_hmac_md5_avx(MB_MGR_HMAC_MD5_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_md5_avx(MB_MGR_HMAC_MD5_OOO *state); - -IMB_JOB *submit_job_aes128_cmac_auth_avx(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes128_cmac_auth_avx(MB_MGR_CMAC_OOO *state); - -IMB_JOB *submit_job_aes256_cmac_auth_avx(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes256_cmac_auth_avx(MB_MGR_CMAC_OOO *state); - -IMB_JOB *submit_job_aes128_ccm_auth_avx(MB_MGR_CCM_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes128_ccm_auth_avx(MB_MGR_CCM_OOO *state); - -IMB_JOB *submit_job_aes256_ccm_auth_avx(MB_MGR_CCM_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes256_ccm_auth_avx(MB_MGR_CCM_OOO *state); - -void aes_cmac_256_subkey_gen_avx(const void *key_exp, - void *key1, void *key2); - -void aes128_cbc_mac_x8(AES_ARGS *args, uint64_t len); - -uint32_t ethernet_fcs_avx(const void *msg, const uint64_t len); -uint32_t ethernet_fcs_avx_local(const void *msg, const uint64_t len, - const void *tag_ouput); -uint32_t crc16_x25_avx(const void *msg, const uint64_t len); -uint32_t crc32_sctp_avx(const void *msg, const uint64_t len); -uint32_t crc24_lte_a_avx(const void *msg, const uint64_t len); -uint32_t crc24_lte_b_avx(const void *msg, const uint64_t len); -uint32_t crc16_fp_data_avx(const void *msg, const uint64_t len); -uint32_t crc11_fp_header_avx(const void *msg, const uint64_t len); -uint32_t crc7_fp_header_avx(const void *msg, const uint64_t len); -uint32_t crc10_iuup_data_avx(const void *msg, const uint64_t len); -uint32_t crc6_iuup_header_avx(const void *msg, const uint64_t len); -uint32_t crc32_wimax_ofdma_data_avx(const void *msg, const uint64_t len); -uint32_t crc8_wimax_ofdma_hcs_avx(const void *msg, const uint64_t len); +IMB_JOB * +submit_job_aes128_enc_avx(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_enc_avx(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes192_enc_avx(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes192_enc_avx(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes256_enc_avx(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes256_enc_avx(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes_xcbc_avx(MB_MGR_AES_XCBC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes_xcbc_avx(MB_MGR_AES_XCBC_OOO *state); + +IMB_JOB * +submit_job_aes_cntr_avx(IMB_JOB *job); + +IMB_JOB * +submit_job_aes_cntr_bit_avx(IMB_JOB *job); + +IMB_JOB * +submit_job_zuc_eea3_avx(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_avx(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +flush_job_zuc256_eea3_avx(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eea3_avx(MB_MGR_ZUC_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_zuc_eia3_avx(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_avx(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eia3_avx(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_avx(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); + +IMB_JOB * +submit_job_sha1_avx(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha1_avx(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha224_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha224_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha256_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha256_avx(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha384_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha512_avx(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); + +uint32_t +hec_32_avx(const uint8_t *in); +uint64_t +hec_64_avx(const uint8_t *in); + +IMB_JOB * +submit_job_aes128_cbcs_1_9_enc_avx(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_cbcs_1_9_enc_avx(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_chacha20_enc_dec_avx(IMB_JOB *job); + +IMB_JOB * +snow_v_avx(IMB_JOB *job); +IMB_JOB * +snow_v_aead_init_avx(IMB_JOB *job); + +IMB_JOB * +submit_job_hmac_avx(MB_MGR_HMAC_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_avx(MB_MGR_HMAC_SHA_1_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_224_avx(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_224_avx(MB_MGR_HMAC_SHA_256_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_256_avx(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_256_avx(MB_MGR_HMAC_SHA_256_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_384_avx(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_384_avx(MB_MGR_HMAC_SHA_512_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_512_avx(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_512_avx(MB_MGR_HMAC_SHA_512_OOO *state); + +IMB_JOB * +submit_job_hmac_md5_avx(MB_MGR_HMAC_MD5_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_md5_avx(MB_MGR_HMAC_MD5_OOO *state); + +IMB_JOB * +submit_job_aes128_cmac_auth_avx(MB_MGR_CMAC_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes128_cmac_auth_avx(MB_MGR_CMAC_OOO *state); + +IMB_JOB * +submit_job_aes256_cmac_auth_avx(MB_MGR_CMAC_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes256_cmac_auth_avx(MB_MGR_CMAC_OOO *state); + +IMB_JOB * +submit_job_aes128_ccm_auth_avx(MB_MGR_CCM_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes128_ccm_auth_avx(MB_MGR_CCM_OOO *state); + +IMB_JOB * +submit_job_aes256_ccm_auth_avx(MB_MGR_CCM_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes256_ccm_auth_avx(MB_MGR_CCM_OOO *state); + +void +aes_cmac_256_subkey_gen_avx(const void *key_exp, void *key1, void *key2); + +void +aes128_cbc_mac_x8(AES_ARGS *args, uint64_t len); + +uint32_t +ethernet_fcs_avx(const void *msg, const uint64_t len); +uint32_t +ethernet_fcs_avx_local(const void *msg, const uint64_t len, const void *tag_ouput); +uint32_t +crc16_x25_avx(const void *msg, const uint64_t len); +uint32_t +crc32_sctp_avx(const void *msg, const uint64_t len); +uint32_t +crc24_lte_a_avx(const void *msg, const uint64_t len); +uint32_t +crc24_lte_b_avx(const void *msg, const uint64_t len); +uint32_t +crc16_fp_data_avx(const void *msg, const uint64_t len); +uint32_t +crc11_fp_header_avx(const void *msg, const uint64_t len); +uint32_t +crc7_fp_header_avx(const void *msg, const uint64_t len); +uint32_t +crc10_iuup_data_avx(const void *msg, const uint64_t len); +uint32_t +crc6_iuup_header_avx(const void *msg, const uint64_t len); +uint32_t +crc32_wimax_ofdma_data_avx(const void *msg, const uint64_t len); +uint32_t +crc8_wimax_ofdma_hcs_avx(const void *msg, const uint64_t len); /* SHA */ -void call_sha1_mult_avx_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); -void call_sha_256_mult_avx_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); -void call_sha512_x2_avx_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); - -IMB_DLL_EXPORT void sha1_avx(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha1_one_block_avx(const void *data, void *digest); -IMB_DLL_EXPORT void sha224_avx(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha224_one_block_avx(const void *data, void *digest); -IMB_DLL_EXPORT void sha256_avx(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha256_one_block_avx(const void *data, void *digest); -IMB_DLL_EXPORT void sha384_avx(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha384_one_block_avx(const void *data, void *digest); -IMB_DLL_EXPORT void sha512_avx(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha512_one_block_avx(const void *data, void *digest); - -IMB_DLL_EXPORT void set_suite_id_avx_t1(IMB_MGR *state, IMB_JOB *job); +void +call_sha1_mult_avx_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); +void +call_sha_256_mult_avx_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); +void +call_sha512_x2_avx_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); + +IMB_DLL_EXPORT void +sha1_avx(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha1_one_block_avx(const void *data, void *digest); +IMB_DLL_EXPORT void +sha224_avx(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha224_one_block_avx(const void *data, void *digest); +IMB_DLL_EXPORT void +sha256_avx(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha256_one_block_avx(const void *data, void *digest); +IMB_DLL_EXPORT void +sha384_avx(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha384_one_block_avx(const void *data, void *digest); +IMB_DLL_EXPORT void +sha512_avx(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha512_one_block_avx(const void *data, void *digest); + +IMB_DLL_EXPORT void +set_suite_id_avx_t1(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_AVX_T1_H */ diff --git a/lib/include/arch_avx_type2.h b/lib/include/arch_avx_type2.h index ec48e003..d892e1fa 100644 --- a/lib/include/arch_avx_type2.h +++ b/lib/include/arch_avx_type2.h @@ -32,6 +32,7 @@ #include "ipsec-mb.h" -IMB_DLL_EXPORT void set_suite_id_avx_t2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_avx_t2(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_AVX_T2_H */ diff --git a/lib/include/arch_noaesni.h b/lib/include/arch_noaesni.h index 6341e3f8..1056de43 100644 --- a/lib/include/arch_noaesni.h +++ b/lib/include/arch_noaesni.h @@ -35,164 +35,202 @@ /* AES-CBC */ -void aes_cbc_dec_128_sse_no_aesni(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes); -void aes_cbc_dec_192_sse_no_aesni(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes); -void aes_cbc_dec_256_sse_no_aesni(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes); +void +aes_cbc_dec_128_sse_no_aesni(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_192_sse_no_aesni(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_256_sse_no_aesni(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); /* AES-CTR */ -void aes_cntr_256_sse_no_aesni(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); -void aes_cntr_192_sse_no_aesni(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); -void aes_cntr_128_sse_no_aesni(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); +void +aes_cntr_256_sse_no_aesni(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bytes, uint64_t IV_len); +void +aes_cntr_192_sse_no_aesni(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bytes, uint64_t IV_len); +void +aes_cntr_128_sse_no_aesni(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bytes, uint64_t IV_len); /* AES-CTR-BITLEN */ -void aes_cntr_bit_256_sse_no_aesni(const void *in, const void *IV, - const void *keys, void *out, - uint64_t len_bits, uint64_t IV_len); -void aes_cntr_bit_192_sse_no_aesni(const void *in, const void *IV, - const void *keys, void *out, - uint64_t len_bits, uint64_t IV_len); -void aes_cntr_bit_128_sse_no_aesni(const void *in, const void *IV, - const void *keys, void *out, - uint64_t len_bits, uint64_t IV_len); +void +aes_cntr_bit_256_sse_no_aesni(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bits, uint64_t IV_len); +void +aes_cntr_bit_192_sse_no_aesni(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bits, uint64_t IV_len); +void +aes_cntr_bit_128_sse_no_aesni(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bits, uint64_t IV_len); /* AES-CCM */ -IMB_JOB *aes_cntr_ccm_128_sse_no_aesni(IMB_JOB *job); -IMB_JOB *aes_cntr_ccm_256_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +aes_cntr_ccm_128_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +aes_cntr_ccm_256_sse_no_aesni(IMB_JOB *job); /* AES-ECB */ -void aes_ecb_enc_256_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_192_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_128_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_dec_256_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_192_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_128_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_quic_enc_128_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t num_buffers); -void aes_ecb_quic_enc_256_sse_no_aesni(const void *in, const void *keys, - void *out, uint64_t num_buffers); +void +aes_ecb_enc_256_sse_no_aesni(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_192_sse_no_aesni(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_128_sse_no_aesni(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_dec_256_sse_no_aesni(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_192_sse_no_aesni(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_128_sse_no_aesni(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_quic_enc_128_sse_no_aesni(const void *in, const void *keys, void *out, + uint64_t num_buffers); +void +aes_ecb_quic_enc_256_sse_no_aesni(const void *in, const void *keys, void *out, + uint64_t num_buffers); /* AES128-ECBENC */ -void aes128_ecbenc_x3_sse_no_aesni(const void *in, void *keys, - void *out1, void *out2, void *out3); +void +aes128_ecbenc_x3_sse_no_aesni(const void *in, void *keys, void *out1, void *out2, void *out3); /* AES-CBCS */ -void aes_cbcs_1_9_dec_128_sse_no_aesni(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes, void *next_iv); +void +aes_cbcs_1_9_dec_128_sse_no_aesni(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes, void *next_iv); /* stitched AES128-CNTR, CRC32 and BIP */ -IMB_JOB *submit_job_pon_enc_sse_no_aesni(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +submit_job_pon_enc_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_sse_no_aesni(IMB_JOB *job); -IMB_JOB *submit_job_pon_enc_no_ctr_sse_no_aesni(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_no_ctr_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +submit_job_pon_enc_no_ctr_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_no_ctr_sse_no_aesni(IMB_JOB *job); /* moved from MB MGR */ -IMB_JOB *submit_job_aes128_enc_sse_no_aesni(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_enc_sse_no_aesni(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_aes128_enc_sse_no_aesni(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_enc_sse_no_aesni(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes192_enc_sse_no_aesni(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes192_enc_sse_no_aesni(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes256_enc_sse_no_aesni(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes256_enc_sse_no_aesni(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes_xcbc_sse_no_aesni(MB_MGR_AES_XCBC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes_xcbc_sse_no_aesni(MB_MGR_AES_XCBC_OOO *state); + +IMB_JOB * +submit_job_aes128_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state); + +IMB_JOB * +submit_job_aes256_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes256_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state); + +IMB_JOB * +submit_job_aes128_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes128_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state); + +IMB_JOB * +submit_job_aes256_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes256_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state); + +IMB_JOB * +submit_job_aes_cntr_sse_no_aesni(IMB_JOB *job); + +IMB_JOB * +submit_job_aes_cntr_bit_sse_no_aesni(IMB_JOB *job); + +IMB_JOB * +submit_job_zuc_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc256_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); -IMB_JOB *submit_job_aes192_enc_sse_no_aesni(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes192_enc_sse_no_aesni(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes256_enc_sse_no_aesni(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes256_enc_sse_no_aesni(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes_xcbc_sse_no_aesni(MB_MGR_AES_XCBC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes_xcbc_sse_no_aesni(MB_MGR_AES_XCBC_OOO *state); - -IMB_JOB *submit_job_aes128_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state); - -IMB_JOB *submit_job_aes256_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes256_cmac_auth_sse_no_aesni(MB_MGR_CMAC_OOO *state); - -IMB_JOB *submit_job_aes128_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes128_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state); - -IMB_JOB *submit_job_aes256_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes256_ccm_auth_sse_no_aesni(MB_MGR_CCM_OOO *state); - -IMB_JOB *submit_job_aes_cntr_sse_no_aesni(IMB_JOB *job); - -IMB_JOB *submit_job_aes_cntr_bit_sse_no_aesni(IMB_JOB *job); - -IMB_JOB *submit_job_zuc_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc256_eea3_sse_no_aesni(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_sse_no_aesni(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); - -uint32_t hec_32_sse_no_aesni(const uint8_t *in); -uint64_t hec_64_sse_no_aesni(const uint8_t *in); +uint32_t +hec_32_sse_no_aesni(const uint8_t *in); +uint64_t +hec_64_sse_no_aesni(const uint8_t *in); -IMB_JOB *submit_job_aes128_cbcs_1_9_enc_sse_no_aesni(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_cbcs_1_9_enc_sse_no_aesni(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_aes128_cbcs_1_9_enc_sse_no_aesni(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_cbcs_1_9_enc_sse_no_aesni(MB_MGR_AES_OOO *state); -IMB_JOB *snow_v_sse_no_aesni(IMB_JOB *job); -IMB_JOB *snow_v_aead_init_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +snow_v_sse_no_aesni(IMB_JOB *job); +IMB_JOB * +snow_v_aead_init_sse_no_aesni(IMB_JOB *job); -void aes128_cbc_mac_x4_no_aesni(AES_ARGS *args, uint64_t len); +void +aes128_cbc_mac_x4_no_aesni(AES_ARGS *args, uint64_t len); -uint32_t ethernet_fcs_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc16_x25_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc32_sctp_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc24_lte_a_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc24_lte_b_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc16_fp_data_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc11_fp_header_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc7_fp_header_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc10_iuup_data_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc6_iuup_header_sse_no_aesni(const void *msg, const uint64_t len); -uint32_t crc32_wimax_ofdma_data_sse_no_aesni(const void *msg, - const uint64_t len); -uint32_t crc8_wimax_ofdma_hcs_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +ethernet_fcs_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc16_x25_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc32_sctp_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc24_lte_a_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc24_lte_b_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc16_fp_data_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc11_fp_header_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc7_fp_header_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc10_iuup_data_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc6_iuup_header_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc32_wimax_ofdma_data_sse_no_aesni(const void *msg, const uint64_t len); +uint32_t +crc8_wimax_ofdma_hcs_sse_no_aesni(const void *msg, const uint64_t len); uint32_t -ethernet_fcs_sse_no_aesni_local(const void *msg, const uint64_t len, - const void *tag_ouput); +ethernet_fcs_sse_no_aesni_local(const void *msg, const uint64_t len, const void *tag_ouput); -IMB_DLL_EXPORT void set_suite_id_sse_no_aesni(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_sse_no_aesni(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ARCH_NOAESNI_H */ - - diff --git a/lib/include/arch_sse_type1.h b/lib/include/arch_sse_type1.h index ac915f10..57c8c21e 100644 --- a/lib/include/arch_sse_type1.h +++ b/lib/include/arch_sse_type1.h @@ -34,248 +34,307 @@ #include "ipsec_ooo_mgr.h" /* AES-CBC */ -void aes_cbc_enc_128_x8(AES_ARGS *args, uint64_t len_in_bytes); -void aes_cbc_enc_192_x8(AES_ARGS *args, uint64_t len_in_bytes); -void aes_cbc_enc_256_x8(AES_ARGS *args, uint64_t len_in_bytes); - - -void aes_cbc_dec_128_sse(const void *in, const uint8_t *IV, const void *keys, - void *out, uint64_t len_bytes); -void aes_cbc_dec_192_sse(const void *in, const uint8_t *IV, const void *keys, - void *out, uint64_t len_bytes); -void aes_cbc_dec_256_sse(const void *in, const uint8_t *IV, const void *keys, - void *out, uint64_t len_bytes); +void +aes_cbc_enc_128_x8(AES_ARGS *args, uint64_t len_in_bytes); +void +aes_cbc_enc_192_x8(AES_ARGS *args, uint64_t len_in_bytes); +void +aes_cbc_enc_256_x8(AES_ARGS *args, uint64_t len_in_bytes); + +void +aes_cbc_dec_128_sse(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_192_sse(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_256_sse(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); /* AES-CTR */ -void aes_cntr_256_sse(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); -void aes_cntr_192_sse(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); -void aes_cntr_128_sse(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bytes, uint64_t IV_len); +void +aes_cntr_256_sse(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bytes, + uint64_t IV_len); +void +aes_cntr_192_sse(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bytes, + uint64_t IV_len); +void +aes_cntr_128_sse(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bytes, + uint64_t IV_len); /* AES-CTR-BITLEN */ -void aes_cntr_bit_256_sse(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bits, uint64_t IV_len); -void aes_cntr_bit_192_sse(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bits, uint64_t IV_len); -void aes_cntr_bit_128_sse(const void *in, const void *IV, const void *keys, - void *out, uint64_t len_bits, uint64_t IV_len); +void +aes_cntr_bit_256_sse(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bits, + uint64_t IV_len); +void +aes_cntr_bit_192_sse(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bits, + uint64_t IV_len); +void +aes_cntr_bit_128_sse(const void *in, const void *IV, const void *keys, void *out, uint64_t len_bits, + uint64_t IV_len); /* AES-CCM */ -IMB_JOB *aes_cntr_ccm_128_sse(IMB_JOB *job); +IMB_JOB * +aes_cntr_ccm_128_sse(IMB_JOB *job); -IMB_JOB *aes_cntr_ccm_256_sse(IMB_JOB *job); +IMB_JOB * +aes_cntr_ccm_256_sse(IMB_JOB *job); /* AES-ECB */ -void aes_ecb_enc_256_by4_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_192_by4_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_128_by4_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_dec_256_by4_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_192_by4_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_128_by4_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_quic_enc_128_sse(const void *in, const void *keys, - void *out, uint64_t num_buffers); -void aes_ecb_quic_enc_256_sse(const void *in, const void *keys, - void *out, uint64_t num_buffers); - +void +aes_ecb_enc_256_by4_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_192_by4_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_128_by4_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_dec_256_by4_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_192_by4_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_128_by4_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_quic_enc_128_sse(const void *in, const void *keys, void *out, uint64_t num_buffers); +void +aes_ecb_quic_enc_256_sse(const void *in, const void *keys, void *out, uint64_t num_buffers); /* AES128-ECBENC */ -void aes128_ecbenc_x3_sse(const void *in, void *keys, - void *out1, void *out2, void *out3); +void +aes128_ecbenc_x3_sse(const void *in, void *keys, void *out1, void *out2, void *out3); /* AES-CBCS */ -void aes_cbcs_1_9_dec_128_sse(const void *in, const uint8_t *IV, - const void *keys, void *out, - uint64_t len_bytes, void *next_iv); +void +aes_cbcs_1_9_dec_128_sse(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes, void *next_iv); /* AES-CFB */ -IMB_DLL_EXPORT void aes_cfb_128_one_sse(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); -IMB_DLL_EXPORT void aes_cfb_256_one_sse(void *out, const void *in, - const void *iv, const void *keys, - uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_128_one_sse(void *out, const void *in, const void *iv, const void *keys, uint64_t len); +IMB_DLL_EXPORT void +aes_cfb_256_one_sse(void *out, const void *in, const void *iv, const void *keys, uint64_t len); /* stitched AES128-CNTR, CRC32 and BIP */ -IMB_JOB *submit_job_pon_enc_sse(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_sse(IMB_JOB *job); +IMB_JOB * +submit_job_pon_enc_sse(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_sse(IMB_JOB *job); -IMB_JOB *submit_job_pon_enc_no_ctr_sse(IMB_JOB *job); -IMB_JOB *submit_job_pon_dec_no_ctr_sse(IMB_JOB *job); +IMB_JOB * +submit_job_pon_enc_no_ctr_sse(IMB_JOB *job); +IMB_JOB * +submit_job_pon_dec_no_ctr_sse(IMB_JOB *job); /* CRC */ -uint32_t ethernet_fcs_sse(const void *msg, const uint64_t len); -uint32_t crc16_x25_sse(const void *msg, const uint64_t len); -uint32_t crc32_sctp_sse(const void *msg, const uint64_t len); -uint32_t crc24_lte_a_sse(const void *msg, const uint64_t len); -uint32_t crc24_lte_b_sse(const void *msg, const uint64_t len); -uint32_t crc16_fp_data_sse(const void *msg, const uint64_t len); -uint32_t crc11_fp_header_sse(const void *msg, const uint64_t len); -uint32_t crc7_fp_header_sse(const void *msg, const uint64_t len); -uint32_t crc10_iuup_data_sse(const void *msg, const uint64_t len); -uint32_t crc6_iuup_header_sse(const void *msg, const uint64_t len); -uint32_t crc32_wimax_ofdma_data_sse(const void *msg, const uint64_t len); -uint32_t crc8_wimax_ofdma_hcs_sse(const void *msg, const uint64_t len); -uint32_t ethernet_fcs_sse_local(const void *msg, const uint64_t len, - const void *tag_ouput); +uint32_t +ethernet_fcs_sse(const void *msg, const uint64_t len); +uint32_t +crc16_x25_sse(const void *msg, const uint64_t len); +uint32_t +crc32_sctp_sse(const void *msg, const uint64_t len); +uint32_t +crc24_lte_a_sse(const void *msg, const uint64_t len); +uint32_t +crc24_lte_b_sse(const void *msg, const uint64_t len); +uint32_t +crc16_fp_data_sse(const void *msg, const uint64_t len); +uint32_t +crc11_fp_header_sse(const void *msg, const uint64_t len); +uint32_t +crc7_fp_header_sse(const void *msg, const uint64_t len); +uint32_t +crc10_iuup_data_sse(const void *msg, const uint64_t len); +uint32_t +crc6_iuup_header_sse(const void *msg, const uint64_t len); +uint32_t +crc32_wimax_ofdma_data_sse(const void *msg, const uint64_t len); +uint32_t +crc8_wimax_ofdma_hcs_sse(const void *msg, const uint64_t len); +uint32_t +ethernet_fcs_sse_local(const void *msg, const uint64_t len, const void *tag_ouput); /* SHA */ -void call_sha1_mult_sse_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); -void call_sha_256_mult_sse_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); -void call_sha512_x2_sse_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); - -IMB_DLL_EXPORT void sha1_sse(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha1_one_block_sse(const void *data, void *digest); -IMB_DLL_EXPORT void sha224_sse(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha224_one_block_sse(const void *data, void *digest); -IMB_DLL_EXPORT void sha256_sse(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha256_one_block_sse(const void *data, void *digest); -IMB_DLL_EXPORT void sha384_sse(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha384_one_block_sse(const void *data, void *digest); -IMB_DLL_EXPORT void sha512_sse(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha512_one_block_sse(const void *data, void *digest); +void +call_sha1_mult_sse_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); +void +call_sha_256_mult_sse_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); +void +call_sha512_x2_sse_from_c(SHA512_ARGS *args, uint64_t size_in_blocks); + +IMB_DLL_EXPORT void +sha1_sse(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha1_one_block_sse(const void *data, void *digest); +IMB_DLL_EXPORT void +sha224_sse(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha224_one_block_sse(const void *data, void *digest); +IMB_DLL_EXPORT void +sha256_sse(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha256_one_block_sse(const void *data, void *digest); +IMB_DLL_EXPORT void +sha384_sse(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha384_one_block_sse(const void *data, void *digest); +IMB_DLL_EXPORT void +sha512_sse(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha512_one_block_sse(const void *data, void *digest); /* moved from MB MGR */ -IMB_JOB *submit_job_aes128_enc_sse(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_enc_sse(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes192_enc_sse(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes192_enc_sse(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_aes256_enc_sse(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes256_enc_sse(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_hmac_sse(MB_MGR_HMAC_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sse(MB_MGR_HMAC_SHA_1_OOO *state); - -IMB_JOB *submit_job_hmac_sha_224_sse(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_224_sse(MB_MGR_HMAC_SHA_256_OOO *state); - -IMB_JOB *submit_job_hmac_sha_256_sse(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_256_sse(MB_MGR_HMAC_SHA_256_OOO *state); - -IMB_JOB *submit_job_hmac_sha_384_sse(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_384_sse(MB_MGR_HMAC_SHA_512_OOO *state); - -IMB_JOB *submit_job_hmac_sha_512_sse(MB_MGR_HMAC_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_512_sse(MB_MGR_HMAC_SHA_512_OOO *state); - -IMB_JOB *submit_job_hmac_md5_sse(MB_MGR_HMAC_MD5_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_md5_sse(MB_MGR_HMAC_MD5_OOO *state); - - -IMB_JOB *submit_job_aes_xcbc_sse(MB_MGR_AES_XCBC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes_xcbc_sse(MB_MGR_AES_XCBC_OOO *state); - -IMB_JOB *submit_job_aes128_cmac_auth_sse(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes128_cmac_auth_sse(MB_MGR_CMAC_OOO *state); - -IMB_JOB *submit_job_aes256_cmac_auth_sse(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes256_cmac_auth_sse(MB_MGR_CMAC_OOO *state); - -IMB_JOB *submit_job_aes128_ccm_auth_sse(MB_MGR_CCM_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_aes256_ccm_auth_sse(MB_MGR_CCM_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes128_ccm_auth_sse(MB_MGR_CCM_OOO *state); - -IMB_JOB *flush_job_aes256_ccm_auth_sse(MB_MGR_CCM_OOO *state); - -IMB_JOB *submit_job_zuc_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc256_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state); - -IMB_JOB *submit_job_zuc256_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); - -IMB_JOB *submit_job_sha1_sse(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha1_sse(MB_MGR_SHA_1_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha224_sse(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha224_sse(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha256_sse(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha256_sse(MB_MGR_SHA_256_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha384_sse(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha384_sse(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); - -IMB_JOB *submit_job_sha512_sse(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_sha512_sse(MB_MGR_SHA_512_OOO *state, - IMB_JOB *job); - -void aes_cmac_256_subkey_gen_sse(const void *key_exp, - void *key1, void *key2); -uint32_t hec_32_sse(const uint8_t *in); -uint64_t hec_64_sse(const uint8_t *in); - -IMB_JOB *submit_job_aes128_cbcs_1_9_enc_sse(MB_MGR_AES_OOO *state, - IMB_JOB *job); - -IMB_JOB *flush_job_aes128_cbcs_1_9_enc_sse(MB_MGR_AES_OOO *state); - -IMB_JOB *submit_job_chacha20_enc_dec_sse(IMB_JOB *job); - -IMB_JOB *snow_v_sse(IMB_JOB *job); -IMB_JOB *snow_v_aead_init_sse(IMB_JOB *job); - -IMB_JOB *submit_job_snow3g_uea2_sse(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_snow3g_uea2_sse(MB_MGR_SNOW3G_OOO *state); - -IMB_JOB *submit_job_snow3g_uia2_sse(MB_MGR_SNOW3G_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_snow3g_uia2_sse(MB_MGR_SNOW3G_OOO *state); +IMB_JOB * +submit_job_aes128_enc_sse(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_enc_sse(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes192_enc_sse(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes192_enc_sse(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_aes256_enc_sse(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes256_enc_sse(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_hmac_sse(MB_MGR_HMAC_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sse(MB_MGR_HMAC_SHA_1_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_224_sse(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_224_sse(MB_MGR_HMAC_SHA_256_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_256_sse(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_256_sse(MB_MGR_HMAC_SHA_256_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_384_sse(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_384_sse(MB_MGR_HMAC_SHA_512_OOO *state); + +IMB_JOB * +submit_job_hmac_sha_512_sse(MB_MGR_HMAC_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_512_sse(MB_MGR_HMAC_SHA_512_OOO *state); + +IMB_JOB * +submit_job_hmac_md5_sse(MB_MGR_HMAC_MD5_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_md5_sse(MB_MGR_HMAC_MD5_OOO *state); + +IMB_JOB * +submit_job_aes_xcbc_sse(MB_MGR_AES_XCBC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes_xcbc_sse(MB_MGR_AES_XCBC_OOO *state); + +IMB_JOB * +submit_job_aes128_cmac_auth_sse(MB_MGR_CMAC_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes128_cmac_auth_sse(MB_MGR_CMAC_OOO *state); + +IMB_JOB * +submit_job_aes256_cmac_auth_sse(MB_MGR_CMAC_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes256_cmac_auth_sse(MB_MGR_CMAC_OOO *state); + +IMB_JOB * +submit_job_aes128_ccm_auth_sse(MB_MGR_CCM_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_aes256_ccm_auth_sse(MB_MGR_CCM_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes128_ccm_auth_sse(MB_MGR_CCM_OOO *state); + +IMB_JOB * +flush_job_aes256_ccm_auth_sse(MB_MGR_CCM_OOO *state); + +IMB_JOB * +submit_job_zuc_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc256_eea3_no_gfni_sse(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state); + +IMB_JOB * +submit_job_zuc256_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_no_gfni_sse(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); + +IMB_JOB * +submit_job_sha1_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha1_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha224_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha224_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha256_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha256_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha384_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha384_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); + +IMB_JOB * +submit_job_sha512_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha512_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job); + +void +aes_cmac_256_subkey_gen_sse(const void *key_exp, void *key1, void *key2); +uint32_t +hec_32_sse(const uint8_t *in); +uint64_t +hec_64_sse(const uint8_t *in); + +IMB_JOB * +submit_job_aes128_cbcs_1_9_enc_sse(MB_MGR_AES_OOO *state, IMB_JOB *job); + +IMB_JOB * +flush_job_aes128_cbcs_1_9_enc_sse(MB_MGR_AES_OOO *state); + +IMB_JOB * +submit_job_chacha20_enc_dec_sse(IMB_JOB *job); + +IMB_JOB * +snow_v_sse(IMB_JOB *job); +IMB_JOB * +snow_v_aead_init_sse(IMB_JOB *job); + +IMB_JOB * +submit_job_snow3g_uea2_sse(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_snow3g_uea2_sse(MB_MGR_SNOW3G_OOO *state); + +IMB_JOB * +submit_job_snow3g_uia2_sse(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_snow3g_uia2_sse(MB_MGR_SNOW3G_OOO *state); -IMB_DLL_EXPORT void set_suite_id_sse_t1(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_sse_t1(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ARCH_SSE_TYPE1_H */ diff --git a/lib/include/arch_sse_type2.h b/lib/include/arch_sse_type2.h index 77c66403..b291f9a9 100644 --- a/lib/include/arch_sse_type2.h +++ b/lib/include/arch_sse_type2.h @@ -34,48 +34,64 @@ #include "ipsec_ooo_mgr.h" /* SHA */ -void call_sha1_ni_x2_sse_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); -void call_sha224_ni_x2_sse_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); -void call_sha256_ni_x2_sse_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); - -IMB_DLL_EXPORT void sha1_sse_shani(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha1_one_block_sse_shani(const void *data, void *digest); - -IMB_DLL_EXPORT void sha224_sse_shani(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha224_one_block_sse_shani(const void *data, void *digest); - -IMB_DLL_EXPORT void sha256_sse_shani(const void *data, const uint64_t length, - void *digest); -IMB_DLL_EXPORT void sha256_one_block_sse_shani(const void *data, void *digest); +void +call_sha1_ni_x2_sse_from_c(SHA1_ARGS *args, uint32_t size_in_blocks); +void +call_sha224_ni_x2_sse_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); +void +call_sha256_ni_x2_sse_from_c(SHA256_ARGS *args, uint32_t size_in_blocks); + +IMB_DLL_EXPORT void +sha1_sse_shani(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha1_one_block_sse_shani(const void *data, void *digest); + +IMB_DLL_EXPORT void +sha224_sse_shani(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha224_one_block_sse_shani(const void *data, void *digest); + +IMB_DLL_EXPORT void +sha256_sse_shani(const void *data, const uint64_t length, void *digest); +IMB_DLL_EXPORT void +sha256_one_block_sse_shani(const void *data, void *digest); /* Moved from MB MGR */ -IMB_JOB *submit_job_hmac_ni_sse(MB_MGR_HMAC_SHA_1_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_ni_sse(MB_MGR_HMAC_SHA_1_OOO *state); +IMB_JOB * +submit_job_hmac_ni_sse(MB_MGR_HMAC_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_ni_sse(MB_MGR_HMAC_SHA_1_OOO *state); -IMB_JOB *submit_job_hmac_sha_224_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_224_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state); +IMB_JOB * +submit_job_hmac_sha_224_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_224_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state); -IMB_JOB *submit_job_hmac_sha_256_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_hmac_sha_256_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state); +IMB_JOB * +submit_job_hmac_sha_256_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_hmac_sha_256_ni_sse(MB_MGR_HMAC_SHA_256_OOO *state); -IMB_JOB *submit_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); -IMB_JOB *submit_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +submit_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job); -IMB_DLL_EXPORT void set_suite_id_sse_t2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_sse_t2(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ARCH_SSE_TYPE2_H */ diff --git a/lib/include/arch_sse_type3.h b/lib/include/arch_sse_type3.h index 02df33aa..66bc76a0 100644 --- a/lib/include/arch_sse_type3.h +++ b/lib/include/arch_sse_type3.h @@ -34,84 +34,100 @@ #include "ipsec_ooo_mgr.h" /* AES-CBC */ -void aes_cbc_enc_128_x8_sse(AES_ARGS *args, uint64_t len_in_bytes); -void aes_cbc_enc_192_x8_sse(AES_ARGS *args, uint64_t len_in_bytes); -void aes_cbc_enc_256_x8_sse(AES_ARGS *args, uint64_t len_in_bytes); - -void aes_cbc_dec_128_by8_sse(const void *in, const uint8_t *IV, - const void *keys, void *out, uint64_t len_bytes); -void aes_cbc_dec_192_by8_sse(const void *in, const uint8_t *IV, - const void *keys, void *out, uint64_t len_bytes); -void aes_cbc_dec_256_by8_sse(const void *in, const uint8_t *IV, - const void *keys, void *out, uint64_t len_bytes); +void +aes_cbc_enc_128_x8_sse(AES_ARGS *args, uint64_t len_in_bytes); +void +aes_cbc_enc_192_x8_sse(AES_ARGS *args, uint64_t len_in_bytes); +void +aes_cbc_enc_256_x8_sse(AES_ARGS *args, uint64_t len_in_bytes); + +void +aes_cbc_dec_128_by8_sse(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_192_by8_sse(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); +void +aes_cbc_dec_256_by8_sse(const void *in, const uint8_t *IV, const void *keys, void *out, + uint64_t len_bytes); /* AES-ECB */ -void aes_ecb_enc_256_by8_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_192_by8_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_enc_128_by8_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); - -void aes_ecb_dec_256_by8_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_192_by8_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); -void aes_ecb_dec_128_by8_sse(const void *in, const void *keys, - void *out, uint64_t len_bytes); +void +aes_ecb_enc_256_by8_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_192_by8_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_enc_128_by8_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); + +void +aes_ecb_dec_256_by8_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_192_by8_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); +void +aes_ecb_dec_128_by8_sse(const void *in, const void *keys, void *out, uint64_t len_bytes); /* moved from MB MGR */ -IMB_JOB *submit_job_aes128_enc_x8_sse(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes128_enc_x8_sse(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_aes128_enc_x8_sse(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes128_enc_x8_sse(MB_MGR_AES_OOO *state); -IMB_JOB *submit_job_aes192_enc_x8_sse(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes192_enc_x8_sse(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_aes192_enc_x8_sse(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes192_enc_x8_sse(MB_MGR_AES_OOO *state); -IMB_JOB *submit_job_aes256_enc_x8_sse(MB_MGR_AES_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_aes256_enc_x8_sse(MB_MGR_AES_OOO *state); +IMB_JOB * +submit_job_aes256_enc_x8_sse(MB_MGR_AES_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_aes256_enc_x8_sse(MB_MGR_AES_OOO *state); -IMB_JOB *submit_job_aes128_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_aes128_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_aes128_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state); +IMB_JOB * +flush_job_aes128_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state); -IMB_JOB *submit_job_aes256_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_aes256_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_aes256_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state); +IMB_JOB * +flush_job_aes256_cmac_auth_x8_sse(MB_MGR_CMAC_OOO *state); -IMB_JOB *submit_job_aes128_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_aes128_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_aes128_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state); +IMB_JOB * +flush_job_aes128_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state); -IMB_JOB *submit_job_aes256_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state, - IMB_JOB *job); +IMB_JOB * +submit_job_aes256_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state, IMB_JOB *job); -IMB_JOB *flush_job_aes256_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state); +IMB_JOB * +flush_job_aes256_ccm_auth_x8_sse(MB_MGR_CCM_OOO *state); -IMB_JOB *submit_job_zuc_eea3_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eea3_gfni_sse(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc_eea3_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eea3_gfni_sse(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc256_eea3_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc256_eea3_gfni_sse(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc256_eea3_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc256_eea3_gfni_sse(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc_eia3_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job); -IMB_JOB *flush_job_zuc_eia3_gfni_sse(MB_MGR_ZUC_OOO *state); +IMB_JOB * +submit_job_zuc_eia3_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job); +IMB_JOB * +flush_job_zuc_eia3_gfni_sse(MB_MGR_ZUC_OOO *state); -IMB_JOB *submit_job_zuc256_eia3_gfni_sse(MB_MGR_ZUC_OOO *state, - IMB_JOB *job, - const uint64_t tag_sz); -IMB_JOB *flush_job_zuc256_eia3_gfni_sse(MB_MGR_ZUC_OOO *state, - const uint64_t tag_sz); +IMB_JOB * +submit_job_zuc256_eia3_gfni_sse(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint64_t tag_sz); +IMB_JOB * +flush_job_zuc256_eia3_gfni_sse(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); -IMB_DLL_EXPORT void set_suite_id_sse_t3(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT void +set_suite_id_sse_t3(IMB_MGR *state, IMB_JOB *job); #endif /* IMB_ASM_SSE_T3_H */ diff --git a/lib/include/arch_x86_64.h b/lib/include/arch_x86_64.h index 87d4a9bc..da6967af 100644 --- a/lib/include/arch_x86_64.h +++ b/lib/include/arch_x86_64.h @@ -30,10 +30,10 @@ #include "ipsec-mb.h" -IMB_DLL_LOCAL void *poly1305_mac_scalar(IMB_JOB *job); +IMB_DLL_LOCAL void * +poly1305_mac_scalar(IMB_JOB *job); IMB_DLL_LOCAL void -poly1305_aead_update_scalar(const void *msg, const uint64_t msg_len, - void *hash, const void *key); +poly1305_aead_update_scalar(const void *msg, const uint64_t msg_len, void *hash, const void *key); IMB_DLL_LOCAL void poly1305_aead_complete_scalar(const void *hash, const void *key, void *tag); @@ -47,8 +47,9 @@ poly1305_aead_complete_scalar(const void *hash, const void *key, void *tag); * @param ivec pointer to initialization vector */ IMB_DLL_LOCAL -void des_enc_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec); +void +des_enc_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec); /** * @brief DES CBC decryption @@ -60,8 +61,9 @@ void des_enc_cbc_basic(const void *input, void *output, const int size, * @param ivec pointer to initialization vector */ IMB_DLL_LOCAL -void des_dec_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec); +void +des_dec_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec); /** * @brief 3DES CBC encryption @@ -75,9 +77,9 @@ void des_dec_cbc_basic(const void *input, void *output, const int size, * @param ivec pointer to initialization vector */ IMB_DLL_LOCAL -void des3_enc_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks1, const uint64_t *ks2, - const uint64_t *ks3, const uint64_t *ivec); +void +des3_enc_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks1, + const uint64_t *ks2, const uint64_t *ks3, const uint64_t *ivec); /** * @brief 3DES CBC decryption @@ -91,9 +93,9 @@ void des3_enc_cbc_basic(const void *input, void *output, const int size, * @param ivec pointer to initialization vector */ IMB_DLL_LOCAL -void des3_dec_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks1, const uint64_t *ks2, - const uint64_t *ks3, const uint64_t *ivec); +void +des3_dec_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks1, + const uint64_t *ks2, const uint64_t *ks3, const uint64_t *ivec); /** * @brief DOCSIS DES encryption @@ -105,8 +107,9 @@ void des3_dec_cbc_basic(const void *input, void *output, const int size, * @param ivec pointer to initialization vector */ IMB_DLL_LOCAL -void docsis_des_enc_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec); +void +docsis_des_enc_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec); /** * @brief DOCSIS DES decryption @@ -118,8 +121,9 @@ void docsis_des_enc_basic(const void *input, void *output, const int size, * @param ivec pointer to initialization vector */ IMB_DLL_LOCAL -void docsis_des_dec_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec); +void +docsis_des_dec_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec); /** * @brief Runs self test on selected CAVP algorithms @@ -130,7 +134,8 @@ void docsis_des_dec_basic(const void *input, void *output, const int size, * @retval 0 self test failed * @retval 1 self test passed */ -IMB_DLL_LOCAL int self_test(IMB_MGR *p_mgr); +IMB_DLL_LOCAL int +self_test(IMB_MGR *p_mgr); /** * @brief Atomic 64-bit counter increment @@ -141,6 +146,7 @@ IMB_DLL_LOCAL int self_test(IMB_MGR *p_mgr); * * @return Counter value prior to increment */ -IMB_DLL_LOCAL uint64_t atomic_uint64_inc(uint64_t *counter); +IMB_DLL_LOCAL uint64_t +atomic_uint64_inc(uint64_t *counter); #endif /* IMB_ARCH_X86_64_H */ diff --git a/lib/include/chacha20_poly1305.h b/lib/include/chacha20_poly1305.h index 38f14f84..c2254209 100644 --- a/lib/include/chacha20_poly1305.h +++ b/lib/include/chacha20_poly1305.h @@ -32,166 +32,171 @@ #include "include/arch_x86_64.h" /* new internal API's */ -IMB_JOB *aead_chacha20_poly1305_sse(IMB_MGR *mgr, IMB_JOB *job); -IMB_JOB *aead_chacha20_poly1305_avx(IMB_MGR *mgr, IMB_JOB *job); -IMB_JOB *aead_chacha20_poly1305_avx2(IMB_MGR *mgr, IMB_JOB *job); -IMB_JOB *aead_chacha20_poly1305_avx512(IMB_MGR *mgr, IMB_JOB *job); - -IMB_JOB *aead_chacha20_poly1305_sgl_sse(IMB_MGR *mgr, IMB_JOB *job); -IMB_JOB *aead_chacha20_poly1305_sgl_avx(IMB_MGR *mgr, IMB_JOB *job); -IMB_JOB *aead_chacha20_poly1305_sgl_avx2(IMB_MGR *mgr, IMB_JOB *job); -IMB_JOB *aead_chacha20_poly1305_sgl_avx512(IMB_MGR *mgr, IMB_JOB *job); +IMB_JOB * +aead_chacha20_poly1305_sse(IMB_MGR *mgr, IMB_JOB *job); +IMB_JOB * +aead_chacha20_poly1305_avx(IMB_MGR *mgr, IMB_JOB *job); +IMB_JOB * +aead_chacha20_poly1305_avx2(IMB_MGR *mgr, IMB_JOB *job); +IMB_JOB * +aead_chacha20_poly1305_avx512(IMB_MGR *mgr, IMB_JOB *job); + +IMB_JOB * +aead_chacha20_poly1305_sgl_sse(IMB_MGR *mgr, IMB_JOB *job); +IMB_JOB * +aead_chacha20_poly1305_sgl_avx(IMB_MGR *mgr, IMB_JOB *job); +IMB_JOB * +aead_chacha20_poly1305_sgl_avx2(IMB_MGR *mgr, IMB_JOB *job); +IMB_JOB * +aead_chacha20_poly1305_sgl_avx512(IMB_MGR *mgr, IMB_JOB *job); /* external symbols needed to implement the above */ -IMB_JOB *submit_job_chacha20_enc_dec_sse(IMB_JOB *); -void chacha20_enc_dec_ks_sse(const void *src, void *dst, - const uint64_t length, const void *key, - const struct chacha20_poly1305_context_data *ctx); -IMB_JOB *submit_job_chacha20_poly_dec_sse(IMB_JOB *, const void *ks, - const uint64_t len_to_xor); -IMB_JOB *submit_job_chacha20_enc_dec_avx(IMB_JOB *); -void chacha20_enc_dec_ks_avx(const void *src, void *dst, - const uint64_t length, const void *key, - const struct chacha20_poly1305_context_data *ctx); -IMB_JOB *submit_job_chacha20_enc_dec_avx2(IMB_JOB *); -void chacha20_enc_dec_ks_avx2(const void *src, void *dst, - const uint64_t length, const void *key, - const struct chacha20_poly1305_context_data *ctx); -IMB_JOB *submit_job_chacha20_enc_dec_avx512(IMB_JOB *); -void chacha20_enc_dec_ks_avx512(const void *src, void *dst, - const uint64_t length, const void *key, - const struct chacha20_poly1305_context_data *ctx); -IMB_JOB *submit_job_chacha20_poly_enc_avx512(IMB_JOB *, void *poly_key); -IMB_JOB *submit_job_chacha20_poly_dec_avx512(IMB_JOB *, const void *ks, - const uint64_t len_to_xor); -IMB_JOB *submit_job_chacha20_poly_enc_sse(IMB_JOB *, void *poly_key); - -void poly1305_key_gen_sse(const void *key, const void *iv, void *poly_key); -void poly1305_key_gen_avx(const void *key, const void *iv, void *poly_key); - -void poly1305_aead_update_avx512(const void *msg, const uint64_t msg_len, - void *hash, const void *key); -void poly1305_aead_complete_avx512(const void *hash, const void *key, - void *tag); - -void poly1305_aead_update_fma_avx512(const void *msg, const uint64_t msg_len, - void *hash, const void *key); -void poly1305_aead_complete_fma_avx512(const void *hash, const void *key, - void *tag); +IMB_JOB * +submit_job_chacha20_enc_dec_sse(IMB_JOB *); +void +chacha20_enc_dec_ks_sse(const void *src, void *dst, const uint64_t length, const void *key, + const struct chacha20_poly1305_context_data *ctx); +IMB_JOB * +submit_job_chacha20_poly_dec_sse(IMB_JOB *, const void *ks, const uint64_t len_to_xor); +IMB_JOB * +submit_job_chacha20_enc_dec_avx(IMB_JOB *); +void +chacha20_enc_dec_ks_avx(const void *src, void *dst, const uint64_t length, const void *key, + const struct chacha20_poly1305_context_data *ctx); +IMB_JOB * +submit_job_chacha20_enc_dec_avx2(IMB_JOB *); +void +chacha20_enc_dec_ks_avx2(const void *src, void *dst, const uint64_t length, const void *key, + const struct chacha20_poly1305_context_data *ctx); +IMB_JOB * +submit_job_chacha20_enc_dec_avx512(IMB_JOB *); +void +chacha20_enc_dec_ks_avx512(const void *src, void *dst, const uint64_t length, const void *key, + const struct chacha20_poly1305_context_data *ctx); +IMB_JOB * +submit_job_chacha20_poly_enc_avx512(IMB_JOB *, void *poly_key); +IMB_JOB * +submit_job_chacha20_poly_dec_avx512(IMB_JOB *, const void *ks, const uint64_t len_to_xor); +IMB_JOB * +submit_job_chacha20_poly_enc_sse(IMB_JOB *, void *poly_key); + +void +poly1305_key_gen_sse(const void *key, const void *iv, void *poly_key); +void +poly1305_key_gen_avx(const void *key, const void *iv, void *poly_key); + +void +poly1305_aead_update_avx512(const void *msg, const uint64_t msg_len, void *hash, const void *key); +void +poly1305_aead_complete_avx512(const void *hash, const void *key, void *tag); + +void +poly1305_aead_update_fma_avx512(const void *msg, const uint64_t msg_len, void *hash, + const void *key); +void +poly1305_aead_complete_fma_avx512(const void *hash, const void *key, void *tag); #ifdef AVX_IFMA -void poly1305_aead_update_fma_avx2(const void *msg, const uint64_t msg_len, - void *hash, const void *key); -void poly1305_aead_complete_fma_avx2(const void *hash, const void *key, - void *tag); +void +poly1305_aead_update_fma_avx2(const void *msg, const uint64_t msg_len, void *hash, const void *key); +void +poly1305_aead_complete_fma_avx2(const void *hash, const void *key, void *tag); #endif -void gen_keystr_poly_key_sse(const void *key, const void *iv, - const uint64_t len, void *ks); - -void gen_keystr_poly_key_avx512(const void *key, const void *iv, - const uint64_t len, void *ks); - -void init_chacha20_poly1305_sse(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len); -void init_chacha20_poly1305_avx(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len); -void init_chacha20_poly1305_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len); +void +gen_keystr_poly_key_sse(const void *key, const void *iv, const uint64_t len, void *ks); + +void +gen_keystr_poly_key_avx512(const void *key, const void *iv, const uint64_t len, void *ks); + +void +init_chacha20_poly1305_sse(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len); +void +init_chacha20_poly1305_avx(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len); +void +init_chacha20_poly1305_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len); #ifdef AVX_IFMA -void init_chacha20_poly1305_fma_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len); +void +init_chacha20_poly1305_fma_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len); #endif -void init_chacha20_poly1305_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len); -void init_chacha20_poly1305_fma_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len); -void update_enc_chacha20_poly1305_sse(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void update_enc_chacha20_poly1305_avx(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void update_enc_chacha20_poly1305_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); +void +init_chacha20_poly1305_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len); +void +init_chacha20_poly1305_fma_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len); +void +update_enc_chacha20_poly1305_sse(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +update_enc_chacha20_poly1305_avx(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +update_enc_chacha20_poly1305_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); #ifdef AVX_IFMA -void update_enc_chacha20_poly1305_fma_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); +void +update_enc_chacha20_poly1305_fma_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); #endif -void update_enc_chacha20_poly1305_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void update_enc_chacha20_poly1305_fma_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void update_dec_chacha20_poly1305_sse(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void update_dec_chacha20_poly1305_avx(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void update_dec_chacha20_poly1305_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); +void +update_enc_chacha20_poly1305_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +update_enc_chacha20_poly1305_fma_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +update_dec_chacha20_poly1305_sse(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +update_dec_chacha20_poly1305_avx(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +update_dec_chacha20_poly1305_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); #ifdef AVX_IFMA -void update_dec_chacha20_poly1305_fma_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); +void +update_dec_chacha20_poly1305_fma_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); #endif -void update_dec_chacha20_poly1305_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void update_dec_chacha20_poly1305_fma_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len); -void finalize_chacha20_poly1305_sse(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len); -void finalize_chacha20_poly1305_avx(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len); -void finalize_chacha20_poly1305_avx2(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len); +void +update_dec_chacha20_poly1305_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +update_dec_chacha20_poly1305_fma_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len); +void +finalize_chacha20_poly1305_sse(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len); +void +finalize_chacha20_poly1305_avx(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len); +void +finalize_chacha20_poly1305_avx2(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len); #ifdef AVX_IFMA void -finalize_chacha20_poly1305_fma_avx2(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len); +finalize_chacha20_poly1305_fma_avx2(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len); #endif -void finalize_chacha20_poly1305_avx512( - struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len); -void finalize_chacha20_poly1305_fma_avx512( - struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len); - -void quic_chacha20_sse(const void *key, const void * const src_ptr_array[], - void *dst_ptr_array[], const uint64_t num_buffers); -void quic_chacha20_avx2(const void *key, const void * const src_ptr_array[], - void *dst_ptr_array[], const uint64_t num_buffers); -void quic_chacha20_avx512(const void *key, const void * const src_ptr_array[], - void *dst_ptr_array[], const uint64_t num_buffers); +void +finalize_chacha20_poly1305_avx512(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len); +void +finalize_chacha20_poly1305_fma_avx512(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len); + +void +quic_chacha20_sse(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], + const uint64_t num_buffers); +void +quic_chacha20_avx2(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], + const uint64_t num_buffers); +void +quic_chacha20_avx512(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], + const uint64_t num_buffers); #endif /* IMB_CHACHA20POLY1305_H */ diff --git a/lib/include/clear_regs_mem.h b/lib/include/clear_regs_mem.h index 4b923818..7c90b2a0 100644 --- a/lib/include/clear_regs_mem.h +++ b/lib/include/clear_regs_mem.h @@ -30,7 +30,8 @@ #define CLEAR_SCRATCH_GPS clear_scratch_gps -void force_memset_zero(void *mem, const size_t size); +void +force_memset_zero(void *mem, const size_t size); static inline void clear_mem(void *mem, const size_t size) @@ -44,10 +45,15 @@ clear_var(void *var, const size_t size) force_memset_zero(var, size); } -void clear_scratch_gps(void); -void clear_scratch_xmms_sse(void); -void clear_scratch_xmms_avx(void); -void clear_scratch_ymms(void); -void clear_scratch_zmms(void); +void +clear_scratch_gps(void); +void +clear_scratch_xmms_sse(void); +void +clear_scratch_xmms_avx(void); +void +clear_scratch_ymms(void); +void +clear_scratch_zmms(void); #endif /* CLEAR_REGS_H */ diff --git a/lib/include/constant_lookup.h b/lib/include/constant_lookup.h index d95c34e1..9382a2d9 100644 --- a/lib/include/constant_lookup.h +++ b/lib/include/constant_lookup.h @@ -38,39 +38,23 @@ #endif #ifdef SAFE_LOOKUP -#define LOOKUP8_SSE(_table, _idx, _size) \ - lookup_8bit_sse(_table, _idx, _size) -#define LOOKUP8_AVX(_table, _idx, _size) \ - lookup_8bit_avx(_table, _idx, _size) -#define LOOKUP16_SSE(_table, _idx, _size) \ - lookup_16bit_sse(_table, _idx, _size) -#define LOOKUP16_AVX(_table, _idx, _size) \ - lookup_16bit_avx(_table, _idx, _size) -#define LOOKUP32_SSE(_table, _idx, _size) \ - lookup_32bit_sse(_table, _idx, _size) -#define LOOKUP32_AVX(_table, _idx, _size) \ - lookup_32bit_avx(_table, _idx, _size) -#define LOOKUP64_SSE(_table, _idx, _size) \ - lookup_64bit_sse(_table, _idx, _size) -#define LOOKUP64_AVX(_table, _idx, _size) \ - lookup_64bit_avx(_table, _idx, _size) +#define LOOKUP8_SSE(_table, _idx, _size) lookup_8bit_sse(_table, _idx, _size) +#define LOOKUP8_AVX(_table, _idx, _size) lookup_8bit_avx(_table, _idx, _size) +#define LOOKUP16_SSE(_table, _idx, _size) lookup_16bit_sse(_table, _idx, _size) +#define LOOKUP16_AVX(_table, _idx, _size) lookup_16bit_avx(_table, _idx, _size) +#define LOOKUP32_SSE(_table, _idx, _size) lookup_32bit_sse(_table, _idx, _size) +#define LOOKUP32_AVX(_table, _idx, _size) lookup_32bit_avx(_table, _idx, _size) +#define LOOKUP64_SSE(_table, _idx, _size) lookup_64bit_sse(_table, _idx, _size) +#define LOOKUP64_AVX(_table, _idx, _size) lookup_64bit_avx(_table, _idx, _size) #else -#define LOOKUP8_SSE(_table, _idx, _size) \ - _table[_idx] -#define LOOKUP8_AVX(_table, _idx, _size) \ - _table[_idx] -#define LOOKUP16_SSE(_table, _idx, _size) \ - _table[_idx] -#define LOOKUP16_AVX(_table, _idx, _size) \ - _table[_idx] -#define LOOKUP32_SSE(_table, _idx, _size) \ - _table[_idx] -#define LOOKUP32_AVX(_table, _idx, _size) \ - _table[_idx] -#define LOOKUP64_SSE(_table, _idx, _size) \ - _table[_idx] -#define LOOKUP64_AVX(_table, _idx, _size) \ - _table[_idx] +#define LOOKUP8_SSE(_table, _idx, _size) _table[_idx] +#define LOOKUP8_AVX(_table, _idx, _size) _table[_idx] +#define LOOKUP16_SSE(_table, _idx, _size) _table[_idx] +#define LOOKUP16_AVX(_table, _idx, _size) _table[_idx] +#define LOOKUP32_SSE(_table, _idx, _size) _table[_idx] +#define LOOKUP32_AVX(_table, _idx, _size) _table[_idx] +#define LOOKUP64_SSE(_table, _idx, _size) _table[_idx] +#define LOOKUP64_AVX(_table, _idx, _size) _table[_idx] #endif /** diff --git a/lib/include/constants.h b/lib/include/constants.h index 91b21afa..2cb539b7 100644 --- a/lib/include/constants.h +++ b/lib/include/constants.h @@ -29,55 +29,55 @@ #define IMB_CONSTANTS_H_ /* define SHA1 constants */ -#define H0 0x67452301 -#define H1 0xefcdab89 -#define H2 0x98badcfe -#define H3 0x10325476 -#define H4 0xc3d2e1f0 +#define H0 0x67452301 +#define H1 0xefcdab89 +#define H2 0x98badcfe +#define H3 0x10325476 +#define H4 0xc3d2e1f0 #define SHA1_PAD_SIZE 8 /* define SHA256 constants */ -#define SHA256_H0 0x6a09e667 -#define SHA256_H1 0xbb67ae85 -#define SHA256_H2 0x3c6ef372 -#define SHA256_H3 0xa54ff53a -#define SHA256_H4 0x510e527f -#define SHA256_H5 0x9b05688c -#define SHA256_H6 0x1f83d9ab -#define SHA256_H7 0x5be0cd19 +#define SHA256_H0 0x6a09e667 +#define SHA256_H1 0xbb67ae85 +#define SHA256_H2 0x3c6ef372 +#define SHA256_H3 0xa54ff53a +#define SHA256_H4 0x510e527f +#define SHA256_H5 0x9b05688c +#define SHA256_H6 0x1f83d9ab +#define SHA256_H7 0x5be0cd19 #define SHA256_PAD_SIZE 8 /* define SHA224 constants */ -#define SHA224_H0 0xc1059ed8 -#define SHA224_H1 0x367cd507 -#define SHA224_H2 0x3070dd17 -#define SHA224_H3 0xf70e5939 -#define SHA224_H4 0xffc00b31 -#define SHA224_H5 0x68581511 -#define SHA224_H6 0x64f98fa7 -#define SHA224_H7 0xbefa4fa4 +#define SHA224_H0 0xc1059ed8 +#define SHA224_H1 0x367cd507 +#define SHA224_H2 0x3070dd17 +#define SHA224_H3 0xf70e5939 +#define SHA224_H4 0xffc00b31 +#define SHA224_H5 0x68581511 +#define SHA224_H6 0x64f98fa7 +#define SHA224_H7 0xbefa4fa4 #define SHA224_PAD_SIZE 8 /* define SHA512 constants */ -#define SHA512_H0 0x6a09e667f3bcc908 -#define SHA512_H1 0xbb67ae8584caa73b -#define SHA512_H2 0x3c6ef372fe94f82b -#define SHA512_H3 0xa54ff53a5f1d36f1 -#define SHA512_H4 0x510e527fade682d1 -#define SHA512_H5 0x9b05688c2b3e6c1f -#define SHA512_H6 0x1f83d9abfb41bd6b -#define SHA512_H7 0x5be0cd19137e2179 +#define SHA512_H0 0x6a09e667f3bcc908 +#define SHA512_H1 0xbb67ae8584caa73b +#define SHA512_H2 0x3c6ef372fe94f82b +#define SHA512_H3 0xa54ff53a5f1d36f1 +#define SHA512_H4 0x510e527fade682d1 +#define SHA512_H5 0x9b05688c2b3e6c1f +#define SHA512_H6 0x1f83d9abfb41bd6b +#define SHA512_H7 0x5be0cd19137e2179 #define SHA512_PAD_SIZE 16 /* define SHA384 constants */ -#define SHA384_H0 0xcbbb9d5dc1059ed8 -#define SHA384_H1 0x629a292a367cd507 -#define SHA384_H2 0x9159015a3070dd17 -#define SHA384_H3 0x152fecd8f70e5939 -#define SHA384_H4 0x67332667ffc00b31 -#define SHA384_H5 0x8eb44a8768581511 -#define SHA384_H6 0xdb0c2e0d64f98fa7 -#define SHA384_H7 0x47b5481dbefa4fa4 +#define SHA384_H0 0xcbbb9d5dc1059ed8 +#define SHA384_H1 0x629a292a367cd507 +#define SHA384_H2 0x9159015a3070dd17 +#define SHA384_H3 0x152fecd8f70e5939 +#define SHA384_H4 0x67332667ffc00b31 +#define SHA384_H5 0x8eb44a8768581511 +#define SHA384_H6 0xdb0c2e0d64f98fa7 +#define SHA384_H7 0x47b5481dbefa4fa4 #define SHA384_PAD_SIZE 16 #endif /* IMB_CONSTANTS_H_ */ diff --git a/lib/include/cpu_feature.h b/lib/include/cpu_feature.h index 9620588f..b50a9703 100644 --- a/lib/include/cpu_feature.h +++ b/lib/include/cpu_feature.h @@ -36,7 +36,8 @@ * @return Bitmask representing presence of CPU features/extensions, * see ipsec-mb.h IMB_FEATURE_xyz definitions for details. */ -IMB_DLL_LOCAL uint64_t cpu_feature_detect(void); +IMB_DLL_LOCAL uint64_t +cpu_feature_detect(void); /** * @brief Modifies CPU \a features mask based on requested \a flags diff --git a/lib/include/des.h b/lib/include/des.h index 39ae99ea..d97dd55c 100644 --- a/lib/include/des.h +++ b/lib/include/des.h @@ -41,16 +41,13 @@ * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DES_CBC_ENC(IMB_JOB *job) { IMB_ASSERT(!(job->status & IMB_STATUS_COMPLETED_CIPHER)); - des_enc_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, - job->dst, - job->msg_len_to_cipher_in_bytes & - (~(IMB_DES_BLOCK_SIZE - 1)), - job->enc_keys, (const uint64_t *)job->iv); + des_enc_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~(IMB_DES_BLOCK_SIZE - 1)), + job->enc_keys, (const uint64_t *) job->iv); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } @@ -61,16 +58,13 @@ DES_CBC_ENC(IMB_JOB *job) * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DES_CBC_DEC(IMB_JOB *job) { IMB_ASSERT(!(job->status & IMB_STATUS_COMPLETED_CIPHER)); - des_dec_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, - job->dst, - job->msg_len_to_cipher_in_bytes & - (~(IMB_DES_BLOCK_SIZE - 1)), - job->dec_keys, (const uint64_t *)job->iv); + des_dec_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~(IMB_DES_BLOCK_SIZE - 1)), + job->dec_keys, (const uint64_t *) job->iv); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } @@ -81,20 +75,15 @@ DES_CBC_DEC(IMB_JOB *job) * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DES3_CBC_ENC(IMB_JOB *job) { - const void * const *ks_ptr = - (const void * const *)job->enc_keys; + const void *const *ks_ptr = (const void *const *) job->enc_keys; IMB_ASSERT(!(job->status & IMB_STATUS_COMPLETED_CIPHER)); - des3_enc_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, - job->dst, - job->msg_len_to_cipher_in_bytes & - (~(IMB_DES_BLOCK_SIZE - 1)), - ks_ptr[0], ks_ptr[1], ks_ptr[2], - (const uint64_t *)job->iv); + des3_enc_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~(IMB_DES_BLOCK_SIZE - 1)), ks_ptr[0], + ks_ptr[1], ks_ptr[2], (const uint64_t *) job->iv); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } @@ -105,23 +94,17 @@ DES3_CBC_ENC(IMB_JOB *job) * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DES3_CBC_DEC(IMB_JOB *job) { - const void * const *ks_ptr = - (const void * const *)job->dec_keys; + const void *const *ks_ptr = (const void *const *) job->dec_keys; IMB_ASSERT(!(job->status & IMB_STATUS_COMPLETED_CIPHER)); - des3_dec_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, - job->dst, - job->msg_len_to_cipher_in_bytes & - (~(IMB_DES_BLOCK_SIZE - 1)), - ks_ptr[0], ks_ptr[1], ks_ptr[2], - (const uint64_t *)job->iv); + des3_dec_cbc_basic(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~(IMB_DES_BLOCK_SIZE - 1)), ks_ptr[0], + ks_ptr[1], ks_ptr[2], (const uint64_t *) job->iv); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } - #endif /* IMB_DES_H */ diff --git a/lib/include/des_utils.h b/lib/include/des_utils.h index d88b9621..62d8ec81 100644 --- a/lib/include/des_utils.h +++ b/lib/include/des_utils.h @@ -41,8 +41,8 @@ * * @return n-th bit value (0 or 1 value only) */ -__forceinline -uint64_t bit_get64b(const uint64_t val, const unsigned n) +__forceinline uint64_t +bit_get64b(const uint64_t val, const unsigned n) { IMB_ASSERT(n < 64); return (val >> n) & UINT64_C(1); @@ -57,8 +57,8 @@ uint64_t bit_get64b(const uint64_t val, const unsigned n) * * @return val with n-th bit set to value b */ -__forceinline -uint64_t bit_set64b(const uint64_t val, const unsigned n, const uint64_t b) +__forceinline uint64_t +bit_set64b(const uint64_t val, const unsigned n, const uint64_t b) { const uint64_t m = UINT64_C(1) << n; @@ -79,8 +79,8 @@ uint64_t bit_set64b(const uint64_t val, const unsigned n, const uint64_t b) * * @return permuted in word as described by the pattern */ -__forceinline -uint64_t permute_64b(const uint64_t in, const uint8_t *pattern, const int size) +__forceinline uint64_t +permute_64b(const uint64_t in, const uint8_t *pattern, const int size) { uint64_t out = 0; int n = 0; @@ -109,26 +109,21 @@ static const uint8_t reflect_tab[16] = { /* [14] 1110 => 0111 */ 7, /* [15] 1111 => 1111 */ 15 }; -__forceinline -uint8_t reflect_8b(const uint8_t pb) +__forceinline uint8_t +reflect_8b(const uint8_t pb) { return reflect_tab[pb >> 4] | (reflect_tab[pb & 15] << 4); } -__forceinline -uint64_t load64_reflect(const void *key) +__forceinline uint64_t +load64_reflect(const void *key) { const uint8_t *kb = (const uint8_t *) key; - return ((uint64_t) reflect_8b(kb[0])) | - ((uint64_t) reflect_8b(kb[1])) << 8 | - ((uint64_t) reflect_8b(kb[2])) << 16 | - ((uint64_t) reflect_8b(kb[3])) << 24 | - ((uint64_t) reflect_8b(kb[4])) << 32 | - ((uint64_t) reflect_8b(kb[5])) << 40 | - ((uint64_t) reflect_8b(kb[6])) << 48 | - ((uint64_t) reflect_8b(kb[7])) << 56; + return ((uint64_t) reflect_8b(kb[0])) | ((uint64_t) reflect_8b(kb[1])) << 8 | + ((uint64_t) reflect_8b(kb[2])) << 16 | ((uint64_t) reflect_8b(kb[3])) << 24 | + ((uint64_t) reflect_8b(kb[4])) << 32 | ((uint64_t) reflect_8b(kb[5])) << 40 | + ((uint64_t) reflect_8b(kb[6])) << 48 | ((uint64_t) reflect_8b(kb[7])) << 56; } - #endif /* DES_UTILS_H */ diff --git a/lib/include/docsis_common.h b/lib/include/docsis_common.h index daea8327..bfbd1159 100644 --- a/lib/include/docsis_common.h +++ b/lib/include/docsis_common.h @@ -69,8 +69,7 @@ * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DOCSIS_LAST_BLOCK(IMB_JOB *job, const uint64_t key_size) { const void *iv = NULL; @@ -83,8 +82,7 @@ DOCSIS_LAST_BLOCK(IMB_JOB *job, const uint64_t key_size) IMB_ASSERT((job->cipher_direction == IMB_DIR_DECRYPT) || (job->status & IMB_STATUS_COMPLETED_CIPHER)); - partial_bytes = job->msg_len_to_cipher_in_bytes & - (IMB_AES_BLOCK_SIZE - 1); + partial_bytes = job->msg_len_to_cipher_in_bytes & (IMB_AES_BLOCK_SIZE - 1); offset = job->msg_len_to_cipher_in_bytes & (~(IMB_AES_BLOCK_SIZE - 1)); if (!partial_bytes) @@ -94,20 +92,17 @@ DOCSIS_LAST_BLOCK(IMB_JOB *job, const uint64_t key_size) if (job->cipher_direction == IMB_DIR_ENCRYPT) iv = job->dst + offset - IMB_AES_BLOCK_SIZE; else - iv = job->src + job->cipher_start_src_offset_in_bytes + - offset - IMB_AES_BLOCK_SIZE; + iv = job->src + job->cipher_start_src_offset_in_bytes + offset - IMB_AES_BLOCK_SIZE; IMB_ASSERT(partial_bytes <= IMB_AES_BLOCK_SIZE); if (key_size == 16) AES_CFB_128_ONE(job->dst + offset, - job->src + job->cipher_start_src_offset_in_bytes + - offset, - iv, job->enc_keys, partial_bytes); + job->src + job->cipher_start_src_offset_in_bytes + offset, iv, + job->enc_keys, partial_bytes); else /* 32 */ AES_CFB_256_ONE(job->dst + offset, - job->src + job->cipher_start_src_offset_in_bytes + - offset, - iv, job->enc_keys, partial_bytes); + job->src + job->cipher_start_src_offset_in_bytes + offset, iv, + job->enc_keys, partial_bytes); return job; } @@ -121,22 +116,17 @@ DOCSIS_LAST_BLOCK(IMB_JOB *job, const uint64_t key_size) * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DOCSIS_FIRST_BLOCK(IMB_JOB *job, const uint64_t key_size) { IMB_ASSERT(!(job->status & IMB_STATUS_COMPLETED_CIPHER)); IMB_ASSERT(job->msg_len_to_cipher_in_bytes <= IMB_AES_BLOCK_SIZE); if (key_size == 16) - AES_CFB_128_ONE(job->dst, - job->src + job->cipher_start_src_offset_in_bytes, - job->iv, job->enc_keys, - job->msg_len_to_cipher_in_bytes); + AES_CFB_128_ONE(job->dst, job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->msg_len_to_cipher_in_bytes); else /* 32 */ - AES_CFB_256_ONE(job->dst, - job->src + job->cipher_start_src_offset_in_bytes, - job->iv, job->enc_keys, - job->msg_len_to_cipher_in_bytes); + AES_CFB_256_ONE(job->dst, job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->msg_len_to_cipher_in_bytes); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; @@ -150,16 +140,14 @@ DOCSIS_FIRST_BLOCK(IMB_JOB *job, const uint64_t key_size) * * @return Pointer to completed JOB or NULL */ -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size) { IMB_JOB *tmp; if (key_size == 16) { if (job->msg_len_to_cipher_in_bytes >= IMB_AES_BLOCK_SIZE) { - MB_MGR_AES_OOO *aes_mgr = (MB_MGR_AES_OOO *)state; + MB_MGR_AES_OOO *aes_mgr = (MB_MGR_AES_OOO *) state; tmp = SUBMIT_JOB_AES_CBC_128_ENC(aes_mgr, job); return DOCSIS_LAST_BLOCK(tmp, 16); @@ -167,7 +155,7 @@ SUBMIT_JOB_DOCSIS_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, return DOCSIS_FIRST_BLOCK(job, 16); } else { /* Key length = 32 */ if (job->msg_len_to_cipher_in_bytes >= IMB_AES_BLOCK_SIZE) { - MB_MGR_AES_OOO *aes_mgr = (MB_MGR_AES_OOO *)state; + MB_MGR_AES_OOO *aes_mgr = (MB_MGR_AES_OOO *) state; tmp = SUBMIT_JOB_AES_CBC_256_ENC(aes_mgr, job); return DOCSIS_LAST_BLOCK(tmp, 32); @@ -176,15 +164,13 @@ SUBMIT_JOB_DOCSIS_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, } } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS128_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_ENC(state, job, 16); } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS256_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_ENC(state, job, 32); @@ -197,31 +183,28 @@ SUBMIT_JOB_DOCSIS256_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) * * @return Pointer to completed JOB or NULL */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * FLUSH_JOB_DOCSIS_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state, const uint64_t key_size) { IMB_JOB *tmp; if (key_size == 16) { - tmp = FLUSH_JOB_AES_CBC_128_ENC((MB_MGR_AES_OOO *)state); + tmp = FLUSH_JOB_AES_CBC_128_ENC((MB_MGR_AES_OOO *) state); return DOCSIS_LAST_BLOCK(tmp, 16); } else { /* 32 */ - tmp = FLUSH_JOB_AES_CBC_256_ENC((MB_MGR_AES_OOO *)state); + tmp = FLUSH_JOB_AES_CBC_256_ENC((MB_MGR_AES_OOO *) state); return DOCSIS_LAST_BLOCK(tmp, 32); } } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * FLUSH_JOB_DOCSIS128_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state) { return FLUSH_JOB_DOCSIS_SEC_ENC(state, 16); } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * FLUSH_JOB_DOCSIS256_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state) { return FLUSH_JOB_DOCSIS_SEC_ENC(state, 32); @@ -235,10 +218,8 @@ FLUSH_JOB_DOCSIS256_SEC_ENC(MB_MGR_DOCSIS_AES_OOO *state) * * @return Pointer to completed JOB or NULL */ -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size) { (void) state; @@ -257,62 +238,48 @@ SUBMIT_JOB_DOCSIS_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, } } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS128_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_DEC(state, job, 16); } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * SUBMIT_JOB_DOCSIS256_SEC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_DEC(state, job, 32); } -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size) { - if (job->msg_len_to_hash_in_bytes >= - IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE) { + if (job->msg_len_to_hash_in_bytes >= IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE) { uint32_t *p_crc = (uint32_t *) job->auth_tag_output; - (*p_crc) = - ETHERNET_FCS(job->src + - job->hash_start_src_offset_in_bytes, - job->msg_len_to_hash_in_bytes, - job->src + - job->hash_start_src_offset_in_bytes + - job->msg_len_to_hash_in_bytes); + (*p_crc) = ETHERNET_FCS(job->src + job->hash_start_src_offset_in_bytes, + job->msg_len_to_hash_in_bytes, + job->src + job->hash_start_src_offset_in_bytes + + job->msg_len_to_hash_in_bytes); } return SUBMIT_JOB_DOCSIS_SEC_ENC(state, job, key_size); } #ifndef AVX512 -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(state, job, 16); } -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_CRC_ENC(state, job, 32); } #endif -__forceinline -IMB_JOB * -FLUSH_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, - const uint64_t key_size) +__forceinline IMB_JOB * +FLUSH_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, const uint64_t key_size) { /** * CRC has been already calculated. @@ -322,24 +289,20 @@ FLUSH_JOB_DOCSIS_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state, } #ifndef AVX512 -__forceinline -IMB_JOB * +__forceinline IMB_JOB * FLUSH_JOB_DOCSIS128_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state) { return FLUSH_JOB_DOCSIS_SEC_CRC_ENC(state, 16); } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * FLUSH_JOB_DOCSIS256_SEC_CRC_ENC(MB_MGR_DOCSIS_AES_OOO *state) { return FLUSH_JOB_DOCSIS_SEC_CRC_ENC(state, 32); } #endif -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, - const uint64_t key_size) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, const uint64_t key_size) { (void) state; @@ -353,33 +316,25 @@ SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job, job = DOCSIS_FIRST_BLOCK(job, key_size); } - if (job->msg_len_to_hash_in_bytes >= - IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE) { + if (job->msg_len_to_hash_in_bytes >= IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE) { uint32_t *p_crc = (uint32_t *) job->auth_tag_output; - (*p_crc) = - ETHERNET_FCS(job->src + - job->hash_start_src_offset_in_bytes, - job->msg_len_to_hash_in_bytes, - NULL); + (*p_crc) = ETHERNET_FCS(job->src + job->hash_start_src_offset_in_bytes, + job->msg_len_to_hash_in_bytes, NULL); } return job; } #ifndef AVX512 -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS128_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS128_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(state, job, 16); } -__forceinline -IMB_JOB * -SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, - IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job) { return SUBMIT_JOB_DOCSIS_SEC_CRC_DEC(state, job, 32); } @@ -395,16 +350,13 @@ SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC(MB_MGR_DOCSIS_AES_OOO *state, * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DOCSIS_DES_ENC(IMB_JOB *job) { IMB_ASSERT(!(job->status & IMB_STATUS_COMPLETED_CIPHER)); - docsis_des_enc_basic(job->src + job->cipher_start_src_offset_in_bytes, - job->dst, - (int) job->msg_len_to_cipher_in_bytes, - job->enc_keys, - (const uint64_t *)job->iv); + docsis_des_enc_basic(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + (int) job->msg_len_to_cipher_in_bytes, job->enc_keys, + (const uint64_t *) job->iv); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } @@ -415,16 +367,13 @@ DOCSIS_DES_ENC(IMB_JOB *job) * @param job description of performed crypto operation * @return It always returns value passed in \a job */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * DOCSIS_DES_DEC(IMB_JOB *job) { IMB_ASSERT(!(job->status & IMB_STATUS_COMPLETED_CIPHER)); - docsis_des_dec_basic(job->src + job->cipher_start_src_offset_in_bytes, - job->dst, - (int) job->msg_len_to_cipher_in_bytes, - job->dec_keys, - (const uint64_t *)job->iv); + docsis_des_dec_basic(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + (int) job->msg_len_to_cipher_in_bytes, job->dec_keys, + (const uint64_t *) job->iv); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } diff --git a/lib/include/error.h b/lib/include/error.h index ec9936f0..113d6bce 100644 --- a/lib/include/error.h +++ b/lib/include/error.h @@ -40,8 +40,8 @@ extern volatile int imb_errno; * @param mb_mgr Pointer to multi-buffer manager * @param errnum Error type */ -__forceinline -void imb_set_errno(IMB_MGR *mb_mgr, const int errnum) +__forceinline void +imb_set_errno(IMB_MGR *mb_mgr, const int errnum) { /* set MB_MGR error status */ if (mb_mgr != NULL) diff --git a/lib/include/gcm.h b/lib/include/gcm.h index b933da71..27bfad51 100644 --- a/lib/include/gcm.h +++ b/lib/include/gcm.h @@ -37,133 +37,112 @@ */ IMB_DLL_EXPORT void aes_gcm_enc_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_init_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, + const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, + const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, + const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_enc_128_update_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_192_update_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_256_update_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_128_update_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_192_update_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_256_update_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_128_finalize_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_finalize_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_finalize_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_finalize_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_finalize_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_finalize_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_precomp_128_vaes_avx512(struct gcm_key_data *key_data); IMB_DLL_EXPORT void @@ -184,133 +163,106 @@ aes_gcm_pre_256_vaes_avx512(const void *key, struct gcm_key_data *key_data); * - available through IMB_GCM_xxx() macros from ipsec-mb.h */ IMB_DLL_EXPORT void -aes_gcm_enc_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); -IMB_DLL_EXPORT void -aes_gcm_enc_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); -IMB_DLL_EXPORT void -aes_gcm_enc_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); -IMB_DLL_EXPORT void -aes_gcm_dec_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); -IMB_DLL_EXPORT void -aes_gcm_dec_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); -IMB_DLL_EXPORT void -aes_gcm_dec_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); - -IMB_DLL_EXPORT void -aes_gcm_init_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); -IMB_DLL_EXPORT void -aes_gcm_init_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); -IMB_DLL_EXPORT void -aes_gcm_init_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); +aes_gcm_enc_128_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_enc_192_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_enc_256_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_128_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_192_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_256_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); + +IMB_DLL_EXPORT void +aes_gcm_init_128_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); +IMB_DLL_EXPORT void +aes_gcm_init_192_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); +IMB_DLL_EXPORT void +aes_gcm_init_256_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_enc_128_update_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_192_update_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_256_update_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_128_update_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_192_update_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_256_update_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_128_finalize_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_finalize_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_finalize_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_finalize_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_finalize_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_finalize_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_precomp_128_avx512(struct gcm_key_data *key_data); IMB_DLL_EXPORT void @@ -333,133 +285,109 @@ aes_gcm_pre_256_avx512(const void *key, struct gcm_key_data *key_data); #ifdef AESNI_EMU IMB_DLL_EXPORT void aes_gcm_enc_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len, uint8_t *auth_tag, - uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len, uint8_t *auth_tag, - uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len, uint8_t *auth_tag, - uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len, uint8_t *auth_tag, - uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len, uint8_t *auth_tag, - uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, + uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_init_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, - uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_enc_128_update_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_192_update_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_256_update_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_128_update_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_192_update_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_dec_256_update_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, - uint64_t msg_len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); IMB_DLL_EXPORT void aes_gcm_enc_128_finalize_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_finalize_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_finalize_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_finalize_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_finalize_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_finalize_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_precomp_128_sse_no_aesni(struct gcm_key_data *key_data); IMB_DLL_EXPORT void @@ -482,51 +410,42 @@ aes_gcm_pre_256_sse_no_aesni(const void *key, struct gcm_key_data *key_data); */ IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len, - const uint8_t *aad, const uint64_t aad_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, const uint64_t aad_len); /* * Internal GCM API for SSE/AVX/AVX2/AVX512/AESNI emulation, @@ -607,27 +526,23 @@ aes_gcm_dec_var_iv_256_sse_no_aesni(IMB_MGR *state, IMB_JOB *job); */ IMB_DLL_EXPORT void -ghash_sse_no_aesni(const struct gcm_key_data *key_data, const void *in, - const uint64_t in_len, void *io_tag, const uint64_t tag_len); +ghash_sse_no_aesni(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, + void *io_tag, const uint64_t tag_len); IMB_DLL_EXPORT void -ghash_sse(const struct gcm_key_data *key_data, const void *in, - const uint64_t in_len, void *io_tag, const uint64_t tag_len); +ghash_sse(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, void *io_tag, + const uint64_t tag_len); IMB_DLL_EXPORT void -ghash_avx_gen2(const struct gcm_key_data *key_data, const void *in, - const uint64_t in_len, void *io_tag, - const uint64_t tag_len); +ghash_avx_gen2(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, + void *io_tag, const uint64_t tag_len); IMB_DLL_EXPORT void -ghash_avx_gen4(const struct gcm_key_data *key_data, const void *in, - const uint64_t in_len, void *io_tag, - const uint64_t tag_len); +ghash_avx_gen4(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, + void *io_tag, const uint64_t tag_len); IMB_DLL_EXPORT void -ghash_avx512(const struct gcm_key_data *key_data, const void *in, - const uint64_t in_len, void *io_tag, - const uint64_t tag_len); +ghash_avx512(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, + void *io_tag, const uint64_t tag_len); IMB_DLL_EXPORT void -ghash_vaes_avx512(const struct gcm_key_data *key_data, const void *in, - const uint64_t in_len, void *io_tag, - const uint64_t tag_len); +ghash_vaes_avx512(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, + void *io_tag, const uint64_t tag_len); IMB_DLL_EXPORT void ghash_pre_sse_no_aesni(const void *key, struct gcm_key_data *key_data); @@ -652,250 +567,235 @@ ghash_pre_vaes_avx512(const void *key, struct gcm_key_data *key_data); */ IMB_DLL_EXPORT void imb_aes_gmac_init_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_init_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, const uint64_t iv_len); + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_update_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *in, const uint64_t in_len); + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, const uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, const uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, const uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len); #endif /* _GCM_H_ */ diff --git a/lib/include/ipsec_ooo_mgr.h b/lib/include/ipsec_ooo_mgr.h index bf86c01e..ed427f79 100644 --- a/lib/include/ipsec_ooo_mgr.h +++ b/lib/include/ipsec_ooo_mgr.h @@ -37,11 +37,11 @@ #define NUM_SHA_512_DIGEST_WORDS 8 #define NUM_SHA_384_DIGEST_WORDS 6 -#define SHA_DIGEST_WORD_SIZE 4 -#define SHA224_DIGEST_WORD_SIZE 4 -#define SHA256_DIGEST_WORD_SIZE 4 -#define SHA384_DIGEST_WORD_SIZE 8 -#define SHA512_DIGEST_WORD_SIZE 8 +#define SHA_DIGEST_WORD_SIZE 4 +#define SHA224_DIGEST_WORD_SIZE 4 +#define SHA256_DIGEST_WORD_SIZE 4 +#define SHA384_DIGEST_WORD_SIZE 8 +#define SHA512_DIGEST_WORD_SIZE 8 /* Number of lanes AVX512, AVX2, AVX and SSE */ #define AVX512_NUM_SHA1_LANES 16 @@ -50,15 +50,15 @@ #define AVX512_NUM_MD5_LANES 32 #define AVX512_NUM_DES_LANES 16 -#define AVX2_NUM_SHA1_LANES 8 -#define AVX2_NUM_SHA256_LANES 8 -#define AVX2_NUM_SHA512_LANES 4 -#define AVX2_NUM_MD5_LANES 16 +#define AVX2_NUM_SHA1_LANES 8 +#define AVX2_NUM_SHA256_LANES 8 +#define AVX2_NUM_SHA512_LANES 4 +#define AVX2_NUM_MD5_LANES 16 -#define AVX_NUM_SHA1_LANES 4 -#define AVX_NUM_SHA256_LANES 4 -#define AVX_NUM_SHA512_LANES 2 -#define AVX_NUM_MD5_LANES 8 +#define AVX_NUM_SHA1_LANES 4 +#define AVX_NUM_SHA256_LANES 4 +#define AVX_NUM_SHA512_LANES 2 +#define AVX_NUM_MD5_LANES 8 #define SSE_NUM_SHA1_LANES AVX_NUM_SHA1_LANES #define SSE_NUM_SHA256_LANES AVX_NUM_SHA256_LANES @@ -77,7 +77,7 @@ /* Maximum size of the ZUC state (LFSR (16) + X0-X3 (4) + R1-R2 (2)). For AVX512, each takes 16 double words, defining the maximum required size */ -#define MAX_ZUC_STATE_SZ 16*(16 + 4 + 2) +#define MAX_ZUC_STATE_SZ 16 * (16 + 4 + 2) /** ***************************************************************************** @@ -85,20 +85,20 @@ * Packed structure to store the ZUC state for 16 packets. *****************************************************************************/ typedef struct zuc_state_16_s { - uint32_t lfsrState[16][16]; - /**< State registers of the LFSR */ - uint32_t fR1[16]; - /**< register of F */ - uint32_t fR2[16]; - /**< register of F */ - uint32_t bX0[16]; - /**< Output X0 of the bit reorganization for 16 packets */ - uint32_t bX1[16]; - /**< Output X1 of the bit reorganization for 16 packets */ - uint32_t bX2[16]; - /**< Output X2 of the bit reorganization for 16 packets */ - uint32_t bX3[16]; - /**< Output X3 of the bit reorganization for 16 packets */ + uint32_t lfsrState[16][16]; + /**< State registers of the LFSR */ + uint32_t fR1[16]; + /**< register of F */ + uint32_t fR2[16]; + /**< register of F */ + uint32_t bX0[16]; + /**< Output X0 of the bit reorganization for 16 packets */ + uint32_t bX1[16]; + /**< Output X1 of the bit reorganization for 16 packets */ + uint32_t bX2[16]; + /**< Output X2 of the bit reorganization for 16 packets */ + uint32_t bX3[16]; + /**< Output X3 of the bit reorganization for 16 packets */ } ZucState16_t; /* @@ -125,7 +125,7 @@ typedef struct { typedef struct { DECLARE_ALIGNED(uint64_t digest[SHA512_DIGEST_SZ], 32); const uint8_t *data_ptr[AVX512_NUM_SHA512_LANES]; -} SHA512_ARGS; +} SHA512_ARGS; typedef struct { DECLARE_ALIGNED(uint32_t digest[MD5_DIGEST_SZ], 32); @@ -154,8 +154,8 @@ typedef struct { DECLARE_ALIGNED(const uint8_t *in[16], 64); DECLARE_ALIGNED(uint8_t *out[16], 64); const uint8_t *keys[16]; - DECLARE_ALIGNED(uint8_t iv[16*32], 32); - DECLARE_ALIGNED(uint32_t digest[16*4], 64); + DECLARE_ALIGNED(uint8_t iv[16 * 32], 32); + DECLARE_ALIGNED(uint32_t digest[16 * 4], 64); /* Memory for 128 bytes of KS for 16 buffers */ DECLARE_ALIGNED(uint32_t ks[16 * 2 * 16], 64); } ZUC_ARGS_x16; @@ -268,7 +268,6 @@ typedef struct { uint64_t road_block; } MB_MGR_CCM_OOO; - /* AES-CMAC out-of-order scheduler structure */ typedef struct { AES_ARGS args; /* need to re-use AES arguments */ @@ -284,7 +283,6 @@ typedef struct { uint64_t road_block; } MB_MGR_CMAC_OOO; - /* DES out-of-order scheduler fields */ typedef struct { DES_ARGS_x16 args; @@ -320,7 +318,7 @@ typedef struct { /* HMAC-SHA1 and HMAC-SHA256/224 */ typedef struct { /* YMM aligned access to extra_block */ - DECLARE_ALIGNED(uint8_t extra_block[2 * IMB_SHA1_BLOCK_SIZE+8], 32); + DECLARE_ALIGNED(uint8_t extra_block[2 * IMB_SHA1_BLOCK_SIZE + 8], 32); IMB_JOB *job_in_lane; uint8_t outer_block[64]; uint32_t outer_done; @@ -332,7 +330,7 @@ typedef struct { /* HMAC-SHA512/384 */ typedef struct { - DECLARE_ALIGNED(uint8_t extra_block[2*IMB_SHA_512_BLOCK_SIZE + 16], 32); + DECLARE_ALIGNED(uint8_t extra_block[2 * IMB_SHA_512_BLOCK_SIZE + 16], 32); uint8_t outer_block[IMB_SHA_512_BLOCK_SIZE]; IMB_JOB *job_in_lane; uint32_t outer_done; @@ -502,35 +500,25 @@ IMB_DLL_EXPORT uint32_t submit_burst_avx512_t2(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_sse_t1(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_sse_t1(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_sse_t2(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_sse_t2(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_sse_t3(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_sse_t3(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_avx_t1(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_avx_t1(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_avx_t2(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_avx_t2(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_avx2_t1(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_avx2_t1(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_avx2_t2(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_avx2_t2(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_avx2_t3(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_avx2_t3(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_avx512_t1(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_avx512_t1(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_avx512_t2(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_avx512_t2(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t flush_burst_sse_t1(IMB_MGR *state, const uint32_t max_jobs, IMB_JOB **jobs); @@ -554,288 +542,288 @@ IMB_DLL_EXPORT uint32_t flush_burst_avx512_t2(IMB_MGR *state, const uint32_t max_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_sse_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_sse_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_sse_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_sse_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_sse_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_sse_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_avx_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_avx_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_avx_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_avx_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_sse_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_sse_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_sse_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_sse_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_sse_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_sse_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_avx_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_avx_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_avx_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_avx_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_nocheck_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_hash_burst_sse_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_sse_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_sse_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_sse_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_sse_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_sse_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_avx_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_avx_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_avx_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_avx_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_sse_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_sse_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_sse_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_sse_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_sse_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_sse_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_avx_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_avx_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_avx_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_avx_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_avx2_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_avx2_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_avx2_t3(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_avx512_t1(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_avx512_t2(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); /* SSE TYPE1 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_sse_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_sse_t1(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_sse_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_sse_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_sse_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_sse_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_sse_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_sse_t1(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_sse_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_sse_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_sse_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_sse_t1(IMB_MGR *state); /* SSE TYPE2 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_sse_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_sse_t2(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_sse_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_sse_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_sse_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_sse_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_sse_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_sse_t2(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_sse_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_sse_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_sse_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_sse_t2(IMB_MGR *state); /* SSE TYPE3 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_sse_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_sse_t3(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_sse_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_sse_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_sse_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_sse_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_sse_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_sse_t3(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_sse_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_sse_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_sse_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_sse_t3(IMB_MGR *state); /* AVX TYPE1 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_avx_t1(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_avx_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx_t1(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx_t1(IMB_MGR *state); /* AVX TYPE2 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_avx_t2(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_avx_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx_t2(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx_t2(IMB_MGR *state); /* AVX2 TYPE1 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx2_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_avx2_t1(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_avx2_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx2_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx2_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx2_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx2_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx2_t1(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx2_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx2_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx2_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx2_t1(IMB_MGR *state); /* AVX2 TYPE2 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx2_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_avx2_t2(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_avx2_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx2_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx2_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx2_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx2_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx2_t2(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx2_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx2_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx2_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx2_t2(IMB_MGR *state); /* AVX2 TYPE3 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx2_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_avx2_t3(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_avx2_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx2_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx2_t3(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx2_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx2_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx2_t3(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx2_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx2_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx2_t3(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx2_t3(IMB_MGR *state); /* AVX512 TYPE1 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx512_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_avx512_t1(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_avx512_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx512_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx512_t1(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx512_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx512_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx512_t1(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx512_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx512_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx512_t1(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx512_t1(IMB_MGR *state); /* AVX512 TYPE2 manager functions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx512_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_avx512_t2(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_avx512_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx512_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx512_t2(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx512_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx512_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx512_t2(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx512_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx512_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx512_t2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx512_t2(IMB_MGR *state); #ifdef __aarch64__ /* noaesni functions */ diff --git a/lib/include/job_api_docsis.h b/lib/include/job_api_docsis.h index 9494ab73..19bc8526 100644 --- a/lib/include/job_api_docsis.h +++ b/lib/include/job_api_docsis.h @@ -31,93 +31,78 @@ #ifndef JOB_API_DOCSIS_H #define JOB_API_DOCSIS_H -__forceinline -IMB_JOB * +__forceinline IMB_JOB * submit_docsis_enc_job(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) { if (16 == key_sz) { if (job->hash_alg == IMB_AUTH_DOCSIS_CRC32) { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis128_crc32_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis128_crc32_sec_ooo; return SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC(p_ooo, job); } else { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis128_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis128_sec_ooo; return SUBMIT_JOB_DOCSIS128_SEC_ENC(p_ooo, job); } } else { /* 32 */ if (job->hash_alg == IMB_AUTH_DOCSIS_CRC32) { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis256_crc32_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis256_crc32_sec_ooo; return SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC(p_ooo, job); } else { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis256_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis256_sec_ooo; return SUBMIT_JOB_DOCSIS256_SEC_ENC(p_ooo, job); } } } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * flush_docsis_enc_job(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) { if (16 == key_sz) { if (job->hash_alg == IMB_AUTH_DOCSIS_CRC32) { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis128_crc32_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis128_crc32_sec_ooo; return FLUSH_JOB_DOCSIS128_SEC_CRC_ENC(p_ooo); } else { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis128_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis128_sec_ooo; return FLUSH_JOB_DOCSIS128_SEC_ENC(p_ooo); } } else { /* 32 */ if (job->hash_alg == IMB_AUTH_DOCSIS_CRC32) { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis256_crc32_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis256_crc32_sec_ooo; return FLUSH_JOB_DOCSIS256_SEC_CRC_ENC(p_ooo); } else { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis256_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis256_sec_ooo; return FLUSH_JOB_DOCSIS256_SEC_ENC(p_ooo); } } } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * submit_docsis_dec_job(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) { if (16 == key_sz) { if (job->hash_alg == IMB_AUTH_DOCSIS_CRC32) { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis128_crc32_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis128_crc32_sec_ooo; return SUBMIT_JOB_DOCSIS128_SEC_CRC_DEC(p_ooo, job); } else { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis128_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis128_sec_ooo; return SUBMIT_JOB_DOCSIS128_SEC_DEC(p_ooo, job); } } else { /* 32 */ if (job->hash_alg == IMB_AUTH_DOCSIS_CRC32) { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis256_crc32_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis256_crc32_sec_ooo; return SUBMIT_JOB_DOCSIS256_SEC_CRC_DEC(p_ooo, job); } else { - MB_MGR_DOCSIS_AES_OOO *p_ooo = - state->docsis256_sec_ooo; + MB_MGR_DOCSIS_AES_OOO *p_ooo = state->docsis256_sec_ooo; return SUBMIT_JOB_DOCSIS256_SEC_DEC(p_ooo, job); } diff --git a/lib/include/job_api_gcm.h b/lib/include/job_api_gcm.h index 12ae3041..4edbd6ba 100644 --- a/lib/include/job_api_gcm.h +++ b/lib/include/job_api_gcm.h @@ -30,127 +30,93 @@ #ifndef JOB_API_GCM_H #define JOB_API_GCM_H -__forceinline -IMB_JOB * +__forceinline IMB_JOB * submit_gcm_sgl_enc(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) { switch (key_sz) { case IMB_KEY_128_BYTES: if (job->sgl_state == IMB_SGL_INIT) - IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); else if (job->sgl_state == IMB_SGL_UPDATE) - IMB_AES128_GCM_ENC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->dst, job->src, - job->msg_len_to_cipher_in_bytes); + IMB_AES128_GCM_ENC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, job->dst, + job->src, job->msg_len_to_cipher_in_bytes); else if (job->sgl_state == IMB_SGL_COMPLETE) - IMB_AES128_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES128_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); else { /* IMB_SGL_ALL */ unsigned int i; - IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); for (i = 0; i < job->num_sgl_io_segs; i++) - IMB_AES128_GCM_ENC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->sgl_io_segs[i].out, - job->sgl_io_segs[i].in, - job->sgl_io_segs[i].len); - IMB_AES128_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES128_GCM_ENC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, + job->sgl_io_segs[i].out, + job->sgl_io_segs[i].in, + job->sgl_io_segs[i].len); + IMB_AES128_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); } break; case IMB_KEY_192_BYTES: if (job->sgl_state == IMB_SGL_INIT) - IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); else if (job->sgl_state == IMB_SGL_UPDATE) - IMB_AES192_GCM_ENC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->dst, job->src, - job->msg_len_to_cipher_in_bytes); + IMB_AES192_GCM_ENC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, job->dst, + job->src, job->msg_len_to_cipher_in_bytes); else if (job->sgl_state == IMB_SGL_COMPLETE) - IMB_AES192_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES192_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); else { /* IMB_SGL_ALL */ unsigned int i; - IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); for (i = 0; i < job->num_sgl_io_segs; i++) - IMB_AES192_GCM_ENC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->sgl_io_segs[i].out, - job->sgl_io_segs[i].in, - job->sgl_io_segs[i].len); - IMB_AES192_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES192_GCM_ENC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, + job->sgl_io_segs[i].out, + job->sgl_io_segs[i].in, + job->sgl_io_segs[i].len); + IMB_AES192_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); } break; case IMB_KEY_256_BYTES: default: if (job->sgl_state == IMB_SGL_INIT) - IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); else if (job->sgl_state == IMB_SGL_UPDATE) - IMB_AES256_GCM_ENC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->dst, job->src, - job->msg_len_to_cipher_in_bytes); + IMB_AES256_GCM_ENC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, job->dst, + job->src, job->msg_len_to_cipher_in_bytes); else if (job->sgl_state == IMB_SGL_COMPLETE) - IMB_AES256_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES256_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); else { /* IMB_SGL_ALL */ unsigned int i; - IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); for (i = 0; i < job->num_sgl_io_segs; i++) - IMB_AES256_GCM_ENC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->sgl_io_segs[i].out, - job->sgl_io_segs[i].in, - job->sgl_io_segs[i].len); - IMB_AES256_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES256_GCM_ENC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, + job->sgl_io_segs[i].out, + job->sgl_io_segs[i].in, + job->sgl_io_segs[i].len); + IMB_AES256_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); } break; } @@ -160,127 +126,93 @@ submit_gcm_sgl_enc(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) return job; } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * submit_gcm_sgl_dec(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) { switch (key_sz) { case IMB_KEY_128_BYTES: if (job->sgl_state == IMB_SGL_INIT) - IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); else if (job->sgl_state == IMB_SGL_UPDATE) - IMB_AES128_GCM_DEC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->dst, job->src, - job->msg_len_to_cipher_in_bytes); + IMB_AES128_GCM_DEC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, job->dst, + job->src, job->msg_len_to_cipher_in_bytes); else if (job->sgl_state == IMB_SGL_COMPLETE) - IMB_AES128_GCM_DEC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES128_GCM_DEC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); else { /* IMB_SGL_ALL */ unsigned int i; - IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES128_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); for (i = 0; i < job->num_sgl_io_segs; i++) - IMB_AES128_GCM_DEC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->sgl_io_segs[i].out, - job->sgl_io_segs[i].in, - job->sgl_io_segs[i].len); - IMB_AES128_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES128_GCM_DEC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, + job->sgl_io_segs[i].out, + job->sgl_io_segs[i].in, + job->sgl_io_segs[i].len); + IMB_AES128_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); } break; case IMB_KEY_192_BYTES: if (job->sgl_state == IMB_SGL_INIT) - IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); else if (job->sgl_state == IMB_SGL_UPDATE) - IMB_AES192_GCM_DEC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->dst, job->src, - job->msg_len_to_cipher_in_bytes); + IMB_AES192_GCM_DEC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, job->dst, + job->src, job->msg_len_to_cipher_in_bytes); else if (job->sgl_state == IMB_SGL_COMPLETE) - IMB_AES192_GCM_DEC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES192_GCM_DEC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); else { /* IMB_SGL_ALL */ unsigned int i; - IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES192_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); for (i = 0; i < job->num_sgl_io_segs; i++) - IMB_AES192_GCM_DEC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->sgl_io_segs[i].out, - job->sgl_io_segs[i].in, - job->sgl_io_segs[i].len); - IMB_AES192_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES192_GCM_DEC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, + job->sgl_io_segs[i].out, + job->sgl_io_segs[i].in, + job->sgl_io_segs[i].len); + IMB_AES192_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); } break; case IMB_KEY_256_BYTES: default: if (job->sgl_state == IMB_SGL_INIT) - IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); else if (job->sgl_state == IMB_SGL_UPDATE) - IMB_AES256_GCM_DEC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->dst, job->src, - job->msg_len_to_cipher_in_bytes); + IMB_AES256_GCM_DEC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, job->dst, + job->src, job->msg_len_to_cipher_in_bytes); else if (job->sgl_state == IMB_SGL_COMPLETE) - IMB_AES256_GCM_DEC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES256_GCM_DEC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); else { /* IMB_SGL_ALL */ unsigned int i; - IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, - job->u.GCM.ctx, - job->iv, - job->iv_len_in_bytes, - job->u.GCM.aad, + IMB_AES256_GCM_INIT_VAR_IV(state, job->enc_keys, job->u.GCM.ctx, job->iv, + job->iv_len_in_bytes, job->u.GCM.aad, job->u.GCM.aad_len_in_bytes); for (i = 0; i < job->num_sgl_io_segs; i++) - IMB_AES256_GCM_DEC_UPDATE(state, job->enc_keys, - job->u.GCM.ctx, - job->sgl_io_segs[i].out, - job->sgl_io_segs[i].in, - job->sgl_io_segs[i].len); - IMB_AES256_GCM_ENC_FINALIZE(state, job->enc_keys, - job->u.GCM.ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes); + IMB_AES256_GCM_DEC_UPDATE(state, job->enc_keys, job->u.GCM.ctx, + job->sgl_io_segs[i].out, + job->sgl_io_segs[i].in, + job->sgl_io_segs[i].len); + IMB_AES256_GCM_ENC_FINALIZE(state, job->enc_keys, job->u.GCM.ctx, + job->auth_tag_output, + job->auth_tag_output_len_in_bytes); } break; } @@ -290,8 +222,7 @@ submit_gcm_sgl_dec(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) return job; } -__forceinline -void +__forceinline void process_gmac(IMB_MGR *state, IMB_JOB *job, const IMB_KEY_SIZE_BYTES key_size) { struct gcm_context_data ctx; @@ -304,35 +235,31 @@ process_gmac(IMB_MGR *state, IMB_JOB *job, const IMB_KEY_SIZE_BYTES key_size) if (key_size == IMB_KEY_128_BYTES) { IMB_AES128_GMAC_INIT(state, key, &ctx, iv, iv_len); IMB_AES128_GMAC_UPDATE(state, key, &ctx, src, src_len); - IMB_AES128_GMAC_FINALIZE(state, key, &ctx, - job->auth_tag_output, + IMB_AES128_GMAC_FINALIZE(state, key, &ctx, job->auth_tag_output, job->auth_tag_output_len_in_bytes); } else if (key_size == IMB_KEY_192_BYTES) { IMB_AES192_GMAC_INIT(state, key, &ctx, iv, iv_len); IMB_AES192_GMAC_UPDATE(state, key, &ctx, src, src_len); - IMB_AES192_GMAC_FINALIZE(state, key, &ctx, - job->auth_tag_output, + IMB_AES192_GMAC_FINALIZE(state, key, &ctx, job->auth_tag_output, job->auth_tag_output_len_in_bytes); } else { /* key_size == 256 */ IMB_AES256_GMAC_INIT(state, key, &ctx, iv, iv_len); IMB_AES256_GMAC_UPDATE(state, key, &ctx, src, src_len); - IMB_AES256_GMAC_FINALIZE(state, key, &ctx, - job->auth_tag_output, + IMB_AES256_GMAC_FINALIZE(state, key, &ctx, job->auth_tag_output, job->auth_tag_output_len_in_bytes); } } -__forceinline IMB_JOB *process_ghash(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +process_ghash(IMB_MGR *state, IMB_JOB *job) { /* copy initial tag value to the destination */ - memcpy(job->auth_tag_output, job->u.GHASH._init_tag, - job->auth_tag_output_len_in_bytes); + memcpy(job->auth_tag_output, job->u.GHASH._init_tag, job->auth_tag_output_len_in_bytes); /* compute new tag value */ - IMB_GHASH(state, job->u.GHASH._key, - job->src + job->hash_start_src_offset_in_bytes, - job->msg_len_to_hash_in_bytes, - job->auth_tag_output, job->auth_tag_output_len_in_bytes); + IMB_GHASH(state, job->u.GHASH._key, job->src + job->hash_start_src_offset_in_bytes, + job->msg_len_to_hash_in_bytes, job->auth_tag_output, + job->auth_tag_output_len_in_bytes); job->status |= IMB_STATUS_COMPLETED_AUTH; return job; diff --git a/lib/include/job_api_kasumi.h b/lib/include/job_api_kasumi.h index fe2a190e..088d526d 100644 --- a/lib/include/job_api_kasumi.h +++ b/lib/include/job_api_kasumi.h @@ -30,24 +30,21 @@ #ifndef JOB_API_KASUMI_H #define JOB_API_KASUMI_H -__forceinline -IMB_JOB * +__forceinline IMB_JOB * submit_kasumi_uea1_job(IMB_MGR *state, IMB_JOB *job) { const kasumi_key_sched_t *key = job->enc_keys; - const uint64_t iv = *(const uint64_t *)job->iv; - const uint32_t msg_bitlen = - (const uint32_t)job->msg_len_to_cipher_in_bits; - const uint32_t msg_bitoff = - (const uint32_t)job->cipher_start_src_offset_in_bits; + const uint64_t iv = *(const uint64_t *) job->iv; + const uint32_t msg_bitlen = (const uint32_t) job->msg_len_to_cipher_in_bits; + const uint32_t msg_bitoff = (const uint32_t) job->cipher_start_src_offset_in_bits; /* Use bit length API if * - msg length is not a multiple of bytes * - bit offset is not a multiple of bytes */ if ((msg_bitlen & 0x07) || (msg_bitoff & 0x07)) { - IMB_KASUMI_F8_1_BUFFER_BIT(state, key, iv, job->src, job->dst, - msg_bitlen, msg_bitoff); + IMB_KASUMI_F8_1_BUFFER_BIT(state, key, iv, job->src, job->dst, msg_bitlen, + msg_bitoff); } else { const uint32_t msg_bytelen = msg_bitlen >> 3; @@ -55,8 +52,7 @@ submit_kasumi_uea1_job(IMB_MGR *state, IMB_JOB *job) const void *src = job->src + msg_byteoff; void *dst = job->dst + msg_byteoff; - IMB_KASUMI_F8_1_BUFFER(state, key, iv, src, dst, - msg_bytelen); + IMB_KASUMI_F8_1_BUFFER(state, key, iv, src, dst, msg_bytelen); } job->status |= IMB_STATUS_COMPLETED_CIPHER; diff --git a/lib/include/job_api_snowv.h b/lib/include/job_api_snowv.h index 10c6f7c3..a4701a93 100644 --- a/lib/include/job_api_snowv.h +++ b/lib/include/job_api_snowv.h @@ -30,8 +30,7 @@ #ifndef JOB_API_SNOWV_H #define JOB_API_SNOWV_H -__forceinline -IMB_JOB * +__forceinline IMB_JOB * submit_snow_v_aead_job(IMB_MGR *state, IMB_JOB *job) { struct gcm_key_data gdata_key; @@ -49,7 +48,7 @@ submit_snow_v_aead_job(IMB_MGR *state, IMB_JOB *job) * SUBMIT_JOB_SNOW_V_AEAD fills hkey_endpad with first * 2 keystreams (no operations on src vector are done) */ - if(job->cipher_direction == IMB_DIR_ENCRYPT) + if (job->cipher_direction == IMB_DIR_ENCRYPT) hkey_endpad[1].high = 0; else hkey_endpad[1].high = 1; @@ -60,24 +59,21 @@ submit_snow_v_aead_job(IMB_MGR *state, IMB_JOB *job) memset(auth, 0, sizeof(imb_uint128_t)); /* GHASH key H */ - IMB_GHASH_PRE(state, (void *)hkey_endpad, &gdata_key); + IMB_GHASH_PRE(state, (void *) hkey_endpad, &gdata_key); /* push AAD into GHASH */ - IMB_GHASH(state, &gdata_key, job->u.SNOW_V_AEAD.aad, - job->u.SNOW_V_AEAD.aad_len_in_bytes, - (void *)auth, sizeof(imb_uint128_t)); + IMB_GHASH(state, &gdata_key, job->u.SNOW_V_AEAD.aad, job->u.SNOW_V_AEAD.aad_len_in_bytes, + (void *) auth, sizeof(imb_uint128_t)); if (job->cipher_direction == IMB_DIR_ENCRYPT) - IMB_GHASH(state, &gdata_key, job->dst, - job->msg_len_to_cipher_in_bytes, - (void *)auth, sizeof(imb_uint128_t)); + IMB_GHASH(state, &gdata_key, job->dst, job->msg_len_to_cipher_in_bytes, + (void *) auth, sizeof(imb_uint128_t)); else - IMB_GHASH(state, &gdata_key, job->src, - job->msg_len_to_cipher_in_bytes, - (void *)auth, sizeof(imb_uint128_t)); + IMB_GHASH(state, &gdata_key, job->src, job->msg_len_to_cipher_in_bytes, + (void *) auth, sizeof(imb_uint128_t)); - IMB_GHASH(state, &gdata_key, (void *)&temp, sizeof(temp), - (void *)auth, sizeof(imb_uint128_t)); + IMB_GHASH(state, &gdata_key, (void *) &temp, sizeof(temp), (void *) auth, + sizeof(imb_uint128_t)); /* The resulting AuthTag */ auth->low = auth->low ^ hkey_endpad[1].low; diff --git a/lib/include/kasumi_interface.h b/lib/include/kasumi_interface.h index bc03a6ba..fd9fcec4 100644 --- a/lib/include/kasumi_interface.h +++ b/lib/include/kasumi_interface.h @@ -25,7 +25,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ - #ifndef _KASUMI_INTERFACE_H_ #define _KASUMI_INTERFACE_H_ @@ -33,109 +32,102 @@ #include "ipsec-mb.h" /* Range of input data for KASUMI is from 1 to 20000 bits */ -#define KASUMI_MIN_LEN 1 -#define KASUMI_MAX_LEN 20000 +#define KASUMI_MIN_LEN 1 +#define KASUMI_MAX_LEN 20000 -#define BYTESIZE (8) -#define BITSIZE(x) ((int)(sizeof(x)*BYTESIZE)) +#define BYTESIZE (8) +#define BITSIZE(x) ((int) (sizeof(x) * BYTESIZE)) /* SSE */ -size_t kasumi_key_sched_size_sse(void); -int kasumi_init_f8_key_sched_sse(const void *pKey, kasumi_key_sched_t *pCtx); -int kasumi_init_f9_key_sched_sse(const void *pKey, kasumi_key_sched_t *pCtx); - -void kasumi_f8_1_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pBufferIn, void *pBufferOut, - const uint32_t cipherLengthInBytes); - -void kasumi_f8_1_buffer_bit_sse(const kasumi_key_sched_t *pCtx, - const uint64_t IV, - const void *pBufferIn, void *pBufferOut, - const uint32_t cipherLengthInBits, - const uint32_t offsetInBits); - -void kasumi_f8_2_buffer_sse(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, - const void *pBufferIn1, void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, void *pBufferOut2, - const uint32_t lengthInBytes2); - -void kasumi_f8_3_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, - const uint64_t IV2, const uint64_t IV3, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const uint32_t lengthInBytes); - -void kasumi_f8_4_buffer_sse(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, - const uint64_t IV3, const uint64_t IV4, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const void *pBufferIn4, void *pBufferOut4, - const uint32_t lengthInBytes); - -void kasumi_f8_n_buffer_sse(const kasumi_key_sched_t *pKeySchedule, - const uint64_t IV[], - const void * const pDataIn[], void *pDataOut[], - const uint32_t dataLen[], const uint32_t dataCount); - -void kasumi_f9_1_buffer_sse(const kasumi_key_sched_t *pCtx, - const void *pBufferIn, - const uint32_t lengthInBytes, void *pDigest); - -void kasumi_f9_1_buffer_user_sse(const kasumi_key_sched_t *pCtx, - const uint64_t IV, const void *pBufferIn, - const uint32_t lengthInBits, - void *pDigest, const uint32_t direction); +size_t +kasumi_key_sched_size_sse(void); +int +kasumi_init_f8_key_sched_sse(const void *pKey, kasumi_key_sched_t *pCtx); +int +kasumi_init_f9_key_sched_sse(const void *pKey, kasumi_key_sched_t *pCtx); + +void +kasumi_f8_1_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBytes); + +void +kasumi_f8_1_buffer_bit_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBits, + const uint32_t offsetInBits); + +void +kasumi_f8_2_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2); + +void +kasumi_f8_3_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const void *pBufferIn1, void *pBufferOut1, + const void *pBufferIn2, void *pBufferOut2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes); + +void +kasumi_f8_4_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const uint64_t IV4, const void *pBufferIn1, + void *pBufferOut1, const void *pBufferIn2, void *pBufferOut2, + const void *pBufferIn3, void *pBufferOut3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes); + +void +kasumi_f8_n_buffer_sse(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], + const void *const pDataIn[], void *pDataOut[], const uint32_t dataLen[], + const uint32_t dataCount); + +void +kasumi_f9_1_buffer_sse(const kasumi_key_sched_t *pCtx, const void *pBufferIn, + const uint32_t lengthInBytes, void *pDigest); + +void +kasumi_f9_1_buffer_user_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, + const void *pBufferIn, const uint32_t lengthInBits, void *pDigest, + const uint32_t direction); /* AVX */ -size_t kasumi_key_sched_size_avx(void); -int kasumi_init_f8_key_sched_avx(const void *pKey, kasumi_key_sched_t *pCtx); -int kasumi_init_f9_key_sched_avx(const void *pKey, kasumi_key_sched_t *pCtx); - -void kasumi_f8_1_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pBufferIn, void *pBufferOut, - const uint32_t cipherLengthInBytes); -void kasumi_f8_1_buffer_bit_avx(const kasumi_key_sched_t *pCtx, - const uint64_t IV, - const void *pBufferIn, void *pBufferOut, - const uint32_t cipherLengthInBits, - const uint32_t offsetInBits); -void kasumi_f8_2_buffer_avx(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, - const void *pBufferIn1, void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, void *pBufferOut2, - const uint32_t lengthInBytes2); -void kasumi_f8_3_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, - const uint64_t IV2, const uint64_t IV3, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const uint32_t lengthInBytes); -void kasumi_f8_4_buffer_avx(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, - const uint64_t IV3, const uint64_t IV4, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const void *pBufferIn4, void *pBufferOut4, - const uint32_t lengthInBytes); -void kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, - const uint64_t IV[], - const void * const pDataIn[], void *pDataOut[], - const uint32_t dataLen[], const uint32_t dataCount); - -void kasumi_f9_1_buffer_avx(const kasumi_key_sched_t *pCtx, - const void *pBufferIn, - const uint32_t lengthInBytes, void *pDigest); - -void kasumi_f9_1_buffer_user_avx(const kasumi_key_sched_t *pCtx, - const uint64_t IV, const void *pBufferIn, - const uint32_t lengthInBits, - void *pDigest, const uint32_t direction); +size_t +kasumi_key_sched_size_avx(void); +int +kasumi_init_f8_key_sched_avx(const void *pKey, kasumi_key_sched_t *pCtx); +int +kasumi_init_f9_key_sched_avx(const void *pKey, kasumi_key_sched_t *pCtx); + +void +kasumi_f8_1_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBytes); +void +kasumi_f8_1_buffer_bit_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBits, + const uint32_t offsetInBits); +void +kasumi_f8_2_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2); +void +kasumi_f8_3_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const void *pBufferIn1, void *pBufferOut1, + const void *pBufferIn2, void *pBufferOut2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes); +void +kasumi_f8_4_buffer_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const uint64_t IV4, const void *pBufferIn1, + void *pBufferOut1, const void *pBufferIn2, void *pBufferOut2, + const void *pBufferIn3, void *pBufferOut3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes); +void +kasumi_f8_n_buffer_avx(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], + const void *const pDataIn[], void *pDataOut[], const uint32_t dataLen[], + const uint32_t dataCount); + +void +kasumi_f9_1_buffer_avx(const kasumi_key_sched_t *pCtx, const void *pBufferIn, + const uint32_t lengthInBytes, void *pDigest); + +void +kasumi_f9_1_buffer_user_avx(const kasumi_key_sched_t *pCtx, const uint64_t IV, + const void *pBufferIn, const uint32_t lengthInBits, void *pDigest, + const uint32_t direction); #endif /*_KASUMI_INTERFACE_H_*/ - diff --git a/lib/include/kasumi_internal.h b/lib/include/kasumi_internal.h old mode 100755 new mode 100644 index cd77b4ef..7b84526b --- a/lib/include/kasumi_internal.h +++ b/lib/include/kasumi_internal.h @@ -25,10 +25,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ - /*--------------------------------------------------------- -* Kasumi_internal.h -*---------------------------------------------------------*/ + * Kasumi_internal.h + *---------------------------------------------------------*/ #ifndef _KASUMI_INTERNAL_H_ #define _KASUMI_INTERNAL_H_ @@ -47,127 +46,102 @@ #include "kasumi_interface.h" /*--------------------------------------------------------------------- -* Kasumi Inner S-Boxes -*---------------------------------------------------------------------*/ + * Kasumi Inner S-Boxes + *---------------------------------------------------------------------*/ /* Table version based on a small table, no cache trash */ static const uint16_t sso_kasumi_S7e[] = { - 0x6c00, 0x6601, 0x7802, 0x7603, 0x2404, 0x4e05, 0xb006, 0xce07, - 0x5c08, 0x1e09, 0x6a0a, 0xac0b, 0x1c0c, 0x3e0d, 0xea0e, 0x5c0f, - 0x4e10, 0xc011, 0x6a12, 0xc213, 0x0214, 0xac15, 0xae16, 0x3617, - 0x6e18, 0xa019, 0x681a, 0x001b, 0x0a1c, 0xe41d, 0xc41e, 0x9c1f, - 0x2a20, 0x5021, 0xb622, 0xd823, 0x2024, 0x3225, 0x3826, 0x2e27, - 0x9a28, 0xac29, 0x042a, 0xa62b, 0x882c, 0xd62d, 0xd22e, 0x082f, - 0x4830, 0x9631, 0xf432, 0x1c33, 0x4634, 0xb035, 0x7636, 0xa637, - 0xea38, 0x7039, 0x543a, 0x783b, 0xdc3c, 0x6e3d, 0xae3e, 0xba3f, - 0x6a40, 0x6a41, 0x1c42, 0x9043, 0x3a44, 0x5e45, 0x8c46, 0x7447, - 0x7c48, 0x5449, 0x384a, 0x1c4b, 0xa44c, 0xe84d, 0x604e, 0x304f, - 0x4050, 0xc451, 0x8652, 0xac53, 0x1654, 0xb655, 0x1856, 0x0657, - 0x0658, 0xa259, 0xf25a, 0x785b, 0xf85c, 0x785d, 0x845e, 0x3a5f, - 0x0c60, 0xfc61, 0xf062, 0x9c63, 0x5e64, 0xc265, 0x6666, 0x7667, - 0x9a68, 0x4669, 0x746a, 0xb46b, 0x506c, 0xe06d, 0x3a6e, 0x866f, - 0x6070, 0x3471, 0x3c72, 0xd673, 0x3474, 0x4c75, 0xa476, 0x7277, - 0xa478, 0xd479, 0xea7a, 0xa47b, 0x487c, 0x147d, 0x8a7e, 0xf87f, - 0x6c00, 0x6601, 0x7802, 0x7603, 0x2404, 0x4e05, 0xb006, 0xce07, - 0x5c08, 0x1e09, 0x6a0a, 0xac0b, 0x1c0c, 0x3e0d, 0xea0e, 0x5c0f, - 0x4e10, 0xc011, 0x6a12, 0xc213, 0x0214, 0xac15, 0xae16, 0x3617, - 0x6e18, 0xa019, 0x681a, 0x001b, 0x0a1c, 0xe41d, 0xc41e, 0x9c1f, - 0x2a20, 0x5021, 0xb622, 0xd823, 0x2024, 0x3225, 0x3826, 0x2e27, - 0x9a28, 0xac29, 0x042a, 0xa62b, 0x882c, 0xd62d, 0xd22e, 0x082f, - 0x4830, 0x9631, 0xf432, 0x1c33, 0x4634, 0xb035, 0x7636, 0xa637, - 0xea38, 0x7039, 0x543a, 0x783b, 0xdc3c, 0x6e3d, 0xae3e, 0xba3f, - 0x6a40, 0x6a41, 0x1c42, 0x9043, 0x3a44, 0x5e45, 0x8c46, 0x7447, - 0x7c48, 0x5449, 0x384a, 0x1c4b, 0xa44c, 0xe84d, 0x604e, 0x304f, - 0x4050, 0xc451, 0x8652, 0xac53, 0x1654, 0xb655, 0x1856, 0x0657, - 0x0658, 0xa259, 0xf25a, 0x785b, 0xf85c, 0x785d, 0x845e, 0x3a5f, - 0x0c60, 0xfc61, 0xf062, 0x9c63, 0x5e64, 0xc265, 0x6666, 0x7667, - 0x9a68, 0x4669, 0x746a, 0xb46b, 0x506c, 0xe06d, 0x3a6e, 0x866f, - 0x6070, 0x3471, 0x3c72, 0xd673, 0x3474, 0x4c75, 0xa476, 0x7277, - 0xa478, 0xd479, 0xea7a, 0xa47b, 0x487c, 0x147d, 0x8a7e, 0xf87f + 0x6c00, 0x6601, 0x7802, 0x7603, 0x2404, 0x4e05, 0xb006, 0xce07, 0x5c08, 0x1e09, 0x6a0a, + 0xac0b, 0x1c0c, 0x3e0d, 0xea0e, 0x5c0f, 0x4e10, 0xc011, 0x6a12, 0xc213, 0x0214, 0xac15, + 0xae16, 0x3617, 0x6e18, 0xa019, 0x681a, 0x001b, 0x0a1c, 0xe41d, 0xc41e, 0x9c1f, 0x2a20, + 0x5021, 0xb622, 0xd823, 0x2024, 0x3225, 0x3826, 0x2e27, 0x9a28, 0xac29, 0x042a, 0xa62b, + 0x882c, 0xd62d, 0xd22e, 0x082f, 0x4830, 0x9631, 0xf432, 0x1c33, 0x4634, 0xb035, 0x7636, + 0xa637, 0xea38, 0x7039, 0x543a, 0x783b, 0xdc3c, 0x6e3d, 0xae3e, 0xba3f, 0x6a40, 0x6a41, + 0x1c42, 0x9043, 0x3a44, 0x5e45, 0x8c46, 0x7447, 0x7c48, 0x5449, 0x384a, 0x1c4b, 0xa44c, + 0xe84d, 0x604e, 0x304f, 0x4050, 0xc451, 0x8652, 0xac53, 0x1654, 0xb655, 0x1856, 0x0657, + 0x0658, 0xa259, 0xf25a, 0x785b, 0xf85c, 0x785d, 0x845e, 0x3a5f, 0x0c60, 0xfc61, 0xf062, + 0x9c63, 0x5e64, 0xc265, 0x6666, 0x7667, 0x9a68, 0x4669, 0x746a, 0xb46b, 0x506c, 0xe06d, + 0x3a6e, 0x866f, 0x6070, 0x3471, 0x3c72, 0xd673, 0x3474, 0x4c75, 0xa476, 0x7277, 0xa478, + 0xd479, 0xea7a, 0xa47b, 0x487c, 0x147d, 0x8a7e, 0xf87f, 0x6c00, 0x6601, 0x7802, 0x7603, + 0x2404, 0x4e05, 0xb006, 0xce07, 0x5c08, 0x1e09, 0x6a0a, 0xac0b, 0x1c0c, 0x3e0d, 0xea0e, + 0x5c0f, 0x4e10, 0xc011, 0x6a12, 0xc213, 0x0214, 0xac15, 0xae16, 0x3617, 0x6e18, 0xa019, + 0x681a, 0x001b, 0x0a1c, 0xe41d, 0xc41e, 0x9c1f, 0x2a20, 0x5021, 0xb622, 0xd823, 0x2024, + 0x3225, 0x3826, 0x2e27, 0x9a28, 0xac29, 0x042a, 0xa62b, 0x882c, 0xd62d, 0xd22e, 0x082f, + 0x4830, 0x9631, 0xf432, 0x1c33, 0x4634, 0xb035, 0x7636, 0xa637, 0xea38, 0x7039, 0x543a, + 0x783b, 0xdc3c, 0x6e3d, 0xae3e, 0xba3f, 0x6a40, 0x6a41, 0x1c42, 0x9043, 0x3a44, 0x5e45, + 0x8c46, 0x7447, 0x7c48, 0x5449, 0x384a, 0x1c4b, 0xa44c, 0xe84d, 0x604e, 0x304f, 0x4050, + 0xc451, 0x8652, 0xac53, 0x1654, 0xb655, 0x1856, 0x0657, 0x0658, 0xa259, 0xf25a, 0x785b, + 0xf85c, 0x785d, 0x845e, 0x3a5f, 0x0c60, 0xfc61, 0xf062, 0x9c63, 0x5e64, 0xc265, 0x6666, + 0x7667, 0x9a68, 0x4669, 0x746a, 0xb46b, 0x506c, 0xe06d, 0x3a6e, 0x866f, 0x6070, 0x3471, + 0x3c72, 0xd673, 0x3474, 0x4c75, 0xa476, 0x7277, 0xa478, 0xd479, 0xea7a, 0xa47b, 0x487c, + 0x147d, 0x8a7e, 0xf87f }; static const uint16_t sso_kasumi_S9e[] = { - 0x4ea7, 0xdeef, 0x42a1, 0xf77b, 0x0f87, 0x9d4e, 0x1209, 0xa552, - 0x4c26, 0xc4e2, 0x6030, 0xcd66, 0x89c4, 0x0381, 0xb45a, 0x1b8d, - 0x6eb7, 0xfafd, 0x2693, 0x974b, 0x3f9f, 0xa954, 0x6633, 0xd56a, - 0x6532, 0xe9f4, 0x0d06, 0xa452, 0xb0d8, 0x3e9f, 0xc964, 0x62b1, - 0x5eaf, 0xe2f1, 0xd3e9, 0x4a25, 0x9cce, 0x2211, 0x0000, 0x9b4d, - 0x582c, 0xfcfe, 0xf57a, 0x743a, 0x1e8f, 0xb8dc, 0xa251, 0x2190, - 0xbe5f, 0x0603, 0x773b, 0xeaf5, 0x6c36, 0xd6eb, 0xb4da, 0x2b95, - 0xb1d8, 0x1108, 0x58ac, 0xddee, 0xe773, 0x4522, 0x1f8f, 0x984c, - 0x4aa5, 0x8ac5, 0x178b, 0xf279, 0x0301, 0xc1e0, 0x4fa7, 0xa8d4, - 0xe0f0, 0x381c, 0x9dce, 0x60b0, 0x2d96, 0xf7fb, 0x4120, 0xbedf, - 0xebf5, 0x2f97, 0xf2f9, 0x1309, 0xb259, 0x74ba, 0xbadd, 0x59ac, - 0x48a4, 0x944a, 0x71b8, 0x88c4, 0x95ca, 0x4ba5, 0xbd5e, 0x46a3, - 0xd0e8, 0x3c9e, 0x0c86, 0xc562, 0x1a0d, 0xf4fa, 0xd7eb, 0x1c8e, - 0x7ebf, 0x8a45, 0x82c1, 0x53a9, 0x3098, 0xc6e3, 0xdd6e, 0x0e87, - 0xb158, 0x592c, 0x2914, 0xe4f2, 0x6bb5, 0x8140, 0xe271, 0x2d16, - 0x160b, 0xe6f3, 0xae57, 0x7b3d, 0x4824, 0xba5d, 0xe1f0, 0x361b, - 0xcfe7, 0x7dbe, 0xc5e2, 0x5229, 0x8844, 0x389c, 0x93c9, 0x0683, - 0x8d46, 0x2793, 0xa753, 0x2814, 0x4e27, 0xe673, 0x75ba, 0xf87c, - 0xb7db, 0x0180, 0xf9fc, 0x6a35, 0xe070, 0x54aa, 0xbfdf, 0x2e97, - 0xfc7e, 0x52a9, 0x9249, 0x190c, 0x2f17, 0x8341, 0x50a8, 0xd96c, - 0xd76b, 0x4924, 0x5c2e, 0xe7f3, 0x1389, 0x8f47, 0x8944, 0x3018, - 0x91c8, 0x170b, 0x3a9d, 0x99cc, 0xd1e8, 0x55aa, 0x6b35, 0xcae5, - 0x6fb7, 0xf5fa, 0xa0d0, 0x1f0f, 0xbb5d, 0x2391, 0x65b2, 0xd8ec, - 0x2010, 0xa2d1, 0xcf67, 0x6834, 0x7038, 0xf078, 0x8ec7, 0x2b15, - 0xa3d1, 0x41a0, 0xf8fc, 0x3f1f, 0xecf6, 0x0c06, 0xa653, 0x6331, - 0x49a4, 0xb359, 0x3299, 0xedf6, 0x8241, 0x7a3d, 0xe8f4, 0x351a, - 0x5aad, 0xbcde, 0x45a2, 0x8643, 0x0582, 0xe170, 0x0b05, 0xca65, - 0xb9dc, 0x4723, 0x86c3, 0x5dae, 0x6231, 0x9e4f, 0x4ca6, 0x954a, - 0x3118, 0xff7f, 0xeb75, 0x0080, 0xfd7e, 0x3198, 0x369b, 0xdfef, - 0xdf6f, 0x0984, 0x2512, 0xd66b, 0x97cb, 0x43a1, 0x7c3e, 0x8dc6, - 0x0884, 0xc2e1, 0x96cb, 0x793c, 0xd4ea, 0x1c0e, 0x5b2d, 0xb65b, - 0xeff7, 0x3d1e, 0x51a8, 0xa6d3, 0xb75b, 0x6733, 0x188c, 0xed76, - 0x4623, 0xce67, 0xfa7d, 0x57ab, 0x2613, 0xacd6, 0x8bc5, 0x2492, - 0xe5f2, 0x753a, 0x79bc, 0xcce6, 0x0100, 0x9349, 0x8cc6, 0x3b1d, - 0x6432, 0xe874, 0x9c4e, 0x359a, 0x140a, 0x9acd, 0xfdfe, 0x56ab, - 0xcee7, 0x5a2d, 0x168b, 0xa7d3, 0x3a1d, 0xac56, 0xf3f9, 0x4020, - 0x9048, 0x341a, 0xad56, 0x2c96, 0x7339, 0xd5ea, 0x5faf, 0xdcee, - 0x379b, 0x8b45, 0x2a95, 0xb3d9, 0x5028, 0xee77, 0x5cae, 0xc763, - 0x72b9, 0xd2e9, 0x0b85, 0x8e47, 0x81c0, 0x2311, 0xe974, 0x6e37, - 0xdc6e, 0x64b2, 0x8542, 0x180c, 0xabd5, 0x1188, 0xe371, 0x7cbe, - 0x0201, 0xda6d, 0xef77, 0x1289, 0x6ab5, 0xb058, 0x964b, 0x6934, - 0x0904, 0xc9e4, 0xc462, 0x2110, 0xe572, 0x2713, 0x399c, 0xde6f, - 0xa150, 0x7d3e, 0x0804, 0xf1f8, 0xd9ec, 0x0703, 0x6130, 0x9a4d, - 0xa351, 0x67b3, 0x2a15, 0xcb65, 0x5f2f, 0x994c, 0xc7e3, 0x2412, - 0x5e2f, 0xaa55, 0x3219, 0xe3f1, 0xb5da, 0x4321, 0xc864, 0x1b0d, - 0x5128, 0xbdde, 0x1d0e, 0xd46a, 0x3e1f, 0xd068, 0x63b1, 0xa854, - 0x3d9e, 0xcde6, 0x158a, 0xc060, 0xc663, 0x349a, 0xffff, 0x2894, - 0x3b9d, 0xd369, 0x3399, 0xfeff, 0x44a2, 0xaed7, 0x5d2e, 0x92c9, - 0x150a, 0xbf5f, 0xaf57, 0x2090, 0x73b9, 0xdb6d, 0xd86c, 0x552a, - 0xf6fb, 0x4422, 0x6cb6, 0xfbfd, 0x148a, 0xa4d2, 0x9f4f, 0x0a85, - 0x6f37, 0xc160, 0x9148, 0x1a8d, 0x198c, 0xb55a, 0xf67b, 0x7f3f, - 0x85c2, 0x3319, 0x5bad, 0xc8e4, 0x77bb, 0xc3e1, 0xb85c, 0x2994, - 0xcbe5, 0x4da6, 0xf0f8, 0x5329, 0x2e17, 0xaad5, 0x0482, 0xa5d2, - 0x2c16, 0xb2d9, 0x371b, 0x8c46, 0x4d26, 0xd168, 0x47a3, 0xfe7f, - 0x7138, 0xf379, 0x0e07, 0xa9d4, 0x84c2, 0x0402, 0xea75, 0x4f27, - 0x9fcf, 0x0502, 0xc0e0, 0x7fbf, 0xeef7, 0x76bb, 0xa050, 0x1d8e, - 0x391c, 0xc361, 0xd269, 0x0d86, 0x572b, 0xafd7, 0xadd6, 0x70b8, - 0x7239, 0x90c8, 0xb95c, 0x7e3f, 0x98cc, 0x78bc, 0x4221, 0x87c3, - 0xc261, 0x3c1e, 0x6d36, 0xb6db, 0xbc5e, 0x40a0, 0x0281, 0xdbed, - 0x8040, 0x66b3, 0x0f07, 0xcc66, 0x7abd, 0x9ecf, 0xe472, 0x2592, - 0x6db6, 0xbbdd, 0x0783, 0xf47a, 0x80c0, 0x542a, 0xfb7d, 0x0a05, - 0x2291, 0xec76, 0x68b4, 0x83c1, 0x4b25, 0x8743, 0x1088, 0xf97c, - 0x562b, 0x8442, 0x783c, 0x8fc7, 0xab55, 0x7bbd, 0x94ca, 0x61b0, - 0x1008, 0xdaed, 0x1e0f, 0xf178, 0x69b4, 0xa1d0, 0x763b, 0x9bcd + 0x4ea7, 0xdeef, 0x42a1, 0xf77b, 0x0f87, 0x9d4e, 0x1209, 0xa552, 0x4c26, 0xc4e2, 0x6030, + 0xcd66, 0x89c4, 0x0381, 0xb45a, 0x1b8d, 0x6eb7, 0xfafd, 0x2693, 0x974b, 0x3f9f, 0xa954, + 0x6633, 0xd56a, 0x6532, 0xe9f4, 0x0d06, 0xa452, 0xb0d8, 0x3e9f, 0xc964, 0x62b1, 0x5eaf, + 0xe2f1, 0xd3e9, 0x4a25, 0x9cce, 0x2211, 0x0000, 0x9b4d, 0x582c, 0xfcfe, 0xf57a, 0x743a, + 0x1e8f, 0xb8dc, 0xa251, 0x2190, 0xbe5f, 0x0603, 0x773b, 0xeaf5, 0x6c36, 0xd6eb, 0xb4da, + 0x2b95, 0xb1d8, 0x1108, 0x58ac, 0xddee, 0xe773, 0x4522, 0x1f8f, 0x984c, 0x4aa5, 0x8ac5, + 0x178b, 0xf279, 0x0301, 0xc1e0, 0x4fa7, 0xa8d4, 0xe0f0, 0x381c, 0x9dce, 0x60b0, 0x2d96, + 0xf7fb, 0x4120, 0xbedf, 0xebf5, 0x2f97, 0xf2f9, 0x1309, 0xb259, 0x74ba, 0xbadd, 0x59ac, + 0x48a4, 0x944a, 0x71b8, 0x88c4, 0x95ca, 0x4ba5, 0xbd5e, 0x46a3, 0xd0e8, 0x3c9e, 0x0c86, + 0xc562, 0x1a0d, 0xf4fa, 0xd7eb, 0x1c8e, 0x7ebf, 0x8a45, 0x82c1, 0x53a9, 0x3098, 0xc6e3, + 0xdd6e, 0x0e87, 0xb158, 0x592c, 0x2914, 0xe4f2, 0x6bb5, 0x8140, 0xe271, 0x2d16, 0x160b, + 0xe6f3, 0xae57, 0x7b3d, 0x4824, 0xba5d, 0xe1f0, 0x361b, 0xcfe7, 0x7dbe, 0xc5e2, 0x5229, + 0x8844, 0x389c, 0x93c9, 0x0683, 0x8d46, 0x2793, 0xa753, 0x2814, 0x4e27, 0xe673, 0x75ba, + 0xf87c, 0xb7db, 0x0180, 0xf9fc, 0x6a35, 0xe070, 0x54aa, 0xbfdf, 0x2e97, 0xfc7e, 0x52a9, + 0x9249, 0x190c, 0x2f17, 0x8341, 0x50a8, 0xd96c, 0xd76b, 0x4924, 0x5c2e, 0xe7f3, 0x1389, + 0x8f47, 0x8944, 0x3018, 0x91c8, 0x170b, 0x3a9d, 0x99cc, 0xd1e8, 0x55aa, 0x6b35, 0xcae5, + 0x6fb7, 0xf5fa, 0xa0d0, 0x1f0f, 0xbb5d, 0x2391, 0x65b2, 0xd8ec, 0x2010, 0xa2d1, 0xcf67, + 0x6834, 0x7038, 0xf078, 0x8ec7, 0x2b15, 0xa3d1, 0x41a0, 0xf8fc, 0x3f1f, 0xecf6, 0x0c06, + 0xa653, 0x6331, 0x49a4, 0xb359, 0x3299, 0xedf6, 0x8241, 0x7a3d, 0xe8f4, 0x351a, 0x5aad, + 0xbcde, 0x45a2, 0x8643, 0x0582, 0xe170, 0x0b05, 0xca65, 0xb9dc, 0x4723, 0x86c3, 0x5dae, + 0x6231, 0x9e4f, 0x4ca6, 0x954a, 0x3118, 0xff7f, 0xeb75, 0x0080, 0xfd7e, 0x3198, 0x369b, + 0xdfef, 0xdf6f, 0x0984, 0x2512, 0xd66b, 0x97cb, 0x43a1, 0x7c3e, 0x8dc6, 0x0884, 0xc2e1, + 0x96cb, 0x793c, 0xd4ea, 0x1c0e, 0x5b2d, 0xb65b, 0xeff7, 0x3d1e, 0x51a8, 0xa6d3, 0xb75b, + 0x6733, 0x188c, 0xed76, 0x4623, 0xce67, 0xfa7d, 0x57ab, 0x2613, 0xacd6, 0x8bc5, 0x2492, + 0xe5f2, 0x753a, 0x79bc, 0xcce6, 0x0100, 0x9349, 0x8cc6, 0x3b1d, 0x6432, 0xe874, 0x9c4e, + 0x359a, 0x140a, 0x9acd, 0xfdfe, 0x56ab, 0xcee7, 0x5a2d, 0x168b, 0xa7d3, 0x3a1d, 0xac56, + 0xf3f9, 0x4020, 0x9048, 0x341a, 0xad56, 0x2c96, 0x7339, 0xd5ea, 0x5faf, 0xdcee, 0x379b, + 0x8b45, 0x2a95, 0xb3d9, 0x5028, 0xee77, 0x5cae, 0xc763, 0x72b9, 0xd2e9, 0x0b85, 0x8e47, + 0x81c0, 0x2311, 0xe974, 0x6e37, 0xdc6e, 0x64b2, 0x8542, 0x180c, 0xabd5, 0x1188, 0xe371, + 0x7cbe, 0x0201, 0xda6d, 0xef77, 0x1289, 0x6ab5, 0xb058, 0x964b, 0x6934, 0x0904, 0xc9e4, + 0xc462, 0x2110, 0xe572, 0x2713, 0x399c, 0xde6f, 0xa150, 0x7d3e, 0x0804, 0xf1f8, 0xd9ec, + 0x0703, 0x6130, 0x9a4d, 0xa351, 0x67b3, 0x2a15, 0xcb65, 0x5f2f, 0x994c, 0xc7e3, 0x2412, + 0x5e2f, 0xaa55, 0x3219, 0xe3f1, 0xb5da, 0x4321, 0xc864, 0x1b0d, 0x5128, 0xbdde, 0x1d0e, + 0xd46a, 0x3e1f, 0xd068, 0x63b1, 0xa854, 0x3d9e, 0xcde6, 0x158a, 0xc060, 0xc663, 0x349a, + 0xffff, 0x2894, 0x3b9d, 0xd369, 0x3399, 0xfeff, 0x44a2, 0xaed7, 0x5d2e, 0x92c9, 0x150a, + 0xbf5f, 0xaf57, 0x2090, 0x73b9, 0xdb6d, 0xd86c, 0x552a, 0xf6fb, 0x4422, 0x6cb6, 0xfbfd, + 0x148a, 0xa4d2, 0x9f4f, 0x0a85, 0x6f37, 0xc160, 0x9148, 0x1a8d, 0x198c, 0xb55a, 0xf67b, + 0x7f3f, 0x85c2, 0x3319, 0x5bad, 0xc8e4, 0x77bb, 0xc3e1, 0xb85c, 0x2994, 0xcbe5, 0x4da6, + 0xf0f8, 0x5329, 0x2e17, 0xaad5, 0x0482, 0xa5d2, 0x2c16, 0xb2d9, 0x371b, 0x8c46, 0x4d26, + 0xd168, 0x47a3, 0xfe7f, 0x7138, 0xf379, 0x0e07, 0xa9d4, 0x84c2, 0x0402, 0xea75, 0x4f27, + 0x9fcf, 0x0502, 0xc0e0, 0x7fbf, 0xeef7, 0x76bb, 0xa050, 0x1d8e, 0x391c, 0xc361, 0xd269, + 0x0d86, 0x572b, 0xafd7, 0xadd6, 0x70b8, 0x7239, 0x90c8, 0xb95c, 0x7e3f, 0x98cc, 0x78bc, + 0x4221, 0x87c3, 0xc261, 0x3c1e, 0x6d36, 0xb6db, 0xbc5e, 0x40a0, 0x0281, 0xdbed, 0x8040, + 0x66b3, 0x0f07, 0xcc66, 0x7abd, 0x9ecf, 0xe472, 0x2592, 0x6db6, 0xbbdd, 0x0783, 0xf47a, + 0x80c0, 0x542a, 0xfb7d, 0x0a05, 0x2291, 0xec76, 0x68b4, 0x83c1, 0x4b25, 0x8743, 0x1088, + 0xf97c, 0x562b, 0x8442, 0x783c, 0x8fc7, 0xab55, 0x7bbd, 0x94ca, 0x61b0, 0x1008, 0xdaed, + 0x1e0f, 0xf178, 0x69b4, 0xa1d0, 0x763b, 0x9bcd }; /* KASUMI cipher definitions */ -#define NUM_KASUMI_ROUNDS (8) /* 8 rounds in the kasumi spec */ -#define QWORDSIZEINBITS (64) -#define QWORDSIZEINBYTES (8) -#define LAST_PADDING_BIT (1) +#define NUM_KASUMI_ROUNDS (8) /* 8 rounds in the kasumi spec */ +#define QWORDSIZEINBITS (64) +#define QWORDSIZEINBYTES (8) +#define LAST_PADDING_BIT (1) /*--------- 16 bit rotate left ------------------------------------------*/ -#define ROL16(a,b) (uint16_t)((a<>(16-b))) +#define ROL16(a, b) (uint16_t)((a << b) | (a >> (16 - b))) /*----- a 64-bit structure to help with kasumi endian issues -----*/ typedef union _ku64 { - uint64_t b64[1]; - uint32_t b32[2]; - uint16_t b16[4]; - uint8_t b8[8]; + uint64_t b64[1]; + uint32_t b32[2]; + uint16_t b16[4]; + uint8_t b8[8]; } kasumi_union_t; typedef union SafeBuffer { @@ -177,122 +151,122 @@ typedef union SafeBuffer { } SafeBuf; /*--------------------------------------------------------------------- -* Inline 16-bit left rotation -*---------------------------------------------------------------------*/ - -#define ROL16(a,b) (uint16_t)((a<>(16-b))) - -#define FIp1(data, key1, key2, key3) \ - do { \ - uint16_t datal, datah; \ - \ - (data) ^= (key1); \ - datal = LOOKUP16_SSE(sso_kasumi_S7e, (uint8_t)(data), 256); \ - datah = LOOKUP16_SSE(sso_kasumi_S9e, (data) >> 7, 512); \ - (data) = datal ^ datah; \ - (data) ^= (key2); \ - datal = LOOKUP16_SSE(sso_kasumi_S7e, (data) >> 9, 256); \ - datah = LOOKUP16_SSE(sso_kasumi_S9e, (data) & 0x1FF, 512); \ - (data) = datal ^ datah; \ - (data) ^= (key3); \ + * Inline 16-bit left rotation + *---------------------------------------------------------------------*/ + +#define ROL16(a, b) (uint16_t)((a << b) | (a >> (16 - b))) + +#define FIp1(data, key1, key2, key3) \ + do { \ + uint16_t datal, datah; \ + \ + (data) ^= (key1); \ + datal = LOOKUP16_SSE(sso_kasumi_S7e, (uint8_t) (data), 256); \ + datah = LOOKUP16_SSE(sso_kasumi_S9e, (data) >> 7, 512); \ + (data) = datal ^ datah; \ + (data) ^= (key2); \ + datal = LOOKUP16_SSE(sso_kasumi_S7e, (data) >> 9, 256); \ + datah = LOOKUP16_SSE(sso_kasumi_S9e, (data) &0x1FF, 512); \ + (data) = datal ^ datah; \ + (data) ^= (key3); \ } while (0) -#define FIp2(data1, data2, key1, key2, key3, key4) \ - do { \ - FIp1(data1, key1, key2, key3); \ - FIp1(data2, key1, key2, key4); \ +#define FIp2(data1, data2, key1, key2, key3, key4) \ + do { \ + FIp1(data1, key1, key2, key3); \ + FIp1(data2, key1, key2, key4); \ } while (0) -#define FLpi(key1, key2, res_h, res_l) \ - do { \ - uint16_t l, r; \ - r = (res_l) & (key1); \ - r = (res_h) ^ ROL16(r, 1); \ - l = r | (key2); \ - (res_h) = (res_l) ^ ROL16(l, 1); \ - (res_l) = r; \ +#define FLpi(key1, key2, res_h, res_l) \ + do { \ + uint16_t l, r; \ + r = (res_l) & (key1); \ + r = (res_h) ^ ROL16(r, 1); \ + l = r | (key2); \ + (res_h) = (res_l) ^ ROL16(l, 1); \ + (res_l) = r; \ } while (0) -#define FLp1(index, h, l) \ - do { \ - uint16_t ka = *(index + 0); \ - uint16_t kb = *(index + 1); \ - FLpi(ka, kb, h, l); \ +#define FLp1(index, h, l) \ + do { \ + uint16_t ka = *(index + 0); \ + uint16_t kb = *(index + 1); \ + FLpi(ka, kb, h, l); \ } while (0) -#define FLp2(index, h1, l1, h2, l2) \ - do { \ - uint16_t ka = *(index + 0); \ - uint16_t kb = *(index + 1); \ - FLpi(ka, kb, h1, l1); \ - FLpi(ka, kb, h2, l2); \ +#define FLp2(index, h1, l1, h2, l2) \ + do { \ + uint16_t ka = *(index + 0); \ + uint16_t kb = *(index + 1); \ + FLpi(ka, kb, h1, l1); \ + FLpi(ka, kb, h2, l2); \ } while (0) -#define FLp3(index, h1, l1, h2, l2, h3, l3) \ - do { \ - uint16_t ka = *(index + 0); \ - uint16_t kb = *(index + 1); \ - FLpi(ka, kb, h1, l1); \ - FLpi(ka, kb, h2, l2); \ - FLpi(ka, kb, h3, l3); \ +#define FLp3(index, h1, l1, h2, l2, h3, l3) \ + do { \ + uint16_t ka = *(index + 0); \ + uint16_t kb = *(index + 1); \ + FLpi(ka, kb, h1, l1); \ + FLpi(ka, kb, h2, l2); \ + FLpi(ka, kb, h3, l3); \ } while (0) -#define FLp4(index, h1, l1, h2, l2, h3, l3, h4, l4) \ - do { \ - FLp2(index, h1, l1, h2, l2); \ - FLp2(index, h3, l3, h4, l4); \ +#define FLp4(index, h1, l1, h2, l2, h3, l3, h4, l4) \ + do { \ + FLp2(index, h1, l1, h2, l2); \ + FLp2(index, h3, l3, h4, l4); \ } while (0) -#define FOp1(index, h, l) \ - do { \ - FIp1(h, *(index + 2), *(index + 3), l); \ - FIp1(l, *(index + 4), *(index + 5), h); \ - FIp1(h, *(index + 6), *(index + 7), l); \ +#define FOp1(index, h, l) \ + do { \ + FIp1(h, *(index + 2), *(index + 3), l); \ + FIp1(l, *(index + 4), *(index + 5), h); \ + FIp1(h, *(index + 6), *(index + 7), l); \ } while (0) -#define FOp2(index, h1, l1, h2, l2) \ - do { \ - uint16_t ka = *(index + 2); \ - uint16_t kb = *(index + 3); \ - FIp2(h1, h2, ka, kb, l1, l2); \ - ka = *(index + 4); \ - kb = *(index + 5); \ - FIp2(l1, l2, ka, kb, h1, h2); \ - ka = *(index + 6); \ - kb = *(index + 7); \ - FIp2(h1, h2, ka, kb, l1, l2); \ +#define FOp2(index, h1, l1, h2, l2) \ + do { \ + uint16_t ka = *(index + 2); \ + uint16_t kb = *(index + 3); \ + FIp2(h1, h2, ka, kb, l1, l2); \ + ka = *(index + 4); \ + kb = *(index + 5); \ + FIp2(l1, l2, ka, kb, h1, h2); \ + ka = *(index + 6); \ + kb = *(index + 7); \ + FIp2(h1, h2, ka, kb, l1, l2); \ } while (0) -#define FOp3(index, h1, l1, h2, l2, h3, l3) \ - do { \ - uint16_t ka = *(index + 2); \ - uint16_t kb = *(index + 3); \ - FIp2(h1, h2, ka, kb, l1, l2); \ - FIp1(h3, ka, kb, l3); \ - ka = *(index + 4); \ - kb = *(index + 5); \ - FIp2(l1, l2, ka, kb, h1, h2); \ - FIp1(l3, ka, kb, h3); \ - ka = *(index + 6); \ - kb = *(index + 7); \ - FIp2(h1, h2, ka, kb, l1, l2); \ - FIp1(h3, ka, kb, l3); \ +#define FOp3(index, h1, l1, h2, l2, h3, l3) \ + do { \ + uint16_t ka = *(index + 2); \ + uint16_t kb = *(index + 3); \ + FIp2(h1, h2, ka, kb, l1, l2); \ + FIp1(h3, ka, kb, l3); \ + ka = *(index + 4); \ + kb = *(index + 5); \ + FIp2(l1, l2, ka, kb, h1, h2); \ + FIp1(l3, ka, kb, h3); \ + ka = *(index + 6); \ + kb = *(index + 7); \ + FIp2(h1, h2, ka, kb, l1, l2); \ + FIp1(h3, ka, kb, l3); \ } while (0) -#define FOp4(index, h1, l1, h2, l2, h3, l3, h4, l4) \ - do { \ - uint16_t ka = *(index + 2); \ - uint16_t kb = *(index + 3); \ - FIp2(h1, h2, ka, kb, l1, l2); \ - FIp2(h3, h4, ka, kb, l3, l4); \ - ka = *(index + 4); \ - kb = *(index + 5); \ - FIp2(l1, l2, ka, kb, h1, h2); \ - FIp2(l3, l4, ka, kb, h3, h4); \ - ka = *(index + 6); \ - kb = *(index + 7); \ - FIp2(h1, h2, ka, kb, l1, l2); \ - FIp2(h3, h4, ka, kb, l3, l4); \ +#define FOp4(index, h1, l1, h2, l2, h3, l3, h4, l4) \ + do { \ + uint16_t ka = *(index + 2); \ + uint16_t kb = *(index + 3); \ + FIp2(h1, h2, ka, kb, l1, l2); \ + FIp2(h3, h4, ka, kb, l3, l4); \ + ka = *(index + 4); \ + kb = *(index + 5); \ + FIp2(l1, l2, ka, kb, h1, h2); \ + FIp2(l3, l4, ka, kb, h3, h4); \ + ka = *(index + 6); \ + kb = *(index + 7); \ + FIp2(h1, h2, ka, kb, l1, l2); \ + FIp2(h3, h4, ka, kb, l3, l4); \ } while (0) /** @@ -305,7 +279,8 @@ typedef union SafeBuffer { * @param[in/out] pData Block to be enc/dec * ******************************************************************************/ -static void kasumi_1_block(const uint16_t *context, uint16_t *data) +static void +kasumi_1_block(const uint16_t *context, uint16_t *data) { const uint16_t *end = context + KASUMI_KEY_SCHEDULE_SIZE; @@ -374,7 +349,6 @@ kasumi_2_blocks(const uint16_t *context, uint16_t *data1, uint16_t *data2) } while (context < end); } - /** ******************************************************************************* * @description @@ -388,8 +362,7 @@ kasumi_2_blocks(const uint16_t *context, uint16_t *data1, uint16_t *data2) * ******************************************************************************/ static void -kasumi_3_blocks(const uint16_t *context, uint16_t *data1, - uint16_t *data2, uint16_t *data3) +kasumi_3_blocks(const uint16_t *context, uint16_t *data1, uint16_t *data2, uint16_t *data3) { /* Case when the conmpiler is able to interleave efficiently */ const uint16_t *end = context + KASUMI_KEY_SCHEDULE_SIZE; @@ -400,10 +373,8 @@ kasumi_3_blocks(const uint16_t *context, uint16_t *data1, uint16_t temp2_l = data2[3], temp2_h = data2[2]; uint16_t temp3_l = data3[3], temp3_h = data3[2]; - FLp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, - temp3_l); - FOp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, - temp3_l); + FLp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, temp3_l); + FOp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, temp3_l); context += 8; data1[1] ^= temp1_l; data1[0] ^= temp1_h; @@ -418,10 +389,8 @@ kasumi_3_blocks(const uint16_t *context, uint16_t *data1, temp2_l = data2[0]; temp3_h = data3[1]; temp3_l = data3[0]; - FOp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, - temp3_l); - FLp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, - temp3_l); + FOp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, temp3_l); + FLp3(context, temp1_h, temp1_l, temp2_h, temp2_l, temp3_h, temp3_l); context += 8; data1[3] ^= temp1_h; data1[2] ^= temp1_l; @@ -446,8 +415,8 @@ static void kasumi_4_blocks(const uint16_t *context, uint16_t **ppData) { /* Case when the conmpiler is unable to interleave efficiently */ - kasumi_2_blocks (context, ppData[0], ppData[1]); - kasumi_2_blocks (context, ppData[2], ppData[3]); + kasumi_2_blocks(context, ppData[0], ppData[1]); + kasumi_2_blocks(context, ppData[2], ppData[3]); } /** @@ -463,26 +432,26 @@ kasumi_4_blocks(const uint16_t *context, uint16_t **ppData) static void kasumi_8_blocks(const uint16_t *context, uint16_t **ppData) { - kasumi_4_blocks (context, &ppData[0]); - kasumi_4_blocks (context, &ppData[4]); + kasumi_4_blocks(context, &ppData[0]); + kasumi_4_blocks(context, &ppData[4]); } /****************************************************************************** -* @description -* Multiple wrappers for the Kasumi rounds on up to 16 blocks of 64 bits at a -*time. -* -* Depending on the variable packet lengths, different wrappers get called. -* It has been measured that 1 packet is faster than 2, 2 packets is faster -*than 3 -* 3 packets is faster than 4, and so on ... -* It has also been measured that 6 = 4+2 packets is faster than 8 -* It has also been measured that 7 packets are processed faster as 8 packets, -* -* If the assumptions are not verified, it is easy to implmement -* the right function and reference it in wrapperArray. -* -*******************************************************************************/ + * @description + * Multiple wrappers for the Kasumi rounds on up to 16 blocks of 64 bits at a + *time. + * + * Depending on the variable packet lengths, different wrappers get called. + * It has been measured that 1 packet is faster than 2, 2 packets is faster + *than 3 + * 3 packets is faster than 4, and so on ... + * It has also been measured that 6 = 4+2 packets is faster than 8 + * It has also been measured that 7 packets are processed faster as 8 packets, + * + * If the assumptions are not verified, it is easy to implmement + * the right function and reference it in wrapperArray. + * + *******************************************************************************/ static void kasumi_f8_1_buffer_wrapper(const uint16_t *context, uint16_t **data) { @@ -586,39 +555,39 @@ kasumi_f8_16_buffer_wrapper(const uint16_t *context, uint16_t **data) typedef void (*kasumi_wrapper_t)(const uint16_t *, uint16_t **); -static kasumi_wrapper_t kasumiWrapperArray[] = { - NULL, - kasumi_f8_1_buffer_wrapper, - kasumi_f8_2_buffer_wrapper, - kasumi_f8_3_buffer_wrapper, - kasumi_4_blocks, - kasumi_f8_5_buffer_wrapper, - kasumi_f8_6_buffer_wrapper, - kasumi_f8_7_buffer_wrapper, - kasumi_8_blocks, - kasumi_f8_9_buffer_wrapper, - kasumi_f8_10_buffer_wrapper, - kasumi_f8_11_buffer_wrapper, - kasumi_f8_12_buffer_wrapper, - kasumi_f8_13_buffer_wrapper, - kasumi_f8_14_buffer_wrapper, - kasumi_f8_15_buffer_wrapper, - kasumi_f8_16_buffer_wrapper}; +static kasumi_wrapper_t kasumiWrapperArray[] = { NULL, + kasumi_f8_1_buffer_wrapper, + kasumi_f8_2_buffer_wrapper, + kasumi_f8_3_buffer_wrapper, + kasumi_4_blocks, + kasumi_f8_5_buffer_wrapper, + kasumi_f8_6_buffer_wrapper, + kasumi_f8_7_buffer_wrapper, + kasumi_8_blocks, + kasumi_f8_9_buffer_wrapper, + kasumi_f8_10_buffer_wrapper, + kasumi_f8_11_buffer_wrapper, + kasumi_f8_12_buffer_wrapper, + kasumi_f8_13_buffer_wrapper, + kasumi_f8_14_buffer_wrapper, + kasumi_f8_15_buffer_wrapper, + kasumi_f8_16_buffer_wrapper }; /*--------------------------------------------------------------------- -* kasumi_key_schedule_sk() -* Build the key schedule. Most "key" operations use 16-bit -* -* Context is a flat array of 64 uint16. The context is built in the same order -* it will be used. -*---------------------------------------------------------------------*/ + * kasumi_key_schedule_sk() + * Build the key schedule. Most "key" operations use 16-bit + * + * Context is a flat array of 64 uint16. The context is built in the same order + * it will be used. + *---------------------------------------------------------------------*/ static inline void kasumi_key_schedule_sk(uint16_t *context, const void *pKey) { /* Kasumi constants*/ - static const uint16_t C[] = {0x0123, 0x4567, 0x89AB, 0xCDEF, - 0xFEDC, 0xBA98, 0x7654, 0x3210}; + static const uint16_t C[] = { + 0x0123, 0x4567, 0x89AB, 0xCDEF, 0xFEDC, 0xBA98, 0x7654, 0x3210 + }; uint16_t k[8], kprime[8], n; const uint8_t *pk = (const uint8_t *) pKey; @@ -651,13 +620,12 @@ kasumi_key_schedule_sk(uint16_t *context, const void *pKey) } /*--------------------------------------------------------------------- -* kasumi_compute_sched() -* Generic ksaumi key sched init function. -* -*---------------------------------------------------------------------*/ + * kasumi_compute_sched() + * Generic ksaumi key sched init function. + * + *---------------------------------------------------------------------*/ static inline int -kasumi_compute_sched(const uint8_t modifier, - const void *const pKey, void *pCtx) +kasumi_compute_sched(const uint8_t modifier, const void *const pKey, void *pCtx) { #ifdef SAFE_PARAM /* Check for NULL pointers */ @@ -672,13 +640,13 @@ kasumi_compute_sched(const uint8_t modifier, } #endif uint32_t i = 0; - const uint8_t *const key = (const uint8_t * const)pKey; - uint8_t ModKey[IMB_KASUMI_KEY_SIZE] = {0}; /* Modified key */ - kasumi_key_sched_t *pLocalCtx = (kasumi_key_sched_t *)pCtx; + const uint8_t *const key = (const uint8_t *const) pKey; + uint8_t ModKey[IMB_KASUMI_KEY_SIZE] = { 0 }; /* Modified key */ + kasumi_key_sched_t *pLocalCtx = (kasumi_key_sched_t *) pCtx; /* Construct the modified key*/ for (i = 0; i < IMB_KASUMI_KEY_SIZE; i++) - ModKey[i] = (uint8_t)key[i] ^ modifier; + ModKey[i] = (uint8_t) key[i] ^ modifier; kasumi_key_schedule_sk(pLocalCtx->sk16, pKey); kasumi_key_schedule_sk(pLocalCtx->msk16, ModKey); @@ -692,10 +660,10 @@ kasumi_compute_sched(const uint8_t modifier, } /*--------------------------------------------------------------------- -* kasumi_key_sched_size() -* Get the size of a kasumi key sched context. -* -*---------------------------------------------------------------------*/ + * kasumi_key_sched_size() + * Get the size of a kasumi key sched context. + * + *---------------------------------------------------------------------*/ static inline size_t kasumi_key_sched_size(void) { @@ -707,34 +675,31 @@ kasumi_key_sched_size(void) } /*--------------------------------------------------------------------- -* kasumi_init_f8_key_sched() -* Compute the kasumi f8 key schedule. -* -*---------------------------------------------------------------------*/ + * kasumi_init_f8_key_sched() + * Compute the kasumi f8 key schedule. + * + *---------------------------------------------------------------------*/ static inline int -kasumi_init_f8_key_sched(const void *const pKey, - kasumi_key_sched_t *pCtx) +kasumi_init_f8_key_sched(const void *const pKey, kasumi_key_sched_t *pCtx) { return kasumi_compute_sched(0x55, pKey, pCtx); } /*--------------------------------------------------------------------- -* kasumi_init_f9_key_sched() -* Compute the kasumi f9 key schedule. -* -*---------------------------------------------------------------------*/ + * kasumi_init_f9_key_sched() + * Compute the kasumi f9 key schedule. + * + *---------------------------------------------------------------------*/ static inline int -kasumi_init_f9_key_sched(const void *const pKey, - kasumi_key_sched_t *pCtx) +kasumi_init_f9_key_sched(const void *const pKey, kasumi_key_sched_t *pCtx) { return kasumi_compute_sched(0xAA, pKey, pCtx); } static inline void -kasumi_f8_1_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pIn, void *pOut, +kasumi_f8_1_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pIn, void *pOut, const uint32_t length) { #ifdef SAFE_DATA @@ -748,10 +713,10 @@ kasumi_f8_1_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV, uint32_t lengthInBytes = length; /* IV Endianness */ - a.b64[0] = BSWAP64(IV); + a.b64[0] = BSWAP64(IV); /* First encryption to create modifier */ - kasumi_1_block(pCtx->msk16, a.b16 ); + kasumi_1_block(pCtx->msk16, a.b16); /* Final initialisation steps */ blkcnt = 0; @@ -760,11 +725,10 @@ kasumi_f8_1_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV, /* Now run the block cipher */ while (lengthInBytes) { /* KASUMI it to produce the next block of keystream */ - kasumi_1_block(pCtx->sk16, b.b16 ); + kasumi_1_block(pCtx->sk16, b.b16); if (lengthInBytes > IMB_KASUMI_BLOCK_SIZE) { - pBufferIn = xor_keystrm_rev(pBufferOut, pBufferIn, - b.b64[0]); + pBufferIn = xor_keystrm_rev(pBufferOut, pBufferIn, b.b64[0]); pBufferOut += IMB_KASUMI_BLOCK_SIZE; /* loop variant */ /* done another 64 bits */ @@ -772,13 +736,12 @@ kasumi_f8_1_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV, /* apply the modifier and update the block count */ b.b64[0] ^= a.b64[0]; - b.b16[0] ^= (uint16_t)++blkcnt; + b.b16[0] ^= (uint16_t) ++blkcnt; } else if (lengthInBytes < IMB_KASUMI_BLOCK_SIZE) { - SafeBuf safeInBuf = {0}; + SafeBuf safeInBuf = { 0 }; /* end of the loop, handle the last bytes */ - memcpy_keystrm(safeInBuf.b8, pBufferIn, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn, lengthInBytes); xor_keystrm_rev(b.b8, safeInBuf.b8, b.b64[0]); memcpy_keystrm(pBufferOut, b.b8, lengthInBytes); lengthInBytes = 0; @@ -799,13 +762,11 @@ kasumi_f8_1_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV, } static inline void -preserve_bits(kasumi_union_t *c, - const uint8_t *pcBufferOut, const uint8_t *pcBufferIn, - SafeBuf *safeOutBuf, SafeBuf *safeInBuf, - const uint8_t bit_len, const uint8_t byte_len) +preserve_bits(kasumi_union_t *c, const uint8_t *pcBufferOut, const uint8_t *pcBufferIn, + SafeBuf *safeOutBuf, SafeBuf *safeInBuf, const uint8_t bit_len, + const uint8_t byte_len) { - const uint64_t mask = UINT64_MAX << (IMB_KASUMI_BLOCK_SIZE * 8 - - bit_len); + const uint64_t mask = UINT64_MAX << (IMB_KASUMI_BLOCK_SIZE * 8 - bit_len); /* Clear the last bits of the keystream and the input * (input only in out-of-place case) */ @@ -826,10 +787,8 @@ preserve_bits(kasumi_union_t *c, } static inline void -kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pIn, void *pOut, - const uint32_t lengthInBits, - const uint32_t offsetInBits) +kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pIn, + void *pOut, const uint32_t lengthInBits, const uint32_t offsetInBits) { #ifdef SAFE_DATA CLEAR_SCRATCH_SIMD_REGS(); @@ -845,8 +804,8 @@ kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, uint8_t *pcBufferOut = pBufferOut + (offsetInBits / 8); /* Offset into the first byte (0 - 7 bits) */ uint32_t remainOffset = offsetInBits % 8; - SafeBuf safeOutBuf = {0}; - SafeBuf safeInBuf = {0}; + SafeBuf safeOutBuf = { 0 }; + SafeBuf safeInBuf = { 0 }; /* IV Endianness */ a.b64[0] = BSWAP64(IV); @@ -874,21 +833,18 @@ kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, * since remainOffset is up to 7 bits) */ if ((pIn != pOut) && remainOffset) { - const uint8_t mask8 = - (const uint8_t)(1 << (8 - remainOffset)) - 1; + const uint8_t mask8 = (const uint8_t)(1 << (8 - remainOffset)) - 1; - safeInBuf.b8[0] = (safeInBuf.b8[0] & mask8) | - (pcBufferOut[0] & ~mask8); + safeInBuf.b8[0] = (safeInBuf.b8[0] & mask8) | (pcBufferOut[0] & ~mask8); } /* If last byte is a partial byte, the last bits of the output * need to be preserved */ - const uint8_t bitlen_with_off = remainOffset + - cipherLengthInBits; + const uint8_t bitlen_with_off = remainOffset + cipherLengthInBits; if ((bitlen_with_off & 0x7) != 0) { - preserve_bits(&c, pcBufferOut, pcBufferIn, &safeOutBuf, - &safeInBuf, bitlen_with_off, byteLength); + preserve_bits(&c, pcBufferOut, pcBufferIn, &safeOutBuf, &safeInBuf, + bitlen_with_off, byteLength); } xor_keystrm_rev(safeOutBuf.b8, safeInBuf.b8, c.b64[0]); memcpy_keystrm(pcBufferOut, safeOutBuf.b8, byteLength); @@ -901,13 +857,11 @@ kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, * need to be preserved (only applicable to first byte, * since remainOffset is up to 7 bits) */ - if ((pIn != pOut) && remainOffset) { - const uint8_t mask8 = - (const uint8_t)(1 << (8 - remainOffset)) - 1; + if ((pIn != pOut) && remainOffset) { + const uint8_t mask8 = (const uint8_t)(1 << (8 - remainOffset)) - 1; memcpy_keystrm(safeInBuf.b8, pcBufferIn, 8); - safeInBuf.b8[0] = (safeInBuf.b8[0] & mask8) | - (pcBufferOut[0] & ~mask8); + safeInBuf.b8[0] = (safeInBuf.b8[0] & mask8) | (pcBufferOut[0] & ~mask8); xor_keystrm_rev(pcBufferOut, safeInBuf.b8, c.b64[0]); pcBufferIn += IMB_KASUMI_BLOCK_SIZE; } else { @@ -921,7 +875,7 @@ kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, pcBufferOut += IMB_KASUMI_BLOCK_SIZE; /* apply the modifier and update the block count */ b.b64[0] ^= a.b64[0]; - b.b16[0] ^= (uint16_t)++blkcnt; + b.b16[0] ^= (uint16_t) ++blkcnt; while (cipherLengthInBits) { /* KASUMI it to produce the next block of keystream */ @@ -930,28 +884,24 @@ kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, if (remainOffset != 0) shiftrem = b.b64[0] << (64 - remainOffset); if (cipherLengthInBits >= IMB_KASUMI_BLOCK_SIZE * 8) { - pcBufferIn = xor_keystrm_rev(pcBufferOut, - pcBufferIn, c.b64[0]); + pcBufferIn = xor_keystrm_rev(pcBufferOut, pcBufferIn, c.b64[0]); cipherLengthInBits -= IMB_KASUMI_BLOCK_SIZE * 8; pcBufferOut += IMB_KASUMI_BLOCK_SIZE; /* loop variant */ /* apply the modifier and update the block count */ b.b64[0] ^= a.b64[0]; - b.b16[0] ^= (uint16_t)++blkcnt; + b.b16[0] ^= (uint16_t) ++blkcnt; } else { /* end of the loop, handle the last bytes */ - const uint32_t byteLength = - (cipherLengthInBits + 7) / 8; + const uint32_t byteLength = (cipherLengthInBits + 7) / 8; - memcpy_keystrm(safeInBuf.b8, pcBufferIn, - byteLength); + memcpy_keystrm(safeInBuf.b8, pcBufferIn, byteLength); /* If last byte is a partial byte, the last bits * of the output need to be preserved */ if ((cipherLengthInBits & 0x7) != 0) - preserve_bits(&c, pcBufferOut, pcBufferIn, - &safeOutBuf, &safeInBuf, + preserve_bits(&c, pcBufferOut, pcBufferIn, &safeOutBuf, &safeInBuf, cipherLengthInBits, byteLength); xor_keystrm_rev(safeOutBuf.b8, safeInBuf.b8, c.b64[0]); memcpy_keystrm(pcBufferOut, safeOutBuf.b8, byteLength); @@ -969,12 +919,9 @@ kasumi_f8_1_buffer_bit(const kasumi_key_sched_t *pCtx, const uint64_t IV, } static inline void -kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, - const void *pIn1, void *pOut1, - const uint32_t length1, - const void *pIn2, void *pOut2, - const uint32_t length2) +kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const void *pIn1, void *pOut1, const uint32_t length1, const void *pIn2, + void *pOut2, const uint32_t length2) { #ifdef SAFE_DATA CLEAR_SCRATCH_SIMD_REGS(); @@ -989,7 +936,7 @@ kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, uint32_t blkcnt, length; kasumi_union_t a1, b1; /* the modifier */ kasumi_union_t a2, b2; /* the modifier */ - SafeBuf safeInBuf = {0}; + SafeBuf safeInBuf = { 0 }; kasumi_union_t temp; @@ -1023,20 +970,18 @@ kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, kasumi_2_blocks(pCtx->sk16, b1.b16, b2.b16); /* xor and write keystream */ - pBufferIn1 = - xor_keystrm_rev(pBufferOut1, pBufferIn1, b1.b64[0]); + pBufferIn1 = xor_keystrm_rev(pBufferOut1, pBufferIn1, b1.b64[0]); pBufferOut1 += IMB_KASUMI_BLOCK_SIZE; - pBufferIn2 = - xor_keystrm_rev(pBufferOut2, pBufferIn2, b2.b64[0]); + pBufferIn2 = xor_keystrm_rev(pBufferOut2, pBufferIn2, b2.b64[0]); pBufferOut2 += IMB_KASUMI_BLOCK_SIZE; /* loop variant */ length -= IMB_KASUMI_BLOCK_SIZE; /* done another 64 bits */ /* apply the modifier and update the block count */ b1.b64[0] ^= a1.b64[0]; - b1.b16[0] ^= (uint16_t)++blkcnt; + b1.b16[0] ^= (uint16_t) ++blkcnt; b2.b64[0] ^= a2.b64[0]; - b2.b16[0] ^= (uint16_t)blkcnt; + b2.b16[0] ^= (uint16_t) blkcnt; } /* @@ -1047,18 +992,15 @@ kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, /* final round for 1 of the packets */ kasumi_2_blocks(pCtx->sk16, b1.b16, b2.b16); if (lengthInBytes1 > IMB_KASUMI_BLOCK_SIZE) { - pBufferIn1 = xor_keystrm_rev(pBufferOut1, - pBufferIn1, b1.b64[0]); + pBufferIn1 = xor_keystrm_rev(pBufferOut1, pBufferIn1, b1.b64[0]); pBufferOut1 += IMB_KASUMI_BLOCK_SIZE; b1.b64[0] ^= a1.b64[0]; - b1.b16[0] ^= (uint16_t)++blkcnt; + b1.b16[0] ^= (uint16_t) ++blkcnt; lengthInBytes1 -= IMB_KASUMI_BLOCK_SIZE; } else if (lengthInBytes1 < IMB_KASUMI_BLOCK_SIZE) { - memcpy_keystrm(safeInBuf.b8, pBufferIn1, - lengthInBytes1); + memcpy_keystrm(safeInBuf.b8, pBufferIn1, lengthInBytes1); xor_keystrm_rev(temp.b8, safeInBuf.b8, b1.b64[0]); - memcpy_keystrm(pBufferOut1, temp.b8, - lengthInBytes1); + memcpy_keystrm(pBufferOut1, temp.b8, lengthInBytes1); lengthInBytes1 = 0; } else { /* lengthInBytes1 == IMB_KASUMI_BLOCK_SIZE */ @@ -1066,18 +1008,15 @@ kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, lengthInBytes1 = 0; } if (lengthInBytes2 > IMB_KASUMI_BLOCK_SIZE) { - pBufferIn2 = xor_keystrm_rev(pBufferOut2, - pBufferIn2, b2.b64[0]); + pBufferIn2 = xor_keystrm_rev(pBufferOut2, pBufferIn2, b2.b64[0]); pBufferOut2 += IMB_KASUMI_BLOCK_SIZE; b2.b64[0] ^= a2.b64[0]; - b2.b16[0] ^= (uint16_t)++blkcnt; + b2.b16[0] ^= (uint16_t) ++blkcnt; lengthInBytes2 -= IMB_KASUMI_BLOCK_SIZE; } else if (lengthInBytes2 < IMB_KASUMI_BLOCK_SIZE) { - memcpy_keystrm(safeInBuf.b8, pBufferIn2, - lengthInBytes2); + memcpy_keystrm(safeInBuf.b8, pBufferIn2, lengthInBytes2); xor_keystrm_rev(temp.b8, safeInBuf.b8, b2.b64[0]); - memcpy_keystrm(pBufferOut2, temp.b8, - lengthInBytes2); + memcpy_keystrm(pBufferOut2, temp.b8, lengthInBytes2); lengthInBytes2 = 0; } else { /* lengthInBytes2 == IMB_KASUMI_BLOCK_SIZE */ @@ -1088,8 +1027,8 @@ kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, if (lengthInBytes1 < lengthInBytes2) { /* packet 2 is not completed since lengthInBytes2 > 0 - * packet 1 has less than 8 bytes. - */ + * packet 1 has less than 8 bytes. + */ if (lengthInBytes1) { kasumi_1_block(pCtx->sk16, b1.b16); xor_keystrm_rev(pBufferOut1, pBufferIn1, b1.b64[0]); @@ -1118,22 +1057,19 @@ kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, kasumi_1_block(pCtx->sk16, b1.b16); if (lengthInBytes1 > IMB_KASUMI_BLOCK_SIZE) { - pBufferIn1 = xor_keystrm_rev(pBufferOut1, - pBufferIn1, b1.b64[0]); + pBufferIn1 = xor_keystrm_rev(pBufferOut1, pBufferIn1, b1.b64[0]); pBufferOut1 += IMB_KASUMI_BLOCK_SIZE; /* loop variant */ lengthInBytes1 -= IMB_KASUMI_BLOCK_SIZE; /* apply the modifier and update the block count */ b1.b64[0] ^= a1.b64[0]; - b1.b16[0] ^= (uint16_t)++blkcnt; + b1.b16[0] ^= (uint16_t) ++blkcnt; } else if (lengthInBytes1 < IMB_KASUMI_BLOCK_SIZE) { /* end of the loop, handle the last bytes */ - memcpy_keystrm(safeInBuf.b8, pBufferIn1, - lengthInBytes1); + memcpy_keystrm(safeInBuf.b8, pBufferIn1, lengthInBytes1); xor_keystrm_rev(temp.b8, safeInBuf.b8, b1.b64[0]); - memcpy_keystrm(pBufferOut1, temp.b8, - lengthInBytes1); + memcpy_keystrm(pBufferOut1, temp.b8, lengthInBytes1); lengthInBytes1 = 0; } else { /* lengthInBytes1 == IMB_KASUMI_BLOCK_SIZE */ @@ -1153,12 +1089,9 @@ kasumi_f8_2_buffer(const kasumi_key_sched_t *pCtx, } static inline void -kasumi_f8_3_buffer(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, const uint64_t IV3, - const void *pIn1, void *pOut1, - const void *pIn2, void *pOut2, - const void *pIn3, void *pOut3, - const uint32_t length) +kasumi_f8_3_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const void *pIn1, void *pOut1, const void *pIn2, void *pOut2, + const void *pIn3, void *pOut3, const uint32_t length) { #ifdef SAFE_DATA CLEAR_SCRATCH_SIMD_REGS(); @@ -1198,41 +1131,35 @@ kasumi_f8_3_buffer(const kasumi_key_sched_t *pCtx, if (lengthInBytes > IMB_KASUMI_BLOCK_SIZE) { /* xor and write keystream */ - pBufferIn1 = xor_keystrm_rev(pBufferOut1, - pBufferIn1, b1.b64[0]); + pBufferIn1 = xor_keystrm_rev(pBufferOut1, pBufferIn1, b1.b64[0]); pBufferOut1 += IMB_KASUMI_BLOCK_SIZE; - pBufferIn2 = xor_keystrm_rev(pBufferOut2, - pBufferIn2, b2.b64[0]); + pBufferIn2 = xor_keystrm_rev(pBufferOut2, pBufferIn2, b2.b64[0]); pBufferOut2 += IMB_KASUMI_BLOCK_SIZE; - pBufferIn3 = xor_keystrm_rev(pBufferOut3, - pBufferIn3, b3.b64[0]); + pBufferIn3 = xor_keystrm_rev(pBufferOut3, pBufferIn3, b3.b64[0]); pBufferOut3 += IMB_KASUMI_BLOCK_SIZE; /* loop variant */ lengthInBytes -= IMB_KASUMI_BLOCK_SIZE; /* apply the modifier and update the block count */ b1.b64[0] ^= a1.b64[0]; - b1.b16[0] ^= (uint16_t)++blkcnt; + b1.b16[0] ^= (uint16_t) ++blkcnt; b2.b64[0] ^= a2.b64[0]; - b2.b16[0] ^= (uint16_t)blkcnt; + b2.b16[0] ^= (uint16_t) blkcnt; b3.b64[0] ^= a3.b64[0]; - b3.b16[0] ^= (uint16_t)blkcnt; + b3.b16[0] ^= (uint16_t) blkcnt; } else if (lengthInBytes < IMB_KASUMI_BLOCK_SIZE) { - SafeBuf safeInBuf = {0}; + SafeBuf safeInBuf = { 0 }; /* end of the loop, handle the last bytes */ - memcpy_keystrm(safeInBuf.b8, pBufferIn1, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn1, lengthInBytes); xor_keystrm_rev(b1.b8, safeInBuf.b8, b1.b64[0]); memcpy_keystrm(pBufferOut1, b1.b8, lengthInBytes); - memcpy_keystrm(safeInBuf.b8, pBufferIn2, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn2, lengthInBytes); xor_keystrm_rev(b2.b8, safeInBuf.b8, b2.b64[0]); memcpy_keystrm(pBufferOut2, b2.b8, lengthInBytes); - memcpy_keystrm(safeInBuf.b8, pBufferIn3, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn3, lengthInBytes); xor_keystrm_rev(b3.b8, safeInBuf.b8, b3.b64[0]); memcpy_keystrm(pBufferOut3, b3.b8, lengthInBytes); lengthInBytes = 0; @@ -1259,21 +1186,18 @@ kasumi_f8_3_buffer(const kasumi_key_sched_t *pCtx, } /*--------------------------------------------------------- -* @description -* Kasumi F8 4 packet: -* Four packets enc/dec with the same key schedule. -* The 4 Ivs are independent and are passed as an array of values -* The packets are separate, the datalength is common -*---------------------------------------------------------*/ + * @description + * Kasumi F8 4 packet: + * Four packets enc/dec with the same key schedule. + * The 4 Ivs are independent and are passed as an array of values + * The packets are separate, the datalength is common + *---------------------------------------------------------*/ static inline void -kasumi_f8_4_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV1, - const uint64_t IV2, const uint64_t IV3, const uint64_t IV4, - const void *pIn1, void *pOut1, - const void *pIn2, void *pOut2, - const void *pIn3, void *pOut3, - const void *pIn4, void *pOut4, - const uint32_t length) +kasumi_f8_4_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const uint64_t IV4, const void *pIn1, void *pOut1, + const void *pIn2, void *pOut2, const void *pIn3, void *pOut3, const void *pIn4, + void *pOut4, const uint32_t length) { #ifdef SAFE_DATA CLEAR_SCRATCH_SIMD_REGS(); @@ -1293,7 +1217,7 @@ kasumi_f8_4_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV1, kasumi_union_t a2, b2; /* the modifier */ kasumi_union_t a3, b3; /* the modifier */ kasumi_union_t a4, b4; /* the modifier */ - uint16_t *pTemp[4] = {b1.b16, b2.b16, b3.b16, b4.b16}; + uint16_t *pTemp[4] = { b1.b16, b2.b16, b3.b16, b4.b16 }; /* IV Endianness */ b1.b64[0] = BSWAP64(IV1); @@ -1319,51 +1243,43 @@ kasumi_f8_4_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV1, if (lengthInBytes > IMB_KASUMI_BLOCK_SIZE) { /* xor and write keystream */ - pBufferIn1 = xor_keystrm_rev(pBufferOut1, - pBufferIn1, b1.b64[0]); + pBufferIn1 = xor_keystrm_rev(pBufferOut1, pBufferIn1, b1.b64[0]); pBufferOut1 += IMB_KASUMI_BLOCK_SIZE; - pBufferIn2 = xor_keystrm_rev(pBufferOut2, - pBufferIn2, b2.b64[0]); + pBufferIn2 = xor_keystrm_rev(pBufferOut2, pBufferIn2, b2.b64[0]); pBufferOut2 += IMB_KASUMI_BLOCK_SIZE; - pBufferIn3 = xor_keystrm_rev(pBufferOut3, - pBufferIn3, b3.b64[0]); + pBufferIn3 = xor_keystrm_rev(pBufferOut3, pBufferIn3, b3.b64[0]); pBufferOut3 += IMB_KASUMI_BLOCK_SIZE; - pBufferIn4 = xor_keystrm_rev(pBufferOut4, - pBufferIn4, b4.b64[0]); + pBufferIn4 = xor_keystrm_rev(pBufferOut4, pBufferIn4, b4.b64[0]); pBufferOut4 += IMB_KASUMI_BLOCK_SIZE; /* loop variant */ lengthInBytes -= IMB_KASUMI_BLOCK_SIZE; /* apply the modifier and update the block count */ b1.b64[0] ^= a1.b64[0]; - b1.b16[0] ^= (uint16_t)++blkcnt; + b1.b16[0] ^= (uint16_t) ++blkcnt; b2.b64[0] ^= a2.b64[0]; - b2.b16[0] ^= (uint16_t)blkcnt; + b2.b16[0] ^= (uint16_t) blkcnt; b3.b64[0] ^= a3.b64[0]; - b3.b16[0] ^= (uint16_t)blkcnt; + b3.b16[0] ^= (uint16_t) blkcnt; b4.b64[0] ^= a4.b64[0]; - b4.b16[0] ^= (uint16_t)blkcnt; + b4.b16[0] ^= (uint16_t) blkcnt; } else if (lengthInBytes < IMB_KASUMI_BLOCK_SIZE) { - SafeBuf safeInBuf = {0}; + SafeBuf safeInBuf = { 0 }; /* end of the loop, handle the last bytes */ - memcpy_keystrm(safeInBuf.b8, pBufferIn1, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn1, lengthInBytes); xor_keystrm_rev(b1.b8, safeInBuf.b8, b1.b64[0]); memcpy_keystrm(pBufferOut1, b1.b8, lengthInBytes); - memcpy_keystrm(safeInBuf.b8, pBufferIn2, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn2, lengthInBytes); xor_keystrm_rev(b2.b8, safeInBuf.b8, b2.b64[0]); memcpy_keystrm(pBufferOut2, b2.b8, lengthInBytes); - memcpy_keystrm(safeInBuf.b8, pBufferIn3, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn3, lengthInBytes); xor_keystrm_rev(b3.b8, safeInBuf.b8, b3.b64[0]); memcpy_keystrm(pBufferOut3, b3.b8, lengthInBytes); - memcpy_keystrm(safeInBuf.b8, pBufferIn4, - lengthInBytes); + memcpy_keystrm(safeInBuf.b8, pBufferIn4, lengthInBytes); xor_keystrm_rev(b4.b8, safeInBuf.b8, b4.b64[0]); memcpy_keystrm(pBufferOut4, b4.b8, lengthInBytes); lengthInBytes = 0; @@ -1393,24 +1309,24 @@ kasumi_f8_4_buffer(const kasumi_key_sched_t *pCtx, const uint64_t IV1, } /*--------------------------------------------------------- -* @description -* Kasumi F8 2 packet: -* Two packets enc/dec with the same key schedule. -* The 2 Ivs are independent and are passed as an array of values. -* The packets are separate, the datalength is common -*---------------------------------------------------------*/ + * @description + * Kasumi F8 2 packet: + * Two packets enc/dec with the same key schedule. + * The 2 Ivs are independent and are passed as an array of values. + * The packets are separate, the datalength is common + *---------------------------------------------------------*/ /****************************************************************************** -* @description -* Kasumi F8 n packet: -* Performs F8 enc/dec on [n] packets. The operation is performed in-place. -* The input IV's are passed in Big Endian format. -* The KeySchedule is in Little Endian format. -*******************************************************************************/ + * @description + * Kasumi F8 n packet: + * Performs F8 enc/dec on [n] packets. The operation is performed in-place. + * The input IV's are passed in Big Endian format. + * The KeySchedule is in Little Endian format. + *******************************************************************************/ static inline void kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], - const void * const pIn[], void *pOut[], - const uint32_t lengths[], const uint32_t bufCount) + const void *const pIn[], void *pOut[], const uint32_t lengths[], + const uint32_t bufCount) { #ifdef SAFE_DATA CLEAR_SCRATCH_SIMD_REGS(); @@ -1426,19 +1342,19 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], kasumi_union_t A[NUM_PACKETS_16], temp[NUM_PACKETS_16], tempSort; uint16_t *data[NUM_PACKETS_16]; uint32_t dataLen[NUM_PACKETS_16]; - uint8_t *pDataOut[NUM_PACKETS_16] = {NULL}; - const uint8_t *pDataIn[NUM_PACKETS_16] = {NULL}; + uint8_t *pDataOut[NUM_PACKETS_16] = { NULL }; + const uint8_t *pDataIn[NUM_PACKETS_16] = { NULL }; const uint8_t *srctempbuff; uint8_t *dsttempbuff; uint32_t blkcnt = 0; uint32_t len = 0; uint32_t packet_idx, inner_idx, same_size_blocks; int sortNeeded = 0; - SafeBuf safeInBuf = {0}; + SafeBuf safeInBuf = { 0 }; - memcpy((void *)dataLen, lengths, dataCount * sizeof(uint32_t)); - memcpy((void *)pDataIn, pIn, dataCount * sizeof(void *)); - memcpy((void *)pDataOut, pOut, dataCount * sizeof(void *)); + memcpy((void *) dataLen, lengths, dataCount * sizeof(uint32_t)); + memcpy((void *) pDataIn, pIn, dataCount * sizeof(void *)); + memcpy((void *) pDataOut, pOut, dataCount * sizeof(void *)); /* save the IV to A for each packet */ packet_idx = dataCount; @@ -1450,8 +1366,7 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], data[packet_idx] = temp[packet_idx].b16; /* check if all packets are sorted by decreasing length */ - if (packet_idx > 0 && - dataLen[packet_idx - 1] < dataLen[packet_idx]) + if (packet_idx > 0 && dataLen[packet_idx - 1] < dataLen[packet_idx]) /* this packet array is not correctly sorted */ sortNeeded = 1; } @@ -1485,13 +1400,10 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], const int tempLen = dataLen[packet_idx]; - pDataIn[packet_idx] = - pDataIn[inner_idx]; - pDataOut[packet_idx] = - pDataOut[inner_idx]; + pDataIn[packet_idx] = pDataIn[inner_idx]; + pDataOut[packet_idx] = pDataOut[inner_idx]; temp[packet_idx] = temp[inner_idx]; - dataLen[packet_idx] = - dataLen[inner_idx]; + dataLen[packet_idx] = dataLen[inner_idx]; pDataIn[inner_idx] = srctempbuff; pDataOut[inner_idx] = dsttempbuff; @@ -1509,25 +1421,22 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], while (dataCount > 0) { /* max num of blocks left depends on roundUp(smallest packet), - * The shortest stream to process is always stored at location - * [dataCount - 1] - */ - same_size_blocks = - ((dataLen[dataCount - 1] + IMB_KASUMI_BLOCK_SIZE - 1) / - IMB_KASUMI_BLOCK_SIZE) - - blkcnt; + * The shortest stream to process is always stored at location + * [dataCount - 1] + */ + same_size_blocks = ((dataLen[dataCount - 1] + IMB_KASUMI_BLOCK_SIZE - 1) / + IMB_KASUMI_BLOCK_SIZE) - + blkcnt; /* process streams of complete blocks */ while (same_size_blocks-- > 1) { /* do kasumi block encryption */ - kasumiWrapperArray[dataCount](pKeySchedule->sk16, - data); + kasumiWrapperArray[dataCount](pKeySchedule->sk16, data); packet_idx = dataCount; while (packet_idx--) xor_keystrm_rev(pDataOut[packet_idx] + len, - pDataIn[packet_idx] + len, - temp[packet_idx].b64[0]); + pDataIn[packet_idx] + len, temp[packet_idx].b64[0]); /* length already done since the start of the packets */ len += IMB_KASUMI_BLOCK_SIZE; @@ -1538,7 +1447,7 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], packet_idx = dataCount; while (packet_idx--) { temp[packet_idx].b64[0] ^= A[packet_idx].b64[0]; - temp[packet_idx].b16[0] ^= (uint16_t)blkcnt; + temp[packet_idx].b16[0] ^= (uint16_t) blkcnt; } /* for packet_idx */ } /* while same_size_blocks (iteration on multiple blocks) */ @@ -1549,18 +1458,15 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], /* process incomplete blocks without overwriting past the buffer * end */ while ((dataCount > 0) && - (dataLen[dataCount - 1] < (len+IMB_KASUMI_BLOCK_SIZE))) { + (dataLen[dataCount - 1] < (len + IMB_KASUMI_BLOCK_SIZE))) { dataCount--; /* incomplete block is copied into a temp buffer */ memcpy_keystrm(safeInBuf.b8, pDataIn[dataCount] + len, dataLen[dataCount] - len); - xor_keystrm_rev(temp[dataCount].b8, - safeInBuf.b8, - temp[dataCount].b64[0]); + xor_keystrm_rev(temp[dataCount].b8, safeInBuf.b8, temp[dataCount].b64[0]); - memcpy_keystrm(pDataOut[dataCount] + len, - temp[dataCount].b8, + memcpy_keystrm(pDataOut[dataCount] + len, temp[dataCount].b8, dataLen[dataCount] - len); } /* while dataCount */ @@ -1569,11 +1475,10 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], KASUMI_SAFE_BUFFER is defined, the last block (complete or not) of the packets*/ while ((dataCount > 0) && - (dataLen[dataCount-1] <= (len+IMB_KASUMI_BLOCK_SIZE))) { + (dataLen[dataCount - 1] <= (len + IMB_KASUMI_BLOCK_SIZE))) { dataCount--; - xor_keystrm_rev(pDataOut[dataCount] + len, - pDataIn[dataCount] + len, + xor_keystrm_rev(pDataOut[dataCount] + len, pDataIn[dataCount] + len, temp[dataCount].b64[0]); } /* while dataCount */ /* block idx is incremented and rewritten in the keystream */ @@ -1584,11 +1489,10 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], packet_idx = dataCount; while (packet_idx--) { - xor_keystrm_rev(pDataOut[packet_idx] + len, - pDataIn[packet_idx] + len, + xor_keystrm_rev(pDataOut[packet_idx] + len, pDataIn[packet_idx] + len, temp[packet_idx].b64[0]); temp[packet_idx].b64[0] ^= A[packet_idx].b64[0]; - temp[packet_idx].b16[0] ^= (uint16_t)blkcnt; + temp[packet_idx].b16[0] ^= (uint16_t) blkcnt; } /* while packet_idx */ /* length already done since the start of the packets */ @@ -1612,15 +1516,15 @@ kasumi_f8_n_buffer(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], } static inline void -kasumi_f9_1_buffer(const kasumi_key_sched_t *pCtx, const void *dataIn, - const uint32_t length, void *pDigest) +kasumi_f9_1_buffer(const kasumi_key_sched_t *pCtx, const void *dataIn, const uint32_t length, + void *pDigest) { #ifdef SAFE_DATA CLEAR_SCRATCH_SIMD_REGS(); #endif /* SAFE_DATA */ kasumi_union_t a, b, mask; - const uint64_t *pIn = (const uint64_t *)dataIn; + const uint64_t *pIn = (const uint64_t *) dataIn; uint32_t lengthInBytes = length; /* Init */ @@ -1644,7 +1548,7 @@ kasumi_f9_1_buffer(const kasumi_key_sched_t *pCtx, const void *dataIn, } if (lengthInBytes) { - SafeBuf safeBuf = {0}; + SafeBuf safeBuf = { 0 }; /* Not a whole 8 byte block remaining */ mask.b64[0] = ~(mask.b64[0] >> (BYTESIZE * lengthInBytes)); @@ -1667,7 +1571,7 @@ kasumi_f9_1_buffer(const kasumi_key_sched_t *pCtx, const void *dataIn, kasumi_1_block(pCtx->msk16, b.b16); /* swap result */ - *(uint32_t *)pDigest = bswap4(b.b32[1]); + *(uint32_t *) pDigest = bswap4(b.b32[1]); #ifdef SAFE_DATA /* Clear sensitive data in stack */ clear_mem(&a, sizeof(a)); @@ -1677,18 +1581,17 @@ kasumi_f9_1_buffer(const kasumi_key_sched_t *pCtx, const void *dataIn, } /*--------------------------------------------------------- -* @description -* Kasumi F9 1 packet with user config: -* Single packet digest with user defined IV, and precomputed key schedule. -* -* IV = swap32(count) << 32 | swap32(fresh) -* -*---------------------------------------------------------*/ + * @description + * Kasumi F9 1 packet with user config: + * Single packet digest with user defined IV, and precomputed key schedule. + * + * IV = swap32(count) << 32 | swap32(fresh) + * + *---------------------------------------------------------*/ static inline void -kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pDataIn, const uint32_t length, - void *pDigest, const uint32_t direction) +kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pDataIn, + const uint32_t length, void *pDigest, const uint32_t direction) { #ifdef SAFE_DATA CLEAR_SCRATCH_SIMD_REGS(); @@ -1696,7 +1599,7 @@ kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, kasumi_union_t a, b, mask, message, temp; uint32_t lengthInBits = length; - const uint64_t *pIn = (const uint64_t *)pDataIn; + const uint64_t *pIn = (const uint64_t *) pDataIn; kasumi_union_t safebuff; a.b64[0] = 0; @@ -1723,7 +1626,7 @@ kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, /* Is there any non 8 byte blocks remaining ? */ if (lengthInBits == 0) { /* last block is : direct + 1 + 62 0's */ - a.b64[0] ^= ((uint64_t)direction + direction + LAST_PADDING_BIT) + a.b64[0] ^= ((uint64_t) direction + direction + LAST_PADDING_BIT) << (QWORDSIZEINBITS - 2); kasumi_1_block(pCtx->sk16, a.b16); /* update */ @@ -1739,9 +1642,8 @@ kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, safe_memcpy(&safebuff.b64[0], pIn, (lengthInBits + 7) / 8); message.b64[0] = BSWAP64(safebuff.b64[0]); temp.b64[0] = mask.b64[0] & message.b64[0]; - temp.b64[0] |= - ((uint64_t)direction + direction + LAST_PADDING_BIT) - << ((QWORDSIZEINBITS - 2) - lengthInBits); + temp.b64[0] |= ((uint64_t) direction + direction + LAST_PADDING_BIT) + << ((QWORDSIZEINBITS - 2) - lengthInBits); a.b64[0] ^= temp.b64[0]; /* KASUMI it */ kasumi_1_block(pCtx->sk16, a.b16); @@ -1756,8 +1658,7 @@ kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, kasumi_1_block(pCtx->sk16, a.b16); /* update */ b.b64[0] ^= a.b64[0]; - a.b8[QWORDSIZEINBYTES - 1] ^= (LAST_PADDING_BIT) - << (QWORDSIZEINBYTES - 1); + a.b8[QWORDSIZEINBYTES - 1] ^= (LAST_PADDING_BIT) << (QWORDSIZEINBYTES - 1); /* KASUMI it */ kasumi_1_block(pCtx->sk16, a.b16); /* update */ @@ -1767,7 +1668,7 @@ kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, kasumi_1_block(pCtx->msk16, b.b16); /* swap result */ - *(uint32_t *)pDigest = bswap4(b.b32[1]); + *(uint32_t *) pDigest = bswap4(b.b32[1]); #ifdef SAFE_DATA /* Clear sensitive data in stack */ clear_mem(&a, sizeof(a)); @@ -1780,4 +1681,3 @@ kasumi_f9_1_buffer_user(const kasumi_key_sched_t *pCtx, const uint64_t IV, } #endif /*_KASUMI_INTERNAL_H_*/ - diff --git a/lib/include/mb_mgr_burst.h b/lib/include/mb_mgr_burst.h index cb3009b7..694f44b9 100644 --- a/lib/include/mb_mgr_burst.h +++ b/lib/include/mb_mgr_burst.h @@ -35,12 +35,9 @@ #include "include/mb_mgr_job_check.h" /* is_job_invalid() */ #ifndef __aarch64__ -__forceinline -uint32_t submit_aes_cbc_burst_enc(IMB_MGR *state, - IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_KEY_SIZE_BYTES key_size, - const int run_check) +__forceinline uint32_t +submit_aes_cbc_burst_enc(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_KEY_SIZE_BYTES key_size, const int run_check) { uint32_t completed_jobs = 0; @@ -52,8 +49,7 @@ uint32_t submit_aes_cbc_burst_enc(IMB_MGR *state, IMB_JOB *job = &jobs[i]; /* validate job */ - if (is_job_invalid(state, job, - IMB_CIPHER_CBC, IMB_AUTH_NULL, + if (is_job_invalid(state, job, IMB_CIPHER_CBC, IMB_AUTH_NULL, IMB_DIR_ENCRYPT, key_size)) { job->status = IMB_STATUS_INVALID_ARGS; return 0; @@ -78,8 +74,7 @@ uint32_t submit_aes_cbc_burst_enc(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while((job = FLUSH_JOB_AES_CBC_128_ENC(aes_ooo)) - != NULL) { + while ((job = FLUSH_JOB_AES_CBC_128_ENC(aes_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -101,8 +96,7 @@ uint32_t submit_aes_cbc_burst_enc(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while((job = FLUSH_JOB_AES_CBC_192_ENC(aes_ooo)) - != NULL) { + while ((job = FLUSH_JOB_AES_CBC_192_ENC(aes_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -124,8 +118,7 @@ uint32_t submit_aes_cbc_burst_enc(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while((job = FLUSH_JOB_AES_CBC_256_ENC(aes_ooo)) - != NULL) { + while ((job = FLUSH_JOB_AES_CBC_256_ENC(aes_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -135,12 +128,9 @@ uint32_t submit_aes_cbc_burst_enc(IMB_MGR *state, return completed_jobs; } -__forceinline -uint32_t submit_aes_cbc_burst_dec(IMB_MGR *state, - IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_KEY_SIZE_BYTES key_size, - const int run_check) +__forceinline uint32_t +submit_aes_cbc_burst_dec(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_KEY_SIZE_BYTES key_size, const int run_check) { (void) state; @@ -152,8 +142,7 @@ uint32_t submit_aes_cbc_burst_dec(IMB_MGR *state, IMB_JOB *job = &jobs[i]; /* validate job */ - if (is_job_invalid(state, job, - IMB_CIPHER_CBC, IMB_AUTH_NULL, + if (is_job_invalid(state, job, IMB_CIPHER_CBC, IMB_AUTH_NULL, IMB_DIR_DECRYPT, key_size)) { job->status = IMB_STATUS_INVALID_ARGS; return 0; @@ -167,13 +156,9 @@ uint32_t submit_aes_cbc_burst_dec(IMB_MGR *state, for (i = 0; i < n_jobs; i++) { IMB_JOB *job = &jobs[i]; - AES_CBC_DEC_128(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->dec_keys, - job->dst, - job->msg_len_to_cipher_in_bytes & - (~15)); + AES_CBC_DEC_128(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->dec_keys, job->dst, + job->msg_len_to_cipher_in_bytes & (~15)); job->status = IMB_STATUS_COMPLETED; } } else if (key_size == IMB_KEY_192_BYTES) { @@ -182,28 +167,20 @@ uint32_t submit_aes_cbc_burst_dec(IMB_MGR *state, for (i = 0; i < n_jobs; i++) { IMB_JOB *job = &jobs[i]; - AES_CBC_DEC_192(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->dec_keys, - job->dst, - job->msg_len_to_cipher_in_bytes & - (~15)); + AES_CBC_DEC_192(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->dec_keys, job->dst, + job->msg_len_to_cipher_in_bytes & (~15)); job->status = IMB_STATUS_COMPLETED; } - } else /* assume 256-bit key */ { + } else /* assume 256-bit key */ { uint32_t i; for (i = 0; i < n_jobs; i++) { IMB_JOB *job = &jobs[i]; - AES_CBC_DEC_256(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->dec_keys, - job->dst, - job->msg_len_to_cipher_in_bytes & - (~15)); + AES_CBC_DEC_256(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->dec_keys, job->dst, + job->msg_len_to_cipher_in_bytes & (~15)); job->status = IMB_STATUS_COMPLETED; } } @@ -211,12 +188,9 @@ uint32_t submit_aes_cbc_burst_dec(IMB_MGR *state, return n_jobs; } -__forceinline -uint32_t submit_aes_ctr_burst(IMB_MGR *state, - IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_KEY_SIZE_BYTES key_size, - const int run_check) +__forceinline uint32_t +submit_aes_ctr_burst(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_KEY_SIZE_BYTES key_size, const int run_check) { if (run_check) { uint32_t i; @@ -226,8 +200,7 @@ uint32_t submit_aes_ctr_burst(IMB_MGR *state, IMB_JOB *job = &jobs[i]; /* validate job */ - if (is_job_invalid(state, job, - IMB_CIPHER_CNTR, IMB_AUTH_NULL, + if (is_job_invalid(state, job, IMB_CIPHER_CNTR, IMB_AUTH_NULL, IMB_DIR_ENCRYPT, key_size)) { job->status = IMB_STATUS_INVALID_ARGS; return 0; @@ -244,12 +217,8 @@ uint32_t submit_aes_ctr_burst(IMB_MGR *state, #ifdef SUBMIT_JOB_AES_CTR_128 SUBMIT_JOB_AES_CTR_128(job); #else - AES_CTR_128(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bytes, + AES_CTR_128(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes, job->iv_len_in_bytes); #endif job->status = IMB_STATUS_COMPLETED; @@ -263,17 +232,13 @@ uint32_t submit_aes_ctr_burst(IMB_MGR *state, #ifdef SUBMIT_JOB_AES_CTR_192 SUBMIT_JOB_AES_CTR_192(job); #else - AES_CTR_192(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bytes, + AES_CTR_192(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes, job->iv_len_in_bytes); #endif job->status = IMB_STATUS_COMPLETED; } - } else /* assume 256-bit key */ { + } else /* assume 256-bit key */ { uint32_t i; for (i = 0; i < n_jobs; i++) { @@ -282,12 +247,8 @@ uint32_t submit_aes_ctr_burst(IMB_MGR *state, #ifdef SUBMIT_JOB_AES_CTR_256 SUBMIT_JOB_AES_CTR_256(job); #else - AES_CTR_256(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bytes, + AES_CTR_256(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes, job->iv_len_in_bytes); #endif job->status = IMB_STATUS_COMPLETED; @@ -298,13 +259,10 @@ uint32_t submit_aes_ctr_burst(IMB_MGR *state, } #endif /* __aarch64__ */ -__forceinline -uint32_t submit_cipher_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, - const IMB_KEY_SIZE_BYTES key_size, - const int run_check) +__forceinline uint32_t +submit_cipher_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, + const IMB_KEY_SIZE_BYTES key_size, const int run_check) { /* reset error status */ imb_set_errno(state, 0); @@ -319,14 +277,11 @@ uint32_t submit_cipher_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, #ifndef __aarch64__ case IMB_CIPHER_CBC: if (dir == IMB_DIR_ENCRYPT) - return submit_aes_cbc_burst_enc(state, jobs, n_jobs, - key_size, run_check); + return submit_aes_cbc_burst_enc(state, jobs, n_jobs, key_size, run_check); else - return submit_aes_cbc_burst_dec(state, jobs, n_jobs, - key_size, run_check); + return submit_aes_cbc_burst_dec(state, jobs, n_jobs, key_size, run_check); case IMB_CIPHER_CNTR: - return submit_aes_ctr_burst(state, jobs, n_jobs, - key_size, run_check); + return submit_aes_ctr_burst(state, jobs, n_jobs, key_size, run_check); #endif /* __aarch64__ */ default: break; @@ -339,34 +294,25 @@ uint32_t submit_cipher_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, } uint32_t -SUBMIT_CIPHER_BURST(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +SUBMIT_CIPHER_BURST(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size) { - return submit_cipher_burst_and_check(state, jobs, n_jobs, - cipher, dir, key_size, 1); + return submit_cipher_burst_and_check(state, jobs, n_jobs, cipher, dir, key_size, 1); } uint32_t -SUBMIT_CIPHER_BURST_NOCHECK(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +SUBMIT_CIPHER_BURST_NOCHECK(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size) { - return submit_cipher_burst_and_check(state, jobs, n_jobs, - cipher, dir, key_size, 0); + return submit_cipher_burst_and_check(state, jobs, n_jobs, cipher, dir, key_size, 0); } #ifndef __aarch64__ -__forceinline -uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, - IMB_JOB *jobs, - const uint32_t n_jobs, - const int run_check, - const IMB_HASH_ALG hash_alg) +__forceinline uint32_t +submit_burst_hmac_sha_x(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const int run_check, + const IMB_HASH_ALG hash_alg) { uint32_t i, completed_jobs = 0; @@ -376,10 +322,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, IMB_JOB *job = &jobs[i]; /* validate job */ - if (is_job_invalid(state, job, - IMB_CIPHER_NULL, - hash_alg, - IMB_DIR_ENCRYPT, + if (is_job_invalid(state, job, IMB_CIPHER_NULL, hash_alg, IMB_DIR_ENCRYPT, job->key_len_in_bytes)) { job->status = IMB_STATUS_INVALID_ARGS; return 0; @@ -402,8 +345,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while ((job = FLUSH_JOB_HMAC(state->hmac_sha_1_ooo)) - != NULL) { + while ((job = FLUSH_JOB_HMAC(state->hmac_sha_1_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -413,8 +355,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, for (i = 0; i < n_jobs; i++) { IMB_JOB *job = &jobs[i]; - job = SUBMIT_JOB_HMAC_SHA_224(state->hmac_sha_224_ooo, - job); + job = SUBMIT_JOB_HMAC_SHA_224(state->hmac_sha_224_ooo, job); if (job != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; @@ -424,9 +365,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while ((job = - FLUSH_JOB_HMAC_SHA_224(state->hmac_sha_224_ooo)) - != NULL) { + while ((job = FLUSH_JOB_HMAC_SHA_224(state->hmac_sha_224_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -436,8 +375,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, for (i = 0; i < n_jobs; i++) { IMB_JOB *job = &jobs[i]; - job = SUBMIT_JOB_HMAC_SHA_256(state->hmac_sha_256_ooo, - job); + job = SUBMIT_JOB_HMAC_SHA_256(state->hmac_sha_256_ooo, job); if (job != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; @@ -447,9 +385,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while ((job = - FLUSH_JOB_HMAC_SHA_256(state->hmac_sha_256_ooo)) - != NULL) { + while ((job = FLUSH_JOB_HMAC_SHA_256(state->hmac_sha_256_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -459,8 +395,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, for (i = 0; i < n_jobs; i++) { IMB_JOB *job = &jobs[i]; - job = SUBMIT_JOB_HMAC_SHA_384(state->hmac_sha_384_ooo, - job); + job = SUBMIT_JOB_HMAC_SHA_384(state->hmac_sha_384_ooo, job); if (job != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; @@ -470,9 +405,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while ((job = - FLUSH_JOB_HMAC_SHA_384(state->hmac_sha_384_ooo)) - != NULL) { + while ((job = FLUSH_JOB_HMAC_SHA_384(state->hmac_sha_384_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -482,8 +415,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, for (i = 0; i < n_jobs; i++) { IMB_JOB *job = &jobs[i]; - job = SUBMIT_JOB_HMAC_SHA_512(state->hmac_sha_512_ooo, - job); + job = SUBMIT_JOB_HMAC_SHA_512(state->hmac_sha_512_ooo, job); if (job != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; @@ -493,9 +425,7 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, if (completed_jobs != n_jobs) { IMB_JOB *job = NULL; - while ((job = - FLUSH_JOB_HMAC_SHA_512(state->hmac_sha_512_ooo)) - != NULL) { + while ((job = FLUSH_JOB_HMAC_SHA_512(state->hmac_sha_512_ooo)) != NULL) { job->status = IMB_STATUS_COMPLETED; completed_jobs++; } @@ -506,11 +436,9 @@ uint32_t submit_burst_hmac_sha_x(IMB_MGR *state, } #endif /* __aarch64__ */ -__forceinline -uint32_t submit_hash_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_HASH_ALG hash, - const int run_check) +__forceinline uint32_t +submit_hash_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_HASH_ALG hash, const int run_check) { /* reset error status */ imb_set_errno(state, 0); @@ -525,8 +453,7 @@ uint32_t submit_hash_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, switch (hash) { #ifndef __aarch64__ case IMB_AUTH_HMAC_SHA_1: - return submit_burst_hmac_sha_x(state, jobs, n_jobs, run_check, - IMB_AUTH_HMAC_SHA_1); + return submit_burst_hmac_sha_x(state, jobs, n_jobs, run_check, IMB_AUTH_HMAC_SHA_1); case IMB_AUTH_HMAC_SHA_224: return submit_burst_hmac_sha_x(state, jobs, n_jobs, run_check, IMB_AUTH_HMAC_SHA_224); @@ -551,16 +478,13 @@ uint32_t submit_hash_burst_and_check(IMB_MGR *state, IMB_JOB *jobs, } uint32_t -SUBMIT_HASH_BURST(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_HASH_ALG hash) +SUBMIT_HASH_BURST(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash) { return submit_hash_burst_and_check(state, jobs, n_jobs, hash, 1); } uint32_t -SUBMIT_HASH_BURST_NOCHECK(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +SUBMIT_HASH_BURST_NOCHECK(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash) { return submit_hash_burst_and_check(state, jobs, n_jobs, hash, 0); diff --git a/lib/include/mb_mgr_burst_async.h b/lib/include/mb_mgr_burst_async.h index c9dd5bf0..b6d98801 100644 --- a/lib/include/mb_mgr_burst_async.h +++ b/lib/include/mb_mgr_burst_async.h @@ -34,15 +34,14 @@ #include "include/error.h" #include "include/mb_mgr_job_check.h" /* is_job_invalid() */ -__forceinline -void ADV_N_JOBS(int *ptr, const uint32_t n_jobs) +__forceinline void +ADV_N_JOBS(int *ptr, const uint32_t n_jobs) { *ptr += (sizeof(IMB_JOB) * n_jobs); if (*ptr >= (int) (IMB_MAX_JOBS * sizeof(IMB_JOB))) *ptr -= (int) (IMB_MAX_JOBS * sizeof(IMB_JOB)); } - /* get number of jobs between job_offset and the end of the queue */ __forceinline uint32_t get_queue_sz_end(const int job_offset) @@ -111,8 +110,7 @@ GET_NEXT_BURST(IMB_MGR *state, const uint32_t n_req_jobs, IMB_JOB **jobs) } __forceinline uint32_t -submit_burst_and_check(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs, const int run_check) +submit_burst_and_check(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs, const int run_check) { uint32_t i, n_ret_jobs = 0, num_jobs = n_jobs; IMB_JOB *job = NULL; @@ -149,11 +147,8 @@ submit_burst_and_check(IMB_MGR *state, const uint32_t n_jobs, ADV_JOBS(&job_offset); /* validate job */ - if (is_job_invalid(state, jobs[i], - jobs[i]->cipher_mode, - jobs[i]->hash_alg, - jobs[i]->cipher_direction, - jobs[i]->key_len_in_bytes)) { + if (is_job_invalid(state, jobs[i], jobs[i]->cipher_mode, jobs[i]->hash_alg, + jobs[i]->cipher_direction, jobs[i]->key_len_in_bytes)) { goto return_invalid_job; } @@ -162,10 +157,8 @@ submit_burst_and_check(IMB_MGR *state, const uint32_t n_jobs, set_cipher_suite_id(jobs[i], t); - if(jobs[i]->suite_id[0] != t[0] || - jobs[i]->suite_id[1] != t[1] || - jobs[i]->suite_id[2] != t[2] || - jobs[i]->suite_id[3] != t[3]) { + if (jobs[i]->suite_id[0] != t[0] || jobs[i]->suite_id[1] != t[1] || + jobs[i]->suite_id[2] != t[2] || jobs[i]->suite_id[3] != t[3]) { imb_set_errno(state, IMB_ERR_BURST_SUITE_ID); goto return_invalid_job; } diff --git a/lib/include/mb_mgr_code.h b/lib/include/mb_mgr_code.h index ef1362de..f3f23ae9 100644 --- a/lib/include/mb_mgr_code.h +++ b/lib/include/mb_mgr_code.h @@ -33,16 +33,16 @@ #include "ipsec-mb.h" #include "include/error.h" -__forceinline -IMB_JOB *JOBS(IMB_MGR *state, const int offset) +__forceinline IMB_JOB * +JOBS(IMB_MGR *state, const int offset) { - char *cp = (char *)state->jobs; + char *cp = (char *) state->jobs; - return (IMB_JOB *)(cp + offset); + return (IMB_JOB *) (cp + offset); } -__forceinline -void ADV_JOBS(int *ptr) +__forceinline void +ADV_JOBS(int *ptr) { *ptr += sizeof(IMB_JOB); if (*ptr >= (int) (IMB_MAX_JOBS * sizeof(IMB_JOB))) @@ -52,10 +52,9 @@ void ADV_JOBS(int *ptr) __forceinline uint32_t get_queue_sz(IMB_MGR *state) { - const int a = (state->next_job - state->earliest_job) / - (int) sizeof(IMB_JOB); + const int a = (state->next_job - state->earliest_job) / (int) sizeof(IMB_JOB); - return a & (IMB_MAX_JOBS-1); + return a & (IMB_MAX_JOBS - 1); } __forceinline uint32_t diff --git a/lib/include/mb_mgr_job_api.h b/lib/include/mb_mgr_job_api.h index b942a920..2c63d71c 100644 --- a/lib/include/mb_mgr_job_api.h +++ b/lib/include/mb_mgr_job_api.h @@ -58,43 +58,38 @@ #include "include/mb_mgr_job_check.h" /* is_job_invalid() */ #ifndef __aarch64__ -#define CRC(func, state, job) *((uint32_t *)job->auth_tag_output) = \ - func(state, job->src + job->hash_start_src_offset_in_bytes, \ +#define CRC(func, state, job) \ + *((uint32_t *) job->auth_tag_output) = \ + func(state, job->src + job->hash_start_src_offset_in_bytes, \ job->msg_len_to_hash_in_bytes) /* ========================================================================= */ /* AES-CBC */ /* ========================================================================= */ -__forceinline IMB_JOB *SUBMIT_JOB_AES_CBC_128_DEC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_CBC_128_DEC(IMB_JOB *job) { - AES_CBC_DEC_128(job->src + job->cipher_start_src_offset_in_bytes, - job->iv, - job->dec_keys, - job->dst, - job->msg_len_to_cipher_in_bytes & (~15)); + AES_CBC_DEC_128(job->src + job->cipher_start_src_offset_in_bytes, job->iv, job->dec_keys, + job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_CBC_192_DEC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_CBC_192_DEC(IMB_JOB *job) { - AES_CBC_DEC_192(job->src + job->cipher_start_src_offset_in_bytes, - job->iv, - job->dec_keys, - job->dst, - job->msg_len_to_cipher_in_bytes); + AES_CBC_DEC_192(job->src + job->cipher_start_src_offset_in_bytes, job->iv, job->dec_keys, + job->dst, job->msg_len_to_cipher_in_bytes); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_CBC_256_DEC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_CBC_256_DEC(IMB_JOB *job) { - AES_CBC_DEC_256(job->src + job->cipher_start_src_offset_in_bytes, - job->iv, - job->dec_keys, - job->dst, - job->msg_len_to_cipher_in_bytes & (~15)); + AES_CBC_DEC_256(job->src + job->cipher_start_src_offset_in_bytes, job->iv, job->dec_keys, + job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } @@ -103,61 +98,55 @@ __forceinline IMB_JOB *SUBMIT_JOB_AES_CBC_256_DEC(IMB_JOB *job) /* AES-ECB */ /* ========================================================================= */ -__forceinline IMB_JOB *SUBMIT_JOB_AES_ECB_128_ENC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_ECB_128_ENC(IMB_JOB *job) { - AES_ECB_ENC_128(job->src + job->cipher_start_src_offset_in_bytes, - job->enc_keys, - job->dst, + AES_ECB_ENC_128(job->src + job->cipher_start_src_offset_in_bytes, job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_ECB_192_ENC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_ECB_192_ENC(IMB_JOB *job) { - AES_ECB_ENC_192(job->src + job->cipher_start_src_offset_in_bytes, - job->enc_keys, - job->dst, + AES_ECB_ENC_192(job->src + job->cipher_start_src_offset_in_bytes, job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_ECB_256_ENC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_ECB_256_ENC(IMB_JOB *job) { - AES_ECB_ENC_256(job->src + job->cipher_start_src_offset_in_bytes, - job->enc_keys, - job->dst, + AES_ECB_ENC_256(job->src + job->cipher_start_src_offset_in_bytes, job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_ECB_128_DEC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_ECB_128_DEC(IMB_JOB *job) { - AES_ECB_DEC_128(job->src + job->cipher_start_src_offset_in_bytes, - job->dec_keys, - job->dst, + AES_ECB_DEC_128(job->src + job->cipher_start_src_offset_in_bytes, job->dec_keys, job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_ECB_192_DEC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_ECB_192_DEC(IMB_JOB *job) { - AES_ECB_DEC_192(job->src + job->cipher_start_src_offset_in_bytes, - job->dec_keys, - job->dst, + AES_ECB_DEC_192(job->src + job->cipher_start_src_offset_in_bytes, job->dec_keys, job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_ECB_256_DEC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_ECB_256_DEC(IMB_JOB *job) { - AES_ECB_DEC_256(job->src + job->cipher_start_src_offset_in_bytes, - job->dec_keys, - job->dst, + AES_ECB_DEC_256(job->src + job->cipher_start_src_offset_in_bytes, job->dec_keys, job->dst, job->msg_len_to_cipher_in_bytes & (~15)); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; @@ -167,13 +156,11 @@ __forceinline IMB_JOB *SUBMIT_JOB_AES_ECB_256_DEC(IMB_JOB *job) /* AES-CBCS */ /* ========================================================================= */ -__forceinline IMB_JOB * SUBMIT_JOB_AES128_CBCS_1_9_DEC(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_AES128_CBCS_1_9_DEC(IMB_JOB *job) { - AES_CBCS_1_9_DEC_128(job->src + job->cipher_start_src_offset_in_bytes, - job->iv, - job->dec_keys, - job->dst, - job->msg_len_to_cipher_in_bytes & (~15), + AES_CBCS_1_9_DEC_128(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->dec_keys, job->dst, job->msg_len_to_cipher_in_bytes & (~15), job->cipher_fields.CBCS.next_iv); job->status |= IMB_STATUS_COMPLETED_CIPHER; return job; @@ -188,8 +175,8 @@ __forceinline IMB_JOB * SUBMIT_JOB_AES128_CBCS_1_9_DEC(IMB_JOB *job) /* ========================================================================= */ /* AES-GCM */ /* ========================================================================= */ -__forceinline IMB_JOB *SUBMIT_JOB_AES_GCM_DEC(IMB_MGR *state, IMB_JOB *job, - const uint64_t key_sz) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_GCM_DEC(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) { if (16 == key_sz) return AES_GCM_DEC_IV_128(state, job); @@ -199,8 +186,8 @@ __forceinline IMB_JOB *SUBMIT_JOB_AES_GCM_DEC(IMB_MGR *state, IMB_JOB *job, return AES_GCM_DEC_IV_256(state, job); } -__forceinline IMB_JOB *SUBMIT_JOB_AES_GCM_ENC(IMB_MGR *state, IMB_JOB *job, - const uint64_t key_sz) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_GCM_ENC(IMB_MGR *state, IMB_JOB *job, const uint64_t key_sz) { if (16 == key_sz) return AES_GCM_ENC_IV_128(state, job); @@ -213,40 +200,31 @@ __forceinline IMB_JOB *SUBMIT_JOB_AES_GCM_ENC(IMB_MGR *state, IMB_JOB *job, /* ========================================================================= */ /* AES-CTR */ /* ========================================================================= */ -__forceinline IMB_JOB *SUBMIT_JOB_AES_CTR(IMB_JOB *job, - const uint64_t key_sz) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_CTR(IMB_JOB *job, const uint64_t key_sz) { if (IMB_KEY_128_BYTES == key_sz) { #ifdef SUBMIT_JOB_AES_CTR_128 SUBMIT_JOB_AES_CTR_128(job); #else - AES_CTR_128(job->src + job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bytes, + AES_CTR_128(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes, job->iv_len_in_bytes); #endif } else if (IMB_KEY_192_BYTES == key_sz) { #ifdef SUBMIT_JOB_AES_CTR_192 SUBMIT_JOB_AES_CTR_192(job); #else - AES_CTR_192(job->src + job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bytes, + AES_CTR_192(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes, job->iv_len_in_bytes); #endif } else /* assume 256-bit key */ { #ifdef SUBMIT_JOB_AES_CTR_256 SUBMIT_JOB_AES_CTR_256(job); #else - AES_CTR_256(job->src + job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bytes, + AES_CTR_256(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bytes, job->iv_len_in_bytes); #endif } @@ -255,43 +233,31 @@ __forceinline IMB_JOB *SUBMIT_JOB_AES_CTR(IMB_JOB *job, return job; } -__forceinline IMB_JOB *SUBMIT_JOB_AES_CTR_BIT(IMB_JOB *job, - const uint64_t key_sz) +__forceinline IMB_JOB * +SUBMIT_JOB_AES_CTR_BIT(IMB_JOB *job, const uint64_t key_sz) { if (IMB_KEY_128_BYTES == key_sz) { #ifdef SUBMIT_JOB_AES_CTR_128_BIT SUBMIT_JOB_AES_CTR_128_BIT(job); #else - AES_CTR_128_BIT(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bits, + AES_CTR_128_BIT(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bits, job->iv_len_in_bytes); #endif } else if (IMB_KEY_192_BYTES == key_sz) { #ifdef SUBMIT_JOB_AES_CTR_192_BIT SUBMIT_JOB_AES_CTR_192_BIT(job); #else - AES_CTR_192_BIT(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bits, + AES_CTR_192_BIT(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bits, job->iv_len_in_bytes); #endif } else /* assume 256-bit key */ { #ifdef SUBMIT_JOB_AES_CTR_256_BIT SUBMIT_JOB_AES_CTR_256_BIT(job); #else - AES_CTR_256_BIT(job->src + - job->cipher_start_src_offset_in_bytes, - job->iv, - job->enc_keys, - job->dst, - job->msg_len_to_cipher_in_bits, + AES_CTR_256_BIT(job->src + job->cipher_start_src_offset_in_bytes, job->iv, + job->enc_keys, job->dst, job->msg_len_to_cipher_in_bits, job->iv_len_in_bytes); #endif } @@ -304,7 +270,8 @@ __forceinline IMB_JOB *SUBMIT_JOB_AES_CTR_BIT(IMB_JOB *job, /* Custom hash / cipher */ /* ========================================================================= */ -__forceinline IMB_JOB *JOB_CUSTOM_CIPHER(IMB_JOB *job) +__forceinline IMB_JOB * +JOB_CUSTOM_CIPHER(IMB_JOB *job) { if (!(job->status & IMB_STATUS_COMPLETED_CIPHER)) { if (job->cipher_func(job)) @@ -315,17 +282,20 @@ __forceinline IMB_JOB *JOB_CUSTOM_CIPHER(IMB_JOB *job) return job; } -__forceinline IMB_JOB *SUBMIT_JOB_CUSTOM_CIPHER(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_CUSTOM_CIPHER(IMB_JOB *job) { return JOB_CUSTOM_CIPHER(job); } -__forceinline IMB_JOB *FLUSH_JOB_CUSTOM_CIPHER(IMB_JOB *job) +__forceinline IMB_JOB * +FLUSH_JOB_CUSTOM_CIPHER(IMB_JOB *job) { return JOB_CUSTOM_CIPHER(job); } -__forceinline IMB_JOB *JOB_CUSTOM_HASH(IMB_JOB *job) +__forceinline IMB_JOB * +JOB_CUSTOM_HASH(IMB_JOB *job) { if (!(job->status & IMB_STATUS_COMPLETED_AUTH)) { if (job->hash_func(job)) @@ -336,12 +306,14 @@ __forceinline IMB_JOB *JOB_CUSTOM_HASH(IMB_JOB *job) return job; } -__forceinline IMB_JOB *SUBMIT_JOB_CUSTOM_HASH(IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_CUSTOM_HASH(IMB_JOB *job) { return JOB_CUSTOM_HASH(job); } -__forceinline IMB_JOB *FLUSH_JOB_CUSTOM_HASH(IMB_JOB *job) +__forceinline IMB_JOB * +FLUSH_JOB_CUSTOM_HASH(IMB_JOB *job) { return JOB_CUSTOM_HASH(job); } @@ -350,9 +322,9 @@ __forceinline IMB_JOB *FLUSH_JOB_CUSTOM_HASH(IMB_JOB *job) /* ========================================================================= */ /* Cipher submit & flush functions */ /* ========================================================================= */ -__forceinline IMB_JOB *SUBMIT_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, - const IMB_CIPHER_MODE cipher_mode, - const uint64_t key_sz) +__forceinline IMB_JOB * +SUBMIT_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, + const uint64_t key_sz) { #ifndef __aarch64__ if (IMB_CIPHER_GCM == cipher_mode) { @@ -412,8 +384,7 @@ __forceinline IMB_JOB *SUBMIT_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, #ifdef SUBMIT_JOB_DOCSIS_DES_ENC MB_MGR_DES_OOO *docsis_des_enc_ooo = state->docsis_des_enc_ooo; - return SUBMIT_JOB_DOCSIS_DES_ENC(docsis_des_enc_ooo, - job); + return SUBMIT_JOB_DOCSIS_DES_ENC(docsis_des_enc_ooo, job); #else return DOCSIS_DES_ENC(job); #endif /* SUBMIT_JOB_DOCSIS_DES_ENC */ @@ -440,8 +411,7 @@ __forceinline IMB_JOB *SUBMIT_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, return SUBMIT_JOB_ZUC_EEA3(zuc_eea3_ooo, job); } else { /* assume 32 */ - MB_MGR_ZUC_OOO *zuc256_eea3_ooo = - state->zuc256_eea3_ooo; + MB_MGR_ZUC_OOO *zuc256_eea3_ooo = state->zuc256_eea3_ooo; return SUBMIT_JOB_ZUC256_EEA3(zuc256_eea3_ooo, job); } @@ -469,9 +439,9 @@ __forceinline IMB_JOB *SUBMIT_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, } } -__forceinline IMB_JOB *FLUSH_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, - const IMB_CIPHER_MODE cipher_mode, - const uint64_t key_sz) +__forceinline IMB_JOB * +FLUSH_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, + const uint64_t key_sz) { #ifndef __aarch64__ if (IMB_CIPHER_CBC == cipher_mode) { @@ -483,7 +453,7 @@ __forceinline IMB_JOB *FLUSH_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, MB_MGR_AES_OOO *aes192_ooo = state->aes192_ooo; return FLUSH_JOB_AES_CBC_192_ENC(aes192_ooo); - } else { /* assume 32 */ + } else { /* assume 32 */ MB_MGR_AES_OOO *aes256_ooo = state->aes256_ooo; return FLUSH_JOB_AES_CBC_256_ENC(aes256_ooo); @@ -519,8 +489,7 @@ __forceinline IMB_JOB *FLUSH_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, return FLUSH_JOB_ZUC_EEA3(zuc_eea3_ooo); } else { /* assume 32 */ - MB_MGR_ZUC_OOO *zuc256_eea3_ooo = - state->zuc256_eea3_ooo; + MB_MGR_ZUC_OOO *zuc256_eea3_ooo = state->zuc256_eea3_ooo; return FLUSH_JOB_ZUC256_EEA3(zuc256_eea3_ooo); } @@ -534,18 +503,18 @@ __forceinline IMB_JOB *FLUSH_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, } else if (IMB_CIPHER_SNOW3G_UEA2_BITLEN == cipher_mode) { return FLUSH_JOB_SNOW3G_UEA2(state); #endif - /** - * assume IMB_CIPHER_CNTR/CNTR_BITLEN, IMB_CIPHER_ECB, - * IMB_CIPHER_CCM, IMB_CIPHER_NULL or IMB_CIPHER_GCM - */ + /** + * assume IMB_CIPHER_CNTR/CNTR_BITLEN, IMB_CIPHER_ECB, + * IMB_CIPHER_CCM, IMB_CIPHER_NULL or IMB_CIPHER_GCM + */ } else { return NULL; } } -__forceinline IMB_JOB *SUBMIT_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, - const IMB_CIPHER_MODE cipher_mode, - const uint64_t key_sz) +__forceinline IMB_JOB * +SUBMIT_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, + const uint64_t key_sz) { #ifndef __aarch64__ if (IMB_CIPHER_GCM == cipher_mode) { @@ -598,8 +567,7 @@ __forceinline IMB_JOB *SUBMIT_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, #ifdef SUBMIT_JOB_DOCSIS_DES_DEC MB_MGR_DES_OOO *docsis_des_dec_ooo = state->docsis_des_dec_ooo; - return SUBMIT_JOB_DOCSIS_DES_DEC(docsis_des_dec_ooo, - job); + return SUBMIT_JOB_DOCSIS_DES_DEC(docsis_des_dec_ooo, job); #else return DOCSIS_DES_DEC(job); #endif /* SUBMIT_JOB_DOCSIS_DES_DEC */ @@ -628,8 +596,7 @@ __forceinline IMB_JOB *SUBMIT_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, return SUBMIT_JOB_ZUC_EEA3(zuc_eea3_ooo, job); } else { /* assume 32 */ - MB_MGR_ZUC_OOO *zuc256_eea3_ooo = - state->zuc256_eea3_ooo; + MB_MGR_ZUC_OOO *zuc256_eea3_ooo = state->zuc256_eea3_ooo; return SUBMIT_JOB_ZUC256_EEA3(zuc256_eea3_ooo, job); } @@ -656,9 +623,9 @@ __forceinline IMB_JOB *SUBMIT_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, } } -__forceinline IMB_JOB *FLUSH_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, - const IMB_CIPHER_MODE cipher_mode, - const uint64_t key_sz) +__forceinline IMB_JOB * +FLUSH_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, + const uint64_t key_sz) { (void) job; @@ -700,8 +667,7 @@ __forceinline IMB_JOB *FLUSH_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, return FLUSH_JOB_ZUC_EEA3(zuc_eea3_ooo); } else { /* assume 32 */ - MB_MGR_ZUC_OOO *zuc256_eea3_ooo = - state->zuc256_eea3_ooo; + MB_MGR_ZUC_OOO *zuc256_eea3_ooo = state->zuc256_eea3_ooo; return FLUSH_JOB_ZUC256_EEA3(zuc256_eea3_ooo); } @@ -720,63 +686,63 @@ __forceinline IMB_JOB *FLUSH_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, #ifndef __aarch64__ /* AES-CBC */ -static IMB_JOB *submit_cipher_dec_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, IMB_KEY_256_BYTES); } /* AES-CTR */ -static IMB_JOB *submit_cipher_dec_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* NULL */ -static IMB_JOB *submit_cipher_dec_null(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_null(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_NULL, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_NULL, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* AES DOCSIS */ -static IMB_JOB *submit_cipher_dec_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_256_BYTES); } /* AES-GCM */ @@ -785,182 +751,180 @@ static IMB_JOB *submit_cipher_dec_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) #define submit_cipher_dec_aes_gcm_256 AES_GCM_DEC_IV_256 /* CUSTOM */ -static IMB_JOB *submit_cipher_dec_custom(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_custom(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CUSTOM, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CUSTOM, IMB_KEY_128_BYTES); } /* DES */ -static IMB_JOB *submit_cipher_dec_des_cbc_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_des_cbc_64(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES, - IMB_KEY_64_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES, IMB_KEY_64_BYTES); } /* DES DOCSIS */ -static IMB_JOB *submit_cipher_dec_des_docsis_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_des_docsis_64(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_DES, - IMB_KEY_64_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_DES, IMB_KEY_64_BYTES); } /* AES-CCM */ -static IMB_JOB *submit_cipher_dec_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, IMB_KEY_256_BYTES); } /* 3DES */ -static IMB_JOB *submit_cipher_dec_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES3, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES3, IMB_KEY_192_BYTES); } /* PON AES-CTR */ -static IMB_JOB *submit_cipher_dec_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_PON_AES_CNTR, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_PON_AES_CNTR, IMB_KEY_128_BYTES); } /* AES-ECB */ -static IMB_JOB *submit_cipher_dec_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, IMB_KEY_256_BYTES); } /* AES-CTR BITS */ -static IMB_JOB *submit_cipher_dec_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* ZUC EEA3 */ -static IMB_JOB *submit_cipher_dec_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_256_BYTES); } /* SNOW3G UEA2 */ -static IMB_JOB *submit_cipher_dec_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* KASUMI F8 UEA1 */ -static IMB_JOB *submit_cipher_dec_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, IMB_KEY_128_BYTES); } /* AES-CBCS-1-9 */ -static IMB_JOB *submit_cipher_dec_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBCS_1_9, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBCS_1_9, IMB_KEY_128_BYTES); } /* CHACHA20 */ -static IMB_JOB *submit_cipher_dec_chacha20(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_chacha20(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 */ static IMB_JOB * submit_cipher_dec_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20_POLY1305, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20_POLY1305, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 SGL */ static IMB_JOB * submit_cipher_dec_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, - IMB_CIPHER_CHACHA20_POLY1305_SGL, + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20_POLY1305_SGL, IMB_KEY_256_BYTES); } /* SNOW-V */ -static IMB_JOB *submit_cipher_dec_snow_v(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_snow_v(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V, IMB_KEY_256_BYTES); } /* SNOW-V AEAD */ -static IMB_JOB *submit_cipher_dec_snow_v_aead(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_snow_v_aead(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V_AEAD, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V_AEAD, IMB_KEY_256_BYTES); } /* AES-GCM SGL */ -static IMB_JOB *submit_cipher_dec_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ @@ -970,63 +934,63 @@ static IMB_JOB *submit_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) #ifndef __aarch64__ /* AES-CBC */ -static IMB_JOB *submit_cipher_enc_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, IMB_KEY_256_BYTES); } /* AES-CTR */ -static IMB_JOB *submit_cipher_enc_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* NULL */ -static IMB_JOB *submit_cipher_enc_null(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_null(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_NULL, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_NULL, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* AES DOCSIS */ -static IMB_JOB *submit_cipher_enc_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_256_BYTES); } /* AES-GCM */ @@ -1035,182 +999,180 @@ static IMB_JOB *submit_cipher_enc_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) #define submit_cipher_enc_aes_gcm_256 AES_GCM_ENC_IV_256 /* CUSTOM */ -static IMB_JOB *submit_cipher_enc_custom(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_custom(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CUSTOM, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CUSTOM, IMB_KEY_128_BYTES); } /* DES */ -static IMB_JOB *submit_cipher_enc_des_cbc_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_des_cbc_64(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES, - IMB_KEY_64_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES, IMB_KEY_64_BYTES); } /* DES DOCSIS */ -static IMB_JOB *submit_cipher_enc_des_docsis_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_des_docsis_64(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_DES, - IMB_KEY_64_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_DES, IMB_KEY_64_BYTES); } /* AES-CCM */ -static IMB_JOB *submit_cipher_enc_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, IMB_KEY_256_BYTES); } /* 3DES */ -static IMB_JOB *submit_cipher_enc_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES3, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES3, IMB_KEY_192_BYTES); } /* PON AES-CTR */ -static IMB_JOB *submit_cipher_enc_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_PON_AES_CNTR, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_PON_AES_CNTR, IMB_KEY_128_BYTES); } /* AES-ECB */ -static IMB_JOB *submit_cipher_enc_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, IMB_KEY_256_BYTES); } /* AES-CTR BITS */ -static IMB_JOB *submit_cipher_enc_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* ZUC EEA3 */ -static IMB_JOB *submit_cipher_enc_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_256_BYTES); } /* SNOW3G UEA2 */ -static IMB_JOB *submit_cipher_enc_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* KASUMI F8 UEA1 */ -static IMB_JOB *submit_cipher_enc_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, IMB_KEY_128_BYTES); } /* AES-CBCS-1-9 */ -static IMB_JOB *submit_cipher_enc_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBCS_1_9, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBCS_1_9, IMB_KEY_128_BYTES); } /* CHACHA20 */ -static IMB_JOB *submit_cipher_enc_chacha20(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_chacha20(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 */ static IMB_JOB * submit_cipher_enc_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20_POLY1305, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20_POLY1305, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 SGL */ static IMB_JOB * submit_cipher_enc_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, - IMB_CIPHER_CHACHA20_POLY1305_SGL, + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20_POLY1305_SGL, IMB_KEY_256_BYTES); } /* SNOW-V */ -static IMB_JOB *submit_cipher_enc_snow_v(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_snow_v(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V, IMB_KEY_256_BYTES); } /* SNOW-V AEAD */ -static IMB_JOB *submit_cipher_enc_snow_v_aead(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_snow_v_aead(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V_AEAD, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V_AEAD, IMB_KEY_256_BYTES); } /* AES-GCM SGL */ -static IMB_JOB *submit_cipher_enc_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_128_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_128_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_192_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_192_BYTES); } -static IMB_JOB *submit_cipher_enc_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_cipher_enc_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) { - return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_256_BYTES); + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ @@ -1232,7 +1194,10 @@ static const submit_flush_fn_t tab_submit_cipher[] = { /* ========================= */ /* [0] keep empty - enums start from value 1 */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, #ifndef __aarch64__ /* [1] AES-CBC */ submit_cipher_dec_null, @@ -1384,28 +1349,55 @@ static const submit_flush_fn_t tab_submit_cipher[] = { /* add new cipher decrypt here */ /* [24] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [25] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [26] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [27] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [28] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [29] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [30] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [31] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* ========================= */ /* === ENCRYPT DIRECTION === */ /* ========================= */ /* [0] keep empty - enums start from value 1 */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, #ifndef __aarch64__ /* [1] AES-CBC */ submit_cipher_enc_null, @@ -1557,21 +1549,45 @@ static const submit_flush_fn_t tab_submit_cipher[] = { /* add new cipher encrypt here */ /* [24] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [25] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [26] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [27] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [28] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [29] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [30] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [31] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }; @@ -1585,261 +1601,259 @@ static const submit_flush_fn_t tab_submit_cipher[] = { #ifndef __aarch64__ /* AES-CBC */ -static IMB_JOB *flush_cipher_dec_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBC, IMB_KEY_256_BYTES); } /* AES-CTR */ -static IMB_JOB *flush_cipher_dec_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* NULL */ -static IMB_JOB *flush_cipher_dec_null(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_null(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_NULL, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_NULL, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* AES DOCSIS */ -static IMB_JOB *flush_cipher_dec_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_256_BYTES); } /* AES-GCM */ -static IMB_JOB *flush_cipher_dec_aes_gcm_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_gcm_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_gcm_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_gcm_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_gcm_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_gcm_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM, IMB_KEY_256_BYTES); } /* CUSTOM */ -static IMB_JOB *flush_cipher_dec_custom(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_custom(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CUSTOM, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CUSTOM, IMB_KEY_128_BYTES); } /* DES */ -static IMB_JOB *flush_cipher_dec_des_cbc_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_des_cbc_64(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES, - IMB_KEY_64_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES, IMB_KEY_64_BYTES); } /* DES DOCSIS */ -static IMB_JOB *flush_cipher_dec_des_docsis_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_des_docsis_64(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_DES, - IMB_KEY_64_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DOCSIS_DES, IMB_KEY_64_BYTES); } /* AES-CCM */ -static IMB_JOB *flush_cipher_dec_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CCM, IMB_KEY_256_BYTES); } /* 3DES */ -static IMB_JOB *flush_cipher_dec_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES3, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_DES3, IMB_KEY_192_BYTES); } /* PON AES-CTR */ -static IMB_JOB *flush_cipher_dec_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_PON_AES_CNTR, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_PON_AES_CNTR, IMB_KEY_128_BYTES); } /* AES-ECB */ -static IMB_JOB *flush_cipher_dec_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ECB, IMB_KEY_256_BYTES); } /* AES-CTR BITS */ -static IMB_JOB *flush_cipher_dec_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* ZUC EEA3 */ -static IMB_JOB *flush_cipher_dec_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_256_BYTES); } /* SNOW3G UEA2 */ -static IMB_JOB *flush_cipher_dec_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* KASUMI F8 UEA1 */ -static IMB_JOB *flush_cipher_dec_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, IMB_KEY_128_BYTES); } /* AES-CBCS-1-9 */ -static IMB_JOB *flush_cipher_dec_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBCS_1_9, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CBCS_1_9, IMB_KEY_128_BYTES); } /* CHACHA20 */ -static IMB_JOB *flush_cipher_dec_chacha20(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_chacha20(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 */ static IMB_JOB * flush_cipher_dec_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20_POLY1305, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20_POLY1305, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 SGL */ static IMB_JOB * flush_cipher_dec_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, - IMB_CIPHER_CHACHA20_POLY1305_SGL, + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_CHACHA20_POLY1305_SGL, IMB_KEY_256_BYTES); } /* SNOW-V */ -static IMB_JOB *flush_cipher_dec_snow_v(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_snow_v(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V, IMB_KEY_256_BYTES); } /* SNOW-V AEAD */ -static IMB_JOB *flush_cipher_dec_snow_v_aead(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_snow_v_aead(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V_AEAD, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SNOW_V_AEAD, IMB_KEY_256_BYTES); } /* AES-GCM SGL */ -static IMB_JOB *flush_cipher_dec_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ @@ -1849,261 +1863,259 @@ static IMB_JOB *flush_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) #ifndef __aarch64__ /* AES-CBC */ -static IMB_JOB *flush_cipher_enc_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_cbc_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_cbc_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBC, IMB_KEY_256_BYTES); } /* AES-CTR */ -static IMB_JOB *flush_cipher_enc_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ctr_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ctr_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ctr_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* NULL */ -static IMB_JOB *flush_cipher_enc_null(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_null(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_NULL, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_NULL, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* AES DOCSIS */ -static IMB_JOB *flush_cipher_enc_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_docsis_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_docsis_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_SEC_BPI, IMB_KEY_256_BYTES); } /* AES-GCM */ -static IMB_JOB *flush_cipher_enc_aes_gcm_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_gcm_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_gcm_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_gcm_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_gcm_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_gcm_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM, IMB_KEY_256_BYTES); } /* CUSTOM */ -static IMB_JOB *flush_cipher_enc_custom(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_custom(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CUSTOM, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CUSTOM, IMB_KEY_128_BYTES); } /* DES */ -static IMB_JOB *flush_cipher_enc_des_cbc_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_des_cbc_64(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES, - IMB_KEY_64_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES, IMB_KEY_64_BYTES); } /* DES DOCSIS */ -static IMB_JOB *flush_cipher_enc_des_docsis_64(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_des_docsis_64(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_DES, - IMB_KEY_64_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DOCSIS_DES, IMB_KEY_64_BYTES); } /* AES-CCM */ -static IMB_JOB *flush_cipher_enc_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ccm_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ccm_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CCM, IMB_KEY_256_BYTES); } /* 3DES */ -static IMB_JOB *flush_cipher_enc_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_des3_cbc_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES3, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_DES3, IMB_KEY_192_BYTES); } /* PON AES-CTR */ -static IMB_JOB *flush_cipher_enc_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ctr_pon_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_PON_AES_CNTR, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_PON_AES_CNTR, IMB_KEY_128_BYTES); } /* AES-ECB */ -static IMB_JOB *flush_cipher_enc_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ecb_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ecb_192(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ecb_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ECB, IMB_KEY_256_BYTES); } /* AES-CTR BITS */ -static IMB_JOB *flush_cipher_enc_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ctr_128_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ctr_192_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_ctr_256_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CNTR_BITLEN, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ /* ZUC EEA3 */ -static IMB_JOB *flush_cipher_enc_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_zuc_eea3_128(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_zuc_eea3_256(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_ZUC_EEA3, IMB_KEY_256_BYTES); } /* SNOW3G UEA2 */ -static IMB_JOB *flush_cipher_enc_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_snow3g_uea2_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, IMB_KEY_128_BYTES); } #ifndef __aarch64__ /* KASUMI F8 UEA1 */ -static IMB_JOB *flush_cipher_enc_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_kasumi_uea1_bit(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_KASUMI_UEA1_BITLEN, IMB_KEY_128_BYTES); } /* AES-CBCS-1-9 */ -static IMB_JOB *flush_cipher_enc_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_cbcs_1_9(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBCS_1_9, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CBCS_1_9, IMB_KEY_128_BYTES); } /* CHACHA20 */ -static IMB_JOB *flush_cipher_enc_chacha20(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_chacha20(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 */ static IMB_JOB * flush_cipher_enc_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20_POLY1305, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20_POLY1305, IMB_KEY_256_BYTES); } /* CHACHA20-POLY1305 SGL */ static IMB_JOB * flush_cipher_enc_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, - IMB_CIPHER_CHACHA20_POLY1305_SGL, + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_CHACHA20_POLY1305_SGL, IMB_KEY_256_BYTES); } /* SNOW-V */ -static IMB_JOB *flush_cipher_enc_snow_v(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_snow_v(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V, IMB_KEY_256_BYTES); } /* SNOW-V AEAD */ -static IMB_JOB *flush_cipher_enc_snow_v_aead(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_snow_v_aead(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V_AEAD, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SNOW_V_AEAD, IMB_KEY_256_BYTES); } /* AES-GCM SGL */ -static IMB_JOB *flush_cipher_enc_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_gcm_128_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_128_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_128_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_gcm_192_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_192_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_192_BYTES); } -static IMB_JOB *flush_cipher_enc_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_cipher_enc_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) { - return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, - IMB_KEY_256_BYTES); + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_GCM_SGL, IMB_KEY_256_BYTES); } #endif /* __aarch64__ */ @@ -2121,7 +2133,10 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* ========================= */ /* [0] keep empty - enums start from value 1 */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, #ifndef __aarch64__ /* [1] AES-CBC */ flush_cipher_dec_null, @@ -2273,28 +2288,55 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* add new cipher decrypt here */ /* [24] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [25] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [26] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [27] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [28] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [29] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [30] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [31] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* ========================= */ /* === ENCRYPT DIRECTION === */ /* ========================= */ /* [0] keep empty - enums start from value 1 */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, #ifndef __aarch64__ /* [1] AES-CBC */ flush_cipher_enc_null, @@ -2446,21 +2488,45 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* add new cipher encrypt here */ /* [24] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [25] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [26] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [27] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [28] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [29] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [30] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, /* [31] NULL */ - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }; @@ -2468,8 +2534,7 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* Hash submit & flush functions */ /* ========================================================================= */ -__forceinline -IMB_JOB * +__forceinline IMB_JOB * SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) { #ifndef __aarch64__ @@ -2481,9 +2546,9 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) MB_MGR_HMAC_MD5_OOO *hmac_md5_ooo = state->hmac_md5_ooo; MB_MGR_AES_XCBC_OOO *aes_xcbc_ooo = state->aes_xcbc_ooo; MB_MGR_CCM_OOO *aes_ccm_ooo = state->aes_ccm_ooo; - MB_MGR_CCM_OOO *aes256_ccm_ooo = state->aes256_ccm_ooo; + MB_MGR_CCM_OOO *aes256_ccm_ooo = state->aes256_ccm_ooo; MB_MGR_CMAC_OOO *aes_cmac_ooo = state->aes_cmac_ooo; - MB_MGR_CMAC_OOO *aes256_cmac_ooo = state->aes256_cmac_ooo; + MB_MGR_CMAC_OOO *aes256_cmac_ooo = state->aes256_cmac_ooo; #endif /* __aarch64__ */ MB_MGR_ZUC_OOO *zuc_eia3_ooo = state->zuc_eia3_ooo; MB_MGR_ZUC_OOO *zuc256_eia3_ooo = state->zuc256_eia3_ooo; @@ -2529,14 +2594,12 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) * CMAC OOO MGR assumes job len in bits * (for CMAC length is provided in bytes) */ - job->msg_len_to_hash_in_bits = - job->msg_len_to_hash_in_bytes * 8; + job->msg_len_to_hash_in_bits = job->msg_len_to_hash_in_bytes * 8; return SUBMIT_JOB_AES128_CMAC_AUTH(aes_cmac_ooo, job); case IMB_AUTH_AES_CMAC_BITLEN: return SUBMIT_JOB_AES128_CMAC_AUTH(aes_cmac_ooo, job); case IMB_AUTH_AES_CMAC_256: - job->msg_len_to_hash_in_bits = - job->msg_len_to_hash_in_bytes * 8; + job->msg_len_to_hash_in_bits = job->msg_len_to_hash_in_bytes * 8; return SUBMIT_JOB_AES256_CMAC_AUTH(aes256_cmac_ooo, job); case IMB_AUTH_SHA_1: return SUBMIT_JOB_SHA1(sha_1_ooo, job); @@ -2553,18 +2616,16 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) return SUBMIT_JOB_ZUC_EIA3(zuc_eia3_ooo, job); case IMB_AUTH_ZUC256_EIA3_BITLEN: return SUBMIT_JOB_ZUC256_EIA3(zuc256_eia3_ooo, job, - job->auth_tag_output_len_in_bytes); + job->auth_tag_output_len_in_bytes); case IMB_AUTH_SNOW3G_UIA2_BITLEN: #ifndef __aarch64__ #if (defined(SAFE_LOOKUP) || defined(AVX512)) && !defined(SSE_AESNI_EMU) return SUBMIT_JOB_SNOW3G_UIA2(snow3g_uia2_ooo, job); #else - IMB_SNOW3G_F9_1_BUFFER(state, (const snow3g_key_schedule_t *) - job->u.SNOW3G_UIA2._key, - job->u.SNOW3G_UIA2._iv, - job->src + job->hash_start_src_offset_in_bytes, - job->msg_len_to_hash_in_bits, - job->auth_tag_output); + IMB_SNOW3G_F9_1_BUFFER( + state, (const snow3g_key_schedule_t *) job->u.SNOW3G_UIA2._key, + job->u.SNOW3G_UIA2._iv, job->src + job->hash_start_src_offset_in_bytes, + job->msg_len_to_hash_in_bits, job->auth_tag_output); job->status |= IMB_STATUS_COMPLETED_AUTH; return job; #endif @@ -2574,11 +2635,10 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) #ifndef __aarch64__ case IMB_AUTH_KASUMI_UIA1: - IMB_KASUMI_F9_1_BUFFER(state, (const kasumi_key_sched_t *) - job->u.KASUMI_UIA1._key, - job->src + job->hash_start_src_offset_in_bytes, - (const uint32_t) job->msg_len_to_hash_in_bytes, - job->auth_tag_output); + IMB_KASUMI_F9_1_BUFFER(state, (const kasumi_key_sched_t *) job->u.KASUMI_UIA1._key, + job->src + job->hash_start_src_offset_in_bytes, + (const uint32_t) job->msg_len_to_hash_in_bytes, + job->auth_tag_output); job->status |= IMB_STATUS_COMPLETED_AUTH; return job; case IMB_AUTH_AES_GMAC_128: @@ -2658,8 +2718,7 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) } } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * FLUSH_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) { #ifndef __aarch64__ @@ -2671,9 +2730,9 @@ FLUSH_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) MB_MGR_HMAC_MD5_OOO *hmac_md5_ooo = state->hmac_md5_ooo; MB_MGR_AES_XCBC_OOO *aes_xcbc_ooo = state->aes_xcbc_ooo; MB_MGR_CCM_OOO *aes_ccm_ooo = state->aes_ccm_ooo; - MB_MGR_CCM_OOO *aes256_ccm_ooo = state->aes256_ccm_ooo; + MB_MGR_CCM_OOO *aes256_ccm_ooo = state->aes256_ccm_ooo; MB_MGR_CMAC_OOO *aes_cmac_ooo = state->aes_cmac_ooo; - MB_MGR_CMAC_OOO *aes256_cmac_ooo = state->aes256_cmac_ooo; + MB_MGR_CMAC_OOO *aes256_cmac_ooo = state->aes256_cmac_ooo; #endif /* __aarch64__ */ MB_MGR_ZUC_OOO *zuc_eia3_ooo = state->zuc_eia3_ooo; MB_MGR_ZUC_OOO *zuc256_eia3_ooo = state->zuc256_eia3_ooo; @@ -2733,8 +2792,7 @@ FLUSH_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) case IMB_AUTH_ZUC_EIA3_BITLEN: return FLUSH_JOB_ZUC_EIA3(zuc_eia3_ooo); case IMB_AUTH_ZUC256_EIA3_BITLEN: - return FLUSH_JOB_ZUC256_EIA3(zuc256_eia3_ooo, - job->auth_tag_output_len_in_bytes); + return FLUSH_JOB_ZUC256_EIA3(zuc256_eia3_ooo, job->auth_tag_output_len_in_bytes); #ifndef __aarch64__ #if (defined(SAFE_LOOKUP) || defined(AVX512)) && !defined(SSE_AESNI_EMU) case IMB_AUTH_SNOW3G_UIA2_BITLEN: @@ -2759,240 +2817,286 @@ FLUSH_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) /* ========================================================================= */ #ifndef __aarch64__ -static IMB_JOB *submit_hash_hmac_sha1(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_hmac_sha1(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_1); } -static IMB_JOB *submit_hash_hmac_sha224(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_hmac_sha224(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_224); } -static IMB_JOB *submit_hash_hmac_sha256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_hmac_sha256(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_256); } -static IMB_JOB *submit_hash_hmac_sha384(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_hmac_sha384(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_384); } -static IMB_JOB *submit_hash_hmac_sha512(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_hmac_sha512(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_512); } -static IMB_JOB *submit_hash_aes_xcbc(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_xcbc(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_XCBC); } -static IMB_JOB *submit_hash_hmac_md5(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_hmac_md5(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_MD5); } #endif /* __aarch64__ */ -static IMB_JOB *submit_hash_null(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_null(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_NULL); } #ifndef __aarch64__ -static IMB_JOB *submit_hash_aes_gmac(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_gmac(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC); } -static IMB_JOB *submit_hash_custom(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_custom(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CUSTOM); } -static IMB_JOB *submit_hash_aes_ccm(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_ccm(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_CCM); } -static IMB_JOB *submit_hash_aes_cmac(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_cmac(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_CMAC); } -static IMB_JOB *submit_hash_sha1(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_sha1(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SHA_1); } -static IMB_JOB *submit_hash_sha224(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_sha224(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SHA_224); } -static IMB_JOB *submit_hash_sha256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_sha256(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SHA_256); } -static IMB_JOB *submit_hash_sha384(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_sha384(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SHA_384); } -static IMB_JOB *submit_hash_sha512(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_sha512(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SHA_512); } -static IMB_JOB *submit_hash_aes_cmac_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_cmac_bit(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_CMAC_BITLEN); } -static IMB_JOB *submit_hash_pon_crc_bip(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_pon_crc_bip(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_PON_CRC_BIP); } #endif /* __aarch64__ */ -static IMB_JOB *submit_hash_zuc_eia3_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_zuc_eia3_bit(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_ZUC_EIA3_BITLEN); } #ifndef __aarch64__ -static IMB_JOB *submit_hash_docsis_crc32(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_docsis_crc32(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_DOCSIS_CRC32); } #endif /* __aarch64__ */ -static IMB_JOB *submit_hash_snow3g_uia2_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_snow3g_uia2_bit(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SNOW3G_UIA2_BITLEN); } #ifndef __aarch64__ -static IMB_JOB *submit_hash_kasumi_uia1(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_kasumi_uia1(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_KASUMI_UIA1); } -static IMB_JOB *submit_hash_aes_gmac_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_gmac_128(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC_128); } -static IMB_JOB *submit_hash_aes_gmac_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_gmac_192(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC_192); } -static IMB_JOB *submit_hash_aes_gmac_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_gmac_256(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC_256); } -static IMB_JOB *submit_hash_aes_cmac_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_aes_cmac_256(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_AES_CMAC_256); } -static IMB_JOB *submit_hash_poly1305(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_poly1305(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_POLY1305); } -static IMB_JOB *submit_hash_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CHACHA20_POLY1305); } -static IMB_JOB *submit_hash_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CHACHA20_POLY1305_SGL); } #endif /* __aarch64__ */ -static IMB_JOB *submit_hash_zuc256_eia3_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_zuc256_eia3_bit(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_ZUC256_EIA3_BITLEN); } #ifndef __aarch64__ -static IMB_JOB *submit_hash_snow_v_aead(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_snow_v_aead(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SNOW_V_AEAD); } -static IMB_JOB *submit_hash_gcm_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_gcm_sgl(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_GCM_SGL); } -static IMB_JOB *submit_hash_crc32_ethernet_fcs(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc32_ethernet_fcs(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC32_ETHERNET_FCS); } -static IMB_JOB *submit_hash_crc32_sctp(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc32_sctp(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC32_SCTP); } -static IMB_JOB *submit_hash_crc32_wimax_ofdma(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc32_wimax_ofdma(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC32_WIMAX_OFDMA_DATA); } -static IMB_JOB *submit_hash_crc24_lte_a(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc24_lte_a(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC24_LTE_A); } -static IMB_JOB *submit_hash_crc24_lte_b(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc24_lte_b(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC24_LTE_B); } -static IMB_JOB *submit_hash_crc16_x25(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc16_x25(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC16_X25); } -static IMB_JOB *submit_hash_crc16_fp_data(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc16_fp_data(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC16_FP_DATA); } -static IMB_JOB *submit_hash_crc11_fp_header(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc11_fp_header(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC11_FP_HEADER); } -static IMB_JOB *submit_hash_crc10_iuup_data(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc10_iuup_data(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC10_IUUP_DATA); } -static IMB_JOB *submit_hash_crc8_wimax_odma(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc8_wimax_odma(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC8_WIMAX_OFDMA_HCS); } -static IMB_JOB *submit_hash_crc7_fp_header(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc7_fp_header(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC7_FP_HEADER); } -static IMB_JOB *submit_hash_crc6_iuup_header(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_crc6_iuup_header(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_CRC6_IUUP_HEADER); } -static IMB_JOB *submit_hash_ghash(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +submit_hash_ghash(IMB_MGR *state, IMB_JOB *job) { return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_GHASH); } @@ -3133,240 +3237,286 @@ static const submit_flush_fn_t tab_submit_hash[] = { /* ========================================================================= */ #ifndef __aarch64__ -static IMB_JOB *flush_hash_hmac_sha1(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_hmac_sha1(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_1); } -static IMB_JOB *flush_hash_hmac_sha224(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_hmac_sha224(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_224); } -static IMB_JOB *flush_hash_hmac_sha256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_hmac_sha256(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_256); } -static IMB_JOB *flush_hash_hmac_sha384(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_hmac_sha384(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_384); } -static IMB_JOB *flush_hash_hmac_sha512(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_hmac_sha512(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SHA_512); } -static IMB_JOB *flush_hash_aes_xcbc(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_xcbc(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_XCBC); } -static IMB_JOB *flush_hash_hmac_md5(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_hmac_md5(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_MD5); } #endif /* __aarch64__ */ -static IMB_JOB *flush_hash_null(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_null(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_NULL); } #ifndef __aarch64__ -static IMB_JOB *flush_hash_aes_gmac(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_gmac(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC); } -static IMB_JOB *flush_hash_custom(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_custom(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CUSTOM); } -static IMB_JOB *flush_hash_aes_ccm(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_ccm(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_CCM); } -static IMB_JOB *flush_hash_aes_cmac(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_cmac(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_CMAC); } -static IMB_JOB *flush_hash_sha1(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_sha1(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SHA_1); } -static IMB_JOB *flush_hash_sha224(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_sha224(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SHA_224); } -static IMB_JOB *flush_hash_sha256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_sha256(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SHA_256); } -static IMB_JOB *flush_hash_sha384(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_sha384(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SHA_384); } -static IMB_JOB *flush_hash_sha512(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_sha512(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SHA_512); } -static IMB_JOB *flush_hash_aes_cmac_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_cmac_bit(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_CMAC_BITLEN); } -static IMB_JOB *flush_hash_pon_crc_bip(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_pon_crc_bip(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_PON_CRC_BIP); } #endif /* __aarch64__ */ -static IMB_JOB *flush_hash_zuc_eia3_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_zuc_eia3_bit(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_ZUC_EIA3_BITLEN); } #ifndef __aarch64__ -static IMB_JOB *flush_hash_docsis_crc32(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_docsis_crc32(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_DOCSIS_CRC32); } #endif /* __aarch64__ */ -static IMB_JOB *flush_hash_snow3g_uia2_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_snow3g_uia2_bit(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SNOW3G_UIA2_BITLEN); } #ifndef __aarch64__ -static IMB_JOB *flush_hash_kasumi_uia1(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_kasumi_uia1(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_KASUMI_UIA1); } -static IMB_JOB *flush_hash_aes_gmac_128(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_gmac_128(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC_128); } -static IMB_JOB *flush_hash_aes_gmac_192(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_gmac_192(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC_192); } -static IMB_JOB *flush_hash_aes_gmac_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_gmac_256(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_GMAC_256); } -static IMB_JOB *flush_hash_aes_cmac_256(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_aes_cmac_256(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_AES_CMAC_256); } -static IMB_JOB *flush_hash_poly1305(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_poly1305(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_POLY1305); } -static IMB_JOB *flush_hash_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_chacha20_poly1305(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CHACHA20_POLY1305); } -static IMB_JOB *flush_hash_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_chacha20_poly1305_sgl(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CHACHA20_POLY1305_SGL); } #endif /* __aarch64__ */ -static IMB_JOB *flush_hash_zuc256_eia3_bit(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_zuc256_eia3_bit(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_ZUC256_EIA3_BITLEN); } #ifndef __aarch64__ -static IMB_JOB *flush_hash_snow_v_aead(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_snow_v_aead(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SNOW_V_AEAD); } -static IMB_JOB *flush_hash_gcm_sgl(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_gcm_sgl(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_GCM_SGL); } -static IMB_JOB *flush_hash_crc32_ethernet_fcs(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc32_ethernet_fcs(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC32_ETHERNET_FCS); } -static IMB_JOB *flush_hash_crc32_sctp(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc32_sctp(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC32_SCTP); } -static IMB_JOB *flush_hash_crc32_wimax_ofdma(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc32_wimax_ofdma(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC32_WIMAX_OFDMA_DATA); } -static IMB_JOB *flush_hash_crc24_lte_a(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc24_lte_a(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC24_LTE_A); } -static IMB_JOB *flush_hash_crc24_lte_b(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc24_lte_b(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC24_LTE_B); } -static IMB_JOB *flush_hash_crc16_x25(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc16_x25(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC16_X25); } -static IMB_JOB *flush_hash_crc16_fp_data(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc16_fp_data(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC16_FP_DATA); } -static IMB_JOB *flush_hash_crc11_fp_header(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc11_fp_header(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC11_FP_HEADER); } -static IMB_JOB *flush_hash_crc10_iuup_data(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc10_iuup_data(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC10_IUUP_DATA); } -static IMB_JOB *flush_hash_crc8_wimax_odma(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc8_wimax_odma(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC8_WIMAX_OFDMA_HCS); } -static IMB_JOB *flush_hash_crc7_fp_header(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc7_fp_header(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC7_FP_HEADER); } -static IMB_JOB *flush_hash_crc6_iuup_header(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_crc6_iuup_header(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_CRC6_IUUP_HEADER); } -static IMB_JOB *flush_hash_ghash(IMB_MGR *state, IMB_JOB *job) +static IMB_JOB * +flush_hash_ghash(IMB_MGR *state, IMB_JOB *job) { return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_GHASH); } @@ -3502,12 +3652,14 @@ static const submit_flush_fn_t tab_flush_hash[] = { /* add new hash algorithms here */ }; -__forceinline IMB_JOB *SUBMIT_JOB_HASH(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_HASH(IMB_MGR *state, IMB_JOB *job) { return tab_submit_hash[job->hash_alg](state, job); } -__forceinline IMB_JOB *FLUSH_JOB_HASH(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +FLUSH_JOB_HASH(IMB_MGR *state, IMB_JOB *job) { return tab_flush_hash[job->hash_alg](state, job); } @@ -3516,7 +3668,8 @@ __forceinline IMB_JOB *FLUSH_JOB_HASH(IMB_MGR *state, IMB_JOB *job) /* Job submit & flush functions */ /* ========================================================================= */ -__forceinline unsigned calc_cipher_tab_index(const IMB_JOB *job) +__forceinline unsigned +calc_cipher_tab_index(const IMB_JOB *job) { /* * See include/mb_mgr_job_api.h for cipher table organization @@ -3524,13 +3677,12 @@ __forceinline unsigned calc_cipher_tab_index(const IMB_JOB *job) * - map key_len_in_bytes into 0, 1, 2 & 3 index values * - encrypt_direction_bit x (ENCRYPT_DECRYPT_GAP x 4) */ - return (job->cipher_mode << 2) + - (((job->key_len_in_bytes - 1) >> 3) & 3) + - ((job->cipher_direction & IMB_DIR_ENCRYPT) << 7); + return (job->cipher_mode << 2) + (((job->key_len_in_bytes - 1) >> 3) & 3) + + ((job->cipher_direction & IMB_DIR_ENCRYPT) << 7); } -__forceinline -IMB_JOB *SUBMIT_JOB_CIPHER(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +SUBMIT_JOB_CIPHER(IMB_MGR *state, IMB_JOB *job) { const unsigned idx = calc_cipher_tab_index(job); @@ -3539,8 +3691,8 @@ IMB_JOB *SUBMIT_JOB_CIPHER(IMB_MGR *state, IMB_JOB *job) return tab_submit_cipher[idx](state, job); } -__forceinline -IMB_JOB *FLUSH_JOB_CIPHER(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +FLUSH_JOB_CIPHER(IMB_MGR *state, IMB_JOB *job) { const unsigned idx = calc_cipher_tab_index(job); @@ -3548,8 +3700,8 @@ IMB_JOB *FLUSH_JOB_CIPHER(IMB_MGR *state, IMB_JOB *job) } /* submit a half-completed job, based on the status */ -__forceinline -IMB_JOB *RESUBMIT_JOB(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +RESUBMIT_JOB(IMB_MGR *state, IMB_JOB *job) { while (job != NULL && job->status < IMB_STATUS_COMPLETED) { if (job->status == IMB_STATUS_COMPLETED_AUTH) @@ -3558,28 +3710,28 @@ IMB_JOB *RESUBMIT_JOB(IMB_MGR *state, IMB_JOB *job) job = SUBMIT_JOB_HASH(state, job); } - return job; + return job; } -__forceinline -IMB_JOB *submit_new_job(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +submit_new_job(IMB_MGR *state, IMB_JOB *job) { #ifndef __aarch64__ if (job->cipher_mode == IMB_CIPHER_GCM) return SUBMIT_JOB_CIPHER(state, job); #endif /* __aarch64__ */ - if (job->chain_order == IMB_ORDER_CIPHER_HASH) - job = SUBMIT_JOB_CIPHER(state, job); - else - job = SUBMIT_JOB_HASH(state, job); + if (job->chain_order == IMB_ORDER_CIPHER_HASH) + job = SUBMIT_JOB_CIPHER(state, job); + else + job = SUBMIT_JOB_HASH(state, job); job = RESUBMIT_JOB(state, job); - return job; + return job; } -__forceinline -uint32_t complete_job(IMB_MGR *state, IMB_JOB *job) +__forceinline uint32_t +complete_job(IMB_MGR *state, IMB_JOB *job) { uint32_t completed_jobs = 0; @@ -3614,8 +3766,7 @@ uint32_t complete_job(IMB_MGR *state, IMB_JOB *job) return completed_jobs; } -__forceinline -IMB_JOB * +__forceinline IMB_JOB * submit_job_and_check(IMB_MGR *state, const int run_check) { IMB_JOB *job = NULL; @@ -3641,10 +3792,8 @@ submit_job_and_check(IMB_MGR *state, const int run_check) job = JOBS(state, state->next_job); if (run_check) { - if (is_job_invalid(state, job, - job->cipher_mode, job->hash_alg, - job->cipher_direction, - job->key_len_in_bytes)) { + if (is_job_invalid(state, job, job->cipher_mode, job->hash_alg, + job->cipher_direction, job->key_len_in_bytes)) { job->status = IMB_STATUS_INVALID_ARGS; } else { job->status = IMB_STATUS_BEING_PROCESSED; @@ -3749,7 +3898,8 @@ FLUSH_JOB(IMB_MGR *state) /* Async burst job submit & flush functions */ /* ========================================================================= */ -__forceinline void set_cipher_suite_id(IMB_JOB *job, void **id) +__forceinline void +set_cipher_suite_id(IMB_JOB *job, void **id) { const unsigned c_idx = calc_cipher_tab_index(job); const unsigned h_idx = (unsigned) job->hash_alg; @@ -3761,18 +3911,19 @@ __forceinline void set_cipher_suite_id(IMB_JOB *job, void **id) } #define CALL_SUBMIT_CIPHER(s, j) ((submit_flush_fn_t) (j)->suite_id[0])(s, j) -#define CALL_FLUSH_CIPHER(s, j) ((submit_flush_fn_t) (j)->suite_id[2])(s, j) -#define CALL_SUBMIT_HASH(s, j) ((submit_flush_fn_t) (j)->suite_id[1])(s, j) -#define CALL_FLUSH_HASH(s, j) ((submit_flush_fn_t) (j)->suite_id[3])(s, j) +#define CALL_FLUSH_CIPHER(s, j) ((submit_flush_fn_t) (j)->suite_id[2])(s, j) +#define CALL_SUBMIT_HASH(s, j) ((submit_flush_fn_t) (j)->suite_id[1])(s, j) +#define CALL_FLUSH_HASH(s, j) ((submit_flush_fn_t) (j)->suite_id[3])(s, j) -IMB_DLL_EXPORT void SET_SUITE_ID_FN(IMB_MGR *state, IMB_JOB *job) +IMB_DLL_EXPORT void +SET_SUITE_ID_FN(IMB_MGR *state, IMB_JOB *job) { (void) state; set_cipher_suite_id(job, job->suite_id); } -__forceinline -IMB_JOB *RESUBMIT_BURST_JOB(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +RESUBMIT_BURST_JOB(IMB_MGR *state, IMB_JOB *job) { while (job != NULL && job->status < IMB_STATUS_COMPLETED) { if (job->status == IMB_STATUS_COMPLETED_AUTH) @@ -3781,28 +3932,28 @@ IMB_JOB *RESUBMIT_BURST_JOB(IMB_MGR *state, IMB_JOB *job) job = CALL_SUBMIT_HASH(state, job); } - return job; + return job; } -__forceinline -IMB_JOB *submit_new_burst_job(IMB_MGR *state, IMB_JOB *job) +__forceinline IMB_JOB * +submit_new_burst_job(IMB_MGR *state, IMB_JOB *job) { #ifndef __aarch64__ if (job->cipher_mode == IMB_CIPHER_GCM) return CALL_SUBMIT_CIPHER(state, job); #endif /* __aarch64__ */ - if (job->chain_order == IMB_ORDER_CIPHER_HASH) - job = CALL_SUBMIT_CIPHER(state, job); - else - job = CALL_SUBMIT_HASH(state, job); + if (job->chain_order == IMB_ORDER_CIPHER_HASH) + job = CALL_SUBMIT_CIPHER(state, job); + else + job = CALL_SUBMIT_HASH(state, job); job = RESUBMIT_BURST_JOB(state, job); - return job; + return job; } -__forceinline -uint32_t complete_burst_job(IMB_MGR *state, IMB_JOB *job) +__forceinline uint32_t +complete_burst_job(IMB_MGR *state, IMB_JOB *job) { uint32_t completed_jobs = 0; diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 5fddc0f5..7d1645d2 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -32,14 +32,13 @@ #include "include/error.h" /* GCM NIST standard: len(M) < 2^39 - 256 */ -#define GCM_MAX_LEN UINT64_C(((1ULL << 39) - 256) - 1) +#define GCM_MAX_LEN UINT64_C(((1ULL << 39) - 256) - 1) #define SNOW3G_MAX_BITLEN (UINT32_MAX) -#define MB_MAX_LEN16 ((1 << 16) - 2) +#define MB_MAX_LEN16 ((1 << 16) - 2) __forceinline int -is_job_invalid(IMB_MGR *state, const IMB_JOB *job, - const IMB_CIPHER_MODE cipher_mode, const IMB_HASH_ALG hash_alg, - const IMB_CIPHER_DIRECTION cipher_direction, +is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, + const IMB_HASH_ALG hash_alg, const IMB_CIPHER_DIRECTION cipher_direction, const IMB_KEY_SIZE_BYTES key_len_in_bytes) { const uint64_t auth_tag_len_fips[] = { @@ -146,8 +145,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, * of XGEM header */ const uint64_t max_pon_len = (1 << 14) + 8; - if (cipher_direction != IMB_DIR_DECRYPT && - cipher_direction != IMB_DIR_ENCRYPT && + if (cipher_direction != IMB_DIR_DECRYPT && cipher_direction != IMB_DIR_ENCRYPT && cipher_mode != IMB_CIPHER_NULL) { imb_set_errno(state, IMB_ERR_JOB_CIPH_DIR); return 1; @@ -168,18 +166,15 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_IV); return 1; } - if (cipher_direction == IMB_DIR_ENCRYPT && - job->enc_keys == NULL) { + if (cipher_direction == IMB_DIR_ENCRYPT && job->enc_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (cipher_direction == IMB_DIR_DECRYPT && - job->dec_keys == NULL) { + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (key_len_in_bytes != UINT64_C(16) && - key_len_in_bytes != UINT64_C(24) && + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(24) && key_len_in_bytes != UINT64_C(32)) { imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; @@ -193,14 +188,12 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, return 1; } if (cipher_mode == IMB_CIPHER_CBCS_1_9) { - if (job->msg_len_to_cipher_in_bytes > - ((1ULL << (60)) - 1)) { + if (job->msg_len_to_cipher_in_bytes > ((1ULL << (60)) - 1)) { imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); return 1; } if (job->cipher_fields.CBCS.next_iv == NULL) { - imb_set_errno(state, - IMB_ERR_JOB_NULL_NEXT_IV); + imb_set_errno(state, IMB_ERR_JOB_NULL_NEXT_IV); return 1; } } else if (cipher_direction == IMB_DIR_ENCRYPT && @@ -222,18 +215,15 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_DST); return 1; } - if (cipher_direction == IMB_DIR_ENCRYPT && - job->enc_keys == NULL) { + if (cipher_direction == IMB_DIR_ENCRYPT && job->enc_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (cipher_direction == IMB_DIR_DECRYPT && - job->dec_keys == NULL) { + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (key_len_in_bytes != UINT64_C(16) && - key_len_in_bytes != UINT64_C(24) && + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(24) && key_len_in_bytes != UINT64_C(32)) { imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; @@ -266,17 +256,15 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (key_len_in_bytes != UINT64_C(16) && - key_len_in_bytes != UINT64_C(24) && + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(24) && key_len_in_bytes != UINT64_C(32)) { imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; } - if ((cipher_mode == IMB_CIPHER_CNTR && - job->iv_len_in_bytes != UINT64_C(16) && + if ((cipher_mode == IMB_CIPHER_CNTR && job->iv_len_in_bytes != UINT64_C(16) && job->iv_len_in_bytes != UINT64_C(12)) || - (cipher_mode == IMB_CIPHER_CNTR_BITLEN && - job->iv_len_in_bytes != UINT64_C(16))) { + (cipher_mode == IMB_CIPHER_CNTR_BITLEN && + job->iv_len_in_bytes != UINT64_C(16))) { imb_set_errno(state, IMB_ERR_JOB_IV_LEN); return 1; } @@ -317,13 +305,11 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (cipher_direction == IMB_DIR_DECRYPT && - job->dec_keys == NULL) { + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if ((key_len_in_bytes != UINT64_C(16)) && - (key_len_in_bytes != UINT64_C(32))) { + if ((key_len_in_bytes != UINT64_C(16)) && (key_len_in_bytes != UINT64_C(32))) { imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; } @@ -355,18 +341,15 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, return 1; } /* Same key structure used for encrypt and decrypt */ - if (cipher_direction == IMB_DIR_ENCRYPT && - job->enc_keys == NULL) { + if (cipher_direction == IMB_DIR_ENCRYPT && job->enc_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (cipher_direction == IMB_DIR_DECRYPT && - job->dec_keys == NULL) { + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (key_len_in_bytes != UINT64_C(16) && - key_len_in_bytes != UINT64_C(24) && + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(24) && key_len_in_bytes != UINT64_C(32)) { imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; @@ -375,13 +358,11 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_IV_LEN); return 1; } - if (cipher_mode == IMB_CIPHER_GCM && - hash_alg != IMB_AUTH_AES_GMAC) { + if (cipher_mode == IMB_CIPHER_GCM && hash_alg != IMB_AUTH_AES_GMAC) { imb_set_errno(state, IMB_ERR_HASH_ALGO); return 1; } - if (cipher_mode == IMB_CIPHER_GCM_SGL && - hash_alg != IMB_AUTH_GCM_SGL) { + if (cipher_mode == IMB_CIPHER_GCM_SGL && hash_alg != IMB_AUTH_GCM_SGL) { imb_set_errno(state, IMB_ERR_HASH_ALGO); return 1; } @@ -406,13 +387,11 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_IV); return 1; } - if (cipher_direction == IMB_DIR_ENCRYPT && - job->enc_keys == NULL) { + if (cipher_direction == IMB_DIR_ENCRYPT && job->enc_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (cipher_direction == IMB_DIR_DECRYPT && - job->dec_keys == NULL) { + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } @@ -447,13 +426,11 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_IV); return 1; } - if (cipher_direction == IMB_DIR_ENCRYPT && - job->enc_keys == NULL) { + if (cipher_direction == IMB_DIR_ENCRYPT && job->enc_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (cipher_direction == IMB_DIR_DECRYPT && - job->dec_keys == NULL) { + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } @@ -496,8 +473,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, return 1; } /* currently only AES-CCM-128 and AES-CCM-256 supported */ - if (key_len_in_bytes != UINT64_C(16) && - key_len_in_bytes != UINT64_C(32)) { + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(32)) { imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; } @@ -507,8 +483,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, * Valid L values are: 2 to 8 * Then valid nonce lengths 13 to 7 (inclusive). */ - if (job->iv_len_in_bytes > UINT64_C(13) || - job->iv_len_in_bytes < UINT64_C(7)) { + if (job->iv_len_in_bytes > UINT64_C(13) || job->iv_len_in_bytes < UINT64_C(7)) { imb_set_errno(state, IMB_ERR_JOB_IV_LEN); return 1; } @@ -548,28 +523,24 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, return 1; } if (cipher_direction == IMB_DIR_ENCRYPT) { - const void * const *ks_ptr = - (const void * const *)job->enc_keys; + const void *const *ks_ptr = (const void *const *) job->enc_keys; if (ks_ptr == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (ks_ptr[0] == NULL || ks_ptr[1] == NULL || - ks_ptr[2] == NULL) { + if (ks_ptr[0] == NULL || ks_ptr[1] == NULL || ks_ptr[2] == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } } else { - const void * const *ks_ptr = - (const void * const *)job->dec_keys; + const void *const *ks_ptr = (const void *const *) job->dec_keys; if (ks_ptr == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (ks_ptr[0] == NULL || ks_ptr[1] == NULL || - ks_ptr[2] == NULL) { + if (ks_ptr[0] == NULL || ks_ptr[1] == NULL || ks_ptr[2] == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } @@ -598,8 +569,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, /* source and destination buffer pointers cannot be the same, * as there are always 8 bytes that are not ciphered */ - if ((job->src + job->cipher_start_src_offset_in_bytes) - != job->dst) { + if ((job->src + job->cipher_start_src_offset_in_bytes) != job->dst) { imb_set_errno(state, EINVAL); return 1; } @@ -621,8 +591,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, /* Subtract 8 bytes to maximum length since * XGEM header is not ciphered */ - if ((job->msg_len_to_cipher_in_bytes > - (max_pon_len - 8))) { + if ((job->msg_len_to_cipher_in_bytes > (max_pon_len - 8))) { imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); return 1; } @@ -645,9 +614,8 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, } } if (job->msg_len_to_cipher_in_bytes >= 4) { - const uint64_t xgem_hdr = *(const uint64_t *) - (job->src + - job->hash_start_src_offset_in_bytes); + const uint64_t xgem_hdr = *( + const uint64_t *) (job->src + job->hash_start_src_offset_in_bytes); /* PLI is 14 MS bits of XGEM header */ const uint16_t pli = BSWAP64(xgem_hdr) >> 50; @@ -656,10 +624,8 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, if (pli > 4) { const uint16_t crc_len = pli - 4; - if (crc_len > - job->msg_len_to_cipher_in_bytes - 4) { - imb_set_errno(state, - IMB_ERR_JOB_PON_PLI); + if (crc_len > job->msg_len_to_cipher_in_bytes - 4) { + imb_set_errno(state, IMB_ERR_JOB_PON_PLI); return 1; } } @@ -683,8 +649,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (key_len_in_bytes != UINT64_C(16) && - key_len_in_bytes != UINT64_C(32)) { + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(32)) { imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; } @@ -859,8 +824,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_IV_LEN); return 1; } - if (cipher_mode == IMB_CIPHER_SNOW_V_AEAD && - hash_alg != IMB_AUTH_SNOW_V_AEAD) { + if (cipher_mode == IMB_CIPHER_SNOW_V_AEAD && hash_alg != IMB_AUTH_SNOW_V_AEAD) { imb_set_errno(state, IMB_ERR_HASH_ALGO); return 1; } @@ -883,10 +847,8 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg] && - job->auth_tag_output_len_in_bytes != - auth_tag_len_fips[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg] && + job->auth_tag_output_len_in_bytes != auth_tag_len_fips[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -913,10 +875,8 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg] && - job->auth_tag_output_len_in_bytes != - auth_tag_len_fips[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg] && + job->auth_tag_output_len_in_bytes != auth_tag_len_fips[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -965,8 +925,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_AUTH); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -977,8 +936,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } - if ((job->u.GCM.aad_len_in_bytes > 0) && - (job->u.GCM.aad == NULL)) { + if ((job->u.GCM.aad_len_in_bytes > 0) && (job->u.GCM.aad == NULL)) { imb_set_errno(state, IMB_ERR_JOB_NULL_AAD); return 1; } @@ -1017,8 +975,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, } } if (job->sgl_state == IMB_SGL_INIT) { - if ((job->u.GCM.aad_len_in_bytes > 0) && - (job->u.GCM.aad == NULL)) { + if ((job->u.GCM.aad_len_in_bytes > 0) && (job->u.GCM.aad == NULL)) { imb_set_errno(state, IMB_ERR_JOB_NULL_AAD); return 1; } @@ -1098,8 +1055,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_AAD_LEN); return 1; } - if ((job->u.CCM.aad_len_in_bytes > 0) && - (job->u.CCM.aad == NULL)) { + if ((job->u.CCM.aad_len_in_bytes > 0) && (job->u.CCM.aad == NULL)) { imb_set_errno(state, IMB_ERR_JOB_NULL_AAD); return 1; } @@ -1108,7 +1064,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, job->auth_tag_output_len_in_bytes > UINT64_C(16) || ((job->auth_tag_output_len_in_bytes & 1) != 0)) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); - return 1; + return 1; } if (cipher_mode != IMB_CIPHER_CCM) { imb_set_errno(state, IMB_ERR_CIPH_MODE); @@ -1124,13 +1080,11 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, * AAD can be used to extend authentication over * clear text fields. */ - if (job->msg_len_to_cipher_in_bytes != - job->msg_len_to_hash_in_bytes) { + if (job->msg_len_to_cipher_in_bytes != job->msg_len_to_hash_in_bytes) { imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); return 1; } - if (job->cipher_start_src_offset_in_bytes != - job->hash_start_src_offset_in_bytes) { + if (job->cipher_start_src_offset_in_bytes != job->hash_start_src_offset_in_bytes) { imb_set_errno(state, IMB_ERR_JOB_SRC_OFFSET); return 1; } @@ -1152,8 +1106,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); return 1; } - if ((job->u.CMAC._key_expanded == NULL) || - (job->u.CMAC._skey1 == NULL) || + if ((job->u.CMAC._key_expanded == NULL) || (job->u.CMAC._skey1 == NULL) || (job->u.CMAC._skey2 == NULL)) { imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; @@ -1181,8 +1134,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, case IMB_AUTH_SHA_256: case IMB_AUTH_SHA_384: case IMB_AUTH_SHA_512: - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -1218,8 +1170,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_AUTH_LEN); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { /* 64-bits: * - BIP 32-bits * - CRC 32-bits @@ -1255,8 +1206,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_IV); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -1317,12 +1267,10 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_CIPH_MODE); return 1; } - if (job->msg_len_to_cipher_in_bytes && - job->msg_len_to_hash_in_bytes) { - const uint64_t ciph_adjust = - IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE - - 2 - /* ETH TYPE */ - IMB_DOCSIS_CRC32_TAG_SIZE; + if (job->msg_len_to_cipher_in_bytes && job->msg_len_to_hash_in_bytes) { + const uint64_t ciph_adjust = IMB_DOCSIS_CRC32_MIN_ETH_PDU_SIZE - + 2 - /* ETH TYPE */ + IMB_DOCSIS_CRC32_TAG_SIZE; if ((job->msg_len_to_cipher_in_bytes + ciph_adjust) > job->msg_len_to_hash_in_bytes) { @@ -1343,8 +1291,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_AUTH); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { /* Ethernet FCS CRC is 32-bits */ imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; @@ -1376,8 +1323,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_IV); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -1396,10 +1342,8 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, * KASUMI-UIA1 needs to be at least 8 bytes * (IV + direction bit + '1' + 0s to align to byte boundary) */ - if ((job->msg_len_to_hash_in_bytes < - (IMB_KASUMI_BLOCK_SIZE + 1)) || - (job->msg_len_to_hash_in_bytes > - (KASUMI_MAX_LEN / BYTESIZE))) { + if ((job->msg_len_to_hash_in_bytes < (IMB_KASUMI_BLOCK_SIZE + 1)) || + (job->msg_len_to_hash_in_bytes > (KASUMI_MAX_LEN / BYTESIZE))) { imb_set_errno(state, IMB_ERR_JOB_AUTH_LEN); return 1; } @@ -1407,8 +1351,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -1430,8 +1373,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_AUTH); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -1458,8 +1400,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_AUTH); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -1486,8 +1427,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_AUTH); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } @@ -1497,8 +1437,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, } break; case IMB_AUTH_SNOW_V_AEAD: - if ((job->u.SNOW_V_AEAD.aad_len_in_bytes > 0) && - (job->u.SNOW_V_AEAD.aad == NULL)) { + if ((job->u.SNOW_V_AEAD.aad_len_in_bytes > 0) && (job->u.SNOW_V_AEAD.aad == NULL)) { imb_set_errno(state, IMB_ERR_JOB_NULL_AAD); return 1; } @@ -1506,8 +1445,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, imb_set_errno(state, IMB_ERR_JOB_NULL_AUTH); return 1; } - if (job->auth_tag_output_len_in_bytes != - auth_tag_len_ipsec[hash_alg]) { + if (job->auth_tag_output_len_in_bytes != auth_tag_len_ipsec[hash_alg]) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); return 1; } diff --git a/lib/include/memcpy.h b/lib/include/memcpy.h index 89fa0ded..d4fc39db 100644 --- a/lib/include/memcpy.h +++ b/lib/include/memcpy.h @@ -29,15 +29,19 @@ #define MEMCPY_H /* Memcpy up to 16 bytes with SSE instructions */ -void memcpy_fn_sse_16(void *dst, const void *src, const size_t size); +void +memcpy_fn_sse_16(void *dst, const void *src, const size_t size); /* Memcpy up to 16 bytes with AVX instructions */ -void memcpy_fn_avx_16(void *dst, const void *src, const size_t size); +void +memcpy_fn_avx_16(void *dst, const void *src, const size_t size); /* Memcpy 128 bytes with SSE instructions */ -void memcpy_fn_sse_128(void *dst, const void *src); +void +memcpy_fn_sse_128(void *dst, const void *src); /* Basic memcpy that doesn't use stack */ -void safe_memcpy(void *dst, const void *src, const size_t size); +void +safe_memcpy(void *dst, const void *src, const size_t size); #endif /* MEMCPY_H */ diff --git a/lib/include/noaesni.h b/lib/include/noaesni.h index f97a1e85..326c72c1 100644 --- a/lib/include/noaesni.h +++ b/lib/include/noaesni.h @@ -31,68 +31,69 @@ #define NOAESNI_H #ifdef __aarch64__ -IMB_DLL_EXPORT void init_mb_mgr_aarch64_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_aarch64_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_aarch64_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_aarch64_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_aarch64_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_aarch64_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_aarch64_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT void +init_mb_mgr_aarch64_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_aarch64_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_aarch64_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_aarch64_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_aarch64_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_aarch64_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_aarch64_no_aesni(IMB_MGR *state); #else /* __aarch64__ */ -IMB_DLL_EXPORT void init_mb_mgr_sse_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_sse_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_sse_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *flush_job_sse_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT uint32_t queue_size_sse_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_completed_job_sse_no_aesni(IMB_MGR *state); -IMB_DLL_EXPORT IMB_JOB *get_next_job_sse_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT void +init_mb_mgr_sse_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_sse_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_sse_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_sse_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_sse_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_sse_no_aesni(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_sse_no_aesni(IMB_MGR *state); IMB_DLL_EXPORT uint32_t -get_next_burst_sse_no_aesni(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +get_next_burst_sse_no_aesni(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_sse_no_aesni(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_sse_no_aesni(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_burst_nocheck_sse_no_aesni(IMB_MGR *state, const uint32_t n_jobs, - IMB_JOB **jobs); +submit_burst_nocheck_sse_no_aesni(IMB_MGR *state, const uint32_t n_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -flush_burst_sse_no_aesni(IMB_MGR *state, const uint32_t max_jobs, - IMB_JOB **jobs); +flush_burst_sse_no_aesni(IMB_MGR *state, const uint32_t max_jobs, IMB_JOB **jobs); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, - const IMB_CIPHER_MODE cipher, - const IMB_CIPHER_DIRECTION dir, +submit_cipher_burst_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, + const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_cipher_burst_nocheck_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_cipher_burst_nocheck_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); IMB_DLL_EXPORT uint32_t -submit_hash_burst_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT uint32_t -submit_hash_burst_nocheck_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, - const uint32_t n_jobs, +submit_hash_burst_nocheck_sse_no_aesni(IMB_MGR *state, IMB_JOB *jobs, const uint32_t n_jobs, const IMB_HASH_ALG hash); IMB_DLL_EXPORT void -aes_keyexp_128_sse_no_aesni(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +aes_keyexp_128_sse_no_aesni(const void *key, void *enc_exp_keys, void *dec_exp_keys); IMB_DLL_EXPORT void -aes_keyexp_192_sse_no_aesni(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +aes_keyexp_192_sse_no_aesni(const void *key, void *enc_exp_keys, void *dec_exp_keys); IMB_DLL_EXPORT void -aes_keyexp_256_sse_no_aesni(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +aes_keyexp_256_sse_no_aesni(const void *key, void *enc_exp_keys, void *dec_exp_keys); IMB_DLL_EXPORT void -aes_xcbc_expand_key_sse_no_aesni(const void *key, void *k1_exp, void *k2, - void *k3); +aes_xcbc_expand_key_sse_no_aesni(const void *key, void *k1_exp, void *k2, void *k3); IMB_DLL_EXPORT void aes_keyexp_128_enc_sse_no_aesni(const void *key, void *enc_exp_keys); IMB_DLL_EXPORT void @@ -102,15 +103,14 @@ aes_keyexp_256_enc_sse_no_aesni(const void *key, void *enc_exp_keys); IMB_DLL_EXPORT void aes_cmac_subkey_gen_sse_no_aesni(const void *key_exp, void *key1, void *key2); IMB_DLL_EXPORT void -aes_cmac_256_subkey_gen_sse_no_aesni(const void *key_exp, - void *key1, void *key2); +aes_cmac_256_subkey_gen_sse_no_aesni(const void *key_exp, void *key1, void *key2); IMB_DLL_EXPORT void -aes_cfb_128_one_sse_no_aesni(void *out, const void *in, const void *iv, - const void *keys, uint64_t len); +aes_cfb_128_one_sse_no_aesni(void *out, const void *in, const void *iv, const void *keys, + uint64_t len); IMB_DLL_EXPORT void -aes_cfb_256_one_sse_no_aesni(void *out, const void *in, const void *iv, - const void *keys, uint64_t len); +aes_cfb_256_one_sse_no_aesni(void *out, const void *in, const void *iv, const void *keys, + uint64_t len); #endif /* __aarch64__ */ #endif /* NOAESNI_H */ diff --git a/lib/include/ooo_mgr_reset.h b/lib/include/ooo_mgr_reset.h index 270b40d8..416fff20 100644 --- a/lib/include/ooo_mgr_reset.h +++ b/lib/include/ooo_mgr_reset.h @@ -42,45 +42,58 @@ IMB_DLL_LOCAL void ooo_mgr_ccm_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_aes_xcbc_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_aes_xcbc_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_hmac_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_hmac_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_hmac_sha224_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_hmac_sha224_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_hmac_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_hmac_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_hmac_sha384_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_hmac_sha384_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_hmac_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_hmac_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_hmac_md5_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_hmac_md5_reset(void *p_ooo_mgr, const unsigned num_lanes); #endif /* __aarch64__ */ IMB_DLL_LOCAL -void ooo_mgr_zuc_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_zuc_reset(void *p_ooo_mgr, const unsigned num_lanes); #ifndef __aarch64__ IMB_DLL_LOCAL -void ooo_mgr_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes); IMB_DLL_LOCAL -void ooo_mgr_des_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_des_reset(void *p_ooo_mgr, const unsigned num_lanes); #endif /* __aarch64__ */ IMB_DLL_LOCAL -void ooo_mgr_snow3g_reset(void *p_ooo_mgr, const unsigned num_lanes); +void +ooo_mgr_snow3g_reset(void *p_ooo_mgr, const unsigned num_lanes); #endif /* OOO_MGR_RESET_H */ diff --git a/lib/include/save_xmms.h b/lib/include/save_xmms.h index 1513c232..db642cb7 100644 --- a/lib/include/save_xmms.h +++ b/lib/include/save_xmms.h @@ -30,10 +30,14 @@ #include "ipsec-mb.h" -void save_xmms(imb_uint128_t array[10]); -void restore_xmms(imb_uint128_t array[10]); - -void save_xmms_avx(imb_uint128_t array[10]); -void restore_xmms_avx(imb_uint128_t array[10]); +void +save_xmms(imb_uint128_t array[10]); +void +restore_xmms(imb_uint128_t array[10]); + +void +save_xmms_avx(imb_uint128_t array[10]); +void +restore_xmms_avx(imb_uint128_t array[10]); #endif /* SAVE_XMMS_H */ diff --git a/lib/include/sha_generic.h b/lib/include/sha_generic.h index c7f51e72..c1d68d6a 100644 --- a/lib/include/sha_generic.h +++ b/lib/include/sha_generic.h @@ -37,36 +37,44 @@ #include "include/clear_regs_mem.h" #include "include/error.h" -extern void sha1_block_sse(const void *, void *); -extern void sha1_block_avx(const void *, void *); -extern void sha1_ni_block_sse(const void *, void *); - -extern void sha224_block_sse(const void *, void *); -extern void sha224_block_avx(const void *, void *); - -extern void sha256_block_sse(const void *, void *); -extern void sha256_block_avx(const void *, void *); -extern void sha256_ni_block_sse(const void *, void *); - -extern void sha384_block_sse(const void *, void *); -extern void sha384_block_avx(const void *, void *); - -extern void sha512_block_sse(const void *, void *); -extern void sha512_block_avx(const void *, void *); - -enum arch_type { - ARCH_SSE = 0, - ARCH_SSE_SHANI, - ARCH_AVX -}; +extern void +sha1_block_sse(const void *, void *); +extern void +sha1_block_avx(const void *, void *); +extern void +sha1_ni_block_sse(const void *, void *); + +extern void +sha224_block_sse(const void *, void *); +extern void +sha224_block_avx(const void *, void *); + +extern void +sha256_block_sse(const void *, void *); +extern void +sha256_block_avx(const void *, void *); +extern void +sha256_ni_block_sse(const void *, void *); + +extern void +sha384_block_sse(const void *, void *); +extern void +sha384_block_avx(const void *, void *); + +extern void +sha512_block_sse(const void *, void *); +extern void +sha512_block_avx(const void *, void *); + +enum arch_type { ARCH_SSE = 0, ARCH_SSE_SHANI, ARCH_AVX }; /* ========================================================================== */ /* * Various utility functions for SHA API */ -__forceinline -uint32_t bswap4(const uint32_t val) +__forceinline uint32_t +bswap4(const uint32_t val) { return ((val >> 24) | /**< A*/ ((val & 0xff0000) >> 8) | /**< B*/ @@ -74,32 +82,32 @@ uint32_t bswap4(const uint32_t val) (val << 24)); /**< D*/ } -__forceinline -uint64_t bswap8(const uint64_t val) +__forceinline uint64_t +bswap8(const uint64_t val) { return (((uint64_t) bswap4((uint32_t) val)) << 32) | - (((uint64_t) bswap4((uint32_t) (val >> 32)))); + (((uint64_t) bswap4((uint32_t) (val >> 32)))); } -__forceinline -void store8_be(void *outp, const uint64_t val) +__forceinline void +store8_be(void *outp, const uint64_t val) { - *((uint64_t *)outp) = bswap8(val); + *((uint64_t *) outp) = bswap8(val); } -__forceinline -void var_memcpy(void *dst, const void *src, const uint64_t len) +__forceinline void +var_memcpy(void *dst, const void *src, const uint64_t len) { uint64_t i; - const uint8_t *src8 = (const uint8_t *)src; - uint8_t *dst8 = (uint8_t *)dst; + const uint8_t *src8 = (const uint8_t *) src; + uint8_t *dst8 = (uint8_t *) dst; for (i = 0; i < len; i++) dst8[i] = src8[i]; } -__forceinline -void copy_bswap4_array(void *dst, const void *src, const size_t num) +__forceinline void +copy_bswap4_array(void *dst, const void *src, const size_t num) { uint32_t *outp = (uint32_t *) dst; const uint32_t *inp = (const uint32_t *) src; @@ -109,8 +117,8 @@ void copy_bswap4_array(void *dst, const void *src, const size_t num) outp[i] = bswap4(inp[i]); } -__forceinline -void copy_bswap8_array(void *dst, const void *src, const size_t num) +__forceinline void +copy_bswap8_array(void *dst, const void *src, const size_t num) { uint64_t *outp = (uint64_t *) dst; const uint64_t *inp = (const uint64_t *) src; @@ -120,10 +128,8 @@ void copy_bswap8_array(void *dst, const void *src, const size_t num) outp[i] = bswap8(inp[i]); } -__forceinline -void -sha_generic_one_block(const void *inp, void *digest, - const enum arch_type arch, const int sha_type) +__forceinline void +sha_generic_one_block(const void *inp, void *digest, const enum arch_type arch, const int sha_type) { if (sha_type == 1) { if (arch == ARCH_AVX) @@ -160,10 +166,10 @@ sha_generic_one_block(const void *inp, void *digest, } } -__forceinline -void sha1_init_digest(void *p) +__forceinline void +sha1_init_digest(void *p) { - uint32_t *p_digest = (uint32_t *)p; + uint32_t *p_digest = (uint32_t *) p; p_digest[0] = H0; p_digest[1] = H1; @@ -172,10 +178,10 @@ void sha1_init_digest(void *p) p_digest[4] = H4; } -__forceinline -void sha224_init_digest(void *p) +__forceinline void +sha224_init_digest(void *p) { - uint32_t *p_digest = (uint32_t *)p; + uint32_t *p_digest = (uint32_t *) p; p_digest[0] = SHA224_H0; p_digest[1] = SHA224_H1; @@ -187,10 +193,10 @@ void sha224_init_digest(void *p) p_digest[7] = SHA224_H7; } -__forceinline -void sha256_init_digest(void *p) +__forceinline void +sha256_init_digest(void *p) { - uint32_t *p_digest = (uint32_t *)p; + uint32_t *p_digest = (uint32_t *) p; p_digest[0] = SHA256_H0; p_digest[1] = SHA256_H1; @@ -202,10 +208,10 @@ void sha256_init_digest(void *p) p_digest[7] = SHA256_H7; } -__forceinline -void sha384_init_digest(void *p) +__forceinline void +sha384_init_digest(void *p) { - uint64_t *p_digest = (uint64_t *)p; + uint64_t *p_digest = (uint64_t *) p; p_digest[0] = SHA384_H0; p_digest[1] = SHA384_H1; @@ -217,10 +223,10 @@ void sha384_init_digest(void *p) p_digest[7] = SHA384_H7; } -__forceinline -void sha512_init_digest(void *p) +__forceinline void +sha512_init_digest(void *p) { - uint64_t *p_digest = (uint64_t *)p; + uint64_t *p_digest = (uint64_t *) p; p_digest[0] = SHA512_H0; p_digest[1] = SHA512_H1; @@ -232,8 +238,7 @@ void sha512_init_digest(void *p) p_digest[7] = SHA512_H7; } -__forceinline -void +__forceinline void sha_generic_init(void *digest, const int sha_type) { if (sha_type == 1) @@ -248,8 +253,8 @@ sha_generic_init(void *digest, const int sha_type) sha512_init_digest(digest); } -__forceinline -void sha_generic_write_digest(void *dst, const void *src, const int sha_type) +__forceinline void +sha_generic_write_digest(void *dst, const void *src, const int sha_type) { if (sha_type == 1) copy_bswap4_array(dst, src, NUM_SHA_DIGEST_WORDS); @@ -263,11 +268,9 @@ void sha_generic_write_digest(void *dst, const void *src, const int sha_type) copy_bswap8_array(dst, src, NUM_SHA_512_DIGEST_WORDS); } -__forceinline -void -sha_generic(const void *data, const uint64_t length, void *digest, - const enum arch_type arch, const int sha_type, - const uint64_t blk_size, const uint64_t pad_size) +__forceinline void +sha_generic(const void *data, const uint64_t length, void *digest, const enum arch_type arch, + const int sha_type, const uint64_t blk_size, const uint64_t pad_size) { #ifdef SAFE_PARAM imb_set_errno(NULL, 0); @@ -322,9 +325,8 @@ sha_generic(const void *data, const uint64_t length, void *digest, #endif } -__forceinline -void sha_generic_1block(const void *data, void *digest, - const enum arch_type arch, const int sha_type) +__forceinline void +sha_generic_1block(const void *data, void *digest, const enum arch_type arch, const int sha_type) { #ifdef SAFE_PARAM imb_set_errno(NULL, 0); diff --git a/lib/include/sha_mb_mgr.h b/lib/include/sha_mb_mgr.h index c2e61e33..7d1ebbee 100644 --- a/lib/include/sha_mb_mgr.h +++ b/lib/include/sha_mb_mgr.h @@ -34,142 +34,141 @@ #include "include/arch_avx2_type1.h" #include "include/arch_avx512_type1.h" -__forceinline -void copy_bswap4_array_mb(void *dst, const void *src, const size_t num, - const size_t offset, const unsigned lane) +__forceinline void +copy_bswap4_array_mb(void *dst, const void *src, const size_t num, const size_t offset, + const unsigned lane) { uint32_t *outp = (uint32_t *) dst; const uint32_t *inp = (const uint32_t *) src; size_t i; for (i = 0; i < num; i++) - outp[i] = bswap4(inp[lane + i*offset]); + outp[i] = bswap4(inp[lane + i * offset]); } -__forceinline -void copy_bswap4_array_mb_ni(void *dst, const void *src, const size_t num, - const unsigned lane, const int digest_row_sz) +__forceinline void +copy_bswap4_array_mb_ni(void *dst, const void *src, const size_t num, const unsigned lane, + const int digest_row_sz) { uint32_t *outp = (uint32_t *) dst; const uint32_t *inp = (const uint32_t *) src; size_t i; for (i = 0; i < num; i++) - outp[i] = bswap4(inp[digest_row_sz*lane + i]); + outp[i] = bswap4(inp[digest_row_sz * lane + i]); } -__forceinline -void copy_bswap8_array_mb(void *dst, const void *src, const size_t num, - const size_t offset, const unsigned lane) +__forceinline void +copy_bswap8_array_mb(void *dst, const void *src, const size_t num, const size_t offset, + const unsigned lane) { uint64_t *outp = (uint64_t *) dst; const uint64_t *inp = (const uint64_t *) src; size_t i; for (i = 0; i < num; i++) - outp[i] = bswap8(inp[lane + i*offset]); + outp[i] = bswap8(inp[lane + i * offset]); } -__forceinline -void sha1_mb_init_digest(uint32_t *digest, const unsigned lane) +__forceinline void +sha1_mb_init_digest(uint32_t *digest, const unsigned lane) { - digest[lane + 0*16] = H0; - digest[lane + 1*16] = H1; - digest[lane + 2*16] = H2; - digest[lane + 3*16] = H3; - digest[lane + 4*16] = H4; + digest[lane + 0 * 16] = H0; + digest[lane + 1 * 16] = H1; + digest[lane + 2 * 16] = H2; + digest[lane + 3 * 16] = H3; + digest[lane + 4 * 16] = H4; } -__forceinline -void sha1_ni_mb_init_digest(uint32_t *digest, const unsigned lane) +__forceinline void +sha1_ni_mb_init_digest(uint32_t *digest, const unsigned lane) { - digest[5*lane + 0] = H0; - digest[5*lane + 1] = H1; - digest[5*lane + 2] = H2; - digest[5*lane + 3] = H3; - digest[5*lane + 4] = H4; + digest[5 * lane + 0] = H0; + digest[5 * lane + 1] = H1; + digest[5 * lane + 2] = H2; + digest[5 * lane + 3] = H3; + digest[5 * lane + 4] = H4; } -__forceinline -void sha224_mb_init_digest(uint32_t *digest, const unsigned lane) +__forceinline void +sha224_mb_init_digest(uint32_t *digest, const unsigned lane) { - digest[lane + 0*16] = SHA224_H0; - digest[lane + 1*16] = SHA224_H1; - digest[lane + 2*16] = SHA224_H2; - digest[lane + 3*16] = SHA224_H3; - digest[lane + 4*16] = SHA224_H4; - digest[lane + 5*16] = SHA224_H5; - digest[lane + 6*16] = SHA224_H6; - digest[lane + 7*16] = SHA224_H7; + digest[lane + 0 * 16] = SHA224_H0; + digest[lane + 1 * 16] = SHA224_H1; + digest[lane + 2 * 16] = SHA224_H2; + digest[lane + 3 * 16] = SHA224_H3; + digest[lane + 4 * 16] = SHA224_H4; + digest[lane + 5 * 16] = SHA224_H5; + digest[lane + 6 * 16] = SHA224_H6; + digest[lane + 7 * 16] = SHA224_H7; } -__forceinline -void sha224_ni_mb_init_digest(uint32_t *digest, const unsigned lane) +__forceinline void +sha224_ni_mb_init_digest(uint32_t *digest, const unsigned lane) { - digest[8*lane + 0] = SHA224_H0; - digest[8*lane + 1] = SHA224_H1; - digest[8*lane + 2] = SHA224_H2; - digest[8*lane + 3] = SHA224_H3; - digest[8*lane + 4] = SHA224_H4; - digest[8*lane + 5] = SHA224_H5; - digest[8*lane + 6] = SHA224_H6; - digest[8*lane + 7] = SHA224_H7; + digest[8 * lane + 0] = SHA224_H0; + digest[8 * lane + 1] = SHA224_H1; + digest[8 * lane + 2] = SHA224_H2; + digest[8 * lane + 3] = SHA224_H3; + digest[8 * lane + 4] = SHA224_H4; + digest[8 * lane + 5] = SHA224_H5; + digest[8 * lane + 6] = SHA224_H6; + digest[8 * lane + 7] = SHA224_H7; } -__forceinline -void sha256_mb_init_digest(uint32_t *digest, const unsigned lane) +__forceinline void +sha256_mb_init_digest(uint32_t *digest, const unsigned lane) { - digest[lane + 0*16] = SHA256_H0; - digest[lane + 1*16] = SHA256_H1; - digest[lane + 2*16] = SHA256_H2; - digest[lane + 3*16] = SHA256_H3; - digest[lane + 4*16] = SHA256_H4; - digest[lane + 5*16] = SHA256_H5; - digest[lane + 6*16] = SHA256_H6; - digest[lane + 7*16] = SHA256_H7; + digest[lane + 0 * 16] = SHA256_H0; + digest[lane + 1 * 16] = SHA256_H1; + digest[lane + 2 * 16] = SHA256_H2; + digest[lane + 3 * 16] = SHA256_H3; + digest[lane + 4 * 16] = SHA256_H4; + digest[lane + 5 * 16] = SHA256_H5; + digest[lane + 6 * 16] = SHA256_H6; + digest[lane + 7 * 16] = SHA256_H7; } -__forceinline -void sha256_ni_mb_init_digest(uint32_t *digest, const unsigned lane) +__forceinline void +sha256_ni_mb_init_digest(uint32_t *digest, const unsigned lane) { - digest[8*lane + 0] = SHA256_H0; - digest[8*lane + 1] = SHA256_H1; - digest[8*lane + 2] = SHA256_H2; - digest[8*lane + 3] = SHA256_H3; - digest[8*lane + 4] = SHA256_H4; - digest[8*lane + 5] = SHA256_H5; - digest[8*lane + 6] = SHA256_H6; - digest[8*lane + 7] = SHA256_H7; + digest[8 * lane + 0] = SHA256_H0; + digest[8 * lane + 1] = SHA256_H1; + digest[8 * lane + 2] = SHA256_H2; + digest[8 * lane + 3] = SHA256_H3; + digest[8 * lane + 4] = SHA256_H4; + digest[8 * lane + 5] = SHA256_H5; + digest[8 * lane + 6] = SHA256_H6; + digest[8 * lane + 7] = SHA256_H7; } -__forceinline -void sha384_mb_init_digest(uint64_t *digest, const unsigned lane) +__forceinline void +sha384_mb_init_digest(uint64_t *digest, const unsigned lane) { - digest[lane + 0*8] = SHA384_H0; - digest[lane + 1*8] = SHA384_H1; - digest[lane + 2*8] = SHA384_H2; - digest[lane + 3*8] = SHA384_H3; - digest[lane + 4*8] = SHA384_H4; - digest[lane + 5*8] = SHA384_H5; - digest[lane + 6*8] = SHA384_H6; - digest[lane + 7*8] = SHA384_H7; + digest[lane + 0 * 8] = SHA384_H0; + digest[lane + 1 * 8] = SHA384_H1; + digest[lane + 2 * 8] = SHA384_H2; + digest[lane + 3 * 8] = SHA384_H3; + digest[lane + 4 * 8] = SHA384_H4; + digest[lane + 5 * 8] = SHA384_H5; + digest[lane + 6 * 8] = SHA384_H6; + digest[lane + 7 * 8] = SHA384_H7; } -__forceinline -void sha512_mb_init_digest(uint64_t *digest, const unsigned lane) +__forceinline void +sha512_mb_init_digest(uint64_t *digest, const unsigned lane) { - digest[lane + 0*8] = SHA512_H0; - digest[lane + 1*8] = SHA512_H1; - digest[lane + 2*8] = SHA512_H2; - digest[lane + 3*8] = SHA512_H3; - digest[lane + 4*8] = SHA512_H4; - digest[lane + 5*8] = SHA512_H5; - digest[lane + 6*8] = SHA512_H6; - digest[lane + 7*8] = SHA512_H7; + digest[lane + 0 * 8] = SHA512_H0; + digest[lane + 1 * 8] = SHA512_H1; + digest[lane + 2 * 8] = SHA512_H2; + digest[lane + 3 * 8] = SHA512_H3; + digest[lane + 4 * 8] = SHA512_H4; + digest[lane + 5 * 8] = SHA512_H5; + digest[lane + 6 * 8] = SHA512_H6; + digest[lane + 7 * 8] = SHA512_H7; } -__forceinline -void +__forceinline void sha_mb_generic_init(void *digest, const int sha_type, const unsigned lane) { if (sha_type == 1) @@ -180,12 +179,11 @@ sha_mb_generic_init(void *digest, const int sha_type, const unsigned lane) sha256_mb_init_digest(digest, lane); else if (sha_type == 384) sha384_mb_init_digest(digest, lane); - else /* sha_type == 512 */ + else /* sha_type == 512 */ sha512_mb_init_digest(digest, lane); } -__forceinline -void +__forceinline void sha_ni_mb_generic_init(void *digest, const int sha_type, const unsigned lane) { if (sha_type == 1) @@ -196,119 +194,100 @@ sha_ni_mb_generic_init(void *digest, const int sha_type, const unsigned lane) sha256_ni_mb_init_digest(digest, lane); } -__forceinline -void sha_mb_generic_write_digest(void *dst, const void *src, - const int sha_type, const size_t offset, - const unsigned lane) +__forceinline void +sha_mb_generic_write_digest(void *dst, const void *src, const int sha_type, const size_t offset, + const unsigned lane) { if (sha_type == 1) - copy_bswap4_array_mb(dst, src, NUM_SHA_DIGEST_WORDS, offset, - lane); + copy_bswap4_array_mb(dst, src, NUM_SHA_DIGEST_WORDS, offset, lane); else if (sha_type == 224) - copy_bswap4_array_mb(dst, src, NUM_SHA_224_DIGEST_WORDS, offset, - lane); + copy_bswap4_array_mb(dst, src, NUM_SHA_224_DIGEST_WORDS, offset, lane); else if (sha_type == 256) - copy_bswap4_array_mb(dst, src, NUM_SHA_256_DIGEST_WORDS, offset, - lane); + copy_bswap4_array_mb(dst, src, NUM_SHA_256_DIGEST_WORDS, offset, lane); else if (sha_type == 384) - copy_bswap8_array_mb(dst, src, NUM_SHA_384_DIGEST_WORDS, offset, - lane); - else /* sha_type == 512 */ - copy_bswap8_array_mb(dst, src, NUM_SHA_512_DIGEST_WORDS, offset, - lane); + copy_bswap8_array_mb(dst, src, NUM_SHA_384_DIGEST_WORDS, offset, lane); + else /* sha_type == 512 */ + copy_bswap8_array_mb(dst, src, NUM_SHA_512_DIGEST_WORDS, offset, lane); } -__forceinline -void sha_ni_mb_generic_write_digest(void *dst, const void *src, - const int sha_type, const unsigned lane) +__forceinline void +sha_ni_mb_generic_write_digest(void *dst, const void *src, const int sha_type, const unsigned lane) { if (sha_type == 1) - copy_bswap4_array_mb_ni(dst, src, NUM_SHA_DIGEST_WORDS, - lane, 5); + copy_bswap4_array_mb_ni(dst, src, NUM_SHA_DIGEST_WORDS, lane, 5); else if (sha_type == 224) - copy_bswap4_array_mb_ni(dst, src, NUM_SHA_224_DIGEST_WORDS, - lane, 8); + copy_bswap4_array_mb_ni(dst, src, NUM_SHA_224_DIGEST_WORDS, lane, 8); else if (sha_type == 256) - copy_bswap4_array_mb_ni(dst, src, NUM_SHA_256_DIGEST_WORDS, - lane, 8); + copy_bswap4_array_mb_ni(dst, src, NUM_SHA_256_DIGEST_WORDS, lane, 8); } -__forceinline -void sha1_create_extra_blocks(MB_MGR_SHA_1_OOO *state, - const uint64_t blk_size, const uint64_t r, - const unsigned min_idx) +__forceinline void +sha1_create_extra_blocks(MB_MGR_SHA_1_OOO *state, const uint64_t blk_size, const uint64_t r, + const unsigned min_idx) { HMAC_SHA1_LANE_DATA *ld = &state->ldata[min_idx]; - const uint64_t xblk_size = blk_size*state->ldata[min_idx].extra_blocks; + const uint64_t xblk_size = blk_size * state->ldata[min_idx].extra_blocks; memset(ld->extra_block, 0, sizeof(ld->extra_block)); var_memcpy(ld->extra_block, state->args.data_ptr[min_idx], r); ld->extra_block[r] = 0x80; - store8_be(&ld->extra_block[xblk_size - 8], - ld->job_in_lane->msg_len_to_hash_in_bytes * 8); + store8_be(&ld->extra_block[xblk_size - 8], ld->job_in_lane->msg_len_to_hash_in_bytes * 8); state->args.data_ptr[min_idx] = &ld->extra_block[0]; - state->lens[min_idx] = (uint16_t)xblk_size; + state->lens[min_idx] = (uint16_t) xblk_size; state->ldata[min_idx].extra_blocks = 0; } -__forceinline -void sha256_create_extra_blocks(MB_MGR_SHA_256_OOO *state, - const uint64_t blk_size, const uint64_t r, - const unsigned min_idx) +__forceinline void +sha256_create_extra_blocks(MB_MGR_SHA_256_OOO *state, const uint64_t blk_size, const uint64_t r, + const unsigned min_idx) { HMAC_SHA1_LANE_DATA *ld = &state->ldata[min_idx]; - const uint64_t xblk_size = blk_size*state->ldata[min_idx].extra_blocks; + const uint64_t xblk_size = blk_size * state->ldata[min_idx].extra_blocks; memset(ld->extra_block, 0, sizeof(ld->extra_block)); var_memcpy(ld->extra_block, state->args.data_ptr[min_idx], r); ld->extra_block[r] = 0x80; - store8_be(&ld->extra_block[xblk_size - 8], - ld->job_in_lane->msg_len_to_hash_in_bytes * 8); + store8_be(&ld->extra_block[xblk_size - 8], ld->job_in_lane->msg_len_to_hash_in_bytes * 8); state->args.data_ptr[min_idx] = &ld->extra_block[0]; - state->lens[min_idx] = (uint16_t)xblk_size; + state->lens[min_idx] = (uint16_t) xblk_size; state->ldata[min_idx].extra_blocks = 0; } -__forceinline -void sha512_create_extra_blocks(MB_MGR_SHA_512_OOO *state, - const uint64_t blk_size, const uint64_t r, - const unsigned min_idx) +__forceinline void +sha512_create_extra_blocks(MB_MGR_SHA_512_OOO *state, const uint64_t blk_size, const uint64_t r, + const unsigned min_idx) { HMAC_SHA512_LANE_DATA *ld = &state->ldata[min_idx]; - const uint64_t xblk_size = blk_size*state->ldata[min_idx].extra_blocks; + const uint64_t xblk_size = blk_size * state->ldata[min_idx].extra_blocks; memset(ld->extra_block, 0, sizeof(ld->extra_block)); var_memcpy(ld->extra_block, state->args.data_ptr[min_idx], r); ld->extra_block[r] = 0x80; - store8_be(&ld->extra_block[xblk_size - 8], - ld->job_in_lane->msg_len_to_hash_in_bytes * 8); + store8_be(&ld->extra_block[xblk_size - 8], ld->job_in_lane->msg_len_to_hash_in_bytes * 8); state->args.data_ptr[min_idx] = &ld->extra_block[0]; - state->lens[min_idx] = (uint16_t)xblk_size; + state->lens[min_idx] = (uint16_t) xblk_size; state->ldata[min_idx].extra_blocks = 0; } -__forceinline -IMB_JOB * -submit_flush_job_sha_1(MB_MGR_SHA_1_OOO *state, IMB_JOB *job, - const unsigned max_jobs, const int is_submit, - const int sha_type, const uint64_t blk_size, - const uint64_t pad_size, - void (*fn)(SHA1_ARGS *, uint32_t), const int shani) +__forceinline IMB_JOB * +submit_flush_job_sha_1(MB_MGR_SHA_1_OOO *state, IMB_JOB *job, const unsigned max_jobs, + const int is_submit, const int sha_type, const uint64_t blk_size, + const uint64_t pad_size, void (*fn)(SHA1_ARGS *, uint32_t), const int shani) { unsigned lane, min_idx; IMB_JOB *ret_job = NULL; @@ -322,15 +301,12 @@ submit_flush_job_sha_1(MB_MGR_SHA_1_OOO *state, IMB_JOB *job, lane = state->unused_lanes & 15; state->unused_lanes >>= 4; state->num_lanes_inuse++; - state->args.data_ptr[lane] = - job->src + job->hash_start_src_offset_in_bytes; + state->args.data_ptr[lane] = job->src + job->hash_start_src_offset_in_bytes; if (shani) - sha_ni_mb_generic_init(state->args.digest, sha_type, - lane); + sha_ni_mb_generic_init(state->args.digest, sha_type, lane); else - sha_mb_generic_init(state->args.digest, sha_type, - lane); + sha_mb_generic_init(state->args.digest, sha_type, lane); /* copy job data in and set up initial blocks */ state->ldata[lane].job_in_lane = job; @@ -390,8 +366,7 @@ submit_flush_job_sha_1(MB_MGR_SHA_1_OOO *state, IMB_JOB *job, min_len = state->lens[i]; } } else { - state->args.data_ptr[i] = - state->args.data_ptr[lane]; + state->args.data_ptr[i] = state->args.data_ptr[lane]; state->lens[i] = UINT64_MAX; } } @@ -409,15 +384,14 @@ submit_flush_job_sha_1(MB_MGR_SHA_1_OOO *state, IMB_JOB *job, state->ldata[min_idx].extra_blocks = 2; /* run the algorithmic code on full selected blocks */ - if(min_len >= blk_size) - (*fn)(&state->args, - (uint32_t)(min_len/blk_size)); + if (min_len >= blk_size) + (*fn)(&state->args, (uint32_t) (min_len / blk_size)); /* create extra blocks */ if (state->ldata[min_idx].extra_blocks != 0) sha1_create_extra_blocks(state, blk_size, r, min_idx); - } while(state->lens[min_idx] != 0); + } while (state->lens[min_idx] != 0); ret_job = state->ldata[min_idx].job_in_lane; #ifdef SAFE_DATA @@ -428,25 +402,21 @@ submit_flush_job_sha_1(MB_MGR_SHA_1_OOO *state, IMB_JOB *job, state->unused_lanes = (state->unused_lanes << 4) | min_idx; state->num_lanes_inuse--; if (shani) - sha_ni_mb_generic_write_digest(ret_job->auth_tag_output, - state->args.digest, sha_type, - min_idx); + sha_ni_mb_generic_write_digest(ret_job->auth_tag_output, state->args.digest, + sha_type, min_idx); else - sha_mb_generic_write_digest(ret_job->auth_tag_output, - state->args.digest, sha_type, 16, - min_idx); + sha_mb_generic_write_digest(ret_job->auth_tag_output, state->args.digest, sha_type, + 16, min_idx); ret_job->status |= IMB_STATUS_COMPLETED_AUTH; state->ldata[min_idx].job_in_lane = NULL; return ret_job; } -__forceinline -IMB_JOB * -submit_flush_job_sha_256(MB_MGR_SHA_256_OOO *state, IMB_JOB *job, - const unsigned max_jobs, const int is_submit, - const int sha_type, const uint64_t blk_size, - const uint64_t pad_size, - void (*fn)(SHA256_ARGS *, uint32_t), const int shani) +__forceinline IMB_JOB * +submit_flush_job_sha_256(MB_MGR_SHA_256_OOO *state, IMB_JOB *job, const unsigned max_jobs, + const int is_submit, const int sha_type, const uint64_t blk_size, + const uint64_t pad_size, void (*fn)(SHA256_ARGS *, uint32_t), + const int shani) { unsigned lane, min_idx; IMB_JOB *ret_job = NULL; @@ -460,15 +430,12 @@ submit_flush_job_sha_256(MB_MGR_SHA_256_OOO *state, IMB_JOB *job, lane = state->unused_lanes & 15; state->unused_lanes >>= 4; state->num_lanes_inuse++; - state->args.data_ptr[lane] = - job->src + job->hash_start_src_offset_in_bytes; + state->args.data_ptr[lane] = job->src + job->hash_start_src_offset_in_bytes; if (shani) - sha_ni_mb_generic_init(state->args.digest, sha_type, - lane); + sha_ni_mb_generic_init(state->args.digest, sha_type, lane); else - sha_mb_generic_init(state->args.digest, sha_type, - lane); + sha_mb_generic_init(state->args.digest, sha_type, lane); /* copy job data in and set up initial blocks */ state->ldata[lane].job_in_lane = job; @@ -528,8 +495,7 @@ submit_flush_job_sha_256(MB_MGR_SHA_256_OOO *state, IMB_JOB *job, min_len = state->lens[i]; } } else { - state->args.data_ptr[i] = - state->args.data_ptr[lane]; + state->args.data_ptr[i] = state->args.data_ptr[lane]; state->lens[i] = UINT64_MAX; } } @@ -547,15 +513,14 @@ submit_flush_job_sha_256(MB_MGR_SHA_256_OOO *state, IMB_JOB *job, state->ldata[min_idx].extra_blocks = 2; /* run the algorithmic code on full selected blocks */ - if(min_len >= blk_size) - (*fn)(&state->args, - (uint32_t)(min_len/blk_size)); + if (min_len >= blk_size) + (*fn)(&state->args, (uint32_t) (min_len / blk_size)); /* create extra blocks */ if (state->ldata[min_idx].extra_blocks != 0) sha256_create_extra_blocks(state, blk_size, r, min_idx); - } while(state->lens[min_idx] != 0); + } while (state->lens[min_idx] != 0); ret_job = state->ldata[min_idx].job_in_lane; #ifdef SAFE_DATA @@ -566,26 +531,21 @@ submit_flush_job_sha_256(MB_MGR_SHA_256_OOO *state, IMB_JOB *job, state->unused_lanes = (state->unused_lanes << 4) | min_idx; state->num_lanes_inuse--; if (shani) - sha_ni_mb_generic_write_digest(ret_job->auth_tag_output, - state->args.digest, sha_type, - min_idx); + sha_ni_mb_generic_write_digest(ret_job->auth_tag_output, state->args.digest, + sha_type, min_idx); else - sha_mb_generic_write_digest(ret_job->auth_tag_output, - state->args.digest, sha_type, 16, - min_idx); + sha_mb_generic_write_digest(ret_job->auth_tag_output, state->args.digest, sha_type, + 16, min_idx); ret_job->status |= IMB_STATUS_COMPLETED_AUTH; state->ldata[min_idx].job_in_lane = NULL; return ret_job; } -__forceinline -IMB_JOB * -submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, - const unsigned max_jobs, const int is_submit, - const int sha_type, const uint64_t blk_size, - const uint64_t pad_size, - void (*fn)(SHA512_ARGS *, uint64_t)) +__forceinline IMB_JOB * +submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, const unsigned max_jobs, + const int is_submit, const int sha_type, const uint64_t blk_size, + const uint64_t pad_size, void (*fn)(SHA512_ARGS *, uint64_t)) { unsigned lane, min_idx; IMB_JOB *ret_job = NULL; @@ -599,14 +559,13 @@ submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, lane = state->unused_lanes & 15; state->unused_lanes >>= 4; state->num_lanes_inuse++; - state->args.data_ptr[lane] = - job->src + job->hash_start_src_offset_in_bytes; + state->args.data_ptr[lane] = job->src + job->hash_start_src_offset_in_bytes; sha_mb_generic_init(state->args.digest, sha_type, lane); /* copy job data in and set up initial blocks */ state->ldata[lane].job_in_lane = job; - state->lens[lane] = (uint16_t)job->msg_len_to_hash_in_bytes; + state->lens[lane] = (uint16_t) job->msg_len_to_hash_in_bytes; state->ldata[lane].extra_blocks = 1; /* enough jobs to start processing? */ @@ -630,9 +589,9 @@ submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, if (is_submit) { /* - * SUBMIT - * - find min common length to process - */ + * SUBMIT + * - find min common length to process + */ min_idx = 0; min_len = state->lens[0]; @@ -644,11 +603,11 @@ submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, } } else { /* - * FLUSH - * - copy good (not null) lane onto empty lanes - * - find min common length to process across - * - not null lanes - */ + * FLUSH + * - copy good (not null) lane onto empty lanes + * - find min common length to process across + * - not null lanes + */ min_idx = lane; min_len = state->lens[lane]; @@ -662,8 +621,7 @@ submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, min_len = state->lens[i]; } } else { - state->args.data_ptr[i] = - state->args.data_ptr[lane]; + state->args.data_ptr[i] = state->args.data_ptr[lane]; state->lens[i] = UINT64_MAX; } } @@ -681,15 +639,14 @@ submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, state->ldata[min_idx].extra_blocks = 2; /* run the algorithmic code on full selected blocks */ - if(min_len >= blk_size) - (*fn)(&state->args, - (uint64_t)(min_len/blk_size)); + if (min_len >= blk_size) + (*fn)(&state->args, (uint64_t) (min_len / blk_size)); /* create extra blocks */ if (state->ldata[min_idx].extra_blocks != 0) sha512_create_extra_blocks(state, blk_size, r, min_idx); - } while(state->lens[min_idx] != 0); + } while (state->lens[min_idx] != 0); ret_job = state->ldata[min_idx].job_in_lane; #ifdef SAFE_DATA @@ -699,8 +656,8 @@ submit_flush_job_sha_512(MB_MGR_SHA_512_OOO *state, IMB_JOB *job, /* put back processed packet into unused lanes, set job as complete */ state->unused_lanes = (state->unused_lanes << 4) | min_idx; state->num_lanes_inuse--; - sha_mb_generic_write_digest(ret_job->auth_tag_output, - state->args.digest, sha_type, 8, min_idx); + sha_mb_generic_write_digest(ret_job->auth_tag_output, state->args.digest, sha_type, 8, + min_idx); ret_job->status |= IMB_STATUS_COMPLETED_AUTH; state->ldata[min_idx].job_in_lane = NULL; return ret_job; diff --git a/lib/include/snow3g.h b/lib/include/snow3g.h index cd7eca39..06b386fc 100644 --- a/lib/include/snow3g.h +++ b/lib/include/snow3g.h @@ -33,114 +33,58 @@ * SSE ******************************************************************************/ void -snow3g_f8_1_buffer_bit_sse(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t cipherLengthInBits, - const uint32_t offsetInBits); - -void -snow3g_f8_1_buffer_sse(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t lengthInBytes); - -void -snow3g_f8_2_buffer_sse(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2); - -void -snow3g_f8_4_buffer_sse(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4); - -void -snow3g_f8_8_buffer_sse(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pIV5, - const void *pIV6, - const void *pIV7, - const void *pIV8, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4, - const void *pBufferIn5, - void *pBufferOut5, - const uint32_t lengthInBytes5, - const void *pBufferIn6, - void *pBufferOut6, - const uint32_t lengthInBytes6, - const void *pBufferIn7, - void *pBufferOut7, - const uint32_t lengthInBytes7, - const void *pBufferIn8, - void *pBufferOut8, - const uint32_t lengthInBytes8); - -void -snow3g_f8_8_buffer_multikey_sse(const snow3g_key_schedule_t * const pCtx[], - const void * const pIV[], - const void * const pBufferIn[], - void *pBufferOut[], +snow3g_f8_1_buffer_bit_sse(const snow3g_key_schedule_t *pCtx, const void *pIV, + const void *pBufferIn, void *pBufferOut, + const uint32_t cipherLengthInBits, const uint32_t offsetInBits); + +void +snow3g_f8_1_buffer_sse(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + void *pBufferOut, const uint32_t lengthInBytes); + +void +snow3g_f8_2_buffer_sse(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2); + +void +snow3g_f8_4_buffer_sse(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4); + +void +snow3g_f8_8_buffer_sse(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pIV5, const void *pIV6, + const void *pIV7, const void *pIV8, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4, const void *pBufferIn5, + void *pBufferOut5, const uint32_t lengthInBytes5, const void *pBufferIn6, + void *pBufferOut6, const uint32_t lengthInBytes6, const void *pBufferIn7, + void *pBufferOut7, const uint32_t lengthInBytes7, const void *pBufferIn8, + void *pBufferOut8, const uint32_t lengthInBytes8); + +void +snow3g_f8_8_buffer_multikey_sse(const snow3g_key_schedule_t *const pCtx[], const void *const pIV[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t lengthInBytes[]); void -snow3g_f8_n_buffer_sse(const snow3g_key_schedule_t *pCtx, - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); +snow3g_f8_n_buffer_sse(const snow3g_key_schedule_t *pCtx, const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f8_n_buffer_multikey_sse(const snow3g_key_schedule_t * const pCtx[], - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); +snow3g_f8_n_buffer_multikey_sse(const snow3g_key_schedule_t *const pCtx[], const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f9_1_buffer_sse(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest); +snow3g_f9_1_buffer_sse(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + const uint64_t lengthInBits, void *pDigest); size_t snow3g_key_sched_size_sse(void); @@ -149,249 +93,137 @@ int snow3g_init_key_sched_sse(const void *pKey, snow3g_key_schedule_t *pCtx); uint32_t -snow3g_f9_1_buffer_internal_sse(const uint64_t *pBufferIn, - const uint32_t KS[5], +snow3g_f9_1_buffer_internal_sse(const uint64_t *pBufferIn, const uint32_t KS[5], const uint64_t lengthInBits); /******************************************************************************* * SSE NO-AESNI ******************************************************************************/ void -snow3g_f8_1_buffer_bit_sse_no_aesni(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t cipherLengthInBits, - const uint32_t offsetInBits); +snow3g_f8_1_buffer_bit_sse_no_aesni(const snow3g_key_schedule_t *pCtx, const void *pIV, + const void *pBufferIn, void *pBufferOut, + const uint32_t cipherLengthInBits, const uint32_t offsetInBits); void -snow3g_f8_1_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, +snow3g_f8_1_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, const void *pIV, + const void *pBufferIn, void *pBufferOut, const uint32_t lengthInBytes); void -snow3g_f8_2_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2); - -void -snow3g_f8_4_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4); - -void -snow3g_f8_8_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pIV5, - const void *pIV6, - const void *pIV7, - const void *pIV8, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4, - const void *pBufferIn5, - void *pBufferOut5, - const uint32_t lengthInBytes5, - const void *pBufferIn6, - void *pBufferOut6, - const uint32_t lengthInBytes6, - const void *pBufferIn7, - void *pBufferOut7, - const uint32_t lengthInBytes7, - const void *pBufferIn8, - void *pBufferOut8, - const uint32_t lengthInBytes8); - -void -snow3g_f8_8_buffer_multikey_sse_no_aesni(const snow3g_key_schedule_t * const - pCtx[], - const void * const pIV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t lengthInBytes[]); +snow3g_f8_2_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, const void *pIV1, + const void *pIV2, const void *pBufferIn1, void *pBufferOut1, + const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2); void -snow3g_f8_n_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); +snow3g_f8_4_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, const void *pIV1, + const void *pIV2, const void *pIV3, const void *pIV4, + const void *pBufferIn1, void *pBufferOut1, + const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, + const void *pBufferIn3, void *pBufferOut3, + const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4); void -snow3g_f8_n_buffer_multikey_sse_no_aesni(const snow3g_key_schedule_t * const - pCtx[], - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], +snow3g_f8_8_buffer_sse_no_aesni( + const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, const void *pIV3, + const void *pIV4, const void *pIV5, const void *pIV6, const void *pIV7, const void *pIV8, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2, + const void *pBufferIn3, void *pBufferOut3, const uint32_t lengthInBytes3, + const void *pBufferIn4, void *pBufferOut4, const uint32_t lengthInBytes4, + const void *pBufferIn5, void *pBufferOut5, const uint32_t lengthInBytes5, + const void *pBufferIn6, void *pBufferOut6, const uint32_t lengthInBytes6, + const void *pBufferIn7, void *pBufferOut7, const uint32_t lengthInBytes7, + const void *pBufferIn8, void *pBufferOut8, const uint32_t lengthInBytes8); + +void +snow3g_f8_8_buffer_multikey_sse_no_aesni(const snow3g_key_schedule_t *const pCtx[], + const void *const pIV[], const void *const pBufferIn[], + void *pBufferOut[], const uint32_t lengthInBytes[]); + +void +snow3g_f8_n_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); + +void +snow3g_f8_n_buffer_multikey_sse_no_aesni(const snow3g_key_schedule_t *const pCtx[], + const void *const IV[], const void *const pBufferIn[], + void *pBufferOut[], const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f9_1_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest); +snow3g_f9_1_buffer_sse_no_aesni(const snow3g_key_schedule_t *pCtx, const void *pIV, + const void *pBufferIn, const uint64_t lengthInBits, void *pDigest); size_t snow3g_key_sched_size_sse_no_aesni(void); int -snow3g_init_key_sched_sse_no_aesni(const void *pKey, - snow3g_key_schedule_t *pCtx); +snow3g_init_key_sched_sse_no_aesni(const void *pKey, snow3g_key_schedule_t *pCtx); uint32_t -snow3g_f9_1_buffer_internal_sse_no_aesni(const uint64_t *pBufferIn, - const uint32_t KS[5], +snow3g_f9_1_buffer_internal_sse_no_aesni(const uint64_t *pBufferIn, const uint32_t KS[5], const uint64_t lengthInBits); /******************************************************************************* * AVX ******************************************************************************/ void -snow3g_f8_1_buffer_bit_avx(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t cipherLengthInBits, - const uint32_t offsetInBits); - -void -snow3g_f8_1_buffer_avx(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t lengthInBytes); - -void -snow3g_f8_2_buffer_avx(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2); - -void -snow3g_f8_4_buffer_avx(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4); - -void -snow3g_f8_8_buffer_avx(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pIV5, - const void *pIV6, - const void *pIV7, - const void *pIV8, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4, - const void *pBufferIn5, - void *pBufferOut5, - const uint32_t lengthInBytes5, - const void *pBufferIn6, - void *pBufferOut6, - const uint32_t lengthInBytes6, - const void *pBufferIn7, - void *pBufferOut7, - const uint32_t lengthInBytes7, - const void *pBufferIn8, - void *pBufferOut8, - const uint32_t lengthInBytes8); - -void -snow3g_f8_8_buffer_multikey_avx(const snow3g_key_schedule_t * const pCtx[], - const void * const pIV[], - const void * const pBufferIn[], - void *pBufferOut[], +snow3g_f8_1_buffer_bit_avx(const snow3g_key_schedule_t *pCtx, const void *pIV, + const void *pBufferIn, void *pBufferOut, + const uint32_t cipherLengthInBits, const uint32_t offsetInBits); + +void +snow3g_f8_1_buffer_avx(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + void *pBufferOut, const uint32_t lengthInBytes); + +void +snow3g_f8_2_buffer_avx(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2); + +void +snow3g_f8_4_buffer_avx(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4); + +void +snow3g_f8_8_buffer_avx(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pIV5, const void *pIV6, + const void *pIV7, const void *pIV8, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4, const void *pBufferIn5, + void *pBufferOut5, const uint32_t lengthInBytes5, const void *pBufferIn6, + void *pBufferOut6, const uint32_t lengthInBytes6, const void *pBufferIn7, + void *pBufferOut7, const uint32_t lengthInBytes7, const void *pBufferIn8, + void *pBufferOut8, const uint32_t lengthInBytes8); + +void +snow3g_f8_8_buffer_multikey_avx(const snow3g_key_schedule_t *const pCtx[], const void *const pIV[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t lengthInBytes[]); void -snow3g_f8_n_buffer_avx(const snow3g_key_schedule_t *pCtx, - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); +snow3g_f8_n_buffer_avx(const snow3g_key_schedule_t *pCtx, const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f8_n_buffer_multikey_avx(const snow3g_key_schedule_t * const pCtx[], - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); +snow3g_f8_n_buffer_multikey_avx(const snow3g_key_schedule_t *const pCtx[], const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f9_1_buffer_avx(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest); +snow3g_f9_1_buffer_avx(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + const uint64_t lengthInBits, void *pDigest); size_t snow3g_key_sched_size_avx(void); @@ -400,8 +232,7 @@ int snow3g_init_key_sched_avx(const void *pKey, snow3g_key_schedule_t *pCtx); uint32_t -snow3g_f9_1_buffer_internal_avx(const uint64_t *pBufferIn, - const uint32_t KS[5], +snow3g_f9_1_buffer_internal_avx(const uint64_t *pBufferIn, const uint32_t KS[5], const uint64_t lengthInBits); /******************************************************************************* @@ -409,114 +240,58 @@ snow3g_f9_1_buffer_internal_avx(const uint64_t *pBufferIn, ******************************************************************************/ void -snow3g_f8_1_buffer_bit_avx2(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t cipherLengthInBits, - const uint32_t offsetInBits); - -void -snow3g_f8_1_buffer_avx2(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t lengthInBytes); - -void -snow3g_f8_2_buffer_avx2(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2); - -void -snow3g_f8_4_buffer_avx2(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4); - -void -snow3g_f8_8_buffer_avx2(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pIV5, - const void *pIV6, - const void *pIV7, - const void *pIV8, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4, - const void *pBufferIn5, - void *pBufferOut5, - const uint32_t lengthInBytes5, - const void *pBufferIn6, - void *pBufferOut6, - const uint32_t lengthInBytes6, - const void *pBufferIn7, - void *pBufferOut7, - const uint32_t lengthInBytes7, - const void *pBufferIn8, - void *pBufferOut8, - const uint32_t lengthInBytes8); - -void -snow3g_f8_8_buffer_multikey_avx2(const snow3g_key_schedule_t * const pCtx[], - const void * const pIV[], - const void * const pBufferIn[], - void *pBufferOut[], +snow3g_f8_1_buffer_bit_avx2(const snow3g_key_schedule_t *pCtx, const void *pIV, + const void *pBufferIn, void *pBufferOut, + const uint32_t cipherLengthInBits, const uint32_t offsetInBits); + +void +snow3g_f8_1_buffer_avx2(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + void *pBufferOut, const uint32_t lengthInBytes); + +void +snow3g_f8_2_buffer_avx2(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2); + +void +snow3g_f8_4_buffer_avx2(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4); + +void +snow3g_f8_8_buffer_avx2(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pIV5, const void *pIV6, + const void *pIV7, const void *pIV8, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4, const void *pBufferIn5, + void *pBufferOut5, const uint32_t lengthInBytes5, const void *pBufferIn6, + void *pBufferOut6, const uint32_t lengthInBytes6, const void *pBufferIn7, + void *pBufferOut7, const uint32_t lengthInBytes7, const void *pBufferIn8, + void *pBufferOut8, const uint32_t lengthInBytes8); + +void +snow3g_f8_8_buffer_multikey_avx2(const snow3g_key_schedule_t *const pCtx[], const void *const pIV[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t lengthInBytes[]); void -snow3g_f8_n_buffer_avx2(const snow3g_key_schedule_t *pCtx, - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); +snow3g_f8_n_buffer_avx2(const snow3g_key_schedule_t *pCtx, const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f8_n_buffer_multikey_avx2(const snow3g_key_schedule_t * const pCtx[], - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); +snow3g_f8_n_buffer_multikey_avx2(const snow3g_key_schedule_t *const pCtx[], const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f9_1_buffer_avx2(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest); +snow3g_f9_1_buffer_avx2(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + const uint64_t lengthInBits, void *pDigest); size_t snow3g_key_sched_size_avx2(void); @@ -529,114 +304,59 @@ snow3g_init_key_sched_avx2(const void *pKey, snow3g_key_schedule_t *pCtx); ******************************************************************************/ void -snow3g_f8_1_buffer_bit_avx512(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t cipherLengthInBits, - const uint32_t offsetInBits); - -void -snow3g_f8_1_buffer_avx512(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t lengthInBytes); - -void -snow3g_f8_2_buffer_avx512(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2); - -void -snow3g_f8_4_buffer_avx512(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4); - -void -snow3g_f8_8_buffer_avx512(const snow3g_key_schedule_t *pCtx, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pIV5, - const void *pIV6, - const void *pIV7, - const void *pIV8, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4, - const void *pBufferIn5, - void *pBufferOut5, - const uint32_t lengthInBytes5, - const void *pBufferIn6, - void *pBufferOut6, - const uint32_t lengthInBytes6, - const void *pBufferIn7, - void *pBufferOut7, - const uint32_t lengthInBytes7, - const void *pBufferIn8, - void *pBufferOut8, - const uint32_t lengthInBytes8); - -void -snow3g_f8_8_buffer_multikey_avx512(const snow3g_key_schedule_t * const pCtx[], - const void * const pIV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t lengthInBytes[]); - -void -snow3g_f8_n_buffer_avx512(const snow3g_key_schedule_t *pCtx, - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], - const uint32_t bufferCount); - -void -snow3g_f8_n_buffer_multikey_avx512(const snow3g_key_schedule_t * const pCtx[], - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufferLenInBytes[], +snow3g_f8_1_buffer_bit_avx512(const snow3g_key_schedule_t *pCtx, const void *pIV, + const void *pBufferIn, void *pBufferOut, + const uint32_t cipherLengthInBits, const uint32_t offsetInBits); + +void +snow3g_f8_1_buffer_avx512(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + void *pBufferOut, const uint32_t lengthInBytes); + +void +snow3g_f8_2_buffer_avx512(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2); + +void +snow3g_f8_4_buffer_avx512(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4); + +void +snow3g_f8_8_buffer_avx512(const snow3g_key_schedule_t *pCtx, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pIV5, const void *pIV6, + const void *pIV7, const void *pIV8, const void *pBufferIn1, + void *pBufferOut1, const uint32_t lengthInBytes1, const void *pBufferIn2, + void *pBufferOut2, const uint32_t lengthInBytes2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes4, const void *pBufferIn5, + void *pBufferOut5, const uint32_t lengthInBytes5, const void *pBufferIn6, + void *pBufferOut6, const uint32_t lengthInBytes6, const void *pBufferIn7, + void *pBufferOut7, const uint32_t lengthInBytes7, const void *pBufferIn8, + void *pBufferOut8, const uint32_t lengthInBytes8); + +void +snow3g_f8_8_buffer_multikey_avx512(const snow3g_key_schedule_t *const pCtx[], + const void *const pIV[], const void *const pBufferIn[], + void *pBufferOut[], const uint32_t lengthInBytes[]); + +void +snow3g_f8_n_buffer_avx512(const snow3g_key_schedule_t *pCtx, const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufferLenInBytes[], const uint32_t bufferCount); + +void +snow3g_f8_n_buffer_multikey_avx512(const snow3g_key_schedule_t *const pCtx[], + const void *const IV[], const void *const pBufferIn[], + void *pBufferOut[], const uint32_t bufferLenInBytes[], const uint32_t bufferCount); void -snow3g_f9_1_buffer_avx512(const snow3g_key_schedule_t *pCtx, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest); +snow3g_f9_1_buffer_avx512(const snow3g_key_schedule_t *pCtx, const void *pIV, const void *pBufferIn, + const uint64_t lengthInBits, void *pDigest); size_t snow3g_key_sched_size_avx512(void); @@ -645,15 +365,11 @@ int snow3g_init_key_sched_avx512(const void *pKey, snow3g_key_schedule_t *pCtx); void -snow3g_f9_1_buffer_vaes_avx512(const snow3g_key_schedule_t *pHandle, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest); +snow3g_f9_1_buffer_vaes_avx512(const snow3g_key_schedule_t *pHandle, const void *pIV, + const void *pBufferIn, const uint64_t lengthInBits, void *pDigest); uint32_t -snow3g_f9_1_buffer_internal_vaes_avx512(const uint64_t *pBufferIn, - const uint32_t KS[5], +snow3g_f9_1_buffer_internal_vaes_avx512(const uint64_t *pBufferIn, const uint32_t KS[5], const uint64_t lengthInBits); #else /* __aarch64__ */ diff --git a/lib/include/snow3g_common.h b/lib/include/snow3g_common.h index 8d9917fd..6e413719 100644 --- a/lib/include/snow3g_common.h +++ b/lib/include/snow3g_common.h @@ -35,7 +35,7 @@ #ifndef SNOW3G_COMMON_H #define SNOW3G_COMMON_H -#include /* printf() */ +#include /* printf() */ #include /* memset(), memcpy() */ #include @@ -55,23 +55,23 @@ #define CLEAR_MEM clear_mem #define CLEAR_VAR clear_var -#define MAX_KEY_LEN (16) -#define SNOW3G_4_BYTES (4) -#define SNOW3G_8_BYTES (8) -#define SNOW3G_8_BITS (8) +#define MAX_KEY_LEN (16) +#define SNOW3G_4_BYTES (4) +#define SNOW3G_8_BYTES (8) +#define SNOW3G_8_BITS (8) #define SNOW3G_16_BYTES (16) -#define SNOW3G_16_BITS (16) +#define SNOW3G_16_BITS (16) #define SNOW3G_BLOCK_SIZE (8) #define SNOW3G_KEY_LEN_IN_BYTES (16) /* 128b */ -#define SNOW3G_IV_LEN_IN_BYTES (16) /* 128b */ +#define SNOW3G_IV_LEN_IN_BYTES (16) /* 128b */ #define SNOW3GCONSTANT (0x1b) /* Range of input data for SNOW3G is from 1 to 2^32 bits */ -#define SNOW3G_MIN_LEN 1 -#define SNOW3G_MAX_BITLEN (UINT32_MAX) +#define SNOW3G_MIN_LEN 1 +#define SNOW3G_MAX_BITLEN (UINT32_MAX) #define SNOW3G_MAX_BYTELEN (UINT32_MAX / 8) typedef union SafeBuffer { @@ -118,7 +118,7 @@ length_find_min(const uint32_t *out_array, const size_t dim_array) uint32_t min = 0; if (dim_array > 0) - min = out_array[0]; + min = out_array[0]; for (i = 1; i < dim_array; i++) if (out_array[i] < min) @@ -156,11 +156,10 @@ length_check(const uint32_t *out_array, const size_t dim_array) } for (i = 0; i < dim_array; i++) { - if ((out_array[i] == 0) || - (out_array[i] > SNOW3G_MAX_BYTELEN)) { + if ((out_array[i] == 0) || (out_array[i] > SNOW3G_MAX_BYTELEN)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return 0; - } + } } return 1; @@ -170,8 +169,7 @@ length_check(const uint32_t *out_array, const size_t dim_array) * @brief Copies 4 32-bit length values into an array */ static inline void -length_copy_4(uint32_t *out_array, - const uint32_t length1, const uint32_t length2, +length_copy_4(uint32_t *out_array, const uint32_t length1, const uint32_t length2, const uint32_t length3, const uint32_t length4) { out_array[0] = length1; @@ -184,11 +182,9 @@ length_copy_4(uint32_t *out_array, * @brief Copies 8 32-bit length values into an array */ static inline void -length_copy_8(uint32_t *out_array, - const uint32_t length1, const uint32_t length2, - const uint32_t length3, const uint32_t length4, - const uint32_t length5, const uint32_t length6, - const uint32_t length7, const uint32_t length8) +length_copy_8(uint32_t *out_array, const uint32_t length1, const uint32_t length2, + const uint32_t length3, const uint32_t length4, const uint32_t length5, + const uint32_t length6, const uint32_t length7, const uint32_t length8) { out_array[0] = length1; out_array[1] = length2; @@ -230,9 +226,7 @@ ptr_check(void *out_array[], const size_t dim_array, const int errnum) * @retval 1 all OK */ static inline int -cptr_check(const void * const out_array[], - const size_t dim_array, - const int errnum) +cptr_check(const void *const out_array[], const size_t dim_array, const int errnum) { size_t i; @@ -254,8 +248,7 @@ cptr_check(const void * const out_array[], * @brief Copies 4 pointers into an array */ static inline void -ptr_copy_4(void *out_array[], - void *ptr1, void *ptr2, void *ptr3, void *ptr4) +ptr_copy_4(void *out_array[], void *ptr1, void *ptr2, void *ptr3, void *ptr4) { out_array[0] = ptr1; out_array[1] = ptr2; @@ -267,9 +260,8 @@ ptr_copy_4(void *out_array[], * @brief Copies 4 const pointers into an array */ static inline void -cptr_copy_4(const void *out_array[], - const void *ptr1, const void *ptr2, - const void *ptr3, const void *ptr4) +cptr_copy_4(const void *out_array[], const void *ptr1, const void *ptr2, const void *ptr3, + const void *ptr4) { out_array[0] = ptr1; out_array[1] = ptr2; @@ -281,9 +273,8 @@ cptr_copy_4(const void *out_array[], * @brief Copies 8 pointers into an array */ static inline void -ptr_copy_8(void *out_array[], - void *ptr1, void *ptr2, void *ptr3, void *ptr4, - void *ptr5, void *ptr6, void *ptr7, void *ptr8) +ptr_copy_8(void *out_array[], void *ptr1, void *ptr2, void *ptr3, void *ptr4, void *ptr5, + void *ptr6, void *ptr7, void *ptr8) { out_array[0] = ptr1; out_array[1] = ptr2; @@ -299,11 +290,9 @@ ptr_copy_8(void *out_array[], * @brief Copies 8 const pointers into an array */ static inline void -cptr_copy_8(const void *out_array[], - const void *ptr1, const void *ptr2, - const void *ptr3, const void *ptr4, - const void *ptr5, const void *ptr6, - const void *ptr7, const void *ptr8) +cptr_copy_8(const void *out_array[], const void *ptr1, const void *ptr2, const void *ptr3, + const void *ptr4, const void *ptr5, const void *ptr6, const void *ptr7, + const void *ptr8) { out_array[0] = ptr1; out_array[1] = ptr2; @@ -322,7 +311,8 @@ cptr_copy_8(const void *out_array[], * @param[in] lo pointer to 128-bit vector (low) * @return 256-bit vector */ -static inline __m256i load_2xm128i_into_m256i(const void *hi, const void *lo) +static inline __m256i +load_2xm128i_into_m256i(const void *hi, const void *lo) { const __m128i lo128 = _mm_loadu_si128((const __m128i *) lo); const __m128i hi128 = _mm_loadu_si128((const __m128i *) hi); @@ -335,9 +325,10 @@ static inline __m256i load_2xm128i_into_m256i(const void *hi, const void *lo) * @param[in] ptr pointer to a 128-bit vector * @return 256-bit vector */ -static inline __m256i broadcast_m128i_to_m256i(const void *ptr) +static inline __m256i +broadcast_m128i_to_m256i(const void *ptr) { - return _mm256_castps_si256(_mm256_broadcast_ps((const __m128 *)ptr)); + return _mm256_castps_si256(_mm256_broadcast_ps((const __m128 *) ptr)); } #endif /* AVX2 */ @@ -347,7 +338,8 @@ static inline __m256i broadcast_m128i_to_m256i(const void *ptr) * @param[in] lut pointer to a 256x8-bit table * @return 16x8-bit values looked in \a lut using 16x8-bit \a indexes */ -static inline __m128i lut16x8b_256(const __m128i indexes, const void *lut) +static inline __m128i +lut16x8b_256(const __m128i indexes, const void *lut) { #if defined(AVX2) || defined(AVX) return lookup_16x8bit_avx(indexes, lut); @@ -360,7 +352,8 @@ static inline __m128i lut16x8b_256(const __m128i indexes, const void *lut) * @brief LFSR array shift by 2 positions * @param[in/out] pCtx key state context structure */ -static inline void ShiftTwiceLFSR_1(snow3gKeyState1_t *pCtx) +static inline void +ShiftTwiceLFSR_1(snow3gKeyState1_t *pCtx) { int i; @@ -404,10 +397,10 @@ static inline void ShiftTwiceLFSR_1(snow3gKeyState1_t *pCtx) * * @return corrected \a mixc for SNOW3G S2, 4 x 32-bit words */ -static inline __m128i s2_mixc_fixup_4(const __m128i no_mixc, const __m128i mixc) +static inline __m128i +s2_mixc_fixup_4(const __m128i no_mixc, const __m128i mixc) { - const __m128i m_shuf = _mm_set_epi32(0x0c0f0e0d, 0x080b0a09, - 0x04070605, 0x00030201); + const __m128i m_shuf = _mm_set_epi32(0x0c0f0e0d, 0x080b0a09, 0x04070605, 0x00030201); const __m128i m_zero = _mm_setzero_si128(); const __m128i m_mask = _mm_set1_epi32(0x72727272); __m128i pattern, pattern_shuf, fixup; @@ -427,11 +420,8 @@ static inline __m128i s2_mixc_fixup_4(const __m128i no_mixc, const __m128i mixc) static inline __m256i s2_mixc_fixup_avx2(const __m256i no_mixc, const __m256i mixc) { - const __m256i m_shuf = - _mm256_set_epi32(0x0c0f0e0d, 0x080b0a09, - 0x04070605, 0x00030201, - 0x0c0f0e0d, 0x080b0a09, - 0x04070605, 0x00030201); + const __m256i m_shuf = _mm256_set_epi32(0x0c0f0e0d, 0x080b0a09, 0x04070605, 0x00030201, + 0x0c0f0e0d, 0x080b0a09, 0x04070605, 0x00030201); const __m256i m_zero = _mm256_setzero_si256(); const __m256i m_mask = _mm256_set1_epi32(0x72727272); __m256i pattern, pattern_shuf, fixup; @@ -470,15 +460,15 @@ s2_mixc_fixup_scalar(const __m128i no_mixc, const __m128i mixc) * * @return \a x transformed through S1 box */ -static inline uint32_t S1_box(const uint32_t x) +static inline uint32_t +S1_box(const uint32_t x) { #ifdef NO_AESNI union xmm_reg key, v; key.qword[0] = key.qword[1] = 0; - v.dword[0] = v.dword[1] = - v.dword[2] = v.dword[3] = x; + v.dword[0] = v.dword[1] = v.dword[2] = v.dword[3] = x; emulate_AESENC(&v, &key); return v.dword[0]; @@ -501,7 +491,8 @@ static inline uint32_t S1_box(const uint32_t x) * @param[in] x1 32-bit word to be passed through S1 box * @param[in] x2 32-bit word to be passed through S1 box */ -static inline void S1_box_2(uint32_t *x1, uint32_t *x2) +static inline void +S1_box_2(uint32_t *x1, uint32_t *x2) { #ifdef NO_AESNI /* reuse S1_box() for NO_AESNI path */ @@ -527,10 +518,10 @@ static inline void S1_box_2(uint32_t *x1, uint32_t *x2) * * @return 4x32-bits from \a x transformed through S1 box */ -static inline __m128i S1_box_4(const __m128i x) +static inline __m128i +S1_box_4(const __m128i x) { - const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, - 0x0b0e0104, 0x070a0d00); + const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, 0x0b0e0104, 0x070a0d00); const __m128i m1 = _mm_shuffle_epi8(x, m_shuf_r); const __m128i m_zero = _mm_setzero_si128(); @@ -563,13 +554,13 @@ static inline __m128i S1_box_4(const __m128i x) * * @return 8x32-bits from \a x transformed through S1 box */ -static inline __m256i S1_box_8(const __m256i x) +static inline __m256i +S1_box_8(const __m256i x) { const __m128i x1 = _mm256_castsi256_si128(x); const __m128i x2 = _mm256_extractf128_si256(x, 1); const __m128i m_zero = _mm_setzero_si128(); - const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, - 0x0b0e0104, 0x070a0d00); + const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, 0x0b0e0104, 0x070a0d00); __m128i m1, m2; m1 = _mm_shuffle_epi8(x1, m_shuf_r); @@ -590,43 +581,38 @@ static inline __m256i S1_box_8(const __m256i x) * * @return \a x transformed through S2 box */ -static inline uint32_t S2_box(const uint32_t x) +static inline uint32_t +S2_box(const uint32_t x) { #ifdef NO_AESNI /* Perform invSR(SQ(x)) transform */ - const __m128i par_lut = - lut16x8b_256(_mm_cvtsi32_si128(x), snow3g_invSR_SQ); + const __m128i par_lut = lut16x8b_256(_mm_cvtsi32_si128(x), snow3g_invSR_SQ); const uint32_t new_x = _mm_cvtsi128_si32(par_lut); union xmm_reg key, v, v_fixup; key.qword[0] = key.qword[1] = 0; - v.dword[0] = v.dword[1] = - v.dword[2] = v.dword[3] = new_x; + v.dword[0] = v.dword[1] = v.dword[2] = v.dword[3] = new_x; v_fixup = v; emulate_AESENC(&v, &key); emulate_AESENCLAST(&v_fixup, &key); - const __m128i ret_mixc = - _mm_loadu_si128((const __m128i *) &v.qword[0]); - const __m128i ret_nomixc = - _mm_loadu_si128((const __m128i *) &v_fixup.qword[0]); + const __m128i ret_mixc = _mm_loadu_si128((const __m128i *) &v.qword[0]); + const __m128i ret_nomixc = _mm_loadu_si128((const __m128i *) &v_fixup.qword[0]); return s2_mixc_fixup_scalar(ret_nomixc, ret_mixc); #else #ifndef SAFE_LOOKUP - const uint8_t *w3 = (const uint8_t *)&snow3g_table_S2[x & 0xff]; - const uint8_t *w1 = (const uint8_t *)&snow3g_table_S2[(x >> 16) & 0xff]; - const uint8_t *w2 = (const uint8_t *)&snow3g_table_S2[(x >> 8) & 0xff]; - const uint8_t *w0 = (const uint8_t *)&snow3g_table_S2[(x >> 24) & 0xff]; + const uint8_t *w3 = (const uint8_t *) &snow3g_table_S2[x & 0xff]; + const uint8_t *w1 = (const uint8_t *) &snow3g_table_S2[(x >> 16) & 0xff]; + const uint8_t *w2 = (const uint8_t *) &snow3g_table_S2[(x >> 8) & 0xff]; + const uint8_t *w0 = (const uint8_t *) &snow3g_table_S2[(x >> 24) & 0xff]; - return *((const uint32_t *)&w3[3]) ^ - *((const uint32_t *)&w1[1]) ^ - *((const uint32_t *)&w2[2]) ^ - *((const uint32_t *)&w0[0]); + return *((const uint32_t *) &w3[3]) ^ *((const uint32_t *) &w1[1]) ^ + *((const uint32_t *) &w2[2]) ^ *((const uint32_t *) &w0[0]); #else /* @@ -634,8 +620,7 @@ static inline uint32_t S2_box(const uint32_t x) * broadcasted across the 128-bit vector register for S1/AESENC */ /* Perform invSR(SQ(x)) transform */ - const __m128i par_lut = - lut16x8b_256(_mm_cvtsi32_si128(x), snow3g_invSR_SQ); + const __m128i par_lut = lut16x8b_256(_mm_cvtsi32_si128(x), snow3g_invSR_SQ); const __m128i m = _mm_shuffle_epi32(par_lut, 0); /* @@ -643,10 +628,8 @@ static inline uint32_t S2_box(const uint32_t x) * allows to determine the fix-up value to be applied * on result of aesenc to produce correct result for SNOW3G. */ - const __m128i ret_nomixc = - _mm_aesenclast_si128(m, _mm_setzero_si128()); - const __m128i ret_mixc = - _mm_aesenc_si128(m, _mm_setzero_si128()); + const __m128i ret_nomixc = _mm_aesenclast_si128(m, _mm_setzero_si128()); + const __m128i ret_mixc = _mm_aesenc_si128(m, _mm_setzero_si128()); return s2_mixc_fixup_scalar(ret_nomixc, ret_mixc); #endif @@ -660,7 +643,8 @@ static inline uint32_t S2_box(const uint32_t x) * @param[in/out] x1 32-bit word to be passed through S2 box * @param[in/out] x2 32-bit word to be passed through S2 box */ -static inline void S2_box_2(uint32_t *x1, uint32_t *x2) +static inline void +S2_box_2(uint32_t *x1, uint32_t *x2) { #ifdef NO_AESNI *x1 = S2_box(*x1); @@ -713,11 +697,11 @@ static inline void S2_box_2(uint32_t *x1, uint32_t *x2) * * @return 4x32-bits from \a x transformed through S2 box */ -static inline __m128i S2_box_4(const __m128i x) +static inline __m128i +S2_box_4(const __m128i x) { const __m128i m_zero = _mm_setzero_si128(); - const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, - 0x0b0e0104, 0x070a0d00); + const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, 0x0b0e0104, 0x070a0d00); /* Perform invSR(SQ(x)) transform through a lookup table */ const __m128i new_x = lut16x8b_256(x, snow3g_invSR_SQ); @@ -752,7 +736,8 @@ static inline __m128i S2_box_4(const __m128i x) * @param[in/out] in_out1 vector of 4 32-bit words to be passed through S2 box * @param[in/out] in_out2 vector of 4 32-bit words to be passed through S2 box */ -static inline void S2_box_2x4(__m128i *in_out1, __m128i *in_out2) +static inline void +S2_box_2x4(__m128i *in_out1, __m128i *in_out2) { #ifdef NO_AESNI *in_out1 = S2_box_4(*in_out1); @@ -765,8 +750,7 @@ static inline void S2_box_2x4(__m128i *in_out1, __m128i *in_out2) const __m128i m_zero = _mm_setzero_si128(); const __m128i x1 = lut16x8b_256(*in_out1, snow3g_invSR_SQ); const __m128i x2 = lut16x8b_256(*in_out2, snow3g_invSR_SQ); - const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, - 0x0b0e0104, 0x070a0d00); + const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, 0x0b0e0104, 0x070a0d00); __m128i m1, m2, f1, f2; m1 = _mm_shuffle_epi8(x1, m_shuf_r); @@ -790,7 +774,8 @@ static inline void S2_box_2x4(__m128i *in_out1, __m128i *in_out2) * * @return 8x32-bits from \a x transformed through S2 box */ -static inline __m256i S2_box_8(const __m256i x) +static inline __m256i +S2_box_8(const __m256i x) { /* Perform invSR(SQ(x)) transform through a lookup table */ const __m256i new_x = lookup_32x8bit_avx2(x, snow3g_invSR_SQ); @@ -799,8 +784,7 @@ static inline __m256i S2_box_8(const __m256i x) const __m128i m_zero = _mm_setzero_si128(); const __m128i x1 = (__m128i) _mm256_castsi256_si128(new_x); const __m128i x2 = (__m128i) _mm256_extractf128_si256(new_x, 1); - const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, - 0x0b0e0104, 0x070a0d00); + const __m128i m_shuf_r = _mm_set_epi32(0x0306090c, 0x0f020508, 0x0b0e0104, 0x070a0d00); __m128i m1, m2, f1, f2; __m256i m, f; @@ -835,23 +819,22 @@ static inline __m256i S2_box_8(const __m256i x) * @param [in] L0 4 x 32-bit LFSR[0] * @return 4 x 32-bit MULalpha(L0 >> 24) */ -static inline -__m128i MULa_4(const __m128i L0) +static inline __m128i +MULa_4(const __m128i L0) { #ifdef SAFE_LOOKUP - const __m128i gather_clear_mask = - _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 15, 11, 7, 3); + const __m128i gather_clear_mask = _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 15, 11, 7, 3); const __m128i low_nibble_mask = _mm_set1_epi32(0x0f0f0f0f); __m128i b0, b1, b2, b3, tl, th; th = _mm_shuffle_epi8(L0, gather_clear_mask); tl = _mm_and_si128(th, low_nibble_mask); - b0 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte0_low); - b1 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte1_low); - b2 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte2_low); - b3 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte3_low); + b0 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte0_low); + b1 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte1_low); + b2 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte2_low); + b3 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte3_low); b0 = _mm_shuffle_epi8(b0, tl); b1 = _mm_shuffle_epi8(b1, tl); @@ -862,10 +845,10 @@ __m128i MULa_4(const __m128i L0) b2 = _mm_unpacklo_epi8(b2, b3); tl = _mm_unpacklo_epi16(b0, b2); - b0 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte0_hi); - b1 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte1_hi); - b2 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte2_hi); - b3 = _mm_loadu_si128((const __m128i *)snow3g_MULa_byte3_hi); + b0 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte0_hi); + b1 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte1_hi); + b2 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte2_hi); + b3 = _mm_loadu_si128((const __m128i *) snow3g_MULa_byte3_hi); th = _mm_and_si128(_mm_srli_epi32(th, 4), low_nibble_mask); @@ -885,10 +868,8 @@ __m128i MULa_4(const __m128i L0) const uint8_t L0IDX2 = _mm_extract_epi8(L0, 11); const uint8_t L0IDX3 = _mm_extract_epi8(L0, 15); - return _mm_setr_epi32(snow3g_table_A_mul[L0IDX0], - snow3g_table_A_mul[L0IDX1], - snow3g_table_A_mul[L0IDX2], - snow3g_table_A_mul[L0IDX3]); + return _mm_setr_epi32(snow3g_table_A_mul[L0IDX0], snow3g_table_A_mul[L0IDX1], + snow3g_table_A_mul[L0IDX2], snow3g_table_A_mul[L0IDX3]); #endif } @@ -900,8 +881,8 @@ __m128i MULa_4(const __m128i L0) * @param [in/out] L0_2 On input, 32-bit LFSR[0]. * On output, 32-bit MULalpha(L0 >> 24) */ -static inline -void MULa_2(uint32_t *L0_1, uint32_t *L0_2) +static inline void +MULa_2(uint32_t *L0_1, uint32_t *L0_2) { #ifdef SAFE_LOOKUP __m128i in, out; @@ -924,8 +905,8 @@ void MULa_2(uint32_t *L0_1, uint32_t *L0_2) * @param [in] L0 32-bit LFSR[0] * @return 32-bit MULalpha(L0 >> 24) */ -static inline -uint32_t MULa(const uint32_t L0) +static inline uint32_t +MULa(const uint32_t L0) { #ifdef SAFE_LOOKUP const __m128i L0_vec = _mm_cvtsi32_si128(L0); @@ -950,8 +931,8 @@ uint32_t MULa(const uint32_t L0) * @param [in] L0 8 x 32-bit LFSR[0] * @return 8 x 32-bit MULalpha(L0 >> 24) */ -static inline -__m256i MULa_8(const __m256i L0) +static inline __m256i +MULa_8(const __m256i L0) { #ifdef SAFE_LOOKUP const __m256i byte0_mask = _mm256_set1_epi64x(0x000000ff000000ffULL); @@ -959,10 +940,9 @@ __m256i MULa_8(const __m256i L0) const __m256i byte2_mask = _mm256_set1_epi64x(0x00ff000000ff0000ULL); const __m256i byte3_mask = _mm256_set1_epi64x(0xff000000ff000000ULL); const __m256i gather_clear_mask = - _mm256_set_epi8(0x0f, 0x0f, 0x0f, 0x0f, 0x0b, 0x0b, 0x0b, 0x0b, - 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, 0x03, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0b, 0x0b, 0x0b, 0x0b, - 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, 0x03); + _mm256_set_epi8(0x0f, 0x0f, 0x0f, 0x0f, 0x0b, 0x0b, 0x0b, 0x0b, 0x07, 0x07, 0x07, + 0x07, 0x03, 0x03, 0x03, 0x03, 0x0f, 0x0f, 0x0f, 0x0f, 0x0b, 0x0b, + 0x0b, 0x0b, 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, 0x03); const __m256i low_nibble_mask = _mm256_set1_epi32(0x0f0f0f0f); __m256i b0, b1, b2, b3, tl, th; @@ -1012,13 +992,10 @@ __m256i MULa_8(const __m256i L0) return _mm256_xor_si256(th, tl); #else - static const __m256i mask = { - 0x8080800780808003ULL, 0x8080800F8080800BULL, - 0x8080800780808003ULL, 0x8080800F8080800BULL - }; + static const __m256i mask = { 0x8080800780808003ULL, 0x8080800F8080800BULL, + 0x8080800780808003ULL, 0x8080800F8080800BULL }; - return _mm256_i32gather_epi32(snow3g_table_A_mul, - _mm256_shuffle_epi8(L0, mask), 4); + return _mm256_i32gather_epi32(snow3g_table_A_mul, _mm256_shuffle_epi8(L0, mask), 4); #endif } #endif /* AVX2 */ @@ -1036,23 +1013,23 @@ __m256i MULa_8(const __m256i L0) * @param [in] L11 4 x 32-bit LFSR[11] * @return 4 x 32-bit DIValpha(L11 & 0xff) */ -static inline -__m128i DIVa_4(const __m128i L11) +static inline __m128i +DIVa_4(const __m128i L11) { #ifdef SAFE_LOOKUP const __m128i gather_clear_mask = - _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x0c, 0x08, 0x04, 0x00); + _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x0c, 0x08, 0x04, 0x00); const __m128i low_nibble_mask = _mm_set1_epi32(0x0f0f0f0f); __m128i b0, b1, b2, b3, tl, th; th = _mm_shuffle_epi8(L11, gather_clear_mask); tl = _mm_and_si128(th, low_nibble_mask); - b0 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte0_low); - b1 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte1_low); - b2 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte2_low); - b3 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte3_low); + b0 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte0_low); + b1 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte1_low); + b2 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte2_low); + b3 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte3_low); b0 = _mm_shuffle_epi8(b0, tl); b1 = _mm_shuffle_epi8(b1, tl); @@ -1063,10 +1040,10 @@ __m128i DIVa_4(const __m128i L11) b2 = _mm_unpacklo_epi8(b2, b3); tl = _mm_unpacklo_epi16(b0, b2); - b0 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte0_hi); - b1 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte1_hi); - b2 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte2_hi); - b3 = _mm_loadu_si128((const __m128i *)snow3g_DIVa_byte3_hi); + b0 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte0_hi); + b1 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte1_hi); + b2 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte2_hi); + b3 = _mm_loadu_si128((const __m128i *) snow3g_DIVa_byte3_hi); th = _mm_and_si128(_mm_srli_epi32(th, 4), low_nibble_mask); @@ -1086,10 +1063,8 @@ __m128i DIVa_4(const __m128i L11) const uint8_t L11IDX2 = _mm_extract_epi8(L11, 8); const uint8_t L11IDX3 = _mm_extract_epi8(L11, 12); - return _mm_setr_epi32(snow3g_table_A_div[L11IDX0], - snow3g_table_A_div[L11IDX1], - snow3g_table_A_div[L11IDX2], - snow3g_table_A_div[L11IDX3]); + return _mm_setr_epi32(snow3g_table_A_div[L11IDX0], snow3g_table_A_div[L11IDX1], + snow3g_table_A_div[L11IDX2], snow3g_table_A_div[L11IDX3]); #endif } @@ -1101,8 +1076,8 @@ __m128i DIVa_4(const __m128i L11) * @param [in/out] L11_2 On input, 32-bit LFSR[11]. * On output, 32-bit DIValpha(L11 & 0xff) */ -static inline -void DIVa_2(uint32_t *L11_1, uint32_t *L11_2) +static inline void +DIVa_2(uint32_t *L11_1, uint32_t *L11_2) { #ifdef SAFE_LOOKUP __m128i in, out; @@ -1125,8 +1100,8 @@ void DIVa_2(uint32_t *L11_1, uint32_t *L11_2) * @param [in] L11 32-bit LFSR[11] * @return 32-bit DIValpha(L11 & 0xff) */ -static inline -uint32_t DIVa(const uint32_t L11) +static inline uint32_t +DIVa(const uint32_t L11) { #ifdef SAFE_LOOKUP const __m128i L11_vec = _mm_cvtsi32_si128(L11); @@ -1151,8 +1126,8 @@ uint32_t DIVa(const uint32_t L11) * @param [in] L11 8 x 32-bit LFSR[11] * @return 8 x 32-bit DIValpha(L11 & 0xff) */ -static inline -__m256i DIVa_8(const __m256i L11) +static inline __m256i +DIVa_8(const __m256i L11) { #ifdef SAFE_LOOKUP const __m256i byte0_mask = _mm256_set1_epi64x(0x000000ff000000ffULL); @@ -1160,10 +1135,9 @@ __m256i DIVa_8(const __m256i L11) const __m256i byte2_mask = _mm256_set1_epi64x(0x00ff000000ff0000ULL); const __m256i byte3_mask = _mm256_set1_epi64x(0xff000000ff000000ULL); const __m256i gather_clear_mask = - _mm256_set_epi8(0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x08, 0x08, 0x08, - 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x08, 0x08, 0x08, - 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00); + _mm256_set_epi8(0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x08, + 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00); const __m256i low_nibble_mask = _mm256_set1_epi32(0x0f0f0f0f); __m256i b0, b1, b2, b3, tl, th; @@ -1213,13 +1187,10 @@ __m256i DIVa_8(const __m256i L11) return _mm256_xor_si256(th, tl); #else - static const __m256i mask = { - 0x8080800480808000ULL, 0x8080800C80808008ULL, - 0x8080800480808000ULL, 0x8080800C80808008ULL - }; + static const __m256i mask = { 0x8080800480808000ULL, 0x8080800C80808008ULL, + 0x8080800480808000ULL, 0x8080800C80808008ULL }; - return _mm256_i32gather_epi32(snow3g_table_A_div, - _mm256_shuffle_epi8(L11, mask), 4); + return _mm256_i32gather_epi32(snow3g_table_A_div, _mm256_shuffle_epi8(L11, mask), 4); #endif } #endif /* AVX2 */ @@ -1232,7 +1203,8 @@ __m256i DIVa_8(const __m256i L11) * * @param[in/out] pCtx context structure */ -static inline uint32_t ClockFSM_1(snow3gKeyState1_t *pCtx) +static inline uint32_t +ClockFSM_1(snow3gKeyState1_t *pCtx) { const uint32_t F = (pCtx->LFSR_S[15] + pCtx->FSM_R1) ^ pCtx->FSM_R2; const uint32_t R = (pCtx->FSM_R3 ^ pCtx->LFSR_S[5]) + pCtx->FSM_R2; @@ -1248,15 +1220,12 @@ static inline uint32_t ClockFSM_1(snow3gKeyState1_t *pCtx) * @brief ClockLFSR function as defined in SNOW3G standard * @param[in/out] pCtx context structure */ -static inline void ClockLFSR_1(snow3gKeyState1_t *pCtx) +static inline void +ClockLFSR_1(snow3gKeyState1_t *pCtx) { const uint32_t S0 = pCtx->LFSR_S[0]; const uint32_t S11 = pCtx->LFSR_S[11]; - const uint32_t V = pCtx->LFSR_S[2] ^ - MULa(S0) ^ - DIVa(S11) ^ - (S0 << 8) ^ - (S11 >> 8); + const uint32_t V = pCtx->LFSR_S[2] ^ MULa(S0) ^ DIVa(S11) ^ (S0 << 8) ^ (S11 >> 8); unsigned i; /* LFSR array shift by 1 position */ @@ -1274,8 +1243,7 @@ static inline void ClockLFSR_1(snow3gKeyState1_t *pCtx) * @param[in] pIV IV */ static inline void -snow3gStateInitialize_1(snow3gKeyState1_t *pCtx, - const snow3g_key_schedule_t *pKeySched, +snow3gStateInitialize_1(snow3gKeyState1_t *pCtx, const snow3g_key_schedule_t *pKeySched, const void *pIV) { uint32_t FSM1, FSM2, FSM3; @@ -1317,19 +1285,15 @@ snow3gStateInitialize_1(snow3gKeyState1_t *pCtx, DIVa_2(&DIVa_L11, &DIVa_L12); /* clock FSM + clock LFSR + clockFSM + clock LFSR */ - const uint32_t F0 = - (pCtx->LFSR_S[15] + FSM1) ^ FSM2; /* (s15 + R1) ^ R2 */ + const uint32_t F0 = (pCtx->LFSR_S[15] + FSM1) ^ FSM2; /* (s15 + R1) ^ R2 */ - const uint32_t V0 = - pCtx->LFSR_S[2] ^ - MULa_L0 ^ /* MUL(s0,0 ) */ - DIVa_L11 ^ /* DIV(s11,3 )*/ - (L0 << 8) ^ /* (s0,1 || s0,2 || s0,3 || 0x00) */ - (L11 >> 8) ^ /* (0x00 || s11,0 || s11,1 || s11,2 ) */ - F0; + const uint32_t V0 = pCtx->LFSR_S[2] ^ MULa_L0 ^ /* MUL(s0,0 ) */ + DIVa_L11 ^ /* DIV(s11,3 )*/ + (L0 << 8) ^ /* (s0,1 || s0,2 || s0,3 || 0x00) */ + (L11 >> 8) ^ /* (0x00 || s11,0 || s11,1 || s11,2 ) */ + F0; - const uint32_t R0 = - (FSM3 ^ pCtx->LFSR_S[5]) + FSM2; /* R2 + (R3 ^ s5 ) */ + const uint32_t R0 = (FSM3 ^ pCtx->LFSR_S[5]) + FSM2; /* R2 + (R3 ^ s5 ) */ uint32_t s1_box_step1 = FSM1; uint32_t s1_box_step2 = R0; @@ -1345,10 +1309,8 @@ snow3gStateInitialize_1(snow3gKeyState1_t *pCtx, const uint32_t F1 = (V0 + R0) ^ s1_box_step1; - const uint32_t V1 = pCtx->LFSR_S[3] ^ - MULa_L1 ^ - DIVa_L12 ^ - (L1 << 8) ^ (L12 >> 8) ^ F1; + const uint32_t V1 = + pCtx->LFSR_S[3] ^ MULa_L1 ^ DIVa_L12 ^ (L1 << 8) ^ (L12 >> 8) ^ F1; FSM2 = s1_box_step2; FSM3 = s2_box_step2; @@ -1372,8 +1334,8 @@ snow3gStateInitialize_1(snow3gKeyState1_t *pCtx, * @param[in] pCtx Context where the scheduled keys are stored * @param[in/out] pKeyStream Pointer to the generated keystream */ -static inline void snow3g_f9_keystream_words(snow3gKeyState1_t *pCtx, - uint32_t *pKeyStream) +static inline void +snow3g_f9_keystream_words(snow3gKeyState1_t *pCtx, uint32_t *pKeyStream) { int i; @@ -1391,7 +1353,8 @@ static inline void snow3g_f9_keystream_words(snow3gKeyState1_t *pCtx, * @brief LFSR array shift by one (8 lanes) * @param[in] pCtx Context where the scheduled keys are stored */ -static inline void ShiftLFSR_8(snow3gKeyState8_t *pCtx) +static inline void +ShiftLFSR_8(snow3gKeyState8_t *pCtx) { pCtx->iLFSR_X = (pCtx->iLFSR_X + 1) & 15; } @@ -1401,7 +1364,8 @@ static inline void ShiftLFSR_8(snow3gKeyState8_t *pCtx) * @brief LFSR array shift by one (4 lanes) * @param[in] pCtx Context where the scheduled keys are stored */ -static inline void ShiftLFSR_4(snow3gKeyState4_t *pCtx) +static inline void +ShiftLFSR_4(snow3gKeyState4_t *pCtx) { pCtx->iLFSR_X = (pCtx->iLFSR_X + 1) & 15; } @@ -1414,7 +1378,8 @@ static inline void ShiftLFSR_4(snow3gKeyState4_t *pCtx) * @param[in] L11 LFSR[11] * @return table_Alpha_div[LFSR[11] & 0xff] ^ table_Alpha_mul[LFSR[0] & 0xff] */ -static inline __m256i C0_C11_8(const __m256i L0, const __m256i L11) +static inline __m256i +C0_C11_8(const __m256i L0, const __m256i L11) { const __m256i S1 = DIVa_8(L11); const __m256i S2 = MULa_8(L0); @@ -1430,7 +1395,8 @@ static inline __m256i C0_C11_8(const __m256i L0, const __m256i L11) * @param[in] L11 LFSR[11] * @return table_Alpha_div[LFSR[11] & 0xff] ^ table_Alpha_mul[LFSR[0] & 0xff] */ -static inline __m128i C0_C11_4(const __m128i L0, const __m128i L11) +static inline __m128i +C0_C11_4(const __m128i L0, const __m128i L11) { const __m128i SL11 = DIVa_4(L11); const __m128i SL0 = MULa_4(L0); @@ -1448,7 +1414,8 @@ static inline __m128i C0_C11_4(const __m128i L0, const __m128i L11) * * @param[in] pCtx Context where the scheduled keys are stored */ -static inline void ClockLFSR_8(snow3gKeyState8_t *pCtx) +static inline void +ClockLFSR_8(snow3gKeyState8_t *pCtx) { __m256i X2; __m256i S, T, U; @@ -1479,7 +1446,8 @@ static inline void ClockLFSR_8(snow3gKeyState8_t *pCtx) * * @param[in] pCtx Context where the scheduled keys are stored */ -static inline void ClockLFSR_4(snow3gKeyState4_t *pCtx) +static inline void +ClockLFSR_4(snow3gKeyState4_t *pCtx) { __m128i S, T, U; @@ -1506,20 +1474,18 @@ static inline void ClockLFSR_4(snow3gKeyState4_t *pCtx) * @param[in] pCtx Context where the scheduled keys are stored * @return 8 x 4bytes of key stream */ -static inline __m256i ClockFSM_8(snow3gKeyState8_t *pCtx) +static inline __m256i +ClockFSM_8(snow3gKeyState8_t *pCtx) { const uint32_t iLFSR_X_5 = (pCtx->iLFSR_X + 5) & 15; const uint32_t iLFSR_X_15 = (pCtx->iLFSR_X + 15) & 15; - const __m256i F = - _mm256_add_epi32(pCtx->LFSR_X[iLFSR_X_15], pCtx->FSM_X[0]); + const __m256i F = _mm256_add_epi32(pCtx->LFSR_X[iLFSR_X_15], pCtx->FSM_X[0]); const __m256i ret = _mm256_xor_si256(F, pCtx->FSM_X[1]); - const __m256i R = - _mm256_add_epi32(_mm256_xor_si256(pCtx->LFSR_X[iLFSR_X_5], - pCtx->FSM_X[2]), - pCtx->FSM_X[1]); + const __m256i R = _mm256_add_epi32( + _mm256_xor_si256(pCtx->LFSR_X[iLFSR_X_5], pCtx->FSM_X[2]), pCtx->FSM_X[1]); pCtx->FSM_X[2] = S2_box_8(pCtx->FSM_X[1]); pCtx->FSM_X[1] = S1_box_8(pCtx->FSM_X[0]); @@ -1537,16 +1503,13 @@ static inline __m256i ClockFSM_8(snow3gKeyState8_t *pCtx) * @param[in] pCtx Context where the scheduled keys are stored * @return 4 x 4bytes of key stream */ -static inline __m128i ClockFSM_4(snow3gKeyState4_t *pCtx) +static inline __m128i +ClockFSM_4(snow3gKeyState4_t *pCtx) { const uint32_t iLFSR_X = pCtx->iLFSR_X; - const __m128i F = - _mm_add_epi32(pCtx->LFSR_X[(iLFSR_X + 15) & 15], - pCtx->FSM_X[0]); - const __m128i R = - _mm_add_epi32(_mm_xor_si128(pCtx->LFSR_X[(iLFSR_X + 5) & 15], - pCtx->FSM_X[2]), - pCtx->FSM_X[1]); + const __m128i F = _mm_add_epi32(pCtx->LFSR_X[(iLFSR_X + 15) & 15], pCtx->FSM_X[0]); + const __m128i R = _mm_add_epi32( + _mm_xor_si128(pCtx->LFSR_X[(iLFSR_X + 5) & 15], pCtx->FSM_X[2]), pCtx->FSM_X[1]); const __m128i ret = _mm_xor_si128(F, pCtx->FSM_X[1]); @@ -1563,7 +1526,8 @@ static inline __m128i ClockFSM_4(snow3gKeyState4_t *pCtx) * @param[in] pCtx Context where the scheduled keys are stored * @return 4 bytes of key stream */ -static inline uint32_t snow3g_keystream_1_4(snow3gKeyState1_t *pCtx) +static inline uint32_t +snow3g_keystream_1_4(snow3gKeyState1_t *pCtx) { const uint32_t F = ClockFSM_1(pCtx); const uint32_t ks = F ^ pCtx->LFSR_S[0]; @@ -1578,7 +1542,8 @@ static inline uint32_t snow3g_keystream_1_4(snow3gKeyState1_t *pCtx) * @param[in] pCtx Context where the scheduled keys are stored * @return 8 bytes of a key stream */ -static inline uint64_t snow3g_keystream_1_8(snow3gKeyState1_t *pCtx) +static inline uint64_t +snow3g_keystream_1_8(snow3gKeyState1_t *pCtx) { /* * Merged clock FSM + clock LFSR + clock FSM + clockLFSR @@ -1597,24 +1562,12 @@ static inline uint64_t snow3g_keystream_1_8(snow3gKeyState1_t *pCtx) MULa_2(&MULa_L0, &MULa_L1); DIVa_2(&DIVa_L11, &DIVa_L12); - const uint32_t V0 = - pCtx->LFSR_S[2] ^ - MULa_L0 ^ - DIVa_L11 ^ - (L0 << 8) ^ - (L11 >> 8); - - const uint32_t V1 = - pCtx->LFSR_S[3] ^ - MULa_L1 ^ - DIVa_L12 ^ - (L1 << 8) ^ - (L12 >> 8); - - const uint32_t F0 = - (pCtx->LFSR_S[15] + pCtx->FSM_R1) ^ L0 ^ pCtx->FSM_R2; - const uint32_t R0 = - (pCtx->FSM_R3 ^ pCtx->LFSR_S[5]) + pCtx->FSM_R2; + const uint32_t V0 = pCtx->LFSR_S[2] ^ MULa_L0 ^ DIVa_L11 ^ (L0 << 8) ^ (L11 >> 8); + + const uint32_t V1 = pCtx->LFSR_S[3] ^ MULa_L1 ^ DIVa_L12 ^ (L1 << 8) ^ (L12 >> 8); + + const uint32_t F0 = (pCtx->LFSR_S[15] + pCtx->FSM_R1) ^ L0 ^ pCtx->FSM_R2; + const uint32_t R0 = (pCtx->FSM_R3 ^ pCtx->LFSR_S[5]) + pCtx->FSM_R2; uint32_t s1_box_step1 = pCtx->FSM_R1; uint32_t s1_box_step2 = R0; @@ -1655,18 +1608,15 @@ static inline uint64_t snow3g_keystream_1_8(snow3gKeyState1_t *pCtx) * @param[in/out] pKeyStreamLo Pointer to generated key stream * @param[in/out] pKeyStreamHi Pointer to generated key stream */ -static inline void snow3g_keystream_8_8(snow3gKeyState8_t *pCtx, - __m256i *pKeyStreamLo, - __m256i *pKeyStreamHi) +static inline void +snow3g_keystream_8_8(snow3gKeyState8_t *pCtx, __m256i *pKeyStreamLo, __m256i *pKeyStreamHi) { /* first set of 4 bytes */ - const __m256i L = _mm256_xor_si256(ClockFSM_8(pCtx), - pCtx->LFSR_X[pCtx->iLFSR_X]); + const __m256i L = _mm256_xor_si256(ClockFSM_8(pCtx), pCtx->LFSR_X[pCtx->iLFSR_X]); ClockLFSR_8(pCtx); /* second set of 4 bytes */ - const __m256i H = _mm256_xor_si256(ClockFSM_8(pCtx), - pCtx->LFSR_X[pCtx->iLFSR_X]); + const __m256i H = _mm256_xor_si256(ClockFSM_8(pCtx), pCtx->LFSR_X[pCtx->iLFSR_X]); ClockLFSR_8(pCtx); /* merge the 2 sets */ @@ -1680,10 +1630,10 @@ static inline void snow3g_keystream_8_8(snow3gKeyState8_t *pCtx, * @param[in] pCtx Context where the scheduled keys are stored * @return 8 x 4 bytes vaector with key stream data */ -static inline __m256i snow3g_keystream_8_4(snow3gKeyState8_t *pCtx) +static inline __m256i +snow3g_keystream_8_4(snow3gKeyState8_t *pCtx) { - const __m256i keyStream = _mm256_xor_si256(ClockFSM_8(pCtx), - pCtx->LFSR_X[pCtx->iLFSR_X]); + const __m256i keyStream = _mm256_xor_si256(ClockFSM_8(pCtx), pCtx->LFSR_X[pCtx->iLFSR_X]); ClockLFSR_8(pCtx); return keyStream; @@ -1700,50 +1650,34 @@ transpose8xu32_avx2(__m256i in[8], __m256i out[8]) { __m256i tmp[2]; - tmp[0] = (__m256i) _mm256_shuffle_ps((__m256)in[0], (__m256)in[1], - 0x44); - in[0] = (__m256i) _mm256_shuffle_ps((__m256)in[0], (__m256)in[1], - 0xEE); - tmp[1] = (__m256i) _mm256_shuffle_ps((__m256)in[2], (__m256)in[3], - 0x44); - in[2] = (__m256i) _mm256_shuffle_ps((__m256)in[2], (__m256)in[3], - 0xEE); - - in[3] = (__m256i) _mm256_shuffle_ps((__m256)tmp[0],(__m256) tmp[1], - 0xDD); - in[1] = (__m256i) _mm256_shuffle_ps((__m256)in[0], (__m256) in[2], - 0x88); - in[0] = (__m256i) _mm256_shuffle_ps((__m256)in[0], (__m256) in[2], - 0xDD); - tmp[0] = (__m256i) _mm256_shuffle_ps((__m256)tmp[0],(__m256) tmp[1], - 0x88); - - in[2] = (__m256i) _mm256_shuffle_ps((__m256)in[4], (__m256)in[5], - 0x44); - in[4] = (__m256i) _mm256_shuffle_ps((__m256)in[4], (__m256)in[5], - 0xEE); - tmp[1] = (__m256i) _mm256_shuffle_ps((__m256)in[6], (__m256)in[7], - 0x44); - in[6] = (__m256i) _mm256_shuffle_ps((__m256)in[6], (__m256)in[7], - 0xEE); - - in[7] = (__m256i) _mm256_shuffle_ps((__m256)in[2],(__m256) tmp[1], - 0xDD); - in[5] = (__m256i) _mm256_shuffle_ps((__m256)in[4], (__m256) in[6], - 0x88); - in[4] = (__m256i) _mm256_shuffle_ps((__m256)in[4], (__m256) in[6], - 0xDD); - tmp[1] = (__m256i) _mm256_shuffle_ps((__m256)in[2],(__m256) tmp[1], - 0x88); - - out[6] = _mm256_permute2f128_si256(in[5], in[1], 0x13); - out[2] = _mm256_permute2f128_si256(in[5], in[1], 0x02); - out[5] = _mm256_permute2f128_si256(in[7], in[3], 0x13); - out[1] = _mm256_permute2f128_si256(in[7], in[3], 0x02); - out[7] = _mm256_permute2f128_si256(in[4], in[0], 0x13); - out[3] = _mm256_permute2f128_si256(in[4], in[0], 0x02); - out[4] = _mm256_permute2f128_si256(tmp[1], tmp[0], 0x13); - out[0] = _mm256_permute2f128_si256(tmp[1], tmp[0], 0x02); + tmp[0] = (__m256i) _mm256_shuffle_ps((__m256) in[0], (__m256) in[1], 0x44); + in[0] = (__m256i) _mm256_shuffle_ps((__m256) in[0], (__m256) in[1], 0xEE); + tmp[1] = (__m256i) _mm256_shuffle_ps((__m256) in[2], (__m256) in[3], 0x44); + in[2] = (__m256i) _mm256_shuffle_ps((__m256) in[2], (__m256) in[3], 0xEE); + + in[3] = (__m256i) _mm256_shuffle_ps((__m256) tmp[0], (__m256) tmp[1], 0xDD); + in[1] = (__m256i) _mm256_shuffle_ps((__m256) in[0], (__m256) in[2], 0x88); + in[0] = (__m256i) _mm256_shuffle_ps((__m256) in[0], (__m256) in[2], 0xDD); + tmp[0] = (__m256i) _mm256_shuffle_ps((__m256) tmp[0], (__m256) tmp[1], 0x88); + + in[2] = (__m256i) _mm256_shuffle_ps((__m256) in[4], (__m256) in[5], 0x44); + in[4] = (__m256i) _mm256_shuffle_ps((__m256) in[4], (__m256) in[5], 0xEE); + tmp[1] = (__m256i) _mm256_shuffle_ps((__m256) in[6], (__m256) in[7], 0x44); + in[6] = (__m256i) _mm256_shuffle_ps((__m256) in[6], (__m256) in[7], 0xEE); + + in[7] = (__m256i) _mm256_shuffle_ps((__m256) in[2], (__m256) tmp[1], 0xDD); + in[5] = (__m256i) _mm256_shuffle_ps((__m256) in[4], (__m256) in[6], 0x88); + in[4] = (__m256i) _mm256_shuffle_ps((__m256) in[4], (__m256) in[6], 0xDD); + tmp[1] = (__m256i) _mm256_shuffle_ps((__m256) in[2], (__m256) tmp[1], 0x88); + + out[6] = _mm256_permute2f128_si256(in[5], in[1], 0x13); + out[2] = _mm256_permute2f128_si256(in[5], in[1], 0x02); + out[5] = _mm256_permute2f128_si256(in[7], in[3], 0x13); + out[1] = _mm256_permute2f128_si256(in[7], in[3], 0x02); + out[7] = _mm256_permute2f128_si256(in[4], in[0], 0x13); + out[3] = _mm256_permute2f128_si256(in[4], in[0], 0x02); + out[4] = _mm256_permute2f128_si256(tmp[1], tmp[0], 0x13); + out[0] = _mm256_permute2f128_si256(tmp[1], tmp[0], 0x02); } /** @@ -1752,17 +1686,15 @@ transpose8xu32_avx2(__m256i in[8], __m256i out[8]) * @param[in] pCtx Context where the scheduled keys are stored * @param[in/out] pKeyStream Array of generated key streams */ -static inline void snow3g_keystream_8_32(snow3gKeyState8_t *pCtx, - __m256i *pKeyStream) +static inline void +snow3g_keystream_8_32(snow3gKeyState8_t *pCtx, __m256i *pKeyStream) { __m256i in[8]; unsigned int i; /** Byte reversal on each KS */ - static const __m256i mask = { - 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL, - 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL - }; + static const __m256i mask = { 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL, + 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL }; /** produces the next 4 bytes for each buffer */ for (i = 0; i < 8; i++) @@ -1771,8 +1703,6 @@ static inline void snow3g_keystream_8_32(snow3gKeyState8_t *pCtx, /* Transposes the dwords of KS for all buffers into * 32 consecutive KS bytes for each buffer */ transpose8xu32_avx2(in, pKeyStream); - - } #endif /* AVX2 */ @@ -1782,10 +1712,10 @@ static inline void snow3g_keystream_8_32(snow3gKeyState8_t *pCtx, * @param[in] pCtx Context where the scheduled keys are stored * @param[in/out] pKeyStream Pointer to generated key stream */ -static inline __m128i snow3g_keystream_4_4(snow3gKeyState4_t *pCtx) +static inline __m128i +snow3g_keystream_4_4(snow3gKeyState4_t *pCtx) { - const __m128i keyStream = _mm_xor_si128(ClockFSM_4(pCtx), - pCtx->LFSR_X[pCtx->iLFSR_X]); + const __m128i keyStream = _mm_xor_si128(ClockFSM_4(pCtx), pCtx->LFSR_X[pCtx->iLFSR_X]); ClockLFSR_4(pCtx); return keyStream; @@ -1798,9 +1728,8 @@ static inline __m128i snow3g_keystream_4_4(snow3gKeyState4_t *pCtx) * @param[in/out] pKeyStreamLo Pointer to lower end of generated key stream * @param[in/out] pKeyStreamHi Pointer to higher end of generated key stream */ -static inline void snow3g_keystream_4_8(snow3gKeyState4_t *pCtx, - __m128i *pKeyStreamLo, - __m128i *pKeyStreamHi) +static inline void +snow3g_keystream_4_8(snow3gKeyState4_t *pCtx, __m128i *pKeyStreamLo, __m128i *pKeyStreamHi) { const __m128i L0 = pCtx->LFSR_X[pCtx->iLFSR_X]; const __m128i L2 = pCtx->LFSR_X[(pCtx->iLFSR_X + 2) & 15]; @@ -1814,23 +1743,21 @@ static inline void snow3g_keystream_4_8(snow3gKeyState4_t *pCtx, const __m128i L6 = pCtx->LFSR_X[(pCtx->iLFSR_X + 6) & 15]; const __m128i L15 = pCtx->LFSR_X[(pCtx->iLFSR_X + 15) & 15]; - const __m128i V0 = _mm_xor_si128(_mm_xor_si128(C0_C11_4(L0, L11), L2), - _mm_xor_si128(_mm_slli_epi32(L0, 8), - _mm_srli_epi32(L11, 8))); + const __m128i V0 = + _mm_xor_si128(_mm_xor_si128(C0_C11_4(L0, L11), L2), + _mm_xor_si128(_mm_slli_epi32(L0, 8), _mm_srli_epi32(L11, 8))); - const __m128i V1 = _mm_xor_si128(_mm_xor_si128(C0_C11_4(L1, L12), L3), - _mm_xor_si128(_mm_slli_epi32(L1, 8), - _mm_srli_epi32(L12, 8))); + const __m128i V1 = + _mm_xor_si128(_mm_xor_si128(C0_C11_4(L1, L12), L3), + _mm_xor_si128(_mm_slli_epi32(L1, 8), _mm_srli_epi32(L12, 8))); /* ======== first set of 4 bytes */ const __m128i s1_box_step1 = S1_box_4(pCtx->FSM_X[0]); /* do early */ - const __m128i R0 = _mm_add_epi32(_mm_xor_si128(L5, pCtx->FSM_X[2]), - pCtx->FSM_X[1]); + const __m128i R0 = _mm_add_epi32(_mm_xor_si128(L5, pCtx->FSM_X[2]), pCtx->FSM_X[1]); - const __m128i F0 = _mm_xor_si128(_mm_add_epi32(L15, pCtx->FSM_X[0]), - pCtx->FSM_X[1]); + const __m128i F0 = _mm_xor_si128(_mm_add_epi32(L15, pCtx->FSM_X[0]), pCtx->FSM_X[1]); const __m128i L = _mm_xor_si128(F0, L0); const __m128i F1 = _mm_xor_si128(_mm_add_epi32(V0, R0), s1_box_step1); @@ -1861,8 +1788,7 @@ static inline void snow3g_keystream_4_8(snow3gKeyState4_t *pCtx, const __m128i s1_box_step2 = S1_box_4(R0); - const __m128i R1 = _mm_add_epi32(_mm_xor_si128(L6, s2_box_step1), - s1_box_step1); + const __m128i R1 = _mm_add_epi32(_mm_xor_si128(L6, s2_box_step1), s1_box_step1); /* Final FSM_X update * FSM_X[2] = s2_box_step2 @@ -1880,28 +1806,23 @@ static inline void snow3g_keystream_4_8(snow3gKeyState4_t *pCtx, * @param[in] pCtx Context where the scheduled keys are stored * @param[in/out] pKeyStream Pointer to store generated key stream */ -static inline void snow3g_keystream_4_16(snow3gKeyState4_t *pCtx, - __m128i pKeyStream[4]) +static inline void +snow3g_keystream_4_16(snow3gKeyState4_t *pCtx, __m128i pKeyStream[4]) { - static const uint64_t sm[2] = { - /* mask for byte swapping 64-bit words */ - 0x0001020304050607ULL, 0x08090a0b0c0d0e0fULL + static const uint64_t sm[2] = { /* mask for byte swapping 64-bit words */ + 0x0001020304050607ULL, 0x08090a0b0c0d0e0fULL }; __m128i ksL1, ksL2, ksH1, ksH2; snow3g_keystream_4_8(pCtx, &ksL1, &ksH1); snow3g_keystream_4_8(pCtx, &ksL2, &ksH2); - const __m128i swapMask = _mm_loadu_si128((const __m128i *)sm); + const __m128i swapMask = _mm_loadu_si128((const __m128i *) sm); - pKeyStream[0] = _mm_shuffle_epi8(_mm_unpacklo_epi64(ksL1, ksL2), - swapMask); - pKeyStream[1] = _mm_shuffle_epi8(_mm_unpackhi_epi64(ksL1, ksL2), - swapMask); - pKeyStream[2] = _mm_shuffle_epi8(_mm_unpacklo_epi64(ksH1, ksH2), - swapMask); - pKeyStream[3] = _mm_shuffle_epi8(_mm_unpackhi_epi64(ksH1, ksH2), - swapMask); + pKeyStream[0] = _mm_shuffle_epi8(_mm_unpacklo_epi64(ksL1, ksL2), swapMask); + pKeyStream[1] = _mm_shuffle_epi8(_mm_unpackhi_epi64(ksL1, ksL2), swapMask); + pKeyStream[2] = _mm_shuffle_epi8(_mm_unpacklo_epi64(ksH1, ksH2), swapMask); + pKeyStream[3] = _mm_shuffle_epi8(_mm_unpackhi_epi64(ksH1, ksH2), swapMask); } /** @@ -1915,10 +1836,8 @@ static inline void snow3g_keystream_4_16(snow3gKeyState4_t *pCtx, * @param [in] pIV4 IV for buffer 4 */ static inline void -snow3gStateInitialize_4(snow3gKeyState4_t *pCtx, - const snow3g_key_schedule_t *pKeySched, - const void *pIV1, const void *pIV2, - const void *pIV3, const void *pIV4) +snow3gStateInitialize_4(snow3gKeyState4_t *pCtx, const snow3g_key_schedule_t *pKeySched, + const void *pIV1, const void *pIV2, const void *pIV3, const void *pIV4) { __m128i R, S, T, U; __m128i T0, T1; @@ -1927,14 +1846,12 @@ snow3gStateInitialize_4(snow3gKeyState4_t *pCtx, /* Initialize the LFSR table from constants, Keys, and IV */ /* Load complete 128b IV into register (SSE2)*/ - static const uint64_t sm[2] = { - 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL - }; + static const uint64_t sm[2] = { 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL }; - R = _mm_loadu_si128((const __m128i *)pIV1); - S = _mm_loadu_si128((const __m128i *)pIV2); - T = _mm_loadu_si128((const __m128i *)pIV3); - U = _mm_loadu_si128((const __m128i *)pIV4); + R = _mm_loadu_si128((const __m128i *) pIV1); + S = _mm_loadu_si128((const __m128i *) pIV2); + T = _mm_loadu_si128((const __m128i *) pIV3); + U = _mm_loadu_si128((const __m128i *) pIV4); /* initialize the array block (SSE4) */ for (i = 0; i < 4; i++) { @@ -1943,10 +1860,8 @@ snow3gStateInitialize_4(snow3gKeyState4_t *pCtx, const __m128i VK = _mm_set1_epi32(K); const __m128i VL = _mm_set1_epi32(L); - pCtx->LFSR_X[i + 4] = - pCtx->LFSR_X[i + 12] = VK; - pCtx->LFSR_X[i + 0] = - pCtx->LFSR_X[i + 8] = VL; + pCtx->LFSR_X[i + 4] = pCtx->LFSR_X[i + 12] = VK; + pCtx->LFSR_X[i + 0] = pCtx->LFSR_X[i + 8] = VL; } /* Update the schedule structure with IVs */ /* Store the 4 IVs in LFSR by a column/row matrix swap @@ -1980,16 +1895,14 @@ snow3gStateInitialize_4(snow3gKeyState4_t *pCtx, pCtx->iLFSR_X = 0; /* FSM initialization (SSE2) */ - pCtx->FSM_X[0] = pCtx->FSM_X[1] = - pCtx->FSM_X[2] = _mm_setzero_si128(); + pCtx->FSM_X[0] = pCtx->FSM_X[1] = pCtx->FSM_X[2] = _mm_setzero_si128(); /* Initialisation rounds */ for (i = 0; i < 32; i++) { T1 = ClockFSM_4(pCtx); ClockLFSR_4(pCtx); pCtx->LFSR_X[(pCtx->iLFSR_X + 15) & 15] = - _mm_xor_si128(pCtx->LFSR_X[(pCtx->iLFSR_X + 15) & 15], - T1); + _mm_xor_si128(pCtx->LFSR_X[(pCtx->iLFSR_X + 15) & 15], T1); } } @@ -2005,17 +1918,13 @@ snow3gStateInitialize_4(snow3gKeyState4_t *pCtx, */ static inline void snow3gStateInitialize_8_multiKey(snow3gKeyState8_t *pCtx, - const snow3g_key_schedule_t * const KeySched[], - const void * const pIV[]) + const snow3g_key_schedule_t *const KeySched[], + const void *const pIV[]) { - static const __m256i swapMask = { - 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL, - 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL - }; - static const __m256i ALLFS = { - 0xffffffffffffffffULL, 0xffffffffffffffffULL, - 0xffffffffffffffffULL, 0xffffffffffffffffULL - }; + static const __m256i swapMask = { 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL, + 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL }; + static const __m256i ALLFS = { 0xffffffffffffffffULL, 0xffffffffffffffffULL, + 0xffffffffffffffffULL, 0xffffffffffffffffULL }; __m256i ksR, ksS, ksT, ksU; __m256i ivR, ivS, ivT, ivU; __m256i T0, T1; @@ -2077,12 +1986,10 @@ snow3gStateInitialize_8_multiKey(snow3gKeyState8_t *pCtx, ksS = _mm256_xor_si256(ksS, ALLFS); ksT = _mm256_xor_si256(ksT, ALLFS); - pCtx->LFSR_X[0 + 0] = - pCtx->LFSR_X[8 + 0] = _mm256_xor_si256(ksR, ALLFS); + pCtx->LFSR_X[0 + 0] = pCtx->LFSR_X[8 + 0] = _mm256_xor_si256(ksR, ALLFS); pCtx->LFSR_X[0 + 1] = ksS; /* LFSR[9] set later */ pCtx->LFSR_X[0 + 2] = ksT; /* LFSR[10] set later */ - pCtx->LFSR_X[0 + 3] = - pCtx->LFSR_X[8 + 3] = _mm256_xor_si256(ksU, ALLFS); + pCtx->LFSR_X[0 + 3] = pCtx->LFSR_X[8 + 3] = _mm256_xor_si256(ksU, ALLFS); /* * Update LFSR structure with IVs @@ -2121,9 +2028,7 @@ snow3gStateInitialize_8_multiKey(snow3gKeyState8_t *pCtx, pCtx->iLFSR_X = 0; /* FSM initialization */ - pCtx->FSM_X[0] = - pCtx->FSM_X[1] = - pCtx->FSM_X[2] = _mm256_setzero_si256(); + pCtx->FSM_X[0] = pCtx->FSM_X[1] = pCtx->FSM_X[2] = _mm256_setzero_si256(); /* Initialisation rounds */ for (i = 0; i < 32; i++) { @@ -2151,12 +2056,9 @@ snow3gStateInitialize_8_multiKey(snow3gKeyState8_t *pCtx, * @param [in] pIV8 IV for buffer 8 */ static inline void -snow3gStateInitialize_8(snow3gKeyState8_t *pCtx, - const snow3g_key_schedule_t *pKeySched, - const void *pIV1, const void *pIV2, - const void *pIV3, const void *pIV4, - const void *pIV5, const void *pIV6, - const void *pIV7, const void *pIV8) +snow3gStateInitialize_8(snow3gKeyState8_t *pCtx, const snow3g_key_schedule_t *pKeySched, + const void *pIV1, const void *pIV2, const void *pIV3, const void *pIV4, + const void *pIV5, const void *pIV6, const void *pIV7, const void *pIV8) { __m256i mR, mS, mT, mU, T0, T1; int i; @@ -2164,10 +2066,8 @@ snow3gStateInitialize_8(snow3gKeyState8_t *pCtx, /* Initialize the LFSR table from constants, Keys, and IV */ /* Load complete 256b IV into register (SSE2)*/ - static const __m256i swapMask = { - 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL, - 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL - }; + static const __m256i swapMask = { 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL, + 0x0405060700010203ULL, 0x0c0d0e0f08090a0bULL }; mR = load_2xm128i_into_m256i(pIV5, pIV1); mS = load_2xm128i_into_m256i(pIV6, pIV2); @@ -2181,10 +2081,8 @@ snow3gStateInitialize_8(snow3gKeyState8_t *pCtx, const __m256i V0 = _mm256_set1_epi32(K); const __m256i V1 = _mm256_set1_epi32(L); - pCtx->LFSR_X[i + 4] = - pCtx->LFSR_X[i + 12] = V0; - pCtx->LFSR_X[i + 0] = - pCtx->LFSR_X[i + 8] = V1; + pCtx->LFSR_X[i + 4] = pCtx->LFSR_X[i + 12] = V0; + pCtx->LFSR_X[i + 0] = pCtx->LFSR_X[i + 8] = V1; } /* Update the schedule structure with IVs */ @@ -2217,9 +2115,7 @@ snow3gStateInitialize_8(snow3gKeyState8_t *pCtx, pCtx->iLFSR_X = 0; /* FSM initialization (SSE2) */ - pCtx->FSM_X[0] = - pCtx->FSM_X[1] = - pCtx->FSM_X[2] = _mm256_setzero_si256(); + pCtx->FSM_X[0] = pCtx->FSM_X[1] = pCtx->FSM_X[2] = _mm256_setzero_si256(); /* Initialisation rounds */ for (i = 0; i < 32; i++) { @@ -2241,16 +2137,14 @@ snow3gStateInitialize_8(snow3gKeyState8_t *pCtx, * @param[out] pOut Output buffer * @param[in] lengthInBytes length in bytes of the data to be encrypted */ -static inline void f8_snow3g(snow3gKeyState1_t *pCtx, - const void *pIn, - void *pOut, - const uint32_t lengthInBytes) +static inline void +f8_snow3g(snow3gKeyState1_t *pCtx, const void *pIn, void *pOut, const uint32_t lengthInBytes) { uint32_t qwords = lengthInBytes / SNOW3G_8_BYTES; /* number of qwords */ - const uint32_t words = lengthInBytes & 4; /* remaining word if not 0 */ - const uint32_t bytes = lengthInBytes & 3; /* remaining bytes */ - uint32_t KS4; /* 4 bytes of key stream */ - uint64_t KS8; /* 8 bytes of key stream */ + const uint32_t words = lengthInBytes & 4; /* remaining word if not 0 */ + const uint32_t bytes = lengthInBytes & 3; /* remaining bytes */ + uint32_t KS4; /* 4 bytes of key stream */ + uint64_t KS8; /* 8 bytes of key stream */ const uint8_t *pBufferIn = pIn; uint8_t *pBufferOut = pOut; @@ -2315,24 +2209,23 @@ static inline void f8_snow3g(snow3gKeyState1_t *pCtx, * @param[in] pDstState Pointer to the destination state * @param[in] NumBuffer Buffer number */ -static inline void snow3gStateConvert_8(const snow3gKeyState8_t *pSrcState, - snow3gKeyState1_t *pDstState, - const uint32_t NumBuffer) +static inline void +snow3gStateConvert_8(const snow3gKeyState8_t *pSrcState, snow3gKeyState1_t *pDstState, + const uint32_t NumBuffer) { const uint32_t iLFSR_X = pSrcState->iLFSR_X; const __m256i *LFSR_X = pSrcState->LFSR_X; uint32_t i; for (i = 0; i < 16; i++) { - const uint32_t *pLFSR_X = - (const uint32_t *) &LFSR_X[(i + iLFSR_X) & 15]; + const uint32_t *pLFSR_X = (const uint32_t *) &LFSR_X[(i + iLFSR_X) & 15]; pDstState->LFSR_S[i] = pLFSR_X[NumBuffer]; } - const uint32_t *pFSM_X0 = (const uint32_t *)&pSrcState->FSM_X[0]; - const uint32_t *pFSM_X1 = (const uint32_t *)&pSrcState->FSM_X[1]; - const uint32_t *pFSM_X2 = (const uint32_t *)&pSrcState->FSM_X[2]; + const uint32_t *pFSM_X0 = (const uint32_t *) &pSrcState->FSM_X[0]; + const uint32_t *pFSM_X1 = (const uint32_t *) &pSrcState->FSM_X[1]; + const uint32_t *pFSM_X2 = (const uint32_t *) &pSrcState->FSM_X[2]; pDstState->FSM_R1 = pFSM_X0[NumBuffer]; pDstState->FSM_R2 = pFSM_X1[NumBuffer]; @@ -2347,24 +2240,23 @@ static inline void snow3gStateConvert_8(const snow3gKeyState8_t *pSrcState, * @param[in] pDstState Pointer to the destination state * @param[in] NumBuffer Buffer number */ -static inline void snow3gStateConvert_4(const snow3gKeyState4_t *pSrcState, - snow3gKeyState1_t *pDstState, - const uint32_t NumBuffer) +static inline void +snow3gStateConvert_4(const snow3gKeyState4_t *pSrcState, snow3gKeyState1_t *pDstState, + const uint32_t NumBuffer) { const uint32_t iLFSR_X = pSrcState->iLFSR_X; const __m128i *LFSR_X = pSrcState->LFSR_X; uint32_t i; for (i = 0; i < 16; i++) { - const uint32_t *pLFSR_X = - (const uint32_t *) &LFSR_X[(i + iLFSR_X) & 15]; + const uint32_t *pLFSR_X = (const uint32_t *) &LFSR_X[(i + iLFSR_X) & 15]; pDstState->LFSR_S[i] = pLFSR_X[NumBuffer]; } - const uint32_t *pFSM_X0 = (const uint32_t *)&pSrcState->FSM_X[0]; - const uint32_t *pFSM_X1 = (const uint32_t *)&pSrcState->FSM_X[1]; - const uint32_t *pFSM_X2 = (const uint32_t *)&pSrcState->FSM_X[2]; + const uint32_t *pFSM_X0 = (const uint32_t *) &pSrcState->FSM_X[0]; + const uint32_t *pFSM_X1 = (const uint32_t *) &pSrcState->FSM_X[1]; + const uint32_t *pFSM_X2 = (const uint32_t *) &pSrcState->FSM_X[2]; pDstState->FSM_R1 = pFSM_X0[NumBuffer]; pDstState->FSM_R2 = pFSM_X1[NumBuffer]; @@ -2375,7 +2267,8 @@ static inline void snow3gStateConvert_4(const snow3gKeyState4_t *pSrcState, * @brief Provides size of key schedule structure * @return Key schedule structure in bytes */ -size_t SNOW3G_KEY_SCHED_SIZE(void) +size_t +SNOW3G_KEY_SCHED_SIZE(void) { return sizeof(snow3g_key_schedule_t); } @@ -2388,12 +2281,13 @@ size_t SNOW3G_KEY_SCHED_SIZE(void) * @retval 0 all OK * @retval -1 parameter error */ -int SNOW3G_INIT_KEY_SCHED(const void *pKey, snow3g_key_schedule_t *pCtx) +int +SNOW3G_INIT_KEY_SCHED(const void *pKey, snow3g_key_schedule_t *pCtx) { #ifdef SAFE_PARAM if ((pKey == NULL) || (pCtx == NULL)) - /* reset error status */ - imb_set_errno(NULL, 0); + /* reset error status */ + imb_set_errno(NULL, 0); if (pKey == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_KEY); @@ -2426,11 +2320,9 @@ int SNOW3G_INIT_KEY_SCHED(const void *pKey, snow3g_key_schedule_t *pCtx) * @param[out] pBufferOut pointer to an output buffer * @param[in] lengthInBytes message length in bits */ -void SNOW3G_F8_1_BUFFER(const snow3g_key_schedule_t *pHandle, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t lengthInBytes) +void +SNOW3G_F8_1_BUFFER(const snow3g_key_schedule_t *pHandle, const void *pIV, const void *pBufferIn, + void *pBufferOut, const uint32_t lengthInBytes) { #ifdef SAFE_PARAM @@ -2489,12 +2381,9 @@ void SNOW3G_F8_1_BUFFER(const snow3g_key_schedule_t *pHandle, * @param[in] lengthInBits message length in bits * @param[in] offsetInBits message offset in bits */ -void SNOW3G_F8_1_BUFFER_BIT(const snow3g_key_schedule_t *pHandle, - const void *pIV, - const void *pBufferIn, - void *pBufferOut, - const uint32_t lengthInBits, - const uint32_t offsetInBits) +void +SNOW3G_F8_1_BUFFER_BIT(const snow3g_key_schedule_t *pHandle, const void *pIV, const void *pBufferIn, + void *pBufferOut, const uint32_t lengthInBits, const uint32_t offsetInBits) { #ifdef SAFE_PARAM /* reset error status */ @@ -2525,15 +2414,13 @@ void SNOW3G_F8_1_BUFFER_BIT(const snow3g_key_schedule_t *pHandle, uint8_t save_start = 0, save_end = 0; uint8_t *dst = &((uint8_t *) pBufferOut)[offsetInBits >> 3]; - save_msg_start_end(dst, offsetInBits & 7, lengthInBits, &save_start, - &save_end); + save_msg_start_end(dst, offsetInBits & 7, lengthInBits, &save_start, &save_end); copy_bits(dst, pBufferIn, offsetInBits, lengthInBits); SNOW3G_F8_1_BUFFER(pHandle, pIV, dst, dst, (lengthInBits + 7) / 8); shift_bits(dst, offsetInBits & 7, lengthInBits); - restore_msg_start_end(dst, offsetInBits & 7, lengthInBits, save_start, - save_end); + restore_msg_start_end(dst, offsetInBits & 7, lengthInBits, save_start, save_end); } /** @@ -2553,15 +2440,10 @@ void SNOW3G_F8_1_BUFFER_BIT(const snow3g_key_schedule_t *pHandle, * @param[in] pBufOut2 pointer to an output buffer * @param[in] lenInBytes2 message size in bytes */ -void SNOW3G_F8_2_BUFFER(const snow3g_key_schedule_t *pHandle, - const void *pIV1, - const void *pIV2, - const void *pBufIn1, - void *pBufOut1, - const uint32_t lenInBytes1, - const void *pBufIn2, - void *pBufOut2, - const uint32_t lenInBytes2) +void +SNOW3G_F8_2_BUFFER(const snow3g_key_schedule_t *pHandle, const void *pIV1, const void *pIV2, + const void *pBufIn1, void *pBufOut1, const uint32_t lenInBytes1, + const void *pBufIn2, void *pBufOut2, const uint32_t lenInBytes2) { #ifdef SAFE_PARAM /* reset error status */ @@ -2584,8 +2466,8 @@ void SNOW3G_F8_2_BUFFER(const snow3g_key_schedule_t *pHandle, imb_set_errno(NULL, IMB_ERR_NULL_DST); return; } - if ((lenInBytes1 == 0) || (lenInBytes1 > SNOW3G_MAX_BYTELEN) || - (lenInBytes2 == 0) || (lenInBytes2 > SNOW3G_MAX_BYTELEN)) { + if ((lenInBytes1 == 0) || (lenInBytes1 > SNOW3G_MAX_BYTELEN) || (lenInBytes2 == 0) || + (lenInBytes2 > SNOW3G_MAX_BYTELEN)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -2620,7 +2502,6 @@ void SNOW3G_F8_2_BUFFER(const snow3g_key_schedule_t *pHandle, CLEAR_SCRATCH_GPS(); CLEAR_SCRATCH_SIMD_REGS(); #endif /* SAFE_DATA */ - } /** @@ -2648,23 +2529,13 @@ void SNOW3G_F8_2_BUFFER(const snow3g_key_schedule_t *pHandle, * @param[in] pBufferOut4 pointer to an output buffer * @param[in] lengthInBytes4 message size in bytes */ -void SNOW3G_F8_4_BUFFER(const snow3g_key_schedule_t *pHandle, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pBufferIn1, - void *pBufferOut1, - const uint32_t lengthInBytes1, - const void *pBufferIn2, - void *pBufferOut2, - const uint32_t lengthInBytes2, - const void *pBufferIn3, - void *pBufferOut3, - const uint32_t lengthInBytes3, - const void *pBufferIn4, - void *pBufferOut4, - const uint32_t lengthInBytes4) +void +SNOW3G_F8_4_BUFFER(const snow3g_key_schedule_t *pHandle, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pBufferIn1, void *pBufferOut1, + const uint32_t lengthInBytes1, const void *pBufferIn2, void *pBufferOut2, + const uint32_t lengthInBytes2, const void *pBufferIn3, void *pBufferOut3, + const uint32_t lengthInBytes3, const void *pBufferIn4, void *pBufferOut4, + const uint32_t lengthInBytes4) { const size_t num_lanes = 4; snow3gKeyState4_t ctx; @@ -2673,12 +2544,9 @@ void SNOW3G_F8_4_BUFFER(const snow3g_key_schedule_t *pHandle, const uint8_t *pBufferIn[4]; uint32_t bytes, qwords, i; - cptr_copy_4((const void **)pBufferIn, - pBufferIn1, pBufferIn2, pBufferIn3, pBufferIn4); - ptr_copy_4((void **)pBufferOut, pBufferOut1, pBufferOut2, - pBufferOut3, pBufferOut4); - length_copy_4(lenInBytes, lengthInBytes1, lengthInBytes2, - lengthInBytes3, lengthInBytes4); + cptr_copy_4((const void **) pBufferIn, pBufferIn1, pBufferIn2, pBufferIn3, pBufferIn4); + ptr_copy_4((void **) pBufferOut, pBufferOut1, pBufferOut2, pBufferOut3, pBufferOut4); + length_copy_4(lenInBytes, lengthInBytes1, lengthInBytes2, lengthInBytes3, lengthInBytes4); #ifdef SAFE_PARAM /* reset error status */ @@ -2688,15 +2556,13 @@ void SNOW3G_F8_4_BUFFER(const snow3g_key_schedule_t *pHandle, imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } - if ((pIV1 == NULL) || pIV2 == NULL || - (pIV3 == NULL) || (pIV4 == NULL)) { + if ((pIV1 == NULL) || pIV2 == NULL || (pIV3 == NULL) || (pIV4 == NULL)) { imb_set_errno(NULL, IMB_ERR_NULL_IV); return; } - if (!cptr_check((const void * const *)pBufferIn, num_lanes, - IMB_ERR_NULL_SRC)) + if (!cptr_check((const void *const *) pBufferIn, num_lanes, IMB_ERR_NULL_SRC)) return; - if (!ptr_check((void **)pBufferOut, num_lanes, IMB_ERR_NULL_DST)) + if (!ptr_check((void **) pBufferOut, num_lanes, IMB_ERR_NULL_DST)) return; if (!length_check(lenInBytes, num_lanes)) return; @@ -2726,11 +2592,9 @@ void SNOW3G_F8_4_BUFFER(const snow3g_key_schedule_t *pHandle, snow3g_keystream_4_16(&ctx, ks); for (i = 0; i < num_lanes; i++) { - const __m128i in = - _mm_loadu_si128((const __m128i *)pBufferIn[i]); + const __m128i in = _mm_loadu_si128((const __m128i *) pBufferIn[i]); - _mm_storeu_si128((__m128i *)pBufferOut[i], - _mm_xor_si128(in, ks[i])); + _mm_storeu_si128((__m128i *) pBufferOut[i], _mm_xor_si128(in, ks[i])); pBufferOut[i] += (2 * SNOW3G_8_BYTES); pBufferIn[i] += (2 * SNOW3G_8_BYTES); @@ -2744,14 +2608,14 @@ void SNOW3G_F8_4_BUFFER(const snow3g_key_schedule_t *pHandle, snow3g_keystream_4_8(&ctx, &L, &H); - pBufferIn[0] = xor_keystrm_rev(pBufferOut[0], pBufferIn[0], - _mm_extract_epi64(L, 0)); - pBufferIn[1] = xor_keystrm_rev(pBufferOut[1], pBufferIn[1], - _mm_extract_epi64(L, 1)); - pBufferIn[2] = xor_keystrm_rev(pBufferOut[2], pBufferIn[2], - _mm_extract_epi64(H, 0)); - pBufferIn[3] = xor_keystrm_rev(pBufferOut[3], pBufferIn[3], - _mm_extract_epi64(H, 1)); + pBufferIn[0] = + xor_keystrm_rev(pBufferOut[0], pBufferIn[0], _mm_extract_epi64(L, 0)); + pBufferIn[1] = + xor_keystrm_rev(pBufferOut[1], pBufferIn[1], _mm_extract_epi64(L, 1)); + pBufferIn[2] = + xor_keystrm_rev(pBufferOut[2], pBufferIn[2], _mm_extract_epi64(H, 0)); + pBufferIn[3] = + xor_keystrm_rev(pBufferOut[3], pBufferIn[3], _mm_extract_epi64(H, 1)); for (i = 0; i < num_lanes; i++) pBufferOut[i] += SNOW3G_8_BYTES; @@ -2791,10 +2655,8 @@ void SNOW3G_F8_4_BUFFER(const snow3g_key_schedule_t *pHandle, * @param[in] lengthInBytes pointer to an array of message lengths in bytes */ static inline void -snow3g_8_buffer_ks_32_8_multi(const snow3g_key_schedule_t * const pKey[], - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], +snow3g_8_buffer_ks_32_8_multi(const snow3g_key_schedule_t *const pKey[], const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t *lengthInBytes) { const size_t num_lanes = 8; @@ -2808,12 +2670,9 @@ snow3g_8_buffer_ks_32_8_multi(const snow3g_key_schedule_t * const pKey[], uint32_t bytes_left = bytes & (~(small_block_size - 1)); size_t i; - memcpy((void *)tBufferIn, (const void *)pBufferIn, - sizeof(tBufferIn)); - memcpy((void *)tBufferOut, (const void *)pBufferOut, - sizeof(tBufferOut)); - memcpy((void *)tLenInBytes, (const void *)lengthInBytes, - sizeof(tLenInBytes)); + memcpy((void *) tBufferIn, (const void *) pBufferIn, sizeof(tBufferIn)); + memcpy((void *) tBufferOut, (const void *) pBufferOut, sizeof(tBufferOut)); + memcpy((void *) tLenInBytes, (const void *) lengthInBytes, sizeof(tLenInBytes)); /* Initialize the schedule from the IV */ snow3gStateInitialize_8_multiKey(&ctx, pKey, IV); @@ -2839,15 +2698,11 @@ snow3g_8_buffer_ks_32_8_multi(const snow3g_key_schedule_t * const pKey[], snow3g_keystream_8_32(&ctx, ks); for (j = 0; j < num_lanes; j++) { - const __m256i *in_ptr = - (const __m256i *)tBufferIn[j]; - const __m256i in_val = - _mm256_loadu_si256(in_ptr); - const __m256i xor_val = - _mm256_xor_si256(in_val, ks[j]); + const __m256i *in_ptr = (const __m256i *) tBufferIn[j]; + const __m256i in_val = _mm256_loadu_si256(in_ptr); + const __m256i xor_val = _mm256_xor_si256(in_val, ks[j]); - _mm256_storeu_si256((__m256i *)tBufferOut[j], - xor_val); + _mm256_storeu_si256((__m256i *) tBufferOut[j], xor_val); tBufferOut[j] += big_block_size; tBufferIn[j] += big_block_size; @@ -2871,30 +2726,22 @@ snow3g_8_buffer_ks_32_8_multi(const snow3g_key_schedule_t * const pKey[], snow3g_keystream_8_8(&ctx, &L, &H); - tBufferIn[0] = - xor_keystrm_rev(tBufferOut[0], tBufferIn[0], - _mm256_extract_epi64(L, 0)); - tBufferIn[1] = - xor_keystrm_rev(tBufferOut[1], tBufferIn[1], - _mm256_extract_epi64(L, 1)); - tBufferIn[2] = - xor_keystrm_rev(tBufferOut[2], tBufferIn[2], - _mm256_extract_epi64(H, 0)); - tBufferIn[3] = - xor_keystrm_rev(tBufferOut[3], tBufferIn[3], - _mm256_extract_epi64(H, 1)); - tBufferIn[4] = - xor_keystrm_rev(tBufferOut[4], tBufferIn[4], - _mm256_extract_epi64(L, 2)); - tBufferIn[5] = - xor_keystrm_rev(tBufferOut[5], tBufferIn[5], - _mm256_extract_epi64(L, 3)); - tBufferIn[6] = - xor_keystrm_rev(tBufferOut[6], tBufferIn[6], - _mm256_extract_epi64(H, 2)); - tBufferIn[7] = - xor_keystrm_rev(tBufferOut[7], tBufferIn[7], - _mm256_extract_epi64(H, 3)); + tBufferIn[0] = xor_keystrm_rev(tBufferOut[0], tBufferIn[0], + _mm256_extract_epi64(L, 0)); + tBufferIn[1] = xor_keystrm_rev(tBufferOut[1], tBufferIn[1], + _mm256_extract_epi64(L, 1)); + tBufferIn[2] = xor_keystrm_rev(tBufferOut[2], tBufferIn[2], + _mm256_extract_epi64(H, 0)); + tBufferIn[3] = xor_keystrm_rev(tBufferOut[3], tBufferIn[3], + _mm256_extract_epi64(H, 1)); + tBufferIn[4] = xor_keystrm_rev(tBufferOut[4], tBufferIn[4], + _mm256_extract_epi64(L, 2)); + tBufferIn[5] = xor_keystrm_rev(tBufferOut[5], tBufferIn[5], + _mm256_extract_epi64(L, 3)); + tBufferIn[6] = xor_keystrm_rev(tBufferOut[6], tBufferIn[6], + _mm256_extract_epi64(H, 2)); + tBufferIn[7] = xor_keystrm_rev(tBufferOut[7], tBufferIn[7], + _mm256_extract_epi64(H, 3)); for (j = 0; j < num_lanes; j++) tBufferOut[j] += small_block_size; @@ -2933,11 +2780,8 @@ snow3g_8_buffer_ks_32_8_multi(const snow3g_key_schedule_t * const pKey[], * @param[in] lengthInBytes pointer to an array of message lengths in bytes */ static inline void -snow3g_8_buffer_ks_32_8(const snow3g_key_schedule_t *pKey, - const void * const IV[], - const uint8_t *pBufferIn[], - uint8_t *pBufferOut[], - uint32_t *lengthInBytes) +snow3g_8_buffer_ks_32_8(const snow3g_key_schedule_t *pKey, const void *const IV[], + const uint8_t *pBufferIn[], uint8_t *pBufferOut[], uint32_t *lengthInBytes) { const size_t num_lanes = 8; const size_t big_block_size = 32; @@ -2947,8 +2791,7 @@ snow3g_8_buffer_ks_32_8(const snow3g_key_schedule_t *pKey, uint32_t i, bytes_left = bytes & (~(small_block_size - 1)); /* Initialize the schedule from the IV */ - snow3gStateInitialize_8(&ctx, pKey, IV[0], IV[1], IV[2], - IV[3], IV[4], IV[5], IV[6], IV[7]); + snow3gStateInitialize_8(&ctx, pKey, IV[0], IV[1], IV[2], IV[3], IV[4], IV[5], IV[6], IV[7]); /* Clock FSM and LFSR once, ignore the key stream */ (void) snow3g_keystream_8_4(&ctx); @@ -2967,15 +2810,11 @@ snow3g_8_buffer_ks_32_8(const snow3g_key_schedule_t *pKey, snow3g_keystream_8_32(&ctx, ks); for (j = 0; j < num_lanes; j++) { - const __m256i *in_ptr = - (const __m256i *)pBufferIn[j]; - const __m256i in_val = - _mm256_loadu_si256(in_ptr); - const __m256i xor_val = - _mm256_xor_si256(in_val, ks[j]); + const __m256i *in_ptr = (const __m256i *) pBufferIn[j]; + const __m256i in_val = _mm256_loadu_si256(in_ptr); + const __m256i xor_val = _mm256_xor_si256(in_val, ks[j]); - _mm256_storeu_si256((__m256i *)pBufferOut[j], - xor_val); + _mm256_storeu_si256((__m256i *) pBufferOut[j], xor_val); pBufferOut[j] += big_block_size; pBufferIn[j] += big_block_size; @@ -2999,30 +2838,22 @@ snow3g_8_buffer_ks_32_8(const snow3g_key_schedule_t *pKey, snow3g_keystream_8_8(&ctx, &L, &H); - pBufferIn[0] = - xor_keystrm_rev(pBufferOut[0], pBufferIn[0], - _mm256_extract_epi64(L, 0)); - pBufferIn[1] = - xor_keystrm_rev(pBufferOut[1], pBufferIn[1], - _mm256_extract_epi64(L, 1)); - pBufferIn[2] = - xor_keystrm_rev(pBufferOut[2], pBufferIn[2], - _mm256_extract_epi64(H, 0)); - pBufferIn[3] = - xor_keystrm_rev(pBufferOut[3], pBufferIn[3], - _mm256_extract_epi64(H, 1)); - pBufferIn[4] = - xor_keystrm_rev(pBufferOut[4], pBufferIn[4], - _mm256_extract_epi64(L, 2)); - pBufferIn[5] = - xor_keystrm_rev(pBufferOut[5], pBufferIn[5], - _mm256_extract_epi64(L, 3)); - pBufferIn[6] = - xor_keystrm_rev(pBufferOut[6], pBufferIn[6], - _mm256_extract_epi64(H, 2)); - pBufferIn[7] = - xor_keystrm_rev(pBufferOut[7], pBufferIn[7], - _mm256_extract_epi64(H, 3)); + pBufferIn[0] = xor_keystrm_rev(pBufferOut[0], pBufferIn[0], + _mm256_extract_epi64(L, 0)); + pBufferIn[1] = xor_keystrm_rev(pBufferOut[1], pBufferIn[1], + _mm256_extract_epi64(L, 1)); + pBufferIn[2] = xor_keystrm_rev(pBufferOut[2], pBufferIn[2], + _mm256_extract_epi64(H, 0)); + pBufferIn[3] = xor_keystrm_rev(pBufferOut[3], pBufferIn[3], + _mm256_extract_epi64(H, 1)); + pBufferIn[4] = xor_keystrm_rev(pBufferOut[4], pBufferIn[4], + _mm256_extract_epi64(L, 2)); + pBufferIn[5] = xor_keystrm_rev(pBufferOut[5], pBufferIn[5], + _mm256_extract_epi64(L, 3)); + pBufferIn[6] = xor_keystrm_rev(pBufferOut[6], pBufferIn[6], + _mm256_extract_epi64(H, 2)); + pBufferIn[7] = xor_keystrm_rev(pBufferOut[7], pBufferIn[7], + _mm256_extract_epi64(H, 3)); for (j = 0; j < num_lanes; j++) pBufferOut[j] += small_block_size; @@ -3040,8 +2871,7 @@ snow3g_8_buffer_ks_32_8(const snow3g_key_schedule_t *pKey, continue; snow3gStateConvert_8(&ctx, &ctx_t, i); - f8_snow3g(&ctx_t, pBufferIn[i], pBufferOut[i], - lengthInBytes[i]); + f8_snow3g(&ctx_t, pBufferIn[i], pBufferOut[i], lengthInBytes[i]); } #ifdef SAFE_DATA @@ -3064,11 +2894,10 @@ snow3g_8_buffer_ks_32_8(const snow3g_key_schedule_t *pKey, * @param[out] pBufferOut pointer to an array of output buffers * @param[in] lengthInBytes pointer to an array of message lengths in bytes */ -void SNOW3G_F8_8_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pKey[], - const void * const IV[], - const void * const BufferIn[], - void *BufferOut[], - const uint32_t lengthInBytes[]) +void +SNOW3G_F8_8_BUFFER_MULTIKEY(const snow3g_key_schedule_t *const pKey[], const void *const IV[], + const void *const BufferIn[], void *BufferOut[], + const uint32_t lengthInBytes[]) { const size_t num_lanes = 8; @@ -3076,19 +2905,13 @@ void SNOW3G_F8_8_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pKey[], /* reset error status */ imb_set_errno(NULL, 0); - if (!cptr_check((const void * const *)pKey, - num_lanes, - IMB_ERR_NULL_EXP_KEY)) + if (!cptr_check((const void *const *) pKey, num_lanes, IMB_ERR_NULL_EXP_KEY)) return; - if (!cptr_check((const void * const *)IV, - num_lanes, - IMB_ERR_NULL_IV)) + if (!cptr_check((const void *const *) IV, num_lanes, IMB_ERR_NULL_IV)) return; - if (!cptr_check((const void * const *)BufferIn, - num_lanes, - IMB_ERR_NULL_SRC)) + if (!cptr_check((const void *const *) BufferIn, num_lanes, IMB_ERR_NULL_SRC)) return; - if (!ptr_check((void **)BufferOut, num_lanes, IMB_ERR_NULL_DST)) + if (!ptr_check((void **) BufferOut, num_lanes, IMB_ERR_NULL_DST)) return; if (!length_check(lengthInBytes, num_lanes)) return; @@ -3099,8 +2922,7 @@ void SNOW3G_F8_8_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pKey[], size_t i; for (i = 0; i < num_lanes; i++) - SNOW3G_F8_1_BUFFER(pKey[i], IV[i], BufferIn[i], BufferOut[i], - lengthInBytes[i]); + SNOW3G_F8_1_BUFFER(pKey[i], IV[i], BufferIn[i], BufferOut[i], lengthInBytes[i]); #else #ifdef SAFE_DATA @@ -3108,8 +2930,7 @@ void SNOW3G_F8_8_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pKey[], #endif /* SAFE_DATA */ (void) num_lanes; /* avoid compiler warning */ - snow3g_8_buffer_ks_32_8_multi(pKey, IV, BufferIn, - BufferOut, lengthInBytes); + snow3g_8_buffer_ks_32_8_multi(pKey, IV, BufferIn, BufferOut, lengthInBytes); #ifdef SAFE_DATA CLEAR_SCRATCH_GPS(); @@ -3159,58 +2980,34 @@ void SNOW3G_F8_8_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pKey[], * @param[in] pBufOut8 pointer to an output buffer * @param[in] lenInBytes8 message size in bytes */ -void SNOW3G_F8_8_BUFFER(const snow3g_key_schedule_t *pHandle, - const void *pIV1, - const void *pIV2, - const void *pIV3, - const void *pIV4, - const void *pIV5, - const void *pIV6, - const void *pIV7, - const void *pIV8, - const void *pBufIn1, - void *pBufOut1, - const uint32_t lenInBytes1, - const void *pBufIn2, - void *pBufOut2, - const uint32_t lenInBytes2, - const void *pBufIn3, - void *pBufOut3, - const uint32_t lenInBytes3, - const void *pBufIn4, - void *pBufOut4, - const uint32_t lenInBytes4, - const void *pBufIn5, - void *pBufOut5, - const uint32_t lenInBytes5, - const void *pBufIn6, - void *pBufOut6, - const uint32_t lenInBytes6, - const void *pBufIn7, - void *pBufOut7, - const uint32_t lenInBytes7, - const void *pBufIn8, - void *pBufOut8, - const uint32_t lenInBytes8) +void +SNOW3G_F8_8_BUFFER(const snow3g_key_schedule_t *pHandle, const void *pIV1, const void *pIV2, + const void *pIV3, const void *pIV4, const void *pIV5, const void *pIV6, + const void *pIV7, const void *pIV8, const void *pBufIn1, void *pBufOut1, + const uint32_t lenInBytes1, const void *pBufIn2, void *pBufOut2, + const uint32_t lenInBytes2, const void *pBufIn3, void *pBufOut3, + const uint32_t lenInBytes3, const void *pBufIn4, void *pBufOut4, + const uint32_t lenInBytes4, const void *pBufIn5, void *pBufOut5, + const uint32_t lenInBytes5, const void *pBufIn6, void *pBufOut6, + const uint32_t lenInBytes6, const void *pBufIn7, void *pBufOut7, + const uint32_t lenInBytes7, const void *pBufIn8, void *pBufOut8, + const uint32_t lenInBytes8) { uint32_t lengthInBytes[8]; const uint8_t *pBufferIn[8]; const void *pIV[8]; uint8_t *pBufferOut[8]; - length_copy_8(lengthInBytes, - lenInBytes1, lenInBytes2, lenInBytes3, lenInBytes4, + length_copy_8(lengthInBytes, lenInBytes1, lenInBytes2, lenInBytes3, lenInBytes4, lenInBytes5, lenInBytes6, lenInBytes7, lenInBytes8); - cptr_copy_8((const void **)pBufferIn, - pBufIn1, pBufIn2, pBufIn3, pBufIn4, - pBufIn5, pBufIn6, pBufIn7, pBufIn8); + cptr_copy_8((const void **) pBufferIn, pBufIn1, pBufIn2, pBufIn3, pBufIn4, pBufIn5, pBufIn6, + pBufIn7, pBufIn8); cptr_copy_8(pIV, pIV1, pIV2, pIV3, pIV4, pIV5, pIV6, pIV7, pIV8); - ptr_copy_8((void **)pBufferOut, - pBufOut1, pBufOut2, pBufOut3, pBufOut4, - pBufOut5, pBufOut6, pBufOut7, pBufOut8); + ptr_copy_8((void **) pBufferOut, pBufOut1, pBufOut2, pBufOut3, pBufOut4, pBufOut5, pBufOut6, + pBufOut7, pBufOut8); #ifdef SAFE_PARAM const size_t num_lanes = 8; @@ -3224,11 +3021,9 @@ void SNOW3G_F8_8_BUFFER(const snow3g_key_schedule_t *pHandle, } if (!cptr_check(pIV, num_lanes, IMB_ERR_NULL_IV)) return; - if (!cptr_check((const void * const *)pBufferIn, - num_lanes, - IMB_ERR_NULL_SRC)) + if (!cptr_check((const void *const *) pBufferIn, num_lanes, IMB_ERR_NULL_SRC)) return; - if (!ptr_check((void **)pBufferOut, num_lanes, IMB_ERR_NULL_DST)) + if (!ptr_check((void **) pBufferOut, num_lanes, IMB_ERR_NULL_DST)) return; if (!length_check(lengthInBytes, num_lanes)) return; @@ -3240,27 +3035,22 @@ void SNOW3G_F8_8_BUFFER(const snow3g_key_schedule_t *pHandle, CLEAR_SCRATCH_SIMD_REGS(); #endif /* SAFE_DATA */ - snow3g_8_buffer_ks_32_8(pHandle, pIV, pBufferIn, - pBufferOut, lengthInBytes); + snow3g_8_buffer_ks_32_8(pHandle, pIV, pBufferIn, pBufferOut, lengthInBytes); #ifdef SAFE_DATA CLEAR_SCRATCH_GPS(); CLEAR_SCRATCH_SIMD_REGS(); #endif #else /* ~AVX2 */ - SNOW3G_F8_4_BUFFER(pHandle, - pIV[0], pIV[1], pIV[2], pIV[3], - pBufferIn[0], pBufferOut[0], lengthInBytes[0], - pBufferIn[1], pBufferOut[1], lengthInBytes[1], - pBufferIn[2], pBufferOut[2], lengthInBytes[2], - pBufferIn[3], pBufferOut[3], lengthInBytes[3]); - - SNOW3G_F8_4_BUFFER(pHandle, - pIV[4], pIV[5], pIV[6], pIV[7], - pBufferIn[4], pBufferOut[4], lengthInBytes[4], - pBufferIn[5], pBufferOut[5], lengthInBytes[5], - pBufferIn[6], pBufferOut[6], lengthInBytes[6], - pBufferIn[7], pBufferOut[7], lengthInBytes[7]); + SNOW3G_F8_4_BUFFER(pHandle, pIV[0], pIV[1], pIV[2], pIV[3], pBufferIn[0], pBufferOut[0], + lengthInBytes[0], pBufferIn[1], pBufferOut[1], lengthInBytes[1], + pBufferIn[2], pBufferOut[2], lengthInBytes[2], pBufferIn[3], + pBufferOut[3], lengthInBytes[3]); + + SNOW3G_F8_4_BUFFER(pHandle, pIV[4], pIV[5], pIV[6], pIV[7], pBufferIn[4], pBufferOut[4], + lengthInBytes[4], pBufferIn[5], pBufferOut[5], lengthInBytes[5], + pBufferIn[6], pBufferOut[6], lengthInBytes[6], pBufferIn[7], + pBufferOut[7], lengthInBytes[7]); #endif /* AVX */ } @@ -3278,12 +3068,10 @@ void SNOW3G_F8_8_BUFFER(const snow3g_key_schedule_t *pHandle, * @param[in] bufLenInBytes pointer to an array of message lengths in bytes * @param[in] packetCount number of packets to process (N) */ -void SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufLenInBytes[], - const uint32_t packetCount) +void +SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufLenInBytes[], const uint32_t packetCount) { #ifdef SAFE_PARAM /* reset error status */ @@ -3295,11 +3083,9 @@ void SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, } if (!cptr_check(IV, packetCount, IMB_ERR_NULL_IV)) return; - if (!cptr_check((const void * const *)pBufferIn, - packetCount, - IMB_ERR_NULL_SRC)) + if (!cptr_check((const void *const *) pBufferIn, packetCount, IMB_ERR_NULL_SRC)) return; - if (!ptr_check((void **)pBufferOut, packetCount, IMB_ERR_NULL_DST)) + if (!ptr_check((void **) pBufferOut, packetCount, IMB_ERR_NULL_DST)) return; if (!length_check(bufLenInBytes, packetCount)) return; @@ -3320,23 +3106,22 @@ void SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, uint8_t *srctempbuff; uint8_t *dsttempbuff; uint8_t *ivtempbuff; - uint8_t *pSrcBuf[NUM_PACKETS_16] = {NULL}; - uint8_t *pDstBuf[NUM_PACKETS_16] = {NULL}; - uint8_t *pIV[NUM_PACKETS_16] = {NULL}; - uint32_t lensBuf[NUM_PACKETS_16] = {0}; + uint8_t *pSrcBuf[NUM_PACKETS_16] = { NULL }; + uint8_t *pDstBuf[NUM_PACKETS_16] = { NULL }; + uint8_t *pIV[NUM_PACKETS_16] = { NULL }; + uint32_t lensBuf[NUM_PACKETS_16] = { 0 }; - memcpy((void *)lensBuf, bufLenInBytes, packetCount * sizeof(uint32_t)); - memcpy((void *)pSrcBuf, pBufferIn, packetCount * sizeof(void *)); - memcpy((void *)pDstBuf, pBufferOut, packetCount * sizeof(void *)); - memcpy((void *)pIV, IV, packetCount * sizeof(void *)); + memcpy((void *) lensBuf, bufLenInBytes, packetCount * sizeof(uint32_t)); + memcpy((void *) pSrcBuf, pBufferIn, packetCount * sizeof(void *)); + memcpy((void *) pDstBuf, pBufferOut, packetCount * sizeof(void *)); + memcpy((void *) pIV, IV, packetCount * sizeof(void *)); packet_index = packetCount; while (packet_index--) { /* check if all packets are sorted by decreasing length */ - if (packet_index > 0 && lensBuf[packet_index - 1] < - lensBuf[packet_index]) { + if (packet_index > 0 && lensBuf[packet_index - 1] < lensBuf[packet_index]) { /* this packet array is not correctly sorted */ sortNeeded = 1; } @@ -3358,8 +3143,7 @@ void SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, inner_index = packet_index; while (inner_index--) { - if (lensBuf[packet_index] > - lensBuf[inner_index]) { + if (lensBuf[packet_index] > lensBuf[inner_index]) { /* swap buffers to arrange in descending order from [0]. */ @@ -3367,16 +3151,12 @@ void SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, dsttempbuff = pDstBuf[packet_index]; ivtempbuff = pIV[packet_index]; - const int tempLen = - lensBuf[packet_index]; + const int tempLen = lensBuf[packet_index]; - pSrcBuf[packet_index] = - pSrcBuf[inner_index]; - pDstBuf[packet_index] = - pDstBuf[inner_index]; + pSrcBuf[packet_index] = pSrcBuf[inner_index]; + pDstBuf[packet_index] = pDstBuf[inner_index]; pIV[packet_index] = pIV[inner_index]; - lensBuf[packet_index] = - lensBuf[inner_index]; + lensBuf[packet_index] = lensBuf[inner_index]; pSrcBuf[inner_index] = srctempbuff; pDstBuf[inner_index] = dsttempbuff; @@ -3392,83 +3172,52 @@ void SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, #ifdef AVX2 while (pktCnt >= 8) { pktCnt -= 8; - SNOW3G_F8_8_BUFFER(pCtx, pIV[packet_index], - pIV[packet_index + 1], - pIV[packet_index + 2], - pIV[packet_index + 3], - pIV[packet_index + 4], - pIV[packet_index + 5], - pIV[packet_index + 6], - pIV[packet_index + 7], - pSrcBuf[packet_index], - pDstBuf[packet_index], - lensBuf[packet_index], - pSrcBuf[packet_index + 1], - pDstBuf[packet_index + 1], - lensBuf[packet_index + 1], - pSrcBuf[packet_index + 2], - pDstBuf[packet_index + 2], - lensBuf[packet_index + 2], - pSrcBuf[packet_index + 3], - pDstBuf[packet_index + 3], - lensBuf[packet_index + 3], - pSrcBuf[packet_index + 4], - pDstBuf[packet_index + 4], - lensBuf[packet_index + 4], - pSrcBuf[packet_index + 5], - pDstBuf[packet_index + 5], - lensBuf[packet_index + 5], - pSrcBuf[packet_index + 6], - pDstBuf[packet_index + 6], - lensBuf[packet_index + 6], - pSrcBuf[packet_index + 7], - pDstBuf[packet_index + 7], - lensBuf[packet_index + 7]); + SNOW3G_F8_8_BUFFER( + pCtx, pIV[packet_index], pIV[packet_index + 1], pIV[packet_index + 2], + pIV[packet_index + 3], pIV[packet_index + 4], pIV[packet_index + 5], + pIV[packet_index + 6], pIV[packet_index + 7], pSrcBuf[packet_index], + pDstBuf[packet_index], lensBuf[packet_index], pSrcBuf[packet_index + 1], + pDstBuf[packet_index + 1], lensBuf[packet_index + 1], + pSrcBuf[packet_index + 2], pDstBuf[packet_index + 2], + lensBuf[packet_index + 2], pSrcBuf[packet_index + 3], + pDstBuf[packet_index + 3], lensBuf[packet_index + 3], + pSrcBuf[packet_index + 4], pDstBuf[packet_index + 4], + lensBuf[packet_index + 4], pSrcBuf[packet_index + 5], + pDstBuf[packet_index + 5], lensBuf[packet_index + 5], + pSrcBuf[packet_index + 6], pDstBuf[packet_index + 6], + lensBuf[packet_index + 6], pSrcBuf[packet_index + 7], + pDstBuf[packet_index + 7], lensBuf[packet_index + 7]); packet_index += 8; } #endif /* process 4 buffers at-a-time */ while (pktCnt >= 4) { pktCnt -= 4; - SNOW3G_F8_4_BUFFER(pCtx, pIV[packet_index + 0], - pIV[packet_index + 1], - pIV[packet_index + 2], - pIV[packet_index + 3], - pSrcBuf[packet_index + 0], - pDstBuf[packet_index + 0], - lensBuf[packet_index + 0], - pSrcBuf[packet_index + 1], - pDstBuf[packet_index + 1], - lensBuf[packet_index + 1], - pSrcBuf[packet_index + 2], - pDstBuf[packet_index + 2], - lensBuf[packet_index + 2], - pSrcBuf[packet_index + 3], - pDstBuf[packet_index + 3], - lensBuf[packet_index + 3]); + SNOW3G_F8_4_BUFFER(pCtx, pIV[packet_index + 0], pIV[packet_index + 1], + pIV[packet_index + 2], pIV[packet_index + 3], + pSrcBuf[packet_index + 0], pDstBuf[packet_index + 0], + lensBuf[packet_index + 0], pSrcBuf[packet_index + 1], + pDstBuf[packet_index + 1], lensBuf[packet_index + 1], + pSrcBuf[packet_index + 2], pDstBuf[packet_index + 2], + lensBuf[packet_index + 2], pSrcBuf[packet_index + 3], + pDstBuf[packet_index + 3], lensBuf[packet_index + 3]); packet_index += 4; } /* process 2 packets at-a-time */ while (pktCnt >= 2) { pktCnt -= 2; - SNOW3G_F8_2_BUFFER(pCtx, pIV[packet_index + 0], - pIV[packet_index + 1], - pSrcBuf[packet_index + 0], - pDstBuf[packet_index + 0], - lensBuf[packet_index + 0], - pSrcBuf[packet_index + 1], - pDstBuf[packet_index + 1], - lensBuf[packet_index + 1]); + SNOW3G_F8_2_BUFFER(pCtx, pIV[packet_index + 0], pIV[packet_index + 1], + pSrcBuf[packet_index + 0], pDstBuf[packet_index + 0], + lensBuf[packet_index + 0], pSrcBuf[packet_index + 1], + pDstBuf[packet_index + 1], lensBuf[packet_index + 1]); packet_index += 2; } /* remaining packets are processed 1 at a time */ while (pktCnt--) { - SNOW3G_F8_1_BUFFER(pCtx, pIV[packet_index + 0], - pSrcBuf[packet_index + 0], - pDstBuf[packet_index + 0], - lensBuf[packet_index + 0]); + SNOW3G_F8_1_BUFFER(pCtx, pIV[packet_index + 0], pSrcBuf[packet_index + 0], + pDstBuf[packet_index + 0], lensBuf[packet_index + 0]); packet_index++; } } @@ -3487,26 +3236,21 @@ void SNOW3G_F8_N_BUFFER(const snow3g_key_schedule_t *pCtx, * @param[in] bufLenInBytes pointer to an array of message lengths in bytes * @param[in] packetCount number of packets to process (N) */ -void SNOW3G_F8_N_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pCtx[], - const void * const IV[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t bufLenInBytes[], - const uint32_t packetCount) +void +SNOW3G_F8_N_BUFFER_MULTIKEY(const snow3g_key_schedule_t *const pCtx[], const void *const IV[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t bufLenInBytes[], const uint32_t packetCount) { #ifdef SAFE_PARAM /* reset error status */ imb_set_errno(NULL, 0); - if (!cptr_check((const void * const *)pCtx, packetCount, - IMB_ERR_NULL_EXP_KEY)) + if (!cptr_check((const void *const *) pCtx, packetCount, IMB_ERR_NULL_EXP_KEY)) return; if (!cptr_check(IV, packetCount, IMB_ERR_NULL_IV)) return; - if (!cptr_check((const void * const *)pBufferIn, - packetCount, - IMB_ERR_NULL_SRC)) + if (!cptr_check((const void *const *) pBufferIn, packetCount, IMB_ERR_NULL_SRC)) return; - if (!ptr_check((void **)pBufferOut, packetCount, IMB_ERR_NULL_DST)) + if (!ptr_check((void **) pBufferOut, packetCount, IMB_ERR_NULL_DST)) return; if (!length_check(bufLenInBytes, packetCount)) return; @@ -3526,26 +3270,25 @@ void SNOW3G_F8_N_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pCtx[], uint8_t *srctempbuff; uint8_t *dsttempbuff; uint8_t *ivtempbuff; - snow3g_key_schedule_t *pCtxBuf[NUM_PACKETS_16] = {NULL}; - uint8_t *pSrcBuf[NUM_PACKETS_16] = {NULL}; - uint8_t *pDstBuf[NUM_PACKETS_16] = {NULL}; - uint8_t *pIV[NUM_PACKETS_16] = {NULL}; - uint32_t lensBuf[NUM_PACKETS_16] = {0}; + snow3g_key_schedule_t *pCtxBuf[NUM_PACKETS_16] = { NULL }; + uint8_t *pSrcBuf[NUM_PACKETS_16] = { NULL }; + uint8_t *pDstBuf[NUM_PACKETS_16] = { NULL }; + uint8_t *pIV[NUM_PACKETS_16] = { NULL }; + uint32_t lensBuf[NUM_PACKETS_16] = { 0 }; snow3g_key_schedule_t *tempCtx; - memcpy((void *)pCtxBuf, pCtx, packetCount * sizeof(void *)); - memcpy((void *)lensBuf, bufLenInBytes, packetCount * sizeof(uint32_t)); - memcpy((void *)pSrcBuf, pBufferIn, packetCount * sizeof(void *)); - memcpy((void *)pDstBuf, pBufferOut, packetCount * sizeof(void *)); - memcpy((void *)pIV, IV, packetCount * sizeof(void *)); + memcpy((void *) pCtxBuf, pCtx, packetCount * sizeof(void *)); + memcpy((void *) lensBuf, bufLenInBytes, packetCount * sizeof(uint32_t)); + memcpy((void *) pSrcBuf, pBufferIn, packetCount * sizeof(void *)); + memcpy((void *) pDstBuf, pBufferOut, packetCount * sizeof(void *)); + memcpy((void *) pIV, IV, packetCount * sizeof(void *)); packet_index = packetCount; while (packet_index--) { /* check if all packets are sorted by decreasing length */ - if (packet_index > 0 && lensBuf[packet_index - 1] < - lensBuf[packet_index]) { + if (packet_index > 0 && lensBuf[packet_index - 1] < lensBuf[packet_index]) { /* this packet array is not correctly sorted */ sortNeeded = 1; } @@ -3564,28 +3307,22 @@ void SNOW3G_F8_N_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pCtx[], while (packet_index--) { inner_index = packet_index; while (inner_index--) { - if (lensBuf[packet_index] > - lensBuf[inner_index]) { + if (lensBuf[packet_index] > lensBuf[inner_index]) { /* swap buffers to arrange in descending order from [0]. */ srctempbuff = pSrcBuf[packet_index]; dsttempbuff = pDstBuf[packet_index]; ivtempbuff = pIV[packet_index]; - const int tempLen = - lensBuf[packet_index]; + const int tempLen = lensBuf[packet_index]; tempCtx = pCtxBuf[packet_index]; - pSrcBuf[packet_index] = - pSrcBuf[inner_index]; - pDstBuf[packet_index] = - pDstBuf[inner_index]; + pSrcBuf[packet_index] = pSrcBuf[inner_index]; + pDstBuf[packet_index] = pDstBuf[inner_index]; pIV[packet_index] = pIV[inner_index]; - lensBuf[packet_index] = - lensBuf[inner_index]; - pCtxBuf[packet_index] = - pCtxBuf[inner_index]; + lensBuf[packet_index] = lensBuf[inner_index]; + pCtxBuf[packet_index] = pCtxBuf[inner_index]; pSrcBuf[inner_index] = srctempbuff; pDstBuf[inner_index] = dsttempbuff; @@ -3603,12 +3340,10 @@ void SNOW3G_F8_N_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pCtx[], while (pktCnt >= 8) { pktCnt -= 8; SNOW3G_F8_8_BUFFER_MULTIKEY( - (const snow3g_key_schedule_t * const *) - &pCtxBuf[packet_index], - (const void * const *)&pIV[packet_index], - (const void * const *)&pSrcBuf[packet_index], - (void **)&pDstBuf[packet_index], - &lensBuf[packet_index]); + (const snow3g_key_schedule_t *const *) &pCtxBuf[packet_index], + (const void *const *) &pIV[packet_index], + (const void *const *) &pSrcBuf[packet_index], + (void **) &pDstBuf[packet_index], &lensBuf[packet_index]); packet_index += 8; } #endif @@ -3616,10 +3351,8 @@ void SNOW3G_F8_N_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pCtx[], /* @todo process 2 packets at-a-time */ /* remaining packets are processed 1 at a time */ while (pktCnt--) { - SNOW3G_F8_1_BUFFER(pCtxBuf[packet_index + 0], - pIV[packet_index + 0], - pSrcBuf[packet_index + 0], - pDstBuf[packet_index + 0], + SNOW3G_F8_1_BUFFER(pCtxBuf[packet_index + 0], pIV[packet_index + 0], + pSrcBuf[packet_index + 0], pDstBuf[packet_index + 0], lensBuf[packet_index + 0]); packet_index++; } @@ -3636,11 +3369,9 @@ void SNOW3G_F8_N_BUFFER_MULTIKEY(const snow3g_key_schedule_t * const pCtx[], * @param[in] lengthInBits message length in bits * @param[out] pDigest pointer to store the F9 digest */ -void SNOW3G_F9_1_BUFFER(const snow3g_key_schedule_t *pHandle, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest) +void +SNOW3G_F9_1_BUFFER(const snow3g_key_schedule_t *pHandle, const void *pIV, const void *pBufferIn, + const uint64_t lengthInBits, void *pDigest) { #ifdef SAFE_PARAM if (pHandle == NULL) { @@ -3672,7 +3403,7 @@ void SNOW3G_F9_1_BUFFER(const snow3g_key_schedule_t *pHandle, uint32_t z[5]; const uint64_t *inputBuffer; - inputBuffer = (const uint64_t *)pBufferIn; + inputBuffer = (const uint64_t *) pBufferIn; /* Initialize the SNOW3G key schedule */ snow3gStateInitialize_1(&ctx, pHandle, pIV); @@ -3681,17 +3412,14 @@ void SNOW3G_F9_1_BUFFER(const snow3g_key_schedule_t *pHandle, snow3g_f9_keystream_words(&ctx, &z[0]); /* Final MAC */ - *(uint32_t *)pDigest = + *(uint32_t *) pDigest = #ifdef NO_AESNI - snow3g_f9_1_buffer_internal_sse_no_aesni(&inputBuffer[0], - z, lengthInBits); + snow3g_f9_1_buffer_internal_sse_no_aesni(&inputBuffer[0], z, lengthInBits); #elif defined(SSE) - snow3g_f9_1_buffer_internal_sse(&inputBuffer[0], - z, lengthInBits); -#else /* AVX / AVX2 / AVX512 */ - snow3g_f9_1_buffer_internal_avx(&inputBuffer[0], - z, lengthInBits); + snow3g_f9_1_buffer_internal_sse(&inputBuffer[0], z, lengthInBits); +#else /* AVX / AVX2 / AVX512 */ + snow3g_f9_1_buffer_internal_avx(&inputBuffer[0], z, lengthInBits); #endif /* NO_AESNI */ #ifdef SAFE_DATA CLEAR_MEM(&z, sizeof(z)); @@ -3713,11 +3441,9 @@ void SNOW3G_F9_1_BUFFER(const snow3g_key_schedule_t *pHandle, * @param[in] lengthInBits message length in bits * @param[out] pDigest pointer to store the F9 digest */ -void snow3g_f9_1_buffer_vaes_avx512(const snow3g_key_schedule_t *pHandle, - const void *pIV, - const void *pBufferIn, - const uint64_t lengthInBits, - void *pDigest) +void +snow3g_f9_1_buffer_vaes_avx512(const snow3g_key_schedule_t *pHandle, const void *pIV, + const void *pBufferIn, const uint64_t lengthInBits, void *pDigest) { #ifdef SAFE_PARAM if (pHandle == NULL) { @@ -3755,10 +3481,8 @@ void snow3g_f9_1_buffer_vaes_avx512(const snow3g_key_schedule_t *pHandle, snow3g_f9_keystream_words(&ctx, z); /* Final MAC */ - *(uint32_t *)pDigest = - snow3g_f9_1_buffer_internal_vaes_avx512((const uint64_t *) - pBufferIn, z, - lengthInBits); + *(uint32_t *) pDigest = snow3g_f9_1_buffer_internal_vaes_avx512( + (const uint64_t *) pBufferIn, z, lengthInBits); #ifdef SAFE_DATA CLEAR_MEM(z, sizeof(z)); CLEAR_MEM(&ctx, sizeof(ctx)); diff --git a/lib/include/snow3g_submit.h b/lib/include/snow3g_submit.h index 9d98ddee..17a94a0a 100644 --- a/lib/include/snow3g_submit.h +++ b/lib/include/snow3g_submit.h @@ -30,7 +30,8 @@ #include "ipsec-mb.h" -static inline IMB_JOB *def_submit_snow3g_uea2_job(IMB_MGR *state, IMB_JOB *job) +static inline IMB_JOB * +def_submit_snow3g_uea2_job(IMB_MGR *state, IMB_JOB *job) { const snow3g_key_schedule_t *key = job->enc_keys; const uint32_t bitlen = (uint32_t) job->msg_len_to_cipher_in_bits; @@ -41,8 +42,7 @@ static inline IMB_JOB *def_submit_snow3g_uea2_job(IMB_MGR *state, IMB_JOB *job) * - bit offset is not a multiple of bytes */ if ((bitlen & 0x07) || (bitoff & 0x07)) { - IMB_SNOW3G_F8_1_BUFFER_BIT(state, key, job->iv, job->src, - job->dst, bitlen, bitoff); + IMB_SNOW3G_F8_1_BUFFER_BIT(state, key, job->iv, job->src, job->dst, bitlen, bitoff); } else { const uint32_t bytelen = bitlen >> 3; const uint32_t byteoff = bitoff >> 3; @@ -56,7 +56,8 @@ static inline IMB_JOB *def_submit_snow3g_uea2_job(IMB_MGR *state, IMB_JOB *job) return job; } -static inline IMB_JOB *def_flush_snow3g_uea2_job(IMB_MGR *state) +static inline IMB_JOB * +def_flush_snow3g_uea2_job(IMB_MGR *state) { (void) state; return NULL; diff --git a/lib/include/snow3g_tables.h b/lib/include/snow3g_tables.h index f3cbf218..a39fb3dd 100644 --- a/lib/include/snow3g_tables.h +++ b/lib/include/snow3g_tables.h @@ -34,7 +34,7 @@ #ifndef __aarch64__ #include "constant_lookup.h" -#if defined (AVX) || defined (AVX2) +#if defined(AVX) || defined(AVX2) #define SNOW3G_SAFE_LUT8(table, idx, size) LOOKUP8_AVX(table, idx, size) #else /* SSE */ #define SNOW3G_SAFE_LUT8(table, idx, size) LOOKUP8_SSE(table, idx, size) diff --git a/lib/include/wireless_common.h b/lib/include/wireless_common.h index 2fb27b23..ae964784 100644 --- a/lib/include/wireless_common.h +++ b/lib/include/wireless_common.h @@ -38,11 +38,11 @@ #endif #endif /* __aarch64__ */ -#define NUM_PACKETS_1 1 -#define NUM_PACKETS_2 2 -#define NUM_PACKETS_3 3 -#define NUM_PACKETS_4 4 -#define NUM_PACKETS_8 8 +#define NUM_PACKETS_1 1 +#define NUM_PACKETS_2 2 +#define NUM_PACKETS_3 3 +#define NUM_PACKETS_4 4 +#define NUM_PACKETS_8 8 #define NUM_PACKETS_16 16 #ifdef LINUX @@ -70,28 +70,28 @@ typedef union _m64_u { } m64_t; #endif -static inline uint32_t bswap4(const uint32_t val) +static inline uint32_t +bswap4(const uint32_t val) { return BSWAP32(val); } /************************************************************************* -* @description - this function is used to copy the right number of bytes -* from the source to destination buffer -* -* @param pSrc [IN] - pointer to an input Byte array (at least len bytes -* available) -* @param pDst [IN] - pointer to the output buffer (at least len bytes available) -* @param len [IN] - length in bytes to copy (0 to 4) -* -*************************************************************************/ -static inline void memcpy_keystream_32(uint8_t *pDst, - const uint8_t *pSrc, - const uint32_t len) + * @description - this function is used to copy the right number of bytes + * from the source to destination buffer + * + * @param pSrc [IN] - pointer to an input Byte array (at least len bytes + * available) + * @param pDst [IN] - pointer to the output buffer (at least len bytes available) + * @param len [IN] - length in bytes to copy (0 to 4) + * + *************************************************************************/ +static inline void +memcpy_keystream_32(uint8_t *pDst, const uint8_t *pSrc, const uint32_t len) { switch (len) { case 4: - *(uint32_t *)pDst = *(const uint32_t *)pSrc; + *(uint32_t *) pDst = *(const uint32_t *) pSrc; break; case 3: pDst[2] = pSrc[2]; @@ -106,20 +106,19 @@ static inline void memcpy_keystream_32(uint8_t *pDst, } /************************************************************************* -* @description - this function is used to XOR the right number of bytes -* from a keystrea and a source into a destination buffer -* -* @param pSrc [IN] - pointer to an input Byte array (at least 4 bytes available) -* @param pDst [IN] - pointer to the output buffer (at least 4 bytes available) -* @param KS [IN] - 4 bytes of keystream number, must be reversed -* into network byte order before XOR -* -*************************************************************************/ -static inline void xor_keystream_reverse_32(uint8_t *pDst, - const uint8_t *pSrc, - const uint32_t KS) + * @description - this function is used to XOR the right number of bytes + * from a keystrea and a source into a destination buffer + * + * @param pSrc [IN] - pointer to an input Byte array (at least 4 bytes available) + * @param pDst [IN] - pointer to the output buffer (at least 4 bytes available) + * @param KS [IN] - 4 bytes of keystream number, must be reversed + * into network byte order before XOR + * + *************************************************************************/ +static inline void +xor_keystream_reverse_32(uint8_t *pDst, const uint8_t *pSrc, const uint32_t KS) { - *(uint32_t *)pDst = (*(const uint32_t *)pSrc) ^ BSWAP32(KS); + *(uint32_t *) pDst = (*(const uint32_t *) pSrc) ^ BSWAP32(KS); } /****************************************************************************** @@ -133,10 +132,10 @@ static inline const uint8_t * xor_keystrm_rev(uint8_t *pDst, const uint8_t *pSrc, uint64_t keyStream) { /* default: XOR ONLY, read the input buffer, update the output buffer */ - const uint64_t *pSrc64 = (const uint64_t *)pSrc; - uint64_t *pDst64 = (uint64_t *)pDst; + const uint64_t *pSrc64 = (const uint64_t *) pSrc; + uint64_t *pDst64 = (uint64_t *) pDst; *pDst64 = *pSrc64 ^ BSWAP64(keyStream); - return (const uint8_t *)(pSrc64 + 1); + return (const uint8_t *) (pSrc64 + 1); } /****************************************************************************** @@ -153,7 +152,7 @@ memcpy_keystrm(uint8_t *pDst, const uint8_t *pSrc, const uint32_t len) { switch (len) { case 8: - *(uint64_t *)pDst = *(const uint64_t *)pSrc; + *(uint64_t *) pDst = *(const uint64_t *) pSrc; break; case 7: pDst[6] = pSrc[6]; @@ -165,7 +164,7 @@ memcpy_keystrm(uint8_t *pDst, const uint8_t *pSrc, const uint32_t len) pDst[4] = pSrc[4]; /* fall-through */ case 4: - *(uint32_t *)pDst = *(const uint32_t *)pSrc; + *(uint32_t *) pDst = *(const uint32_t *) pSrc; break; case 3: pDst[2] = pSrc[2]; @@ -190,14 +189,12 @@ memcpy_keystrm(uint8_t *pDst, const uint8_t *pSrc, const uint32_t len) * @param save_end place to store end byte */ static inline void -save_msg_start_end(const void *msg, - const size_t bit_offset, const size_t bit_length, +save_msg_start_end(const void *msg, const size_t bit_offset, const size_t bit_length, uint8_t *save_start, uint8_t *save_end) { const uint8_t *msg_ptr = (const uint8_t *) msg; - const size_t mstart_bit = bit_offset & 7; /* inclusive */ - const size_t mend_bit = - (mstart_bit + bit_length) & 7; /* non-inclusive */ + const size_t mstart_bit = bit_offset & 7; /* inclusive */ + const size_t mend_bit = (mstart_bit + bit_length) & 7; /* non-inclusive */ *save_start = 0; *save_end = 0; @@ -228,8 +225,7 @@ save_msg_start_end(const void *msg, * @param save_end saved end byte to be restored */ static inline void -restore_msg_start_end(void *msg, - const size_t bit_offset, const size_t bit_length, +restore_msg_start_end(void *msg, const size_t bit_offset, const size_t bit_length, const uint8_t save_start, const uint8_t save_end) { uint8_t *msg_ptr = (uint8_t *) msg; @@ -253,8 +249,7 @@ restore_msg_start_end(void *msg, * @param bit_length message length in bits */ static inline void -copy_bits(void *dst, const void *src, - const size_t bit_offset, const size_t bit_length) +copy_bits(void *dst, const void *src, const size_t bit_offset, const size_t bit_length) { uint8_t *dp = (uint8_t *) dst; const uint8_t *sp = &((const uint8_t *) src)[bit_offset >> 3]; @@ -265,12 +260,11 @@ copy_bits(void *dst, const void *src, if (bit_length == 0) return; - for ( ; byte_length >= 1; byte_length--) { + for (; byte_length >= 1; byte_length--) { if (mstart_bit == 0) { *dp++ = *sp++; } else { - *dp++ = (sp[0] << mstart_bit) | - (sp[1] >> (8 - mstart_bit)); + *dp++ = (sp[0] << mstart_bit) | (sp[1] >> (8 - mstart_bit)); sp++; } } @@ -322,7 +316,7 @@ shift_bits(void *msg, const size_t bit_offset, const size_t bit_length) return; } - for ( ; byte_length >= 1; byte_length--) { + for (; byte_length >= 1; byte_length--) { const uint8_t c = *dst; *dst++ = (c >> mstart_bit) | byte_save; @@ -336,7 +330,6 @@ shift_bits(void *msg, const size_t bit_offset, const size_t bit_length) } } - /** ****************************************************************************** * @@ -352,8 +345,8 @@ shift_bits(void *msg, const size_t bit_offset, const size_t bit_length) * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_XorKeyStream16B_sse(const void *pIn, void *pOut, - const void *pKey); +IMB_DLL_LOCAL void +asm_XorKeyStream16B_sse(const void *pIn, void *pOut, const void *pKey); /** ****************************************************************************** @@ -370,8 +363,8 @@ IMB_DLL_LOCAL void asm_XorKeyStream16B_sse(const void *pIn, void *pOut, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_XorKeyStream16B_avx(const void *pIn, void *pOut, - const void *pKey); +IMB_DLL_LOCAL void +asm_XorKeyStream16B_avx(const void *pIn, void *pOut, const void *pKey); /** ****************************************************************************** @@ -388,8 +381,8 @@ IMB_DLL_LOCAL void asm_XorKeyStream16B_avx(const void *pIn, void *pOut, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_XorKeyStream32B_avx2(const void *pIn, void *pOut, - const void *pKey); +IMB_DLL_LOCAL void +asm_XorKeyStream32B_avx2(const void *pIn, void *pOut, const void *pKey); /** ****************************************************************************** @@ -406,8 +399,8 @@ IMB_DLL_LOCAL void asm_XorKeyStream32B_avx2(const void *pIn, void *pOut, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_XorKeyStream64B_avx512(const void *pIn, void *pOut, - const void *pKey); +IMB_DLL_LOCAL void +asm_XorKeyStream64B_avx512(const void *pIn, void *pOut, const void *pKey); #endif /* __aarch64__ */ #endif /* _WIRELESS_COMMON_H_ */ diff --git a/lib/include/zuc_internal.h b/lib/include/zuc_internal.h old mode 100755 new mode 100644 index 43fff3b6..e93062a5 --- a/lib/include/zuc_internal.h +++ b/lib/include/zuc_internal.h @@ -50,24 +50,23 @@ #include "include/wireless_common.h" /* 64 bytes of Keystream will be generated */ -#define ZUC_KEYSTR_LEN (64) -#define NUM_LFSR_STATES (16) -#define ZUC_WORD_BITS (32) -#define ZUC_WORD_BYTES (ZUC_WORD_BITS / 8) +#define ZUC_KEYSTR_LEN (64) +#define NUM_LFSR_STATES (16) +#define ZUC_WORD_BITS (32) +#define ZUC_WORD_BYTES (ZUC_WORD_BITS / 8) /* Range of input data for ZUC is from 1 to 65504 bits */ -#define ZUC_MIN_BITLEN 1 -#define ZUC_MAX_BITLEN 65504 -#define ZUC_MIN_BYTELEN 1 -#define ZUC_MAX_BYTELEN (ZUC_MAX_BITLEN / 8) +#define ZUC_MIN_BITLEN 1 +#define ZUC_MAX_BITLEN 65504 +#define ZUC_MIN_BYTELEN 1 +#define ZUC_MAX_BYTELEN (ZUC_MAX_BITLEN / 8) #ifdef DEBUG #ifdef _WIN32 -#define DEBUG_PRINT(_fmt, ...) \ - fprintf(stderr, "%s()::%d " _fmt , __FUNCTION__, __LINE__, __VA_ARGS__) +#define DEBUG_PRINT(_fmt, ...) \ + fprintf(stderr, "%s()::%d " _fmt, __FUNCTION__, __LINE__, __VA_ARGS__) #else -#define DEBUG_PRINT(_fmt, ...) \ - fprintf(stderr, "%s()::%d " _fmt , __func__, __LINE__, __VA_ARGS__) +#define DEBUG_PRINT(_fmt, ...) fprintf(stderr, "%s()::%d " _fmt, __func__, __LINE__, __VA_ARGS__) #endif #else #define DEBUG_PRINT(_fmt, ...) @@ -81,21 +80,21 @@ * KeyStream bytes must be swapped on 32bit boundary before this operation * *****************************************************************************/ -#define ZUC_XOR_KEYSTREAM(pIn64, pOut64, pKeyStream64) \ -{ \ - int i =0; \ - union SwapBytes_t { \ - uint64_t l64; \ - uint32_t w32[2]; \ - }swapBytes; \ - /* loop through the key stream and xor 64 bits at a time */ \ - for(i =0; i < ZUC_KEYSTR_LEN/8; i++) { \ - swapBytes.l64 = *pKeyStream64++; \ - swapBytes.w32[0] = bswap4(swapBytes.w32[0]); \ - swapBytes.w32[1] = bswap4(swapBytes.w32[1]); \ - *pOut64++ = *pIn64++ ^ swapBytes.l64; \ - } \ -} +#define ZUC_XOR_KEYSTREAM(pIn64, pOut64, pKeyStream64) \ + { \ + int i = 0; \ + union SwapBytes_t { \ + uint64_t l64; \ + uint32_t w32[2]; \ + } swapBytes; \ + /* loop through the key stream and xor 64 bits at a time */ \ + for (i = 0; i < ZUC_KEYSTR_LEN / 8; i++) { \ + swapBytes.l64 = *pKeyStream64++; \ + swapBytes.w32[0] = bswap4(swapBytes.w32[0]); \ + swapBytes.w32[1] = bswap4(swapBytes.w32[1]); \ + *pOut64++ = *pIn64++ ^ swapBytes.l64; \ + } \ + } /** ***************************************************************************** @@ -103,20 +102,20 @@ * Packed structure to store the ZUC state for 4 packets. * *****************************************************************************/ typedef struct zuc_state_4_s { - uint32_t lfsrState[16][4]; - /**< State registers of the LFSR */ - uint32_t fR1[4]; - /**< register of F */ - uint32_t fR2[4]; - /**< register of F */ - uint32_t bX0[4]; - /**< Output X0 of the bit reorganization for 4 packets */ - uint32_t bX1[4]; - /**< Output X1 of the bit reorganization for 4 packets */ - uint32_t bX2[4]; - /**< Output X2 of the bit reorganization for 4 packets */ - uint32_t bX3[4]; - /**< Output X3 of the bit reorganization for 4 packets */ + uint32_t lfsrState[16][4]; + /**< State registers of the LFSR */ + uint32_t fR1[4]; + /**< register of F */ + uint32_t fR2[4]; + /**< register of F */ + uint32_t bX0[4]; + /**< Output X0 of the bit reorganization for 4 packets */ + uint32_t bX1[4]; + /**< Output X1 of the bit reorganization for 4 packets */ + uint32_t bX2[4]; + /**< Output X2 of the bit reorganization for 4 packets */ + uint32_t bX3[4]; + /**< Output X3 of the bit reorganization for 4 packets */ } ZucState4_t; /** @@ -125,20 +124,20 @@ typedef struct zuc_state_4_s { * Packed structure to store the ZUC state for 8 packets. * *****************************************************************************/ typedef struct zuc_state_8_s { - uint32_t lfsrState[16][8]; - /**< State registers of the LFSR */ - uint32_t fR1[8]; - /**< register of F */ - uint32_t fR2[8]; - /**< register of F */ - uint32_t bX0[8]; - /**< Output X0 of the bit reorganization for 8 packets */ - uint32_t bX1[8]; - /**< Output X1 of the bit reorganization for 8 packets */ - uint32_t bX2[8]; - /**< Output X2 of the bit reorganization for 8 packets */ - uint32_t bX3[8]; - /**< Output X3 of the bit reorganization for 8 packets */ + uint32_t lfsrState[16][8]; + /**< State registers of the LFSR */ + uint32_t fR1[8]; + /**< register of F */ + uint32_t fR2[8]; + /**< register of F */ + uint32_t bX0[8]; + /**< Output X0 of the bit reorganization for 8 packets */ + uint32_t bX1[8]; + /**< Output X1 of the bit reorganization for 8 packets */ + uint32_t bX2[8]; + /**< Output X2 of the bit reorganization for 8 packets */ + uint32_t bX3[8]; + /**< Output X3 of the bit reorganization for 8 packets */ } ZucState8_t; /** @@ -147,20 +146,20 @@ typedef struct zuc_state_8_s { * Packed structure to store the ZUC state for a single packet. * *****************************************************************************/ typedef struct zuc_state_s { - uint32_t lfsrState[16]; - /**< State registers of the LFSR */ - uint32_t fR1; - /**< register of F */ - uint32_t fR2; - /**< register of F */ - uint32_t bX0; - /**< Output X0 of the bit reorganization */ - uint32_t bX1; - /**< Output X1 of the bit reorganization */ - uint32_t bX2; - /**< Output X2 of the bit reorganization */ - uint32_t bX3; - /**< Output X3 of the bit reorganization */ + uint32_t lfsrState[16]; + /**< State registers of the LFSR */ + uint32_t fR1; + /**< register of F */ + uint32_t fR2; + /**< register of F */ + uint32_t bX0; + /**< Output X0 of the bit reorganization */ + uint32_t bX1; + /**< Output X1 of the bit reorganization */ + uint32_t bX2; + /**< Output X2 of the bit reorganization */ + uint32_t bX3; + /**< Output X3 of the bit reorganization */ } ZucState_t; /** @@ -170,8 +169,8 @@ typedef struct zuc_state_s { * @ref asm_ZucInitialization_4 and @ref asm_ZucGenKeystream64B_4 *****************************************************************************/ typedef struct zuc_key_4_s { - const uint8_t *pKeys[4]; - /**< Array of pointers to 128-bit keys for the 4 packets */ + const uint8_t *pKeys[4]; + /**< Array of pointers to 128-bit keys for the 4 packets */ } ZucKey4_t; /** @@ -181,8 +180,8 @@ typedef struct zuc_key_4_s { * @ref asm_ZucInitialization_8 and @ref asm_ZucGenKeystream64B_8 *****************************************************************************/ typedef struct zuc_key_8_s { - const uint8_t *pKeys[8]; - /**< Array of pointers to 128-bit keys for the 8 packets */ + const uint8_t *pKeys[8]; + /**< Array of pointers to 128-bit keys for the 8 packets */ } ZucKey8_t; /** @@ -192,8 +191,8 @@ typedef struct zuc_key_8_s { * @ref asm_ZucInitialization_16 and @ref asm_ZucGenKeystream64B_16 *****************************************************************************/ typedef struct zuc_key_16_s { - const uint8_t *pKeys[16]; - /**< Array of pointers to 128-bit keys for the 16 packets */ + const uint8_t *pKeys[16]; + /**< Array of pointers to 128-bit keys for the 16 packets */ } ZucKey16_t; #ifndef __aarch64__ @@ -219,17 +218,14 @@ typedef struct zuc_key_16_s { * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucInitialization_sse(const void *pKey, - const void *pIv, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_sse(const void *pKey, const void *pIv, ZucState_t *pState); -IMB_DLL_LOCAL void asm_ZucInitialization_sse_no_aesni(const void *pKey, - const void *pIv, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_sse_no_aesni(const void *pKey, const void *pIv, ZucState_t *pState); -IMB_DLL_LOCAL void asm_ZucInitialization_avx(const void *pKey, - const void *pIv, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_avx(const void *pKey, const void *pIv, ZucState_t *pState); /** ****************************************************************************** @@ -252,21 +248,17 @@ IMB_DLL_LOCAL void asm_ZucInitialization_avx(const void *pKey, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucInitialization_4_sse(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_4_sse(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState); -IMB_DLL_LOCAL void asm_ZucInitialization_4_sse_no_aesni(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_4_sse_no_aesni(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState); -IMB_DLL_LOCAL void asm_ZucInitialization_4_gfni_sse(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_4_gfni_sse(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState); -IMB_DLL_LOCAL void asm_ZucInitialization_4_avx(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_4_avx(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState); /** ****************************************************************************** @@ -297,30 +289,21 @@ IMB_DLL_LOCAL void asm_ZucInitialization_4_avx(ZucKey4_t *pKeys, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_Zuc256Initialization_4_sse(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState, - void *tags, - const uint64_t tag_sz); - -IMB_DLL_LOCAL void asm_Zuc256Initialization_4_sse_no_aesni(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState, - void *tags, - const uint64_t tag_sz); - -IMB_DLL_LOCAL void asm_Zuc256Initialization_4_gfni_sse(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState, - void *tags, - const uint64_t tag_sz); - -IMB_DLL_LOCAL void asm_Zuc256Initialization_4_avx(ZucKey4_t *pKeys, - const uint8_t *ivs, - ZucState4_t *pState, - void *tags, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Zuc256Initialization_4_sse(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState, + void *tags, const uint64_t tag_sz); + +IMB_DLL_LOCAL void +asm_Zuc256Initialization_4_sse_no_aesni(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState, + void *tags, const uint64_t tag_sz); + +IMB_DLL_LOCAL void +asm_Zuc256Initialization_4_gfni_sse(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState, + void *tags, const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Zuc256Initialization_4_avx(ZucKey4_t *pKeys, const uint8_t *ivs, ZucState4_t *pState, + void *tags, const uint64_t tag_sz); /** ****************************************************************************** @@ -343,12 +326,10 @@ IMB_DLL_LOCAL void asm_Zuc256Initialization_4_avx(ZucKey4_t *pKeys, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucInitialization_8_avx2(ZucKey8_t *pKeys, - const uint8_t *ivs, - ZucState8_t *pState); -IMB_DLL_LOCAL void asm_ZucInitialization_8_gfni_avx2(ZucKey8_t *pKeys, - const uint8_t *ivs, - ZucState8_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_8_avx2(ZucKey8_t *pKeys, const uint8_t *ivs, ZucState8_t *pState); +IMB_DLL_LOCAL void +asm_ZucInitialization_8_gfni_avx2(ZucKey8_t *pKeys, const uint8_t *ivs, ZucState8_t *pState); /** ****************************************************************************** @@ -379,16 +360,12 @@ IMB_DLL_LOCAL void asm_ZucInitialization_8_gfni_avx2(ZucKey8_t *pKeys, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_Zuc256Initialization_8_avx2(ZucKey8_t *pKeys, - const uint8_t *ivs, - ZucState8_t *pState, - void *tags, - const uint64_t tag_sz); -IMB_DLL_LOCAL void asm_Zuc256Initialization_8_gfni_avx2(ZucKey8_t *pKeys, - const uint8_t *ivs, - ZucState8_t *pState, - void *tags, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Zuc256Initialization_8_avx2(ZucKey8_t *pKeys, const uint8_t *ivs, ZucState8_t *pState, + void *tags, const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Zuc256Initialization_8_gfni_avx2(ZucKey8_t *pKeys, const uint8_t *ivs, ZucState8_t *pState, + void *tags, const uint64_t tag_sz); /** ****************************************************************************** @@ -411,15 +388,13 @@ IMB_DLL_LOCAL void asm_Zuc256Initialization_8_gfni_avx2(ZucKey8_t *pKeys, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucInitialization_16_avx512(ZucKey16_t *pKeys, - const uint8_t *ivs, - ZucState16_t *pState, - const uint16_t lane_mask); +IMB_DLL_LOCAL void +asm_ZucInitialization_16_avx512(ZucKey16_t *pKeys, const uint8_t *ivs, ZucState16_t *pState, + const uint16_t lane_mask); -IMB_DLL_LOCAL void asm_ZucInitialization_16_gfni_avx512(ZucKey16_t *pKeys, - const uint8_t *ivs, - ZucState16_t *pState, - const uint16_t lane_mask); +IMB_DLL_LOCAL void +asm_ZucInitialization_16_gfni_avx512(ZucKey16_t *pKeys, const uint8_t *ivs, ZucState16_t *pState, + const uint16_t lane_mask); /** ****************************************************************************** @@ -444,17 +419,13 @@ IMB_DLL_LOCAL void asm_ZucInitialization_16_gfni_avx512(ZucKey16_t *pKeys, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_Zuc256Initialization_16_avx512(ZucKey16_t *pKeys, - const uint8_t *ivs, - ZucState16_t *pState, - const uint16_t lane_mask, - const unsigned tag_sz); - -IMB_DLL_LOCAL void asm_Zuc256Initialization_16_gfni_avx512(ZucKey16_t *pKeys, - const uint8_t *ivs, - ZucState16_t *pState, - const uint16_t lane_mask, - const unsigned tag_sz); +IMB_DLL_LOCAL void +asm_Zuc256Initialization_16_avx512(ZucKey16_t *pKeys, const uint8_t *ivs, ZucState16_t *pState, + const uint16_t lane_mask, const unsigned tag_sz); + +IMB_DLL_LOCAL void +asm_Zuc256Initialization_16_gfni_avx512(ZucKey16_t *pKeys, const uint8_t *ivs, ZucState16_t *pState, + const uint16_t lane_mask, const unsigned tag_sz); /** ****************************************************************************** @@ -475,8 +446,8 @@ IMB_DLL_LOCAL void asm_Zuc256Initialization_16_gfni_avx512(ZucKey16_t *pKeys, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream64B_avx(uint32_t *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream64B_avx(uint32_t *pKeystream, ZucState_t *pState); /** ****************************************************************************** @@ -497,8 +468,8 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream64B_avx(uint32_t *pKeystream, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream32B_avx(uint32_t *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream32B_avx(uint32_t *pKeystream, ZucState_t *pState); /** ****************************************************************************** @@ -519,14 +490,14 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream32B_avx(uint32_t *pKeystream, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_avx(uint32_t *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_avx(uint32_t *pKeystream, ZucState_t *pState); -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_sse(uint32_t *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_sse(uint32_t *pKeystream, ZucState_t *pState); -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_sse_no_aesni(uint32_t *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_sse_no_aesni(uint32_t *pKeystream, ZucState_t *pState); /** ****************************************************************************** @@ -547,14 +518,14 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream16B_sse_no_aesni(uint32_t *pKeystream, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_sse(void *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_sse(void *pKeystream, ZucState_t *pState); -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_sse_no_aesni(void *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_sse_no_aesni(void *pKeystream, ZucState_t *pState); -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_avx(void *pKeystream, - ZucState_t *pState); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_avx(void *pKeystream, ZucState_t *pState); /** ****************************************************************************** @@ -579,17 +550,14 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream8B_avx(void *pKeystream, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream_sse(void *pKeystream, - ZucState_t *pState, - uint64_t numRounds); +IMB_DLL_LOCAL void +asm_ZucGenKeystream_sse(void *pKeystream, ZucState_t *pState, uint64_t numRounds); -IMB_DLL_LOCAL void asm_ZucGenKeystream_sse_no_aesni(void *pKeystream, - ZucState_t *pState, - uint64_t numRounds); +IMB_DLL_LOCAL void +asm_ZucGenKeystream_sse_no_aesni(void *pKeystream, ZucState_t *pState, uint64_t numRounds); -IMB_DLL_LOCAL void asm_ZucGenKeystream_avx(void *pKeystream, - ZucState_t *pState, - uint64_t numRounds); +IMB_DLL_LOCAL void +asm_ZucGenKeystream_avx(void *pKeystream, ZucState_t *pState, uint64_t numRounds); /** ****************************************************************************** @@ -611,17 +579,17 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream_avx(void *pKeystream, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_4_sse(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_4_sse(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_4_sse_no_aesni(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_4_sse_no_aesni(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_4_gfni_sse(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_4_gfni_sse(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_4_avx(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_4_avx(ZucState4_t *pState, uint32_t *pKeyStr[4]); /** ****************************************************************************** @@ -643,10 +611,10 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream16B_4_avx(ZucState4_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream32B_8_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); -IMB_DLL_LOCAL void asm_ZucGenKeystream32B_8_gfni_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream32B_8_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream32B_8_gfni_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); /** ****************************************************************************** @@ -670,13 +638,12 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream32B_8_gfni_avx2(ZucState8_t *pState, * the ZUC state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream64B_16_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off); +IMB_DLL_LOCAL void +asm_ZucGenKeystream64B_16_avx512(ZucState16_t *pState, uint32_t *pKeyStr, const unsigned key_off); -IMB_DLL_LOCAL void asm_ZucGenKeystream64B_16_gfni_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off); +IMB_DLL_LOCAL void +asm_ZucGenKeystream64B_16_gfni_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off); /** ****************************************************************************** * @@ -705,16 +672,12 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream64B_16_gfni_avx512(ZucState16_t *pState, * *****************************************************************************/ IMB_DLL_LOCAL void -asm_ZucGenKeystream64B_16_skip16_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off, - const uint16_t lane_mask); +asm_ZucGenKeystream64B_16_skip16_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off, const uint16_t lane_mask); IMB_DLL_LOCAL void -asm_ZucGenKeystream64B_16_skip16_gfni_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off, - const uint16_t lane_mask); +asm_ZucGenKeystream64B_16_skip16_gfni_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off, const uint16_t lane_mask); /** ****************************************************************************** * @@ -743,16 +706,12 @@ asm_ZucGenKeystream64B_16_skip16_gfni_avx512(ZucState16_t *pState, * *****************************************************************************/ IMB_DLL_LOCAL void -asm_ZucGenKeystream64B_16_skip8_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off, - const uint16_t lane_mask); +asm_ZucGenKeystream64B_16_skip8_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off, const uint16_t lane_mask); IMB_DLL_LOCAL void -asm_ZucGenKeystream64B_16_skip8_gfni_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off, - const uint16_t lane_mask); +asm_ZucGenKeystream64B_16_skip8_gfni_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off, const uint16_t lane_mask); /** ****************************************************************************** * @@ -781,16 +740,12 @@ asm_ZucGenKeystream64B_16_skip8_gfni_avx512(ZucState16_t *pState, * *****************************************************************************/ IMB_DLL_LOCAL void -asm_ZucGenKeystream64B_16_skip4_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off, - const uint16_t lane_mask); +asm_ZucGenKeystream64B_16_skip4_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off, const uint16_t lane_mask); IMB_DLL_LOCAL void -asm_ZucGenKeystream64B_16_skip4_gfni_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off, - const uint16_t lane_mask); +asm_ZucGenKeystream64B_16_skip4_gfni_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off, const uint16_t lane_mask); /** ****************************************************************************** * @@ -811,17 +766,17 @@ asm_ZucGenKeystream64B_16_skip4_gfni_avx512(ZucState16_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_4_sse(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_4_sse(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_4_sse_no_aesni(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_4_sse_no_aesni(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_4_gfni_sse(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_4_gfni_sse(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_4_avx(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_4_avx(ZucState4_t *pState, uint32_t *pKeyStr[4]); /** ****************************************************************************** @@ -843,17 +798,17 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream8B_4_avx(ZucState4_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream4B_4_sse(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream4B_4_sse(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream4B_4_sse_no_aesni(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream4B_4_sse_no_aesni(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream4B_4_gfni_sse(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream4B_4_gfni_sse(ZucState4_t *pState, uint32_t *pKeyStr[4]); -IMB_DLL_LOCAL void asm_ZucGenKeystream4B_4_avx(ZucState4_t *pState, - uint32_t *pKeyStr[4]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream4B_4_avx(ZucState4_t *pState, uint32_t *pKeyStr[4]); /** ****************************************************************************** @@ -875,10 +830,10 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream4B_4_avx(ZucState4_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_8_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); -IMB_DLL_LOCAL void asm_ZucGenKeystream16B_8_gfni_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_8_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream16B_8_gfni_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); /** ****************************************************************************** @@ -900,10 +855,10 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream16B_8_gfni_avx2(ZucState8_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_8_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_8_gfni_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_8_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_8_gfni_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); /** ****************************************************************************** @@ -925,10 +880,10 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream8B_8_gfni_avx2(ZucState8_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream4B_8_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); -IMB_DLL_LOCAL void asm_ZucGenKeystream4B_8_gfni_avx2(ZucState8_t *pState, - uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream4B_8_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); +IMB_DLL_LOCAL void +asm_ZucGenKeystream4B_8_gfni_avx2(ZucState8_t *pState, uint32_t *pKeyStr[8]); /** ****************************************************************************** @@ -952,13 +907,12 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream4B_8_gfni_avx2(ZucState8_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_16_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_16_avx512(ZucState16_t *pState, uint32_t *pKeyStr, const unsigned key_off); -IMB_DLL_LOCAL void asm_ZucGenKeystream8B_16_gfni_avx512(ZucState16_t *pState, - uint32_t *pKeyStr, - const unsigned key_off); +IMB_DLL_LOCAL void +asm_ZucGenKeystream8B_16_gfni_avx512(ZucState16_t *pState, uint32_t *pKeyStr, + const unsigned key_off); /** ****************************************************************************** @@ -985,15 +939,11 @@ IMB_DLL_LOCAL void asm_ZucGenKeystream8B_16_gfni_avx512(ZucState16_t *pState, * *****************************************************************************/ IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, +asm_ZucGenKeystream_16_avx512(ZucState16_t *pState, uint32_t *pKstr, const unsigned key_off, const uint32_t numRounds); IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_gfni_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, +asm_ZucGenKeystream_16_gfni_avx512(ZucState16_t *pState, uint32_t *pKstr, const unsigned key_off, const uint32_t numRounds); /** ****************************************************************************** @@ -1024,18 +974,13 @@ asm_ZucGenKeystream_16_gfni_avx512(ZucState16_t *pState, * *****************************************************************************/ IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_skip16_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, - const uint16_t lane_mask, - const uint32_t numRounds); +asm_ZucGenKeystream_16_skip16_avx512(ZucState16_t *pState, uint32_t *pKstr, const unsigned key_off, + const uint16_t lane_mask, const uint32_t numRounds); IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_skip16_gfni_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, - const uint16_t lane_mask, - const uint32_t numRounds); +asm_ZucGenKeystream_16_skip16_gfni_avx512(ZucState16_t *pState, uint32_t *pKstr, + const unsigned key_off, const uint16_t lane_mask, + const uint32_t numRounds); /** ****************************************************************************** @@ -1066,17 +1011,12 @@ asm_ZucGenKeystream_16_skip16_gfni_avx512(ZucState16_t *pState, * *****************************************************************************/ IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_skip8_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, - const uint16_t lane_mask, - const uint32_t numRounds); +asm_ZucGenKeystream_16_skip8_avx512(ZucState16_t *pState, uint32_t *pKstr, const unsigned key_off, + const uint16_t lane_mask, const uint32_t numRounds); IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_skip8_gfni_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, - const uint16_t lane_mask, +asm_ZucGenKeystream_16_skip8_gfni_avx512(ZucState16_t *pState, uint32_t *pKstr, + const unsigned key_off, const uint16_t lane_mask, const uint32_t numRounds); /** @@ -1108,17 +1048,12 @@ asm_ZucGenKeystream_16_skip8_gfni_avx512(ZucState16_t *pState, * *****************************************************************************/ IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_skip4_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, - const uint16_t lane_mask, - const uint32_t numRounds); +asm_ZucGenKeystream_16_skip4_avx512(ZucState16_t *pState, uint32_t *pKstr, const unsigned key_off, + const uint16_t lane_mask, const uint32_t numRounds); IMB_DLL_LOCAL void -asm_ZucGenKeystream_16_skip4_gfni_avx512(ZucState16_t *pState, - uint32_t *pKstr, - const unsigned key_off, - const uint16_t lane_mask, +asm_ZucGenKeystream_16_skip4_gfni_avx512(ZucState16_t *pState, uint32_t *pKstr, + const unsigned key_off, const uint16_t lane_mask, const uint32_t numRounds); /** ****************************************************************************** @@ -1145,29 +1080,21 @@ asm_ZucGenKeystream_16_skip4_gfni_avx512(ZucState16_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucCipher_4_sse(ZucState4_t *pState, - const uint64_t *pIn[4], - uint64_t *pOut[4], - uint16_t lengths[4], - const uint64_t minLength); - -IMB_DLL_LOCAL void asm_ZucCipher_4_sse_no_aesni(ZucState4_t *pState, - const uint64_t *pIn[4], - uint64_t *pOut[4], - uint16_t lengths[4], - const uint64_t minLength); - -IMB_DLL_LOCAL void asm_ZucCipher_4_gfni_sse(ZucState4_t *pState, - const uint64_t *pIn[4], - uint64_t *pOut[4], - uint16_t lengths[4], - const uint64_t minLength); - -IMB_DLL_LOCAL void asm_ZucCipher_4_avx(ZucState4_t *pState, - const uint64_t *pIn[4], - uint64_t *pOut[4], - uint16_t lengths[4], - const uint64_t minLength); +IMB_DLL_LOCAL void +asm_ZucCipher_4_sse(ZucState4_t *pState, const uint64_t *pIn[4], uint64_t *pOut[4], + uint16_t lengths[4], const uint64_t minLength); + +IMB_DLL_LOCAL void +asm_ZucCipher_4_sse_no_aesni(ZucState4_t *pState, const uint64_t *pIn[4], uint64_t *pOut[4], + uint16_t lengths[4], const uint64_t minLength); + +IMB_DLL_LOCAL void +asm_ZucCipher_4_gfni_sse(ZucState4_t *pState, const uint64_t *pIn[4], uint64_t *pOut[4], + uint16_t lengths[4], const uint64_t minLength); + +IMB_DLL_LOCAL void +asm_ZucCipher_4_avx(ZucState4_t *pState, const uint64_t *pIn[4], uint64_t *pOut[4], + uint16_t lengths[4], const uint64_t minLength); /** ****************************************************************************** @@ -1194,16 +1121,12 @@ IMB_DLL_LOCAL void asm_ZucCipher_4_avx(ZucState4_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucCipher_8_avx2(ZucState8_t *pState, - const uint64_t *pIn[8], - uint64_t *pOut[8], - const uint16_t lengths[8], - const uint64_t minLength); -IMB_DLL_LOCAL void asm_ZucCipher_8_gfni_avx2(ZucState8_t *pState, - const uint64_t *pIn[8], - uint64_t *pOut[8], - const uint16_t lengths[8], - const uint64_t minLength); +IMB_DLL_LOCAL void +asm_ZucCipher_8_avx2(ZucState8_t *pState, const uint64_t *pIn[8], uint64_t *pOut[8], + const uint16_t lengths[8], const uint64_t minLength); +IMB_DLL_LOCAL void +asm_ZucCipher_8_gfni_avx2(ZucState8_t *pState, const uint64_t *pIn[8], uint64_t *pOut[8], + const uint16_t lengths[8], const uint64_t minLength); /** ****************************************************************************** @@ -1229,17 +1152,13 @@ IMB_DLL_LOCAL void asm_ZucCipher_8_gfni_avx2(ZucState8_t *pState, * state. * *****************************************************************************/ -IMB_DLL_LOCAL void asm_ZucCipher_16_avx512(ZucState16_t *pState, - const uint64_t *pIn[16], - uint64_t *pOut[16], - const uint16_t lengths[16], - const uint64_t minLength); - -IMB_DLL_LOCAL void asm_ZucCipher_16_gfni_avx512(ZucState16_t *pState, - const uint64_t *pIn[16], - uint64_t *pOut[16], - const uint16_t lengths[16], - const uint64_t minLength); +IMB_DLL_LOCAL void +asm_ZucCipher_16_avx512(ZucState16_t *pState, const uint64_t *pIn[16], uint64_t *pOut[16], + const uint16_t lengths[16], const uint64_t minLength); + +IMB_DLL_LOCAL void +asm_ZucCipher_16_gfni_avx512(ZucState16_t *pState, const uint64_t *pIn[16], uint64_t *pOut[16], + const uint16_t lengths[16], const uint64_t minLength); /** ****************************************************************************** @@ -1259,25 +1178,20 @@ IMB_DLL_LOCAL void asm_ZucCipher_16_gfni_avx512(ZucState16_t *pState, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_Eia3Round16B_sse(void *T, const void *ks, - const void *data, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Eia3Round16B_sse(void *T, const void *ks, const void *data, const uint64_t tag_sz); -IMB_DLL_LOCAL void asm_Eia3Round16B_sse_no_aesni(void *T, const void *ks, - const void *data, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Eia3Round16B_sse_no_aesni(void *T, const void *ks, const void *data, const uint64_t tag_sz); -IMB_DLL_LOCAL void asm_Eia3Round16B_gfni_sse(void *T, const void *ks, - const void *data, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Eia3Round16B_gfni_sse(void *T, const void *ks, const void *data, const uint64_t tag_sz); -IMB_DLL_LOCAL void asm_Eia3Round16B_avx(void *T, const void *ks, - const void *data, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Eia3Round16B_avx(void *T, const void *ks, const void *data, const uint64_t tag_sz); -IMB_DLL_LOCAL void asm_Eia3Round32B_avx(void *T, const void *ks, - const void *data, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Eia3Round32B_avx(void *T, const void *ks, const void *data, const uint64_t tag_sz); /** ****************************************************************************** @@ -1295,29 +1209,21 @@ IMB_DLL_LOCAL void asm_Eia3Round32B_avx(void *T, const void *ks, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_Eia3Remainder_sse(void *T, const void *ks, - const void *data, - const uint64_t n_bits, - const uint64_t key_size, - const uint64_t tag_size); - -IMB_DLL_LOCAL void asm_Eia3Remainder_sse_no_aesni(void *T, const void *ks, - const void *data, - const uint64_t n_bits, - const uint64_t key_size, - const uint64_t tag_size); - -IMB_DLL_LOCAL void asm_Eia3Remainder_gfni_sse(void *T, const void *ks, - const void *data, - const uint64_t n_bits, - const uint64_t key_size, - const uint64_t tag_size); - -IMB_DLL_LOCAL void asm_Eia3Remainder_avx(void *T, const void *ks, - const void *data, - const uint64_t n_bits, - const uint64_t key_size, - const uint64_t tag_size); +IMB_DLL_LOCAL void +asm_Eia3Remainder_sse(void *T, const void *ks, const void *data, const uint64_t n_bits, + const uint64_t key_size, const uint64_t tag_size); + +IMB_DLL_LOCAL void +asm_Eia3Remainder_sse_no_aesni(void *T, const void *ks, const void *data, const uint64_t n_bits, + const uint64_t key_size, const uint64_t tag_size); + +IMB_DLL_LOCAL void +asm_Eia3Remainder_gfni_sse(void *T, const void *ks, const void *data, const uint64_t n_bits, + const uint64_t key_size, const uint64_t tag_size); + +IMB_DLL_LOCAL void +asm_Eia3Remainder_avx(void *T, const void *ks, const void *data, const uint64_t n_bits, + const uint64_t key_size, const uint64_t tag_size); /** ****************************************************************************** @@ -1340,20 +1246,16 @@ IMB_DLL_LOCAL void asm_Eia3Remainder_avx(void *T, const void *ks, * *****************************************************************************/ -IMB_DLL_LOCAL void asm_Eia3Round64BAVX512_16(void *T, - const uint32_t *ks, - const void **data, - uint16_t *len, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Eia3Round64BAVX512_16(void *T, const uint32_t *ks, const void **data, uint16_t *len, + const uint64_t tag_sz); -IMB_DLL_LOCAL void asm_Eia3Round64B_16_VPCLMUL(void *T, - const uint32_t *ks, - const void **data, - uint16_t *len, - const uint64_t tag_sz); +IMB_DLL_LOCAL void +asm_Eia3Round64B_16_VPCLMUL(void *T, const uint32_t *ks, const void **data, uint16_t *len, + const uint64_t tag_sz); -IMB_DLL_LOCAL void asm_Eia3Round64BAVX512(uint32_t *T, const void *ks, - const void *data); +IMB_DLL_LOCAL void +asm_Eia3Round64BAVX512(uint32_t *T, const void *ks, const void *data); /** ****************************************************************************** @@ -1373,35 +1275,25 @@ IMB_DLL_LOCAL void asm_Eia3Round64BAVX512(uint32_t *T, const void *ks, * None * *****************************************************************************/ -IMB_DLL_LOCAL void asm_Eia3RemainderAVX512(uint32_t *T, const void *ks, - const void *data, - const uint32_t n_bits); - -IMB_DLL_LOCAL uint32_t asm_Eia3RemainderAVX512_16(uint32_t *T, - const uint32_t *ks, - const void **data, - uint16_t *lens, - const uint32_t commonBits); - -IMB_DLL_LOCAL uint32_t asm_Eia3_256_RemainderAVX512_16(uint32_t *T, - const uint32_t *ks, - const void **data, - uint16_t *lens, - const uint64_t commonBits, - const uint64_t tag_size); - -IMB_DLL_LOCAL uint32_t asm_Eia3RemainderAVX512_16_VPCLMUL(uint32_t *T, - const uint32_t *ks, - const void **data, - uint16_t *lens, - const uint32_t commonBits); - -IMB_DLL_LOCAL uint32_t asm_Eia3_256_RemainderAVX512_16_VPCLMUL(uint32_t *T, - const uint32_t *ks, - const void **data, - uint16_t *lens, - const uint64_t commonBits, - const uint64_t tag_size); +IMB_DLL_LOCAL void +asm_Eia3RemainderAVX512(uint32_t *T, const void *ks, const void *data, const uint32_t n_bits); + +IMB_DLL_LOCAL uint32_t +asm_Eia3RemainderAVX512_16(uint32_t *T, const uint32_t *ks, const void **data, uint16_t *lens, + const uint32_t commonBits); + +IMB_DLL_LOCAL uint32_t +asm_Eia3_256_RemainderAVX512_16(uint32_t *T, const uint32_t *ks, const void **data, uint16_t *lens, + const uint64_t commonBits, const uint64_t tag_size); + +IMB_DLL_LOCAL uint32_t +asm_Eia3RemainderAVX512_16_VPCLMUL(uint32_t *T, const uint32_t *ks, const void **data, + uint16_t *lens, const uint32_t commonBits); + +IMB_DLL_LOCAL uint32_t +asm_Eia3_256_RemainderAVX512_16_VPCLMUL(uint32_t *T, const uint32_t *ks, const void **data, + uint16_t *lens, const uint64_t commonBits, + const uint64_t tag_size); /** ****************************************************************************** @@ -1418,313 +1310,250 @@ IMB_DLL_LOCAL uint32_t asm_Eia3_256_RemainderAVX512_16_VPCLMUL(uint32_t *T, * *****************************************************************************/ IMB_DLL_LOCAL -void asm_Eia3_Nx64B_AVX512_16(ZucState16_t *pState, - uint32_t *pKeyStr, - uint32_t *T, - const void **data, - uint16_t *len, - const uint64_t numRounds, - const uint64_t tagSize); +void +asm_Eia3_Nx64B_AVX512_16(ZucState16_t *pState, uint32_t *pKeyStr, uint32_t *T, const void **data, + uint16_t *len, const uint64_t numRounds, const uint64_t tagSize); IMB_DLL_LOCAL -void asm_Eia3_Nx64B_AVX512_16_VPCLMUL(ZucState16_t *pState, - uint32_t *pKeyStr, - uint32_t *T, - const void **data, - uint16_t *len, - const uint64_t numRounds, - const uint64_t tagSize); +void +asm_Eia3_Nx64B_AVX512_16_VPCLMUL(ZucState16_t *pState, uint32_t *pKeyStr, uint32_t *T, + const void **data, uint16_t *len, const uint64_t numRounds, + const uint64_t tagSize); IMB_DLL_LOCAL -void zuc_eia3_4_buffer_job_gfni_sse(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - uint32_t *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4]); +void +zuc_eia3_4_buffer_job_gfni_sse(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], uint32_t *pMacI[4], + const uint16_t lengthInBits[4], const void *const job_in_lane[4]); IMB_DLL_LOCAL -void zuc_eia3_4_buffer_job_no_gfni_sse(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - uint32_t *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4]); +void +zuc_eia3_4_buffer_job_no_gfni_sse(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], uint32_t *pMacI[4], + const uint16_t lengthInBits[4], const void *const job_in_lane[4]); IMB_DLL_LOCAL -void zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - uint32_t *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4]); +void +zuc_eia3_4_buffer_job_sse_no_aesni(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], uint32_t *pMacI[4], + const uint16_t lengthInBits[4], + const void *const job_in_lane[4]); IMB_DLL_LOCAL -void zuc256_eia3_4_buffer_job_gfni_sse(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - void *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4], - const uint64_t tag_size); +void +zuc256_eia3_4_buffer_job_gfni_sse(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], void *pMacI[4], + const uint16_t lengthInBits[4], const void *const job_in_lane[4], + const uint64_t tag_size); IMB_DLL_LOCAL -void zuc256_eia3_4_buffer_job_no_gfni_sse(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - void *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4], - const uint64_t tag_size); +void +zuc256_eia3_4_buffer_job_no_gfni_sse(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], void *pMacI[4], + const uint16_t lengthInBits[4], + const void *const job_in_lane[4], const uint64_t tag_size); IMB_DLL_LOCAL -void zuc256_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - void *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4], - const uint64_t tag_size); +void +zuc256_eia3_4_buffer_job_sse_no_aesni(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], void *pMacI[4], + const uint16_t lengthInBits[4], + const void *const job_in_lane[4], const uint64_t tag_size); IMB_DLL_LOCAL -void zuc_eia3_4_buffer_job_avx(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - uint32_t *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4]); +void +zuc_eia3_4_buffer_job_avx(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], uint32_t *pMacI[4], + const uint16_t lengthInBits[4], const void *const job_in_lane[4]); IMB_DLL_LOCAL -void zuc256_eia3_4_buffer_job_avx(const void * const pKey[4], - const uint8_t *ivs, - const void * const pBufferIn[4], - void *pMacI[4], - const uint16_t lengthInBits[4], - const void * const job_in_lane[4], - const uint64_t tag_size); +void +zuc256_eia3_4_buffer_job_avx(const void *const pKey[4], const uint8_t *ivs, + const void *const pBufferIn[4], void *pMacI[4], + const uint16_t lengthInBits[4], const void *const job_in_lane[4], + const uint64_t tag_size); IMB_DLL_LOCAL -void zuc_eia3_8_buffer_job_avx2(const void * const pKey[8], - const uint8_t *ivs, - const void * const pBufferIn[8], - uint32_t *pMacI[8], - const uint16_t lengthInBits[8], - const void * const job_in_lane[8]); +void +zuc_eia3_8_buffer_job_avx2(const void *const pKey[8], const uint8_t *ivs, + const void *const pBufferIn[8], uint32_t *pMacI[8], + const uint16_t lengthInBits[8], const void *const job_in_lane[8]); IMB_DLL_LOCAL -void zuc_eia3_8_buffer_job_gfni_avx2(const void * const pKey[8], - const uint8_t *ivs, - const void * const pBufferIn[8], - uint32_t *pMacI[8], - const uint16_t lengthInBits[8], - const void * const job_in_lane[8]); +void +zuc_eia3_8_buffer_job_gfni_avx2(const void *const pKey[8], const uint8_t *ivs, + const void *const pBufferIn[8], uint32_t *pMacI[8], + const uint16_t lengthInBits[8], const void *const job_in_lane[8]); IMB_DLL_LOCAL -void zuc256_eia3_8_buffer_job_avx2(const void * const pKey[8], - const uint8_t *ivs, - const void * const pBufferIn[8], - void *pMacI[8], - const uint16_t lengthInBits[8], - const void * const job_in_lane[8], - const uint64_t tag_size); +void +zuc256_eia3_8_buffer_job_avx2(const void *const pKey[8], const uint8_t *ivs, + const void *const pBufferIn[8], void *pMacI[8], + const uint16_t lengthInBits[8], const void *const job_in_lane[8], + const uint64_t tag_size); IMB_DLL_LOCAL -void zuc256_eia3_8_buffer_job_gfni_avx2(const void * const pKey[8], - const uint8_t *ivs, - const void * const pBufferIn[8], - void *pMacI[8], - const uint16_t lengthInBits[8], - const void * const job_in_lane[8], +void +zuc256_eia3_8_buffer_job_gfni_avx2(const void *const pKey[8], const uint8_t *ivs, + const void *const pBufferIn[8], void *pMacI[8], + const uint16_t lengthInBits[8], const void *const job_in_lane[8], const uint64_t tag_size); /* the s-boxes */ extern const uint8_t S0[256]; extern const uint8_t S1[256]; -void zuc_eea3_1_buffer_sse(const void *pKey, const void *pIv, - const void *pBufferIn, void *pBufferOut, - const uint32_t lengthInBytes); - -void zuc_eea3_4_buffer_sse(const void * const pKey[4], - const void * const pIv[4], - const void * const pBufferIn[4], - void *pBufferOut[4], +void +zuc_eea3_1_buffer_sse(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t lengthInBytes); + +void +zuc_eea3_4_buffer_sse(const void *const pKey[4], const void *const pIv[4], + const void *const pBufferIn[4], void *pBufferOut[4], + const uint32_t lengthInBytes[4]); + +void +zuc_eea3_n_buffer_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t lengthInBytes[], const uint32_t numBuffers); + +void +zuc_eia3_1_buffer_sse(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI); + +void +zuc_eia3_n_buffer_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers); + +void +zuc_eia3_n_buffer_gfni_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers); + +void +zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, const void *pBufferIn, + void *pBufferOut, const uint32_t lengthInBytes); + +void +zuc_eea3_4_buffer_sse_no_aesni(const void *const pKey[4], const void *const pIv[4], + const void *const pBufferIn[4], void *pBufferOut[4], + const uint32_t lengthInBytes[4]); + +void +zuc_eea3_n_buffer_sse_no_aesni(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t lengthInBytes[], const uint32_t numBuffers); + +void +zuc_eea3_4_buffer_gfni_sse(const void *const pKey[4], const void *const pIv[4], + const void *const pBufferIn[4], void *pBufferOut[4], const uint32_t lengthInBytes[4]); -void zuc_eea3_n_buffer_sse(const void * const pKey[], const void * const pIv[], - const void * const pBufferIn[], void *pBufferOut[], - const uint32_t lengthInBytes[], - const uint32_t numBuffers); - -void zuc_eia3_1_buffer_sse(const void *pKey, const void *pIv, - const void *pBufferIn, const uint32_t lengthInBits, - uint32_t *pMacI); - -void zuc_eia3_n_buffer_sse(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers); - -void zuc_eia3_n_buffer_gfni_sse(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers); - -void zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, - const void *pBufferIn, void *pBufferOut, - const uint32_t lengthInBytes); - -void zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[4], - const void * const pIv[4], - const void * const pBufferIn[4], - void *pBufferOut[4], - const uint32_t lengthInBytes[4]); - -void zuc_eea3_n_buffer_sse_no_aesni(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t lengthInBytes[], - const uint32_t numBuffers); - -void zuc_eea3_4_buffer_gfni_sse(const void * const pKey[4], - const void * const pIv[4], - const void * const pBufferIn[4], - void *pBufferOut[4], - const uint32_t lengthInBytes[4]); - -void zuc_eea3_n_buffer_gfni_sse(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t lengthInBytes[], - const uint32_t numBuffers); - -void zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI); - -void zuc_eia3_n_buffer_sse_no_aesni(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers); - -void zuc_eea3_1_buffer_avx(const void *pKey, const void *pIv, - const void *pBufferIn, void *pBufferOut, - const uint32_t lengthInBytes); - -void zuc_eea3_4_buffer_avx(const void * const pKey[4], - const void * const pIv[4], - const void * const pBufferIn[4], - void *pBufferOut[4], - const uint32_t lengthInBytes[4]); - -void zuc_eea3_n_buffer_avx(const void * const pKey[], const void * const pIv[], - const void * const pBufferIn[], void *pBufferOut[], - const uint32_t lengthInBytes[], - const uint32_t numBuffers); - -void zuc_eia3_1_buffer_avx(const void *pKey, const void *pIv, - const void *pBufferIn, const uint32_t lengthInBits, - uint32_t *pMacI); - -void zuc_eia3_n_buffer_avx(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers); - - -void zuc_eea3_1_buffer_avx2(const void *pKey, const void *pIv, - const void *pBufferIn, void *pBufferOut, - const uint32_t lengthInBytes); - -void zuc_eea3_n_buffer_avx2(const void * const pKey[], const void * const pIv[], - const void * const pBufferIn[], void *pBufferOut[], - const uint32_t lengthInBytes[], - const uint32_t numBuffers); - -void zuc_eia3_1_buffer_avx2(const void *pKey, const void *pIv, - const void *pBufferIn, const uint32_t lengthInBits, - uint32_t *pMacI); - -void zuc_eia3_n_buffer_avx2(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers); - -void zuc_eea3_1_buffer_avx512(const void *pKey, const void *pIv, - const void *pBufferIn, void *pBufferOut, - const uint32_t lengthInBytes); - -void zuc_eea3_n_buffer_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t lengthInBytes[], - const uint32_t numBuffers); - -void zuc_eea3_n_buffer_gfni_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t lengthInBytes[], - const uint32_t numBuffers); - -void zuc_eia3_1_buffer_avx512(const void *pKey, const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI); - -void zuc_eia3_n_buffer_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers); - -void zuc_eia3_n_buffer_gfni_avx512(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers); +void +zuc_eea3_n_buffer_gfni_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t lengthInBytes[], const uint32_t numBuffers); + +void +zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI); + +void +zuc_eia3_n_buffer_sse_no_aesni(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers); + +void +zuc_eea3_1_buffer_avx(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t lengthInBytes); + +void +zuc_eea3_4_buffer_avx(const void *const pKey[4], const void *const pIv[4], + const void *const pBufferIn[4], void *pBufferOut[4], + const uint32_t lengthInBytes[4]); + +void +zuc_eea3_n_buffer_avx(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t lengthInBytes[], const uint32_t numBuffers); + +void +zuc_eia3_1_buffer_avx(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI); + +void +zuc_eia3_n_buffer_avx(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers); + +void +zuc_eea3_1_buffer_avx2(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t lengthInBytes); + +void +zuc_eea3_n_buffer_avx2(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t lengthInBytes[], const uint32_t numBuffers); + +void +zuc_eia3_1_buffer_avx2(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI); + +void +zuc_eia3_n_buffer_avx2(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers); + +void +zuc_eea3_1_buffer_avx512(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t lengthInBytes); + +void +zuc_eea3_n_buffer_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t lengthInBytes[], const uint32_t numBuffers); + +void +zuc_eea3_n_buffer_gfni_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t lengthInBytes[], const uint32_t numBuffers); + +void +zuc_eia3_1_buffer_avx512(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI); + +void +zuc_eia3_n_buffer_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers); + +void +zuc_eia3_n_buffer_gfni_avx512(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers); /* Internal API */ IMB_DLL_LOCAL -void _zuc_eea3_4_buffer_avx(const void * const pKey[4], - const void * const pIv[4], - const void * const pBufferIn[4], - void *pBufferOut[4], - const uint32_t length[4]); +void +_zuc_eea3_4_buffer_avx(const void *const pKey[4], const void *const pIv[4], + const void *const pBufferIn[4], void *pBufferOut[4], + const uint32_t length[4]); IMB_DLL_LOCAL -void _zuc_eia3_4_buffer_avx(const void * const pKey[4], - const void * const pIv[4], - const void * const pBufferIn[4], - const uint32_t lengthInBits[4], - uint32_t *pMacI[4]); +void +_zuc_eia3_4_buffer_avx(const void *const pKey[4], const void *const pIv[4], + const void *const pBufferIn[4], const uint32_t lengthInBits[4], + uint32_t *pMacI[4]); IMB_DLL_LOCAL -void _zuc_eea3_8_buffer_avx2(const void * const pKey[8], - const void * const pIv[8], - const void * const pBufferIn[8], - void *pBufferOut[8], - const uint32_t length[8]); +void +_zuc_eea3_8_buffer_avx2(const void *const pKey[8], const void *const pIv[8], + const void *const pBufferIn[8], void *pBufferOut[8], + const uint32_t length[8]); IMB_DLL_LOCAL -void _zuc_eia3_8_buffer_avx2(const void * const pKey[8], - const void * const pIv[8], - const void * const pBufferIn[8], - const uint32_t lengthInBits[8], - uint32_t *pMacI[8]); +void +_zuc_eia3_8_buffer_avx2(const void *const pKey[8], const void *const pIv[8], + const void *const pBufferIn[8], const uint32_t lengthInBits[8], + uint32_t *pMacI[8]); #else /* __aarch64__ */ /* AARCH64 */ @@ -2072,4 +1901,3 @@ void zuc256_eia3_4_buffer_job_aarch64_no_aesni(const void * const pKey[4], #endif /* __aarch64__ */ #endif /* ZUC_INTERNAL_H_ */ - diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 169e4d06..7645167b 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -47,10 +47,8 @@ typedef struct { */ #if defined __linux__ || defined __FreeBSD__ /**< Linux/FreeBSD */ -#define DECLARE_ALIGNED(decl, alignval) \ - decl __attribute__((aligned(alignval))) -#define __forceinline \ - static inline __attribute__((always_inline)) +#define DECLARE_ALIGNED(decl, alignval) decl __attribute__((aligned(alignval))) +#define __forceinline static inline __attribute__((always_inline)) #if __GNUC__ >= 4 #define IMB_DLL_EXPORT __attribute__((visibility("default"))) @@ -65,18 +63,14 @@ typedef struct { #ifdef __MINGW32__ /* MinGW-w64 */ -#define DECLARE_ALIGNED(decl, alignval) \ - decl __attribute__((aligned(alignval))) +#define DECLARE_ALIGNED(decl, alignval) decl __attribute__((aligned(alignval))) #undef __forceinline -#define __forceinline \ - static inline __attribute__((always_inline)) +#define __forceinline static inline __attribute__((always_inline)) #else /* MSVS */ -#define DECLARE_ALIGNED(decl, alignval) \ - __declspec(align(alignval)) decl -#define __forceinline \ - static __forceinline +#define DECLARE_ALIGNED(decl, alignval) __declspec(align(alignval)) decl +#define __forceinline static __forceinline #endif /* __MINGW__ */ @@ -135,7 +129,7 @@ typedef enum { * Algorithm constants */ #define IMB_DES_KEY_SCHED_SIZE (16 * 8) /**< 16 rounds x 8 bytes */ -#define IMB_DES_BLOCK_SIZE 8 +#define IMB_DES_BLOCK_SIZE 8 #define IMB_AES_BLOCK_SIZE 16 @@ -147,7 +141,7 @@ typedef enum { #define IMB_MD5_DIGEST_SIZE_IN_BYTES 16 -#define IMB_SHA1_BLOCK_SIZE 64 /**< 512 bits is 64 byte blocks */ +#define IMB_SHA1_BLOCK_SIZE 64 /**< 512 bits is 64 byte blocks */ #define IMB_SHA_224_BLOCK_SIZE 64 /**< 512 bits is 64 byte blocks */ #define IMB_SHA_256_BLOCK_SIZE 64 /**< 512 bits is 64 byte blocks */ #define IMB_SHA_384_BLOCK_SIZE 128 @@ -155,23 +149,22 @@ typedef enum { #define IMB_MD5_BLOCK_SIZE 64 -#define IMB_KASUMI_KEY_SIZE 16 -#define IMB_KASUMI_IV_SIZE 8 -#define IMB_KASUMI_BLOCK_SIZE 8 -#define IMB_KASUMI_DIGEST_SIZE 4 +#define IMB_KASUMI_KEY_SIZE 16 +#define IMB_KASUMI_IV_SIZE 8 +#define IMB_KASUMI_BLOCK_SIZE 8 +#define IMB_KASUMI_DIGEST_SIZE 4 -#define IMB_ZUC_KEY_LEN_IN_BYTES 16 -#define IMB_ZUC_IV_LEN_IN_BYTES 16 -#define IMB_ZUC256_KEY_LEN_IN_BYTES 32 -#define IMB_ZUC256_IV_LEN_IN_BYTES_MIN 23 -#define IMB_ZUC256_IV_LEN_IN_BYTES_MAX 25 -#define IMB_ZUC_DIGEST_LEN_IN_BYTES 4 -#define IMB_ZUC256_DIGEST_LEN_IN_BYTES_MIN 4 -#define IMB_ZUC256_DIGEST_LEN_IN_BYTES_MAX 16 +#define IMB_ZUC_KEY_LEN_IN_BYTES 16 +#define IMB_ZUC_IV_LEN_IN_BYTES 16 +#define IMB_ZUC256_KEY_LEN_IN_BYTES 32 +#define IMB_ZUC256_IV_LEN_IN_BYTES_MIN 23 +#define IMB_ZUC256_IV_LEN_IN_BYTES_MAX 25 +#define IMB_ZUC_DIGEST_LEN_IN_BYTES 4 +#define IMB_ZUC256_DIGEST_LEN_IN_BYTES_MIN 4 +#define IMB_ZUC256_DIGEST_LEN_IN_BYTES_MAX 16 - -#define IMB_SNOW3G_DIGEST_LEN 4 -#define IMB_SNOW3G_IV_LEN_IN_BYTES 16 +#define IMB_SNOW3G_DIGEST_LEN 4 +#define IMB_SNOW3G_IV_LEN_IN_BYTES 16 /** * Minimum Ethernet frame size to calculate CRC32 @@ -185,12 +178,12 @@ typedef enum { */ typedef enum { - IMB_STATUS_BEING_PROCESSED = 0, + IMB_STATUS_BEING_PROCESSED = 0, IMB_STATUS_COMPLETED_CIPHER = 1, - IMB_STATUS_COMPLETED_AUTH = 2, - IMB_STATUS_COMPLETED = 3, /**< COMPLETED_CIPHER | - COMPLETED_AUTH */ - IMB_STATUS_INVALID_ARGS = 4, + IMB_STATUS_COMPLETED_AUTH = 2, + IMB_STATUS_COMPLETED = 3, /**< COMPLETED_CIPHER | + COMPLETED_AUTH */ + IMB_STATUS_INVALID_ARGS = 4, IMB_STATUS_INTERNAL_ERROR, IMB_STATUS_ERROR } IMB_STATUS; @@ -254,7 +247,7 @@ typedef enum { IMB_ERR_SELFTEST, IMB_ERR_BURST_SUITE_ID, /* add new error types above this comment */ - IMB_ERR_MAX /* don't move this one */ + IMB_ERR_MAX /* don't move this one */ } IMB_ERR; /** @@ -280,13 +273,13 @@ typedef enum { IMB_CIPHER_DES3, IMB_CIPHER_PON_AES_CNTR, IMB_CIPHER_ECB, - IMB_CIPHER_CNTR_BITLEN, /**< 128-EEA2/NEA2 (3GPP) */ - IMB_CIPHER_ZUC_EEA3, /**< 128-EEA3/NEA3 (3GPP) */ - IMB_CIPHER_SNOW3G_UEA2_BITLEN,/**< 128-UEA2 (3GPP) */ - IMB_CIPHER_KASUMI_UEA1_BITLEN,/**< 128-UEA1 (3GPP) */ - IMB_CIPHER_CBCS_1_9, /**< MPEG CENC (ISO 23001-7) */ + IMB_CIPHER_CNTR_BITLEN, /**< 128-EEA2/NEA2 (3GPP) */ + IMB_CIPHER_ZUC_EEA3, /**< 128-EEA3/NEA3 (3GPP) */ + IMB_CIPHER_SNOW3G_UEA2_BITLEN, /**< 128-UEA2 (3GPP) */ + IMB_CIPHER_KASUMI_UEA1_BITLEN, /**< 128-UEA1 (3GPP) */ + IMB_CIPHER_CBCS_1_9, /**< MPEG CENC (ISO 23001-7) */ IMB_CIPHER_CHACHA20, - IMB_CIPHER_CHACHA20_POLY1305, /**< AEAD CHACHA20 */ + IMB_CIPHER_CHACHA20_POLY1305, /**< AEAD CHACHA20 */ IMB_CIPHER_CHACHA20_POLY1305_SGL, /**< AEAD CHACHA20 with SGL support*/ IMB_CIPHER_SNOW_V, IMB_CIPHER_SNOW_V_AEAD, @@ -294,65 +287,59 @@ typedef enum { IMB_CIPHER_NUM } IMB_CIPHER_MODE; -typedef enum { - IMB_DIR_ENCRYPT = 1, - IMB_DIR_DECRYPT -} IMB_CIPHER_DIRECTION; +typedef enum { IMB_DIR_ENCRYPT = 1, IMB_DIR_DECRYPT } IMB_CIPHER_DIRECTION; typedef enum { - IMB_AUTH_HMAC_SHA_1 = 1, /**< HMAC-SHA1 */ - IMB_AUTH_HMAC_SHA_224, /**< HMAC-SHA224 */ - IMB_AUTH_HMAC_SHA_256, /**< HMAC-SHA256 */ - IMB_AUTH_HMAC_SHA_384, /**< HMAC-SHA384 */ - IMB_AUTH_HMAC_SHA_512, /**< HMAC-SHA512 */ + IMB_AUTH_HMAC_SHA_1 = 1, /**< HMAC-SHA1 */ + IMB_AUTH_HMAC_SHA_224, /**< HMAC-SHA224 */ + IMB_AUTH_HMAC_SHA_256, /**< HMAC-SHA256 */ + IMB_AUTH_HMAC_SHA_384, /**< HMAC-SHA384 */ + IMB_AUTH_HMAC_SHA_512, /**< HMAC-SHA512 */ IMB_AUTH_AES_XCBC, - IMB_AUTH_MD5, /**< HMAC-MD5 */ + IMB_AUTH_MD5, /**< HMAC-MD5 */ IMB_AUTH_NULL, IMB_AUTH_AES_GMAC, IMB_AUTH_CUSTOM, - IMB_AUTH_AES_CCM, /**< AES128-CCM */ - IMB_AUTH_AES_CMAC, /**< AES128-CMAC */ - IMB_AUTH_SHA_1, /**< SHA1 */ - IMB_AUTH_SHA_224, /**< SHA224 */ - IMB_AUTH_SHA_256, /**< SHA256 */ - IMB_AUTH_SHA_384, /**< SHA384 */ - IMB_AUTH_SHA_512, /**< SHA512 */ - IMB_AUTH_AES_CMAC_BITLEN, /**< 128-EIA2/NIA2 (3GPP) */ + IMB_AUTH_AES_CCM, /**< AES128-CCM */ + IMB_AUTH_AES_CMAC, /**< AES128-CMAC */ + IMB_AUTH_SHA_1, /**< SHA1 */ + IMB_AUTH_SHA_224, /**< SHA224 */ + IMB_AUTH_SHA_256, /**< SHA256 */ + IMB_AUTH_SHA_384, /**< SHA384 */ + IMB_AUTH_SHA_512, /**< SHA512 */ + IMB_AUTH_AES_CMAC_BITLEN, /**< 128-EIA2/NIA2 (3GPP) */ IMB_AUTH_PON_CRC_BIP, - IMB_AUTH_ZUC_EIA3_BITLEN, /**< 128-EIA3/NIA3 (3GPP) */ - IMB_AUTH_DOCSIS_CRC32, /**< with DOCSIS_SEC_BPI only */ - IMB_AUTH_SNOW3G_UIA2_BITLEN, /**< 128-UIA2 (3GPP) */ - IMB_AUTH_KASUMI_UIA1, /**< 128-UIA1 (3GPP) */ - IMB_AUTH_AES_GMAC_128, /**< AES-GMAC (128-bit key) */ - IMB_AUTH_AES_GMAC_192, /**< AES-GMAC (192-bit key) */ - IMB_AUTH_AES_GMAC_256, /**< AES-GMAC (256-bit key) */ - IMB_AUTH_AES_CMAC_256, /**< AES256-CMAC */ - IMB_AUTH_POLY1305, /**< POLY1305 */ - IMB_AUTH_CHACHA20_POLY1305, /**< AEAD POLY1305 */ - IMB_AUTH_CHACHA20_POLY1305_SGL, /**< AEAD CHACHA20 with SGL support */ - IMB_AUTH_ZUC256_EIA3_BITLEN, /**< 256-EIA3/NIA3 (3GPP) */ - IMB_AUTH_SNOW_V_AEAD, /**< SNOW-V-AEAD */ - IMB_AUTH_GCM_SGL, /**< AES-GCM with SGL support */ - IMB_AUTH_CRC32_ETHERNET_FCS, /**< CRC32-ETHERNET-FCS */ - IMB_AUTH_CRC32_SCTP, /**< CRC32-SCTP */ - IMB_AUTH_CRC32_WIMAX_OFDMA_DATA,/**< CRC32-WIMAX-OFDMA-DATA */ - IMB_AUTH_CRC24_LTE_A, /**< CRC32-LTE-A */ - IMB_AUTH_CRC24_LTE_B, /**< CRC32-LTE-B */ - IMB_AUTH_CRC16_X25, /**< CRC16-X25 */ - IMB_AUTH_CRC16_FP_DATA, /**< CRC16-FP-DATA */ - IMB_AUTH_CRC11_FP_HEADER, /**< CRC11-FP-HEADER */ - IMB_AUTH_CRC10_IUUP_DATA, /**< CRC10-IUUP-DATA */ - IMB_AUTH_CRC8_WIMAX_OFDMA_HCS, /**< CRC8-WIMAX-OFDMA-HCS */ - IMB_AUTH_CRC7_FP_HEADER, /**< CRC7-FP-HEADER */ - IMB_AUTH_CRC6_IUUP_HEADER, /**< CRC6-IUUP-HEADER */ - IMB_AUTH_GHASH, /**< GHASH */ + IMB_AUTH_ZUC_EIA3_BITLEN, /**< 128-EIA3/NIA3 (3GPP) */ + IMB_AUTH_DOCSIS_CRC32, /**< with DOCSIS_SEC_BPI only */ + IMB_AUTH_SNOW3G_UIA2_BITLEN, /**< 128-UIA2 (3GPP) */ + IMB_AUTH_KASUMI_UIA1, /**< 128-UIA1 (3GPP) */ + IMB_AUTH_AES_GMAC_128, /**< AES-GMAC (128-bit key) */ + IMB_AUTH_AES_GMAC_192, /**< AES-GMAC (192-bit key) */ + IMB_AUTH_AES_GMAC_256, /**< AES-GMAC (256-bit key) */ + IMB_AUTH_AES_CMAC_256, /**< AES256-CMAC */ + IMB_AUTH_POLY1305, /**< POLY1305 */ + IMB_AUTH_CHACHA20_POLY1305, /**< AEAD POLY1305 */ + IMB_AUTH_CHACHA20_POLY1305_SGL, /**< AEAD CHACHA20 with SGL support */ + IMB_AUTH_ZUC256_EIA3_BITLEN, /**< 256-EIA3/NIA3 (3GPP) */ + IMB_AUTH_SNOW_V_AEAD, /**< SNOW-V-AEAD */ + IMB_AUTH_GCM_SGL, /**< AES-GCM with SGL support */ + IMB_AUTH_CRC32_ETHERNET_FCS, /**< CRC32-ETHERNET-FCS */ + IMB_AUTH_CRC32_SCTP, /**< CRC32-SCTP */ + IMB_AUTH_CRC32_WIMAX_OFDMA_DATA, /**< CRC32-WIMAX-OFDMA-DATA */ + IMB_AUTH_CRC24_LTE_A, /**< CRC32-LTE-A */ + IMB_AUTH_CRC24_LTE_B, /**< CRC32-LTE-B */ + IMB_AUTH_CRC16_X25, /**< CRC16-X25 */ + IMB_AUTH_CRC16_FP_DATA, /**< CRC16-FP-DATA */ + IMB_AUTH_CRC11_FP_HEADER, /**< CRC11-FP-HEADER */ + IMB_AUTH_CRC10_IUUP_DATA, /**< CRC10-IUUP-DATA */ + IMB_AUTH_CRC8_WIMAX_OFDMA_HCS, /**< CRC8-WIMAX-OFDMA-HCS */ + IMB_AUTH_CRC7_FP_HEADER, /**< CRC7-FP-HEADER */ + IMB_AUTH_CRC6_IUUP_HEADER, /**< CRC6-IUUP-HEADER */ + IMB_AUTH_GHASH, /**< GHASH */ IMB_AUTH_NUM } IMB_HASH_ALG; -typedef enum { - IMB_ORDER_CIPHER_HASH = 1, - IMB_ORDER_HASH_CIPHER -} IMB_CHAIN_ORDER; +typedef enum { IMB_ORDER_CIPHER_HASH = 1, IMB_ORDER_HASH_CIPHER } IMB_CHAIN_ORDER; typedef enum { IMB_KEY_64_BYTES = 8, @@ -361,20 +348,15 @@ typedef enum { IMB_KEY_256_BYTES = 32 } IMB_KEY_SIZE_BYTES; -typedef enum { - IMB_SGL_INIT = 0, - IMB_SGL_UPDATE, - IMB_SGL_COMPLETE, - IMB_SGL_ALL -} IMB_SGL_STATE; +typedef enum { IMB_SGL_INIT = 0, IMB_SGL_UPDATE, IMB_SGL_COMPLETE, IMB_SGL_ALL } IMB_SGL_STATE; /** * Input/output SGL segment structure. */ struct IMB_SGL_IOV { - const void *in; /**< Input segment */ - void *out; /**< Output segment */ - uint64_t len; /** Length of segment */ + const void *in; /**< Input segment */ + void *out; /**< Output segment */ + uint64_t len; /** Length of segment */ }; /** @@ -397,8 +379,8 @@ struct IMB_SGL_IOV { */ typedef struct IMB_JOB { - const void *enc_keys; /**< Encryption key pointer */ - const void *dec_keys; /**< Decryption key pointer */ + const void *enc_keys; /**< Encryption key pointer */ + const void *dec_keys; /**< Decryption key pointer */ uint64_t key_len_in_bytes; /**< Key length in bytes */ union { const uint8_t *src; /**< Input buffer. @@ -434,22 +416,22 @@ typedef struct IMB_JOB { /**< Length of message to hash (in bytes) */ uint64_t msg_len_to_hash_in_bits; /**< Length of message to hash (in bits) */ - }; /**< Length of message to hash */ - const uint8_t *iv; /**< Initialization Vector (IV) */ - uint64_t iv_len_in_bytes; /**< IV length in bytes */ - uint8_t *auth_tag_output; /**< Authentication tag output */ + }; /**< Length of message to hash */ + const uint8_t *iv; /**< Initialization Vector (IV) */ + uint64_t iv_len_in_bytes; /**< IV length in bytes */ + uint8_t *auth_tag_output; /**< Authentication tag output */ uint64_t auth_tag_output_len_in_bytes; /**< Authentication tag output - length in bytes */ + length in bytes */ /* Start hash algorithm-specific fields */ union { struct _HMAC_specific_fields { const uint8_t *_hashed_auth_key_xor_ipad; /**< Hashed result of HMAC key xor'd - * with ipad (0x36). */ + * with ipad (0x36). */ const uint8_t *_hashed_auth_key_xor_opad; /**< Hashed result of HMAC key xor'd - * with opad (0x5c). */ + * with opad (0x5c). */ } HMAC; /**< HMAC specific fields */ struct _AES_XCBC_specific_fields { const uint32_t *_k1_expanded; @@ -463,17 +445,17 @@ typedef struct IMB_JOB { const void *aad; /**< Additional Authentication Data (AAD) */ uint64_t aad_len_in_bytes; /**< Length of AAD */ - } CCM; /**< AES-CCM specific fields */ + } CCM; /**< AES-CCM specific fields */ struct _AES_CMAC_specific_fields { const void *_key_expanded; /**< Expanded key (16-byte aligned) */ const void *_skey1; /**< S key 1 (16-byte aligned) */ const void *_skey2; /**< S key 2 (16-byte aligned) */ - } CMAC; /**< AES-CMAC specific fields */ + } CMAC; /**< AES-CMAC specific fields */ struct _AES_GCM_specific_fields { const void *aad; /**< Additional Authentication Data (AAD) */ - uint64_t aad_len_in_bytes; /**< Length of AAD */ + uint64_t aad_len_in_bytes; /**< Length of AAD */ struct gcm_context_data *ctx; /**< AES-GCM context (for SGL only) */ } GCM; /**< AES-GCM specific fields */ @@ -507,7 +489,7 @@ typedef struct IMB_JOB { const struct gcm_key_data *_key; /**< Expanded GHASH key */ const void *_init_tag; /**< initial tag value */ - } GHASH; /**< GHASH specific fields */ + } GHASH; /**< GHASH specific fields */ struct _POLY1305_specific_fields { const void *_key; /**< Poly1305 key */ @@ -528,16 +510,16 @@ typedef struct IMB_JOB { void *reserved; /**< Reserved bytes */ } SNOW_V_AEAD; /**< SNOW-V AEAD specific fields */ - } u; /**< Hash algorithm-specific fields */ + } u; /**< Hash algorithm-specific fields */ - IMB_STATUS status; /**< Job status */ - IMB_CIPHER_MODE cipher_mode; /**< Cipher mode */ + IMB_STATUS status; /**< Job status */ + IMB_CIPHER_MODE cipher_mode; /**< Cipher mode */ IMB_CIPHER_DIRECTION cipher_direction; /**< Cipher direction */ - IMB_HASH_ALG hash_alg; /**< Hashing algorithm */ + IMB_HASH_ALG hash_alg; /**< Hashing algorithm */ IMB_CHAIN_ORDER chain_order; /**< Chain order (IMB_ORDER_CIPHER_HASH / IMB_ORDER_HASH_CIPHER).*/ - void *user_data; /**< Pointer 1 to user data */ + void *user_data; /**< Pointer 1 to user data */ void *user_data2; /**< Pointer 2 to user data */ int (*cipher_func)(struct IMB_JOB *); @@ -553,30 +535,29 @@ typedef struct IMB_JOB { struct _CBCS_specific_fields { void *next_iv; /**< Pointer to next IV (last ciphertext block) */ - } CBCS; /**< CBCS specific fields */ + } CBCS; /**< CBCS specific fields */ } cipher_fields; /**< Cipher algorithm-specific fields */ - void *suite_id[4]; /**< see imb_set_session() */ - uint32_t session_id; /**< see imb_set_session() */ + void *suite_id[4]; /**< see imb_set_session() */ + uint32_t session_id; /**< see imb_set_session() */ } IMB_JOB; - /* KASUMI */ /* 64 precomputed words for key schedule */ -#define KASUMI_KEY_SCHEDULE_SIZE 64 +#define KASUMI_KEY_SCHEDULE_SIZE 64 /** * Structure to maintain internal key scheduling */ typedef struct kasumi_key_sched_s { - /**< Kasumi internal scheduling */ - uint16_t sk16[KASUMI_KEY_SCHEDULE_SIZE]; /**< key schedule */ - uint16_t msk16[KASUMI_KEY_SCHEDULE_SIZE]; /**< modified key schedule */ + /**< Kasumi internal scheduling */ + uint16_t sk16[KASUMI_KEY_SCHEDULE_SIZE]; /**< key schedule */ + uint16_t msk16[KASUMI_KEY_SCHEDULE_SIZE]; /**< modified key schedule */ } kasumi_key_sched_t; /* GCM data structures */ -#define IMB_GCM_BLOCK_LEN 16 +#define IMB_GCM_BLOCK_LEN 16 /** * @brief holds GCM operation context @@ -584,12 +565,12 @@ typedef struct kasumi_key_sched_s { * init, update and finalize context data */ struct gcm_context_data { - uint8_t aad_hash[IMB_GCM_BLOCK_LEN]; + uint8_t aad_hash[IMB_GCM_BLOCK_LEN]; uint64_t aad_length; uint64_t in_length; - uint8_t partial_block_enc_key[IMB_GCM_BLOCK_LEN]; - uint8_t orig_IV[IMB_GCM_BLOCK_LEN]; - uint8_t current_counter[IMB_GCM_BLOCK_LEN]; + uint8_t partial_block_enc_key[IMB_GCM_BLOCK_LEN]; + uint8_t orig_IV[IMB_GCM_BLOCK_LEN]; + uint8_t current_counter[IMB_GCM_BLOCK_LEN]; uint64_t partial_block_length; }; #undef IMB_GCM_BLOCK_LEN @@ -598,19 +579,19 @@ struct gcm_context_data { * @brief holds Chacha20-Poly1305 operation context */ struct chacha20_poly1305_context_data { - uint64_t hash[3]; /**< Intermediate computation of hash value */ - uint64_t aad_len; /**< Total AAD length */ - uint64_t hash_len; /**< Total length to digest (excluding AAD) */ - uint8_t last_ks[64]; /**< Last 64 bytes of KS */ - uint8_t poly_key[32]; /**< Poly key */ - uint8_t poly_scratch[16]; /**< Scratchpad to compute Poly on 16 bytes */ + uint64_t hash[3]; /**< Intermediate computation of hash value */ + uint64_t aad_len; /**< Total AAD length */ + uint64_t hash_len; /**< Total length to digest (excluding AAD) */ + uint8_t last_ks[64]; /**< Last 64 bytes of KS */ + uint8_t poly_key[32]; /**< Poly key */ + uint8_t poly_scratch[16]; /**< Scratchpad to compute Poly on 16 bytes */ uint64_t last_block_count; /**< Last block count used in last segment */ - uint64_t remain_ks_bytes;/**< Amount of bytes still to use of keystream - (up to 63 bytes) */ - uint64_t remain_ct_bytes; /**< Amount of ciphertext bytes still to use - of previous segment to authenticate - (up to 16 bytes) */ - uint8_t IV[12]; /**< IV (12 bytes) */ + uint64_t remain_ks_bytes; /**< Amount of bytes still to use of keystream + (up to 63 bytes) */ + uint64_t remain_ct_bytes; /**< Amount of ciphertext bytes still to use + of previous segment to authenticate + (up to 16 bytes) */ + uint8_t IV[12]; /**< IV (12 bytes) */ }; /** @@ -645,7 +626,7 @@ struct chacha20_poly1305_context_data { #ifdef __WIN32 __declspec(align(64)) #endif /* WIN32 */ -struct gcm_key_data { + struct gcm_key_data { uint8_t expanded_keys[IMB_GCM_ENC_KEY_LEN * IMB_GCM_KEY_SETS]; union { /**< Storage for precomputed hash keys */ @@ -712,18 +693,12 @@ typedef IMB_JOB *(*submit_job_t)(struct IMB_MGR *); typedef IMB_JOB *(*get_completed_job_t)(struct IMB_MGR *); typedef IMB_JOB *(*flush_job_t)(struct IMB_MGR *); typedef uint32_t (*queue_size_t)(struct IMB_MGR *); -typedef uint32_t (*burst_fn_t)(struct IMB_MGR *, - const uint32_t, - struct IMB_JOB **); -typedef uint32_t (*submit_cipher_burst_t)(struct IMB_MGR *, - struct IMB_JOB *, - const uint32_t, +typedef uint32_t (*burst_fn_t)(struct IMB_MGR *, const uint32_t, struct IMB_JOB **); +typedef uint32_t (*submit_cipher_burst_t)(struct IMB_MGR *, struct IMB_JOB *, const uint32_t, const IMB_CIPHER_MODE cipher, const IMB_CIPHER_DIRECTION dir, const IMB_KEY_SIZE_BYTES key_size); -typedef uint32_t (*submit_hash_burst_t)(struct IMB_MGR *, - struct IMB_JOB *, - const uint32_t, +typedef uint32_t (*submit_hash_burst_t)(struct IMB_MGR *, struct IMB_JOB *, const uint32_t, const IMB_HASH_ALG hash); typedef void (*keyexp_t)(const void *, void *, void *); typedef void (*cmac_subkey_gen_t)(const void *, void *, void *); @@ -731,75 +706,47 @@ typedef void (*hash_one_block_t)(const void *, void *); typedef void (*hash_fn_t)(const void *, const uint64_t, void *); typedef void (*xcbc_keyexp_t)(const void *, void *, void *, void *); typedef int (*des_keysched_t)(uint64_t *, const void *); -typedef void (*aes_cfb_t)(void *, const void *, const void *, const void *, - uint64_t); -typedef void (*aes_gcm_enc_dec_t)(const struct gcm_key_data *, - struct gcm_context_data *, - uint8_t *, uint8_t const *, uint64_t, - const uint8_t *, uint8_t const *, uint64_t, - uint8_t *, uint64_t); -typedef void (*aes_gcm_enc_dec_iv_t)(const struct gcm_key_data *, - struct gcm_context_data *, uint8_t *, - uint8_t const *, const uint64_t, - const uint8_t *, uint8_t const *, - const uint64_t, uint8_t *, - const uint64_t, const uint64_t); -typedef void (*aes_gcm_init_t)(const struct gcm_key_data *, - struct gcm_context_data *, +typedef void (*aes_cfb_t)(void *, const void *, const void *, const void *, uint64_t); +typedef void (*aes_gcm_enc_dec_t)(const struct gcm_key_data *, struct gcm_context_data *, uint8_t *, + uint8_t const *, uint64_t, const uint8_t *, uint8_t const *, + uint64_t, uint8_t *, uint64_t); +typedef void (*aes_gcm_enc_dec_iv_t)(const struct gcm_key_data *, struct gcm_context_data *, + uint8_t *, uint8_t const *, const uint64_t, const uint8_t *, + uint8_t const *, const uint64_t, uint8_t *, const uint64_t, + const uint64_t); +typedef void (*aes_gcm_init_t)(const struct gcm_key_data *, struct gcm_context_data *, const uint8_t *, uint8_t const *, uint64_t); -typedef void (*aes_gcm_init_var_iv_t)(const struct gcm_key_data *, - struct gcm_context_data *, - const uint8_t *, const uint64_t, - const uint8_t *, const uint64_t); -typedef void (*aes_gcm_enc_dec_update_t)(const struct gcm_key_data *, - struct gcm_context_data *, +typedef void (*aes_gcm_init_var_iv_t)(const struct gcm_key_data *, struct gcm_context_data *, + const uint8_t *, const uint64_t, const uint8_t *, + const uint64_t); +typedef void (*aes_gcm_enc_dec_update_t)(const struct gcm_key_data *, struct gcm_context_data *, uint8_t *, const uint8_t *, uint64_t); -typedef void (*aes_gcm_enc_dec_finalize_t)(const struct gcm_key_data *, - struct gcm_context_data *, +typedef void (*aes_gcm_enc_dec_finalize_t)(const struct gcm_key_data *, struct gcm_context_data *, uint8_t *, uint64_t); typedef void (*aes_gcm_precomp_t)(struct gcm_key_data *); typedef void (*aes_gcm_pre_t)(const void *, struct gcm_key_data *); -typedef void (*aes_gmac_init_t)(const struct gcm_key_data *, - struct gcm_context_data *, +typedef void (*aes_gmac_init_t)(const struct gcm_key_data *, struct gcm_context_data *, const uint8_t *, const uint64_t); -typedef void (*aes_gmac_update_t)(const struct gcm_key_data *, - struct gcm_context_data *, +typedef void (*aes_gmac_update_t)(const struct gcm_key_data *, struct gcm_context_data *, const uint8_t *, const uint64_t); -typedef void (*aes_gmac_finalize_t)(const struct gcm_key_data *, - struct gcm_context_data *, - uint8_t *, const uint64_t); +typedef void (*aes_gmac_finalize_t)(const struct gcm_key_data *, struct gcm_context_data *, + uint8_t *, const uint64_t); -typedef void (*chacha_poly_init_t)(const void *, - struct chacha20_poly1305_context_data *, +typedef void (*chacha_poly_init_t)(const void *, struct chacha20_poly1305_context_data *, const void *, const void *, const uint64_t); -typedef void (*chacha_poly_enc_dec_update_t)(const void *, - struct chacha20_poly1305_context_data *, - void *, const void *, const uint64_t); -typedef void (*chacha_poly_finalize_t)(struct chacha20_poly1305_context_data *, - void *, const uint64_t); -typedef void (*ghash_t)(const struct gcm_key_data *, const void *, - const uint64_t, void *, const uint64_t); - -typedef void (*zuc_eea3_1_buffer_t)(const void *, const void *, const void *, - void *, const uint32_t); - -typedef void (*zuc_eea3_4_buffer_t)(const void * const *, const void * const *, - const void * const *, void **, - const uint32_t *); - -typedef void (*zuc_eea3_n_buffer_t)(const void * const *, const void * const *, - const void * const *, void **, - const uint32_t *, const uint32_t); - -typedef void (*zuc_eia3_1_buffer_t)(const void *, const void *, const void *, - const uint32_t, uint32_t *); - -typedef void (*zuc_eia3_n_buffer_t)(const void * const *, const void * const *, - const void * const *, - const uint32_t *, uint32_t **, +typedef void (*chacha_poly_enc_dec_update_t)(const void *, struct chacha20_poly1305_context_data *, + void *, const void *, const uint64_t); +typedef void (*chacha_poly_finalize_t)(struct chacha20_poly1305_context_data *, void *, + const uint64_t); +typedef void (*ghash_t)(const struct gcm_key_data *, const void *, const uint64_t, void *, + const uint64_t); + +typedef void (*zuc_eea3_1_buffer_t)(const void *, const void *, const void *, void *, const uint32_t); +typedef void (*zuc_eea3_4_buffer_t)(const void *const *, const void *const *, const void *const *, + void **, const uint32_t *); #ifdef __aarch64__ typedef void (*zuc256_eea3_1_buffer_t)(const void *, const void *, const uint32_t, const void *, @@ -817,53 +764,40 @@ typedef void (*zuc256_eia3_n_buffer_t)(const void * const *, const void * const const uint32_t *, uint32_t **, const uint64_t, const uint32_t); #endif +typedef void (*zuc_eea3_n_buffer_t)(const void *const *, const void *const *, const void *const *, + void **, const uint32_t *, const uint32_t); -typedef void (*kasumi_f8_1_buffer_t)(const kasumi_key_sched_t *, - const uint64_t, const void *, void *, - const uint32_t); -typedef void (*kasumi_f8_1_buffer_bit_t)(const kasumi_key_sched_t *, - const uint64_t, const void *, - void *, - const uint32_t, const uint32_t); -typedef void (*kasumi_f8_2_buffer_t)(const kasumi_key_sched_t *, - const uint64_t, const uint64_t, - const void *, void *, - const uint32_t, - const void *, void *, - const uint32_t); -typedef void (*kasumi_f8_3_buffer_t)(const kasumi_key_sched_t *, - const uint64_t, const uint64_t, - const uint64_t, - const void *, void *, - const void *, void *, - const void *, void *, - const uint32_t); -typedef void (*kasumi_f8_4_buffer_t)(const kasumi_key_sched_t *, - const uint64_t, const uint64_t, - const uint64_t, const uint64_t, - const void *, void *, - const void *, void *, - const void *, void *, - const void *, void *, +typedef void (*zuc_eia3_1_buffer_t)(const void *, const void *, const void *, const uint32_t, + uint32_t *); + +typedef void (*zuc_eia3_n_buffer_t)(const void *const *, const void *const *, const void *const *, + const uint32_t *, uint32_t **, const uint32_t); + +typedef void (*kasumi_f8_1_buffer_t)(const kasumi_key_sched_t *, const uint64_t, const void *, + void *, const uint32_t); +typedef void (*kasumi_f8_1_buffer_bit_t)(const kasumi_key_sched_t *, const uint64_t, const void *, + void *, const uint32_t, const uint32_t); +typedef void (*kasumi_f8_2_buffer_t)(const kasumi_key_sched_t *, const uint64_t, const uint64_t, + const void *, void *, const uint32_t, const void *, void *, const uint32_t); -typedef void (*kasumi_f8_n_buffer_t)(const kasumi_key_sched_t *, - const uint64_t *, const void * const *, - void **, const uint32_t *, +typedef void (*kasumi_f8_3_buffer_t)(const kasumi_key_sched_t *, const uint64_t, const uint64_t, + const uint64_t, const void *, void *, const void *, void *, + const void *, void *, const uint32_t); +typedef void (*kasumi_f8_4_buffer_t)(const kasumi_key_sched_t *, const uint64_t, const uint64_t, + const uint64_t, const uint64_t, const void *, void *, + const void *, void *, const void *, void *, const void *, + void *, const uint32_t); +typedef void (*kasumi_f8_n_buffer_t)(const kasumi_key_sched_t *, const uint64_t *, + const void *const *, void **, const uint32_t *, const uint32_t); -typedef void (*kasumi_f9_1_buffer_user_t)(const kasumi_key_sched_t *, - const uint64_t, const void *, - const uint32_t, void *, - const uint32_t); -typedef void (*kasumi_f9_1_buffer_t)(const kasumi_key_sched_t *, - const void *, - const uint32_t, void *); -typedef int (*kasumi_init_f8_key_sched_t)(const void *, - kasumi_key_sched_t *); -typedef int (*kasumi_init_f9_key_sched_t)(const void *, - kasumi_key_sched_t *); +typedef void (*kasumi_f9_1_buffer_user_t)(const kasumi_key_sched_t *, const uint64_t, const void *, + const uint32_t, void *, const uint32_t); +typedef void (*kasumi_f9_1_buffer_t)(const kasumi_key_sched_t *, const void *, const uint32_t, + void *); +typedef int (*kasumi_init_f8_key_sched_t)(const void *, kasumi_key_sched_t *); +typedef int (*kasumi_init_f9_key_sched_t)(const void *, kasumi_key_sched_t *); typedef size_t (*kasumi_key_sched_size_t)(void); - /** * Snow3G key scheduling structure */ @@ -872,25 +806,14 @@ typedef struct snow3g_key_schedule_s { uint32_t k[4]; } snow3g_key_schedule_t; -typedef void (*snow3g_f8_1_buffer_t)(const snow3g_key_schedule_t *, - const void *, const void *, +typedef void (*snow3g_f8_1_buffer_t)(const snow3g_key_schedule_t *, const void *, const void *, void *, const uint32_t); -typedef void (*snow3g_f8_1_buffer_bit_t)(const snow3g_key_schedule_t *, - const void *, const void *, void *, - const uint32_t, const uint32_t); - -typedef void (*snow3g_f8_2_buffer_t)(const snow3g_key_schedule_t *, - const void *, const void *, - const void *, void *, const uint32_t, - const void *, void *, const uint32_t); +typedef void (*snow3g_f8_1_buffer_bit_t)(const snow3g_key_schedule_t *, const void *, const void *, + void *, const uint32_t, const uint32_t); -typedef void (*snow3g_f8_4_buffer_t)(const snow3g_key_schedule_t *, - const void *, const void *, const void *, - const void *, const void *, void *, - const uint32_t, const void *, void *, - const uint32_t, const void *, void *, - const uint32_t, const void *, void *, +typedef void (*snow3g_f8_2_buffer_t)(const snow3g_key_schedule_t *, const void *, const void *, + const void *, void *, const uint32_t, const void *, void *, const uint32_t); #ifdef __aarch64__ @@ -905,44 +828,36 @@ typedef void (*snow3g_f8_4_buffer_multikey_t)(const snow3g_key_schedule_t *, const uint32_t, const void *, void *, const uint32_t); #endif - -typedef void (*snow3g_f8_8_buffer_t)(const snow3g_key_schedule_t *, - const void *, const void *, const void *, - const void *, const void *, const void *, - const void *, const void *, const void *, - void *, const uint32_t, const void *, - void *, const uint32_t, const void *, - void *, const uint32_t, const void *, - void *, const uint32_t, const void *, - void *, const uint32_t, const void *, - void *, const uint32_t, const void *, - void *, const uint32_t, const void *, - void *, const uint32_t); - -typedef void -(*snow3g_f8_8_buffer_multikey_t)(const snow3g_key_schedule_t * const [], - const void * const [], const void * const [], - void *[], const uint32_t[]); - -typedef void (*snow3g_f8_n_buffer_t)(const snow3g_key_schedule_t *, - const void * const [], - const void * const [], - void *[], const uint32_t[], +typedef void (*snow3g_f8_4_buffer_t)(const snow3g_key_schedule_t *, const void *, const void *, + const void *, const void *, const void *, void *, + const uint32_t, const void *, void *, const uint32_t, + const void *, void *, const uint32_t, const void *, void *, + const uint32_t); +typedef void (*snow3g_f8_8_buffer_t)(const snow3g_key_schedule_t *, const void *, const void *, + const void *, const void *, const void *, const void *, + const void *, const void *, const void *, void *, + const uint32_t, const void *, void *, const uint32_t, + const void *, void *, const uint32_t, const void *, void *, + const uint32_t, const void *, void *, const uint32_t, + const void *, void *, const uint32_t, const void *, void *, + const uint32_t, const void *, void *, const uint32_t); + +typedef void (*snow3g_f8_8_buffer_multikey_t)(const snow3g_key_schedule_t *const[], + const void *const[], const void *const[], void *[], + const uint32_t[]); + +typedef void (*snow3g_f8_n_buffer_t)(const snow3g_key_schedule_t *, const void *const[], + const void *const[], void *[], const uint32_t[], const uint32_t); -typedef void -(*snow3g_f8_n_buffer_multikey_t)(const snow3g_key_schedule_t * const [], - const void * const [], - const void * const [], - void *[], const uint32_t[], - const uint32_t); +typedef void (*snow3g_f8_n_buffer_multikey_t)(const snow3g_key_schedule_t *const[], + const void *const[], const void *const[], void *[], + const uint32_t[], const uint32_t); -typedef void (*snow3g_f9_1_buffer_t)(const snow3g_key_schedule_t *, - const void *, const void *, +typedef void (*snow3g_f9_1_buffer_t)(const snow3g_key_schedule_t *, const void *, const void *, const uint64_t, void *); -typedef int (*snow3g_init_key_sched_t)(const void *, - snow3g_key_schedule_t *); +typedef int (*snow3g_init_key_sched_t)(const void *, snow3g_key_schedule_t *); typedef size_t (*snow3g_key_sched_size_t)(void); @@ -951,19 +866,17 @@ typedef uint64_t (*hec_64_t)(const uint8_t *); typedef uint32_t (*crc32_fn_t)(const void *, const uint64_t); -typedef void (*aes_ecb_quic_t)(const void *, const void *, - void *out, uint64_t); +typedef void (*aes_ecb_quic_t)(const void *, const void *, void *out, uint64_t); -typedef IMB_JOB * (*chacha20_poly1305_quic_t)(struct IMB_MGR *, IMB_JOB *); +typedef IMB_JOB *(*chacha20_poly1305_quic_t)(struct IMB_MGR *, IMB_JOB *); -typedef void (*chacha20_hp_quic_t)(const void *, const void * const *, - void **, const uint64_t); +typedef void (*chacha20_hp_quic_t)(const void *, const void *const *, void **, const uint64_t); /* Multi-buffer manager flags passed to alloc_mb_mgr() */ #define IMB_FLAG_SHANI_OFF (1ULL << 0) /**< disable use of SHANI extension */ #define IMB_FLAG_AESNI_OFF (1ULL << 1) /**< disable use of AESNI extension */ -#define IMB_FLAG_GFNI_OFF (1ULL << 2) /**< disable use of GFNI extension */ +#define IMB_FLAG_GFNI_OFF (1ULL << 2) /**< disable use of GFNI extension */ /** * Multi-buffer manager detected features @@ -972,54 +885,51 @@ typedef void (*chacha20_hp_quic_t)(const void *, const void * const *, * - some HW supported features can be disabled via IMB_FLAG_xxx (see above) */ -#define IMB_FEATURE_SHANI (1ULL << 0) -#define IMB_FEATURE_AESNI (1ULL << 1) -#define IMB_FEATURE_PCLMULQDQ (1ULL << 2) -#define IMB_FEATURE_CMOV (1ULL << 3) -#define IMB_FEATURE_SSE4_2 (1ULL << 4) -#define IMB_FEATURE_AVX (1ULL << 5) -#define IMB_FEATURE_AVX2 (1ULL << 6) -#define IMB_FEATURE_AVX512F (1ULL << 7) -#define IMB_FEATURE_AVX512DQ (1ULL << 8) -#define IMB_FEATURE_AVX512CD (1ULL << 9) -#define IMB_FEATURE_AVX512BW (1ULL << 10) -#define IMB_FEATURE_AVX512VL (1ULL << 11) -#define IMB_FEATURE_AVX512_SKX (IMB_FEATURE_AVX512F | IMB_FEATURE_AVX512DQ | \ - IMB_FEATURE_AVX512CD | IMB_FEATURE_AVX512BW | \ - IMB_FEATURE_AVX512VL) -#define IMB_FEATURE_VAES (1ULL << 12) -#define IMB_FEATURE_VPCLMULQDQ (1ULL << 13) -#define IMB_FEATURE_SAFE_DATA (1ULL << 14) -#define IMB_FEATURE_SAFE_PARAM (1ULL << 15) -#define IMB_FEATURE_GFNI (1ULL << 16) -#define IMB_FEATURE_AVX512_IFMA (1ULL << 17) -#define IMB_FEATURE_BMI2 (1ULL << 18) -#define IMB_FEATURE_AESNI_EMU (1ULL << 19) -#define IMB_FEATURE_SELF_TEST (1ULL << 20) /* self-test feature present */ +#define IMB_FEATURE_SHANI (1ULL << 0) +#define IMB_FEATURE_AESNI (1ULL << 1) +#define IMB_FEATURE_PCLMULQDQ (1ULL << 2) +#define IMB_FEATURE_CMOV (1ULL << 3) +#define IMB_FEATURE_SSE4_2 (1ULL << 4) +#define IMB_FEATURE_AVX (1ULL << 5) +#define IMB_FEATURE_AVX2 (1ULL << 6) +#define IMB_FEATURE_AVX512F (1ULL << 7) +#define IMB_FEATURE_AVX512DQ (1ULL << 8) +#define IMB_FEATURE_AVX512CD (1ULL << 9) +#define IMB_FEATURE_AVX512BW (1ULL << 10) +#define IMB_FEATURE_AVX512VL (1ULL << 11) +#define IMB_FEATURE_AVX512_SKX \ + (IMB_FEATURE_AVX512F | IMB_FEATURE_AVX512DQ | IMB_FEATURE_AVX512CD | \ + IMB_FEATURE_AVX512BW | IMB_FEATURE_AVX512VL) +#define IMB_FEATURE_VAES (1ULL << 12) +#define IMB_FEATURE_VPCLMULQDQ (1ULL << 13) +#define IMB_FEATURE_SAFE_DATA (1ULL << 14) +#define IMB_FEATURE_SAFE_PARAM (1ULL << 15) +#define IMB_FEATURE_GFNI (1ULL << 16) +#define IMB_FEATURE_AVX512_IFMA (1ULL << 17) +#define IMB_FEATURE_BMI2 (1ULL << 18) +#define IMB_FEATURE_AESNI_EMU (1ULL << 19) +#define IMB_FEATURE_SELF_TEST (1ULL << 20) /* self-test feature present */ #define IMB_FEATURE_SELF_TEST_PASS (1ULL << 21) /* self-test passed */ -#define IMB_FEATURE_AVX_IFMA (1ULL << 22) +#define IMB_FEATURE_AVX_IFMA (1ULL << 22) /** * CPU flags needed for each implementation */ -#define IMB_CPUFLAGS_NO_AESNI (IMB_FEATURE_SSE4_2 | IMB_FEATURE_CMOV) -#define IMB_CPUFLAGS_SSE (IMB_CPUFLAGS_NO_AESNI | IMB_FEATURE_AESNI | \ - IMB_FEATURE_PCLMULQDQ) -#define IMB_CPUFLAGS_SSE_T2 (IMB_CPUFLAGS_SSE | IMB_FEATURE_SHANI) -#define IMB_CPUFLAGS_SSE_T3 (IMB_CPUFLAGS_SSE_T2 | IMB_FEATURE_GFNI) -#define IMB_CPUFLAGS_AVX (IMB_CPUFLAGS_SSE | IMB_FEATURE_AVX) -#define IMB_CPUFLAGS_AVX2 (IMB_CPUFLAGS_AVX | IMB_FEATURE_AVX2 | \ - IMB_FEATURE_BMI2) -#define IMB_CPUFLAGS_AVX512 (IMB_CPUFLAGS_AVX2 | IMB_FEATURE_AVX512_SKX) -#define IMB_CPUFLAGS_AVX512_T2 (IMB_CPUFLAGS_AVX512 | IMB_FEATURE_VAES | \ - IMB_FEATURE_VPCLMULQDQ | IMB_FEATURE_GFNI | \ - IMB_FEATURE_AVX512_IFMA | IMB_FEATURE_SHANI) -#define IMB_CPUFLAGS_AVX2_T2 (IMB_CPUFLAGS_AVX2 | IMB_FEATURE_SHANI | \ - IMB_FEATURE_VAES | IMB_FEATURE_VPCLMULQDQ | \ - IMB_FEATURE_GFNI) -#define IMB_CPUFLAGS_AVX_T2 (IMB_CPUFLAGS_AVX | IMB_FEATURE_SHANI | \ - IMB_FEATURE_GFNI) -#define IMB_CPUFLAGS_AVX2_T3 (IMB_CPUFLAGS_AVX2_T2 | IMB_FEATURE_AVX_IFMA) +#define IMB_CPUFLAGS_NO_AESNI (IMB_FEATURE_SSE4_2 | IMB_FEATURE_CMOV) +#define IMB_CPUFLAGS_SSE (IMB_CPUFLAGS_NO_AESNI | IMB_FEATURE_AESNI | IMB_FEATURE_PCLMULQDQ) +#define IMB_CPUFLAGS_SSE_T2 (IMB_CPUFLAGS_SSE | IMB_FEATURE_SHANI) +#define IMB_CPUFLAGS_SSE_T3 (IMB_CPUFLAGS_SSE_T2 | IMB_FEATURE_GFNI) +#define IMB_CPUFLAGS_AVX (IMB_CPUFLAGS_SSE | IMB_FEATURE_AVX) +#define IMB_CPUFLAGS_AVX2 (IMB_CPUFLAGS_AVX | IMB_FEATURE_AVX2 | IMB_FEATURE_BMI2) +#define IMB_CPUFLAGS_AVX512 (IMB_CPUFLAGS_AVX2 | IMB_FEATURE_AVX512_SKX) +#define IMB_CPUFLAGS_AVX512_T2 \ + (IMB_CPUFLAGS_AVX512 | IMB_FEATURE_VAES | IMB_FEATURE_VPCLMULQDQ | IMB_FEATURE_GFNI | \ + IMB_FEATURE_AVX512_IFMA | IMB_FEATURE_SHANI) +#define IMB_CPUFLAGS_AVX2_T2 \ + (IMB_CPUFLAGS_AVX2 | IMB_FEATURE_SHANI | IMB_FEATURE_VAES | IMB_FEATURE_VPCLMULQDQ | \ + IMB_FEATURE_GFNI) +#define IMB_CPUFLAGS_AVX_T2 (IMB_CPUFLAGS_AVX | IMB_FEATURE_SHANI | IMB_FEATURE_GFNI) +#define IMB_CPUFLAGS_AVX2_T3 (IMB_CPUFLAGS_AVX2_T2 | IMB_FEATURE_AVX_IFMA) #define IMB_FEATURE_AARCH64 (1ULL << 32) #define IMB_FEATURE_ASIMD (1ULL << 33) @@ -1029,17 +939,17 @@ typedef void (*chacha20_hp_quic_t)(const void *, const void * const *, /* TOP LEVEL (IMB_MGR) Data structure fields */ #define IMB_MAX_BURST_SIZE 128 -#define IMB_MAX_JOBS (IMB_MAX_BURST_SIZE * 2) +#define IMB_MAX_JOBS (IMB_MAX_BURST_SIZE * 2) typedef struct IMB_MGR { - uint64_t flags; /**< passed to alloc_mb_mgr() */ + uint64_t flags; /**< passed to alloc_mb_mgr() */ uint64_t features; /**< reflects features of multi-buffer instance */ uint64_t reserved[5]; /**< reserved for the future */ - uint32_t used_arch; /**< Architecture being used */ + uint32_t used_arch; /**< Architecture being used */ - int imb_errno; /**< per mb_mgr error status */ + int imb_errno; /**< per mb_mgr error status */ /** * ARCH handlers / API @@ -1047,40 +957,40 @@ typedef struct IMB_MGR { * (always include function pointers at the end of the list, * before "earliest_job") */ - get_next_job_t get_next_job; - submit_job_t submit_job; - submit_job_t submit_job_nocheck; - get_completed_job_t get_completed_job; - flush_job_t flush_job; - queue_size_t queue_size; - keyexp_t keyexp_128; - keyexp_t keyexp_192; - keyexp_t keyexp_256; - cmac_subkey_gen_t cmac_subkey_gen_128; - xcbc_keyexp_t xcbc_keyexp; - des_keysched_t des_key_sched; - hash_one_block_t sha1_one_block; - hash_one_block_t sha224_one_block; - hash_one_block_t sha256_one_block; - hash_one_block_t sha384_one_block; - hash_one_block_t sha512_one_block; - hash_one_block_t md5_one_block; - hash_fn_t sha1; - hash_fn_t sha224; - hash_fn_t sha256; - hash_fn_t sha384; - hash_fn_t sha512; - aes_cfb_t aes128_cfb_one; - - aes_gcm_enc_dec_t gcm128_enc; - aes_gcm_enc_dec_t gcm192_enc; - aes_gcm_enc_dec_t gcm256_enc; - aes_gcm_enc_dec_t gcm128_dec; - aes_gcm_enc_dec_t gcm192_dec; - aes_gcm_enc_dec_t gcm256_dec; - aes_gcm_init_t gcm128_init; - aes_gcm_init_t gcm192_init; - aes_gcm_init_t gcm256_init; + get_next_job_t get_next_job; + submit_job_t submit_job; + submit_job_t submit_job_nocheck; + get_completed_job_t get_completed_job; + flush_job_t flush_job; + queue_size_t queue_size; + keyexp_t keyexp_128; + keyexp_t keyexp_192; + keyexp_t keyexp_256; + cmac_subkey_gen_t cmac_subkey_gen_128; + xcbc_keyexp_t xcbc_keyexp; + des_keysched_t des_key_sched; + hash_one_block_t sha1_one_block; + hash_one_block_t sha224_one_block; + hash_one_block_t sha256_one_block; + hash_one_block_t sha384_one_block; + hash_one_block_t sha512_one_block; + hash_one_block_t md5_one_block; + hash_fn_t sha1; + hash_fn_t sha224; + hash_fn_t sha256; + hash_fn_t sha384; + hash_fn_t sha512; + aes_cfb_t aes128_cfb_one; + + aes_gcm_enc_dec_t gcm128_enc; + aes_gcm_enc_dec_t gcm192_enc; + aes_gcm_enc_dec_t gcm256_enc; + aes_gcm_enc_dec_t gcm128_dec; + aes_gcm_enc_dec_t gcm192_dec; + aes_gcm_enc_dec_t gcm256_dec; + aes_gcm_init_t gcm128_init; + aes_gcm_init_t gcm192_init; + aes_gcm_init_t gcm256_init; aes_gcm_enc_dec_update_t gcm128_enc_update; aes_gcm_enc_dec_update_t gcm192_enc_update; aes_gcm_enc_dec_update_t gcm256_enc_update; @@ -1093,12 +1003,12 @@ typedef struct IMB_MGR { aes_gcm_enc_dec_finalize_t gcm128_dec_finalize; aes_gcm_enc_dec_finalize_t gcm192_dec_finalize; aes_gcm_enc_dec_finalize_t gcm256_dec_finalize; - aes_gcm_precomp_t gcm128_precomp; - aes_gcm_precomp_t gcm192_precomp; - aes_gcm_precomp_t gcm256_precomp; - aes_gcm_pre_t gcm128_pre; - aes_gcm_pre_t gcm192_pre; - aes_gcm_pre_t gcm256_pre; + aes_gcm_precomp_t gcm128_precomp; + aes_gcm_precomp_t gcm192_precomp; + aes_gcm_precomp_t gcm256_precomp; + aes_gcm_pre_t gcm128_pre; + aes_gcm_pre_t gcm192_pre; + aes_gcm_pre_t gcm256_pre; zuc_eea3_1_buffer_t eea3_1_buffer; zuc_eea3_4_buffer_t eea3_4_buffer; @@ -1111,17 +1021,17 @@ typedef struct IMB_MGR { zuc256_eia3_1_buffer_t zuc256_eia3_1_buffer; zuc256_eia3_n_buffer_t zuc256_eia3_n_buffer; #endif - kasumi_f8_1_buffer_t f8_1_buffer; - kasumi_f8_1_buffer_bit_t f8_1_buffer_bit; - kasumi_f8_2_buffer_t f8_2_buffer; - kasumi_f8_3_buffer_t f8_3_buffer; - kasumi_f8_4_buffer_t f8_4_buffer; - kasumi_f8_n_buffer_t f8_n_buffer; - kasumi_f9_1_buffer_t f9_1_buffer; + kasumi_f8_1_buffer_t f8_1_buffer; + kasumi_f8_1_buffer_bit_t f8_1_buffer_bit; + kasumi_f8_2_buffer_t f8_2_buffer; + kasumi_f8_3_buffer_t f8_3_buffer; + kasumi_f8_4_buffer_t f8_4_buffer; + kasumi_f8_n_buffer_t f8_n_buffer; + kasumi_f9_1_buffer_t f9_1_buffer; kasumi_f9_1_buffer_user_t f9_1_buffer_user; kasumi_init_f8_key_sched_t kasumi_init_f8_key_sched; kasumi_init_f9_key_sched_t kasumi_init_f9_key_sched; - kasumi_key_sched_size_t kasumi_key_sched_size; + kasumi_key_sched_size_t kasumi_key_sched_size; snow3g_f8_1_buffer_bit_t snow3g_f8_1_buffer_bit; snow3g_f8_1_buffer_t snow3g_f8_1_buffer; @@ -1138,42 +1048,42 @@ typedef struct IMB_MGR { snow3g_init_key_sched_t snow3g_init_key_sched; snow3g_key_sched_size_t snow3g_key_sched_size; - ghash_t ghash; - zuc_eia3_n_buffer_t eia3_n_buffer; - aes_gcm_init_var_iv_t gcm128_init_var_iv; - aes_gcm_init_var_iv_t gcm192_init_var_iv; - aes_gcm_init_var_iv_t gcm256_init_var_iv; - - aes_gmac_init_t gmac128_init; - aes_gmac_init_t gmac192_init; - aes_gmac_init_t gmac256_init; - aes_gmac_update_t gmac128_update; - aes_gmac_update_t gmac192_update; - aes_gmac_update_t gmac256_update; - aes_gmac_finalize_t gmac128_finalize; - aes_gmac_finalize_t gmac192_finalize; - aes_gmac_finalize_t gmac256_finalize; - hec_32_t hec_32; - hec_64_t hec_64; - cmac_subkey_gen_t cmac_subkey_gen_256; - aes_gcm_pre_t ghash_pre; - crc32_fn_t crc32_ethernet_fcs; - crc32_fn_t crc16_x25; - crc32_fn_t crc32_sctp; - crc32_fn_t crc24_lte_a; - crc32_fn_t crc24_lte_b; - crc32_fn_t crc16_fp_data; - crc32_fn_t crc11_fp_header; - crc32_fn_t crc7_fp_header; - crc32_fn_t crc10_iuup_data; - crc32_fn_t crc6_iuup_header; - crc32_fn_t crc32_wimax_ofdma_data; - crc32_fn_t crc8_wimax_ofdma_hcs; - - chacha_poly_init_t chacha20_poly1305_init; + ghash_t ghash; + zuc_eia3_n_buffer_t eia3_n_buffer; + aes_gcm_init_var_iv_t gcm128_init_var_iv; + aes_gcm_init_var_iv_t gcm192_init_var_iv; + aes_gcm_init_var_iv_t gcm256_init_var_iv; + + aes_gmac_init_t gmac128_init; + aes_gmac_init_t gmac192_init; + aes_gmac_init_t gmac256_init; + aes_gmac_update_t gmac128_update; + aes_gmac_update_t gmac192_update; + aes_gmac_update_t gmac256_update; + aes_gmac_finalize_t gmac128_finalize; + aes_gmac_finalize_t gmac192_finalize; + aes_gmac_finalize_t gmac256_finalize; + hec_32_t hec_32; + hec_64_t hec_64; + cmac_subkey_gen_t cmac_subkey_gen_256; + aes_gcm_pre_t ghash_pre; + crc32_fn_t crc32_ethernet_fcs; + crc32_fn_t crc16_x25; + crc32_fn_t crc32_sctp; + crc32_fn_t crc24_lte_a; + crc32_fn_t crc24_lte_b; + crc32_fn_t crc16_fp_data; + crc32_fn_t crc11_fp_header; + crc32_fn_t crc7_fp_header; + crc32_fn_t crc10_iuup_data; + crc32_fn_t crc6_iuup_header; + crc32_fn_t crc32_wimax_ofdma_data; + crc32_fn_t crc8_wimax_ofdma_hcs; + + chacha_poly_init_t chacha20_poly1305_init; chacha_poly_enc_dec_update_t chacha20_poly1305_enc_update; chacha_poly_enc_dec_update_t chacha20_poly1305_dec_update; - chacha_poly_finalize_t chacha20_poly1305_finalize; + chacha_poly_finalize_t chacha20_poly1305_finalize; burst_fn_t get_next_burst; burst_fn_t submit_burst; @@ -1194,9 +1104,9 @@ typedef struct IMB_MGR { chacha20_hp_quic_t chacha20_hp_quic; /* in-order scheduler fields */ - int earliest_job; /**< byte offset, -1 if none */ - int next_job; /**< byte offset */ - IMB_JOB jobs[IMB_MAX_JOBS]; + int earliest_job; /**< byte offset, -1 if none */ + int next_job; /**< byte offset */ + IMB_JOB jobs[IMB_MAX_JOBS]; /* out of order managers */ void *aes128_ooo; @@ -1243,13 +1153,13 @@ typedef struct IMB_MGR { * API definitions */ - /** * @brief Get library version in string format * * @return library version string */ -IMB_DLL_EXPORT const char *imb_get_version_str(void); +IMB_DLL_EXPORT const char * +imb_get_version_str(void); /** * @brief Get library version in numerical format @@ -1259,8 +1169,8 @@ IMB_DLL_EXPORT const char *imb_get_version_str(void); * * @return library version number */ -IMB_DLL_EXPORT unsigned imb_get_version(void); - +IMB_DLL_EXPORT unsigned +imb_get_version(void); /** * @brief API to get error status @@ -1269,7 +1179,8 @@ IMB_DLL_EXPORT unsigned imb_get_version(void); * * @retval Integer error type */ -IMB_DLL_EXPORT int imb_get_errno(IMB_MGR *mb_mgr); +IMB_DLL_EXPORT int +imb_get_errno(IMB_MGR *mb_mgr); /** * @brief API to get description for \a errnum @@ -1278,7 +1189,8 @@ IMB_DLL_EXPORT int imb_get_errno(IMB_MGR *mb_mgr); * * @retval String description of \a errnum */ -IMB_DLL_EXPORT const char *imb_get_strerror(int errnum); +IMB_DLL_EXPORT const char * +imb_get_strerror(int errnum); /** * get_next_job returns a job object. This must be filled in and returned @@ -1305,7 +1217,8 @@ IMB_DLL_EXPORT const char *imb_get_strerror(int errnum); * @return Pointer to allocated memory for IMB_MGR structure * @retval NULL on allocation error */ -IMB_DLL_EXPORT IMB_MGR *alloc_mb_mgr(uint64_t flags); +IMB_DLL_EXPORT IMB_MGR * +alloc_mb_mgr(uint64_t flags); /** * @brief Frees memory allocated previously by alloc_mb_mgr() @@ -1313,14 +1226,16 @@ IMB_DLL_EXPORT IMB_MGR *alloc_mb_mgr(uint64_t flags); * @param [in] ptr Pointer to allocated MB_MGR structure * */ -IMB_DLL_EXPORT void free_mb_mgr(IMB_MGR *ptr); +IMB_DLL_EXPORT void +free_mb_mgr(IMB_MGR *ptr); /** * @brief Calculates necessary memory size for IMB_MGR. * * @return Size for IMB_MGR (aligned to 64 bytes) */ -IMB_DLL_EXPORT size_t imb_get_mb_mgr_size(void); +IMB_DLL_EXPORT size_t +imb_get_mb_mgr_size(void); /** * @brief Initializes IMB_MGR pointers to out-of-order managers with @@ -1344,8 +1259,8 @@ IMB_DLL_EXPORT size_t imb_get_mb_mgr_size(void); * * @return Pointer to IMB_MGR structure */ -IMB_DLL_EXPORT IMB_MGR *imb_set_pointers_mb_mgr(void *ptr, const uint64_t flags, - const unsigned reset_mgr); +IMB_DLL_EXPORT IMB_MGR * +imb_set_pointers_mb_mgr(void *ptr, const uint64_t flags, const unsigned reset_mgr); /** * @brief Retrieves the bitmask with the features supported by the library, @@ -1353,7 +1268,8 @@ IMB_DLL_EXPORT IMB_MGR *imb_set_pointers_mb_mgr(void *ptr, const uint64_t flags, * * @return Bitmask containing feature flags */ -IMB_DLL_EXPORT uint64_t imb_get_feature_flags(void); +IMB_DLL_EXPORT uint64_t +imb_get_feature_flags(void); /** * @brief Initialize Multi-Buffer Manager structure. @@ -1365,20 +1281,23 @@ IMB_DLL_EXPORT uint64_t imb_get_feature_flags(void); * is recommended to allocate the IMB_MGR structure using * the alloc_mb_mgr() API */ -IMB_DLL_EXPORT void init_mb_mgr_avx(IMB_MGR *state); +IMB_DLL_EXPORT void +init_mb_mgr_avx(IMB_MGR *state); /** * @copydoc init_mb_mgr_avx */ -IMB_DLL_EXPORT void init_mb_mgr_avx2(IMB_MGR *state); +IMB_DLL_EXPORT void +init_mb_mgr_avx2(IMB_MGR *state); /** * @copydoc init_mb_mgr_avx */ -IMB_DLL_EXPORT void init_mb_mgr_avx512(IMB_MGR *state); +IMB_DLL_EXPORT void +init_mb_mgr_avx512(IMB_MGR *state); /** * @copydoc init_mb_mgr_avx */ -IMB_DLL_EXPORT void init_mb_mgr_sse(IMB_MGR *state); - +IMB_DLL_EXPORT void +init_mb_mgr_sse(IMB_MGR *state); /** * @brief Submit job for processing after validating. @@ -1389,19 +1308,23 @@ IMB_DLL_EXPORT void init_mb_mgr_sse(IMB_MGR *state); * If NULL, imb_get_errno() can be used to check for potential * error conditions */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx(IMB_MGR *state); /** * @copydoc submit_job_avx */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx2(IMB_MGR *state); /** * @copydoc submit_job_avx */ -IMB_DLL_EXPORT IMB_JOB *submit_job_avx512(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_avx512(IMB_MGR *state); /** * @copydoc submit_job_avx */ -IMB_DLL_EXPORT IMB_JOB *submit_job_sse(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_sse(IMB_MGR *state); /** * @brief Submit job for processing without validating. @@ -1412,19 +1335,23 @@ IMB_DLL_EXPORT IMB_JOB *submit_job_sse(IMB_MGR *state); * * @return Pointer to completed IMB_JOB or NULL if no job completed */ -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx(IMB_MGR *state); /** * @copydoc submit_job_nocheck_avx */ -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx2(IMB_MGR *state); /** * @copydoc submit_job_nocheck_avx */ -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_avx512(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_avx512(IMB_MGR *state); /** * @copydoc submit_job_nocheck_avx */ -IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_sse(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +submit_job_nocheck_sse(IMB_MGR *state); /** * @brief Force processing until next job in queue is completed. @@ -1433,19 +1360,23 @@ IMB_DLL_EXPORT IMB_JOB *submit_job_nocheck_sse(IMB_MGR *state); * * @return Pointer to completed IMB_JOB or NULL if no more jobs to process */ -IMB_DLL_EXPORT IMB_JOB *flush_job_avx(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx(IMB_MGR *state); /** * @copydoc flush_job_avx */ -IMB_DLL_EXPORT IMB_JOB *flush_job_avx2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx2(IMB_MGR *state); /** * @copydoc flush_job_avx */ -IMB_DLL_EXPORT IMB_JOB *flush_job_avx512(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_avx512(IMB_MGR *state); /** * @copydoc flush_job_avx */ -IMB_DLL_EXPORT IMB_JOB *flush_job_sse(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +flush_job_sse(IMB_MGR *state); /** * @brief Get number of jobs queued to be processed. @@ -1454,19 +1385,23 @@ IMB_DLL_EXPORT IMB_JOB *flush_job_sse(IMB_MGR *state); * * @return Number of jobs in the queue */ -IMB_DLL_EXPORT uint32_t queue_size_avx(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx(IMB_MGR *state); /** * @copydoc queue_size_avx */ -IMB_DLL_EXPORT uint32_t queue_size_avx2(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx2(IMB_MGR *state); /** * @copydoc queue_size_avx */ -IMB_DLL_EXPORT uint32_t queue_size_avx512(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_avx512(IMB_MGR *state); /** * @copydoc queue_size_avx */ -IMB_DLL_EXPORT uint32_t queue_size_sse(IMB_MGR *state); +IMB_DLL_EXPORT uint32_t +queue_size_sse(IMB_MGR *state); /** * @brief Get next completed job. @@ -1475,19 +1410,23 @@ IMB_DLL_EXPORT uint32_t queue_size_sse(IMB_MGR *state); * * @return Pointer to completed IMB_JOB or NULL if next job not complete */ -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx(IMB_MGR *state); /** * @copydoc get_completed_job_avx */ -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx2(IMB_MGR *state); /** * @copydoc get_completed_job_avx */ -IMB_DLL_EXPORT IMB_JOB *get_completed_job_avx512(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_avx512(IMB_MGR *state); /** * @copydoc get_completed_job_avx */ -IMB_DLL_EXPORT IMB_JOB *get_completed_job_sse(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_completed_job_sse(IMB_MGR *state); /** * @brief Get next available job. @@ -1496,19 +1435,23 @@ IMB_DLL_EXPORT IMB_JOB *get_completed_job_sse(IMB_MGR *state); * * @return Pointer to next free IMB_JOB in the queue */ -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx(IMB_MGR *state); /** * @copydoc get_next_job_avx */ -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx2(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx2(IMB_MGR *state); /** * @copydoc get_next_job_avx */ -IMB_DLL_EXPORT IMB_JOB *get_next_job_avx512(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_avx512(IMB_MGR *state); /** * @copydoc get_next_job_avx */ -IMB_DLL_EXPORT IMB_JOB *get_next_job_sse(IMB_MGR *state); +IMB_DLL_EXPORT IMB_JOB * +get_next_job_sse(IMB_MGR *state); IMB_DLL_EXPORT void init_mb_mgr_aarch64(IMB_MGR *state); IMB_DLL_EXPORT IMB_JOB *submit_job_aarch64(IMB_MGR *state); @@ -1533,7 +1476,8 @@ IMB_DLL_EXPORT IMB_JOB *get_next_job_aarch64_sve256(IMB_MGR *state); * @param [out] arch Pointer to arch enum to be set (can be NULL) * */ -IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); +IMB_DLL_EXPORT void +init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); /* * Wrapper macros to call arch API's set up @@ -1596,7 +1540,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Pointer to completed IMB_JOB or NULL if next job not complete */ -#define IMB_GET_COMPLETED_JOB(_mgr) ((_mgr)->get_completed_job((_mgr))) +#define IMB_GET_COMPLETED_JOB(_mgr) ((_mgr)->get_completed_job((_mgr))) /** * @brief Force processing until next job in queue is completed. @@ -1605,7 +1549,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Pointer to completed IMB_JOB or NULL if no more jobs to process */ -#define IMB_FLUSH_JOB(_mgr) ((_mgr)->flush_job((_mgr))) +#define IMB_FLUSH_JOB(_mgr) ((_mgr)->flush_job((_mgr))) /** * @brief Get number of jobs queued to be processed. @@ -1614,7 +1558,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Number of jobs in the queue */ -#define IMB_QUEUE_SIZE(_mgr) ((_mgr)->queue_size((_mgr))) +#define IMB_QUEUE_SIZE(_mgr) ((_mgr)->queue_size((_mgr))) /** * @brief Get next available burst @@ -1628,7 +1572,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * May be less than number of requested jobs if not enough space in * queue. IMB_FLUSH_BURST() can be used to free up space. */ -#define IMB_GET_NEXT_BURST(_mgr, _n_jobs, _jobs) \ +#define IMB_GET_NEXT_BURST(_mgr, _n_jobs, _jobs) \ ((_mgr)->get_next_burst((_mgr), (_n_jobs), (_jobs))) /** @@ -1647,8 +1591,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * If zero, imb_get_errno() can be used to check for potential * error conditions and _jobs[0] contains pointer to invalid job */ -#define IMB_SUBMIT_BURST(_mgr, _n_jobs, _jobs) \ - ((_mgr)->submit_burst((_mgr), (_n_jobs), (_jobs))) +#define IMB_SUBMIT_BURST(_mgr, _n_jobs, _jobs) ((_mgr)->submit_burst((_mgr), (_n_jobs), (_jobs))) /** * @brief Submit multiple jobs to be processed without validating. @@ -1664,7 +1607,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Number of completed jobs or zero on error */ -#define IMB_SUBMIT_BURST_NOCHECK(_mgr, _n_jobs, _jobs) \ +#define IMB_SUBMIT_BURST_NOCHECK(_mgr, _n_jobs, _jobs) \ ((_mgr)->submit_burst_nocheck((_mgr), (_n_jobs), (_jobs))) /** @@ -1676,8 +1619,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Number of completed jobs */ -#define IMB_FLUSH_BURST(_mgr, _max_jobs, _jobs) \ - ((_mgr)->flush_burst((_mgr), (_max_jobs), (_jobs))) +#define IMB_FLUSH_BURST(_mgr, _max_jobs, _jobs) ((_mgr)->flush_burst((_mgr), (_max_jobs), (_jobs))) /** * Submit multiple cipher jobs to be processed synchronously after validating. @@ -1691,10 +1633,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Number of completed jobs */ -#define IMB_SUBMIT_CIPHER_BURST(_mgr, _jobs, _n_jobs, _cipher, \ - _dir, _key_size) \ - ((_mgr)->submit_cipher_burst((_mgr), (_jobs), (_n_jobs), \ - (_cipher), (_dir), (_key_size))) +#define IMB_SUBMIT_CIPHER_BURST(_mgr, _jobs, _n_jobs, _cipher, _dir, _key_size) \ + ((_mgr)->submit_cipher_burst((_mgr), (_jobs), (_n_jobs), (_cipher), (_dir), (_key_size))) /** * Submit multiple cipher jobs to be processed synchronously without validating. * @@ -1709,10 +1649,9 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Number of completed jobs */ -#define IMB_SUBMIT_CIPHER_BURST_NOCHECK(_mgr, _jobs, _n_jobs, _cipher, \ - _dir, _key_size) \ - ((_mgr)->submit_cipher_burst_nocheck((_mgr), (_jobs), (_n_jobs),\ - (_cipher), (_dir), (_key_size))) +#define IMB_SUBMIT_CIPHER_BURST_NOCHECK(_mgr, _jobs, _n_jobs, _cipher, _dir, _key_size) \ + ((_mgr)->submit_cipher_burst_nocheck((_mgr), (_jobs), (_n_jobs), (_cipher), (_dir), \ + (_key_size))) /** * Submit multiple hash jobs to be processed synchronously after validating. * @@ -1723,7 +1662,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Number of completed jobs */ -#define IMB_SUBMIT_HASH_BURST(_mgr, _jobs, _n_jobs, _hash) \ +#define IMB_SUBMIT_HASH_BURST(_mgr, _jobs, _n_jobs, _hash) \ ((_mgr)->submit_hash_burst((_mgr), (_jobs), (_n_jobs), (_hash))) /** @@ -1738,7 +1677,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * * @return Number of completed jobs */ -#define IMB_SUBMIT_HASH_BURST_NOCHECK(_mgr, _jobs, _n_jobs, _hash) \ +#define IMB_SUBMIT_HASH_BURST_NOCHECK(_mgr, _jobs, _n_jobs, _hash) \ ((_mgr)->submit_hash_burst_nocheck((_mgr), (_jobs), (_n_jobs), (_hash))) /* Key expansion and generation API's */ @@ -1751,7 +1690,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _enc_exp_key AES-128 encryption expansion key * @param[out] _dec_exp_key AES-128 decryption expansion key */ -#define IMB_AES_KEYEXP_128(_mgr, _key, _enc_exp_key, _dec_exp_key) \ +#define IMB_AES_KEYEXP_128(_mgr, _key, _enc_exp_key, _dec_exp_key) \ ((_mgr)->keyexp_128((_key), (_enc_exp_key), (_dec_exp_key))) /** * Generate encryption/decryption AES-192 expansion keys. @@ -1761,7 +1700,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _enc_exp_key AES-192 encryption expansion key * @param[out] _dec_exp_key AES-192 decryption expansion key */ -#define IMB_AES_KEYEXP_192(_mgr, _key, _enc_exp_key, _dec_exp_key) \ +#define IMB_AES_KEYEXP_192(_mgr, _key, _enc_exp_key, _dec_exp_key) \ ((_mgr)->keyexp_192((_key), (_enc_exp_key), (_dec_exp_key))) /** * Generate encryption/decryption AES-256 expansion keys. @@ -1771,7 +1710,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _enc_exp_key AES-256 encryption expansion key * @param[out] _dec_exp_key AES-256 decryption expansion key */ -#define IMB_AES_KEYEXP_256(_mgr, _key, _enc_exp_key, _dec_exp_key) \ +#define IMB_AES_KEYEXP_256(_mgr, _key, _enc_exp_key, _dec_exp_key) \ ((_mgr)->keyexp_256((_key), (_enc_exp_key), (_dec_exp_key))) /** @@ -1782,7 +1721,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _key1 Subkey 1 * @param[out] _key2 Subkey 2 */ -#define IMB_AES_CMAC_SUBKEY_GEN_128(_mgr, _exp_key, _key1, _key2) \ +#define IMB_AES_CMAC_SUBKEY_GEN_128(_mgr, _exp_key, _key1, _key2) \ ((_mgr)->cmac_subkey_gen_128((_exp_key), (_key1), (_key2))) /** @@ -1793,7 +1732,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _key1 Subkey 1 * @param[out] _key2 Subkey 2 */ -#define IMB_AES_CMAC_SUBKEY_GEN_256(_mgr, _exp_key, _key1, _key2) \ +#define IMB_AES_CMAC_SUBKEY_GEN_256(_mgr, _exp_key, _key1, _key2) \ ((_mgr)->cmac_subkey_gen_256((_exp_key), (_key1), (_key2))) /** @@ -1805,11 +1744,10 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _exp_key2 k2 expansion key * @param[out] _exp_key3 k3 expansion key */ -#define IMB_AES_XCBC_KEYEXP(_mgr, _key, _exp_key, _exp_key2, _exp_key3) \ +#define IMB_AES_XCBC_KEYEXP(_mgr, _key, _exp_key, _exp_key2, _exp_key3) \ ((_mgr)->xcbc_keyexp((_key), (_exp_key), (_exp_key2), (_exp_key3))) -#define IMB_DES_KEYSCHED(_mgr, _exp_key, _key) \ - ((_mgr)->des_key_sched((_exp_key), (_key))) +#define IMB_DES_KEYSCHED(_mgr, _exp_key, _key) ((_mgr)->des_key_sched((_exp_key), (_key))) /* Hash API's */ @@ -1820,8 +1758,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _src 64-byte data buffer * @param[out] _tag Digest output (20 bytes) */ -#define IMB_SHA1_ONE_BLOCK(_mgr, _src, _tag) \ - ((_mgr)->sha1_one_block((_src), (_tag))) +#define IMB_SHA1_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->sha1_one_block((_src), (_tag))) /** * Authenticate variable sized data with SHA1. @@ -1831,8 +1768,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _length Length of data in bytes for authentication. * @param[out] _tag Digest output (20 bytes) */ -#define IMB_SHA1(_mgr, _src, _length, _tag) \ - ((_mgr)->sha1((_src), (_length), (_tag))) +#define IMB_SHA1(_mgr, _src, _length, _tag) ((_mgr)->sha1((_src), (_length), (_tag))) /** * Authenticate 64-byte data buffer with SHA224. * @@ -1840,8 +1776,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _src 64-byte data buffer * @param[out] _tag Digest output (28 bytes) */ -#define IMB_SHA224_ONE_BLOCK(_mgr, _src, _tag) \ - ((_mgr)->sha224_one_block((_src), (_tag))) +#define IMB_SHA224_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->sha224_one_block((_src), (_tag))) /** * Authenticate variable sized data with SHA224. @@ -1851,8 +1786,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _length Length of data in bytes for authentication. * @param[out] _tag Digest output (28 bytes) */ -#define IMB_SHA224(_mgr, _src, _length, _tag) \ - ((_mgr)->sha224((_src), (_length), (_tag))) +#define IMB_SHA224(_mgr, _src, _length, _tag) ((_mgr)->sha224((_src), (_length), (_tag))) /** * Authenticate 64-byte data buffer with SHA256. * @@ -1860,8 +1794,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _src 64-byte data buffer * @param[out] _tag Digest output (32 bytes) */ -#define IMB_SHA256_ONE_BLOCK(_mgr, _src, _tag) \ - ((_mgr)->sha256_one_block((_src), (_tag))) +#define IMB_SHA256_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->sha256_one_block((_src), (_tag))) /** * Authenticate variable sized data with SHA256. * @@ -1870,8 +1803,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _length Length of data in bytes for authentication. * @param[out] _tag Digest output (32 bytes) */ -#define IMB_SHA256(_mgr, _src, _length, _tag) \ - ((_mgr)->sha256((_src), (_length), (_tag))) +#define IMB_SHA256(_mgr, _src, _length, _tag) ((_mgr)->sha256((_src), (_length), (_tag))) /** * Authenticate 128-byte data buffer with SHA384. * @@ -1879,8 +1811,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _src 128-byte data buffer * @param[out] _tag Digest output (48 bytes) */ -#define IMB_SHA384_ONE_BLOCK(_mgr, _src, _tag) \ - ((_mgr)->sha384_one_block((_src), (_tag))) +#define IMB_SHA384_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->sha384_one_block((_src), (_tag))) /** * Authenticate variable sized data with SHA384. * @@ -1889,8 +1820,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _length Length of data in bytes for authentication. * @param[out] _tag Digest output (48 bytes) */ -#define IMB_SHA384(_mgr, _src, _length, _tag) \ - ((_mgr)->sha384((_src), (_length), (_tag))) +#define IMB_SHA384(_mgr, _src, _length, _tag) ((_mgr)->sha384((_src), (_length), (_tag))) /** * Authenticate 128-byte data buffer with SHA512. * @@ -1898,8 +1828,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _src 128-byte data buffer * @param[out] _tag Digest output (64 bytes) */ -#define IMB_SHA512_ONE_BLOCK(_mgr, _src, _tag) \ - ((_mgr)->sha512_one_block((_src), (_tag))) +#define IMB_SHA512_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->sha512_one_block((_src), (_tag))) /** * Authenticate variable sized data with SHA512. * @@ -1908,8 +1837,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _length Length of data in bytes for authentication. * @param[out] _tag Digest output (20 bytes) */ -#define IMB_SHA512(_mgr, _src, _length, _tag) \ - ((_mgr)->sha512((_src), (_length), (_tag))) +#define IMB_SHA512(_mgr, _src, _length, _tag) ((_mgr)->sha512((_src), (_length), (_tag))) /** * Authenticate 64-byte data buffer with MD5. * @@ -1917,8 +1845,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _src 64-byte data buffer * @param[out] _tag Digest output (16 bytes) */ -#define IMB_MD5_ONE_BLOCK(_mgr, _src, _tag) \ - ((_mgr)->md5_one_block((_src), (_tag))) +#define IMB_MD5_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->md5_one_block((_src), (_tag))) /** * @brief AES-CFB-128 Encrypt/Decrypt up to one block. @@ -1933,7 +1860,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _exp_key Pointer to expanded AES keys * @param [in] _len Length of data in bytes */ -#define IMB_AES128_CFB_ONE(_mgr, _dst, _src, _iv, _exp_key, _len) \ +#define IMB_AES128_CFB_ONE(_mgr, _dst, _src, _iv, _exp_key, _len) \ ((_mgr)->aes128_cfb_one((_dst), (_src), (_iv), (_exp_key), (_len))) /** @@ -1949,140 +1876,118 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _exp_key Pointer to expanded AES keys * @param [in] _len Length of data in bytes */ -#define IMB_AES256_CFB_ONE(_mgr, _dst, _src, _iv, _exp_key, _len) \ +#define IMB_AES256_CFB_ONE(_mgr, _dst, _src, _iv, _exp_key, _len) \ ((_mgr)->aes256_cfb_one((_dst), (_src), (_iv), (_exp_key), (_len))) /* AES-GCM API's */ -#define IMB_AES128_GCM_ENC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, \ - _aadl, _tag, _tagl) \ - ((_mgr)->gcm128_enc((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), \ - (_aad), (_aadl), (_tag), (_tagl))) -#define IMB_AES192_GCM_ENC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, \ - _aadl, _tag, _tagl) \ - ((_mgr)->gcm192_enc((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), \ - (_aad), (_aadl), (_tag), (_tagl))) -#define IMB_AES256_GCM_ENC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, \ - _aadl, _tag, _tagl) \ - ((_mgr)->gcm256_enc((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), \ - (_aad), (_aadl), (_tag), (_tagl))) - -#define IMB_AES128_GCM_DEC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, \ - _aadl, _tag, _tagl) \ - ((_mgr)->gcm128_dec((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), \ - (_aad), (_aadl), (_tag), (_tagl))) -#define IMB_AES192_GCM_DEC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, \ - _aad, _aadl, _tag, _tagl) \ - ((_mgr)->gcm192_dec((_exp_key), (_ctx), (_dst), (_src), (_len), \ - (_iv), (_aad), (_aadl), (_tag), (_tagl))) -#define IMB_AES256_GCM_DEC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, \ - _aad, _aadl, _tag, _tagl) \ - ((_mgr)->gcm256_dec((_exp_key), (_ctx), (_dst), (_src), (_len), \ - (_iv), (_aad), (_aadl), (_tag), (_tagl))) - -#define IMB_AES128_GCM_INIT(_mgr, _exp_key, _ctx, _iv, _aad, _aadl) \ +#define IMB_AES128_GCM_ENC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, _aadl, _tag, _tagl) \ + ((_mgr)->gcm128_enc((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), (_aad), (_aadl), \ + (_tag), (_tagl))) +#define IMB_AES192_GCM_ENC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, _aadl, _tag, _tagl) \ + ((_mgr)->gcm192_enc((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), (_aad), (_aadl), \ + (_tag), (_tagl))) +#define IMB_AES256_GCM_ENC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, _aadl, _tag, _tagl) \ + ((_mgr)->gcm256_enc((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), (_aad), (_aadl), \ + (_tag), (_tagl))) + +#define IMB_AES128_GCM_DEC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, _aadl, _tag, _tagl) \ + ((_mgr)->gcm128_dec((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), (_aad), (_aadl), \ + (_tag), (_tagl))) +#define IMB_AES192_GCM_DEC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, _aadl, _tag, _tagl) \ + ((_mgr)->gcm192_dec((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), (_aad), (_aadl), \ + (_tag), (_tagl))) +#define IMB_AES256_GCM_DEC(_mgr, _exp_key, _ctx, _dst, _src, _len, _iv, _aad, _aadl, _tag, _tagl) \ + ((_mgr)->gcm256_dec((_exp_key), (_ctx), (_dst), (_src), (_len), (_iv), (_aad), (_aadl), \ + (_tag), (_tagl))) + +#define IMB_AES128_GCM_INIT(_mgr, _exp_key, _ctx, _iv, _aad, _aadl) \ ((_mgr)->gcm128_init((_exp_key), (_ctx), (_iv), (_aad), (_aadl))) -#define IMB_AES192_GCM_INIT(_mgr, _exp_key, _ctx, _iv, _aad, _aadl) \ +#define IMB_AES192_GCM_INIT(_mgr, _exp_key, _ctx, _iv, _aad, _aadl) \ ((_mgr)->gcm192_init((_exp_key), (_ctx), (_iv), (_aad), (_aadl))) -#define IMB_AES256_GCM_INIT(_mgr, _exp_key, _ctx, _iv, _aad, _aadl) \ +#define IMB_AES256_GCM_INIT(_mgr, _exp_key, _ctx, _iv, _aad, _aadl) \ ((_mgr)->gcm256_init((_exp_key), (_ctx), (_iv), (_aad), (_aadl))) -#define IMB_AES128_GCM_INIT_VAR_IV(_mgr, _exp_key, _ctx, _iv, _ivl, _aad, \ - _aadl) \ - ((_mgr)->gcm128_init_var_iv((_exp_key), (_ctx), (_iv), (_ivl), \ - (_aad), (_aadl))) -#define IMB_AES192_GCM_INIT_VAR_IV(_mgr, _exp_key, _ctx, _iv, _ivl, _aad, \ - _aadl) \ - ((_mgr)->gcm192_init_var_iv((_exp_key), (_ctx), (_iv), (_ivl), \ - (_aad), (_aadl))) -#define IMB_AES256_GCM_INIT_VAR_IV(_mgr, _exp_key, _ctx, _iv, _ivl, _aad, \ - _aadl) \ - ((_mgr)->gcm256_init_var_iv((_exp_key), (_ctx), (_iv), (_ivl), \ - (_aad), (_aadl))) - -#define IMB_AES128_GCM_ENC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ +#define IMB_AES128_GCM_INIT_VAR_IV(_mgr, _exp_key, _ctx, _iv, _ivl, _aad, _aadl) \ + ((_mgr)->gcm128_init_var_iv((_exp_key), (_ctx), (_iv), (_ivl), (_aad), (_aadl))) +#define IMB_AES192_GCM_INIT_VAR_IV(_mgr, _exp_key, _ctx, _iv, _ivl, _aad, _aadl) \ + ((_mgr)->gcm192_init_var_iv((_exp_key), (_ctx), (_iv), (_ivl), (_aad), (_aadl))) +#define IMB_AES256_GCM_INIT_VAR_IV(_mgr, _exp_key, _ctx, _iv, _ivl, _aad, _aadl) \ + ((_mgr)->gcm256_init_var_iv((_exp_key), (_ctx), (_iv), (_ivl), (_aad), (_aadl))) + +#define IMB_AES128_GCM_ENC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ ((_mgr)->gcm128_enc_update((_exp_key), (_ctx), (_dst), (_src), (_len))) -#define IMB_AES192_GCM_ENC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ +#define IMB_AES192_GCM_ENC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ ((_mgr)->gcm192_enc_update((_exp_key), (_ctx), (_dst), (_src), (_len))) -#define IMB_AES256_GCM_ENC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ +#define IMB_AES256_GCM_ENC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ ((_mgr)->gcm256_enc_update((_exp_key), (_ctx), (_dst), (_src), (_len))) -#define IMB_AES128_GCM_DEC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ +#define IMB_AES128_GCM_DEC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ ((_mgr)->gcm128_dec_update((_exp_key), (_ctx), (_dst), (_src), (_len))) -#define IMB_AES192_GCM_DEC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ +#define IMB_AES192_GCM_DEC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ ((_mgr)->gcm192_dec_update((_exp_key), (_ctx), (_dst), (_src), (_len))) -#define IMB_AES256_GCM_DEC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ +#define IMB_AES256_GCM_DEC_UPDATE(_mgr, _exp_key, _ctx, _dst, _src, _len) \ ((_mgr)->gcm256_dec_update((_exp_key), (_ctx), (_dst), (_src), (_len))) -#define IMB_AES128_GCM_ENC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES128_GCM_ENC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gcm128_enc_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES192_GCM_ENC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES192_GCM_ENC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gcm192_enc_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES256_GCM_ENC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES256_GCM_ENC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gcm256_enc_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES128_GCM_DEC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES128_GCM_DEC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gcm128_dec_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES192_GCM_DEC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES192_GCM_DEC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gcm192_dec_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES256_GCM_DEC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES256_GCM_DEC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gcm256_dec_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES128_GMAC_INIT(_mgr, _exp_key, _ctx, _iv, _ivl) \ +#define IMB_AES128_GMAC_INIT(_mgr, _exp_key, _ctx, _iv, _ivl) \ ((_mgr)->gmac128_init((_exp_key), (_ctx), (_iv), (_ivl))) -#define IMB_AES192_GMAC_INIT(_mgr, _exp_key, _ctx, _iv, _ivl) \ +#define IMB_AES192_GMAC_INIT(_mgr, _exp_key, _ctx, _iv, _ivl) \ ((_mgr)->gmac192_init((_exp_key), (_ctx), (_iv), (_ivl))) -#define IMB_AES256_GMAC_INIT(_mgr, _exp_key, _ctx, _iv, _ivl) \ +#define IMB_AES256_GMAC_INIT(_mgr, _exp_key, _ctx, _iv, _ivl) \ ((_mgr)->gmac256_init((_exp_key), (_ctx), (_iv), (_ivl))) -#define IMB_AES128_GMAC_UPDATE(_mgr, _exp_key, _ctx, _src, _len) \ +#define IMB_AES128_GMAC_UPDATE(_mgr, _exp_key, _ctx, _src, _len) \ ((_mgr)->gmac128_update((_exp_key), (_ctx), (_src), (_len))) -#define IMB_AES192_GMAC_UPDATE(_mgr, _exp_key, _ctx, _src, _len) \ +#define IMB_AES192_GMAC_UPDATE(_mgr, _exp_key, _ctx, _src, _len) \ ((_mgr)->gmac192_update((_exp_key), (_ctx), (_src), (_len))) -#define IMB_AES256_GMAC_UPDATE(_mgr, _exp_key, _ctx, _src, _len) \ +#define IMB_AES256_GMAC_UPDATE(_mgr, _exp_key, _ctx, _src, _len) \ ((_mgr)->gmac256_update((_exp_key), (_ctx), (_src), (_len))) -#define IMB_AES128_GMAC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES128_GMAC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gmac128_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES192_GMAC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES192_GMAC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gmac192_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES256_GMAC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ +#define IMB_AES256_GMAC_FINALIZE(_mgr, _exp_key, _ctx, _tag, _tagl) \ ((_mgr)->gmac256_finalize((_exp_key), (_ctx), (_tag), (_tagl))) -#define IMB_AES128_GCM_PRECOMP(_mgr, _key) \ - ((_mgr)->gcm128_precomp((_key))) -#define IMB_AES192_GCM_PRECOMP(_mgr, _key) \ - ((_mgr)->gcm192_precomp((_key))) -#define IMB_AES256_GCM_PRECOMP(_mgr, _key) \ - ((_mgr)->gcm256_precomp((_key))) - -#define IMB_AES128_GCM_PRE(_mgr, _key, _exp_key) \ - ((_mgr)->gcm128_pre((_key), (_exp_key))) -#define IMB_AES192_GCM_PRE(_mgr, _key, _exp_key) \ - ((_mgr)->gcm192_pre((_key), (_exp_key))) -#define IMB_AES256_GCM_PRE(_mgr, _key, _exp_key) \ - ((_mgr)->gcm256_pre((_key), (_exp_key))) - -#define IMB_GHASH_PRE(_mgr, _key, _exp_key) \ - ((_mgr)->ghash_pre((_key), (_exp_key))) -#define IMB_GHASH(_mgr, _exp_key, _src, _len, _tag, _tagl) \ +#define IMB_AES128_GCM_PRECOMP(_mgr, _key) ((_mgr)->gcm128_precomp((_key))) +#define IMB_AES192_GCM_PRECOMP(_mgr, _key) ((_mgr)->gcm192_precomp((_key))) +#define IMB_AES256_GCM_PRECOMP(_mgr, _key) ((_mgr)->gcm256_precomp((_key))) + +#define IMB_AES128_GCM_PRE(_mgr, _key, _exp_key) ((_mgr)->gcm128_pre((_key), (_exp_key))) +#define IMB_AES192_GCM_PRE(_mgr, _key, _exp_key) ((_mgr)->gcm192_pre((_key), (_exp_key))) +#define IMB_AES256_GCM_PRE(_mgr, _key, _exp_key) ((_mgr)->gcm256_pre((_key), (_exp_key))) + +#define IMB_GHASH_PRE(_mgr, _key, _exp_key) ((_mgr)->ghash_pre((_key), (_exp_key))) +#define IMB_GHASH(_mgr, _exp_key, _src, _len, _tag, _tagl) \ ((_mgr)->ghash((_exp_key), (_src), (_len), (_tag), (_tagl))) /* Chacha20-Poly1305 direct API's */ -#define IMB_CHACHA20_POLY1305_INIT(_mgr, _key, _ctx, _iv, _aad, _aadl) \ - ((_mgr)->chacha20_poly1305_init((_key), (_ctx), (_iv), (_aad), \ - (_aadl))) - -#define IMB_CHACHA20_POLY1305_ENC_UPDATE(_mgr, _key, _ctx, _dst, _src, _len) \ - ((_mgr)->chacha20_poly1305_enc_update((_key), (_ctx), (_dst), (_src), \ - (_len))) -#define IMB_CHACHA20_POLY1305_DEC_UPDATE(_mgr, _key, _ctx, _dst, _src, _len) \ - ((_mgr)->chacha20_poly1305_dec_update((_key), (_ctx), (_dst), (_src), \ - (_len))) - -#define IMB_CHACHA20_POLY1305_ENC_FINALIZE(_mgr, _ctx, _tag, _tagl) \ +#define IMB_CHACHA20_POLY1305_INIT(_mgr, _key, _ctx, _iv, _aad, _aadl) \ + ((_mgr)->chacha20_poly1305_init((_key), (_ctx), (_iv), (_aad), (_aadl))) + +#define IMB_CHACHA20_POLY1305_ENC_UPDATE(_mgr, _key, _ctx, _dst, _src, _len) \ + ((_mgr)->chacha20_poly1305_enc_update((_key), (_ctx), (_dst), (_src), (_len))) +#define IMB_CHACHA20_POLY1305_DEC_UPDATE(_mgr, _key, _ctx, _dst, _src, _len) \ + ((_mgr)->chacha20_poly1305_dec_update((_key), (_ctx), (_dst), (_src), (_len))) + +#define IMB_CHACHA20_POLY1305_ENC_FINALIZE(_mgr, _ctx, _tag, _tagl) \ ((_mgr)->chacha20_poly1305_finalize((_ctx), (_tag), (_tagl))) -#define IMB_CHACHA20_POLY1305_DEC_FINALIZE(_mgr, _ctx, _tag, _tagl) \ +#define IMB_CHACHA20_POLY1305_DEC_FINALIZE(_mgr, _ctx, _tag, _tagl) \ ((_mgr)->chacha20_poly1305_finalize((_ctx), (_tag), (_tagl))) /* ZUC EEA3/EIA3 functions */ @@ -2097,17 +2002,17 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param _dst Pointer to Ciphertext/Plaintext output. * @param _len Length of input data in bytes. */ -#define IMB_ZUC_EEA3_1_BUFFER(_mgr, _key, _iv, _src, _dst, _len) \ +#define IMB_ZUC_EEA3_1_BUFFER(_mgr, _key, _iv, _src, _dst, _len) \ ((_mgr)->eea3_1_buffer((_key), (_iv), (_src), (_dst), (_len))) -#define IMB_ZUC_EEA3_4_BUFFER(_mgr, _key, _iv, _src, _dst, _len) \ +#define IMB_ZUC_EEA3_4_BUFFER(_mgr, _key, _iv, _src, _dst, _len) \ ((_mgr)->eea3_4_buffer((_key), (_iv), (_src), (_dst), (_len))) -#define IMB_ZUC_EEA3_N_BUFFER(_mgr, _key, _iv, _src, _dst, _len, _count) \ +#define IMB_ZUC_EEA3_N_BUFFER(_mgr, _key, _iv, _src, _dst, _len, _count) \ ((_mgr)->eea3_n_buffer((_key), (_iv), (_src), (_dst), (_len), (_count))) #ifdef __aarch64__ -#define IMB_ZUC256_EEA3_1_BUFFER(_mgr, _key, _iv, _iv_len, _src, _dst, _len) \ +#define IMB_ZUC256_EEA3_1_BUFFER(_mgr, _key, _iv, _iv_len, _src, _dst, _len) \ ((_mgr)->zuc256_eea3_1_buffer((_key), (_iv), (_iv_len), (_src), (_dst), (_len))) -#define IMB_ZUC256_EEA3_N_BUFFER(_mgr, _key, _iv, _iv_len, _src, _dst, _len, _count) \ +#define IMB_ZUC256_EEA3_N_BUFFER(_mgr, _key, _iv, _iv_len, _src, _dst, _len, _count) \ ((_mgr)->zuc256_eea3_n_buffer((_key), (_iv), (_iv_len), (_src), (_dst), (_len), (_count))) #endif @@ -2121,15 +2026,15 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param _len Length of input data in bits. * @param _tag Pointer to Authenticated Tag output (4 bytes) */ -#define IMB_ZUC_EIA3_1_BUFFER(_mgr, _key, _iv, _src, _len, _tag) \ +#define IMB_ZUC_EIA3_1_BUFFER(_mgr, _key, _iv, _src, _len, _tag) \ ((_mgr)->eia3_1_buffer((_key), (_iv), (_src), (_len), (_tag))) -#define IMB_ZUC_EIA3_N_BUFFER(_mgr, _key, _iv, _src, _len, _tag, _count) \ +#define IMB_ZUC_EIA3_N_BUFFER(_mgr, _key, _iv, _src, _len, _tag, _count) \ ((_mgr)->eia3_n_buffer((_key), (_iv), (_src), (_len), (_tag), (_count))) #ifdef __aarch64__ -#define IMB_ZUC256_EIA3_1_BUFFER(_mgr, _key, _iv, _iv_len, _src, _len, _tag, _tag_sz) \ +#define IMB_ZUC256_EIA3_1_BUFFER(_mgr, _key, _iv, _iv_len, _src, _len, _tag, _tag_sz) \ ((_mgr)->zuc256_eia3_1_buffer((_key), (_iv), (_iv_len), (_src), (_len), (_tag), (_tag_sz))) -#define IMB_ZUC256_EIA3_N_BUFFER(_mgr, _key, _iv, _iv_len, _src, _len, _tag, _tag_sz, _count) \ +#define IMB_ZUC256_EIA3_N_BUFFER(_mgr, _key, _iv, _iv_len, _src, _len, _tag, _tag_sz, _count) \ ((_mgr)->zuc256_eia3_n_buffer((_key), (_iv), (_iv_len), (_src), (_len), (_tag), (_tag_sz), (_count))) #endif @@ -2150,7 +2055,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _len Length in BYTES * ******************************************************************************/ -#define IMB_KASUMI_F8_1_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len) \ +#define IMB_KASUMI_F8_1_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len) \ ((_mgr)->f8_1_buffer((_exp_key), (_iv), (_src), (_dst), (_len))) /** @@ -2169,10 +2074,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _offset Offset in BITS from begin of input buffer * ******************************************************************************/ -#define IMB_KASUMI_F8_1_BUFFER_BIT(_mgr, _exp_key, _iv, _src, _dst, _len, \ - _offset) \ - ((_mgr)->f8_1_buffer_bit((_exp_key), (_iv), (_src), (_dst), (_len), \ - (_offset))) +#define IMB_KASUMI_F8_1_BUFFER_BIT(_mgr, _exp_key, _iv, _src, _dst, _len, _offset) \ + ((_mgr)->f8_1_buffer_bit((_exp_key), (_iv), (_src), (_dst), (_len), (_offset))) /** * @brief Kasumi byte-level f8 operation in parallel on two buffers @@ -2193,10 +2096,10 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _len2 Length in BYTES of input buffer 2 * ******************************************************************************/ -#define IMB_KASUMI_F8_2_BUFFER(_mgr, _exp_key, _iv1, _iv2, _src1, _dst1, \ - _len1, _src2, _dst2, _len2) \ - ((_mgr)->f8_2_buffer((_exp_key), (_iv1), (_iv2), (_src1), (_dst1), \ - (_len1), (_src2), (_dst2), (_len2))) +#define IMB_KASUMI_F8_2_BUFFER(_mgr, _exp_key, _iv1, _iv2, _src1, _dst1, _len1, _src2, _dst2, \ + _len2) \ + ((_mgr)->f8_2_buffer((_exp_key), (_iv1), (_iv2), (_src1), (_dst1), (_len1), (_src2), \ + (_dst2), (_len2))) /** * @brief kasumi byte-level f8 operation in parallel on three buffers * @@ -2218,11 +2121,10 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _len Common length in bytes for all buffers * ******************************************************************************/ -#define IMB_KASUMI_F8_3_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _src1, _dst1, \ - _src2, _dst2, _src3, _dst3, _len) \ - ((_mgr)->f8_3_buffer((_exp_key), (_iv1), (_iv2), (_iv3), (_src1), \ - (_dst1), (_src2), (_dst2), (_src3), (_dst3), \ - (_len))) +#define IMB_KASUMI_F8_3_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _src1, _dst1, _src2, _dst2, \ + _src3, _dst3, _len) \ + ((_mgr)->f8_3_buffer((_exp_key), (_iv1), (_iv2), (_iv3), (_src1), (_dst1), (_src2), \ + (_dst2), (_src3), (_dst3), (_len))) /** * @brief kasumi byte-level f8 operation in parallel on four buffers * @@ -2247,12 +2149,10 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _len Common length in bytes for all buffers * ******************************************************************************/ -#define IMB_KASUMI_F8_4_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _iv4, \ - _src1, _dst1, _src2, _dst2, _src3, _dst3, \ - _src4, _dst4, _len) \ - ((_mgr)->f8_4_buffer((_exp_key), (_iv1), (_iv2), (_iv3), (_iv4), \ - (_src1), (_dst1), (_src2), (_dst2), \ - (_src3), (_dst3), (_src4), (_dst4), (_len))) +#define IMB_KASUMI_F8_4_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _iv4, _src1, _dst1, _src2, _dst2, \ + _src3, _dst3, _src4, _dst4, _len) \ + ((_mgr)->f8_4_buffer((_exp_key), (_iv1), (_iv2), (_iv3), (_iv4), (_src1), (_dst1), \ + (_src2), (_dst2), (_src3), (_dst3), (_src4), (_dst4), (_len))) /** * @brief Kasumi f8 operation on N buffers * @@ -2268,9 +2168,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _len Array of corresponding input buffer lengths in BITS * @param [in] _count Number of input buffers */ -#define IMB_KASUMI_F8_N_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len, _count) \ - ((_mgr)->f8_n_buffer((_exp_key), (_iv), (_src), (_dst), (_len), \ - (_count))) +#define IMB_KASUMI_F8_N_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len, _count) \ + ((_mgr)->f8_n_buffer((_exp_key), (_iv), (_src), (_dst), (_len), (_count))) /** * @brief Kasumi bit-level f9 operation on a single buffer. * @@ -2286,7 +2185,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [out] _tag Computed digest * */ -#define IMB_KASUMI_F9_1_BUFFER(_mgr, _exp_key, _src, _len, _tag) \ +#define IMB_KASUMI_F9_1_BUFFER(_mgr, _exp_key, _src, _len, _tag) \ ((_mgr)->f9_1_buffer((_exp_key), (_src), (_len), (_tag))) /** @@ -2303,10 +2202,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param [in] _dir Direction bit * */ -#define IMB_KASUMI_F9_1_BUFFER_USER(_mgr, _exp_key, _iv, _src, _len, _tag, \ - _dir) \ - ((_mgr)->f9_1_buffer_user((_exp_key), (_iv), (_src), (_len), \ - (_tag), (_dir))) +#define IMB_KASUMI_F9_1_BUFFER_USER(_mgr, _exp_key, _iv, _src, _len, _tag, _dir) \ + ((_mgr)->f9_1_buffer_user((_exp_key), (_iv), (_src), (_len), (_tag), (_dir))) /** * KASUMI F8 key schedule init function. @@ -2317,7 +2214,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @return 0 on success, -1 on failure * ******************************************************************************/ -#define IMB_KASUMI_INIT_F8_KEY_SCHED(_mgr, _key, _exp_key) \ +#define IMB_KASUMI_INIT_F8_KEY_SCHED(_mgr, _key, _exp_key) \ ((_mgr)->kasumi_init_f8_key_sched((_key), (_exp_key))) /** @@ -2329,7 +2226,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @return 0 on success, -1 on failure * ******************************************************************************/ -#define IMB_KASUMI_INIT_F9_KEY_SCHED(_mgr, _key, _exp_key) \ +#define IMB_KASUMI_INIT_F9_KEY_SCHED(_mgr, _key, _exp_key) \ ((_mgr)->kasumi_init_f9_key_sched((_key), (_exp_key))) /** @@ -2341,8 +2238,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @return size of kasumi_key_sched_t type success * ******************************************************************************/ -#define IMB_KASUMI_KEY_SCHED_SIZE(_mgr)((_mgr)->kasumi_key_sched_size()) - +#define IMB_KASUMI_KEY_SCHED_SIZE(_mgr) ((_mgr)->kasumi_key_sched_size()) /* SNOW3G F8/F9 functions */ @@ -2361,10 +2257,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _len Length in bits of input buffer * @param[in] _offset Offset in input/output buffer (in bits) */ -#define IMB_SNOW3G_F8_1_BUFFER_BIT(_mgr, _exp_key, _iv, _src, _dst, \ - _len, _offset) \ - ((_mgr)->snow3g_f8_1_buffer_bit((_exp_key), (_iv), (_src), \ - (_dst), (_len), (_offset))) +#define IMB_SNOW3G_F8_1_BUFFER_BIT(_mgr, _exp_key, _iv, _src, _dst, _len, _offset) \ + ((_mgr)->snow3g_f8_1_buffer_bit((_exp_key), (_iv), (_src), (_dst), (_len), (_offset))) /** * This function performs snow3g f8 operation on a single buffer. The key has @@ -2380,7 +2274,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _dst Output buffer * @param[in] _len Length in bits of input buffer */ -#define IMB_SNOW3G_F8_1_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len) \ +#define IMB_SNOW3G_F8_1_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len) \ ((_mgr)->snow3g_f8_1_buffer((_exp_key), (_iv), (_src), (_dst), (_len))) /** @@ -2399,11 +2293,9 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _dst2 Output buffer 2 * @param[in] _len2 Length in bytes of input buffer 2 */ -#define IMB_SNOW3G_F8_2_BUFFER(_mgr, _exp_key, _iv1, _iv2, \ - _src1, _dst1, _len1, \ - _src2, _dst2, _len2) \ - ((_mgr)->snow3g_f8_2_buffer((_exp_key), (_iv1), (_iv2), \ - (_src1), (_dst1), (_len1), \ +#define IMB_SNOW3G_F8_2_BUFFER(_mgr, _exp_key, _iv1, _iv2, _src1, _dst1, _len1, _src2, _dst2, \ + _len2) \ + ((_mgr)->snow3g_f8_2_buffer((_exp_key), (_iv1), (_iv2), (_src1), (_dst1), (_len1), \ (_src2), (_dst2), (_len2))) /** @@ -2431,15 +2323,10 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _dst4 Output buffer 4 * @param[in] _len4 Length in bytes of input buffer 4 */ -#define IMB_SNOW3G_F8_4_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _iv4, \ - _src1, _dst1, _len1, \ - _src2, _dst2, _len2, \ - _src3, _dst3, _len3, \ - _src4, _dst4, _len4) \ - ((_mgr)->snow3g_f8_4_buffer((_exp_key), (_iv1), (_iv2), (_iv3), \ - (_iv4), (_src1), (_dst1), (_len1), \ - (_src2), (_dst2), (_len2), \ - (_src3), (_dst3), (_len3), \ +#define IMB_SNOW3G_F8_4_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _iv4, _src1, _dst1, _len1, _src2, \ + _dst2, _len2, _src3, _dst3, _len3, _src4, _dst4, _len4) \ + ((_mgr)->snow3g_f8_4_buffer((_exp_key), (_iv1), (_iv2), (_iv3), (_iv4), (_src1), (_dst1), \ + (_len1), (_src2), (_dst2), (_len2), (_src3), (_dst3), (_len3), \ (_src4), (_dst4), (_len4))) #ifdef __aarch64__ @@ -2528,26 +2415,15 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _dst8 Output buffer 8 * @param[in] _len8 Length in bytes of input buffer 8 */ -#define IMB_SNOW3G_F8_8_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _iv4, \ - _iv5, _iv6, _iv7, _iv8, \ - _src1, _dst1, _len1, \ - _src2, _dst2, _len2, \ - _src3, _dst3, _len3, \ - _src4, _dst4, _len4, \ - _src5, _dst5, _len5, \ - _src6, _dst6, _len6, \ - _src7, _dst7, _len7, \ - _src8, _dst8, _len8) \ - ((_mgr)->snow3g_f8_8_buffer((_exp_key), (_iv1), (_iv2), (_iv3), \ - (_iv4), (_iv5), (_iv6), (_iv7), \ - (_iv8), (_src1), (_dst1), (_len1), \ - (_src2), (_dst2), (_len2), \ - (_src3), (_dst3), (_len3), \ - (_src4), (_dst4), (_len4), \ - (_src5), (_dst5), (_len5), \ - (_src6), (_dst6), (_len6), \ - (_src7), (_dst7), (_len7), \ - (_src8), (_dst8), (_len8))) +#define IMB_SNOW3G_F8_8_BUFFER(_mgr, _exp_key, _iv1, _iv2, _iv3, _iv4, _iv5, _iv6, _iv7, _iv8, \ + _src1, _dst1, _len1, _src2, _dst2, _len2, _src3, _dst3, _len3, \ + _src4, _dst4, _len4, _src5, _dst5, _len5, _src6, _dst6, _len6, \ + _src7, _dst7, _len7, _src8, _dst8, _len8) \ + ((_mgr)->snow3g_f8_8_buffer((_exp_key), (_iv1), (_iv2), (_iv3), (_iv4), (_iv5), (_iv6), \ + (_iv7), (_iv8), (_src1), (_dst1), (_len1), (_src2), (_dst2), \ + (_len2), (_src3), (_dst3), (_len3), (_src4), (_dst4), (_len4), \ + (_src5), (_dst5), (_len5), (_src6), (_dst6), (_len6), (_src7), \ + (_dst7), (_len7), (_src8), (_dst8), (_len8))) /** * This function performs snow3g f8 operation on eight buffers. They will * be processed with individual keys, which have already been scheduled @@ -2561,9 +2437,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[out] _dst Array of 8 output buffers * @param[in] _len Array of 8 corresponding input buffer lengths */ -#define IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(_mgr, _exp_key, _iv, _src, _dst, _len) \ - ((_mgr)->snow3g_f8_8_buffer_multikey((_exp_key), (_iv), (_src), (_dst),\ - (_len))) +#define IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(_mgr, _exp_key, _iv, _src, _dst, _len) \ + ((_mgr)->snow3g_f8_8_buffer_multikey((_exp_key), (_iv), (_src), (_dst), (_len))) /** * This function performs snow3g f8 operation in parallel on N buffers. All @@ -2579,9 +2454,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _count Number of input buffers * ******************************************************************************/ -#define IMB_SNOW3G_F8_N_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len, _count) \ - ((_mgr)->snow3g_f8_n_buffer((_exp_key), (_iv), (_src), \ - (_dst), (_len), (_count))) +#define IMB_SNOW3G_F8_N_BUFFER(_mgr, _exp_key, _iv, _src, _dst, _len, _count) \ + ((_mgr)->snow3g_f8_n_buffer((_exp_key), (_iv), (_src), (_dst), (_len), (_count))) /** * This function performs snow3g f8 operation in parallel on N buffers. All @@ -2597,10 +2471,8 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _len Array of corresponding input buffer lengths * @param[in] _count Number of input buffers */ -#define IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(_mgr, _exp_key, _iv, _src, \ - _dst, _len, _count) \ - ((_mgr)->snow3g_f8_n_buffer_multikey((_exp_key), (_iv), (_src), \ - (_dst), (_len), (_count))) +#define IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(_mgr, _exp_key, _iv, _src, _dst, _len, _count) \ + ((_mgr)->snow3g_f8_n_buffer_multikey((_exp_key), (_iv), (_src), (_dst), (_len), (_count))) /** * This function performs a snow3g f9 operation on a single block of data. The @@ -2617,7 +2489,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @param[in] _len Length in bits of the data to be hashed * @param[out] _tag Computed digest */ -#define IMB_SNOW3G_F9_1_BUFFER(_mgr, _exp_key, _iv, _src, _len, _tag) \ +#define IMB_SNOW3G_F9_1_BUFFER(_mgr, _exp_key, _iv, _src, _len, _tag) \ ((_mgr)->snow3g_f9_1_buffer((_exp_key), (_iv), (_src), (_len), (_tag))) /** @@ -2630,7 +2502,7 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @return -1 on error * ******************************************************************************/ -#define IMB_SNOW3G_INIT_KEY_SCHED(_mgr, _key, _exp_key) \ +#define IMB_SNOW3G_INIT_KEY_SCHED(_mgr, _key, _exp_key) \ ((_mgr)->snow3g_init_key_sched((_key), (_exp_key))) /** @@ -2642,85 +2514,73 @@ IMB_DLL_EXPORT void init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); * @return size of snow3g_key_schedule_t type * ******************************************************************************/ -#define IMB_SNOW3G_KEY_SCHED_SIZE(_mgr)((_mgr)->snow3g_key_sched_size()) +#define IMB_SNOW3G_KEY_SCHED_SIZE(_mgr) ((_mgr)->snow3g_key_sched_size()) /** * HEC compute functions */ -#define IMB_HEC_32(_mgr, _src)((_mgr)->hec_32(_src)) -#define IMB_HEC_64(_mgr, _src)((_mgr)->hec_64(_src)) +#define IMB_HEC_32(_mgr, _src) ((_mgr)->hec_32(_src)) +#define IMB_HEC_64(_mgr, _src) ((_mgr)->hec_64(_src)) /** * CRC32 Ethernet FCS function */ -#define IMB_CRC32_ETHERNET_FCS(_mgr, _src, _len) \ - (_mgr)->crc32_ethernet_fcs(_src, _len) +#define IMB_CRC32_ETHERNET_FCS(_mgr, _src, _len) (_mgr)->crc32_ethernet_fcs(_src, _len) /** * CRC16 X25 function */ -#define IMB_CRC16_X25(_mgr, _src, _len) \ - (_mgr)->crc16_x25(_src, _len) +#define IMB_CRC16_X25(_mgr, _src, _len) (_mgr)->crc16_x25(_src, _len) /** * CRC32 SCTP function */ -#define IMB_CRC32_SCTP(_mgr, _src, _len) \ - (_mgr)->crc32_sctp(_src, _len) +#define IMB_CRC32_SCTP(_mgr, _src, _len) (_mgr)->crc32_sctp(_src, _len) /** * LTE CRC24A function */ -#define IMB_CRC24_LTE_A(_mgr, _src, _len) \ - (_mgr)->crc24_lte_a(_src, _len) +#define IMB_CRC24_LTE_A(_mgr, _src, _len) (_mgr)->crc24_lte_a(_src, _len) /** * LTE CRC24B function */ -#define IMB_CRC24_LTE_B(_mgr, _src, _len) \ - (_mgr)->crc24_lte_b(_src, _len) +#define IMB_CRC24_LTE_B(_mgr, _src, _len) (_mgr)->crc24_lte_b(_src, _len) /** * Framing Protocol CRC16 function (3GPP TS 25.435, 3GPP TS 25.427) */ -#define IMB_CRC16_FP_DATA(_mgr, _src, _len) \ - (_mgr)->crc16_fp_data(_src, _len) +#define IMB_CRC16_FP_DATA(_mgr, _src, _len) (_mgr)->crc16_fp_data(_src, _len) /** * Framing Protocol CRC11 function (3GPP TS 25.435, 3GPP TS 25.427) */ -#define IMB_CRC11_FP_HEADER(_mgr, _src, _len) \ - (_mgr)->crc11_fp_header(_src, _len) +#define IMB_CRC11_FP_HEADER(_mgr, _src, _len) (_mgr)->crc11_fp_header(_src, _len) /** * Framing Protocol CRC7 function (3GPP TS 25.435, 3GPP TS 25.427) */ -#define IMB_CRC7_FP_HEADER(_mgr, _src, _len) \ - (_mgr)->crc7_fp_header(_src, _len) +#define IMB_CRC7_FP_HEADER(_mgr, _src, _len) (_mgr)->crc7_fp_header(_src, _len) /** * IUUP CRC10 function (3GPP TS 25.415) */ -#define IMB_CRC10_IUUP_DATA(_mgr, _src, _len) \ - (_mgr)->crc10_iuup_data(_src, _len) +#define IMB_CRC10_IUUP_DATA(_mgr, _src, _len) (_mgr)->crc10_iuup_data(_src, _len) /** * IUUP CRC6 function (3GPP TS 25.415) */ -#define IMB_CRC6_IUUP_HEADER(_mgr, _src, _len) \ - (_mgr)->crc6_iuup_header(_src, _len) +#define IMB_CRC6_IUUP_HEADER(_mgr, _src, _len) (_mgr)->crc6_iuup_header(_src, _len) /** * WIMAX OFDMA DATA CRC32 function (IEEE 802.16) */ -#define IMB_CRC32_WIMAX_OFDMA_DATA(_mgr, _src, _len) \ - (_mgr)->crc32_wimax_ofdma_data(_src, _len) +#define IMB_CRC32_WIMAX_OFDMA_DATA(_mgr, _src, _len) (_mgr)->crc32_wimax_ofdma_data(_src, _len) /** * WIMAX OFDMA HCS CRC8 function (IEEE 802.16) */ -#define IMB_CRC8_WIMAX_OFDMA_HCS(_mgr, _src, _len) \ - (_mgr)->crc8_wimax_ofdma_hcs(_src, _len) +#define IMB_CRC8_WIMAX_OFDMA_HCS(_mgr, _src, _len) (_mgr)->crc8_wimax_ofdma_hcs(_src, _len) /* Auxiliary functions */ @@ -2750,9 +2610,8 @@ des_key_schedule(uint64_t *ks, const void *key); * @param [out] opad_hash Block-sized outer padding */ IMB_DLL_EXPORT void -imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, - const void *pkey, const size_t key_len, - void *ipad_hash, void *opad_hash); +imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, const void *pkey, + const size_t key_len, void *ipad_hash, void *opad_hash); /** * @brief DES-CFB Encrypt/Decrypt up to one block. @@ -2767,8 +2626,7 @@ imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, * @param [in] len Length of data in bytes */ IMB_DLL_EXPORT void -des_cfb_one(void *out, const void *in, const uint64_t *iv, - const uint64_t *ks, const int len); +des_cfb_one(void *out, const void *in, const uint64_t *iv, const uint64_t *ks, const int len); /** * Authenticate 64-byte data buffer with MD5. @@ -2776,20 +2634,23 @@ des_cfb_one(void *out, const void *in, const uint64_t *iv, * @param[in] data 64-byte data buffer * @param[out] digest Digest output (16 bytes) */ -IMB_DLL_EXPORT void md5_one_block_sse(const void *data, void *digest); +IMB_DLL_EXPORT void +md5_one_block_sse(const void *data, void *digest); /** * @copydoc md5_one_block_sse */ -IMB_DLL_EXPORT void md5_one_block_avx(const void *data, void *digest); +IMB_DLL_EXPORT void +md5_one_block_avx(const void *data, void *digest); /** * @copydoc md5_one_block_sse */ -IMB_DLL_EXPORT void md5_one_block_avx2(const void *data, void *digest); +IMB_DLL_EXPORT void +md5_one_block_avx2(const void *data, void *digest); /** * @copydoc md5_one_block_sse */ -IMB_DLL_EXPORT void md5_one_block_avx512(const void *data, void *digest); - +IMB_DLL_EXPORT void +md5_one_block_avx512(const void *data, void *digest); /** * Generate encryption/decryption AES-128 expansion keys. @@ -2798,23 +2659,23 @@ IMB_DLL_EXPORT void md5_one_block_avx512(const void *data, void *digest); * @param[out] enc_exp_keys AES-128 encryption expansion key * @param[out] dec_exp_keys AES-128 decryption expansion key */ -IMB_DLL_EXPORT void aes_keyexp_128_sse(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_sse(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_128_sse */ -IMB_DLL_EXPORT void aes_keyexp_128_avx(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_avx(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_128_sse */ -IMB_DLL_EXPORT void aes_keyexp_128_avx2(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_avx2(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_128_sse */ -IMB_DLL_EXPORT void aes_keyexp_128_avx512(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_avx512(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * Generate encryption/decryption AES-192 expansion keys. @@ -2823,23 +2684,23 @@ IMB_DLL_EXPORT void aes_keyexp_128_avx512(const void *key, void *enc_exp_keys, * @param[out] enc_exp_keys AES-192 encryption expansion key * @param[out] dec_exp_keys AES-192 decryption expansion key */ -IMB_DLL_EXPORT void aes_keyexp_192_sse(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_sse(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_256_sse */ -IMB_DLL_EXPORT void aes_keyexp_192_avx(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_avx(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_256_sse */ -IMB_DLL_EXPORT void aes_keyexp_192_avx2(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_avx2(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_256_sse */ -IMB_DLL_EXPORT void aes_keyexp_192_avx512(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_avx512(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * Generate encryption/decryption AES-256 expansion keys. @@ -2848,23 +2709,23 @@ IMB_DLL_EXPORT void aes_keyexp_192_avx512(const void *key, void *enc_exp_keys, * @param[out] enc_exp_keys AES-256 encryption expansion key * @param[out] dec_exp_keys AES-256 decryption expansion key */ -IMB_DLL_EXPORT void aes_keyexp_256_sse(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_sse(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_256_sse */ -IMB_DLL_EXPORT void aes_keyexp_256_avx(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_avx(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_256_sse */ -IMB_DLL_EXPORT void aes_keyexp_256_avx2(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_avx2(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * @copydoc aes_keyexp_256_sse */ -IMB_DLL_EXPORT void aes_keyexp_256_avx512(const void *key, void *enc_exp_keys, - void *dec_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_avx512(const void *key, void *enc_exp_keys, void *dec_exp_keys); /** * Generate encryption AES-128 expansion keys. @@ -2872,23 +2733,23 @@ IMB_DLL_EXPORT void aes_keyexp_256_avx512(const void *key, void *enc_exp_keys, * @param[in] key AES-128 key * @param[out] enc_exp_keys AES-128 encryption expansion key */ -IMB_DLL_EXPORT void aes_keyexp_128_enc_sse(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_enc_sse(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_128_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_128_enc_avx(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_enc_avx(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_128_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_128_enc_avx2(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_enc_avx2(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_128_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_128_enc_avx512(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_128_enc_avx512(const void *key, void *enc_exp_keys); /** * Generate encryption AES-192 expansion keys. @@ -2896,23 +2757,23 @@ IMB_DLL_EXPORT void aes_keyexp_128_enc_avx512(const void *key, * @param[in] key AES-192 key * @param[out] enc_exp_keys AES-192 encryption expansion key */ -IMB_DLL_EXPORT void aes_keyexp_192_enc_sse(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_enc_sse(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_192_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_192_enc_avx(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_enc_avx(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_192_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_192_enc_avx2(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_enc_avx2(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_192_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_192_enc_avx512(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_192_enc_avx512(const void *key, void *enc_exp_keys); /** * Generate encryption AES-256 expansion keys. @@ -2920,23 +2781,23 @@ IMB_DLL_EXPORT void aes_keyexp_192_enc_avx512(const void *key, * @param[in] key AES-256 key * @param[out] enc_exp_keys AES-256 encryption expansion key */ -IMB_DLL_EXPORT void aes_keyexp_256_enc_sse(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_enc_sse(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_256_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_256_enc_avx(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_enc_avx(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_256_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_256_enc_avx2(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_enc_avx2(const void *key, void *enc_exp_keys); /** * @copydoc aes_keyexp_256_enc_sse */ -IMB_DLL_EXPORT void aes_keyexp_256_enc_avx512(const void *key, - void *enc_exp_keys); +IMB_DLL_EXPORT void +aes_keyexp_256_enc_avx512(const void *key, void *enc_exp_keys); /** * Generate AES-128-XCBC expansion keys. @@ -2946,23 +2807,23 @@ IMB_DLL_EXPORT void aes_keyexp_256_enc_avx512(const void *key, * @param[out] k2 k2 key * @param[out] k3 k3 key */ -IMB_DLL_EXPORT void aes_xcbc_expand_key_sse(const void *key, void *k1_exp, - void *k2, void *k3); +IMB_DLL_EXPORT void +aes_xcbc_expand_key_sse(const void *key, void *k1_exp, void *k2, void *k3); /** * @copydoc aes_xcbc_expand_key_sse */ -IMB_DLL_EXPORT void aes_xcbc_expand_key_avx(const void *key, void *k1_exp, - void *k2, void *k3); +IMB_DLL_EXPORT void +aes_xcbc_expand_key_avx(const void *key, void *k1_exp, void *k2, void *k3); /** * @copydoc aes_xcbc_expand_key_sse */ -IMB_DLL_EXPORT void aes_xcbc_expand_key_avx2(const void *key, void *k1_exp, - void *k2, void *k3); +IMB_DLL_EXPORT void +aes_xcbc_expand_key_avx2(const void *key, void *k1_exp, void *k2, void *k3); /** * @copydoc aes_xcbc_expand_key_sse */ -IMB_DLL_EXPORT void aes_xcbc_expand_key_avx512(const void *key, void *k1_exp, - void *k2, void *k3); +IMB_DLL_EXPORT void +aes_xcbc_expand_key_avx512(const void *key, void *k1_exp, void *k2, void *k3); /** * Generate AES-128-CMAC subkeys. @@ -2971,23 +2832,23 @@ IMB_DLL_EXPORT void aes_xcbc_expand_key_avx512(const void *key, void *k1_exp, * @param[out] key1 Subkey 1 * @param[out] key2 Subkey 2 */ -IMB_DLL_EXPORT void aes_cmac_subkey_gen_sse(const void *key_exp, void *key1, - void *key2); +IMB_DLL_EXPORT void +aes_cmac_subkey_gen_sse(const void *key_exp, void *key1, void *key2); /** * @copydoc aes_cmac_subkey_gen_sse */ -IMB_DLL_EXPORT void aes_cmac_subkey_gen_avx(const void *key_exp, void *key1, - void *key2); +IMB_DLL_EXPORT void +aes_cmac_subkey_gen_avx(const void *key_exp, void *key1, void *key2); /** * @copydoc aes_cmac_subkey_gen_sse */ -IMB_DLL_EXPORT void aes_cmac_subkey_gen_avx2(const void *key_exp, void *key1, - void *key2); +IMB_DLL_EXPORT void +aes_cmac_subkey_gen_avx2(const void *key_exp, void *key1, void *key2); /** * @copydoc aes_cmac_subkey_gen_sse */ -IMB_DLL_EXPORT void aes_cmac_subkey_gen_avx512(const void *key_exp, void *key1, - void *key2); +IMB_DLL_EXPORT void +aes_cmac_subkey_gen_avx512(const void *key_exp, void *key1, void *key2); /* * Direct GCM API. @@ -3013,31 +2874,25 @@ IMB_DLL_EXPORT void aes_cmac_subkey_gen_avx512(const void *key_exp, void *key1, * (most likely), 12 or 8 */ IMB_DLL_EXPORT void -aes_gcm_enc_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_128_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_128_sse */ IMB_DLL_EXPORT void -aes_gcm_enc_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_128_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_128_sse */ IMB_DLL_EXPORT void -aes_gcm_enc_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_128_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief AES-GCM-192 Encryption. * @@ -3057,31 +2912,25 @@ aes_gcm_enc_128_avx_gen4(const struct gcm_key_data *key_data, * (most likely), 12 or 8 */ IMB_DLL_EXPORT void -aes_gcm_enc_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_192_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_192_sse */ IMB_DLL_EXPORT void -aes_gcm_enc_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_192_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_192_sse */ IMB_DLL_EXPORT void -aes_gcm_enc_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_192_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief AES-GCM-256 Encryption. @@ -3102,32 +2951,25 @@ aes_gcm_enc_192_avx_gen4(const struct gcm_key_data *key_data, * (most likely), 12 or 8 */ IMB_DLL_EXPORT void -aes_gcm_enc_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_256_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_256_sse */ IMB_DLL_EXPORT void -aes_gcm_enc_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_256_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_256_sse */ IMB_DLL_EXPORT void -aes_gcm_enc_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_enc_256_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief AES-GCM-128 Decryption. @@ -3148,31 +2990,25 @@ aes_gcm_enc_256_avx_gen4(const struct gcm_key_data *key_data, * (most likely), 12 or 8 */ IMB_DLL_EXPORT void -aes_gcm_dec_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_128_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_128_sse */ IMB_DLL_EXPORT void -aes_gcm_dec_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_128_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_128_sse */ IMB_DLL_EXPORT void -aes_gcm_dec_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_128_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief AES-GCM-192 Decryption. @@ -3193,31 +3029,25 @@ aes_gcm_dec_128_avx_gen4(const struct gcm_key_data *key_data, * (most likely), 12 or 8 */ IMB_DLL_EXPORT void -aes_gcm_dec_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_192_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_192_sse */ IMB_DLL_EXPORT void -aes_gcm_dec_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_192_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_192_sse */ IMB_DLL_EXPORT void -aes_gcm_dec_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_192_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief AES-GCM-256 Decryption. @@ -3238,31 +3068,25 @@ aes_gcm_dec_192_avx_gen4(const struct gcm_key_data *key_data, * (most likely), 12 or 8 */ IMB_DLL_EXPORT void -aes_gcm_dec_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_256_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_256_sse */ IMB_DLL_EXPORT void -aes_gcm_dec_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_256_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_256_sse */ IMB_DLL_EXPORT void -aes_gcm_dec_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t len, - const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, - uint8_t *auth_tag, uint64_t auth_tag_len); +aes_gcm_dec_256_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, + uint8_t *out, uint8_t const *in, uint64_t len, const uint8_t *iv, + uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief Initialize a gcm_context_data structure to prepare for @@ -3277,24 +3101,21 @@ aes_gcm_dec_256_avx_gen4(const struct gcm_key_data *key_data, * @param [in] aad_len Length of AAD in bytes */ IMB_DLL_EXPORT void -aes_gcm_init_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, +aes_gcm_init_128_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @copydoc aes_gcm_init_128_sse */ IMB_DLL_EXPORT void aes_gcm_init_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @copydoc aes_gcm_init_128_sse */ IMB_DLL_EXPORT void aes_gcm_init_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @brief Initialize a gcm_context_data structure to prepare for @@ -3309,24 +3130,21 @@ aes_gcm_init_128_avx_gen4(const struct gcm_key_data *key_data, * @param [in] aad_len Length of AAD in bytes */ IMB_DLL_EXPORT void -aes_gcm_init_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, +aes_gcm_init_192_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @copydoc aes_gcm_init_192_sse */ IMB_DLL_EXPORT void aes_gcm_init_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @copydoc aes_gcm_init_192_sse */ IMB_DLL_EXPORT void aes_gcm_init_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @brief Initialize a gcm_context_data structure to prepare for @@ -3341,24 +3159,21 @@ aes_gcm_init_192_avx_gen4(const struct gcm_key_data *key_data, * @param [in] aad_len Length of AAD in bytes */ IMB_DLL_EXPORT void -aes_gcm_init_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, +aes_gcm_init_256_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @copydoc aes_gcm_init_256_sse */ IMB_DLL_EXPORT void aes_gcm_init_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** * @copydoc aes_gcm_init_256_sse */ IMB_DLL_EXPORT void aes_gcm_init_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); /** @@ -3372,22 +3187,22 @@ aes_gcm_init_256_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_enc_128_update_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t len); /** * @copydoc aes_gcm_enc_128_update_sse */ IMB_DLL_EXPORT void aes_gcm_enc_128_update_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @copydoc aes_gcm_enc_128_update_sse */ IMB_DLL_EXPORT void aes_gcm_enc_128_update_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @brief Encrypt a block of a AES-GCM-192 encryption message. @@ -3400,22 +3215,22 @@ aes_gcm_enc_128_update_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_enc_192_update_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t len); /** * @copydoc aes_gcm_enc_192_update_sse */ IMB_DLL_EXPORT void aes_gcm_enc_192_update_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @copydoc aes_gcm_enc_192_update_sse */ IMB_DLL_EXPORT void aes_gcm_enc_192_update_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @brief Encrypt a block of a AES-GCM-256 encryption message. @@ -3428,22 +3243,22 @@ aes_gcm_enc_192_update_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_enc_256_update_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t len); /** * @copydoc aes_gcm_enc_256_update_sse */ IMB_DLL_EXPORT void aes_gcm_enc_256_update_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @copydoc aes_gcm_enc_256_update_sse */ IMB_DLL_EXPORT void aes_gcm_enc_256_update_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @brief Decrypt a block of a AES-GCM-128 encryption message. @@ -3456,22 +3271,22 @@ aes_gcm_enc_256_update_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_dec_128_update_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t len); /** * @copydoc aes_gcm_dec_128_update_sse */ IMB_DLL_EXPORT void aes_gcm_dec_128_update_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @copydoc aes_gcm_dec_128_update_sse */ IMB_DLL_EXPORT void aes_gcm_dec_128_update_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @brief Decrypt a block of a AES-GCM-192 encryption message. @@ -3484,22 +3299,22 @@ aes_gcm_dec_128_update_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_dec_192_update_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t len); /** * @copydoc aes_gcm_dec_192_update_sse */ IMB_DLL_EXPORT void aes_gcm_dec_192_update_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @copydoc aes_gcm_dec_192_update_sse */ IMB_DLL_EXPORT void aes_gcm_dec_192_update_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @brief Decrypt a block of a AES-GCM-256 encryption message. @@ -3512,22 +3327,22 @@ aes_gcm_dec_192_update_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_dec_256_update_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t len); /** * @copydoc aes_gcm_dec_256_update_sse */ IMB_DLL_EXPORT void aes_gcm_dec_256_update_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @copydoc aes_gcm_dec_256_update_sse */ IMB_DLL_EXPORT void aes_gcm_dec_256_update_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *out, const uint8_t *in, uint64_t len); + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t len); /** * @brief End encryption of a AES-GCM-128 encryption message. @@ -3541,22 +3356,22 @@ aes_gcm_dec_256_update_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_enc_128_finalize_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_128_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_enc_128_finalize_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_128_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_enc_128_finalize_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief End encryption of a AES-GCM-192 encryption message. @@ -3570,22 +3385,22 @@ aes_gcm_enc_128_finalize_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_enc_192_finalize_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_192_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_enc_192_finalize_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_192_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_enc_192_finalize_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief End encryption of a AES-GCM-256 encryption message. @@ -3599,22 +3414,22 @@ aes_gcm_enc_192_finalize_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_enc_256_finalize_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_256_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_enc_256_finalize_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_enc_256_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_enc_256_finalize_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief End decryption of a AES-GCM-128 encryption message. @@ -3628,22 +3443,22 @@ aes_gcm_enc_256_finalize_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_dec_128_finalize_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_128_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_dec_128_finalize_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_128_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_dec_128_finalize_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief End decryption of a AES-GCM-192 encryption message. @@ -3657,22 +3472,22 @@ aes_gcm_dec_128_finalize_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_dec_192_finalize_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_192_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_dec_192_finalize_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_192_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_dec_192_finalize_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief End decryption of a AES-GCM-256 encryption message. @@ -3686,22 +3501,22 @@ aes_gcm_dec_192_finalize_avx_gen4(const struct gcm_key_data *key_data, */ IMB_DLL_EXPORT void aes_gcm_dec_256_finalize_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_256_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_dec_256_finalize_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @copydoc aes_gcm_dec_256_finalize_sse */ IMB_DLL_EXPORT void aes_gcm_dec_256_finalize_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, uint64_t auth_tag_len); + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); /** * @brief Precomputation of AES-GCM-128 HashKey constants. @@ -3711,17 +3526,20 @@ aes_gcm_dec_256_finalize_avx_gen4(const struct gcm_key_data *key_data, * * @param [in,out] key_data GCM key data */ -IMB_DLL_EXPORT void aes_gcm_precomp_128_sse(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_128_sse(struct gcm_key_data *key_data); /** * @copydoc aes_gcm_precomp_128_sse */ -IMB_DLL_EXPORT void aes_gcm_precomp_128_avx_gen2(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_128_avx_gen2(struct gcm_key_data *key_data); /** * @copydoc aes_gcm_precomp_128_sse */ -IMB_DLL_EXPORT void aes_gcm_precomp_128_avx_gen4(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_128_avx_gen4(struct gcm_key_data *key_data); /** * @brief Precomputation of AES-GCM-192 HashKey constants. @@ -3731,17 +3549,20 @@ IMB_DLL_EXPORT void aes_gcm_precomp_128_avx_gen4(struct gcm_key_data *key_data); * * @param [in,out] key_data GCM key data */ -IMB_DLL_EXPORT void aes_gcm_precomp_192_sse(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_192_sse(struct gcm_key_data *key_data); /** * @copydoc aes_gcm_precomp_192_sse */ -IMB_DLL_EXPORT void aes_gcm_precomp_192_avx_gen2(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_192_avx_gen2(struct gcm_key_data *key_data); /** * @copydoc aes_gcm_precomp_192_sse */ -IMB_DLL_EXPORT void aes_gcm_precomp_192_avx_gen4(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_192_avx_gen4(struct gcm_key_data *key_data); /** * @brief Precomputation of AES-GCM-256 HashKey constants. @@ -3751,17 +3572,20 @@ IMB_DLL_EXPORT void aes_gcm_precomp_192_avx_gen4(struct gcm_key_data *key_data); * * @param [in,out] key_data GCM key data */ -IMB_DLL_EXPORT void aes_gcm_precomp_256_sse(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_256_sse(struct gcm_key_data *key_data); /** * @copydoc aes_gcm_precomp_256_sse */ -IMB_DLL_EXPORT void aes_gcm_precomp_256_avx_gen2(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_256_avx_gen2(struct gcm_key_data *key_data); /** * @copydoc aes_gcm_precomp_256_sse */ -IMB_DLL_EXPORT void aes_gcm_precomp_256_avx_gen4(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_256_avx_gen4(struct gcm_key_data *key_data); /** * @brief Pre-processes AES-GCM-128 key data. @@ -3772,18 +3596,18 @@ IMB_DLL_EXPORT void aes_gcm_precomp_256_avx_gen4(struct gcm_key_data *key_data); * @param [in] key Pointer to key data * @param [out] key_data GCM expanded key data */ -IMB_DLL_EXPORT void aes_gcm_pre_128_sse(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_128_sse(const void *key, struct gcm_key_data *key_data); /** * @copydoc aes_gcm_pre_128_sse */ -IMB_DLL_EXPORT void aes_gcm_pre_128_avx_gen2(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_128_avx_gen2(const void *key, struct gcm_key_data *key_data); /** * @copydoc aes_gcm_pre_128_sse */ -IMB_DLL_EXPORT void aes_gcm_pre_128_avx_gen4(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_128_avx_gen4(const void *key, struct gcm_key_data *key_data); /** * @brief Pre-processes AES-GCM-192 key data. * @@ -3793,18 +3617,18 @@ IMB_DLL_EXPORT void aes_gcm_pre_128_avx_gen4(const void *key, * @param [in] key Pointer to key data * @param [out] key_data GCM expanded key data */ -IMB_DLL_EXPORT void aes_gcm_pre_192_sse(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_192_sse(const void *key, struct gcm_key_data *key_data); /** * @copydoc aes_gcm_pre_192_sse */ -IMB_DLL_EXPORT void aes_gcm_pre_192_avx_gen2(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_192_avx_gen2(const void *key, struct gcm_key_data *key_data); /** * @copydoc aes_gcm_pre_192_sse */ -IMB_DLL_EXPORT void aes_gcm_pre_192_avx_gen4(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_192_avx_gen4(const void *key, struct gcm_key_data *key_data); /** * @brief Pre-processes AES-GCM-256 key data. * @@ -3814,18 +3638,18 @@ IMB_DLL_EXPORT void aes_gcm_pre_192_avx_gen4(const void *key, * @param [in] key Pointer to key data * @param [out] key_data GCM expanded key data */ -IMB_DLL_EXPORT void aes_gcm_pre_256_sse(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_256_sse(const void *key, struct gcm_key_data *key_data); /** * @copydoc aes_gcm_pre_256_sse */ -IMB_DLL_EXPORT void aes_gcm_pre_256_avx_gen2(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_256_avx_gen2(const void *key, struct gcm_key_data *key_data); /** * @copydoc aes_gcm_pre_256_sse */ -IMB_DLL_EXPORT void aes_gcm_pre_256_avx_gen4(const void *key, - struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_256_avx_gen4(const void *key, struct gcm_key_data *key_data); /** * @brief Generation of ZUC-EEA3 Initialization Vector. @@ -3839,10 +3663,8 @@ IMB_DLL_EXPORT void aes_gcm_pre_256_avx_gen4(const void *key, * @retval 0 success * @retval -1 if one or more parameters are invalid */ -IMB_DLL_EXPORT int zuc_eea3_iv_gen(const uint32_t count, - const uint8_t bearer, - const uint8_t dir, - void *iv_ptr); +IMB_DLL_EXPORT int +zuc_eea3_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr); /** * @brief Generation of ZUC-EIA3 Initialization Vector. * @@ -3855,10 +3677,8 @@ IMB_DLL_EXPORT int zuc_eea3_iv_gen(const uint32_t count, * @retval 0 success * @retval -1 if one or more parameters are invalid */ -IMB_DLL_EXPORT int zuc_eia3_iv_gen(const uint32_t count, - const uint8_t bearer, - const uint8_t dir, - void *iv_ptr); +IMB_DLL_EXPORT int +zuc_eia3_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr); /** * @brief Generation of KASUMI F8 Initialization Vector. @@ -3872,10 +3692,8 @@ IMB_DLL_EXPORT int zuc_eia3_iv_gen(const uint32_t count, * @retval 0 success * @retval -1 if one or more parameters are invalid */ -IMB_DLL_EXPORT int kasumi_f8_iv_gen(const uint32_t count, - const uint8_t bearer, - const uint8_t dir, - void *iv_ptr); +IMB_DLL_EXPORT int +kasumi_f8_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr); /** * @brief Generation of KASUMI F9 Initialization Vector. * @@ -3887,9 +3705,8 @@ IMB_DLL_EXPORT int kasumi_f8_iv_gen(const uint32_t count, * @retval 0 success * @retval -1 if one or more parameters are invalid */ -IMB_DLL_EXPORT int kasumi_f9_iv_gen(const uint32_t count, - const uint32_t fresh, - void *iv_ptr); +IMB_DLL_EXPORT int +kasumi_f9_iv_gen(const uint32_t count, const uint32_t fresh, void *iv_ptr); /** * @brief Generation of SNOW3G F8 Initialization Vector. @@ -3906,10 +3723,8 @@ IMB_DLL_EXPORT int kasumi_f9_iv_gen(const uint32_t count, * @retval 0 success * @retval -1 if one or more parameters are invalid */ -IMB_DLL_EXPORT int snow3g_f8_iv_gen(const uint32_t count, - const uint8_t bearer, - const uint8_t dir, - void *iv_ptr); +IMB_DLL_EXPORT int +snow3g_f8_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr); /** * @brief Generation of SNOW3G F9 Initialization Vector. * @@ -3925,17 +3740,16 @@ IMB_DLL_EXPORT int snow3g_f8_iv_gen(const uint32_t count, * @retval 0 success * @retval -1 if one or more parameters are invalid */ -IMB_DLL_EXPORT int snow3g_f9_iv_gen(const uint32_t count, - const uint32_t fresh, - const uint8_t dir, - void *iv_ptr); +IMB_DLL_EXPORT int +snow3g_f9_iv_gen(const uint32_t count, const uint32_t fresh, const uint8_t dir, void *iv_ptr); /** * @brief Force clearing/zeroing of memory * * @param [in] mem Pointer to memory address to clear * @param [in] size Size of memory to clear (in bytes) */ -IMB_DLL_EXPORT void imb_clear_mem(void *mem, const size_t size); +IMB_DLL_EXPORT void +imb_clear_mem(void *mem, const size_t size); /** * @brief Batch of GCM encrypt/decrypt operations with the same key @@ -3959,19 +3773,12 @@ IMB_DLL_EXPORT void imb_clear_mem(void *mem, const size_t size); * @param [in] num_packets number of packets in this batch */ IMB_DLL_EXPORT void -imb_quic_aes_gcm(IMB_MGR *state, - const struct gcm_key_data *key_data, - const IMB_KEY_SIZE_BYTES key_size, - const IMB_CIPHER_DIRECTION cipher_dir, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t len_array[], - const void * const iv_ptr_array[], - const void * const aad_ptr_array[], - const uint64_t aad_len, - void *tag_ptr_array[], - const uint64_t tag_len, - const uint64_t num_packets); +imb_quic_aes_gcm(IMB_MGR *state, const struct gcm_key_data *key_data, + const IMB_KEY_SIZE_BYTES key_size, const IMB_CIPHER_DIRECTION cipher_dir, + void *dst_ptr_array[], const void *const src_ptr_array[], + const uint64_t len_array[], const void *const iv_ptr_array[], + const void *const aad_ptr_array[], const uint64_t aad_len, void *tag_ptr_array[], + const uint64_t tag_len, const uint64_t num_packets); /** * @brief Batch of AES-ECB encrypt/decrypt operations with the same key @@ -3988,11 +3795,8 @@ imb_quic_aes_gcm(IMB_MGR *state, * @param [in] key_size key size (in bytes, see IMB_KEY_128_BYTES etc.) */ IMB_DLL_EXPORT void -imb_quic_hp_aes_ecb(IMB_MGR *state, - const void *exp_key_data, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t num_packets, +imb_quic_hp_aes_ecb(IMB_MGR *state, const void *exp_key_data, void *dst_ptr_array[], + const void *const src_ptr_array[], const uint64_t num_packets, const IMB_KEY_SIZE_BYTES key_size); /** @@ -4014,17 +3818,11 @@ imb_quic_hp_aes_ecb(IMB_MGR *state, * @param [in] num_packets number of packets in this batch */ IMB_DLL_EXPORT void -imb_quic_chacha20_poly1305(IMB_MGR *state, - const void *key, - const IMB_CIPHER_DIRECTION cipher_dir, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t len_array[], - const void * const iv_ptr_array[], - const void * const aad_ptr_array[], - const uint64_t aad_len, - void *tag_ptr_array[], - const uint64_t tag_len, +imb_quic_chacha20_poly1305(IMB_MGR *state, const void *key, const IMB_CIPHER_DIRECTION cipher_dir, + void *dst_ptr_array[], const void *const src_ptr_array[], + const uint64_t len_array[], const void *const iv_ptr_array[], + const void *const aad_ptr_array[], const uint64_t aad_len, + void *tag_ptr_array[], const uint64_t tag_len, const uint64_t num_packets); /** @@ -4041,11 +3839,8 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, * @param [in] num_packets number of packets in this batch */ IMB_DLL_EXPORT void -imb_quic_hp_chacha20(IMB_MGR *state, - const void *key, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t num_packets); +imb_quic_hp_chacha20(IMB_MGR *state, const void *key, void *dst_ptr_array[], + const void *const src_ptr_array[], const uint64_t num_packets); /** * @brief Sets up suite_id and session_id fields for selected cipher suite in @@ -4086,7 +3881,8 @@ imb_quic_hp_chacha20(IMB_MGR *state, * @return Session ID value * @retval 0 on error */ -IMB_DLL_EXPORT uint32_t imb_set_session(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_EXPORT uint32_t +imb_set_session(IMB_MGR *state, IMB_JOB *job); #ifdef __cplusplus } diff --git a/lib/no-aesni/aesni_emu.c b/lib/no-aesni/aesni_emu.c index 3b8aa1c0..ab65167e 100644 --- a/lib/no-aesni/aesni_emu.c +++ b/lib/no-aesni/aesni_emu.c @@ -47,83 +47,80 @@ #endif #endif /* __aarch64__ */ -static const DECLARE_ALIGNED(uint8_t aes_sbox[16][16], 16) = { - { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, - 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76 }, - { 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, - 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0 }, - { 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, - 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15 }, - { 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, - 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75 }, - { 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, - 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84 }, - { 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, - 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf }, - { 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, - 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8 }, - { 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, - 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2 }, - { 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, - 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73 }, - { 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, - 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb }, - { 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, - 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79 }, - { 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, - 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08 }, - { 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, - 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a }, - { 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e }, - { 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, - 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf }, - { 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, - 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 } -}; - -static const DECLARE_ALIGNED(uint8_t aes_isbox[16][16], 16) = { - { 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, - 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb }, - { 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb }, - { 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, - 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e }, - { 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, - 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25 }, - { 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92 }, - { 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, - 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84 }, - { 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, - 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06 }, - { 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b }, - { 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, - 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73 }, - { 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, - 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e }, - { 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b }, - { 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, - 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4 }, - { 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, - 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f }, - { 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef }, - { 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, - 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61 }, - { 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, - 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d } -}; +static const DECLARE_ALIGNED(uint8_t aes_sbox[16][16], + 16) = { { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, + 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76 }, + { 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, + 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0 }, + { 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, + 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15 }, + { 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, + 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75 }, + { 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, + 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84 }, + { 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, + 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf }, + { 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, + 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8 }, + { 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, + 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2 }, + { 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, + 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73 }, + { 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, + 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb }, + { 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, + 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79 }, + { 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, + 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08 }, + { 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, + 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a }, + { 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, + 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e }, + { 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, + 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf }, + { 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, + 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 } }; + +static const DECLARE_ALIGNED(uint8_t aes_isbox[16][16], + 16) = { { 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, + 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb }, + { 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, + 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb }, + { 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, + 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e }, + { 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, + 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25 }, + { 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, + 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92 }, + { 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, + 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84 }, + { 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, + 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06 }, + { 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, + 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b }, + { 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, + 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73 }, + { 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, + 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e }, + { 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, + 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b }, + { 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, + 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4 }, + { 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, + 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f }, + { 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, + 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef }, + { 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, + 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61 }, + { 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, + 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d } }; /* ========================================================================== */ /* Emulation API helper functions */ /* ========================================================================== */ -static void xor_xmm(union xmm_reg *d, - const union xmm_reg *s1, - const union xmm_reg *s2) +static void +xor_xmm(union xmm_reg *d, const union xmm_reg *s1, const union xmm_reg *s2) { uint32_t i; @@ -131,14 +128,16 @@ static void xor_xmm(union xmm_reg *d, d->qword[i] = s1->qword[i] ^ s2->qword[i]; } -static uint32_t rot(const uint32_t x) +static uint32_t +rot(const uint32_t x) { - uint32_t y = (x>>8) | (x<<24); + uint32_t y = (x >> 8) | (x << 24); return y; } -static void substitute_bytes(union xmm_reg *dst, const union xmm_reg *src) +static void +substitute_bytes(union xmm_reg *dst, const union xmm_reg *src) { #ifdef __aarch64__ uint8x16_t vx = vld1q_u8((uint8_t const *) &src->byte[0]); @@ -157,8 +156,8 @@ static void substitute_bytes(union xmm_reg *dst, const union xmm_reg *src) #endif } -static void inverse_substitute_bytes(union xmm_reg *dst, - const union xmm_reg *src) +static void +inverse_substitute_bytes(union xmm_reg *dst, const union xmm_reg *src) { #ifdef __aarch64__ uint8x16_t vx = vld1q_u8((uint8_t const *) &src->byte[0]); @@ -177,7 +176,8 @@ static void inverse_substitute_bytes(union xmm_reg *dst, #endif } -static uint8_t gfmul(const uint8_t x, const uint8_t y) +static uint8_t +gfmul(const uint8_t x, const uint8_t y) { uint32_t i; uint8_t multiplier = y; @@ -188,7 +188,7 @@ static uint8_t gfmul(const uint8_t x, const uint8_t y) /* GFMUL by 2. "xtimes" operation from FIPS document */ uint8_t t = multiplier << 1; /* lop of the high bit */ - if (multiplier >> 7) /* look at the old high bit */ + if (multiplier >> 7) /* look at the old high bit */ multiplier = t ^ 0x1B; /* polynomial division */ else multiplier = t; @@ -200,58 +200,62 @@ static uint8_t gfmul(const uint8_t x, const uint8_t y) return out; } -static void mix_columns(union xmm_reg *dst, const union xmm_reg *src) +static void +mix_columns(union xmm_reg *dst, const union xmm_reg *src) { uint32_t c; for (c = 0; c < MAX_DWORDS_PER_XMM; c++) { - uint8_t s0c = src->byte[c*4+0]; - uint8_t s1c = src->byte[c*4+1]; - uint8_t s2c = src->byte[c*4+2]; - uint8_t s3c = src->byte[c*4+3]; - - dst->byte[c*4+0] = gfmul(2, s0c) ^ gfmul(3, s1c) ^ s2c ^ s3c; - dst->byte[c*4+1] = s0c ^ gfmul(2, s1c) ^ gfmul(3, s2c) ^ s3c; - dst->byte[c*4+2] = s0c ^ s1c ^ gfmul(2, s2c) ^ gfmul(3, s3c); - dst->byte[c*4+3] = gfmul(3, s0c) ^ s1c ^ s2c ^ gfmul(2, s3c); + uint8_t s0c = src->byte[c * 4 + 0]; + uint8_t s1c = src->byte[c * 4 + 1]; + uint8_t s2c = src->byte[c * 4 + 2]; + uint8_t s3c = src->byte[c * 4 + 3]; + + dst->byte[c * 4 + 0] = gfmul(2, s0c) ^ gfmul(3, s1c) ^ s2c ^ s3c; + dst->byte[c * 4 + 1] = s0c ^ gfmul(2, s1c) ^ gfmul(3, s2c) ^ s3c; + dst->byte[c * 4 + 2] = s0c ^ s1c ^ gfmul(2, s2c) ^ gfmul(3, s3c); + dst->byte[c * 4 + 3] = gfmul(3, s0c) ^ s1c ^ s2c ^ gfmul(2, s3c); } } -static void inverse_mix_columns(union xmm_reg *dst, - const union xmm_reg *src) +static void +inverse_mix_columns(union xmm_reg *dst, const union xmm_reg *src) { uint32_t c; for (c = 0; c < MAX_DWORDS_PER_XMM; c++) { - uint8_t s0c = src->byte[c*4+0]; - uint8_t s1c = src->byte[c*4+1]; - uint8_t s2c = src->byte[c*4+2]; - uint8_t s3c = src->byte[c*4+3]; - - dst->byte[c*4+0] = gfmul(0xe, s0c) ^ gfmul(0xb, s1c) ^ - gfmul(0xd, s2c) ^ gfmul(0x9, s3c); - dst->byte[c*4+1] = gfmul(0x9, s0c) ^ gfmul(0xe, s1c) ^ - gfmul(0xb, s2c) ^ gfmul(0xd, s3c); - dst->byte[c*4+2] = gfmul(0xd, s0c) ^ gfmul(0x9, s1c) ^ - gfmul(0xe, s2c) ^ gfmul(0xb, s3c); - dst->byte[c*4+3] = gfmul(0xb, s0c) ^ gfmul(0xd, s1c) ^ - gfmul(0x9, s2c) ^ gfmul(0xe, s3c); + uint8_t s0c = src->byte[c * 4 + 0]; + uint8_t s1c = src->byte[c * 4 + 1]; + uint8_t s2c = src->byte[c * 4 + 2]; + uint8_t s3c = src->byte[c * 4 + 3]; + + dst->byte[c * 4 + 0] = + gfmul(0xe, s0c) ^ gfmul(0xb, s1c) ^ gfmul(0xd, s2c) ^ gfmul(0x9, s3c); + dst->byte[c * 4 + 1] = + gfmul(0x9, s0c) ^ gfmul(0xe, s1c) ^ gfmul(0xb, s2c) ^ gfmul(0xd, s3c); + dst->byte[c * 4 + 2] = + gfmul(0xd, s0c) ^ gfmul(0x9, s1c) ^ gfmul(0xe, s2c) ^ gfmul(0xb, s3c); + dst->byte[c * 4 + 3] = + gfmul(0xb, s0c) ^ gfmul(0xd, s1c) ^ gfmul(0x9, s2c) ^ gfmul(0xe, s3c); } } -static uint32_t wrap_neg(const int x) +static uint32_t +wrap_neg(const int x) { /* make sure we stay in 0..3 */ return (x >= 0) ? x : (x + 4); } -static uint32_t wrap_pos(const int x) +static uint32_t +wrap_pos(const int x) { /* make sure we stay in 0..3 */ return (x <= 3) ? x : (x - 4); } -static void shift_rows(union xmm_reg *dst, const union xmm_reg *src) +static void +shift_rows(union xmm_reg *dst, const union xmm_reg *src) { /* cyclic shift last 3 rows of the input */ int j; @@ -277,12 +281,12 @@ static void shift_rows(union xmm_reg *dst, const union xmm_reg *src) int i; for (i = 0; i < MAX_DWORDS_PER_XMM; i++) - dst->byte[i*4+j] = tmp.byte[wrap_pos(i+j)*4+j]; + dst->byte[i * 4 + j] = tmp.byte[wrap_pos(i + j) * 4 + j]; } - } -static void inverse_shift_rows(union xmm_reg *dst, const union xmm_reg *src) +static void +inverse_shift_rows(union xmm_reg *dst, const union xmm_reg *src) { uint32_t j; union xmm_reg tmp = *src; @@ -299,7 +303,7 @@ static void inverse_shift_rows(union xmm_reg *dst, const union xmm_reg *src) uint32_t i; for (i = 0; i < MAX_DWORDS_PER_XMM; i++) - dst->byte[i*4+j] = tmp.byte[wrap_neg(i - j) * 4 + j]; + dst->byte[i * 4 + j] = tmp.byte[wrap_neg(i - j) * 4 + j]; } } @@ -307,9 +311,8 @@ static void inverse_shift_rows(union xmm_reg *dst, const union xmm_reg *src) /* AESNI emulation functions */ /* ========================================================================== */ -IMB_DLL_LOCAL void emulate_AESKEYGENASSIST(union xmm_reg *dst, - const union xmm_reg *src, - const uint32_t imm8) +IMB_DLL_LOCAL void +emulate_AESKEYGENASSIST(union xmm_reg *dst, const union xmm_reg *src, const uint32_t imm8) { union xmm_reg tmp; const uint32_t rcon = (imm8 & 0xFF); @@ -322,8 +325,8 @@ IMB_DLL_LOCAL void emulate_AESKEYGENASSIST(union xmm_reg *dst, dst->dword[0] = tmp.dword[1]; } -IMB_DLL_LOCAL void emulate_AESENC(union xmm_reg *dst, - const union xmm_reg *src) +IMB_DLL_LOCAL void +emulate_AESENC(union xmm_reg *dst, const union xmm_reg *src) { union xmm_reg tmp = *dst; @@ -333,8 +336,8 @@ IMB_DLL_LOCAL void emulate_AESENC(union xmm_reg *dst, xor_xmm(dst, &tmp, src); } -IMB_DLL_LOCAL void emulate_AESENCLAST(union xmm_reg *dst, - const union xmm_reg *src) +IMB_DLL_LOCAL void +emulate_AESENCLAST(union xmm_reg *dst, const union xmm_reg *src) { union xmm_reg tmp = *dst; @@ -343,8 +346,8 @@ IMB_DLL_LOCAL void emulate_AESENCLAST(union xmm_reg *dst, xor_xmm(dst, &tmp, src); } -IMB_DLL_LOCAL void emulate_AESDEC(union xmm_reg *dst, - const union xmm_reg *src) +IMB_DLL_LOCAL void +emulate_AESDEC(union xmm_reg *dst, const union xmm_reg *src) { union xmm_reg tmp = *dst; @@ -354,8 +357,8 @@ IMB_DLL_LOCAL void emulate_AESDEC(union xmm_reg *dst, xor_xmm(dst, &tmp, src); } -IMB_DLL_LOCAL void emulate_AESDECLAST(union xmm_reg *dst, - const union xmm_reg *src) +IMB_DLL_LOCAL void +emulate_AESDECLAST(union xmm_reg *dst, const union xmm_reg *src) { union xmm_reg tmp = *dst; @@ -364,8 +367,8 @@ IMB_DLL_LOCAL void emulate_AESDECLAST(union xmm_reg *dst, xor_xmm(dst, &tmp, src); } -IMB_DLL_LOCAL void emulate_AESIMC(union xmm_reg *dst, - const union xmm_reg *src) +IMB_DLL_LOCAL void +emulate_AESIMC(union xmm_reg *dst, const union xmm_reg *src) { inverse_mix_columns(dst, src); } @@ -375,10 +378,9 @@ IMB_DLL_LOCAL void emulate_AESIMC(union xmm_reg *dst, /* ========================================================================== */ IMB_DLL_LOCAL void -emulate_PCLMULQDQ(union xmm_reg *src1_dst, const union xmm_reg *src2, - const uint32_t imm8) +emulate_PCLMULQDQ(union xmm_reg *src1_dst, const union xmm_reg *src2, const uint32_t imm8) { - uint64_t x; /* input 64-bit word */ + uint64_t x; /* input 64-bit word */ uint64_t r0 = 0, r1 = 0; /* result 128-bit word (2x64) */ uint64_t y0 = 0, y1 = 0; /* y0/y1 - input word; 128 bits */ uint64_t mask; diff --git a/lib/no-aesni/mb_mgr_sse_no_aesni.c b/lib/no-aesni/mb_mgr_sse_no_aesni.c index 800cfcca..1b59618a 100644 --- a/lib/no-aesni/mb_mgr_sse_no_aesni.c +++ b/lib/no-aesni/mb_mgr_sse_no_aesni.c @@ -51,8 +51,8 @@ /* ====================================================================== */ -#define SAVE_XMMS save_xmms -#define RESTORE_XMMS restore_xmms +#define SAVE_XMMS save_xmms +#define RESTORE_XMMS restore_xmms #define SUBMIT_JOB_AES_CBC_128_ENC submit_job_aes128_enc_sse_no_aesni #define SUBMIT_JOB_AES_CBC_128_DEC submit_job_aes128_dec_sse_no_aesni @@ -69,154 +69,149 @@ #define SUBMIT_JOB_AES_ECB_192_DEC submit_job_aes_ecb_192_dec_sse_no_aesni #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_sse_no_aesni #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_sse_no_aesni -#define SUBMIT_JOB_HMAC submit_job_hmac_sse -#define FLUSH_JOB_HMAC flush_job_hmac_sse -#define SUBMIT_JOB_HMAC_NI submit_job_hmac_sse -#define FLUSH_JOB_HMAC_NI flush_job_hmac_sse -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_sse -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_sse -#define SUBMIT_JOB_HMAC_SHA_224_NI submit_job_hmac_sha_224_sse -#define FLUSH_JOB_HMAC_SHA_224_NI flush_job_hmac_sha_224_sse -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_sse -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_sse -#define SUBMIT_JOB_HMAC_SHA_256_NI submit_job_hmac_sha_256_sse -#define FLUSH_JOB_HMAC_SHA_256_NI flush_job_hmac_sha_256_sse -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse_no_aesni -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse_no_aesni -#define SUBMIT_JOB_SHA1 submit_job_sha1_sse -#define FLUSH_JOB_SHA1 flush_job_sha1_sse -#define SUBMIT_JOB_SHA224 submit_job_sha224_sse -#define FLUSH_JOB_SHA224 flush_job_sha224_sse -#define SUBMIT_JOB_SHA256 submit_job_sha256_sse -#define FLUSH_JOB_SHA256 flush_job_sha256_sse -#define SUBMIT_JOB_SHA1_NI submit_job_sha1_ni_sse -#define FLUSH_JOB_SHA1_NI flush_job_sha1_ni_sse -#define SUBMIT_JOB_SHA224_NI submit_job_sha224_ni_sse -#define FLUSH_JOB_SHA224_NI flush_job_sha224_ni_sse -#define SUBMIT_JOB_SHA256_NI submit_job_sha256_ni_sse -#define FLUSH_JOB_SHA256_NI flush_job_sha256_ni_sse -#define SUBMIT_JOB_SHA384 submit_job_sha384_sse -#define FLUSH_JOB_SHA384 flush_job_sha384_sse -#define SUBMIT_JOB_SHA512 submit_job_sha512_sse -#define FLUSH_JOB_SHA512 flush_job_sha512_sse - -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_sse_no_aesni -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_sse_no_aesni -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_sse_no_aesni -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_sse_no_aesni -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_sse_no_aesni -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_sse_no_aesni -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_sse_no_aesni -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_sse_no_aesni - -#define AES_CBC_DEC_128 aes_cbc_dec_128_sse_no_aesni -#define AES_CBC_DEC_192 aes_cbc_dec_192_sse_no_aesni -#define AES_CBC_DEC_256 aes_cbc_dec_256_sse_no_aesni - -#define AES_CTR_128 aes_cntr_128_sse_no_aesni -#define AES_CTR_192 aes_cntr_192_sse_no_aesni -#define AES_CTR_256 aes_cntr_256_sse_no_aesni -#define AES_CTR_128_BIT aes_cntr_bit_128_sse_no_aesni -#define AES_CTR_192_BIT aes_cntr_bit_192_sse_no_aesni -#define AES_CTR_256_BIT aes_cntr_bit_256_sse_no_aesni - -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse_no_aesni -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse_no_aesni - -#define AES_ECB_ENC_128 aes_ecb_enc_128_sse_no_aesni -#define AES_ECB_ENC_192 aes_ecb_enc_192_sse_no_aesni -#define AES_ECB_ENC_256 aes_ecb_enc_256_sse_no_aesni -#define AES_ECB_DEC_128 aes_ecb_dec_128_sse_no_aesni -#define AES_ECB_DEC_192 aes_ecb_dec_192_sse_no_aesni -#define AES_ECB_DEC_256 aes_ecb_dec_256_sse_no_aesni +#define SUBMIT_JOB_HMAC submit_job_hmac_sse +#define FLUSH_JOB_HMAC flush_job_hmac_sse +#define SUBMIT_JOB_HMAC_NI submit_job_hmac_sse +#define FLUSH_JOB_HMAC_NI flush_job_hmac_sse +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_sse +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_sse +#define SUBMIT_JOB_HMAC_SHA_224_NI submit_job_hmac_sha_224_sse +#define FLUSH_JOB_HMAC_SHA_224_NI flush_job_hmac_sha_224_sse +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_sse +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_sse +#define SUBMIT_JOB_HMAC_SHA_256_NI submit_job_hmac_sha_256_sse +#define FLUSH_JOB_HMAC_SHA_256_NI flush_job_hmac_sha_256_sse +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse_no_aesni +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse_no_aesni +#define SUBMIT_JOB_SHA1 submit_job_sha1_sse +#define FLUSH_JOB_SHA1 flush_job_sha1_sse +#define SUBMIT_JOB_SHA224 submit_job_sha224_sse +#define FLUSH_JOB_SHA224 flush_job_sha224_sse +#define SUBMIT_JOB_SHA256 submit_job_sha256_sse +#define FLUSH_JOB_SHA256 flush_job_sha256_sse +#define SUBMIT_JOB_SHA1_NI submit_job_sha1_ni_sse +#define FLUSH_JOB_SHA1_NI flush_job_sha1_ni_sse +#define SUBMIT_JOB_SHA224_NI submit_job_sha224_ni_sse +#define FLUSH_JOB_SHA224_NI flush_job_sha224_ni_sse +#define SUBMIT_JOB_SHA256_NI submit_job_sha256_ni_sse +#define FLUSH_JOB_SHA256_NI flush_job_sha256_ni_sse +#define SUBMIT_JOB_SHA384 submit_job_sha384_sse +#define FLUSH_JOB_SHA384 flush_job_sha384_sse +#define SUBMIT_JOB_SHA512 submit_job_sha512_sse +#define FLUSH_JOB_SHA512 flush_job_sha512_sse + +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_sse_no_aesni +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_sse_no_aesni +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_sse_no_aesni +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_sse_no_aesni +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_sse_no_aesni +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_sse_no_aesni +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_sse_no_aesni +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_sse_no_aesni + +#define AES_CBC_DEC_128 aes_cbc_dec_128_sse_no_aesni +#define AES_CBC_DEC_192 aes_cbc_dec_192_sse_no_aesni +#define AES_CBC_DEC_256 aes_cbc_dec_256_sse_no_aesni + +#define AES_CTR_128 aes_cntr_128_sse_no_aesni +#define AES_CTR_192 aes_cntr_192_sse_no_aesni +#define AES_CTR_256 aes_cntr_256_sse_no_aesni +#define AES_CTR_128_BIT aes_cntr_bit_128_sse_no_aesni +#define AES_CTR_192_BIT aes_cntr_bit_192_sse_no_aesni +#define AES_CTR_256_BIT aes_cntr_bit_256_sse_no_aesni + +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse_no_aesni +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse_no_aesni + +#define AES_ECB_ENC_128 aes_ecb_enc_128_sse_no_aesni +#define AES_ECB_ENC_192 aes_ecb_enc_192_sse_no_aesni +#define AES_ECB_ENC_256 aes_ecb_enc_256_sse_no_aesni +#define AES_ECB_DEC_128 aes_ecb_dec_128_sse_no_aesni +#define AES_ECB_DEC_192 aes_ecb_dec_192_sse_no_aesni +#define AES_ECB_DEC_256 aes_ecb_dec_256_sse_no_aesni #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_sse_no_aesni #define SUBMIT_JOB_PON_DEC submit_job_pon_dec_sse_no_aesni #define SUBMIT_JOB_PON_ENC_NO_CTR submit_job_pon_enc_no_ctr_sse_no_aesni #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_sse_no_aesni -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse_no_aesni -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse_no_aesni -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse_no_aesni -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse_no_aesni -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse_no_aesni -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse_no_aesni +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse_no_aesni +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse_no_aesni +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse_no_aesni +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse_no_aesni +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse_no_aesni +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse_no_aesni #define SUBMIT_JOB_AES_GCM_DEC submit_job_aes_gcm_dec_sse_no_aesni #define SUBMIT_JOB_AES_GCM_ENC submit_job_aes_gcm_enc_sse_no_aesni /* ====================================================================== */ -#define SUBMIT_JOB submit_job_sse_no_aesni -#define FLUSH_JOB flush_job_sse_no_aesni -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_no_aesni -#define GET_NEXT_JOB get_next_job_sse_no_aesni -#define GET_COMPLETED_JOB get_completed_job_sse_no_aesni -#define GET_NEXT_BURST get_next_burst_sse_no_aesni -#define SUBMIT_BURST submit_burst_sse_no_aesni -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_no_aesni -#define FLUSH_BURST flush_burst_sse_no_aesni -#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_no_aesni +#define SUBMIT_JOB submit_job_sse_no_aesni +#define FLUSH_JOB flush_job_sse_no_aesni +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_no_aesni +#define GET_NEXT_JOB get_next_job_sse_no_aesni +#define GET_COMPLETED_JOB get_completed_job_sse_no_aesni +#define GET_NEXT_BURST get_next_burst_sse_no_aesni +#define SUBMIT_BURST submit_burst_sse_no_aesni +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_no_aesni +#define FLUSH_BURST flush_burst_sse_no_aesni +#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_no_aesni #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_sse_no_aesni -#define SUBMIT_HASH_BURST submit_hash_burst_sse_no_aesni -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_no_aesni -#define SET_SUITE_ID_FN set_suite_id_sse_no_aesni +#define SUBMIT_HASH_BURST submit_hash_burst_sse_no_aesni +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_no_aesni +#define SET_SUITE_ID_FN set_suite_id_sse_no_aesni #define SUBMIT_JOB_AES128_DEC submit_job_aes128_dec_sse_no_aesni #define SUBMIT_JOB_AES192_DEC submit_job_aes192_dec_sse_no_aesni #define SUBMIT_JOB_AES256_DEC submit_job_aes256_dec_sse_no_aesni -#define QUEUE_SIZE queue_size_sse_no_aesni +#define QUEUE_SIZE queue_size_sse_no_aesni /* ====================================================================== */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_SSE #define FLUSH_JOB_CIPHER_ENC FLUSH_JOB_CIPHER_ENC_SSE #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_SSE -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE /* ====================================================================== */ -#define AES_CFB_128_ONE aes_cfb_128_one_sse_no_aesni -#define AES_CFB_256_ONE aes_cfb_256_one_sse_no_aesni +#define AES_CFB_128_ONE aes_cfb_128_one_sse_no_aesni +#define AES_CFB_256_ONE aes_cfb_256_one_sse_no_aesni +#define AES128_CBC_MAC aes128_cbc_mac_x4_no_aesni -#define AES128_CBC_MAC aes128_cbc_mac_x4_no_aesni +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_sse_no_aesni +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_sse_no_aesni -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_sse_no_aesni -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_sse_no_aesni +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_sse_no_aesni +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_sse_no_aesni -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_sse_no_aesni -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_sse_no_aesni +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_sse_no_aesni +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_sse_no_aesni -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_sse_no_aesni -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_sse_no_aesni - -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_sse_no_aesni -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_sse_no_aesni +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_sse_no_aesni +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_sse_no_aesni /* ====================================================================== */ -#define SUBMIT_JOB_AES128_CBCS_1_9_ENC \ - submit_job_aes128_cbcs_1_9_enc_sse_no_aesni -#define FLUSH_JOB_AES128_CBCS_1_9_ENC \ - flush_job_aes128_cbcs_1_9_enc_sse_no_aesni -#define SUBMIT_JOB_AES128_CBCS_1_9_DEC \ - submit_job_aes128_cbcs_1_9_dec_sse_no_aesni -#define AES_CBCS_1_9_DEC_128 \ - aes_cbcs_1_9_dec_128_sse_no_aesni -#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_sse -#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_sse +#define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_sse_no_aesni +#define FLUSH_JOB_AES128_CBCS_1_9_ENC flush_job_aes128_cbcs_1_9_enc_sse_no_aesni +#define SUBMIT_JOB_AES128_CBCS_1_9_DEC submit_job_aes128_cbcs_1_9_dec_sse_no_aesni +#define AES_CBCS_1_9_DEC_128 aes_cbcs_1_9_dec_128_sse_no_aesni +#define SUBMIT_JOB_CHACHA20_ENC_DEC submit_job_chacha20_enc_dec_sse +#define SUBMIT_JOB_CHACHA20_POLY1305 aead_chacha20_poly1305_sse #define SUBMIT_JOB_CHACHA20_POLY1305_SGL aead_chacha20_poly1305_sgl_sse -#define POLY1305_MAC poly1305_mac_scalar +#define POLY1305_MAC poly1305_mac_scalar -#define SUBMIT_JOB_SNOW_V snow_v_sse_no_aesni +#define SUBMIT_JOB_SNOW_V snow_v_sse_no_aesni #define SUBMIT_JOB_SNOW_V_AEAD snow_v_aead_init_sse_no_aesni /* ====================================================================== */ @@ -249,20 +244,16 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, SSE_NUM_SHA1_LANES); /* Init HMAC/SHA224 out-of-order fields */ - ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, - SSE_NUM_SHA256_LANES); + ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, SSE_NUM_SHA256_LANES); /* Init HMAC/SHA_256 out-of-order fields */ - ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, - SSE_NUM_SHA256_LANES); + ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, SSE_NUM_SHA256_LANES); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, SSE_NUM_MD5_LANES); @@ -290,10 +281,10 @@ reset_ooo_mgrs(IMB_MGR *state) /* Init SHA256 out-of-order fields */ ooo_mgr_sha256_reset(state->sha_256_ooo, SSE_NUM_SHA256_LANES); - /* Init SHA384 out-of-order fields */ + /* Init SHA384 out-of-order fields */ ooo_mgr_sha512_reset(state->sha_384_ooo, SSE_NUM_SHA512_LANES); - /* Init SHA512 out-of-order fields */ + /* Init SHA512 out-of-order fields */ ooo_mgr_sha512_reset(state->sha_512_ooo, SSE_NUM_SHA512_LANES); /* Init SNOW3G-UEA out-of-order fields */ @@ -316,10 +307,8 @@ init_mb_mgr_sse_no_aesni_internal(IMB_MGR *state, const int reset_mgrs) /* reset error status */ imb_set_errno(state, 0); - /* Check if CPU flags needed for NO_AESNI interface are present */ - if ((state->features & IMB_CPUFLAGS_NO_AESNI) != - IMB_CPUFLAGS_NO_AESNI) { + if ((state->features & IMB_CPUFLAGS_NO_AESNI) != IMB_CPUFLAGS_NO_AESNI) { imb_set_errno(state, IMB_ERR_MISSING_CPUFLAGS_INIT_MGR); return; } @@ -336,130 +325,126 @@ init_mb_mgr_sse_no_aesni_internal(IMB_MGR *state, const int reset_mgrs) } /* set SSE NO AESNI handlers */ - state->get_next_job = get_next_job_sse_no_aesni; - state->submit_job = submit_job_sse_no_aesni; - state->get_next_burst = get_next_burst_sse_no_aesni; - state->submit_burst = submit_burst_sse_no_aesni; - state->submit_burst_nocheck= submit_burst_nocheck_sse_no_aesni; - state->flush_burst = flush_burst_sse_no_aesni; + state->get_next_job = get_next_job_sse_no_aesni; + state->submit_job = submit_job_sse_no_aesni; + state->get_next_burst = get_next_burst_sse_no_aesni; + state->submit_burst = submit_burst_sse_no_aesni; + state->submit_burst_nocheck = submit_burst_nocheck_sse_no_aesni; + state->flush_burst = flush_burst_sse_no_aesni; state->submit_cipher_burst = submit_cipher_burst_sse_no_aesni; - state->submit_cipher_burst_nocheck = - submit_cipher_burst_nocheck_sse_no_aesni; - state->submit_hash_burst = submit_hash_burst_sse_no_aesni; - state->submit_hash_burst_nocheck = - submit_hash_burst_nocheck_sse_no_aesni; - state->submit_job_nocheck = submit_job_nocheck_sse_no_aesni; - state->get_completed_job = get_completed_job_sse_no_aesni; - state->flush_job = flush_job_sse_no_aesni; - state->queue_size = queue_size_sse_no_aesni; - state->keyexp_128 = aes_keyexp_128_sse_no_aesni; - state->keyexp_192 = aes_keyexp_192_sse_no_aesni; - state->keyexp_256 = aes_keyexp_256_sse_no_aesni; + state->submit_cipher_burst_nocheck = submit_cipher_burst_nocheck_sse_no_aesni; + state->submit_hash_burst = submit_hash_burst_sse_no_aesni; + state->submit_hash_burst_nocheck = submit_hash_burst_nocheck_sse_no_aesni; + state->submit_job_nocheck = submit_job_nocheck_sse_no_aesni; + state->get_completed_job = get_completed_job_sse_no_aesni; + state->flush_job = flush_job_sse_no_aesni; + state->queue_size = queue_size_sse_no_aesni; + state->keyexp_128 = aes_keyexp_128_sse_no_aesni; + state->keyexp_192 = aes_keyexp_192_sse_no_aesni; + state->keyexp_256 = aes_keyexp_256_sse_no_aesni; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_sse_no_aesni; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_sse_no_aesni; - state->xcbc_keyexp = aes_xcbc_expand_key_sse_no_aesni; - state->des_key_sched = des_key_schedule; - state->sha1_one_block = sha1_one_block_sse; - state->sha1 = sha1_sse; - state->sha224_one_block = sha224_one_block_sse; - state->sha224 = sha224_sse; - state->sha256_one_block = sha256_one_block_sse; - state->sha256 = sha256_sse; - state->sha384_one_block = sha384_one_block_sse; - state->sha384 = sha384_sse; - state->sha512_one_block = sha512_one_block_sse; - state->sha512 = sha512_sse; - state->md5_one_block = md5_one_block_sse; - state->aes128_cfb_one = aes_cfb_128_one_sse_no_aesni; - state->aes256_cfb_one = aes_cfb_256_one_sse_no_aesni; - - state->eea3_1_buffer = zuc_eea3_1_buffer_sse_no_aesni; - state->eea3_4_buffer = zuc_eea3_4_buffer_sse_no_aesni; - state->eea3_n_buffer = zuc_eea3_n_buffer_sse_no_aesni; - state->eia3_1_buffer = zuc_eia3_1_buffer_sse_no_aesni; - state->eia3_n_buffer = zuc_eia3_n_buffer_sse_no_aesni; - - state->f8_1_buffer = kasumi_f8_1_buffer_sse; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; - state->f8_2_buffer = kasumi_f8_2_buffer_sse; - state->f8_3_buffer = kasumi_f8_3_buffer_sse; - state->f8_4_buffer = kasumi_f8_4_buffer_sse; - state->f8_n_buffer = kasumi_f8_n_buffer_sse; - state->f9_1_buffer = kasumi_f9_1_buffer_sse; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; + state->xcbc_keyexp = aes_xcbc_expand_key_sse_no_aesni; + state->des_key_sched = des_key_schedule; + state->sha1_one_block = sha1_one_block_sse; + state->sha1 = sha1_sse; + state->sha224_one_block = sha224_one_block_sse; + state->sha224 = sha224_sse; + state->sha256_one_block = sha256_one_block_sse; + state->sha256 = sha256_sse; + state->sha384_one_block = sha384_one_block_sse; + state->sha384 = sha384_sse; + state->sha512_one_block = sha512_one_block_sse; + state->sha512 = sha512_sse; + state->md5_one_block = md5_one_block_sse; + state->aes128_cfb_one = aes_cfb_128_one_sse_no_aesni; + state->aes256_cfb_one = aes_cfb_256_one_sse_no_aesni; + + state->eea3_1_buffer = zuc_eea3_1_buffer_sse_no_aesni; + state->eea3_4_buffer = zuc_eea3_4_buffer_sse_no_aesni; + state->eea3_n_buffer = zuc_eea3_n_buffer_sse_no_aesni; + state->eia3_1_buffer = zuc_eia3_1_buffer_sse_no_aesni; + state->eia3_n_buffer = zuc_eia3_n_buffer_sse_no_aesni; + + state->f8_1_buffer = kasumi_f8_1_buffer_sse; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; + state->f8_2_buffer = kasumi_f8_2_buffer_sse; + state->f8_3_buffer = kasumi_f8_3_buffer_sse; + state->f8_4_buffer = kasumi_f8_4_buffer_sse; + state->f8_n_buffer = kasumi_f8_n_buffer_sse; + state->f9_1_buffer = kasumi_f9_1_buffer_sse; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_sse; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_sse; state->kasumi_key_sched_size = kasumi_key_sched_size_sse; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_sse_no_aesni; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse_no_aesni; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse_no_aesni; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse_no_aesni; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse_no_aesni; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse_no_aesni; - state->snow3g_f8_8_buffer_multikey = - snow3g_f8_8_buffer_multikey_sse_no_aesni; - state->snow3g_f8_n_buffer_multikey = - snow3g_f8_n_buffer_multikey_sse_no_aesni; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse_no_aesni; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse_no_aesni; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse_no_aesni; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse_no_aesni; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse_no_aesni; + state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_sse_no_aesni; + state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_sse_no_aesni; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_sse_no_aesni; state->snow3g_init_key_sched = snow3g_init_key_sched_sse_no_aesni; state->snow3g_key_sched_size = snow3g_key_sched_size_sse_no_aesni; - state->gcm128_enc = aes_gcm_enc_128_sse_no_aesni; - state->gcm192_enc = aes_gcm_enc_192_sse_no_aesni; - state->gcm256_enc = aes_gcm_enc_256_sse_no_aesni; - state->gcm128_dec = aes_gcm_dec_128_sse_no_aesni; - state->gcm192_dec = aes_gcm_dec_192_sse_no_aesni; - state->gcm256_dec = aes_gcm_dec_256_sse_no_aesni; - state->gcm128_init = aes_gcm_init_128_sse_no_aesni; - state->gcm192_init = aes_gcm_init_192_sse_no_aesni; - state->gcm256_init = aes_gcm_init_256_sse_no_aesni; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse_no_aesni; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse_no_aesni; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse_no_aesni; - state->gcm128_enc_update = aes_gcm_enc_128_update_sse_no_aesni; - state->gcm192_enc_update = aes_gcm_enc_192_update_sse_no_aesni; - state->gcm256_enc_update = aes_gcm_enc_256_update_sse_no_aesni; - state->gcm128_dec_update = aes_gcm_dec_128_update_sse_no_aesni; - state->gcm192_dec_update = aes_gcm_dec_192_update_sse_no_aesni; - state->gcm256_dec_update = aes_gcm_dec_256_update_sse_no_aesni; + state->gcm128_enc = aes_gcm_enc_128_sse_no_aesni; + state->gcm192_enc = aes_gcm_enc_192_sse_no_aesni; + state->gcm256_enc = aes_gcm_enc_256_sse_no_aesni; + state->gcm128_dec = aes_gcm_dec_128_sse_no_aesni; + state->gcm192_dec = aes_gcm_dec_192_sse_no_aesni; + state->gcm256_dec = aes_gcm_dec_256_sse_no_aesni; + state->gcm128_init = aes_gcm_init_128_sse_no_aesni; + state->gcm192_init = aes_gcm_init_192_sse_no_aesni; + state->gcm256_init = aes_gcm_init_256_sse_no_aesni; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse_no_aesni; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse_no_aesni; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse_no_aesni; + state->gcm128_enc_update = aes_gcm_enc_128_update_sse_no_aesni; + state->gcm192_enc_update = aes_gcm_enc_192_update_sse_no_aesni; + state->gcm256_enc_update = aes_gcm_enc_256_update_sse_no_aesni; + state->gcm128_dec_update = aes_gcm_dec_128_update_sse_no_aesni; + state->gcm192_dec_update = aes_gcm_dec_192_update_sse_no_aesni; + state->gcm256_dec_update = aes_gcm_dec_256_update_sse_no_aesni; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_sse_no_aesni; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_sse_no_aesni; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_sse_no_aesni; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_sse_no_aesni; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_sse_no_aesni; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_sse_no_aesni; - state->gcm128_precomp = aes_gcm_precomp_128_sse_no_aesni; - state->gcm192_precomp = aes_gcm_precomp_192_sse_no_aesni; - state->gcm256_precomp = aes_gcm_precomp_256_sse_no_aesni; - state->gcm128_pre = aes_gcm_pre_128_sse_no_aesni; - state->gcm192_pre = aes_gcm_pre_192_sse_no_aesni; - state->gcm256_pre = aes_gcm_pre_256_sse_no_aesni; - state->ghash = ghash_sse_no_aesni; - state->ghash_pre = ghash_pre_sse_no_aesni; - - state->gmac128_init = imb_aes_gmac_init_128_sse_no_aesni; - state->gmac192_init = imb_aes_gmac_init_192_sse_no_aesni; - state->gmac256_init = imb_aes_gmac_init_256_sse_no_aesni; - state->gmac128_update = imb_aes_gmac_update_128_sse_no_aesni; - state->gmac192_update = imb_aes_gmac_update_192_sse_no_aesni; - state->gmac256_update = imb_aes_gmac_update_256_sse_no_aesni; - state->gmac128_finalize = imb_aes_gmac_finalize_128_sse_no_aesni; - state->gmac192_finalize = imb_aes_gmac_finalize_192_sse_no_aesni; - state->gmac256_finalize = imb_aes_gmac_finalize_256_sse_no_aesni; - - state->hec_32 = hec_32_sse_no_aesni; - state->hec_64 = hec_64_sse_no_aesni; - state->crc32_ethernet_fcs = ethernet_fcs_sse_no_aesni; - state->crc16_x25 = crc16_x25_sse_no_aesni; - state->crc32_sctp = crc32_sctp_sse_no_aesni; - state->crc24_lte_a = crc24_lte_a_sse_no_aesni; - state->crc24_lte_b = crc24_lte_b_sse_no_aesni; - state->crc16_fp_data = crc16_fp_data_sse_no_aesni; - state->crc11_fp_header = crc11_fp_header_sse_no_aesni; - state->crc7_fp_header = crc7_fp_header_sse_no_aesni; - state->crc10_iuup_data = crc10_iuup_data_sse_no_aesni; - state->crc6_iuup_header = crc6_iuup_header_sse_no_aesni; + state->gcm128_precomp = aes_gcm_precomp_128_sse_no_aesni; + state->gcm192_precomp = aes_gcm_precomp_192_sse_no_aesni; + state->gcm256_precomp = aes_gcm_precomp_256_sse_no_aesni; + state->gcm128_pre = aes_gcm_pre_128_sse_no_aesni; + state->gcm192_pre = aes_gcm_pre_192_sse_no_aesni; + state->gcm256_pre = aes_gcm_pre_256_sse_no_aesni; + state->ghash = ghash_sse_no_aesni; + state->ghash_pre = ghash_pre_sse_no_aesni; + + state->gmac128_init = imb_aes_gmac_init_128_sse_no_aesni; + state->gmac192_init = imb_aes_gmac_init_192_sse_no_aesni; + state->gmac256_init = imb_aes_gmac_init_256_sse_no_aesni; + state->gmac128_update = imb_aes_gmac_update_128_sse_no_aesni; + state->gmac192_update = imb_aes_gmac_update_192_sse_no_aesni; + state->gmac256_update = imb_aes_gmac_update_256_sse_no_aesni; + state->gmac128_finalize = imb_aes_gmac_finalize_128_sse_no_aesni; + state->gmac192_finalize = imb_aes_gmac_finalize_192_sse_no_aesni; + state->gmac256_finalize = imb_aes_gmac_finalize_256_sse_no_aesni; + + state->hec_32 = hec_32_sse_no_aesni; + state->hec_64 = hec_64_sse_no_aesni; + state->crc32_ethernet_fcs = ethernet_fcs_sse_no_aesni; + state->crc16_x25 = crc16_x25_sse_no_aesni; + state->crc32_sctp = crc32_sctp_sse_no_aesni; + state->crc24_lte_a = crc24_lte_a_sse_no_aesni; + state->crc24_lte_b = crc24_lte_b_sse_no_aesni; + state->crc16_fp_data = crc16_fp_data_sse_no_aesni; + state->crc11_fp_header = crc11_fp_header_sse_no_aesni; + state->crc7_fp_header = crc7_fp_header_sse_no_aesni; + state->crc10_iuup_data = crc10_iuup_data_sse_no_aesni; + state->crc6_iuup_header = crc6_iuup_header_sse_no_aesni; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_sse_no_aesni; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_sse_no_aesni; @@ -468,13 +453,13 @@ init_mb_mgr_sse_no_aesni_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_sse; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_sse; - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse_no_aesni; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse_no_aesni; + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse_no_aesni; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse_no_aesni; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_sse; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; } void diff --git a/lib/no-aesni/snow3g_sse_no_aesni.c b/lib/no-aesni/snow3g_sse_no_aesni.c index 7112221a..515e22d3 100644 --- a/lib/no-aesni/snow3g_sse_no_aesni.c +++ b/lib/no-aesni/snow3g_sse_no_aesni.c @@ -27,17 +27,17 @@ #define SSE #define NO_AESNI -#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_sse_no_aesni -#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_sse_no_aesni -#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_sse_no_aesni -#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_sse_no_aesni -#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_sse_no_aesni -#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_sse_no_aesni +#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_sse_no_aesni +#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_sse_no_aesni +#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_sse_no_aesni +#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_sse_no_aesni +#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_sse_no_aesni +#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_sse_no_aesni #define SNOW3G_F8_8_BUFFER_MULTIKEY snow3g_f8_8_buffer_multikey_sse_no_aesni #define SNOW3G_F8_N_BUFFER_MULTIKEY snow3g_f8_n_buffer_multikey_sse_no_aesni -#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_sse_no_aesni -#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_sse_no_aesni -#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_sse_no_aesni -#define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_sse +#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_sse_no_aesni +#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_sse_no_aesni +#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_sse_no_aesni +#define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_sse #include "include/snow3g_common.h" diff --git a/lib/no-aesni/zuc_top_sse_no_aesni.c b/lib/no-aesni/zuc_top_sse_no_aesni.c index 99054ce8..a440f369 100644 --- a/lib/no-aesni/zuc_top_sse_no_aesni.c +++ b/lib/no-aesni/zuc_top_sse_no_aesni.c @@ -26,12 +26,12 @@ *******************************************************************************/ /*----------------------------------------------------------------------- -* zuc_sse_no_aesni.c -*----------------------------------------------------------------------- -* An implementation of ZUC, the core algorithm for the -* 3GPP Confidentiality and Integrity algorithms. -* -*-----------------------------------------------------------------------*/ + * zuc_sse_no_aesni.c + *----------------------------------------------------------------------- + * An implementation of ZUC, the core algorithm for the + * 3GPP Confidentiality and Integrity algorithms. + * + *-----------------------------------------------------------------------*/ #include @@ -46,15 +46,12 @@ #define RESTORE_XMMS restore_xmms #define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_sse -#define NUM_SSE_BUFS 4 +#define NUM_SSE_BUFS 4 #define KEYSTR_ROUND_LEN 16 -static inline -void _zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +static inline void +_zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, const void *pBufferIn, + void *pBufferOut, const uint32_t length) { DECLARE_ALIGNED(ZucState_t zucState, 16); DECLARE_ALIGNED(uint8_t keyStream[KEYSTR_ROUND_LEN], 16); @@ -75,8 +72,7 @@ void _zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, while (numKeyStreamsPerPkt--) { /* Generate the key stream 16 bytes at a time */ - asm_ZucGenKeystream16B_sse_no_aesni((uint32_t *) &keyStream[0], - &zucState); + asm_ZucGenKeystream16B_sse_no_aesni((uint32_t *) &keyStream[0], &zucState); /* XOR The Keystream generated with the input buffer here */ pKeyStream64 = (uint64_t *) keyStream; @@ -94,28 +90,24 @@ void _zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, uint8_t *pOut8 = (uint8_t *) pBufferOut; const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_sse_no_aesni((uint32_t *) &keyStream[0], - &zucState, num4BRounds); + asm_ZucGenKeystream_sse_no_aesni((uint32_t *) &keyStream[0], &zucState, + num4BRounds); /* copy the remaining bytes into temporary buffer and XOR with * the 16 bytes of keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], - numBytesLeftOver); + memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStream[0]; pTemp64 = (uint64_t *) &tempSrc[0]; pdstTemp64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream16B_sse(pTemp64, pdstTemp64, - pKeyStream64); - memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], - numBytesLeftOver); + asm_XorKeyStream16B_sse(pTemp64, pdstTemp64, pKeyStream64); + memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); clear_mem(tempDst, sizeof(tempDst)); #endif - } #ifdef SAFE_DATA /* Clear sensitive data in stack */ @@ -124,34 +116,31 @@ void _zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, #endif } -static inline -void _zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - void *pBufferOut[NUM_SSE_BUFS], - const uint32_t length[NUM_SSE_BUFS]) +static inline void +_zuc_eea3_4_buffer_sse_no_aesni(const void *const pKey[NUM_SSE_BUFS], + const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], + void *pBufferOut[NUM_SSE_BUFS], const uint32_t length[NUM_SSE_BUFS]) { DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); unsigned int i; /* Calculate the minimum input packet size */ - uint32_t bytes1 = (length[0] < length[1] ? - length[0] : length[1]); - uint32_t bytes2 = (length[2] < length[3] ? - length[2] : length[3]); + uint32_t bytes1 = (length[0] < length[1] ? length[0] : length[1]); + uint32_t bytes2 = (length[2] < length[3] ? length[2] : length[3]); /* min number of bytes */ uint32_t bytes = (bytes1 < bytes2) ? bytes1 : bytes2; - uint16_t remainBytes[NUM_SSE_BUFS] = {0}; + uint16_t remainBytes[NUM_SSE_BUFS] = { 0 }; DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); /* structure to store the 4 IV's */ - DECLARE_ALIGNED(uint8_t ivs[4*32], 16); + DECLARE_ALIGNED(uint8_t ivs[4 * 32], 16); const uint8_t *pTempBufInPtr = NULL; uint8_t *pTempBufOutPtr = NULL; - const uint64_t *pIn64[NUM_SSE_BUFS]= {NULL}; - uint64_t *pOut64[NUM_SSE_BUFS] = {NULL}; + const uint64_t *pIn64[NUM_SSE_BUFS] = { NULL }; + uint64_t *pOut64[NUM_SSE_BUFS] = { NULL }; uint64_t *pKeyStream64 = NULL; /* @@ -161,10 +150,10 @@ void _zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], for (i = 0; i < NUM_SSE_BUFS; i++) { remainBytes[i] = length[i]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } - asm_ZucInitialization_4_sse_no_aesni( &keys, ivs, &state); + asm_ZucInitialization_4_sse_no_aesni(&keys, ivs, &state); for (i = 0; i < NUM_SSE_BUFS; i++) { pOut64[i] = (uint64_t *) pBufferOut[i]; @@ -172,8 +161,7 @@ void _zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], } /* Encrypt common length of all buffers) */ - asm_ZucCipher_4_sse_no_aesni(&state, pIn64, pOut64, remainBytes, - (uint16_t) bytes); + asm_ZucCipher_4_sse_no_aesni(&state, pIn64, pOut64, remainBytes, (uint16_t) bytes); /* process each packet separately for the remaining bytes */ for (i = 0; i < NUM_SSE_BUFS; i++) { @@ -199,30 +187,23 @@ void _zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], singlePktState.fR1 = state.fR1[i]; singlePktState.fR2 = state.fR2[i]; - uint32_t numKeyStreamsPerPkt = - remainBytes[i] / KEYSTR_ROUND_LEN; - const uint32_t numBytesLeftOver = - remainBytes[i] % KEYSTR_ROUND_LEN; + uint32_t numKeyStreamsPerPkt = remainBytes[i] / KEYSTR_ROUND_LEN; + const uint32_t numBytesLeftOver = remainBytes[i] % KEYSTR_ROUND_LEN; pTempBufInPtr = pBufferIn[i]; pTempBufOutPtr = pBufferOut[i]; /* update the output and input pointers here to point * to the i'th buffers */ - pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - - remainBytes[i]]; - pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - - remainBytes[i]]; + pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - remainBytes[i]]; + pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - remainBytes[i]]; while (numKeyStreamsPerPkt--) { /* Generate the key stream 16 bytes at a time */ - asm_ZucGenKeystream16B_sse_no_aesni( - (uint32_t *) keyStr[0], - &singlePktState); + asm_ZucGenKeystream16B_sse_no_aesni((uint32_t *) keyStr[0], + &singlePktState); pKeyStream64 = (uint64_t *) keyStr[0]; - asm_XorKeyStream16B_sse(pIn64[0], - pOut64[0], - pKeyStream64); + asm_XorKeyStream16B_sse(pIn64[0], pOut64[0], pKeyStream64); pIn64[0] += 2; pOut64[0] += 2; } @@ -234,31 +215,23 @@ void _zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], uint64_t *pTempSrc64; uint64_t *pTempDst64; uint32_t offset = length[i] - numBytesLeftOver; - const uint64_t num4BRounds = - ((numBytesLeftOver - 1) / 4) + 1; + const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_sse_no_aesni( - (uint32_t *)&keyStr[0], - &singlePktState, - num4BRounds); + asm_ZucGenKeystream_sse_no_aesni((uint32_t *) &keyStr[0], + &singlePktState, num4BRounds); /* copy the remaining bytes into temporary * buffer and XOR with the 16 bytes of * keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pTempBufInPtr[offset], - numBytesLeftOver); - memset(&tempSrc[numBytesLeftOver], 0, - 16 - numBytesLeftOver); + memcpy(&tempSrc[0], &pTempBufInPtr[offset], numBytesLeftOver); + memset(&tempSrc[numBytesLeftOver], 0, 16 - numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStr[0][0]; pTempSrc64 = (uint64_t *) &tempSrc[0]; pTempDst64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream16B_sse(pTempSrc64, - pTempDst64, - pKeyStream64); + asm_XorKeyStream16B_sse(pTempSrc64, pTempDst64, pKeyStream64); - memcpy(&pTempBufOutPtr[offset], - &tempDst[0], numBytesLeftOver); + memcpy(&pTempBufOutPtr[offset], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); clear_mem(tempDst, sizeof(tempDst)); @@ -276,11 +249,9 @@ void _zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +void +zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, const void *pBufferIn, + void *pBufferOut, const uint32_t length) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -317,8 +288,7 @@ void zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, } #endif - _zuc_eea3_1_buffer_sse_no_aesni(pKey, pIv, pBufferIn, pBufferOut, - length); + _zuc_eea3_1_buffer_sse_no_aesni(pKey, pIv, pBufferIn, pBufferOut, length); #ifdef SAFE_DATA /* Clear sensitive data in registers */ @@ -330,11 +300,11 @@ void zuc_eea3_1_buffer_sse_no_aesni(const void *pKey, #endif } -void zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - void *pBufferOut[NUM_SSE_BUFS], - const uint32_t length[NUM_SSE_BUFS]) +void +zuc_eea3_4_buffer_sse_no_aesni(const void *const pKey[NUM_SSE_BUFS], + const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], + void *pBufferOut[NUM_SSE_BUFS], const uint32_t length[NUM_SSE_BUFS]) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -395,16 +365,14 @@ void zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } } #endif - _zuc_eea3_4_buffer_sse_no_aesni(pKey, pIv, pBufferIn, pBufferOut, - length); + _zuc_eea3_4_buffer_sse_no_aesni(pKey, pIv, pBufferIn, pBufferOut, length); #ifdef SAFE_DATA /* Clear sensitive data in registers */ @@ -416,13 +384,10 @@ void zuc_eea3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], #endif } - -void zuc_eea3_n_buffer_sse_no_aesni(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers) +void +zuc_eea3_n_buffer_sse_no_aesni(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t length[], const uint32_t numBuffers) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -485,8 +450,7 @@ void zuc_eea3_n_buffer_sse_no_aesni(const void * const pKey[], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -496,19 +460,13 @@ void zuc_eea3_n_buffer_sse_no_aesni(const void * const pKey[], while (packetCount >= NUM_SSE_BUFS) { packetCount -= NUM_SSE_BUFS; - _zuc_eea3_4_buffer_sse_no_aesni(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], + _zuc_eea3_4_buffer_sse_no_aesni(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], &length[i]); i += NUM_SSE_BUFS; } - while(packetCount--) { - _zuc_eea3_1_buffer_sse_no_aesni(pKey[i], - pIv[i], - pBufferIn[i], - pBufferOut[i], + while (packetCount--) { + _zuc_eea3_1_buffer_sse_no_aesni(pKey[i], pIv[i], pBufferIn[i], pBufferOut[i], length[i]); i++; } @@ -523,12 +481,9 @@ void zuc_eea3_n_buffer_sse_no_aesni(const void * const pKey[], #endif } -static inline -void _zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +static inline void +_zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { DECLARE_ALIGNED(ZucState_t zucState, 64); DECLARE_ALIGNED(uint32_t keyStream[4 * 2], 64); @@ -543,15 +498,13 @@ void _zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, /* loop over the message bits */ while (remainingBits >= keyStreamLengthInBits) { - remainingBits -= keyStreamLengthInBits; + remainingBits -= keyStreamLengthInBits; /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainingBits) - asm_ZucGenKeystream8B_sse_no_aesni(&keyStream[4], - &zucState); + asm_ZucGenKeystream8B_sse_no_aesni(&keyStream[4], &zucState); else - asm_ZucGenKeystream16B_sse_no_aesni(&keyStream[4], - &zucState); + asm_ZucGenKeystream16B_sse_no_aesni(&keyStream[4], &zucState); asm_Eia3Round16B_sse_no_aesni(&T, keyStream, pIn8, 4); pIn8 = &pIn8[KEYSTR_ROUND_LEN]; } @@ -562,8 +515,7 @@ void _zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, */ if (remainingBits > (2 * 32)) asm_ZucGenKeystream8B_sse_no_aesni(&keyStream[4], &zucState); - asm_Eia3Remainder_sse_no_aesni(&T, &keyStream[0], pIn8, remainingBits, - 128, 4); + asm_Eia3Remainder_sse_no_aesni(&T, &keyStream[0], pIn8, remainingBits, 128, 4); /* save the final MAC-I result */ *pMacI = T; @@ -575,41 +527,40 @@ void _zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, #endif } -static inline -void _zuc_eia3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - const uint32_t lengthInBits[NUM_SSE_BUFS], - uint32_t *pMacI[NUM_SSE_BUFS]) +static inline void +_zuc_eia3_4_buffer_sse_no_aesni(const void *const pKey[NUM_SSE_BUFS], + const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], + const uint32_t lengthInBits[NUM_SSE_BUFS], + uint32_t *pMacI[NUM_SSE_BUFS]) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); /* structure to store the 4 IV's */ - DECLARE_ALIGNED(uint8_t ivs[4*32], 16); - const uint8_t *pIn8[NUM_SSE_BUFS] = {NULL}; + DECLARE_ALIGNED(uint8_t ivs[4 * 32], 16); + const uint8_t *pIn8[NUM_SSE_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t numKeyStr = 0; - uint32_t T[NUM_SSE_BUFS] = {0}; + uint32_t T[NUM_SSE_BUFS] = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - uint32_t *pKeyStrArr[NUM_SSE_BUFS] = {NULL}; + uint32_t *pKeyStrArr[NUM_SSE_BUFS] = { NULL }; unsigned int allCommonBits; /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -619,7 +570,7 @@ void _zuc_eia3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], pIn8[i] = (const uint8_t *) pBufferIn[i]; pKeyStrArr[i] = (uint32_t *) &keyStr[i][0]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } asm_ZucInitialization_4_sse_no_aesni(&keys, ivs, &state); @@ -637,28 +588,24 @@ void _zuc_eia3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], numKeyStr++; /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainCommonBits && allCommonBits) - asm_ZucGenKeystream8B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream8B_4_sse_no_aesni(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_sse_no_aesni(&state, pKeyStrArr); for (i = 0; i < NUM_SSE_BUFS; i++) { - asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr[i], - pIn8[i], 4); + asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr[i], pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } } /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_SSE_BUFS; i++) { - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; /* If remaining bits are more than 8 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (2*32)) { + if (remainBits > (2 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -685,15 +632,10 @@ void _zuc_eia3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_sse_no_aesni( - &keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_sse_no_aesni(&keyStr32[4], &singlePktState); else - asm_ZucGenKeystream16B_sse_no_aesni( - &keyStr32[4], - &singlePktState); - asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr32, - pIn8[i], 4); + asm_ZucGenKeystream16B_sse_no_aesni(&keyStr32[4], &singlePktState); + asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr32, pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } @@ -702,11 +644,9 @@ void _zuc_eia3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], * keystream needs to have up to another 2 ZUC WORDS (8B) */ if (remainBits > (2 * 32)) - asm_ZucGenKeystream8B_sse_no_aesni(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_sse_no_aesni(&keyStr32[4], &singlePktState); - asm_Eia3Remainder_sse_no_aesni(&T[i], keyStr32, pIn8[i], - remainBits, 128, 4); + asm_Eia3Remainder_sse_no_aesni(&T[i], keyStr32, pIn8[i], remainBits, 128, 4); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; } @@ -720,11 +660,9 @@ void _zuc_eia3_4_buffer_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +void +zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -761,8 +699,7 @@ void zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, } #endif - _zuc_eia3_1_buffer_sse_no_aesni(pKey, pIv, pBufferIn, - lengthInBits, pMacI); + _zuc_eia3_1_buffer_sse_no_aesni(pKey, pIv, pBufferIn, lengthInBits, pMacI); #ifdef SAFE_DATA CLEAR_SCRATCH_GPS(); @@ -774,39 +711,37 @@ void zuc_eia3_1_buffer_sse_no_aesni(const void *pKey, } void -zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_SSE_BUFS], +zuc_eia3_4_buffer_job_sse_no_aesni(const void *const pKey[NUM_SSE_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_SSE_BUFS], uint32_t *pMacI[NUM_SSE_BUFS], const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS]) + const void *const job_in_lane[NUM_SSE_BUFS]) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); - const uint8_t *pIn8[NUM_SSE_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_SSE_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t numKeyStr = 0; - uint32_t T[NUM_SSE_BUFS] = {0}; + uint32_t T[NUM_SSE_BUFS] = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - uint32_t *pKeyStrArr[NUM_SSE_BUFS] = {NULL}; + uint32_t *pKeyStrArr[NUM_SSE_BUFS] = { NULL }; unsigned int allCommonBits; /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -818,7 +753,7 @@ zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], keys.pKeys[i] = pKey[i]; } - asm_ZucInitialization_4_sse_no_aesni(&keys, ivs, &state); + asm_ZucInitialization_4_sse_no_aesni(&keys, ivs, &state); /* Generate 16 bytes at a time */ asm_ZucGenKeystream16B_4_sse_no_aesni(&state, pKeyStrArr); @@ -833,17 +768,14 @@ zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], numKeyStr++; /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainCommonBits && allCommonBits) - asm_ZucGenKeystream8B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream8B_4_sse_no_aesni(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_sse_no_aesni(&state, pKeyStrArr); for (i = 0; i < NUM_SSE_BUFS; i++) { if (job_in_lane[i] == NULL) continue; - asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr[i], - pIn8[i], 4); + asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr[i], pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } } @@ -853,14 +785,13 @@ zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], if (job_in_lane[i] == NULL) continue; - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; /* If remaining bits are more than 8 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (2*32)) { + if (remainBits > (2 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -887,15 +818,10 @@ zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_sse_no_aesni( - &keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_sse_no_aesni(&keyStr32[4], &singlePktState); else - asm_ZucGenKeystream16B_sse_no_aesni( - &keyStr32[4], - &singlePktState); - asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr32, - pIn8[i], 4); + asm_ZucGenKeystream16B_sse_no_aesni(&keyStr32[4], &singlePktState); + asm_Eia3Round16B_sse_no_aesni(&T[i], keyStr32, pIn8[i], 4); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } @@ -904,11 +830,9 @@ zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], * keystream needs to have up to another 2 ZUC WORDS (8B) */ if (remainBits > (2 * 32)) - asm_ZucGenKeystream8B_sse_no_aesni(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_sse_no_aesni(&keyStr32[4], &singlePktState); - asm_Eia3Remainder_sse_no_aesni(&T[i], keyStr32, pIn8[i], - remainBits, 128, 4); + asm_Eia3Remainder_sse_no_aesni(&T[i], keyStr32, pIn8[i], remainBits, 128, 4); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; } @@ -923,40 +847,38 @@ zuc_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], } void -zuc256_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_SSE_BUFS], - void *pMacI[NUM_SSE_BUFS], - const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS], - const uint64_t tag_size) +zuc256_eia3_4_buffer_job_sse_no_aesni(const void *const pKey[NUM_SSE_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_SSE_BUFS], + void *pMacI[NUM_SSE_BUFS], + const uint16_t lengthInBits[NUM_SSE_BUFS], + const void *const job_in_lane[NUM_SSE_BUFS], + const uint64_t tag_size) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); - const uint8_t *pIn8[NUM_SSE_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_SSE_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t dataDigested = 0; - uint8_t T[NUM_SSE_BUFS*16] = {0}; + uint8_t T[NUM_SSE_BUFS * 16] = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - uint32_t *pKeyStrArr[NUM_SSE_BUFS] = {NULL}; + uint32_t *pKeyStrArr[NUM_SSE_BUFS] = { NULL }; unsigned int allCommonBits; /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -968,8 +890,7 @@ zuc256_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], keys.pKeys[i] = pKey[i]; } - asm_Zuc256Initialization_4_sse_no_aesni(&keys, ivs, &state, T, - tag_size); + asm_Zuc256Initialization_4_sse_no_aesni(&keys, ivs, &state, T, tag_size); /* Generate 16 bytes at a time */ asm_ZucGenKeystream16B_4_sse_no_aesni(&state, pKeyStrArr); @@ -985,32 +906,27 @@ zuc256_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream 4 bytes or 16 bytes */ if (!remainCommonBits && allCommonBits) if (tag_size == 4) - asm_ZucGenKeystream4B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream4B_4_sse_no_aesni(&state, pKeyStrArr); else if (tag_size == 8) - asm_ZucGenKeystream8B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream8B_4_sse_no_aesni(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_sse_no_aesni(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_sse_no_aesni(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_sse_no_aesni(&state, pKeyStrArr); for (i = 0; i < NUM_SSE_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; - asm_Eia3Round16B_sse_no_aesni(tag, keyStr[i], pIn8[i], - tag_size); + asm_Eia3Round16B_sse_no_aesni(tag, keyStr[i], pIn8[i], tag_size); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } } /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_SSE_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; @@ -1052,28 +968,21 @@ zuc256_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream (16 bytes max) */ if (L > 3) { - asm_ZucGenKeystream16B_sse_no_aesni( - &keyStr32[4], - &singlePktState); + asm_ZucGenKeystream16B_sse_no_aesni(&keyStr32[4], &singlePktState); L -= 4; } else { - asm_ZucGenKeystream_sse_no_aesni( - &keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_sse_no_aesni(&keyStr32[4], &singlePktState, L); L = 0; } - asm_Eia3Round16B_sse_no_aesni(tag, keyStr32, pIn8[i], - tag_size); + asm_Eia3Round16B_sse_no_aesni(tag, keyStr32, pIn8[i], tag_size); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } /* Generate final keystream if needed */ if (L > 0) - asm_ZucGenKeystream_sse_no_aesni(&keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_sse_no_aesni(&keyStr32[4], &singlePktState, L); - asm_Eia3Remainder_sse_no_aesni(tag, keyStr32, pIn8[i], - remainBits, 256, tag_size); + asm_Eia3Remainder_sse_no_aesni(tag, keyStr32, pIn8[i], remainBits, 256, tag_size); /* save the final MAC-I result */ memcpy(pMacI[i], tag, tag_size); } @@ -1087,12 +996,10 @@ zuc256_eia3_4_buffer_job_sse_no_aesni(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc_eia3_n_buffer_sse_no_aesni(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers) +void +zuc_eia3_n_buffer_sse_no_aesni(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -1155,8 +1062,7 @@ void zuc_eia3_n_buffer_sse_no_aesni(const void * const pKey[], } /* Check input data is in range of supported length */ - if (lengthInBits[i] < ZUC_MIN_BITLEN || - lengthInBits[i] > ZUC_MAX_BITLEN) { + if (lengthInBits[i] < ZUC_MIN_BITLEN || lengthInBits[i] > ZUC_MAX_BITLEN) { imb_set_errno(NULL, IMB_ERR_AUTH_LEN); return; } @@ -1164,21 +1070,15 @@ void zuc_eia3_n_buffer_sse_no_aesni(const void * const pKey[], #endif i = 0; - while(packetCount >= 4) { - packetCount -=4; - _zuc_eia3_4_buffer_sse_no_aesni(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], + while (packetCount >= 4) { + packetCount -= 4; + _zuc_eia3_4_buffer_sse_no_aesni(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], &pMacI[i]); - i+=4; + i += 4; } - while(packetCount--) { - _zuc_eia3_1_buffer_sse_no_aesni(pKey[i], - pIv[i], - pBufferIn[i], - lengthInBits[i], + while (packetCount--) { + _zuc_eia3_1_buffer_sse_no_aesni(pKey[i], pIv[i], pBufferIn[i], lengthInBits[i], pMacI[i]); i++; } diff --git a/lib/sse_t1/kasumi_sse.c b/lib/sse_t1/kasumi_sse.c index 3a63917b..aefad507 100644 --- a/lib/sse_t1/kasumi_sse.c +++ b/lib/sse_t1/kasumi_sse.c @@ -34,13 +34,12 @@ #include "include/clear_regs_mem.h" #include "include/error.h" -#define SAVE_XMMS save_xmms -#define RESTORE_XMMS restore_xmms +#define SAVE_XMMS save_xmms +#define RESTORE_XMMS restore_xmms void -kasumi_f8_1_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pBufferIn, void *pBufferOut, - const uint32_t cipherLengthInBytes) +kasumi_f8_1_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBytes) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -50,7 +49,7 @@ kasumi_f8_1_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, #ifdef SAFE_PARAM /* Check for NULL pointers */ imb_set_errno(NULL, 0); - if (pCtx == NULL) { + if (pCtx == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } @@ -63,14 +62,12 @@ kasumi_f8_1_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, return; } /* Check input data is in range of supported length */ - if (cipherLengthInBytes == 0 || - cipherLengthInBytes > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (cipherLengthInBytes == 0 || cipherLengthInBytes > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } #endif - kasumi_f8_1_buffer(pCtx, IV, pBufferIn, pBufferOut, - cipherLengthInBytes); + kasumi_f8_1_buffer(pCtx, IV, pBufferIn, pBufferOut, cipherLengthInBytes); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -82,10 +79,8 @@ kasumi_f8_1_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, } void -kasumi_f8_1_buffer_bit_sse(const kasumi_key_sched_t *pCtx, - const uint64_t IV, - const void *pBufferIn, void *pBufferOut, - const uint32_t cipherLengthInBits, +kasumi_f8_1_buffer_bit_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, const void *pBufferIn, + void *pBufferOut, const uint32_t cipherLengthInBits, const uint32_t offsetInBits) { #ifndef LINUX @@ -96,7 +91,7 @@ kasumi_f8_1_buffer_bit_sse(const kasumi_key_sched_t *pCtx, #ifdef SAFE_PARAM /* Check for NULL pointers */ imb_set_errno(NULL, 0); - if (pCtx == NULL) { + if (pCtx == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } @@ -109,14 +104,12 @@ kasumi_f8_1_buffer_bit_sse(const kasumi_key_sched_t *pCtx, return; } /* Check input data is in range of supported length */ - if (cipherLengthInBits == 0 || - cipherLengthInBits > KASUMI_MAX_LEN) { + if (cipherLengthInBits == 0 || cipherLengthInBits > KASUMI_MAX_LEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } #endif - kasumi_f8_1_buffer_bit(pCtx, IV, pBufferIn, pBufferOut, - cipherLengthInBits, offsetInBits); + kasumi_f8_1_buffer_bit(pCtx, IV, pBufferIn, pBufferOut, cipherLengthInBits, offsetInBits); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -128,11 +121,9 @@ kasumi_f8_1_buffer_bit_sse(const kasumi_key_sched_t *pCtx, } void -kasumi_f8_2_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, - const uint64_t IV2, const void *pBufferIn1, - void *pBufferOut1, const uint32_t lengthInBytes1, - const void *pBufferIn2, void *pBufferOut2, - const uint32_t lengthInBytes2) +kasumi_f8_2_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const void *pBufferIn1, void *pBufferOut1, const uint32_t lengthInBytes1, + const void *pBufferIn2, void *pBufferOut2, const uint32_t lengthInBytes2) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -155,21 +146,18 @@ kasumi_f8_2_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, return; } /* Check input data is in range of supported length */ - if (lengthInBytes1 == 0 || - lengthInBytes1 > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (lengthInBytes1 == 0 || lengthInBytes1 > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } - if (lengthInBytes2 == 0 || - lengthInBytes2 > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (lengthInBytes2 == 0 || lengthInBytes2 > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } #endif - kasumi_f8_2_buffer(pCtx, IV1, IV2, - pBufferIn1, pBufferOut1, lengthInBytes1, - pBufferIn2, pBufferOut2, lengthInBytes2); + kasumi_f8_2_buffer(pCtx, IV1, IV2, pBufferIn1, pBufferOut1, lengthInBytes1, pBufferIn2, + pBufferOut2, lengthInBytes2); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -181,12 +169,10 @@ kasumi_f8_2_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, } void -kasumi_f8_3_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, - const uint64_t IV2, const uint64_t IV3, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const uint32_t lengthInBytes) +kasumi_f8_3_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const void *pBufferIn1, void *pBufferOut1, + const void *pBufferIn2, void *pBufferOut2, const void *pBufferIn3, + void *pBufferOut3, const uint32_t lengthInBytes) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -214,9 +200,7 @@ kasumi_f8_3_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, return; } #endif - kasumi_f8_3_buffer(pCtx, IV1, IV2, IV3, - pBufferIn1, pBufferOut1, - pBufferIn2, pBufferOut2, + kasumi_f8_3_buffer(pCtx, IV1, IV2, IV3, pBufferIn1, pBufferOut1, pBufferIn2, pBufferOut2, pBufferIn3, pBufferOut3, lengthInBytes); #ifdef SAFE_DATA /* Clear sensitive data in registers */ @@ -229,14 +213,11 @@ kasumi_f8_3_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, } void -kasumi_f8_4_buffer_sse(const kasumi_key_sched_t *pCtx, - const uint64_t IV1, const uint64_t IV2, - const uint64_t IV3, const uint64_t IV4, - const void *pBufferIn1, void *pBufferOut1, - const void *pBufferIn2, void *pBufferOut2, - const void *pBufferIn3, void *pBufferOut3, - const void *pBufferIn4, void *pBufferOut4, - const uint32_t lengthInBytes) +kasumi_f8_4_buffer_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV1, const uint64_t IV2, + const uint64_t IV3, const uint64_t IV4, const void *pBufferIn1, + void *pBufferOut1, const void *pBufferIn2, void *pBufferOut2, + const void *pBufferIn3, void *pBufferOut3, const void *pBufferIn4, + void *pBufferOut4, const uint32_t lengthInBytes) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -250,8 +231,7 @@ kasumi_f8_4_buffer_sse(const kasumi_key_sched_t *pCtx, imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); return; } - if (pBufferIn1 == NULL || pBufferIn2 == NULL || pBufferIn3 == NULL || - pBufferIn4 == NULL) { + if (pBufferIn1 == NULL || pBufferIn2 == NULL || pBufferIn3 == NULL || pBufferIn4 == NULL) { imb_set_errno(NULL, IMB_ERR_NULL_SRC); return; } @@ -266,11 +246,8 @@ kasumi_f8_4_buffer_sse(const kasumi_key_sched_t *pCtx, return; } #endif - kasumi_f8_4_buffer(pCtx, IV1, IV2, IV3, IV4, - pBufferIn1, pBufferOut1, - pBufferIn2, pBufferOut2, - pBufferIn3, pBufferOut3, - pBufferIn4, pBufferOut4, + kasumi_f8_4_buffer(pCtx, IV1, IV2, IV3, IV4, pBufferIn1, pBufferOut1, pBufferIn2, + pBufferOut2, pBufferIn3, pBufferOut3, pBufferIn4, pBufferOut4, lengthInBytes); #ifdef SAFE_DATA /* Clear sensitive data in registers */ @@ -283,10 +260,9 @@ kasumi_f8_4_buffer_sse(const kasumi_key_sched_t *pCtx, } void -kasumi_f8_n_buffer_sse(const kasumi_key_sched_t *pKeySchedule, - const uint64_t IV[], - const void * const pDataIn[], void *pDataOut[], - const uint32_t dataLen[], const uint32_t dataCount) +kasumi_f8_n_buffer_sse(const kasumi_key_sched_t *pKeySchedule, const uint64_t IV[], + const void *const pDataIn[], void *pDataOut[], const uint32_t dataLen[], + const uint32_t dataCount) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -332,8 +308,7 @@ kasumi_f8_n_buffer_sse(const kasumi_key_sched_t *pKeySchedule, return; } /* Check input data is in range of supported length */ - if (dataLen[i] == 0 || - dataLen[i] > (KASUMI_MAX_LEN / CHAR_BIT)) { + if (dataLen[i] == 0 || dataLen[i] > (KASUMI_MAX_LEN / CHAR_BIT)) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -345,13 +320,13 @@ kasumi_f8_n_buffer_sse(const kasumi_key_sched_t *pKeySchedule, /* KASUMI F8 n buffer function can handle up to 16 buffers */ while (numLeft > 0) { const uint64_t *IVPtr = &IV[i]; - const void * const *pDataInPtr = &pDataIn[i]; + const void *const *pDataInPtr = &pDataIn[i]; void **pDataOutPtr = &pDataOut[i]; const uint32_t *dataLenPtr = &dataLen[i]; const uint32_t numBuffs = (numLeft > 16) ? 16 : numLeft; - kasumi_f8_n_buffer(pKeySchedule, IVPtr, pDataInPtr, pDataOutPtr, - dataLenPtr, numBuffs); + kasumi_f8_n_buffer(pKeySchedule, IVPtr, pDataInPtr, pDataOutPtr, dataLenPtr, + numBuffs); i += numBuffs; numLeft -= numBuffs; } @@ -365,7 +340,6 @@ kasumi_f8_n_buffer_sse(const kasumi_key_sched_t *pKeySchedule, #endif } - void kasumi_f9_1_buffer_sse(const kasumi_key_sched_t *pCtx, const void *pBufferIn, const uint32_t lengthInBytes, void *pDigest) @@ -411,8 +385,8 @@ kasumi_f9_1_buffer_sse(const kasumi_key_sched_t *pCtx, const void *pBufferIn, void kasumi_f9_1_buffer_user_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, - const void *pBufferIn, const uint32_t lengthInBits, - void *pDigest, const uint32_t direction) + const void *pBufferIn, const uint32_t lengthInBits, void *pDigest, + const uint32_t direction) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -442,8 +416,7 @@ kasumi_f9_1_buffer_user_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, return; } #endif - kasumi_f9_1_buffer_user(pCtx, IV, pBufferIn, lengthInBits, - pDigest, direction); + kasumi_f9_1_buffer_user(pCtx, IV, pBufferIn, lengthInBits, pDigest, direction); #ifdef SAFE_DATA /* Clear sensitive data in registers */ CLEAR_SCRATCH_GPS(); @@ -455,15 +428,13 @@ kasumi_f9_1_buffer_user_sse(const kasumi_key_sched_t *pCtx, const uint64_t IV, } int -kasumi_init_f8_key_sched_sse(const void *const pKey, - kasumi_key_sched_t *pCtx) +kasumi_init_f8_key_sched_sse(const void *const pKey, kasumi_key_sched_t *pCtx) { return kasumi_init_f8_key_sched(pKey, pCtx); } int -kasumi_init_f9_key_sched_sse(const void *const pKey, - kasumi_key_sched_t *pCtx) +kasumi_init_f9_key_sched_sse(const void *const pKey, kasumi_key_sched_t *pCtx) { return kasumi_init_f9_key_sched(pKey, pCtx); } diff --git a/lib/sse_t1/mb_mgr_sse.c b/lib/sse_t1/mb_mgr_sse.c index d53c4a5d..6f98144b 100644 --- a/lib/sse_t1/mb_mgr_sse.c +++ b/lib/sse_t1/mb_mgr_sse.c @@ -47,8 +47,7 @@ init_mb_mgr_sse_internal(IMB_MGR *state, const int reset_mgrs) return; } - state->features = cpu_feature_adjust(state->flags, - cpu_feature_detect()); + state->features = cpu_feature_adjust(state->flags, cpu_feature_detect()); /* reset error status */ imb_set_errno(state, 0); @@ -70,33 +69,38 @@ init_mb_mgr_sse(IMB_MGR *state) imb_set_errno(state, IMB_ERR_SELFTEST); } -IMB_JOB *submit_job_sse(IMB_MGR *state) +IMB_JOB * +submit_job_sse(IMB_MGR *state) { return IMB_SUBMIT_JOB(state); } -IMB_JOB *flush_job_sse(IMB_MGR *state) +IMB_JOB * +flush_job_sse(IMB_MGR *state) { return IMB_FLUSH_JOB(state); } -uint32_t queue_size_sse(IMB_MGR *state) +uint32_t +queue_size_sse(IMB_MGR *state) { return IMB_QUEUE_SIZE(state); } -IMB_JOB *submit_job_nocheck_sse(IMB_MGR *state) +IMB_JOB * +submit_job_nocheck_sse(IMB_MGR *state) { return IMB_SUBMIT_JOB_NOCHECK(state); } -IMB_JOB *get_next_job_sse(IMB_MGR *state) +IMB_JOB * +get_next_job_sse(IMB_MGR *state) { return IMB_GET_NEXT_JOB(state); } -IMB_JOB *get_completed_job_sse(IMB_MGR *state) +IMB_JOB * +get_completed_job_sse(IMB_MGR *state) { return IMB_GET_COMPLETED_JOB(state); } - diff --git a/lib/sse_t1/mb_mgr_sse_t1.c b/lib/sse_t1/mb_mgr_sse_t1.c index f7cef5f0..5f8374cd 100644 --- a/lib/sse_t1/mb_mgr_sse_t1.c +++ b/lib/sse_t1/mb_mgr_sse_t1.c @@ -51,30 +51,30 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms -#define RESTORE_XMMS restore_xmms +#define SAVE_XMMS save_xmms +#define RESTORE_XMMS restore_xmms /* JOB API */ -#define SUBMIT_JOB submit_job_sse_t1 -#define FLUSH_JOB flush_job_sse_t1 -#define QUEUE_SIZE queue_size_sse_t1 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_t1 -#define GET_NEXT_JOB get_next_job_sse_t1 -#define GET_COMPLETED_JOB get_completed_job_sse_t1 -#define GET_NEXT_BURST get_next_burst_sse_t1 -#define SUBMIT_BURST submit_burst_sse_t1 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_t1 -#define FLUSH_BURST flush_burst_sse_t1 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_t1 +#define SUBMIT_JOB submit_job_sse_t1 +#define FLUSH_JOB flush_job_sse_t1 +#define QUEUE_SIZE queue_size_sse_t1 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_t1 +#define GET_NEXT_JOB get_next_job_sse_t1 +#define GET_COMPLETED_JOB get_completed_job_sse_t1 +#define GET_NEXT_BURST get_next_burst_sse_t1 +#define SUBMIT_BURST submit_burst_sse_t1 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_t1 +#define FLUSH_BURST flush_burst_sse_t1 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_t1 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_sse_t1 -#define SUBMIT_HASH_BURST submit_hash_burst_sse_t1 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_t1 +#define SUBMIT_HASH_BURST submit_hash_burst_sse_t1 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_t1 -#define SET_SUITE_ID_FN set_suite_id_sse_t1 +#define SET_SUITE_ID_FN set_suite_id_sse_t1 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_SSE @@ -82,12 +82,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_SSE /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse #define SUBMIT_JOB_AES_GCM_DEC submit_job_aes_gcm_dec_sse #define SUBMIT_JOB_AES_GCM_ENC submit_job_aes_gcm_enc_sse @@ -105,9 +105,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_sse #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_sse -#define AES_CBC_DEC_128 aes_cbc_dec_128_sse -#define AES_CBC_DEC_192 aes_cbc_dec_192_sse -#define AES_CBC_DEC_256 aes_cbc_dec_256_sse +#define AES_CBC_DEC_128 aes_cbc_dec_128_sse +#define AES_CBC_DEC_192 aes_cbc_dec_192_sse +#define AES_CBC_DEC_256 aes_cbc_dec_256_sse /* AES-CBCS */ #define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_sse @@ -123,45 +123,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_sse #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_sse -#define AES_ECB_ENC_128 aes_ecb_enc_128_by4_sse -#define AES_ECB_ENC_192 aes_ecb_enc_192_by4_sse -#define AES_ECB_ENC_256 aes_ecb_enc_256_by4_sse -#define AES_ECB_DEC_128 aes_ecb_dec_128_by4_sse -#define AES_ECB_DEC_192 aes_ecb_dec_192_by4_sse -#define AES_ECB_DEC_256 aes_ecb_dec_256_by4_sse +#define AES_ECB_ENC_128 aes_ecb_enc_128_by4_sse +#define AES_ECB_ENC_192 aes_ecb_enc_192_by4_sse +#define AES_ECB_ENC_256 aes_ecb_enc_256_by4_sse +#define AES_ECB_DEC_128 aes_ecb_dec_128_by4_sse +#define AES_ECB_DEC_192 aes_ecb_dec_192_by4_sse +#define AES_ECB_DEC_256 aes_ecb_dec_256_by4_sse /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_sse -#define AES_CTR_192 aes_cntr_192_sse -#define AES_CTR_256 aes_cntr_256_sse -#define AES_CTR_128_BIT aes_cntr_bit_128_sse -#define AES_CTR_192_BIT aes_cntr_bit_192_sse -#define AES_CTR_256_BIT aes_cntr_bit_256_sse +#define AES_CTR_128 aes_cntr_128_sse +#define AES_CTR_192 aes_cntr_192_sse +#define AES_CTR_256 aes_cntr_256_sse +#define AES_CTR_128_BIT aes_cntr_bit_128_sse +#define AES_CTR_192_BIT aes_cntr_bit_192_sse +#define AES_CTR_256_BIT aes_cntr_bit_256_sse /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_sse -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_sse +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_sse +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_sse -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_sse -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_sse +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_sse +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_sse /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_sse -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_sse +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_sse +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_sse -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_sse -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_sse +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_sse +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_sse /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_sse -#define AES_CFB_256_ONE aes_cfb_256_one_sse +#define AES_CFB_128_ONE aes_cfb_128_one_sse +#define AES_CFB_256_ONE aes_cfb_256_one_sse /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_sse @@ -170,30 +170,30 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_sse /* SHA1/224/256/384/512 */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_sse -#define FLUSH_JOB_SHA1 flush_job_sha1_sse -#define SUBMIT_JOB_SHA224 submit_job_sha224_sse -#define FLUSH_JOB_SHA224 flush_job_sha224_sse -#define SUBMIT_JOB_SHA256 submit_job_sha256_sse -#define FLUSH_JOB_SHA256 flush_job_sha256_sse -#define SUBMIT_JOB_SHA384 submit_job_sha384_sse -#define FLUSH_JOB_SHA384 flush_job_sha384_sse -#define SUBMIT_JOB_SHA512 submit_job_sha512_sse -#define FLUSH_JOB_SHA512 flush_job_sha512_sse +#define SUBMIT_JOB_SHA1 submit_job_sha1_sse +#define FLUSH_JOB_SHA1 flush_job_sha1_sse +#define SUBMIT_JOB_SHA224 submit_job_sha224_sse +#define FLUSH_JOB_SHA224 flush_job_sha224_sse +#define SUBMIT_JOB_SHA256 submit_job_sha256_sse +#define FLUSH_JOB_SHA256 flush_job_sha256_sse +#define SUBMIT_JOB_SHA384 submit_job_sha384_sse +#define FLUSH_JOB_SHA384 flush_job_sha384_sse +#define SUBMIT_JOB_SHA512 submit_job_sha512_sse +#define FLUSH_JOB_SHA512 flush_job_sha512_sse /* HMAC-SHA1/224/256/384/512/MD5 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_sse -#define FLUSH_JOB_HMAC flush_job_hmac_sse -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_sse -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_sse -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_sse -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_sse -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse +#define SUBMIT_JOB_HMAC submit_job_hmac_sse +#define FLUSH_JOB_HMAC flush_job_hmac_sse +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_sse +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_sse +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_sse +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_sse +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse /* DES & 3DES */ @@ -210,14 +210,14 @@ #define POLY1305_MAC poly1305_mac_scalar /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_no_gfni_sse -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_no_gfni_sse -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_no_gfni_sse -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_no_gfni_sse -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_no_gfni_sse -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_no_gfni_sse -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_no_gfni_sse -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_no_gfni_sse +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_no_gfni_sse +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_no_gfni_sse +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_no_gfni_sse +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_no_gfni_sse +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_no_gfni_sse +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_no_gfni_sse +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_no_gfni_sse +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_no_gfni_sse /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_sse @@ -229,8 +229,7 @@ submit_snow3g_uea2_job_sse(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -255,7 +254,8 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) /* ====================================================================== */ -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 4); @@ -278,20 +278,16 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, SSE_NUM_SHA1_LANES); /* Init HMAC/SHA224 out-of-order fields */ - ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, - SSE_NUM_SHA256_LANES); + ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, SSE_NUM_SHA256_LANES); /* Init HMAC/SHA_256 out-of-order fields */ - ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, - SSE_NUM_SHA256_LANES); + ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, SSE_NUM_SHA256_LANES); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, SSE_NUM_MD5_LANES); @@ -353,90 +349,90 @@ init_mb_mgr_sse_t1_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_sse; - state->keyexp_192 = aes_keyexp_192_sse; - state->keyexp_256 = aes_keyexp_256_sse; + state->keyexp_128 = aes_keyexp_128_sse; + state->keyexp_192 = aes_keyexp_192_sse; + state->keyexp_256 = aes_keyexp_256_sse; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_sse; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_sse; - state->xcbc_keyexp = aes_xcbc_expand_key_sse; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_sse; - state->sha1 = sha1_sse; - state->sha224_one_block = sha224_one_block_sse; - state->sha224 = sha224_sse; - state->sha256_one_block = sha256_one_block_sse; - state->sha256 = sha256_sse; - state->sha384_one_block = sha384_one_block_sse; - state->sha384 = sha384_sse; - state->sha512_one_block = sha512_one_block_sse; - state->sha512 = sha512_sse; - state->md5_one_block = md5_one_block_sse; - - state->aes128_cfb_one = aes_cfb_128_one_sse; - state->aes256_cfb_one = aes_cfb_256_one_sse; - - state->eea3_1_buffer = zuc_eea3_1_buffer_sse; - state->eea3_4_buffer = zuc_eea3_4_buffer_sse; - state->eea3_n_buffer = zuc_eea3_n_buffer_sse; - state->eia3_n_buffer = zuc_eia3_n_buffer_sse; - state->eia3_1_buffer = zuc_eia3_1_buffer_sse; - - state->f8_1_buffer = kasumi_f8_1_buffer_sse; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; - state->f8_2_buffer = kasumi_f8_2_buffer_sse; - state->f8_3_buffer = kasumi_f8_3_buffer_sse; - state->f8_4_buffer = kasumi_f8_4_buffer_sse; - state->f8_n_buffer = kasumi_f8_n_buffer_sse; - state->f9_1_buffer = kasumi_f9_1_buffer_sse; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; + state->xcbc_keyexp = aes_xcbc_expand_key_sse; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_sse; + state->sha1 = sha1_sse; + state->sha224_one_block = sha224_one_block_sse; + state->sha224 = sha224_sse; + state->sha256_one_block = sha256_one_block_sse; + state->sha256 = sha256_sse; + state->sha384_one_block = sha384_one_block_sse; + state->sha384 = sha384_sse; + state->sha512_one_block = sha512_one_block_sse; + state->sha512 = sha512_sse; + state->md5_one_block = md5_one_block_sse; + + state->aes128_cfb_one = aes_cfb_128_one_sse; + state->aes256_cfb_one = aes_cfb_256_one_sse; + + state->eea3_1_buffer = zuc_eea3_1_buffer_sse; + state->eea3_4_buffer = zuc_eea3_4_buffer_sse; + state->eea3_n_buffer = zuc_eea3_n_buffer_sse; + state->eia3_n_buffer = zuc_eia3_n_buffer_sse; + state->eia3_1_buffer = zuc_eia3_1_buffer_sse; + + state->f8_1_buffer = kasumi_f8_1_buffer_sse; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; + state->f8_2_buffer = kasumi_f8_2_buffer_sse; + state->f8_3_buffer = kasumi_f8_3_buffer_sse; + state->f8_4_buffer = kasumi_f8_4_buffer_sse; + state->f8_n_buffer = kasumi_f8_n_buffer_sse; + state->f9_1_buffer = kasumi_f9_1_buffer_sse; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_sse; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_sse; state->kasumi_key_sched_size = kasumi_key_sched_size_sse; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_sse; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_sse; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_sse; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_sse; state->snow3g_init_key_sched = snow3g_init_key_sched_sse; state->snow3g_key_sched_size = snow3g_key_sched_size_sse; - state->hec_32 = hec_32_sse; - state->hec_64 = hec_64_sse; - - state->crc32_ethernet_fcs = ethernet_fcs_sse; - state->crc16_x25 = crc16_x25_sse; - state->crc32_sctp = crc32_sctp_sse; - state->crc24_lte_a = crc24_lte_a_sse; - state->crc24_lte_b = crc24_lte_b_sse; - state->crc16_fp_data = crc16_fp_data_sse; - state->crc11_fp_header = crc11_fp_header_sse; - state->crc7_fp_header = crc7_fp_header_sse; - state->crc10_iuup_data = crc10_iuup_data_sse; - state->crc6_iuup_header = crc6_iuup_header_sse; + state->hec_32 = hec_32_sse; + state->hec_64 = hec_64_sse; + + state->crc32_ethernet_fcs = ethernet_fcs_sse; + state->crc16_x25 = crc16_x25_sse; + state->crc32_sctp = crc32_sctp_sse; + state->crc24_lte_a = crc24_lte_a_sse; + state->crc24_lte_b = crc24_lte_b_sse; + state->crc16_fp_data = crc16_fp_data_sse; + state->crc11_fp_header = crc11_fp_header_sse; + state->crc7_fp_header = crc7_fp_header_sse; + state->crc10_iuup_data = crc10_iuup_data_sse; + state->crc6_iuup_header = crc6_iuup_header_sse; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_sse; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_sse; @@ -445,55 +441,55 @@ init_mb_mgr_sse_t1_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_sse; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_sse; - state->gcm128_enc = aes_gcm_enc_128_sse; - state->gcm192_enc = aes_gcm_enc_192_sse; - state->gcm256_enc = aes_gcm_enc_256_sse; - state->gcm128_dec = aes_gcm_dec_128_sse; - state->gcm192_dec = aes_gcm_dec_192_sse; - state->gcm256_dec = aes_gcm_dec_256_sse; - state->gcm128_init = aes_gcm_init_128_sse; - state->gcm192_init = aes_gcm_init_192_sse; - state->gcm256_init = aes_gcm_init_256_sse; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; - state->gcm128_enc_update = aes_gcm_enc_128_update_sse; - state->gcm192_enc_update = aes_gcm_enc_192_update_sse; - state->gcm256_enc_update = aes_gcm_enc_256_update_sse; - state->gcm128_dec_update = aes_gcm_dec_128_update_sse; - state->gcm192_dec_update = aes_gcm_dec_192_update_sse; - state->gcm256_dec_update = aes_gcm_dec_256_update_sse; + state->gcm128_enc = aes_gcm_enc_128_sse; + state->gcm192_enc = aes_gcm_enc_192_sse; + state->gcm256_enc = aes_gcm_enc_256_sse; + state->gcm128_dec = aes_gcm_dec_128_sse; + state->gcm192_dec = aes_gcm_dec_192_sse; + state->gcm256_dec = aes_gcm_dec_256_sse; + state->gcm128_init = aes_gcm_init_128_sse; + state->gcm192_init = aes_gcm_init_192_sse; + state->gcm256_init = aes_gcm_init_256_sse; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; + state->gcm128_enc_update = aes_gcm_enc_128_update_sse; + state->gcm192_enc_update = aes_gcm_enc_192_update_sse; + state->gcm256_enc_update = aes_gcm_enc_256_update_sse; + state->gcm128_dec_update = aes_gcm_dec_128_update_sse; + state->gcm192_dec_update = aes_gcm_dec_192_update_sse; + state->gcm256_dec_update = aes_gcm_dec_256_update_sse; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_sse; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_sse; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_sse; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_sse; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_sse; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_sse; - state->gcm128_precomp = aes_gcm_precomp_128_sse; - state->gcm192_precomp = aes_gcm_precomp_192_sse; - state->gcm256_precomp = aes_gcm_precomp_256_sse; - state->gcm128_pre = aes_gcm_pre_128_sse; - state->gcm192_pre = aes_gcm_pre_192_sse; - state->gcm256_pre = aes_gcm_pre_256_sse; - - state->ghash = ghash_sse; - state->ghash_pre = ghash_pre_sse; - - state->gmac128_init = imb_aes_gmac_init_128_sse; - state->gmac192_init = imb_aes_gmac_init_192_sse; - state->gmac256_init = imb_aes_gmac_init_256_sse; - state->gmac128_update = imb_aes_gmac_update_128_sse; - state->gmac192_update = imb_aes_gmac_update_192_sse; - state->gmac256_update = imb_aes_gmac_update_256_sse; - state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; - state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; - state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; + state->gcm128_precomp = aes_gcm_precomp_128_sse; + state->gcm192_precomp = aes_gcm_precomp_192_sse; + state->gcm256_precomp = aes_gcm_precomp_256_sse; + state->gcm128_pre = aes_gcm_pre_128_sse; + state->gcm192_pre = aes_gcm_pre_192_sse; + state->gcm256_pre = aes_gcm_pre_256_sse; + + state->ghash = ghash_sse; + state->ghash_pre = ghash_pre_sse; + + state->gmac128_init = imb_aes_gmac_init_128_sse; + state->gmac192_init = imb_aes_gmac_init_192_sse; + state->gmac256_init = imb_aes_gmac_init_256_sse; + state->gmac128_update = imb_aes_gmac_update_128_sse; + state->gmac192_update = imb_aes_gmac_update_192_sse; + state->gmac256_update = imb_aes_gmac_update_256_sse; + state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; + state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; + state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t1/sha_mb_sse.c b/lib/sse_t1/sha_mb_sse.c index c5d91822..c8dcb904 100644 --- a/lib/sse_t1/sha_mb_sse.c +++ b/lib/sse_t1/sha_mb_sse.c @@ -34,18 +34,18 @@ */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha1_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha1_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 4, 1, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + return submit_flush_job_sha_1(state, job, 4, 1, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, call_sha1_mult_sse_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha1_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha1_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 4, 0, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + return submit_flush_job_sha_1(state, job, 4, 0, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, call_sha1_mult_sse_from_c, 0); } @@ -55,19 +55,19 @@ IMB_JOB *flush_job_sha1_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha224_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha224_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 1, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha_256_mult_sse_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 1, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha_256_mult_sse_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha224_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha224_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 0, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha_256_mult_sse_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 0, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha_256_mult_sse_from_c, 0); } /* ========================================================================== */ @@ -76,19 +76,19 @@ IMB_JOB *flush_job_sha224_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha256_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha256_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 1, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha_256_mult_sse_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 1, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha_256_mult_sse_from_c, 0); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha256_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha256_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 4, 0, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha_256_mult_sse_from_c, 0); + return submit_flush_job_sha_256(state, job, 4, 0, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha_256_mult_sse_from_c, 0); } /* ========================================================================== */ @@ -97,19 +97,19 @@ IMB_JOB *flush_job_sha256_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha384_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha384_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 1, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x2_sse_from_c); + return submit_flush_job_sha_512(state, job, 2, 1, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x2_sse_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha384_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha384_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 0, 384, - IMB_SHA_512_BLOCK_SIZE, SHA384_PAD_SIZE, - call_sha512_x2_sse_from_c); + return submit_flush_job_sha_512(state, job, 2, 0, 384, IMB_SHA_512_BLOCK_SIZE, + SHA384_PAD_SIZE, call_sha512_x2_sse_from_c); } /* ========================================================================== */ @@ -118,17 +118,17 @@ IMB_JOB *flush_job_sha384_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha512_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha512_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 1, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x2_sse_from_c); + return submit_flush_job_sha_512(state, job, 2, 1, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x2_sse_from_c); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha512_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha512_sse(MB_MGR_SHA_512_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_512(state, job, 2, 0, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE, - call_sha512_x2_sse_from_c); + return submit_flush_job_sha_512(state, job, 2, 0, 512, IMB_SHA_512_BLOCK_SIZE, + SHA512_PAD_SIZE, call_sha512_x2_sse_from_c); } diff --git a/lib/sse_t1/sha_sse.c b/lib/sse_t1/sha_sse.c index e61f6e58..a425db71 100644 --- a/lib/sse_t1/sha_sse.c +++ b/lib/sse_t1/sha_sse.c @@ -31,7 +31,8 @@ /* ========================================================================== */ /* One block SHA1 computation for IPAD / OPAD usage only */ -void sha1_one_block_sse(const void *data, void *digest) +void +sha1_one_block_sse(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE, 1 /* SHA1 */); } @@ -41,16 +42,17 @@ void sha1_one_block_sse(const void *data, void *digest) * SHA1 API for use in HMAC-SHA1 when key is longer than the block size */ -void sha1_sse(const void *data, const uint64_t length, void *digest) +void +sha1_sse(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE, 1, IMB_SHA1_BLOCK_SIZE, - SHA1_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE); } /* ========================================================================== */ /* One block SHA224 computation for IPAD / OPAD usage only */ -void sha224_one_block_sse(const void *data, void *digest) +void +sha224_one_block_sse(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE, 224 /* SHA224 */); } @@ -59,16 +61,17 @@ void sha224_one_block_sse(const void *data, void *digest) /* * SHA224 API for use in HMAC-SHA224 when key is longer than the block size */ -void sha224_sse(const void *data, const uint64_t length, void *digest) +void +sha224_sse(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE, 224, IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); } /* ========================================================================== */ /* One block SHA256 computation for IPAD / OPAD usage only */ -void sha256_one_block_sse(const void *data, void *digest) +void +sha256_one_block_sse(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE, 256 /* SHA256 */); } @@ -77,16 +80,17 @@ void sha256_one_block_sse(const void *data, void *digest) /* * SHA256 API for use in HMAC-SHA256 when key is longer than the block size */ -void sha256_sse(const void *data, const uint64_t length, void *digest) +void +sha256_sse(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE, 256, IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); } /* ========================================================================== */ /* One block SHA384 computation for IPAD / OPAD usage only */ -void sha384_one_block_sse(const void *data, void *digest) +void +sha384_one_block_sse(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE, 384 /* SHA384 */); } @@ -95,16 +99,17 @@ void sha384_one_block_sse(const void *data, void *digest) /* * SHA384 API for use in HMAC-SHA384 when key is longer than the block size */ -void sha384_sse(const void *data, const uint64_t length, void *digest) +void +sha384_sse(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE, 384, - IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE, 384, IMB_SHA_384_BLOCK_SIZE, SHA384_PAD_SIZE); } /* ========================================================================== */ /* One block SHA512 computation for IPAD / OPAD usage only */ -void sha512_one_block_sse(const void *data, void *digest) +void +sha512_one_block_sse(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE, 512 /* SHA512 */); } @@ -113,8 +118,8 @@ void sha512_one_block_sse(const void *data, void *digest) /* * SHA512 API for use in HMAC-SHA512 when key is longer than the block size */ -void sha512_sse(const void *data, const uint64_t length, void *digest) +void +sha512_sse(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE, 512, - IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE, 512, IMB_SHA_512_BLOCK_SIZE, SHA512_PAD_SIZE); } diff --git a/lib/sse_t1/snow3g_sse.c b/lib/sse_t1/snow3g_sse.c index 8c54d445..0b78aacf 100644 --- a/lib/sse_t1/snow3g_sse.c +++ b/lib/sse_t1/snow3g_sse.c @@ -26,21 +26,22 @@ *******************************************************************************/ #define SSE -#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_sse -#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_sse -#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_sse -#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_sse -#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_sse -#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_sse +#define SNOW3G_F8_1_BUFFER_BIT snow3g_f8_1_buffer_bit_sse +#define SNOW3G_F8_1_BUFFER snow3g_f8_1_buffer_sse +#define SNOW3G_F8_2_BUFFER snow3g_f8_2_buffer_sse +#define SNOW3G_F8_4_BUFFER snow3g_f8_4_buffer_sse +#define SNOW3G_F8_8_BUFFER snow3g_f8_8_buffer_sse +#define SNOW3G_F8_N_BUFFER snow3g_f8_n_buffer_sse #define SNOW3G_F8_8_BUFFER_MULTIKEY snow3g_f8_8_buffer_multikey_sse #define SNOW3G_F8_N_BUFFER_MULTIKEY snow3g_f8_n_buffer_multikey_sse -#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_sse -#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_sse -#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_sse -#define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_sse +#define SNOW3G_F9_1_BUFFER snow3g_f9_1_buffer_sse +#define SNOW3G_INIT_KEY_SCHED snow3g_init_key_sched_sse +#define SNOW3G_KEY_SCHED_SIZE snow3g_key_sched_size_sse +#define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_sse #include "include/snow3g_common.h" #include "include/ipsec_ooo_mgr.h" -IMB_DLL_LOCAL void submit_job_snow3g_uea2_sse(MB_MGR_SNOW3G_OOO *, IMB_JOB *); +IMB_DLL_LOCAL void +submit_job_snow3g_uea2_sse(MB_MGR_SNOW3G_OOO *, IMB_JOB *); IMB_DLL_LOCAL void flush_job_snow3g_uea2_sse(MB_MGR_SNOW3G_OOO); diff --git a/lib/sse_t1/zuc_top_sse.c b/lib/sse_t1/zuc_top_sse.c index e9306e56..0e01bef2 100644 --- a/lib/sse_t1/zuc_top_sse.c +++ b/lib/sse_t1/zuc_top_sse.c @@ -26,12 +26,12 @@ *******************************************************************************/ /*----------------------------------------------------------------------- -* zuc_sse.c -*----------------------------------------------------------------------- -* An implementation of ZUC, the core algorithm for the -* 3GPP Confidentiality and Integrity algorithms. -* -*-----------------------------------------------------------------------*/ + * zuc_sse.c + *----------------------------------------------------------------------- + * An implementation of ZUC, the core algorithm for the + * 3GPP Confidentiality and Integrity algorithms. + * + *-----------------------------------------------------------------------*/ #include @@ -46,13 +46,12 @@ #define RESTORE_XMMS restore_xmms #define CLEAR_SCRATCH_SIMD_REGS clear_scratch_xmms_sse -#define NUM_SSE_BUFS 4 +#define NUM_SSE_BUFS 4 #define KEYSTR_ROUND_LEN 16 static inline void -init_4(ZucKey4_t *keys, const uint8_t *ivs, ZucState4_t *state, - const uint64_t key_sz, const uint64_t tag_sz, - void *T, const unsigned use_gfni) +init_4(ZucKey4_t *keys, const uint8_t *ivs, ZucState4_t *state, const uint64_t key_sz, + const uint64_t tag_sz, void *T, const unsigned use_gfni) { if (key_sz == 128) { if (use_gfni) @@ -61,17 +60,15 @@ init_4(ZucKey4_t *keys, const uint8_t *ivs, ZucState4_t *state, asm_ZucInitialization_4_sse(keys, ivs, state); } else { if (use_gfni) - asm_Zuc256Initialization_4_gfni_sse(keys, ivs, - state, T, tag_sz); + asm_Zuc256Initialization_4_gfni_sse(keys, ivs, state, T, tag_sz); else - asm_Zuc256Initialization_4_sse(keys, ivs, state, T, - tag_sz); + asm_Zuc256Initialization_4_sse(keys, ivs, state, T, tag_sz); } } static inline void -eia3_round16B(void *T, const void *ks, const void *data, - const uint64_t tag_sz, const unsigned use_gfni) +eia3_round16B(void *T, const void *ks, const void *data, const uint64_t tag_sz, + const unsigned use_gfni) { if (use_gfni) asm_Eia3Round16B_gfni_sse(T, ks, data, tag_sz); @@ -80,21 +77,18 @@ eia3_round16B(void *T, const void *ks, const void *data, } static inline void -eia3_remainder(void *T, const void *ks, const void *data, - const uint64_t n_bits, const uint64_t key_size, - const uint64_t tag_size, const unsigned use_gfni) +eia3_remainder(void *T, const void *ks, const void *data, const uint64_t n_bits, + const uint64_t key_size, const uint64_t tag_size, const unsigned use_gfni) { if (use_gfni) - asm_Eia3Remainder_gfni_sse(T, ks, data, n_bits, key_size, - tag_size); + asm_Eia3Remainder_gfni_sse(T, ks, data, n_bits, key_size, tag_size); else - asm_Eia3Remainder_sse(T, ks, data, n_bits, key_size, - tag_size); + asm_Eia3Remainder_sse(T, ks, data, n_bits, key_size, tag_size); } static inline void -keygen_4(ZucState4_t *state, uint32_t **pKeyStrArr, - const uint64_t numKeyStrBytes, const unsigned use_gfni) +keygen_4(ZucState4_t *state, uint32_t **pKeyStrArr, const uint64_t numKeyStrBytes, + const unsigned use_gfni) { if (use_gfni) { if (numKeyStrBytes == 4) @@ -113,12 +107,9 @@ keygen_4(ZucState4_t *state, uint32_t **pKeyStrArr, } } -static inline -void _zuc_eea3_1_buffer_sse(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +static inline void +_zuc_eea3_1_buffer_sse(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t length) { DECLARE_ALIGNED(ZucState_t zucState, 16); DECLARE_ALIGNED(uint8_t keyStream[KEYSTR_ROUND_LEN], 16); @@ -126,7 +117,7 @@ void _zuc_eea3_1_buffer_sse(const void *pKey, uint64_t *pOut64 = NULL, *pKeyStream64 = NULL; uint64_t *pTemp64 = NULL, *pdstTemp64 = NULL; - uint32_t numKeyStreamsPerPkt = length/ KEYSTR_ROUND_LEN; + uint32_t numKeyStreamsPerPkt = length / KEYSTR_ROUND_LEN; const uint32_t numBytesLeftOver = length % KEYSTR_ROUND_LEN; /* initialize the zuc state */ @@ -139,8 +130,7 @@ void _zuc_eea3_1_buffer_sse(const void *pKey, while (numKeyStreamsPerPkt--) { /* Generate the key stream 16 bytes at a time */ - asm_ZucGenKeystream16B_sse((uint32_t *) &keyStream[0], - &zucState); + asm_ZucGenKeystream16B_sse((uint32_t *) &keyStream[0], &zucState); /* XOR The Keystream generated with the input buffer here */ pKeyStream64 = (uint64_t *) keyStream; @@ -158,28 +148,23 @@ void _zuc_eea3_1_buffer_sse(const void *pKey, uint8_t *pOut8 = (uint8_t *) pBufferOut; const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_sse((uint32_t *) &keyStream[0], - &zucState, num4BRounds); + asm_ZucGenKeystream_sse((uint32_t *) &keyStream[0], &zucState, num4BRounds); /* copy the remaining bytes into temporary buffer and XOR with * the 64-bytes of keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], - numBytesLeftOver); + memcpy(&tempSrc[0], &pIn8[length - numBytesLeftOver], numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStream[0]; pTemp64 = (uint64_t *) &tempSrc[0]; pdstTemp64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream16B_sse(pTemp64, pdstTemp64, - pKeyStream64); - memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], - numBytesLeftOver); + asm_XorKeyStream16B_sse(pTemp64, pdstTemp64, pKeyStream64); + memcpy(&pOut8[length - numBytesLeftOver], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); clear_mem(tempDst, sizeof(tempDst)); #endif - } #ifdef SAFE_DATA /* Clear sensitive data in stack */ @@ -188,34 +173,29 @@ void _zuc_eea3_1_buffer_sse(const void *pKey, #endif } -static inline -void _zuc_eea3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - void *pBufferOut[NUM_SSE_BUFS], - const uint32_t length[NUM_SSE_BUFS], - const unsigned use_gfni) +static inline void +_zuc_eea3_4_buffer_sse(const void *const pKey[NUM_SSE_BUFS], const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], void *pBufferOut[NUM_SSE_BUFS], + const uint32_t length[NUM_SSE_BUFS], const unsigned use_gfni) { DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); unsigned int i; /* Calculate the minimum input packet size */ - uint32_t bytes1 = (length[0] < length[1] ? - length[0] : length[1]); - uint32_t bytes2 = (length[2] < length[3] ? - length[2] : length[3]); + uint32_t bytes1 = (length[0] < length[1] ? length[0] : length[1]); + uint32_t bytes2 = (length[2] < length[3] ? length[2] : length[3]); /* min number of bytes */ uint32_t bytes = (bytes1 < bytes2) ? bytes1 : bytes2; - DECLARE_ALIGNED(uint16_t remainBytes[NUM_SSE_BUFS], 16) = {0}; + DECLARE_ALIGNED(uint16_t remainBytes[NUM_SSE_BUFS], 16) = { 0 }; DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); /* structure to store the 4 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_SSE_BUFS*32], 16); + DECLARE_ALIGNED(uint8_t ivs[NUM_SSE_BUFS * 32], 16); const uint8_t *pTempBufInPtr = NULL; uint8_t *pTempBufOutPtr = NULL; - DECLARE_ALIGNED(const uint64_t *pIn64[NUM_SSE_BUFS], 64) = {NULL}; - DECLARE_ALIGNED(uint64_t *pOut64[NUM_SSE_BUFS], 64) = {NULL}; + DECLARE_ALIGNED(const uint64_t *pIn64[NUM_SSE_BUFS], 64) = { NULL }; + DECLARE_ALIGNED(uint64_t * pOut64[NUM_SSE_BUFS], 64) = { NULL }; uint64_t *pKeyStream64 = NULL; /* @@ -225,7 +205,7 @@ void _zuc_eea3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], for (i = 0; i < NUM_SSE_BUFS; i++) { remainBytes[i] = length[i]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } init_4(&keys, ivs, &state, 128, 0, NULL, use_gfni); @@ -237,11 +217,9 @@ void _zuc_eea3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], /* Encrypt common length of all buffers */ if (use_gfni) - asm_ZucCipher_4_gfni_sse(&state, pIn64, pOut64, - remainBytes, (uint16_t) bytes); + asm_ZucCipher_4_gfni_sse(&state, pIn64, pOut64, remainBytes, (uint16_t) bytes); else - asm_ZucCipher_4_sse(&state, pIn64, pOut64, - remainBytes, (uint16_t) bytes); + asm_ZucCipher_4_sse(&state, pIn64, pOut64, remainBytes, (uint16_t) bytes); /* process each packet separately for the remaining bytes */ for (i = 0; i < NUM_SSE_BUFS; i++) { @@ -267,30 +245,22 @@ void _zuc_eea3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], singlePktState.fR1 = state.fR1[i]; singlePktState.fR2 = state.fR2[i]; - uint32_t numKeyStreamsPerPkt = - remainBytes[i] / KEYSTR_ROUND_LEN; - const uint32_t numBytesLeftOver = - remainBytes[i] % KEYSTR_ROUND_LEN; + uint32_t numKeyStreamsPerPkt = remainBytes[i] / KEYSTR_ROUND_LEN; + const uint32_t numBytesLeftOver = remainBytes[i] % KEYSTR_ROUND_LEN; pTempBufInPtr = pBufferIn[i]; pTempBufOutPtr = pBufferOut[i]; /* update the output and input pointers here to point * to the i'th buffers */ - pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - - remainBytes[i]]; - pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - - remainBytes[i]]; + pOut64[0] = (uint64_t *) &pTempBufOutPtr[length[i] - remainBytes[i]]; + pIn64[0] = (const uint64_t *) &pTempBufInPtr[length[i] - remainBytes[i]]; while (numKeyStreamsPerPkt--) { /* Generate the key stream 16 bytes at a time */ - asm_ZucGenKeystream16B_sse( - (uint32_t *) keyStr[0], - &singlePktState); + asm_ZucGenKeystream16B_sse((uint32_t *) keyStr[0], &singlePktState); pKeyStream64 = (uint64_t *) keyStr[0]; - asm_XorKeyStream16B_sse(pIn64[0], - pOut64[0], - pKeyStream64); + asm_XorKeyStream16B_sse(pIn64[0], pOut64[0], pKeyStream64); pIn64[0] += 2; pOut64[0] += 2; } @@ -302,30 +272,23 @@ void _zuc_eea3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], uint64_t *pTempSrc64; uint64_t *pTempDst64; uint32_t offset = length[i] - numBytesLeftOver; - const uint64_t num4BRounds = - ((numBytesLeftOver - 1) / 4) + 1; + const uint64_t num4BRounds = ((numBytesLeftOver - 1) / 4) + 1; - asm_ZucGenKeystream_sse((uint32_t *)&keyStr[0], - &singlePktState, + asm_ZucGenKeystream_sse((uint32_t *) &keyStr[0], &singlePktState, num4BRounds); /* copy the remaining bytes into temporary * buffer and XOR with the 16 bytes of * keystream. Then copy on the valid bytes back * to the output buffer */ - memcpy(&tempSrc[0], &pTempBufInPtr[offset], - numBytesLeftOver); - memset(&tempSrc[numBytesLeftOver], 0, - 16 - numBytesLeftOver); + memcpy(&tempSrc[0], &pTempBufInPtr[offset], numBytesLeftOver); + memset(&tempSrc[numBytesLeftOver], 0, 16 - numBytesLeftOver); pKeyStream64 = (uint64_t *) &keyStr[0][0]; pTempSrc64 = (uint64_t *) &tempSrc[0]; pTempDst64 = (uint64_t *) &tempDst[0]; - asm_XorKeyStream16B_sse(pTempSrc64, - pTempDst64, - pKeyStream64); + asm_XorKeyStream16B_sse(pTempSrc64, pTempDst64, pKeyStream64); - memcpy(&pTempBufOutPtr[offset], - &tempDst[0], numBytesLeftOver); + memcpy(&pTempBufOutPtr[offset], &tempDst[0], numBytesLeftOver); #ifdef SAFE_DATA clear_mem(tempSrc, sizeof(tempSrc)); clear_mem(tempDst, sizeof(tempDst)); @@ -342,11 +305,9 @@ void _zuc_eea3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc_eea3_1_buffer_sse(const void *pKey, - const void *pIv, - const void *pBufferIn, - void *pBufferOut, - const uint32_t length) +void +zuc_eea3_1_buffer_sse(const void *pKey, const void *pIv, const void *pBufferIn, void *pBufferOut, + const uint32_t length) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -377,8 +338,7 @@ void zuc_eea3_1_buffer_sse(const void *pKey, } /* Check input data is in range of supported length */ - if (length < ZUC_MIN_BYTELEN || - length > ZUC_MAX_BYTELEN) { + if (length < ZUC_MIN_BYTELEN || length > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -396,13 +356,10 @@ void zuc_eea3_1_buffer_sse(const void *pKey, #endif } -static inline -void _zuc_eea3_4_buffer(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - void *pBufferOut[NUM_SSE_BUFS], - const uint32_t length[NUM_SSE_BUFS], - const unsigned use_gfni) +static inline void +_zuc_eea3_4_buffer(const void *const pKey[NUM_SSE_BUFS], const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], void *pBufferOut[NUM_SSE_BUFS], + const uint32_t length[NUM_SSE_BUFS], const unsigned use_gfni) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -463,16 +420,14 @@ void _zuc_eea3_4_buffer(const void * const pKey[NUM_SSE_BUFS], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } } #endif - _zuc_eea3_4_buffer_sse(pKey, pIv, pBufferIn, pBufferOut, length, - use_gfni); + _zuc_eea3_4_buffer_sse(pKey, pIv, pBufferIn, pBufferOut, length, use_gfni); #ifdef SAFE_DATA /* Clear sensitive data in registers */ @@ -484,30 +439,27 @@ void _zuc_eea3_4_buffer(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc_eea3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - void *pBufferOut[NUM_SSE_BUFS], - const uint32_t length[NUM_SSE_BUFS]) +void +zuc_eea3_4_buffer_sse(const void *const pKey[NUM_SSE_BUFS], const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], void *pBufferOut[NUM_SSE_BUFS], + const uint32_t length[NUM_SSE_BUFS]) { _zuc_eea3_4_buffer(pKey, pIv, pBufferIn, pBufferOut, length, 0); } -void zuc_eea3_4_buffer_gfni_sse(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - void *pBufferOut[NUM_SSE_BUFS], - const uint32_t length[NUM_SSE_BUFS]) +void +zuc_eea3_4_buffer_gfni_sse(const void *const pKey[NUM_SSE_BUFS], + const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], + void *pBufferOut[NUM_SSE_BUFS], const uint32_t length[NUM_SSE_BUFS]) { _zuc_eea3_4_buffer(pKey, pIv, pBufferIn, pBufferOut, length, 1); } -static inline -void _zuc_eea3_n_buffer(const void * const pKey[], const void * const pIv[], - const void * const pBufferIn[], void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers, - const unsigned use_gfni) +static inline void +_zuc_eea3_n_buffer(const void *const pKey[], const void *const pIv[], const void *const pBufferIn[], + void *pBufferOut[], const uint32_t length[], const uint32_t numBuffers, + const unsigned use_gfni) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -570,8 +522,7 @@ void _zuc_eea3_n_buffer(const void * const pKey[], const void * const pIv[], } /* Check input data is in range of supported length */ - if (length[i] < ZUC_MIN_BYTELEN || - length[i] > ZUC_MAX_BYTELEN) { + if (length[i] < ZUC_MIN_BYTELEN || length[i] > ZUC_MAX_BYTELEN) { imb_set_errno(NULL, IMB_ERR_CIPH_LEN); return; } @@ -581,21 +532,13 @@ void _zuc_eea3_n_buffer(const void * const pKey[], const void * const pIv[], while (packetCount >= NUM_SSE_BUFS) { packetCount -= NUM_SSE_BUFS; - _zuc_eea3_4_buffer(&pKey[i], - &pIv[i], - &pBufferIn[i], - &pBufferOut[i], - &length[i], + _zuc_eea3_4_buffer(&pKey[i], &pIv[i], &pBufferIn[i], &pBufferOut[i], &length[i], use_gfni); i += NUM_SSE_BUFS; } - while(packetCount--) { - _zuc_eea3_1_buffer_sse(pKey[i], - pIv[i], - pBufferIn[i], - pBufferOut[i], - length[i]); + while (packetCount--) { + _zuc_eea3_1_buffer_sse(pKey[i], pIv[i], pBufferIn[i], pBufferOut[i], length[i]); i++; } @@ -609,32 +552,25 @@ void _zuc_eea3_n_buffer(const void * const pKey[], const void * const pIv[], #endif } -void zuc_eea3_n_buffer_sse(const void * const pKey[], const void * const pIv[], - const void * const pBufferIn[], void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers) +void +zuc_eea3_n_buffer_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], const uint32_t length[], + const uint32_t numBuffers) { - _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, length, - numBuffers, 0); + _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, length, numBuffers, 0); } -void zuc_eea3_n_buffer_gfni_sse(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - void *pBufferOut[], - const uint32_t length[], - const uint32_t numBuffers) +void +zuc_eea3_n_buffer_gfni_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], void *pBufferOut[], + const uint32_t length[], const uint32_t numBuffers) { - _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, length, - numBuffers, 1); + _zuc_eea3_n_buffer(pKey, pIv, pBufferIn, pBufferOut, length, numBuffers, 1); } -static inline -void _zuc_eia3_1_buffer_sse(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +static inline void +_zuc_eia3_1_buffer_sse(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { DECLARE_ALIGNED(ZucState_t zucState, 16); DECLARE_ALIGNED(uint32_t keyStream[4 * 2], 64); @@ -651,7 +587,7 @@ void _zuc_eia3_1_buffer_sse(const void *pKey, /* loop over the message bits */ while (remainingBits >= keyStreamLengthInBits) { - remainingBits -= keyStreamLengthInBits; + remainingBits -= keyStreamLengthInBits; /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainingBits) @@ -679,44 +615,41 @@ void _zuc_eia3_1_buffer_sse(const void *pKey, #endif } -static inline -void _zuc_eia3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], - const void * const pIv[NUM_SSE_BUFS], - const void * const pBufferIn[NUM_SSE_BUFS], - const uint32_t lengthInBits[NUM_SSE_BUFS], - uint32_t *pMacI[NUM_SSE_BUFS], - const unsigned use_gfni) +static inline void +_zuc_eia3_4_buffer_sse(const void *const pKey[NUM_SSE_BUFS], const void *const pIv[NUM_SSE_BUFS], + const void *const pBufferIn[NUM_SSE_BUFS], + const uint32_t lengthInBits[NUM_SSE_BUFS], uint32_t *pMacI[NUM_SSE_BUFS], + const unsigned use_gfni) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); /* structure to store the 4 IV's */ - DECLARE_ALIGNED(uint8_t ivs[NUM_SSE_BUFS*32], 16); - const uint8_t *pIn8[NUM_SSE_BUFS] = {NULL}; + DECLARE_ALIGNED(uint8_t ivs[NUM_SSE_BUFS * 32], 16); + const uint8_t *pIn8[NUM_SSE_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t numKeyStr = 0; - uint32_t T[NUM_SSE_BUFS] = {0}; + uint32_t T[NUM_SSE_BUFS] = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_SSE_BUFS], 16) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_SSE_BUFS], 16) = { NULL }; unsigned int allCommonBits; memset(keyStr, 0, sizeof(keyStr)); /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -726,7 +659,7 @@ void _zuc_eia3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], pIn8[i] = (const uint8_t *) pBufferIn[i]; pKeyStrArr[i] = (uint32_t *) &keyStr[i][0]; keys.pKeys[i] = pKey[i]; - memcpy(ivs + i*32, pIv[i], 16); + memcpy(ivs + i * 32, pIv[i], 16); } init_4(&keys, ivs, &state, 128, 0, NULL, use_gfni); @@ -749,17 +682,14 @@ void _zuc_eia3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream 8 bytes or 16 bytes */ if (use_gfni) { if (!remainCommonBits && allCommonBits) - asm_ZucGenKeystream8B_4_gfni_sse(&state, - pKeyStrArr); + asm_ZucGenKeystream8B_4_gfni_sse(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_gfni_sse(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_gfni_sse(&state, pKeyStrArr); } else { if (!remainCommonBits && allCommonBits) asm_ZucGenKeystream8B_4_sse(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_sse(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_sse(&state, pKeyStrArr); } for (i = 0; i < NUM_SSE_BUFS; i++) { eia3_round16B(&T[i], keyStr[i], pIn8[i], 4, use_gfni); @@ -769,14 +699,13 @@ void _zuc_eia3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_SSE_BUFS; i++) { - uint32_t remainBits = lengthInBits[i] - - numKeyStr*keyStreamLengthInBits; + uint32_t remainBits = lengthInBits[i] - numKeyStr * keyStreamLengthInBits; uint32_t *keyStr32 = (uint32_t *) keyStr[i]; /* If remaining bits are more than 8 bytes, we need to generate * at least 8B more of keystream, so we need to copy * the zuc state to single packet state first */ - if (remainBits > (2*32)) { + if (remainBits > (2 * 32)) { singlePktState.lfsrState[0] = state.lfsrState[0][i]; singlePktState.lfsrState[1] = state.lfsrState[1][i]; singlePktState.lfsrState[2] = state.lfsrState[2][i]; @@ -803,11 +732,9 @@ void _zuc_eia3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream 8 bytes or 16 bytes */ if (!remainBits) - asm_ZucGenKeystream8B_sse(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_sse(&keyStr32[4], &singlePktState); else - asm_ZucGenKeystream16B_sse(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream16B_sse(&keyStr32[4], &singlePktState); eia3_round16B(&T[i], keyStr32, pIn8[i], 4, use_gfni); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } @@ -817,11 +744,9 @@ void _zuc_eia3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], * keystream needs to have up to another 2 ZUC WORDS (8B) */ if (remainBits > (2 * 32)) - asm_ZucGenKeystream8B_sse(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream8B_sse(&keyStr32[4], &singlePktState); - eia3_remainder(&T[i], keyStr32, pIn8[i], remainBits, - 128, 4, use_gfni); + eia3_remainder(&T[i], keyStr32, pIn8[i], remainBits, 128, 4, use_gfni); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; } @@ -835,11 +760,9 @@ void _zuc_eia3_4_buffer_sse(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc_eia3_1_buffer_sse(const void *pKey, - const void *pIv, - const void *pBufferIn, - const uint32_t lengthInBits, - uint32_t *pMacI) +void +zuc_eia3_1_buffer_sse(const void *pKey, const void *pIv, const void *pBufferIn, + const uint32_t lengthInBits, uint32_t *pMacI) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -887,43 +810,39 @@ void zuc_eia3_1_buffer_sse(const void *pKey, #endif } -static inline -void _zuc_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_SSE_BUFS], - uint32_t *pMacI[NUM_SSE_BUFS], - const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS], - const unsigned use_gfni) +static inline void +_zuc_eia3_4_buffer_job(const void *const pKey[NUM_SSE_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_SSE_BUFS], uint32_t *pMacI[NUM_SSE_BUFS], + const uint16_t lengthInBits[NUM_SSE_BUFS], + const void *const job_in_lane[NUM_SSE_BUFS], const unsigned use_gfni) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); - const uint8_t *pIn8[NUM_SSE_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_SSE_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t dataDigested = 0; - uint32_t T[NUM_SSE_BUFS] = {0}; + uint32_t T[NUM_SSE_BUFS] = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_SSE_BUFS], 16) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_SSE_BUFS], 16) = { NULL }; unsigned int allCommonBits; memset(keyStr, 0, sizeof(keyStr)); /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -955,18 +874,14 @@ void _zuc_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream 8 bytes or 16 bytes */ if (use_gfni) { if (!remainCommonBits && allCommonBits) - asm_ZucGenKeystream8B_4_gfni_sse(&state, - pKeyStrArr); + asm_ZucGenKeystream8B_4_gfni_sse(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_gfni_sse(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_gfni_sse(&state, pKeyStrArr); } else { if (!remainCommonBits && allCommonBits) - asm_ZucGenKeystream8B_4_sse(&state, - pKeyStrArr); + asm_ZucGenKeystream8B_4_sse(&state, pKeyStrArr); else - asm_ZucGenKeystream16B_4_sse(&state, - pKeyStrArr); + asm_ZucGenKeystream16B_4_sse(&state, pKeyStrArr); } for (i = 0; i < NUM_SSE_BUFS; i++) { if (job_in_lane[i] == NULL) @@ -1018,12 +933,10 @@ void _zuc_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], remainBits -= keyStreamLengthInBits; /* Generate the next key stream (16 bytes max) */ if (L > 3) { - asm_ZucGenKeystream16B_sse(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream16B_sse(&keyStr32[4], &singlePktState); L -= 4; } else { - asm_ZucGenKeystream_sse(&keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_sse(&keyStr32[4], &singlePktState, L); L = 0; } eia3_round16B(&T[i], keyStr32, pIn8[i], 4, use_gfni); @@ -1032,11 +945,9 @@ void _zuc_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], /* Generate final keystream if needed */ if (L > 0) - asm_ZucGenKeystream_sse(&keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_sse(&keyStr32[4], &singlePktState, L); - eia3_remainder(&T[i], keyStr32, pIn8[i], remainBits, - 128, 4, use_gfni); + eia3_remainder(&T[i], keyStr32, pIn8[i], remainBits, 128, 4, use_gfni); /* save the final MAC-I result */ *(pMacI[i]) = T[i]; } @@ -1050,66 +961,60 @@ void _zuc_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc_eia3_4_buffer_job_no_gfni_sse(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_SSE_BUFS], +void +zuc_eia3_4_buffer_job_no_gfni_sse(const void *const pKey[NUM_SSE_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_SSE_BUFS], uint32_t *pMacI[NUM_SSE_BUFS], const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS]) + const void *const job_in_lane[NUM_SSE_BUFS]) { - _zuc_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, 0); + _zuc_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, 0); } -void zuc_eia3_4_buffer_job_gfni_sse(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_SSE_BUFS], - uint32_t *pMacI[NUM_SSE_BUFS], - const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS]) +void +zuc_eia3_4_buffer_job_gfni_sse(const void *const pKey[NUM_SSE_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_SSE_BUFS], + uint32_t *pMacI[NUM_SSE_BUFS], + const uint16_t lengthInBits[NUM_SSE_BUFS], + const void *const job_in_lane[NUM_SSE_BUFS]) { - _zuc_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, 1); + _zuc_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, 1); } -static inline -void _zuc256_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *ivs, - const void * const pBufferIn[NUM_SSE_BUFS], - void *pMacI[NUM_SSE_BUFS], - const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS], - const uint64_t tag_size, - const unsigned use_gfni) +static inline void +_zuc256_eia3_4_buffer_job(const void *const pKey[NUM_SSE_BUFS], const uint8_t *ivs, + const void *const pBufferIn[NUM_SSE_BUFS], void *pMacI[NUM_SSE_BUFS], + const uint16_t lengthInBits[NUM_SSE_BUFS], + const void *const job_in_lane[NUM_SSE_BUFS], const uint64_t tag_size, + const unsigned use_gfni) { unsigned int i; DECLARE_ALIGNED(ZucState4_t state, 64); DECLARE_ALIGNED(ZucState_t singlePktState, 64); - DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2*KEYSTR_ROUND_LEN], 64); + DECLARE_ALIGNED(uint8_t keyStr[NUM_SSE_BUFS][2 * KEYSTR_ROUND_LEN], 64); /* structure to store the 4 keys */ DECLARE_ALIGNED(ZucKey4_t keys, 64); - const uint8_t *pIn8[NUM_SSE_BUFS] = {NULL}; + const uint8_t *pIn8[NUM_SSE_BUFS] = { NULL }; uint32_t remainCommonBits; uint32_t dataDigested = 0; - DECLARE_ALIGNED(uint8_t T[NUM_SSE_BUFS*16], 16) = {0}; + DECLARE_ALIGNED(uint8_t T[NUM_SSE_BUFS * 16], 16) = { 0 }; const uint32_t keyStreamLengthInBits = KEYSTR_ROUND_LEN * 8; - DECLARE_ALIGNED(uint32_t *pKeyStrArr[NUM_SSE_BUFS], 16) = {NULL}; + DECLARE_ALIGNED(uint32_t * pKeyStrArr[NUM_SSE_BUFS], 16) = { NULL }; unsigned int allCommonBits; memset(keyStr, 0, sizeof(keyStr)); /* Check if all lengths are equal */ - if ((lengthInBits[0] == lengthInBits[1]) && - (lengthInBits[0] == lengthInBits[2]) && + if ((lengthInBits[0] == lengthInBits[1]) && (lengthInBits[0] == lengthInBits[2]) && (lengthInBits[0] == lengthInBits[3])) { remainCommonBits = lengthInBits[0]; allCommonBits = 1; } else { /* Calculate the minimum input packet size */ - uint32_t bits1 = (lengthInBits[0] < lengthInBits[1] ? - lengthInBits[0] : lengthInBits[1]); - uint32_t bits2 = (lengthInBits[2] < lengthInBits[3] ? - lengthInBits[2] : lengthInBits[3]); + uint32_t bits1 = + (lengthInBits[0] < lengthInBits[1] ? lengthInBits[0] : lengthInBits[1]); + uint32_t bits2 = + (lengthInBits[2] < lengthInBits[3] ? lengthInBits[2] : lengthInBits[3]); remainCommonBits = (bits1 < bits2) ? bits1 : bits2; allCommonBits = 0; @@ -1139,19 +1044,18 @@ void _zuc256_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], keygen_4(&state, pKeyStrArr, 16, use_gfni); for (i = 0; i < NUM_SSE_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; - eia3_round16B(tag, keyStr[i], pIn8[i], tag_size, - use_gfni); + eia3_round16B(tag, keyStr[i], pIn8[i], tag_size, use_gfni); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } } /* Process each packet separately for the remaining bits */ for (i = 0; i < NUM_SSE_BUFS; i++) { - void *tag = (void *) &T[i*tag_size]; + void *tag = (void *) &T[i * tag_size]; if (job_in_lane[i] == NULL) continue; @@ -1193,26 +1097,21 @@ void _zuc256_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], /* Generate the next key stream (16 bytes max) */ if (L > 3) { - asm_ZucGenKeystream16B_sse(&keyStr32[4], - &singlePktState); + asm_ZucGenKeystream16B_sse(&keyStr32[4], &singlePktState); L -= 4; } else { - asm_ZucGenKeystream_sse(&keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_sse(&keyStr32[4], &singlePktState, L); L = 0; } - eia3_round16B(tag, keyStr32, pIn8[i], - tag_size, use_gfni); + eia3_round16B(tag, keyStr32, pIn8[i], tag_size, use_gfni); pIn8[i] = &pIn8[i][KEYSTR_ROUND_LEN]; } /* Generate final keystream if needed */ if (L > 0) - asm_ZucGenKeystream_sse(&keyStr32[4], - &singlePktState, L); + asm_ZucGenKeystream_sse(&keyStr32[4], &singlePktState, L); - eia3_remainder(tag, keyStr32, pIn8[i], remainBits, - 256, tag_size, use_gfni); + eia3_remainder(tag, keyStr32, pIn8[i], remainBits, 256, tag_size, use_gfni); /* save the final MAC-I result */ memcpy(pMacI[i], tag, tag_size); } @@ -1226,38 +1125,34 @@ void _zuc256_eia3_4_buffer_job(const void * const pKey[NUM_SSE_BUFS], #endif } -void zuc256_eia3_4_buffer_job_no_gfni_sse(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_SSE_BUFS], - void *pMacI[NUM_SSE_BUFS], - const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS], - const uint64_t tag_size) +void +zuc256_eia3_4_buffer_job_no_gfni_sse(const void *const pKey[NUM_SSE_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_SSE_BUFS], + void *pMacI[NUM_SSE_BUFS], + const uint16_t lengthInBits[NUM_SSE_BUFS], + const void *const job_in_lane[NUM_SSE_BUFS], + const uint64_t tag_size) { - _zuc256_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, tag_size, 0); + _zuc256_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, tag_size, + 0); } -void zuc256_eia3_4_buffer_job_gfni_sse(const void * const pKey[NUM_SSE_BUFS], - const uint8_t *pIv, - const void * const pBufferIn[NUM_SSE_BUFS], +void +zuc256_eia3_4_buffer_job_gfni_sse(const void *const pKey[NUM_SSE_BUFS], const uint8_t *pIv, + const void *const pBufferIn[NUM_SSE_BUFS], void *pMacI[NUM_SSE_BUFS], const uint16_t lengthInBits[NUM_SSE_BUFS], - const void * const job_in_lane[NUM_SSE_BUFS], + const void *const job_in_lane[NUM_SSE_BUFS], const uint64_t tag_size) { - _zuc256_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, - job_in_lane, tag_size, 1); + _zuc256_eia3_4_buffer_job(pKey, pIv, pBufferIn, pMacI, lengthInBits, job_in_lane, tag_size, + 1); } -static inline -void _zuc_eia3_n_buffer_sse(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers, - const unsigned use_gfni) +static inline void +_zuc_eia3_n_buffer_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers, const unsigned use_gfni) { #ifndef LINUX DECLARE_ALIGNED(imb_uint128_t xmm_save[10], 16); @@ -1320,8 +1215,7 @@ void _zuc_eia3_n_buffer_sse(const void * const pKey[], } /* Check input data is in range of supported length */ - if (lengthInBits[i] < ZUC_MIN_BITLEN || - lengthInBits[i] > ZUC_MAX_BITLEN) { + if (lengthInBits[i] < ZUC_MIN_BITLEN || lengthInBits[i] > ZUC_MAX_BITLEN) { imb_set_errno(NULL, IMB_ERR_AUTH_LEN); return; } @@ -1329,23 +1223,15 @@ void _zuc_eia3_n_buffer_sse(const void * const pKey[], #endif i = 0; - while(packetCount >= 4) { - packetCount -=4; - _zuc_eia3_4_buffer_sse(&pKey[i], - &pIv[i], - &pBufferIn[i], - &lengthInBits[i], - &pMacI[i], - use_gfni); - i+=4; + while (packetCount >= 4) { + packetCount -= 4; + _zuc_eia3_4_buffer_sse(&pKey[i], &pIv[i], &pBufferIn[i], &lengthInBits[i], + &pMacI[i], use_gfni); + i += 4; } - while(packetCount--) { - _zuc_eia3_1_buffer_sse(pKey[i], - pIv[i], - pBufferIn[i], - lengthInBits[i], - pMacI[i]); + while (packetCount--) { + _zuc_eia3_1_buffer_sse(pKey[i], pIv[i], pBufferIn[i], lengthInBits[i], pMacI[i]); i++; } @@ -1359,24 +1245,18 @@ void _zuc_eia3_n_buffer_sse(const void * const pKey[], #endif } -void zuc_eia3_n_buffer_sse(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers) +void +zuc_eia3_n_buffer_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers) { - _zuc_eia3_n_buffer_sse(pKey, pIv, pBufferIn, lengthInBits, - pMacI, numBuffers, 0); + _zuc_eia3_n_buffer_sse(pKey, pIv, pBufferIn, lengthInBits, pMacI, numBuffers, 0); } -void zuc_eia3_n_buffer_gfni_sse(const void * const pKey[], - const void * const pIv[], - const void * const pBufferIn[], - const uint32_t lengthInBits[], - uint32_t *pMacI[], - const uint32_t numBuffers) +void +zuc_eia3_n_buffer_gfni_sse(const void *const pKey[], const void *const pIv[], + const void *const pBufferIn[], const uint32_t lengthInBits[], + uint32_t *pMacI[], const uint32_t numBuffers) { - _zuc_eia3_n_buffer_sse(pKey, pIv, pBufferIn, lengthInBits, - pMacI, numBuffers, 1); + _zuc_eia3_n_buffer_sse(pKey, pIv, pBufferIn, lengthInBits, pMacI, numBuffers, 1); } diff --git a/lib/sse_t2/mb_mgr_sse_t2.c b/lib/sse_t2/mb_mgr_sse_t2.c index 3f598115..eaaf9515 100644 --- a/lib/sse_t2/mb_mgr_sse_t2.c +++ b/lib/sse_t2/mb_mgr_sse_t2.c @@ -52,29 +52,29 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms -#define RESTORE_XMMS restore_xmms +#define SAVE_XMMS save_xmms +#define RESTORE_XMMS restore_xmms /* JOB API */ -#define SUBMIT_JOB submit_job_sse_t2 -#define FLUSH_JOB flush_job_sse_t2 -#define QUEUE_SIZE queue_size_sse_t2 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_t2 -#define GET_NEXT_JOB get_next_job_sse_t2 -#define GET_COMPLETED_JOB get_completed_job_sse_t2 -#define GET_NEXT_BURST get_next_burst_sse_t2 -#define SUBMIT_BURST submit_burst_sse_t2 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_t2 -#define FLUSH_BURST flush_burst_sse_t2 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_t2 +#define SUBMIT_JOB submit_job_sse_t2 +#define FLUSH_JOB flush_job_sse_t2 +#define QUEUE_SIZE queue_size_sse_t2 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_t2 +#define GET_NEXT_JOB get_next_job_sse_t2 +#define GET_COMPLETED_JOB get_completed_job_sse_t2 +#define GET_NEXT_BURST get_next_burst_sse_t2 +#define SUBMIT_BURST submit_burst_sse_t2 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_t2 +#define FLUSH_BURST flush_burst_sse_t2 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_t2 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_sse_t2 -#define SUBMIT_HASH_BURST submit_hash_burst_sse_t2 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_t2 -#define SET_SUITE_ID_FN set_suite_id_sse_t2 +#define SUBMIT_HASH_BURST submit_hash_burst_sse_t2 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_t2 +#define SET_SUITE_ID_FN set_suite_id_sse_t2 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE_T2 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE_T2 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE_T2 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE_T2 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_SSE_T2 @@ -82,12 +82,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_SSE_T2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse #define SUBMIT_JOB_AES_GCM_DEC submit_job_aes_gcm_dec_sse #define SUBMIT_JOB_AES_GCM_ENC submit_job_aes_gcm_enc_sse @@ -105,9 +105,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_sse #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_sse -#define AES_CBC_DEC_128 aes_cbc_dec_128_sse -#define AES_CBC_DEC_192 aes_cbc_dec_192_sse -#define AES_CBC_DEC_256 aes_cbc_dec_256_sse +#define AES_CBC_DEC_128 aes_cbc_dec_128_sse +#define AES_CBC_DEC_192 aes_cbc_dec_192_sse +#define AES_CBC_DEC_256 aes_cbc_dec_256_sse /* AES-CBCS */ #define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_sse @@ -123,45 +123,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_sse #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_sse -#define AES_ECB_ENC_128 aes_ecb_enc_128_by4_sse -#define AES_ECB_ENC_192 aes_ecb_enc_192_by4_sse -#define AES_ECB_ENC_256 aes_ecb_enc_256_by4_sse -#define AES_ECB_DEC_128 aes_ecb_dec_128_by4_sse -#define AES_ECB_DEC_192 aes_ecb_dec_192_by4_sse -#define AES_ECB_DEC_256 aes_ecb_dec_256_by4_sse +#define AES_ECB_ENC_128 aes_ecb_enc_128_by4_sse +#define AES_ECB_ENC_192 aes_ecb_enc_192_by4_sse +#define AES_ECB_ENC_256 aes_ecb_enc_256_by4_sse +#define AES_ECB_DEC_128 aes_ecb_dec_128_by4_sse +#define AES_ECB_DEC_192 aes_ecb_dec_192_by4_sse +#define AES_ECB_DEC_256 aes_ecb_dec_256_by4_sse /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_sse -#define AES_CTR_192 aes_cntr_192_sse -#define AES_CTR_256 aes_cntr_256_sse -#define AES_CTR_128_BIT aes_cntr_bit_128_sse -#define AES_CTR_192_BIT aes_cntr_bit_192_sse -#define AES_CTR_256_BIT aes_cntr_bit_256_sse +#define AES_CTR_128 aes_cntr_128_sse +#define AES_CTR_192 aes_cntr_192_sse +#define AES_CTR_256 aes_cntr_256_sse +#define AES_CTR_128_BIT aes_cntr_bit_128_sse +#define AES_CTR_192_BIT aes_cntr_bit_192_sse +#define AES_CTR_256_BIT aes_cntr_bit_256_sse /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_sse -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_sse +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_sse +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_sse -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_sse -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_sse +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_sse +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_sse /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_sse -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_sse +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_sse +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_sse -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_sse -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_sse +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_sse +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_sse /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_sse -#define AES_CFB_256_ONE aes_cfb_256_one_sse +#define AES_CFB_128_ONE aes_cfb_128_one_sse +#define AES_CFB_256_ONE aes_cfb_256_one_sse /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_sse @@ -170,30 +170,30 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_sse /* SHA1/224/256/384/512 */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_ni_sse -#define FLUSH_JOB_SHA1 flush_job_sha1_ni_sse -#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse -#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse -#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse -#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse -#define SUBMIT_JOB_SHA384 submit_job_sha384_sse -#define FLUSH_JOB_SHA384 flush_job_sha384_sse -#define SUBMIT_JOB_SHA512 submit_job_sha512_sse -#define FLUSH_JOB_SHA512 flush_job_sha512_sse +#define SUBMIT_JOB_SHA1 submit_job_sha1_ni_sse +#define FLUSH_JOB_SHA1 flush_job_sha1_ni_sse +#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse +#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse +#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse +#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse +#define SUBMIT_JOB_SHA384 submit_job_sha384_sse +#define FLUSH_JOB_SHA384 flush_job_sha384_sse +#define SUBMIT_JOB_SHA512 submit_job_sha512_sse +#define FLUSH_JOB_SHA512 flush_job_sha512_sse /* HMAC-SHA1/224/256/384/512/MD5 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_ni_sse -#define FLUSH_JOB_HMAC flush_job_hmac_ni_sse -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse +#define SUBMIT_JOB_HMAC submit_job_hmac_ni_sse +#define FLUSH_JOB_HMAC flush_job_hmac_ni_sse +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse /* DES & 3DES */ @@ -210,14 +210,14 @@ #define POLY1305_MAC poly1305_mac_scalar /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_no_gfni_sse -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_no_gfni_sse -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_no_gfni_sse -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_no_gfni_sse -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_no_gfni_sse -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_no_gfni_sse -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_no_gfni_sse -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_no_gfni_sse +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_no_gfni_sse +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_no_gfni_sse +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_no_gfni_sse +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_no_gfni_sse +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_no_gfni_sse +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_no_gfni_sse +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_no_gfni_sse +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_no_gfni_sse /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_sse @@ -229,8 +229,7 @@ submit_snow3g_uea2_job_sse(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -255,7 +254,8 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) /* ====================================================================== */ -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 4); @@ -284,12 +284,10 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, 2); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, SSE_NUM_MD5_LANES); @@ -351,90 +349,90 @@ init_mb_mgr_sse_t2_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_sse; - state->keyexp_192 = aes_keyexp_192_sse; - state->keyexp_256 = aes_keyexp_256_sse; + state->keyexp_128 = aes_keyexp_128_sse; + state->keyexp_192 = aes_keyexp_192_sse; + state->keyexp_256 = aes_keyexp_256_sse; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_sse; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_sse; - state->xcbc_keyexp = aes_xcbc_expand_key_sse; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_sse_shani; - state->sha1 = sha1_sse_shani; - state->sha224_one_block = sha224_one_block_sse_shani; - state->sha224 = sha224_sse_shani; - state->sha256_one_block = sha256_one_block_sse_shani; - state->sha256 = sha256_sse_shani; - state->sha384_one_block = sha384_one_block_sse; - state->sha384 = sha384_sse; - state->sha512_one_block = sha512_one_block_sse; - state->sha512 = sha512_sse; - state->md5_one_block = md5_one_block_sse; - - state->aes128_cfb_one = aes_cfb_128_one_sse; - state->aes256_cfb_one = aes_cfb_256_one_sse; - - state->eea3_1_buffer = zuc_eea3_1_buffer_sse; - state->eea3_4_buffer = zuc_eea3_4_buffer_sse; - state->eea3_n_buffer = zuc_eea3_n_buffer_sse; - state->eia3_n_buffer = zuc_eia3_n_buffer_sse; - state->eia3_1_buffer = zuc_eia3_1_buffer_sse; - - state->f8_1_buffer = kasumi_f8_1_buffer_sse; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; - state->f8_2_buffer = kasumi_f8_2_buffer_sse; - state->f8_3_buffer = kasumi_f8_3_buffer_sse; - state->f8_4_buffer = kasumi_f8_4_buffer_sse; - state->f8_n_buffer = kasumi_f8_n_buffer_sse; - state->f9_1_buffer = kasumi_f9_1_buffer_sse; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; + state->xcbc_keyexp = aes_xcbc_expand_key_sse; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_sse_shani; + state->sha1 = sha1_sse_shani; + state->sha224_one_block = sha224_one_block_sse_shani; + state->sha224 = sha224_sse_shani; + state->sha256_one_block = sha256_one_block_sse_shani; + state->sha256 = sha256_sse_shani; + state->sha384_one_block = sha384_one_block_sse; + state->sha384 = sha384_sse; + state->sha512_one_block = sha512_one_block_sse; + state->sha512 = sha512_sse; + state->md5_one_block = md5_one_block_sse; + + state->aes128_cfb_one = aes_cfb_128_one_sse; + state->aes256_cfb_one = aes_cfb_256_one_sse; + + state->eea3_1_buffer = zuc_eea3_1_buffer_sse; + state->eea3_4_buffer = zuc_eea3_4_buffer_sse; + state->eea3_n_buffer = zuc_eea3_n_buffer_sse; + state->eia3_n_buffer = zuc_eia3_n_buffer_sse; + state->eia3_1_buffer = zuc_eia3_1_buffer_sse; + + state->f8_1_buffer = kasumi_f8_1_buffer_sse; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; + state->f8_2_buffer = kasumi_f8_2_buffer_sse; + state->f8_3_buffer = kasumi_f8_3_buffer_sse; + state->f8_4_buffer = kasumi_f8_4_buffer_sse; + state->f8_n_buffer = kasumi_f8_n_buffer_sse; + state->f9_1_buffer = kasumi_f9_1_buffer_sse; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_sse; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_sse; state->kasumi_key_sched_size = kasumi_key_sched_size_sse; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_sse; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_sse; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_sse; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_sse; state->snow3g_init_key_sched = snow3g_init_key_sched_sse; state->snow3g_key_sched_size = snow3g_key_sched_size_sse; - state->hec_32 = hec_32_sse; - state->hec_64 = hec_64_sse; - - state->crc32_ethernet_fcs = ethernet_fcs_sse; - state->crc16_x25 = crc16_x25_sse; - state->crc32_sctp = crc32_sctp_sse; - state->crc24_lte_a = crc24_lte_a_sse; - state->crc24_lte_b = crc24_lte_b_sse; - state->crc16_fp_data = crc16_fp_data_sse; - state->crc11_fp_header = crc11_fp_header_sse; - state->crc7_fp_header = crc7_fp_header_sse; - state->crc10_iuup_data = crc10_iuup_data_sse; - state->crc6_iuup_header = crc6_iuup_header_sse; + state->hec_32 = hec_32_sse; + state->hec_64 = hec_64_sse; + + state->crc32_ethernet_fcs = ethernet_fcs_sse; + state->crc16_x25 = crc16_x25_sse; + state->crc32_sctp = crc32_sctp_sse; + state->crc24_lte_a = crc24_lte_a_sse; + state->crc24_lte_b = crc24_lte_b_sse; + state->crc16_fp_data = crc16_fp_data_sse; + state->crc11_fp_header = crc11_fp_header_sse; + state->crc7_fp_header = crc7_fp_header_sse; + state->crc10_iuup_data = crc10_iuup_data_sse; + state->crc6_iuup_header = crc6_iuup_header_sse; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_sse; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_sse; @@ -443,55 +441,55 @@ init_mb_mgr_sse_t2_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_sse; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_sse; - state->gcm128_enc = aes_gcm_enc_128_sse; - state->gcm192_enc = aes_gcm_enc_192_sse; - state->gcm256_enc = aes_gcm_enc_256_sse; - state->gcm128_dec = aes_gcm_dec_128_sse; - state->gcm192_dec = aes_gcm_dec_192_sse; - state->gcm256_dec = aes_gcm_dec_256_sse; - state->gcm128_init = aes_gcm_init_128_sse; - state->gcm192_init = aes_gcm_init_192_sse; - state->gcm256_init = aes_gcm_init_256_sse; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; - state->gcm128_enc_update = aes_gcm_enc_128_update_sse; - state->gcm192_enc_update = aes_gcm_enc_192_update_sse; - state->gcm256_enc_update = aes_gcm_enc_256_update_sse; - state->gcm128_dec_update = aes_gcm_dec_128_update_sse; - state->gcm192_dec_update = aes_gcm_dec_192_update_sse; - state->gcm256_dec_update = aes_gcm_dec_256_update_sse; + state->gcm128_enc = aes_gcm_enc_128_sse; + state->gcm192_enc = aes_gcm_enc_192_sse; + state->gcm256_enc = aes_gcm_enc_256_sse; + state->gcm128_dec = aes_gcm_dec_128_sse; + state->gcm192_dec = aes_gcm_dec_192_sse; + state->gcm256_dec = aes_gcm_dec_256_sse; + state->gcm128_init = aes_gcm_init_128_sse; + state->gcm192_init = aes_gcm_init_192_sse; + state->gcm256_init = aes_gcm_init_256_sse; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; + state->gcm128_enc_update = aes_gcm_enc_128_update_sse; + state->gcm192_enc_update = aes_gcm_enc_192_update_sse; + state->gcm256_enc_update = aes_gcm_enc_256_update_sse; + state->gcm128_dec_update = aes_gcm_dec_128_update_sse; + state->gcm192_dec_update = aes_gcm_dec_192_update_sse; + state->gcm256_dec_update = aes_gcm_dec_256_update_sse; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_sse; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_sse; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_sse; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_sse; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_sse; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_sse; - state->gcm128_precomp = aes_gcm_precomp_128_sse; - state->gcm192_precomp = aes_gcm_precomp_192_sse; - state->gcm256_precomp = aes_gcm_precomp_256_sse; - state->gcm128_pre = aes_gcm_pre_128_sse; - state->gcm192_pre = aes_gcm_pre_192_sse; - state->gcm256_pre = aes_gcm_pre_256_sse; - - state->ghash = ghash_sse; - state->ghash_pre = ghash_pre_sse; - - state->gmac128_init = imb_aes_gmac_init_128_sse; - state->gmac192_init = imb_aes_gmac_init_192_sse; - state->gmac256_init = imb_aes_gmac_init_256_sse; - state->gmac128_update = imb_aes_gmac_update_128_sse; - state->gmac192_update = imb_aes_gmac_update_192_sse; - state->gmac256_update = imb_aes_gmac_update_256_sse; - state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; - state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; - state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; + state->gcm128_precomp = aes_gcm_precomp_128_sse; + state->gcm192_precomp = aes_gcm_precomp_192_sse; + state->gcm256_precomp = aes_gcm_precomp_256_sse; + state->gcm128_pre = aes_gcm_pre_128_sse; + state->gcm192_pre = aes_gcm_pre_192_sse; + state->gcm256_pre = aes_gcm_pre_256_sse; + + state->ghash = ghash_sse; + state->ghash_pre = ghash_pre_sse; + + state->gmac128_init = imb_aes_gmac_init_128_sse; + state->gmac192_init = imb_aes_gmac_init_192_sse; + state->gmac256_init = imb_aes_gmac_init_256_sse; + state->gmac128_update = imb_aes_gmac_update_128_sse; + state->gmac192_update = imb_aes_gmac_update_192_sse; + state->gmac256_update = imb_aes_gmac_update_256_sse; + state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; + state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; + state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t2/sha_ni_mb_sse.c b/lib/sse_t2/sha_ni_mb_sse.c index b872a5ab..20880dd2 100644 --- a/lib/sse_t2/sha_ni_mb_sse.c +++ b/lib/sse_t2/sha_ni_mb_sse.c @@ -34,19 +34,19 @@ */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 2, 1, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_ni_x2_sse_from_c, 1); + return submit_flush_job_sha_1(state, job, 2, 1, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_ni_x2_sse_from_c, 1); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_1(state, job, 2, 0, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, - call_sha1_ni_x2_sse_from_c, 1); + return submit_flush_job_sha_1(state, job, 2, 0, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE, + call_sha1_ni_x2_sse_from_c, 1); } /* ========================================================================== */ @@ -55,19 +55,19 @@ IMB_JOB *flush_job_sha1_ni_sse(MB_MGR_SHA_1_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 2, 1, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha256_ni_x2_sse_from_c, 1); + return submit_flush_job_sha_256(state, job, 2, 1, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha256_ni_x2_sse_from_c, 1); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 2, 0, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE, - call_sha256_ni_x2_sse_from_c, 1); + return submit_flush_job_sha_256(state, job, 2, 0, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE, call_sha256_ni_x2_sse_from_c, 1); } /* ========================================================================== */ @@ -76,17 +76,17 @@ IMB_JOB *flush_job_sha224_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) */ IMB_DLL_LOCAL -IMB_JOB *submit_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +submit_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 2, 1, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha256_ni_x2_sse_from_c, 1); + return submit_flush_job_sha_256(state, job, 2, 1, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha256_ni_x2_sse_from_c, 1); } IMB_DLL_LOCAL -IMB_JOB *flush_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) +IMB_JOB * +flush_job_sha256_ni_sse(MB_MGR_SHA_256_OOO *state, IMB_JOB *job) { - return submit_flush_job_sha_256(state, job, 2, 0, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE, - call_sha256_ni_x2_sse_from_c, 1); + return submit_flush_job_sha_256(state, job, 2, 0, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE, call_sha256_ni_x2_sse_from_c, 1); } diff --git a/lib/sse_t2/sha_ni_sse.c b/lib/sse_t2/sha_ni_sse.c index b3efb20e..17c31010 100644 --- a/lib/sse_t2/sha_ni_sse.c +++ b/lib/sse_t2/sha_ni_sse.c @@ -31,14 +31,16 @@ /* ========================================================================== */ /* One block SHA1 computation for IPAD / OPAD usage only */ -void sha1_one_block_sse_shani(const void *data, void *digest) +void +sha1_one_block_sse_shani(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE_SHANI, 1 /* SHA1 */); } /* ========================================================================== */ /* One block SHA224 computation for IPAD / OPAD usage only */ -void sha224_one_block_sse_shani(const void *data, void *digest) +void +sha224_one_block_sse_shani(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE_SHANI, 224 /* SHA224 */); } @@ -46,7 +48,8 @@ void sha224_one_block_sse_shani(const void *data, void *digest) /* ========================================================================== */ /* ========================================================================== */ /* One block SHA256 computation for IPAD / OPAD usage only */ -void sha256_one_block_sse_shani(const void *data, void *digest) +void +sha256_one_block_sse_shani(const void *data, void *digest) { sha_generic_1block(data, digest, ARCH_SSE_SHANI, 256 /* SHA256 */); } @@ -56,27 +59,29 @@ void sha256_one_block_sse_shani(const void *data, void *digest) * SHA1 API for use in HMAC-SHA1 when key is longer than the block size */ -void sha1_sse_shani(const void *data, const uint64_t length, void *digest) +void +sha1_sse_shani(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE_SHANI, 1, - IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE_SHANI, 1, IMB_SHA1_BLOCK_SIZE, SHA1_PAD_SIZE); } /* ========================================================================== */ /* * SHA224 API for use in HMAC-SHA224 when key is longer than the block size */ -void sha224_sse_shani(const void *data, const uint64_t length, void *digest) +void +sha224_sse_shani(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE_SHANI, 224, - IMB_SHA_256_BLOCK_SIZE, SHA224_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE_SHANI, 224, IMB_SHA_256_BLOCK_SIZE, + SHA224_PAD_SIZE); } /* ========================================================================== */ /* * SHA256 API for use in HMAC-SHA256 when key is longer than the block size */ -void sha256_sse_shani(const void *data, const uint64_t length, void *digest) +void +sha256_sse_shani(const void *data, const uint64_t length, void *digest) { - sha_generic(data, length, digest, ARCH_SSE_SHANI, 256, - IMB_SHA_256_BLOCK_SIZE, SHA256_PAD_SIZE); + sha_generic(data, length, digest, ARCH_SSE_SHANI, 256, IMB_SHA_256_BLOCK_SIZE, + SHA256_PAD_SIZE); } diff --git a/lib/sse_t3/mb_mgr_sse_t3.c b/lib/sse_t3/mb_mgr_sse_t3.c index 31a61d40..16ae2375 100644 --- a/lib/sse_t3/mb_mgr_sse_t3.c +++ b/lib/sse_t3/mb_mgr_sse_t3.c @@ -53,29 +53,29 @@ #include "include/ooo_mgr_reset.h" -#define SAVE_XMMS save_xmms -#define RESTORE_XMMS restore_xmms +#define SAVE_XMMS save_xmms +#define RESTORE_XMMS restore_xmms /* JOB API */ -#define SUBMIT_JOB submit_job_sse_t3 -#define FLUSH_JOB flush_job_sse_t3 -#define QUEUE_SIZE queue_size_sse_t3 -#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_t3 -#define GET_NEXT_JOB get_next_job_sse_t3 -#define GET_COMPLETED_JOB get_completed_job_sse_t3 -#define GET_NEXT_BURST get_next_burst_sse_t3 -#define SUBMIT_BURST submit_burst_sse_t3 -#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_t3 -#define FLUSH_BURST flush_burst_sse_t3 -#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_t3 +#define SUBMIT_JOB submit_job_sse_t3 +#define FLUSH_JOB flush_job_sse_t3 +#define QUEUE_SIZE queue_size_sse_t3 +#define SUBMIT_JOB_NOCHECK submit_job_nocheck_sse_t3 +#define GET_NEXT_JOB get_next_job_sse_t3 +#define GET_COMPLETED_JOB get_completed_job_sse_t3 +#define GET_NEXT_BURST get_next_burst_sse_t3 +#define SUBMIT_BURST submit_burst_sse_t3 +#define SUBMIT_BURST_NOCHECK submit_burst_nocheck_sse_t3 +#define FLUSH_BURST flush_burst_sse_t3 +#define SUBMIT_CIPHER_BURST submit_cipher_burst_sse_t3 #define SUBMIT_CIPHER_BURST_NOCHECK submit_cipher_burst_nocheck_sse_t3 -#define SUBMIT_HASH_BURST submit_hash_burst_sse_t3 -#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_t3 -#define SET_SUITE_ID_FN set_suite_id_sse_t3 +#define SUBMIT_HASH_BURST submit_hash_burst_sse_t3 +#define SUBMIT_HASH_BURST_NOCHECK submit_hash_burst_nocheck_sse_t3 +#define SET_SUITE_ID_FN set_suite_id_sse_t3 /* Hash */ -#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE_T3 -#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE_T3 +#define SUBMIT_JOB_HASH SUBMIT_JOB_HASH_SSE_T3 +#define FLUSH_JOB_HASH FLUSH_JOB_HASH_SSE_T3 /* Cipher encrypt / decrypt */ #define SUBMIT_JOB_CIPHER_ENC SUBMIT_JOB_CIPHER_ENC_SSE_T3 @@ -83,12 +83,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_SSE_T3 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_sse +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_sse +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_sse +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_sse +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_sse +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_sse #define SUBMIT_JOB_AES_GCM_DEC submit_job_aes_gcm_dec_sse #define SUBMIT_JOB_AES_GCM_ENC submit_job_aes_gcm_enc_sse @@ -106,9 +106,9 @@ #define SUBMIT_JOB_AES_CBC_256_DEC submit_job_aes256_dec_sse #define FLUSH_JOB_AES_CBC_256_ENC flush_job_aes256_enc_x8_sse -#define AES_CBC_DEC_128 aes_cbc_dec_128_by8_sse -#define AES_CBC_DEC_192 aes_cbc_dec_192_by8_sse -#define AES_CBC_DEC_256 aes_cbc_dec_256_by8_sse +#define AES_CBC_DEC_128 aes_cbc_dec_128_by8_sse +#define AES_CBC_DEC_192 aes_cbc_dec_192_by8_sse +#define AES_CBC_DEC_256 aes_cbc_dec_256_by8_sse /* AES-CBCS */ #define SUBMIT_JOB_AES128_CBCS_1_9_ENC submit_job_aes128_cbcs_1_9_enc_sse @@ -124,45 +124,45 @@ #define SUBMIT_JOB_AES_ECB_256_ENC submit_job_aes_ecb_256_enc_sse #define SUBMIT_JOB_AES_ECB_256_DEC submit_job_aes_ecb_256_dec_sse -#define AES_ECB_ENC_128 aes_ecb_enc_128_by8_sse -#define AES_ECB_ENC_192 aes_ecb_enc_192_by8_sse -#define AES_ECB_ENC_256 aes_ecb_enc_256_by8_sse -#define AES_ECB_DEC_128 aes_ecb_dec_128_by8_sse -#define AES_ECB_DEC_192 aes_ecb_dec_192_by8_sse -#define AES_ECB_DEC_256 aes_ecb_dec_256_by8_sse +#define AES_ECB_ENC_128 aes_ecb_enc_128_by8_sse +#define AES_ECB_ENC_192 aes_ecb_enc_192_by8_sse +#define AES_ECB_ENC_256 aes_ecb_enc_256_by8_sse +#define AES_ECB_DEC_128 aes_ecb_dec_128_by8_sse +#define AES_ECB_DEC_192 aes_ecb_dec_192_by8_sse +#define AES_ECB_DEC_256 aes_ecb_dec_256_by8_sse /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_sse -#define AES_CTR_192 aes_cntr_192_sse -#define AES_CTR_256 aes_cntr_256_sse -#define AES_CTR_128_BIT aes_cntr_bit_128_sse -#define AES_CTR_192_BIT aes_cntr_bit_192_sse -#define AES_CTR_256_BIT aes_cntr_bit_256_sse +#define AES_CTR_128 aes_cntr_128_sse +#define AES_CTR_192 aes_cntr_192_sse +#define AES_CTR_256 aes_cntr_256_sse +#define AES_CTR_128_BIT aes_cntr_bit_128_sse +#define AES_CTR_192_BIT aes_cntr_bit_192_sse +#define AES_CTR_256_BIT aes_cntr_bit_256_sse /* AES-CCM */ -#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse -#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse +#define AES_CNTR_CCM_128 aes_cntr_ccm_128_sse +#define AES_CNTR_CCM_256 aes_cntr_ccm_256_sse -#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_x8_sse -#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_x8_sse +#define FLUSH_JOB_AES128_CCM_AUTH flush_job_aes128_ccm_auth_x8_sse +#define SUBMIT_JOB_AES128_CCM_AUTH submit_job_aes128_ccm_auth_x8_sse -#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_x8_sse -#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_x8_sse +#define FLUSH_JOB_AES256_CCM_AUTH flush_job_aes256_ccm_auth_x8_sse +#define SUBMIT_JOB_AES256_CCM_AUTH submit_job_aes256_ccm_auth_x8_sse /* AES-CMAC */ -#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_x8_sse -#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_x8_sse +#define FLUSH_JOB_AES128_CMAC_AUTH flush_job_aes128_cmac_auth_x8_sse +#define SUBMIT_JOB_AES128_CMAC_AUTH submit_job_aes128_cmac_auth_x8_sse -#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_x8_sse -#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_x8_sse +#define FLUSH_JOB_AES256_CMAC_AUTH flush_job_aes256_cmac_auth_x8_sse +#define SUBMIT_JOB_AES256_CMAC_AUTH submit_job_aes256_cmac_auth_x8_sse /* AES-CFB */ -#define AES_CFB_128_ONE aes_cfb_128_one_sse -#define AES_CFB_256_ONE aes_cfb_256_one_sse +#define AES_CFB_128_ONE aes_cfb_128_one_sse +#define AES_CFB_256_ONE aes_cfb_256_one_sse /* AES-XCBC */ -#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse -#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse +#define SUBMIT_JOB_AES_XCBC submit_job_aes_xcbc_sse +#define FLUSH_JOB_AES_XCBC flush_job_aes_xcbc_sse /* PON */ #define SUBMIT_JOB_PON_ENC submit_job_pon_enc_sse @@ -171,30 +171,30 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_sse /* SHA1/224/256/384/512 */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_ni_sse -#define FLUSH_JOB_SHA1 flush_job_sha1_ni_sse -#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse -#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse -#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse -#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse -#define SUBMIT_JOB_SHA384 submit_job_sha384_sse -#define FLUSH_JOB_SHA384 flush_job_sha384_sse -#define SUBMIT_JOB_SHA512 submit_job_sha512_sse -#define FLUSH_JOB_SHA512 flush_job_sha512_sse +#define SUBMIT_JOB_SHA1 submit_job_sha1_ni_sse +#define FLUSH_JOB_SHA1 flush_job_sha1_ni_sse +#define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse +#define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse +#define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse +#define FLUSH_JOB_SHA256 flush_job_sha256_ni_sse +#define SUBMIT_JOB_SHA384 submit_job_sha384_sse +#define FLUSH_JOB_SHA384 flush_job_sha384_sse +#define SUBMIT_JOB_SHA512 submit_job_sha512_sse +#define FLUSH_JOB_SHA512 flush_job_sha512_sse /* HMAC-SHA1/224/256/384/512/MD5 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_ni_sse -#define FLUSH_JOB_HMAC flush_job_hmac_ni_sse -#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse -#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse -#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse -#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse -#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse -#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse -#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse -#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse -#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse -#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse +#define SUBMIT_JOB_HMAC submit_job_hmac_ni_sse +#define FLUSH_JOB_HMAC flush_job_hmac_ni_sse +#define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse +#define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse +#define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse +#define FLUSH_JOB_HMAC_SHA_256 flush_job_hmac_sha_256_ni_sse +#define SUBMIT_JOB_HMAC_SHA_384 submit_job_hmac_sha_384_sse +#define FLUSH_JOB_HMAC_SHA_384 flush_job_hmac_sha_384_sse +#define SUBMIT_JOB_HMAC_SHA_512 submit_job_hmac_sha_512_sse +#define FLUSH_JOB_HMAC_SHA_512 flush_job_hmac_sha_512_sse +#define SUBMIT_JOB_HMAC_MD5 submit_job_hmac_md5_sse +#define FLUSH_JOB_HMAC_MD5 flush_job_hmac_md5_sse /* DES & 3DES */ @@ -211,14 +211,14 @@ #define POLY1305_MAC poly1305_mac_scalar /* ZUC EEA3 & EIA3 */ -#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_sse -#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_sse -#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_sse -#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_sse -#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_sse -#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_sse -#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_sse -#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_sse +#define SUBMIT_JOB_ZUC_EEA3 submit_job_zuc_eea3_gfni_sse +#define FLUSH_JOB_ZUC_EEA3 flush_job_zuc_eea3_gfni_sse +#define SUBMIT_JOB_ZUC_EIA3 submit_job_zuc_eia3_gfni_sse +#define FLUSH_JOB_ZUC_EIA3 flush_job_zuc_eia3_gfni_sse +#define SUBMIT_JOB_ZUC256_EEA3 submit_job_zuc256_eea3_gfni_sse +#define FLUSH_JOB_ZUC256_EEA3 flush_job_zuc256_eea3_gfni_sse +#define SUBMIT_JOB_ZUC256_EIA3 submit_job_zuc256_eia3_gfni_sse +#define FLUSH_JOB_ZUC256_EIA3 flush_job_zuc256_eia3_gfni_sse /* SNOW-V */ #define SUBMIT_JOB_SNOW_V snow_v_sse @@ -230,8 +230,7 @@ submit_snow3g_uea2_job_sse(IMB_MGR *state, IMB_JOB *job) { MB_MGR_SNOW3G_OOO *snow3g_uea2_ooo = state->snow3g_uea2_ooo; - if ((job->msg_len_to_cipher_in_bits & 7) || - (job->cipher_start_offset_in_bits & 7)) + if ((job->msg_len_to_cipher_in_bits & 7) || (job->cipher_start_offset_in_bits & 7)) return def_submit_snow3g_uea2_job(state, job); return submit_job_snow3g_uea2_sse(snow3g_uea2_ooo, job); @@ -256,7 +255,8 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) /* ====================================================================== */ -static void reset_ooo_mgrs(IMB_MGR *state) +static void +reset_ooo_mgrs(IMB_MGR *state) { /* Init AES out-of-order fields */ ooo_mgr_aes_reset(state->aes128_ooo, 8); @@ -285,12 +285,10 @@ static void reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_hmac_sha256_reset(state->hmac_sha_256_ooo, 2); /* Init HMAC/SHA384 out-of-order fields */ - ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha384_reset(state->hmac_sha_384_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/SHA512 out-of-order fields */ - ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, - SSE_NUM_SHA512_LANES); + ooo_mgr_hmac_sha512_reset(state->hmac_sha_512_ooo, SSE_NUM_SHA512_LANES); /* Init HMAC/MD5 out-of-order fields */ ooo_mgr_hmac_md5_reset(state->hmac_md5_ooo, SSE_NUM_MD5_LANES); @@ -352,90 +350,90 @@ init_mb_mgr_sse_t3_internal(IMB_MGR *state, const int reset_mgrs) } /* set handlers */ - state->get_next_job = GET_NEXT_JOB; - state->submit_job = SUBMIT_JOB; - state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; - state->get_completed_job = GET_COMPLETED_JOB; - state->flush_job = FLUSH_JOB; - state->queue_size = QUEUE_SIZE; - state->get_next_burst = GET_NEXT_BURST; - state->submit_burst = SUBMIT_BURST; - state->submit_burst_nocheck= SUBMIT_BURST_NOCHECK; - state->flush_burst = FLUSH_BURST; + state->get_next_job = GET_NEXT_JOB; + state->submit_job = SUBMIT_JOB; + state->submit_job_nocheck = SUBMIT_JOB_NOCHECK; + state->get_completed_job = GET_COMPLETED_JOB; + state->flush_job = FLUSH_JOB; + state->queue_size = QUEUE_SIZE; + state->get_next_burst = GET_NEXT_BURST; + state->submit_burst = SUBMIT_BURST; + state->submit_burst_nocheck = SUBMIT_BURST_NOCHECK; + state->flush_burst = FLUSH_BURST; state->submit_cipher_burst = SUBMIT_CIPHER_BURST; state->submit_cipher_burst_nocheck = SUBMIT_CIPHER_BURST_NOCHECK; - state->submit_hash_burst = SUBMIT_HASH_BURST; + state->submit_hash_burst = SUBMIT_HASH_BURST; state->submit_hash_burst_nocheck = SUBMIT_HASH_BURST_NOCHECK; - state->set_suite_id = SET_SUITE_ID_FN; + state->set_suite_id = SET_SUITE_ID_FN; - state->keyexp_128 = aes_keyexp_128_sse; - state->keyexp_192 = aes_keyexp_192_sse; - state->keyexp_256 = aes_keyexp_256_sse; + state->keyexp_128 = aes_keyexp_128_sse; + state->keyexp_192 = aes_keyexp_192_sse; + state->keyexp_256 = aes_keyexp_256_sse; state->cmac_subkey_gen_128 = aes_cmac_subkey_gen_sse; state->cmac_subkey_gen_256 = aes_cmac_256_subkey_gen_sse; - state->xcbc_keyexp = aes_xcbc_expand_key_sse; - state->des_key_sched = des_key_schedule; - - state->sha1_one_block = sha1_one_block_sse_shani; - state->sha1 = sha1_sse_shani; - state->sha224_one_block = sha224_one_block_sse_shani; - state->sha224 = sha224_sse_shani; - state->sha256_one_block = sha256_one_block_sse_shani; - state->sha256 = sha256_sse_shani; - state->sha384_one_block = sha384_one_block_sse; - state->sha384 = sha384_sse; - state->sha512_one_block = sha512_one_block_sse; - state->sha512 = sha512_sse; - state->md5_one_block = md5_one_block_sse; - - state->aes128_cfb_one = aes_cfb_128_one_sse; - state->aes256_cfb_one = aes_cfb_256_one_sse; - - state->eea3_1_buffer = zuc_eea3_1_buffer_sse; - state->eea3_4_buffer = zuc_eea3_4_buffer_gfni_sse; - state->eea3_n_buffer = zuc_eea3_n_buffer_gfni_sse; - state->eia3_n_buffer = zuc_eia3_n_buffer_gfni_sse; - state->eia3_1_buffer = zuc_eia3_1_buffer_sse; - - state->f8_1_buffer = kasumi_f8_1_buffer_sse; - state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; - state->f8_2_buffer = kasumi_f8_2_buffer_sse; - state->f8_3_buffer = kasumi_f8_3_buffer_sse; - state->f8_4_buffer = kasumi_f8_4_buffer_sse; - state->f8_n_buffer = kasumi_f8_n_buffer_sse; - state->f9_1_buffer = kasumi_f9_1_buffer_sse; - state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; + state->xcbc_keyexp = aes_xcbc_expand_key_sse; + state->des_key_sched = des_key_schedule; + + state->sha1_one_block = sha1_one_block_sse_shani; + state->sha1 = sha1_sse_shani; + state->sha224_one_block = sha224_one_block_sse_shani; + state->sha224 = sha224_sse_shani; + state->sha256_one_block = sha256_one_block_sse_shani; + state->sha256 = sha256_sse_shani; + state->sha384_one_block = sha384_one_block_sse; + state->sha384 = sha384_sse; + state->sha512_one_block = sha512_one_block_sse; + state->sha512 = sha512_sse; + state->md5_one_block = md5_one_block_sse; + + state->aes128_cfb_one = aes_cfb_128_one_sse; + state->aes256_cfb_one = aes_cfb_256_one_sse; + + state->eea3_1_buffer = zuc_eea3_1_buffer_sse; + state->eea3_4_buffer = zuc_eea3_4_buffer_gfni_sse; + state->eea3_n_buffer = zuc_eea3_n_buffer_gfni_sse; + state->eia3_n_buffer = zuc_eia3_n_buffer_gfni_sse; + state->eia3_1_buffer = zuc_eia3_1_buffer_sse; + + state->f8_1_buffer = kasumi_f8_1_buffer_sse; + state->f8_1_buffer_bit = kasumi_f8_1_buffer_bit_sse; + state->f8_2_buffer = kasumi_f8_2_buffer_sse; + state->f8_3_buffer = kasumi_f8_3_buffer_sse; + state->f8_4_buffer = kasumi_f8_4_buffer_sse; + state->f8_n_buffer = kasumi_f8_n_buffer_sse; + state->f9_1_buffer = kasumi_f9_1_buffer_sse; + state->f9_1_buffer_user = kasumi_f9_1_buffer_user_sse; state->kasumi_init_f8_key_sched = kasumi_init_f8_key_sched_sse; state->kasumi_init_f9_key_sched = kasumi_init_f9_key_sched_sse; state->kasumi_key_sched_size = kasumi_key_sched_size_sse; state->snow3g_f8_1_buffer_bit = snow3g_f8_1_buffer_bit_sse; - state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse; - state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse; - state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse; - state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse; - state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse; + state->snow3g_f8_1_buffer = snow3g_f8_1_buffer_sse; + state->snow3g_f8_2_buffer = snow3g_f8_2_buffer_sse; + state->snow3g_f8_4_buffer = snow3g_f8_4_buffer_sse; + state->snow3g_f8_8_buffer = snow3g_f8_8_buffer_sse; + state->snow3g_f8_n_buffer = snow3g_f8_n_buffer_sse; state->snow3g_f8_8_buffer_multikey = snow3g_f8_8_buffer_multikey_sse; state->snow3g_f8_n_buffer_multikey = snow3g_f8_n_buffer_multikey_sse; state->snow3g_f9_1_buffer = snow3g_f9_1_buffer_sse; state->snow3g_init_key_sched = snow3g_init_key_sched_sse; state->snow3g_key_sched_size = snow3g_key_sched_size_sse; - state->hec_32 = hec_32_sse; - state->hec_64 = hec_64_sse; - - state->crc32_ethernet_fcs = ethernet_fcs_sse; - state->crc16_x25 = crc16_x25_sse; - state->crc32_sctp = crc32_sctp_sse; - state->crc24_lte_a = crc24_lte_a_sse; - state->crc24_lte_b = crc24_lte_b_sse; - state->crc16_fp_data = crc16_fp_data_sse; - state->crc11_fp_header = crc11_fp_header_sse; - state->crc7_fp_header = crc7_fp_header_sse; - state->crc10_iuup_data = crc10_iuup_data_sse; - state->crc6_iuup_header = crc6_iuup_header_sse; + state->hec_32 = hec_32_sse; + state->hec_64 = hec_64_sse; + + state->crc32_ethernet_fcs = ethernet_fcs_sse; + state->crc16_x25 = crc16_x25_sse; + state->crc32_sctp = crc32_sctp_sse; + state->crc24_lte_a = crc24_lte_a_sse; + state->crc24_lte_b = crc24_lte_b_sse; + state->crc16_fp_data = crc16_fp_data_sse; + state->crc11_fp_header = crc11_fp_header_sse; + state->crc7_fp_header = crc7_fp_header_sse; + state->crc10_iuup_data = crc10_iuup_data_sse; + state->crc6_iuup_header = crc6_iuup_header_sse; state->crc32_wimax_ofdma_data = crc32_wimax_ofdma_data_sse; state->crc8_wimax_ofdma_hcs = crc8_wimax_ofdma_hcs_sse; @@ -444,55 +442,55 @@ init_mb_mgr_sse_t3_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_sse; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_sse; - state->gcm128_enc = aes_gcm_enc_128_sse; - state->gcm192_enc = aes_gcm_enc_192_sse; - state->gcm256_enc = aes_gcm_enc_256_sse; - state->gcm128_dec = aes_gcm_dec_128_sse; - state->gcm192_dec = aes_gcm_dec_192_sse; - state->gcm256_dec = aes_gcm_dec_256_sse; - state->gcm128_init = aes_gcm_init_128_sse; - state->gcm192_init = aes_gcm_init_192_sse; - state->gcm256_init = aes_gcm_init_256_sse; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; - state->gcm128_enc_update = aes_gcm_enc_128_update_sse; - state->gcm192_enc_update = aes_gcm_enc_192_update_sse; - state->gcm256_enc_update = aes_gcm_enc_256_update_sse; - state->gcm128_dec_update = aes_gcm_dec_128_update_sse; - state->gcm192_dec_update = aes_gcm_dec_192_update_sse; - state->gcm256_dec_update = aes_gcm_dec_256_update_sse; + state->gcm128_enc = aes_gcm_enc_128_sse; + state->gcm192_enc = aes_gcm_enc_192_sse; + state->gcm256_enc = aes_gcm_enc_256_sse; + state->gcm128_dec = aes_gcm_dec_128_sse; + state->gcm192_dec = aes_gcm_dec_192_sse; + state->gcm256_dec = aes_gcm_dec_256_sse; + state->gcm128_init = aes_gcm_init_128_sse; + state->gcm192_init = aes_gcm_init_192_sse; + state->gcm256_init = aes_gcm_init_256_sse; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_sse; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_sse; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_sse; + state->gcm128_enc_update = aes_gcm_enc_128_update_sse; + state->gcm192_enc_update = aes_gcm_enc_192_update_sse; + state->gcm256_enc_update = aes_gcm_enc_256_update_sse; + state->gcm128_dec_update = aes_gcm_dec_128_update_sse; + state->gcm192_dec_update = aes_gcm_dec_192_update_sse; + state->gcm256_dec_update = aes_gcm_dec_256_update_sse; state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_sse; state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_sse; state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_sse; state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_sse; state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_sse; state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_sse; - state->gcm128_precomp = aes_gcm_precomp_128_sse; - state->gcm192_precomp = aes_gcm_precomp_192_sse; - state->gcm256_precomp = aes_gcm_precomp_256_sse; - state->gcm128_pre = aes_gcm_pre_128_sse; - state->gcm192_pre = aes_gcm_pre_192_sse; - state->gcm256_pre = aes_gcm_pre_256_sse; - - state->ghash = ghash_sse; - state->ghash_pre = ghash_pre_sse; - - state->gmac128_init = imb_aes_gmac_init_128_sse; - state->gmac192_init = imb_aes_gmac_init_192_sse; - state->gmac256_init = imb_aes_gmac_init_256_sse; - state->gmac128_update = imb_aes_gmac_update_128_sse; - state->gmac192_update = imb_aes_gmac_update_192_sse; - state->gmac256_update = imb_aes_gmac_update_256_sse; - state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; - state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; - state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; - - state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; - state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; + state->gcm128_precomp = aes_gcm_precomp_128_sse; + state->gcm192_precomp = aes_gcm_precomp_192_sse; + state->gcm256_precomp = aes_gcm_precomp_256_sse; + state->gcm128_pre = aes_gcm_pre_128_sse; + state->gcm192_pre = aes_gcm_pre_192_sse; + state->gcm256_pre = aes_gcm_pre_256_sse; + + state->ghash = ghash_sse; + state->ghash_pre = ghash_pre_sse; + + state->gmac128_init = imb_aes_gmac_init_128_sse; + state->gmac192_init = imb_aes_gmac_init_192_sse; + state->gmac256_init = imb_aes_gmac_init_256_sse; + state->gmac128_update = imb_aes_gmac_update_128_sse; + state->gmac192_update = imb_aes_gmac_update_192_sse; + state->gmac256_update = imb_aes_gmac_update_256_sse; + state->gmac128_finalize = imb_aes_gmac_finalize_128_sse; + state->gmac192_finalize = imb_aes_gmac_finalize_192_sse; + state->gmac256_finalize = imb_aes_gmac_finalize_256_sse; + + state->aes_ecb_128_quic = aes_ecb_quic_enc_128_sse; + state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_chacha20_sse; } #include "mb_mgr_code.h" diff --git a/lib/x86_64/aes_xcbc_expand_key.c b/lib/x86_64/aes_xcbc_expand_key.c index 7a9c1772..d7d5d1d0 100644 --- a/lib/x86_64/aes_xcbc_expand_key.c +++ b/lib/x86_64/aes_xcbc_expand_key.c @@ -25,7 +25,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ - #include #include "ipsec-mb.h" #ifdef AESNI_EMU @@ -37,11 +36,9 @@ #include "include/arch_sse_type1.h" #include "include/arch_avx_type1.h" -static uint32_t in[4*3] = { - 0x01010101, 0x01010101, 0x01010101, 0x01010101, - 0x02020202, 0x02020202, 0x02020202, 0x02020202, - 0x03030303, 0x03030303, 0x03030303, 0x03030303 -}; +static uint32_t in[4 * 3] = { 0x01010101, 0x01010101, 0x01010101, 0x01010101, + 0x02020202, 0x02020202, 0x02020202, 0x02020202, + 0x03030303, 0x03030303, 0x03030303, 0x03030303 }; void aes_xcbc_expand_key_sse(const void *key, void *k1_exp, void *k2, void *k3) @@ -57,7 +54,7 @@ aes_xcbc_expand_key_sse(const void *key, void *k1_exp, void *k2, void *k3) return; } #endif - DECLARE_ALIGNED(uint32_t keys_exp_enc[11*4], 16); + DECLARE_ALIGNED(uint32_t keys_exp_enc[11 * 4], 16); aes_keyexp_128_enc_sse(key, keys_exp_enc); @@ -72,8 +69,7 @@ aes_xcbc_expand_key_sse(const void *key, void *k1_exp, void *k2, void *k3) #ifdef AESNI_EMU void -aes_xcbc_expand_key_sse_no_aesni(const void *key, void *k1_exp, - void *k2, void *k3) +aes_xcbc_expand_key_sse_no_aesni(const void *key, void *k1_exp, void *k2, void *k3) { #ifdef SAFE_PARAM imb_set_errno(NULL, 0); @@ -86,7 +82,7 @@ aes_xcbc_expand_key_sse_no_aesni(const void *key, void *k1_exp, return; } #endif - DECLARE_ALIGNED(uint32_t keys_exp_enc[11*4], 16); + DECLARE_ALIGNED(uint32_t keys_exp_enc[11 * 4], 16); aes_keyexp_128_enc_sse_no_aesni(key, keys_exp_enc); @@ -100,10 +96,8 @@ aes_xcbc_expand_key_sse_no_aesni(const void *key, void *k1_exp, } #endif /* AESNI_EMU */ -__forceinline -void -aes_xcbc_expand_key_avx_common(const void *key, - void *k1_exp, void *k2, void *k3) +__forceinline void +aes_xcbc_expand_key_avx_common(const void *key, void *k1_exp, void *k2, void *k3) { #ifdef SAFE_PARAM imb_set_errno(NULL, 0); @@ -116,7 +110,7 @@ aes_xcbc_expand_key_avx_common(const void *key, return; } #endif - DECLARE_ALIGNED(uint32_t keys_exp_enc[11*4], 16); + DECLARE_ALIGNED(uint32_t keys_exp_enc[11 * 4], 16); aes_keyexp_128_enc_avx(key, keys_exp_enc); diff --git a/lib/x86_64/alloc.c b/lib/x86_64/alloc.c index e4708a5a..b792fc3d 100644 --- a/lib/x86_64/alloc.c +++ b/lib/x86_64/alloc.c @@ -41,63 +41,64 @@ #define IMB_OOO_ROAD_BLOCK 0xDEADCAFEDEADCAFEULL -#define ALIGNMENT 64 +#define ALIGNMENT 64 #define ALIGN(x, y) ((x + (y - 1)) & (~(y - 1))) -#define OOO_INFO(imb_mgr_ooo_ptr_name__, ooo_mgr_type__) \ - { offsetof(IMB_MGR, imb_mgr_ooo_ptr_name__), \ - ALIGN(sizeof(ooo_mgr_type__), ALIGNMENT), \ - offsetof(ooo_mgr_type__, road_block) } +#define OOO_INFO(imb_mgr_ooo_ptr_name__, ooo_mgr_type__) \ + { \ + offsetof(IMB_MGR, imb_mgr_ooo_ptr_name__), \ + ALIGN(sizeof(ooo_mgr_type__), ALIGNMENT), \ + offsetof(ooo_mgr_type__, road_block) \ + } const struct { size_t ooo_ptr_offset; size_t ooo_aligned_size; size_t road_block_offset; -} ooo_mgr_table[] = { - OOO_INFO(aes128_ooo, MB_MGR_AES_OOO), - OOO_INFO(aes192_ooo, MB_MGR_AES_OOO), - OOO_INFO(aes256_ooo, MB_MGR_AES_OOO), - OOO_INFO(docsis128_sec_ooo, MB_MGR_DOCSIS_AES_OOO), - OOO_INFO(docsis128_crc32_sec_ooo, MB_MGR_DOCSIS_AES_OOO), - OOO_INFO(docsis256_sec_ooo, MB_MGR_DOCSIS_AES_OOO), - OOO_INFO(docsis256_crc32_sec_ooo, MB_MGR_DOCSIS_AES_OOO), - OOO_INFO(des_enc_ooo, MB_MGR_DES_OOO), - OOO_INFO(des_dec_ooo, MB_MGR_DES_OOO), - OOO_INFO(des3_enc_ooo, MB_MGR_DES_OOO), - OOO_INFO(des3_dec_ooo, MB_MGR_DES_OOO), - OOO_INFO(docsis_des_enc_ooo, MB_MGR_DES_OOO), - OOO_INFO(docsis_des_dec_ooo, MB_MGR_DES_OOO), - OOO_INFO(hmac_sha_1_ooo, MB_MGR_HMAC_SHA_1_OOO), - OOO_INFO(hmac_sha_224_ooo, MB_MGR_HMAC_SHA_256_OOO), - OOO_INFO(hmac_sha_256_ooo, MB_MGR_HMAC_SHA_256_OOO), - OOO_INFO(hmac_sha_384_ooo, MB_MGR_HMAC_SHA_512_OOO), - OOO_INFO(hmac_sha_512_ooo, MB_MGR_HMAC_SHA_512_OOO), - OOO_INFO(hmac_md5_ooo, MB_MGR_HMAC_MD5_OOO), - OOO_INFO(aes_xcbc_ooo, MB_MGR_AES_XCBC_OOO), - OOO_INFO(aes_ccm_ooo, MB_MGR_CCM_OOO), - OOO_INFO(aes_cmac_ooo, MB_MGR_CMAC_OOO), - OOO_INFO(aes128_cbcs_ooo, MB_MGR_AES_OOO), - OOO_INFO(zuc_eea3_ooo, MB_MGR_ZUC_OOO), - OOO_INFO(zuc_eia3_ooo, MB_MGR_ZUC_OOO), - OOO_INFO(zuc256_eea3_ooo, MB_MGR_ZUC_OOO), - OOO_INFO(zuc256_eia3_ooo, MB_MGR_ZUC_OOO), - OOO_INFO(aes256_ccm_ooo, MB_MGR_CCM_OOO), - OOO_INFO(aes256_cmac_ooo, MB_MGR_CMAC_OOO), - OOO_INFO(snow3g_uea2_ooo, MB_MGR_SNOW3G_OOO), - OOO_INFO(snow3g_uia2_ooo, MB_MGR_SNOW3G_OOO), - OOO_INFO(sha_1_ooo, MB_MGR_SHA_1_OOO), - OOO_INFO(sha_224_ooo, MB_MGR_SHA_256_OOO), - OOO_INFO(sha_256_ooo, MB_MGR_SHA_256_OOO), - OOO_INFO(sha_384_ooo, MB_MGR_SHA_512_OOO), - OOO_INFO(sha_512_ooo, MB_MGR_SHA_512_OOO) -}; +} ooo_mgr_table[] = { OOO_INFO(aes128_ooo, MB_MGR_AES_OOO), + OOO_INFO(aes192_ooo, MB_MGR_AES_OOO), + OOO_INFO(aes256_ooo, MB_MGR_AES_OOO), + OOO_INFO(docsis128_sec_ooo, MB_MGR_DOCSIS_AES_OOO), + OOO_INFO(docsis128_crc32_sec_ooo, MB_MGR_DOCSIS_AES_OOO), + OOO_INFO(docsis256_sec_ooo, MB_MGR_DOCSIS_AES_OOO), + OOO_INFO(docsis256_crc32_sec_ooo, MB_MGR_DOCSIS_AES_OOO), + OOO_INFO(des_enc_ooo, MB_MGR_DES_OOO), + OOO_INFO(des_dec_ooo, MB_MGR_DES_OOO), + OOO_INFO(des3_enc_ooo, MB_MGR_DES_OOO), + OOO_INFO(des3_dec_ooo, MB_MGR_DES_OOO), + OOO_INFO(docsis_des_enc_ooo, MB_MGR_DES_OOO), + OOO_INFO(docsis_des_dec_ooo, MB_MGR_DES_OOO), + OOO_INFO(hmac_sha_1_ooo, MB_MGR_HMAC_SHA_1_OOO), + OOO_INFO(hmac_sha_224_ooo, MB_MGR_HMAC_SHA_256_OOO), + OOO_INFO(hmac_sha_256_ooo, MB_MGR_HMAC_SHA_256_OOO), + OOO_INFO(hmac_sha_384_ooo, MB_MGR_HMAC_SHA_512_OOO), + OOO_INFO(hmac_sha_512_ooo, MB_MGR_HMAC_SHA_512_OOO), + OOO_INFO(hmac_md5_ooo, MB_MGR_HMAC_MD5_OOO), + OOO_INFO(aes_xcbc_ooo, MB_MGR_AES_XCBC_OOO), + OOO_INFO(aes_ccm_ooo, MB_MGR_CCM_OOO), + OOO_INFO(aes_cmac_ooo, MB_MGR_CMAC_OOO), + OOO_INFO(aes128_cbcs_ooo, MB_MGR_AES_OOO), + OOO_INFO(zuc_eea3_ooo, MB_MGR_ZUC_OOO), + OOO_INFO(zuc_eia3_ooo, MB_MGR_ZUC_OOO), + OOO_INFO(zuc256_eea3_ooo, MB_MGR_ZUC_OOO), + OOO_INFO(zuc256_eia3_ooo, MB_MGR_ZUC_OOO), + OOO_INFO(aes256_ccm_ooo, MB_MGR_CCM_OOO), + OOO_INFO(aes256_cmac_ooo, MB_MGR_CMAC_OOO), + OOO_INFO(snow3g_uea2_ooo, MB_MGR_SNOW3G_OOO), + OOO_INFO(snow3g_uia2_ooo, MB_MGR_SNOW3G_OOO), + OOO_INFO(sha_1_ooo, MB_MGR_SHA_1_OOO), + OOO_INFO(sha_224_ooo, MB_MGR_SHA_256_OOO), + OOO_INFO(sha_256_ooo, MB_MGR_SHA_256_OOO), + OOO_INFO(sha_384_ooo, MB_MGR_SHA_512_OOO), + OOO_INFO(sha_512_ooo, MB_MGR_SHA_512_OOO) }; /** * @brief Calculates necessary memory size for IMB_MGR. * * @return Size for IMB_MGR (aligned to 64 bytes) */ -size_t imb_get_mb_mgr_size(void) +size_t +imb_get_mb_mgr_size(void) { size_t ooo_total_size = 0; unsigned i; @@ -111,7 +112,8 @@ size_t imb_get_mb_mgr_size(void) return (sizeof(IMB_MGR) + ooo_total_size + ALIGNMENT); } -static uint8_t *get_ooo_ptr(IMB_MGR *mgr, const size_t offset) +static uint8_t * +get_ooo_ptr(IMB_MGR *mgr, const size_t offset) { uint8_t *mgr_offset = &((uint8_t *) mgr)[offset]; uint8_t **ptr = (uint8_t **) mgr_offset; @@ -119,7 +121,8 @@ static uint8_t *get_ooo_ptr(IMB_MGR *mgr, const size_t offset) return *ptr; } -static void set_ooo_ptr(IMB_MGR *mgr, const size_t offset, uint8_t *new_ptr) +static void +set_ooo_ptr(IMB_MGR *mgr, const size_t offset, uint8_t *new_ptr) { uint8_t *mgr_offset = &((uint8_t *) mgr)[offset]; uint8_t **ptr = (uint8_t **) mgr_offset; @@ -127,7 +130,8 @@ static void set_ooo_ptr(IMB_MGR *mgr, const size_t offset, uint8_t *new_ptr) *ptr = new_ptr; } -static void set_road_block(uint8_t *ooo_ptr, const size_t offset) +static void +set_road_block(uint8_t *ooo_ptr, const size_t offset) { uint64_t *p_road_block = (uint64_t *) &ooo_ptr[offset]; @@ -140,13 +144,13 @@ static void set_road_block(uint8_t *ooo_ptr, const size_t offset) * This is to assist in searching for sensitive data remaining * in the heap after algorithmic code completes */ -static void set_ooo_mgr_road_block(IMB_MGR *mgr) +static void +set_ooo_mgr_road_block(IMB_MGR *mgr) { unsigned n; for (n = 0; n < IMB_DIM(ooo_mgr_table); n++) - set_road_block(get_ooo_ptr(mgr, - ooo_mgr_table[n].ooo_ptr_offset), + set_road_block(get_ooo_ptr(mgr, ooo_mgr_table[n].ooo_ptr_offset), ooo_mgr_table[n].road_block_offset); } @@ -173,8 +177,8 @@ static void set_ooo_mgr_road_block(IMB_MGR *mgr) * * @return Pointer to IMB_MGR structure */ -IMB_MGR *imb_set_pointers_mb_mgr(void *mem_ptr, const uint64_t flags, - const unsigned reset_mgr) +IMB_MGR * +imb_set_pointers_mb_mgr(void *mem_ptr, const uint64_t flags, const unsigned reset_mgr) { if (mem_ptr == NULL) { imb_set_errno(mem_ptr, ENOMEM); @@ -247,7 +251,7 @@ IMB_MGR *imb_set_pointers_mb_mgr(void *mem_ptr, const uint64_t flags, for (i = 0; i < IMB_DIM(ooo_mgr_table); i++) { set_ooo_ptr(ptr, ooo_mgr_table[i].ooo_ptr_offset, free_ptr); free_ptr = &free_ptr[ooo_mgr_table[i].ooo_aligned_size]; - IMB_ASSERT((uintptr_t)(free_ptr - ptr8) <= mem_size); + IMB_ASSERT((uintptr_t) (free_ptr - ptr8) <= mem_size); } set_ooo_mgr_road_block(ptr); @@ -294,7 +298,8 @@ free_mem(void *ptr) * @return Pointer to allocated memory for MB_MGR structure * @retval NULL on allocation error */ -IMB_MGR *alloc_mb_mgr(uint64_t flags) +IMB_MGR * +alloc_mb_mgr(uint64_t flags) { IMB_MGR *ptr = NULL; @@ -325,7 +330,8 @@ IMB_MGR *alloc_mb_mgr(uint64_t flags) * @param ptr a pointer to allocated MB_MGR structure * */ -void free_mb_mgr(IMB_MGR *ptr) +void +free_mb_mgr(IMB_MGR *ptr) { IMB_ASSERT(ptr != NULL); diff --git a/lib/x86_64/chacha20_poly1305.c b/lib/x86_64/chacha20_poly1305.c index ba69cd2e..4044b986 100644 --- a/lib/x86_64/chacha20_poly1305.c +++ b/lib/x86_64/chacha20_poly1305.c @@ -38,9 +38,8 @@ #include "include/chacha20_poly1305.h" #include "include/error.h" -__forceinline -void memcpy_asm(void *dst, const void *src, const size_t size, - const IMB_ARCH arch) +__forceinline void +memcpy_asm(void *dst, const void *src, const size_t size, const IMB_ARCH arch) { if (arch == IMB_ARCH_SSE) memcpy_fn_sse_16(dst, src, size); @@ -48,11 +47,9 @@ void memcpy_asm(void *dst, const void *src, const size_t size, memcpy_fn_avx_16(dst, src, size); } -__forceinline -void chacha20_enc_dec_ks(const void *src, void *dst, - const uint64_t length, const void *key, - struct chacha20_poly1305_context_data *ctx, - const IMB_ARCH arch) +__forceinline void +chacha20_enc_dec_ks(const void *src, void *dst, const uint64_t length, const void *key, + struct chacha20_poly1305_context_data *ctx, const IMB_ARCH arch) { if (arch == IMB_ARCH_SSE) chacha20_enc_dec_ks_sse(src, dst, length, key, ctx); @@ -64,15 +61,13 @@ void chacha20_enc_dec_ks(const void *src, void *dst, chacha20_enc_dec_ks_avx512(src, dst, length, key, ctx); } -__forceinline -void poly1305_aead_update(const void *msg, const uint64_t msg_len, - void *hash, const void *key, const IMB_ARCH arch, - const unsigned ifma) +__forceinline void +poly1305_aead_update(const void *msg, const uint64_t msg_len, void *hash, const void *key, + const IMB_ARCH arch, const unsigned ifma) { if (arch == IMB_ARCH_AVX512) { if (ifma) - poly1305_aead_update_fma_avx512(msg, msg_len, hash, - key); + poly1305_aead_update_fma_avx512(msg, msg_len, hash, key); else poly1305_aead_update_avx512(msg, msg_len, hash, key); #ifdef AVX_IFMA @@ -83,9 +78,9 @@ void poly1305_aead_update(const void *msg, const uint64_t msg_len, poly1305_aead_update_scalar(msg, msg_len, hash, key); } -__forceinline -void poly1305_aead_complete(const void *hash, const void *key, - void *tag, const IMB_ARCH arch, const unsigned ifma) +__forceinline void +poly1305_aead_complete(const void *hash, const void *key, void *tag, const IMB_ARCH arch, + const unsigned ifma) { if (arch == IMB_ARCH_AVX512) { if (ifma) @@ -100,16 +95,12 @@ void poly1305_aead_complete(const void *hash, const void *key, poly1305_aead_complete_scalar(hash, key, tag); } -__forceinline -void init_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, - const unsigned ifma) +__forceinline void +init_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, const unsigned ifma) { - struct chacha20_poly1305_context_data *ctx = - job->u.CHACHA20_POLY1305.ctx; - const uint64_t hash_len = - (job->msg_len_to_hash_in_bytes & HASH_LEN_CLAMP); - const uint64_t remain_ct_bytes = - (job->msg_len_to_hash_in_bytes & HASH_REMAIN_CLAMP); + struct chacha20_poly1305_context_data *ctx = job->u.CHACHA20_POLY1305.ctx; + const uint64_t hash_len = (job->msg_len_to_hash_in_bytes & HASH_LEN_CLAMP); + const uint64_t remain_ct_bytes = (job->msg_len_to_hash_in_bytes & HASH_REMAIN_CLAMP); const uint8_t *remain_ct_ptr; ctx->hash[0] = 0; @@ -131,57 +122,42 @@ void init_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, poly1305_key_gen_avx(job->enc_keys, job->iv, ctx->poly_key); /* Calculate hash over AAD */ - poly1305_aead_update(job->u.CHACHA20_POLY1305.aad, - ctx->aad_len, - ctx->hash, ctx->poly_key, arch, ifma); + poly1305_aead_update(job->u.CHACHA20_POLY1305.aad, ctx->aad_len, ctx->hash, ctx->poly_key, + arch, ifma); if (job->cipher_direction == IMB_DIR_ENCRYPT) { - chacha20_enc_dec_ks(job->src + - job->cipher_start_src_offset_in_bytes, - job->dst, job->msg_len_to_cipher_in_bytes, - job->enc_keys, ctx, arch); + chacha20_enc_dec_ks(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes, job->enc_keys, ctx, arch); /* * Compute hash after cipher on encrypt * (only on multiple of 16 bytes) */ - poly1305_aead_update(job->dst, hash_len, ctx->hash, - ctx->poly_key, arch, ifma); + poly1305_aead_update(job->dst, hash_len, ctx->hash, ctx->poly_key, arch, ifma); remain_ct_ptr = job->dst + hash_len; /* Copy last bytes of ciphertext (less than 16 bytes) */ - memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, - arch); + memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, arch); } else { /* * Compute hash first on decrypt * (only on multiple of 16 bytes) */ - poly1305_aead_update(job->src + - job->hash_start_src_offset_in_bytes, - hash_len, ctx->hash, ctx->poly_key, arch, - ifma); + poly1305_aead_update(job->src + job->hash_start_src_offset_in_bytes, hash_len, + ctx->hash, ctx->poly_key, arch, ifma); - remain_ct_ptr = job->src + job->hash_start_src_offset_in_bytes - + hash_len; + remain_ct_ptr = job->src + job->hash_start_src_offset_in_bytes + hash_len; /* Copy last bytes of ciphertext (less than 16 bytes) */ - memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, - arch); - chacha20_enc_dec_ks(job->src + - job->cipher_start_src_offset_in_bytes, - job->dst, job->msg_len_to_cipher_in_bytes, - job->enc_keys, ctx, arch); + memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, arch); + chacha20_enc_dec_ks(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes, job->enc_keys, ctx, arch); } job->status = IMB_STATUS_COMPLETED; } -__forceinline -void update_chacha20_poly1305_direct(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len, - const IMB_CIPHER_DIRECTION dir, - const IMB_ARCH arch, - const unsigned check_param, - const unsigned ifma) +__forceinline void +update_chacha20_poly1305_direct(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len, + const IMB_CIPHER_DIRECTION dir, const IMB_ARCH arch, + const unsigned check_param, const unsigned ifma) { #ifdef SAFE_PARAM if (check_param) { @@ -231,8 +207,7 @@ void update_chacha20_poly1305_direct(const void *key, chacha20_enc_dec_ks(src, dst, length, key, ctx, arch); /* Copy more bytes on Poly scratchpad */ - memcpy_asm(ctx->poly_scratch + ctx->remain_ct_bytes, - dst, bytes_to_copy, arch); + memcpy_asm(ctx->poly_scratch + ctx->remain_ct_bytes, dst, bytes_to_copy, arch); ctx->remain_ct_bytes += bytes_to_copy; /* @@ -240,8 +215,8 @@ void update_chacha20_poly1305_direct(const void *key, * first bytes of this segment (if there are 16 bytes) */ if (ctx->remain_ct_bytes == 16) { - poly1305_aead_update(ctx->poly_scratch, 16, ctx->hash, - ctx->poly_key, arch, ifma); + poly1305_aead_update(ctx->poly_scratch, 16, ctx->hash, ctx->poly_key, arch, + ifma); ctx->remain_ct_bytes = 0; } @@ -250,19 +225,16 @@ void update_chacha20_poly1305_direct(const void *key, length &= HASH_LEN_CLAMP; /* compute hash after cipher on encrypt */ - poly1305_aead_update(dst8 + bytes_to_copy, - length, ctx->hash, ctx->poly_key, arch, + poly1305_aead_update(dst8 + bytes_to_copy, length, ctx->hash, ctx->poly_key, arch, ifma); remain_ct_ptr = dst8 + bytes_to_copy + length; /* copy last bytes of ciphertext (less than 16 bytes) */ - memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, - arch); + memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, arch); ctx->remain_ct_bytes += remain_ct_bytes; } else { /* Copy more bytes on Poly scratchpad */ - memcpy_asm(ctx->poly_scratch + ctx->remain_ct_bytes, - src, bytes_to_copy, arch); + memcpy_asm(ctx->poly_scratch + ctx->remain_ct_bytes, src, bytes_to_copy, arch); ctx->remain_ct_bytes += bytes_to_copy; /* @@ -270,8 +242,8 @@ void update_chacha20_poly1305_direct(const void *key, * first bytes of this segment (if there are 16 bytes) */ if (ctx->remain_ct_bytes == 16) { - poly1305_aead_update(ctx->poly_scratch, 16, ctx->hash, - ctx->poly_key, arch, ifma); + poly1305_aead_update(ctx->poly_scratch, 16, ctx->hash, ctx->poly_key, arch, + ifma); ctx->remain_ct_bytes = 0; } @@ -280,40 +252,31 @@ void update_chacha20_poly1305_direct(const void *key, length &= HASH_LEN_CLAMP; /* compute hash first on decrypt */ - poly1305_aead_update(src8 + bytes_to_copy, length, ctx->hash, - ctx->poly_key, arch, ifma); + poly1305_aead_update(src8 + bytes_to_copy, length, ctx->hash, ctx->poly_key, arch, + ifma); remain_ct_ptr = src8 + bytes_to_copy + length; /* copy last bytes of ciphertext (less than 16 bytes) */ - memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, - arch); + memcpy_asm(ctx->poly_scratch, remain_ct_ptr, remain_ct_bytes, arch); ctx->remain_ct_bytes += remain_ct_bytes; chacha20_enc_dec_ks(src, dst, len, key, ctx, arch); } } -__forceinline -void update_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, - const unsigned ifma) +__forceinline void +update_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, const unsigned ifma) { - update_chacha20_poly1305_direct(job->enc_keys, - job->u.CHACHA20_POLY1305.ctx, - job->dst, - job->src + - job->cipher_start_src_offset_in_bytes, - job->msg_len_to_cipher_in_bytes, - job->cipher_direction, - arch, - 0, ifma); + update_chacha20_poly1305_direct(job->enc_keys, job->u.CHACHA20_POLY1305.ctx, job->dst, + job->src + job->cipher_start_src_offset_in_bytes, + job->msg_len_to_cipher_in_bytes, job->cipher_direction, + arch, 0, ifma); job->status = IMB_STATUS_COMPLETED; } -__forceinline -void complete_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, - const unsigned ifma) +__forceinline void +complete_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, const unsigned ifma) { - struct chacha20_poly1305_context_data *ctx = - job->u.CHACHA20_POLY1305.ctx; + struct chacha20_poly1305_context_data *ctx = job->u.CHACHA20_POLY1305.ctx; uint64_t hash_len = job->msg_len_to_hash_in_bytes; uint64_t last[2]; uint64_t bytes_to_copy = 0; @@ -331,14 +294,11 @@ void complete_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, ctx->hash_len += job->msg_len_to_hash_in_bytes; if (job->cipher_direction == IMB_DIR_ENCRYPT) { - chacha20_enc_dec_ks(job->src + - job->cipher_start_src_offset_in_bytes, - job->dst, job->msg_len_to_cipher_in_bytes, - job->enc_keys, ctx, arch); + chacha20_enc_dec_ks(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes, job->enc_keys, ctx, arch); /* Copy more bytes on Poly scratchpad */ - memcpy_asm(ctx->poly_scratch + ctx->remain_ct_bytes, - job->dst, bytes_to_copy, arch); + memcpy_asm(ctx->poly_scratch + ctx->remain_ct_bytes, job->dst, bytes_to_copy, arch); ctx->remain_ct_bytes += bytes_to_copy; /* @@ -347,25 +307,19 @@ void complete_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, * as this is the last segment) */ if (ctx->remain_ct_bytes > 0) { - poly1305_aead_update(ctx->poly_scratch, - ctx->remain_ct_bytes, - ctx->hash, - ctx->poly_key, - arch, ifma); + poly1305_aead_update(ctx->poly_scratch, ctx->remain_ct_bytes, ctx->hash, + ctx->poly_key, arch, ifma); ctx->remain_ct_bytes = 0; } hash_len -= bytes_to_copy; /* compute hash after cipher on encrypt */ if (hash_len != 0) - poly1305_aead_update(job->dst + bytes_to_copy, - hash_len, ctx->hash, - ctx->poly_key, - arch, ifma); + poly1305_aead_update(job->dst + bytes_to_copy, hash_len, ctx->hash, + ctx->poly_key, arch, ifma); } else { /* Copy more bytes on Poly scratchpad */ memcpy_asm(ctx->poly_scratch + ctx->remain_ct_bytes, - job->src + job->hash_start_src_offset_in_bytes, - bytes_to_copy, arch); + job->src + job->hash_start_src_offset_in_bytes, bytes_to_copy, arch); ctx->remain_ct_bytes += bytes_to_copy; /* @@ -374,26 +328,20 @@ void complete_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, * as this is the last segment) */ if (ctx->remain_ct_bytes > 0) { - poly1305_aead_update(ctx->poly_scratch, - ctx->remain_ct_bytes, - ctx->hash, - ctx->poly_key, - arch, ifma); + poly1305_aead_update(ctx->poly_scratch, ctx->remain_ct_bytes, ctx->hash, + ctx->poly_key, arch, ifma); ctx->remain_ct_bytes = 0; } hash_len -= bytes_to_copy; /* compute hash first on decrypt */ if (hash_len != 0) - poly1305_aead_update(job->src + - job->hash_start_src_offset_in_bytes + - bytes_to_copy, - hash_len, ctx->hash, ctx->poly_key, arch, ifma); - - chacha20_enc_dec_ks(job->src + - job->cipher_start_src_offset_in_bytes, - job->dst, job->msg_len_to_cipher_in_bytes, - job->enc_keys, ctx, arch); + poly1305_aead_update(job->src + job->hash_start_src_offset_in_bytes + + bytes_to_copy, + hash_len, ctx->hash, ctx->poly_key, arch, ifma); + + chacha20_enc_dec_ks(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes, job->enc_keys, ctx, arch); } /* @@ -402,12 +350,10 @@ void complete_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, */ last[0] = ctx->aad_len; last[1] = ctx->hash_len; - poly1305_aead_update(last, sizeof(last), ctx->hash, ctx->poly_key, - arch, ifma); + poly1305_aead_update(last, sizeof(last), ctx->hash, ctx->poly_key, arch, ifma); /* Finalize AEAD Poly1305 (final reduction and +S) */ - poly1305_aead_complete(ctx->hash, ctx->poly_key, job->auth_tag_output, - arch, ifma); + poly1305_aead_complete(ctx->hash, ctx->poly_key, job->auth_tag_output, arch, ifma); /* Clear sensitive data from the context */ #ifdef SAFE_DATA @@ -417,13 +363,10 @@ void complete_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, job->status = IMB_STATUS_COMPLETED; } -__forceinline -void init_chacha20_poly1305_direct(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len, const IMB_ARCH arch, - const unsigned check_params, - const unsigned ifma) +__forceinline void +init_chacha20_poly1305_direct(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len, + const IMB_ARCH arch, const unsigned check_params, const unsigned ifma) { #ifdef SAFE_PARAM if (check_params) { @@ -469,17 +412,13 @@ void init_chacha20_poly1305_direct(const void *key, poly1305_key_gen_avx(key, iv, ctx->poly_key); /* Calculate hash over AAD */ - poly1305_aead_update(aad, aad_len, ctx->hash, ctx->poly_key, - arch, ifma); + poly1305_aead_update(aad, aad_len, ctx->hash, ctx->poly_key, arch, ifma); } -__forceinline -void -finalize_chacha20_poly1305_direct(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len, - const IMB_ARCH arch, - const unsigned check_params, - const unsigned ifma) +__forceinline void +finalize_chacha20_poly1305_direct(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len, const IMB_ARCH arch, + const unsigned check_params, const unsigned ifma) { #ifdef SAFE_PARAM if (check_params) { @@ -506,11 +445,8 @@ finalize_chacha20_poly1305_direct(struct chacha20_poly1305_context_data *ctx, uint8_t auth_tag[16]; if (ctx->remain_ct_bytes > 0) { - poly1305_aead_update(ctx->poly_scratch, - ctx->remain_ct_bytes, - ctx->hash, - ctx->poly_key, - arch, ifma); + poly1305_aead_update(ctx->poly_scratch, ctx->remain_ct_bytes, ctx->hash, + ctx->poly_key, arch, ifma); ctx->remain_ct_bytes = 0; } @@ -520,8 +456,7 @@ finalize_chacha20_poly1305_direct(struct chacha20_poly1305_context_data *ctx, */ last[0] = ctx->aad_len; last[1] = ctx->hash_len; - poly1305_aead_update(last, sizeof(last), ctx->hash, ctx->poly_key, - arch, ifma); + poly1305_aead_update(last, sizeof(last), ctx->hash, ctx->poly_key, arch, ifma); /* Finalize AEAD Poly1305 (final reduction and +S) */ poly1305_aead_complete(ctx->hash, ctx->poly_key, auth_tag, arch, ifma); @@ -536,13 +471,11 @@ finalize_chacha20_poly1305_direct(struct chacha20_poly1305_context_data *ctx, #endif } -__forceinline -IMB_JOB *aead_chacha20_poly1305_sgl(IMB_JOB *job, const IMB_ARCH arch, - const unsigned ifma) +__forceinline IMB_JOB * +aead_chacha20_poly1305_sgl(IMB_JOB *job, const IMB_ARCH arch, const unsigned ifma) { unsigned i; - struct chacha20_poly1305_context_data *ctx = - job->u.CHACHA20_POLY1305.ctx; + struct chacha20_poly1305_context_data *ctx = job->u.CHACHA20_POLY1305.ctx; switch (job->sgl_state) { case IMB_SGL_INIT: @@ -557,26 +490,15 @@ IMB_JOB *aead_chacha20_poly1305_sgl(IMB_JOB *job, const IMB_ARCH arch, case IMB_SGL_ALL: default: init_chacha20_poly1305_direct( - job->enc_keys, - ctx, - job->iv, - job->u.CHACHA20_POLY1305.aad, - job->u.CHACHA20_POLY1305.aad_len_in_bytes, - arch, 0, ifma); + job->enc_keys, ctx, job->iv, job->u.CHACHA20_POLY1305.aad, + job->u.CHACHA20_POLY1305.aad_len_in_bytes, arch, 0, ifma); for (i = 0; i < job->num_sgl_io_segs; i++) - update_chacha20_poly1305_direct(job->enc_keys, - ctx, - job->sgl_io_segs[i].out, - job->sgl_io_segs[i].in, - job->sgl_io_segs[i].len, - job->cipher_direction, - arch, - 0, ifma); - - finalize_chacha20_poly1305_direct(ctx, - job->auth_tag_output, - job->auth_tag_output_len_in_bytes, - arch, 0, ifma); + update_chacha20_poly1305_direct( + job->enc_keys, ctx, job->sgl_io_segs[i].out, job->sgl_io_segs[i].in, + job->sgl_io_segs[i].len, job->cipher_direction, arch, 0, ifma); + + finalize_chacha20_poly1305_direct(ctx, job->auth_tag_output, + job->auth_tag_output_len_in_bytes, arch, 0, ifma); /* Clear sensitive data from the context */ #ifdef SAFE_DATA clear_mem(ctx->last_ks, sizeof(ctx->last_ks)); @@ -588,12 +510,11 @@ IMB_JOB *aead_chacha20_poly1305_sgl(IMB_JOB *job, const IMB_ARCH arch, return job; } -__forceinline -IMB_JOB *aead_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, - const unsigned ifma) +__forceinline IMB_JOB * +aead_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, const unsigned ifma) { - DECLARE_ALIGNED(uint8_t ks[16*64], 64); - uint64_t hash[3] = {0, 0, 0}; + DECLARE_ALIGNED(uint8_t ks[16 * 64], 64); + uint64_t hash[3] = { 0, 0, 0 }; const uint64_t aad_len = job->u.CHACHA20_POLY1305.aad_len_in_bytes; const uint64_t hash_len = job->msg_len_to_hash_in_bytes; uint64_t cipher_len = job->msg_len_to_cipher_in_bytes; @@ -618,8 +539,7 @@ IMB_JOB *aead_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, } /* Calculate hash over AAD */ - poly1305_aead_update(job->u.CHACHA20_POLY1305.aad, aad_len, - hash, ks, arch, ifma); + poly1305_aead_update(job->u.CHACHA20_POLY1305.aad, aad_len, hash, ks, arch, ifma); /* compute hash after cipher on encrypt */ poly1305_aead_update(job->dst, hash_len, hash, ks, arch, ifma); @@ -629,10 +549,8 @@ IMB_JOB *aead_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, /* generate key for authentication */ switch (arch) { case IMB_ARCH_SSE: - len_to_gen = (cipher_len >= (256 - 64)) ? - 256 : (cipher_len + 64); - gen_keystr_poly_key_sse(job->enc_keys, job->iv, - len_to_gen, ks); + len_to_gen = (cipher_len >= (256 - 64)) ? 256 : (cipher_len + 64); + gen_keystr_poly_key_sse(job->enc_keys, job->iv, len_to_gen, ks); break; case IMB_ARCH_AVX: case IMB_ARCH_AVX2: @@ -640,25 +558,20 @@ IMB_JOB *aead_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, break; case IMB_ARCH_AVX512: default: - len_to_gen = (cipher_len >= (1024 - 64)) ? - 1024 : (cipher_len + 64); - gen_keystr_poly_key_avx512(job->enc_keys, job->iv, - len_to_gen, ks); + len_to_gen = (cipher_len >= (1024 - 64)) ? 1024 : (cipher_len + 64); + gen_keystr_poly_key_avx512(job->enc_keys, job->iv, len_to_gen, ks); } /* Calculate hash over AAD */ - poly1305_aead_update(job->u.CHACHA20_POLY1305.aad, aad_len, - hash, ks, arch, ifma); + poly1305_aead_update(job->u.CHACHA20_POLY1305.aad, aad_len, hash, ks, arch, ifma); /* compute hash first on decrypt */ - poly1305_aead_update(job->src + - job->hash_start_src_offset_in_bytes, - hash_len, hash, ks, arch, ifma); + poly1305_aead_update(job->src + job->hash_start_src_offset_in_bytes, hash_len, hash, + ks, arch, ifma); switch (arch) { case IMB_ARCH_SSE: - submit_job_chacha20_poly_dec_sse(job, ks + 64, - len_to_gen - 64); + submit_job_chacha20_poly_dec_sse(job, ks + 64, len_to_gen - 64); break; case IMB_ARCH_AVX: submit_job_chacha20_enc_dec_avx(job); @@ -670,8 +583,7 @@ IMB_JOB *aead_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, default: /* Skip first 64 bytes of KS, as that's used only for Poly key */ - submit_job_chacha20_poly_dec_avx512(job, ks + 64, - len_to_gen - 64); + submit_job_chacha20_poly_dec_avx512(job, ks + 64, len_to_gen - 64); break; } } @@ -693,21 +605,24 @@ IMB_JOB *aead_chacha20_poly1305(IMB_JOB *job, const IMB_ARCH arch, } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_sse(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_sse(IMB_MGR *mgr, IMB_JOB *job) { (void) mgr; return aead_chacha20_poly1305(job, IMB_ARCH_SSE, 0); } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_avx(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_avx(IMB_MGR *mgr, IMB_JOB *job) { (void) mgr; return aead_chacha20_poly1305(job, IMB_ARCH_AVX, 0); } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_avx2(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_avx2(IMB_MGR *mgr, IMB_JOB *job) { if (mgr->features & IMB_FEATURE_AVX_IFMA) return aead_chacha20_poly1305(job, IMB_ARCH_AVX2, 1); @@ -716,7 +631,8 @@ IMB_JOB *aead_chacha20_poly1305_avx2(IMB_MGR *mgr, IMB_JOB *job) } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_avx512(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_avx512(IMB_MGR *mgr, IMB_JOB *job) { if (mgr->features & IMB_FEATURE_AVX512_IFMA) return aead_chacha20_poly1305(job, IMB_ARCH_AVX512, 1); @@ -725,21 +641,24 @@ IMB_JOB *aead_chacha20_poly1305_avx512(IMB_MGR *mgr, IMB_JOB *job) } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_sgl_sse(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_sgl_sse(IMB_MGR *mgr, IMB_JOB *job) { (void) mgr; return aead_chacha20_poly1305_sgl(job, IMB_ARCH_SSE, 0); } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_sgl_avx(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_sgl_avx(IMB_MGR *mgr, IMB_JOB *job) { (void) mgr; return aead_chacha20_poly1305_sgl(job, IMB_ARCH_AVX, 0); } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_sgl_avx2(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_sgl_avx2(IMB_MGR *mgr, IMB_JOB *job) { if (mgr->features & IMB_FEATURE_AVX_IFMA) return aead_chacha20_poly1305_sgl(job, IMB_ARCH_AVX2, 1); @@ -748,7 +667,8 @@ IMB_JOB *aead_chacha20_poly1305_sgl_avx2(IMB_MGR *mgr, IMB_JOB *job) } IMB_DLL_LOCAL -IMB_JOB *aead_chacha20_poly1305_sgl_avx512(IMB_MGR *mgr, IMB_JOB *job) +IMB_JOB * +aead_chacha20_poly1305_sgl_avx512(IMB_MGR *mgr, IMB_JOB *job) { if (mgr->features & IMB_FEATURE_AVX512_IFMA) return aead_chacha20_poly1305_sgl(job, IMB_ARCH_AVX512, 1); @@ -757,222 +677,195 @@ IMB_JOB *aead_chacha20_poly1305_sgl_avx512(IMB_MGR *mgr, IMB_JOB *job) } IMB_DLL_LOCAL -void init_chacha20_poly1305_sse(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len) +void +init_chacha20_poly1305_sse(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len) { - init_chacha20_poly1305_direct(key, ctx, iv, aad, - aad_len, IMB_ARCH_SSE, 1, 0); + init_chacha20_poly1305_direct(key, ctx, iv, aad, aad_len, IMB_ARCH_SSE, 1, 0); } IMB_DLL_LOCAL -void init_chacha20_poly1305_avx(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len) +void +init_chacha20_poly1305_avx(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len) { - init_chacha20_poly1305_direct(key, ctx, iv, aad, - aad_len, IMB_ARCH_AVX, 1, 0); + init_chacha20_poly1305_direct(key, ctx, iv, aad, aad_len, IMB_ARCH_AVX, 1, 0); } IMB_DLL_LOCAL -void init_chacha20_poly1305_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len) +void +init_chacha20_poly1305_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len) { - init_chacha20_poly1305_direct(key, ctx, iv, aad, - aad_len, IMB_ARCH_AVX2, 1, 0); + init_chacha20_poly1305_direct(key, ctx, iv, aad, aad_len, IMB_ARCH_AVX2, 1, 0); } #ifdef AVX_IFMA IMB_DLL_LOCAL -void init_chacha20_poly1305_fma_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len) +void +init_chacha20_poly1305_fma_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len) { - init_chacha20_poly1305_direct(key, ctx, iv, aad, - aad_len, IMB_ARCH_AVX2, 1, 1); + init_chacha20_poly1305_direct(key, ctx, iv, aad, aad_len, IMB_ARCH_AVX2, 1, 1); } #endif IMB_DLL_LOCAL -void init_chacha20_poly1305_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len) +void +init_chacha20_poly1305_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len) { - init_chacha20_poly1305_direct(key, ctx, iv, aad, - aad_len, IMB_ARCH_AVX512, 1, 0); + init_chacha20_poly1305_direct(key, ctx, iv, aad, aad_len, IMB_ARCH_AVX512, 1, 0); } IMB_DLL_LOCAL -void init_chacha20_poly1305_fma_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - const void *iv, const void *aad, - const uint64_t aad_len) +void +init_chacha20_poly1305_fma_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + const void *iv, const void *aad, const uint64_t aad_len) { - init_chacha20_poly1305_direct(key, ctx, iv, aad, - aad_len, IMB_ARCH_AVX512, 1, 1); + init_chacha20_poly1305_direct(key, ctx, iv, aad, aad_len, IMB_ARCH_AVX512, 1, 1); } -void update_enc_chacha20_poly1305_sse(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_enc_chacha20_poly1305_sse(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_ENCRYPT, IMB_ARCH_SSE, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_ENCRYPT, IMB_ARCH_SSE, 1, + 0); } -void update_enc_chacha20_poly1305_avx(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_enc_chacha20_poly1305_avx(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_ENCRYPT, IMB_ARCH_AVX, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_ENCRYPT, IMB_ARCH_AVX, 1, + 0); } -void update_enc_chacha20_poly1305_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_enc_chacha20_poly1305_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_ENCRYPT, IMB_ARCH_AVX2, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_ENCRYPT, IMB_ARCH_AVX2, 1, + 0); } #ifdef AVX_IFMA -void update_enc_chacha20_poly1305_fma_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_enc_chacha20_poly1305_fma_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_ENCRYPT, IMB_ARCH_AVX2, 1, 1); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_ENCRYPT, IMB_ARCH_AVX2, 1, + 1); } #endif -void update_enc_chacha20_poly1305_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_enc_chacha20_poly1305_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_ENCRYPT, IMB_ARCH_AVX512, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_ENCRYPT, IMB_ARCH_AVX512, + 1, 0); } -void update_enc_chacha20_poly1305_fma_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_enc_chacha20_poly1305_fma_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_ENCRYPT, IMB_ARCH_AVX512, 1, 1); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_ENCRYPT, IMB_ARCH_AVX512, + 1, 1); } -void update_dec_chacha20_poly1305_sse(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_dec_chacha20_poly1305_sse(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_DECRYPT, IMB_ARCH_SSE, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_DECRYPT, IMB_ARCH_SSE, 1, + 0); } -void update_dec_chacha20_poly1305_avx(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_dec_chacha20_poly1305_avx(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_DECRYPT, IMB_ARCH_AVX, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_DECRYPT, IMB_ARCH_AVX, 1, + 0); } -void update_dec_chacha20_poly1305_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_dec_chacha20_poly1305_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_DECRYPT, IMB_ARCH_AVX2, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_DECRYPT, IMB_ARCH_AVX2, 1, + 0); } #ifdef AVX_IFMA -void update_dec_chacha20_poly1305_fma_avx2(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_dec_chacha20_poly1305_fma_avx2(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_DECRYPT, IMB_ARCH_AVX2, 1, 1); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_DECRYPT, IMB_ARCH_AVX2, 1, + 1); } #endif -void update_dec_chacha20_poly1305_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_dec_chacha20_poly1305_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_DECRYPT, IMB_ARCH_AVX512, 1, 0); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_DECRYPT, IMB_ARCH_AVX512, + 1, 0); } -void update_dec_chacha20_poly1305_fma_avx512(const void *key, - struct chacha20_poly1305_context_data *ctx, - void *dst, const void *src, - const uint64_t len) +void +update_dec_chacha20_poly1305_fma_avx512(const void *key, struct chacha20_poly1305_context_data *ctx, + void *dst, const void *src, const uint64_t len) { - update_chacha20_poly1305_direct(key, ctx, dst, src, len, - IMB_DIR_DECRYPT, IMB_ARCH_AVX512, 1, 1); + update_chacha20_poly1305_direct(key, ctx, dst, src, len, IMB_DIR_DECRYPT, IMB_ARCH_AVX512, + 1, 1); } -void finalize_chacha20_poly1305_sse(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len) +void +finalize_chacha20_poly1305_sse(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len) { - finalize_chacha20_poly1305_direct(ctx, tag, tag_len, - IMB_ARCH_SSE, 1, 0); + finalize_chacha20_poly1305_direct(ctx, tag, tag_len, IMB_ARCH_SSE, 1, 0); } -void finalize_chacha20_poly1305_avx(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len) +void +finalize_chacha20_poly1305_avx(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len) { - finalize_chacha20_poly1305_direct(ctx, tag, tag_len, - IMB_ARCH_AVX, 1, 0); + finalize_chacha20_poly1305_direct(ctx, tag, tag_len, IMB_ARCH_AVX, 1, 0); } -void finalize_chacha20_poly1305_avx2(struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len) +void +finalize_chacha20_poly1305_avx2(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len) { - finalize_chacha20_poly1305_direct(ctx, tag, tag_len, - IMB_ARCH_AVX2, 1, 0); + finalize_chacha20_poly1305_direct(ctx, tag, tag_len, IMB_ARCH_AVX2, 1, 0); } #ifdef AVX_IFMA -void finalize_chacha20_poly1305_fma_avx2(struct - chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len) +void +finalize_chacha20_poly1305_fma_avx2(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len) { - finalize_chacha20_poly1305_direct(ctx, tag, tag_len, - IMB_ARCH_AVX2, 1, 1); + finalize_chacha20_poly1305_direct(ctx, tag, tag_len, IMB_ARCH_AVX2, 1, 1); } #endif -void finalize_chacha20_poly1305_avx512( - struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len) +void +finalize_chacha20_poly1305_avx512(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len) { - finalize_chacha20_poly1305_direct(ctx, tag, tag_len, - IMB_ARCH_AVX512, 1, 0); + finalize_chacha20_poly1305_direct(ctx, tag, tag_len, IMB_ARCH_AVX512, 1, 0); } -void finalize_chacha20_poly1305_fma_avx512( - struct chacha20_poly1305_context_data *ctx, - void *tag, const uint64_t tag_len) +void +finalize_chacha20_poly1305_fma_avx512(struct chacha20_poly1305_context_data *ctx, void *tag, + const uint64_t tag_len) { - finalize_chacha20_poly1305_direct(ctx, tag, tag_len, - IMB_ARCH_AVX512, 1, 1); + finalize_chacha20_poly1305_direct(ctx, tag, tag_len, IMB_ARCH_AVX512, 1, 1); } diff --git a/lib/x86_64/cipher_suite_id.c b/lib/x86_64/cipher_suite_id.c index a8142be0..46da5222 100644 --- a/lib/x86_64/cipher_suite_id.c +++ b/lib/x86_64/cipher_suite_id.c @@ -33,7 +33,8 @@ #include #endif -IMB_DLL_EXPORT uint32_t imb_set_session(IMB_MGR *state, IMB_JOB *job) +IMB_DLL_EXPORT uint32_t +imb_set_session(IMB_MGR *state, IMB_JOB *job) { struct { uint16_t key_len; @@ -68,15 +69,14 @@ IMB_DLL_EXPORT uint32_t imb_set_session(IMB_MGR *state, IMB_JOB *job) */ extract.key_len = (uint16_t) job->key_len_in_bytes; extract.hash_alg = (uint16_t) job->hash_alg; - extract.cipher_mode = (uint16_t) job->cipher_mode ; + extract.cipher_mode = (uint16_t) job->cipher_mode; extract.cipher_dir = (uint16_t) job->cipher_direction; #ifndef __aarch64__ extract.counter = atomic_uint64_inc(&counter); #else extract.counter = atomic_fetch_add(&counter, 1); #endif - const uint32_t id = - IMB_CRC32_WIMAX_OFDMA_DATA(state, &extract, sizeof(extract)); + const uint32_t id = IMB_CRC32_WIMAX_OFDMA_DATA(state, &extract, sizeof(extract)); job->session_id = id; return id; diff --git a/lib/x86_64/cpu_feature.c b/lib/x86_64/cpu_feature.c index 2c0555dd..a70d7f72 100644 --- a/lib/x86_64/cpu_feature.c +++ b/lib/x86_64/cpu_feature.c @@ -48,107 +48,123 @@ static struct cpuid_regs cpuid_7_1; * [in] subleaf - CPUID sub-leaf number (ECX) * [out] out - registers structure to store results of CPUID into */ -void mbcpuid(const unsigned leaf, - const unsigned subleaf, - struct cpuid_regs *out); +void +mbcpuid(const unsigned leaf, const unsigned subleaf, struct cpuid_regs *out); -static uint32_t detect_shani(void) +static uint32_t +detect_shani(void) { /* Check presence of SHANI - bit 29 of EBX */ return (cpuid_7_0.ebx & (1UL << 29)); } -static uint32_t detect_aesni(void) +static uint32_t +detect_aesni(void) { /* Check presence of AESNI - bit 25 of ECX */ return (cpuid_1_0.ecx & (1UL << 25)); } -static uint32_t detect_pclmulqdq(void) +static uint32_t +detect_pclmulqdq(void) { /* Check presence of PCLMULQDQ - bit 1 of ECX */ return (cpuid_1_0.ecx & (1UL << 1)); } -static uint32_t detect_cmov(void) +static uint32_t +detect_cmov(void) { /* Check presence of CMOV - bit 15 of EDX */ return (cpuid_1_0.edx & (1UL << 15)); } -static uint32_t detect_sse42(void) +static uint32_t +detect_sse42(void) { /* Check presence of SSE4.2 - bit 20 of ECX */ return (cpuid_1_0.ecx & (1UL << 20)); } -static uint32_t detect_avx(void) +static uint32_t +detect_avx(void) { /* Check presence of AVX - bit 28 of ECX */ return (cpuid_1_0.ecx & (1UL << 28)); } -static uint32_t detect_avx2(void) +static uint32_t +detect_avx2(void) { /* Check presence of AVX2 - bit 5 of EBX */ return (cpuid_7_0.ebx & (1UL << 5)); } -static uint32_t detect_avx512f(void) +static uint32_t +detect_avx512f(void) { /* Check presence of AVX512F - bit 16 of EBX */ return (cpuid_7_0.ebx & (1UL << 16)); } -static uint32_t detect_avx512dq(void) +static uint32_t +detect_avx512dq(void) { /* Check presence of AVX512DQ - bit 17 of EBX */ return (cpuid_7_0.ebx & (1UL << 17)); } -static uint32_t detect_avx512cd(void) +static uint32_t +detect_avx512cd(void) { /* Check presence of AVX512CD - bit 28 of EBX */ return (cpuid_7_0.ebx & (1UL << 28)); } -static uint32_t detect_avx512bw(void) +static uint32_t +detect_avx512bw(void) { /* Check presence of AVX512BW - bit 30 of EBX */ return (cpuid_7_0.ebx & (1UL << 30)); } -static uint32_t detect_avx512vl(void) +static uint32_t +detect_avx512vl(void) { /* Check presence of AVX512VL - bit 31 of EBX */ return (cpuid_7_0.ebx & (1UL << 31)); } -static uint32_t detect_vaes(void) +static uint32_t +detect_vaes(void) { /* Check presence of VAES - bit 9 of ECX */ return (cpuid_7_0.ecx & (1UL << 9)); } -static uint32_t detect_vpclmulqdq(void) +static uint32_t +detect_vpclmulqdq(void) { /* Check presence of VAES - bit 10 of ECX */ return (cpuid_7_0.ecx & (1UL << 10)); } -static uint32_t detect_gfni(void) +static uint32_t +detect_gfni(void) { /* Check presence of GFNI - bit 8 of ECX */ return (cpuid_7_0.ecx & (1UL << 8)); } -static uint32_t detect_avx512_ifma(void) +static uint32_t +detect_avx512_ifma(void) { /* Check presence of AVX512-IFMA - bit 21 of EBX */ return (cpuid_7_0.ebx & (1UL << 21)); } -static uint32_t detect_avx_ifma(void) +static uint32_t +detect_avx_ifma(void) { /* Check presence of AVX-IFMA - bit 23 of EAX */ #ifdef AVX_IFMA @@ -158,13 +174,15 @@ static uint32_t detect_avx_ifma(void) #endif } -static uint32_t detect_bmi2(void) +static uint32_t +detect_bmi2(void) { /* Check presence of BMI2 - bit 8 of EBX */ return (cpuid_7_0.ebx & (1UL << 8)); } -uint64_t cpu_feature_detect(void) +uint64_t +cpu_feature_detect(void) { static const struct { unsigned req_leaf_number; @@ -230,7 +248,8 @@ uint64_t cpu_feature_detect(void) return features; } -uint64_t cpu_feature_adjust(const uint64_t flags, uint64_t features) +uint64_t +cpu_feature_adjust(const uint64_t flags, uint64_t features) { if (flags & IMB_FLAG_SHANI_OFF) features &= ~IMB_FEATURE_SHANI; @@ -245,7 +264,8 @@ uint64_t cpu_feature_adjust(const uint64_t flags, uint64_t features) } /* External function to retrieve feature flags */ -uint64_t imb_get_feature_flags(void) +uint64_t +imb_get_feature_flags(void) { return cpu_feature_detect(); } diff --git a/lib/x86_64/des_basic.c b/lib/x86_64/des_basic.c index 2a08ccea..d1350762 100644 --- a/lib/x86_64/des_basic.c +++ b/lib/x86_64/des_basic.c @@ -37,9 +37,8 @@ #include "include/constant_lookup.h" #include "include/memcpy.h" -__forceinline -void permute_operation(uint32_t *pa, uint32_t *pb, - const uint32_t n, const uint32_t m) +__forceinline void +permute_operation(uint32_t *pa, uint32_t *pb, const uint32_t n, const uint32_t m) { register uint32_t t = (*pb ^ (*pa >> n)) & m; @@ -48,8 +47,8 @@ void permute_operation(uint32_t *pa, uint32_t *pb, } /* initial permutation */ -__forceinline -void ip_z(uint32_t *pl, uint32_t *pr) +__forceinline void +ip_z(uint32_t *pl, uint32_t *pr) { permute_operation(pr, pl, 4, 0x0f0f0f0f); permute_operation(pl, pr, 16, 0x0000ffff); @@ -59,8 +58,8 @@ void ip_z(uint32_t *pl, uint32_t *pr) } /* final permutation */ -__forceinline -void fp_z(uint32_t *pl, uint32_t *pr) +__forceinline void +fp_z(uint32_t *pl, uint32_t *pr) { permute_operation(pl, pr, 1, 0x55555555); permute_operation(pr, pl, 8, 0x00ff00ff); @@ -72,8 +71,8 @@ void fp_z(uint32_t *pl, uint32_t *pr) /* 1st part of DES round * - permutes and exands R(32 bits) into 48 bits */ -__forceinline -uint64_t e_phase(const uint64_t R) +__forceinline uint64_t +e_phase(const uint64_t R) { /* E phase as in FIPS46-3 and also 8x6 to 8x8 expansion. * @@ -89,298 +88,166 @@ uint64_t e_phase(const uint64_t R) * where 'X' is bit value 0. */ return ((R << 1) & UINT64_C(0x3e)) | ((R >> 31) & UINT64_C(1)) | - ((R << 5) & UINT64_C(0x3f00)) | - ((R << 9) & UINT64_C(0x3f0000)) | - ((R << 13) & UINT64_C(0x3f000000)) | - ((R << 17) & UINT64_C(0x3f00000000)) | - ((R << 21) & UINT64_C(0x3f0000000000)) | - ((R << 25) & UINT64_C(0x3f000000000000)) | - ((R << 29) & UINT64_C(0x1f00000000000000)) | - ((R & UINT64_C(1)) << 61); + ((R << 5) & UINT64_C(0x3f00)) | ((R << 9) & UINT64_C(0x3f0000)) | + ((R << 13) & UINT64_C(0x3f000000)) | ((R << 17) & UINT64_C(0x3f00000000)) | + ((R << 21) & UINT64_C(0x3f0000000000)) | ((R << 25) & UINT64_C(0x3f000000000000)) | + ((R << 29) & UINT64_C(0x1f00000000000000)) | ((R & UINT64_C(1)) << 61); } static const uint32_t sbox0p[64] = { - UINT32_C(0x00410100), UINT32_C(0x00010000), - UINT32_C(0x40400000), UINT32_C(0x40410100), - UINT32_C(0x00400000), UINT32_C(0x40010100), - UINT32_C(0x40010000), UINT32_C(0x40400000), - UINT32_C(0x40010100), UINT32_C(0x00410100), - UINT32_C(0x00410000), UINT32_C(0x40000100), - UINT32_C(0x40400100), UINT32_C(0x00400000), - UINT32_C(0x00000000), UINT32_C(0x40010000), - UINT32_C(0x00010000), UINT32_C(0x40000000), - UINT32_C(0x00400100), UINT32_C(0x00010100), - UINT32_C(0x40410100), UINT32_C(0x00410000), - UINT32_C(0x40000100), UINT32_C(0x00400100), - UINT32_C(0x40000000), UINT32_C(0x00000100), - UINT32_C(0x00010100), UINT32_C(0x40410000), - UINT32_C(0x00000100), UINT32_C(0x40400100), - UINT32_C(0x40410000), UINT32_C(0x00000000), - UINT32_C(0x00000000), UINT32_C(0x40410100), - UINT32_C(0x00400100), UINT32_C(0x40010000), - UINT32_C(0x00410100), UINT32_C(0x00010000), - UINT32_C(0x40000100), UINT32_C(0x00400100), - UINT32_C(0x40410000), UINT32_C(0x00000100), - UINT32_C(0x00010100), UINT32_C(0x40400000), - UINT32_C(0x40010100), UINT32_C(0x40000000), - UINT32_C(0x40400000), UINT32_C(0x00410000), - UINT32_C(0x40410100), UINT32_C(0x00010100), - UINT32_C(0x00410000), UINT32_C(0x40400100), - UINT32_C(0x00400000), UINT32_C(0x40000100), - UINT32_C(0x40010000), UINT32_C(0x00000000), - UINT32_C(0x00010000), UINT32_C(0x00400000), - UINT32_C(0x40400100), UINT32_C(0x00410100), - UINT32_C(0x40000000), UINT32_C(0x40410000), - UINT32_C(0x00000100), UINT32_C(0x40010100) + UINT32_C(0x00410100), UINT32_C(0x00010000), UINT32_C(0x40400000), UINT32_C(0x40410100), + UINT32_C(0x00400000), UINT32_C(0x40010100), UINT32_C(0x40010000), UINT32_C(0x40400000), + UINT32_C(0x40010100), UINT32_C(0x00410100), UINT32_C(0x00410000), UINT32_C(0x40000100), + UINT32_C(0x40400100), UINT32_C(0x00400000), UINT32_C(0x00000000), UINT32_C(0x40010000), + UINT32_C(0x00010000), UINT32_C(0x40000000), UINT32_C(0x00400100), UINT32_C(0x00010100), + UINT32_C(0x40410100), UINT32_C(0x00410000), UINT32_C(0x40000100), UINT32_C(0x00400100), + UINT32_C(0x40000000), UINT32_C(0x00000100), UINT32_C(0x00010100), UINT32_C(0x40410000), + UINT32_C(0x00000100), UINT32_C(0x40400100), UINT32_C(0x40410000), UINT32_C(0x00000000), + UINT32_C(0x00000000), UINT32_C(0x40410100), UINT32_C(0x00400100), UINT32_C(0x40010000), + UINT32_C(0x00410100), UINT32_C(0x00010000), UINT32_C(0x40000100), UINT32_C(0x00400100), + UINT32_C(0x40410000), UINT32_C(0x00000100), UINT32_C(0x00010100), UINT32_C(0x40400000), + UINT32_C(0x40010100), UINT32_C(0x40000000), UINT32_C(0x40400000), UINT32_C(0x00410000), + UINT32_C(0x40410100), UINT32_C(0x00010100), UINT32_C(0x00410000), UINT32_C(0x40400100), + UINT32_C(0x00400000), UINT32_C(0x40000100), UINT32_C(0x40010000), UINT32_C(0x00000000), + UINT32_C(0x00010000), UINT32_C(0x00400000), UINT32_C(0x40400100), UINT32_C(0x00410100), + UINT32_C(0x40000000), UINT32_C(0x40410000), UINT32_C(0x00000100), UINT32_C(0x40010100) }; static const uint32_t sbox1p[64] = { - UINT32_C(0x08021002), UINT32_C(0x00000000), - UINT32_C(0x00021000), UINT32_C(0x08020000), - UINT32_C(0x08000002), UINT32_C(0x00001002), - UINT32_C(0x08001000), UINT32_C(0x00021000), - UINT32_C(0x00001000), UINT32_C(0x08020002), - UINT32_C(0x00000002), UINT32_C(0x08001000), - UINT32_C(0x00020002), UINT32_C(0x08021000), - UINT32_C(0x08020000), UINT32_C(0x00000002), - UINT32_C(0x00020000), UINT32_C(0x08001002), - UINT32_C(0x08020002), UINT32_C(0x00001000), - UINT32_C(0x00021002), UINT32_C(0x08000000), - UINT32_C(0x00000000), UINT32_C(0x00020002), - UINT32_C(0x08001002), UINT32_C(0x00021002), - UINT32_C(0x08021000), UINT32_C(0x08000002), - UINT32_C(0x08000000), UINT32_C(0x00020000), - UINT32_C(0x00001002), UINT32_C(0x08021002), - UINT32_C(0x00020002), UINT32_C(0x08021000), - UINT32_C(0x08001000), UINT32_C(0x00021002), - UINT32_C(0x08021002), UINT32_C(0x00020002), - UINT32_C(0x08000002), UINT32_C(0x00000000), - UINT32_C(0x08000000), UINT32_C(0x00001002), - UINT32_C(0x00020000), UINT32_C(0x08020002), - UINT32_C(0x00001000), UINT32_C(0x08000000), - UINT32_C(0x00021002), UINT32_C(0x08001002), - UINT32_C(0x08021000), UINT32_C(0x00001000), - UINT32_C(0x00000000), UINT32_C(0x08000002), - UINT32_C(0x00000002), UINT32_C(0x08021002), - UINT32_C(0x00021000), UINT32_C(0x08020000), - UINT32_C(0x08020002), UINT32_C(0x00020000), - UINT32_C(0x00001002), UINT32_C(0x08001000), - UINT32_C(0x08001002), UINT32_C(0x00000002), - UINT32_C(0x08020000), UINT32_C(0x00021000) + UINT32_C(0x08021002), UINT32_C(0x00000000), UINT32_C(0x00021000), UINT32_C(0x08020000), + UINT32_C(0x08000002), UINT32_C(0x00001002), UINT32_C(0x08001000), UINT32_C(0x00021000), + UINT32_C(0x00001000), UINT32_C(0x08020002), UINT32_C(0x00000002), UINT32_C(0x08001000), + UINT32_C(0x00020002), UINT32_C(0x08021000), UINT32_C(0x08020000), UINT32_C(0x00000002), + UINT32_C(0x00020000), UINT32_C(0x08001002), UINT32_C(0x08020002), UINT32_C(0x00001000), + UINT32_C(0x00021002), UINT32_C(0x08000000), UINT32_C(0x00000000), UINT32_C(0x00020002), + UINT32_C(0x08001002), UINT32_C(0x00021002), UINT32_C(0x08021000), UINT32_C(0x08000002), + UINT32_C(0x08000000), UINT32_C(0x00020000), UINT32_C(0x00001002), UINT32_C(0x08021002), + UINT32_C(0x00020002), UINT32_C(0x08021000), UINT32_C(0x08001000), UINT32_C(0x00021002), + UINT32_C(0x08021002), UINT32_C(0x00020002), UINT32_C(0x08000002), UINT32_C(0x00000000), + UINT32_C(0x08000000), UINT32_C(0x00001002), UINT32_C(0x00020000), UINT32_C(0x08020002), + UINT32_C(0x00001000), UINT32_C(0x08000000), UINT32_C(0x00021002), UINT32_C(0x08001002), + UINT32_C(0x08021000), UINT32_C(0x00001000), UINT32_C(0x00000000), UINT32_C(0x08000002), + UINT32_C(0x00000002), UINT32_C(0x08021002), UINT32_C(0x00021000), UINT32_C(0x08020000), + UINT32_C(0x08020002), UINT32_C(0x00020000), UINT32_C(0x00001002), UINT32_C(0x08001000), + UINT32_C(0x08001002), UINT32_C(0x00000002), UINT32_C(0x08020000), UINT32_C(0x00021000) }; static const uint32_t sbox2p[64] = { - UINT32_C(0x20800000), UINT32_C(0x00808020), - UINT32_C(0x00000020), UINT32_C(0x20800020), - UINT32_C(0x20008000), UINT32_C(0x00800000), - UINT32_C(0x20800020), UINT32_C(0x00008020), - UINT32_C(0x00800020), UINT32_C(0x00008000), - UINT32_C(0x00808000), UINT32_C(0x20000000), - UINT32_C(0x20808020), UINT32_C(0x20000020), - UINT32_C(0x20000000), UINT32_C(0x20808000), - UINT32_C(0x00000000), UINT32_C(0x20008000), - UINT32_C(0x00808020), UINT32_C(0x00000020), - UINT32_C(0x20000020), UINT32_C(0x20808020), - UINT32_C(0x00008000), UINT32_C(0x20800000), - UINT32_C(0x20808000), UINT32_C(0x00800020), - UINT32_C(0x20008020), UINT32_C(0x00808000), - UINT32_C(0x00008020), UINT32_C(0x00000000), - UINT32_C(0x00800000), UINT32_C(0x20008020), - UINT32_C(0x00808020), UINT32_C(0x00000020), - UINT32_C(0x20000000), UINT32_C(0x00008000), - UINT32_C(0x20000020), UINT32_C(0x20008000), - UINT32_C(0x00808000), UINT32_C(0x20800020), - UINT32_C(0x00000000), UINT32_C(0x00808020), - UINT32_C(0x00008020), UINT32_C(0x20808000), - UINT32_C(0x20008000), UINT32_C(0x00800000), - UINT32_C(0x20808020), UINT32_C(0x20000000), - UINT32_C(0x20008020), UINT32_C(0x20800000), - UINT32_C(0x00800000), UINT32_C(0x20808020), - UINT32_C(0x00008000), UINT32_C(0x00800020), - UINT32_C(0x20800020), UINT32_C(0x00008020), - UINT32_C(0x00800020), UINT32_C(0x00000000), - UINT32_C(0x20808000), UINT32_C(0x20000020), - UINT32_C(0x20800000), UINT32_C(0x20008020), - UINT32_C(0x00000020), UINT32_C(0x00808000) + UINT32_C(0x20800000), UINT32_C(0x00808020), UINT32_C(0x00000020), UINT32_C(0x20800020), + UINT32_C(0x20008000), UINT32_C(0x00800000), UINT32_C(0x20800020), UINT32_C(0x00008020), + UINT32_C(0x00800020), UINT32_C(0x00008000), UINT32_C(0x00808000), UINT32_C(0x20000000), + UINT32_C(0x20808020), UINT32_C(0x20000020), UINT32_C(0x20000000), UINT32_C(0x20808000), + UINT32_C(0x00000000), UINT32_C(0x20008000), UINT32_C(0x00808020), UINT32_C(0x00000020), + UINT32_C(0x20000020), UINT32_C(0x20808020), UINT32_C(0x00008000), UINT32_C(0x20800000), + UINT32_C(0x20808000), UINT32_C(0x00800020), UINT32_C(0x20008020), UINT32_C(0x00808000), + UINT32_C(0x00008020), UINT32_C(0x00000000), UINT32_C(0x00800000), UINT32_C(0x20008020), + UINT32_C(0x00808020), UINT32_C(0x00000020), UINT32_C(0x20000000), UINT32_C(0x00008000), + UINT32_C(0x20000020), UINT32_C(0x20008000), UINT32_C(0x00808000), UINT32_C(0x20800020), + UINT32_C(0x00000000), UINT32_C(0x00808020), UINT32_C(0x00008020), UINT32_C(0x20808000), + UINT32_C(0x20008000), UINT32_C(0x00800000), UINT32_C(0x20808020), UINT32_C(0x20000000), + UINT32_C(0x20008020), UINT32_C(0x20800000), UINT32_C(0x00800000), UINT32_C(0x20808020), + UINT32_C(0x00008000), UINT32_C(0x00800020), UINT32_C(0x20800020), UINT32_C(0x00008020), + UINT32_C(0x00800020), UINT32_C(0x00000000), UINT32_C(0x20808000), UINT32_C(0x20000020), + UINT32_C(0x20800000), UINT32_C(0x20008020), UINT32_C(0x00000020), UINT32_C(0x00808000) }; static const uint32_t sbox3p[64] = { - UINT32_C(0x00080201), UINT32_C(0x02000200), - UINT32_C(0x00000001), UINT32_C(0x02080201), - UINT32_C(0x00000000), UINT32_C(0x02080000), - UINT32_C(0x02000201), UINT32_C(0x00080001), - UINT32_C(0x02080200), UINT32_C(0x02000001), - UINT32_C(0x02000000), UINT32_C(0x00000201), - UINT32_C(0x02000001), UINT32_C(0x00080201), - UINT32_C(0x00080000), UINT32_C(0x02000000), - UINT32_C(0x02080001), UINT32_C(0x00080200), - UINT32_C(0x00000200), UINT32_C(0x00000001), - UINT32_C(0x00080200), UINT32_C(0x02000201), - UINT32_C(0x02080000), UINT32_C(0x00000200), - UINT32_C(0x00000201), UINT32_C(0x00000000), - UINT32_C(0x00080001), UINT32_C(0x02080200), - UINT32_C(0x02000200), UINT32_C(0x02080001), - UINT32_C(0x02080201), UINT32_C(0x00080000), - UINT32_C(0x02080001), UINT32_C(0x00000201), - UINT32_C(0x00080000), UINT32_C(0x02000001), - UINT32_C(0x00080200), UINT32_C(0x02000200), - UINT32_C(0x00000001), UINT32_C(0x02080000), - UINT32_C(0x02000201), UINT32_C(0x00000000), - UINT32_C(0x00000200), UINT32_C(0x00080001), - UINT32_C(0x00000000), UINT32_C(0x02080001), - UINT32_C(0x02080200), UINT32_C(0x00000200), - UINT32_C(0x02000000), UINT32_C(0x02080201), - UINT32_C(0x00080201), UINT32_C(0x00080000), - UINT32_C(0x02080201), UINT32_C(0x00000001), - UINT32_C(0x02000200), UINT32_C(0x00080201), - UINT32_C(0x00080001), UINT32_C(0x00080200), - UINT32_C(0x02080000), UINT32_C(0x02000201), - UINT32_C(0x00000201), UINT32_C(0x02000000), - UINT32_C(0x02000001), UINT32_C(0x02080200) + UINT32_C(0x00080201), UINT32_C(0x02000200), UINT32_C(0x00000001), UINT32_C(0x02080201), + UINT32_C(0x00000000), UINT32_C(0x02080000), UINT32_C(0x02000201), UINT32_C(0x00080001), + UINT32_C(0x02080200), UINT32_C(0x02000001), UINT32_C(0x02000000), UINT32_C(0x00000201), + UINT32_C(0x02000001), UINT32_C(0x00080201), UINT32_C(0x00080000), UINT32_C(0x02000000), + UINT32_C(0x02080001), UINT32_C(0x00080200), UINT32_C(0x00000200), UINT32_C(0x00000001), + UINT32_C(0x00080200), UINT32_C(0x02000201), UINT32_C(0x02080000), UINT32_C(0x00000200), + UINT32_C(0x00000201), UINT32_C(0x00000000), UINT32_C(0x00080001), UINT32_C(0x02080200), + UINT32_C(0x02000200), UINT32_C(0x02080001), UINT32_C(0x02080201), UINT32_C(0x00080000), + UINT32_C(0x02080001), UINT32_C(0x00000201), UINT32_C(0x00080000), UINT32_C(0x02000001), + UINT32_C(0x00080200), UINT32_C(0x02000200), UINT32_C(0x00000001), UINT32_C(0x02080000), + UINT32_C(0x02000201), UINT32_C(0x00000000), UINT32_C(0x00000200), UINT32_C(0x00080001), + UINT32_C(0x00000000), UINT32_C(0x02080001), UINT32_C(0x02080200), UINT32_C(0x00000200), + UINT32_C(0x02000000), UINT32_C(0x02080201), UINT32_C(0x00080201), UINT32_C(0x00080000), + UINT32_C(0x02080201), UINT32_C(0x00000001), UINT32_C(0x02000200), UINT32_C(0x00080201), + UINT32_C(0x00080001), UINT32_C(0x00080200), UINT32_C(0x02080000), UINT32_C(0x02000201), + UINT32_C(0x00000201), UINT32_C(0x02000000), UINT32_C(0x02000001), UINT32_C(0x02080200) }; static const uint32_t sbox4p[64] = { - UINT32_C(0x01000000), UINT32_C(0x00002000), - UINT32_C(0x00000080), UINT32_C(0x01002084), - UINT32_C(0x01002004), UINT32_C(0x01000080), - UINT32_C(0x00002084), UINT32_C(0x01002000), - UINT32_C(0x00002000), UINT32_C(0x00000004), - UINT32_C(0x01000004), UINT32_C(0x00002080), - UINT32_C(0x01000084), UINT32_C(0x01002004), - UINT32_C(0x01002080), UINT32_C(0x00000000), - UINT32_C(0x00002080), UINT32_C(0x01000000), - UINT32_C(0x00002004), UINT32_C(0x00000084), - UINT32_C(0x01000080), UINT32_C(0x00002084), - UINT32_C(0x00000000), UINT32_C(0x01000004), - UINT32_C(0x00000004), UINT32_C(0x01000084), - UINT32_C(0x01002084), UINT32_C(0x00002004), - UINT32_C(0x01002000), UINT32_C(0x00000080), - UINT32_C(0x00000084), UINT32_C(0x01002080), - UINT32_C(0x01002080), UINT32_C(0x01000084), - UINT32_C(0x00002004), UINT32_C(0x01002000), - UINT32_C(0x00002000), UINT32_C(0x00000004), - UINT32_C(0x01000004), UINT32_C(0x01000080), - UINT32_C(0x01000000), UINT32_C(0x00002080), - UINT32_C(0x01002084), UINT32_C(0x00000000), - UINT32_C(0x00002084), UINT32_C(0x01000000), - UINT32_C(0x00000080), UINT32_C(0x00002004), - UINT32_C(0x01000084), UINT32_C(0x00000080), - UINT32_C(0x00000000), UINT32_C(0x01002084), - UINT32_C(0x01002004), UINT32_C(0x01002080), - UINT32_C(0x00000084), UINT32_C(0x00002000), - UINT32_C(0x00002080), UINT32_C(0x01002004), - UINT32_C(0x01000080), UINT32_C(0x00000084), - UINT32_C(0x00000004), UINT32_C(0x00002084), - UINT32_C(0x01002000), UINT32_C(0x01000004) + UINT32_C(0x01000000), UINT32_C(0x00002000), UINT32_C(0x00000080), UINT32_C(0x01002084), + UINT32_C(0x01002004), UINT32_C(0x01000080), UINT32_C(0x00002084), UINT32_C(0x01002000), + UINT32_C(0x00002000), UINT32_C(0x00000004), UINT32_C(0x01000004), UINT32_C(0x00002080), + UINT32_C(0x01000084), UINT32_C(0x01002004), UINT32_C(0x01002080), UINT32_C(0x00000000), + UINT32_C(0x00002080), UINT32_C(0x01000000), UINT32_C(0x00002004), UINT32_C(0x00000084), + UINT32_C(0x01000080), UINT32_C(0x00002084), UINT32_C(0x00000000), UINT32_C(0x01000004), + UINT32_C(0x00000004), UINT32_C(0x01000084), UINT32_C(0x01002084), UINT32_C(0x00002004), + UINT32_C(0x01002000), UINT32_C(0x00000080), UINT32_C(0x00000084), UINT32_C(0x01002080), + UINT32_C(0x01002080), UINT32_C(0x01000084), UINT32_C(0x00002004), UINT32_C(0x01002000), + UINT32_C(0x00002000), UINT32_C(0x00000004), UINT32_C(0x01000004), UINT32_C(0x01000080), + UINT32_C(0x01000000), UINT32_C(0x00002080), UINT32_C(0x01002084), UINT32_C(0x00000000), + UINT32_C(0x00002084), UINT32_C(0x01000000), UINT32_C(0x00000080), UINT32_C(0x00002004), + UINT32_C(0x01000084), UINT32_C(0x00000080), UINT32_C(0x00000000), UINT32_C(0x01002084), + UINT32_C(0x01002004), UINT32_C(0x01002080), UINT32_C(0x00000084), UINT32_C(0x00002000), + UINT32_C(0x00002080), UINT32_C(0x01002004), UINT32_C(0x01000080), UINT32_C(0x00000084), + UINT32_C(0x00000004), UINT32_C(0x00002084), UINT32_C(0x01002000), UINT32_C(0x01000004) }; const uint32_t sbox5p[64] = { - UINT32_C(0x10000008), UINT32_C(0x00040008), - UINT32_C(0x00000000), UINT32_C(0x10040400), - UINT32_C(0x00040008), UINT32_C(0x00000400), - UINT32_C(0x10000408), UINT32_C(0x00040000), - UINT32_C(0x00000408), UINT32_C(0x10040408), - UINT32_C(0x00040400), UINT32_C(0x10000000), - UINT32_C(0x10000400), UINT32_C(0x10000008), - UINT32_C(0x10040000), UINT32_C(0x00040408), - UINT32_C(0x00040000), UINT32_C(0x10000408), - UINT32_C(0x10040008), UINT32_C(0x00000000), - UINT32_C(0x00000400), UINT32_C(0x00000008), - UINT32_C(0x10040400), UINT32_C(0x10040008), - UINT32_C(0x10040408), UINT32_C(0x10040000), - UINT32_C(0x10000000), UINT32_C(0x00000408), - UINT32_C(0x00000008), UINT32_C(0x00040400), - UINT32_C(0x00040408), UINT32_C(0x10000400), - UINT32_C(0x00000408), UINT32_C(0x10000000), - UINT32_C(0x10000400), UINT32_C(0x00040408), - UINT32_C(0x10040400), UINT32_C(0x00040008), - UINT32_C(0x00000000), UINT32_C(0x10000400), - UINT32_C(0x10000000), UINT32_C(0x00000400), - UINT32_C(0x10040008), UINT32_C(0x00040000), - UINT32_C(0x00040008), UINT32_C(0x10040408), - UINT32_C(0x00040400), UINT32_C(0x00000008), - UINT32_C(0x10040408), UINT32_C(0x00040400), - UINT32_C(0x00040000), UINT32_C(0x10000408), - UINT32_C(0x10000008), UINT32_C(0x10040000), - UINT32_C(0x00040408), UINT32_C(0x00000000), - UINT32_C(0x00000400), UINT32_C(0x10000008), - UINT32_C(0x10000408), UINT32_C(0x10040400), - UINT32_C(0x10040000), UINT32_C(0x00000408), - UINT32_C(0x00000008), UINT32_C(0x10040008) + UINT32_C(0x10000008), UINT32_C(0x00040008), UINT32_C(0x00000000), UINT32_C(0x10040400), + UINT32_C(0x00040008), UINT32_C(0x00000400), UINT32_C(0x10000408), UINT32_C(0x00040000), + UINT32_C(0x00000408), UINT32_C(0x10040408), UINT32_C(0x00040400), UINT32_C(0x10000000), + UINT32_C(0x10000400), UINT32_C(0x10000008), UINT32_C(0x10040000), UINT32_C(0x00040408), + UINT32_C(0x00040000), UINT32_C(0x10000408), UINT32_C(0x10040008), UINT32_C(0x00000000), + UINT32_C(0x00000400), UINT32_C(0x00000008), UINT32_C(0x10040400), UINT32_C(0x10040008), + UINT32_C(0x10040408), UINT32_C(0x10040000), UINT32_C(0x10000000), UINT32_C(0x00000408), + UINT32_C(0x00000008), UINT32_C(0x00040400), UINT32_C(0x00040408), UINT32_C(0x10000400), + UINT32_C(0x00000408), UINT32_C(0x10000000), UINT32_C(0x10000400), UINT32_C(0x00040408), + UINT32_C(0x10040400), UINT32_C(0x00040008), UINT32_C(0x00000000), UINT32_C(0x10000400), + UINT32_C(0x10000000), UINT32_C(0x00000400), UINT32_C(0x10040008), UINT32_C(0x00040000), + UINT32_C(0x00040008), UINT32_C(0x10040408), UINT32_C(0x00040400), UINT32_C(0x00000008), + UINT32_C(0x10040408), UINT32_C(0x00040400), UINT32_C(0x00040000), UINT32_C(0x10000408), + UINT32_C(0x10000008), UINT32_C(0x10040000), UINT32_C(0x00040408), UINT32_C(0x00000000), + UINT32_C(0x00000400), UINT32_C(0x10000008), UINT32_C(0x10000408), UINT32_C(0x10040400), + UINT32_C(0x10040000), UINT32_C(0x00000408), UINT32_C(0x00000008), UINT32_C(0x10040008) }; static const uint32_t sbox6p[64] = { - UINT32_C(0x00000800), UINT32_C(0x00000040), - UINT32_C(0x00200040), UINT32_C(0x80200000), - UINT32_C(0x80200840), UINT32_C(0x80000800), - UINT32_C(0x00000840), UINT32_C(0x00000000), - UINT32_C(0x00200000), UINT32_C(0x80200040), - UINT32_C(0x80000040), UINT32_C(0x00200800), - UINT32_C(0x80000000), UINT32_C(0x00200840), - UINT32_C(0x00200800), UINT32_C(0x80000040), - UINT32_C(0x80200040), UINT32_C(0x00000800), - UINT32_C(0x80000800), UINT32_C(0x80200840), - UINT32_C(0x00000000), UINT32_C(0x00200040), - UINT32_C(0x80200000), UINT32_C(0x00000840), - UINT32_C(0x80200800), UINT32_C(0x80000840), - UINT32_C(0x00200840), UINT32_C(0x80000000), - UINT32_C(0x80000840), UINT32_C(0x80200800), - UINT32_C(0x00000040), UINT32_C(0x00200000), - UINT32_C(0x80000840), UINT32_C(0x00200800), - UINT32_C(0x80200800), UINT32_C(0x80000040), - UINT32_C(0x00000800), UINT32_C(0x00000040), - UINT32_C(0x00200000), UINT32_C(0x80200800), - UINT32_C(0x80200040), UINT32_C(0x80000840), - UINT32_C(0x00000840), UINT32_C(0x00000000), - UINT32_C(0x00000040), UINT32_C(0x80200000), - UINT32_C(0x80000000), UINT32_C(0x00200040), - UINT32_C(0x00000000), UINT32_C(0x80200040), - UINT32_C(0x00200040), UINT32_C(0x00000840), - UINT32_C(0x80000040), UINT32_C(0x00000800), - UINT32_C(0x80200840), UINT32_C(0x00200000), - UINT32_C(0x00200840), UINT32_C(0x80000000), - UINT32_C(0x80000800), UINT32_C(0x80200840), - UINT32_C(0x80200000), UINT32_C(0x00200840), - UINT32_C(0x00200800), UINT32_C(0x80000800) + UINT32_C(0x00000800), UINT32_C(0x00000040), UINT32_C(0x00200040), UINT32_C(0x80200000), + UINT32_C(0x80200840), UINT32_C(0x80000800), UINT32_C(0x00000840), UINT32_C(0x00000000), + UINT32_C(0x00200000), UINT32_C(0x80200040), UINT32_C(0x80000040), UINT32_C(0x00200800), + UINT32_C(0x80000000), UINT32_C(0x00200840), UINT32_C(0x00200800), UINT32_C(0x80000040), + UINT32_C(0x80200040), UINT32_C(0x00000800), UINT32_C(0x80000800), UINT32_C(0x80200840), + UINT32_C(0x00000000), UINT32_C(0x00200040), UINT32_C(0x80200000), UINT32_C(0x00000840), + UINT32_C(0x80200800), UINT32_C(0x80000840), UINT32_C(0x00200840), UINT32_C(0x80000000), + UINT32_C(0x80000840), UINT32_C(0x80200800), UINT32_C(0x00000040), UINT32_C(0x00200000), + UINT32_C(0x80000840), UINT32_C(0x00200800), UINT32_C(0x80200800), UINT32_C(0x80000040), + UINT32_C(0x00000800), UINT32_C(0x00000040), UINT32_C(0x00200000), UINT32_C(0x80200800), + UINT32_C(0x80200040), UINT32_C(0x80000840), UINT32_C(0x00000840), UINT32_C(0x00000000), + UINT32_C(0x00000040), UINT32_C(0x80200000), UINT32_C(0x80000000), UINT32_C(0x00200040), + UINT32_C(0x00000000), UINT32_C(0x80200040), UINT32_C(0x00200040), UINT32_C(0x00000840), + UINT32_C(0x80000040), UINT32_C(0x00000800), UINT32_C(0x80200840), UINT32_C(0x00200000), + UINT32_C(0x00200840), UINT32_C(0x80000000), UINT32_C(0x80000800), UINT32_C(0x80200840), + UINT32_C(0x80200000), UINT32_C(0x00200840), UINT32_C(0x00200800), UINT32_C(0x80000800) }; static const uint32_t sbox7p[64] = { - UINT32_C(0x04100010), UINT32_C(0x04104000), - UINT32_C(0x00004010), UINT32_C(0x00000000), - UINT32_C(0x04004000), UINT32_C(0x00100010), - UINT32_C(0x04100000), UINT32_C(0x04104010), - UINT32_C(0x00000010), UINT32_C(0x04000000), - UINT32_C(0x00104000), UINT32_C(0x00004010), - UINT32_C(0x00104010), UINT32_C(0x04004010), - UINT32_C(0x04000010), UINT32_C(0x04100000), - UINT32_C(0x00004000), UINT32_C(0x00104010), - UINT32_C(0x00100010), UINT32_C(0x04004000), - UINT32_C(0x04104010), UINT32_C(0x04000010), - UINT32_C(0x00000000), UINT32_C(0x00104000), - UINT32_C(0x04000000), UINT32_C(0x00100000), - UINT32_C(0x04004010), UINT32_C(0x04100010), - UINT32_C(0x00100000), UINT32_C(0x00004000), - UINT32_C(0x04104000), UINT32_C(0x00000010), - UINT32_C(0x00100000), UINT32_C(0x00004000), - UINT32_C(0x04000010), UINT32_C(0x04104010), - UINT32_C(0x00004010), UINT32_C(0x04000000), - UINT32_C(0x00000000), UINT32_C(0x00104000), - UINT32_C(0x04100010), UINT32_C(0x04004010), - UINT32_C(0x04004000), UINT32_C(0x00100010), - UINT32_C(0x04104000), UINT32_C(0x00000010), - UINT32_C(0x00100010), UINT32_C(0x04004000), - UINT32_C(0x04104010), UINT32_C(0x00100000), - UINT32_C(0x04100000), UINT32_C(0x04000010), - UINT32_C(0x00104000), UINT32_C(0x00004010), - UINT32_C(0x04004010), UINT32_C(0x04100000), - UINT32_C(0x00000010), UINT32_C(0x04104000), - UINT32_C(0x00104010), UINT32_C(0x00000000), - UINT32_C(0x04000000), UINT32_C(0x04100010), - UINT32_C(0x00004000), UINT32_C(0x00104010) + UINT32_C(0x04100010), UINT32_C(0x04104000), UINT32_C(0x00004010), UINT32_C(0x00000000), + UINT32_C(0x04004000), UINT32_C(0x00100010), UINT32_C(0x04100000), UINT32_C(0x04104010), + UINT32_C(0x00000010), UINT32_C(0x04000000), UINT32_C(0x00104000), UINT32_C(0x00004010), + UINT32_C(0x00104010), UINT32_C(0x04004010), UINT32_C(0x04000010), UINT32_C(0x04100000), + UINT32_C(0x00004000), UINT32_C(0x00104010), UINT32_C(0x00100010), UINT32_C(0x04004000), + UINT32_C(0x04104010), UINT32_C(0x04000010), UINT32_C(0x00000000), UINT32_C(0x00104000), + UINT32_C(0x04000000), UINT32_C(0x00100000), UINT32_C(0x04004010), UINT32_C(0x04100010), + UINT32_C(0x00100000), UINT32_C(0x00004000), UINT32_C(0x04104000), UINT32_C(0x00000010), + UINT32_C(0x00100000), UINT32_C(0x00004000), UINT32_C(0x04000010), UINT32_C(0x04104010), + UINT32_C(0x00004010), UINT32_C(0x04000000), UINT32_C(0x00000000), UINT32_C(0x00104000), + UINT32_C(0x04100010), UINT32_C(0x04004010), UINT32_C(0x04004000), UINT32_C(0x00100010), + UINT32_C(0x04104000), UINT32_C(0x00000010), UINT32_C(0x00100010), UINT32_C(0x04004000), + UINT32_C(0x04104010), UINT32_C(0x00100000), UINT32_C(0x04100000), UINT32_C(0x04000010), + UINT32_C(0x00104000), UINT32_C(0x00004010), UINT32_C(0x04004010), UINT32_C(0x04100000), + UINT32_C(0x00000010), UINT32_C(0x04104000), UINT32_C(0x00104010), UINT32_C(0x00000000), + UINT32_C(0x04000000), UINT32_C(0x04100010), UINT32_C(0x00004000), UINT32_C(0x00104010) }; -__forceinline -uint32_t fRK(const uint32_t R, const uint64_t K) +__forceinline uint32_t +fRK(const uint32_t R, const uint64_t K) { uint64_t x; @@ -393,26 +260,18 @@ uint32_t fRK(const uint32_t R, const uint64_t K) * s-box: 48 bits -> 32 bits * p-phase: 32 bits -> 32 bites permutation */ - return ((LOOKUP32_SSE(sbox0p, ((x >> (8 * 0)) & 0x3f), - sizeof(sbox0p))) | - (LOOKUP32_SSE(sbox1p, ((x >> (8 * 1)) & 0x3f), - sizeof(sbox1p))) | - (LOOKUP32_SSE(sbox2p, ((x >> (8 * 2)) & 0x3f), - sizeof(sbox2p))) | - (LOOKUP32_SSE(sbox3p, ((x >> (8 * 3)) & 0x3f), - sizeof(sbox3p))) | - (LOOKUP32_SSE(sbox4p, ((x >> (8 * 4)) & 0x3f), - sizeof(sbox4p))) | - (LOOKUP32_SSE(sbox5p, ((x >> (8 * 5)) & 0x3f), - sizeof(sbox5p))) | - (LOOKUP32_SSE(sbox6p, ((x >> (8 * 6)) & 0x3f), - sizeof(sbox6p))) | - (LOOKUP32_SSE(sbox7p, ((x >> (8 * 7)) & 0x3f), - sizeof(sbox7p)))); + return ((LOOKUP32_SSE(sbox0p, ((x >> (8 * 0)) & 0x3f), sizeof(sbox0p))) | + (LOOKUP32_SSE(sbox1p, ((x >> (8 * 1)) & 0x3f), sizeof(sbox1p))) | + (LOOKUP32_SSE(sbox2p, ((x >> (8 * 2)) & 0x3f), sizeof(sbox2p))) | + (LOOKUP32_SSE(sbox3p, ((x >> (8 * 3)) & 0x3f), sizeof(sbox3p))) | + (LOOKUP32_SSE(sbox4p, ((x >> (8 * 4)) & 0x3f), sizeof(sbox4p))) | + (LOOKUP32_SSE(sbox5p, ((x >> (8 * 5)) & 0x3f), sizeof(sbox5p))) | + (LOOKUP32_SSE(sbox6p, ((x >> (8 * 6)) & 0x3f), sizeof(sbox6p))) | + (LOOKUP32_SSE(sbox7p, ((x >> (8 * 7)) & 0x3f), sizeof(sbox7p)))); } -__forceinline -uint64_t enc_dec_1(const uint64_t data, const uint64_t *ks, const int enc) +__forceinline uint64_t +enc_dec_1(const uint64_t data, const uint64_t *ks, const int enc) { uint32_t l, r; uint64_t k[16]; @@ -442,8 +301,8 @@ uint64_t enc_dec_1(const uint64_t data, const uint64_t *ks, const int enc) l ^= fRK(r, k[14]); r ^= fRK(l, k[15]); } else { - l ^= fRK(r, k[15]); /* l: l0 -> r1/l2 */ - r ^= fRK(l, k[14]); /* r: r0 -> r2 */ + l ^= fRK(r, k[15]); /* l: l0 -> r1/l2 */ + r ^= fRK(l, k[14]); /* r: r0 -> r2 */ l ^= fRK(r, k[13]); r ^= fRK(l, k[12]); l ^= fRK(r, k[11]); @@ -470,12 +329,11 @@ uint64_t enc_dec_1(const uint64_t data, const uint64_t *ks, const int enc) IMB_DLL_LOCAL void -des_enc_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec) +des_enc_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec) { #ifdef SAFE_PARAM - if ((input == NULL) || (output == NULL) || - (ks == NULL) || (ivec == NULL) || (size < 0)) + if ((input == NULL) || (output == NULL) || (ks == NULL) || (ivec == NULL) || (size < 0)) return; #else IMB_ASSERT(size >= 0); @@ -493,7 +351,6 @@ des_enc_cbc_basic(const void *input, void *output, const int size, for (n = 0; n < nblocks; n++) out[n] = iv = enc_dec_1(in[n] ^ iv, ks, 1 /* encrypt */); - #ifdef SAFE_DATA /* *ivec = iv; */ clear_var(&iv, sizeof(iv)); @@ -502,12 +359,11 @@ des_enc_cbc_basic(const void *input, void *output, const int size, IMB_DLL_LOCAL void -des_dec_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec) +des_dec_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec) { #ifdef SAFE_PARAM - if ((input == NULL) || (output == NULL) || - (ks == NULL) || (ivec == NULL) || (size < 0)) + if ((input == NULL) || (output == NULL) || (ks == NULL) || (ivec == NULL) || (size < 0)) return; #else IMB_ASSERT(size >= 0); @@ -537,14 +393,12 @@ des_dec_cbc_basic(const void *input, void *output, const int size, IMB_DLL_LOCAL void -des3_enc_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks1, const uint64_t *ks2, - const uint64_t *ks3, const uint64_t *ivec) +des3_enc_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks1, + const uint64_t *ks2, const uint64_t *ks3, const uint64_t *ivec) { #ifdef SAFE_PARAM - if ((input == NULL) || (output == NULL) || - (ks1 == NULL) || (ks2 == NULL) || (ks3 == NULL) || - (ivec == NULL) || (size < 0)) + if ((input == NULL) || (output == NULL) || (ks1 == NULL) || (ks2 == NULL) || + (ks3 == NULL) || (ivec == NULL) || (size < 0)) return; #else IMB_ASSERT(size >= 0); @@ -578,14 +432,12 @@ des3_enc_cbc_basic(const void *input, void *output, const int size, IMB_DLL_LOCAL void -des3_dec_cbc_basic(const void *input, void *output, const int size, - const uint64_t *ks1, const uint64_t *ks2, - const uint64_t *ks3, const uint64_t *ivec) +des3_dec_cbc_basic(const void *input, void *output, const int size, const uint64_t *ks1, + const uint64_t *ks2, const uint64_t *ks3, const uint64_t *ivec) { #ifdef SAFE_PARAM - if ((input == NULL) || (output == NULL) || - (ks1 == NULL) || (ks2 == NULL) || (ks3 == NULL) || - (ivec == NULL) || (size < 0)) + if ((input == NULL) || (output == NULL) || (ks1 == NULL) || (ks2 == NULL) || + (ks3 == NULL) || (ivec == NULL) || (size < 0)) return; #else IMB_ASSERT(size >= 0); @@ -620,14 +472,12 @@ des3_dec_cbc_basic(const void *input, void *output, const int size, #endif } -__forceinline -void -cfb_one_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec) +__forceinline void +cfb_one_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec) { #ifdef SAFE_PARAM - if ((input == NULL) || (output == NULL) || - (ks == NULL) || (ivec == NULL) || (size < 0)) + if ((input == NULL) || (output == NULL) || (ks == NULL) || (ivec == NULL) || (size < 0)) return; #else IMB_ASSERT(size <= 8 && size >= 0); @@ -672,12 +522,11 @@ cfb_one_basic(const void *input, void *output, const int size, IMB_DLL_LOCAL void -docsis_des_enc_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec) +docsis_des_enc_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec) { #ifdef SAFE_PARAM - if ((input == NULL) || (output == NULL) || - (ks == NULL) || (ivec == NULL) || (size < 0)) + if ((input == NULL) || (output == NULL) || (ks == NULL) || (ivec == NULL) || (size < 0)) return; #else IMB_ASSERT(size >= 0); @@ -698,8 +547,7 @@ docsis_des_enc_basic(const void *input, void *output, const int size, if (partial) { if (nblocks) - cfb_one_basic(&in[nblocks], &out[nblocks], partial, - ks, &out[nblocks - 1]); + cfb_one_basic(&in[nblocks], &out[nblocks], partial, ks, &out[nblocks - 1]); else cfb_one_basic(input, output, partial, ks, ivec); } @@ -712,12 +560,11 @@ docsis_des_enc_basic(const void *input, void *output, const int size, IMB_DLL_LOCAL void -docsis_des_dec_basic(const void *input, void *output, const int size, - const uint64_t *ks, const uint64_t *ivec) +docsis_des_dec_basic(const void *input, void *output, const int size, const uint64_t *ks, + const uint64_t *ivec) { #ifdef SAFE_PARAM - if ((input == NULL) || (output == NULL) || - (ks == NULL) || (ivec == NULL) || (size < 0)) + if ((input == NULL) || (output == NULL) || (ks == NULL) || (ivec == NULL) || (size < 0)) return; #else IMB_ASSERT(size >= 0); @@ -740,8 +587,7 @@ docsis_des_dec_basic(const void *input, void *output, const int size, return; } /* last block is partial */ - cfb_one_basic(&in[nblocks], &out[nblocks], partial, - ks, &in[nblocks - 1]); + cfb_one_basic(&in[nblocks], &out[nblocks], partial, ks, &in[nblocks - 1]); } for (n = 0; n < nblocks; n++) { @@ -754,8 +600,7 @@ docsis_des_dec_basic(const void *input, void *output, const int size, IMB_DLL_EXPORT void -des_cfb_one(void *output, const void *input, const uint64_t *iv, - const uint64_t *ks, const int size) +des_cfb_one(void *output, const void *input, const uint64_t *iv, const uint64_t *ks, const int size) { cfb_one_basic(input, output, size, ks, iv); } diff --git a/lib/x86_64/des_key.c b/lib/x86_64/des_key.c index a80f3055..825700c6 100644 --- a/lib/x86_64/des_key.c +++ b/lib/x86_64/des_key.c @@ -44,14 +44,13 @@ * * @return val rotated by nshift bits */ -__forceinline -uint32_t rotate28(const uint32_t val, const unsigned nshift) +__forceinline uint32_t +rotate28(const uint32_t val, const unsigned nshift) { const uint32_t mask = (UINT32_C(1) << 28) - UINT32_C(1); IMB_ASSERT(nshift <= 28); - return ((val >> nshift) & mask) | - ((val << (28 - nshift)) & mask); + return ((val >> nshift) & mask) | ((val << (28 - nshift)) & mask); } /** @@ -61,50 +60,36 @@ uint32_t rotate28(const uint32_t val, const unsigned nshift) * * @return 64-bit word with 8 groups of 8bits */ -__forceinline -uint64_t expand_8x6_to_8x8(const uint64_t in) +__forceinline uint64_t +expand_8x6_to_8x8(const uint64_t in) { return (((in >> (6 * 0)) & UINT64_C(63)) << (8 * 0)) | - (((in >> (6 * 1)) & UINT64_C(63)) << (8 * 1)) | - (((in >> (6 * 2)) & UINT64_C(63)) << (8 * 2)) | - (((in >> (6 * 3)) & UINT64_C(63)) << (8 * 3)) | - (((in >> (6 * 4)) & UINT64_C(63)) << (8 * 4)) | - (((in >> (6 * 5)) & UINT64_C(63)) << (8 * 5)) | - (((in >> (6 * 6)) & UINT64_C(63)) << (8 * 6)) | - (((in >> (6 * 7)) & UINT64_C(63)) << (8 * 7)); + (((in >> (6 * 1)) & UINT64_C(63)) << (8 * 1)) | + (((in >> (6 * 2)) & UINT64_C(63)) << (8 * 2)) | + (((in >> (6 * 3)) & UINT64_C(63)) << (8 * 3)) | + (((in >> (6 * 4)) & UINT64_C(63)) << (8 * 4)) | + (((in >> (6 * 5)) & UINT64_C(63)) << (8 * 5)) | + (((in >> (6 * 6)) & UINT64_C(63)) << (8 * 6)) | + (((in >> (6 * 7)) & UINT64_C(63)) << (8 * 7)); } -static const uint8_t pc1c_table_fips46_3[28] = { - 57, 49, 41, 33, 25, 17, 9, - 1, 58, 50, 42, 34, 26, 18, - 10, 2, 59, 51, 43, 35, 27, - 19, 11, 3, 60, 52, 44, 36 -}; - -static const uint8_t pc1d_table_fips46_3[28] = { - 63, 55, 47, 39, 31, 23, 15, - 7, 62, 54, 46, 38, 30, 22, - 14, 6, 61, 53, 45, 37, 29, - 21, 13, 5, 28, 20, 12, 4 -}; - -static const uint8_t pc2_table_fips46_3[48] = { - 14, 17, 11, 24, 1, 5, - 3, 28, 15, 6, 21, 10, - 23, 19, 12, 4, 26, 8, - 16, 7, 27, 20, 13, 2, - 41, 52, 31, 37, 47, 55, - 30, 40, 51, 45, 33, 48, - 44, 49, 39, 56, 34, 53, - 46, 42, 50, 36, 29, 32 -}; - -static const uint8_t shift_tab_fips46_3[16] = { - 1, 1, 2, 2, 2, 2, 2, 2, - 1, 2, 2, 2, 2, 2, 2, 1 -}; - -int des_key_schedule(uint64_t *ks, const void *key) +static const uint8_t pc1c_table_fips46_3[28] = { 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, + 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, + 27, 19, 11, 3, 60, 52, 44, 36 }; + +static const uint8_t pc1d_table_fips46_3[28] = { 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, + 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, + 29, 21, 13, 5, 28, 20, 12, 4 }; + +static const uint8_t pc2_table_fips46_3[48] = { 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32 }; + +static const uint8_t shift_tab_fips46_3[16] = { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 }; + +int +des_key_schedule(uint64_t *ks, const void *key) { #ifdef SAFE_PARAM imb_set_errno(NULL, 0); @@ -117,7 +102,6 @@ int des_key_schedule(uint64_t *ks, const void *key) return -1; } - #endif uint64_t c, d; @@ -141,12 +125,11 @@ int des_key_schedule(uint64_t *ks, const void *key) /* KS rounds */ for (n = 0; n < 16; n++) { - c = rotate28((uint32_t)c, (unsigned) shift_tab_fips46_3[n]); - d = rotate28((uint32_t)d, (unsigned) shift_tab_fips46_3[n]); + c = rotate28((uint32_t) c, (unsigned) shift_tab_fips46_3[n]); + d = rotate28((uint32_t) d, (unsigned) shift_tab_fips46_3[n]); /* PC2 */ - t = permute_64b(c | (d << 28), pc2_table_fips46_3, - IMB_DIM(pc2_table_fips46_3)); + t = permute_64b(c | (d << 28), pc2_table_fips46_3, IMB_DIM(pc2_table_fips46_3)); /* store KS as 6 bits per byte and keep LE */ ks[n] = expand_8x6_to_8x8(t); diff --git a/lib/x86_64/error.c b/lib/x86_64/error.c index dbcbef70..176b6ecf 100644 --- a/lib/x86_64/error.c +++ b/lib/x86_64/error.c @@ -40,67 +40,65 @@ #endif IMB_DLL_LOCAL volatile int imb_errno; -IMB_DLL_LOCAL const int imb_errno_types[] = { - IMB_ERR_NULL_MBMGR, - IMB_ERR_JOB_NULL_SRC, - IMB_ERR_JOB_NULL_DST, - IMB_ERR_JOB_NULL_KEY, - IMB_ERR_JOB_NULL_IV, - IMB_ERR_JOB_NULL_AUTH, - IMB_ERR_JOB_NULL_AAD, - IMB_ERR_JOB_CIPH_LEN, - IMB_ERR_JOB_AUTH_LEN, - IMB_ERR_JOB_IV_LEN, - IMB_ERR_JOB_KEY_LEN, - IMB_ERR_JOB_AUTH_TAG_LEN, - IMB_ERR_JOB_AAD_LEN, - IMB_ERR_JOB_SRC_OFFSET, - IMB_ERR_JOB_CHAIN_ORDER, - IMB_ERR_CIPH_MODE, - IMB_ERR_HASH_ALGO, - IMB_ERR_JOB_NULL_AUTH_KEY, - IMB_ERR_JOB_NULL_SGL_CTX, - IMB_ERR_JOB_NULL_NEXT_IV, - IMB_ERR_JOB_PON_PLI, - IMB_ERR_NULL_SRC, - IMB_ERR_NULL_DST, - IMB_ERR_NULL_KEY, - IMB_ERR_NULL_EXP_KEY, - IMB_ERR_NULL_IV, - IMB_ERR_NULL_AUTH, - IMB_ERR_NULL_AAD, - IMB_ERR_CIPH_LEN, - IMB_ERR_AUTH_LEN, - IMB_ERR_IV_LEN, - IMB_ERR_KEY_LEN, - IMB_ERR_AUTH_TAG_LEN, - IMB_ERR_AAD_LEN, - IMB_ERR_SRC_OFFSET, - IMB_ERR_NULL_AUTH_KEY, - IMB_ERR_NULL_CTX, - IMB_ERR_NO_AESNI_EMU, - IMB_ERR_JOB_NULL_HMAC_OPAD, - IMB_ERR_JOB_NULL_HMAC_IPAD, - IMB_ERR_JOB_NULL_XCBC_K1_EXP, - IMB_ERR_JOB_NULL_XCBC_K2, - IMB_ERR_JOB_NULL_XCBC_K3, - IMB_ERR_JOB_CIPH_DIR, - IMB_ERR_JOB_NULL_GHASH_INIT_TAG, - IMB_ERR_MISSING_CPUFLAGS_INIT_MGR, - IMB_ERR_NULL_JOB, - IMB_ERR_QUEUE_SPACE, - IMB_ERR_NULL_BURST, - IMB_ERR_BURST_SIZE, - IMB_ERR_BURST_OOO, - IMB_ERR_SELFTEST, - IMB_ERR_BURST_SUITE_ID -}; +IMB_DLL_LOCAL const int imb_errno_types[] = { IMB_ERR_NULL_MBMGR, + IMB_ERR_JOB_NULL_SRC, + IMB_ERR_JOB_NULL_DST, + IMB_ERR_JOB_NULL_KEY, + IMB_ERR_JOB_NULL_IV, + IMB_ERR_JOB_NULL_AUTH, + IMB_ERR_JOB_NULL_AAD, + IMB_ERR_JOB_CIPH_LEN, + IMB_ERR_JOB_AUTH_LEN, + IMB_ERR_JOB_IV_LEN, + IMB_ERR_JOB_KEY_LEN, + IMB_ERR_JOB_AUTH_TAG_LEN, + IMB_ERR_JOB_AAD_LEN, + IMB_ERR_JOB_SRC_OFFSET, + IMB_ERR_JOB_CHAIN_ORDER, + IMB_ERR_CIPH_MODE, + IMB_ERR_HASH_ALGO, + IMB_ERR_JOB_NULL_AUTH_KEY, + IMB_ERR_JOB_NULL_SGL_CTX, + IMB_ERR_JOB_NULL_NEXT_IV, + IMB_ERR_JOB_PON_PLI, + IMB_ERR_NULL_SRC, + IMB_ERR_NULL_DST, + IMB_ERR_NULL_KEY, + IMB_ERR_NULL_EXP_KEY, + IMB_ERR_NULL_IV, + IMB_ERR_NULL_AUTH, + IMB_ERR_NULL_AAD, + IMB_ERR_CIPH_LEN, + IMB_ERR_AUTH_LEN, + IMB_ERR_IV_LEN, + IMB_ERR_KEY_LEN, + IMB_ERR_AUTH_TAG_LEN, + IMB_ERR_AAD_LEN, + IMB_ERR_SRC_OFFSET, + IMB_ERR_NULL_AUTH_KEY, + IMB_ERR_NULL_CTX, + IMB_ERR_NO_AESNI_EMU, + IMB_ERR_JOB_NULL_HMAC_OPAD, + IMB_ERR_JOB_NULL_HMAC_IPAD, + IMB_ERR_JOB_NULL_XCBC_K1_EXP, + IMB_ERR_JOB_NULL_XCBC_K2, + IMB_ERR_JOB_NULL_XCBC_K3, + IMB_ERR_JOB_CIPH_DIR, + IMB_ERR_JOB_NULL_GHASH_INIT_TAG, + IMB_ERR_MISSING_CPUFLAGS_INIT_MGR, + IMB_ERR_NULL_JOB, + IMB_ERR_QUEUE_SPACE, + IMB_ERR_NULL_BURST, + IMB_ERR_BURST_SIZE, + IMB_ERR_BURST_OOO, + IMB_ERR_SELFTEST, + IMB_ERR_BURST_SUITE_ID }; -int imb_get_errno(IMB_MGR *mb_mgr) +int +imb_get_errno(IMB_MGR *mb_mgr) { /* check for imb_errno_types[] mismatch vs enum IMB_ERR */ - IMB_ASSERT((IMB_DIM(imb_errno_types) + 1) == - (IMB_ERR_MAX - IMB_ERR_MIN)); + IMB_ASSERT((IMB_DIM(imb_errno_types) + 1) == (IMB_ERR_MAX - IMB_ERR_MIN)); /* try get IMB_MGR error status first */ if (mb_mgr != NULL && mb_mgr->imb_errno) @@ -113,10 +111,10 @@ int imb_get_errno(IMB_MGR *mb_mgr) const char * imb_get_strerror(int errnum) { - if (errnum >= IMB_ERR_MAX) - return "Unknown error"; + if (errnum >= IMB_ERR_MAX) + return "Unknown error"; - switch (errnum){ + switch (errnum) { case 0: return "No error"; case IMB_ERR_NULL_MBMGR: @@ -187,7 +185,7 @@ imb_get_strerror(int errnum) return "Null authentication tag output pointer (direct API)"; case IMB_ERR_NULL_AAD: return "Null Additional Authenticated Data (AAD) " - "pointer (direct API)"; + "pointer (direct API)"; case IMB_ERR_CIPH_LEN: return "Invalid cipher message length (direct API)"; case IMB_ERR_AUTH_LEN: @@ -200,7 +198,7 @@ imb_get_strerror(int errnum) return "Invalid authentication tag length (direct API)"; case IMB_ERR_AAD_LEN: return "Invalid Additional Authenticated Data (AAD) " - "length (direct API)"; + "length (direct API)"; case IMB_ERR_SRC_OFFSET: return "Invalid source offset (direct API)"; case IMB_ERR_NULL_AUTH_KEY: diff --git a/lib/x86_64/gcm.c b/lib/x86_64/gcm.c index e23ac03b..8787f555 100644 --- a/lib/x86_64/gcm.c +++ b/lib/x86_64/gcm.c @@ -42,7 +42,8 @@ * */ -void aes_gcm_pre_128_sse(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_128_sse(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -62,8 +63,8 @@ void aes_gcm_pre_128_sse(const void *key, struct gcm_key_data *key_data) } #ifdef AESNI_EMU -void aes_gcm_pre_128_sse_no_aesni(const void *key, - struct gcm_key_data *key_data) +void +aes_gcm_pre_128_sse_no_aesni(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -83,12 +84,14 @@ void aes_gcm_pre_128_sse_no_aesni(const void *key, } #endif /* AESNI_EMU */ -void aes_gcm_pre_128_avx_gen2(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_128_avx_gen2(const void *key, struct gcm_key_data *key_data) { aes_gcm_pre_128_sse(key, key_data); } -void aes_gcm_pre_128_avx_gen4(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_128_avx_gen4(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -107,7 +110,8 @@ void aes_gcm_pre_128_avx_gen4(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_128_avx_gen4(key_data); } -void aes_gcm_pre_128_avx512(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_128_avx512(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -126,7 +130,8 @@ void aes_gcm_pre_128_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_128_avx512(key_data); } -void aes_gcm_pre_128_vaes_avx512(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_128_vaes_avx512(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -145,7 +150,8 @@ void aes_gcm_pre_128_vaes_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_128_vaes_avx512(key_data); } -void aes_gcm_pre_192_sse(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_192_sse(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -165,8 +171,8 @@ void aes_gcm_pre_192_sse(const void *key, struct gcm_key_data *key_data) } #ifdef AESNI_EMU -void aes_gcm_pre_192_sse_no_aesni(const void *key, - struct gcm_key_data *key_data) +void +aes_gcm_pre_192_sse_no_aesni(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -186,12 +192,14 @@ void aes_gcm_pre_192_sse_no_aesni(const void *key, } #endif /* AESNI_EMU */ -void aes_gcm_pre_192_avx_gen2(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_192_avx_gen2(const void *key, struct gcm_key_data *key_data) { aes_gcm_pre_192_sse(key, key_data); } -void aes_gcm_pre_192_avx_gen4(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_192_avx_gen4(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -210,7 +218,8 @@ void aes_gcm_pre_192_avx_gen4(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_192_avx_gen4(key_data); } -void aes_gcm_pre_192_avx512(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_192_avx512(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -229,7 +238,8 @@ void aes_gcm_pre_192_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_192_avx512(key_data); } -void aes_gcm_pre_192_vaes_avx512(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_192_vaes_avx512(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -248,7 +258,8 @@ void aes_gcm_pre_192_vaes_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_192_vaes_avx512(key_data); } -void aes_gcm_pre_256_sse(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_256_sse(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -268,8 +279,8 @@ void aes_gcm_pre_256_sse(const void *key, struct gcm_key_data *key_data) } #ifdef AESNI_EMU -void aes_gcm_pre_256_sse_no_aesni(const void *key, - struct gcm_key_data *key_data) +void +aes_gcm_pre_256_sse_no_aesni(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -289,12 +300,14 @@ void aes_gcm_pre_256_sse_no_aesni(const void *key, } #endif /* AESNI_EMU */ -void aes_gcm_pre_256_avx_gen2(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_256_avx_gen2(const void *key, struct gcm_key_data *key_data) { aes_gcm_pre_256_sse(key, key_data); } -void aes_gcm_pre_256_avx_gen4(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_256_avx_gen4(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -313,7 +326,8 @@ void aes_gcm_pre_256_avx_gen4(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_256_avx_gen4(key_data); } -void aes_gcm_pre_256_avx512(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_256_avx512(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -332,7 +346,8 @@ void aes_gcm_pre_256_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_256_avx512(key_data); } -void aes_gcm_pre_256_vaes_avx512(const void *key, struct gcm_key_data *key_data) +void +aes_gcm_pre_256_vaes_avx512(const void *key, struct gcm_key_data *key_data) { #ifdef SAFE_PARAM /* reset error status */ @@ -353,362 +368,290 @@ void aes_gcm_pre_256_vaes_avx512(const void *key, struct gcm_key_data *key_data) void imb_aes_gmac_init_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_128_sse(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_128_sse(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_192_sse(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_192_sse(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_256_sse(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_256_sse(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_finalize_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_128_finalize_sse(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_128_finalize_sse(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_192_finalize_sse(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_192_finalize_sse(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_256_finalize_sse(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_256_finalize_sse(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_init_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_128_sse(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_128_sse(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_192_sse(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_192_sse(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_256_sse(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_256_sse(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_finalize_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_128_finalize_sse(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_128_finalize_sse(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_192_finalize_sse(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_192_finalize_sse(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_256_finalize_sse(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_256_finalize_sse(key_data, context_data, auth_tag, auth_tag_len); } #ifdef AESNI_EMU void imb_aes_gmac_init_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_128_sse_no_aesni(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_128_sse_no_aesni(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_192_sse_no_aesni(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_192_sse_no_aesni(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_256_sse_no_aesni(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_256_sse_no_aesni(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_finalize_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len) { - aes_gcm_enc_128_finalize_sse_no_aesni(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_128_finalize_sse_no_aesni(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, + struct gcm_context_data *context_data, uint8_t *auth_tag, const uint64_t auth_tag_len) { - aes_gcm_enc_192_finalize_sse_no_aesni(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_192_finalize_sse_no_aesni(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_256_finalize_sse_no_aesni(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_256_finalize_sse_no_aesni(key_data, context_data, auth_tag, auth_tag_len); } #endif /* AESNI_EMU */ void imb_aes_gmac_init_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_128_avx_gen4(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_128_avx_gen4(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_192_avx_gen4(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_192_avx_gen4(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_256_avx_gen4(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_256_avx_gen4(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_finalize_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_128_finalize_avx_gen4(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_128_finalize_avx_gen4(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_192_finalize_avx_gen4(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_192_finalize_avx_gen4(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_256_finalize_avx_gen4(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_256_finalize_avx_gen4(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_init_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_128_avx512(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_128_avx512(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_192_avx512(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_192_avx512(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_256_avx512(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_256_avx512(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_finalize_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_128_finalize_avx512(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_128_finalize_avx512(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_192_finalize_avx512(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_192_finalize_avx512(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_256_finalize_avx512(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_256_finalize_avx512(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_init_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_128_vaes_avx512(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_128_vaes_avx512(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_192_vaes_avx512(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_192_vaes_avx512(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_init_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - const uint8_t *iv, + struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len) { - aes_gcm_init_var_iv_256_vaes_avx512(key_data, context_data, iv, - iv_len, NULL, 0); + aes_gcm_init_var_iv_256_vaes_avx512(key_data, context_data, iv, iv_len, NULL, 0); } void imb_aes_gmac_finalize_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_128_finalize_vaes_avx512(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_128_finalize_vaes_avx512(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_192_finalize_vaes_avx512(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_192_finalize_vaes_avx512(key_data, context_data, auth_tag, auth_tag_len); } void imb_aes_gmac_finalize_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, - uint8_t *auth_tag, - const uint64_t auth_tag_len) + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) { - aes_gcm_enc_256_finalize_vaes_avx512(key_data, context_data, auth_tag, - auth_tag_len); + aes_gcm_enc_256_finalize_vaes_avx512(key_data, context_data, auth_tag, auth_tag_len); } diff --git a/lib/x86_64/hmac_ipad_opad.c b/lib/x86_64/hmac_ipad_opad.c index 56f254a2..3a90ff06 100644 --- a/lib/x86_64/hmac_ipad_opad.c +++ b/lib/x86_64/hmac_ipad_opad.c @@ -35,9 +35,8 @@ IMB_DLL_EXPORT void -imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, - const void *pkey, const size_t key_len, - void *ipad_hash, void *opad_hash) +imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, const void *pkey, + const size_t key_len, void *ipad_hash, void *opad_hash) { #ifdef SAFE_PARAM if (mb_mgr == NULL) { @@ -55,24 +54,28 @@ imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, switch (sha_type) { case IMB_AUTH_HMAC_SHA_1: - local_key_len = (key_len <= IMB_SHA1_BLOCK_SIZE) ? - key_len : IMB_SHA1_DIGEST_SIZE_IN_BYTES; + local_key_len = + (key_len <= IMB_SHA1_BLOCK_SIZE) ? key_len : IMB_SHA1_DIGEST_SIZE_IN_BYTES; break; case IMB_AUTH_HMAC_SHA_224: - local_key_len = (key_len <= IMB_SHA_224_BLOCK_SIZE) ? - key_len : IMB_SHA224_DIGEST_SIZE_IN_BYTES; + local_key_len = (key_len <= IMB_SHA_224_BLOCK_SIZE) + ? key_len + : IMB_SHA224_DIGEST_SIZE_IN_BYTES; break; case IMB_AUTH_HMAC_SHA_256: - local_key_len = (key_len <= IMB_SHA_256_BLOCK_SIZE) ? - key_len : IMB_SHA256_DIGEST_SIZE_IN_BYTES; + local_key_len = (key_len <= IMB_SHA_256_BLOCK_SIZE) + ? key_len + : IMB_SHA256_DIGEST_SIZE_IN_BYTES; break; case IMB_AUTH_HMAC_SHA_384: - local_key_len = (key_len <= IMB_SHA_384_BLOCK_SIZE) ? - key_len : IMB_SHA384_DIGEST_SIZE_IN_BYTES; + local_key_len = (key_len <= IMB_SHA_384_BLOCK_SIZE) + ? key_len + : IMB_SHA384_DIGEST_SIZE_IN_BYTES; break; case IMB_AUTH_HMAC_SHA_512: - local_key_len = (key_len <= IMB_SHA_512_BLOCK_SIZE) ? - key_len : IMB_SHA512_DIGEST_SIZE_IN_BYTES; + local_key_len = (key_len <= IMB_SHA_512_BLOCK_SIZE) + ? key_len + : IMB_SHA512_DIGEST_SIZE_IN_BYTES; break; case IMB_AUTH_MD5: if (key_len <= IMB_MD5_BLOCK_SIZE) @@ -167,7 +170,7 @@ imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, } #ifdef SAFE_DATA - imb_clear_mem(key, sizeof(key)); - imb_clear_mem(buf, sizeof(buf)); + imb_clear_mem(key, sizeof(key)); + imb_clear_mem(buf, sizeof(buf)); #endif } diff --git a/lib/x86_64/kasumi_iv.c b/lib/x86_64/kasumi_iv.c index 6db884b2..1dd8a743 100644 --- a/lib/x86_64/kasumi_iv.c +++ b/lib/x86_64/kasumi_iv.c @@ -31,8 +31,7 @@ #include "include/wireless_common.h" int -kasumi_f8_iv_gen(const uint32_t count, const uint8_t bearer, - const uint8_t dir, void *iv_ptr) +kasumi_f8_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr) { uint8_t *iv = (uint8_t *) iv_ptr; uint32_t *iv32 = (uint32_t *) iv_ptr; @@ -41,7 +40,7 @@ kasumi_f8_iv_gen(const uint32_t count, const uint8_t bearer, return -1; /* Bearer must contain 5 bits only */ - if (bearer >= (1<<5)) + if (bearer >= (1 << 5)) return -1; /* Direction must contain 1 bit only */ @@ -61,8 +60,7 @@ kasumi_f8_iv_gen(const uint32_t count, const uint8_t bearer, } int -kasumi_f9_iv_gen(const uint32_t count, const uint32_t fresh, - void *iv_ptr) +kasumi_f9_iv_gen(const uint32_t count, const uint32_t fresh, void *iv_ptr) { uint32_t *iv32 = (uint32_t *) iv_ptr; diff --git a/lib/x86_64/mb_mgr_auto.c b/lib/x86_64/mb_mgr_auto.c index beac5599..0cf6fb0c 100644 --- a/lib/x86_64/mb_mgr_auto.c +++ b/lib/x86_64/mb_mgr_auto.c @@ -74,8 +74,7 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch) } #ifdef AESNI_EMU - if ((state->features & IMB_CPUFLAGS_NO_AESNI) - == IMB_CPUFLAGS_NO_AESNI) { + if ((state->features & IMB_CPUFLAGS_NO_AESNI) == IMB_CPUFLAGS_NO_AESNI) { init_mb_mgr_sse_no_aesni(state); arch_detected = IMB_ARCH_NOAESNI; goto init_mb_mgr_auto_ret; @@ -83,7 +82,7 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch) #endif imb_set_errno(state, ENODEV); - init_mb_mgr_auto_ret: +init_mb_mgr_auto_ret: if (arch != NULL) *arch = arch_detected; } diff --git a/lib/x86_64/md5_one_block.c b/lib/x86_64/md5_one_block.c index 9de294e1..1cb82dd9 100644 --- a/lib/x86_64/md5_one_block.c +++ b/lib/x86_64/md5_one_block.c @@ -43,30 +43,34 @@ #define H2 0x98badcfe #define H3 0x10325476 -#define F1(b, c, d) ((((c) ^ (d)) & (b)) ^ (d)) -#define F2(b, c, d) ((((b) ^ (c)) & (d)) ^ (c)) -#define F3(b, c, d) ((b) ^ (c) ^ (d)) -#define F4(b, c, d) (((~(d)) | (b)) ^ (c)) - -#define STEP1(a, b, c, d, k, w, r) { \ - a += w + k + F1(b, c, d); \ - a = ROTATE(a, r); \ - a += b; \ +#define F1(b, c, d) ((((c) ^ (d)) & (b)) ^ (d)) +#define F2(b, c, d) ((((b) ^ (c)) & (d)) ^ (c)) +#define F3(b, c, d) ((b) ^ (c) ^ (d)) +#define F4(b, c, d) (((~(d)) | (b)) ^ (c)) + +#define STEP1(a, b, c, d, k, w, r) \ + { \ + a += w + k + F1(b, c, d); \ + a = ROTATE(a, r); \ + a += b; \ } -#define STEP2(a, b, c, d, k, w, r) { \ - a += w + k + F2(b, c, d); \ - a = ROTATE(a, r); \ - a += b; \ +#define STEP2(a, b, c, d, k, w, r) \ + { \ + a += w + k + F2(b, c, d); \ + a = ROTATE(a, r); \ + a += b; \ } -#define STEP3(a, b, c, d, k, w, r) { \ - a += w + k + F3(b, c, d); \ - a = ROTATE(a, r); \ - a += b; \ +#define STEP3(a, b, c, d, k, w, r) \ + { \ + a += w + k + F3(b, c, d); \ + a = ROTATE(a, r); \ + a += b; \ } -#define STEP4(a, b, c, d, k, w, r) { \ - a += w + k + F4(b, c, d); \ - a = ROTATE(a, r); \ - a += b; \ +#define STEP4(a, b, c, d, k, w, r) \ + { \ + a += w + k + F4(b, c, d); \ + a = ROTATE(a, r); \ + a += b; \ } enum arch_type { @@ -76,10 +80,8 @@ enum arch_type { ARCH_AVX512, }; -__forceinline -void -md5_one_block_common(const uint8_t *data, uint32_t digest[4], - const enum arch_type arch) +__forceinline void +md5_one_block_common(const uint8_t *data, uint32_t digest[4], const enum arch_type arch) { #ifdef SAFE_PARAM imb_set_errno(NULL, 0); @@ -94,7 +96,7 @@ md5_one_block_common(const uint8_t *data, uint32_t digest[4], #endif uint32_t a, b, c, d; uint32_t w[16]; - const uint32_t *data32 = (const uint32_t *)data; + const uint32_t *data32 = (const uint32_t *) data; a = H0; b = H1; @@ -194,7 +196,7 @@ md5_one_block_common(const uint8_t *data, uint32_t digest[4], clear_var(&d, sizeof(d)); clear_mem(w, sizeof(w)); clear_scratch_gps(); - switch(arch) { + switch (arch) { case ARCH_SSE: clear_scratch_xmms_sse(); break; @@ -211,7 +213,7 @@ md5_one_block_common(const uint8_t *data, uint32_t digest[4], break; } #else - (void) arch; /* unused */ + (void) arch; /* unused */ #endif } diff --git a/lib/x86_64/ooo_mgr_reset.c b/lib/x86_64/ooo_mgr_reset.c index 4f19a2e9..f73ca3da 100644 --- a/lib/x86_64/ooo_mgr_reset.c +++ b/lib/x86_64/ooo_mgr_reset.c @@ -34,11 +34,12 @@ #ifndef __aarch64__ IMB_DLL_LOCAL -void ooo_mgr_aes_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_aes_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_AES_OOO *p_mgr = (MB_MGR_AES_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_AES_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_AES_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); if (num_lanes == 4) p_mgr->unused_lanes = 0xF3210; @@ -56,11 +57,12 @@ void ooo_mgr_aes_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_docsis_aes_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_docsis_aes_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_DOCSIS_AES_OOO *p_mgr = (MB_MGR_DOCSIS_AES_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_DOCSIS_AES_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_DOCSIS_AES_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); if (num_lanes == 4) p_mgr->unused_lanes = 0xF3210; @@ -71,11 +73,12 @@ void ooo_mgr_docsis_aes_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_cmac_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_cmac_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_CMAC_OOO *p_mgr = (MB_MGR_CMAC_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_CMAC_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_CMAC_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); if (num_lanes == 4) p_mgr->unused_lanes = 0xF3210; @@ -86,11 +89,12 @@ void ooo_mgr_cmac_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_ccm_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_ccm_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_CCM_OOO *p_mgr = (MB_MGR_CCM_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_CCM_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_CCM_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); if (num_lanes == 4) p_mgr->unused_lanes = 0xF3210; @@ -101,12 +105,13 @@ void ooo_mgr_ccm_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_aes_xcbc_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_aes_xcbc_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_AES_XCBC_OOO *p_mgr = (MB_MGR_AES_XCBC_OOO *) p_ooo_mgr; unsigned i; - memset(p_mgr, 0, offsetof(MB_MGR_AES_XCBC_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_AES_XCBC_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); for (i = 0; i < num_lanes; i++) @@ -121,19 +126,19 @@ void ooo_mgr_aes_xcbc_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_hmac_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_hmac_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_HMAC_SHA_1_OOO *p_mgr = (MB_MGR_HMAC_SHA_1_OOO *) p_ooo_mgr; unsigned i; - memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_1_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_1_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); for (i = 0; i < num_lanes; i++) { p_mgr->ldata[i].extra_block[IMB_SHA1_BLOCK_SIZE] = 0x80; - p_mgr->ldata[i].outer_block[IMB_SHA1_DIGEST_SIZE_IN_BYTES] = - 0x80; + p_mgr->ldata[i].outer_block[IMB_SHA1_DIGEST_SIZE_IN_BYTES] = 0x80; p_mgr->ldata[i].outer_block[IMB_SHA1_BLOCK_SIZE - 2] = 0x02; p_mgr->ldata[i].outer_block[IMB_SHA1_BLOCK_SIZE - 1] = 0xa0; } @@ -151,19 +156,19 @@ void ooo_mgr_hmac_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_hmac_sha224_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_hmac_sha224_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_HMAC_SHA_256_OOO *p_mgr = (MB_MGR_HMAC_SHA_256_OOO *) p_ooo_mgr; unsigned i; - memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_256_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_256_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); for (i = 0; i < num_lanes; i++) { p_mgr->ldata[i].extra_block[IMB_SHA_256_BLOCK_SIZE] = 0x80; - p_mgr->ldata[i].outer_block[IMB_SHA224_DIGEST_SIZE_IN_BYTES] = - 0x80; + p_mgr->ldata[i].outer_block[IMB_SHA224_DIGEST_SIZE_IN_BYTES] = 0x80; p_mgr->ldata[i].outer_block[IMB_SHA_256_BLOCK_SIZE - 2] = 0x02; p_mgr->ldata[i].outer_block[IMB_SHA_256_BLOCK_SIZE - 1] = 0xe0; } @@ -181,19 +186,19 @@ void ooo_mgr_hmac_sha224_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_hmac_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_hmac_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_HMAC_SHA_256_OOO *p_mgr = (MB_MGR_HMAC_SHA_256_OOO *) p_ooo_mgr; unsigned i; - memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_256_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_256_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); for (i = 0; i < num_lanes; i++) { p_mgr->ldata[i].extra_block[IMB_SHA_256_BLOCK_SIZE] = 0x80; - p_mgr->ldata[i].outer_block[IMB_SHA256_DIGEST_SIZE_IN_BYTES] = - 0x80; + p_mgr->ldata[i].outer_block[IMB_SHA256_DIGEST_SIZE_IN_BYTES] = 0x80; p_mgr->ldata[i].outer_block[IMB_SHA_256_BLOCK_SIZE - 2] = 0x03; p_mgr->ldata[i].outer_block[IMB_SHA_256_BLOCK_SIZE - 1] = 0x00; } @@ -211,19 +216,19 @@ void ooo_mgr_hmac_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_hmac_sha384_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_hmac_sha384_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_HMAC_SHA_512_OOO *p_mgr = (MB_MGR_HMAC_SHA_512_OOO *) p_ooo_mgr; unsigned i; - memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_512_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_512_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); for (i = 0; i < num_lanes; i++) { p_mgr->ldata[i].extra_block[IMB_SHA_384_BLOCK_SIZE] = 0x80; - p_mgr->ldata[i].outer_block[IMB_SHA384_DIGEST_SIZE_IN_BYTES] = - 0x80; + p_mgr->ldata[i].outer_block[IMB_SHA384_DIGEST_SIZE_IN_BYTES] = 0x80; /* * hmac outer block length always of fixed size, it is OKey * length, a whole message block length, 1024 bits, with padding @@ -247,20 +252,20 @@ void ooo_mgr_hmac_sha384_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_hmac_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_hmac_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_HMAC_SHA_512_OOO *p_mgr = (MB_MGR_HMAC_SHA_512_OOO *) p_ooo_mgr; unsigned i; - memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_512_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_HMAC_SHA_512_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); for (i = 0; i < num_lanes; i++) { p_mgr->ldata[i].extra_block[IMB_SHA_512_BLOCK_SIZE] = 0x80; - p_mgr->ldata[i].outer_block[IMB_SHA512_DIGEST_SIZE_IN_BYTES] = - 0x80; - /* + p_mgr->ldata[i].outer_block[IMB_SHA512_DIGEST_SIZE_IN_BYTES] = 0x80; + /* * hmac outer block length always of fixed size, it is OKey * length, a whole message block length, 1024 bits, with padding * plus the length of the inner digest, which is 512 bits @@ -283,12 +288,13 @@ void ooo_mgr_hmac_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_hmac_md5_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_hmac_md5_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_HMAC_MD5_OOO *p_mgr = (MB_MGR_HMAC_MD5_OOO *) p_ooo_mgr; unsigned i; - memset(p_mgr, 0, offsetof(MB_MGR_HMAC_MD5_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_HMAC_MD5_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); for (i = 0; i < num_lanes; i++) { @@ -309,11 +315,12 @@ void ooo_mgr_hmac_md5_reset(void *p_ooo_mgr, const unsigned num_lanes) #endif /* __aarch64__ */ IMB_DLL_LOCAL -void ooo_mgr_zuc_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_zuc_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_ZUC_OOO *p_mgr = (MB_MGR_ZUC_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_ZUC_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_ZUC_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); if (num_lanes == 4) { @@ -330,11 +337,12 @@ void ooo_mgr_zuc_reset(void *p_ooo_mgr, const unsigned num_lanes) #ifndef __aarch64__ IMB_DLL_LOCAL -void ooo_mgr_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_SHA_1_OOO *p_mgr = (MB_MGR_SHA_1_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_SHA_1_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_SHA_1_OOO, road_block)); if (num_lanes == 2) p_mgr->unused_lanes = 0xF10; /* SHANI */ @@ -347,11 +355,12 @@ void ooo_mgr_sha1_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_SHA_256_OOO *p_mgr = (MB_MGR_SHA_256_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_SHA_256_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_SHA_256_OOO, road_block)); if (num_lanes == 2) p_mgr->unused_lanes = 0xF10; /* SHANI */ @@ -364,11 +373,12 @@ void ooo_mgr_sha256_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_SHA_512_OOO *p_mgr = (MB_MGR_SHA_512_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_SHA_512_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_SHA_512_OOO, road_block)); if (num_lanes == AVX_NUM_SHA512_LANES) p_mgr->unused_lanes = 0xF10; @@ -379,11 +389,12 @@ void ooo_mgr_sha512_reset(void *p_ooo_mgr, const unsigned num_lanes) } IMB_DLL_LOCAL -void ooo_mgr_des_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_des_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_DES_OOO *p_mgr = (MB_MGR_DES_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_DES_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_DES_OOO, road_block)); if (num_lanes == 16) p_mgr->unused_lanes = 0xFEDCBA9876543210; @@ -391,11 +402,12 @@ void ooo_mgr_des_reset(void *p_ooo_mgr, const unsigned num_lanes) #endif /* __aarch64__ */ IMB_DLL_LOCAL -void ooo_mgr_snow3g_reset(void *p_ooo_mgr, const unsigned num_lanes) +void +ooo_mgr_snow3g_reset(void *p_ooo_mgr, const unsigned num_lanes) { MB_MGR_SNOW3G_OOO *p_mgr = (MB_MGR_SNOW3G_OOO *) p_ooo_mgr; - memset(p_mgr, 0, offsetof(MB_MGR_SNOW3G_OOO,road_block)); + memset(p_mgr, 0, offsetof(MB_MGR_SNOW3G_OOO, road_block)); memset(p_mgr->lens, 0xff, sizeof(p_mgr->lens)); if (num_lanes == 4) { diff --git a/lib/x86_64/quic_aes_gcm.c b/lib/x86_64/quic_aes_gcm.c index 50c5f2af..931831da 100644 --- a/lib/x86_64/quic_aes_gcm.c +++ b/lib/x86_64/quic_aes_gcm.c @@ -29,27 +29,20 @@ #include "include/error.h" IMB_DLL_EXPORT void -imb_quic_aes_gcm(IMB_MGR *state, - const struct gcm_key_data *key_data, - const IMB_KEY_SIZE_BYTES key_size, - const IMB_CIPHER_DIRECTION cipher_dir, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t len_array[], - const void * const iv_ptr_array[], - const void * const aad_ptr_array[], - const uint64_t aad_len, - void *tag_ptr_array[], - const uint64_t tag_len, - const uint64_t num_packets) +imb_quic_aes_gcm(IMB_MGR *state, const struct gcm_key_data *key_data, + const IMB_KEY_SIZE_BYTES key_size, const IMB_CIPHER_DIRECTION cipher_dir, + void *dst_ptr_array[], const void *const src_ptr_array[], + const uint64_t len_array[], const void *const iv_ptr_array[], + const void *const aad_ptr_array[], const uint64_t aad_len, void *tag_ptr_array[], + const uint64_t tag_len, const uint64_t num_packets) { /** * @note 12 byte IV is assumed * @note it can be out of place operation * but AAD needs to be copied by the caller */ - struct gcm_context_data ctx; - uint64_t n; + struct gcm_context_data ctx; + uint64_t n; #ifdef SAFE_PARAM if (state == NULL) { @@ -122,58 +115,37 @@ imb_quic_aes_gcm(IMB_MGR *state, } #endif /* SAFE_PARAM */ - if (cipher_dir == IMB_DIR_ENCRYPT) { - if (key_size == IMB_KEY_128_BYTES) { - for (n = 0; n < num_packets; n++) { - IMB_AES128_GCM_ENC(state, key_data, &ctx, - dst_ptr_array[n], - src_ptr_array[n], - len_array[n], - iv_ptr_array[n], - aad_ptr_array[n], - aad_len, - tag_ptr_array[n], - tag_len); - } - } else /* assume 256-bits key */ { - for (n = 0; n < num_packets; n++) { - IMB_AES256_GCM_ENC(state, key_data, &ctx, - dst_ptr_array[n], - src_ptr_array[n], - len_array[n], - iv_ptr_array[n], - aad_ptr_array[n], - aad_len, - tag_ptr_array[n], - tag_len); - } - } - } else /* decrypt direction */ { - if (key_size == IMB_KEY_128_BYTES) { - for (n = 0; n < num_packets; n++) { - IMB_AES128_GCM_DEC(state, key_data, &ctx, - dst_ptr_array[n], - src_ptr_array[n], - len_array[n], - iv_ptr_array[n], - aad_ptr_array[n], - aad_len, - tag_ptr_array[n], - tag_len); - } - } else /* assume 256-bits key */ { - for (n = 0; n < num_packets; n++) { - IMB_AES256_GCM_DEC(state, key_data, &ctx, - dst_ptr_array[n], - src_ptr_array[n], - len_array[n], - iv_ptr_array[n], - aad_ptr_array[n], - aad_len, - tag_ptr_array[n], - tag_len); - } - } - } + if (cipher_dir == IMB_DIR_ENCRYPT) { + if (key_size == IMB_KEY_128_BYTES) { + for (n = 0; n < num_packets; n++) { + IMB_AES128_GCM_ENC(state, key_data, &ctx, dst_ptr_array[n], + src_ptr_array[n], len_array[n], iv_ptr_array[n], + aad_ptr_array[n], aad_len, tag_ptr_array[n], + tag_len); + } + } else /* assume 256-bits key */ { + for (n = 0; n < num_packets; n++) { + IMB_AES256_GCM_ENC(state, key_data, &ctx, dst_ptr_array[n], + src_ptr_array[n], len_array[n], iv_ptr_array[n], + aad_ptr_array[n], aad_len, tag_ptr_array[n], + tag_len); + } + } + } else /* decrypt direction */ { + if (key_size == IMB_KEY_128_BYTES) { + for (n = 0; n < num_packets; n++) { + IMB_AES128_GCM_DEC(state, key_data, &ctx, dst_ptr_array[n], + src_ptr_array[n], len_array[n], iv_ptr_array[n], + aad_ptr_array[n], aad_len, tag_ptr_array[n], + tag_len); + } + } else /* assume 256-bits key */ { + for (n = 0; n < num_packets; n++) { + IMB_AES256_GCM_DEC(state, key_data, &ctx, dst_ptr_array[n], + src_ptr_array[n], len_array[n], iv_ptr_array[n], + aad_ptr_array[n], aad_len, tag_ptr_array[n], + tag_len); + } + } + } } - diff --git a/lib/x86_64/quic_chacha20_poly1305.c b/lib/x86_64/quic_chacha20_poly1305.c index f1b89259..ab585fe7 100644 --- a/lib/x86_64/quic_chacha20_poly1305.c +++ b/lib/x86_64/quic_chacha20_poly1305.c @@ -30,17 +30,11 @@ #include "include/chacha20_poly1305.h" IMB_DLL_EXPORT void -imb_quic_chacha20_poly1305(IMB_MGR *state, - const void *key, - const IMB_CIPHER_DIRECTION cipher_dir, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t len_array[], - const void * const iv_ptr_array[], - const void * const aad_ptr_array[], - const uint64_t aad_len, - void *tag_ptr_array[], - const uint64_t tag_len, +imb_quic_chacha20_poly1305(IMB_MGR *state, const void *key, const IMB_CIPHER_DIRECTION cipher_dir, + void *dst_ptr_array[], const void *const src_ptr_array[], + const uint64_t len_array[], const void *const iv_ptr_array[], + const void *const aad_ptr_array[], const uint64_t aad_len, + void *tag_ptr_array[], const uint64_t tag_len, const uint64_t num_packets) { /** @@ -132,4 +126,3 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, state->chacha20_poly1305_quic(state, &job); } } - diff --git a/lib/x86_64/quic_hp_aes_ecb.c b/lib/x86_64/quic_hp_aes_ecb.c index b2e7150c..59405d08 100644 --- a/lib/x86_64/quic_hp_aes_ecb.c +++ b/lib/x86_64/quic_hp_aes_ecb.c @@ -29,11 +29,8 @@ #include "include/error.h" IMB_DLL_EXPORT void -imb_quic_hp_aes_ecb(IMB_MGR *state, - const void *exp_key_data, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t num_packets, +imb_quic_hp_aes_ecb(IMB_MGR *state, const void *exp_key_data, void *dst_ptr_array[], + const void *const src_ptr_array[], const uint64_t num_packets, const IMB_KEY_SIZE_BYTES key_size) { #ifdef SAFE_PARAM @@ -69,12 +66,10 @@ imb_quic_hp_aes_ecb(IMB_MGR *state, switch (key_size) { case IMB_KEY_128_BYTES: - state->aes_ecb_128_quic(src_ptr_array, exp_key_data, - dst_ptr_array, num_packets); + state->aes_ecb_128_quic(src_ptr_array, exp_key_data, dst_ptr_array, num_packets); break; case IMB_KEY_256_BYTES: - state->aes_ecb_256_quic(src_ptr_array, exp_key_data, - dst_ptr_array, num_packets); + state->aes_ecb_256_quic(src_ptr_array, exp_key_data, dst_ptr_array, num_packets); break; /* AES-192 is not supported by QUIC */ case IMB_KEY_192_BYTES: diff --git a/lib/x86_64/quic_hp_chacha20.c b/lib/x86_64/quic_hp_chacha20.c index c88f43d9..2228cb2b 100644 --- a/lib/x86_64/quic_hp_chacha20.c +++ b/lib/x86_64/quic_hp_chacha20.c @@ -30,11 +30,8 @@ #include "include/chacha20_poly1305.h" IMB_DLL_EXPORT void -imb_quic_hp_chacha20(IMB_MGR *state, - const void *key, - void *dst_ptr_array[], - const void * const src_ptr_array[], - const uint64_t num_packets) +imb_quic_hp_chacha20(IMB_MGR *state, const void *key, void *dst_ptr_array[], + const void *const src_ptr_array[], const uint64_t num_packets) { #ifdef SAFE_PARAM uint64_t i; diff --git a/lib/x86_64/self_test.c b/lib/x86_64/self_test.c index 3e22b47f..208673d0 100644 --- a/lib/x86_64/self_test.c +++ b/lib/x86_64/self_test.c @@ -25,7 +25,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ - #include #include @@ -34,7 +33,8 @@ #ifndef NO_SELF_TEST_DEV -static int process_job(IMB_MGR *p_mgr) +static int +process_job(IMB_MGR *p_mgr) { IMB_JOB *job = IMB_SUBMIT_JOB(p_mgr); @@ -68,13 +68,13 @@ static int process_job(IMB_MGR *p_mgr) struct self_test_cipher_vector { IMB_CIPHER_MODE cipher_mode; - const uint8_t *cipher_key; - size_t cipher_key_size; /* key size in bytes */ - const uint8_t *cipher_iv; /* initialization vector */ + const uint8_t *cipher_key; + size_t cipher_key_size; /* key size in bytes */ + const uint8_t *cipher_iv; /* initialization vector */ size_t cipher_iv_size; - const uint8_t *plain_text; + const uint8_t *plain_text; size_t plain_text_size; - const uint8_t *cipher_text; + const uint8_t *cipher_text; }; /* @@ -82,95 +82,65 @@ struct self_test_cipher_vector { * http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ -static const uint8_t aes_cbc_128_key[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; -static const uint8_t aes_cbc_128_iv[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; +static const uint8_t aes_cbc_128_key[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; +static const uint8_t aes_cbc_128_iv[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; static const uint8_t aes_cbc_128_plain_text[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 + 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, + 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, + 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, + 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, + 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; static const uint8_t aes_cbc_128_cipher_text[] = { - 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, - 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, - 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, - 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, - 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, - 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, - 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, - 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 -}; - -static const uint8_t aes_cbc_192_key[] = { - 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, - 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, - 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b -}; -static const uint8_t aes_cbc_192_iv[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; + 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, + 0xe9, 0x19, 0x7d, 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, 0x95, 0xdb, + 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, + 0x3b, 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, 0x3f, 0xf1, 0xca, 0xa1, + 0x68, 0x1f, 0xac, 0x09, 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7 +}; + +static const uint8_t aes_cbc_192_key[] = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, + 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, + 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b }; +static const uint8_t aes_cbc_192_iv[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; static const uint8_t aes_cbc_192_plain_text[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 + 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, + 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, + 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, + 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, + 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; static const uint8_t aes_cbc_192_cipher_text[] = { - 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d, - 0x71, 0x78, 0x18, 0x3a, 0x9f, 0xa0, 0x71, 0xe8, - 0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4, - 0xe5, 0xe7, 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a, - 0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, 0xe0, - 0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0, - 0x08, 0xb0, 0xe2, 0x79, 0x88, 0x59, 0x88, 0x81, - 0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd -}; - -static const uint8_t aes_cbc_256_key[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; -static const uint8_t aes_cbc_256_iv[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; + 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d, 0x71, 0x78, 0x18, 0x3a, 0x9f, + 0xa0, 0x71, 0xe8, 0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4, 0xe5, 0xe7, + 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a, 0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, + 0xe0, 0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0, 0x08, 0xb0, 0xe2, 0x79, + 0x88, 0x59, 0x88, 0x81, 0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd +}; + +static const uint8_t aes_cbc_256_key[] = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, + 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, + 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, + 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 }; +static const uint8_t aes_cbc_256_iv[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; static const uint8_t aes_cbc_256_plain_text[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 + 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, + 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, + 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, + 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, + 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; static const uint8_t aes_cbc_256_cipher_text[] = { - 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, - 0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6, - 0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d, - 0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d, - 0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf, - 0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61, - 0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc, - 0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b + 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, 0x77, 0x9e, 0xab, 0xfb, 0x5f, + 0x7b, 0xfb, 0xd6, 0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d, 0x67, 0x9f, + 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d, 0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, + 0xcf, 0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61, 0xb2, 0xeb, 0x05, 0xe2, + 0xc3, 0x9b, 0xe9, 0xfc, 0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b }; /* @@ -183,7 +153,7 @@ static const uint8_t aes_ctr_128_key[] = { 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E, }; static const uint8_t aes_ctr_128_iv[] = { - 0x00, 0x00, 0x00, 0x30, /* nonce */ + 0x00, 0x00, 0x00, 0x30, /* nonce */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; static const uint8_t aes_ctr_128_plain_text[] = { @@ -196,12 +166,11 @@ static const uint8_t aes_ctr_128_cipher_text[] = { }; static const uint8_t aes_ctr_192_key[] = { - 0x16, 0xAF, 0x5B, 0x14, 0x5F, 0xC9, 0xF5, 0x79, - 0xC1, 0x75, 0xF9, 0x3E, 0x3B, 0xFB, 0x0E, 0xED, - 0x86, 0x3D, 0x06, 0xCC, 0xFD, 0xB7, 0x85, 0x15, + 0x16, 0xAF, 0x5B, 0x14, 0x5F, 0xC9, 0xF5, 0x79, 0xC1, 0x75, 0xF9, 0x3E, + 0x3B, 0xFB, 0x0E, 0xED, 0x86, 0x3D, 0x06, 0xCC, 0xFD, 0xB7, 0x85, 0x15, }; static const uint8_t aes_ctr_192_iv[] = { - 0x00, 0x00, 0x00, 0x48, /* nonce */ + 0x00, 0x00, 0x00, 0x48, /* nonce */ 0x36, 0x73, 0x3C, 0x14, 0x7D, 0x6D, 0x93, 0xCB, }; static const uint8_t aes_ctr_192_plain_text[] = { @@ -214,13 +183,12 @@ static const uint8_t aes_ctr_192_cipher_text[] = { }; static const uint8_t aes_ctr_256_key[] = { - 0x77, 0x6B, 0xEF, 0xF2, 0x85, 0x1D, 0xB0, 0x6F, - 0x4C, 0x8A, 0x05, 0x42, 0xC8, 0x69, 0x6F, 0x6C, - 0x6A, 0x81, 0xAF, 0x1E, 0xEC, 0x96, 0xB4, 0xD3, - 0x7F, 0xC1, 0xD6, 0x89, 0xE6, 0xC1, 0xC1, 0x04, + 0x77, 0x6B, 0xEF, 0xF2, 0x85, 0x1D, 0xB0, 0x6F, 0x4C, 0x8A, 0x05, + 0x42, 0xC8, 0x69, 0x6F, 0x6C, 0x6A, 0x81, 0xAF, 0x1E, 0xEC, 0x96, + 0xB4, 0xD3, 0x7F, 0xC1, 0xD6, 0x89, 0xE6, 0xC1, 0xC1, 0x04, }; static const uint8_t aes_ctr_256_iv[] = { - 0x00, 0x00, 0x00, 0x60, /* nonce */ + 0x00, 0x00, 0x00, 0x60, /* nonce */ 0xDB, 0x56, 0x72, 0xC9, 0x7A, 0xA8, 0xF0, 0xB2, }; static const uint8_t aes_ctr_256_plain_text[] = { @@ -236,143 +204,115 @@ static const uint8_t aes_ctr_256_cipher_text[] = { * AES-ECB test vectors */ -static const uint8_t aes_ecb_128_key[] = { - 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, - 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c -}; +static const uint8_t aes_ecb_128_key[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; static const uint8_t aes_ecb_128_plain_text[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 + 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, + 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, + 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, + 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, + 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; static const uint8_t aes_ecb_128_cipher_text[] = { - 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60, - 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97, - 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d, - 0xe7, 0x85, 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf, - 0x43, 0xb1, 0xcd, 0x7f, 0x59, 0x8e, 0xce, 0x23, - 0x88, 0x1b, 0x00, 0xe3, 0xed, 0x03, 0x06, 0x88, - 0x7b, 0x0c, 0x78, 0x5e, 0x27, 0xe8, 0xad, 0x3f, - 0x82, 0x23, 0x20, 0x71, 0x04, 0x72, 0x5d, 0xd4 + 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60, 0xa8, 0x9e, 0xca, 0xf3, 0x24, + 0x66, 0xef, 0x97, 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d, 0xe7, 0x85, + 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf, 0x43, 0xb1, 0xcd, 0x7f, 0x59, 0x8e, 0xce, + 0x23, 0x88, 0x1b, 0x00, 0xe3, 0xed, 0x03, 0x06, 0x88, 0x7b, 0x0c, 0x78, 0x5e, + 0x27, 0xe8, 0xad, 0x3f, 0x82, 0x23, 0x20, 0x71, 0x04, 0x72, 0x5d, 0xd4 }; -static const uint8_t aes_ecb_192_key[] = { - 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, - 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, - 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b -}; +static const uint8_t aes_ecb_192_key[] = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, + 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, + 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b }; static const uint8_t aes_ecb_192_plain_text[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 + 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, + 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, + 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, + 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, + 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; static const uint8_t aes_ecb_192_cipher_text[] = { - 0xbd, 0x33, 0x4f, 0x1d, 0x6e, 0x45, 0xf2, 0x5f, - 0xf7, 0x12, 0xa2, 0x14, 0x57, 0x1f, 0xa5, 0xcc, - 0x97, 0x41, 0x04, 0x84, 0x6d, 0x0a, 0xd3, 0xad, - 0x77, 0x34, 0xec, 0xb3, 0xec, 0xee, 0x4e, 0xef, - 0xef, 0x7a, 0xfd, 0x22, 0x70, 0xe2, 0xe6, 0x0a, - 0xdc, 0xe0, 0xba, 0x2f, 0xac, 0xe6, 0x44, 0x4e, - 0x9a, 0x4b, 0x41, 0xba, 0x73, 0x8d, 0x6c, 0x72, - 0xfb, 0x16, 0x69, 0x16, 0x03, 0xc1, 0x8e, 0x0e + 0xbd, 0x33, 0x4f, 0x1d, 0x6e, 0x45, 0xf2, 0x5f, 0xf7, 0x12, 0xa2, 0x14, 0x57, + 0x1f, 0xa5, 0xcc, 0x97, 0x41, 0x04, 0x84, 0x6d, 0x0a, 0xd3, 0xad, 0x77, 0x34, + 0xec, 0xb3, 0xec, 0xee, 0x4e, 0xef, 0xef, 0x7a, 0xfd, 0x22, 0x70, 0xe2, 0xe6, + 0x0a, 0xdc, 0xe0, 0xba, 0x2f, 0xac, 0xe6, 0x44, 0x4e, 0x9a, 0x4b, 0x41, 0xba, + 0x73, 0x8d, 0x6c, 0x72, 0xfb, 0x16, 0x69, 0x16, 0x03, 0xc1, 0x8e, 0x0e }; -static const uint8_t aes_ecb_256_key[] = { - 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, - 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, - 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, - 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 -}; +static const uint8_t aes_ecb_256_key[] = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, + 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, + 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, + 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 }; static const uint8_t aes_ecb_256_plain_text[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, - 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, - 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, - 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, - 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, - 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 + 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, + 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, + 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, + 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, + 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }; static const uint8_t aes_ecb_256_cipher_text[] = { - 0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c, - 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8, - 0x59, 0x1c, 0xcb, 0x10, 0xd4, 0x10, 0xed, 0x26, - 0xdc, 0x5b, 0xa7, 0x4a, 0x31, 0x36, 0x28, 0x70, - 0xb6, 0xed, 0x21, 0xb9, 0x9c, 0xa6, 0xf4, 0xf9, - 0xf1, 0x53, 0xe7, 0xb1, 0xbe, 0xaf, 0xed, 0x1d, - 0x23, 0x30, 0x4b, 0x7a, 0x39, 0xf9, 0xf3, 0xff, - 0x06, 0x7d, 0x8d, 0x8f, 0x9e, 0x24, 0xec, 0xc7 + 0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c, 0x06, 0x4b, 0x5a, 0x7e, 0x3d, + 0xb1, 0x81, 0xf8, 0x59, 0x1c, 0xcb, 0x10, 0xd4, 0x10, 0xed, 0x26, 0xdc, 0x5b, + 0xa7, 0x4a, 0x31, 0x36, 0x28, 0x70, 0xb6, 0xed, 0x21, 0xb9, 0x9c, 0xa6, 0xf4, + 0xf9, 0xf1, 0x53, 0xe7, 0xb1, 0xbe, 0xaf, 0xed, 0x1d, 0x23, 0x30, 0x4b, 0x7a, + 0x39, 0xf9, 0xf3, 0xff, 0x06, 0x7d, 0x8d, 0x8f, 0x9e, 0x24, 0xec, 0xc7 }; static const uint8_t null_iv[] = { 0x00 }; /* * Triple DES test vector TDES_EDE_CBC */ -static const uint8_t tdes_ede_cbc_key[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 -}; +static const uint8_t tdes_ede_cbc_key[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; -static const uint8_t tdes_ede_cbc_iv[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; +static const uint8_t tdes_ede_cbc_iv[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; -static const uint8_t tdes_ede_cbc_plain_text[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -}; +static const uint8_t tdes_ede_cbc_plain_text[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; static const uint8_t tdes_ede_cbc_cipher_text[] = { 0x89, 0x4b, 0xc3, 0x08, 0x54, 0x26, 0xa4, 0x41, 0xf2, 0x7f, 0x73, 0xae, 0x26, 0xab, 0xbf, 0x74 }; -#define ADD_CIPHER_VECTOR(_cmode,_key,_iv,_plain,_cipher) \ - {_cmode, _key, sizeof(_key), _iv, sizeof(_iv), \ - _plain, sizeof(_plain), _cipher} +#define ADD_CIPHER_VECTOR(_cmode, _key, _iv, _plain, _cipher) \ + { \ + _cmode, _key, sizeof(_key), _iv, sizeof(_iv), _plain, sizeof(_plain), _cipher \ + } struct self_test_cipher_vector cipher_vectors[] = { - ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_128_key, aes_cbc_128_iv, - aes_cbc_128_plain_text, aes_cbc_128_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_192_key, aes_cbc_192_iv, - aes_cbc_192_plain_text, aes_cbc_192_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_256_key, aes_cbc_256_iv, - aes_cbc_256_plain_text, aes_cbc_256_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_128_key, aes_ctr_128_iv, - aes_ctr_128_plain_text, aes_ctr_128_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_192_key, aes_ctr_192_iv, - aes_ctr_192_plain_text, aes_ctr_192_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_256_key, aes_ctr_256_iv, - aes_ctr_256_plain_text, aes_ctr_256_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_128_key, null_iv, - aes_ecb_128_plain_text, aes_ecb_128_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_192_key, null_iv, - aes_ecb_192_plain_text, aes_ecb_192_cipher_text), - ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_256_key, null_iv, - aes_ecb_256_plain_text, aes_ecb_256_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_128_key, aes_cbc_128_iv, aes_cbc_128_plain_text, + aes_cbc_128_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_192_key, aes_cbc_192_iv, aes_cbc_192_plain_text, + aes_cbc_192_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_256_key, aes_cbc_256_iv, aes_cbc_256_plain_text, + aes_cbc_256_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_128_key, aes_ctr_128_iv, aes_ctr_128_plain_text, + aes_ctr_128_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_192_key, aes_ctr_192_iv, aes_ctr_192_plain_text, + aes_ctr_192_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_256_key, aes_ctr_256_iv, aes_ctr_256_plain_text, + aes_ctr_256_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_128_key, null_iv, aes_ecb_128_plain_text, + aes_ecb_128_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_192_key, null_iv, aes_ecb_192_plain_text, + aes_ecb_192_cipher_text), + ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_256_key, null_iv, aes_ecb_256_plain_text, + aes_ecb_256_cipher_text), ADD_CIPHER_VECTOR(IMB_CIPHER_DES3, tdes_ede_cbc_key, tdes_ede_cbc_iv, tdes_ede_cbc_plain_text, tdes_ede_cbc_cipher_text), }; #define DES_KEY_SCHED_WORDS (IMB_DES_KEY_SCHED_SIZE / sizeof(uint64_t)) -static int self_test_ciphers(IMB_MGR *p_mgr) +static int +self_test_ciphers(IMB_MGR *p_mgr) { union { struct { - DECLARE_ALIGNED(uint32_t expkey_enc[4*15], 16); - DECLARE_ALIGNED(uint32_t expkey_dec[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey_enc[4 * 15], 16); + DECLARE_ALIGNED(uint32_t expkey_dec[4 * 15], 16); } aes; struct { uint64_t key_sched1[DES_KEY_SCHED_WORDS]; @@ -403,26 +343,22 @@ static int self_test_ciphers(IMB_MGR *p_mgr) } des_key_schedule(ks.tdes.key_sched1, &v->cipher_key[0]); des_key_schedule(ks.tdes.key_sched2, &v->cipher_key[8]); - des_key_schedule(ks.tdes.key_sched3, - &v->cipher_key[16]); + des_key_schedule(ks.tdes.key_sched3, &v->cipher_key[16]); ks.tdes.keys[0] = ks.tdes.key_sched1; ks.tdes.keys[1] = ks.tdes.key_sched2; ks.tdes.keys[2] = ks.tdes.key_sched3; } else { switch (v->cipher_key_size) { case IMB_KEY_128_BYTES: - IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, - ks.aes.expkey_enc, + IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, ks.aes.expkey_enc, ks.aes.expkey_dec); break; case IMB_KEY_192_BYTES: - IMB_AES_KEYEXP_192(p_mgr, v->cipher_key, - ks.aes.expkey_enc, + IMB_AES_KEYEXP_192(p_mgr, v->cipher_key, ks.aes.expkey_enc, ks.aes.expkey_dec); break; case IMB_KEY_256_BYTES: - IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, - ks.aes.expkey_enc, + IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, ks.aes.expkey_enc, ks.aes.expkey_dec); break; default: @@ -512,13 +448,13 @@ static int self_test_ciphers(IMB_MGR *p_mgr) struct self_test_hash_vector { IMB_HASH_ALG hash_mode; - const uint8_t *hash_key; /* cmac, hmac, gmac */ + const uint8_t *hash_key; /* cmac, hmac, gmac */ size_t hash_key_size; /* key size in bytes */ - const uint8_t *message; + const uint8_t *message; size_t message_size; - const uint8_t *tag; + const uint8_t *tag; size_t tag_size; - const uint8_t *hash_iv; /* gmac */ + const uint8_t *hash_iv; /* gmac */ size_t hash_iv_size; }; @@ -529,148 +465,97 @@ struct self_test_hash_vector { * cryptographic-standards-and-guidelines/documents/examples/sha_all.pdf */ -const uint8_t sha_message[] = { - 0x61, 0x62, 0x63, 0x64, 0x62, 0x63, 0x64, 0x65, - 0x63, 0x64, 0x65, 0x66, 0x64, 0x65, 0x66, 0x67, - 0x65, 0x66, 0x67, 0x68, 0x66, 0x67, 0x68, 0x69, - 0x67, 0x68, 0x69, 0x6a, 0x68, 0x69, 0x6a, 0x6b, - 0x69, 0x6a, 0x6b, 0x6c, 0x6a, 0x6b, 0x6c, 0x6d, - 0x6b, 0x6c, 0x6d, 0x6e, 0x6c, 0x6d, 0x6e, 0x6f, - 0x6d, 0x6e, 0x6f, 0x70, 0x6e, 0x6f, 0x70, 0x71 -}; - -const uint8_t sha1_digest[] = { - 0x84, 0x98, 0x3e, 0x44, - 0x1c, 0x3b, 0xd2, 0x6e, - 0xba, 0xae, 0x4a, 0xa1, - 0xf9, 0x51, 0x29, 0xe5, - 0xe5, 0x46, 0x70, 0xf1 -}; - -const uint8_t sha224_digest[] = { - 0x75, 0x38, 0x8b, 0x16, - 0x51, 0x27, 0x76, 0xcc, - 0x5d, 0xba, 0x5d, 0xa1, - 0xfd, 0x89, 0x01, 0x50, - 0xb0, 0xc6, 0x45, 0x5c, - 0xb4, 0xf5, 0x8b, 0x19, - 0x52, 0x52, 0x25, 0x25 -}; - -const uint8_t sha256_digest[] = { - 0x24, 0x8d, 0x6a, 0x61, - 0xd2, 0x06, 0x38, 0xb8, - 0xe5, 0xc0, 0x26, 0x93, - 0x0c, 0x3e, 0x60, 0x39, - 0xa3, 0x3c, 0xe4, 0x59, - 0x64, 0xff, 0x21, 0x67, - 0xf6, 0xec, 0xed, 0xd4, - 0x19, 0xdb, 0x06, 0xc1 -}; - -const uint8_t sha384_digest[] = { - 0x33, 0x91, 0xfd, 0xdd, 0xfc, 0x8d, 0xc7, 0x39, - 0x37, 0x07, 0xa6, 0x5b, 0x1b, 0x47, 0x09, 0x39, - 0x7c, 0xf8, 0xb1, 0xd1, 0x62, 0xaf, 0x05, 0xab, - 0xfe, 0x8f, 0x45, 0x0d, 0xe5, 0xf3, 0x6b, 0xc6, - 0xb0, 0x45, 0x5a, 0x85, 0x20, 0xbc, 0x4e, 0x6f, - 0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b -}; - -const uint8_t sha512_digest[] = { - 0x20, 0x4a, 0x8f, 0xc6, 0xdd, 0xa8, 0x2f, 0x0a, - 0x0c, 0xed, 0x7b, 0xeb, 0x8e, 0x08, 0xa4, 0x16, - 0x57, 0xc1, 0x6e, 0xf4, 0x68, 0xb2, 0x28, 0xa8, - 0x27, 0x9b, 0xe3, 0x31, 0xa7, 0x03, 0xc3, 0x35, - 0x96, 0xfd, 0x15, 0xc1, 0x3b, 0x1b, 0x07, 0xf9, - 0xaa, 0x1d, 0x3b, 0xea, 0x57, 0x78, 0x9c, 0xa0, - 0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7, 0x03, - 0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45 -}; - -#define ADD_SHA_VECTOR(_hmode,_msg,_digest) \ - {_hmode, NULL, 0, _msg, sizeof(_msg), \ - _digest, sizeof(_digest), NULL, 0} +const uint8_t sha_message[] = { 0x61, 0x62, 0x63, 0x64, 0x62, 0x63, 0x64, 0x65, 0x63, 0x64, + 0x65, 0x66, 0x64, 0x65, 0x66, 0x67, 0x65, 0x66, 0x67, 0x68, + 0x66, 0x67, 0x68, 0x69, 0x67, 0x68, 0x69, 0x6a, 0x68, 0x69, + 0x6a, 0x6b, 0x69, 0x6a, 0x6b, 0x6c, 0x6a, 0x6b, 0x6c, 0x6d, + 0x6b, 0x6c, 0x6d, 0x6e, 0x6c, 0x6d, 0x6e, 0x6f, 0x6d, 0x6e, + 0x6f, 0x70, 0x6e, 0x6f, 0x70, 0x71 }; + +const uint8_t sha1_digest[] = { 0x84, 0x98, 0x3e, 0x44, 0x1c, 0x3b, 0xd2, 0x6e, 0xba, 0xae, + 0x4a, 0xa1, 0xf9, 0x51, 0x29, 0xe5, 0xe5, 0x46, 0x70, 0xf1 }; + +const uint8_t sha224_digest[] = { 0x75, 0x38, 0x8b, 0x16, 0x51, 0x27, 0x76, 0xcc, 0x5d, 0xba, + 0x5d, 0xa1, 0xfd, 0x89, 0x01, 0x50, 0xb0, 0xc6, 0x45, 0x5c, + 0xb4, 0xf5, 0x8b, 0x19, 0x52, 0x52, 0x25, 0x25 }; + +const uint8_t sha256_digest[] = { 0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8, 0xe5, 0xc0, 0x26, + 0x93, 0x0c, 0x3e, 0x60, 0x39, 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, + 0x21, 0x67, 0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1 }; + +const uint8_t sha384_digest[] = { 0x33, 0x91, 0xfd, 0xdd, 0xfc, 0x8d, 0xc7, 0x39, 0x37, 0x07, + 0xa6, 0x5b, 0x1b, 0x47, 0x09, 0x39, 0x7c, 0xf8, 0xb1, 0xd1, + 0x62, 0xaf, 0x05, 0xab, 0xfe, 0x8f, 0x45, 0x0d, 0xe5, 0xf3, + 0x6b, 0xc6, 0xb0, 0x45, 0x5a, 0x85, 0x20, 0xbc, 0x4e, 0x6f, + 0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b }; + +const uint8_t sha512_digest[] = { 0x20, 0x4a, 0x8f, 0xc6, 0xdd, 0xa8, 0x2f, 0x0a, 0x0c, 0xed, 0x7b, + 0xeb, 0x8e, 0x08, 0xa4, 0x16, 0x57, 0xc1, 0x6e, 0xf4, 0x68, 0xb2, + 0x28, 0xa8, 0x27, 0x9b, 0xe3, 0x31, 0xa7, 0x03, 0xc3, 0x35, 0x96, + 0xfd, 0x15, 0xc1, 0x3b, 0x1b, 0x07, 0xf9, 0xaa, 0x1d, 0x3b, 0xea, + 0x57, 0x78, 0x9c, 0xa0, 0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7, + 0x03, 0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45 }; + +#define ADD_SHA_VECTOR(_hmode, _msg, _digest) \ + { \ + _hmode, NULL, 0, _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0 \ + } /* * Test vector from https://csrc.nist.gov/csrc/media/publications/fips/198/ * archive/2002-03-06/documents/fips-198a.pdf */ -static const uint8_t hmac_sha1_key[] = { - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0 -}; +static const uint8_t hmac_sha1_key[] = { 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, + 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0 }; -static const uint8_t hmac_sha1_message[] = { - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x23, - 0x34 -}; +static const uint8_t hmac_sha1_message[] = { 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x23, 0x34 }; -static const uint8_t hmac_sha1_digest[] = { - 0x9e, 0xa8, 0x86, 0xef, 0xe2, 0x68, 0xdb, 0xec, - 0xce, 0x42, 0x0c, 0x75 -}; +static const uint8_t hmac_sha1_digest[] = { 0x9e, 0xa8, 0x86, 0xef, 0xe2, 0x68, + 0xdb, 0xec, 0xce, 0x42, 0x0c, 0x75 }; /* * Test vector from https://csrc.nist.gov/csrc/media/projects/ * cryptographic-standards-and-guidelines/documents/examples/hmac_sha224.pdf */ static const uint8_t hmac_sha224_key[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f -}; -static const uint8_t hmac_sha224_message[] = { - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, - 0x6e, 0x3d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x6e -}; -static const uint8_t hmac_sha224_digest[] = { - 0xc7, 0x40, 0x5e, 0x3a, 0xe0, 0x58, 0xe8, 0xcd, - 0x30, 0xb0, 0x8b, 0x41, 0x40, 0x24, 0x85, 0x81, - 0xed, 0x17, 0x4c, 0xb3, 0x4e, 0x12, 0x24, 0xbc, - 0xc1, 0xef, 0xc8, 0x1b -}; + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f +}; +static const uint8_t hmac_sha224_message[] = { 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, 0x6e, 0x3d, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x6e }; +static const uint8_t hmac_sha224_digest[] = { 0xc7, 0x40, 0x5e, 0x3a, 0xe0, 0x58, 0xe8, + 0xcd, 0x30, 0xb0, 0x8b, 0x41, 0x40, 0x24, + 0x85, 0x81, 0xed, 0x17, 0x4c, 0xb3, 0x4e, + 0x12, 0x24, 0xbc, 0xc1, 0xef, 0xc8, 0x1b }; /* * Test vector from https://csrc.nist.gov/csrc/media/projects/ * cryptographic-standards-and-guidelines/documents/examples/hmac_sha256.pdf */ static const uint8_t hmac_sha256_key[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f -}; -static const uint8_t hmac_sha256_message[] = { - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, - 0x6e, 0x3d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x6e -}; + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f +}; +static const uint8_t hmac_sha256_message[] = { 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, 0x6e, 0x3d, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x6e }; static const uint8_t hmac_sha256_digest[] = { - 0x8b, 0xb9, 0xa1, 0xdb, 0x98, 0x06, 0xf2, 0x0d, - 0xf7, 0xf7, 0x7b, 0x82, 0x13, 0x8c, 0x79, 0x14, - 0xd1, 0x74, 0xd5, 0x9e, 0x13, 0xdc, 0x4d, 0x01, - 0x69, 0xc9, 0x05, 0x7b, 0x13, 0x3e, 0x1d, 0x62, + 0x8b, 0xb9, 0xa1, 0xdb, 0x98, 0x06, 0xf2, 0x0d, 0xf7, 0xf7, 0x7b, + 0x82, 0x13, 0x8c, 0x79, 0x14, 0xd1, 0x74, 0xd5, 0x9e, 0x13, 0xdc, + 0x4d, 0x01, 0x69, 0xc9, 0x05, 0x7b, 0x13, 0x3e, 0x1d, 0x62, }; /* @@ -678,194 +563,135 @@ static const uint8_t hmac_sha256_digest[] = { * cryptographic-standards-and-guidelines/documents/examples/hmac_sha384.pdf */ static const uint8_t hmac_sha384_key[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, + 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, + 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f }; -static const uint8_t hmac_sha384_message[] = { - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, - 0x6e, 0x3d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x6e -}; -static const uint8_t hmac_sha384_digest[] = { - 0x63, 0xc5, 0xda, 0xa5, 0xe6, 0x51, 0x84, 0x7c, - 0xa8, 0x97, 0xc9, 0x58, 0x14, 0xab, 0x83, 0x0b, - 0xed, 0xed, 0xc7, 0xd2, 0x5e, 0x83, 0xee, 0xf9 -}; +static const uint8_t hmac_sha384_message[] = { 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, 0x6e, 0x3d, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x6e }; +static const uint8_t hmac_sha384_digest[] = { 0x63, 0xc5, 0xda, 0xa5, 0xe6, 0x51, 0x84, 0x7c, + 0xa8, 0x97, 0xc9, 0x58, 0x14, 0xab, 0x83, 0x0b, + 0xed, 0xed, 0xc7, 0xd2, 0x5e, 0x83, 0xee, 0xf9 }; /* * Test vector from https://csrc.nist.gov/csrc/media/projects/ * cryptographic-standards-and-guidelines/documents/examples/hmac_sha512.pdf */ static const uint8_t hmac_sha512_key[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, + 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, + 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, + 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f }; -static const uint8_t hmac_sha512_message[] = { - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, - 0x6e, 0x3d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x6e -}; -static const uint8_t hmac_sha512_digest[] = { - 0xfc, 0x25, 0xe2, 0x40, 0x65, 0x8c, 0xa7, 0x85, - 0xb7, 0xa8, 0x11, 0xa8, 0xd3, 0xf7, 0xb4, 0xca, - 0x48, 0xcf, 0xa2, 0x6a, 0x8a, 0x36, 0x6b, 0xf2, - 0xcd, 0x1f, 0x83, 0x6b, 0x05, 0xfc, 0xb0, 0x24 -}; - -#define ADD_HMAC_SHA_VECTOR(_hmode,_key,_msg,_digest) \ - {_hmode, _key, sizeof(_key), _msg, sizeof(_msg), \ - _digest, sizeof(_digest), NULL, 0} +static const uint8_t hmac_sha512_message[] = { 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x6b, 0x65, 0x79, 0x6c, 0x65, 0x6e, 0x3d, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x6e }; +static const uint8_t hmac_sha512_digest[] = { 0xfc, 0x25, 0xe2, 0x40, 0x65, 0x8c, 0xa7, 0x85, + 0xb7, 0xa8, 0x11, 0xa8, 0xd3, 0xf7, 0xb4, 0xca, + 0x48, 0xcf, 0xa2, 0x6a, 0x8a, 0x36, 0x6b, 0xf2, + 0xcd, 0x1f, 0x83, 0x6b, 0x05, 0xfc, 0xb0, 0x24 }; + +#define ADD_HMAC_SHA_VECTOR(_hmode, _key, _msg, _digest) \ + { \ + _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0 \ + } /* * 3GPP 33.401 C.2.1 Test Case 2 */ -static const uint8_t aes_cmac_128_key[] = { - 0xd3, 0xc5, 0xd5, 0x92, 0x32, 0x7f, 0xb1, 0x1c, - 0x40, 0x35, 0xc6, 0x68, 0x0a, 0xf8, 0xc6, 0xd1 -}; - -static const uint8_t aes_cmac_128_tag[] = { - 0xb9, 0x37, 0x87, 0xe6 -}; - -static const uint8_t aes_cmac_128_message[] = { - 0x39, 0x8a, 0x59, 0xb4, 0xd4, 0x00, 0x00, 0x00, - 0x48, 0x45, 0x83, 0xd5, 0xaf, 0xe0, 0x82, 0xae -}; - -static const uint8_t aes_cmac_256_key[] = { - 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, - 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, - 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, - 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 -}; -static const uint8_t aes_cmac_256_message[] = { - 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, - 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57 -}; -static const uint8_t aes_cmac_256_tag[] = { - 0x15, 0x67, 0x27, 0xDC, 0x08, 0x78, 0x94, 0x4A, - 0x02, 0x3C, 0x1F, 0xE0, 0x3B, 0xAD, 0x6D, 0x93 -}; - -#define ADD_CMAC_VECTOR(_hmode,_key,_msg,_digest) \ - {_hmode, _key, sizeof(_key), _msg, sizeof(_msg), \ - _digest, sizeof(_digest), NULL, 0} +static const uint8_t aes_cmac_128_key[] = { 0xd3, 0xc5, 0xd5, 0x92, 0x32, 0x7f, 0xb1, 0x1c, + 0x40, 0x35, 0xc6, 0x68, 0x0a, 0xf8, 0xc6, 0xd1 }; + +static const uint8_t aes_cmac_128_tag[] = { 0xb9, 0x37, 0x87, 0xe6 }; + +static const uint8_t aes_cmac_128_message[] = { 0x39, 0x8a, 0x59, 0xb4, 0xd4, 0x00, 0x00, 0x00, + 0x48, 0x45, 0x83, 0xd5, 0xaf, 0xe0, 0x82, 0xae }; + +static const uint8_t aes_cmac_256_key[] = { 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, + 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, + 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, + 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 }; +static const uint8_t aes_cmac_256_message[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, + 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, + 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57 }; +static const uint8_t aes_cmac_256_tag[] = { 0x15, 0x67, 0x27, 0xDC, 0x08, 0x78, 0x94, 0x4A, + 0x02, 0x3C, 0x1F, 0xE0, 0x3B, 0xAD, 0x6D, 0x93 }; + +#define ADD_CMAC_VECTOR(_hmode, _key, _msg, _digest) \ + { \ + _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0 \ + } /* * GMAC vectors */ -static const uint8_t aes_gmac_128_key[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F -}; -static const uint8_t aes_gmac_128_iv[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B -}; +static const uint8_t aes_gmac_128_key[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; +static const uint8_t aes_gmac_128_iv[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, + 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B }; static const uint8_t aes_gmac_128_message[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, -}; -static const uint8_t aes_gmac_128_tag[] = { - 0xC5, 0x3A, 0xF9, 0xE8 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, }; +static const uint8_t aes_gmac_128_tag[] = { 0xC5, 0x3A, 0xF9, 0xE8 }; static const uint8_t aes_gmac_192_key[] = { - 0xaa, 0x74, 0x0a, 0xbf, 0xad, 0xcd, 0xa7, 0x79, - 0x22, 0x0d, 0x3b, 0x40, 0x6c, 0x5d, 0x7e, 0xc0, - 0x9a, 0x77, 0xfe, 0x9d, 0x94, 0x10, 0x45, 0x39, -}; -static const uint8_t aes_gmac_192_iv[] = { - 0xab, 0x22, 0x65, 0xb4, 0xc1, 0x68, 0x95, 0x55, - 0x61, 0xf0, 0x43, 0x15 + 0xaa, 0x74, 0x0a, 0xbf, 0xad, 0xcd, 0xa7, 0x79, 0x22, 0x0d, 0x3b, 0x40, + 0x6c, 0x5d, 0x7e, 0xc0, 0x9a, 0x77, 0xfe, 0x9d, 0x94, 0x10, 0x45, 0x39, }; +static const uint8_t aes_gmac_192_iv[] = { 0xab, 0x22, 0x65, 0xb4, 0xc1, 0x68, + 0x95, 0x55, 0x61, 0xf0, 0x43, 0x15 }; static const uint8_t aes_gmac_192_message[] = { - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, -}; -static const uint8_t aes_gmac_192_tag[] = { - 0xCF, 0x82, 0x80, 0x64, 0x02, 0x46, 0xF4, 0xFB, - 0x33, 0xAE, 0x1D, 0x90, 0xEA, 0x48, 0x83, 0xDB + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + 0x0F, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, + 0x0D, 0x0E, 0x0F, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, }; +static const uint8_t aes_gmac_192_tag[] = { 0xCF, 0x82, 0x80, 0x64, 0x02, 0x46, 0xF4, 0xFB, + 0x33, 0xAE, 0x1D, 0x90, 0xEA, 0x48, 0x83, 0xDB }; static const uint8_t aes_gmac_256_key[] = { - 0xb5, 0x48, 0xe4, 0x93, 0x4f, 0x5c, 0x64, 0xd3, - 0xc0, 0xf0, 0xb7, 0x8f, 0x7b, 0x4d, 0x88, 0x24, - 0xaa, 0xc4, 0x6b, 0x3c, 0x8d, 0x2c, 0xc3, 0x5e, - 0xe4, 0xbf, 0xb2, 0x54, 0xe4, 0xfc, 0xba, 0xf7, + 0xb5, 0x48, 0xe4, 0x93, 0x4f, 0x5c, 0x64, 0xd3, 0xc0, 0xf0, 0xb7, + 0x8f, 0x7b, 0x4d, 0x88, 0x24, 0xaa, 0xc4, 0x6b, 0x3c, 0x8d, 0x2c, + 0xc3, 0x5e, 0xe4, 0xbf, 0xb2, 0x54, 0xe4, 0xfc, 0xba, 0xf7, }; static const uint8_t aes_gmac_256_iv[] = { - 0x2e, 0xed, 0xe1, 0xdc, 0x64, 0x47, 0xc7, 0xaf, - 0xc4, 0x41, 0x53, 0x58, + 0x2e, 0xed, 0xe1, 0xdc, 0x64, 0x47, 0xc7, 0xaf, 0xc4, 0x41, 0x53, 0x58, }; static const uint8_t aes_gmac_256_message[] = { - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x01 -}; -static const uint8_t aes_gmac_256_tag[] = { - 0x77, 0x46, 0x0D, 0x6F, 0xB1, 0x87, 0xDB, 0xA9, - 0x46, 0xAD, 0xCD, 0xFB, 0xB7, 0xF9, 0x13, 0xA1 -}; - -#define ADD_GMAC_VECTOR(_hmode,_key,_iv,_msg,_tag) \ - {_hmode, _key, sizeof(_key), _msg, sizeof(_msg), \ - _tag, sizeof(_tag), \ - _iv, sizeof(_iv)} + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, + 0x0E, 0x0F, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x01 +}; +static const uint8_t aes_gmac_256_tag[] = { 0x77, 0x46, 0x0D, 0x6F, 0xB1, 0x87, 0xDB, 0xA9, + 0x46, 0xAD, 0xCD, 0xFB, 0xB7, 0xF9, 0x13, 0xA1 }; + +#define ADD_GMAC_VECTOR(_hmode, _key, _iv, _msg, _tag) \ + { \ + _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _tag, sizeof(_tag), _iv, \ + sizeof(_iv) \ + } struct self_test_hash_vector hash_vectors[] = { ADD_SHA_VECTOR(IMB_AUTH_SHA_1, sha_message, sha1_digest), @@ -873,39 +699,37 @@ struct self_test_hash_vector hash_vectors[] = { ADD_SHA_VECTOR(IMB_AUTH_SHA_256, sha_message, sha256_digest), ADD_SHA_VECTOR(IMB_AUTH_SHA_384, sha_message, sha384_digest), ADD_SHA_VECTOR(IMB_AUTH_SHA_512, sha_message, sha512_digest), - ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_1, hmac_sha1_key, - hmac_sha1_message, hmac_sha1_digest), - ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_224, hmac_sha224_key, - hmac_sha224_message, hmac_sha224_digest), - ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_256, hmac_sha256_key, - hmac_sha256_message, hmac_sha256_digest), - ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_384, hmac_sha384_key, - hmac_sha384_message, hmac_sha384_digest), - ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_512, hmac_sha512_key, - hmac_sha512_message, hmac_sha512_digest), - ADD_CMAC_VECTOR(IMB_AUTH_AES_CMAC, aes_cmac_128_key, - aes_cmac_128_message, aes_cmac_128_tag), - ADD_CMAC_VECTOR(IMB_AUTH_AES_CMAC_256, aes_cmac_256_key, - aes_cmac_256_message, aes_cmac_256_tag), - ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_128, aes_gmac_128_key, - aes_gmac_128_iv, aes_gmac_128_message, - aes_gmac_128_tag), - ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_192, aes_gmac_192_key, - aes_gmac_192_iv, aes_gmac_192_message, - aes_gmac_192_tag), - ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_256, aes_gmac_256_key, - aes_gmac_256_iv, aes_gmac_256_message, - aes_gmac_256_tag), -}; - -static int self_test_hash(IMB_MGR *p_mgr) + ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_1, hmac_sha1_key, hmac_sha1_message, + hmac_sha1_digest), + ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_224, hmac_sha224_key, hmac_sha224_message, + hmac_sha224_digest), + ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_256, hmac_sha256_key, hmac_sha256_message, + hmac_sha256_digest), + ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_384, hmac_sha384_key, hmac_sha384_message, + hmac_sha384_digest), + ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_512, hmac_sha512_key, hmac_sha512_message, + hmac_sha512_digest), + ADD_CMAC_VECTOR(IMB_AUTH_AES_CMAC, aes_cmac_128_key, aes_cmac_128_message, + aes_cmac_128_tag), + ADD_CMAC_VECTOR(IMB_AUTH_AES_CMAC_256, aes_cmac_256_key, aes_cmac_256_message, + aes_cmac_256_tag), + ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_128, aes_gmac_128_key, aes_gmac_128_iv, + aes_gmac_128_message, aes_gmac_128_tag), + ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_192, aes_gmac_192_key, aes_gmac_192_iv, + aes_gmac_192_message, aes_gmac_192_tag), + ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_256, aes_gmac_256_key, aes_gmac_256_iv, + aes_gmac_256_message, aes_gmac_256_tag), +}; + +static int +self_test_hash(IMB_MGR *p_mgr) { /* hmac */ DECLARE_ALIGNED(uint8_t hmac_ipad[IMB_SHA512_DIGEST_SIZE_IN_BYTES], 16); DECLARE_ALIGNED(uint8_t hmac_opad[IMB_SHA512_DIGEST_SIZE_IN_BYTES], 16); /* cmac */ - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint32_t skey1[4], skey2[4]; /* gmac */ struct gcm_key_data gmac_key; @@ -937,18 +761,15 @@ static int self_test_hash(IMB_MGR *p_mgr) job->msg_len_to_hash_in_bytes = v->message_size; job->auth_tag_output = scratch; job->auth_tag_output_len_in_bytes = v->tag_size; - if (v->hash_mode >= IMB_AUTH_HMAC_SHA_1 && - v->hash_mode <= IMB_AUTH_HMAC_SHA_512) { - imb_hmac_ipad_opad(p_mgr, v->hash_mode, v->hash_key, - v->hash_key_size, + if (v->hash_mode >= IMB_AUTH_HMAC_SHA_1 && v->hash_mode <= IMB_AUTH_HMAC_SHA_512) { + imb_hmac_ipad_opad(p_mgr, v->hash_mode, v->hash_key, v->hash_key_size, hmac_ipad, hmac_opad); job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; } if (v->hash_mode == IMB_AUTH_AES_CMAC) { IMB_AES_KEYEXP_128(p_mgr, v->hash_key, expkey, dust); - IMB_AES_CMAC_SUBKEY_GEN_128(p_mgr, expkey, - skey1, skey2); + IMB_AES_CMAC_SUBKEY_GEN_128(p_mgr, expkey, skey1, skey2); job->u.CMAC._key_expanded = expkey; job->u.CMAC._skey1 = skey1; job->u.CMAC._skey2 = skey2; @@ -956,8 +777,7 @@ static int self_test_hash(IMB_MGR *p_mgr) if (v->hash_mode == IMB_AUTH_AES_CMAC_256) { IMB_AES_KEYEXP_256(p_mgr, v->hash_key, expkey, dust); - IMB_AES_CMAC_SUBKEY_GEN_256(p_mgr, expkey, - skey1, skey2); + IMB_AES_CMAC_SUBKEY_GEN_256(p_mgr, expkey, skey1, skey2); job->u.CMAC._key_expanded = expkey; job->u.CMAC._skey1 = skey1; job->u.CMAC._skey2 = skey2; @@ -1033,12 +853,9 @@ static int self_test_hash(IMB_MGR *p_mgr) memset(scratch, 0, sizeof(scratch)); IMB_AES128_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - IMB_AES128_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, - v->hash_iv_size); - IMB_AES128_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, - v->message, v->message_size); - IMB_AES128_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, - scratch, v->tag_size); + IMB_AES128_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); + IMB_AES128_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); + IMB_AES128_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); if (memcmp(scratch, v->tag, v->tag_size)) return 0; } @@ -1047,12 +864,9 @@ static int self_test_hash(IMB_MGR *p_mgr) memset(scratch, 0, sizeof(scratch)); IMB_AES192_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - IMB_AES192_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, - v->hash_iv_size); - IMB_AES192_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, - v->message, v->message_size); - IMB_AES192_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, - scratch, v->tag_size); + IMB_AES192_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); + IMB_AES192_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); + IMB_AES192_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); if (memcmp(scratch, v->tag, v->tag_size)) return 0; } @@ -1061,12 +875,9 @@ static int self_test_hash(IMB_MGR *p_mgr) memset(scratch, 0, sizeof(scratch)); IMB_AES256_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - IMB_AES256_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, - v->hash_iv_size); - IMB_AES256_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, - v->message, v->message_size); - IMB_AES256_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, - scratch, v->tag_size); + IMB_AES256_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); + IMB_AES256_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); + IMB_AES256_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); if (memcmp(scratch, v->tag, v->tag_size)) return 0; } @@ -1085,16 +896,16 @@ static int self_test_hash(IMB_MGR *p_mgr) struct self_test_gcm_vector { IMB_HASH_ALG hash_mode; IMB_CIPHER_MODE cipher_mode; - const uint8_t *cipher_key; + const uint8_t *cipher_key; size_t cipher_key_size; - const uint8_t *cipher_iv; + const uint8_t *cipher_iv; size_t cipher_iv_size; - const uint8_t *aad; + const uint8_t *aad; size_t aad_size; - const uint8_t *plain_text; + const uint8_t *plain_text; size_t plain_text_size; - const uint8_t *cipher_text; - const uint8_t *tag; + const uint8_t *cipher_text; + const uint8_t *tag; size_t tag_size; }; @@ -1102,59 +913,41 @@ struct self_test_gcm_vector { * http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip * gcmEncryptExtIV128.rsp */ -static const uint8_t aes_gcm_128_key[] = { - 0xc9, 0x39, 0xcc, 0x13, 0x39, 0x7c, 0x1d, 0x37, - 0xde, 0x6a, 0xe0, 0xe1, 0xcb, 0x7c, 0x42, 0x3c -}; -static const uint8_t aes_gcm_128_iv[] = { - 0xb3, 0xd8, 0xcc, 0x01, 0x7c, 0xbb, 0x89, 0xb3, - 0x9e, 0x0f, 0x67, 0xe2 -}; -static const uint8_t aes_gcm_128_plain_text[] = { - 0xc3, 0xb3, 0xc4, 0x1f, 0x11, 0x3a, 0x31, 0xb7, - 0x3d, 0x9a, 0x5c, 0xd4, 0x32, 0x10, 0x30, 0x69 -}; -static const uint8_t aes_gcm_128_aad[] = { - 0x24, 0x82, 0x56, 0x02, 0xbd, 0x12, 0xa9, 0x84, - 0xe0, 0x09, 0x2d, 0x3e, 0x44, 0x8e, 0xda, 0x5f -}; -static const uint8_t aes_gcm_128_cipher_text[] = { - 0x93, 0xfe, 0x7d, 0x9e, 0x9b, 0xfd, 0x10, 0x34, - 0x8a, 0x56, 0x06, 0xe5, 0xca, 0xfa, 0x73, 0x54 -}; -static const uint8_t aes_gcm_128_tag[] = { - 0x00, 0x32, 0xa1, 0xdc, 0x85, 0xf1, 0xc9, 0x78, - 0x69, 0x25, 0xa2, 0xe7, 0x1d, 0x82, 0x72, 0xdd -}; +static const uint8_t aes_gcm_128_key[] = { 0xc9, 0x39, 0xcc, 0x13, 0x39, 0x7c, 0x1d, 0x37, + 0xde, 0x6a, 0xe0, 0xe1, 0xcb, 0x7c, 0x42, 0x3c }; +static const uint8_t aes_gcm_128_iv[] = { 0xb3, 0xd8, 0xcc, 0x01, 0x7c, 0xbb, + 0x89, 0xb3, 0x9e, 0x0f, 0x67, 0xe2 }; +static const uint8_t aes_gcm_128_plain_text[] = { 0xc3, 0xb3, 0xc4, 0x1f, 0x11, 0x3a, 0x31, 0xb7, + 0x3d, 0x9a, 0x5c, 0xd4, 0x32, 0x10, 0x30, 0x69 }; +static const uint8_t aes_gcm_128_aad[] = { 0x24, 0x82, 0x56, 0x02, 0xbd, 0x12, 0xa9, 0x84, + 0xe0, 0x09, 0x2d, 0x3e, 0x44, 0x8e, 0xda, 0x5f }; +static const uint8_t aes_gcm_128_cipher_text[] = { 0x93, 0xfe, 0x7d, 0x9e, 0x9b, 0xfd, 0x10, 0x34, + 0x8a, 0x56, 0x06, 0xe5, 0xca, 0xfa, 0x73, 0x54 }; +static const uint8_t aes_gcm_128_tag[] = { 0x00, 0x32, 0xa1, 0xdc, 0x85, 0xf1, 0xc9, 0x78, + 0x69, 0x25, 0xa2, 0xe7, 0x1d, 0x82, 0x72, 0xdd }; /* * https://tools.ietf.org/html/draft-mcgrew-gcm-test-01 case #7 */ static const uint8_t aes_gcm_192_key[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, + 0x67, 0x30, 0x83, 0x08, 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, }; -static const uint8_t aes_gcm_192_plain_text[] = { - 0x45, 0x00, 0x00, 0x28, 0xa4, 0xad, 0x40, 0x00, - 0x40, 0x06, 0x78, 0x80, 0x0a, 0x01, 0x03, 0x8f, - 0x0a, 0x01, 0x06, 0x12, 0x80, 0x23, 0x06, 0xb8, - 0xcb, 0x71, 0x26, 0x02, 0xdd, 0x6b, 0xb0, 0x3e, - 0x50, 0x10, 0x16, 0xd0, 0x75, 0x68, 0x00, 0x01, +static const uint8_t aes_gcm_192_plain_text[] = { + 0x45, 0x00, 0x00, 0x28, 0xa4, 0xad, 0x40, 0x00, 0x40, 0x06, 0x78, 0x80, 0x0a, 0x01, + 0x03, 0x8f, 0x0a, 0x01, 0x06, 0x12, 0x80, 0x23, 0x06, 0xb8, 0xcb, 0x71, 0x26, 0x02, + 0xdd, 0x6b, 0xb0, 0x3e, 0x50, 0x10, 0x16, 0xd0, 0x75, 0x68, 0x00, 0x01, }; static const uint8_t aes_gcm_192_aad[] = { 0x00, 0x00, 0xa5, 0xf8, 0x00, 0x00, 0x00, 0x0a, }; static const uint8_t aes_gcm_192_iv[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88, + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88, }; static const uint8_t aes_gcm_192_cipher_text[] = { - 0xa5, 0xb1, 0xf8, 0x06, 0x60, 0x29, 0xae, 0xa4, - 0x0e, 0x59, 0x8b, 0x81, 0x22, 0xde, 0x02, 0x42, - 0x09, 0x38, 0xb3, 0xab, 0x33, 0xf8, 0x28, 0xe6, - 0x87, 0xb8, 0x85, 0x8b, 0x5b, 0xfb, 0xdb, 0xd0, - 0x31, 0x5b, 0x27, 0x45, 0x21, 0x44, 0xcc, 0x77, + 0xa5, 0xb1, 0xf8, 0x06, 0x60, 0x29, 0xae, 0xa4, 0x0e, 0x59, 0x8b, 0x81, 0x22, 0xde, + 0x02, 0x42, 0x09, 0x38, 0xb3, 0xab, 0x33, 0xf8, 0x28, 0xe6, 0x87, 0xb8, 0x85, 0x8b, + 0x5b, 0xfb, 0xdb, 0xd0, 0x31, 0x5b, 0x27, 0x45, 0x21, 0x44, 0xcc, 0x77, }; static const uint8_t aes_gcm_192_tag[] = { 0x95, 0x45, 0x7b, 0x96, 0x52, 0x03, 0x7f, 0x53, @@ -1165,66 +958,47 @@ static const uint8_t aes_gcm_192_tag[] = { * http://csrc.nist.gov/groups/ST/toolkit/BCM/ * documents/proposedmodes/gcm/gcm-revised-spec.pdf */ -static const uint8_t aes_gcm_256_key[] = { - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, - 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, - 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 -}; -static const uint8_t aes_gcm_256_plain_text[] = { - 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, - 0xba, 0x63, 0x7b, 0x39 -}; -static const uint8_t aes_gcm_256_aad[] = { - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xab, 0xad, 0xda, 0xd2 -}; -static const uint8_t aes_gcm_256_iv[] = { - 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88 -}; +static const uint8_t aes_gcm_256_key[] = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }; +static const uint8_t aes_gcm_256_plain_text[] = { + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, + 0x9a, 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, + 0x8a, 0x72, 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, 0x2f, 0xcf, 0x0e, 0x24, 0x49, + 0xa6, 0xb5, 0x25, 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, 0xba, 0x63, 0x7b, 0x39 +}; +static const uint8_t aes_gcm_256_aad[] = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, + 0xef, 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, + 0xbe, 0xef, 0xab, 0xad, 0xda, 0xd2 }; +static const uint8_t aes_gcm_256_iv[] = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, + 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88 }; static const uint8_t aes_gcm_256_cipher_text[] = { - 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07, - 0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d, - 0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9, - 0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa, - 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, - 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38, - 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, - 0xbc, 0xc9, 0xf6, 0x62 -}; -static const uint8_t aes_gcm_256_tag[] = { - 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, - 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b -}; - -#define ADD_GCM_VECTOR(_key,_iv,_aad,_plain,_cipher,_tag) \ - {IMB_AUTH_AES_GMAC, IMB_CIPHER_GCM, _key, sizeof(_key), \ - _iv, sizeof(_iv), _aad, sizeof(_aad), \ - _plain, sizeof(_plain), _cipher, \ - _tag, sizeof(_tag)} + 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07, 0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, + 0x7d, 0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9, 0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, + 0xd1, 0xaa, 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, 0xa7, 0xb0, 0x8b, 0x10, 0x56, + 0x82, 0x88, 0x38, 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, 0xbc, 0xc9, 0xf6, 0x62 +}; +static const uint8_t aes_gcm_256_tag[] = { 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, + 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b }; + +#define ADD_GCM_VECTOR(_key, _iv, _aad, _plain, _cipher, _tag) \ + { \ + IMB_AUTH_AES_GMAC, IMB_CIPHER_GCM, _key, sizeof(_key), _iv, sizeof(_iv), _aad, \ + sizeof(_aad), _plain, sizeof(_plain), _cipher, _tag, sizeof(_tag) \ + } struct self_test_gcm_vector aead_gcm_vectors[] = { - ADD_GCM_VECTOR(aes_gcm_128_key, aes_gcm_128_iv, aes_gcm_128_aad, - aes_gcm_128_plain_text, aes_gcm_128_cipher_text, - aes_gcm_128_tag), - ADD_GCM_VECTOR(aes_gcm_192_key, aes_gcm_192_iv, aes_gcm_192_aad, - aes_gcm_192_plain_text, aes_gcm_192_cipher_text, - aes_gcm_192_tag), - ADD_GCM_VECTOR(aes_gcm_256_key, aes_gcm_256_iv, aes_gcm_256_aad, - aes_gcm_256_plain_text, aes_gcm_256_cipher_text, - aes_gcm_256_tag) + ADD_GCM_VECTOR(aes_gcm_128_key, aes_gcm_128_iv, aes_gcm_128_aad, aes_gcm_128_plain_text, + aes_gcm_128_cipher_text, aes_gcm_128_tag), + ADD_GCM_VECTOR(aes_gcm_192_key, aes_gcm_192_iv, aes_gcm_192_aad, aes_gcm_192_plain_text, + aes_gcm_192_cipher_text, aes_gcm_192_tag), + ADD_GCM_VECTOR(aes_gcm_256_key, aes_gcm_256_iv, aes_gcm_256_aad, aes_gcm_256_plain_text, + aes_gcm_256_cipher_text, aes_gcm_256_tag) }; - -static int self_test_aead_gcm(IMB_MGR *p_mgr) +static int +self_test_aead_gcm(IMB_MGR *p_mgr) { struct gcm_key_data gcm_key; struct gcm_context_data ctx; @@ -1250,16 +1024,13 @@ static int self_test_aead_gcm(IMB_MGR *p_mgr) switch (v->cipher_key_size) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_PRE(p_mgr, v->cipher_key, - &gcm_key); + IMB_AES128_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_PRE(p_mgr, v->cipher_key, - &gcm_key); + IMB_AES192_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); break; case IMB_KEY_256_BYTES: - IMB_AES256_GCM_PRE(p_mgr, v->cipher_key, - &gcm_key); + IMB_AES256_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); break; default: return 0; @@ -1346,37 +1117,25 @@ static int self_test_aead_gcm(IMB_MGR *p_mgr) switch (v->cipher_key_size) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - v->cipher_iv, - v->cipher_iv_size, - v->aad, v->aad_size); - IMB_AES128_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, - v->plain_text, + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, + v->cipher_iv_size, v->aad, v->aad_size); + IMB_AES128_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, v->plain_text_size); - IMB_AES128_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tag_size); + IMB_AES128_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - v->cipher_iv, - v->cipher_iv_size, - v->aad, v->aad_size); - IMB_AES192_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, - v->plain_text, + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, + v->cipher_iv_size, v->aad, v->aad_size); + IMB_AES192_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, v->plain_text_size); - IMB_AES192_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tag_size); + IMB_AES192_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); break; case IMB_KEY_256_BYTES: - IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - v->cipher_iv, - v->cipher_iv_size, - v->aad, v->aad_size); - IMB_AES256_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, - v->plain_text, + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, + v->cipher_iv_size, v->aad, v->aad_size); + IMB_AES256_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, v->plain_text_size); - IMB_AES256_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tag_size); + IMB_AES256_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); break; default: return 0; @@ -1394,37 +1153,25 @@ static int self_test_aead_gcm(IMB_MGR *p_mgr) memset(tag, 0, sizeof(tag)); switch (v->cipher_key_size) { case IMB_KEY_128_BYTES: - IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - v->cipher_iv, - v->cipher_iv_size, - v->aad, v->aad_size); - IMB_AES128_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, - v->cipher_text, + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, + v->cipher_iv_size, v->aad, v->aad_size); + IMB_AES128_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, v->plain_text_size); - IMB_AES128_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tag_size); + IMB_AES128_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); break; case IMB_KEY_192_BYTES: - IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - v->cipher_iv, - v->cipher_iv_size, - v->aad, v->aad_size); - IMB_AES192_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, - v->cipher_text, + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, + v->cipher_iv_size, v->aad, v->aad_size); + IMB_AES192_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, v->plain_text_size); - IMB_AES192_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tag_size); + IMB_AES192_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); break; case IMB_KEY_256_BYTES: - IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, - v->cipher_iv, - v->cipher_iv_size, - v->aad, v->aad_size); - IMB_AES256_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, - v->cipher_text, + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, + v->cipher_iv_size, v->aad, v->aad_size); + IMB_AES256_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, v->plain_text_size); - IMB_AES256_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, - v->tag_size); + IMB_AES256_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); break; default: return 0; @@ -1437,7 +1184,7 @@ static int self_test_aead_gcm(IMB_MGR *p_mgr) if (memcmp(text, v->plain_text, v->plain_text_size)) return 0; - } /* for(gcm_vectors) */ + } /* for(gcm_vectors) */ return 1; } @@ -1445,93 +1192,71 @@ static int self_test_aead_gcm(IMB_MGR *p_mgr) struct self_test_aead_ccm_vector { IMB_HASH_ALG hash_mode; IMB_CIPHER_MODE cipher_mode; - const uint8_t *cipher_key; + const uint8_t *cipher_key; size_t cipher_key_size; - const uint8_t *cipher_nonce; + const uint8_t *cipher_nonce; size_t cipher_nonce_size; - const uint8_t *aad; + const uint8_t *aad; size_t aad_size; - const uint8_t *plain_text; + const uint8_t *plain_text; size_t plain_text_size; - const uint8_t *cipher_text; - const uint8_t *tag; + const uint8_t *cipher_text; + const uint8_t *tag; size_t tag_size; }; /* * Test vectors from https://tools.ietf.org/html/rfc3610 */ -static const uint8_t aes_ccm_128_key[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t aes_ccm_128_nonce[] = { - 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t aes_ccm_128_plain_text[] = { - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; -static const uint8_t aes_ccm_128_aad[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 -}; +static const uint8_t aes_ccm_128_key[] = { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF }; +static const uint8_t aes_ccm_128_nonce[] = { 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 }; +static const uint8_t aes_ccm_128_plain_text[] = { 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E }; +static const uint8_t aes_ccm_128_aad[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; static const uint8_t aes_ccm_128_cipher_text[] = { - 0x58, 0x8C, 0x97, 0x9A, 0x61, 0xC6, 0x63, 0xD2, - 0xF0, 0x66, 0xD0, 0xC2, 0xC0, 0xF9, 0x89, 0x80, - 0x6D, 0x5F, 0x6B, 0x61, 0xDA, 0xC3, 0x84, -}; -static const uint8_t aes_ccm_128_tag[] = { - 0x17, 0xE8, 0xD1, 0x2C, 0xFD, 0xF9, 0x26, 0xE0 -}; - -static const uint8_t aes_ccm_256_key[] = { - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF -}; -static const uint8_t aes_ccm_256_nonce[] = { - 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xA0, - 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 -}; -static const uint8_t aes_ccm_256_plain_text[] = { - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E -}; + 0x58, 0x8C, 0x97, 0x9A, 0x61, 0xC6, 0x63, 0xD2, 0xF0, 0x66, 0xD0, 0xC2, + 0xC0, 0xF9, 0x89, 0x80, 0x6D, 0x5F, 0x6B, 0x61, 0xDA, 0xC3, 0x84, +}; +static const uint8_t aes_ccm_128_tag[] = { 0x17, 0xE8, 0xD1, 0x2C, 0xFD, 0xF9, 0x26, 0xE0 }; + +static const uint8_t aes_ccm_256_key[] = { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF }; +static const uint8_t aes_ccm_256_nonce[] = { 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 }; +static const uint8_t aes_ccm_256_plain_text[] = { 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E }; static const uint8_t aes_ccm_256_aad[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, }; -static const uint8_t aes_ccm_256_cipher_text[] = { - 0x21, 0x61, 0x63, 0xDE, 0xCF, 0x74, 0xE0, 0x0C, - 0xAB, 0x04, 0x56, 0xFF, 0x45, 0xCD, 0xA7, 0x17, - 0x1F, 0xA5, 0x96, 0xD7, 0x0F, 0x76, 0x91 -}; -static const uint8_t aes_ccm_256_tag[] = { - 0xCA, 0x8A, 0xFA, 0xA2, 0x3F, 0x22, 0x3E, 0x64 -}; +static const uint8_t aes_ccm_256_cipher_text[] = { 0x21, 0x61, 0x63, 0xDE, 0xCF, 0x74, 0xE0, 0x0C, + 0xAB, 0x04, 0x56, 0xFF, 0x45, 0xCD, 0xA7, 0x17, + 0x1F, 0xA5, 0x96, 0xD7, 0x0F, 0x76, 0x91 }; +static const uint8_t aes_ccm_256_tag[] = { 0xCA, 0x8A, 0xFA, 0xA2, 0x3F, 0x22, 0x3E, 0x64 }; -#define ADD_CCM_VECTOR(_key,_nonce,_aad,_plain,_cipher,_tag) \ - {IMB_AUTH_AES_CCM, IMB_CIPHER_CCM, _key, sizeof(_key), \ - _nonce, sizeof(_nonce), _aad, sizeof(_aad), \ - _plain, sizeof(_plain), _cipher, \ - _tag, sizeof(_tag)} +#define ADD_CCM_VECTOR(_key, _nonce, _aad, _plain, _cipher, _tag) \ + { \ + IMB_AUTH_AES_CCM, IMB_CIPHER_CCM, _key, sizeof(_key), _nonce, sizeof(_nonce), \ + _aad, sizeof(_aad), _plain, sizeof(_plain), _cipher, _tag, sizeof(_tag) \ + } struct self_test_aead_ccm_vector aead_ccm_vectors[] = { - ADD_CCM_VECTOR(aes_ccm_128_key, aes_ccm_128_nonce, aes_ccm_128_aad, - aes_ccm_128_plain_text, aes_ccm_128_cipher_text, - aes_ccm_128_tag), - ADD_CCM_VECTOR(aes_ccm_256_key, aes_ccm_256_nonce, aes_ccm_256_aad, - aes_ccm_256_plain_text, aes_ccm_256_cipher_text, - aes_ccm_256_tag) + ADD_CCM_VECTOR(aes_ccm_128_key, aes_ccm_128_nonce, aes_ccm_128_aad, aes_ccm_128_plain_text, + aes_ccm_128_cipher_text, aes_ccm_128_tag), + ADD_CCM_VECTOR(aes_ccm_256_key, aes_ccm_256_nonce, aes_ccm_256_aad, aes_ccm_256_plain_text, + aes_ccm_256_cipher_text, aes_ccm_256_tag) }; -static int self_test_aead_ccm(IMB_MGR *p_mgr) +static int +self_test_aead_ccm(IMB_MGR *p_mgr) { - DECLARE_ALIGNED(uint32_t expkey[4*15], 16); - DECLARE_ALIGNED(uint32_t dust[4*15], 16); + DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); + DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint8_t text[128], tag[16]; unsigned i; @@ -1554,12 +1279,10 @@ static int self_test_aead_ccm(IMB_MGR *p_mgr) switch (v->cipher_key_size) { case IMB_KEY_128_BYTES: - IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, expkey, - dust); + IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, expkey, dust); break; case IMB_KEY_256_BYTES: - IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, expkey, - dust); + IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, expkey, dust); break; default: return 0; @@ -1640,12 +1363,13 @@ static int self_test_aead_ccm(IMB_MGR *p_mgr) /* check for text mismatch */ if (memcmp(text, v->plain_text, v->plain_text_size)) return 0; - } /* for(ccm_vectors) */ + } /* for(ccm_vectors) */ return 1; } -static int self_test_aead(IMB_MGR *p_mgr) +static int +self_test_aead(IMB_MGR *p_mgr) { if (!self_test_aead_gcm(p_mgr)) return 0; @@ -1662,13 +1386,13 @@ static int self_test_aead(IMB_MGR *p_mgr) * ============================================================================= */ -IMB_DLL_LOCAL int self_test(IMB_MGR *p_mgr) +IMB_DLL_LOCAL int +self_test(IMB_MGR *p_mgr) { int ret = 1; #ifdef NO_SELF_TEST_DEV - p_mgr->features &= ~(IMB_FEATURE_SELF_TEST | - IMB_FEATURE_SELF_TEST_PASS); + p_mgr->features &= ~(IMB_FEATURE_SELF_TEST | IMB_FEATURE_SELF_TEST_PASS); #else p_mgr->features |= IMB_FEATURE_SELF_TEST; p_mgr->features &= ~IMB_FEATURE_SELF_TEST_PASS; diff --git a/lib/x86_64/snow3g_iv.c b/lib/x86_64/snow3g_iv.c index 6bf51466..95775aad 100644 --- a/lib/x86_64/snow3g_iv.c +++ b/lib/x86_64/snow3g_iv.c @@ -31,8 +31,7 @@ #include "include/wireless_common.h" int -snow3g_f8_iv_gen(const uint32_t count, const uint8_t bearer, - const uint8_t dir, void *iv_ptr) +snow3g_f8_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr) { uint32_t *iv32 = (uint32_t *) iv_ptr; @@ -40,7 +39,7 @@ snow3g_f8_iv_gen(const uint32_t count, const uint8_t bearer, return -1; /* Bearer must contain 5 bits only */ - if (bearer >= (1<<5)) + if (bearer >= (1 << 5)) return -1; /* Direction must contain 1 bit only */ @@ -66,8 +65,7 @@ snow3g_f8_iv_gen(const uint32_t count, const uint8_t bearer, } int -snow3g_f9_iv_gen(const uint32_t count, const uint32_t fresh, - const uint8_t dir, void *iv_ptr) +snow3g_f9_iv_gen(const uint32_t count, const uint32_t fresh, const uint8_t dir, void *iv_ptr) { uint32_t *iv32 = (uint32_t *) iv_ptr; diff --git a/lib/x86_64/snow3g_tables.c b/lib/x86_64/snow3g_tables.c index c8888e57..4e17947d 100644 --- a/lib/x86_64/snow3g_tables.c +++ b/lib/x86_64/snow3g_tables.c @@ -36,358 +36,251 @@ IMB_DLL_LOCAL DECLARE_ALIGNED(const int snow3g_table_A_mul[256], 32) = { - 0x00000000, 0xe19fcf13, 0x6b973726, 0x8a08f835, 0xd6876e4c, 0x3718a15f, - 0xbd10596a, 0x5c8f9679, 0x05a7dc98, 0xe438138b, 0x6e30ebbe, 0x8faf24ad, - 0xd320b2d4, 0x32bf7dc7, 0xb8b785f2, 0x59284ae1, 0x0ae71199, 0xeb78de8a, - 0x617026bf, 0x80efe9ac, 0xdc607fd5, 0x3dffb0c6, 0xb7f748f3, 0x566887e0, - 0x0f40cd01, 0xeedf0212, 0x64d7fa27, 0x85483534, 0xd9c7a34d, 0x38586c5e, - 0xb250946b, 0x53cf5b78, 0x1467229b, 0xf5f8ed88, 0x7ff015bd, 0x9e6fdaae, - 0xc2e04cd7, 0x237f83c4, 0xa9777bf1, 0x48e8b4e2, 0x11c0fe03, 0xf05f3110, - 0x7a57c925, 0x9bc80636, 0xc747904f, 0x26d85f5c, 0xacd0a769, 0x4d4f687a, - 0x1e803302, 0xff1ffc11, 0x75170424, 0x9488cb37, 0xc8075d4e, 0x2998925d, - 0xa3906a68, 0x420fa57b, 0x1b27ef9a, 0xfab82089, 0x70b0d8bc, 0x912f17af, - 0xcda081d6, 0x2c3f4ec5, 0xa637b6f0, 0x47a879e3, 0x28ce449f, 0xc9518b8c, - 0x435973b9, 0xa2c6bcaa, 0xfe492ad3, 0x1fd6e5c0, 0x95de1df5, 0x7441d2e6, - 0x2d699807, 0xccf65714, 0x46feaf21, 0xa7616032, 0xfbeef64b, 0x1a713958, - 0x9079c16d, 0x71e60e7e, 0x22295506, 0xc3b69a15, 0x49be6220, 0xa821ad33, - 0xf4ae3b4a, 0x1531f459, 0x9f390c6c, 0x7ea6c37f, 0x278e899e, 0xc611468d, - 0x4c19beb8, 0xad8671ab, 0xf109e7d2, 0x109628c1, 0x9a9ed0f4, 0x7b011fe7, - 0x3ca96604, 0xdd36a917, 0x573e5122, 0xb6a19e31, 0xea2e0848, 0x0bb1c75b, - 0x81b93f6e, 0x6026f07d, 0x390eba9c, 0xd891758f, 0x52998dba, 0xb30642a9, - 0xef89d4d0, 0x0e161bc3, 0x841ee3f6, 0x65812ce5, 0x364e779d, 0xd7d1b88e, - 0x5dd940bb, 0xbc468fa8, 0xe0c919d1, 0x0156d6c2, 0x8b5e2ef7, 0x6ac1e1e4, - 0x33e9ab05, 0xd2766416, 0x587e9c23, 0xb9e15330, 0xe56ec549, 0x04f10a5a, - 0x8ef9f26f, 0x6f663d7c, 0x50358897, 0xb1aa4784, 0x3ba2bfb1, 0xda3d70a2, - 0x86b2e6db, 0x672d29c8, 0xed25d1fd, 0x0cba1eee, 0x5592540f, 0xb40d9b1c, - 0x3e056329, 0xdf9aac3a, 0x83153a43, 0x628af550, 0xe8820d65, 0x091dc276, - 0x5ad2990e, 0xbb4d561d, 0x3145ae28, 0xd0da613b, 0x8c55f742, 0x6dca3851, - 0xe7c2c064, 0x065d0f77, 0x5f754596, 0xbeea8a85, 0x34e272b0, 0xd57dbda3, - 0x89f22bda, 0x686de4c9, 0xe2651cfc, 0x03fad3ef, 0x4452aa0c, 0xa5cd651f, - 0x2fc59d2a, 0xce5a5239, 0x92d5c440, 0x734a0b53, 0xf942f366, 0x18dd3c75, - 0x41f57694, 0xa06ab987, 0x2a6241b2, 0xcbfd8ea1, 0x977218d8, 0x76edd7cb, - 0xfce52ffe, 0x1d7ae0ed, 0x4eb5bb95, 0xaf2a7486, 0x25228cb3, 0xc4bd43a0, - 0x9832d5d9, 0x79ad1aca, 0xf3a5e2ff, 0x123a2dec, 0x4b12670d, 0xaa8da81e, - 0x2085502b, 0xc11a9f38, 0x9d950941, 0x7c0ac652, 0xf6023e67, 0x179df174, - 0x78fbcc08, 0x9964031b, 0x136cfb2e, 0xf2f3343d, 0xae7ca244, 0x4fe36d57, - 0xc5eb9562, 0x24745a71, 0x7d5c1090, 0x9cc3df83, 0x16cb27b6, 0xf754e8a5, - 0xabdb7edc, 0x4a44b1cf, 0xc04c49fa, 0x21d386e9, 0x721cdd91, 0x93831282, - 0x198beab7, 0xf81425a4, 0xa49bb3dd, 0x45047cce, 0xcf0c84fb, 0x2e934be8, - 0x77bb0109, 0x9624ce1a, 0x1c2c362f, 0xfdb3f93c, 0xa13c6f45, 0x40a3a056, - 0xcaab5863, 0x2b349770, 0x6c9cee93, 0x8d032180, 0x070bd9b5, 0xe69416a6, - 0xba1b80df, 0x5b844fcc, 0xd18cb7f9, 0x301378ea, 0x693b320b, 0x88a4fd18, - 0x02ac052d, 0xe333ca3e, 0xbfbc5c47, 0x5e239354, 0xd42b6b61, 0x35b4a472, - 0x667bff0a, 0x87e43019, 0x0decc82c, 0xec73073f, 0xb0fc9146, 0x51635e55, - 0xdb6ba660, 0x3af46973, 0x63dc2392, 0x8243ec81, 0x084b14b4, 0xe9d4dba7, + 0x00000000, 0xe19fcf13, 0x6b973726, 0x8a08f835, 0xd6876e4c, 0x3718a15f, 0xbd10596a, + 0x5c8f9679, 0x05a7dc98, 0xe438138b, 0x6e30ebbe, 0x8faf24ad, 0xd320b2d4, 0x32bf7dc7, + 0xb8b785f2, 0x59284ae1, 0x0ae71199, 0xeb78de8a, 0x617026bf, 0x80efe9ac, 0xdc607fd5, + 0x3dffb0c6, 0xb7f748f3, 0x566887e0, 0x0f40cd01, 0xeedf0212, 0x64d7fa27, 0x85483534, + 0xd9c7a34d, 0x38586c5e, 0xb250946b, 0x53cf5b78, 0x1467229b, 0xf5f8ed88, 0x7ff015bd, + 0x9e6fdaae, 0xc2e04cd7, 0x237f83c4, 0xa9777bf1, 0x48e8b4e2, 0x11c0fe03, 0xf05f3110, + 0x7a57c925, 0x9bc80636, 0xc747904f, 0x26d85f5c, 0xacd0a769, 0x4d4f687a, 0x1e803302, + 0xff1ffc11, 0x75170424, 0x9488cb37, 0xc8075d4e, 0x2998925d, 0xa3906a68, 0x420fa57b, + 0x1b27ef9a, 0xfab82089, 0x70b0d8bc, 0x912f17af, 0xcda081d6, 0x2c3f4ec5, 0xa637b6f0, + 0x47a879e3, 0x28ce449f, 0xc9518b8c, 0x435973b9, 0xa2c6bcaa, 0xfe492ad3, 0x1fd6e5c0, + 0x95de1df5, 0x7441d2e6, 0x2d699807, 0xccf65714, 0x46feaf21, 0xa7616032, 0xfbeef64b, + 0x1a713958, 0x9079c16d, 0x71e60e7e, 0x22295506, 0xc3b69a15, 0x49be6220, 0xa821ad33, + 0xf4ae3b4a, 0x1531f459, 0x9f390c6c, 0x7ea6c37f, 0x278e899e, 0xc611468d, 0x4c19beb8, + 0xad8671ab, 0xf109e7d2, 0x109628c1, 0x9a9ed0f4, 0x7b011fe7, 0x3ca96604, 0xdd36a917, + 0x573e5122, 0xb6a19e31, 0xea2e0848, 0x0bb1c75b, 0x81b93f6e, 0x6026f07d, 0x390eba9c, + 0xd891758f, 0x52998dba, 0xb30642a9, 0xef89d4d0, 0x0e161bc3, 0x841ee3f6, 0x65812ce5, + 0x364e779d, 0xd7d1b88e, 0x5dd940bb, 0xbc468fa8, 0xe0c919d1, 0x0156d6c2, 0x8b5e2ef7, + 0x6ac1e1e4, 0x33e9ab05, 0xd2766416, 0x587e9c23, 0xb9e15330, 0xe56ec549, 0x04f10a5a, + 0x8ef9f26f, 0x6f663d7c, 0x50358897, 0xb1aa4784, 0x3ba2bfb1, 0xda3d70a2, 0x86b2e6db, + 0x672d29c8, 0xed25d1fd, 0x0cba1eee, 0x5592540f, 0xb40d9b1c, 0x3e056329, 0xdf9aac3a, + 0x83153a43, 0x628af550, 0xe8820d65, 0x091dc276, 0x5ad2990e, 0xbb4d561d, 0x3145ae28, + 0xd0da613b, 0x8c55f742, 0x6dca3851, 0xe7c2c064, 0x065d0f77, 0x5f754596, 0xbeea8a85, + 0x34e272b0, 0xd57dbda3, 0x89f22bda, 0x686de4c9, 0xe2651cfc, 0x03fad3ef, 0x4452aa0c, + 0xa5cd651f, 0x2fc59d2a, 0xce5a5239, 0x92d5c440, 0x734a0b53, 0xf942f366, 0x18dd3c75, + 0x41f57694, 0xa06ab987, 0x2a6241b2, 0xcbfd8ea1, 0x977218d8, 0x76edd7cb, 0xfce52ffe, + 0x1d7ae0ed, 0x4eb5bb95, 0xaf2a7486, 0x25228cb3, 0xc4bd43a0, 0x9832d5d9, 0x79ad1aca, + 0xf3a5e2ff, 0x123a2dec, 0x4b12670d, 0xaa8da81e, 0x2085502b, 0xc11a9f38, 0x9d950941, + 0x7c0ac652, 0xf6023e67, 0x179df174, 0x78fbcc08, 0x9964031b, 0x136cfb2e, 0xf2f3343d, + 0xae7ca244, 0x4fe36d57, 0xc5eb9562, 0x24745a71, 0x7d5c1090, 0x9cc3df83, 0x16cb27b6, + 0xf754e8a5, 0xabdb7edc, 0x4a44b1cf, 0xc04c49fa, 0x21d386e9, 0x721cdd91, 0x93831282, + 0x198beab7, 0xf81425a4, 0xa49bb3dd, 0x45047cce, 0xcf0c84fb, 0x2e934be8, 0x77bb0109, + 0x9624ce1a, 0x1c2c362f, 0xfdb3f93c, 0xa13c6f45, 0x40a3a056, 0xcaab5863, 0x2b349770, + 0x6c9cee93, 0x8d032180, 0x070bd9b5, 0xe69416a6, 0xba1b80df, 0x5b844fcc, 0xd18cb7f9, + 0x301378ea, 0x693b320b, 0x88a4fd18, 0x02ac052d, 0xe333ca3e, 0xbfbc5c47, 0x5e239354, + 0xd42b6b61, 0x35b4a472, 0x667bff0a, 0x87e43019, 0x0decc82c, 0xec73073f, 0xb0fc9146, + 0x51635e55, 0xdb6ba660, 0x3af46973, 0x63dc2392, 0x8243ec81, 0x084b14b4, 0xe9d4dba7, 0xb55b4dde, 0x54c482cd, 0xdecc7af8, 0x3f53b5eb }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const int snow3g_table_A_div[256],32) = { - 0x00000000, 0x180f40cd, 0x301e8033, 0x2811c0fe, 0x603ca966, 0x7833e9ab, - 0x50222955, 0x482d6998, 0xc078fbcc, 0xd877bb01, 0xf0667bff, 0xe8693b32, - 0xa04452aa, 0xb84b1267, 0x905ad299, 0x88559254, 0x29f05f31, 0x31ff1ffc, - 0x19eedf02, 0x01e19fcf, 0x49ccf657, 0x51c3b69a, 0x79d27664, 0x61dd36a9, - 0xe988a4fd, 0xf187e430, 0xd99624ce, 0xc1996403, 0x89b40d9b, 0x91bb4d56, - 0xb9aa8da8, 0xa1a5cd65, 0x5249be62, 0x4a46feaf, 0x62573e51, 0x7a587e9c, - 0x32751704, 0x2a7a57c9, 0x026b9737, 0x1a64d7fa, 0x923145ae, 0x8a3e0563, - 0xa22fc59d, 0xba208550, 0xf20decc8, 0xea02ac05, 0xc2136cfb, 0xda1c2c36, - 0x7bb9e153, 0x63b6a19e, 0x4ba76160, 0x53a821ad, 0x1b854835, 0x038a08f8, - 0x2b9bc806, 0x339488cb, 0xbbc11a9f, 0xa3ce5a52, 0x8bdf9aac, 0x93d0da61, - 0xdbfdb3f9, 0xc3f2f334, 0xebe333ca, 0xf3ec7307, 0xa492d5c4, 0xbc9d9509, - 0x948c55f7, 0x8c83153a, 0xc4ae7ca2, 0xdca13c6f, 0xf4b0fc91, 0xecbfbc5c, - 0x64ea2e08, 0x7ce56ec5, 0x54f4ae3b, 0x4cfbeef6, 0x04d6876e, 0x1cd9c7a3, - 0x34c8075d, 0x2cc74790, 0x8d628af5, 0x956dca38, 0xbd7c0ac6, 0xa5734a0b, - 0xed5e2393, 0xf551635e, 0xdd40a3a0, 0xc54fe36d, 0x4d1a7139, 0x551531f4, - 0x7d04f10a, 0x650bb1c7, 0x2d26d85f, 0x35299892, 0x1d38586c, 0x053718a1, - 0xf6db6ba6, 0xeed42b6b, 0xc6c5eb95, 0xdecaab58, 0x96e7c2c0, 0x8ee8820d, - 0xa6f942f3, 0xbef6023e, 0x36a3906a, 0x2eacd0a7, 0x06bd1059, 0x1eb25094, - 0x569f390c, 0x4e9079c1, 0x6681b93f, 0x7e8ef9f2, 0xdf2b3497, 0xc724745a, - 0xef35b4a4, 0xf73af469, 0xbf179df1, 0xa718dd3c, 0x8f091dc2, 0x97065d0f, - 0x1f53cf5b, 0x075c8f96, 0x2f4d4f68, 0x37420fa5, 0x7f6f663d, 0x676026f0, - 0x4f71e60e, 0x577ea6c3, 0xe18d0321, 0xf98243ec, 0xd1938312, 0xc99cc3df, - 0x81b1aa47, 0x99beea8a, 0xb1af2a74, 0xa9a06ab9, 0x21f5f8ed, 0x39fab820, - 0x11eb78de, 0x09e43813, 0x41c9518b, 0x59c61146, 0x71d7d1b8, 0x69d89175, - 0xc87d5c10, 0xd0721cdd, 0xf863dc23, 0xe06c9cee, 0xa841f576, 0xb04eb5bb, - 0x985f7545, 0x80503588, 0x0805a7dc, 0x100ae711, 0x381b27ef, 0x20146722, - 0x68390eba, 0x70364e77, 0x58278e89, 0x4028ce44, 0xb3c4bd43, 0xabcbfd8e, - 0x83da3d70, 0x9bd57dbd, 0xd3f81425, 0xcbf754e8, 0xe3e69416, 0xfbe9d4db, - 0x73bc468f, 0x6bb30642, 0x43a2c6bc, 0x5bad8671, 0x1380efe9, 0x0b8faf24, - 0x239e6fda, 0x3b912f17, 0x9a34e272, 0x823ba2bf, 0xaa2a6241, 0xb225228c, - 0xfa084b14, 0xe2070bd9, 0xca16cb27, 0xd2198bea, 0x5a4c19be, 0x42435973, - 0x6a52998d, 0x725dd940, 0x3a70b0d8, 0x227ff015, 0x0a6e30eb, 0x12617026, - 0x451fd6e5, 0x5d109628, 0x750156d6, 0x6d0e161b, 0x25237f83, 0x3d2c3f4e, - 0x153dffb0, 0x0d32bf7d, 0x85672d29, 0x9d686de4, 0xb579ad1a, 0xad76edd7, - 0xe55b844f, 0xfd54c482, 0xd545047c, 0xcd4a44b1, 0x6cef89d4, 0x74e0c919, - 0x5cf109e7, 0x44fe492a, 0x0cd320b2, 0x14dc607f, 0x3ccda081, 0x24c2e04c, - 0xac977218, 0xb49832d5, 0x9c89f22b, 0x8486b2e6, 0xccabdb7e, 0xd4a49bb3, - 0xfcb55b4d, 0xe4ba1b80, 0x17566887, 0x0f59284a, 0x2748e8b4, 0x3f47a879, - 0x776ac1e1, 0x6f65812c, 0x477441d2, 0x5f7b011f, 0xd72e934b, 0xcf21d386, - 0xe7301378, 0xff3f53b5, 0xb7123a2d, 0xaf1d7ae0, 0x870cba1e, 0x9f03fad3, - 0x3ea637b6, 0x26a9777b, 0x0eb8b785, 0x16b7f748, 0x5e9a9ed0, 0x4695de1d, - 0x6e841ee3, 0x768b5e2e, 0xfedecc7a, 0xe6d18cb7, 0xcec04c49, 0xd6cf0c84, +DECLARE_ALIGNED(const int snow3g_table_A_div[256], 32) = { + 0x00000000, 0x180f40cd, 0x301e8033, 0x2811c0fe, 0x603ca966, 0x7833e9ab, 0x50222955, + 0x482d6998, 0xc078fbcc, 0xd877bb01, 0xf0667bff, 0xe8693b32, 0xa04452aa, 0xb84b1267, + 0x905ad299, 0x88559254, 0x29f05f31, 0x31ff1ffc, 0x19eedf02, 0x01e19fcf, 0x49ccf657, + 0x51c3b69a, 0x79d27664, 0x61dd36a9, 0xe988a4fd, 0xf187e430, 0xd99624ce, 0xc1996403, + 0x89b40d9b, 0x91bb4d56, 0xb9aa8da8, 0xa1a5cd65, 0x5249be62, 0x4a46feaf, 0x62573e51, + 0x7a587e9c, 0x32751704, 0x2a7a57c9, 0x026b9737, 0x1a64d7fa, 0x923145ae, 0x8a3e0563, + 0xa22fc59d, 0xba208550, 0xf20decc8, 0xea02ac05, 0xc2136cfb, 0xda1c2c36, 0x7bb9e153, + 0x63b6a19e, 0x4ba76160, 0x53a821ad, 0x1b854835, 0x038a08f8, 0x2b9bc806, 0x339488cb, + 0xbbc11a9f, 0xa3ce5a52, 0x8bdf9aac, 0x93d0da61, 0xdbfdb3f9, 0xc3f2f334, 0xebe333ca, + 0xf3ec7307, 0xa492d5c4, 0xbc9d9509, 0x948c55f7, 0x8c83153a, 0xc4ae7ca2, 0xdca13c6f, + 0xf4b0fc91, 0xecbfbc5c, 0x64ea2e08, 0x7ce56ec5, 0x54f4ae3b, 0x4cfbeef6, 0x04d6876e, + 0x1cd9c7a3, 0x34c8075d, 0x2cc74790, 0x8d628af5, 0x956dca38, 0xbd7c0ac6, 0xa5734a0b, + 0xed5e2393, 0xf551635e, 0xdd40a3a0, 0xc54fe36d, 0x4d1a7139, 0x551531f4, 0x7d04f10a, + 0x650bb1c7, 0x2d26d85f, 0x35299892, 0x1d38586c, 0x053718a1, 0xf6db6ba6, 0xeed42b6b, + 0xc6c5eb95, 0xdecaab58, 0x96e7c2c0, 0x8ee8820d, 0xa6f942f3, 0xbef6023e, 0x36a3906a, + 0x2eacd0a7, 0x06bd1059, 0x1eb25094, 0x569f390c, 0x4e9079c1, 0x6681b93f, 0x7e8ef9f2, + 0xdf2b3497, 0xc724745a, 0xef35b4a4, 0xf73af469, 0xbf179df1, 0xa718dd3c, 0x8f091dc2, + 0x97065d0f, 0x1f53cf5b, 0x075c8f96, 0x2f4d4f68, 0x37420fa5, 0x7f6f663d, 0x676026f0, + 0x4f71e60e, 0x577ea6c3, 0xe18d0321, 0xf98243ec, 0xd1938312, 0xc99cc3df, 0x81b1aa47, + 0x99beea8a, 0xb1af2a74, 0xa9a06ab9, 0x21f5f8ed, 0x39fab820, 0x11eb78de, 0x09e43813, + 0x41c9518b, 0x59c61146, 0x71d7d1b8, 0x69d89175, 0xc87d5c10, 0xd0721cdd, 0xf863dc23, + 0xe06c9cee, 0xa841f576, 0xb04eb5bb, 0x985f7545, 0x80503588, 0x0805a7dc, 0x100ae711, + 0x381b27ef, 0x20146722, 0x68390eba, 0x70364e77, 0x58278e89, 0x4028ce44, 0xb3c4bd43, + 0xabcbfd8e, 0x83da3d70, 0x9bd57dbd, 0xd3f81425, 0xcbf754e8, 0xe3e69416, 0xfbe9d4db, + 0x73bc468f, 0x6bb30642, 0x43a2c6bc, 0x5bad8671, 0x1380efe9, 0x0b8faf24, 0x239e6fda, + 0x3b912f17, 0x9a34e272, 0x823ba2bf, 0xaa2a6241, 0xb225228c, 0xfa084b14, 0xe2070bd9, + 0xca16cb27, 0xd2198bea, 0x5a4c19be, 0x42435973, 0x6a52998d, 0x725dd940, 0x3a70b0d8, + 0x227ff015, 0x0a6e30eb, 0x12617026, 0x451fd6e5, 0x5d109628, 0x750156d6, 0x6d0e161b, + 0x25237f83, 0x3d2c3f4e, 0x153dffb0, 0x0d32bf7d, 0x85672d29, 0x9d686de4, 0xb579ad1a, + 0xad76edd7, 0xe55b844f, 0xfd54c482, 0xd545047c, 0xcd4a44b1, 0x6cef89d4, 0x74e0c919, + 0x5cf109e7, 0x44fe492a, 0x0cd320b2, 0x14dc607f, 0x3ccda081, 0x24c2e04c, 0xac977218, + 0xb49832d5, 0x9c89f22b, 0x8486b2e6, 0xccabdb7e, 0xd4a49bb3, 0xfcb55b4d, 0xe4ba1b80, + 0x17566887, 0x0f59284a, 0x2748e8b4, 0x3f47a879, 0x776ac1e1, 0x6f65812c, 0x477441d2, + 0x5f7b011f, 0xd72e934b, 0xcf21d386, 0xe7301378, 0xff3f53b5, 0xb7123a2d, 0xaf1d7ae0, + 0x870cba1e, 0x9f03fad3, 0x3ea637b6, 0x26a9777b, 0x0eb8b785, 0x16b7f748, 0x5e9a9ed0, + 0x4695de1d, 0x6e841ee3, 0x768b5e2e, 0xfedecc7a, 0xe6d18cb7, 0xcec04c49, 0xd6cf0c84, 0x9ee2651c, 0x86ed25d1, 0xaefce52f, 0xb6f3a5e2 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte0_low[16], 16) = { - 0x00, 0x13, 0x26, 0x35, 0x4C, 0x5F, 0x6A, 0x79, - 0x98, 0x8B, 0xBE, 0xAD, 0xD4, 0xC7, 0xF2, 0xE1 -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte0_low[16], 16) = { 0x00, 0x13, 0x26, 0x35, 0x4C, 0x5F, + 0x6A, 0x79, 0x98, 0x8B, 0xBE, 0xAD, + 0xD4, 0xC7, 0xF2, 0xE1 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte1_low[16], 16) = { - 0x00, 0xCF, 0x37, 0xF8, 0x6E, 0xA1, 0x59, 0x96, - 0xDC, 0x13, 0xEB, 0x24, 0xB2, 0x7D, 0x85, 0x4A -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte1_low[16], 16) = { 0x00, 0xCF, 0x37, 0xF8, 0x6E, 0xA1, + 0x59, 0x96, 0xDC, 0x13, 0xEB, 0x24, + 0xB2, 0x7D, 0x85, 0x4A }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte2_low[16], 16) = { - 0x00, 0x9F, 0x97, 0x08, 0x87, 0x18, 0x10, 0x8F, - 0xA7, 0x38, 0x30, 0xAF, 0x20, 0xBF, 0xB7, 0x28 -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte2_low[16], 16) = { 0x00, 0x9F, 0x97, 0x08, 0x87, 0x18, + 0x10, 0x8F, 0xA7, 0x38, 0x30, 0xAF, + 0x20, 0xBF, 0xB7, 0x28 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte3_low[16], 16) = { - 0x00, 0xE1, 0x6B, 0x8A, 0xD6, 0x37, 0xBD, 0x5C, - 0x05, 0xE4, 0x6E, 0x8F, 0xD3, 0x32, 0xB8, 0x59 -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte3_low[16], 16) = { 0x00, 0xE1, 0x6B, 0x8A, 0xD6, 0x37, + 0xBD, 0x5C, 0x05, 0xE4, 0x6E, 0x8F, + 0xD3, 0x32, 0xB8, 0x59 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte0_hi[16], 16) = { - 0x00, 0x99, 0x9B, 0x02, 0x9F, 0x06, 0x04, 0x9D, - 0x97, 0x0E, 0x0C, 0x95, 0x08, 0x91, 0x93, 0x0A -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte0_hi[16], 16) = { 0x00, 0x99, 0x9B, 0x02, 0x9F, 0x06, + 0x04, 0x9D, 0x97, 0x0E, 0x0C, 0x95, + 0x08, 0x91, 0x93, 0x0A }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte1_hi[16], 16) = { - 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte1_hi[16], 16) = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, + 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xCC, 0xDD, 0xEE, 0xFF }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte2_hi[16], 16) = { - 0x00, 0xE7, 0x67, 0x80, 0xCE, 0x29, 0xA9, 0x4E, - 0x35, 0xD2, 0x52, 0xB5, 0xFB, 0x1C, 0x9C, 0x7B -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte2_hi[16], 16) = { 0x00, 0xE7, 0x67, 0x80, 0xCE, 0x29, + 0xA9, 0x4E, 0x35, 0xD2, 0x52, 0xB5, + 0xFB, 0x1C, 0x9C, 0x7B }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte3_hi[16], 16) = { - 0x00, 0x0A, 0x14, 0x1E, 0x28, 0x22, 0x3C, 0x36, - 0x50, 0x5A, 0x44, 0x4E, 0x78, 0x72, 0x6C, 0x66 -}; +DECLARE_ALIGNED(const uint8_t snow3g_MULa_byte3_hi[16], 16) = { 0x00, 0x0A, 0x14, 0x1E, 0x28, 0x22, + 0x3C, 0x36, 0x50, 0x5A, 0x44, 0x4E, + 0x78, 0x72, 0x6C, 0x66 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte0_low[16], 16) = { - 0x00, 0xCD, 0x33, 0xFE, 0x66, 0xAB, 0x55, 0x98, - 0xCC, 0x01, 0xFF, 0x32, 0xAA, 0x67, 0x99, 0x54 -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte0_low[16], 16) = { 0x00, 0xCD, 0x33, 0xFE, 0x66, 0xAB, + 0x55, 0x98, 0xCC, 0x01, 0xFF, 0x32, + 0xAA, 0x67, 0x99, 0x54 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte1_low[16], 16) = { - 0x00, 0x40, 0x80, 0xC0, 0xA9, 0xE9, 0x29, 0x69, - 0xFB, 0xBB, 0x7B, 0x3B, 0x52, 0x12, 0xD2, 0x92 -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte1_low[16], 16) = { 0x00, 0x40, 0x80, 0xC0, 0xA9, 0xE9, + 0x29, 0x69, 0xFB, 0xBB, 0x7B, 0x3B, + 0x52, 0x12, 0xD2, 0x92 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte2_low[16], 16) = { - 0x00, 0x0F, 0x1E, 0x11, 0x3C, 0x33, 0x22, 0x2D, - 0x78, 0x77, 0x66, 0x69, 0x44, 0x4B, 0x5A, 0x55 -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte2_low[16], 16) = { 0x00, 0x0F, 0x1E, 0x11, 0x3C, 0x33, + 0x22, 0x2D, 0x78, 0x77, 0x66, 0x69, + 0x44, 0x4B, 0x5A, 0x55 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte3_low[16], 16) = { - 0x00, 0x18, 0x30, 0x28, 0x60, 0x78, 0x50, 0x48, - 0xC0, 0xD8, 0xF0, 0xE8, 0xA0, 0xB8, 0x90, 0x88 -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte3_low[16], 16) = { 0x00, 0x18, 0x30, 0x28, 0x60, 0x78, + 0x50, 0x48, 0xC0, 0xD8, 0xF0, 0xE8, + 0xA0, 0xB8, 0x90, 0x88 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte0_hi[16], 16) = { - 0x00, 0x31, 0x62, 0x53, 0xC4, 0xF5, 0xA6, 0x97, - 0x21, 0x10, 0x43, 0x72, 0xE5, 0xD4, 0x87, 0xB6 -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte0_hi[16], 16) = { 0x00, 0x31, 0x62, 0x53, 0xC4, 0xF5, + 0xA6, 0x97, 0x21, 0x10, 0x43, 0x72, + 0xE5, 0xD4, 0x87, 0xB6 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte1_hi[16], 16) = { - 0x00, 0x5F, 0xBE, 0xE1, 0xD5, 0x8A, 0x6B, 0x34, - 0x03, 0x5C, 0xBD, 0xE2, 0xD6, 0x89, 0x68, 0x37 -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte1_hi[16], 16) = { 0x00, 0x5F, 0xBE, 0xE1, 0xD5, 0x8A, + 0x6B, 0x34, 0x03, 0x5C, 0xBD, 0xE2, + 0xD6, 0x89, 0x68, 0x37 }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte2_hi[16], 16) = { - 0x00, 0xF0, 0x49, 0xB9, 0x92, 0x62, 0xDB, 0x2B, - 0x8D, 0x7D, 0xC4, 0x34, 0x1F, 0xEF, 0x56, 0xA6 -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte2_hi[16], 16) = { 0x00, 0xF0, 0x49, 0xB9, 0x92, 0x62, + 0xDB, 0x2B, 0x8D, 0x7D, 0xC4, 0x34, + 0x1F, 0xEF, 0x56, 0xA6 }; IMB_DLL_LOCAL - DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte3_hi[16], 16) = { - 0x00, 0x29, 0x52, 0x7B, 0xA4, 0x8D, 0xF6, 0xDF, - 0xE1, 0xC8, 0xB3, 0x9A, 0x45, 0x6C, 0x17, 0x3E -}; +DECLARE_ALIGNED(const uint8_t snow3g_DIVa_byte3_hi[16], 16) = { 0x00, 0x29, 0x52, 0x7B, 0xA4, 0x8D, + 0xF6, 0xDF, 0xE1, 0xC8, 0xB3, 0x9A, + 0x45, 0x6C, 0x17, 0x3E }; IMB_DLL_LOCAL DECLARE_ALIGNED(const uint8_t snow3g_invSR_SQ[256], 64) = { - 0xC2, 0xA6, 0x8F, 0x0A, 0x0D, 0xBE, 0xA7, 0x08, - 0x1D, 0x99, 0x45, 0x59, 0x13, 0xD2, 0x11, 0x9F, - 0xAE, 0xE6, 0xD4, 0xA4, 0x92, 0x8D, 0x58, 0xC1, - 0xD0, 0x97, 0xC8, 0x84, 0x9D, 0x4F, 0xBC, 0x3B, - 0x2D, 0xEB, 0x27, 0x53, 0x72, 0x4E, 0xE3, 0xEE, - 0xDA, 0x7F, 0xAA, 0x4D, 0x5C, 0x2F, 0x44, 0xDB, - 0x3E, 0x3A, 0x67, 0xC5, 0xC3, 0x6A, 0x16, 0x4C, - 0x38, 0xCC, 0xD7, 0xDD, 0x70, 0x62, 0xF2, 0x19, - 0x10, 0x09, 0x98, 0x4B, 0x61, 0xC9, 0x86, 0x03, - 0xA8, 0x6B, 0x5A, 0x33, 0x6E, 0x54, 0x5D, 0x8C, - 0x41, 0x1A, 0xF7, 0xF6, 0x82, 0xC6, 0xF8, 0x80, - 0xC0, 0xC7, 0xFE, 0xB3, 0x65, 0x2C, 0x7B, 0xBA, - 0xB4, 0xFC, 0x2A, 0x22, 0x0C, 0x73, 0xF5, 0x5F, - 0x64, 0x68, 0x2E, 0x94, 0xB2, 0x24, 0x35, 0x14, - 0x78, 0xFB, 0xBF, 0x48, 0xDE, 0xED, 0x43, 0x07, - 0xB6, 0x32, 0xE4, 0xBD, 0x74, 0x7D, 0x57, 0x46, - 0x3C, 0x37, 0xC4, 0xB7, 0x51, 0x8A, 0xF3, 0x55, - 0x6C, 0xCF, 0x79, 0xAB, 0x77, 0xA3, 0xE1, 0x93, - 0xD5, 0x6D, 0x81, 0x5B, 0x2B, 0x9A, 0x7E, 0x8B, - 0x04, 0xB5, 0x85, 0xD3, 0x91, 0xA1, 0x47, 0x52, - 0xA5, 0xEC, 0xD6, 0xBB, 0x20, 0x87, 0x26, 0xF0, - 0xAF, 0x4A, 0x89, 0xF4, 0xCE, 0x25, 0xCB, 0x50, - 0x00, 0x3F, 0xD9, 0x42, 0x90, 0x21, 0x3D, 0xA9, - 0xE7, 0x29, 0x01, 0xF1, 0x36, 0x5E, 0xFA, 0xCD, - 0xE5, 0x31, 0x1B, 0x05, 0xFD, 0x9E, 0xA0, 0x76, - 0x30, 0xB1, 0x75, 0xB0, 0x9B, 0x56, 0xEA, 0x1C, - 0xEF, 0x06, 0x69, 0x7A, 0x95, 0x88, 0x15, 0xFF, - 0xCA, 0xAC, 0x0E, 0x23, 0xD8, 0x0F, 0x28, 0x0B, - 0x18, 0xF9, 0x63, 0x1E, 0x83, 0x66, 0x39, 0x9C, - 0xE2, 0x49, 0x1F, 0xE8, 0xD1, 0x34, 0x7C, 0xA2, - 0xB9, 0xE0, 0x02, 0x12, 0xE9, 0xDF, 0xAD, 0x71, - 0x96, 0x8E, 0x6F, 0xB8, 0x40, 0x60, 0x17, 0xDC + 0xC2, 0xA6, 0x8F, 0x0A, 0x0D, 0xBE, 0xA7, 0x08, 0x1D, 0x99, 0x45, 0x59, 0x13, 0xD2, 0x11, + 0x9F, 0xAE, 0xE6, 0xD4, 0xA4, 0x92, 0x8D, 0x58, 0xC1, 0xD0, 0x97, 0xC8, 0x84, 0x9D, 0x4F, + 0xBC, 0x3B, 0x2D, 0xEB, 0x27, 0x53, 0x72, 0x4E, 0xE3, 0xEE, 0xDA, 0x7F, 0xAA, 0x4D, 0x5C, + 0x2F, 0x44, 0xDB, 0x3E, 0x3A, 0x67, 0xC5, 0xC3, 0x6A, 0x16, 0x4C, 0x38, 0xCC, 0xD7, 0xDD, + 0x70, 0x62, 0xF2, 0x19, 0x10, 0x09, 0x98, 0x4B, 0x61, 0xC9, 0x86, 0x03, 0xA8, 0x6B, 0x5A, + 0x33, 0x6E, 0x54, 0x5D, 0x8C, 0x41, 0x1A, 0xF7, 0xF6, 0x82, 0xC6, 0xF8, 0x80, 0xC0, 0xC7, + 0xFE, 0xB3, 0x65, 0x2C, 0x7B, 0xBA, 0xB4, 0xFC, 0x2A, 0x22, 0x0C, 0x73, 0xF5, 0x5F, 0x64, + 0x68, 0x2E, 0x94, 0xB2, 0x24, 0x35, 0x14, 0x78, 0xFB, 0xBF, 0x48, 0xDE, 0xED, 0x43, 0x07, + 0xB6, 0x32, 0xE4, 0xBD, 0x74, 0x7D, 0x57, 0x46, 0x3C, 0x37, 0xC4, 0xB7, 0x51, 0x8A, 0xF3, + 0x55, 0x6C, 0xCF, 0x79, 0xAB, 0x77, 0xA3, 0xE1, 0x93, 0xD5, 0x6D, 0x81, 0x5B, 0x2B, 0x9A, + 0x7E, 0x8B, 0x04, 0xB5, 0x85, 0xD3, 0x91, 0xA1, 0x47, 0x52, 0xA5, 0xEC, 0xD6, 0xBB, 0x20, + 0x87, 0x26, 0xF0, 0xAF, 0x4A, 0x89, 0xF4, 0xCE, 0x25, 0xCB, 0x50, 0x00, 0x3F, 0xD9, 0x42, + 0x90, 0x21, 0x3D, 0xA9, 0xE7, 0x29, 0x01, 0xF1, 0x36, 0x5E, 0xFA, 0xCD, 0xE5, 0x31, 0x1B, + 0x05, 0xFD, 0x9E, 0xA0, 0x76, 0x30, 0xB1, 0x75, 0xB0, 0x9B, 0x56, 0xEA, 0x1C, 0xEF, 0x06, + 0x69, 0x7A, 0x95, 0x88, 0x15, 0xFF, 0xCA, 0xAC, 0x0E, 0x23, 0xD8, 0x0F, 0x28, 0x0B, 0x18, + 0xF9, 0x63, 0x1E, 0x83, 0x66, 0x39, 0x9C, 0xE2, 0x49, 0x1F, 0xE8, 0xD1, 0x34, 0x7C, 0xA2, + 0xB9, 0xE0, 0x02, 0x12, 0xE9, 0xDF, 0xAD, 0x71, 0x96, 0x8E, 0x6F, 0xB8, 0x40, 0x60, 0x17, + 0xDC }; IMB_DLL_LOCAL -DECLARE_ALIGNED(const uint64_t snow3g_table_S2[256],32) = { - 0x4a6f25254a6f2525ULL, 0x486c2424486c2424ULL, - 0xe6957373e6957373ULL, 0xcea96767cea96767ULL, - 0xc710d7d7c710d7d7ULL, 0x359baeae359baeaeULL, - 0xb8e45c5cb8e45c5cULL, 0x6050303060503030ULL, - 0x2185a4a42185a4a4ULL, 0xb55beeeeb55beeeeULL, - 0xdcb26e6edcb26e6eULL, 0xff34cbcbff34cbcbULL, - 0xfa877d7dfa877d7dULL, 0x03b6b5b503b6b5b5ULL, - 0x6def82826def8282ULL, 0xdf04dbdbdf04dbdbULL, - 0xa145e4e4a145e4e4ULL, 0x75fb8e8e75fb8e8eULL, - 0x90d8484890d84848ULL, 0x92db494992db4949ULL, - 0x9ed14f4f9ed14f4fULL, 0xbae75d5dbae75d5dULL, - 0xd4be6a6ad4be6a6aULL, 0xf0887878f0887878ULL, - 0xe0907070e0907070ULL, 0x79f1888879f18888ULL, - 0xb951e8e8b951e8e8ULL, 0xbee15f5fbee15f5fULL, - 0xbce25e5ebce25e5eULL, 0x61e5848461e58484ULL, - 0xcaaf6565caaf6565ULL, 0xad4fe2e2ad4fe2e2ULL, - 0xd901d8d8d901d8d8ULL, 0xbb52e9e9bb52e9e9ULL, - 0xf13dccccf13dccccULL, 0xb35eededb35eededULL, - 0x80c0404080c04040ULL, 0x5e712f2f5e712f2fULL, - 0x2233111122331111ULL, 0x5078282850782828ULL, - 0xaef95757aef95757ULL, 0xcd1fd2d2cd1fd2d2ULL, - 0x319dacac319dacacULL, 0xaf4ce3e3af4ce3e3ULL, - 0x94de4a4a94de4a4aULL, 0x2a3f15152a3f1515ULL, - 0x362d1b1b362d1b1bULL, 0x1ba2b9b91ba2b9b9ULL, - 0x0dbfb2b20dbfb2b2ULL, 0x69e9808069e98080ULL, - 0x63e6858563e68585ULL, 0x2583a6a62583a6a6ULL, - 0x5c722e2e5c722e2eULL, 0x0406020204060202ULL, - 0x8ec947478ec94747ULL, 0x527b2929527b2929ULL, - 0x0e0907070e090707ULL, 0x96dd4b4b96dd4b4bULL, - 0x1c120e0e1c120e0eULL, 0xeb2ac1c1eb2ac1c1ULL, - 0xa2f35151a2f35151ULL, 0x3d97aaaa3d97aaaaULL, - 0x7bf289897bf28989ULL, 0xc115d4d4c115d4d4ULL, - 0xfd37cacafd37cacaULL, 0x0203010102030101ULL, - 0x8cca46468cca4646ULL, 0x0fbcb3b30fbcb3b3ULL, - 0xb758efefb758efefULL, 0xd30eddddd30eddddULL, - 0x88cc444488cc4444ULL, 0xf68d7b7bf68d7b7bULL, - 0xed2fc2c2ed2fc2c2ULL, 0xfe817f7ffe817f7fULL, - 0x15abbebe15abbebeULL, 0xef2cc3c3ef2cc3c3ULL, - 0x57c89f9f57c89f9fULL, 0x4060202040602020ULL, - 0x98d44c4c98d44c4cULL, 0xc8ac6464c8ac6464ULL, - 0x6fec83836fec8383ULL, 0x2d8fa2a22d8fa2a2ULL, - 0xd0b86868d0b86868ULL, 0x84c6424284c64242ULL, - 0x2635131326351313ULL, 0x01b5b4b401b5b4b4ULL, - 0x82c3414182c34141ULL, 0xf33ecdcdf33ecdcdULL, - 0x1da7baba1da7babaULL, 0xe523c6c6e523c6c6ULL, - 0x1fa4bbbb1fa4bbbbULL, 0xdab76d6ddab76d6dULL, - 0x9ad74d4d9ad74d4dULL, 0xe2937171e2937171ULL, - 0x4263212142632121ULL, 0x8175f4f48175f4f4ULL, - 0x73fe8d8d73fe8d8dULL, 0x09b9b0b009b9b0b0ULL, - 0xa346e5e5a346e5e5ULL, 0x4fdc93934fdc9393ULL, - 0x956bfefe956bfefeULL, 0x77f88f8f77f88f8fULL, - 0xa543e6e6a543e6e6ULL, 0xf738cfcff738cfcfULL, - 0x86c5434386c54343ULL, 0x8acf45458acf4545ULL, - 0x6253313162533131ULL, 0x4466222244662222ULL, - 0x6e5937376e593737ULL, 0x6c5a36366c5a3636ULL, - 0x45d3969645d39696ULL, 0x9d67fafa9d67fafaULL, - 0x11adbcbc11adbcbcULL, 0x1e110f0f1e110f0fULL, - 0x1018080810180808ULL, 0xa4f65252a4f65252ULL, - 0x3a271d1d3a271d1dULL, 0xaaff5555aaff5555ULL, - 0x342e1a1a342e1a1aULL, 0xe326c5c5e326c5c5ULL, - 0x9cd24e4e9cd24e4eULL, 0x4665232346652323ULL, - 0xd2bb6969d2bb6969ULL, 0xf48e7a7af48e7a7aULL, - 0x4ddf92924ddf9292ULL, 0x9768ffff9768ffffULL, - 0xb6ed5b5bb6ed5b5bULL, 0xb4ee5a5ab4ee5a5aULL, - 0xbf54ebebbf54ebebULL, 0x5dc79a9a5dc79a9aULL, - 0x38241c1c38241c1cULL, 0x3b92a9a93b92a9a9ULL, - 0xcb1ad1d1cb1ad1d1ULL, 0xfc827e7efc827e7eULL, - 0x1a170d0d1a170d0dULL, 0x916dfcfc916dfcfcULL, - 0xa0f05050a0f05050ULL, 0x7df78a8a7df78a8aULL, - 0x05b3b6b605b3b6b6ULL, 0xc4a66262c4a66262ULL, - 0x8376f5f58376f5f5ULL, 0x141e0a0a141e0a0aULL, - 0x9961f8f89961f8f8ULL, 0xd10ddcdcd10ddcdcULL, - 0x0605030306050303ULL, 0x78443c3c78443c3cULL, - 0x18140c0c18140c0cULL, 0x724b3939724b3939ULL, - 0x8b7af1f18b7af1f1ULL, 0x19a1b8b819a1b8b8ULL, - 0x8f7cf3f38f7cf3f3ULL, 0x7a473d3d7a473d3dULL, - 0x8d7ff2f28d7ff2f2ULL, 0xc316d5d5c316d5d5ULL, - 0x47d0979747d09797ULL, 0xccaa6666ccaa6666ULL, - 0x6bea81816bea8181ULL, 0x6456323264563232ULL, - 0x2989a0a02989a0a0ULL, 0x0000000000000000ULL, - 0x0c0a06060c0a0606ULL, 0xf53bcecef53bceceULL, - 0x8573f6f68573f6f6ULL, 0xbd57eaeabd57eaeaULL, - 0x07b0b7b707b0b7b7ULL, 0x2e3917172e391717ULL, - 0x8770f7f78770f7f7ULL, 0x71fd8c8c71fd8c8cULL, - 0xf28b7979f28b7979ULL, 0xc513d6d6c513d6d6ULL, - 0x2780a7a72780a7a7ULL, 0x17a8bfbf17a8bfbfULL, - 0x7ff48b8b7ff48b8bULL, 0x7e413f3f7e413f3fULL, - 0x3e211f1f3e211f1fULL, 0xa6f55353a6f55353ULL, - 0xc6a56363c6a56363ULL, 0xea9f7575ea9f7575ULL, - 0x6a5f35356a5f3535ULL, 0x58742c2c58742c2cULL, - 0xc0a06060c0a06060ULL, 0x936efdfd936efdfdULL, - 0x4e6927274e692727ULL, 0xcf1cd3d3cf1cd3d3ULL, - 0x41d5949441d59494ULL, 0x2386a5a52386a5a5ULL, - 0xf8847c7cf8847c7cULL, 0x2b8aa1a12b8aa1a1ULL, - 0x0a0f05050a0f0505ULL, 0xb0e85858b0e85858ULL, - 0x5a772d2d5a772d2dULL, 0x13aebdbd13aebdbdULL, - 0xdb02d9d9db02d9d9ULL, 0xe720c7c7e720c7c7ULL, - 0x3798afaf3798afafULL, 0xd6bd6b6bd6bd6b6bULL, - 0xa8fc5454a8fc5454ULL, 0x161d0b0b161d0b0bULL, - 0xa949e0e0a949e0e0ULL, 0x7048383870483838ULL, - 0x080c0404080c0404ULL, 0xf931c8c8f931c8c8ULL, - 0x53ce9d9d53ce9d9dULL, 0xa740e7e7a740e7e7ULL, - 0x283c1414283c1414ULL, 0x0bbab1b10bbab1b1ULL, - 0x67e0878767e08787ULL, 0x51cd9c9c51cd9c9cULL, - 0xd708dfdfd708dfdfULL, 0xdeb16f6fdeb16f6fULL, - 0x9b62f9f99b62f9f9ULL, 0xdd07dadadd07dadaULL, - 0x547e2a2a547e2a2aULL, 0xe125c4c4e125c4c4ULL, - 0xb2eb5959b2eb5959ULL, 0x2c3a16162c3a1616ULL, - 0xe89c7474e89c7474ULL, 0x4bda91914bda9191ULL, - 0x3f94abab3f94ababULL, 0x4c6a26264c6a2626ULL, - 0xc2a36161c2a36161ULL, 0xec9a7676ec9a7676ULL, - 0x685c3434685c3434ULL, 0x567d2b2b567d2b2bULL, - 0x339eadad339eadadULL, 0x5bc299995bc29999ULL, - 0x9f64fbfb9f64fbfbULL, 0xe4967272e4967272ULL, - 0xb15dececb15dececULL, 0x6655333366553333ULL, - 0x2436121224361212ULL, 0xd50bdeded50bdedeULL, - 0x59c1989859c19898ULL, 0x764d3b3b764d3b3bULL, - 0xe929c0c0e929c0c0ULL, 0x5fc49b9b5fc49b9bULL, - 0x7c423e3e7c423e3eULL, 0x3028181830281818ULL, - 0x2030101020301010ULL, 0x744e3a3a744e3a3aULL, - 0xacfa5656acfa5656ULL, 0xab4ae1e1ab4ae1e1ULL, - 0xee997777ee997777ULL, 0xfb32c9c9fb32c9c9ULL, - 0x3c221e1e3c221e1eULL, 0x55cb9e9e55cb9e9eULL, - 0x43d6959543d69595ULL, 0x2f8ca3a32f8ca3a3ULL, - 0x49d9909049d99090ULL, 0x322b1919322b1919ULL, - 0x3991a8a83991a8a8ULL, 0xd8b46c6cd8b46c6cULL, - 0x121b0909121b0909ULL, 0xc919d0d0c919d0d0ULL, - 0x8979f0f08979f0f0ULL, 0x65e3868665e38686ULL +DECLARE_ALIGNED(const uint64_t snow3g_table_S2[256], 32) = { + 0x4a6f25254a6f2525ULL, 0x486c2424486c2424ULL, 0xe6957373e6957373ULL, 0xcea96767cea96767ULL, + 0xc710d7d7c710d7d7ULL, 0x359baeae359baeaeULL, 0xb8e45c5cb8e45c5cULL, 0x6050303060503030ULL, + 0x2185a4a42185a4a4ULL, 0xb55beeeeb55beeeeULL, 0xdcb26e6edcb26e6eULL, 0xff34cbcbff34cbcbULL, + 0xfa877d7dfa877d7dULL, 0x03b6b5b503b6b5b5ULL, 0x6def82826def8282ULL, 0xdf04dbdbdf04dbdbULL, + 0xa145e4e4a145e4e4ULL, 0x75fb8e8e75fb8e8eULL, 0x90d8484890d84848ULL, 0x92db494992db4949ULL, + 0x9ed14f4f9ed14f4fULL, 0xbae75d5dbae75d5dULL, 0xd4be6a6ad4be6a6aULL, 0xf0887878f0887878ULL, + 0xe0907070e0907070ULL, 0x79f1888879f18888ULL, 0xb951e8e8b951e8e8ULL, 0xbee15f5fbee15f5fULL, + 0xbce25e5ebce25e5eULL, 0x61e5848461e58484ULL, 0xcaaf6565caaf6565ULL, 0xad4fe2e2ad4fe2e2ULL, + 0xd901d8d8d901d8d8ULL, 0xbb52e9e9bb52e9e9ULL, 0xf13dccccf13dccccULL, 0xb35eededb35eededULL, + 0x80c0404080c04040ULL, 0x5e712f2f5e712f2fULL, 0x2233111122331111ULL, 0x5078282850782828ULL, + 0xaef95757aef95757ULL, 0xcd1fd2d2cd1fd2d2ULL, 0x319dacac319dacacULL, 0xaf4ce3e3af4ce3e3ULL, + 0x94de4a4a94de4a4aULL, 0x2a3f15152a3f1515ULL, 0x362d1b1b362d1b1bULL, 0x1ba2b9b91ba2b9b9ULL, + 0x0dbfb2b20dbfb2b2ULL, 0x69e9808069e98080ULL, 0x63e6858563e68585ULL, 0x2583a6a62583a6a6ULL, + 0x5c722e2e5c722e2eULL, 0x0406020204060202ULL, 0x8ec947478ec94747ULL, 0x527b2929527b2929ULL, + 0x0e0907070e090707ULL, 0x96dd4b4b96dd4b4bULL, 0x1c120e0e1c120e0eULL, 0xeb2ac1c1eb2ac1c1ULL, + 0xa2f35151a2f35151ULL, 0x3d97aaaa3d97aaaaULL, 0x7bf289897bf28989ULL, 0xc115d4d4c115d4d4ULL, + 0xfd37cacafd37cacaULL, 0x0203010102030101ULL, 0x8cca46468cca4646ULL, 0x0fbcb3b30fbcb3b3ULL, + 0xb758efefb758efefULL, 0xd30eddddd30eddddULL, 0x88cc444488cc4444ULL, 0xf68d7b7bf68d7b7bULL, + 0xed2fc2c2ed2fc2c2ULL, 0xfe817f7ffe817f7fULL, 0x15abbebe15abbebeULL, 0xef2cc3c3ef2cc3c3ULL, + 0x57c89f9f57c89f9fULL, 0x4060202040602020ULL, 0x98d44c4c98d44c4cULL, 0xc8ac6464c8ac6464ULL, + 0x6fec83836fec8383ULL, 0x2d8fa2a22d8fa2a2ULL, 0xd0b86868d0b86868ULL, 0x84c6424284c64242ULL, + 0x2635131326351313ULL, 0x01b5b4b401b5b4b4ULL, 0x82c3414182c34141ULL, 0xf33ecdcdf33ecdcdULL, + 0x1da7baba1da7babaULL, 0xe523c6c6e523c6c6ULL, 0x1fa4bbbb1fa4bbbbULL, 0xdab76d6ddab76d6dULL, + 0x9ad74d4d9ad74d4dULL, 0xe2937171e2937171ULL, 0x4263212142632121ULL, 0x8175f4f48175f4f4ULL, + 0x73fe8d8d73fe8d8dULL, 0x09b9b0b009b9b0b0ULL, 0xa346e5e5a346e5e5ULL, 0x4fdc93934fdc9393ULL, + 0x956bfefe956bfefeULL, 0x77f88f8f77f88f8fULL, 0xa543e6e6a543e6e6ULL, 0xf738cfcff738cfcfULL, + 0x86c5434386c54343ULL, 0x8acf45458acf4545ULL, 0x6253313162533131ULL, 0x4466222244662222ULL, + 0x6e5937376e593737ULL, 0x6c5a36366c5a3636ULL, 0x45d3969645d39696ULL, 0x9d67fafa9d67fafaULL, + 0x11adbcbc11adbcbcULL, 0x1e110f0f1e110f0fULL, 0x1018080810180808ULL, 0xa4f65252a4f65252ULL, + 0x3a271d1d3a271d1dULL, 0xaaff5555aaff5555ULL, 0x342e1a1a342e1a1aULL, 0xe326c5c5e326c5c5ULL, + 0x9cd24e4e9cd24e4eULL, 0x4665232346652323ULL, 0xd2bb6969d2bb6969ULL, 0xf48e7a7af48e7a7aULL, + 0x4ddf92924ddf9292ULL, 0x9768ffff9768ffffULL, 0xb6ed5b5bb6ed5b5bULL, 0xb4ee5a5ab4ee5a5aULL, + 0xbf54ebebbf54ebebULL, 0x5dc79a9a5dc79a9aULL, 0x38241c1c38241c1cULL, 0x3b92a9a93b92a9a9ULL, + 0xcb1ad1d1cb1ad1d1ULL, 0xfc827e7efc827e7eULL, 0x1a170d0d1a170d0dULL, 0x916dfcfc916dfcfcULL, + 0xa0f05050a0f05050ULL, 0x7df78a8a7df78a8aULL, 0x05b3b6b605b3b6b6ULL, 0xc4a66262c4a66262ULL, + 0x8376f5f58376f5f5ULL, 0x141e0a0a141e0a0aULL, 0x9961f8f89961f8f8ULL, 0xd10ddcdcd10ddcdcULL, + 0x0605030306050303ULL, 0x78443c3c78443c3cULL, 0x18140c0c18140c0cULL, 0x724b3939724b3939ULL, + 0x8b7af1f18b7af1f1ULL, 0x19a1b8b819a1b8b8ULL, 0x8f7cf3f38f7cf3f3ULL, 0x7a473d3d7a473d3dULL, + 0x8d7ff2f28d7ff2f2ULL, 0xc316d5d5c316d5d5ULL, 0x47d0979747d09797ULL, 0xccaa6666ccaa6666ULL, + 0x6bea81816bea8181ULL, 0x6456323264563232ULL, 0x2989a0a02989a0a0ULL, 0x0000000000000000ULL, + 0x0c0a06060c0a0606ULL, 0xf53bcecef53bceceULL, 0x8573f6f68573f6f6ULL, 0xbd57eaeabd57eaeaULL, + 0x07b0b7b707b0b7b7ULL, 0x2e3917172e391717ULL, 0x8770f7f78770f7f7ULL, 0x71fd8c8c71fd8c8cULL, + 0xf28b7979f28b7979ULL, 0xc513d6d6c513d6d6ULL, 0x2780a7a72780a7a7ULL, 0x17a8bfbf17a8bfbfULL, + 0x7ff48b8b7ff48b8bULL, 0x7e413f3f7e413f3fULL, 0x3e211f1f3e211f1fULL, 0xa6f55353a6f55353ULL, + 0xc6a56363c6a56363ULL, 0xea9f7575ea9f7575ULL, 0x6a5f35356a5f3535ULL, 0x58742c2c58742c2cULL, + 0xc0a06060c0a06060ULL, 0x936efdfd936efdfdULL, 0x4e6927274e692727ULL, 0xcf1cd3d3cf1cd3d3ULL, + 0x41d5949441d59494ULL, 0x2386a5a52386a5a5ULL, 0xf8847c7cf8847c7cULL, 0x2b8aa1a12b8aa1a1ULL, + 0x0a0f05050a0f0505ULL, 0xb0e85858b0e85858ULL, 0x5a772d2d5a772d2dULL, 0x13aebdbd13aebdbdULL, + 0xdb02d9d9db02d9d9ULL, 0xe720c7c7e720c7c7ULL, 0x3798afaf3798afafULL, 0xd6bd6b6bd6bd6b6bULL, + 0xa8fc5454a8fc5454ULL, 0x161d0b0b161d0b0bULL, 0xa949e0e0a949e0e0ULL, 0x7048383870483838ULL, + 0x080c0404080c0404ULL, 0xf931c8c8f931c8c8ULL, 0x53ce9d9d53ce9d9dULL, 0xa740e7e7a740e7e7ULL, + 0x283c1414283c1414ULL, 0x0bbab1b10bbab1b1ULL, 0x67e0878767e08787ULL, 0x51cd9c9c51cd9c9cULL, + 0xd708dfdfd708dfdfULL, 0xdeb16f6fdeb16f6fULL, 0x9b62f9f99b62f9f9ULL, 0xdd07dadadd07dadaULL, + 0x547e2a2a547e2a2aULL, 0xe125c4c4e125c4c4ULL, 0xb2eb5959b2eb5959ULL, 0x2c3a16162c3a1616ULL, + 0xe89c7474e89c7474ULL, 0x4bda91914bda9191ULL, 0x3f94abab3f94ababULL, 0x4c6a26264c6a2626ULL, + 0xc2a36161c2a36161ULL, 0xec9a7676ec9a7676ULL, 0x685c3434685c3434ULL, 0x567d2b2b567d2b2bULL, + 0x339eadad339eadadULL, 0x5bc299995bc29999ULL, 0x9f64fbfb9f64fbfbULL, 0xe4967272e4967272ULL, + 0xb15dececb15dececULL, 0x6655333366553333ULL, 0x2436121224361212ULL, 0xd50bdeded50bdedeULL, + 0x59c1989859c19898ULL, 0x764d3b3b764d3b3bULL, 0xe929c0c0e929c0c0ULL, 0x5fc49b9b5fc49b9bULL, + 0x7c423e3e7c423e3eULL, 0x3028181830281818ULL, 0x2030101020301010ULL, 0x744e3a3a744e3a3aULL, + 0xacfa5656acfa5656ULL, 0xab4ae1e1ab4ae1e1ULL, 0xee997777ee997777ULL, 0xfb32c9c9fb32c9c9ULL, + 0x3c221e1e3c221e1eULL, 0x55cb9e9e55cb9e9eULL, 0x43d6959543d69595ULL, 0x2f8ca3a32f8ca3a3ULL, + 0x49d9909049d99090ULL, 0x322b1919322b1919ULL, 0x3991a8a83991a8a8ULL, 0xd8b46c6cd8b46c6cULL, + 0x121b0909121b0909ULL, 0xc919d0d0c919d0d0ULL, 0x8979f0f08979f0f0ULL, 0x65e3868665e38686ULL }; - diff --git a/lib/x86_64/version.c b/lib/x86_64/version.c index b549bdeb..38ed0a0e 100644 --- a/lib/x86_64/version.c +++ b/lib/x86_64/version.c @@ -30,12 +30,14 @@ const char *imb_version_str = IMB_VERSION_STR; const unsigned imb_version = IMB_VERSION_NUM; -const char *imb_get_version_str(void) +const char * +imb_get_version_str(void) { return imb_version_str; } -unsigned imb_get_version(void) +unsigned +imb_get_version(void) { return imb_version; } diff --git a/lib/x86_64/zuc_iv.c b/lib/x86_64/zuc_iv.c index 6d42000c..a3fa18d9 100644 --- a/lib/x86_64/zuc_iv.c +++ b/lib/x86_64/zuc_iv.c @@ -31,8 +31,7 @@ #include "include/wireless_common.h" int -zuc_eea3_iv_gen(const uint32_t count, const uint8_t bearer, - const uint8_t dir, void *iv_ptr) +zuc_eea3_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr) { uint8_t *iv = (uint8_t *) iv_ptr; uint32_t *iv32 = (uint32_t *) iv_ptr; @@ -41,7 +40,7 @@ zuc_eea3_iv_gen(const uint32_t count, const uint8_t bearer, return -1; /* Bearer must contain 5 bits only */ - if (bearer >= (1<<5)) + if (bearer >= (1 << 5)) return -1; /* Direction must contain 1 bit only */ @@ -64,8 +63,7 @@ zuc_eea3_iv_gen(const uint32_t count, const uint8_t bearer, } int -zuc_eia3_iv_gen(const uint32_t count, const uint8_t bearer, - const uint8_t dir, void *iv_ptr) +zuc_eia3_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, void *iv_ptr) { uint8_t *iv = (uint8_t *) iv_ptr; uint32_t *iv32 = (uint32_t *) iv_ptr; @@ -74,7 +72,7 @@ zuc_eia3_iv_gen(const uint32_t count, const uint8_t bearer, return -1; /* Bearer must contain 5 bits only */ - if (bearer >= (1<<5)) + if (bearer >= (1 << 5)) return -1; /* Direction must contain 1 bit only */ -- GitLab From 6afb86ab79dab562ae4a847bd0393b97e70625c6 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 8 Sep 2023 14:40:35 +0100 Subject: [PATCH 068/204] lib: add clang-format to makefile style check - use clang-format for .c and .h files - use checkpatch for .asm and .inc files - fix source directories searched by checkpatch --- lib/Makefile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index e89c600c..90e12b79 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1213,6 +1213,8 @@ help: @echo "SAFE_OPTIONS=n" @echo " - Disable all safe options (enabled by default)" +.PHONY: style +style: clang-format checkpatch ifneq ($(ARCH), aarch64) CHECKPATCH ?= checkpatch.pl @@ -1227,13 +1229,7 @@ CHECKPATCH ?= checkpatch.pl # # NOTE: these flags cannot be broken into multiple lines due to # spaces injected by make -CHECKPATCH_FLAGS = --no-tree --no-signoff --emacs --no-color --ignore CODE_INDENT,INITIALISED_STATIC,LEADING_SPACE,SPLIT_STRING,UNSPECIFIED_INT,ARRAY_SIZE,BLOCK_COMMENT_STYLE,GLOBAL_INITIALISERS,NEW_TYPEDEFS,AVOID_EXTERNS,COMPLEX_MACRO,PREFER_ALIGNED,USE_FUNC,CONSTANT_COMPARISON,SPACING,GCC_BINARY_CONSTANT,VOLATILE - -%.c_style_check : %.c - $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< - -%.h_style_check : %.h - $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< +CHECKPATCH_FLAGS = --no-tree --no-signoff --emacs --no-color --max-line-length=100 --ignore CODE_INDENT,INITIALISED_STATIC,LEADING_SPACE,SPLIT_STRING,UNSPECIFIED_INT,ARRAY_SIZE,BLOCK_COMMENT_STYLE,GLOBAL_INITIALISERS,NEW_TYPEDEFS,AVOID_EXTERNS,COMPLEX_MACRO,PREFER_ALIGNED,USE_FUNC,CONSTANT_COMPARISON,SPACING,GCC_BINARY_CONSTANT,VOLATILE %.asm_style_check : %.asm $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< @@ -1241,13 +1237,22 @@ CHECKPATCH_FLAGS = --no-tree --no-signoff --emacs --no-color --ignore CODE_INDEN %.inc_style_check : %.inc $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< -SOURCES_DIRS := . sse avx avx2 avx512 include no-aesni -SOURCES := $(foreach dir,$(SOURCES_DIRS),$(wildcard $(dir)/**/*.[ch]) $(wildcard $(dir)/**/*.asm) $(wildcard $(dir)/**/*.inc)) -SOURCES_STYLE := $(foreach infile,$(SOURCES),$(infile)_style_check) +SOURCES_DIRS := . sse_t1 sse_t2 sse_t3 avx_t1 avx_t2 avx2_t1 avx_t2 avx2_t3 avx512_t1 avx512_t2 x86_64 include no-aesni +ASM_SOURCES := $(foreach dir,$(SOURCES_DIRS), $(wildcard $(dir)/**/*.asm) $(wildcard $(dir)/**/*.inc)) endif # aarch64 -.PHONY: style -style: $(SOURCES_STYLE) +.PHONY: checkpatch +checkpatch: + $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $(ASM_SOURCES) + +.PHONY: clang-format +CLANGFORMAT?=clang-format +clang-format: + @for file in $(wildcard ./**/*.[ch]); do \ + echo "Checking style $$file"; \ + $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ + { echo "ERROR: $$file has style problems"; exit 1; } \ + done # cppcheck analysis check CPPCHECK ?= cppcheck -- GitLab From fc056ff49f70d3934d092b39f4dede8bc0499a0d Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 8 Sep 2023 14:41:34 +0100 Subject: [PATCH 069/204] examples: reformat burst-app source files with clang-format --- examples/burst-app/main.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/examples/burst-app/main.c b/examples/burst-app/main.c index 71a487af..cd501cbc 100644 --- a/examples/burst-app/main.c +++ b/examples/burst-app/main.c @@ -32,13 +32,13 @@ #include -#define NUM_BUFS IMB_MAX_JOBS -#define BURST_SIZE 32 -#define BUF_SIZE 2048 -#define KEY_SIZE 16 -#define IV_SIZE 16 -#define AAD_SIZE 12 -#define DIGEST_SIZE 16 +#define NUM_BUFS IMB_MAX_JOBS +#define BURST_SIZE 32 +#define BUF_SIZE 2048 +#define KEY_SIZE 16 +#define IV_SIZE 16 +#define AAD_SIZE 12 +#define DIGEST_SIZE 16 #define TOTAL_NUM_JOBS 10000UL /* @@ -75,8 +75,7 @@ fill_job(IMB_JOB *job, const void *src_buf, void *dst_buf, const void *iv, } static int -allocate_array(void **array, const unsigned num_elems, - const size_t elem_size) +allocate_array(void **array, const unsigned num_elems, const size_t elem_size) { unsigned i; @@ -89,7 +88,8 @@ allocate_array(void **array, const unsigned num_elems, return 0; } -int main(void) +int +main(void) { unsigned i; IMB_MGR *mb_mgr = NULL; @@ -130,7 +130,7 @@ int main(void) /* Prepare GCM keys (common for all buffers) */ uint8_t key[KEY_SIZE]; - struct gcm_key_data gdata_key; + struct gcm_key_data gdata_key; /* IMB API: Expand AES keys and precompute GHASH keys for AES-GCM */ IMB_AES128_GCM_PRE(mb_mgr, key, &gdata_key); @@ -147,8 +147,7 @@ int main(void) printf("Encrypting %lu buffers with AES-GCM\n", TOTAL_NUM_JOBS); while (n_jobs_left != 0) { - const unsigned burst_size = (n_jobs_left < BURST_SIZE) ? - n_jobs_left : BURST_SIZE; + const unsigned burst_size = (n_jobs_left < BURST_SIZE) ? n_jobs_left : BURST_SIZE; /* IMB API: Get next burst of IMB_JOB's */ const unsigned n_jobs = IMB_GET_NEXT_BURST(mb_mgr, burst_size, jobs); @@ -175,8 +174,8 @@ int main(void) /* Index for next buffer in src_bufs/dst_bufs arrays */ const unsigned buf_idx = (TOTAL_NUM_JOBS - n_jobs_left + i) % NUM_BUFS; - fill_job(jobs[i], src_bufs[buf_idx], dst_bufs[buf_idx], - iv[i], &gdata_key, aad[i], auth_tags[buf_idx]); + fill_job(jobs[i], src_bufs[buf_idx], dst_bufs[buf_idx], iv[i], &gdata_key, + aad[i], auth_tags[buf_idx]); #if IMB_VERSION(1, 3, 0) < IMB_VERSION_NUM imb_set_session(mb_mgr, jobs[i]); #endif @@ -191,8 +190,7 @@ int main(void) /* IMB API: Get string for the error */ if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, - imb_get_strerror(err)); + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); goto exit; } @@ -229,8 +227,8 @@ int main(void) } if (total_jobs_rx != TOTAL_NUM_JOBS) { - printf("Not all jobs could be completed (expected %lu, got %u)\n", - TOTAL_NUM_JOBS, total_jobs_rx); + printf("Not all jobs could be completed (expected %lu, got %u)\n", TOTAL_NUM_JOBS, + total_jobs_rx); goto exit; } -- GitLab From d5a2668fe9fe49681f495a8fd6159307568127e6 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 8 Sep 2023 14:47:00 +0100 Subject: [PATCH 070/204] examples: use clang-format for style check --- examples/Makefile | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 7eab0c8d..af670ad9 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -38,19 +38,14 @@ $(BURST_APP): clean: $(MAKE) -C burst-app clean -# style check section -CHECKPATCH?=checkpatch.pl -CHECKPATCH_FLAGS = --no-tree --no-signoff --emacs --no-color --max-line-length=100 --ignore CODE_INDENT,INITIALISED_STATIC,LEADING_SPACE,SPLIT_STRING,UNSPECIFIED_INT,ARRAY_SIZE,BLOCK_COMMENT_STYLE,GLOBAL_INITIALISERS,AVOID_EXTERNS,COMPLEX_MACRO,USE_FUNC,CONSTANT_COMPARISON,MISSING_SPACE,NEW_TYPEDEFS - -%.c_style_check : %.c - $(CHECKPATCH) $(CHECKPATCH_FLAGS) -f $< - -BURST_APP_SOURCES := $(wildcard $(BURST_APP)/*.[c]) -SOURCES_ALL := $(BURST_APP_SOURCES) -SOURCES_STYLE := $(foreach infile,$(SOURCES_ALL),$(infile)_style_check) - +CLANGFORMAT?=clang-format .PHONY: style -style: $(SOURCES_STYLE) +style: + @for file in $(wildcard ./**/*.[ch]); do \ + echo "Checking style $$file"; \ + $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ + { echo "ERROR: $$file has style problems"; exit 1; } \ + done # cppcheck analysis check CPPCHECK ?= cppcheck -- GitLab From b5e609b0ccf33a0192bc4695be586e366ab7f059 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 8 Sep 2023 16:01:45 +0100 Subject: [PATCH 071/204] cmake: update style check src files dirs --- cmake/clang-format.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/clang-format.cmake b/cmake/clang-format.cmake index 6d71f07c..d32e9b8d 100644 --- a/cmake/clang-format.cmake +++ b/cmake/clang-format.cmake @@ -32,7 +32,13 @@ find_program(CLANG_FORMAT NAMES ${CLANG_FORMAT_BIN}) # set up target if clang-format available if(CLANG_FORMAT) - file(GLOB_RECURSE CLANG_FORMAT_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.[ch]") + file( + GLOB_RECURSE + CLANG_FORMAT_SRC_FILES + "${CMAKE_CURRENT_SOURCE_DIR}/lib/*.[ch]" + "${CMAKE_CURRENT_SOURCE_DIR}/perf/*.[ch]" + "${CMAKE_CURRENT_SOURCE_DIR}/test/*.[ch]" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.[ch]") add_custom_target(style COMMENT "Checking style using clang-format" @@ -44,5 +50,3 @@ if(CLANG_FORMAT) COMMAND clang-format -style=file -i ${CLANG_FORMAT_SRC_FILES} ) endif() - - -- GitLab From 8753c11b644d1387cc933de4b58f5c9622bd70fe Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 11 Sep 2023 15:40:24 +0100 Subject: [PATCH 072/204] cmake: add clang-format version check --- cmake/clang-format.cmake | 64 +++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/cmake/clang-format.cmake b/cmake/clang-format.cmake index d32e9b8d..ebdd9215 100644 --- a/cmake/clang-format.cmake +++ b/cmake/clang-format.cmake @@ -32,21 +32,51 @@ find_program(CLANG_FORMAT NAMES ${CLANG_FORMAT_BIN}) # set up target if clang-format available if(CLANG_FORMAT) - file( - GLOB_RECURSE - CLANG_FORMAT_SRC_FILES - "${CMAKE_CURRENT_SOURCE_DIR}/lib/*.[ch]" - "${CMAKE_CURRENT_SOURCE_DIR}/perf/*.[ch]" - "${CMAKE_CURRENT_SOURCE_DIR}/test/*.[ch]" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.[ch]") - - add_custom_target(style - COMMENT "Checking style using clang-format" - COMMAND clang-format -style=file --dry-run --Werror ${CLANG_FORMAT_SRC_FILES} - ) - - add_custom_target(style-fix - COMMENT "Fixing style issues using clang-format" - COMMAND clang-format -style=file -i ${CLANG_FORMAT_SRC_FILES} - ) + set(CLANG_FORMAT_REQUIRED "13.0.1") + + execute_process( + COMMAND ${CLANG_FORMAT} --version + RESULT_VARIABLE CLANG_FORMAT_VERSION_STATUS + OUTPUT_VARIABLE CLANG_FORMAT_VERSION_OUTPUT + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + + string(REGEX MATCH "clang-format version ([0-9]*.[0-9]*.[0-9]*)" + CLANG_FORMAT_VERSION "${CLANG_FORMAT_VERSION_OUTPUT}") + + if(CLANG_FORMAT_VERSION_STATUS EQUAL 0 AND CLANG_FORMAT_VERSION) + message(STATUS "clang-format version: ${CMAKE_MATCH_1}") + if(CLANG_FORMAT_REQUIRED VERSION_LESS_EQUAL ${CMAKE_MATCH_1}) + file( + GLOB_RECURSE + CLANG_FORMAT_SRC_FILES + "${CMAKE_CURRENT_SOURCE_DIR}/lib/*.[ch]" + "${CMAKE_CURRENT_SOURCE_DIR}/perf/*.[ch]" + "${CMAKE_CURRENT_SOURCE_DIR}/test/*.[ch]" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.[ch]") + + add_custom_target( + style + COMMENT "Checking style using clang-format" + COMMAND ${CLANG_FORMAT} -style=file --dry-run --Werror + ${CLANG_FORMAT_SRC_FILES}) + + add_custom_target( + style-fix + COMMENT "Fixing style issues using clang-format" + COMMAND ${CLANG_FORMAT} -style=file -i ${CLANG_FORMAT_SRC_FILES}) + else() + set(MIN_VERSION_MSG + "target requires at least clang-format version ${CLANG_FORMAT_REQUIRED}! Found version ${CMAKE_MATCH_1}" + ) + message(DEBUG "WARNING: ${MIN_VERSION_MSG}") + add_custom_target( + style + COMMENT "Checking style using clang-format" + COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red "${MIN_VERSION_MSG}") + add_custom_target( + style-fix + COMMENT "Fixing style issues using clang-format" + COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red "${MIN_VERSION_MSG}") + endif() + endif() endif() -- GitLab From fc7802752e420d9fadc4a5c2c6225877863f978e Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Tue, 12 Sep 2023 21:17:58 +0100 Subject: [PATCH 073/204] cmake: fix nasm version check version check incorrectly fails if minor version is lower than required --- lib/CMakeLists.txt | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4b7e7251..93de640d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -225,21 +225,25 @@ else() endif() endif() -set(NASM_MAJOR_REQUIRED 2) -set(NASM_MINOR_REQUIRED 14) +set(NASM_VERSION_REQUIRED "2.14") -execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -v +execute_process( + COMMAND ${CMAKE_ASM_NASM_COMPILER} -v OUTPUT_VARIABLE NASM_VERSION_OUTPUT - OUTPUT_STRIP_TRAILING_WHITESPACE -) -string(REGEX MATCH "NASM version ([0-9]*).([0-9]*)" NASM_VERSION "${NASM_VERSION_OUTPUT}") -if (NASM_VERSION) - if (NASM_MAJOR_REQUIRED GREATER ${CMAKE_MATCH_1} OR NASM_MINOR_REQUIRED GREATER ${CMAKE_MATCH_2}) - message(FATAL_ERROR "NASM version must be at least ${NASM_MAJOR_REQUIRED}.${NASM_MINOR_REQUIRED}!") + OUTPUT_STRIP_TRAILING_WHITESPACE) +string(REGEX MATCH "NASM version ([0-9]*.[0-9]*)" NASM_VERSION + "${NASM_VERSION_OUTPUT}") +if(NASM_VERSION) + if(NASM_VERSION_REQUIRED VERSION_GREATER ${CMAKE_MATCH_1}) + message( + FATAL_ERROR "NASM version must be at least ${NASM_VERSION_REQUIRED}!") endif() - message(STATUS "NASM version: ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}") + message(STATUS "NASM version: ${CMAKE_MATCH_1}") else() - message(WARNING "Could not parse NASM version string: ${NASM_VERSION_OUTPUT}.\nPlease, be sure that ${CMAKE_ASM_NASM_COMPILER} version is >= ${NASM_MAJOR_REQUIRED}.${NASM_MINOR_REQUIRED}.") + message( + WARNING + "Could not parse NASM version string: ${NASM_VERSION_OUTPUT}.\nPlease, be sure that ${CMAKE_ASM_NASM_COMPILER} version is >= ${NASM_VERSION_REQUIRED}" + ) endif() set(CAN_USE_ASSEMBLER 1) -- GitLab From 7f0388272d7d305ddd47282816415a99ef67bbc5 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 13 Sep 2023 09:56:49 +0100 Subject: [PATCH 074/204] update clang-format search path in Makefiles --- examples/Makefile | 2 +- lib/Makefile | 2 +- perf/Makefile | 2 +- test/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index af670ad9..e2b9990e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -41,7 +41,7 @@ clean: CLANGFORMAT?=clang-format .PHONY: style style: - @for file in $(wildcard ./**/*.[ch]); do \ + @for file in $(wildcard ./*.[ch]) $(wildcard ./**/*.[ch]); do \ echo "Checking style $$file"; \ $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ { echo "ERROR: $$file has style problems"; exit 1; } \ diff --git a/lib/Makefile b/lib/Makefile index 90e12b79..6b37ff95 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1248,7 +1248,7 @@ checkpatch: .PHONY: clang-format CLANGFORMAT?=clang-format clang-format: - @for file in $(wildcard ./**/*.[ch]); do \ + @for file in $(wildcard ./*.[ch]) $(wildcard ./**/*.[ch]); do \ echo "Checking style $$file"; \ $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ { echo "ERROR: $$file has style problems"; exit 1; } \ diff --git a/perf/Makefile b/perf/Makefile index f1280af4..a8e72891 100644 --- a/perf/Makefile +++ b/perf/Makefile @@ -148,7 +148,7 @@ style: clang-format checkpatch .PHONY: clang-format CLANGFORMAT?=clang-format clang-format: - @for file in $(wildcard *.[ch]); do \ + @for file in $(wildcard ./*.[ch]) $(wildcard ./**/*.[ch]); do \ echo "Checking style $$file"; \ $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ { echo "ERROR: $$file has style problems"; exit 1; } \ diff --git a/test/Makefile b/test/Makefile index df0925d0..8a7eb0fb 100644 --- a/test/Makefile +++ b/test/Makefile @@ -77,7 +77,7 @@ checkpatch: CLANGFORMAT?=clang-format .PHONY: clang-format clang-format: - @for file in $(wildcard ./**/*.[ch]); do \ + @for file in $(wildcard ./*.[ch]) $(wildcard ./**/*.[ch]); do \ echo "Checking style $$file"; \ $(CLANGFORMAT) -style=file "$$file" | diff "$$file" - | tee /dev/stderr | [ $$(wc -c) -eq 0 ] || \ { echo "ERROR: $$file has style problems"; exit 1; } \ -- GitLab From db46abd32ae52687ed45848e835f9d4b5be21076 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 14 Dec 2022 17:45:38 +0000 Subject: [PATCH 075/204] avx2: [aes-ctr] add AVX2 type2 (VAES) AES counter mode implementation --- README.md | 6 +- ReleaseNotes.txt | 1 + lib/Makefile | 3 + lib/avx2_t2/aes128_cntr_vaes_avx2.asm | 43 ++ lib/avx2_t2/aes192_cntr_vaes_avx2.asm | 42 ++ lib/avx2_t2/aes256_cntr_vaes_avx2.asm | 42 ++ lib/avx2_t2/mb_mgr_avx2_t2.c | 6 +- lib/include/aes_cntr_by16_vaes_avx2.inc | 589 ++++++++++++++++++++++++ lib/include/arch_avx2_type2.h | 11 + lib/win_x64.mak | 3 + 10 files changed, 740 insertions(+), 6 deletions(-) create mode 100644 lib/avx2_t2/aes128_cntr_vaes_avx2.asm create mode 100644 lib/avx2_t2/aes192_cntr_vaes_avx2.asm create mode 100644 lib/avx2_t2/aes256_cntr_vaes_avx2.asm create mode 100644 lib/include/aes_cntr_by16_vaes_avx2.inc diff --git a/README.md b/README.md index 886559a4..64c8081d 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,9 @@ Table 1. List of supported cipher algorithms and their implementations. | AES128-CBC | N | Y(1) | Y(3) | N | N | Y(6) | N | | AES192-CBC | N | Y(1) | Y(3) | N | N | Y(6) | N | | AES256-CBC | N | Y(1) | Y(3) | N | N | Y(6) | N | -| AES128-CTR | N | Y by8 | Y by8 | N | N | Y by16 | N | -| AES192-CTR | N | Y by8 | Y by8 | N | N | Y by16 | N | -| AES256-CTR | N | Y by8 | Y by8 | N | N | Y by16 | N | +| AES128-CTR | N | Y by8 | Y by8 | Y(10) | N | Y by16 | N | +| AES192-CTR | N | Y by8 | Y by8 | Y(10) | N | Y by16 | N | +| AES256-CTR | N | Y by8 | Y by8 | Y(10) | N | Y by16 | N | | AES128-ECB | N | Y(1) | Y by8 | Y(10) | N | Y by16 | N | | AES192-ECB | N | Y(1) | Y by8 | Y(10) | N | Y by16 | N | | AES256-ECB | N | Y(1) | Y by8 | Y(10) | N | Y by16 | N | diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index dcbd5e2e..36218afe 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -6,6 +6,7 @@ Unreleased Library - QUIC CHACHA20-POLY1305 and CHACHA20 HP API added. +- AVX2-VAES AES-CTR implementation added. Test Applications - QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. diff --git a/lib/Makefile b/lib/Makefile index 6b37ff95..0edae556 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -722,6 +722,9 @@ asm_avx2_lib_objs := \ aes128_ecb_vaes_avx2.o \ aes192_ecb_vaes_avx2.o \ aes256_ecb_vaes_avx2.o \ + aes128_cntr_vaes_avx2.o \ + aes192_cntr_vaes_avx2.o \ + aes256_cntr_vaes_avx2.o \ mb_mgr_hmac_md5_flush_avx2.o \ mb_mgr_hmac_md5_submit_avx2.o \ mb_mgr_hmac_sha1_flush_avx2.o \ diff --git a/lib/avx2_t2/aes128_cntr_vaes_avx2.asm b/lib/avx2_t2/aes128_cntr_vaes_avx2.asm new file mode 100644 index 00000000..495946de --- /dev/null +++ b/lib/avx2_t2/aes128_cntr_vaes_avx2.asm @@ -0,0 +1,43 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +%use smartalign +%define AES_CTR_DECLARE_DATA 1 +%include "include/aes_cntr_by16_vaes_avx2.inc" + +%include "include/cet.inc" + +;; aes_cntr_128_vaes_avx2(void *in, void *IV, void *keys, void *out, UINT64 num_bytes, +;; UINT64 iv_len) +align 32 +MKGLOBAL(aes_cntr_128_vaes_avx2,function,internal) +aes_cntr_128_vaes_avx2: + endbranch64 + DO_CNTR 128 + ret + +mksection stack-noexec diff --git a/lib/avx2_t2/aes192_cntr_vaes_avx2.asm b/lib/avx2_t2/aes192_cntr_vaes_avx2.asm new file mode 100644 index 00000000..870a958c --- /dev/null +++ b/lib/avx2_t2/aes192_cntr_vaes_avx2.asm @@ -0,0 +1,42 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +%use smartalign +%include "include/aes_cntr_by16_vaes_avx2.inc" + +%include "include/cet.inc" + +;; aes_cntr_192_vaes_avx2(void *in, void *IV, void *keys, void *out, UINT64 num_bytes, +;; UINT64 iv_len) +align 32 +MKGLOBAL(aes_cntr_192_vaes_avx2,function,internal) +aes_cntr_192_vaes_avx2: + endbranch64 + DO_CNTR 192 + ret + +mksection stack-noexec diff --git a/lib/avx2_t2/aes256_cntr_vaes_avx2.asm b/lib/avx2_t2/aes256_cntr_vaes_avx2.asm new file mode 100644 index 00000000..b29f22c6 --- /dev/null +++ b/lib/avx2_t2/aes256_cntr_vaes_avx2.asm @@ -0,0 +1,42 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +%use smartalign +%include "include/aes_cntr_by16_vaes_avx2.inc" + +%include "include/cet.inc" + +;; aes_cntr_256_vaes_avx2(void *in, void *IV, void *keys, void *out, UINT64 num_bytes, +;; UINT64 iv_len) +align 32 +MKGLOBAL(aes_cntr_256_vaes_avx2,function,internal) +aes_cntr_256_vaes_avx2: + endbranch64 + DO_CNTR 256 + ret + +mksection stack-noexec diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index 4d0f5692..0ef102b4 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -134,9 +134,9 @@ #define AES_ECB_DEC_256 aes_ecb_dec_256_vaes_avx2 /* AES-CTR */ -#define AES_CTR_128 aes_cntr_128_avx -#define AES_CTR_192 aes_cntr_192_avx -#define AES_CTR_256 aes_cntr_256_avx +#define AES_CTR_128 aes_cntr_128_vaes_avx2 +#define AES_CTR_192 aes_cntr_192_vaes_avx2 +#define AES_CTR_256 aes_cntr_256_vaes_avx2 #define AES_CTR_128_BIT aes_cntr_bit_128_avx #define AES_CTR_192_BIT aes_cntr_bit_192_avx #define AES_CTR_256_BIT aes_cntr_bit_256_avx diff --git a/lib/include/aes_cntr_by16_vaes_avx2.inc b/lib/include/aes_cntr_by16_vaes_avx2.inc new file mode 100644 index 00000000..a4509ba2 --- /dev/null +++ b/lib/include/aes_cntr_by16_vaes_avx2.inc @@ -0,0 +1,589 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright(c) 2023, Intel Corporation All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in +; the documentation and/or other materials provided with the +; distribution. +; * Neither the name of Intel Corporation nor the names of its +; contributors may be used to endorse or promote products derived +; from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%ifndef AES_CNTR_VAES_AVX2_INC +%define AES_CNTR_VAES_AVX2_INC + +%use smartalign + +%include "include/os.inc" +%include "include/imb_job.inc" +%include "include/memcpy.inc" +%include "include/reg_sizes.inc" +%include "include/aes_common.inc" +%include "include/clear_regs.inc" + +;; YMM registers are clobbered and then scratch ones get cleared. +;; Windows YMM saving/restoring must be done at a higher level. + +;; ============================================================================= +;; DATA PART +;; ============================================================================= + +mksection .rodata +default rel + +%ifdef AES_CTR_DECLARE_DATA + +MKGLOBAL(vavx2_byteswap_const2,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_1_0,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_1,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_3_2,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_2,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_3,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_5_4,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_4,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_5,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_7_6,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_6,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_7,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_8,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_8_8,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_16,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_16_16,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_1_0,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_1,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_3_2,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_2,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_3,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_5_4,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_4,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_5,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_7_6,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_6,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_7,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_8,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_8_8,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_16,data,internal) +MKGLOBAL(vavx2_ctr_ddq_add_be_16_16,data,internal) + +align 32 +vavx2_byteswap_const2: + DQ 0x08090A0B0C0D0E0F, 0x0001020304050607 + DQ 0x08090A0B0C0D0E0F, 0x0001020304050607 + +align 32 +vavx2_ctr_ddq_add_1_0: + DQ 0x0000000000000000, 0x0000000000000000 +vavx2_ctr_ddq_add_1: + DQ 0x0000000000000001, 0x0000000000000000 +vavx2_ctr_ddq_add_3_2: +vavx2_ctr_ddq_add_2: + DQ 0x0000000000000002, 0x0000000000000000 +vavx2_ctr_ddq_add_3: + DQ 0x0000000000000003, 0x0000000000000000 +vavx2_ctr_ddq_add_5_4: +vavx2_ctr_ddq_add_4: + DQ 0x0000000000000004, 0x0000000000000000 +vavx2_ctr_ddq_add_5: + DQ 0x0000000000000005, 0x0000000000000000 +vavx2_ctr_ddq_add_7_6: +vavx2_ctr_ddq_add_6: + DQ 0x0000000000000006, 0x0000000000000000 +vavx2_ctr_ddq_add_7: + DQ 0x0000000000000007, 0x0000000000000000 +vavx2_ctr_ddq_add_8: +vavx2_ctr_ddq_add_8_8: + DQ 0x0000000000000008, 0x0000000000000000 + DQ 0x0000000000000008, 0x0000000000000000 + +vavx2_ctr_ddq_add_16: +vavx2_ctr_ddq_add_16_16: + DQ 0x0000000000000010, 0x0000000000000000 + DQ 0x0000000000000010, 0x0000000000000000 + +align 32 +vavx2_ctr_ddq_add_be_1_0: + DQ 0x0000000000000000, 0x0000000000000000 +vavx2_ctr_ddq_add_be_1: + DQ 0x0000000000000000, 0x0100000000000000 +vavx2_ctr_ddq_add_be_3_2: +vavx2_ctr_ddq_add_be_2: + DQ 0x0000000000000000, 0x0200000000000000 +vavx2_ctr_ddq_add_be_3: + DQ 0x0000000000000000, 0x0300000000000000 +vavx2_ctr_ddq_add_be_5_4: +vavx2_ctr_ddq_add_be_4: + DQ 0x0000000000000000, 0x0400000000000000 +vavx2_ctr_ddq_add_be_5: + DQ 0x0000000000000000, 0x0500000000000000 +vavx2_ctr_ddq_add_be_7_6: +vavx2_ctr_ddq_add_be_6: + DQ 0x0000000000000000, 0x0600000000000000 +vavx2_ctr_ddq_add_be_7: + DQ 0x0000000000000000, 0x0700000000000000 +vavx2_ctr_ddq_add_be_8: +vavx2_ctr_ddq_add_be_8_8: + DQ 0x0000000000000000, 0x0800000000000000 + DQ 0x0000000000000000, 0x0800000000000000 + +vavx2_ctr_ddq_add_be_16: +vavx2_ctr_ddq_add_be_16_16: + DQ 0x0000000000000000, 0x1000000000000000 + DQ 0x0000000000000000, 0x1000000000000000 +%else +;; constants already declared - re-use them inseatd of copying +extern vavx2_byteswap_const2 +extern vavx2_ctr_ddq_add_1_0 +extern vavx2_ctr_ddq_add_1 +extern vavx2_ctr_ddq_add_3_2 +extern vavx2_ctr_ddq_add_2 +extern vavx2_ctr_ddq_add_3 +extern vavx2_ctr_ddq_add_5_4 +extern vavx2_ctr_ddq_add_4 +extern vavx2_ctr_ddq_add_5 +extern vavx2_ctr_ddq_add_7_6 +extern vavx2_ctr_ddq_add_6 +extern vavx2_ctr_ddq_add_7 +extern vavx2_ctr_ddq_add_8 +extern vavx2_ctr_ddq_add_8_8 +extern vavx2_ctr_ddq_add_16 +extern vavx2_ctr_ddq_add_16_16 +extern vavx2_ctr_ddq_add_be_1_0 +extern vavx2_ctr_ddq_add_be_1 +extern vavx2_ctr_ddq_add_be_3_2 +extern vavx2_ctr_ddq_add_be_2 +extern vavx2_ctr_ddq_add_be_3 +extern vavx2_ctr_ddq_add_be_5_4 +extern vavx2_ctr_ddq_add_be_4 +extern vavx2_ctr_ddq_add_be_5 +extern vavx2_ctr_ddq_add_be_7_6 +extern vavx2_ctr_ddq_add_be_6 +extern vavx2_ctr_ddq_add_be_7 +extern vavx2_ctr_ddq_add_be_8 +extern vavx2_ctr_ddq_add_be_8_8 +extern vavx2_ctr_ddq_add_be_16 +extern vavx2_ctr_ddq_add_be_16_16 +%endif + +;; ============================================================================= +;; CODE PART +;; ============================================================================= + +mksection .text + +%define CONCAT(a,b) a %+ b + +%define xdata0 xmm0 +%define xdata1 xmm1 +%define xdata2 xmm2 +%define xdata3 xmm3 +%define xpart xmm4 +%define xcounter xmm5 + +%define xbyteswap xmm7 +%define xkey xmm8 +%define xdata4 xmm9 +%define xdata5 xmm10 +%define xdata6 xmm11 +%define xdata7 xmm12 + +%define ydata0 ymm0 +%define ydata1 ymm1 +%define ydata2 ymm2 +%define ydata3 ymm3 + +%define ycounter ymm5 + +%define ybyteswap ymm7 +%define ykey ymm8 +%define ydata4 ymm9 +%define ydata5 ymm10 +%define ydata6 ymm11 +%define ydata7 ymm12 + +%ifdef LINUX +%define p_in rdi +%define p_IV rsi +%define p_keys rdx +%define p_out rcx +%define num_bytes r8 +%define arg_ivlen r9 +%else ;; LINUX +%define p_in rcx +%define p_IV rdx +%define p_keys r8 +%define p_out r9 +%define num_bytes r10 +%define arg_ivlen r11 +%endif ;; LINUX + +%define tmp r11 + +;; ============================================================================= +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; do_aes +;; - increments p_in and p_out +;; - updates ycounter +;; - clobbers ydata & ykey +;; - uses tmp to track counter overflow condition +%macro do_aes 2 +%define %%by %1 ;; [in] number of blocks to encrypt/decrypt +%define %%rounds %2 ;; [in] number of aesenc rounds + + ;; prepare counter blocks +%if %%by == 1 + ;; single block only + vmovdqa xdata0, xcounter + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_1] + +%elif %%by == 16 + + ;; most optimized case - 16 blocks + cmp tmp, 255-16 + ja %%_by16_overflow + + vpaddd ydata0, ycounter, [rel vavx2_ctr_ddq_add_be_1_0] + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_be_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_be_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_be_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_be_8_8] + vpaddd ydata5, ydata1, [rel vavx2_ctr_ddq_add_be_8_8] + vpaddd ydata6, ydata2, [rel vavx2_ctr_ddq_add_be_8_8] + vpaddd ydata7, ydata3, [rel vavx2_ctr_ddq_add_be_8_8] + vpaddd ycounter, ycounter, [rel vavx2_ctr_ddq_add_be_16_16] + jmp %%_by16_end + +align 32 +%%_by16_overflow: + vpshufb ycounter, ycounter, ybyteswap + vpaddd ydata0, ycounter, [rel vavx2_ctr_ddq_add_1_0] + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata5, ydata1, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata6, ydata2, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata7, ydata3, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ycounter, ycounter, [rel vavx2_ctr_ddq_add_16_16] + vpshufb ydata0, ydata0, ybyteswap + vpshufb ydata1, ydata1, ybyteswap + vpshufb ydata2, ydata2, ybyteswap + vpshufb ydata3, ydata3, ybyteswap + vpshufb ydata4, ydata4, ybyteswap + vpshufb ydata5, ydata5, ybyteswap + vpshufb ydata6, ydata6, ybyteswap + vpshufb ydata7, ydata7, ybyteswap + vpshufb ycounter, ycounter, ybyteswap + +align 32 +%%_by16_end: + add tmp, 16 + and tmp, 255 + +%else + ;; from 2 to 15 blocks + vinserti128 ycounter, xcounter, 1 + vpaddd ydata0, ycounter, [rel vavx2_ctr_ddq_add_1_0] + +%if %%by == 2 + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_2] +%elif %%by == 3 + vpaddd xdata1, xcounter, [rel vavx2_ctr_ddq_add_2] + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_3] +%elif %%by == 4 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_4] +%elif %%by == 5 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd xdata2, xcounter, [rel vavx2_ctr_ddq_add_4] + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_5] +%elif %%by == 6 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_6] +%elif %%by == 7 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd xdata3, xcounter, [rel vavx2_ctr_ddq_add_6] + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_7] +%elif %%by == 8 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd xcounter, xcounter, [rel vavx2_ctr_ddq_add_8] +%elif %%by == 9 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd xdata4, xdata0, [rel vavx2_ctr_ddq_add_8] + vpaddd xcounter, xdata1, [rel vavx2_ctr_ddq_add_7] +%elif %%by == 10 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_8_8] + vpaddd xcounter, xdata1, [rel vavx2_ctr_ddq_add_8] +%elif %%by == 11 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_8_8] + vpaddd xdata5, xdata1, [rel vavx2_ctr_ddq_add_8] + vpaddd xcounter, xdata2, [rel vavx2_ctr_ddq_add_7] +%elif %%by == 12 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata5, ydata1, [rel vavx2_ctr_ddq_add_8_8] + vpaddd xcounter, xdata2, [rel vavx2_ctr_ddq_add_8] +%elif %%by == 13 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata5, ydata1, [rel vavx2_ctr_ddq_add_8_8] + vpaddd xdata6, xdata2, [rel vavx2_ctr_ddq_add_8] + vpaddd xcounter, xdata3, [rel vavx2_ctr_ddq_add_7] +%elif %%by == 14 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata5, ydata1, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata6, ydata2, [rel vavx2_ctr_ddq_add_8_8] + vpaddd xcounter, xdata3, [rel vavx2_ctr_ddq_add_8] +%elif %%by == 15 + vpaddd ydata1, ycounter, [rel vavx2_ctr_ddq_add_3_2] + vpaddd ydata2, ycounter, [rel vavx2_ctr_ddq_add_5_4] + vpaddd ydata3, ycounter, [rel vavx2_ctr_ddq_add_7_6] + vpaddd ydata4, ydata0, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata5, ydata1, [rel vavx2_ctr_ddq_add_8_8] + vpaddd ydata6, ydata2, [rel vavx2_ctr_ddq_add_8_8] + vpaddd xdata7, xdata3, [rel vavx2_ctr_ddq_add_8] + vpaddd xcounter, xdata4, [rel vavx2_ctr_ddq_add_7] +%endif ;; %%by = 2 to 15 + +%endif ;; %%by + + ;; shuffle counter blocks +%if %%by != 16 + YMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%by, vpshufb, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ybyteswap, ybyteswap, ybyteswap, ybyteswap, \ + ybyteswap, ybyteswap, ybyteswap, ybyteswap +%endif + ;; ARK + vbroadcasti128 ykey, [p_keys + 0*16] + YMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%by, vpxor, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ykey, ykey, ykey, ykey, ykey, ykey, ykey, ykey + + ;; AESENC rounds +%assign K 1 +%rep %%rounds + vbroadcasti128 ykey, [p_keys + K*16] + YMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%by, vaesenc, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ykey, ykey, ykey, ykey, ykey, ykey, ykey, ykey +%assign K (K + 1) +%endrep ; AESENC keys + + ;; AESENCLAST round + vbroadcasti128 ykey, [p_keys + K*16] + YMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%by, vaesenclast, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ydata0, ydata1, ydata2, ydata3, ydata4, ydata5, ydata6, ydata7, \ + ykey, ykey, ykey, ykey, ykey, ykey, ykey, ykey + + ;; xor with plain/cipher text and store +%assign i 0 +%rep (%%by / 2) + vmovdqu ykey, [p_in + i*32] + vpxor CONCAT(ydata,i), CONCAT(ydata,i), ykey + vmovdqu [p_out + i*32], CONCAT(ydata,i) +%assign i (i + 1) +%endrep +%if (%%by % 2) == 1 + vmovdqu xkey, [p_in + i*32] + vpxor CONCAT(xdata,i), CONCAT(xdata,i), xkey + vmovdqu [p_out + i*32], CONCAT(xdata,i) +%endif + + add p_in, 16*%%by + add p_out, 16*%%by + +%endmacro + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; +;; Macro generating AES-CTR implementation for specific key size +;; +%macro DO_CNTR 1 +%define %%KEY_SIZE_BITS %1 ;; [in] numeric value: 128, 192 or 256 + +%if %%KEY_SIZE_BITS == 128 +%define %%NROUNDS 9 +%elif %%KEY_SIZE_BITS == 256 +%define %%NROUNDS 13 +%elif %%KEY_SIZE_BITS == 192 +%define %%NROUNDS 11 +%else +%error "AES-CTR AVX2 VAES: unsupported key size!" +%endif + +%ifndef LINUX + mov num_bytes, [rsp + 8*5] ; arg5 + mov arg_ivlen, [rsp + 8*6] ; arg6 +%endif + + vmovdqa ybyteswap, [rel vavx2_byteswap_const2] + ;; Read 16 byte IV: Nonce + 8-byte block counter (BE) + test arg_ivlen, 16 + jnz %%iv_is_16_bytes + + ;; Read 12 bytes: Nonce + ESP IV. Then pad with block counter 0x00000001 + mov DWORD(tmp), 0x01000000 + vmovq xcounter, [p_IV] + vpinsrd xcounter, [p_IV + 8], 2 + vpinsrd xcounter, DWORD(tmp), 3 + jmp %%_bswap_xcounter + +%%iv_is_16_bytes: + vmovdqu xcounter, [p_IV] + +%%_bswap_xcounter: + vpshufb xcounter, xbyteswap + + ;; calculate len + ;; convert bits to bytes (message length in bits for CNTR_BIT) + mov DWORD(tmp), DWORD(num_bytes) + and DWORD(tmp), 15*16 + jz %%chk ; multiple of 16x16 or zero + + ; 1 <= tmp <= 15 + cmp DWORD(tmp), 2*16 + je %%eq2 + jb %%eq1 + cmp DWORD(tmp), 14*16 + je %%eq14 + ja %%eq15 + cmp DWORD(tmp), 4*16 + je %%eq4 + jb %%eq3 + cmp DWORD(tmp), 12*16 + je %%eq12 + ja %%eq13 + cmp DWORD(tmp), 6*16 + je %%eq6 + jb %%eq5 + cmp DWORD(tmp), 10*16 + je %%eq10 + ja %%eq11 + cmp DWORD(tmp), 8*16 + je %%eq8 + jb %%eq7 + jmp %%eq9 + +%assign L 1 + +%rep 15 + +align 32 +%%eq %+ L : + do_aes L, %%NROUNDS +%if L < 15 + jmp %%chk +%else + ; fall through to chk +%endif + +%assign L (L + 1) +%endrep + +align 32 +%%chk: + and num_bytes, ~(15 * 16) + jz %%do_return2 + + cmp num_bytes, 16 + jb %%last + + ;; prep for by16 loop + vmovd DWORD(tmp), xcounter + and DWORD(tmp), 255 + vinserti128 ycounter, xcounter, 1 + vpshufb ycounter, ycounter, ybyteswap +align 32 +%%main_loop2: + ; num_bytes is a multiple of 16 blocks + partial bytes + do_aes 16, %%NROUNDS + sub num_bytes, 16*16 + cmp num_bytes, 16*16 + jae %%main_loop2 + + ; Check if there is a partial block + or num_bytes, num_bytes + jz %%do_return2 + + ;; get counter block back to LE + vpshufb xcounter, xcounter, xbyteswap + +%%last: + ; load partial block into XMM register + simd_load_avx_15_1 xpart, p_in, num_bytes + +%%final_ctr_enc: + ; Encryption of a single partial block + vpshufb xdata0, xcounter, xbyteswap + vpxor xdata0, xdata0, [p_keys + 16*0] +%assign i 1 +%rep %%NROUNDS + vaesenc xdata0, xdata0, [p_keys + 16*i] +%assign i (i+1) +%endrep + ; created keystream + vaesenclast xdata0, xdata0, [p_keys + 16*i] + + ; xor keystream with the message (scratch) + vpxor xdata0, xdata0, xpart + +%%store_output: + ; copy result into the output buffer + simd_store_avx_15 p_out, xdata0, num_bytes, tmp, rax + +%%do_return2: + +%ifdef SAFE_DATA + clear_all_ymms_asm +%endif ;; SAFE_DATA + +%endmacro + +%endif ; AES_CNTR_VAES_AVX2_INC diff --git a/lib/include/arch_avx2_type2.h b/lib/include/arch_avx2_type2.h index a1e37f8e..38770459 100644 --- a/lib/include/arch_avx2_type2.h +++ b/lib/include/arch_avx2_type2.h @@ -70,6 +70,17 @@ submit_job_zuc256_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, IMB_JOB *job, const uint IMB_JOB * flush_job_zuc256_eia3_gfni_avx2(MB_MGR_ZUC_OOO *state, const uint64_t tag_sz); +/* AES-CTR */ +void +aes_cntr_256_vaes_avx2(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bytes, uint64_t IV_len); +void +aes_cntr_192_vaes_avx2(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bytes, uint64_t IV_len); +void +aes_cntr_128_vaes_avx2(const void *in, const void *IV, const void *keys, void *out, + uint64_t len_bytes, uint64_t IV_len); + IMB_DLL_EXPORT void set_suite_id_avx2_t2(IMB_MGR *state, IMB_JOB *job); diff --git a/lib/win_x64.mak b/lib/win_x64.mak index ff1374b2..99b787b5 100644 --- a/lib/win_x64.mak +++ b/lib/win_x64.mak @@ -175,17 +175,20 @@ lib_objs1 = \ $(OBJ_DIR)\aes128_cntr_by8_avx.obj \ $(OBJ_DIR)\aes128_cntr_ccm_by8_sse.obj \ $(OBJ_DIR)\aes128_cntr_ccm_by8_avx.obj \ + $(OBJ_DIR)\aes128_cntr_vaes_avx2.obj \ $(OBJ_DIR)\aes128_ecbenc_x3.obj \ $(OBJ_DIR)\aes192_cbc_dec_by4_sse.obj \ $(OBJ_DIR)\aes192_cbc_dec_by8_sse.obj \ $(OBJ_DIR)\aes192_cbc_dec_by8_avx.obj \ $(OBJ_DIR)\aes192_cntr_by8_sse.obj \ $(OBJ_DIR)\aes192_cntr_by8_avx.obj \ + $(OBJ_DIR)\aes192_cntr_vaes_avx2.obj \ $(OBJ_DIR)\aes256_cbc_dec_by4_sse.obj \ $(OBJ_DIR)\aes256_cbc_dec_by8_sse.obj \ $(OBJ_DIR)\aes256_cbc_dec_by8_avx.obj \ $(OBJ_DIR)\aes256_cntr_by8_sse.obj \ $(OBJ_DIR)\aes256_cntr_by8_avx.obj \ + $(OBJ_DIR)\aes256_cntr_vaes_avx2.obj \ $(OBJ_DIR)\aes256_cntr_ccm_by8_sse.obj \ $(OBJ_DIR)\aes256_cntr_ccm_by8_avx.obj \ $(OBJ_DIR)\aes_cfb_sse.obj \ -- GitLab From 194089052b17e11df858e2f8042fb523a4b6f506 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 12 Sep 2023 10:25:24 +0100 Subject: [PATCH 076/204] avx2: [aes-gcm] remove obsolete clear of GP registers and fix function/loop alignment --- lib/include/gcm_common_avx2_avx512.inc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/include/gcm_common_avx2_avx512.inc b/lib/include/gcm_common_avx2_avx512.inc index afaa60e8..0c39e1b3 100644 --- a/lib/include/gcm_common_avx2_avx512.inc +++ b/lib/include/gcm_common_avx2_avx512.inc @@ -111,6 +111,8 @@ ; throughout the code, one tab and two tab indentations are used. one tab is for GHASH part, two tabs is for AES part. ; +%use smartalign + %include "include/os.inc" %include "include/reg_sizes.inc" %include "include/clear_regs.inc" @@ -391,7 +393,7 @@ default rel mov %%T1, %%A_IN ; T1 = AAD mov %%T2, %%A_LEN ; T2 = aadLen - +align 32 %%_get_AAD_loop128: cmp %%T2, 128 jl %%_exit_AAD_loop128 @@ -475,6 +477,7 @@ default rel cmp %%T2, 16 jb %%_AAD_reduce +align 32 %%_AAD_blocks: vmovdqu %%XTMP0, [%%T1] vpshufb %%XTMP0, [rel SHUF_MASK] @@ -2641,11 +2644,11 @@ default rel ;; Encrypt the final <16 byte (partial) block, then hash cmp r13, 16 - jl %%_encrypt_final_partial + jb %%_encrypt_final_partial ;; Process 7 full blocks plus a partial block cmp r13, 128 - jl %%_encrypt_by_8_partial + jb %%_encrypt_by_8_partial %%_encrypt_by_8_parallel: ;; in_order vs. out_order is an optimization to increment the counter without shuffling @@ -2655,9 +2658,10 @@ default rel and r15d, 255 vpshufb xmm9, [rel SHUF_MASK] +align 32 %%_encrypt_by_8_new: cmp r15d, 255-8 - jg %%_encrypt_by_8 + ja %%_encrypt_by_8 ;; xmm0 - T1 ;; xmm10 - T2 @@ -2685,6 +2689,7 @@ default rel vpshufb xmm9, [rel SHUF_MASK] jmp %%_encrypt_by_8_parallel_done +align 32 %%_encrypt_by_8: vpshufb xmm9, [rel SHUF_MASK] add r15b, 8 @@ -3032,6 +3037,7 @@ skip_aad_check_error_init: ; const u8 *aad, ; const u64 aad_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(init_var_iv,_),function,) FN_NAME(init_var_iv,_): endbranch64 @@ -3146,6 +3152,7 @@ skip_aad_check_error_init_IV: ; const u8 *in, ; u64 msg_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(enc,_update_),function,) FN_NAME(enc,_update_): endbranch64 @@ -3230,6 +3237,7 @@ skip_in_out_check_error_update_enc: ; const u8 *in, ; u64 msg_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(dec,_update_),function,) FN_NAME(dec,_update_): endbranch64 @@ -3314,6 +3322,7 @@ skip_in_out_check_error_update_dec: ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(enc,_finalize_),function,) FN_NAME(enc,_finalize_): endbranch64 @@ -3407,6 +3416,7 @@ error_enc_fin: ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(dec,_finalize_),function,) FN_NAME(dec,_finalize_): endbranch64 @@ -3506,6 +3516,7 @@ error_dec_fin: ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(enc,_),function,) FN_NAME(enc,_): endbranch64 @@ -3642,6 +3653,7 @@ skip_aad_check_error_enc: ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(dec,_),function,) FN_NAME(dec,_): endbranch64 @@ -3775,6 +3787,7 @@ skip_aad_check_error_dec: ; aes_gcm_enc_var_iv_256_avx512 ; (IMB_MGR *state, IMB_JOB *job) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(enc_var_iv,_),function,internal) FN_NAME(enc_var_iv,_): endbranch64 @@ -3827,6 +3840,7 @@ skip_iv_len_12_enc_IV: ; aes_gcm_dec_var_iv_256_avx512 ; (IMB_MGR *state, IMB_JOB *job) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(FN_NAME(dec_var_iv,_),function,internal) FN_NAME(dec_var_iv,_): endbranch64 @@ -3874,6 +3888,7 @@ skip_iv_len_12_dec_IV: ;void ghash_pre_avx_gen4 / ghash_pre_avx512 ; (const void *key, struct gcm_key_data *key_data) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(GHASH_FN_NAME(ghash_pre),function,) GHASH_FN_NAME(ghash_pre): endbranch64 @@ -3918,7 +3933,6 @@ GHASH_FN_NAME(ghash_pre): PRECOMPUTE arg2, xmm6, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5 %ifdef SAFE_DATA - clear_scratch_gps_asm clear_scratch_xmms_avx_asm %endif %ifidn __OUTPUT_FORMAT__, win64 @@ -3952,6 +3966,7 @@ error_ghash_pre: ; void *io_tag, ; const u64 tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(GHASH_FN_NAME(ghash),function,) GHASH_FN_NAME(ghash): endbranch64 @@ -4136,6 +4151,7 @@ error_ghash: ; const u8 *in, ; const u64 msg_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 MKGLOBAL(GMAC_FN_NAME(update),function,) GMAC_FN_NAME(update): endbranch64 -- GitLab From 31c8bdb34aeaf5694eb35611d0fa514e588c22bc Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 8 Nov 2022 11:22:06 +0000 Subject: [PATCH 077/204] avx2: [gcm] AVX2 YMM/256-bit GCM implementation based on AVX2 XMM/128-bit one Two loops co-exist at the moment: - by 16, used for messages longer than 512 bytes - by 8, used for smaller messages or to finish last blocks of long message (partial blocks) - AVX2 and AVX512 GHASH key compute need to be different than the AVX one (different hash key layout) --- README.md | 12 +- lib/Makefile | 3 +- lib/avx2_t2/aes128_gcm_vaes_avx2.asm | 31 + lib/avx2_t2/aes192_gcm_vaes_avx2.asm | 31 + lib/avx2_t2/aes256_gcm_vaes_avx2.asm | 31 + lib/avx2_t2/mb_mgr_avx2_t2.c | 98 +- lib/avx2_t3/mb_mgr_avx2_t3.c | 98 +- lib/include/aes_common.inc | 104 + lib/include/gcm.h | 531 ++- lib/include/gcm_defines.inc | 20 + lib/include/gcm_keys_vaes_avx2.inc | 50 + lib/include/gcm_vaes_avx2.inc | 5106 ++++++++++++++++++++++++++ lib/win_x64.mak | 3 + lib/x86_64/gcm.c | 108 + 14 files changed, 5947 insertions(+), 279 deletions(-) create mode 100644 lib/avx2_t2/aes128_gcm_vaes_avx2.asm create mode 100644 lib/avx2_t2/aes192_gcm_vaes_avx2.asm create mode 100644 lib/avx2_t2/aes256_gcm_vaes_avx2.asm create mode 100644 lib/include/gcm_keys_vaes_avx2.inc create mode 100644 lib/include/gcm_vaes_avx2.inc diff --git a/README.md b/README.md index 64c8081d..5957dede 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,7 @@ which provides industry-leading performance on a range of Intel(R) and Arm Processors. For information on how the library works, see the Intel White Paper: -"Fast Multi-buffer IPsec Implementations on Intel Architecture Processors". -Jim Guilford, Sean Gulley, et. al. - -The easiest way to find it is to search the Internet for the title and -Intel White Paper. +["Fast Multi-buffer IPsec Implementations on Intel Architecture Processors". Jim Guilford, Sean Gulley, et. al.](https://github.com/intel/intel-ipsec-mb/wiki/doc/fast-multi-buffer-ipsec-implementations-ia-processors-paper.pdf) Table 1. List of supported cipher algorithms and their implementations. ``` @@ -66,9 +62,9 @@ Table 1. List of supported cipher algorithms and their implementations. | Encryption +---------------------------------------------------------------| | | x86_64 | SSE | AVX | AVX2 | AVX512 | VAES(5)| aarch64 | |----------------+--------+--------+--------+--------+--------+--------|---------| -| AES128-GCM | N | Y by8 | N | Y by8 | Y by8 | Y by32 | N | -| AES192-GCM | N | Y by8 | N | Y by8 | Y by8 | Y by32 | N | -| AES256-GCM | N | Y by8 | N | Y by8 | Y by8 | Y by32 | N | +| AES128-GCM | N | Y by8 | N | Y(10) | Y by8 | Y by32 | N | +| AES192-GCM | N | Y by8 | N | Y(10) | Y by8 | Y by32 | N | +| AES256-GCM | N | Y by8 | N | Y(10) | Y by8 | Y by32 | N | | AES128-CCM | N | Y by8 | Y by8 | N | N | Y by16 | N | | AES256-CCM | N | Y by8 | Y by8 | N | N | Y by16 | N | | AES128-CBC | N | Y(1) | Y(3) | N | N | Y(6) | N | diff --git a/lib/Makefile b/lib/Makefile index 0edae556..4cd4e58c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -833,7 +833,8 @@ asm_sse_gcm_objs := \ asm_avx_gcm_objs := asm_avx2_gcm_objs := \ - aes128_gcm_by8_avx2.o aes192_gcm_by8_avx2.o aes256_gcm_by8_avx2.o + aes128_gcm_by8_avx2.o aes192_gcm_by8_avx2.o aes256_gcm_by8_avx2.o \ + aes128_gcm_vaes_avx2.o aes192_gcm_vaes_avx2.o aes256_gcm_vaes_avx2.o asm_avx512_gcm_objs := \ aes128_gcm_api_vaes_avx512.o aes192_gcm_api_vaes_avx512.o aes256_gcm_api_vaes_avx512.o \ diff --git a/lib/avx2_t2/aes128_gcm_vaes_avx2.asm b/lib/avx2_t2/aes128_gcm_vaes_avx2.asm new file mode 100644 index 00000000..fe60181f --- /dev/null +++ b/lib/avx2_t2/aes128_gcm_vaes_avx2.asm @@ -0,0 +1,31 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright(c) 2023, Intel Corporation All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in +; the documentation and/or other materials provided with the +; distribution. +; * Neither the name of Intel Corporation nor the names of its +; contributors may be used to endorse or promote products derived +; from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%define GCM128_MODE 1 +%include "include/gcm_vaes_avx2.inc" diff --git a/lib/avx2_t2/aes192_gcm_vaes_avx2.asm b/lib/avx2_t2/aes192_gcm_vaes_avx2.asm new file mode 100644 index 00000000..548a174f --- /dev/null +++ b/lib/avx2_t2/aes192_gcm_vaes_avx2.asm @@ -0,0 +1,31 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright(c) 2023, Intel Corporation All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in +; the documentation and/or other materials provided with the +; distribution. +; * Neither the name of Intel Corporation nor the names of its +; contributors may be used to endorse or promote products derived +; from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%define GCM192_MODE 1 +%include "include/gcm_vaes_avx2.inc" diff --git a/lib/avx2_t2/aes256_gcm_vaes_avx2.asm b/lib/avx2_t2/aes256_gcm_vaes_avx2.asm new file mode 100644 index 00000000..dff250d8 --- /dev/null +++ b/lib/avx2_t2/aes256_gcm_vaes_avx2.asm @@ -0,0 +1,31 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright(c) 2023, Intel Corporation All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in +; the documentation and/or other materials provided with the +; distribution. +; * Neither the name of Intel Corporation nor the names of its +; contributors may be used to endorse or promote products derived +; from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%define GCM256_MODE 1 +%include "include/gcm_vaes_avx2.inc" diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index 0ef102b4..de68817f 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -85,12 +85,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_vaes_avx2 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_vaes_avx2 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_vaes_avx2 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_vaes_avx2 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_vaes_avx2 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_vaes_avx2 #define SUBMIT_JOB_AES_GCM_DEC submit_job_gcm_dec_avx2 #define SUBMIT_JOB_AES_GCM_ENC submit_job_gcm_enc_avx2 @@ -437,49 +437,49 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_dec_update = update_dec_chacha20_poly1305_avx2; state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_avx; - state->gcm128_enc = aes_gcm_enc_128_avx_gen4; - state->gcm192_enc = aes_gcm_enc_192_avx_gen4; - state->gcm256_enc = aes_gcm_enc_256_avx_gen4; - state->gcm128_dec = aes_gcm_dec_128_avx_gen4; - state->gcm192_dec = aes_gcm_dec_192_avx_gen4; - state->gcm256_dec = aes_gcm_dec_256_avx_gen4; - state->gcm128_init = aes_gcm_init_128_avx_gen4; - state->gcm192_init = aes_gcm_init_192_avx_gen4; - state->gcm256_init = aes_gcm_init_256_avx_gen4; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; - state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; - state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; - state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; - state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; - state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; - state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; - state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx_gen4; - state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx_gen4; - state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx_gen4; - state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx_gen4; - state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx_gen4; - state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx_gen4; - state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; - state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; - state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; - state->gcm128_pre = aes_gcm_pre_128_avx_gen4; - state->gcm192_pre = aes_gcm_pre_192_avx_gen4; - state->gcm256_pre = aes_gcm_pre_256_avx_gen4; - - state->ghash = ghash_avx_gen4; - state->ghash_pre = ghash_pre_avx_gen4; - - state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; - state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; - state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; - state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; - state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; - state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; - state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; - state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; - state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; + state->gcm128_enc = aes_gcm_enc_128_vaes_avx2; + state->gcm192_enc = aes_gcm_enc_192_vaes_avx2; + state->gcm256_enc = aes_gcm_enc_256_vaes_avx2; + state->gcm128_dec = aes_gcm_dec_128_vaes_avx2; + state->gcm192_dec = aes_gcm_dec_192_vaes_avx2; + state->gcm256_dec = aes_gcm_dec_256_vaes_avx2; + state->gcm128_init = aes_gcm_init_128_vaes_avx2; + state->gcm192_init = aes_gcm_init_192_vaes_avx2; + state->gcm256_init = aes_gcm_init_256_vaes_avx2; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_vaes_avx2; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_vaes_avx2; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_vaes_avx2; + state->gcm128_enc_update = aes_gcm_enc_128_update_vaes_avx2; + state->gcm192_enc_update = aes_gcm_enc_192_update_vaes_avx2; + state->gcm256_enc_update = aes_gcm_enc_256_update_vaes_avx2; + state->gcm128_dec_update = aes_gcm_dec_128_update_vaes_avx2; + state->gcm192_dec_update = aes_gcm_dec_192_update_vaes_avx2; + state->gcm256_dec_update = aes_gcm_dec_256_update_vaes_avx2; + state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_vaes_avx2; + state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_vaes_avx2; + state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_vaes_avx2; + state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_vaes_avx2; + state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_vaes_avx2; + state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_vaes_avx2; + state->gcm128_precomp = aes_gcm_precomp_128_vaes_avx2; + state->gcm192_precomp = aes_gcm_precomp_192_vaes_avx2; + state->gcm256_precomp = aes_gcm_precomp_256_vaes_avx2; + state->gcm128_pre = aes_gcm_pre_128_vaes_avx2; + state->gcm192_pre = aes_gcm_pre_192_vaes_avx2; + state->gcm256_pre = aes_gcm_pre_256_vaes_avx2; + + state->ghash = ghash_vaes_avx2; + state->ghash_pre = ghash_pre_vaes_avx2; + + state->gmac128_init = imb_aes_gmac_init_128_vaes_avx2; + state->gmac192_init = imb_aes_gmac_init_192_vaes_avx2; + state->gmac256_init = imb_aes_gmac_init_256_vaes_avx2; + state->gmac128_update = imb_aes_gmac_update_128_vaes_avx2; + state->gmac192_update = imb_aes_gmac_update_192_vaes_avx2; + state->gmac256_update = imb_aes_gmac_update_256_vaes_avx2; + state->gmac128_finalize = imb_aes_gmac_finalize_128_vaes_avx2; + state->gmac192_finalize = imb_aes_gmac_finalize_192_vaes_avx2; + state->gmac256_finalize = imb_aes_gmac_finalize_256_vaes_avx2; state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index fc89fa28..d47be1b1 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -86,12 +86,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_vaes_avx2 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_vaes_avx2 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_vaes_avx2 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_vaes_avx2 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_vaes_avx2 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_vaes_avx2 #define SUBMIT_JOB_AES_GCM_DEC submit_job_gcm_dec_avx2 #define SUBMIT_JOB_AES_GCM_ENC submit_job_gcm_enc_avx2 @@ -440,49 +440,49 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_fma_avx2; #endif - state->gcm128_enc = aes_gcm_enc_128_avx_gen4; - state->gcm192_enc = aes_gcm_enc_192_avx_gen4; - state->gcm256_enc = aes_gcm_enc_256_avx_gen4; - state->gcm128_dec = aes_gcm_dec_128_avx_gen4; - state->gcm192_dec = aes_gcm_dec_192_avx_gen4; - state->gcm256_dec = aes_gcm_dec_256_avx_gen4; - state->gcm128_init = aes_gcm_init_128_avx_gen4; - state->gcm192_init = aes_gcm_init_192_avx_gen4; - state->gcm256_init = aes_gcm_init_256_avx_gen4; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; - state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; - state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; - state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; - state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; - state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; - state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; - state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx_gen4; - state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx_gen4; - state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx_gen4; - state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx_gen4; - state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx_gen4; - state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx_gen4; - state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; - state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; - state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; - state->gcm128_pre = aes_gcm_pre_128_avx_gen4; - state->gcm192_pre = aes_gcm_pre_192_avx_gen4; - state->gcm256_pre = aes_gcm_pre_256_avx_gen4; - - state->ghash = ghash_avx_gen4; - state->ghash_pre = ghash_pre_avx_gen4; - - state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; - state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; - state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; - state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; - state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; - state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; - state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; - state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; - state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; + state->gcm128_enc = aes_gcm_enc_128_vaes_avx2; + state->gcm192_enc = aes_gcm_enc_192_vaes_avx2; + state->gcm256_enc = aes_gcm_enc_256_vaes_avx2; + state->gcm128_dec = aes_gcm_dec_128_vaes_avx2; + state->gcm192_dec = aes_gcm_dec_192_vaes_avx2; + state->gcm256_dec = aes_gcm_dec_256_vaes_avx2; + state->gcm128_init = aes_gcm_init_128_vaes_avx2; + state->gcm192_init = aes_gcm_init_192_vaes_avx2; + state->gcm256_init = aes_gcm_init_256_vaes_avx2; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_vaes_avx2; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_vaes_avx2; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_vaes_avx2; + state->gcm128_enc_update = aes_gcm_enc_128_update_vaes_avx2; + state->gcm192_enc_update = aes_gcm_enc_192_update_vaes_avx2; + state->gcm256_enc_update = aes_gcm_enc_256_update_vaes_avx2; + state->gcm128_dec_update = aes_gcm_dec_128_update_vaes_avx2; + state->gcm192_dec_update = aes_gcm_dec_192_update_vaes_avx2; + state->gcm256_dec_update = aes_gcm_dec_256_update_vaes_avx2; + state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_vaes_avx2; + state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_vaes_avx2; + state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_vaes_avx2; + state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_vaes_avx2; + state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_vaes_avx2; + state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_vaes_avx2; + state->gcm128_precomp = aes_gcm_precomp_128_vaes_avx2; + state->gcm192_precomp = aes_gcm_precomp_192_vaes_avx2; + state->gcm256_precomp = aes_gcm_precomp_256_vaes_avx2; + state->gcm128_pre = aes_gcm_pre_128_vaes_avx2; + state->gcm192_pre = aes_gcm_pre_192_vaes_avx2; + state->gcm256_pre = aes_gcm_pre_256_vaes_avx2; + + state->ghash = ghash_vaes_avx2; + state->ghash_pre = ghash_pre_vaes_avx2; + + state->gmac128_init = imb_aes_gmac_init_128_vaes_avx2; + state->gmac192_init = imb_aes_gmac_init_192_vaes_avx2; + state->gmac256_init = imb_aes_gmac_init_256_vaes_avx2; + state->gmac128_update = imb_aes_gmac_update_128_vaes_avx2; + state->gmac192_update = imb_aes_gmac_update_192_vaes_avx2; + state->gmac256_update = imb_aes_gmac_update_256_vaes_avx2; + state->gmac128_finalize = imb_aes_gmac_finalize_128_vaes_avx2; + state->gmac192_finalize = imb_aes_gmac_finalize_192_vaes_avx2; + state->gmac256_finalize = imb_aes_gmac_finalize_256_vaes_avx2; state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; diff --git a/lib/include/aes_common.inc b/lib/include/aes_common.inc index 0d0279ad..3552b23b 100644 --- a/lib/include/aes_common.inc +++ b/lib/include/aes_common.inc @@ -29,6 +29,7 @@ %define _AES_COMMON_INC_ %include "include/reg_sizes.inc" +%include "include/memcpy.inc" ;; ============================================================================= ;; Generic macro to produce code that executes %%OPCODE instruction @@ -275,6 +276,109 @@ %endmacro +;; ============================================================================= +;; Loads specified number of AES blocks into YMM registers using mask register +;; for the last loaded register (xmm or ymm). +;; Loads take place at 1 byte granularity. +%macro YMM_LOAD_MASKED_BLOCKS_0_16 12 +%define %%NUM_BLOCKS %1 ; [in] numerical value, number of AES blocks (0 to 16) +%define %%INP %2 ; [in] input data pointer to read from +%define %%DATA_OFFSET %3 ; [in] offset to the output pointer (GP or numerical) +%define %%DST0 %4 ; [out] YMM register with loaded data +%define %%DST1 %5 ; [out] YMM register with loaded data +%define %%DST2 %6 ; [out] YMM register with loaded data +%define %%DST3 %7 ; [out] YMM register with loaded data +%define %%DST4 %8 ; [out] YMM register with loaded data +%define %%DST5 %9 ; [out] YMM register with loaded data +%define %%DST6 %10 ; [out] YMM register with loaded data +%define %%DST7 %11 ; [out] YMM register with loaded data +%define %%MASK %12 ; [in] mask register + +%assign _src_offset 0 +%assign _dst_idx 0 +%assign _blocks_left %%NUM_BLOCKS + +%if %%NUM_BLOCKS > 0 +%rep (((%%NUM_BLOCKS + 1) / 2) - 1) +%xdefine %%DSTREG %%DST %+ _dst_idx + vmovdqu8 %%DSTREG, [%%INP + %%DATA_OFFSET + _src_offset] +%undef %%DSTREG +%assign _src_offset (_src_offset + 32) +%assign _dst_idx (_dst_idx + 1) +%assign _blocks_left (_blocks_left - 2) +%endrep +%endif ; %if %%NUM_BLOCKS > 0 + +%xdefine %%DSTREG %%DST %+ _dst_idx + +%if _blocks_left == 1 + vmovdqu8 XWORD(%%DSTREG){%%MASK}{z}, [%%INP + %%DATA_OFFSET + _src_offset] +%elif _blocks_left == 2 + vmovdqu8 %%DSTREG{%%MASK}{z}, [%%INP + %%DATA_OFFSET + _src_offset] +%endif + +%endmacro + +;; ============================================================================= +;; Loads specified number of AES blocks into YMM registers without using mask +;; register for the last loaded register (xmm or ymm). +;; Loads take place at 1 byte granularity. +%macro YMM_LOAD_BLOCKS_PARTIAL_0_16 12 +%define %%NUM_BLOCKS %1 ; [in] numerical value, number of AES blocks (0 to 16) +%define %%INP %2 ; [in] input data pointer to read from +%define %%DATA_OFFSET %3 ; [in] offset to the output pointer (GP or numerical) +%define %%DST0 %4 ; [out] YMM register with loaded data +%define %%DST1 %5 ; [out] YMM register with loaded data +%define %%DST2 %6 ; [out] YMM register with loaded data +%define %%DST3 %7 ; [out] YMM register with loaded data +%define %%DST4 %8 ; [out] YMM register with loaded data +%define %%DST5 %9 ; [out] YMM register with loaded data +%define %%DST6 %10 ; [out] YMM register with loaded data +%define %%DST7 %11 ; [out] YMM register with loaded data +%define %%LENGTH %12 ; [in/clobbered] GP register + +%assign _src_offset 0 +%assign _dst_idx 0 +%assign _blocks_left %%NUM_BLOCKS +%assign _blocks_loaded 0 + +%if %%NUM_BLOCKS > 0 +%rep (((%%NUM_BLOCKS + 1) / 2) - 1) +%xdefine %%DSTREG %%DST %+ _dst_idx + vmovdqu %%DSTREG, [%%INP + %%DATA_OFFSET + _src_offset] +%undef %%DSTREG +%assign _src_offset (_src_offset + 32) +%assign _dst_idx (_dst_idx + 1) +%assign _blocks_left (_blocks_left - 2) +%assign _blocks_loaded (_blocks_loaded + 2) +%endrep +%endif ; %if %%NUM_BLOCKS > 0 + +%xdefine %%DSTREG %%DST %+ _dst_idx + + sub %%LENGTH, _blocks_loaded * 16 + cmp %%LENGTH, 32 + jb %%_load_less_than_32 + vmovdqu %%DSTREG, [%%INP + %%DATA_OFFSET + _src_offset] + jmp %%_load_done +%%_load_less_than_32: + cmp %%LENGTH, 16 + je %%_load_16 + jb %%_load_less_than_16 + sub %%LENGTH, 16 + simd_load_avx_15_1 XWORD(%%DSTREG), {%%INP + %%DATA_OFFSET + _src_offset + 16}, %%LENGTH + vinserti128 %%DSTREG, %%DSTREG, XWORD(%%DSTREG), 1 + vinserti128 %%DSTREG, %%DSTREG, [%%INP + %%DATA_OFFSET + _src_offset], 0 + jmp %%_load_done +%%_load_16: + vmovdqu XWORD(%%DSTREG), [%%INP + %%DATA_OFFSET + _src_offset] + jmp %%_load_done +%%_load_less_than_16: + simd_load_avx_15_1 XWORD(%%DSTREG), {%%INP + %%DATA_OFFSET + _src_offset}, %%LENGTH +%%_load_done: + +%endmacro + ;; ============================================================================= ;; Stores specified number of AES blocks from ZMM registers %macro ZMM_STORE_BLOCKS_0_16 7 diff --git a/lib/include/gcm.h b/lib/include/gcm.h index 27bfad51..a85dba2c 100644 --- a/lib/include/gcm.h +++ b/lib/include/gcm.h @@ -37,47 +37,47 @@ */ IMB_DLL_EXPORT void aes_gcm_enc_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_init_128_vaes_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len); + const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_192_vaes_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len); + const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_256_vaes_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len); + const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_vaes_avx512(const struct gcm_key_data *key_data, @@ -157,6 +157,133 @@ aes_gcm_pre_192_vaes_avx512(const void *key, struct gcm_key_data *key_data); IMB_DLL_EXPORT void aes_gcm_pre_256_vaes_avx512(const void *key, struct gcm_key_data *key_data); +/* + * AVX2+VAES+VPCLMULQDQ GCM API + * - intentionally this is not exposed in ipsec-mb.h + * - available through IMB_GCM_xxx() macros from ipsec-mb.h + */ +IMB_DLL_EXPORT void +aes_gcm_enc_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, + uint8_t *auth_tag, uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_enc_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, + uint8_t *auth_tag, uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_enc_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, + uint8_t *auth_tag, uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, + uint8_t *auth_tag, uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, + uint8_t *auth_tag, uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, + uint8_t *auth_tag, uint64_t auth_tag_len); + +IMB_DLL_EXPORT void +aes_gcm_init_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len); +IMB_DLL_EXPORT void +aes_gcm_init_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len); +IMB_DLL_EXPORT void +aes_gcm_init_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len); + +IMB_DLL_EXPORT void +aes_gcm_init_var_iv_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, + const uint64_t aad_len); +IMB_DLL_EXPORT void +aes_gcm_init_var_iv_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, + const uint64_t aad_len); +IMB_DLL_EXPORT void +aes_gcm_init_var_iv_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len, const uint8_t *aad, + const uint64_t aad_len); + +IMB_DLL_EXPORT void +aes_gcm_enc_128_update_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); +IMB_DLL_EXPORT void +aes_gcm_enc_192_update_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); +IMB_DLL_EXPORT void +aes_gcm_enc_256_update_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); +IMB_DLL_EXPORT void +aes_gcm_dec_128_update_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); +IMB_DLL_EXPORT void +aes_gcm_dec_192_update_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); +IMB_DLL_EXPORT void +aes_gcm_dec_256_update_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *out, + const uint8_t *in, uint64_t msg_len); +IMB_DLL_EXPORT void +aes_gcm_enc_128_finalize_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_enc_192_finalize_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_enc_256_finalize_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_128_finalize_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_192_finalize_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_dec_256_finalize_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + uint64_t auth_tag_len); +IMB_DLL_EXPORT void +aes_gcm_precomp_128_vaes_avx2(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_192_vaes_avx2(struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_precomp_256_vaes_avx2(struct gcm_key_data *key_data); + +IMB_DLL_EXPORT void +aes_gcm_pre_128_vaes_avx2(const void *key, struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_192_vaes_avx2(const void *key, struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +aes_gcm_pre_256_vaes_avx2(const void *key, struct gcm_key_data *key_data); + /* * AVX512 GCM API * - intentionally this is not exposed in ipsec-mb.h @@ -164,44 +291,44 @@ aes_gcm_pre_256_vaes_avx512(const void *key, struct gcm_key_data *key_data); */ IMB_DLL_EXPORT void aes_gcm_enc_128_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint8_t *out, const uint8_t *in, uint64_t msg_len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint8_t *out, const uint8_t *in, uint64_t msg_len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint8_t *out, const uint8_t *in, uint64_t msg_len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint8_t *out, const uint8_t *in, uint64_t msg_len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint8_t *out, const uint8_t *in, uint64_t msg_len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - uint8_t *out, uint8_t const *in, uint64_t msg_len, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len, uint8_t *auth_tag, + uint8_t *out, const uint8_t *in, uint64_t msg_len, const uint8_t *iv, + const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_init_128_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); + const uint8_t *iv, const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_192_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); + const uint8_t *iv, const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_256_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, - const uint8_t *iv, uint8_t const *aad, uint64_t aad_len); + const uint8_t *iv, const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_avx512(const struct gcm_key_data *key_data, @@ -285,46 +412,46 @@ aes_gcm_pre_256_avx512(const void *key, struct gcm_key_data *key_data); #ifdef AESNI_EMU IMB_DLL_EXPORT void aes_gcm_enc_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_enc_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_dec_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *out, uint8_t const *in, - uint64_t msg_len, const uint8_t *iv, uint8_t const *aad, + struct gcm_context_data *context_data, uint8_t *out, const uint8_t *in, + uint64_t msg_len, const uint8_t *iv, const uint8_t *aad, uint64_t aad_len, uint8_t *auth_tag, uint64_t auth_tag_len); IMB_DLL_EXPORT void aes_gcm_init_128_sse_no_aesni(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len); + const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_192_sse_no_aesni(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len); + const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_256_sse_no_aesni(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, - uint8_t const *aad, uint64_t aad_len); + const uint8_t *aad, uint64_t aad_len); IMB_DLL_EXPORT void aes_gcm_init_var_iv_128_sse_no_aesni(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, @@ -521,6 +648,20 @@ aes_gcm_dec_var_iv_192_sse_no_aesni(IMB_MGR *state, IMB_JOB *job); IMB_DLL_LOCAL IMB_JOB * aes_gcm_dec_var_iv_256_sse_no_aesni(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_LOCAL IMB_JOB * +aes_gcm_enc_var_iv_128_vaes_avx2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_LOCAL IMB_JOB * +aes_gcm_enc_var_iv_192_vaes_avx2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_LOCAL IMB_JOB * +aes_gcm_enc_var_iv_256_vaes_avx2(IMB_MGR *state, IMB_JOB *job); + +IMB_DLL_LOCAL IMB_JOB * +aes_gcm_dec_var_iv_128_vaes_avx2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_LOCAL IMB_JOB * +aes_gcm_dec_var_iv_192_vaes_avx2(IMB_MGR *state, IMB_JOB *job); +IMB_DLL_LOCAL IMB_JOB * +aes_gcm_dec_var_iv_256_vaes_avx2(IMB_MGR *state, IMB_JOB *job); + /* * GHASH API for SSE/AVX/AVX2/AVX512/AESNI emulation */ @@ -543,6 +684,9 @@ ghash_avx512(const struct gcm_key_data *key_data, const void *in, const uint64_t IMB_DLL_EXPORT void ghash_vaes_avx512(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, void *io_tag, const uint64_t tag_len); +IMB_DLL_EXPORT void +ghash_vaes_avx2(const struct gcm_key_data *key_data, const void *in, const uint64_t in_len, + void *io_tag, const uint64_t tag_len); IMB_DLL_EXPORT void ghash_pre_sse_no_aesni(const void *key, struct gcm_key_data *key_data); @@ -562,8 +706,11 @@ ghash_pre_avx512(const void *key, struct gcm_key_data *key_data); IMB_DLL_EXPORT void ghash_pre_vaes_avx512(const void *key, struct gcm_key_data *key_data); +IMB_DLL_EXPORT void +ghash_pre_vaes_avx2(const void *key, struct gcm_key_data *key_data); + /* - * GMAC API for SSE/AVX/AVX2/AVX512/AESNI emulation + * GMAC API for SSE */ IMB_DLL_EXPORT void imb_aes_gmac_init_128_sse(const struct gcm_key_data *key_data, @@ -579,6 +726,34 @@ imb_aes_gmac_init_256_sse(const struct gcm_key_data *key_data, const uint64_t iv_len); IMB_DLL_EXPORT void +imb_aes_gmac_update_128_sse(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); +IMB_DLL_EXPORT void +imb_aes_gmac_update_192_sse(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); +IMB_DLL_EXPORT void +imb_aes_gmac_update_256_sse(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); + +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_128_sse(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_192_sse(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_256_sse(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +/* + * GMAC API for AVX + */ +IMB_DLL_EXPORT void imb_aes_gmac_init_128_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len); @@ -590,7 +765,33 @@ IMB_DLL_EXPORT void imb_aes_gmac_init_256_avx_gen2(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len); - +IMB_DLL_EXPORT void +imb_aes_gmac_update_128_avx_gen2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); +IMB_DLL_EXPORT void +imb_aes_gmac_update_192_avx_gen2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); +IMB_DLL_EXPORT void +imb_aes_gmac_update_256_avx_gen2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_128_avx_gen2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_192_avx_gen2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_256_avx_gen2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +/* + * GMAC API for AVX2 + */ IMB_DLL_EXPORT void imb_aes_gmac_init_128_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, @@ -603,72 +804,18 @@ IMB_DLL_EXPORT void imb_aes_gmac_init_256_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, const uint64_t iv_len); - -IMB_DLL_EXPORT void -imb_aes_gmac_init_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); -IMB_DLL_EXPORT void -imb_aes_gmac_init_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); -IMB_DLL_EXPORT void -imb_aes_gmac_init_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); - -IMB_DLL_EXPORT void -imb_aes_gmac_init_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); -IMB_DLL_EXPORT void -imb_aes_gmac_init_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); -IMB_DLL_EXPORT void -imb_aes_gmac_init_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); - -IMB_DLL_EXPORT void -imb_aes_gmac_init_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); -IMB_DLL_EXPORT void -imb_aes_gmac_init_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); -IMB_DLL_EXPORT void -imb_aes_gmac_init_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *iv, - const uint64_t iv_len); - -IMB_DLL_EXPORT void -imb_aes_gmac_update_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); -IMB_DLL_EXPORT void -imb_aes_gmac_update_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); -IMB_DLL_EXPORT void -imb_aes_gmac_update_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); - IMB_DLL_EXPORT void -imb_aes_gmac_update_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); +imb_aes_gmac_finalize_128_avx_gen4(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void -imb_aes_gmac_update_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); +imb_aes_gmac_finalize_192_avx_gen4(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void -imb_aes_gmac_update_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); - +imb_aes_gmac_finalize_256_avx_gen4(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *in, @@ -681,7 +828,21 @@ IMB_DLL_EXPORT void imb_aes_gmac_update_256_avx_gen4(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *in, const uint64_t in_len); - +/* + * GMAC API for AVX512 + */ +IMB_DLL_EXPORT void +imb_aes_gmac_init_128_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); +IMB_DLL_EXPORT void +imb_aes_gmac_init_192_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); +IMB_DLL_EXPORT void +imb_aes_gmac_init_256_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *in, @@ -694,7 +855,33 @@ IMB_DLL_EXPORT void imb_aes_gmac_update_256_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *in, const uint64_t in_len); - +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_128_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_192_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +IMB_DLL_EXPORT void +imb_aes_gmac_finalize_256_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +/* + * GMAC API for AVX512+VAES+VCLMUL + */ +IMB_DLL_EXPORT void +imb_aes_gmac_init_128_vaes_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); +IMB_DLL_EXPORT void +imb_aes_gmac_init_192_vaes_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); +IMB_DLL_EXPORT void +imb_aes_gmac_init_256_vaes_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void imb_aes_gmac_update_128_vaes_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *in, @@ -707,85 +894,85 @@ IMB_DLL_EXPORT void imb_aes_gmac_update_256_vaes_avx512(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *in, const uint64_t in_len); - IMB_DLL_EXPORT void -imb_aes_gmac_update_128_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); +imb_aes_gmac_finalize_128_vaes_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void -imb_aes_gmac_update_192_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); +imb_aes_gmac_finalize_192_vaes_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void -imb_aes_gmac_update_256_sse_no_aesni(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, const uint8_t *in, - const uint64_t in_len); - +imb_aes_gmac_finalize_256_vaes_avx512(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +/* + * GMAC API for AVX2+VAES+VCLMUL + */ IMB_DLL_EXPORT void -imb_aes_gmac_finalize_128_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_init_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_192_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_init_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_256_sse(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); - +imb_aes_gmac_init_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_128_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_update_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_192_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_update_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_256_avx_gen2(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); - +imb_aes_gmac_update_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_128_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_finalize_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_192_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_finalize_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_256_avx_gen4(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_finalize_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len); +/* + * GMAC API for AESNI emulation + */ IMB_DLL_EXPORT void -imb_aes_gmac_finalize_128_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_init_128_sse_no_aesni(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_192_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_init_192_sse_no_aesni(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_256_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); - +imb_aes_gmac_init_256_sse_no_aesni(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_128_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_update_128_sse_no_aesni(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_192_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); +imb_aes_gmac_update_192_sse_no_aesni(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void -imb_aes_gmac_finalize_256_vaes_avx512(const struct gcm_key_data *key_data, - struct gcm_context_data *context_data, uint8_t *auth_tag, - const uint64_t auth_tag_len); - +imb_aes_gmac_update_256_sse_no_aesni(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *in, + const uint64_t in_len); IMB_DLL_EXPORT void imb_aes_gmac_finalize_128_sse_no_aesni(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, uint8_t *auth_tag, diff --git a/lib/include/gcm_defines.inc b/lib/include/gcm_defines.inc index bc405ebc..14815a57 100644 --- a/lib/include/gcm_defines.inc +++ b/lib/include/gcm_defines.inc @@ -73,6 +73,16 @@ ALL_F: ZERO: dq 0x0000000000000000, 0x0000000000000000 +align 32 +ONE_TWO: + dq 0x0000000000000001, 0x0000000000000000 + dq 0x0000000000000002, 0x0000000000000000 + +align 32 +TWO_TWO: + dq 0x0000000000000002, 0x0000000000000000 + dq 0x0000000000000002, 0x0000000000000000 + align 16 ONE: dq 0x0000000000000001, 0x0000000000000000 @@ -89,6 +99,16 @@ align 16 TWOf: dq 0x0000000000000000, 0x0200000000000000 +align 32 +ONE_TWOf: + dq 0x0000000000000000, 0x0100000000000000 + dq 0x0000000000000000, 0x0200000000000000 + +align 32 +TWO_TWOf: + dq 0x0000000000000000, 0x0200000000000000 + dq 0x0000000000000000, 0x0200000000000000 + align 64 ddq_add_1234: dq 0x0000000000000001, 0x0000000000000000 diff --git a/lib/include/gcm_keys_vaes_avx2.inc b/lib/include/gcm_keys_vaes_avx2.inc new file mode 100644 index 00000000..6b162fdc --- /dev/null +++ b/lib/include/gcm_keys_vaes_avx2.inc @@ -0,0 +1,50 @@ +;; +;; Copyright (c) 2019-2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +%ifndef GCM_KEYS_AVX2_VAES_INCLUDED +%define GCM_KEYS_AVX2_VAES_INCLUDED + +;; First 15 128-bit words are reserved for AES round keys +%define HashKey_16 (16*15) ; HashKey^16 <<1 mod poly +%define HashKey_15 (16*16) ; HashKey^15 <<1 mod poly +%define HashKey_14 (16*17) ; HashKey^14 <<1 mod poly +%define HashKey_13 (16*18) ; HashKey^13 <<1 mod poly +%define HashKey_12 (16*19) ; HashKey^12 <<1 mod poly +%define HashKey_11 (16*20) ; HashKey^11 <<1 mod poly +%define HashKey_10 (16*21) ; HashKey^10 <<1 mod poly +%define HashKey_9 (16*22) ; HashKey^9 <<1 mod poly +%define HashKey_8 (16*23) ; HashKey^8 <<1 mod poly +%define HashKey_7 (16*24) ; HashKey^7 <<1 mod poly +%define HashKey_6 (16*25) ; HashKey^6 <<1 mod poly +%define HashKey_5 (16*26) ; HashKey^5 <<1 mod poly +%define HashKey_4 (16*27) ; HashKey^4 <<1 mod poly +%define HashKey_3 (16*28) ; HashKey^3 <<1 mod poly +%define HashKey_2 (16*29) ; HashKey^2 <<1 mod poly +%define HashKey_1 (16*30) ; HashKey <<1 mod poly +%define HashKey (16*30) ; HashKey <<1 mod poly + +%endif ; GCM_KEYS_AVX2_VAES_INCLUDED diff --git a/lib/include/gcm_vaes_avx2.inc b/lib/include/gcm_vaes_avx2.inc new file mode 100644 index 00000000..63711c9b --- /dev/null +++ b/lib/include/gcm_vaes_avx2.inc @@ -0,0 +1,5106 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright(c) 2011-2023, Intel Corporation All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in +; the documentation and/or other materials provided with the +; distribution. +; * Neither the name of Intel Corporation nor the names of its +; contributors may be used to endorse or promote products derived +; from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; +; Authors: +; Erdinc Ozturk +; Vinodh Gopal +; James Guilford +; Tomasz Kantecki +; +; +; References: +; This code was derived and highly optimized from the code described in paper: +; Vinodh Gopal et. al. Optimized Galois-Counter-Mode Implementation on Intel Architecture Processors. August, 2010 +; The details of the implementation is explained in: +; Erdinc Ozturk et. al. Enabling High-Performance Galois-Counter-Mode on Intel Architecture Processors. October, 2012. +; +; +; +; +; Assumptions: +; +; +; +; iv: +; 0 1 2 3 +; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | Salt (From the SA) | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | Initialization Vector | +; | (This is the sequence number from IPSec header) | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | 0x1 | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; +; +; +; AAD: +; AAD will be padded with 0 to the next 16byte multiple +; for example, assume AAD is a u32 vector +; +; if AAD is 8 bytes: +; AAD[3] = {A0, A1}; +; padded AAD in xmm register = {A1 A0 0 0} +; +; 0 1 2 3 +; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | SPI (A1) | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | 32-bit Sequence Number (A0) | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | 0x0 | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; +; AAD Format with 32-bit Sequence Number +; +; if AAD is 12 bytes: +; AAD[3] = {A0, A1, A2}; +; padded AAD in xmm register = {A2 A1 A0 0} +; +; 0 1 2 3 +; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | SPI (A2) | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | 64-bit Extended Sequence Number {A1,A0} | +; | | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; | 0x0 | +; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +; +; AAD Format with 64-bit Extended Sequence Number +; +; +; aadLen: +; Must be a multiple of 4 bytes and from the definition of the spec. +; The code additionally supports any aadLen length. +; +; TLen (tag length): +; from the definition of the spec, TLen can only be 8, 12 or 16 bytes. +; The code additionally supports any tag length. +; +; poly = x^128 + x^127 + x^126 + x^121 + 1 +; throughout the code, one tab and two tab indentations are used. one tab is for GHASH part, two tabs is for AES part. +; + +%include "include/os.inc" +%include "include/reg_sizes.inc" +%include "include/clear_regs.inc" +%include "include/gcm_defines.inc" +%include "include/gcm_keys_vaes_avx2.inc" +%include "include/gcm_common.inc" +%include "include/memcpy.inc" +%include "include/cet.inc" +%include "include/error.inc" +%include "include/imb_job.inc" + +%ifndef GCM128_MODE +%ifndef GCM192_MODE +%ifndef GCM256_MODE +%error "No GCM mode selected for gcm_vaes_avx2.inc!" +%endif +%endif +%endif + +;; Decide on AES-GCM key size to compile for +%ifdef GCM128_MODE +%define NROUNDS 9 +%define FN_NAME(x,y) aes_gcm_ %+ x %+ _128 %+ y %+ vaes_avx2 +%define GMAC_FN_NAME(x) imb_aes_gmac_ %+ x %+ _128_ %+ vaes_avx2 +%endif + +%ifdef GCM192_MODE +%define NROUNDS 11 +%define FN_NAME(x,y) aes_gcm_ %+ x %+ _192 %+ y %+ vaes_avx2 +%define GMAC_FN_NAME(x) imb_aes_gmac_ %+ x %+ _192_ %+ vaes_avx2 +%endif + +%ifdef GCM256_MODE +%define NROUNDS 13 +%define FN_NAME(x,y) aes_gcm_ %+ x %+ _256 %+ y %+ vaes_avx2 +%define GMAC_FN_NAME(x) imb_aes_gmac_ %+ x %+ _256_ %+ vaes_avx2 +%endif + +mksection .text +default rel + +%define TMP1 16*0 ; Temporary storage for AES State 1 +%define TMP2 16*1 ; Temporary storage for AES State 2 +%define TMP3 16*2 ; Temporary storage for AES State 3 +%define TMP4 16*3 ; Temporary storage for AES State 4 +%define TMP5 16*4 ; Temporary storage for AES State 5 +%define TMP6 16*5 ; Temporary storage for AES State 6 +%define TMP7 16*6 ; Temporary storage for AES State 7 +%define TMP8 16*7 ; Temporary storage for AES State 8 +%define TMP9 16*8 ; Temporary storage for AES State 9 +%define TMP10 16*9 ; Temporary storage for AES State 10 +%define TMP11 16*10 ; Temporary storage for AES State 11 +%define TMP12 16*11 ; Temporary storage for AES State 12 +%define TMP13 16*12 ; Temporary storage for AES State 13 +%define TMP14 16*13 ; Temporary storage for AES State 14 +%define TMP15 16*14 ; Temporary storage for AES State 15 +%define TMP16 16*15 ; Temporary storage for AES State 16 + +; need to store 5 GP registers on stack (align to 16 bytes) +%define GP_STORAGE 8*6 + +%define LOCAL_STORAGE 16*16 + +%ifidn __OUTPUT_FORMAT__, win64 + %define XMM_STORAGE 16*10 +%else + %define XMM_STORAGE 0 +%endif + +%define GP_OFFSET (LOCAL_STORAGE + XMM_STORAGE) + +%define VARIABLE_OFFSET (GP_STORAGE + LOCAL_STORAGE + XMM_STORAGE) + +;; extra memory for GCM context structure +%define CONTEXT_SIZE 6*16 +%define CONTEXT_OFFSET VARIABLE_OFFSET + +;; Full stack frame layout: +;; RETURN ADDRESS + ARGS +;; R14 = + 16*6 -> --------------------------- +;; GCM CONTEXT (JOB API only) +;; + 6*8 -> --------------------------- +;; GP STORAGE +;; + 16*10 -> -------------------------- +;; XMM STORAGE (windows only) +;; + 16*7 -> -------------------------- +;; LOCAL STORAGE +;; RSP = -> -------------------------- + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Utility Macros +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0) +; Input: A and B (128-bits each, bit-reflected) +; Output: C = A*B*x mod poly, (i.e. >>1 ) +; To compute GH = GH*HashKey mod poly, give HK = HashKey<<1 mod poly as input +; GH = GH * HK * x mod poly which is equivalent to GH*HashKey mod poly. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro GHASH_MUL 7 +%define %%GH %1 ; 16 Bytes +%define %%HK %2 ; 16 Bytes +%define %%T1 %3 +%define %%T2 %4 +%define %%T3 %5 +%define %%T4 %6 +%define %%T5 %7 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vpclmulqdq %%T1, %%GH, %%HK, 0x11 ; %%T1 = a1*b1 + vpclmulqdq %%T2, %%GH, %%HK, 0x00 ; %%T2 = a0*b0 + vpclmulqdq %%T3, %%GH, %%HK, 0x01 ; %%T3 = a1*b0 + vpclmulqdq %%GH, %%GH, %%HK, 0x10 ; %%GH = a0*b1 + vpxor %%GH, %%GH, %%T3 + + vpsrldq %%T3, %%GH, 8 ; shift-R %%GH 2 DWs + vpslldq %%GH, %%GH, 8 ; shift-L %%GH 2 DWs + + vpxor %%T1, %%T1, %%T3 + vpxor %%GH, %%GH, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;first phase of the reduction + vmovdqa %%T3, [rel POLY2] + + vpclmulqdq %%T2, %%T3, %%GH, 0x01 + vpslldq %%T2, %%T2, 8 ; shift-L %%T2 2 DWs + + vpxor %%GH, %%GH, %%T2 ; first phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;second phase of the reduction + vpclmulqdq %%T2, %%T3, %%GH, 0x00 + vpsrldq %%T2, %%T2, 4 ; shift-R %%T2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + + vpclmulqdq %%GH, %%T3, %%GH, 0x10 + vpslldq %%GH, %%GH, 4 ; shift-L %%GH 1 DW (Shift-L 1-DW to obtain result with no shifts) + + vpxor %%GH, %%GH, %%T2 ; second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%GH, %%GH, %%T1 ; the result is in %%GH + +%endmacro + +%macro PRECOMPUTE 8 +%define %%GDATA %1 ;; [in/out] pointer to GCM key data structure +%define %%HK %2 ;; [in] Hash Key +%define %%T1 %3 ;; [clobbered] temporary XMM register +%define %%T2 %4 ;; [clobbered] temporary XMM register +%define %%T3 %5 ;; [clobbered] temporary XMM register +%define %%T4 %6 ;; [clobbered] temporary XMM register +%define %%T5 %7 ;; [clobbered] temporary XMM register +%define %%T6 %8 ;; [clobbered] temporary XMM register + + vmovdqa %%T5, %%HK + + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^2<<1 mod poly + vmovdqu [%%GDATA + HashKey_2], %%T5 ; [HashKey_2] = HashKey^2<<1 mod poly + + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^3<<1 mod poly + vmovdqu [%%GDATA + HashKey_3], %%T5 + + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^4<<1 mod poly + vmovdqu [%%GDATA + HashKey_4], %%T5 + + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^5<<1 mod poly + vmovdqu [%%GDATA + HashKey_5], %%T5 + + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^6<<1 mod poly + vmovdqu [%%GDATA + HashKey_6], %%T5 + + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^7<<1 mod poly + vmovdqu [%%GDATA + HashKey_7], %%T5 + + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^8<<1 mod poly + vmovdqu [%%GDATA + HashKey_8], %%T5 + +%assign i 9 +%rep 8 + GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^i<<1 mod poly + vmovdqu [%%GDATA + HashKey_ %+ i], %%T5 +%assign i (i + 1) +%endrep + +%endmacro + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CALC_AAD_HASH: Calculates the hash of the data which will not be encrypted. +; Input: The input data (A_IN), that data's length (A_LEN), and the hash key (HASH_KEY). +; Output: The hash of the data (AAD_HASH). +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro CALC_AAD_HASH 15 +%define %%A_IN %1 ;; [in] message pointer +%define %%A_LEN %2 ;; [in] message length +%define %%AAD_HASH %3 ;; [in] input hash value (XMM) +%define %%GDATA_KEY %4 ;; [in] pointer to GCM key data +%define %%XTMP0 %5 ;; [clobbered] temporary XMM +%define %%XTMP1 %6 ;; [clobbered] temporary XMM +%define %%XTMP2 %7 ;; [clobbered] temporary XMM +%define %%XTMP3 %8 ;; [clobbered] temporary XMM +%define %%XTMP4 %9 ;; [clobbered] temporary XMM +%define %%XTMP5 %10 ;; [clobbered] temporary XMM +%define %%T1 %11 ;; [clobbered] temporary GP register +%define %%T2 %12 ;; [clobbered] temporary GP register +%define %%T3 %13 ;; [clobbered] temporary GP register +%define %%T4 %14 ;; [clobbered] temporary GP register +%define %%T5 %15 ;; [clobbered] temporary GP register + +%xdefine %%YTMP0 YWORD(%%XTMP0) +%xdefine %%YTMP1 YWORD(%%XTMP1) +%xdefine %%YTMP2 YWORD(%%XTMP2) +%xdefine %%YTMP3 YWORD(%%XTMP3) +%xdefine %%YTMP4 YWORD(%%XTMP4) +%xdefine %%YTMP5 YWORD(%%XTMP5) + + mov %%T1, %%A_IN ; T1 = AAD + mov %%T2, %%A_LEN ; T2 = aadLen +align 32 +%%_get_AAD_loop256: + cmp %%T2, 256 + jb %%_exit_AAD_loop256 + + vmovdqu %%YTMP0, [%%T1 + 16*0] + vpshufb %%YTMP0, %%YTMP0, [rel SHUF_MASK] + + vpxor %%YTMP0, %%YTMP0, YWORD(%%AAD_HASH) + + vmovdqu %%YTMP5, [%%GDATA_KEY + HashKey_16] + vpclmulqdq %%YTMP1, %%YTMP0, %%YTMP5, 0x11 ; %%T1 = a1*b1 + vpclmulqdq %%YTMP2, %%YTMP0, %%YTMP5, 0x00 ; %%T2 = a0*b0 + vpclmulqdq %%YTMP3, %%YTMP0, %%YTMP5, 0x01 ; %%T3 = a1*b0 + vpclmulqdq %%YTMP4, %%YTMP0, %%YTMP5, 0x10 ; %%T4 = a0*b1 + vpxor %%YTMP3, %%YTMP3, %%YTMP4 ; %%T3 = a1*b0 + a0*b1 + +%assign i 2 +%assign j 14 +%rep 7 + vmovdqu %%YTMP0, [%%T1 + 16*i] + vpshufb %%YTMP0, %%YTMP0, [rel SHUF_MASK] + + vmovdqu %%YTMP5, [%%GDATA_KEY + HashKey_ %+ j] + vpclmulqdq %%YTMP4, %%YTMP0, %%YTMP5, 0x11 ; %%T1 = T1 + a1*b1 + vpxor %%YTMP1, %%YTMP1, %%YTMP4 + + vpclmulqdq %%YTMP4, %%YTMP0, %%YTMP5, 0x00 ; %%T2 = T2 + a0*b0 + vpxor %%YTMP2, %%YTMP2, %%YTMP4 + + vpclmulqdq %%YTMP4, %%YTMP0, %%YTMP5, 0x01 ; %%T3 = T3 + a1*b0 + a0*b1 + vpxor %%YTMP3, %%YTMP3, %%YTMP4 + vpclmulqdq %%YTMP4, %%YTMP0, %%YTMP5, 0x10 + vpxor %%YTMP3, %%YTMP3, %%YTMP4 +%assign i (i + 2) +%assign j (j - 2) +%endrep + + vpslldq %%YTMP4, %%YTMP3, 8 ; shift-L 2 DWs + vpsrldq %%YTMP3, %%YTMP3, 8 ; shift-R 2 DWs + vpxor %%YTMP2, %%YTMP2, %%YTMP4 + vpxor %%YTMP1, %%YTMP1, %%YTMP3 ; accumulate the results in %%T1(M):%%T2(L) + + vextracti128 %%XTMP4, %%YTMP2, 1 + vextracti128 %%XTMP5, %%YTMP1, 1 + vpxor %%XTMP2, %%XTMP2, %%XTMP4 + vpxor %%XTMP1, %%XTMP1, %%XTMP5 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;first phase of the reduction + vmovdqa %%XTMP5, [rel POLY2] + vpclmulqdq %%XTMP0, %%XTMP5, %%XTMP2, 0x01 + vpslldq %%XTMP0, %%XTMP0, 8 ; shift-L xmm2 2 DWs + vpxor %%XTMP2, %%XTMP2, %%XTMP0 ; first phase of the reduction complete + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;second phase of the reduction + vpclmulqdq %%XTMP3, %%XTMP5, %%XTMP2, 0x00 + vpsrldq %%XTMP3, %%XTMP3, 4 ; shift-R 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + + vpclmulqdq %%XTMP4, %%XTMP5, %%XTMP2, 0x10 + vpslldq %%XTMP4, %%XTMP4, 4 ; shift-L 1 DW (Shift-L 1-DW to obtain result with no shifts) + + vpxor %%XTMP4, %%XTMP4, %%XTMP3 ; second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%AAD_HASH, %%XTMP1, %%XTMP4 ; the result is in %%T1 + + sub %%T2, 256 + je %%_CALC_AAD_done + + add %%T1, 256 + jmp %%_get_AAD_loop256 + +%%_exit_AAD_loop256: + + cmp %%T2, 16 + jb %%_get_small_AAD_block + + ;; calculate hash_key position to start with + mov %%T3, %%T2 + and %%T3, -16 ; 1 to 15 blocks possible here + neg %%T3 + add %%T3, HashKey_1 + 16 + lea %%T3, [%%GDATA_KEY + %%T3] + + vmovdqu %%XTMP0, [%%T1] + vpshufb %%XTMP0, %%XTMP0, [rel SHUF_MASK] + + vpxor %%XTMP0, %%XTMP0, %%AAD_HASH + + vmovdqu %%XTMP5, [%%T3] + vpclmulqdq %%XTMP1, %%XTMP0, %%XTMP5, 0x11 ; %%T1 = a1*b1 + vpclmulqdq %%XTMP2, %%XTMP0, %%XTMP5, 0x00 ; %%T2 = a0*b0 + vpclmulqdq %%XTMP3, %%XTMP0, %%XTMP5, 0x01 ; %%T3 = a1*b0 + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 ; %%T4 = a0*b1 + vpxor %%XTMP3, %%XTMP3, %%XTMP4 ; %%T3 = a1*b0 + a0*b1 + + add %%T3, 16 ; move to the next hashkey + add %%T1, 16 ; move to the next data block + sub %%T2, 16 ; decrement messege length + cmp %%T2, 16 + jb %%_AAD_reduce + +align 32 +%%_AAD_blocks: + vmovdqu %%XTMP0, [%%T1] + vpshufb %%XTMP0, %%XTMP0, [rel SHUF_MASK] + + vmovdqu %%XTMP5, [%%T3] + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x11 ; %%T1 = T1 + a1*b1 + vpxor %%XTMP1, %%XTMP1, %%XTMP4 + + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x00 ; %%T2 = T2 + a0*b0 + vpxor %%XTMP2, %%XTMP2, %%XTMP4 + + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x01 ; %%T3 = T3 + a1*b0 + a0*b1 + vpxor %%XTMP3, %%XTMP3, %%XTMP4 + vpclmulqdq %%XTMP4, %%XTMP0, %%XTMP5, 0x10 + vpxor %%XTMP3, %%XTMP3, %%XTMP4 + + add %%T3, 16 ; move to the next hashkey + add %%T1, 16 ; move to the next data block + sub %%T2, 16 ; decrement messege length + cmp %%T2, 16 + jae %%_AAD_blocks + +%%_AAD_reduce: + vpslldq %%XTMP4, %%XTMP3, 8 ; shift-L 2 DWs + vpsrldq %%XTMP3, %%XTMP3, 8 ; shift-R 2 DWs + vpxor %%XTMP2, %%XTMP2, %%XTMP4 + vpxor %%XTMP1, %%XTMP1, %%XTMP3 ; accumulate the results in %%T1(M):%%T2(L) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;first phase of the reduction + vmovdqa %%XTMP5, [rel POLY2] + vpclmulqdq %%XTMP0, %%XTMP5, %%XTMP2, 0x01 + vpslldq %%XTMP0, %%XTMP0, 8 ; shift-L xmm2 2 DWs + vpxor %%XTMP2, %%XTMP2, %%XTMP0 ; first phase of the reduction complete + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;second phase of the reduction + vpclmulqdq %%XTMP3, %%XTMP5, %%XTMP2, 0x00 + vpsrldq %%XTMP3, %%XTMP3, 4 ; shift-R 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + + vpclmulqdq %%XTMP4, %%XTMP5, %%XTMP2, 0x10 + vpslldq %%XTMP4, %%XTMP4, 4 ; shift-L 1 DW (Shift-L 1-DW to obtain result with no shifts) + + vpxor %%XTMP4, %%XTMP4, %%XTMP3 ; second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%AAD_HASH, %%XTMP1, %%XTMP4 ; the result is in %%T1 + +%%_get_small_AAD_block: + or %%T2, %%T2 + je %%_CALC_AAD_done + + vmovdqu %%XTMP0, [%%GDATA_KEY + HashKey] + READ_SMALL_DATA_INPUT_AVX %%XTMP1, %%T1, %%T2, %%T3 + ;byte-reflect the AAD data + vpshufb %%XTMP1, %%XTMP1, [rel SHUF_MASK] + vpxor %%AAD_HASH, %%AAD_HASH, %%XTMP1 + GHASH_MUL %%AAD_HASH, %%XTMP0, %%XTMP1, %%XTMP2, %%XTMP3, %%XTMP4, %%XTMP5 + +%%_CALC_AAD_done: + +%endmacro ; CALC_AAD_HASH + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; PARTIAL_BLOCK: Handles encryption/decryption and the tag partial blocks between update calls. +; Requires the input data be at least 1 byte long. +; Input: gcm_key_data * (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CIPH_IN), +; input text length (PLAIN_CIPH_LEN), the current data offset (DATA_OFFSET), +; the hash subkey (HASH_SUBKEY) and whether encoding or decoding (ENC_DEC) +; Output: A cipher of the first partial block (CIPH_PLAIN_OUT), and updated GDATA_CTX +; Clobbers rax, r10, r12, r13, r15, xmm0, xmm1, xmm2, xmm3, xmm5, xmm6, xmm9, xmm10, xmm11 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro PARTIAL_BLOCK 8 +%define %%GDATA_CTX %1 ;; [in/out] GP with pointer to GCM context structure; context gets updated +%define %%CIPH_PLAIN_OUT %2 ;; [in] GP with pointer to destination buffer +%define %%PLAIN_CIPH_IN %3 ;; [in] GP with pointer to source buffer +%define %%PLAIN_CIPH_LEN %4 ;; [in] GP with message length +%define %%DATA_OFFSET %5 ;; [in/out] GP with offset to source/destination buffer +%define %%AAD_HASH %6 ;; [in/out] an XMM with GHASH value +%define %%HASH_SUBKEY %7 ;; [in] XMM with hash key for GHASH multiply +%define %%ENC_DEC %8 ;; [in] "ENC" or "DEC" cipher direction selector + + mov r13, [%%GDATA_CTX + PBlockLen] + or r13, r13 + je %%_partial_block_done ;Leave Macro if no partial blocks + + cmp %%PLAIN_CIPH_LEN, 16 ;Read in input data without over reading + jb %%_fewer_than_16_bytes + VXLDR xmm1, [%%PLAIN_CIPH_IN] ;If more than 16 bytes of data, just fill the xmm register + jmp %%_data_read + +%%_fewer_than_16_bytes: + lea r10, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] + READ_SMALL_DATA_INPUT_AVX xmm1, r10, %%PLAIN_CIPH_LEN, rax + +%%_data_read: ;Finished reading in data + + vmovdqu xmm9, [%%GDATA_CTX + PBlockEncKey] ;xmm9 = my_ctx_data.partial_block_enc_key + + lea r12, [rel SHIFT_MASK] + + add r12, r13 ; adjust the shuffle mask pointer to be able to shift r13 bytes (16-r13 is the number of bytes in plaintext mod 16) + vmovdqu xmm2, [r12] ; get the appropriate shuffle mask + vpshufb xmm9, xmm9, xmm2 ;shift right r13 bytes + +%ifidn %%ENC_DEC, DEC + vmovdqa xmm3, xmm1 + vpxor xmm9, xmm9, xmm1 ; Ciphertext XOR E(K, Yn) + + mov r15, %%PLAIN_CIPH_LEN + add r15, r13 + sub r15, 16 ;Set r15 to be the amount of data left in CIPH_PLAIN_IN after filling the block + jge %%_no_extra_mask_1 ;Determine if if partial block is not being filled and shift mask accordingly + sub r12, r15 +%%_no_extra_mask_1: + + vmovdqu xmm1, [r12 + ALL_F - SHIFT_MASK]; get the appropriate mask to mask out bottom r13 bytes of xmm9 + vpand xmm9, xmm9, xmm1 ; mask out bottom r13 bytes of xmm9 + + vpand xmm3, xmm3, xmm1 + vpshufb xmm3, xmm3, [rel SHUF_MASK] + vpshufb xmm3, xmm3, xmm2 + vpxor %%AAD_HASH, %%AAD_HASH, xmm3 + + cmp r15, 0 + jl %%_partial_incomplete_1 + + GHASH_MUL %%AAD_HASH, %%HASH_SUBKEY, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block + xor rax, rax + mov [%%GDATA_CTX + PBlockLen], rax + jmp %%_dec_done +%%_partial_incomplete_1: +%ifidn __OUTPUT_FORMAT__, win64 + mov rax, %%PLAIN_CIPH_LEN + add [%%GDATA_CTX + PBlockLen], rax +%else + add [%%GDATA_CTX + PBlockLen], %%PLAIN_CIPH_LEN +%endif +%%_dec_done: + vmovdqu [%%GDATA_CTX + AadHash], %%AAD_HASH + +%else + vpxor xmm9, xmm1 ; Plaintext XOR E(K, Yn) + + mov r15, %%PLAIN_CIPH_LEN + add r15, r13 + sub r15, 16 ;Set r15 to be the amount of data left in CIPH_PLAIN_IN after filling the block + jge %%_no_extra_mask_2 ;Determine if if partial block is not being filled and shift mask accordingly + sub r12, r15 +%%_no_extra_mask_2: + + vmovdqu xmm1, [r12 + ALL_F-SHIFT_MASK] ; get the appropriate mask to mask out bottom r13 bytes of xmm9 + vpand xmm9, xmm1 ; mask out bottom r13 bytes of xmm9 + + vpshufb xmm9, [rel SHUF_MASK] + vpshufb xmm9, xmm2 + vpxor %%AAD_HASH, xmm9 + + cmp r15, 0 + jl %%_partial_incomplete_2 + + GHASH_MUL %%AAD_HASH, %%HASH_SUBKEY, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block + xor rax,rax + mov [%%GDATA_CTX + PBlockLen], rax + jmp %%_encode_done + +%%_partial_incomplete_2: +%ifidn __OUTPUT_FORMAT__, win64 + mov rax, %%PLAIN_CIPH_LEN + add [%%GDATA_CTX + PBlockLen], rax +%else + add [%%GDATA_CTX + PBlockLen], %%PLAIN_CIPH_LEN +%endif +%%_encode_done: + vmovdqu [%%GDATA_CTX + AadHash], %%AAD_HASH + + vpshufb xmm9, [rel SHUF_MASK] ; shuffle xmm9 back to output as ciphertext + vpshufb xmm9, xmm2 +%endif + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; output encrypted Bytes + cmp r15, 0 + jl %%_partial_fill + mov r12, r13 + mov r13, 16 + sub r13, r12 ; Set r13 to be the number of bytes to write out + jmp %%_count_set +%%_partial_fill: + mov r13, %%PLAIN_CIPH_LEN +%%_count_set: + simd_store_avx %%CIPH_PLAIN_OUT, xmm9, r13, rax, r12, %%DATA_OFFSET + add %%DATA_OFFSET, r13 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%%_partial_block_done: +%endmacro ; PARTIAL_BLOCK + +%macro GHASH_SINGLE_MUL 9 +%define %%GDATA %1 ;; [in] GHASH key pointer +%define %%HASHKEY %2 ;; [in] XMM with hash key +%define %%CIPHER %3 ;; [in] xmm with cipher text block +%define %%STATE_11 %4 ;; [in/out] GHASH product state (hi) +%define %%STATE_00 %5 ;; [in/out] GHASH product state (lo) +%define %%STATE_MID %6 ;; [in/out] GHASH product state (mid) +%define %%T1 %7 ;; [clobbered] temporary xmm +%define %%T2 %8 ;; [clobbered] temporary xmm +%define %%FIRST %9 ;; [in] "first" time or not ("update") selector + + vmovdqu %%T1, [%%GDATA + %%HASHKEY] +%ifidn %%FIRST, first + vpclmulqdq %%STATE_11, %%CIPHER, %%T1, 0x11 ; %%T4 = a1*b1 + vpclmulqdq %%STATE_00, %%CIPHER, %%T1, 0x00 ; %%T4_2 = a0*b0 + vpclmulqdq %%STATE_MID, %%CIPHER, %%T1, 0x01 ; %%T6 = a1*b0 + vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10 ; %%T5 = a0*b1 + vpxor %%STATE_MID, %%STATE_MID, %%T2 +%else + vpclmulqdq %%T2, %%CIPHER, %%T1, 0x11 + vpxor %%STATE_11, %%STATE_11, %%T2 + + vpclmulqdq %%T2, %%CIPHER, %%T1, 0x00 + vpxor %%STATE_00, %%STATE_00, %%T2 + + vpclmulqdq %%T2, %%CIPHER, %%T1, 0x01 + vpxor %%STATE_MID, %%STATE_MID, %%T2 + + vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10 + vpxor %%STATE_MID, %%STATE_MID, %%T2 +%endif + +%endmacro + +; if a = number of total plaintext bytes +; b = floor(a/16) +; %%num_initial_blocks = b mod 8; +; encrypt the initial %%num_initial_blocks blocks and apply ghash on the ciphertext +; %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r14 are used as a pointer only, not modified. +; Updated AAD_HASH is returned in %%T3 + +%macro INITIAL_BLOCKS 23 +%define %%GDATA_KEY %1 +%define %%CIPH_PLAIN_OUT %2 +%define %%PLAIN_CIPH_IN %3 +%define %%LENGTH %4 +%define %%DATA_OFFSET %5 +%define %%num_initial_blocks %6 ; can be 0, 1, 2, 3, 4, 5, 6 or 7 +%define %%T1 %7 +%define %%T2 %8 +%define %%T3 %9 +%define %%T4 %10 +%define %%T5 %11 +%define %%CTR %12 +%define %%XMM1 %13 +%define %%XMM2 %14 +%define %%XMM3 %15 +%define %%XMM4 %16 +%define %%XMM5 %17 +%define %%XMM6 %18 +%define %%XMM7 %19 +%define %%XMM8 %20 +%define %%T6 %21 +%define %%T_key %22 +%define %%ENC_DEC %23 + +%assign i (8-%%num_initial_blocks) + ;; Move AAD_HASH to temp reg + vmovdqu %%T2, %%XMM8 + +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + vpaddd %%CTR, %%CTR, [rel ONE] ; INCR Y0 + vmovdqa reg(i), %%CTR + vpshufb reg(i), [rel SHUF_MASK] ; perform a 16Byte swap +%assign i (i+1) +%endrep + +%if(%%num_initial_blocks>0) +vmovdqu %%T_key, [%%GDATA_KEY+16*0] +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + vpxor reg(i),reg(i),%%T_key +%assign i (i+1) +%endrep + +%assign j 1 +%rep NROUNDS +vmovdqu %%T_key, [%%GDATA_KEY+16*j] +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + vaesenc reg(i),%%T_key +%assign i (i+1) +%endrep + +%assign j (j+1) +%endrep + +vmovdqu %%T_key, [%%GDATA_KEY+16*j] +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + vaesenclast reg(i),%%T_key +%assign i (i+1) +%endrep + +%endif ; %if(%%num_initial_blocks>0) + +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] + vpxor reg(i), reg(i), %%T1 + ;; Write back ciphertext for %%num_initial_blocks blocks + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET], reg(i) + add %%DATA_OFFSET, 16 + %ifidn %%ENC_DEC, DEC + vmovdqa reg(i), %%T1 + %endif + ;; Prepare ciphertext for GHASH computations + vpshufb reg(i), [rel SHUF_MASK] +%assign i (i+1) +%endrep + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%assign i (9-%%num_initial_blocks) +%if(%%num_initial_blocks>0) + vmovdqa %%T3, reg(i) +%assign i (i+1) +%endif +%if(%%num_initial_blocks>1) +%rep %%num_initial_blocks-1 + vmovdqu [rsp + TMP %+ i], reg(i) +%assign i (i+1) +%endrep +%endif + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Prepare 8 counter blocks and perform rounds of AES cipher on + ;; them, load plain/cipher text and store cipher/plain text. + ;; Stitch GHASH computation in between AES rounds. + vpaddd %%XMM1, %%CTR, [rel ONE] ; INCR Y0 + vpaddd %%XMM2, %%CTR, [rel TWO] ; INCR Y0 + vpaddd %%XMM3, %%XMM1, [rel TWO] ; INCR Y0 + vpaddd %%XMM4, %%XMM2, [rel TWO] ; INCR Y0 + vpaddd %%XMM5, %%XMM3, [rel TWO] ; INCR Y0 + vpaddd %%XMM6, %%XMM4, [rel TWO] ; INCR Y0 + vpaddd %%XMM7, %%XMM5, [rel TWO] ; INCR Y0 + vpaddd %%XMM8, %%XMM6, [rel TWO] ; INCR Y0 + vmovdqa %%CTR, %%XMM8 + + vpshufb %%XMM1, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM2, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM3, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM4, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM5, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM6, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM7, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM8, [rel SHUF_MASK] ; perform a 16Byte swap + + vmovdqu %%T_key, [%%GDATA_KEY+16*0] + vpxor %%XMM1, %%XMM1, %%T_key + vpxor %%XMM2, %%XMM2, %%T_key + vpxor %%XMM3, %%XMM3, %%T_key + vpxor %%XMM4, %%XMM4, %%T_key + vpxor %%XMM5, %%XMM5, %%T_key + vpxor %%XMM6, %%XMM6, %%T_key + vpxor %%XMM7, %%XMM7, %%T_key + vpxor %%XMM8, %%XMM8, %%T_key + +%assign i (8-%%num_initial_blocks) +%assign j (9-%%num_initial_blocks) +%assign k (%%num_initial_blocks) + +%define %%T4_2 %%T4 +%if(%%num_initial_blocks>0) + ;; Hash in AES state + ;; T2 - incoming AAD hash + vpxor %%T2, %%T3 + + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, first +%endif + + vmovdqu %%T_key, [%%GDATA_KEY+16*1] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + + vmovdqu %%T_key, [%%GDATA_KEY+16*2] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%if(%%num_initial_blocks>1) + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + vmovdqu %%T2, [rsp + TMP %+ j] + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, not_first +%endif + + vmovdqu %%T_key, [%%GDATA_KEY+16*3] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + + vmovdqu %%T_key, [%%GDATA_KEY+16*4] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%if(%%num_initial_blocks>2) + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + vmovdqu %%T2, [rsp + TMP %+ j] + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, not_first +%endif + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%if(%%num_initial_blocks>3) + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + vmovdqu %%T2, [rsp + TMP %+ j] + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, not_first +%endif + + vmovdqu %%T_key, [%%GDATA_KEY+16*5] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + + vmovdqu %%T_key, [%%GDATA_KEY+16*6] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%if(%%num_initial_blocks>4) + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + vmovdqu %%T2, [rsp + TMP %+ j] + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, not_first +%endif + + vmovdqu %%T_key, [%%GDATA_KEY+16*7] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + + vmovdqu %%T_key, [%%GDATA_KEY+16*8] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%if(%%num_initial_blocks>5) + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + vmovdqu %%T2, [rsp + TMP %+ j] + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, not_first +%endif + + vmovdqu %%T_key, [%%GDATA_KEY+16*9] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + +%ifndef GCM128_MODE + vmovdqu %%T_key, [%%GDATA_KEY+16*10] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key +%endif + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%if(%%num_initial_blocks>6) + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + vmovdqu %%T2, [rsp + TMP %+ j] + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, not_first +%endif + +%ifdef GCM128_MODE + vmovdqu %%T_key, [%%GDATA_KEY+16*10] + vaesenclast %%XMM1, %%T_key + vaesenclast %%XMM2, %%T_key + vaesenclast %%XMM3, %%T_key + vaesenclast %%XMM4, %%T_key + vaesenclast %%XMM5, %%T_key + vaesenclast %%XMM6, %%T_key + vaesenclast %%XMM7, %%T_key + vaesenclast %%XMM8, %%T_key +%endif + +%ifdef GCM192_MODE + vmovdqu %%T_key, [%%GDATA_KEY+16*11] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + + vmovdqu %%T_key, [%%GDATA_KEY+16*12] + vaesenclast %%XMM1, %%T_key + vaesenclast %%XMM2, %%T_key + vaesenclast %%XMM3, %%T_key + vaesenclast %%XMM4, %%T_key + vaesenclast %%XMM5, %%T_key + vaesenclast %%XMM6, %%T_key + vaesenclast %%XMM7, %%T_key + vaesenclast %%XMM8, %%T_key +%endif +%ifdef GCM256_MODE + vmovdqu %%T_key, [%%GDATA_KEY+16*11] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + + vmovdqu %%T_key, [%%GDATA_KEY+16*12] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key +%endif + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%if(%%num_initial_blocks>7) + ;; GDATA, HASHKEY, CIPHER, + ;; STATE_11, STATE_00, STATE_MID, T1, T2 + vmovdqu %%T2, [rsp + TMP %+ j] + GHASH_SINGLE_MUL %%GDATA_KEY, HashKey_ %+ k, %%T2, \ + %%T1, %%T4, %%T6, %%T5, %%T3, not_first +%endif + +%ifdef GCM256_MODE ; GCM256 + vmovdqu %%T_key, [%%GDATA_KEY+16*13] + vaesenc %%XMM1, %%T_key + vaesenc %%XMM2, %%T_key + vaesenc %%XMM3, %%T_key + vaesenc %%XMM4, %%T_key + vaesenc %%XMM5, %%T_key + vaesenc %%XMM6, %%T_key + vaesenc %%XMM7, %%T_key + vaesenc %%XMM8, %%T_key + + vmovdqu %%T_key, [%%GDATA_KEY+16*14] + vaesenclast %%XMM1, %%T_key + vaesenclast %%XMM2, %%T_key + vaesenclast %%XMM3, %%T_key + vaesenclast %%XMM4, %%T_key + vaesenclast %%XMM5, %%T_key + vaesenclast %%XMM6, %%T_key + vaesenclast %%XMM7, %%T_key + vaesenclast %%XMM8, %%T_key +%endif ; GCM256 mode + +%if(%%num_initial_blocks>0) + vpsrldq %%T3, %%T6, 8 ; shift-R %%T2 2 DWs + vpslldq %%T6, %%T6, 8 ; shift-L %%T3 2 DWs + vpxor %%T1, %%T1, %%T3 ; accumulate the results in %%T1:%%T4 + vpxor %%T4, %%T6, %%T4 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; First phase of the reduction + vmovdqa %%T3, [rel POLY2] + + vpclmulqdq %%T2, %%T3, %%T4, 0x01 + vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs + + ;; First phase of the reduction complete + vpxor %%T4, %%T4, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; Second phase of the reduction + vpclmulqdq %%T2, %%T3, %%T4, 0x00 + ;; Shift-R xmm2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + vpsrldq %%T2, %%T2, 4 + + vpclmulqdq %%T4, %%T3, %%T4, 0x10 + ;; Shift-L xmm0 1 DW (Shift-L 1-DW to obtain result with no shifts) + vpslldq %%T4, %%T4, 4 + ;; Second phase of the reduction complete + vpxor %%T4, %%T4, %%T2 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; The result is in %%T3 + vpxor %%T3, %%T1, %%T4 +%else + ;; The hash should end up in T3 + vmovdqa %%T3, %%T2 +%endif + + ;; Final hash is now in T3 +%if %%num_initial_blocks > 0 + ;; NOTE: obsolete in case %%num_initial_blocks = 0 + sub %%LENGTH, 16*%%num_initial_blocks +%endif + + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*0] + vpxor %%XMM1, %%XMM1, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*0], %%XMM1 +%ifidn %%ENC_DEC, DEC + vmovdqa %%XMM1, %%T1 +%endif + + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*1] + vpxor %%XMM2, %%XMM2, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*1], %%XMM2 +%ifidn %%ENC_DEC, DEC + vmovdqa %%XMM2, %%T1 +%endif + + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*2] + vpxor %%XMM3, %%XMM3, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*2], %%XMM3 +%ifidn %%ENC_DEC, DEC + vmovdqa %%XMM3, %%T1 +%endif + + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*3] + vpxor %%XMM4, %%XMM4, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*3], %%XMM4 +%ifidn %%ENC_DEC, DEC + vmovdqa %%XMM4, %%T1 +%endif + + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*4] + vpxor %%XMM5, %%XMM5, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*4], %%XMM5 + %ifidn %%ENC_DEC, DEC + vmovdqa %%XMM5, %%T1 + %endif + + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*5] + vpxor %%XMM6, %%XMM6, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*5], %%XMM6 + %ifidn %%ENC_DEC, DEC + vmovdqa %%XMM6, %%T1 + %endif + + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*6] + vpxor %%XMM7, %%XMM7, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*6], %%XMM7 + %ifidn %%ENC_DEC, DEC + vmovdqa %%XMM7, %%T1 + %endif + +%if %%num_initial_blocks > 0 + ;; NOTE: 'jl' is never taken for %%num_initial_blocks = 0 + ;; This macro is executed for length 128 and up, + ;; zero length is checked in GCM_ENC_DEC. + ;; If the last block is partial then the xor will be done later + ;; in ENCRYPT_FINAL_PARTIAL_BLOCK. + ;; We know it's partial if LENGTH - 16*num_initial_blocks < 128 + cmp %%LENGTH, 128 + jl %%_initial_skip_last_word_write +%endif + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*7] + vpxor %%XMM8, %%XMM8, %%T1 + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET + 16*7], %%XMM8 + %ifidn %%ENC_DEC, DEC + vmovdqa %%XMM8, %%T1 + %endif + + ;; Update %%LENGTH with the number of blocks processed + sub %%LENGTH, 16 + add %%DATA_OFFSET, 16 +%%_initial_skip_last_word_write: + sub %%LENGTH, 128-16 + add %%DATA_OFFSET, 128-16 + + vpshufb %%XMM1, [rel SHUF_MASK] ; perform a 16Byte swap + ;; Combine GHASHed value with the corresponding ciphertext + vpxor %%XMM1, %%XMM1, %%T3 + vpshufb %%XMM2, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM3, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM4, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM5, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM6, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM7, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM8, [rel SHUF_MASK] ; perform a 16Byte swap + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%%_initial_blocks_done: + +%endmacro + +;;; INITIAL_BLOCKS macro with support for a partial final block. +;;; num_initial_blocks is expected to include the partial final block +;;; in the count. +%macro INITIAL_BLOCKS_PARTIAL 25 +%define %%GDATA_KEY %1 ;; [in] pointer to GCM key data +%define %%GDATA_CTX %2 ;; [in] pointer to GCM context data +%define %%CIPH_PLAIN_OUT %3 ;; [in] pointer to destination buffer +%define %%PLAIN_CIPH_IN %4 ;; [in] pointer to source buffer +%define %%LENGTH %5 ;; [in] message length +%define %%DATA_OFFSET %6 ;; [in/out] buffer offset +%define %%num_initial_blocks %7 ;; [in] numeric value, number of blocks can be from 1 to 7 (not 0) +%define %%T1 %8 +%define %%T2 %9 +%define %%T3 %10 ;; [out] hash value (XMM) +%define %%T4 %11 +%define %%T5 %12 +%define %%CTR %13 +%define %%XMM1 %14 +%define %%XMM2 %15 +%define %%XMM3 %16 +%define %%XMM4 %17 +%define %%XMM5 %18 +%define %%XMM6 %19 +%define %%XMM7 %20 +%define %%XMM8 %21 ;; [in] hash value (XMM) +%define %%T6 %22 +%define %%T_key %23 +%define %%ENC_DEC %24 +%define %%INSTANCE_TYPE %25 + +%assign i (8-%%num_initial_blocks) + ;; Move AAD_HASH to temp reg + vmovdqu %%T2, %%XMM8 + +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + ;; prepare AES counter blocks + vpaddd %%CTR, %%CTR, [rel ONE] ; INCR Y0 + vmovdqa reg(i), %%CTR + vpshufb reg(i), [rel SHUF_MASK] ; perform a 16Byte swap +%assign i (i+1) +%endrep + +vmovdqu %%T_key, [%%GDATA_KEY+16*0] +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + ; Start AES for %%num_initial_blocks blocks + vpxor reg(i),reg(i),%%T_key +%assign i (i+1) +%endrep + +%assign j 1 +%rep NROUNDS +vmovdqu %%T_key, [%%GDATA_KEY+16*j] +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + vaesenc reg(i),%%T_key +%assign i (i+1) +%endrep + +%assign j (j+1) +%endrep + +vmovdqu %%T_key, [%%GDATA_KEY+16*j] +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks + vaesenclast reg(i),%%T_key +%assign i (i+1) +%endrep + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Hash all but the last block of data +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%assign i (9-%%num_initial_blocks) +%rep %%num_initial_blocks-1 + ;; Encrypt the message for all but the last block + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] + vpxor reg(i), reg(i), %%T1 + ;; write back ciphertext for %%num_initial_blocks blocks + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET], reg(i) + add %%DATA_OFFSET, 16 + %ifidn %%ENC_DEC, DEC + vmovdqa reg(i), %%T1 + %endif + ;; Prepare ciphertext for GHASH computations + vpshufb reg(i), [rel SHUF_MASK] +%assign i (i+1) +%endrep + + ;; The final block of data may be <16B + sub %%LENGTH, 16*(%%num_initial_blocks-1) + +%if %%num_initial_blocks < 8 + ;; NOTE: the 'jl' is always taken for num_initial_blocks = 8. + ;; This is run in the context of GCM_ENC_DEC_SMALL for length < 128. + cmp %%LENGTH, 16 + jl %%_small_initial_partial_block + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Handle a full length final block - encrypt and hash all blocks +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + sub %%LENGTH, 16 + mov [%%GDATA_CTX + PBlockLen], %%LENGTH + + ;; Encrypt the message + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] + vpxor reg(i), reg(i), %%T1 + ;; write back ciphertext for %%num_initial_blocks blocks + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET], reg(i) + add %%DATA_OFFSET, 16 + %ifidn %%ENC_DEC, DEC + vmovdqa reg(i), %%T1 + %endif + ;; Prepare ciphertext for GHASH computations + vpshufb reg(i), [rel SHUF_MASK] + + ;; Hash all of the data +%assign i (8-%%num_initial_blocks) +%assign j (9-%%num_initial_blocks) +%assign k (%%num_initial_blocks) +%assign last_block_to_hash 0 + +%if(%%num_initial_blocks>last_block_to_hash) + ;; Hash in AES state + vpxor %%T2, reg(j) + + ;; T2 - incoming AAD hash + ;; reg(i) holds ciphertext + ;; T5 - hash key + ;; T6 - updated xor + ;; reg(1)/xmm1 should now be available for tmp use + vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T1, %%T2, %%T5, 0x11 ; %%T4 = a1*b1 + vpclmulqdq %%T4, %%T2, %%T5, 0x00 ; %%T4 = a0*b0 + vpclmulqdq %%T6, %%T2, %%T5, 0x01 ; %%T6 = a1*b0 + vpclmulqdq %%T5, %%T2, %%T5, 0x10 ; %%T5 = a0*b1 + vpxor %%T6, %%T6, %%T5 +%endif + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%assign rep_count (%%num_initial_blocks-1) +%rep rep_count + + vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T3, reg(j), %%T5, 0x11 + vpxor %%T1, %%T1, %%T3 + + vpclmulqdq %%T3, reg(j), %%T5, 0x00 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, reg(j), %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, reg(j), %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%endrep + + ;; Record that a reduction is needed + mov r12, 1 + + jmp %%_small_initial_compute_hash + +%endif ; %if %%num_initial_blocks < 8 + +%%_small_initial_partial_block: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Handle ghash for a <16B final block +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ;; In this case if it's a single call to encrypt we can + ;; hash all of the data but if it's an init / update / finalize + ;; series of call we need to leave the last block if it's + ;; less than a full block of data. + + mov [%%GDATA_CTX + PBlockLen], %%LENGTH + vmovdqu [%%GDATA_CTX + PBlockEncKey], reg(i) + ;; Handle a partial final block + ;; GDATA, KEY, T1, T2 + ;; r13 - length + ;; LT16 - indicates type of read and that the buffer is less than 16 bytes long + ;; NOTE: could be replaced with %%LENGTH but at this point + ;; %%LENGTH is always less than 16. + ;; No PLAIN_CIPH_LEN argument available in this macro. + ENCRYPT_FINAL_PARTIAL_BLOCK reg(i), %%T1, %%T3, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, LT16, %%ENC_DEC, %%DATA_OFFSET + vpshufb reg(i), [rel SHUF_MASK] + +%ifidn %%INSTANCE_TYPE, multi_call +%assign i (8-%%num_initial_blocks) +%assign j (9-%%num_initial_blocks) +%assign k (%%num_initial_blocks-1) +%assign last_block_to_hash 1 +%else +%assign i (8-%%num_initial_blocks) +%assign j (9-%%num_initial_blocks) +%assign k (%%num_initial_blocks) +%assign last_block_to_hash 0 +%endif + +%if(%%num_initial_blocks>last_block_to_hash) + ;; Record that a reduction is needed + mov r12, 1 + ;; Hash in AES state + vpxor %%T2, reg(j) + + ;; T2 - incoming AAD hash + ;; reg(i) holds ciphertext + ;; T5 - hash key + ;; T6 - updated xor + ;; reg(1)/xmm1 should now be available for tmp use + vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T1, %%T2, %%T5, 0x11 ; %%T4 = a1*b1 + vpclmulqdq %%T4, %%T2, %%T5, 0x00 ; %%T4 = a0*b0 + vpclmulqdq %%T6, %%T2, %%T5, 0x01 ; %%T6 = a1*b0 + vpclmulqdq %%T5, %%T2, %%T5, 0x10 ; %%T5 = a0*b1 + vpxor %%T6, %%T6, %%T5 +%else + ;; Record that a reduction is not needed - + ;; In this case no hashes are computed because there + ;; is only one initial block and it is < 16B in length. + mov r12, 0 +%endif + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%ifidn %%INSTANCE_TYPE, multi_call +%assign rep_count (%%num_initial_blocks-2) +%%_multi_call_hash: +%else +%assign rep_count (%%num_initial_blocks-1) +%endif + +%if rep_count < 0 + ;; quick fix for negative rep_count (to be investigated) +%assign rep_count 0 +%endif + +%rep rep_count + + vmovdqu %%T5, [%%GDATA_KEY + HashKey_ %+ k] + vpclmulqdq %%T3, reg(j), %%T5, 0x11 + vpxor %%T1, %%T1, %%T3 + + vpclmulqdq %%T3, reg(j), %%T5, 0x00 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, reg(j), %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, reg(j), %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + +%assign i (i+1) +%assign j (j+1) +%assign k (k-1) +%endrep + +%%_small_initial_compute_hash: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Ghash reduction +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%if(%%num_initial_blocks=1) +%ifidn %%INSTANCE_TYPE, multi_call + ;; We only need to check if a reduction is needed if + ;; initial_blocks == 1 and init/update/final is being used. + ;; In this case we may just have a partial block, and that + ;; gets hashed in finalize. + cmp r12, 0 + je %%_no_reduction_needed +%endif +%endif + + vpsrldq %%T3, %%T6, 8 ; shift-R %%T2 2 DWs + vpslldq %%T6, %%T6, 8 ; shift-L %%T3 2 DWs + vpxor %%T1, %%T1, %%T3 ; accumulate the results in %%T1:%%T4 + vpxor %%T4, %%T6, %%T4 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; First phase of the reduction + vmovdqa %%T3, [rel POLY2] + + vpclmulqdq %%T2, %%T3, %%T4, 0x01 + ;; shift-L xmm2 2 DWs + vpslldq %%T2, %%T2, 8 + vpxor %%T4, %%T4, %%T2 + + ;; First phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Second phase of the reduction + + vpclmulqdq %%T2, %%T3, %%T4, 0x00 + ;; Shift-R xmm2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + vpsrldq %%T2, %%T2, 4 + + vpclmulqdq %%T4, %%T3, %%T4, 0x10 + ;; Shift-L xmm0 1 DW (Shift-L 1-DW to obtain result with no shifts) + vpslldq %%T4, %%T4, 4 + + vpxor %%T4, %%T4, %%T2 + ;; Second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%T3, %%T1, %%T4 + +%ifidn %%INSTANCE_TYPE, multi_call + ;; If using init/update/finalize, we need to xor any partial block data + ;; into the hash. +%if %%num_initial_blocks > 1 + ;; NOTE: for %%num_initial_blocks = 0 the xor never takes place +%if %%num_initial_blocks != 8 + ;; NOTE: for %%num_initial_blocks = 8, %%LENGTH, stored in [PBlockLen] is never zero + cmp qword [%%GDATA_CTX + PBlockLen], 0 + je %%_no_partial_block_xor +%endif ; %%num_initial_blocks != 8 + vpxor %%T3, %%T3, reg(8) +%%_no_partial_block_xor: +%endif ; %%num_initial_blocks > 1 +%endif ; %%INSTANCE_TYPE, multi_call + +%if(%%num_initial_blocks=1) +%ifidn %%INSTANCE_TYPE, multi_call + ;; NOTE: %%_no_reduction_needed case only valid for + ;; multi_call with initial_blocks = 1. + ;; Look for comment above around '_no_reduction_needed' + ;; The jmp below is obsolete as the code will fall through. + + ;; The result is in %%T3 + jmp %%_after_reduction + +%%_no_reduction_needed: + ;; The hash should end up in T3. The only way we should get here is if + ;; there is a partial block of data, so xor that into the hash. + vpxor %%T3, %%T2, reg(8) +%endif ; %%INSTANCE_TYPE = multi_call +%endif ; %%num_initial_blocks=1 + +%%_after_reduction: + ;; Final hash is now in T3 + +%endmacro ; INITIAL_BLOCKS_PARTIAL + +%macro INITIAL_8BLOCKS_CIPHER 17 +%define %%GDATA_KEY %1 +%define %%CIPH_PLAIN_OUT %2 +%define %%PLAIN_CIPH_IN %3 +%define %%LENGTH %4 +%define %%DATA_OFFSET %5 +%define %%STACK_OFFSET %6 +%define %%T1 %7 +%define %%CTR %8 +%define %%XMM1 %9 +%define %%XMM2 %10 +%define %%XMM3 %11 +%define %%XMM4 %12 +%define %%XMM5 %13 +%define %%XMM6 %14 +%define %%XMM7 %15 +%define %%XMM8 %16 +%define %%ENC_DEC %17 + +%xdefine %%T_key %%T1 + +%assign i 1 +%rep 8 + vpaddd %%CTR, %%CTR, [rel ONE] ; INCR Y0 + vmovdqa reg(i), %%CTR + vpshufb reg(i), [rel SHUF_MASK] ; perform a 16Byte swap +%assign i (i+1) +%endrep + ;; ark + vmovdqu %%T_key, [%%GDATA_KEY+16*0] +%assign i 1 +%rep 8 + vpxor reg(i), reg(i), %%T_key +%assign i (i+1) +%endrep + + ;; AESENC rounds +%assign j 1 +%rep NROUNDS + vmovdqu %%T_key, [%%GDATA_KEY+16*j] +%assign i 1 +%rep 8 + vaesenc reg(i), reg(i), %%T_key +%assign i (i+1) +%endrep + +%assign j (j+1) +%endrep + + ;; AESENCLAST round + vmovdqu %%T_key, [%%GDATA_KEY+16*j] +%assign i 1 +%rep 8 + vaesenclast reg(i), reg(i), %%T_key +%assign i (i+1) +%endrep + + ;; text load & xor & store, shuffle for later GHASH +%assign i 1 +%rep 8 + VXLDR %%T1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] + vpxor reg(i), reg(i), %%T1 + ;; Write back ciphertext for %%num_initial_blocks blocks + VXSTR [%%CIPH_PLAIN_OUT + %%DATA_OFFSET], reg(i) + add %%DATA_OFFSET, 16 +%ifidn %%ENC_DEC, DEC + vmovdqa reg(i), %%T1 +%endif + ;; Prepare ciphertext for GHASH computations + vpshufb reg(i), [rel SHUF_MASK] +%assign i (i+1) +%endrep + +%assign i 1 +%rep 8 + vmovdqu [rsp + %%STACK_OFFSET + TMP %+ i], reg(i) +%assign i (i+1) +%endrep + + sub %%LENGTH, 8*16 +%endmacro + + +; encrypt 8 blocks at a time +; ghash the 8 previously encrypted ciphertext blocks +; %%GDATA (KEY), %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN are used as pointers only, not modified +; %%DATA_OFFSET is the data offset value +%macro GHASH_8_ENCRYPT_8_PARALLEL 23 +%define %%GDATA %1 +%define %%CIPH_PLAIN_OUT %2 +%define %%PLAIN_CIPH_IN %3 +%define %%DATA_OFFSET %4 +%define %%T1 %5 +%define %%T2 %6 +%define %%T3 %7 +%define %%T4 %8 +%define %%T5 %9 +%define %%T6 %10 +%define %%CTR %11 +%define %%XMM1 %12 +%define %%XMM2 %13 +%define %%XMM3 %14 +%define %%XMM4 %15 +%define %%XMM5 %16 +%define %%XMM6 %17 +%define %%XMM7 %18 +%define %%XMM8 %19 +%define %%T7 %20 +%define %%loop_idx %21 +%define %%ENC_DEC %22 +%define %%FULL_PARTIAL %23 + + vmovdqa [rsp + TMP1], %%XMM1 + vmovdqa [rsp + TMP2], %%XMM2 + vmovdqa [rsp + TMP3], %%XMM3 + vmovdqa [rsp + TMP4], %%XMM4 + vmovdqa [rsp + TMP5], %%XMM5 + vmovdqa [rsp + TMP6], %%XMM6 + vmovdqa [rsp + TMP7], %%XMM7 + vmovdqa [rsp + TMP8], %%XMM8 + +%ifidn %%loop_idx, in_order + vpaddd %%XMM1, %%CTR, [rel ONE] ; INCR CNT + vmovdqa %%T5, [rel TWO] + vpaddd %%XMM2, %%CTR, %%T5 + vpaddd %%XMM3, %%XMM1, %%T5 + vpaddd %%XMM4, %%XMM2, %%T5 + vpaddd %%XMM5, %%XMM3, %%T5 + vpaddd %%XMM6, %%XMM4, %%T5 + vpaddd %%XMM7, %%XMM5, %%T5 + vpaddd %%XMM8, %%XMM6, %%T5 + vmovdqa %%CTR, %%XMM8 + + vmovdqa %%T5, [rel SHUF_MASK] + vpshufb %%XMM1, %%T5 ; perform a 16Byte swap + vpshufb %%XMM2, %%T5 ; perform a 16Byte swap + vpshufb %%XMM3, %%T5 ; perform a 16Byte swap + vpshufb %%XMM4, %%T5 ; perform a 16Byte swap + vpshufb %%XMM5, %%T5 ; perform a 16Byte swap + vpshufb %%XMM6, %%T5 ; perform a 16Byte swap + vpshufb %%XMM7, %%T5 ; perform a 16Byte swap + vpshufb %%XMM8, %%T5 ; perform a 16Byte swap +%else + vpaddd %%XMM1, %%CTR, [rel ONEf] ; INCR CNT + vmovdqa %%T5, [rel TWOf] + vpaddd %%XMM2, %%CTR, %%T5 + vpaddd %%XMM3, %%XMM1, %%T5 + vpaddd %%XMM4, %%XMM2, %%T5 + vpaddd %%XMM5, %%XMM3, %%T5 + vpaddd %%XMM6, %%XMM4, %%T5 + vpaddd %%XMM7, %%XMM5, %%T5 + vpaddd %%XMM8, %%XMM6, %%T5 + vmovdqa %%CTR, %%XMM8 +%endif + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T1, [%%GDATA + 16*0] + vpxor %%XMM1, %%XMM1, %%T1 + vpxor %%XMM2, %%XMM2, %%T1 + vpxor %%XMM3, %%XMM3, %%T1 + vpxor %%XMM4, %%XMM4, %%T1 + vpxor %%XMM5, %%XMM5, %%T1 + vpxor %%XMM6, %%XMM6, %%T1 + vpxor %%XMM7, %%XMM7, %%T1 + vpxor %%XMM8, %%XMM8, %%T1 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T1, [%%GDATA + 16*1] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + vmovdqu %%T1, [%%GDATA + 16*2] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T2, [rsp + TMP1] + vmovdqu %%T5, [%%GDATA + HashKey_8] + vpclmulqdq %%T4, %%T2, %%T5, 0x11 ; %%T4 = a1*b1 + vpclmulqdq %%T7, %%T2, %%T5, 0x00 ; %%T7 = a0*b0 + vpclmulqdq %%T6, %%T2, %%T5, 0x01 ; %%T6 = a1*b0 + vpclmulqdq %%T5, %%T2, %%T5, 0x10 ; %%T5 = a0*b1 + vpxor %%T6, %%T6, %%T5 + + vmovdqu %%T1, [%%GDATA + 16*3] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + vmovdqu %%T1, [rsp + TMP2] + vmovdqu %%T5, [%%GDATA + HashKey_7] + vpclmulqdq %%T3, %%T1, %%T5, 0x11 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vpxor %%T7, %%T7, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + + vmovdqu %%T1, [%%GDATA + 16*4] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vmovdqu %%T1, [rsp + TMP3] + vmovdqu %%T5, [%%GDATA + HashKey_6] + vpclmulqdq %%T3, %%T1, %%T5, 0x11 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vpxor %%T7, %%T7, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + + vmovdqu %%T1, [%%GDATA + 16*5] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + vmovdqu %%T1, [rsp + TMP4] + vmovdqu %%T5, [%%GDATA + HashKey_5] + vpclmulqdq %%T3, %%T1, %%T5, 0x11 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vpxor %%T7, %%T7, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + + vmovdqu %%T1, [%%GDATA + 16*6] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + vmovdqu %%T1, [rsp + TMP5] + vmovdqu %%T5, [%%GDATA + HashKey_4] + vpclmulqdq %%T3, %%T1, %%T5, 0x11 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vpxor %%T7, %%T7, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + + vmovdqu %%T1, [%%GDATA + 16*7] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + vmovdqu %%T1, [rsp + TMP6] + vmovdqu %%T5, [%%GDATA + HashKey_3] + vpclmulqdq %%T3, %%T1, %%T5, 0x11 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vpxor %%T7, %%T7, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + + vmovdqu %%T1, [%%GDATA + 16*8] + vaesenc %%XMM1, %%T1 + vaesenc %%XMM2, %%T1 + vaesenc %%XMM3, %%T1 + vaesenc %%XMM4, %%T1 + vaesenc %%XMM5, %%T1 + vaesenc %%XMM6, %%T1 + vaesenc %%XMM7, %%T1 + vaesenc %%XMM8, %%T1 + + vmovdqu %%T1, [rsp + TMP7] + vmovdqu %%T5, [%%GDATA + HashKey_2] + vpclmulqdq %%T3, %%T1, %%T5, 0x11 + vpxor %%T4, %%T4, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vpxor %%T7, %%T7, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + 16*9] + vaesenc %%XMM1, %%T5 + vaesenc %%XMM2, %%T5 + vaesenc %%XMM3, %%T5 + vaesenc %%XMM4, %%T5 + vaesenc %%XMM5, %%T5 + vaesenc %%XMM6, %%T5 + vaesenc %%XMM7, %%T5 + vaesenc %%XMM8, %%T5 + + vmovdqu %%T1, [rsp + TMP8] + vmovdqu %%T5, [%%GDATA + HashKey] + + vpclmulqdq %%T3, %%T1, %%T5, 0x00 + vpxor %%T7, %%T7, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x01 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x10 + vpxor %%T6, %%T6, %%T3 + + vpclmulqdq %%T3, %%T1, %%T5, 0x11 + vpxor %%T1, %%T4, %%T3 + + vmovdqu %%T5, [%%GDATA + 16*10] +%ifndef GCM128_MODE ; GCM192 or GCM256 + vaesenc %%XMM1, %%T5 + vaesenc %%XMM2, %%T5 + vaesenc %%XMM3, %%T5 + vaesenc %%XMM4, %%T5 + vaesenc %%XMM5, %%T5 + vaesenc %%XMM6, %%T5 + vaesenc %%XMM7, %%T5 + vaesenc %%XMM8, %%T5 + + vmovdqu %%T5, [%%GDATA + 16*11] + vaesenc %%XMM1, %%T5 + vaesenc %%XMM2, %%T5 + vaesenc %%XMM3, %%T5 + vaesenc %%XMM4, %%T5 + vaesenc %%XMM5, %%T5 + vaesenc %%XMM6, %%T5 + vaesenc %%XMM7, %%T5 + vaesenc %%XMM8, %%T5 + + vmovdqu %%T5, [%%GDATA + 16*12] +%endif +%ifdef GCM256_MODE + vaesenc %%XMM1, %%T5 + vaesenc %%XMM2, %%T5 + vaesenc %%XMM3, %%T5 + vaesenc %%XMM4, %%T5 + vaesenc %%XMM5, %%T5 + vaesenc %%XMM6, %%T5 + vaesenc %%XMM7, %%T5 + vaesenc %%XMM8, %%T5 + + vmovdqu %%T5, [%%GDATA + 16*13] + vaesenc %%XMM1, %%T5 + vaesenc %%XMM2, %%T5 + vaesenc %%XMM3, %%T5 + vaesenc %%XMM4, %%T5 + vaesenc %%XMM5, %%T5 + vaesenc %%XMM6, %%T5 + vaesenc %%XMM7, %%T5 + vaesenc %%XMM8, %%T5 + + vmovdqu %%T5, [%%GDATA + 16*14] +%endif ; GCM256 + + ;; the last round, %%T5 holds the key + vaesenclast %%XMM1, %%T5 + vaesenclast %%XMM2, %%T5 + vaesenclast %%XMM3, %%T5 + vaesenclast %%XMM4, %%T5 + vaesenclast %%XMM5, %%T5 + vaesenclast %%XMM6, %%T5 + vaesenclast %%XMM7, %%T5 + vaesenclast %%XMM8, %%T5 + +%ifidn %%ENC_DEC, ENC + vpxor %%XMM1, %%XMM1, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*0] + vpxor %%XMM2, %%XMM2, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*1] + vpxor %%XMM3, %%XMM3, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*2] + vpxor %%XMM4, %%XMM4, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*3] + vpxor %%XMM5, %%XMM5, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*4] + vpxor %%XMM6, %%XMM6, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*5] + vpxor %%XMM7, %%XMM7, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*6] +%ifidn %%FULL_PARTIAL, full + vpxor %%XMM8, %%XMM8, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*7] +%endif + + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*0], %%XMM1 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*1], %%XMM2 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*2], %%XMM3 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*3], %%XMM4 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*4], %%XMM5 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*5], %%XMM6 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*6], %%XMM7 +%ifidn %%FULL_PARTIAL, full + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*7], %%XMM8 +%endif + + vpshufb %%XMM1, %%XMM1, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM2, %%XMM2, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM3, %%XMM3, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM4, %%XMM4, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM5, %%XMM5, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM6, %%XMM6, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM7, %%XMM7, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM8, %%XMM8, [rel SHUF_MASK] ; perform a 16Byte swap + +%else + ;; decrypt direction + vmovdqu %%T2, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*0] + vmovdqu %%T3, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*1] + vpxor %%XMM1, %%XMM1, %%T2 + vpxor %%XMM2, %%XMM2, %%T3 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*0], %%XMM1 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*1], %%XMM2 + vpshufb %%XMM1, %%T2, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM2, %%T3, [rel SHUF_MASK] ; perform a 16Byte swap + + vmovdqu %%T2, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*2] + vmovdqu %%T3, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*3] + vpxor %%XMM3, %%XMM3, %%T2 + vpxor %%XMM4, %%XMM4, %%T3 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*2], %%XMM3 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*3], %%XMM4 + vpshufb %%XMM3, %%T2, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM4, %%T3, [rel SHUF_MASK] ; perform a 16Byte swap + + vmovdqu %%T2, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*4] + vmovdqu %%T3, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*5] + vpxor %%XMM5, %%XMM5, %%T2 + vpxor %%XMM6, %%XMM6, %%T3 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*4], %%XMM5 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*5], %%XMM6 + vpshufb %%XMM5, %%T2, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%XMM6, %%T3, [rel SHUF_MASK] ; perform a 16Byte swap + + vmovdqu %%T2, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*6] +%ifidn %%FULL_PARTIAL, full + vmovdqu %%T3, [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*7] +%endif + vpxor %%XMM7, %%XMM7, %%T2 +%ifidn %%FULL_PARTIAL, full + vpxor %%XMM8, %%XMM8, %%T3 +%endif + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*6], %%XMM7 +%ifidn %%FULL_PARTIAL, full + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*7], %%XMM8 +%endif + vpshufb %%XMM7, %%T2, [rel SHUF_MASK] ; perform a 16Byte swap +%ifidn %%FULL_PARTIAL, full + vpshufb %%XMM8, %%T3, [rel SHUF_MASK] ; perform a 16Byte swap +%else + vpshufb %%XMM8, %%XMM8, [rel SHUF_MASK] ; perform a 16Byte swap +%endif + +%endif ;; encrypt/decrypt + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vpslldq %%T3, %%T6, 8 ; shift-L %%T3 2 DWs + vpsrldq %%T6, %%T6, 8 ; shift-R %%T2 2 DWs + vpxor %%T7, %%T7, %%T3 + vpxor %%T1, %%T1, %%T6 ; accumulate the results in %%T1:%%T7 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;first phase of the reduction + vmovdqa %%T3, [rel POLY2] + + vpclmulqdq %%T2, %%T3, %%T7, 0x01 + vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs + + vpxor %%T7, %%T7, %%T2 ; first phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;second phase of the reduction + vpclmulqdq %%T2, %%T3, %%T7, 0x00 + vpsrldq %%T2, %%T2, 4 ; shift-R xmm2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + + vpclmulqdq %%T4, %%T3, %%T7, 0x10 + vpslldq %%T4, %%T4, 4 ; shift-L xmm0 1 DW (Shift-L 1-DW to obtain result with no shifts) + + vpxor %%T4, %%T4, %%T2 ; second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%T1, %%T1, %%T4 ; the result is in %%T1 + + vpxor %%XMM1, %%XMM1, %%T1 + +%endmacro ; GHASH_8_ENCRYPT_8_PARALLEL + +; encrypt 16 blocks at a time +; ghash the 16 previously encrypted ciphertext blocks +; %%GDATA (KEY), %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN are used as pointers only, not modified +; %%DATA_OFFSET is the data offset value +%macro GHASH_16_ENCRYPT_16_PARALLEL 23 +%define %%GDATA %1 +%define %%CIPH_PLAIN_OUT %2 +%define %%PLAIN_CIPH_IN %3 +%define %%DATA_OFFSET %4 +%define %%T1 %5 +%define %%T2 %6 +%define %%T3 %7 +%define %%T4 %8 +%define %%T5 %9 +%define %%T6 %10 +%define %%CTR %11 +%define %%XMM1 %12 +%define %%XMM2 %13 +%define %%XMM3 %14 +%define %%XMM4 %15 +%define %%XMM5 %16 +%define %%XMM6 %17 +%define %%XMM7 %18 +%define %%XMM8 %19 +%define %%T7 %20 +%define %%loop_idx %21 +%define %%ENC_DEC %22 +%define %%FULL_PARTIAL %23 + +%xdefine %%YMM1 YWORD(%%XMM1) +%xdefine %%YMM2 YWORD(%%XMM2) +%xdefine %%YMM3 YWORD(%%XMM3) +%xdefine %%YMM4 YWORD(%%XMM4) +%xdefine %%YMM5 YWORD(%%XMM5) +%xdefine %%YMM6 YWORD(%%XMM6) +%xdefine %%YMM7 YWORD(%%XMM7) +%xdefine %%YMM8 YWORD(%%XMM8) + +%ifidn %%loop_idx, in_order + vpshufb %%CTR, %%CTR, [rel SHUF_MASK] + vinserti128 YWORD(%%CTR), %%CTR, 1 + vpaddd %%YMM1, YWORD(%%CTR), [rel ONE_TWO] ; INCR CNT + vmovdqa YWORD(%%T5), [rel TWO_TWO] + vpaddd %%YMM2, %%YMM1, YWORD(%%T5) + vpaddd %%YMM3, %%YMM2, YWORD(%%T5) + vpaddd %%YMM4, %%YMM3, YWORD(%%T5) + vpaddd %%YMM5, %%YMM4, YWORD(%%T5) + vpaddd %%YMM6, %%YMM5, YWORD(%%T5) + vpaddd %%YMM7, %%YMM6, YWORD(%%T5) + vpaddd %%YMM8, %%YMM7, YWORD(%%T5) + + vmovdqa YWORD(%%T5), [rel SHUF_MASK] + vpshufb %%YMM1, %%YMM1, YWORD(%%T5) + vpshufb %%YMM2, %%YMM2, YWORD(%%T5) + vpshufb %%YMM3, %%YMM3, YWORD(%%T5) + vpshufb %%YMM4, %%YMM4, YWORD(%%T5) + vpshufb %%YMM5, %%YMM5, YWORD(%%T5) + vpshufb %%YMM6, %%YMM6, YWORD(%%T5) + vpshufb %%YMM7, %%YMM7, YWORD(%%T5) + vpshufb %%YMM8, %%YMM8, YWORD(%%T5) + vextracti128 %%CTR, %%YMM8, 1 +%else + vinserti128 YWORD(%%CTR), %%CTR, 1 + vpaddd %%YMM1, YWORD(%%CTR), [rel ONE_TWOf] ; INCR CNT + vmovdqa YWORD(%%T5), [rel TWO_TWOf] + vpaddd %%YMM2, %%YMM1, YWORD(%%T5) + vpaddd %%YMM3, %%YMM2, YWORD(%%T5) + vpaddd %%YMM4, %%YMM3, YWORD(%%T5) + vpaddd %%YMM5, %%YMM4, YWORD(%%T5) + vpaddd %%YMM6, %%YMM5, YWORD(%%T5) + vpaddd %%YMM7, %%YMM6, YWORD(%%T5) + vpaddd %%YMM8, %%YMM7, YWORD(%%T5) + vextracti128 %%CTR, %%YMM8, 1 +%endif + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*0] + vpxor %%YMM1, %%YMM1, YWORD(%%T1) + vpxor %%YMM2, %%YMM2, YWORD(%%T1) + vpxor %%YMM3, %%YMM3, YWORD(%%T1) + vpxor %%YMM4, %%YMM4, YWORD(%%T1) + vpxor %%YMM5, %%YMM5, YWORD(%%T1) + vpxor %%YMM6, %%YMM6, YWORD(%%T1) + vpxor %%YMM7, %%YMM7, YWORD(%%T1) + vpxor %%YMM8, %%YMM8, YWORD(%%T1) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*1] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*2] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu YWORD(%%T2), [rsp + TMP1] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_16] + vpclmulqdq YWORD(%%T4), YWORD(%%T2), YWORD(%%T5), 0x11 ; %%T4 = a1*b1 + vpclmulqdq YWORD(%%T7), YWORD(%%T2), YWORD(%%T5), 0x00 ; %%T7 = a0*b0 + vpclmulqdq YWORD(%%T6), YWORD(%%T2), YWORD(%%T5), 0x01 ; %%T6 = a1*b0 + vpclmulqdq YWORD(%%T5), YWORD(%%T2), YWORD(%%T5), 0x10 ; %%T5 = a0*b1 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T5) + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*3] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + vmovdqu YWORD(%%T1), [rsp + TMP3] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_14] + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x11 + vpxor YWORD(%%T4), YWORD(%%T4), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x00 + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x01 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x10 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*4] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vmovdqu YWORD(%%T1), [rsp + TMP5] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_12] + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x11 + vpxor YWORD(%%T4), YWORD(%%T4), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x00 + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x01 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x10 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*5] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + vmovdqu YWORD(%%T1), [rsp + TMP7] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_10] + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x11 + vpxor YWORD(%%T4), YWORD(%%T4), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x00 + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x01 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x10 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*6] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + vmovdqu YWORD(%%T1), [rsp + TMP9] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_8] + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x11 + vpxor YWORD(%%T4), YWORD(%%T4), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x00 + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x01 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x10 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*7] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + vmovdqu YWORD(%%T1), [rsp + TMP11] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_6] + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x11 + vpxor YWORD(%%T4), YWORD(%%T4), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x00 + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x01 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x10 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + + vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*8] + vaesenc %%YMM1, %%YMM1, YWORD(%%T1) + vaesenc %%YMM2, %%YMM2, YWORD(%%T1) + vaesenc %%YMM3, %%YMM3, YWORD(%%T1) + vaesenc %%YMM4, %%YMM4, YWORD(%%T1) + vaesenc %%YMM5, %%YMM5, YWORD(%%T1) + vaesenc %%YMM6, %%YMM6, YWORD(%%T1) + vaesenc %%YMM7, %%YMM7, YWORD(%%T1) + vaesenc %%YMM8, %%YMM8, YWORD(%%T1) + + vmovdqu YWORD(%%T1), [rsp + TMP13] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_4] + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x11 + vpxor YWORD(%%T4), YWORD(%%T4), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x00 + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x01 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x10 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vbroadcasti128 YWORD(%%T5), [%%GDATA + 16*9] + vaesenc %%YMM1, %%YMM1, YWORD(%%T5) + vaesenc %%YMM2, %%YMM2, YWORD(%%T5) + vaesenc %%YMM3, %%YMM3, YWORD(%%T5) + vaesenc %%YMM4, %%YMM4, YWORD(%%T5) + vaesenc %%YMM5, %%YMM5, YWORD(%%T5) + vaesenc %%YMM6, %%YMM6, YWORD(%%T5) + vaesenc %%YMM7, %%YMM7, YWORD(%%T5) + vaesenc %%YMM8, %%YMM8, YWORD(%%T5) + + vmovdqu YWORD(%%T1), [rsp + TMP15] + vmovdqu YWORD(%%T5), [%%GDATA + HashKey_2] + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x00 + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x01 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x10 + vpxor YWORD(%%T6), YWORD(%%T6), YWORD(%%T3) + vpclmulqdq YWORD(%%T3), YWORD(%%T1), YWORD(%%T5), 0x11 + vpxor YWORD(%%T1), YWORD(%%T4), YWORD(%%T3) + + vbroadcasti128 YWORD(%%T5), [%%GDATA + 16*10] +%ifndef GCM128_MODE ; GCM192 or GCM256 + vaesenc %%YMM1, %%YMM1, YWORD(%%T5) + vaesenc %%YMM2, %%YMM2, YWORD(%%T5) + vaesenc %%YMM3, %%YMM3, YWORD(%%T5) + vaesenc %%YMM4, %%YMM4, YWORD(%%T5) + vaesenc %%YMM5, %%YMM5, YWORD(%%T5) + vaesenc %%YMM6, %%YMM6, YWORD(%%T5) + vaesenc %%YMM7, %%YMM7, YWORD(%%T5) + vaesenc %%YMM8, %%YMM8, YWORD(%%T5) + + vbroadcasti128 YWORD(%%T5), [%%GDATA + 16*11] + vaesenc %%YMM1, %%YMM1, YWORD(%%T5) + vaesenc %%YMM2, %%YMM2, YWORD(%%T5) + vaesenc %%YMM3, %%YMM3, YWORD(%%T5) + vaesenc %%YMM4, %%YMM4, YWORD(%%T5) + vaesenc %%YMM5, %%YMM5, YWORD(%%T5) + vaesenc %%YMM6, %%YMM6, YWORD(%%T5) + vaesenc %%YMM7, %%YMM7, YWORD(%%T5) + vaesenc %%YMM8, %%YMM8, YWORD(%%T5) + + vbroadcasti128 YWORD(%%T5), [%%GDATA + 16*12] +%endif +%ifdef GCM256_MODE + vaesenc %%YMM1, %%YMM1, YWORD(%%T5) + vaesenc %%YMM2, %%YMM2, YWORD(%%T5) + vaesenc %%YMM3, %%YMM3, YWORD(%%T5) + vaesenc %%YMM4, %%YMM4, YWORD(%%T5) + vaesenc %%YMM5, %%YMM5, YWORD(%%T5) + vaesenc %%YMM6, %%YMM6, YWORD(%%T5) + vaesenc %%YMM7, %%YMM7, YWORD(%%T5) + vaesenc %%YMM8, %%YMM8, YWORD(%%T5) + + vbroadcasti128 YWORD(%%T5), [%%GDATA + 16*13] + vaesenc %%YMM1, %%YMM1, YWORD(%%T5) + vaesenc %%YMM2, %%YMM2, YWORD(%%T5) + vaesenc %%YMM3, %%YMM3, YWORD(%%T5) + vaesenc %%YMM4, %%YMM4, YWORD(%%T5) + vaesenc %%YMM5, %%YMM5, YWORD(%%T5) + vaesenc %%YMM6, %%YMM6, YWORD(%%T5) + vaesenc %%YMM7, %%YMM7, YWORD(%%T5) + vaesenc %%YMM8, %%YMM8, YWORD(%%T5) + + vbroadcasti128 YWORD(%%T5), [%%GDATA + 16*14] +%endif ; GCM256 + + ;; the last round, %%T5 holds the key + vaesenclast %%YMM1, %%YMM1, YWORD(%%T5) + vaesenclast %%YMM2, %%YMM2, YWORD(%%T5) + vaesenclast %%YMM3, %%YMM3, YWORD(%%T5) + vaesenclast %%YMM4, %%YMM4, YWORD(%%T5) + vaesenclast %%YMM5, %%YMM5, YWORD(%%T5) + vaesenclast %%YMM6, %%YMM6, YWORD(%%T5) + vaesenclast %%YMM7, %%YMM7, YWORD(%%T5) + vaesenclast %%YMM8, %%YMM8, YWORD(%%T5) + +%ifidn %%ENC_DEC, ENC + vpxor %%YMM1, %%YMM1, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*0] + vpxor %%YMM2, %%YMM2, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*2] + vpxor %%YMM3, %%YMM3, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*4] + vpxor %%YMM4, %%YMM4, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*6] + vpxor %%YMM5, %%YMM5, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*8] + vpxor %%YMM6, %%YMM6, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*10] + vpxor %%YMM7, %%YMM7, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*12] + vpxor %%YMM8, %%YMM8, [%%PLAIN_CIPH_IN + %%DATA_OFFSET + 16*14] + + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*0], %%YMM1 + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*2], %%YMM2 + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*4], %%YMM3 + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*6], %%YMM4 + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*8], %%YMM5 + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*10], %%YMM6 + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*12], %%YMM7 + vmovdqu [%%CIPH_PLAIN_OUT + %%DATA_OFFSET+16*14], %%YMM8 + + vpshufb %%YMM1, %%YMM1, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM2, %%YMM2, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM3, %%YMM3, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM4, %%YMM4, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM5, %%YMM5, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM6, %%YMM6, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM7, %%YMM7, [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM8, %%YMM8, [rel SHUF_MASK] ; perform a 16Byte swap + +%else + ;; decrypt direction + vmovdqu YWORD(%%T2), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*0] + vmovdqu YWORD(%%T3), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*2] + vpxor %%YMM1, %%YMM1, YWORD(%%T2) + vpxor %%YMM2, %%YMM2, YWORD(%%T3) + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*0], %%YMM1 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*2], %%YMM2 + vpshufb %%YMM1, YWORD(%%T2), [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM2, YWORD(%%T3), [rel SHUF_MASK] ; perform a 16Byte swap + + vmovdqu YWORD(%%T2), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*4] + vmovdqu YWORD(%%T3), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*6] + vpxor %%YMM3, %%YMM3, YWORD(%%T2) + vpxor %%YMM4, %%YMM4, YWORD(%%T3) + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*4], %%YMM3 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*6], %%YMM4 + vpshufb %%YMM3, YWORD(%%T2), [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM4, YWORD(%%T3), [rel SHUF_MASK] ; perform a 16Byte swap + + vmovdqu YWORD(%%T2), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*8] + vmovdqu YWORD(%%T3), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*10] + vpxor %%YMM5, %%YMM5, YWORD(%%T2) + vpxor %%YMM6, %%YMM6, YWORD(%%T3) + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*8], %%YMM5 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*10], %%YMM6 + vpshufb %%YMM5, YWORD(%%T2), [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM6, YWORD(%%T3), [rel SHUF_MASK] ; perform a 16Byte swap + + vmovdqu YWORD(%%T2), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*12] + vmovdqu YWORD(%%T3), [%%PLAIN_CIPH_IN+%%DATA_OFFSET+16*14] + vpxor %%YMM7, %%YMM7, YWORD(%%T2) + vpxor %%YMM8, %%YMM8, YWORD(%%T3) + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*12], %%YMM7 + vmovdqu [%%CIPH_PLAIN_OUT+%%DATA_OFFSET+16*14], %%YMM8 + vpshufb %%YMM7, YWORD(%%T2), [rel SHUF_MASK] ; perform a 16Byte swap + vpshufb %%YMM8, YWORD(%%T3), [rel SHUF_MASK] ; perform a 16Byte swap + +%endif ;; encrypt/decrypt + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + vpslldq YWORD(%%T3), YWORD(%%T6), 8 ; shift-L %%T3 2 DWs + vpsrldq YWORD(%%T6), YWORD(%%T6), 8 ; shift-R %%T2 2 DWs + vpxor YWORD(%%T7), YWORD(%%T7), YWORD(%%T3) + vpxor YWORD(%%T1), YWORD(%%T1), YWORD(%%T6) ; accumulate the results in %%T1:%%T7 + + vextracti128 %%T3, YWORD(%%T7), 1 + vextracti128 %%T6, YWORD(%%T1), 1 + vpxor %%T7, %%T7, %%T3 + vpxor %%T1, %%T1, %%T6 + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;first phase of the reduction + vmovdqa %%T3, [rel POLY2] + + vpclmulqdq %%T2, %%T3, %%T7, 0x01 + vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs + + vpxor %%T7, %%T7, %%T2 ; first phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;second phase of the reduction + vpclmulqdq %%T2, %%T3, %%T7, 0x00 + vpsrldq %%T2, %%T2, 4 ; shift-R xmm2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + + vpclmulqdq %%T4, %%T3, %%T7, 0x10 + vpslldq %%T4, %%T4, 4 ; shift-L xmm0 1 DW (Shift-L 1-DW to obtain result with no shifts) + + vpxor %%T4, %%T4, %%T2 ; second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%T1, %%T1, %%T4 ; the result is in %%T1 + + vpxor %%YMM1, %%YMM1, YWORD(%%T1) + + vmovdqa [rsp + TMP1], %%YMM1 + vmovdqa [rsp + TMP3], %%YMM2 + vmovdqa [rsp + TMP5], %%YMM3 + vmovdqa [rsp + TMP7], %%YMM4 + vmovdqa [rsp + TMP9], %%YMM5 + vmovdqa [rsp + TMP11], %%YMM6 + vmovdqa [rsp + TMP13], %%YMM7 + vmovdqa [rsp + TMP15], %%YMM8 +%endmacro ; GHASH_16_ENCRYPT_16_PARALLEL + +; GHASH the last 4 ciphertext blocks. +%macro GHASH_LAST_8 16 +%define %%GDATA %1 +%define %%T1 %2 +%define %%T2 %3 +%define %%T3 %4 +%define %%T4 %5 +%define %%T5 %6 +%define %%T6 %7 +%define %%T7 %8 +%define %%XMM1 %9 +%define %%XMM2 %10 +%define %%XMM3 %11 +%define %%XMM4 %12 +%define %%XMM5 %13 +%define %%XMM6 %14 +%define %%XMM7 %15 +%define %%XMM8 %16 + + ;; Karatsuba Method + + vmovdqu %%T5, [%%GDATA + HashKey_8] + + vpshufd %%T2, %%XMM1, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM1 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T6, %%XMM1, %%T5, 0x11 + vpclmulqdq %%T7, %%XMM1, %%T5, 0x00 + + vpclmulqdq %%XMM1, %%T2, %%T3, 0x00 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_7] + vpshufd %%T2, %%XMM2, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM2 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM2, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM2, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_6] + vpshufd %%T2, %%XMM3, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM3 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM3, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM3, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_5] + vpshufd %%T2, %%XMM4, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM4 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM4, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM4, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_4] + vpshufd %%T2, %%XMM5, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM5 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM5, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM5, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_3] + vpshufd %%T2, %%XMM6, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM6 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM6, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM6, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_2] + vpshufd %%T2, %%XMM7, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM7 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM7, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM7, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey] + vpshufd %%T2, %%XMM8, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM8 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM8, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM8, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + vpxor %%XMM1, %%XMM1, %%T6 + vpxor %%T2, %%XMM1, %%T7 + + vpslldq %%T4, %%T2, 8 + vpsrldq %%T2, %%T2, 8 + + vpxor %%T7, %%T7, %%T4 + vpxor %%T6, %%T6, %%T2 ; <%%T6:%%T7> holds the result of the accumulated carry-less multiplications + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;first phase of the reduction + vmovdqa %%T3, [rel POLY2] + + vpclmulqdq %%T2, %%T3, %%T7, 0x01 + vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs + + vpxor %%T7, %%T7, %%T2 ; first phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ;second phase of the reduction + vpclmulqdq %%T2, %%T3, %%T7, 0x00 + vpsrldq %%T2, %%T2, 4 ; shift-R %%T2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + + vpclmulqdq %%T4, %%T3, %%T7, 0x10 + vpslldq %%T4, %%T4, 4 ; shift-L %%T4 1 DW (Shift-L 1-DW to obtain result with no shifts) + + vpxor %%T4, %%T4, %%T2 ; second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%T6, %%T6, %%T4 ; the result is in %%T6 +%endmacro + +; GHASH the last 4 ciphertext blocks. +%macro GHASH_LAST_7 15 +%define %%GDATA %1 +%define %%T1 %2 +%define %%T2 %3 +%define %%T3 %4 +%define %%T4 %5 +%define %%T5 %6 +%define %%T6 %7 +%define %%T7 %8 +%define %%XMM1 %9 +%define %%XMM2 %10 +%define %%XMM3 %11 +%define %%XMM4 %12 +%define %%XMM5 %13 +%define %%XMM6 %14 +%define %%XMM7 %15 + + ;; Karatsuba Method + + vmovdqu %%T5, [%%GDATA + HashKey_7] + + vpshufd %%T2, %%XMM1, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM1 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T6, %%XMM1, %%T5, 0x11 + vpclmulqdq %%T7, %%XMM1, %%T5, 0x00 + + vpclmulqdq %%XMM1, %%T2, %%T3, 0x00 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_6] + vpshufd %%T2, %%XMM2, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM2 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM2, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM2, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_5] + vpshufd %%T2, %%XMM3, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM3 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM3, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM3, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_4] + vpshufd %%T2, %%XMM4, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM4 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM4, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM4, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_3] + vpshufd %%T2, %%XMM5, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM5 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM5, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM5, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_2] + vpshufd %%T2, %%XMM6, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM6 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM6, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM6, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vmovdqu %%T5, [%%GDATA + HashKey_1] + vpshufd %%T2, %%XMM7, 01001110b + vpshufd %%T3, %%T5, 01001110b + vpxor %%T2, %%T2, %%XMM7 + vpxor %%T3, %%T3, %%T5 + + vpclmulqdq %%T4, %%XMM7, %%T5, 0x11 + vpxor %%T6, %%T6, %%T4 + + vpclmulqdq %%T4, %%XMM7, %%T5, 0x00 + vpxor %%T7, %%T7, %%T4 + + vpclmulqdq %%T2, %%T2, %%T3, 0x00 + + vpxor %%XMM1, %%XMM1, %%T2 + + ;;;;;;;;;;;;;;;;;;;;;; + + vpxor %%XMM1, %%XMM1, %%T6 + vpxor %%T2, %%XMM1, %%T7 + + vpslldq %%T4, %%T2, 8 + vpsrldq %%T2, %%T2, 8 + + vpxor %%T7, %%T7, %%T4 + vpxor %%T6, %%T6, %%T2 ; <%%T6:%%T7> holds the result of the accumulated carry-less multiplications + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;first phase of the reduction + vmovdqa %%T3, [rel POLY2] + + vpclmulqdq %%T2, %%T3, %%T7, 0x01 + vpslldq %%T2, %%T2, 8 ; shift-L xmm2 2 DWs + + vpxor %%T7, %%T7, %%T2 ; first phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ;second phase of the reduction + vpclmulqdq %%T2, %%T3, %%T7, 0x00 + vpsrldq %%T2, %%T2, 4 ; shift-R %%T2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) + + vpclmulqdq %%T4, %%T3, %%T7, 0x10 + vpslldq %%T4, %%T4, 4 ; shift-L %%T4 1 DW (Shift-L 1-DW to obtain result with no shifts) + + vpxor %%T4, %%T4, %%T2 ; second phase of the reduction complete + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vpxor %%T6, %%T6, %%T4 ; the result is in %%T6 +%endmacro + +;;; Handle encryption of the final partial block +;;; IN: +;;; r13 - Number of bytes to read +;;; MODIFIES: +;;; KEY - Key for encrypting the partial block +;;; HASH - Current hash value +;;; SMASHES: +;;; r10, r12, r15, rax +;;; T1, T2 +;;; Note: +;;; PLAIN_CIPH_LEN, %7, is passed only to determine +;;; if buffer is big enough to do a 16 byte read & shift. +;;; 'LT16' is passed here only if buffer is known to be smaller +;;; than 16 bytes. +;;; Any other value passed here will result in 16 byte read +;;; code path. +;;; TBD: Remove HASH from the instantiation +%macro ENCRYPT_FINAL_PARTIAL_BLOCK 8 +%define %%KEY %1 +%define %%T1 %2 +%define %%T2 %3 +%define %%CIPH_PLAIN_OUT %4 +%define %%PLAIN_CIPH_IN %5 +%define %%PLAIN_CIPH_LEN %6 +%define %%ENC_DEC %7 +%define %%DATA_OFFSET %8 + + ;; NOTE: type of read tuned based %%PLAIN_CIPH_LEN setting +%ifidn %%PLAIN_CIPH_LEN, LT16 + ;; Handle the case where the message is < 16 bytes + lea r10, [%%PLAIN_CIPH_IN + %%DATA_OFFSET] + + ;; T1 - packed output + ;; r10 - input data address + ;; r13 - input data length + ;; r12, r15, rax - temp registers + READ_SMALL_DATA_INPUT_AVX %%T1, r10, r13, r12 + + lea r12, [SHIFT_MASK + 16] + sub r12, r13 +%else + ;; Handle the case where the message is >= 16 bytes + sub %%DATA_OFFSET, 16 + add %%DATA_OFFSET, r13 + ;; Receive the last <16 Byte block + vmovdqu %%T1, [%%PLAIN_CIPH_IN+%%DATA_OFFSET] + sub %%DATA_OFFSET, r13 + add %%DATA_OFFSET, 16 + + lea r12, [SHIFT_MASK + 16] + ;; Adjust the shuffle mask pointer to be able to shift 16-r13 bytes + ;; (r13 is the number of bytes in plaintext mod 16) + sub r12, r13 + ;; Get the appropriate shuffle mask + vmovdqu %%T2, [r12] + ;; shift right 16-r13 bytes + vpshufb %%T1, %%T2 +%endif ; %%PLAIN_CIPH_LEN, LT16 + + ;; At this point T1 contains the partial block data +%ifidn %%ENC_DEC, DEC + ;; Plaintext XOR E(K, Yn) + ;; Set aside the ciphertext + vmovdqa %%T2, %%T1 + vpxor %%KEY, %%KEY, %%T1 + ;; Get the appropriate mask to mask out top 16-r13 bytes of ciphertext + vmovdqu %%T1, [r12 + ALL_F - SHIFT_MASK] + ;; Mask out top 16-r13 bytes of ciphertext + vpand %%KEY, %%KEY, %%T1 + + ;; Prepare the ciphertext for the hash + ;; mask out top 16-r13 bytes of the plaintext + vpand %%T2, %%T2, %%T1 +%else + ;; Plaintext XOR E(K, Yn) + vpxor %%KEY, %%KEY, %%T1 + ;; Get the appropriate mask to mask out top 16-r13 bytes of %%KEY + vmovdqu %%T1, [r12 + ALL_F - SHIFT_MASK] + ;; Mask out top 16-r13 bytes of %%KEY + vpand %%KEY, %%KEY, %%T1 +%endif + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Output r13 Bytes + vmovq rax, %%KEY + cmp r13, 8 + jle %%_less_than_8_bytes_left + + mov [%%CIPH_PLAIN_OUT + %%DATA_OFFSET], rax + add %%DATA_OFFSET, 8 + vpsrldq %%T1, %%KEY, 8 + vmovq rax, %%T1 + sub r13, 8 + +%%_less_than_8_bytes_left: + mov BYTE [%%CIPH_PLAIN_OUT + %%DATA_OFFSET], al + add %%DATA_OFFSET, 1 + shr rax, 8 + sub r13, 1 + jne %%_less_than_8_bytes_left + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%ifidn %%ENC_DEC, DEC + ;; If decrypt, restore the ciphertext into %%KEY + vmovdqu %%KEY, %%T2 +%endif +%endmacro ; ENCRYPT_FINAL_PARTIAL_BLOCK + +; Encryption of a single block +%macro ENCRYPT_SINGLE_BLOCK 2 +%define %%GDATA %1 +%define %%XMM0 %2 + + vpxor %%XMM0, %%XMM0, [%%GDATA+16*0] +%assign i 1 +%rep NROUNDS + vaesenc %%XMM0, [%%GDATA+16*i] +%assign i (i+1) +%endrep + vaesenclast %%XMM0, [%%GDATA+16*i] +%endmacro + +;; Start of Stack Setup + +%macro FUNC_SAVE 0-1 + ;; Required for Update/GCM_ENC + mov rax, rsp + +%if %0 == 0 + sub rsp, VARIABLE_OFFSET +%else +%ifidni %1, alloc_context + sub rsp, VARIABLE_OFFSET + CONTEXT_SIZE +%endif +%endif + and rsp, ~63 + + mov [rsp + GP_OFFSET + 0*8], rax ; original rsp pointer + mov [rsp + GP_OFFSET + 1*8], r12 + mov [rsp + GP_OFFSET + 2*8], r13 + mov [rsp + GP_OFFSET + 3*8], r14 + mov [rsp + GP_OFFSET + 4*8], r15 + mov r14, rax + +%ifidn __OUTPUT_FORMAT__, win64 + ; xmm6:xmm15 need to be maintained for Windows + vmovdqu [rsp + LOCAL_STORAGE + 0*16], xmm6 + vmovdqu [rsp + LOCAL_STORAGE + 1*16], xmm7 + vmovdqu [rsp + LOCAL_STORAGE + 2*16], xmm8 + vmovdqu [rsp + LOCAL_STORAGE + 3*16], xmm9 + vmovdqu [rsp + LOCAL_STORAGE + 4*16], xmm10 + vmovdqu [rsp + LOCAL_STORAGE + 5*16], xmm11 + vmovdqu [rsp + LOCAL_STORAGE + 6*16], xmm12 + vmovdqu [rsp + LOCAL_STORAGE + 7*16], xmm13 + vmovdqu [rsp + LOCAL_STORAGE + 8*16], xmm14 + vmovdqu [rsp + LOCAL_STORAGE + 9*16], xmm15 +%endif +%endmacro + +%macro FUNC_RESTORE 0 + +%ifdef SAFE_DATA + clear_scratch_xmms_avx_asm +%endif +%ifidn __OUTPUT_FORMAT__, win64 + vmovdqu xmm15, [rsp + LOCAL_STORAGE + 9*16] + vmovdqu xmm14, [rsp + LOCAL_STORAGE + 8*16] + vmovdqu xmm13, [rsp + LOCAL_STORAGE + 7*16] + vmovdqu xmm12, [rsp + LOCAL_STORAGE + 6*16] + vmovdqu xmm11, [rsp + LOCAL_STORAGE + 5*16] + vmovdqu xmm10, [rsp + LOCAL_STORAGE + 4*16] + vmovdqu xmm9, [rsp + LOCAL_STORAGE + 3*16] + vmovdqu xmm8, [rsp + LOCAL_STORAGE + 2*16] + vmovdqu xmm7, [rsp + LOCAL_STORAGE + 1*16] + vmovdqu xmm6, [rsp + LOCAL_STORAGE + 0*16] +%endif + + ;; Required for Update/GCM_ENC + mov r12, [rsp + GP_OFFSET + 1*8] + mov r13, [rsp + GP_OFFSET + 2*8] + mov r14, [rsp + GP_OFFSET + 3*8] + mov r15, [rsp + GP_OFFSET + 4*8] + mov rsp, [rsp + GP_OFFSET + 0*8] +%endmacro + +%macro CALC_J0 15 +%define %%KEY %1 ;; [in] Pointer to GCM KEY structure +%define %%IV %2 ;; [in] Pointer to IV +%define %%IV_LEN %3 ;; [in] IV length +%define %%J0 %4 ;; [out] XMM reg to contain J0 +%define %%TMP0 %5 ;; [clobbered] Temporary GP reg +%define %%TMP1 %6 ;; [clobbered] Temporary GP reg +%define %%TMP2 %7 ;; [clobbered] Temporary GP reg +%define %%TMP3 %8 ;; [clobbered] Temporary GP reg +%define %%TMP4 %9 ;; [clobbered] Temporary GP reg +%define %%XTMP0 %10 ;; [clobbered] Temporary XMM reg +%define %%XTMP1 %11 ;; [clobbered] Temporary XMM reg +%define %%XTMP2 %12 ;; [clobbered] Temporary XMM reg +%define %%XTMP3 %13 ;; [clobbered] Temporary XMM reg +%define %%XTMP4 %14 ;; [clobbered] Temporary XMM reg +%define %%XTMP5 %15 ;; [clobbered] Temporary XMM reg + + ;; J0 = GHASH(IV || 0s+64 || len(IV)64) + ;; s = 16 * RoundUp(len(IV)/16) - len(IV) */ + + ;; Calculate GHASH of (IV || 0s) + vpxor %%J0, %%J0 + CALC_AAD_HASH %%IV, %%IV_LEN, %%J0, %%KEY, %%XTMP0, %%XTMP1, %%XTMP2, \ + %%XTMP3, %%XTMP4, %%XTMP5, %%TMP0, %%TMP1, %%TMP2, %%TMP3, %%TMP4 + + ;; Calculate GHASH of last 16-byte block (0 || len(IV)64) + vmovdqu %%XTMP0, [%%KEY + HashKey] + mov %%TMP2, %%IV_LEN + shl %%TMP2, 3 ;; IV length in bits + vmovq %%XTMP1, %%TMP2 + vpxor %%J0, %%XTMP1 + GHASH_MUL %%J0, %%XTMP0, %%XTMP1, %%XTMP2, %%XTMP3, %%XTMP4, %%XTMP5 + + vpshufb %%J0, [rel SHUF_MASK] ; perform a 16Byte swap +%endmacro + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; GCM_INIT initializes a gcm_context_data struct to prepare for encoding/decoding. +; Input: gcm_key_data * (GDATA_KEY), gcm_context_data *(GDATA_CTX), IV, IV_LEN, +; Additional Authentication data (A_IN), Additional Data length (A_LEN). +; Output: Updated GDATA_CTX with the hash of A_IN (AadHash) and initialized other parts of GDATA. +; Clobbers rax, r10-r13 and xmm0-xmm6 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro GCM_INIT 5-6 +%define %%GDATA_KEY %1 ; [in] Pointer to GCM Key data structure +%define %%GDATA_CTX %2 ; [in/out] Pointer to GCM Context data structure +%define %%IV %3 ; [in] Pointer to IV +%define %%A_IN %4 ; [in] Pointer to AAD +%define %%A_LEN %5 ; [in] AAD length +%define %%IV_LEN %6 ; [in] IV length + +%define %%AAD_HASH xmm14 + + mov r10, %%A_LEN + cmp r10, 0 + je %%_aad_is_zero + + vpxor %%AAD_HASH, %%AAD_HASH + CALC_AAD_HASH %%A_IN, %%A_LEN, %%AAD_HASH, %%GDATA_KEY, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, r10, r11, r12, r13, rax + jmp %%_after_aad + +%%_aad_is_zero: + vpxor %%AAD_HASH, %%AAD_HASH + +%%_after_aad: + mov r10, %%A_LEN + vpxor xmm2, xmm3 + + vmovdqu [%%GDATA_CTX + AadHash], %%AAD_HASH ; ctx_data.aad hash = aad_hash + mov [%%GDATA_CTX + AadLen], r10 ; ctx_data.aad_length = aad_length + xor r10, r10 + mov [%%GDATA_CTX + InLen], r10 ; ctx_data.in_length = 0 + mov [%%GDATA_CTX + PBlockLen], r10 ; ctx_data.partial_block_length = 0 + vmovdqu [%%GDATA_CTX + PBlockEncKey], xmm2 ; ctx_data.partial_block_enc_key = 0 + mov r10, %%IV +%if %0 == 6 ;; IV is different than 12 bytes + CALC_J0 %%GDATA_KEY, %%IV, %%IV_LEN, xmm2, r10, r11, r12, r13, rax, xmm1, xmm0, \ + xmm3, xmm4, xmm5, xmm6 +%else ;; IV is 12 bytes + vmovdqa xmm2, [rel ONEf] ; read 12 IV bytes and pad with 0x00000001 + vpinsrq xmm2, [r10], 0 + vpinsrd xmm2, [r10+8], 2 +%endif + vmovdqu [%%GDATA_CTX + OrigIV], xmm2 ; ctx_data.orig_IV = iv + + vpshufb xmm2, [rel SHUF_MASK] + + vmovdqu [%%GDATA_CTX + CurCount], xmm2 ; ctx_data.current_counter = iv +%endmacro + +%macro GCM_ENC_DEC_SMALL 12 +%define %%GDATA_KEY %1 +%define %%GDATA_CTX %2 +%define %%CIPH_PLAIN_OUT %3 +%define %%PLAIN_CIPH_IN %4 +%define %%PLAIN_CIPH_LEN %5 +%define %%ENC_DEC %6 +%define %%DATA_OFFSET %7 +%define %%LENGTH %8 +%define %%NUM_BLOCKS %9 +%define %%CTR %10 +%define %%HASH %11 +%define %%INSTANCE_TYPE %12 + + ;; NOTE: the check below is obsolete in current implementation. The check is already done in GCM_ENC_DEC. + ;; cmp %%NUM_BLOCKS, 0 + ;; je %%_small_initial_blocks_encrypted + cmp %%NUM_BLOCKS, 8 + je %%_small_initial_num_blocks_is_8 + cmp %%NUM_BLOCKS, 7 + je %%_small_initial_num_blocks_is_7 + cmp %%NUM_BLOCKS, 6 + je %%_small_initial_num_blocks_is_6 + cmp %%NUM_BLOCKS, 5 + je %%_small_initial_num_blocks_is_5 + cmp %%NUM_BLOCKS, 4 + je %%_small_initial_num_blocks_is_4 + cmp %%NUM_BLOCKS, 3 + je %%_small_initial_num_blocks_is_3 + cmp %%NUM_BLOCKS, 2 + je %%_small_initial_num_blocks_is_2 + + jmp %%_small_initial_num_blocks_is_1 + +%%_small_initial_num_blocks_is_8: + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 8, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + jmp %%_small_initial_blocks_encrypted + +%%_small_initial_num_blocks_is_7: + ;; r13 - %%LENGTH + ;; xmm12 - T1 + ;; xmm13 - T2 + ;; xmm14 - T3 - AAD HASH OUT when not producing 8 AES keys + ;; xmm15 - T4 + ;; xmm11 - T5 + ;; xmm9 - CTR + ;; xmm1 - XMM1 - Cipher + Hash when producing 8 AES keys + ;; xmm2 - XMM2 + ;; xmm3 - XMM3 + ;; xmm4 - XMM4 + ;; xmm5 - XMM5 + ;; xmm6 - XMM6 + ;; xmm7 - XMM7 + ;; xmm8 - XMM8 - AAD HASH IN + ;; xmm10 - T6 + ;; xmm0 - T_key + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 7, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + jmp %%_small_initial_blocks_encrypted + +%%_small_initial_num_blocks_is_6: + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 6, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + jmp %%_small_initial_blocks_encrypted + +%%_small_initial_num_blocks_is_5: + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 5, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + jmp %%_small_initial_blocks_encrypted + +%%_small_initial_num_blocks_is_4: + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 4, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + jmp %%_small_initial_blocks_encrypted + +%%_small_initial_num_blocks_is_3: + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 3, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + jmp %%_small_initial_blocks_encrypted + +%%_small_initial_num_blocks_is_2: + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 2, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + jmp %%_small_initial_blocks_encrypted + +%%_small_initial_num_blocks_is_1: + INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 1, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC, %%INSTANCE_TYPE + + ;; Note: zero initial blocks not allowed. + +%%_small_initial_blocks_encrypted: + +%endmacro ; GCM_ENC_DEC_SMALL + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; GCM_ENC_DEC Encodes/Decodes given data. Assumes that the passed gcm_context_data struct +; has been initialized by GCM_INIT +; Requires the input data be at least 1 byte long because of READ_SMALL_INPUT_DATA. +; Input: gcm_key_data struct* (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CIPH_IN), +; input text length (PLAIN_CIPH_LEN) and whether encoding or decoding (ENC_DEC). +; Output: A cipher of the given plain text (CIPH_PLAIN_OUT), and updated GDATA_CTX +; Clobbers rax, r10-r15, and xmm0-xmm15 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro GCM_ENC_DEC 7 +%define %%GDATA_KEY %1 +%define %%GDATA_CTX %2 +%define %%CIPH_PLAIN_OUT %3 +%define %%PLAIN_CIPH_IN %4 +%define %%PLAIN_CIPH_LEN %5 +%define %%ENC_DEC %6 +%define %%INSTANCE_TYPE %7 +%define %%DATA_OFFSET r11 + +; Macro flow: +; calculate the number of 16byte blocks in the message +; process (number of 16byte blocks) mod 8 '%%_initial_num_blocks_is_# .. %%_initial_blocks_encrypted' +; process 8 16 byte blocks at a time until all are done '%%_encrypt_by_8_new .. %%_eight_cipher_left' +; if there is a block of less than 16 bytes process it '%%_zero_cipher_left .. %%_multiple_of_16_bytes' + + cmp %%PLAIN_CIPH_LEN, 0 + je %%_enc_dec_done + + xor %%DATA_OFFSET, %%DATA_OFFSET + ;; Update length of data processed +%ifidn __OUTPUT_FORMAT__, win64 + mov rax, %%PLAIN_CIPH_LEN + add [%%GDATA_CTX + InLen], rax +%else + add [%%GDATA_CTX + InLen], %%PLAIN_CIPH_LEN +%endif + vmovdqu xmm13, [%%GDATA_KEY + HashKey] + vmovdqu xmm8, [%%GDATA_CTX + AadHash] + +%ifidn %%INSTANCE_TYPE, multi_call + ;; NOTE: partial block processing makes only sense for multi_call here. + ;; Used for the update flow - if there was a previous partial + ;; block fill the remaining bytes here. + PARTIAL_BLOCK %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%PLAIN_CIPH_LEN, %%DATA_OFFSET, xmm8, xmm13, %%ENC_DEC +%endif + + ;; lift CTR set from initial_blocks to here +%ifidn %%INSTANCE_TYPE, single_call + vmovdqu xmm9, xmm2 +%else + vmovdqu xmm9, [%%GDATA_CTX + CurCount] +%endif + + ;; Save the amount of data left to process in r10 + mov r13, %%PLAIN_CIPH_LEN +%ifidn %%INSTANCE_TYPE, multi_call + ;; NOTE: %%DATA_OFFSET is zero in single_call case. + ;; Consequently PLAIN_CIPH_LEN will never be zero after + ;; %%DATA_OFFSET subtraction below. + sub r13, %%DATA_OFFSET + + ;; There may be no more data if it was consumed in the partial block. + cmp r13, 0 + je %%_enc_dec_done +%endif ; %%INSTANCE_TYPE, multi_call + mov r10, r13 + + ;; Determine how many blocks to process in INITIAL + mov r12, r13 + shr r12, 4 + and r12, 7 + + ;; Process one additional block in INITIAL if there is a partial block + and r10, 0xf + blsmsk r10, r10 ; Set CF if zero + cmc ; Flip CF + adc r12, 0x0 ; Process an additional INITIAL block if CF set + + ;; Less than 127B will be handled by the small message code, which + ;; can process up to 7 16B blocks. + cmp r13, 128 + jae %%_large_message_path + + GCM_ENC_DEC_SMALL %%GDATA_KEY, %%GDATA_CTX, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%PLAIN_CIPH_LEN, %%ENC_DEC, %%DATA_OFFSET, r13, r12, xmm9, xmm14, %%INSTANCE_TYPE + jmp %%_ghash_done + +%%_large_message_path: + and r12, 0x7 ; Still, don't allow 8 INITIAL blocks since this will + ; can be handled by the x8 partial loop. + + cmp r12, 0 + je %%_initial_num_blocks_is_0 + cmp r12, 7 + je %%_initial_num_blocks_is_7 + cmp r12, 6 + je %%_initial_num_blocks_is_6 + cmp r12, 5 + je %%_initial_num_blocks_is_5 + cmp r12, 4 + je %%_initial_num_blocks_is_4 + cmp r12, 3 + je %%_initial_num_blocks_is_3 + cmp r12, 2 + je %%_initial_num_blocks_is_2 + + jmp %%_initial_num_blocks_is_1 + +%%_initial_num_blocks_is_7: + ;; r13 - %%LENGTH + ;; xmm12 - T1 + ;; xmm13 - T2 + ;; xmm14 - T3 - AAD HASH OUT when not producing 8 AES keys + ;; xmm15 - T4 + ;; xmm11 - T5 + ;; xmm9 - CTR + ;; xmm1 - XMM1 - Cipher + Hash when producing 8 AES keys + ;; xmm2 - XMM2 + ;; xmm3 - XMM3 + ;; xmm4 - XMM4 + ;; xmm5 - XMM5 + ;; xmm6 - XMM6 + ;; xmm7 - XMM7 + ;; xmm8 - XMM8 - AAD HASH IN + ;; xmm10 - T6 + ;; xmm0 - T_key + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 7, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + jmp %%_initial_blocks_encrypted + +%%_initial_num_blocks_is_6: + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 6, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + jmp %%_initial_blocks_encrypted + +%%_initial_num_blocks_is_5: + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 5, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + jmp %%_initial_blocks_encrypted + +%%_initial_num_blocks_is_4: + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 4, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + jmp %%_initial_blocks_encrypted + +%%_initial_num_blocks_is_3: + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 3, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + jmp %%_initial_blocks_encrypted + +%%_initial_num_blocks_is_2: + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 2, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + jmp %%_initial_blocks_encrypted + +%%_initial_num_blocks_is_1: + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 1, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + jmp %%_initial_blocks_encrypted + +%%_initial_num_blocks_is_0: + INITIAL_BLOCKS %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, 0, xmm12, xmm13, xmm14, xmm15, xmm11, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm10, xmm0, %%ENC_DEC + +%%_initial_blocks_encrypted: + ;; The entire message was encrypted processed in initial and now need to be hashed + cmp r13, 0 + je %%_encrypt_done + + ;; Encrypt the final <16 byte (partial) block, then hash + cmp r13, 16 + jl %%_encrypt_final_partial + + ;; Process 7 full blocks plus a partial block + cmp r13, 128 + jl %%_encrypt_by_8_partial + + cmp r13, (256 + 256) + jl %%_encrypt_by_8_parallel + + ;; @note + ;; - cipher 8 blocks and put on the stack frame + ;; - get into 16 block loop + ;; - do ghash_last_8 and then move the cipher blocks on the stack to fall into the _by_8 loop + + vmovdqu [rsp + TMP1], xmm1 + vmovdqu [rsp + TMP2], xmm2 + vmovdqu [rsp + TMP3], xmm3 + vmovdqu [rsp + TMP4], xmm4 + vmovdqu [rsp + TMP5], xmm5 + vmovdqu [rsp + TMP6], xmm6 + vmovdqu [rsp + TMP7], xmm7 + vmovdqu [rsp + TMP8], xmm8 + + INITIAL_8BLOCKS_CIPHER %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, {8*16}, xmm12, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, %%ENC_DEC + +%%_encrypt_by_16_parallel: + ;; in_order vs. out_order is an optimization to increment the counter without shuffling + ;; it back into little endian. r15d keeps track of when we need to increent in order so + ;; that the carry is handled correctly. + vmovd r15d, xmm9 + and r15d, 255 + vpshufb xmm9, [rel SHUF_MASK] + +%%_encrypt_by_16_new: + cmp r15d, 255-16 + ja %%_encrypt_by_16 + + ;; xmm0 - T1 + ;; xmm10 - T2 + ;; xmm11 - T3 + ;; xmm12 - T4 + ;; xmm13 - T5 + ;; xmm14 - T6 + ;; xmm9 - CTR + ;; xmm1 - XMM1 + ;; xmm2 - XMM2 + ;; xmm3 - XMM3 + ;; xmm4 - XMM4 + ;; xmm5 - XMM5 + ;; xmm6 - XMM6 + ;; xmm7 - XMM7 + ;; xmm8 - XMM8 + ;; xmm15 - T7 + add r15b, 16 + GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, out_order, %%ENC_DEC, full + add %%DATA_OFFSET, 256 + sub r13, 256 + cmp r13, 256 + ja %%_encrypt_by_16_new + + vpshufb xmm9, [rel SHUF_MASK] + jmp %%_encrypt_by_16_parallel_done + +%%_encrypt_by_16: + vpshufb xmm9, [rel SHUF_MASK] + add r15b, 16 + GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, full + vpshufb xmm9, [rel SHUF_MASK] + add %%DATA_OFFSET, 256 + sub r13, 256 + cmp r13, 256 + ja %%_encrypt_by_16_new + vpshufb xmm9, [rel SHUF_MASK] + +%%_encrypt_by_16_parallel_done: + ;; ghash last 8 and move the cipher text blocks for ghash + vmovdqu xmm1, [rsp + TMP1] + vmovdqu xmm2, [rsp + TMP2] + vmovdqu xmm3, [rsp + TMP3] + vmovdqu xmm4, [rsp + TMP4] + vmovdqu xmm5, [rsp + TMP5] + vmovdqu xmm6, [rsp + TMP6] + vmovdqu xmm7, [rsp + TMP7] + vmovdqu xmm8, [rsp + TMP8] + GHASH_LAST_8 %%GDATA_KEY, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8 + ;; T6/xmm14 = result ghash + vmovdqu xmm1, [rsp + TMP9] + vmovdqu xmm2, [rsp + TMP10] + vmovdqu xmm3, [rsp + TMP11] + vmovdqu xmm4, [rsp + TMP12] + vmovdqu xmm5, [rsp + TMP13] + vmovdqu xmm6, [rsp + TMP14] + vmovdqu xmm7, [rsp + TMP15] + vmovdqu xmm8, [rsp + TMP16] + vpxor xmm1, xmm1, xmm14 + vmovdqu [rsp + TMP1], xmm1 + vmovdqu [rsp + TMP2], xmm2 + vmovdqu [rsp + TMP3], xmm3 + vmovdqu [rsp + TMP4], xmm4 + vmovdqu [rsp + TMP5], xmm5 + vmovdqu [rsp + TMP6], xmm6 + vmovdqu [rsp + TMP7], xmm7 + vmovdqu [rsp + TMP8], xmm8 + + ;; Encrypt the final <16 byte (partial) block, then hash + cmp r13, 16 + jl %%_encrypt_final_partial + + ;; Process 7 full blocks plus a partial block + cmp r13, 128 + jl %%_encrypt_by_8_partial + +%%_encrypt_by_8_parallel: + ;; in_order vs. out_order is an optimization to increment the counter without shuffling + ;; it back into little endian. r15d keeps track of when we need to increent in order so + ;; that the carry is handled correctly. + vmovd r15d, xmm9 + and r15d, 255 + vpshufb xmm9, [rel SHUF_MASK] + +%%_encrypt_by_8_new: + cmp r15d, 255-8 + ja %%_encrypt_by_8 + + ;; xmm0 - T1 + ;; xmm10 - T2 + ;; xmm11 - T3 + ;; xmm12 - T4 + ;; xmm13 - T5 + ;; xmm14 - T6 + ;; xmm9 - CTR + ;; xmm1 - XMM1 + ;; xmm2 - XMM2 + ;; xmm3 - XMM3 + ;; xmm4 - XMM4 + ;; xmm5 - XMM5 + ;; xmm6 - XMM6 + ;; xmm7 - XMM7 + ;; xmm8 - XMM8 + ;; xmm15 - T7 + add r15b, 8 + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, out_order, %%ENC_DEC, full + add %%DATA_OFFSET, 128 + sub r13, 128 + cmp r13, 128 + jae %%_encrypt_by_8_new + + vpshufb xmm9, [rel SHUF_MASK] + jmp %%_encrypt_by_8_parallel_done + +%%_encrypt_by_8: + vpshufb xmm9, [rel SHUF_MASK] + add r15b, 8 + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, full + vpshufb xmm9, [rel SHUF_MASK] + add %%DATA_OFFSET, 128 + sub r13, 128 + cmp r13, 128 + jae %%_encrypt_by_8_new + vpshufb xmm9, [rel SHUF_MASK] + +%%_encrypt_by_8_parallel_done: + ;; Test to see if we need a by 8 with partial block. At this point + ;; bytes remaining should be either zero or between 113-127. + cmp r13, 0 + je %%_encrypt_done + +%%_encrypt_by_8_partial: + ;; Shuffle needed to align key for partial block xor. out_order + ;; is a little faster because it avoids extra shuffles. + ;; TBD: Might need to account for when we don't have room to increment the counter. + + ;; Process parallel buffers with a final partial block. + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, partial + + add %%DATA_OFFSET, 128-16 + sub r13, 128-16 + +%%_encrypt_final_partial: + + vpshufb xmm8, [rel SHUF_MASK] + mov [%%GDATA_CTX + PBlockLen], r13 + vmovdqu [%%GDATA_CTX + PBlockEncKey], xmm8 + + ;; xmm8 - Final encrypted counter - need to hash with partial or full block ciphertext + ;; GDATA, KEY, T1, T2 + ENCRYPT_FINAL_PARTIAL_BLOCK xmm8, xmm0, xmm10, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%PLAIN_CIPH_LEN, %%ENC_DEC, %%DATA_OFFSET + + vpshufb xmm8, [rel SHUF_MASK] + +%%_encrypt_done: + + ;; Mapping to macro parameters + ;; IN: + ;; xmm9 contains the counter + ;; xmm1-xmm8 contain the xor'd ciphertext + ;; OUT: + ;; xmm14 contains the final hash + ;; GDATA, T1, T2, T3, T4, T5, T6, T7, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8 +%ifidn %%INSTANCE_TYPE, multi_call + mov r13, [%%GDATA_CTX + PBlockLen] + cmp r13, 0 + jz %%_hash_last_8 + GHASH_LAST_7 %%GDATA_KEY, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 + ;; XOR the partial word into the hash + vpxor xmm14, xmm14, xmm8 + jmp %%_ghash_done +%endif +%%_hash_last_8: + GHASH_LAST_8 %%GDATA_KEY, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8 + +%%_ghash_done: + vmovdqu [%%GDATA_CTX + CurCount], xmm9 ; my_ctx_data.current_counter = xmm9 + vmovdqu [%%GDATA_CTX + AadHash], xmm14 ; my_ctx_data.aad hash = xmm14 + +%%_enc_dec_done: + +%endmacro + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; GCM_COMPLETE Finishes Encryption/Decryption of last partial block after GCM_UPDATE finishes. +; Input: A gcm_key_data * (GDATA_KEY), gcm_context_data (GDATA_CTX). +; Output: Authorization Tag (AUTH_TAG) and Authorization Tag length (AUTH_TAG_LEN) +; Clobbers rax, r10-r12, and xmm0-xmm2, xmm5-xmm6, xmm9-xmm11, xmm13-xmm15 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro GCM_COMPLETE 5 +%define %%GDATA_KEY %1 +%define %%GDATA_CTX %2 +%define %%AUTH_TAG %3 +%define %%AUTH_TAG_LEN %4 +%define %%INSTANCE_TYPE %5 +%define %%PLAIN_CIPH_LEN rax + + vmovdqu xmm13, [%%GDATA_KEY + HashKey] + ;; Start AES as early as possible + vmovdqu xmm9, [%%GDATA_CTX + OrigIV] ; xmm9 = Y0 + ENCRYPT_SINGLE_BLOCK %%GDATA_KEY, xmm9 ; E(K, Y0) + +%ifidn %%INSTANCE_TYPE, multi_call + ;; If the GCM function is called as a single function call rather + ;; than invoking the individual parts (init, update, finalize) we + ;; can remove a write to read dependency on AadHash. + vmovdqu xmm14, [%%GDATA_CTX + AadHash] + + ;; Encrypt the final partial block. If we did this as a single call then + ;; the partial block was handled in the main GCM_ENC_DEC macro. + mov r12, [%%GDATA_CTX + PBlockLen] + cmp r12, 0 + + je %%_partial_done + + GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block + vmovdqu [%%GDATA_CTX + AadHash], xmm14 + +%%_partial_done: + +%endif + + mov r12, [%%GDATA_CTX + AadLen] ; r12 = aadLen (number of bytes) + mov %%PLAIN_CIPH_LEN, [%%GDATA_CTX + InLen] + + shl r12, 3 ; convert into number of bits + vmovq xmm15, r12 ; len(A) in xmm15 + + shl %%PLAIN_CIPH_LEN, 3 ; len(C) in bits (*128) + vmovq xmm1, %%PLAIN_CIPH_LEN + vpslldq xmm15, xmm15, 8 ; xmm15 = len(A)|| 0x0000000000000000 + vpxor xmm15, xmm15, xmm1 ; xmm15 = len(A)||len(C) + + vpxor xmm14, xmm15 + GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 + vpshufb xmm14, [rel SHUF_MASK] ; perform a 16Byte swap + + vpxor xmm9, xmm9, xmm14 + +%%_return_T: + mov r10, %%AUTH_TAG ; r10 = authTag + mov r11, %%AUTH_TAG_LEN ; r11 = auth_tag_len + + cmp r11, 16 + je %%_T_16 + + cmp r11, 12 + je %%_T_12 + + cmp r11, 8 + je %%_T_8 + + simd_store_avx r10, xmm9, r11, r12, rax + jmp %%_return_T_done +%%_T_8: + vmovq rax, xmm9 + mov [r10], rax + jmp %%_return_T_done +%%_T_12: + vmovq rax, xmm9 + mov [r10], rax + vpsrldq xmm9, xmm9, 8 + vmovd eax, xmm9 + mov [r10 + 8], eax + jmp %%_return_T_done +%%_T_16: + vmovdqu [r10], xmm9 + +%%_return_T_done: + +%ifdef SAFE_DATA + ;; Clear sensitive data from context structure + vpxor xmm0, xmm0 + vmovdqu [%%GDATA_CTX + AadHash], xmm0 + vmovdqu [%%GDATA_CTX + PBlockEncKey], xmm0 +%endif +%endmacro ; GCM_COMPLETE + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_precomp_128_vaes_avx2 / +; aes_gcm_precomp_192_vaes_avx2 / +; aes_gcm_precomp_256_vaes_avx2 +; (struct gcm_key_data *key_data) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(precomp,_),function,) +FN_NAME(precomp,_): + endbranch64 +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_precomp +%endif + +%ifidn __OUTPUT_FORMAT__, win64 + sub rsp, 1*16 + ; only xmm6 needs to be maintained + vmovdqu [rsp + 0*16],xmm6 +%endif + + vpxor xmm6, xmm6 + ENCRYPT_SINGLE_BLOCK arg1, xmm6 ; xmm6 = HashKey + + vpshufb xmm6, [rel SHUF_MASK] + ;;;;;;;;;;;;;;; PRECOMPUTATION of HashKey<<1 mod poly from the HashKey;;;;;;;;;;;;;;; + vmovdqa xmm2, xmm6 + vpsllq xmm6, xmm6, 1 + vpsrlq xmm2, xmm2, 63 + vmovdqa xmm1, xmm2 + vpslldq xmm2, xmm2, 8 + vpsrldq xmm1, xmm1, 8 + vpor xmm6, xmm6, xmm2 + ;reduction + vpshufd xmm2, xmm1, 00100100b + vpcmpeqd xmm2, [rel TWOONE] + vpand xmm2, xmm2, [rel POLY] + vpxor xmm6, xmm6, xmm2 ; xmm6 holds the HashKey<<1 mod poly + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vmovdqu [arg1 + HashKey], xmm6 ; store HashKey<<1 mod poly + + PRECOMPUTE arg1, xmm6, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5 + +%ifdef SAFE_DATA + clear_scratch_xmms_avx_asm +%endif + +%ifidn __OUTPUT_FORMAT__, win64 + vmovdqu xmm6, [rsp + 0*16] + add rsp, 1*16 +%endif + +exit_precomp: + ret + +%ifdef SAFE_PARAM +error_precomp: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + + jmp exit_precomp +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_init_128_vaes_avx2 / aes_gcm_init_192_vaes_avx2 / aes_gcm_init_256_vaes_avx2 +; (const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *iv, +; const u8 *aad, +; u64 aad_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(init,_),function,) +FN_NAME(init,_): + endbranch64 + push r12 + push r13 +%ifidn __OUTPUT_FORMAT__, win64 + push r14 + push r15 + lea r14, [rsp + 4*8] + ; xmm6 needs to be maintained for Windows + sub rsp, 1*16 + vmovdqu [rsp + 0*16], xmm6 +%endif + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_init + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_init + + ;; Check IV != NULL + cmp arg3, 0 + jz error_init + + ;; Check if aad_len == 0 + cmp arg5, 0 + jz skip_aad_check_init + + ;; Check aad != NULL (aad_len != 0) + cmp arg4, 0 + jz error_init + +skip_aad_check_init: +%endif + GCM_INIT arg1, arg2, arg3, arg4, arg5 + +%ifdef SAFE_DATA + clear_scratch_ymms_asm +%endif +exit_init: + +%ifidn __OUTPUT_FORMAT__, win64 + vmovdqu xmm6 , [rsp + 0*16] + add rsp, 1*16 + pop r15 + pop r14 +%endif + pop r13 + pop r12 + ret + +%ifdef SAFE_PARAM +error_init: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check IV != NULL + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_IV + + ;; Check if aad_len == 0 + cmp arg5, 0 + jz skip_aad_check_error_init + + ;; Check aad != NULL (aad_len != 0) + IMB_ERR_CHECK_NULL arg4, rax, IMB_ERR_NULL_AAD + +skip_aad_check_error_init: + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_init +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_init_var_iv_128_vaes_avx2 / aes_gcm_init_var_iv_192_vaes_avx2 / +; aes_gcm_init_var_iv_256_vaes_avx2 +; const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *iv, +; const u64 iv_len, +; const u8 *aad, +; const u64 aad_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(init_var_iv,_),function,) +FN_NAME(init_var_iv,_): + endbranch64 + push r12 + push r13 +%ifidn __OUTPUT_FORMAT__, win64 + push r14 + push r15 + lea r14, [rsp + 4*8] + ; xmm6 needs to be maintained for Windows + sub rsp, 1*16 + vmovdqu [rsp + 0*16], xmm6 +%endif + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_init_IV + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_init_IV + + ;; Check IV != NULL + cmp arg3, 0 + jz error_init_IV + + ;; Check iv_len != 0 + cmp arg4, 0 + jz error_init_IV + + ;; Check if aad_len == 0 + cmp arg6, 0 + jz skip_aad_check_init_IV + + ;; Check aad != NULL (aad_len != 0) + cmp arg5, 0 + jz error_init_IV + +skip_aad_check_init_IV: +%endif + cmp arg4, 12 + je iv_len_12_init_IV + + GCM_INIT arg1, arg2, arg3, arg5, arg6, arg4 + jmp skip_iv_len_12_init_IV + +iv_len_12_init_IV: + GCM_INIT arg1, arg2, arg3, arg5, arg6 + +skip_iv_len_12_init_IV: +%ifdef SAFE_DATA + clear_scratch_ymms_asm +%endif +exit_init_IV: + +%ifidn __OUTPUT_FORMAT__, win64 + vmovdqu xmm6 , [rsp + 0*16] + add rsp, 1*16 + pop r15 + pop r14 +%endif + pop r13 + pop r12 + ret + +%ifdef SAFE_PARAM +error_init_IV: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check IV != NULL + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_IV + + ;; Check iv_len != 0 + IMB_ERR_CHECK_ZERO arg4, rax, IMB_ERR_IV_LEN + + ;; Check if aad_len == 0 + cmp arg6, 0 + jz skip_aad_check_error_init_IV + + ;; Check aad != NULL (aad_len != 0) + IMB_ERR_CHECK_NULL arg5, rax, IMB_ERR_NULL_AAD + +skip_aad_check_error_init_IV: + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_init_IV +%endif + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_enc_128_update_vaes_avx2 / aes_gcm_enc_192_update_vaes_avx2 / +; aes_gcm_enc_128_update_vaes_avx2 +; (const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *out, +; const u8 *in, +; u64 msg_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(enc,_update_),function,) +FN_NAME(enc,_update_): + endbranch64 + FUNC_SAVE + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Load max len to reg on windows + INIT_GCM_MAX_LENGTH + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_update_enc + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_update_enc + + ;; Check if plaintext_len == 0 + cmp arg5, 0 + jz error_update_enc + + ;; Check if msg_len > max_len + cmp arg5, GCM_MAX_LENGTH + ja error_update_enc + + ;; Check out != NULL (plaintext_len != 0) + cmp arg3, 0 + jz error_update_enc + + ;; Check in != NULL (plaintext_len != 0) + cmp arg4, 0 + jz error_update_enc +%endif + GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, ENC, multi_call + +exit_update_enc: + FUNC_RESTORE + ret + +%ifdef SAFE_PARAM +error_update_enc: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check if plaintext_len == 0 + cmp arg5, 0 + jz skip_in_out_check_error_update_enc + + ;; Check if msg_len > max_len + IMB_ERR_CHECK_ABOVE arg5, GCM_MAX_LENGTH, rax, IMB_ERR_CIPH_LEN + + ;; Check out != NULL + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_DST + + ;; Check in != NULL (plaintext_len != 0) + IMB_ERR_CHECK_NULL arg4, rax, IMB_ERR_NULL_SRC + +skip_in_out_check_error_update_enc: + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_update_enc +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_dec_128_update_vaes_avx2 / aes_gcm_dec_192_update_vaes_avx2 / +; aes_gcm_dec_256_update_vaes_avx2 +; (const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *out, +; const u8 *in, +; u64 msg_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(dec,_update_),function,) +FN_NAME(dec,_update_): + endbranch64 + FUNC_SAVE + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Load max len to reg on windows + INIT_GCM_MAX_LENGTH + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_update_dec + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_update_dec + + ;; Check if plaintext_len == 0 + cmp arg5, 0 + jz error_update_dec + + ;; Check if msg_len > max_len + cmp arg5, GCM_MAX_LENGTH + ja error_update_dec + + ;; Check out != NULL (plaintext_len != 0) + cmp arg3, 0 + jz error_update_dec + + ;; Check in != NULL (plaintext_len != 0) + cmp arg4, 0 + jz error_update_dec +%endif + + GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, DEC, multi_call + +exit_update_dec: + FUNC_RESTORE + + ret + +%ifdef SAFE_PARAM +error_update_dec: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check if plaintext_len == 0 + cmp arg5, 0 + jz skip_in_out_check_error_update_dec + + ;; Check if msg_len > max_len + IMB_ERR_CHECK_ABOVE arg5, GCM_MAX_LENGTH, rax, IMB_ERR_CIPH_LEN + + ;; Check out != NULL + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_DST + + ;; Check in != NULL (plaintext_len != 0) + IMB_ERR_CHECK_NULL arg4, rax, IMB_ERR_NULL_SRC + +skip_in_out_check_error_update_dec: + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_update_dec +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_enc_128_finalize_vaes_avx2 / aes_gcm_enc_192_finalize_vaes_avx2 / +; aes_gcm_enc_256_finalize_vaes_avx2 +; (const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *auth_tag, +; u64 auth_tag_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(enc,_finalize_),function,) +FN_NAME(enc,_finalize_): + endbranch64 +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_enc_fin + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_enc_fin + + ;; Check auth_tag != NULL + cmp arg3, 0 + jz error_enc_fin + + ;; Check auth_tag_len == 0 or > 16 + cmp arg4, 0 + jz error_enc_fin + + cmp arg4, 16 + ja error_enc_fin +%endif + push r12 + +%ifidn __OUTPUT_FORMAT__, win64 + ; xmm6:xmm15 need to be maintained for Windows + sub rsp, 7*16 + vmovdqu [rsp + 0*16], xmm6 + vmovdqu [rsp + 1*16], xmm9 + vmovdqu [rsp + 2*16], xmm10 + vmovdqu [rsp + 3*16], xmm11 + vmovdqu [rsp + 4*16], xmm13 + vmovdqu [rsp + 5*16], xmm14 + vmovdqu [rsp + 6*16], xmm15 +%endif + GCM_COMPLETE arg1, arg2, arg3, arg4, multi_call + +%ifdef SAFE_DATA + clear_scratch_ymms_asm +%endif +%ifidn __OUTPUT_FORMAT__, win64 + vmovdqu xmm15, [rsp + 6*16] + vmovdqu xmm14, [rsp + 5*16] + vmovdqu xmm13, [rsp + 4*16] + vmovdqu xmm11, [rsp + 3*16] + vmovdqu xmm10, [rsp + 2*16] + vmovdqu xmm9, [rsp + 1*16] + vmovdqu xmm6, [rsp + 0*16] + add rsp, 7*16 +%endif + pop r12 +exit_enc_fin: + ret + +%ifdef SAFE_PARAM +error_enc_fin: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check auth_tag != NULL + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_AUTH + + ;; Check auth_tag_len == 0 or > 16 + IMB_ERR_CHECK_ZERO arg4, rax, IMB_ERR_AUTH_TAG_LEN + + IMB_ERR_CHECK_ABOVE arg4, 16, rax, IMB_ERR_AUTH_TAG_LEN + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_enc_fin +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_dec_128_finalize_vaes_avx2 / aes_gcm_dec_192_finalize_vaes_avx2 +; aes_gcm_dec_256_finalize_vaes_avx2 +; (const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *auth_tag, +; u64 auth_tag_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(dec,_finalize_),function,) +FN_NAME(dec,_finalize_): + endbranch64 +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_dec_fin + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_dec_fin + + ;; Check auth_tag != NULL + cmp arg3, 0 + jz error_dec_fin + + ;; Check auth_tag_len == 0 or > 16 + cmp arg4, 0 + jz error_dec_fin + + cmp arg4, 16 + ja error_dec_fin +%endif + + push r12 + +%ifidn __OUTPUT_FORMAT__, win64 + ; xmm6:xmm15 need to be maintained for Windows + sub rsp, 7*16 + vmovdqu [rsp + 0*16], xmm6 + vmovdqu [rsp + 1*16], xmm9 + vmovdqu [rsp + 2*16], xmm10 + vmovdqu [rsp + 3*16], xmm11 + vmovdqu [rsp + 4*16], xmm13 + vmovdqu [rsp + 5*16], xmm14 + vmovdqu [rsp + 6*16], xmm15 +%endif + GCM_COMPLETE arg1, arg2, arg3, arg4, multi_call + +%ifdef SAFE_DATA + clear_scratch_ymms_asm +%endif +%ifidn __OUTPUT_FORMAT__, win64 + vmovdqu xmm15, [rsp + 6*16] + vmovdqu xmm14, [rsp + 5*16] + vmovdqu xmm13, [rsp + 4*16] + vmovdqu xmm11, [rsp + 3*16] + vmovdqu xmm10, [rsp + 2*16] + vmovdqu xmm9, [rsp + 1*16] + vmovdqu xmm6, [rsp + 0*16] + add rsp, 7*16 +%endif + + pop r12 + +exit_dec_fin: + ret + +%ifdef SAFE_PARAM +error_dec_fin: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check auth_tag != NULL + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_AUTH + + ;; Check auth_tag_len == 0 or > 16 + IMB_ERR_CHECK_ZERO arg4, rax, IMB_ERR_AUTH_TAG_LEN + + IMB_ERR_CHECK_ABOVE arg4, 16, rax, IMB_ERR_AUTH_TAG_LEN + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_dec_fin +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_enc_128_vaes_avx2 / aes_gcm_enc_192_vaes_avx2 / aes_gcm_enc_256_vaes_avx2 +; (const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *out, +; const u8 *in, +; u64 msg_len, +; u8 *iv, +; const u8 *aad, +; u64 aad_len, +; u8 *auth_tag, +; u64 auth_tag_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(enc,_),function,) +FN_NAME(enc,_): + endbranch64 + FUNC_SAVE + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Load max len to reg on windows + INIT_GCM_MAX_LENGTH + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_enc + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_enc + + ;; Check IV != NULL + cmp arg6, 0 + jz error_enc + + ;; Check auth_tag != NULL + cmp arg9, 0 + jz error_enc + + ;; Check auth_tag_len == 0 or > 16 + cmp arg10, 0 + jz error_enc + + cmp arg10, 16 + ja error_enc + + ;; Check if msg_len == 0 + cmp arg5, 0 + jz skip_in_out_check_enc + + ;; Check if msg_len > max_len + cmp arg5, GCM_MAX_LENGTH + ja error_enc + + ;; Check out != NULL (msg_len != 0) + cmp arg3, 0 + jz error_enc + + ;; Check in != NULL (msg_len != 0) + cmp arg4, 0 + jz error_enc + +skip_in_out_check_enc: + ;; Check if aad_len == 0 + cmp arg8, 0 + jz skip_aad_check_enc + + ;; Check aad != NULL (aad_len != 0) + cmp arg7, 0 + jz error_enc + +skip_aad_check_enc: +%endif + GCM_INIT arg1, arg2, arg6, arg7, arg8 + + GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, ENC, single_call + + GCM_COMPLETE arg1, arg2, arg9, arg10, single_call + +exit_enc: + FUNC_RESTORE + + ret + +%ifdef SAFE_PARAM +error_enc: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check IV != NULL + IMB_ERR_CHECK_NULL arg6, rax, IMB_ERR_NULL_IV + + ;; Check auth_tag != NULL + IMB_ERR_CHECK_NULL arg9, rax, IMB_ERR_NULL_AUTH + + ;; Check auth_tag_len == 0 or > 16 + IMB_ERR_CHECK_ZERO arg10, rax, IMB_ERR_AUTH_TAG_LEN + + IMB_ERR_CHECK_ABOVE arg10, 16, rax, IMB_ERR_AUTH_TAG_LEN + + ;; Check if msg_len == 0 + cmp arg5, 0 + jz skip_in_out_check_error_enc + + ;; Check if msg_len > max_len + IMB_ERR_CHECK_ABOVE arg5, GCM_MAX_LENGTH, rax, IMB_ERR_CIPH_LEN + + ;; Check out != NULL (msg_len != 0) + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_DST + + ;; Check in != NULL (msg_len != 0) + IMB_ERR_CHECK_NULL arg4, rax, IMB_ERR_NULL_SRC + +skip_in_out_check_error_enc: + ;; Check if aad_len == 0 + cmp arg8, 0 + jz skip_aad_check_error_enc + + ;; Check aad != NULL (aad_len != 0) + IMB_ERR_CHECK_NULL arg7, rax, IMB_ERR_NULL_AAD + +skip_aad_check_error_enc: + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_enc +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_dec_128_vaes_avx2 / aes_gcm_dec_192_vaes_avx2 / aes_gcm_dec_256_vaes_avx2 +; (const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *out, +; const u8 *in, +; u64 msg_len, +; u8 *iv, +; const u8 *aad, +; u64 aad_len, +; u8 *auth_tag, +; u64 auth_tag_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(dec,_),function,) +FN_NAME(dec,_): + endbranch64 + FUNC_SAVE + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Load max len to reg on windows + INIT_GCM_MAX_LENGTH + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_dec + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_dec + + ;; Check IV != NULL + cmp arg6, 0 + jz error_dec + + ;; Check auth_tag != NULL + cmp arg9, 0 + jz error_dec + + ;; Check auth_tag_len == 0 or > 16 + cmp arg10, 0 + jz error_dec + + cmp arg10, 16 + ja error_dec + + ;; Check if msg_len == 0 + cmp arg5, 0 + jz skip_in_out_check_dec + + ;; Check if msg_len > max_len + cmp arg5, GCM_MAX_LENGTH + ja error_dec + + ;; Check out != NULL (msg_len != 0) + cmp arg3, 0 + jz error_dec + + ;; Check in != NULL (msg_len != 0) + cmp arg4, 0 + jz error_dec + +skip_in_out_check_dec: + ;; Check if aad_len == 0 + cmp arg8, 0 + jz skip_aad_check_dec + + ;; Check aad != NULL (aad_len != 0) + cmp arg7, 0 + jz error_dec + +skip_aad_check_dec: +%endif + GCM_INIT arg1, arg2, arg6, arg7, arg8 + + GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, DEC, single_call + + GCM_COMPLETE arg1, arg2, arg9, arg10, single_call + +exit_dec: + FUNC_RESTORE + + ret + +%ifdef SAFE_PARAM +error_dec: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check IV != NULL + IMB_ERR_CHECK_NULL arg6, rax, IMB_ERR_NULL_IV + + ;; Check auth_tag != NULL + IMB_ERR_CHECK_NULL arg9, rax, IMB_ERR_NULL_AUTH + + ;; Check auth_tag_len == 0 or > 16 + IMB_ERR_CHECK_ZERO arg10, rax, IMB_ERR_AUTH_TAG_LEN + + IMB_ERR_CHECK_ABOVE arg10, 16, rax, IMB_ERR_AUTH_TAG_LEN + + ;; Check if msg_len == 0 + cmp arg5, 0 + jz skip_in_out_check_error_dec + + ;; Check if msg_len > max_len + IMB_ERR_CHECK_ABOVE arg5, GCM_MAX_LENGTH, rax, IMB_ERR_CIPH_LEN + + ;; Check out != NULL (msg_len != 0) + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_DST + + ;; Check in != NULL (msg_len != 0) + IMB_ERR_CHECK_NULL arg4, rax, IMB_ERR_NULL_SRC + +skip_in_out_check_error_dec: + ;; Check if aad_len == 0 + cmp arg8, 0 + jz skip_aad_check_error_dec + + ;; Check aad != NULL (aad_len != 0) + IMB_ERR_CHECK_NULL arg7, rax, IMB_ERR_NULL_AAD + +skip_aad_check_error_dec: + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_dec +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_enc_var_iv_128_vaes_avx2 / aes_gcm_enc_var_iv_192_vaes_avx2 / +; aes_gcm_enc_var_iv_256_vaes_avx2 +; const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *out, +; const u8 *in, +; u64 msg_len, +; u8 *iv, +; const u64 iv_len, +; const u8 *aad, +; const u64 aad_len, +; u8 *auth_tag, +; const u64 auth_tag_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(enc_var_iv,_),function,) +FN_NAME(enc_var_iv,_): + endbranch64 + FUNC_SAVE alloc_context + + mov arg1, [arg2 + _enc_keys] + + cmp qword [arg2 + _iv_len_in_bytes], 12 + je iv_len_12_enc_IV + + GCM_INIT arg1, {rsp + CONTEXT_OFFSET}, {[arg2 + _iv]}, \ + {[arg2 + _gcm_aad]}, {[arg2 + _gcm_aad_len]}, \ + {[arg2 + _iv_len_in_bytes]} + jmp skip_iv_len_12_enc_IV + +iv_len_12_enc_IV: + GCM_INIT arg1, {rsp + CONTEXT_OFFSET}, {[arg2 + _iv]}, \ + {[arg2 + _gcm_aad]}, {[arg2 + _gcm_aad_len]} + +skip_iv_len_12_enc_IV: + mov arg3, [arg2 + _src] + add arg3, [arg2 + _cipher_start_src_offset] + mov arg4, [arg2 + _dst] + mov [rsp + GP_OFFSET + 5*8], arg2 ; preserve job pointer + mov arg2, [arg2 + _msg_len_to_cipher] + GCM_ENC_DEC arg1, {rsp + CONTEXT_OFFSET}, arg4, arg3, arg2, ENC, single_call + + mov arg2, [rsp + GP_OFFSET + 5*8] + GCM_COMPLETE arg1, {rsp + CONTEXT_OFFSET}, \ + {[arg2 + _auth_tag_output]}, {[arg2 + _auth_tag_output_len_in_bytes]}, \ + single_call + + ;; mark job complete + mov dword [arg2 + _status], IMB_STATUS_COMPLETED + + mov rax, arg2 ;; return the job + +exit_enc_IV: + FUNC_RESTORE + ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void aes_gcm_dec_var_iv_128_vaes_avx2 / aes_gcm_dec_var_iv_192_vaes_avx2 / +; aes_gcm_dec_var_iv_256_vaes_avx2 +; const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; u8 *out, +; const u8 *in, +; u64 msg_len, +; u8 *iv, +; const u64 iv_len, +; const u8 *aad, +; const u64 aad_len, +; u8 *auth_tag, +; const u64 auth_tag_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(FN_NAME(dec_var_iv,_),function,) +FN_NAME(dec_var_iv,_): + endbranch64 + FUNC_SAVE alloc_context + + mov arg1, [arg2 + _dec_keys] + + cmp qword [arg2 + _iv_len_in_bytes], 12 + je iv_len_12_dec_IV + + GCM_INIT arg1, {rsp + CONTEXT_OFFSET}, {[arg2 + _iv]}, \ + {[arg2 + _gcm_aad]}, {[arg2 + _gcm_aad_len]}, \ + {[arg2 + _iv_len_in_bytes]} + jmp skip_iv_len_12_dec_IV + +iv_len_12_dec_IV: + GCM_INIT arg1, {rsp + CONTEXT_OFFSET}, {[arg2 + _iv]}, \ + {[arg2 + _gcm_aad]}, {[arg2 + _gcm_aad_len]} + +skip_iv_len_12_dec_IV: + mov arg3, [arg2 + _src] + add arg3, [arg2 + _cipher_start_src_offset] + mov arg4, [arg2 + _dst] + mov [rsp + GP_OFFSET + 5*8], arg2 ; preserve job pointer + mov arg2, [arg2 + _msg_len_to_cipher] + GCM_ENC_DEC arg1, {rsp + CONTEXT_OFFSET}, arg4, arg3, arg2, DEC, single_call + + mov arg2, [rsp + GP_OFFSET + 5*8] + GCM_COMPLETE arg1, {rsp + CONTEXT_OFFSET}, \ + {[arg2 + _auth_tag_output]}, {[arg2 + _auth_tag_output_len_in_bytes]}, \ + single_call + + ;; mark job complete + mov dword [arg2 + _status], IMB_STATUS_COMPLETED + + mov rax, arg2 ;; return the job + + FUNC_RESTORE + ret + +%ifdef GCM128_MODE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void ghash_pre_vaes_avx2 +; (const void *key, struct gcm_key_data *key_data) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(ghash_pre_vaes_avx2,function,) +ghash_pre_vaes_avx2: + endbranch64 +;; Parameter is passed through register +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Check key != NULL + cmp arg1, 0 + jz error_ghash_pre + + ;; Check key_data != NULL + cmp arg2, 0 + jz error_ghash_pre +%endif + +%ifidn __OUTPUT_FORMAT__, win64 + sub rsp, 1*16 + + ; only xmm6 needs to be maintained + vmovdqu [rsp + 0*16], xmm6 +%endif + + vmovdqu xmm6, [arg1] + vpshufb xmm6, [rel SHUF_MASK] + ;;;;;;;;;;;;;;; PRECOMPUTATION of HashKey<<1 mod poly from the HashKey;;;;;;;;;;;;;;; + vmovdqa xmm2, xmm6 + vpsllq xmm6, xmm6, 1 + vpsrlq xmm2, xmm2, 63 + vmovdqa xmm1, xmm2 + vpslldq xmm2, xmm2, 8 + vpsrldq xmm1, xmm1, 8 + vpor xmm6, xmm6, xmm2 + ;reduction + vpshufd xmm2, xmm1, 00100100b + vpcmpeqd xmm2, [rel TWOONE] + vpand xmm2, xmm2, [rel POLY] + vpxor xmm6, xmm6, xmm2 ; xmm6 holds the HashKey<<1 mod poly + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + vmovdqu [arg2 + HashKey], xmm6 ; store HashKey<<1 mod poly + + PRECOMPUTE arg2, xmm6, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5 + +%ifdef SAFE_DATA + clear_scratch_xmms_avx_asm +%endif +%ifidn __OUTPUT_FORMAT__, win64 + vmovdqu xmm6, [rsp + 0*16] + add rsp, 1*16 +%endif +exit_ghash_pre: + ret + +%ifdef SAFE_PARAM +error_ghash_pre: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_KEY + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_EXP_KEY + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_ghash_pre +%endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void ghash_vaes_avx2 +; const struct gcm_key_data *key_data, +; const void *in, +; const u64 in_len, +; void *io_tag, +; const u64 tag_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(ghash_vaes_avx2,function,) +ghash_vaes_avx2: + endbranch64 + FUNC_SAVE + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET + + ;; Check key_data != NULL + cmp arg1, 0 + jz error_ghash + + ;; Check in != NULL + cmp arg2, 0 + jz error_ghash + + ;; Check in_len != 0 + cmp arg3, 0 + jz error_ghash + + ;; Check tag != NULL + cmp arg4, 0 + jz error_ghash + + ;; Check tag_len != 0 + cmp arg5, 0 + jz error_ghash +%endif + + ;; copy tag to xmm0 + vmovdqu xmm0, [arg4] + vpshufb xmm0, [rel SHUF_MASK] ; perform a 16Byte swap + + CALC_AAD_HASH arg2, arg3, xmm0, arg1, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, \ + r10, r11, r12, r13, rax + + vpshufb xmm0, [rel SHUF_MASK] ; perform a 16Byte swap + + simd_store_avx arg4, xmm0, arg5, r12, rax + +exit_ghash: + FUNC_RESTORE + ret + +%ifdef SAFE_PARAM +error_ghash: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check in != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_SRC + + ;; Check in_len != 0 + IMB_ERR_CHECK_ZERO arg3, rax, IMB_ERR_AUTH_LEN + + ;; Check tag != NULL + IMB_ERR_CHECK_NULL arg4, rax, IMB_ERR_NULL_AUTH + + ;; Check tag_len != 0 + IMB_ERR_CHECK_ZERO arg5, rax, IMB_ERR_AUTH_TAG_LEN + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + + jmp exit_ghash +%endif + +%endif ;; GCM128_MODE + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; PARTIAL_BLOCK_GMAC: Handles the tag partial blocks between update calls. +; Requires the input data be at least 1 byte long. +; Input: gcm_key_data (GDATA_KEY), gcm_context_data (GDATA_CTX), input text (PLAIN_IN), +; input text length (PLAIN_LEN), hash subkey (HASH_SUBKEY). +; Output: Updated GDATA_CTX +; Clobbers rax, r10, r12, r13, r15, xmm0, xmm1, xmm2, xmm3, xmm5, xmm6, xmm9, xmm10, xmm11, xmm13 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%macro PARTIAL_BLOCK_GMAC 7 +%define %%GDATA_KEY %1 +%define %%GDATA_CTX %2 +%define %%PLAIN_IN %3 +%define %%PLAIN_LEN %4 +%define %%DATA_OFFSET %5 +%define %%AAD_HASH %6 +%define %%HASH_SUBKEY %7 + + mov r13, [%%GDATA_CTX + PBlockLen] + cmp r13, 0 + ; Leave Macro if no partial blocks + je %%_partial_block_done + + ; Read in input data without over reading + cmp %%PLAIN_LEN, 16 + jl %%_fewer_than_16_bytes + ; If more than 16 bytes of data, just fill the xmm register + VXLDR xmm1, [%%PLAIN_IN] + jmp %%_data_read + +%%_fewer_than_16_bytes: + lea r10, [%%PLAIN_IN] + READ_SMALL_DATA_INPUT_AVX xmm1, r10, %%PLAIN_LEN, rax + + ; Finished reading in data +%%_data_read: + + lea r12, [rel SHIFT_MASK] + ; Adjust the shuffle mask pointer to be able to shift r13 bytes + ; (16-r13 is the number of bytes in plaintext mod 16) + add r12, r13 + ; Get the appropriate shuffle mask + vmovdqu xmm2, [r12] + vmovdqa xmm3, xmm1 + + mov r15, %%PLAIN_LEN + add r15, r13 + ; Set r15 to be the amount of data left in PLAIN_IN after filling the block + sub r15, 16 + ; Determine if partial block is not being filled and shift mask accordingly + jge %%_no_extra_mask_1 + sub r12, r15 +%%_no_extra_mask_1: + + ; Get the appropriate mask to mask out bottom r13 bytes of xmm3 + vmovdqu xmm1, [r12 + ALL_F-SHIFT_MASK] + + vpand xmm3, xmm1 + vpshufb xmm3, [rel SHUF_MASK] + vpshufb xmm3, xmm2 + vpxor %%AAD_HASH, xmm3 + + cmp r15,0 + jl %%_partial_incomplete_1 + + ; GHASH computation for the last <16 Byte block + GHASH_MUL %%AAD_HASH, %%HASH_SUBKEY, xmm0, xmm10, xmm11, xmm5, xmm6 + xor rax, rax + mov [%%GDATA_CTX + PBlockLen], rax + jmp %%_ghash_done +%%_partial_incomplete_1: +%ifidn __OUTPUT_FORMAT__, win64 + mov rax, %%PLAIN_LEN + add [%%GDATA_CTX + PBlockLen], rax +%else + add [%%GDATA_CTX + PBlockLen], %%PLAIN_LEN +%endif +%%_ghash_done: + vmovdqu [%%GDATA_CTX + AadHash], %%AAD_HASH + + cmp r15, 0 + jl %%_partial_fill + + mov r12, 16 + ; Set r12 to be the number of bytes to skip after this macro + sub r12, r13 + + jmp %%offset_set +%%_partial_fill: + mov r12, %%PLAIN_LEN +%%offset_set: + mov %%DATA_OFFSET, r12 +%%_partial_block_done: +%endmacro ; PARTIAL_BLOCK_GMAC + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;void imb_aes_gmac_update_128_vaes_avx2 / imb_aes_gmac_update_192_vaes_avx2 / +; imb_aes_gmac_update_256_vaes_avx2 +; const struct gcm_key_data *key_data, +; struct gcm_context_data *context_data, +; const u8 *in, +; const u64 msg_len); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +align 32 +MKGLOBAL(GMAC_FN_NAME(update),function,) +GMAC_FN_NAME(update): + endbranch64 + FUNC_SAVE + +%ifdef SAFE_PARAM + ;; Reset imb_errno + IMB_ERR_CHECK_RESET +%endif + ;; Check if msg_len == 0 + cmp arg4, 0 + je exit_gmac_update + +%ifdef SAFE_PARAM + ;; Check key_data != NULL + cmp arg1, 0 + jz error_gmac_update + + ;; Check context_data != NULL + cmp arg2, 0 + jz error_gmac_update + + ;; Check in != NULL (msg_len != 0) + cmp arg3, 0 + jz error_gmac_update +%endif + + ; Increment size of "AAD length" for GMAC + add [arg2 + AadLen], arg4 + + ;; Deal with previous partial block + xor r11, r11 + vmovdqu xmm13, [arg1 + HashKey] + vmovdqu xmm8, [arg2 + AadHash] + + PARTIAL_BLOCK_GMAC arg1, arg2, arg3, arg4, r11, xmm8, xmm13 + + ; CALC_AAD_HASH needs to deal with multiple of 16 bytes + sub arg4, r11 + add arg3, r11 + + vmovq xmm7, arg4 ; Save remaining length + and arg4, -16 ; Get multiple of 16 bytes + + or arg4, arg4 + jz no_full_blocks + + ;; Calculate GHASH of this segment + CALC_AAD_HASH arg3, arg4, xmm8, arg1, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, \ + r10, r11, r12, r13, rax + vmovdqu [arg2 + AadHash], xmm8 ; ctx_data.aad hash = aad_hash + +no_full_blocks: + add arg3, arg4 ; Point at partial block + + vmovq arg4, xmm7 ; Restore original remaining length + and arg4, 15 + jz exit_gmac_update + + ; Save next partial block + mov [arg2 + PBlockLen], arg4 + READ_SMALL_DATA_INPUT_AVX xmm1, arg3, arg4, r11 + vpshufb xmm1, [rel SHUF_MASK] + vpxor xmm8, xmm1 + vmovdqu [arg2 + AadHash], xmm8 + +exit_gmac_update: + FUNC_RESTORE + + ret + +%ifdef SAFE_PARAM +error_gmac_update: + ;; Clear reg and imb_errno + IMB_ERR_CHECK_START rax + + ;; Check key_data != NULL + IMB_ERR_CHECK_NULL arg1, rax, IMB_ERR_NULL_EXP_KEY + + ;; Check context_data != NULL + IMB_ERR_CHECK_NULL arg2, rax, IMB_ERR_NULL_CTX + + ;; Check in != NULL (msg_len != 0) + IMB_ERR_CHECK_NULL arg3, rax, IMB_ERR_NULL_SRC + + ;; Set imb_errno + IMB_ERR_CHECK_END rax + jmp exit_gmac_update +%endif + +mksection stack-noexec diff --git a/lib/win_x64.mak b/lib/win_x64.mak index 99b787b5..7acaf31d 100644 --- a/lib/win_x64.mak +++ b/lib/win_x64.mak @@ -557,16 +557,19 @@ no_aesni_objs = \ gcm_objs = \ $(OBJ_DIR)\gcm.obj \ $(OBJ_DIR)\aes128_gcm_by8_avx2.obj \ + $(OBJ_DIR)\aes128_gcm_vaes_avx2.obj \ $(OBJ_DIR)\aes128_gcm_by8_avx512.obj \ $(OBJ_DIR)\aes128_gcm_api_vaes_avx512.obj \ $(OBJ_DIR)\aes128_gcm_sgl_api_vaes_avx512.obj \ $(OBJ_DIR)\aes128_gmac_api_vaes_avx512.obj \ $(OBJ_DIR)\aes192_gcm_by8_avx2.obj \ + $(OBJ_DIR)\aes192_gcm_vaes_avx2.obj \ $(OBJ_DIR)\aes192_gcm_by8_avx512.obj \ $(OBJ_DIR)\aes192_gcm_api_vaes_avx512.obj \ $(OBJ_DIR)\aes192_gcm_sgl_api_vaes_avx512.obj \ $(OBJ_DIR)\aes192_gmac_api_vaes_avx512.obj \ $(OBJ_DIR)\aes256_gcm_by8_avx2.obj \ + $(OBJ_DIR)\aes256_gcm_vaes_avx2.obj \ $(OBJ_DIR)\aes256_gcm_by8_avx512.obj \ $(OBJ_DIR)\aes256_gcm_api_vaes_avx512.obj \ $(OBJ_DIR)\aes256_gcm_sgl_api_vaes_avx512.obj \ diff --git a/lib/x86_64/gcm.c b/lib/x86_64/gcm.c index 8787f555..6329ea42 100644 --- a/lib/x86_64/gcm.c +++ b/lib/x86_64/gcm.c @@ -150,6 +150,26 @@ aes_gcm_pre_128_vaes_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_128_vaes_avx512(key_data); } +void +aes_gcm_pre_128_vaes_avx2(const void *key, struct gcm_key_data *key_data) +{ +#ifdef SAFE_PARAM + /* reset error status */ + imb_set_errno(NULL, 0); + + if (key == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_KEY); + return; + } + if (key_data == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); + return; + } +#endif + aes_keyexp_128_enc_avx2(key, key_data->expanded_keys); + aes_gcm_precomp_128_vaes_avx2(key_data); +} + void aes_gcm_pre_192_sse(const void *key, struct gcm_key_data *key_data) { @@ -258,6 +278,26 @@ aes_gcm_pre_192_vaes_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_192_vaes_avx512(key_data); } +void +aes_gcm_pre_192_vaes_avx2(const void *key, struct gcm_key_data *key_data) +{ +#ifdef SAFE_PARAM + /* reset error status */ + imb_set_errno(NULL, 0); + + if (key == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_KEY); + return; + } + if (key_data == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); + return; + } +#endif + aes_keyexp_192_enc_avx2(key, key_data->expanded_keys); + aes_gcm_precomp_192_vaes_avx2(key_data); +} + void aes_gcm_pre_256_sse(const void *key, struct gcm_key_data *key_data) { @@ -366,6 +406,26 @@ aes_gcm_pre_256_vaes_avx512(const void *key, struct gcm_key_data *key_data) aes_gcm_precomp_256_vaes_avx512(key_data); } +void +aes_gcm_pre_256_vaes_avx2(const void *key, struct gcm_key_data *key_data) +{ +#ifdef SAFE_PARAM + /* reset error status */ + imb_set_errno(NULL, 0); + + if (key == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_KEY); + return; + } + if (key_data == NULL) { + imb_set_errno(NULL, IMB_ERR_NULL_EXP_KEY); + return; + } +#endif + aes_keyexp_256_enc_avx2(key, key_data->expanded_keys); + aes_gcm_precomp_256_vaes_avx2(key_data); +} + void imb_aes_gmac_init_128_sse(const struct gcm_key_data *key_data, struct gcm_context_data *context_data, const uint8_t *iv, @@ -655,3 +715,51 @@ imb_aes_gmac_finalize_256_vaes_avx512(const struct gcm_key_data *key_data, { aes_gcm_enc_256_finalize_vaes_avx512(key_data, context_data, auth_tag, auth_tag_len); } + +void +imb_aes_gmac_init_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len) +{ + aes_gcm_init_var_iv_128_vaes_avx2(key_data, context_data, iv, iv_len, NULL, 0); +} + +void +imb_aes_gmac_init_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len) +{ + aes_gcm_init_var_iv_192_vaes_avx2(key_data, context_data, iv, iv_len, NULL, 0); +} + +void +imb_aes_gmac_init_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, const uint8_t *iv, + const uint64_t iv_len) +{ + aes_gcm_init_var_iv_256_vaes_avx2(key_data, context_data, iv, iv_len, NULL, 0); +} + +void +imb_aes_gmac_finalize_128_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) +{ + aes_gcm_enc_128_finalize_vaes_avx2(key_data, context_data, auth_tag, auth_tag_len); +} + +void +imb_aes_gmac_finalize_192_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) +{ + aes_gcm_enc_192_finalize_vaes_avx2(key_data, context_data, auth_tag, auth_tag_len); +} + +void +imb_aes_gmac_finalize_256_vaes_avx2(const struct gcm_key_data *key_data, + struct gcm_context_data *context_data, uint8_t *auth_tag, + const uint64_t auth_tag_len) +{ + aes_gcm_enc_256_finalize_vaes_avx2(key_data, context_data, auth_tag, auth_tag_len); +} -- GitLab From 6a422e37dfe6a9f39b4185fe0d3cbc1456c8b9b2 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 11 Sep 2023 11:58:39 +0100 Subject: [PATCH 078/204] sse: add new SM4-ECB implementation --- README.md | 2 + ReleaseNotes.txt | 1 + lib/Makefile | 6 +- lib/avx2_t1/mb_mgr_avx2_t1.c | 5 + lib/avx2_t2/mb_mgr_avx2_t2.c | 5 + lib/avx2_t3/mb_mgr_avx2_t3.c | 5 + lib/avx512_t1/mb_mgr_avx512_t1.c | 5 + lib/avx512_t2/mb_mgr_avx512_t2.c | 6 + lib/avx_t1/mb_mgr_avx_t1.c | 5 + lib/avx_t2/mb_mgr_avx_t2.c | 5 + lib/include/arch_noaesni.h | 6 + lib/include/arch_sse_type1.h | 7 + lib/include/mb_mgr_job_api.h | 105 +++++-- lib/include/mb_mgr_job_check.h | 27 ++ lib/ipsec-mb.h | 13 + lib/no-aesni/mb_mgr_sse_no_aesni.c | 5 + lib/no-aesni/sm4_sse_no_aesni.asm | 31 ++ lib/sse_t1/mb_mgr_sse_t1.c | 7 +- lib/sse_t1/sm4_sse.asm | 485 +++++++++++++++++++++++++++++ lib/sse_t2/mb_mgr_sse_t2.c | 5 + lib/sse_t3/mb_mgr_sse_t3.c | 5 + lib/win_x64.mak | 6 +- 22 files changed, 717 insertions(+), 30 deletions(-) create mode 100644 lib/no-aesni/sm4_sse_no_aesni.asm create mode 100644 lib/sse_t1/sm4_sse.asm diff --git a/README.md b/README.md index 5957dede..b858eac3 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Table 1. List of supported cipher algorithms and their implementations. | SNOW-V | N | Y | Y | N | N | N | N | | SNOW-V AEAD | N | Y | Y | N | N | N | N | | PON-CRC-BIP | N | Y by8 | Y by8 | N | N | Y | N | +| SM4-ECB | N | Y | N | N | N | N | N | +--------------------------------------------------------------------------------+ ``` Notes: @@ -216,6 +217,7 @@ Table 3. Encryption and integrity algorithm combinations | ZUC-EEA3-256, | | | SNOW3G-UEA3 | | | SNOW-V | | +| SM4-ECB | | |---------------+-----------------------------------------------------| | AES128-DOCSIS,| DOCSIS-CRC32 | | AES256-DOCSIS | | diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 36218afe..a2be186f 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -7,6 +7,7 @@ Unreleased Library - QUIC CHACHA20-POLY1305 and CHACHA20 HP API added. - AVX2-VAES AES-CTR implementation added. +- SM4-ECB SSE implementation added. Test Applications - QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. diff --git a/lib/Makefile b/lib/Makefile index 4cd4e58c..2e061735 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -516,7 +516,8 @@ asm_noaesni_lib_objs := \ crc32_iuup_sse_no_aesni.o \ crc32_wimax_sse_no_aesni.o \ snow_v_sse_no_aesni.o \ - snow3g_uia2_sse_no_aesni.o + snow3g_uia2_sse_no_aesni.o \ + sm4_sse_no_aesni.o # # List of ASM modules (sse directory) @@ -630,7 +631,8 @@ asm_sse_lib_objs := \ chacha20_sse.o \ memcpy_sse.o \ snow_v_sse.o \ - snow3g_uia2_by4_sse.o + snow3g_uia2_by4_sse.o \ + sm4_sse.o # # List of ASM modules (avx directory) diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index 23ff6e33..206e5149 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -245,6 +245,9 @@ flush_snow3g_uea2_job_avx2_t1(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + static void reset_ooo_mgrs(IMB_MGR *state) { @@ -483,6 +486,8 @@ init_mb_mgr_avx2_t1_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; state->chacha20_hp_quic = quic_chacha20_avx2; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index de68817f..ee647310 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -248,6 +248,9 @@ flush_snow3g_uea2_job_avx2_t2(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + static void reset_ooo_mgrs(IMB_MGR *state) { @@ -486,6 +489,8 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; state->chacha20_hp_quic = quic_chacha20_avx2; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index d47be1b1..74cc2af0 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -249,6 +249,9 @@ flush_snow3g_uea2_job_avx2_t2(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + static void reset_ooo_mgrs(IMB_MGR *state) { @@ -489,6 +492,8 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; state->chacha20_hp_quic = quic_chacha20_avx2; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx512_t1/mb_mgr_avx512_t1.c b/lib/avx512_t1/mb_mgr_avx512_t1.c index f91ef0b0..a1ad8f05 100644 --- a/lib/avx512_t1/mb_mgr_avx512_t1.c +++ b/lib/avx512_t1/mb_mgr_avx512_t1.c @@ -326,6 +326,9 @@ submit_aes_docsis256_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job return job; } +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + #define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC submit_job_aes_docsis128_enc_crc32_avx512 #define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC submit_job_aes_docsis256_enc_crc32_avx512 #define FLUSH_JOB_DOCSIS128_SEC_CRC_ENC flush_job_aes_docsis128_enc_crc32_avx512 @@ -578,6 +581,8 @@ init_mb_mgr_avx512_t1_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; state->chacha20_hp_quic = quic_chacha20_avx512; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx512_t2/mb_mgr_avx512_t2.c b/lib/avx512_t2/mb_mgr_avx512_t2.c index 66b0bfad..28700bf7 100644 --- a/lib/avx512_t2/mb_mgr_avx512_t2.c +++ b/lib/avx512_t2/mb_mgr_avx512_t2.c @@ -48,6 +48,7 @@ #include "include/aesni_emu.h" #include "include/error.h" +#include "include/arch_sse_type1.h" /* SM4-ECB */ #include "include/arch_sse_type2.h" /* SHA-NI */ #include "include/arch_avx_type1.h" /* AESNI */ #include "include/arch_avx2_type1.h" /* MD5 */ @@ -332,6 +333,9 @@ submit_job_docsis256_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_J return job; } +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + #define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC submit_job_aes_docsis128_enc_crc32_vaes_avx512 #define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC submit_job_aes_docsis256_enc_crc32_vaes_avx512 #define FLUSH_JOB_DOCSIS128_SEC_CRC_ENC flush_job_aes_docsis128_enc_crc32_vaes_avx512 @@ -589,6 +593,8 @@ init_mb_mgr_avx512_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_vaes_avx512; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; state->chacha20_hp_quic = quic_chacha20_avx512; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx_t1/mb_mgr_avx_t1.c b/lib/avx_t1/mb_mgr_avx_t1.c index a1e29ec1..0f3fb98f 100644 --- a/lib/avx_t1/mb_mgr_avx_t1.c +++ b/lib/avx_t1/mb_mgr_avx_t1.c @@ -244,6 +244,9 @@ flush_snow3g_uea2_job_avx_t1(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + static void reset_ooo_mgrs(IMB_MGR *state) { @@ -482,6 +485,8 @@ init_mb_mgr_avx_t1_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; state->chacha20_hp_quic = quic_chacha20_sse; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/avx_t2/mb_mgr_avx_t2.c b/lib/avx_t2/mb_mgr_avx_t2.c index 6abc7b73..d79cf46d 100644 --- a/lib/avx_t2/mb_mgr_avx_t2.c +++ b/lib/avx_t2/mb_mgr_avx_t2.c @@ -249,6 +249,9 @@ flush_snow3g_uea2_job_avx_t2(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_avx_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + static void reset_ooo_mgrs(IMB_MGR *state) { @@ -487,6 +490,8 @@ init_mb_mgr_avx_t2_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; state->chacha20_hp_quic = quic_chacha20_sse; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/include/arch_noaesni.h b/lib/include/arch_noaesni.h index 1056de43..cd09900d 100644 --- a/lib/include/arch_noaesni.h +++ b/lib/include/arch_noaesni.h @@ -230,6 +230,12 @@ crc8_wimax_ofdma_hcs_sse_no_aesni(const void *msg, const uint64_t len); uint32_t ethernet_fcs_sse_no_aesni_local(const void *msg, const uint64_t len, const void *tag_ouput); +/* SM4 */ +void +sm4_ecb_sse_no_aesni(const void *in, void *out, const int size, const void *exp_keys); + +void +sm4_set_key_sse_no_aesni(const void *pKey, void *exp_enc_keys, void *exp_dec_keys); IMB_DLL_EXPORT void set_suite_id_sse_no_aesni(IMB_MGR *state, IMB_JOB *job); diff --git a/lib/include/arch_sse_type1.h b/lib/include/arch_sse_type1.h index 57c8c21e..679d0b64 100644 --- a/lib/include/arch_sse_type1.h +++ b/lib/include/arch_sse_type1.h @@ -334,6 +334,13 @@ submit_job_snow3g_uia2_sse(MB_MGR_SNOW3G_OOO *state, IMB_JOB *job); IMB_JOB * flush_job_snow3g_uia2_sse(MB_MGR_SNOW3G_OOO *state); +/* SM4 */ +void +sm4_ecb_sse(const void *in, void *out, const int size, const void *exp_keys); + +void +sm4_set_key_sse(const void *pKey, void *exp_enc_keys, void *exp_dec_keys); + IMB_DLL_EXPORT void set_suite_id_sse_t1(IMB_MGR *state, IMB_JOB *job); diff --git a/lib/include/mb_mgr_job_api.h b/lib/include/mb_mgr_job_api.h index 2c63d71c..13d7773e 100644 --- a/lib/include/mb_mgr_job_api.h +++ b/lib/include/mb_mgr_job_api.h @@ -266,6 +266,27 @@ SUBMIT_JOB_AES_CTR_BIT(IMB_JOB *job, const uint64_t key_sz) return job; } +/* ========================================================================= */ +/* SM4 */ +/* ========================================================================= */ +__forceinline IMB_JOB * +SUBMIT_JOB_SM4_ECB_ENC(IMB_JOB *job) +{ + SM4_ECB(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~15), job->enc_keys); + job->status |= IMB_STATUS_COMPLETED_CIPHER; + return job; +} + +__forceinline IMB_JOB * +SUBMIT_JOB_SM4_ECB_DEC(IMB_JOB *job) +{ + SM4_ECB(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~15), job->dec_keys); + job->status |= IMB_STATUS_COMPLETED_CIPHER; + return job; +} + /* ========================================================================= */ /* Custom hash / cipher */ /* ========================================================================= */ @@ -432,6 +453,8 @@ SUBMIT_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher return SUBMIT_JOB_SNOW_V(job); } else if (IMB_CIPHER_SNOW_V_AEAD == cipher_mode) { return submit_snow_v_aead_job(state, job); + } else if (IMB_CIPHER_SM4_ECB == cipher_mode) { + return SUBMIT_JOB_SM4_ECB_ENC(job); #endif /* __aarch64__ */ } else { /* assume IMB_CIPHER_NULL */ job->status |= IMB_STATUS_COMPLETED_CIPHER; @@ -615,6 +638,8 @@ SUBMIT_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher return SUBMIT_JOB_SNOW_V(job); } else if (IMB_CIPHER_SNOW_V_AEAD == cipher_mode) { return submit_snow_v_aead_job(state, job); + } else if (IMB_CIPHER_SM4_ECB == cipher_mode) { + return SUBMIT_JOB_SM4_ECB_DEC(job); #endif /* __aarch64__ */ } else { /* assume IMB_CIPHER_NULL */ @@ -928,6 +953,13 @@ submit_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) } #endif /* __aarch64__ */ +/* SM4-ECB */ +static IMB_JOB * +submit_cipher_dec_sm4_ecb(IMB_MGR *state, IMB_JOB *job) +{ + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); +} + /* ========================= */ /* ======== ENCRYPT ======== */ /* ========================= */ @@ -1176,6 +1208,13 @@ submit_cipher_enc_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) } #endif /* __aarch64__ */ +/* SM4-ECB */ +static IMB_JOB * +submit_cipher_enc_sm4_ecb(IMB_MGR *state, IMB_JOB *job) +{ + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); +} + /* * Four entries per algorithm (different key sizes), * algorithms in the same order IMB_CIPHER_MODE @@ -1334,8 +1373,14 @@ static const submit_flush_fn_t tab_submit_cipher[] = { submit_cipher_dec_aes_gcm_128_sgl, submit_cipher_dec_aes_gcm_192_sgl, submit_cipher_dec_aes_gcm_256_sgl, + /* [24] SM4-ECB */ + submit_cipher_dec_null, + submit_cipher_dec_sm4_ecb, + submit_cipher_dec_null, + submit_cipher_dec_null, #else /* __aarch64__ */ - /* [16] - [23] NULL */ + /* [16] - [24] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1348,11 +1393,6 @@ static const submit_flush_fn_t tab_submit_cipher[] = { /* add new cipher decrypt here */ - /* [24] NULL */ - NULL, - NULL, - NULL, - NULL, /* [25] NULL */ NULL, NULL, @@ -1534,8 +1574,14 @@ static const submit_flush_fn_t tab_submit_cipher[] = { submit_cipher_enc_aes_gcm_128_sgl, submit_cipher_enc_aes_gcm_192_sgl, submit_cipher_enc_aes_gcm_256_sgl, + /* [24] SM4-ECB */ + submit_cipher_enc_null, + submit_cipher_enc_sm4_ecb, + submit_cipher_enc_null, + submit_cipher_enc_null, #else /* __aarch64__ */ - /* [16] - [23] NULL */ + /* [16] - [24] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1548,11 +1594,6 @@ static const submit_flush_fn_t tab_submit_cipher[] = { /* add new cipher encrypt here */ - /* [24] NULL */ - NULL, - NULL, - NULL, - NULL, /* [25] NULL */ NULL, NULL, @@ -1857,6 +1898,13 @@ flush_cipher_dec_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) } #endif /* __aarch64__ */ +/* SM4-ECB */ +static IMB_JOB * +flush_cipher_dec_sm4_ecb(IMB_MGR *state, IMB_JOB *job) +{ + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); +} + /* ========================= */ /* ======== ENCRYPT ======== */ /* ========================= */ @@ -2119,6 +2167,13 @@ flush_cipher_enc_aes_gcm_256_sgl(IMB_MGR *state, IMB_JOB *job) } #endif /* __aarch64__ */ +/* SM4-ECB */ +static IMB_JOB * +flush_cipher_enc_sm4_ecb(IMB_MGR *state, IMB_JOB *job) +{ + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); +} + /* * Four entries per algorithm (different key sizes), * algorithms in the same order IMB_CIPHER_MODE @@ -2273,8 +2328,14 @@ static const submit_flush_fn_t tab_flush_cipher[] = { flush_cipher_dec_aes_gcm_128_sgl, flush_cipher_dec_aes_gcm_192_sgl, flush_cipher_dec_aes_gcm_256_sgl, + /* [24] SM4-ECB */ + flush_cipher_dec_null, + flush_cipher_dec_sm4_ecb, + flush_cipher_dec_null, + flush_cipher_dec_null, #else /* __aarch64__ */ - /* [16] - [23] NULL */ + /* [16] - [24] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -2287,11 +2348,6 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* add new cipher decrypt here */ - /* [24] NULL */ - NULL, - NULL, - NULL, - NULL, /* [25] NULL */ NULL, NULL, @@ -2473,8 +2529,14 @@ static const submit_flush_fn_t tab_flush_cipher[] = { flush_cipher_enc_aes_gcm_128_sgl, flush_cipher_enc_aes_gcm_192_sgl, flush_cipher_enc_aes_gcm_256_sgl, + /* [24] SM4-ECB */ + flush_cipher_enc_null, + flush_cipher_enc_sm4_ecb, + flush_cipher_enc_null, + flush_cipher_enc_null, #else /* __aarch64__ */ - /* [16] - [23] NULL */ + /* [16] - [24] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -2487,11 +2549,6 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* add new cipher encrypt here */ - /* [24] NULL */ - NULL, - NULL, - NULL, - NULL, /* [25] NULL */ NULL, NULL, diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 7d1645d2..d5702ceb 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -829,6 +829,33 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ return 1; } break; + case IMB_CIPHER_SM4_ECB: + if (job->src == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (job->dst == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_DST); + return 1; + } + if (cipher_direction == IMB_DIR_ENCRYPT && job->enc_keys == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); + return 1; + } + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); + return 1; + } + if (job->msg_len_to_cipher_in_bytes == 0 || + job->msg_len_to_cipher_in_bytes > MB_MAX_LEN16) { + imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); + return 1; + } + if (job->msg_len_to_cipher_in_bytes & UINT64_C(15)) { + imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); + return 1; + } + break; #endif /* __aarch64__ */ default: imb_set_errno(state, IMB_ERR_CIPH_MODE); diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 7645167b..d35eddff 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -133,6 +133,8 @@ typedef enum { #define IMB_AES_BLOCK_SIZE 16 +#define IMB_SM4_BLOCK_SIZE 16 + #define IMB_SHA1_DIGEST_SIZE_IN_BYTES 20 #define IMB_SHA224_DIGEST_SIZE_IN_BYTES 28 #define IMB_SHA256_DIGEST_SIZE_IN_BYTES 32 @@ -284,6 +286,7 @@ typedef enum { IMB_CIPHER_SNOW_V, IMB_CIPHER_SNOW_V_AEAD, IMB_CIPHER_GCM_SGL, + IMB_CIPHER_SM4_ECB, IMB_CIPHER_NUM } IMB_CIPHER_MODE; @@ -594,6 +597,9 @@ struct chacha20_poly1305_context_data { uint8_t IV[12]; /**< IV (12 bytes) */ }; +/* 32 precomputed (4-byte) rounds for SM4 key schedule (128 bytes in total) */ +#define IMB_SM4_KEY_SCHEDULE 32 + /** * Maximum Authenticated Tag Length in bytes. */ @@ -872,6 +878,8 @@ typedef IMB_JOB *(*chacha20_poly1305_quic_t)(struct IMB_MGR *, IMB_JOB *); typedef void (*chacha20_hp_quic_t)(const void *, const void *const *, void **, const uint64_t); +typedef void (*sm4_keyexp_t)(const void *, void *, void *); + /* Multi-buffer manager flags passed to alloc_mb_mgr() */ #define IMB_FLAG_SHANI_OFF (1ULL << 0) /**< disable use of SHANI extension */ @@ -1103,6 +1111,8 @@ typedef struct IMB_MGR { chacha20_poly1305_quic_t chacha20_poly1305_quic; chacha20_hp_quic_t chacha20_hp_quic; + sm4_keyexp_t sm4_keyexp; + /* in-order scheduler fields */ int earliest_job; /**< byte offset, -1 if none */ int next_job; /**< byte offset */ @@ -2582,6 +2592,9 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); */ #define IMB_CRC8_WIMAX_OFDMA_HCS(_mgr, _src, _len) (_mgr)->crc8_wimax_ofdma_hcs(_src, _len) +#define IMB_SM4_KEYEXP(_mgr, _key, _exp_enc_key, _exp_dec_key) \ + ((_mgr)->sm4_keyexp((_key), (_exp_enc_key), (_exp_dec_key))) + /* Auxiliary functions */ /** diff --git a/lib/no-aesni/mb_mgr_sse_no_aesni.c b/lib/no-aesni/mb_mgr_sse_no_aesni.c index 1b59618a..732f8d27 100644 --- a/lib/no-aesni/mb_mgr_sse_no_aesni.c +++ b/lib/no-aesni/mb_mgr_sse_no_aesni.c @@ -220,6 +220,9 @@ /* ====================================================================== */ +/* SM4 */ +#define SM4_ECB sm4_ecb_sse_no_aesni + static void reset_ooo_mgrs(IMB_MGR *state) { @@ -460,6 +463,8 @@ init_mb_mgr_sse_no_aesni_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_hp_quic = quic_chacha20_sse; state->set_suite_id = SET_SUITE_ID_FN; + + state->sm4_keyexp = sm4_set_key_sse_no_aesni; } void diff --git a/lib/no-aesni/sm4_sse_no_aesni.asm b/lib/no-aesni/sm4_sse_no_aesni.asm new file mode 100644 index 00000000..bc8e1308 --- /dev/null +++ b/lib/no-aesni/sm4_sse_no_aesni.asm @@ -0,0 +1,31 @@ +;; +;; Copyright (c) 2018-2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +%include "include/aesni_emu.inc" +%define SM4_SET_KEY sm4_set_key_sse_no_aesni +%define SM4_ECB sm4_ecb_sse_no_aesni +%include "sse_t1/sm4_sse.asm" diff --git a/lib/sse_t1/mb_mgr_sse_t1.c b/lib/sse_t1/mb_mgr_sse_t1.c index 5f8374cd..046578fc 100644 --- a/lib/sse_t1/mb_mgr_sse_t1.c +++ b/lib/sse_t1/mb_mgr_sse_t1.c @@ -199,8 +199,6 @@ /* - default x86-64 implementation */ -/* DES-DOCSIS */ - /* - default x86-64 implementation */ /* CHACHA20 & POLY1305 */ @@ -252,6 +250,9 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_sse_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + /* ====================================================================== */ static void @@ -490,6 +491,8 @@ init_mb_mgr_sse_t1_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; state->chacha20_hp_quic = quic_chacha20_sse; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t1/sm4_sse.asm b/lib/sse_t1/sm4_sse.asm new file mode 100644 index 00000000..1f594216 --- /dev/null +++ b/lib/sse_t1/sm4_sse.asm @@ -0,0 +1,485 @@ +;; +;; Copyright (c) 2023, Intel Corporation +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; * Redistributions of source code must retain the above copyright notice, +;; this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; * Neither the name of Intel Corporation nor the names of its contributors +;; may be used to endorse or promote products derived from this software +;; without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;; + +%include "include/os.inc" +%include "include/clear_regs.inc" +%include "include/cet.inc" +%include "include/error.inc" + +%ifndef SM4_SET_KEY +%define SM4_SET_KEY sm4_set_key_sse +%define SM4_ECB sm4_ecb_sse +%endif + +%ifdef LINUX +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%else +%define arg1 rcx +%define arg2 rdx +%define arg3 r8 +%define arg4 r9 +%endif + +%define APPEND(a,b) a %+ b + +mksection .rodata +default rel + +align 16 +SM4_FK: +dd 0xA3B1BAC6, 0x56AA3350, 0x677D9197, 0xB27022DC + +align 16 +SM4_CK: +dd 0x00070E15, 0x1C232A31, 0x383F464D, 0x545B6269, +dd 0x70777E85, 0x8C939AA1, 0xA8AFB6BD, 0xC4CBD2D9, +dd 0xE0E7EEF5, 0xFC030A11, 0x181F262D, 0x343B4249, +dd 0x50575E65, 0x6C737A81, 0x888F969D, 0xA4ABB2B9, +dd 0xC0C7CED5, 0xDCE3EAF1, 0xF8FF060D, 0x141B2229, +dd 0x30373E45, 0x4C535A61, 0x686F767D, 0x848B9299, +dd 0xA0A7AEB5, 0xBCC3CAD1, 0xD8DFE6ED, 0xF4FB0209, +dd 0x10171E25, 0x2C333A41, 0x484F565D, 0x646B7279 + +align 16 +in_mask_lo: +db 0x65, 0x41, 0xfd, 0xd9, 0x0a, 0x2e, 0x92, 0xb6, 0x0f, 0x2b, 0x97, 0xb3, 0x60, 0x44, 0xf8, 0xdc + +align 16 +in_mask_hi: +db 0x00, 0xc9, 0x67, 0xae, 0x80, 0x49, 0xe7, 0x2e, 0x4a, 0x83, 0x2d, 0xe4, 0xca, 0x03, 0xad, 0x64 + +align 16 +out_mask_lo: +db 0xd3, 0x59, 0x38, 0xb2, 0xcc, 0x46, 0x27, 0xad, 0x36, 0xbc, 0xdd, 0x57, 0x29, 0xa3, 0xc2, 0x48 + +align 16 +out_mask_hi: +db 0x00, 0x50, 0x14, 0x44, 0x89, 0xd9, 0x9d, 0xcd, 0xde, 0x8e, 0xca, 0x9a, 0x57, 0x07, 0x43, 0x13 + +align 16 +enc_key: +db 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63 + +align 16 +mask_Srows: +db 0x00, 0x0d, 0x0a, 0x07, 0x04, 0x01, 0x0e, 0x0b, 0x08, 0x05, 0x02, 0x0f, 0x0c, 0x09, 0x06, 0x03 + +align 16 +low_bits_4: +db 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f + +align 16 +swap_bytes: +db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 + +mksection .text + +%macro FUNC_SAVE 0 + mov r11, rsp + sub rsp, 4*16 + 8 + and rsp, ~15 + +%ifidn __OUTPUT_FORMAT__, win64 + ; xmm6:xmm15 need to be maintained for Windows + movdqa [rsp + 0*16], xmm6 + movdqa [rsp + 1*16], xmm7 + movdqa [rsp + 2*16], xmm8 + movdqa [rsp + 3*16], xmm9 +%endif + mov [rsp + 4*16], r11 ;; rsp pointer +%endmacro + +%macro FUNC_RESTORE 0 + +%ifidn __OUTPUT_FORMAT__, win64 + movdqa xmm6, [rsp + 0*16] + movdqa xmm7, [rsp + 1*16] + movdqa xmm8, [rsp + 2*16] + movdqa xmm9, [rsp + 3*16] +%endif + mov rsp, [rsp + 4*16] +%endmacro + +%macro AFFINE 4 +%define %%IN_OUT %1 ; [in/out] Input/output XMM register +%define %%MASK_LO %2 ; [in/clobbered] Low bit mask +%define %%MASK_HI %3 ; [in/clobbered] High bit mask +%define %%XTMP %4 ; [clobbered] Temporary XMM register + + movdqa %%XTMP, %%IN_OUT + psrlq %%XTMP, 4 + pand %%XTMP, [rel low_bits_4] + + pand %%IN_OUT, [rel low_bits_4] + + pshufb %%MASK_LO, %%IN_OUT + pshufb %%MASK_HI, %%XTMP + + movdqa %%IN_OUT, %%MASK_LO + pxor %%IN_OUT, %%MASK_HI +%endmacro + +%macro SBOX 4 +%define %%IN_OUT %1 ; [in/out] Input/output XMM register +%define %%XTMP1 %2 ; [clobbered] Temporary XMM register +%define %%XTMP2 %3 ; [clobbered] Temporary XMM register +%define %%XTMP3 %4 ; [clobbered] Temporary XMM register + + movdqa %%XTMP1, [rel in_mask_lo] + movdqa %%XTMP2, [rel in_mask_hi] + AFFINE %%IN_OUT, %%XTMP1, %%XTMP2, %%XTMP3 + aesenclast %%IN_OUT, [rel enc_key] + pshufb %%IN_OUT, [rel mask_Srows] + movdqa %%XTMP1, [rel out_mask_lo] + movdqa %%XTMP2, [rel out_mask_hi] + AFFINE %%IN_OUT, %%XTMP1, %%XTMP2, %%XTMP3 +%endmacro + +%macro L_TAG 4 +%define %%IN_OUT %1 ; [in/out] Input/output XMM register +%define %%XTMP1 %2 ; [clobbered] Temporary XMM register +%define %%XTMP2 %3 ; [clobbered] Temporary XMM register +%define %%XTMP3 %4 ; [clobbered] Temporary XMM register + + movdqa %%XTMP1, %%IN_OUT + pslld %%XTMP1, 13 + movdqa %%XTMP2, %%IN_OUT + psrld %%XTMP2, 19 + movdqa %%XTMP3, %%IN_OUT + pslld %%XTMP3, 23 + psrld %%IN_OUT, 9 + pxor %%IN_OUT, %%XTMP1 + pxor %%IN_OUT, %%XTMP2 + pxor %%IN_OUT, %%XTMP3 + +%endmacro + +%macro L 5 +%define %%IN_OUT %1 ; [in/out] Input/output XMM register +%define %%XTMP1 %2 ; [clobbered] Temporary XMM register +%define %%XTMP2 %3 ; [clobbered] Temporary XMM register +%define %%XTMP3 %4 ; [clobbered] Temporary XMM register +%define %%XTMP4 %5 ; [clobbered] Temporary XMM register + + movdqa %%XTMP1, %%IN_OUT + pslld %%XTMP1, 2 + movdqa %%XTMP2, %%IN_OUT + psrld %%XTMP2, 30 + movdqa %%XTMP3, %%IN_OUT + pslld %%XTMP3, 10 + movdqa %%XTMP4, %%IN_OUT + psrld %%XTMP4, 22 + + pxor %%XTMP4, %%XTMP1 + pxor %%XTMP4, %%XTMP2 + pxor %%XTMP4, %%XTMP3 + + movdqa %%XTMP1, %%IN_OUT + pslld %%XTMP1, 18 + movdqa %%XTMP2, %%IN_OUT + psrld %%XTMP2, 14 + movdqa %%XTMP3, %%IN_OUT + pslld %%XTMP3, 24 + psrld %%IN_OUT, 8 + + pxor %%IN_OUT, %%XTMP1 + pxor %%IN_OUT, %%XTMP2 + pxor %%IN_OUT, %%XTMP3 + pxor %%IN_OUT, %%XTMP4 +%endmacro + +;; +;; Encrypts/decrypts a single 128-bit block with SM4 +;; +%macro SM4_ENC_DEC 14 +%define %%IN %1 ; [in] Pointer to 128-bit input block +%define %%OUT %2 ; [out] Pointer to 128-bit output block +%define %%KEYS %3 ; [in] Pointer to expanded enc/dec keys +%define %%XTMP1 %4 ; [clobbered] Temporary XMM register +%define %%XTMP2 %5 ; [clobbered] Temporary XMM register +%define %%XTMP3 %6 ; [clobbered] Temporary XMM register +%define %%XTMP4 %7 ; [clobbered] Temporary XMM register +%define %%XTMP5 %8 ; [clobbered] Temporary XMM register +%define %%XTMP6 %9 ; [clobbered] Temporary XMM register +%define %%XTMP7 %10 ; [clobbered] Temporary XMM register +%define %%XTMP8 %11 ; [clobbered] Temporary XMM register +%define %%XTMP9 %12 ; [clobbered] Temporary XMM register +%define %%XTMP %13 ; [clobbered] Temporary XMM register +%define %%IDX %14 ; [clobbered] Temporary GP register + + movd %%XTMP1, [%%IN + 4*0] + pshufb %%XTMP1, [rel swap_bytes] + movd %%XTMP2, [%%IN + 4*1] + pshufb %%XTMP2, [rel swap_bytes] + movd %%XTMP3, [%%IN + 4*2] + pshufb %%XTMP3, [rel swap_bytes] + movd %%XTMP4, [%%IN + 4*3] + pshufb %%XTMP4, [rel swap_bytes] + + xor %%IDX, %%IDX +%%start_loop: + cmp %%IDX, 16*8 + je %%end_loop + + movdqa %%XTMP5, [%%KEYS + %%IDX] + pshufd %%XTMP, %%XTMP5, 0x00 + pxor %%XTMP, %%XTMP2 + pxor %%XTMP, %%XTMP3 + pxor %%XTMP, %%XTMP4 + + SBOX %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8 + pxor %%XTMP1, %%XTMP + L %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8, %%XTMP9 + pxor %%XTMP1, %%XTMP + + pshufd %%XTMP, %%XTMP5, 0x55 + pxor %%XTMP, %%XTMP3 + pxor %%XTMP, %%XTMP4 + pxor %%XTMP, %%XTMP1 + + SBOX %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8 + pxor %%XTMP2, %%XTMP + L %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8, %%XTMP9 + pxor %%XTMP2, %%XTMP + + pshufd %%XTMP, %%XTMP5, 0xAA + pxor %%XTMP, %%XTMP4 + pxor %%XTMP, %%XTMP1 + pxor %%XTMP, %%XTMP2 + + SBOX %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8 + pxor %%XTMP3, %%XTMP + L %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8, %%XTMP9 + pxor %%XTMP3, %%XTMP + + pshufd %%XTMP, %%XTMP5, 0xFF + pxor %%XTMP, %%XTMP1 + pxor %%XTMP, %%XTMP2 + pxor %%XTMP, %%XTMP3 + + SBOX %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8 + pxor %%XTMP4, %%XTMP + L %%XTMP, %%XTMP6, %%XTMP7, %%XTMP8, %%XTMP9 + pxor %%XTMP4, %%XTMP + + add %%IDX, 16 + jmp %%start_loop + +%%end_loop: + pshufb %%XTMP4, [rel swap_bytes] + movd [%%OUT + 4*0], %%XTMP4 + pshufb %%XTMP3, [rel swap_bytes] + movd [%%OUT + 4*1], %%XTMP3 + pshufb %%XTMP2, [rel swap_bytes] + movd [%%OUT + 4*2], %%XTMP2 + pshufb %%XTMP1, [rel swap_bytes] + movd [%%OUT + 4*3], %%XTMP1 + +%assign %%i 0 +%endmacro + + +;; +;;void sm4_set_key_sse(const void *key, const uint32_t *exp_enc_keys, +;; const uint32_t *exp_dec_keys) +;; +; arg 1: KEY: pointer to 128-bit key +; arg 2: EXP_ENC_KEYS: pointer to expanded encryption keys +; arg 3: EXP_DEC_KEYS: pointer to expanded decryption keys +; +align 16 +MKGLOBAL(SM4_SET_KEY,function,internal) +SM4_SET_KEY: + +%define KEY arg1 +%define ENC_KEY_EXP arg2 +%define DEC_KEY_EXP arg3 + +%define XTMP1 xmm1 +%define XTMP2 xmm2 +%define XTMP3 xmm3 +%define XTMP4 xmm4 +%define XTMP5 xmm5 +%define XTMP6 xmm6 +%define XTMP7 xmm7 +%define XTMP xmm8 + + endbranch64 +%ifdef SAFE_PARAM + IMB_ERR_CHECK_RESET + + cmp KEY, 0 + jz error_set_key_sse + cmp ENC_KEY_EXP, 0 + jz error_set_key_sse + cmp DEC_KEY_EXP, 0 + jz error_set_key_sse +%endif + FUNC_SAVE + + mov eax, [KEY + 4*0] + bswap eax + xor eax, [SM4_FK + 4*0] + movd XTMP1, eax + mov eax, [KEY + 4*1] + bswap eax + xor eax, [SM4_FK + 4*1] + movd XTMP2, eax + mov eax, [KEY + 4*2] + bswap eax + xor eax, [SM4_FK + 4*2] + movd XTMP3, eax + mov eax, [KEY + 4*3] + bswap eax + xor eax, [SM4_FK + 4*3] + movd XTMP4, eax + +%assign i 0 +%rep 8 + movd XTMP, [SM4_CK + i*16 + 4*0] + pxor XTMP, XTMP2 + pxor XTMP, XTMP3 + pxor XTMP, XTMP4 + + SBOX XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP1, XTMP + L_TAG XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP1, XTMP + movd [ENC_KEY_EXP + i*16 + 4*0], XTMP1 + movd [DEC_KEY_EXP + (7-i)*16 + 4*3], XTMP1 + + + movd XTMP, [SM4_CK + i*16 + 4*1] + pxor XTMP, XTMP3 + pxor XTMP, XTMP4 + pxor XTMP, XTMP1 + + SBOX XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP2, XTMP + L_TAG XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP2, XTMP + movd [ENC_KEY_EXP + i*16 + 4*1], XTMP2 + movd [DEC_KEY_EXP + (7-i)*16 + 4*2], XTMP2 + + + movd XTMP, [SM4_CK + i*16 + 4*2] + pxor XTMP, XTMP4 + pxor XTMP, XTMP1 + pxor XTMP, XTMP2 + + SBOX XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP3, XTMP + L_TAG XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP3, XTMP + movd [ENC_KEY_EXP + i*16 + 4*2], XTMP3 + movd [DEC_KEY_EXP + (7-i)*16 + 4*1], XTMP3 + + + movd XTMP, [SM4_CK + i*16 + 4*3] + pxor XTMP, XTMP1 + pxor XTMP, XTMP2 + pxor XTMP, XTMP3 + + SBOX XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP4, XTMP + L_TAG XTMP, XTMP5, XTMP6, XTMP7 + pxor XTMP4, XTMP + movd [ENC_KEY_EXP + i*16 + 4*3], XTMP4 + movd [DEC_KEY_EXP + (7-i)*16 + 4*0], XTMP4 + +%assign i (i + 1) +%endrep + +%ifdef SAFE_DATA + clear_all_xmms_sse_asm +%endif + FUNC_RESTORE + + ret + +%ifdef SAFE_PARAM +error_set_key_sse: + IMB_ERR_CHECK_START rax + IMB_ERR_CHECK_NULL KEY, rax, IMB_ERR_NULL_KEY + IMB_ERR_CHECK_NULL ENC_KEY_EXP, rax, IMB_ERR_NULL_EXP_KEY + IMB_ERR_CHECK_NULL DEC_KEY_EXP, rax, IMB_ERR_NULL_EXP_KEY + IMB_ERR_CHECK_END rax + + ret +%endif + +;; +;;void sm4_ecb_sse(const void *in, void *out, uint64_t len, +;; const uint32_t *exp_keys) +;; +; arg 1: IN: pointer to input (cipher text) +; arg 2: OUT: pointer to output (plain text) +; arg 3: LEN: length in bytes (multiple of 16) +; arg 4: KEYS: pointer to keys +; +MKGLOBAL(SM4_ECB,function,internal) +SM4_ECB: + +%define IN arg1 +%define OUT arg2 +%define SIZE arg3 +%define KEY_EXP arg4 + + FUNC_SAVE + + shr SIZE, 4 ; Number of blocks + +align 16 +ecb_loop: + or SIZE, SIZE + jz end_ecb_loop + + SM4_ENC_DEC IN, OUT, KEY_EXP, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, r10 + + dec SIZE + add IN, 16 + add OUT, 16 + + jmp ecb_loop + +end_ecb_loop: + +%ifdef SAFE_DATA + clear_all_xmms_sse_asm +%endif + FUNC_RESTORE + + ret + + +;---------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------------------- + +mksection stack-noexec diff --git a/lib/sse_t2/mb_mgr_sse_t2.c b/lib/sse_t2/mb_mgr_sse_t2.c index eaaf9515..29e24175 100644 --- a/lib/sse_t2/mb_mgr_sse_t2.c +++ b/lib/sse_t2/mb_mgr_sse_t2.c @@ -252,6 +252,9 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_sse_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + /* ====================================================================== */ static void @@ -490,6 +493,8 @@ init_mb_mgr_sse_t2_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; state->chacha20_hp_quic = quic_chacha20_sse; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/sse_t3/mb_mgr_sse_t3.c b/lib/sse_t3/mb_mgr_sse_t3.c index 16ae2375..1e4970e2 100644 --- a/lib/sse_t3/mb_mgr_sse_t3.c +++ b/lib/sse_t3/mb_mgr_sse_t3.c @@ -253,6 +253,9 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) /* AES-DOCSIS */ #define ETHERNET_FCS ethernet_fcs_sse_local +/* SM4 */ +#define SM4_ECB sm4_ecb_sse + /* ====================================================================== */ static void @@ -491,6 +494,8 @@ init_mb_mgr_sse_t3_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; state->chacha20_hp_quic = quic_chacha20_sse; + + state->sm4_keyexp = sm4_set_key_sse; } #include "mb_mgr_code.h" diff --git a/lib/win_x64.mak b/lib/win_x64.mak index 7acaf31d..68a1b5cf 100644 --- a/lib/win_x64.mak +++ b/lib/win_x64.mak @@ -370,7 +370,8 @@ lib_objs1 = \ $(OBJ_DIR)\quic_hp_chacha20.obj \ $(OBJ_DIR)\quic_chacha20_poly1305.obj \ $(OBJ_DIR)\hmac_ipad_opad.obj \ - $(OBJ_DIR)\cipher_suite_id.obj + $(OBJ_DIR)\cipher_suite_id.obj \ + $(OBJ_DIR)\sm4_sse.obj lib_objs2 = \ $(OBJ_DIR)\mb_mgr_aes192_cbc_enc_flush_avx.obj \ @@ -552,7 +553,8 @@ no_aesni_objs = \ $(OBJ_DIR)\gcm192_gmac_api_sse_no_aesni.obj \ $(OBJ_DIR)\gcm256_api_sse_no_aesni.obj \ $(OBJ_DIR)\gcm256_sgl_api_sse_no_aesni.obj \ - $(OBJ_DIR)\gcm256_gmac_api_sse_no_aesni.obj + $(OBJ_DIR)\gcm256_gmac_api_sse_no_aesni.obj \ + $(OBJ_DIR)\sm4_sse_no_aesni.obj gcm_objs = \ $(OBJ_DIR)\gcm.obj \ -- GitLab From 1d72939807e8beb0e63fe5ef329670e315aa85cb Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 7 Sep 2023 12:40:27 +0100 Subject: [PATCH 079/204] test: [KAT] add SM4-ECB tests --- test/kat-app/CMakeLists.txt | 2 + test/kat-app/Makefile | 3 +- test/kat-app/api_test.c | 4 +- test/kat-app/main.c | 11 +- test/kat-app/sm4_ecb_test.c | 264 +++++++++++++++++++++++++++++++ test/kat-app/sm4_ecb_test.json.c | 43 +++++ test/kat-app/win_x64.mak | 2 +- 7 files changed, 322 insertions(+), 7 deletions(-) create mode 100644 test/kat-app/sm4_ecb_test.c create mode 100644 test/kat-app/sm4_ecb_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index fd8b9e01..4bea0414 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -114,6 +114,8 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/ccm_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f8_vectors.json.c ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f9_vectors.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/sm4_ecb_test.c + ${CMAKE_CURRENT_SOURCE_DIR}/sm4_ecb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index f2e1c0fb..9058a66c 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -43,7 +43,8 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ cmac_test.json.c xcbc_test.json.c sha_test.json.c aes_cbcs_test.json.c gmac_test.c aes_cfb_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ - chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c + chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ + sm4_ecb_test.c sm4_ecb_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index bec1501a..ae57f431 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -339,6 +339,7 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, ptr64[0] = ((pli >> 8) & 0xff) | ((pli & 0xff) << 8); break; case IMB_CIPHER_ECB: + case IMB_CIPHER_SM4_ECB: job->key_len_in_bytes = UINT64_C(16); break; #endif /* __aarch64__ */ @@ -1665,7 +1666,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) continue; /* Skip AES-ECB, as it doesn't use any IV */ - if (cipher == IMB_CIPHER_ECB) + if (cipher == IMB_CIPHER_ECB || cipher == IMB_CIPHER_SM4_ECB) continue; fill_in_job(&template_job, cipher, dir, hash, order, &chacha_ctx, @@ -1795,6 +1796,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) case IMB_CIPHER_DES: case IMB_CIPHER_DES3: case IMB_CIPHER_DOCSIS_DES: + case IMB_CIPHER_SM4_ECB: case IMB_CIPHER_ECB: template_job.dec_keys = NULL; if (!is_submit_invalid(mb_mgr, &template_job, diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 45dc0c64..4671edef 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -98,11 +98,13 @@ gmac_test(struct IMB_MGR *mb_mgr); extern int ghash_test(struct IMB_MGR *mb_mgr); extern int -cbc_test(struct IMB_MGR *mb_mg); +cbc_test(struct IMB_MGR *mb_mgr); extern int -cfb_test(struct IMB_MGR *mb_mg); +cfb_test(struct IMB_MGR *mb_mgr); extern int -ctr_test(struct IMB_MGR *mb_mg); +ctr_test(struct IMB_MGR *mb_mgr); +extern int +sm4_ecb_test(struct IMB_MGR *mb_mgr); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); @@ -169,7 +171,8 @@ struct imb_test tests[] = { { .str = "DIRECT_API_PARAM", .fn = direct_api_param_test, .enabled = 1 }, #ifndef __aarch64__ { .str = "QUIC-ECB", .fn = quic_ecb_test, .enabled = 1 }, - { .str = "QUIC-CHACHA20", .fn = quic_chacha20_test, .enabled = 1 } + { .str = "QUIC-CHACHA20", .fn = quic_chacha20_test, .enabled = 1 }, + { .str = "SM4-ECB", .fn = sm4_ecb_test, .enabled = 1 } #endif /* __aarch64__ */ }; diff --git a/test/kat-app/sm4_ecb_test.c b/test/kat-app/sm4_ecb_test.c new file mode 100644 index 00000000..262c5683 --- /dev/null +++ b/test/kat-app/sm4_ecb_test.c @@ -0,0 +1,264 @@ +/***************************************************************************** + Copyright (c) 2018-2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include +#include +#include +#include +#include + +#include + +#include "utils.h" +#include "cipher_test.h" + +#define MAX_BURST_JOBS 64 + +int +sm4_ecb_test(struct IMB_MGR *mb_mgr); + +extern const struct cipher_test sm4_ecb_test_json[]; + +static int +sm4_job_ok(const struct IMB_JOB *job, IMB_MGR *mgr, const uint8_t *out_text, const uint8_t *target, + const uint8_t *padding, const size_t sizeof_padding, const unsigned text_len) +{ + const int num = (const int) ((uint64_t) job->user_data2); + + if (job->status != IMB_STATUS_COMPLETED) { + printf("%d error status:%d, job %d", __LINE__, job->status, num); + imb_get_strerror(imb_get_errno(mgr)); + return 0; + } + if (memcmp(out_text, target + sizeof_padding, text_len)) { + printf("%d mismatched\n", num); + return 0; + } + if (memcmp(padding, target, sizeof_padding)) { + printf("%d overwrite head\n", num); + return 0; + } + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { + printf("%d overwrite tail\n", num); + return 0; + } + return 1; +} + +static int +test_sm4_ecb_many(struct IMB_MGR *mb_mgr, uint32_t *exp_enc_keys, uint32_t *exp_dec_keys, + const void *iv, const uint8_t *in_text, const uint8_t *out_text, + const unsigned text_len, const int dir, const int order, + const IMB_CIPHER_MODE cipher, const int in_place, const int num_jobs) +{ + struct IMB_JOB *job; + uint8_t padding[16]; + uint8_t **targets = malloc(num_jobs * sizeof(void *)); + int i, err, jobs_rx = 0, ret = -1; + + if (targets == NULL) + goto end_alloc; + + memset(targets, 0, num_jobs * sizeof(void *)); + memset(padding, -1, sizeof(padding)); + + for (i = 0; i < num_jobs; i++) { + targets[i] = malloc(text_len + (sizeof(padding) * 2)); + if (targets[i] == NULL) + goto end_alloc; + memset(targets[i], -1, text_len + (sizeof(padding) * 2)); + if (in_place) { + /* copy input text to the allocated buffer */ + memcpy(targets[i] + sizeof(padding), in_text, text_len); + } + } + + /* flush the scheduler */ + while (IMB_FLUSH_JOB(mb_mgr) != NULL) + ; + + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(mb_mgr); + job->cipher_direction = dir; + job->chain_order = order; + if (!in_place) { + job->dst = targets[i] + sizeof(padding); + job->src = in_text; + } else { + job->dst = targets[i] + sizeof(padding); + job->src = targets[i] + sizeof(padding); + } + job->cipher_mode = cipher; + job->enc_keys = exp_enc_keys; + job->dec_keys = exp_dec_keys; + job->key_len_in_bytes = 16; + + job->iv = iv; + job->iv_len_in_bytes = 0; + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = text_len; + job->user_data = targets[i]; + job->user_data2 = (void *) ((uint64_t) i); + + job->hash_alg = IMB_AUTH_NULL; + + job = IMB_SUBMIT_JOB(mb_mgr); + if (job == NULL) { + /* no job returned - check for error */ + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + } else { + /* got job back */ + jobs_rx++; + if (!sm4_job_ok(job, mb_mgr, out_text, job->user_data, padding, + sizeof(padding), text_len)) + goto end; + } + } + + while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + + jobs_rx++; + if (!sm4_job_ok(job, mb_mgr, out_text, job->user_data, padding, sizeof(padding), + text_len)) + goto end; + } + + if (jobs_rx != num_jobs) { + printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); + goto end; + } + ret = 0; + +end: + while (IMB_FLUSH_JOB(mb_mgr) != NULL) { + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + } + +end_alloc: + if (targets != NULL) { + for (i = 0; i < num_jobs; i++) + free(targets[i]); + free(targets); + } + + return ret; +} + +static void +test_sm4_ecb_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, + const IMB_CIPHER_MODE cipher, const int num_jobs) +{ + const struct cipher_test *v = sm4_ecb_test_json; + DECLARE_ALIGNED(uint32_t exp_enc_keys[IMB_SM4_KEY_SCHEDULE], 16); + DECLARE_ALIGNED(uint32_t exp_dec_keys[IMB_SM4_KEY_SCHEDULE], 16); + + if (!quiet_mode) + printf("SM4-ECB Test (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { + if (!quiet_mode) { +#ifdef DEBUG + printf("SM4-ECB Test Case %zu\n", v->tcId); +#else + printf("."); +#endif + } + + IMB_SM4_KEYEXP(mb_mgr, v->key, exp_enc_keys, exp_dec_keys); + + if (test_sm4_ecb_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 0, num_jobs)) { + printf("error #%zu encrypt\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_sm4_ecb_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 0, num_jobs)) { + printf("error #%zu decrypt\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_sm4_ecb_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 1, num_jobs)) { + printf("error #%zu encrypt in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_sm4_ecb_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 1, num_jobs)) { + printf("error #%zu decrypt in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + } + + if (!quiet_mode) + printf("\n"); +} + +int +sm4_ecb_test(struct IMB_MGR *mb_mgr) +{ + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17, MAX_BURST_JOBS }; + unsigned i; + int errors = 0; + struct test_suite_context ctx; + + test_suite_start(&ctx, "SM4-ECB-128"); + for (i = 0; i < DIM(num_jobs_tab); i++) + test_sm4_ecb_vectors(mb_mgr, &ctx, IMB_CIPHER_SM4_ECB, num_jobs_tab[i]); + errors += test_suite_end(&ctx); + + return errors; +} diff --git a/test/kat-app/sm4_ecb_test.json.c b/test/kat-app/sm4_ecb_test.json.c new file mode 100644 index 00000000..9aa4b19c --- /dev/null +++ b/test/kat-app/sm4_ecb_test.json.c @@ -0,0 +1,43 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* SM4-ECB */ +#include "cipher_test.h" +const struct cipher_test sm4_ecb_test_json[] = { + /* Vectors from https://datatracker.ietf.org/doc/draft-ribose-cfrg-sm4/00/ and + https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 */ + { 0, 128, 1, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", NULL, + "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", + "\x68\x1E\xDF\x34\xD2\x06\x96\x5E\x86\xB3\xE9\x4F\x53\x6E\x42\x46", 1, 128 }, + { 0, 128, 2, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", NULL, + "\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD" + "\xEE\xEE\xEE\xEE\xFF\xFF\xFF\xFF\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB", + "\x5E\xC8\x14\x3D\xE5\x09\xCF\xF7\xB5\x17\x9F\x8F\x47\x4B\x86\x19" + "\x2F\x1D\x30\x5A\x7F\xB1\x7D\xF9\x85\xF8\x1C\x84\x82\x19\x23\x04", + 1, 256 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 595d9bff..22259e60 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 671145579f738df018657fd8293871989710d7c6 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 11 Sep 2023 21:53:13 +0100 Subject: [PATCH 080/204] perf: add SM4-ECB --- perf/ipsec_perf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 5141903b..96c132ea 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -156,6 +156,7 @@ enum test_cipher_mode_e { TEST_AEAD_CHACHA20, TEST_SNOW_V, TEST_SNOW_V_AEAD, + TEST_SM4_ECB, TEST_NUM_CIPHER_TESTS }; @@ -320,6 +321,8 @@ const struct str_value_mapping cipher_algo_str_map[] = { { .name = "chacha20", .values.job_params = { .cipher_mode = TEST_CHACHA20, .key_size = 32 } }, { .name = "snow-v", .values.job_params = { .cipher_mode = TEST_SNOW_V, .key_size = 32 } }, + { .name = "sm4-ecb", + .values.job_params = { .cipher_mode = TEST_SM4_ECB, .key_size = IMB_KEY_128_BYTES } }, { .name = "null", .values.job_params = { .cipher_mode = TEST_NULL_CIPHER, .key_size = 0 } } #endif /* __aarch64__ */ }; @@ -1314,6 +1317,9 @@ translate_cipher_mode(const enum test_cipher_mode_e test_mode) case TEST_SNOW_V_AEAD: c_mode = IMB_CIPHER_SNOW_V_AEAD; break; + case TEST_SM4_ECB: + c_mode = IMB_CIPHER_SM4_ECB; + break; default: break; } @@ -2096,7 +2102,8 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 } else if (job_template.cipher_mode == IMB_CIPHER_CBCS_1_9) { job_template.key_len_in_bytes = 16; /* cbcs-128 support only */ job_template.cipher_fields.CBCS.next_iv = next_iv; - } else if (job_template.cipher_mode == IMB_CIPHER_ECB) + } else if (job_template.cipher_mode == IMB_CIPHER_ECB || + job_template.cipher_mode == IMB_CIPHER_SM4_ECB) job_template.iv_len_in_bytes = 0; else if (job_template.cipher_mode == IMB_CIPHER_CHACHA20) job_template.iv_len_in_bytes = 12; @@ -2951,7 +2958,8 @@ print_times(struct variant_s *variant_list, struct params_s *params, const uint3 "CHACHA20", "CHACHA20_AEAD", "SNOW_V", - "SNOW_V_AEAD" }; + "SNOW_V_AEAD", + "SM4_ECB" }; const char *c_dir_names[2] = { "ENCRYPT", "DECRYPT" }; const char *h_alg_names[TEST_NUM_HASH_TESTS - 1] = { "SHA1_HMAC", "SHA_224_HMAC", -- GitLab From 9cddf749f1b9b130d99fa6bb0351492561a8e251 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 12 Sep 2023 10:20:00 +0100 Subject: [PATCH 081/204] test: [XVALID] add SM4-ECB --- test/xvalid-app/ipsec_xvalid.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 20520e73..e0965137 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -230,6 +230,8 @@ struct str_value_mapping cipher_algo_str_map[] = { .values.job_params = { .cipher_mode = IMB_CIPHER_CHACHA20, .key_size = 32 } }, { .name = "SNOW-V", .values.job_params = { .cipher_mode = IMB_CIPHER_SNOW_V, .key_size = 32 } }, + { .name = "SM4-ECB", + .values.job_params = { .cipher_mode = IMB_CIPHER_SM4_ECB, .key_size = 16 } }, #endif /* __aarch64__ */ { .name = "NULL-CIPHER", .values.job_params = { .cipher_mode = IMB_CIPHER_NULL, .key_size = 0 } } @@ -579,6 +581,8 @@ const uint8_t key_sizes[][3] = { { 32, 32, 1 }, /* IMB_CIPHER_CHACHA20_POLY1305_SGL */ { 32, 32, 1 }, /* IMB_CIPHER_SNOW_V */ { 32, 32, 1 }, /* IMB_CIPHER_SNOW_V_AEAD */ + { 16, 32, 8 }, /* IMB_CIPHER_GCM_SGL */ + { 16, 16, 1 }, /* IMB_CIPHER_SM4_ECB */ }; uint8_t custom_test = 0; @@ -1065,6 +1069,7 @@ fill_job(IMB_JOB *job, const struct params_s *params, uint8_t *buf, uint8_t *dig job->iv_len_in_bytes = 8; break; case IMB_CIPHER_ECB: + case IMB_CIPHER_SM4_ECB: job->enc_keys = enc_keys; job->dec_keys = dec_keys; job->iv_len_in_bytes = 0; @@ -1233,6 +1238,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph case IMB_CIPHER_CNTR: case IMB_CIPHER_CNTR_BITLEN: case IMB_CIPHER_DOCSIS_SEC_BPI: + case IMB_CIPHER_SM4_ECB: case IMB_CIPHER_ECB: case IMB_CIPHER_CBCS_1_9: nosimd_memset(enc_keys, pattern_cipher_key, sizeof(keys->enc_keys)); @@ -1409,6 +1415,9 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph return -1; } break; + case IMB_CIPHER_SM4_ECB: + IMB_SM4_KEYEXP(mb_mgr, ciph_key, enc_keys, dec_keys); + break; case IMB_CIPHER_DES: case IMB_CIPHER_DES3: case IMB_CIPHER_DOCSIS_DES: @@ -1693,6 +1702,11 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const random_num &= (~(IMB_DES_BLOCK_SIZE - 1)); } + if (params->cipher_mode == IMB_CIPHER_SM4_ECB) { + random_num += (IMB_SM4_BLOCK_SIZE - 1); + random_num &= (~(IMB_SM4_BLOCK_SIZE - 1)); + } + /* * KASUMI-UIA1 needs to be at least 9 bytes * (IV + direction bit + '1' + 0s to align to -- GitLab From 7d87984d45abb6ddc43d20089f8c305f94145a44 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 20 Sep 2023 11:51:26 +0100 Subject: [PATCH 082/204] test: [XVALID] avoid testing non-multiple of SM4 block buffer sizes --- test/xvalid-app/ipsec_xvalid.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index e0965137..2912d123 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -2172,6 +2172,10 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mgr, const I if ((buf_size % IMB_AES_BLOCK_SIZE) != 0) continue; + if (params->cipher_mode == IMB_CIPHER_SM4_ECB) + if ((buf_size % IMB_SM4_BLOCK_SIZE) != 0) + continue; + if (params->cipher_mode == IMB_CIPHER_DES || params->cipher_mode == IMB_CIPHER_DES3) if ((buf_size % IMB_DES_BLOCK_SIZE) != 0) -- GitLab From aa52c0cbdaa132d86933a5a4dc4b443be1f90331 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 21 Sep 2023 13:14:49 +0100 Subject: [PATCH 083/204] avx2: [gcm] fix for counter block increment (byte overflow) and reduction in code footprint --- lib/include/gcm_vaes_avx2.inc | 158 ++++++++++++++++------------------ 1 file changed, 74 insertions(+), 84 deletions(-) diff --git a/lib/include/gcm_vaes_avx2.inc b/lib/include/gcm_vaes_avx2.inc index 63711c9b..032b5793 100644 --- a/lib/include/gcm_vaes_avx2.inc +++ b/lib/include/gcm_vaes_avx2.inc @@ -112,6 +112,8 @@ ; throughout the code, one tab and two tab indentations are used. one tab is for GHASH part, two tabs is for AES part. ; +%use smartalign + %include "include/os.inc" %include "include/reg_sizes.inc" %include "include/clear_regs.inc" @@ -1660,9 +1662,9 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] %define %%XMM7 %18 %define %%XMM8 %19 %define %%T7 %20 -%define %%loop_idx %21 -%define %%ENC_DEC %22 -%define %%FULL_PARTIAL %23 +%define %%ENC_DEC %21 +%define %%FULL_PARTIAL %22 +%define %%CTR_CHECK %23 vmovdqa [rsp + TMP1], %%XMM1 vmovdqa [rsp + TMP2], %%XMM2 @@ -1673,7 +1675,23 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] vmovdqa [rsp + TMP7], %%XMM7 vmovdqa [rsp + TMP8], %%XMM8 -%ifidn %%loop_idx, in_order + cmp DWORD(%%CTR_CHECK), (255 - 8) + ja %%_ctr_overflow8 + + vpaddd %%XMM1, %%CTR, [rel ONEf] ; INCR CNT + vmovdqa %%T5, [rel TWOf] + vpaddd %%XMM2, %%CTR, %%T5 + vpaddd %%XMM3, %%XMM1, %%T5 + vpaddd %%XMM4, %%XMM2, %%T5 + vpaddd %%XMM5, %%XMM3, %%T5 + vpaddd %%XMM6, %%XMM4, %%T5 + vpaddd %%XMM7, %%XMM5, %%T5 + vpaddd %%XMM8, %%XMM6, %%T5 + vmovdqa %%CTR, %%XMM8 + jmp %%_ctr_overflow8_end + +%%_ctr_overflow8: + vpshufb %%CTR, %%CTR, [rel SHUF_MASK] vpaddd %%XMM1, %%CTR, [rel ONE] ; INCR CNT vmovdqa %%T5, [rel TWO] vpaddd %%XMM2, %%CTR, %%T5 @@ -1683,7 +1701,6 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] vpaddd %%XMM6, %%XMM4, %%T5 vpaddd %%XMM7, %%XMM5, %%T5 vpaddd %%XMM8, %%XMM6, %%T5 - vmovdqa %%CTR, %%XMM8 vmovdqa %%T5, [rel SHUF_MASK] vpshufb %%XMM1, %%T5 ; perform a 16Byte swap @@ -1694,18 +1711,10 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] vpshufb %%XMM6, %%T5 ; perform a 16Byte swap vpshufb %%XMM7, %%T5 ; perform a 16Byte swap vpshufb %%XMM8, %%T5 ; perform a 16Byte swap -%else - vpaddd %%XMM1, %%CTR, [rel ONEf] ; INCR CNT - vmovdqa %%T5, [rel TWOf] - vpaddd %%XMM2, %%CTR, %%T5 - vpaddd %%XMM3, %%XMM1, %%T5 - vpaddd %%XMM4, %%XMM2, %%T5 - vpaddd %%XMM5, %%XMM3, %%T5 - vpaddd %%XMM6, %%XMM4, %%T5 - vpaddd %%XMM7, %%XMM5, %%T5 - vpaddd %%XMM8, %%XMM6, %%T5 vmovdqa %%CTR, %%XMM8 -%endif +align 32 +%%_ctr_overflow8_end: + add BYTE(%%CTR_CHECK), 8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2120,9 +2129,9 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] %define %%XMM7 %18 %define %%XMM8 %19 %define %%T7 %20 -%define %%loop_idx %21 -%define %%ENC_DEC %22 -%define %%FULL_PARTIAL %23 +%define %%ENC_DEC %21 +%define %%FULL_PARTIAL %22 +%define %%CTR_CHECK %23 ;; [in/out] GP register with counter check %xdefine %%YMM1 YWORD(%%XMM1) %xdefine %%YMM2 YWORD(%%XMM2) @@ -2133,10 +2142,26 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] %xdefine %%YMM7 YWORD(%%XMM7) %xdefine %%YMM8 YWORD(%%XMM8) -%ifidn %%loop_idx, in_order + cmp DWORD(%%CTR_CHECK), (255 - 16) + ja %%_counter_overflow16 + ;; CTR in big endian + vinserti128 YWORD(%%CTR), %%CTR, 1 + vpaddd %%YMM1, YWORD(%%CTR), [rel ONE_TWOf] ; INCR CNT + vmovdqa YWORD(%%T5), [rel TWO_TWOf] + vpaddd %%YMM2, %%YMM1, YWORD(%%T5) + vpaddd %%YMM3, %%YMM2, YWORD(%%T5) + vpaddd %%YMM4, %%YMM3, YWORD(%%T5) + vpaddd %%YMM5, %%YMM4, YWORD(%%T5) + vpaddd %%YMM6, %%YMM5, YWORD(%%T5) + vpaddd %%YMM7, %%YMM6, YWORD(%%T5) + vpaddd %%YMM8, %%YMM7, YWORD(%%T5) + vextracti128 %%CTR, %%YMM8, 1 + jmp %%_end_overflow16_check +%%_counter_overflow16: + ;; CTR in big endian vpshufb %%CTR, %%CTR, [rel SHUF_MASK] vinserti128 YWORD(%%CTR), %%CTR, 1 - vpaddd %%YMM1, YWORD(%%CTR), [rel ONE_TWO] ; INCR CNT + vpaddd %%YMM1, YWORD(%%CTR), [rel ONE_TWO] ; INCR CNT vmovdqa YWORD(%%T5), [rel TWO_TWO] vpaddd %%YMM2, %%YMM1, YWORD(%%T5) vpaddd %%YMM3, %%YMM2, YWORD(%%T5) @@ -2156,21 +2181,12 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] vpshufb %%YMM7, %%YMM7, YWORD(%%T5) vpshufb %%YMM8, %%YMM8, YWORD(%%T5) vextracti128 %%CTR, %%YMM8, 1 -%else - vinserti128 YWORD(%%CTR), %%CTR, 1 - vpaddd %%YMM1, YWORD(%%CTR), [rel ONE_TWOf] ; INCR CNT - vmovdqa YWORD(%%T5), [rel TWO_TWOf] - vpaddd %%YMM2, %%YMM1, YWORD(%%T5) - vpaddd %%YMM3, %%YMM2, YWORD(%%T5) - vpaddd %%YMM4, %%YMM3, YWORD(%%T5) - vpaddd %%YMM5, %%YMM4, YWORD(%%T5) - vpaddd %%YMM6, %%YMM5, YWORD(%%T5) - vpaddd %%YMM7, %%YMM6, YWORD(%%T5) - vpaddd %%YMM8, %%YMM7, YWORD(%%T5) - vextracti128 %%CTR, %%YMM8, 1 -%endif + ;; CTR left in big endian +align 32 +%%_end_overflow16_check: + add BYTE(%%CTR_CHECK), 16 - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; vbroadcasti128 YWORD(%%T1), [%%GDATA + 16*0] vpxor %%YMM1, %%YMM1, YWORD(%%T1) @@ -3448,17 +3464,14 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] INITIAL_8BLOCKS_CIPHER %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, r13, %%DATA_OFFSET, {8*16}, xmm12, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, %%ENC_DEC %%_encrypt_by_16_parallel: - ;; in_order vs. out_order is an optimization to increment the counter without shuffling - ;; it back into little endian. r15d keeps track of when we need to increent in order so + ;; r15d keeps track of when we need to increment in order so ;; that the carry is handled correctly. vmovd r15d, xmm9 and r15d, 255 - vpshufb xmm9, [rel SHUF_MASK] + vpshufb xmm9, [rel SHUF_MASK] ;; -> big endian CTR +align 32 %%_encrypt_by_16_new: - cmp r15d, 255-16 - ja %%_encrypt_by_16 - ;; xmm0 - T1 ;; xmm10 - T2 ;; xmm11 - T3 @@ -3475,26 +3488,14 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] ;; xmm7 - XMM7 ;; xmm8 - XMM8 ;; xmm15 - T7 - add r15b, 16 - GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, out_order, %%ENC_DEC, full - add %%DATA_OFFSET, 256 - sub r13, 256 - cmp r13, 256 - ja %%_encrypt_by_16_new - - vpshufb xmm9, [rel SHUF_MASK] - jmp %%_encrypt_by_16_parallel_done -%%_encrypt_by_16: - vpshufb xmm9, [rel SHUF_MASK] - add r15b, 16 - GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, full - vpshufb xmm9, [rel SHUF_MASK] + GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, %%ENC_DEC, full, r15 add %%DATA_OFFSET, 256 sub r13, 256 cmp r13, 256 - ja %%_encrypt_by_16_new - vpshufb xmm9, [rel SHUF_MASK] + jae %%_encrypt_by_16_new + + vpshufb xmm9, [rel SHUF_MASK] ;; -> little endian CTR %%_encrypt_by_16_parallel_done: ;; ghash last 8 and move the cipher text blocks for ghash @@ -3526,26 +3527,23 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] vmovdqu [rsp + TMP7], xmm7 vmovdqu [rsp + TMP8], xmm8 - ;; Encrypt the final <16 byte (partial) block, then hash - cmp r13, 16 - jl %%_encrypt_final_partial + ;; is it the end of the message? + or r13, r13 + je %%_encrypt_done ;; Process 7 full blocks plus a partial block cmp r13, 128 jl %%_encrypt_by_8_partial %%_encrypt_by_8_parallel: - ;; in_order vs. out_order is an optimization to increment the counter without shuffling - ;; it back into little endian. r15d keeps track of when we need to increent in order so + ;; r15d keeps track of when we need to increment in order so ;; that the carry is handled correctly. vmovd r15d, xmm9 and r15d, 255 - vpshufb xmm9, [rel SHUF_MASK] + vpshufb xmm9, [rel SHUF_MASK] ;; -> big endian CTR +align 32 %%_encrypt_by_8_new: - cmp r15d, 255-8 - ja %%_encrypt_by_8 - ;; xmm0 - T1 ;; xmm10 - T2 ;; xmm11 - T3 @@ -3562,26 +3560,13 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] ;; xmm7 - XMM7 ;; xmm8 - XMM8 ;; xmm15 - T7 - add r15b, 8 - GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, out_order, %%ENC_DEC, full + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, %%ENC_DEC, full, r15 add %%DATA_OFFSET, 128 sub r13, 128 cmp r13, 128 jae %%_encrypt_by_8_new - vpshufb xmm9, [rel SHUF_MASK] - jmp %%_encrypt_by_8_parallel_done - -%%_encrypt_by_8: - vpshufb xmm9, [rel SHUF_MASK] - add r15b, 8 - GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, full - vpshufb xmm9, [rel SHUF_MASK] - add %%DATA_OFFSET, 128 - sub r13, 128 - cmp r13, 128 - jae %%_encrypt_by_8_new - vpshufb xmm9, [rel SHUF_MASK] + vpshufb xmm9, [rel SHUF_MASK] ;; -> little endian CTR %%_encrypt_by_8_parallel_done: ;; Test to see if we need a by 8 with partial block. At this point @@ -3593,12 +3578,17 @@ vmovdqu %%T_key, [%%GDATA_KEY+16*j] ;; Shuffle needed to align key for partial block xor. out_order ;; is a little faster because it avoids extra shuffles. ;; TBD: Might need to account for when we don't have room to increment the counter. + vmovd r15d, xmm9 + and r15d, 255 + vpshufb xmm9, [rel SHUF_MASK] ;; -> big endian CTR ;; Process parallel buffers with a final partial block. - GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, in_order, %%ENC_DEC, partial + GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CIPH_PLAIN_OUT, %%PLAIN_CIPH_IN, %%DATA_OFFSET, xmm0, xmm10, xmm11, xmm12, xmm13, xmm14, xmm9, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm15, %%ENC_DEC, partial, r15 + + vpshufb xmm9, [rel SHUF_MASK] ;; -> little endian CTR - add %%DATA_OFFSET, 128-16 - sub r13, 128-16 + add %%DATA_OFFSET, 128 - 16 + sub r13, 128 - 16 %%_encrypt_final_partial: -- GitLab From bd020e9ce7b82d0514be35118892152dd2caaec0 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 14 Sep 2023 16:01:05 +0100 Subject: [PATCH 084/204] sse: add new SM4-CBC implementation --- README.md | 2 + ReleaseNotes.txt | 3 + lib/avx2_t1/mb_mgr_avx2_t1.c | 4 +- lib/avx2_t2/mb_mgr_avx2_t2.c | 4 +- lib/avx2_t3/mb_mgr_avx2_t3.c | 4 +- lib/avx512_t1/mb_mgr_avx512_t1.c | 4 +- lib/avx512_t2/mb_mgr_avx512_t2.c | 4 +- lib/avx_t1/mb_mgr_avx_t1.c | 4 +- lib/avx_t2/mb_mgr_avx_t2.c | 4 +- lib/include/arch_noaesni.h | 7 ++ lib/include/arch_sse_type1.h | 7 ++ lib/include/mb_mgr_job_api.h | 102 +++++++++++++---- lib/include/mb_mgr_job_check.h | 10 ++ lib/ipsec-mb.h | 1 + lib/no-aesni/mb_mgr_sse_no_aesni.c | 4 +- lib/no-aesni/sm4_sse_no_aesni.asm | 2 + lib/sse_t1/mb_mgr_sse_t1.c | 4 +- lib/sse_t1/sm4_sse.asm | 172 +++++++++++++++++++++++++---- lib/sse_t2/mb_mgr_sse_t2.c | 4 +- lib/sse_t3/mb_mgr_sse_t3.c | 4 +- 20 files changed, 293 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index b858eac3..8ff9980b 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ Table 1. List of supported cipher algorithms and their implementations. | SNOW-V AEAD | N | Y | Y | N | N | N | N | | PON-CRC-BIP | N | Y by8 | Y by8 | N | N | Y | N | | SM4-ECB | N | Y | N | N | N | N | N | +| SM4-CBC | N | Y | N | N | N | N | N | +--------------------------------------------------------------------------------+ ``` Notes: @@ -218,6 +219,7 @@ Table 3. Encryption and integrity algorithm combinations | SNOW3G-UEA3 | | | SNOW-V | | | SM4-ECB | | +| SM4-CBC | | |---------------+-----------------------------------------------------| | AES128-DOCSIS,| DOCSIS-CRC32 | | AES256-DOCSIS | | diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index a2be186f..2fef9bb1 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -8,13 +8,16 @@ Library - QUIC CHACHA20-POLY1305 and CHACHA20 HP API added. - AVX2-VAES AES-CTR implementation added. - SM4-ECB SSE implementation added. +- SM4-CBC SSE implementation added. Test Applications - QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. +- SM4-ECB and SM4-CBC tests added. Performance Applications - New parameter added to benchmark QUIC `--quic-api`. - Burst API is benchmarked by default now. +- SM4-ECB and SM4-CBC support added. v1.4 June 2023 ======================================================================== diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index 206e5149..3151f36d 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -246,7 +246,9 @@ flush_snow3g_uea2_job_avx2_t1(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_avx_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse static void reset_ooo_mgrs(IMB_MGR *state) diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index ee647310..57959ba0 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -249,7 +249,9 @@ flush_snow3g_uea2_job_avx2_t2(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_avx_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse static void reset_ooo_mgrs(IMB_MGR *state) diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index 74cc2af0..32e60d7d 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -250,7 +250,9 @@ flush_snow3g_uea2_job_avx2_t2(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_avx_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse static void reset_ooo_mgrs(IMB_MGR *state) diff --git a/lib/avx512_t1/mb_mgr_avx512_t1.c b/lib/avx512_t1/mb_mgr_avx512_t1.c index a1ad8f05..1010a465 100644 --- a/lib/avx512_t1/mb_mgr_avx512_t1.c +++ b/lib/avx512_t1/mb_mgr_avx512_t1.c @@ -327,7 +327,9 @@ submit_aes_docsis256_dec_crc32_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_JOB *job } /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse #define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC submit_job_aes_docsis128_enc_crc32_avx512 #define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC submit_job_aes_docsis256_enc_crc32_avx512 diff --git a/lib/avx512_t2/mb_mgr_avx512_t2.c b/lib/avx512_t2/mb_mgr_avx512_t2.c index 28700bf7..d1dd02ec 100644 --- a/lib/avx512_t2/mb_mgr_avx512_t2.c +++ b/lib/avx512_t2/mb_mgr_avx512_t2.c @@ -334,7 +334,9 @@ submit_job_docsis256_sec_crc_dec_vaes_avx512(MB_MGR_DOCSIS_AES_OOO *state, IMB_J } /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse #define SUBMIT_JOB_DOCSIS128_SEC_CRC_ENC submit_job_aes_docsis128_enc_crc32_vaes_avx512 #define SUBMIT_JOB_DOCSIS256_SEC_CRC_ENC submit_job_aes_docsis256_enc_crc32_vaes_avx512 diff --git a/lib/avx_t1/mb_mgr_avx_t1.c b/lib/avx_t1/mb_mgr_avx_t1.c index 0f3fb98f..cb67ab03 100644 --- a/lib/avx_t1/mb_mgr_avx_t1.c +++ b/lib/avx_t1/mb_mgr_avx_t1.c @@ -245,7 +245,9 @@ flush_snow3g_uea2_job_avx_t1(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_avx_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse static void reset_ooo_mgrs(IMB_MGR *state) diff --git a/lib/avx_t2/mb_mgr_avx_t2.c b/lib/avx_t2/mb_mgr_avx_t2.c index d79cf46d..0ff6404b 100644 --- a/lib/avx_t2/mb_mgr_avx_t2.c +++ b/lib/avx_t2/mb_mgr_avx_t2.c @@ -250,7 +250,9 @@ flush_snow3g_uea2_job_avx_t2(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_avx_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse static void reset_ooo_mgrs(IMB_MGR *state) diff --git a/lib/include/arch_noaesni.h b/lib/include/arch_noaesni.h index cd09900d..be1b894a 100644 --- a/lib/include/arch_noaesni.h +++ b/lib/include/arch_noaesni.h @@ -234,6 +234,13 @@ ethernet_fcs_sse_no_aesni_local(const void *msg, const uint64_t len, const void void sm4_ecb_sse_no_aesni(const void *in, void *out, const int size, const void *exp_keys); +void +sm4_cbc_enc_sse_no_aesni(const void *in, void *out, const int size, const void *exp_enc_keys, + const void *iv); +void +sm4_cbc_dec_sse_no_aesni(const void *in, void *out, const int size, const void *exp_dec_keys, + const void *iv); + void sm4_set_key_sse_no_aesni(const void *pKey, void *exp_enc_keys, void *exp_dec_keys); IMB_DLL_EXPORT void diff --git a/lib/include/arch_sse_type1.h b/lib/include/arch_sse_type1.h index 679d0b64..73b863c9 100644 --- a/lib/include/arch_sse_type1.h +++ b/lib/include/arch_sse_type1.h @@ -338,6 +338,13 @@ flush_job_snow3g_uia2_sse(MB_MGR_SNOW3G_OOO *state); void sm4_ecb_sse(const void *in, void *out, const int size, const void *exp_keys); +void +sm4_cbc_enc_sse(const void *in, void *out, const int size, const void *exp_enc_keys, + const void *iv); +void +sm4_cbc_dec_sse(const void *in, void *out, const int size, const void *exp_dec_keys, + const void *iv); + void sm4_set_key_sse(const void *pKey, void *exp_enc_keys, void *exp_dec_keys); diff --git a/lib/include/mb_mgr_job_api.h b/lib/include/mb_mgr_job_api.h index 13d7773e..654468a1 100644 --- a/lib/include/mb_mgr_job_api.h +++ b/lib/include/mb_mgr_job_api.h @@ -287,6 +287,24 @@ SUBMIT_JOB_SM4_ECB_DEC(IMB_JOB *job) return job; } +__forceinline IMB_JOB * +SUBMIT_JOB_SM4_CBC_ENC(IMB_JOB *job) +{ + SM4_CBC_ENC(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~15), job->enc_keys, job->iv); + job->status |= IMB_STATUS_COMPLETED_CIPHER; + return job; +} + +__forceinline IMB_JOB * +SUBMIT_JOB_SM4_CBC_DEC(IMB_JOB *job) +{ + SM4_CBC_DEC(job->src + job->cipher_start_src_offset_in_bytes, job->dst, + job->msg_len_to_cipher_in_bytes & (~15), job->dec_keys, job->iv); + job->status |= IMB_STATUS_COMPLETED_CIPHER; + return job; +} + /* ========================================================================= */ /* Custom hash / cipher */ /* ========================================================================= */ @@ -455,6 +473,8 @@ SUBMIT_JOB_CIPHER_ENC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher return submit_snow_v_aead_job(state, job); } else if (IMB_CIPHER_SM4_ECB == cipher_mode) { return SUBMIT_JOB_SM4_ECB_ENC(job); + } else if (IMB_CIPHER_SM4_CBC == cipher_mode) { + return SUBMIT_JOB_SM4_CBC_ENC(job); #endif /* __aarch64__ */ } else { /* assume IMB_CIPHER_NULL */ job->status |= IMB_STATUS_COMPLETED_CIPHER; @@ -640,6 +660,8 @@ SUBMIT_JOB_CIPHER_DEC(IMB_MGR *state, IMB_JOB *job, const IMB_CIPHER_MODE cipher return submit_snow_v_aead_job(state, job); } else if (IMB_CIPHER_SM4_ECB == cipher_mode) { return SUBMIT_JOB_SM4_ECB_DEC(job); + } else if (IMB_CIPHER_SM4_CBC == cipher_mode) { + return SUBMIT_JOB_SM4_CBC_DEC(job); #endif /* __aarch64__ */ } else { /* assume IMB_CIPHER_NULL */ @@ -960,6 +982,13 @@ submit_cipher_dec_sm4_ecb(IMB_MGR *state, IMB_JOB *job) return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); } +/* SM4-CBC */ +static IMB_JOB * +submit_cipher_dec_sm4_cbc(IMB_MGR *state, IMB_JOB *job) +{ + return SUBMIT_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SM4_CBC, IMB_KEY_128_BYTES); +} + /* ========================= */ /* ======== ENCRYPT ======== */ /* ========================= */ @@ -1215,6 +1244,13 @@ submit_cipher_enc_sm4_ecb(IMB_MGR *state, IMB_JOB *job) return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); } +/* SM4-CBC */ +static IMB_JOB * +submit_cipher_enc_sm4_cbc(IMB_MGR *state, IMB_JOB *job) +{ + return SUBMIT_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SM4_CBC, IMB_KEY_128_BYTES); +} + /* * Four entries per algorithm (different key sizes), * algorithms in the same order IMB_CIPHER_MODE @@ -1378,8 +1414,14 @@ static const submit_flush_fn_t tab_submit_cipher[] = { submit_cipher_dec_sm4_ecb, submit_cipher_dec_null, submit_cipher_dec_null, + /* [25] SM4-CBC */ + submit_cipher_dec_null, + submit_cipher_dec_sm4_cbc, + submit_cipher_dec_null, + submit_cipher_dec_null, #else /* __aarch64__ */ - /* [16] - [24] NULL */ + /* [16] - [25] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1393,11 +1435,6 @@ static const submit_flush_fn_t tab_submit_cipher[] = { /* add new cipher decrypt here */ - /* [25] NULL */ - NULL, - NULL, - NULL, - NULL, /* [26] NULL */ NULL, NULL, @@ -1579,8 +1616,14 @@ static const submit_flush_fn_t tab_submit_cipher[] = { submit_cipher_enc_sm4_ecb, submit_cipher_enc_null, submit_cipher_enc_null, + /* [25] SM4-CBC */ + submit_cipher_enc_null, + submit_cipher_enc_sm4_cbc, + submit_cipher_enc_null, + submit_cipher_enc_null, #else /* __aarch64__ */ - /* [16] - [24] NULL */ + /* [16] - [25] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1594,11 +1637,6 @@ static const submit_flush_fn_t tab_submit_cipher[] = { /* add new cipher encrypt here */ - /* [25] NULL */ - NULL, - NULL, - NULL, - NULL, /* [26] NULL */ NULL, NULL, @@ -1905,6 +1943,13 @@ flush_cipher_dec_sm4_ecb(IMB_MGR *state, IMB_JOB *job) return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); } +/* SM4-CBC */ +static IMB_JOB * +flush_cipher_dec_sm4_cbc(IMB_MGR *state, IMB_JOB *job) +{ + return FLUSH_JOB_CIPHER_DEC(state, job, IMB_CIPHER_SM4_CBC, IMB_KEY_128_BYTES); +} + /* ========================= */ /* ======== ENCRYPT ======== */ /* ========================= */ @@ -2174,6 +2219,13 @@ flush_cipher_enc_sm4_ecb(IMB_MGR *state, IMB_JOB *job) return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SM4_ECB, IMB_KEY_128_BYTES); } +/* SM4-CBC */ +static IMB_JOB * +flush_cipher_enc_sm4_cbc(IMB_MGR *state, IMB_JOB *job) +{ + return FLUSH_JOB_CIPHER_ENC(state, job, IMB_CIPHER_SM4_CBC, IMB_KEY_128_BYTES); +} + /* * Four entries per algorithm (different key sizes), * algorithms in the same order IMB_CIPHER_MODE @@ -2333,8 +2385,14 @@ static const submit_flush_fn_t tab_flush_cipher[] = { flush_cipher_dec_sm4_ecb, flush_cipher_dec_null, flush_cipher_dec_null, + /* [25] SM4-CBC */ + flush_cipher_dec_null, + flush_cipher_dec_sm4_cbc, + flush_cipher_dec_null, + flush_cipher_dec_null, #else /* __aarch64__ */ - /* [16] - [24] NULL */ + /* [16] - [25] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -2348,11 +2406,6 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* add new cipher decrypt here */ - /* [25] NULL */ - NULL, - NULL, - NULL, - NULL, /* [26] NULL */ NULL, NULL, @@ -2534,8 +2587,14 @@ static const submit_flush_fn_t tab_flush_cipher[] = { flush_cipher_enc_sm4_ecb, flush_cipher_enc_null, flush_cipher_enc_null, + /* [25] SM4-CBC */ + flush_cipher_enc_null, + flush_cipher_enc_sm4_cbc, + flush_cipher_enc_null, + flush_cipher_enc_null, #else /* __aarch64__ */ - /* [16] - [24] NULL */ + /* [16] - [25] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -2549,11 +2608,6 @@ static const submit_flush_fn_t tab_flush_cipher[] = { /* add new cipher encrypt here */ - /* [25] NULL */ - NULL, - NULL, - NULL, - NULL, /* [26] NULL */ NULL, NULL, diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index d5702ceb..28e90edf 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -829,6 +829,16 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ return 1; } break; + case IMB_CIPHER_SM4_CBC: + if (job->iv_len_in_bytes != UINT64_C(16)) { + imb_set_errno(state, IMB_ERR_JOB_IV_LEN); + return 1; + } + if (job->iv == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_IV); + return 1; + } + /* Fall-through */ case IMB_CIPHER_SM4_ECB: if (job->src == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index d35eddff..cf0718b0 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -287,6 +287,7 @@ typedef enum { IMB_CIPHER_SNOW_V_AEAD, IMB_CIPHER_GCM_SGL, IMB_CIPHER_SM4_ECB, + IMB_CIPHER_SM4_CBC, IMB_CIPHER_NUM } IMB_CIPHER_MODE; diff --git a/lib/no-aesni/mb_mgr_sse_no_aesni.c b/lib/no-aesni/mb_mgr_sse_no_aesni.c index 732f8d27..974fe63f 100644 --- a/lib/no-aesni/mb_mgr_sse_no_aesni.c +++ b/lib/no-aesni/mb_mgr_sse_no_aesni.c @@ -221,7 +221,9 @@ /* ====================================================================== */ /* SM4 */ -#define SM4_ECB sm4_ecb_sse_no_aesni +#define SM4_ECB sm4_ecb_sse_no_aesni +#define SM4_CBC_ENC sm4_cbc_enc_sse_no_aesni +#define SM4_CBC_DEC sm4_cbc_dec_sse_no_aesni static void reset_ooo_mgrs(IMB_MGR *state) diff --git a/lib/no-aesni/sm4_sse_no_aesni.asm b/lib/no-aesni/sm4_sse_no_aesni.asm index bc8e1308..d5567f0f 100644 --- a/lib/no-aesni/sm4_sse_no_aesni.asm +++ b/lib/no-aesni/sm4_sse_no_aesni.asm @@ -28,4 +28,6 @@ %include "include/aesni_emu.inc" %define SM4_SET_KEY sm4_set_key_sse_no_aesni %define SM4_ECB sm4_ecb_sse_no_aesni +%define SM4_CBC_ENC sm4_cbc_enc_sse_no_aesni +%define SM4_CBC_DEC sm4_cbc_dec_sse_no_aesni %include "sse_t1/sm4_sse.asm" diff --git a/lib/sse_t1/mb_mgr_sse_t1.c b/lib/sse_t1/mb_mgr_sse_t1.c index 046578fc..0b4db58e 100644 --- a/lib/sse_t1/mb_mgr_sse_t1.c +++ b/lib/sse_t1/mb_mgr_sse_t1.c @@ -251,7 +251,9 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_sse_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse /* ====================================================================== */ diff --git a/lib/sse_t1/sm4_sse.asm b/lib/sse_t1/sm4_sse.asm index 1f594216..4ae7d455 100644 --- a/lib/sse_t1/sm4_sse.asm +++ b/lib/sse_t1/sm4_sse.asm @@ -33,6 +33,8 @@ %ifndef SM4_SET_KEY %define SM4_SET_KEY sm4_set_key_sse %define SM4_ECB sm4_ecb_sse +%define SM4_CBC_ENC sm4_cbc_enc_sse +%define SM4_CBC_DEC sm4_cbc_dec_sse %endif %ifdef LINUX @@ -40,11 +42,13 @@ %define arg2 rsi %define arg3 rdx %define arg4 rcx +%define arg5 r8 %else %define arg1 rcx %define arg2 rdx %define arg3 r8 %define arg4 r9 +%define arg5 qword [rsp + 40] %endif %define APPEND(a,b) a %+ b @@ -99,11 +103,27 @@ align 16 swap_bytes: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 +align 16 +swap_bytes_3_0: +db 3, 2, 1, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + +align 16 +swap_bytes_7_4: +db 7, 6, 5, 4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + +align 16 +swap_bytes_11_8: +db 11, 10, 9, 8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + +align 16 +swap_bytes_15_12: +db 15, 14, 13, 12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + mksection .text %macro FUNC_SAVE 0 mov r11, rsp - sub rsp, 4*16 + 8 + sub rsp, 6*16 + 8 and rsp, ~15 %ifidn __OUTPUT_FORMAT__, win64 @@ -112,8 +132,10 @@ mksection .text movdqa [rsp + 1*16], xmm7 movdqa [rsp + 2*16], xmm8 movdqa [rsp + 3*16], xmm9 + movdqa [rsp + 4*16], xmm10 + movdqa [rsp + 5*16], xmm11 %endif - mov [rsp + 4*16], r11 ;; rsp pointer + mov [rsp + 6*16], r11 ;; rsp pointer %endmacro %macro FUNC_RESTORE 0 @@ -123,8 +145,10 @@ mksection .text movdqa xmm7, [rsp + 1*16] movdqa xmm8, [rsp + 2*16] movdqa xmm9, [rsp + 3*16] + movdqa xmm10, [rsp + 4*16] + movdqa xmm11, [rsp + 5*16] %endif - mov rsp, [rsp + 4*16] + mov rsp, [rsp + 6*16] %endmacro %macro AFFINE 4 @@ -219,8 +243,8 @@ mksection .text ;; Encrypts/decrypts a single 128-bit block with SM4 ;; %macro SM4_ENC_DEC 14 -%define %%IN %1 ; [in] Pointer to 128-bit input block -%define %%OUT %2 ; [out] Pointer to 128-bit output block +%define %%IN %1 ; [in] 128-bit input block (XMM) +%define %%OUT %2 ; [out] 128-bit output block (XMM) %define %%KEYS %3 ; [in] Pointer to expanded enc/dec keys %define %%XTMP1 %4 ; [clobbered] Temporary XMM register %define %%XTMP2 %5 ; [clobbered] Temporary XMM register @@ -234,14 +258,11 @@ mksection .text %define %%XTMP %13 ; [clobbered] Temporary XMM register %define %%IDX %14 ; [clobbered] Temporary GP register - movd %%XTMP1, [%%IN + 4*0] + movdqa %%XTMP1, %%IN pshufb %%XTMP1, [rel swap_bytes] - movd %%XTMP2, [%%IN + 4*1] - pshufb %%XTMP2, [rel swap_bytes] - movd %%XTMP3, [%%IN + 4*2] - pshufb %%XTMP3, [rel swap_bytes] - movd %%XTMP4, [%%IN + 4*3] - pshufb %%XTMP4, [rel swap_bytes] + pshufd %%XTMP2, %%XTMP1, 0x55 + pshufd %%XTMP3, %%XTMP1, 0xAA + pshufd %%XTMP4, %%XTMP1, 0xFF xor %%IDX, %%IDX %%start_loop: @@ -293,14 +314,11 @@ mksection .text jmp %%start_loop %%end_loop: + punpckldq %%XTMP4, %%XTMP3 + punpckldq %%XTMP2, %%XTMP1 + punpcklqdq %%XTMP4, %%XTMP2 pshufb %%XTMP4, [rel swap_bytes] - movd [%%OUT + 4*0], %%XTMP4 - pshufb %%XTMP3, [rel swap_bytes] - movd [%%OUT + 4*1], %%XTMP3 - pshufb %%XTMP2, [rel swap_bytes] - movd [%%OUT + 4*2], %%XTMP2 - pshufb %%XTMP1, [rel swap_bytes] - movd [%%OUT + 4*3], %%XTMP1 + movdqa %%OUT, %%XTMP4 %assign %%i 0 %endmacro @@ -439,8 +457,8 @@ error_set_key_sse: ;;void sm4_ecb_sse(const void *in, void *out, uint64_t len, ;; const uint32_t *exp_keys) ;; -; arg 1: IN: pointer to input (cipher text) -; arg 2: OUT: pointer to output (plain text) +; arg 1: IN: pointer to input +; arg 2: OUT: pointer to output ; arg 3: LEN: length in bytes (multiple of 16) ; arg 4: KEYS: pointer to keys ; @@ -461,7 +479,9 @@ ecb_loop: or SIZE, SIZE jz end_ecb_loop - SM4_ENC_DEC IN, OUT, KEY_EXP, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, r10 + movdqu xmm10, [IN] + SM4_ENC_DEC xmm10, xmm11, KEY_EXP, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, r10 + movdqu [OUT], xmm11 dec SIZE add IN, 16 @@ -478,6 +498,114 @@ end_ecb_loop: ret +;; +;;void sm4_cbc_enc_sse(const void *in, void *out, uint64_t len, +;; const uint32_t *exp_enc_keys) +;; +; arg 1: IN: pointer to input (plaintext) +; arg 2: OUT: pointer to output (ciphertext) +; arg 3: LEN: length in bytes (multiple of 16) +; arg 4: KEYS: pointer to expanded encryption keys +; arg 5: IV: pointer to IV +; +MKGLOBAL(SM4_CBC_ENC,function,internal) +SM4_CBC_ENC: + +%define IN arg1 +%define OUT arg2 +%define SIZE arg3 +%define KEY_EXP arg4 + +%define IV r10 + + mov IV, arg5 + + FUNC_SAVE + + shr SIZE, 4 ; Number of blocks + + ; Read 16-byte IV + movdqu xmm11, [IV] + +align 16 +cbc_enc_loop: + or SIZE, SIZE + jz end_cbc_enc_loop + + movdqu xmm10, [IN] + pxor xmm10, xmm11 ; Plaintext[n] XOR CT[n-1] ; CT[-1] = IV + SM4_ENC_DEC xmm10, xmm11, KEY_EXP, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, r10 + movdqu [OUT], xmm11 + + dec SIZE + add IN, 16 + add OUT, 16 + + jmp cbc_enc_loop + +end_cbc_enc_loop: + +%ifdef SAFE_DATA + clear_all_xmms_sse_asm +%endif + FUNC_RESTORE + + ret + +;; +;;void sm4_cbc_dec_sse(const void *in, void *out, uint64_t len, +;; const uint32_t *exp_dec_keys) +;; +; arg 1: IN: pointer to input (ciphertext) +; arg 2: OUT: pointer to output (plaintext) +; arg 3: LEN: length in bytes (multiple of 16) +; arg 4: KEYS: pointer to expanded decryption keys +; arg 5: IV: pointer to IV +; +MKGLOBAL(SM4_CBC_DEC,function,internal) +SM4_CBC_DEC: + +%define IN arg1 +%define OUT arg2 +%define SIZE arg3 +%define KEY_EXP arg4 + +%define IV r10 + + mov IV, arg5 + + FUNC_SAVE + + shr SIZE, 4 ; Number of blocks + + ; Read 16-byte IV + movdqu xmm12, [IV] + +align 16 +cbc_dec_loop: + or SIZE, SIZE + jz end_cbc_dec_loop + + movdqu xmm10, [IN] + SM4_ENC_DEC xmm10, xmm11, KEY_EXP, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, r10 + pxor xmm11, xmm12 ; Plainttext[n] XOR CT[n-1] ; CT[-1] = IV + movdqu xmm12, xmm10 + movdqu [OUT], xmm11 + + dec SIZE + add IN, 16 + add OUT, 16 + + jmp cbc_dec_loop + +end_cbc_dec_loop: + +%ifdef SAFE_DATA + clear_all_xmms_sse_asm +%endif + FUNC_RESTORE + + ret ;---------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------- diff --git a/lib/sse_t2/mb_mgr_sse_t2.c b/lib/sse_t2/mb_mgr_sse_t2.c index 29e24175..6b4fcdac 100644 --- a/lib/sse_t2/mb_mgr_sse_t2.c +++ b/lib/sse_t2/mb_mgr_sse_t2.c @@ -253,7 +253,9 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_sse_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse /* ====================================================================== */ diff --git a/lib/sse_t3/mb_mgr_sse_t3.c b/lib/sse_t3/mb_mgr_sse_t3.c index 1e4970e2..2fc41355 100644 --- a/lib/sse_t3/mb_mgr_sse_t3.c +++ b/lib/sse_t3/mb_mgr_sse_t3.c @@ -254,7 +254,9 @@ flush_snow3g_uea2_job_sse(IMB_MGR *state) #define ETHERNET_FCS ethernet_fcs_sse_local /* SM4 */ -#define SM4_ECB sm4_ecb_sse +#define SM4_ECB sm4_ecb_sse +#define SM4_CBC_ENC sm4_cbc_enc_sse +#define SM4_CBC_DEC sm4_cbc_dec_sse /* ====================================================================== */ -- GitLab From 1685a373189bcd012f00f73d4f7e7b2fafdb9fa6 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 15 Sep 2023 12:55:31 +0100 Subject: [PATCH 085/204] perf: add SM4-CBC --- perf/ipsec_perf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 96c132ea..8c8fff6d 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -157,6 +157,7 @@ enum test_cipher_mode_e { TEST_SNOW_V, TEST_SNOW_V_AEAD, TEST_SM4_ECB, + TEST_SM4_CBC, TEST_NUM_CIPHER_TESTS }; @@ -323,6 +324,8 @@ const struct str_value_mapping cipher_algo_str_map[] = { { .name = "snow-v", .values.job_params = { .cipher_mode = TEST_SNOW_V, .key_size = 32 } }, { .name = "sm4-ecb", .values.job_params = { .cipher_mode = TEST_SM4_ECB, .key_size = IMB_KEY_128_BYTES } }, + { .name = "sm4-cbc", + .values.job_params = { .cipher_mode = TEST_SM4_CBC, .key_size = IMB_KEY_128_BYTES } }, { .name = "null", .values.job_params = { .cipher_mode = TEST_NULL_CIPHER, .key_size = 0 } } #endif /* __aarch64__ */ }; @@ -1320,6 +1323,9 @@ translate_cipher_mode(const enum test_cipher_mode_e test_mode) case TEST_SM4_ECB: c_mode = IMB_CIPHER_SM4_ECB; break; + case TEST_SM4_CBC: + c_mode = IMB_CIPHER_SM4_CBC; + break; default: break; } @@ -2959,7 +2965,8 @@ print_times(struct variant_s *variant_list, struct params_s *params, const uint3 "CHACHA20_AEAD", "SNOW_V", "SNOW_V_AEAD", - "SM4_ECB" }; + "SM4_ECB", + "SM4_CBC" }; const char *c_dir_names[2] = { "ENCRYPT", "DECRYPT" }; const char *h_alg_names[TEST_NUM_HASH_TESTS - 1] = { "SHA1_HMAC", "SHA_224_HMAC", -- GitLab From a9939c447d2a524ea12facfc1c054dcca7c06896 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 15 Sep 2023 12:56:08 +0100 Subject: [PATCH 086/204] test: [KAT] add SM4-CBC tests --- test/kat-app/CMakeLists.txt | 2 + test/kat-app/Makefile | 2 +- test/kat-app/api_test.c | 4 + test/kat-app/main.c | 5 +- test/kat-app/sm4_cbc_test.c | 266 +++++++++++++++++++++++++++++++ test/kat-app/sm4_cbc_test.json.c | 40 +++++ test/kat-app/win_x64.mak | 2 +- 7 files changed, 318 insertions(+), 3 deletions(-) create mode 100644 test/kat-app/sm4_cbc_test.c create mode 100644 test/kat-app/sm4_cbc_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 4bea0414..1302aecc 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -116,6 +116,8 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f9_vectors.json.c ${CMAKE_CURRENT_SOURCE_DIR}/sm4_ecb_test.c ${CMAKE_CURRENT_SOURCE_DIR}/sm4_ecb_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/sm4_cbc_test.c + ${CMAKE_CURRENT_SOURCE_DIR}/sm4_cbc_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 9058a66c..d503bb4b 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -44,7 +44,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ - sm4_ecb_test.c sm4_ecb_test.json.c + sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index ae57f431..576ddee0 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -275,6 +275,7 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, switch (job->cipher_mode) { #ifndef __aarch64__ + case IMB_CIPHER_SM4_CBC: case IMB_CIPHER_CBC: case IMB_CIPHER_CBCS_1_9: job->key_len_in_bytes = UINT64_C(16); @@ -1791,6 +1792,7 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) &chacha_ctx, &gcm_ctx); switch (cipher) { case IMB_CIPHER_GCM: + case IMB_CIPHER_SM4_CBC: case IMB_CIPHER_CBC: case IMB_CIPHER_CBCS_1_9: case IMB_CIPHER_DES: @@ -2003,6 +2005,8 @@ test_job_invalid_cipher_args(struct IMB_MGR *mb_mgr) } invalid_iv_lens[] = { #ifndef __aarch64__ /* IVs must be 16 bytes */ + { IMB_CIPHER_SM4_CBC, 15 }, + { IMB_CIPHER_SM4_CBC, 17 }, { IMB_CIPHER_CBC, 15 }, { IMB_CIPHER_CBC, 17 }, { IMB_CIPHER_CBCS_1_9, 15 }, diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 4671edef..7675972f 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -105,6 +105,8 @@ extern int ctr_test(struct IMB_MGR *mb_mgr); extern int sm4_ecb_test(struct IMB_MGR *mb_mgr); +extern int +sm4_cbc_test(struct IMB_MGR *mb_mgr); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); @@ -172,7 +174,8 @@ struct imb_test tests[] = { #ifndef __aarch64__ { .str = "QUIC-ECB", .fn = quic_ecb_test, .enabled = 1 }, { .str = "QUIC-CHACHA20", .fn = quic_chacha20_test, .enabled = 1 }, - { .str = "SM4-ECB", .fn = sm4_ecb_test, .enabled = 1 } + { .str = "SM4-ECB", .fn = sm4_ecb_test, .enabled = 1 }, + { .str = "SM4-CBC", .fn = sm4_cbc_test, .enabled = 1 } #endif /* __aarch64__ */ }; diff --git a/test/kat-app/sm4_cbc_test.c b/test/kat-app/sm4_cbc_test.c new file mode 100644 index 00000000..82f8411c --- /dev/null +++ b/test/kat-app/sm4_cbc_test.c @@ -0,0 +1,266 @@ +/***************************************************************************** + Copyright (c) 2018-2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include +#include +#include +#include +#include + +#include + +#include "utils.h" +#include "cipher_test.h" + +#define MAX_BURST_JOBS 64 + +int +sm4_cbc_test(struct IMB_MGR *mb_mgr); + +extern const struct cipher_test sm4_cbc_test_json[]; + +static int +sm4_job_ok(const struct IMB_JOB *job, IMB_MGR *mgr, const uint8_t *out_text, const uint8_t *target, + const uint8_t *padding, const size_t sizeof_padding, const unsigned text_len) +{ + const int num = (const int) ((uint64_t) job->user_data2); + + if (job->status != IMB_STATUS_COMPLETED) { + printf("%d error status:%d, job %d", __LINE__, job->status, num); + imb_get_strerror(imb_get_errno(mgr)); + return 0; + } + if (memcmp(out_text, target + sizeof_padding, text_len)) { + printf("%d mismatched\n", num); + hexdump(stderr, "Expected", out_text, text_len); + hexdump(stderr, "Received", target + sizeof_padding, text_len); + return 0; + } + if (memcmp(padding, target, sizeof_padding)) { + printf("%d overwrite head\n", num); + return 0; + } + if (memcmp(padding, target + sizeof_padding + text_len, sizeof_padding)) { + printf("%d overwrite tail\n", num); + return 0; + } + return 1; +} + +static int +test_sm4_cbc_many(struct IMB_MGR *mb_mgr, uint32_t *exp_enc_keys, uint32_t *exp_dec_keys, + const void *iv, const uint8_t *in_text, const uint8_t *out_text, + const unsigned text_len, const int dir, const int order, + const IMB_CIPHER_MODE cipher, const int in_place, const int num_jobs) +{ + struct IMB_JOB *job; + uint8_t padding[16]; + uint8_t **targets = malloc(num_jobs * sizeof(void *)); + int i, err, jobs_rx = 0, ret = -1; + + if (targets == NULL) + goto end_alloc; + + memset(targets, 0, num_jobs * sizeof(void *)); + memset(padding, -1, sizeof(padding)); + + for (i = 0; i < num_jobs; i++) { + targets[i] = malloc(text_len + (sizeof(padding) * 2)); + if (targets[i] == NULL) + goto end_alloc; + memset(targets[i], -1, text_len + (sizeof(padding) * 2)); + if (in_place) { + /* copy input text to the allocated buffer */ + memcpy(targets[i] + sizeof(padding), in_text, text_len); + } + } + + /* flush the scheduler */ + while (IMB_FLUSH_JOB(mb_mgr) != NULL) + ; + + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(mb_mgr); + job->cipher_direction = dir; + job->chain_order = order; + if (!in_place) { + job->dst = targets[i] + sizeof(padding); + job->src = in_text; + } else { + job->dst = targets[i] + sizeof(padding); + job->src = targets[i] + sizeof(padding); + } + job->cipher_mode = cipher; + job->enc_keys = exp_enc_keys; + job->dec_keys = exp_dec_keys; + job->key_len_in_bytes = 16; + + job->iv = iv; + job->iv_len_in_bytes = 16; + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = text_len; + job->user_data = targets[i]; + job->user_data2 = (void *) ((uint64_t) i); + + job->hash_alg = IMB_AUTH_NULL; + + job = IMB_SUBMIT_JOB(mb_mgr); + if (job == NULL) { + /* no job returned - check for error */ + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + } else { + /* got job back */ + jobs_rx++; + if (!sm4_job_ok(job, mb_mgr, out_text, job->user_data, padding, + sizeof(padding), text_len)) + goto end; + } + } + + while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + + jobs_rx++; + if (!sm4_job_ok(job, mb_mgr, out_text, job->user_data, padding, sizeof(padding), + text_len)) + goto end; + } + + if (jobs_rx != num_jobs) { + printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); + goto end; + } + ret = 0; + +end: + while (IMB_FLUSH_JOB(mb_mgr) != NULL) { + err = imb_get_errno(mb_mgr); + if (err != 0) { + printf("Error: %s!\n", imb_get_strerror(err)); + goto end; + } + } + +end_alloc: + if (targets != NULL) { + for (i = 0; i < num_jobs; i++) + free(targets[i]); + free(targets); + } + + return ret; +} + +static void +test_sm4_cbc_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, + const IMB_CIPHER_MODE cipher, const int num_jobs) +{ + const struct cipher_test *v = sm4_cbc_test_json; + DECLARE_ALIGNED(uint32_t exp_enc_keys[IMB_SM4_KEY_SCHEDULE], 16); + DECLARE_ALIGNED(uint32_t exp_dec_keys[IMB_SM4_KEY_SCHEDULE], 16); + + if (!quiet_mode) + printf("SM4-CBC Test (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { + if (!quiet_mode) { +#ifdef DEBUG + printf("SM4-CBC Test Case %zu\n", v->tcId); +#else + printf("."); +#endif + } + + IMB_SM4_KEYEXP(mb_mgr, v->key, exp_enc_keys, exp_dec_keys); + + if (test_sm4_cbc_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 0, num_jobs)) { + printf("error #%zu encrypt\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_sm4_cbc_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 0, num_jobs)) { + printf("error #%zu decrypt\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_sm4_cbc_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->msg, (const void *) v->ct, + (unsigned) v->msgSize / 8, IMB_DIR_ENCRYPT, + IMB_ORDER_CIPHER_HASH, cipher, 1, num_jobs)) { + printf("error #%zu encrypt in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + + if (test_sm4_cbc_many(mb_mgr, exp_enc_keys, exp_dec_keys, v->iv, + (const void *) v->ct, (const void *) v->msg, + (unsigned) v->msgSize / 8, IMB_DIR_DECRYPT, + IMB_ORDER_HASH_CIPHER, cipher, 1, num_jobs)) { + printf("error #%zu decrypt in-place\n", v->tcId); + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + } + + if (!quiet_mode) + printf("\n"); +} + +int +sm4_cbc_test(struct IMB_MGR *mb_mgr) +{ + const int num_jobs_tab[] = { 1, 3, 4, 5, 7, 8, 9, 15, 16, 17, MAX_BURST_JOBS }; + unsigned i; + int errors = 0; + struct test_suite_context ctx; + + test_suite_start(&ctx, "SM4-CBC-128"); + for (i = 0; i < DIM(num_jobs_tab); i++) + test_sm4_cbc_vectors(mb_mgr, &ctx, IMB_CIPHER_SM4_CBC, num_jobs_tab[i]); + errors += test_suite_end(&ctx); + + return errors; +} diff --git a/test/kat-app/sm4_cbc_test.json.c b/test/kat-app/sm4_cbc_test.json.c new file mode 100644 index 00000000..68f5fd31 --- /dev/null +++ b/test/kat-app/sm4_cbc_test.json.c @@ -0,0 +1,40 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* SM4-CBC */ +#include "cipher_test.h" +const struct cipher_test sm4_cbc_test_json[] = { + /* Vectors from https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 */ + { 128, 128, 1, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", + "\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD" + "\xEE\xEE\xEE\xEE\xFF\xFF\xFF\xFF\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB", + "\x78\xEB\xB1\x1C\xC4\x0B\x0A\x48\x31\x2A\xAE\xB2\x04\x02\x44\xCB" + "\x4C\xB7\x01\x69\x51\x90\x92\x26\x97\x9B\x0D\x15\xDC\x6A\x8F\x6D", + 1, 256 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 22259e60..4246a324 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From 54f7f10918f08b4d23f4481c9e4e1ed091ba0180 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 19 Sep 2023 10:20:36 +0100 Subject: [PATCH 087/204] test: [XVALID] add SM4-CBC --- test/xvalid-app/ipsec_xvalid.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 2912d123..4badec9f 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -232,6 +232,8 @@ struct str_value_mapping cipher_algo_str_map[] = { .values.job_params = { .cipher_mode = IMB_CIPHER_SNOW_V, .key_size = 32 } }, { .name = "SM4-ECB", .values.job_params = { .cipher_mode = IMB_CIPHER_SM4_ECB, .key_size = 16 } }, + { .name = "SM4-CBC", + .values.job_params = { .cipher_mode = IMB_CIPHER_SM4_CBC, .key_size = 16 } }, #endif /* __aarch64__ */ { .name = "NULL-CIPHER", .values.job_params = { .cipher_mode = IMB_CIPHER_NULL, .key_size = 0 } } @@ -583,6 +585,7 @@ const uint8_t key_sizes[][3] = { { 32, 32, 1 }, /* IMB_CIPHER_SNOW_V_AEAD */ { 16, 32, 8 }, /* IMB_CIPHER_GCM_SGL */ { 16, 16, 1 }, /* IMB_CIPHER_SM4_ECB */ + { 16, 16, 1 }, /* IMB_CIPHER_SM4_CBC */ }; uint8_t custom_test = 0; @@ -1023,13 +1026,15 @@ fill_job(IMB_JOB *job, const struct params_s *params, uint8_t *buf, uint8_t *dig switch (job->cipher_mode) { #ifndef __aarch64__ + case IMB_CIPHER_CBCS_1_9: + job->cipher_fields.CBCS.next_iv = next_iv; + /* Fall-through */ + case IMB_CIPHER_SM4_CBC: case IMB_CIPHER_CBC: case IMB_CIPHER_DOCSIS_SEC_BPI: - case IMB_CIPHER_CBCS_1_9: job->enc_keys = enc_keys; job->dec_keys = dec_keys; job->iv_len_in_bytes = 16; - job->cipher_fields.CBCS.next_iv = next_iv; break; case IMB_CIPHER_PON_AES_CNTR: case IMB_CIPHER_CNTR: @@ -1234,6 +1239,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph break; case IMB_CIPHER_PON_AES_CNTR: case IMB_CIPHER_CBC: + case IMB_CIPHER_SM4_CBC: case IMB_CIPHER_CCM: case IMB_CIPHER_CNTR: case IMB_CIPHER_CNTR_BITLEN: @@ -1416,6 +1422,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph } break; case IMB_CIPHER_SM4_ECB: + case IMB_CIPHER_SM4_CBC: IMB_SM4_KEYEXP(mb_mgr, ciph_key, enc_keys, dec_keys); break; case IMB_CIPHER_DES: @@ -1702,7 +1709,8 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const random_num &= (~(IMB_DES_BLOCK_SIZE - 1)); } - if (params->cipher_mode == IMB_CIPHER_SM4_ECB) { + if (params->cipher_mode == IMB_CIPHER_SM4_ECB || + params->cipher_mode == IMB_CIPHER_SM4_CBC) { random_num += (IMB_SM4_BLOCK_SIZE - 1); random_num &= (~(IMB_SM4_BLOCK_SIZE - 1)); } @@ -2172,7 +2180,8 @@ test_single(IMB_MGR *enc_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mgr, const I if ((buf_size % IMB_AES_BLOCK_SIZE) != 0) continue; - if (params->cipher_mode == IMB_CIPHER_SM4_ECB) + if (params->cipher_mode == IMB_CIPHER_SM4_ECB || + params->cipher_mode == IMB_CIPHER_SM4_CBC) if ((buf_size % IMB_SM4_BLOCK_SIZE) != 0) continue; -- GitLab From a0b7cee7700ad18a347515cf17ccc0ff7134413c Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 22 Sep 2023 14:06:06 +0100 Subject: [PATCH 088/204] test: [KAT] add new SM4-CBC/ECB test vectors --- test/kat-app/sm4_cbc_test.json.c | 905 ++++++++++++++++++++++++++++- test/kat-app/sm4_ecb_test.json.c | 960 ++++++++++++++++++++++++++++++- 2 files changed, 1861 insertions(+), 4 deletions(-) diff --git a/test/kat-app/sm4_cbc_test.json.c b/test/kat-app/sm4_cbc_test.json.c index 68f5fd31..37750386 100644 --- a/test/kat-app/sm4_cbc_test.json.c +++ b/test/kat-app/sm4_cbc_test.json.c @@ -28,8 +28,909 @@ /* SM4-CBC */ #include "cipher_test.h" const struct cipher_test sm4_cbc_test_json[] = { - /* Vectors from https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 */ - { 128, 128, 1, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", + /* Generated vectors by 3rd party library */ + { 128, 128, 1, "\xca\xa9\x35\x88\x36\x94\xf6\x7b\x8a\x58\x4d\xed\x0a\xa0\x42\xa3", + "\x4f\xae\xca\xe5\x31\xaf\xc0\xed\x41\xf4\xaf\xe4\xb4\x3a\x68\xcd", + "\xf1\x7b\xe7\x3b\x74\x08\x40\x66\xd1\x5f\x0f\x9e\xd6\xcf\x29\xd3\x25\xc1\xe9\xce\x6e\x61" + "\xe7\xf4\x7c\xcf\x2c\xe7\x22\x04\xb5\x07\x83\x5a\xf3\x3e\xb1\x07\xa2\x71\x31\x4a\x65\x8c" + "\x76\xbd\x53\xff\x7f\xbd\x03\x08\x25\x7f\x7e\x16\x0f\xd2\x41\x06\x07\x52\x06\xf3\xff\x36" + "\x37\x68\x2e\x59\x33\xfd\xe3\x94\xea\x81\x82\x30\x16\x4b\xea\x28\xeb\x3d\x1f\x52\x3c\x62" + "\x96\xcf\xee\x91\x4c\x54\x28\xda\xdd\x6a\xa9\xad\x88\x84\xce\xd3\x68\x2d\xd8\x4e\x3f\x89" + "\x42\x20\xe2\x3d\x37\x4d\x51\x71\xc0\xf1\x11\xaa\xd7\xe3\xdd\x03\xfa\x65\x3e\xfa\x38\xe6" + "\x6c\x2a\xf4\x2c\xb0\xca\x71\x5a\x54\xc5\xb5\xfc", + "\xdd\x92\xae\xbb\x1b\x31\x0f\x8f\x6e\xd3\xd7\xe7\x79\xa3\xc0\x0a\x92\xf6\xe0\xa6\x8d\x84" + "\x00\xac\xbc\xa8\x92\xa4\x49\xc4\x90\x68\x1b\x3c\x9a\x2c\xbf\x16\x54\x3b\x34\xbc\x6c\xec" + "\xb6\x4a\xfd\x01\x48\x2c\xf3\x35\xfc\x62\x8d\x5d\x7c\xa3\x37\xa9\xfb\x3d\x0c\x10\x25\x8f" + "\x07\xa3\x47\x10\x72\xdf\x4f\x16\x73\xaa\x29\xee\x03\x7e\x17\xee\xc4\x0e\x99\x4c\xec\x1a" + "\x68\x0d\x8d\x66\x15\x5a\x0a\x23\x86\x57\xb5\x1a\x50\xb4\x56\xf4\xbc\xff\x9a\xe6\xa3\x61" + "\x89\xbb\x36\x4d\x7d\x3b\xde\x14\x86\x53\x8c\xce\xb7\x57\x29\xd9\x19\x9f\xe2\x9b\xd2\xd1" + "\x75\xb9\xa4\x8f\x2b\xe6\xa3\x86\x1b\xd8\x72\x97\xd0\x48\x9a\xe2\x64\x14\xd7\x52\xd8\x45" + "\x10\x75\x06\x2b\x6d\xf7", + 1, 1152 }, + { 128, 128, 2, "\xad\xbf\x8a\x12\x67\x86\xa5\x61\xb9\x03\xef\xa4\xfe\x8d\x97\xe4", + "\x1c\x6a\x0c\xa0\x5d\x5d\xdc\xf1\x37\xf0\xca\xbe\xc2\x91\xe7\x14", + "\xcc\x03\x2f\xf4\xfb\x25\x0e\x5d\xe9\xec\x00\x14\x57\x99\xb0\xc6\x05\xa0\xfa\x01\x8f\xcf" + "\x82\xd8\xf0\x1e\x3a\xcd\x3b\xfd\x25\x71\xb4\x02\xa9\x5b\x17\xc4\x8b\x7a\x40\x2d\xc0\x4b" + "\x26\xe4\x45\x47\x72\x08\x5f\x20\x7e\x8d\x02\x7a\xd5\x66\x06\x8f\xa7\xbc\x11\xb8\x59\x57" + "\x39\x9a\xd4\xbd\xe5\xbb\xf4\xf1\xcc\x58\x6e\x3d\xce\x73\x73\xe9\x30\xf1\x83\x26\x7e\xeb" + "\x8a\x16\xa5\xb6\x40\xa7\x92\xa1\x9b\x29\x15\x3b\x1b\xfc\x29\x6e\xc4\xc5\xa7\x1c\xef\xba" + "\x2f\x10\x59\x2e\xd7\x19\x0e\xdf\xe5\xe0\x17\xfc\x7c\x0d\x61\x7c\x34\xc3\x91\x76\xf2\x0f" + "\x64\xdd\x83\x7e\xb7\x4a\x98\x0a\x5e\xe0\xba\x48\xd4\xc7\x91\x86\xad\x94\x73\x37\x14\x2e" + "\x60\x24\x28\xcf\xfd\x5b\x96\x89\x6f\xae\x4b\x9f\x16\x8a\x61\xa2\xef\x71\x7f\xee\xde\x61" + "\xe2\xe4\x9a\x24\x4f\xe6\x1b\xcd\x3e\xbc\xd8\xba\xe4\x00\xa5\x08\x87\xc8\x7b\xa1\xc2\xf9" + "\x58\x44\x19\x87\xd3\x43\xd9\x1a\x2f\xba\x3f\x2b\x3a\x8b\x4d\x61\x84\xe1\x36\xfe\x9e\x35" + "\x79\x86\x37\x4a\x61\xea\x12\x4b\xa8\x0c\xc4\xf8\xd7\x20\xd6\x71\xc0\x5f\x13\x30\x2c\x6c" + "\xac\xc4\xf1\x0c\x69\x23\xc2\x32\xfa\x82\xe1\x49\xda\x2e\x2c\x9a\xc4\x87\x4c\xdc\x45\x42" + "\x0f\xc7\x27\xb8\x5a\x32\x09\x70\xe5\x46\x62\xa0\x34\xce\x5b\x8d\x57\x57\xd0\x1b\x8b\x96" + "\xd7\x38\x25\x44\x51\xd6\x88\x10\x28\x5f\x76\xb3\xad\x45\x27\xce\x35\x78\x51\x8a\x38\x94" + "\x21\xa4\xb3\x67\x3e\x4a\xac\x5b\x89\xec\x2a\x83\x2e\x7e\x93\x2b\x56\xb4\x0b\xce\xc6\x4d" + "\x6a\xde\x76\xc6\xca\xe0\x57\x5e\x2c\xd0\xc3\xa6\x1f\xff\xe6\x36\x44\x6a\xc5\xc0\x87\xeb" + "\x1a\xe5\x0d\xc4\x54\x60\x36\x14\xfa\x6b\xb3\x29\xaf\x6a\xe9\x8a\x50\x2d\x8f\x9b\x6b\xdd" + "\x26\xa5\xa1\x7c\xab\xa6\x27\xf1\xcd\xf2\x83\xad\xa1\xf5\x55\x56\xdc\x72\x2b\x85\x74\x6a" + "\xd0\x2b\x6c\x79\x4a\x93\x97\x39\xfc\xa1\x65\x96\x3f\xa7\x24\x18\x2e\xc1\xaf\xae\xe1\xb9" + "\x70\x48\xa8\xbe\xf3\x0b\x73\x1e\xfb\x64\x9a\x28\x58\x55\x2c\xe2\x99\x4c\x33\x3d\x3e\x06" + "\x69\x9f\x76\x42\x1f\x48\x99\x9f", + "\x7d\xf7\x9a\x19\x6d\xe7\x73\x88\x03\x23\x2f\x99\xbb\x89\xf7\x99\x56\x24\x4d\x74\x1c\xa9" + "\xf1\x8a\xc4\x7f\x2e\x2a\x67\x00\x4e\x03\x0e\xff\x92\xb7\xae\x78\x4f\x5e\x95\x3d\x17\x58" + "\xef\xe4\x43\xa5\xe2\xd1\xb8\x09\x75\x21\x89\x08\x8c\x3c\xfa\xbd\x60\x95\x0c\x10\xae\xc4" + "\x92\x1a\x41\x77\x05\x2d\x98\xeb\x88\xb7\x07\xa8\xc2\x82\x2c\x8e\x59\x2f\x4f\xb8\x42\xa0" + "\x0f\x63\x78\x66\xa5\xee\x57\x4c\xb6\xbc\xf2\x82\xce\xdb\x4f\x26\x72\x32\xc4\xa6\xb3\x0a" + "\x57\xed\xd8\xf3\x09\x6d\x02\x55\xdf\x05\xaf\xf4\xd6\x09\x9d\xc2\xa4\xa4\x46\x16\xea\xf9" + "\x2b\x25\x5b\x5f\x5e\x70\x46\x86\x3f\x20\x6f\x7c\xa6\x8b\xf5\x7d\xcd\xb3\x14\x6f\x01\x94" + "\x05\x4b\xce\x03\x8f\xcb\x1c\xa7\xb3\x20\xbe\x10\x9e\xf7\x85\xc8\xad\x9b\xca\xbc\x3e\xdb" + "\x65\x7f\x4b\xb1\x20\x81\x58\x63\x64\x93\xbe\x68\x3c\xbe\x50\x47\xbc\x22\xbd\xa3\x1c\x11" + "\x8c\x59\x19\x53\x11\x3c\x58\x8e\xd7\xc1\x75\xa1\xca\xcc\x95\xec\x51\x2a\xeb\x85\x87\x59" + "\xf5\xbd\x5a\x11\xb1\xff\x18\x84\x91\x90\x0c\x07\x4e\xac\x9a\x8b\xd0\xf4\xa6\x84\xff\x09" + "\x9f\x11\x94\x63\xba\xcb\x30\xf9\x9b\x66\xbd\xa3\x03\x17\x29\x88\x96\x35\x54\xe3\xe5\x64" + "\x23\x73\xa5\x5a\xcb\x2d\x1e\xb0\x4b\x17\xf8\xe1\x4f\xe2\x50\xc9\x1f\x4a\x6f\x5a\xde\xf5" + "\x21\x1e\x8f\xd3\x5a\x63\xb0\x0b\x4c\x8d\x21\xe5\x8c\x93\xce\xe4\x8d\x62\x1a\x64\xa3\x70" + "\x02\x80\x26\x7d\x0b\xa0\xc0\x48\x1d\x5e\x98\x0b\x11\x64\x98\x99\xb9\xed\xc0\x7b\xf5\xc3" + "\x35\x79\x36\xb8\x04\x3a\x37\xb4\x33\xa7\x62\xbf\x72\xf7\x69\x9e\x31\x2c\x40\xb3\x5d\x9d" + "\xf9\x2d\x98\xa3\x70\xb7\xc7\x83\x04\x61\x9d\x6a\xd4\xdd\x25\xa2\xe9\x06\xa5\xa7\x4a\x16" + "\x30\x0c\x3b\x0e\x87\xda\xd0\x68\x1f\x3d\x08\x58\x3b\x2d\x58\x7c\x11\x53\xcf\x69\xcb\xce" + "\xb9\x10\x2a\xed\xad\x99\x46\x11\xb0\x7a\x8e\x3f\x88\x3e\xc0\xf4\x96\x5c\x17\x26\x0c\xdf" + "\x5a\x71\xd1\x07\x07\x06\x3b\x9b\xc2\xd4\x1a\xe3\x04\x1b\x38\xef\x91\xe5\x2d\x3c\xeb\xc5" + "\x0b\xea\xfb\x39\x7d\xae\x6a\x26\x10\x99\x00\xfd\xa4\x15\x38\x32\xb5\x22\x0c\x4d\x33\x15" + "\xc5\x0e", + 1, 3584 }, + { 128, 128, 3, "\x3f\xb0\x1d\x37\x23\x35\x05\xc7\xdb\xd5\xff\x66\xac\xd4\x0f\x8b", + "\x5c\x18\x23\x68\xab\x42\xfd\x27\xee\x08\x42\xae\x63\x92\x42\x27", + "\x97\xbb\x5b\x7d\x64\x31\x91\xfc\xaa\xb1\x12\x21\xc7\x43\x80\x95\xfb\x73\x21\xab\xfc\x1c" + "\x16\x6a\x88\x32\xbb\xef\x16\x30\x81\xf7\x4b\x06\x74\xa8\xba\x9c\xac\x2e\x13\x62\x49\x33" + "\x2f\xa4\xae\x63\x8f\xf8\x0e\xd5\x9a\xc9\x87\xbb\x30\x63\xad\x07\x4a\x1f\x44\x2a\x4f\x69" + "\x29\x9b\x98\x84\x17\x2a\x9a\x6f\x4d\x7c\x6b\x5e\x35\x76\x32\xdd\x97\x86\x65\xf6\xf4\x70" + "\x5c\xc4\xb4\xc9\xf2\xb3\x78\xe2\x1c\x46\xd6\xda\x0f\x33\x1a\x6a\xec\xdf\xda\xc3\xa6\x34" + "\xce\xad\x93\xe5\x7b\x81\xcc\x57\xcb\xab\xd6\x59\xa1\xbe\x95\x0c\xf1\x94\xb1\xdf\x03\x24" + "\x26\x42\xe3\xfc\x4f\xec\x4f\x6f\x8d\xf6\xbe\xe8\xc1\x8a\xb9\x0e\xfb\xa4\xae\xa9\x12\x40" + "\x25\x5e\xab\x5c\x5b\x1a\xe5\x09\x40\x9e\x39\x67\x9b\xb7\xc1\x79\x21\x88\x6a\x55\x29\xf4" + "\x68\x3d\x78\x61\x40\x52\xb7\x38\xf0\x66\x0b\xcf\x85\xf7\x3e\x48\xee\x7d\x7f\x47\xbf\x53" + "\xc8\xd4\x49\xfe\xd7\x19\x15\x07\x31\x2c\x2b\xa7\xda\x0d\xc2\x2a\x5f\x1b\xbd\x06\xdd\xd9" + "\xf3\x6e\x6e\xc3\x53\xbb\xa3\x04\x99\x22\x49\x92\x15\x37\x42\x3e\x20\xc2\xf7\xd3\x7f\x09" + "\x45\xc4\xce\xab\x69\xc1\x6e\xbe\xc9\x2d\xa7\xaa\x1f\xc5\xbf\xa4\xa9\xc1\x17\xd5\xf0\xe6" + "\x88\x41\xd0\x12\xa3\xe6\xe1\x8c\x10\xd3\x5d\xaa\x43\x86\xac\xea\xc8\x92\x0d\xf7\x8a\x42" + "\xaa\xdb\x88\xa8\x4b\xe7\x5d\x27\x46\x5d\xc0\x18\xe3\xc9\x85\x55\xea\xa6\x52\xd1\xab\xda" + "\xf2\xf4\x98\x44\x41\xcb\xaf\x68\xa7\xa6\x10\x5f\xa4\xd8\x8c\xf6\xd3\x2d\x58\x2a\xa9\xce" + "\x34\x42\xde\x8e\x77\x3f", + "\xd0\xc4\x47\x15\x70\x82\x3e\x5c\xa9\x42\x2b\x7e\x86\x8e\x84\xd5\x4c\xc0\x3d\xd0\x34\xd3" + "\x27\x6d\x21\xee\xe5\xbe\xb6\x55\x84\x8d\xb4\x8e\x21\xe4\xec\xf9\xdd\xad\xbb\xa8\x3a\x0d" + "\x7c\x45\x22\xfd\xd6\x16\x60\x38\x4e\x61\x31\x1c\xa7\xa4\xe4\xf8\x64\x24\xf5\x43\xcc\x0f" + "\x72\xb8\xe4\x7a\xa5\x2a\x26\xc0\x14\xa3\xe7\x8b\xb6\x90\x44\xbf\xab\xd8\x8c\x82\xf4\x14" + "\xd8\xc6\xde\xba\xd8\x7d\x39\xd6\x97\xf1\x66\x06\x1b\xfd\x9c\x6b\x3a\xaa\x79\x3b\x07\xed" + "\xe5\x4c\x14\x91\xf7\xe6\xff\x35\xc6\x97\x93\x9a\x35\xd0\xb8\x76\x67\x76\xd0\xda\x88\xe8" + "\xc3\x39\x7e\xe9\x6b\x9d\x34\xcb\x11\x70\x6d\x8f\x2a\xfe\xbd\xdd\xa1\xf6\x76\x7b\x65\x42" + "\xd5\xc9\x7a\x66\xe8\x76\x99\xdd\x9d\xaa\x68\xb2\x48\x38\x88\x22\xa4\xaa\x16\x55\x7e\xb0" + "\xe2\xbf\x7a\x01\xc9\x39\xfb\x8c\xb5\x55\x6f\x4a\x54\x7c\x82\xbd\x4e\xef\xb4\x04\x96\xf2" + "\xc7\x28\x0d\x75\xff\xba\xcb\xb8\xd0\x23\x31\x39\xbe\x77\x02\x1e\x46\xcd\xe6\xaf\x36\x8b" + "\x16\xee\xc2\x89\x9b\xe8\xfc\x8b\x5f\x04\x01\x6f\xc8\x4f\x72\xf9\x6a\xf9\xf8\xb8\xe2\x03" + "\xa1\x0b\x3a\xe5\x00\x34\x2c\x0d\x85\x0e\x89\xb5\xb1\xa2\xa1\xe9\x5b\x26\xe2\xcc\xb7\x24" + "\x0c\xa6\xcd\x2f\xd8\xb2\x0e\xfc\xb2\xeb\xf0\x18\x13\x2b\x74\x6a\x5d\x8c\x71\x69\x09\x22" + "\xdc\x73\x95\x3e\xf8\xb0\xa4\xef\xeb\x7a\x37\xc0\x25\x98\xcf\xa7\x92\x2d\xc1\xf8\xb9\x6b" + "\x4f\xb2\x44\xa4\xf3\x1a\x24\xfa\xad\x28\x50\x79\x6f\x54\xbe\x14\x00\x3a\x77\x82\x90\x7e" + "\xd6\xcc\x5b\xcd\xac\xde\x42\xea\x45\x1f\x49\xe2\xf7\x2f\xaa\x69\x32\x8b\x08\x51\x43" + "\x11", + 1, 2688 }, + { 128, 128, 4, "\x47\xf7\x0d\x29\xea\x26\x0b\xb2\x26\x87\x7e\xf8\xbc\x9c\x75\x2a", + "\x7a\x84\xaa\xb9\x18\xb0\xb9\x47\xa4\x46\x43\x56\x9b\xfd\xe1\x52", + "\x0f\x19\x17\x79\xda\xcd\x7a\xeb\xd0\x44\xef\xc0\x45\xc6\x07\xe7\x01\x31\x0a\xde\x61\x6f" + "\x7b\x56\x06\x6d\x08\x95\xed\xc9\xcc\xb9\x0c\xa9\x11\x97\x46\x04\x0d\xee\xe7\xc0\x74\x07" + "\xa2\x8c\x45\x06\x40\xec\x58\xd7\xd1\x19\xc4\x11\xa6\xb9\xe1\xe1\xdc\x0a\xbf\xfe\x08\x89" + "\xb5\x7c\x5c\xca\x75\x85\x57\x77\x33\x81\x09\x32\x78\xca\xdd\x46\x95\x63\xe8\x85\x83\x35" + "\x68\xb8\x8c\xd5\x17\x56\xe7\xfc\xe1\x3e\x2a\x4a\x44\x9a\x2c\x4b\xe2\xe8\x97\x46\xee\x6a" + "\xa3\x4d\x3d\x08\xb4\x71\x44\xb7\x0a\x22\x2f\x6f\x6e\x87\x2a\x37\x52\xbf", + "\x79\x4e\x3f\xcc\x49\x2c\x3a\xd0\xae\x9c\xab\x4d\x15\x7d\x00\x33\xf9\xdd\x3a\xff\x67\x37" + "\xab\x78\x90\xf1\x30\xfc\x87\x14\xd2\x21\x33\x8d\x43\xba\xb8\x33\xd0\x2f\x50\x37\xd4\x53" + "\x6a\xf4\x52\x79\x58\xba\x13\x61\xbc\xcc\x40\x40\x41\x38\xe3\xfc\x1e\xc1\xa8\xca\x74\x4c" + "\x40\x7c\x8a\x76\x80\x22\x7d\x6d\xb0\xa1\x17\x35\xbf\x58\x40\xed\x0f\x50\x23\x5c\x68\x69" + "\xd6\x86\xae\x82\xc7\x23\xfc\xf4\xcc\x4b\xa0\x76\x55\x46\x5c\xba\xd0\x21\xcb\x24\x96\xe8" + "\x98\x18\x16\x22\x3e\xcd\x67\xa8\x9b\x5b\xe3\x7c\xca\x6d\x2f\x8d\xb3\x24\x2f\x10\x10\x96" + "\x19\x6c\x83\x02\x37\x43\xae\x77\x93\xbd\x56\x87", + 1, 1024 }, + { 128, 128, 5, "\x91\x86\xe6\x0e\x44\x18\x41\x86\x7d\x0a\xba\x03\xe7\x28\xc3\x9b", + "\x05\x28\x94\x0d\x83\xd9\xe2\x78\xf1\x79\x1f\x20\x53\x29\x06\xa0", + "\xbe\x44\xe8\xb9\x6a\xf2\x97\x5d\xb4\xe8\x20\x4c\x1a\x49\x0f\xb6\xb4\xcf\x31\x7b\x56\xbb" + "\x53\xb6\xf4\x01\x2d\x02\xa2\x75\x7f\x1c\x51\x25\x27\xbb\xe5\x86\xe4\x0f\x3c\x63\x62\x21" + "\x31\x68\x25\xca\xca\xa7\xc7\xaa\x7c\x34\xf9\xce\xb8\x95\xd5\x73\x04\x18\x40\x21\xdc\x79" + "\x66\x64\x27\x9c\xc0\x34\x84\x3b\x74\xc0\xc8\x4c\x25\xaf\x0f\xa5\x57\x73\x48\xc6\x02\xb8" + "\x33\x4f\xd9\x0d\x23\x4e\x7b\x91\x03\x3a\x5c\x34\x56\x51\xa2\xf1\x2c\x6e\x9b\x9f\x23\xf4" + "\x1d\x55\x26\xee\x9d\xc6\xd0\xf4\x2b\xd5\x75\x45\x28\x17\x43\x17\x00\xf4\xa6\x05\xd4\x91" + "\x76\xe9\xc7\x1b\x50\xea\x2c\xd6\x1d\xfd\x14\xa9\x70\x0b\xe9\xff\x7c\xad\x73\xb6\x62\x4a" + "\xd2\x87\xcd\xb3\x6d\x98\xa2\x48\x85\x67\x98\xa9\xdd\x2e\xd9\x9d\x88\x3d\xee\xe9\x42\xcb" + "\x17\x9d\xf1\x5e\x5e\x78\xaa\x33\x42\x2c\xdf\xe2\xa4\xba\xb9\x13\x44\x8d\xa9\x69\x03\x7f" + "\x97\x67\x43\x30\x2c\x2f\x75\x46\x40\x3e\xfc\x5f\xab\xb1\x3c\x7d\x51\xdb\xd6\x3c\x29\x84" + "\x99\xe3\xf1\x64\xdb\x3c\x80\x08\x50\xa7\x2c\x1e\xb5\x6c\x17\x20\x59\xf1\x46\xb7\xfe\xb7" + "\x61\x65\x85\xd2\xc9\x68\x50\x7a\x91\xe6\x13\x77\x5c\x0d\x63\xd1\x07\x9d\x6e\x1e\xa7\x86" + "\x2d\x34\x04\xa7\xe8\x08\x76\xd1\x3e\x99\x67\xa9\x21\xd0\xea\xa2\xdb\xf1\x58\xd9\x12\x06" + "\xb1\x77\x66\x9c\xf5\xa1\x24\xea\xae\xed\x6d\x80\x79\x0c\xaf\xbe\x9a\xe5\x11\xb9\x8f\xec" + "\x5d\x0e\x0b\x83\xb3\x32\x41\x99\x24\xa8\x7a\x26\x24\x5c\x0d\x23\xa5\xc5\x83\x1d\xc3\xda" + "\x2b\x8e\x79\x6c\xd9\xfc", + "\xb7\xa8\x93\xcd\x94\xa3\xa7\xbf\x57\xad\xa8\x20\xfd\x41\x9b\x1a\x08\x3c\x09\xce\xc9\x55" + "\x03\x4f\x9f\xa8\xce\xf0\xb9\x49\x38\x84\x29\x4e\xda\xb7\x9a\x89\x12\x2d\xfe\x72\x60\x4b" + "\xc0\xb8\xd0\x37\x38\x3b\x77\xe6\xb3\xad\xe8\x6b\x15\x68\xa4\x03\xfe\x5e\x95\xea\xe2\x5a" + "\xd0\xe9\x38\x22\x77\x1c\xa7\x47\xed\x3e\xfd\x6f\xe6\x81\xf3\xd9\xef\x1e\x04\x64\x8e\x1e" + "\xfe\xe6\x15\xb2\xe4\x3d\x7b\x57\x0a\x0c\x22\xac\x11\x0f\x31\x35\x93\x9e\xbc\x91\x8e\x72" + "\x13\x29\x58\xc2\x05\x0e\x2c\x0d\x83\x53\xf9\x53\x2a\x65\x9a\x0a\x03\xf0\xae\x44\xab\x21" + "\x09\xaf\xac\xeb\x38\xeb\x48\x94\x24\x62\x89\xb2\x04\xd0\xc8\x40\xb6\x83\x93\x31\x49\x12" + "\xed\x17\x38\xd6\x6f\x6f\xe6\xec\x14\x76\xfb\x97\x48\xc2\x8d\x98\x0b\xd2\x73\x1b\xa3\xc1" + "\x07\x1b\x87\xba\x96\x0b\xd5\x54\x66\x59\xda\xeb\xae\x9d\xba\xfe\x15\xfa\x70\x21\x4a\x11" + "\xac\x93\x21\x67\x5e\xda\x3a\xe3\x8a\x86\xc5\xc7\x87\xe0\x2a\xb9\x19\xab\xd1\x76\x2c\xee" + "\x2e\x4e\x13\x16\x5f\x76\x7b\x74\x6a\xdb\xc6\x8c\x3e\x68\xe9\x71\x60\x05\x19\x98\xc9\xfa" + "\x34\xb8\xf5\xfe\x10\x02\x6c\xc1\x9a\xf4\xd7\x2b\xf0\x55\x27\xa1\x6a\x17\x2f\xcc\x75\xda" + "\xb1\xd8\xae\x20\x21\x2b\x4a\xe8\xe7\xd3\x68\x4d\x45\x3c\xe7\xa0\xa0\x08\x69\x56\x20\x54" + "\x8a\x68\x33\xb9\x95\xbb\x48\x58\xe6\xe6\x39\x2c\x49\xf0\xee\x70\xef\x03\xb4\x66\x87\xe0" + "\x07\x80\xa1\x70\xd5\xee\xf0\x6c\xd9\x55\x2f\xce\xef\x11\x92\x7a\xd9\xe2\xe6\x3c\x91\x93" + "\xfe\x7b\x55\xc5\x56\xf7\x00\x12\xc6\xb5\xab\x8e\xf5\x80\xc7\x79\xad\x65\xe0\x1f\xfd" + "\xa1", + 1, 2688 }, + { 128, 128, 6, "\xb5\x0f\x19\x37\x04\xd9\x31\x23\x00\xc2\x4d\x18\xcf\x11\x34\xb0", + "\x1d\x1e\xd8\x7c\x66\xb0\x27\x47\x30\x5c\x54\xc2\xc9\x41\x69\x75", + "\xe7\x13\x76\x61\x90\xe4\x7f\xdf\x42\x72\xe1\x7d\xe3\x0a\xfd\xb4\x87\x6c\x2f\x13\x80\x62" + "\x32\xfb\xd0\x61\xfe\x3e\x1c\x7f\x5b\x2a\x43\x9a\x63\xbc\x33\xca\x7d\xc0\xfa\x2b\x17\x79" + "\x13\xf3\x1f\x10\xec\x42\x52\x8f\xe2\x17\x5d\xd1\x99\xdb\x9c\xbf\x85\x58\x59\x01\x2d\xf1" + "\x10\x22\xbf\xd0\xa4\x05\x92\xb9\x0d\x08\x3b\xbd\x5e\xe1\xf0\x67\xd8\xef\xa5\xab\x1c\x9b" + "\x9a\xfc\x6b\x2f\xee\x89\x2e\x42\x27\x17\x9c\x2a\xd0\x19\xba\x45\x82\x6b\x16\xa9\x29\xcf" + "\xcb\xf9\x51\x21\xab\x47\x00\xa7\xa4\xe1\xe7\xe4\xc6\xde\x3a\x48\xe9\x64\x0f\xb9\x40\xbd" + "\xb9\x30\x9c\x27\x5f\x59\x18\x1b\x72\xf3\x6e\xac\x5a\x57\x24\xab\x97\x4d\x72\x59\x24\x79" + "\x8a\x33\xb3\xbe\xb3\x46\x6a\x0c\x11\x04\x9e\x56\x05\x7e\x1f\xe3\xc8\xc3\x70\x80\xd5\xf9" + "\xdc\x32\x70\xa0\x4e\x43\xa5\x65\xd8\xb8\xb2\xd0\x45\x35\xd8\xfe\xfa\x6a\x4e\x90\xb3\x5e" + "\x25\xe4\x26\xcc\xad\x7f\xd1\xa3\x7e\xa8\xa7\x07\x7a\x48\x06\xfd\x44\x16\xf4\x64\x8f\xbb" + "\xc3\x7e\xbd\x8a\xb7\x00\x63\x5b\xcb\xd5\x23\x31\x76\x92\x77\x17\x7a\xdc\x5a\x32\xf5\xb2" + "\x96\x5b\x9e\x50\xa2\x04\x3c\x13\x17\xde\xa4\xc3\x68\x4f\xfd\x9a\x59\x92\x26\x27\xc8\x57" + "\x44\x80\xa0\x05\x42\xca\x79\x17\xde\x8c\x2f\x06\x43\x4b\x70\xb9\x62\x3c\x17\xae\x77\x1a" + "\x67\x6a\x78\xb6\xc3\xd2\x78\x0d\x6a\x0a\x64\xfc\xb6\xc7\xc7\x0c\xb8\x4d\xae\x07\xd7\xe5" + "\x77\xcd\xb9\x5a\x32\x57\x27\x21\x1c\x2c\x0e\x54\xb3\x09\x4e\xc2\x7a\x15\x15\xf0\xf6\xfe" + "\x69\xed\x71\x26\xad\xbd", + "\xca\xf9\x7a\xf4\xa9\xb1\xa8\x3e\xff\x89\x06\x2d\x26\x90\x53\x65\xb4\x6f\x96\x17\xae\xfb" + "\x25\xc6\x33\x0b\xce\x78\x23\x81\xfd\x27\x7d\x2b\xa2\xa2\x9a\x7c\x11\xef\xa8\xf8\x49\x81" + "\xf4\x6c\xc6\xaf\x34\xa2\xaf\x80\xa3\x36\x63\x15\x27\x12\xf9\x84\x5d\xe2\x55\xcf\xf0\x6b" + "\x8b\xec\xaa\x2e\xfd\x51\x65\x9c\x8b\xc6\xcf\xa5\xa4\x7d\xf0\x04\xcf\xc1\x43\x38\xf9\x5b" + "\xc9\xbc\xd6\x5b\xe9\x1c\x24\xbe\xac\x0c\x9f\xe7\x76\x8e\xc0\x1a\x21\x60\xf4\xd7\x00\xa9" + "\x40\x58\x5d\x41\xcd\x58\xc1\x76\xdc\x4c\x0f\x20\x1a\xfa\xcb\x1a\xfc\x7a\x16\x44\xc2\x37" + "\x29\xce\x0a\x2c\x26\xfc\x9f\x11\x62\x8d\xed\x54\x7b\x88\xf6\xdd\xe5\xb1\x90\x95\x43\x96" + "\x2f\xba\xeb\xb8\x25\x3e\xe5\xb7\x3d\x84\x33\x13\xd7\xab\x73\x36\xae\x25\xbd\x20\xe0\x21" + "\x05\x91\x52\xa9\xcc\xc9\xa0\x33\xfe\xdb\xa9\x6d\xe7\xcb\x2a\x44\x71\x4e\x67\xb0\x17\x62" + "\x2d\x4c\x7e\x10\x69\xcf\xe4\x51\x14\x54\x68\x9a\x97\xdd\x75\x55\xf0\x5c\x94\xfc\xe7\x76" + "\x28\xdc\x89\x06\x79\x2d\xc5\x92\xb2\xb8\x47\x96\x1a\xbd\xff\xd9\xe2\x2f\x71\x45\xbf\x3f" + "\x53\x2a\xa8\xb6\x9e\x70\xd5\x6a\x88\xe7\x44\x97\xc0\xdd\xa8\xc6\x8c\x9c\x44\xfb\xbd\xfc" + "\xe5\xa8\xbc\xa9\x2e\xb1\x43\x86\x91\xcf\xd3\x1c\x17\x32\xa8\x8b\x0d\x14\x78\xbc\x49\xa1" + "\xdc\xf5\xb2\xf6\xae\x96\xba\x43\x5a\x8a\x35\xeb\x62\x0c\xc7\x08\x40\xd9\xe9\xc2\xfc\x6c" + "\x7a\x68\x04\xe9\xd3\xce\x67\x84\x05\xb1\xf6\x0b\xfb\x95\x64\xcd\xf4\x3d\x44\x06\xdf\x4b" + "\xf0\x3f\xf6\x75\x23\xbd\x0c\x65\x30\x43\x4a\x42\xc2\x91\xa2\xc9\x1e\x66\x63\xa4\xeb" + "\xf0", + 1, 2688 }, + { 128, 128, 7, "\xb9\x23\xa6\xc3\x88\xd4\xc4\xa2\x9d\x17\x8a\x66\x3d\x06\xf4\xea", + "\x7e\xc6\x12\x36\x38\xb2\x95\xaa\x77\x2c\xf3\xe4\x4b\xb8\x0c\x3a", + "\xbb\x43\xda\x16\xbb\xac\x08\xcf\xf2\xa0\xdb\x50\x31\xdf\xd0\x5e\xc7\x24\xa2\x86\x6e\xd8" + "\xac\x2a\x74\xe5\x74\x38\x3e\x50\xad\x44\x7a\x06\xac\xad\x8f\xc7\xbd\x45\xee\x0c\x50\xa8" + "\x1f\x11\xd9\xec\x7c\x5b\x00\xd3\x3d\xa7\x64\x0e\xc9\x76\x6f\x12\xa1\x74\x75\x44\xa6\x9d" + "\xd2\x64\x50\x51\x1d\x1d\xde\xe8\x88\x41\x36\x0b\xf8\x56\x9e\x29\x81\x71\x40\xf1\x61\x06" + "\x72\xcf\xdc\xe4\x91\xdc\xb9\xf2\xf1\xe9\xe2\xf0\xa2\xd1\xc6\x89\xb5\xf6\xe4\xe3\xba\x4c" + "\x50\xbf\x06\x97\x24\xa9\xdd\xdf\x5a\x60\x0b\x31\x51\x5d\x4f\x33\x8c\x0e", + "\x2e\xf9\x5a\x46\xcd\xe5\xc4\x8e\xa4\xd6\x4a\x49\x1a\x1e\xee\xc1\x02\xad\xcb\xc6\x59\x8a" + "\x5c\xae\x5f\xe7\xbe\xbe\x63\x84\x37\xd1\x0f\x4e\xdd\x63\xf9\x5f\x26\xdb\x07\x3e\x25\xe0" + "\xed\xab\xfc\x6f\xbf\x0a\x08\x8b\xeb\x41\x53\xb8\xb8\x7c\xa3\x42\x84\x43\x95\xcc\x5b\x70" + "\x26\x14\x71\x82\x31\x35\x1d\x16\x43\x86\x75\x34\x13\x77\x25\x0f\xfa\x91\x51\x02\x9f\x9f" + "\xf1\x3c\xde\xc7\x92\x51\x3b\x2a\xd7\xe4\xa2\x38\xc2\x70\x68\x33\x71\x58\x68\x40\x98\x30" + "\xb4\xe4\x5e\x3f\x65\xd3\x52\x75\xc0\x24\xa6\x94\x77\xd5\x8c\x05\xda\x35\xed\x01\xee\xd3" + "\x18\xea\x60\xb4\x3a\x7b\x3b\x35\x06\x40\x68\x5d", + 1, 1024 }, + { 128, 128, 8, "\x37\xa4\xcb\xdc\xca\xc4\x12\x8e\x67\x37\x39\x38\x10\x1f\xe9\xa8", + "\xb9\x6e\xf0\xb4\x4e\x8a\x46\x52\x62\x76\xcf\x57\xba\x07\xff\xff", + "\xe6\x73\x12\x8a\xac\xdb\x6f\x5c\x8d\x37\xbd\x84\x7e\x08\xd7\x88\x91\xeb\x34\x58\x76\x1e" + "\x39\x16\xa9\x8e\xe4\x26\x27\x01\xf8\x43\x7a\x82\x64\xac\x78\x16\x7c\x09\xd5\xb2\x18\x8b" + "\x18\x7b\x15\x1e\xce\x5c\x04\xce\x0a\xd6\xa9\x23\xf5\xef\xc7\x99\x8e\x95\xcd\xb7\xc5\xc6" + "\xbf\x11\x9a\x63\x18\x6a\xe6\x62\x64\xc6\x6b\x83\xd8\x9b\xf0\x6b\x7e\xa5\xe8\xcc\x0f\x45" + "\x62\x09\x27\x57\xbd\xdb\x95\x9c\xdd\x19\x21\x3a\xc2\x6c\xfd\x11\x47\x18\x95\x84\xa1\xb8" + "\xf6\x26\x30\x1c\x67\x4e\x5a\xeb\xdf\x7a\x1c\xce\x62\xe8\x64\xb9\xe4\x5f\x50\x5a\x9f\x69" + "\x9a\x63\xcd\x2e\xcb\x8a\x04\x55\xf9\xb8\x62\xb6\xc8\x38\x8a\x66\x2c\xe4\xd3\x04\xb6\xae" + "\x05\x90\x05\x32\xdf\x57\xec\xc0\x67\xd6\x43\xf7\x6b\x74\xc2\x8f\xb3\xc0\x28\x44\xa1\x17" + "\x71\x80\xb4\xbc\xb6\x75\xa8\xe4\x9c\x99\x82\x7a\x93\xb0\x10\x53\xa3\x90\xea\xe5\x98\xf7" + "\x4d\x38\x1e\x99\xd6\x1e\xd1\x7b\x50\x23\xc1\x69\xae\xb1\x24\xf3\x2b\xb9\x73\x0b\x97\x25" + "\xc6\x7d\x94\x56\x4f\xb5\x58\x56\xd1\x51\xc3\x87\xb3\x1c\x20\x47\xcc\x1f\x82\x11\xa0\x2e" + "\xfd\xdb\x6e\x7e\x66\x1c\x4b\xd1\x9e\xf5\x2d\x8b\x11\x47", + "\x43\xce\x0a\x61\xc9\xe1\x05\x6e\x1e\x28\xfc\x6a\xf0\x11\xe9\xb2\xbe\x82\x61\x68\x85\x1c" + "\x30\x5b\x0c\xa6\x31\xd8\x24\x23\xf7\xd2\xbe\x3e\xc7\xea\xe9\x80\xb0\xaf\x5a\x61\x39\x31" + "\xe9\xde\xbc\x8b\xc6\xa0\x9d\xed\xf2\x43\xd5\x86\xb0\x7d\x20\xef\x9d\xd0\xaa\x79\x16\x1e" + "\x55\x81\xb7\xd1\xc7\xc1\x24\x70\x16\x92\x35\x61\xd8\x22\xb1\xc0\x53\x74\x90\xcf\xe3\xab" + "\xc1\x82\x80\x89\x28\x80\x41\x46\x6c\x0e\x3c\x33\x5c\x5a\xb5\xbb\xdf\x3a\xc9\x28\x36\x1b" + "\x56\x47\x2e\x16\x8d\x7d\x1d\x1a\x37\x1e\x5a\x15\xda\x0a\x7d\x4f\xa3\x1b\xdd\xe9\x33\x83" + "\xad\xc7\xdc\x4c\x52\x4d\xa6\xb8\x71\x75\xd4\xc6\xc3\x5a\x97\x41\x3b\x59\x15\xff\xa4\x1f" + "\xa6\x24\x02\x39\xad\x43\xee\x04\xe5\xb9\x5f\x01\x8c\xe9\x88\xb1\xc7\xe3\xbf\x73\x19\xfe" + "\x2d\xc6\xf7\x82\x7d\x34\x9d\xbe\xde\xaa\x64\xdc\x39\x91\x37\x1b\x4e\x3a\xb3\x8e\xd5\x2a" + "\xdd\xae\xf3\x57\xd0\xe4\xeb\x7c\x0c\xc3\xcf\x83\xe4\x01\xc8\xfd\x55\x27\xc9\x23\xaf\x2e" + "\xd9\xbc\xfa\x03\x57\xc9\xe9\x78\xf9\x59\xfc\xb5\xde\x71\xf8\x54\xbd\xdf\x93\xe4\x61\xdf" + "\x49\x19\xf9\x08\xc7\xd6\x31\x1a\xcb\xc0\x5f\x22\x12\xff\xd4\x87\x7c\x1a\x55\x5d\xa4\x6c" + "\x57\xf6\xa1\xb8\x60\x4e\x06\xe3", + 1, 2048 }, + { 128, 128, 9, "\xa4\x5e\x0c\x69\x32\xad\x62\x55\x62\x14\x74\x87\x16\xdd\x34\x93", + "\x92\x72\x45\xb7\xe1\x4a\x40\xd3\xf3\xf5\x17\x5d\xd3\xc3\x9a\x63", + "\x6f\x10\x2c\x7c\x75\x35\x16\x87\xdb\x0b\x41\xb1\xbc\xb2\x71\xd2\xef\x8a\x56\x70\x38\x93" + "\xe5\x79\xb9\x63\x2a\x09\xc3\x35\xe9\xf4\x8d\xb2\x32\xda\x37\x36\x50\x82\x1b\xef\x29\xc5" + "\xf4\x71\xac\xfb\x7f\x8b\x65\x6d\xf0\xae\x1c\x83\xd0\x88\x72\x90\xc4\xb5\x60\x94\xf7\xcc" + "\xd3\x8f\x23\x08\xe5\x25\x60\x5b\xd6\xab\xcc\x1a\x7d\x17\xa8\x46\x82\x26\x1c\x30\x13\x60" + "\xfc\xa6\xca\x8b\x53\x26\x09\xb9\xb1\x0a\x3e\x4c\xb3\x27\x7c\x18\x58\x37\xc2\xd3\x77\x67" + "\xed\xec\xe9\xd7\x40\xb0\x1a\x93\xb6\x7e\x31\xc7\xa4\x86\x63\x3a\xa3\x28\xb1\xc1\xb2\xb1" + "\x3e\xe0\x7d\xfc\x14\x2d\xed\xc2\x47\xd3\xaf\xa7\xa8\x0f\x56\xca\xc3\x8b\x4e\x8d\x2b\xa1" + "\x65\x71\xf9\x1e\xb3\xc5\x53\xd7\x91\x83\x9b\x0d\xf2\x2e\x83\x0e\xa6\x31\xb4\x63\x67\x34" + "\x23\x3b\xac\x9f\x3d\x2a\xd6\x38\x52\x9a\xfc\x38\x18\x0f\x62\x4d\xe8\x4b\xb8\x7e\x45\x5f" + "\x28\xfe\x44\xc4\x16\xf9\x1f\x03\x06\x67\xc9\x2b\x3d\x98\xd5\xff\xe6\xdb\x8b\x70\x0f\xaa" + "\x02\x20\xe9\x83\xeb\x3a\x42\x8e\xc3\x90\x79\xb0\x07\xa3\xf6\x5e\xb9\xa9\xe3\x81\x3c\x4c" + "\xc9\xec\xac\x10\x3f\xcb\x35\x46\x98\xf7\xab\xd0\x13\xbf\x75\x6b\x41\x90\xaa\x4c\xa0\x99" + "\x06\x25\x5a\x31\x2a\x5a\xc3\x09\x08\x35\x2d\x80\x8d\xbd\x89\xe8\x7a\x10\x28\xe9\x47\x2d" + "\xf7\xe5\x98\x5f\x73\x9b\xd9\x23\x41\xec\xb1\x28\xe5\x67\x81\xc1\x53\xc7\xbe\xa7\xfa\xb9" + "\x0b\xf0\x6e\x73\xf5\x09\x3e\xe3\x90\xa5\x3a\x1c\xe8\x08\x28\x56\xb8\xbe\xe1\x38\xb1\x68" + "\x09\xae\x25\x11\x28\x03\x0e\x7c\x38\xbd\x80\x8d\x0b\x7e\x46\x5e\x00\xa0\x70\x50\xac" + "\x7c", + "\x35\xa9\xb1\x0a\x7f\xd1\x4e\x29\xba\x2d\xf2\x58\x16\xf5\x53\xc8\xc1\x83\x99\x10\xbf\x00" + "\x81\xd0\x95\x86\xa1\x58\xe5\x81\x33\x9a\xa3\x1f\xf7\x36\xc5\x41\xe7\xd2\xd7\x58\x15\xdd" + "\x0d\xe5\x75\xa3\x51\x1c\xfe\xdf\x63\xf3\x10\x96\xad\x95\x79\x04\xf2\x88\xce\xf9\x0a\x34" + "\x1b\x5a\x2f\x85\xed\x5c\x16\x9c\x19\xa1\x8b\xfc\xd9\x7e\x5c\x4c\xf3\x74\xed\x4a\x6b\x5d" + "\xe8\x5c\x98\x8f\xd1\xf6\xef\xae\xd3\x21\x9b\x77\xd6\xb8\x52\x5f\x54\x56\xb2\xf8\x3a\xbc" + "\x64\xc0\x13\x4c\x5a\xbb\x73\x01\x20\xad\xaf\x5f\x4b\x27\x0a\x38\x07\xc2\x2c\x2f\xf4\xcd" + "\x41\xb4\x5e\x9f\x05\xa8\xf6\xaf\x2f\xf3\xd9\x0e\x24\xc7\x66\x11\xfa\xea\x54\xe4\xec\xec" + "\xd6\x8f\x08\x3f\xa6\xc7\x9c\xa6\xc4\xeb\x14\x10\x12\x56\x9b\x5d\x73\xef\xf9\xc2\x1b\x1d" + "\x74\x3a\x48\xe3\xc8\x5f\x59\x12\x63\x28\x56\xde\xc0\xf8\xdb\xe0\x87\x13\x10\xea\x4d\x31" + "\xc8\x08\x4b\x3a\x58\x5c\x0a\x1a\xab\x7c\x36\x10\x12\x66\xea\x53\x87\xfc\xb8\x8e\x51\x0d" + "\xc7\x85\x0a\x11\x4e\x0c\xee\x4b\x1d\xac\xca\xbc\xe7\xb0\x00\x20\xad\x14\xdf\xb9\xe7\x5c" + "\x77\x9e\xad\x35\x09\xea\x7e\xa1\x19\x8b\xb0\x98\xa8\xaf\x7d\x8e\xed\x34\xae\xa9\x40\x68" + "\x1a\x37\x66\x1e\xfc\x87\x60\xf4\xe0\xca\x5e\x49\x50\x1e\x6d\xeb\x10\x70\xae\x80\x63\x12" + "\x12\xc4\x6b\x38\x6b\x37\x2c\x47\x12\x45\xe7\x7f\x6d\xbf\xb7\xa2\xfa\xa6\x03\x5d\x87\xc0" + "\xea\xf4\x84\xcd\xe3\xbb\xf6\x0a\x65\x5f\x1d\x07\x80\xbc\xf8\xd7\x56\x9e\xc5\x4f\x44\x4f" + "\xee\x69\xdc\xc3\x9c\x00\x30\x7f\x78\xa8\x12\xac\xad\x1d\x77\xf9\xde\xd9\x05\xd7\x6d\x19" + "\x82\xc3\xff\x83\x81\x48\x82\xbe\x09\xda\xd4\xeb\x1f\xe8\x96\x69", + 1, 2816 }, + { 128, 128, 10, "\xeb\xcb\x01\xb1\x19\x2a\x67\xd5\x19\xf7\xea\x54\x16\x54\x0c\x42", + "\x3e\x8e\xd8\x30\xd6\x68\x57\x2f\x4f\xd8\x81\x60\x09\x84\xb4\xd0", + "\x6b\x44\xa6\x07\x77\x51\xa3\x86\xe6\x0b\xbf\xf6\xd9\x52\x3e\xa0\x06\x03\x4a\xbd\xac\xdb" + "\x23\x79\x71\x6f\x4c\x0d\xfa\xe5\xa4\x2f\x71\xe3\xbf\x9d\x96\xff\xf2\x53\x0a\xec\xc8\x26" + "\x90\xdc\x97\xba\xd7\xeb\xe1\x55\x49\x10\x5c\x3f\x30\x8f\xfc\x72\xd1\xcc\xc5\xcc\x58\x36" + "\x60\xbf\xe0\xe2\x74\x53\xca\x06\xa0\x88\xbb\xf0\x6e\x25\x8b\xa2\x1e\xcf\x2e\xa3\x53\xd8" + "\x6b\x4c\xaf\xa6\xe4\xfc\x01\xc0\x74\xb8\xea\x96\xd3\x1a\x49\x52\xdb\x1f\x49\x6c\xe5\xb4" + "\x5c\xfa\x8d\xb0\xd1\x5d\x04\x76\xe2\xc4\x6d\x58\x50\x9e\x67\x3f\x60\x56\x4a\x26\x36\x20" + "\xbc\x88\x72\x7f\xdd\xda\x28\xda\x21\x1a\x1d\x30\x3d\xe4\xb4\x8b\x95\xb7\x1e\x9c\xb0\x98" + "\x41\xe2\x8c\xd7\x37\x76\x15\x5f\xb5\x93\x3b\x74\xc1\xca\x69\xfb\xcf\x06\x89\x76\xdb\xd0" + "\x52\xc5\xf0\xac\xc5\xfb\x26\x74\x86\xca\x33\x31\xb8\x0b\xef\x64\x62\xa2\xdf\xcd\x06\x4a" + "\xe3\xf3\x09\x5d\x8c\x7a\xca\xfd\xba\x52\x5b\x78\xa1\x22\xce\xc6\x66\x4b\xc8\x55\x54\xd7" + "\xbf\xe3\x62\xa9\xb3\x3e\xb1\x19\xae\x8a\xf8\x95\x0e\xee\x88\x0f\x25\x2f\x08\x8a\x59\xab" + "\xdf\x4a\xb9\xda\x9f\x9c\xce\x65\xd5\xa8\x94\xa3\x52\xe3\x6c\x60\x93\x0c\x76\x8a\x66\xf0" + "\x06\x5d\x8a\x7e\x84\x6b\x88\xac\x46\xb5\x8e\x05\xa0\xa1\xf6\xe7\xd6\x42\xe8\x4d\xee\x67" + "\xf7\x24\xfe\x5a\xc6\x67\x81\xe3\xc0\xf0\x07\x5a\x43\x09\x57\x5b\x5b\x02\x54\x5d\x8e\xcf" + "\x6d\xab\x92\x6c\x47\x4b\x0f\xb1\xa8\xa7\x1b\x0c\x49\xfe\x3d\xc6\xa2\xcb\x12\xcd\xec\x66" + "\x90\xc2\x76\xd7\x49\xfe\x77\x3e\xdf\x88\x0f\x39\x91\x60\x26\xc6\xff\xc0\x36\xdb\xd4\x4d" + "\xe1\x90\xca\x96\x5e\x33\x85\x4f\x94\xb4\x42\x48\x42\xea\x06\x88", + "\xd1\x81\x7f\x0d\x2e\xe9\x4a\x83\x54\x17\xe0\x9f\x23\x73\xf4\x2d\x23\xb0\xdf\x9c\x32\x44" + "\x3f\xfd\xca\xaf\x3c\xc0\x96\x48\x6c\xfd\xd9\xe4\x70\xe7\xe6\xfe\x91\xd9\x90\x18\x78\x12" + "\x81\x17\xda\x53\xc6\xc1\x41\x5a\xe2\xca\xa0\xbf\xfe\x1e\xb9\xfb\x42\x53\xf9\x75\x3b\x0b" + "\xd6\xcd\x1d\x15\xda\xc0\x9a\x21\x84\xae\x3e\x22\xa6\x1f\x91\x7f\xcb\x45\x42\xf9\x0a\xc0" + "\x0d\xd8\x27\xeb\x9a\x06\xea\x61\xa3\x0e\xc6\xa7\x30\xe2\x3d\xc7\x5d\x2c\xe0\x34\x65\x70" + "\xa8\x4f\x35\xcd\xdf\xef\xdd\xdc\x37\x36\x82\x3f\x15\xcf\x29\x1d\x15\xbc\x92\x46\xc1\xf7" + "\xcc\x45\x73\x2f\xc0\x17\xd9\xed\x78\xbc\x32\xa0\x11\xad\xf6\x63\xd8\x71\x6b\xb7\xf1\xd9" + "\x86\xd4\xf2\x05\xbb\xff\xb7\x84\xea\xbc\x1b\x3d\x90\x44\xb8\xe9\xff\x36\x9f\x94\xa3\x2f" + "\x31\xec\xbb\x36\xed\xad\x56\x65\x64\x4e\x86\x83\xb0\x91\xcd\xbc\x56\xb9\xa8\xa1\xa3\x74" + "\xae\xc5\xc9\x58\xd0\x0a\x57\xc0\x2a\x84\x92\x30\x42\x8a\x9a\xbc\xeb\x97\x71\xbe\xe7\xa6" + "\x57\xb6\x4c\x86\x5a\x9e\xb3\xdf\x86\x42\xcb\xe9\x2d\xc3\x3d\xc0\xb0\xcf\x17\x67\xa1\xb5" + "\x20\x1a\xbd\x83\x35\xa5\x12\xdd\xca\xdb\x9c\xff\x2e\x76\x15\x54\x9b\x57\xe5\x99\x78\x1b" + "\xb5\x20\x6e\x92\xbd\x1d\x23\xc1\x1c\x95\xb0\x34\x8f\xeb\x7d\xb9\x17\x1b\x37\x90\xc8\x93" + "\xa1\x4b\x94\x86\x6e\xe1\x52\x7b\x24\x23\xa3\x05\x0f\xf7\xaf\xd2\x45\xff\x67\xb4\x56\x39" + "\x3b\xce\xb5\x10\x0a\xb9\xb4\x73\xee\xf5\x33\xb1\xd4\x45\x6d\x55\x09\x7e\xaf\x6b\x75\x91" + "\x37\x38\x8a\x13\x80\xf2\xbf\x45\x5c\xbd\x30\x98\xcf\x6b\x87\xab\x07\xf5\x38\xb8\x57\xe1" + "\x72\x88\x03\x46\xeb\x87\x87\xf9\x60\x27\x37\x5c\x5d\x75\x37\x2a\x3a\x26\xc0\x3e\x3c\xb3" + "\xd1\xaf\xca\x71\x8e\x97\x9c\x25\x3b\x1f", + 1, 2944 }, + { 128, 128, 11, "\x23\x92\xc5\x2e\x25\x7e\x7d\xd1\xf3\xa5\xd6\x4d\xac\xfc\xaa\x02", + "\xb0\xdb\x14\x69\x98\xd2\xa2\x82\x42\x13\x3f\x0a\x42\xd8\xce\x9a", + "\x4f\x49\x49\x72\x31\xd0\x36\xee\xad\xee\xce\x1b\x36\x96\x1c\x96\x7b\xce\x5a\xf6\xdf\x72" + "\xe7\xbb\x8c\x33\x0f\x99\x14\x4d\x68\x37\x22\x8f\x1a\xa3\x49\xb9\xaa\x25\xf2\x3c\x7b\xcf" + "\x46\x6f\x9f\xa7", + "\x12\x1d\xcb\xc3\x47\x9c\x41\x6e\xf5\xc4\x97\xbd\xac\x9b\x94\x6c\x2d\x78\xf2\x23\x04\xd1" + "\xb9\xa7\x3b\x58\xa5\xe2\x2b\xbe\x1c\xb3\xd4\xe1\xbc\xc9\x9a\x85\x09\x82\xc5\x3e\x07\x26" + "\x02\x53\x88\x6c\x49\x9d\x9f\x08\xc0\x68\xda\x65\x54\x02\xe3\x33\x89\x4d\xb7\xa3", + 1, 384 }, + { 128, 128, 12, "\x00\x82\x6a\x92\x09\x2f\x24\x77\x4d\x2b\x34\xc9\x23\x2b\x0b\x20", + "\xf2\x6f\xf3\xed\xaa\xa2\xf1\xc4\x66\x68\x99\xf8\xb7\xaf\xbf\xaf", + "\xf0\x0f\x43\xde\xe2\xb3\x9d\x33\x85\xf4\x62\xaf\x91\x7b\x6d\x4e\x4c\x48\x30\xc7\x93\x64" + "\xac\x4c\xac\xb8\xc6\xc3\xbc\x2a\xfc\xae\xbb\xec\x4a\x33\xad\x6d\x2b\xb0\xc0\xec\xe1\xd1" + "\x33\xcd\xd4\xbb\x2d\x87\xeb\xe4\x25\xdf\x74\xac\xf2\xd5\x4c\xf9\xc1\x93\x39\x31\x42\x71" + "\x6b\x4d\x29\xcc\x18\x76\xe3\xb4\x8f\x96\x49\xb5\x66\x74\xb6\x7b\x39\x6a\xbd\x38\x1a\x53" + "\x6a\xda\x22\x47\x2c\xe8\xcf\x7b\x35\x7e\x4d\xe7\xbc\x17\xc8\xc7\xb4\x8a\x71\x6b\x94\xbf" + "\x09\x0d\x8a\x6f\x00\xf6\x87\x2a\xe2\xe7\x93\x1f\xab\x78\x9d\x44\x3d\xc4\xa1\x74\x60\x9f" + "\x44\xb5\x61\x84\xc4\xe7\x1b\xed\xa8\x13\xc7\xc5\x84\x69\xaa\xa2\xb0\xf3\x0d\x31\x6d\x60" + "\xd9\xef\x84\x44\xef\x4a\xc9\x73\x46\xa5\xdf\xed\x38\x43\xc7\x58\x33\x30\xa5\x2c\x1a\x69" + "\x0b\x76\x8e\x9c\x1e\x65\x63\x2c\x8f\xe7\x23\x01\x6d\xf2\x6d\x3d\xcd\x44\x3e\x0d\xf8\xe4" + "\x9d\x5f\x25\xc6\x16\x0b\x9b\x28\x52\x93\x97\x9a\x12\xd4\xec\x90\x95\x52\xdf\x00\x60\x02" + "\x48\xe1\x8b\x36\x80\xc5\xc3\x22\x47\x52\x47\xce\x1e\x6c\x8e\xd3\x3c\x4d\x6b\xe1\x08\xdb" + "\xf1\xa7\x17\xd2\x17\x32\x8c\x7b\x18\x26\x37\xf7\xaa\x93\xc6\xec\xd9\x69\x39\xd5\x61\x78" + "\x85\x3a\xf6\x43\x43\x84\x0e\x38\x71\xc2\x03\x57\x05\xea\x37\xa0\x52\x48\x3b\x97\x2b\x33" + "\x81\xe8", + "\x36\xc6\x7c\xed\x77\x5b\xb5\xf8\x24\x69\xf2\xe7\x1e\x5d\xa1\x06\x68\x91\x06\x12\xd6\x4f" + "\x78\x09\xcd\x35\x3c\x42\x28\x88\x15\xea\xc1\x09\xf0\x64\x60\xdf\x8f\x89\xdf\x34\xf8\x65" + "\xfe\xff\xe8\x5a\x4d\xfe\x8c\x82\xf5\xbe\x43\x02\xba\xe9\xe7\x04\x35\xdd\x54\x18\x87\x7b" + "\xf7\x4a\xe1\x30\xd5\x22\xe8\x62\x87\xff\x82\x59\x33\xc3\xa9\xcb\xbe\x42\x53\x03\xd5\xdc" + "\x66\xd1\xcb\xac\x40\x16\xd8\xdd\x24\xfc\x12\xcc\xd2\x80\x2c\x43\xf5\x41\x5e\xb3\x7a\xb0" + "\x01\x9d\x6b\xca\x44\x5a\xaa\xe9\xcc\xcb\xbc\x32\x6c\xd4\x22\x74\xa6\xda\x4a\x12\x18\x72" + "\x7d\xe2\x47\x69\xbb\x75\x50\x30\xd6\x7d\x80\xb7\x55\x17\x9f\xb4\xe1\x1d\xae\x7a\x2a\xe1" + "\x73\x1c\x9b\xa3\xec\xd3\x69\x59\x5e\xf0\x4b\x90\x8f\x5f\x41\x6d\xc1\x2d\x70\x7b\xee\x43" + "\x2c\x45\xfd\xd2\x47\x44\x10\x5a\x53\x9b\x18\xfc\x10\x2f\x33\xf5\x56\x36\xcc\xda\xeb\x52" + "\x1e\x92\xf4\xcb\x4c\xd5\xa1\x21\xef\x5c\x3c\x1f\xfd\xde\x4c\xa4\x17\x57\x00\x39\x80\xab" + "\xee\xe8\xec\x25\x63\x26\x8c\x2d\x1d\xc5\xe0\xd8\x99\x20\x60\xd5\x0b\x31\x66\xb8\x8b\xed" + "\xe6\xf3\x05\xea\xf8\x76\xd9\x28\x41\xe6\x77\x98\x26\x42\x5e\x51\xf5\xd9\x76\x78\xb8\x51" + "\x11\x91\x23\xf9\x46\xbd\x93\xc4\xb2\x18\xad\x7b\xde\x4c\xb4\x42\x77\x1a\x53\xeb\x9e\x67" + "\xdf\xeb\xcb\xb8\xbb\xd3\x48\x4d\xf0\x01\xe2\x00\xe5\xfb\x41\x6e\xea\x45", + 1, 2304 }, + { 128, 128, 13, "\x6f\x1e\x3a\xf9\xd9\xcc\x23\x6f\x77\x2c\x02\x52\xca\x40\xb5\x1f", + "\x94\x30\x7d\x11\xa9\xb2\x60\x14\x40\x24\xad\x18\x25\xa5\x84\x87", + "\x2d\x1b\x83\x67\x82\xdf\x23\xf8\xc4\x90\x10\x5b\x6e\x61\xa9\x33\x21\xe5\xd2\xbe\x88\xe0" + "\x96\xb2\x14\xa2\xfd\xb9\x34\xbb\x62\xda\xb1\x06\x49\xed\xbe\xb7\x3b\xa7\x78\x22\xfe\xb6" + "\x5a\x4a\xe6\xdd\x52\x6a\x8c\xdd\x00\xb0\xc1\x8b\xca\xce\x40\x17\x67\x21\x5b\x18\xf8\x66" + "\x6b\xa4\xca\xb3\x92\x61\x92\x9d\xb0\xb1\x1f\x2d\x14\x86\x62\x57\x74\x2a\x30\xe7\x7e\xc7" + "\xcf\xb6\x5b\xb3\x1b\x52\xf7\x83\x48\x08\x13\x2f\xae\x63\xbc\x0e\x06\x88\x0c\x21\xcc\xc7" + "\x9a\x26\x99\xcc\xb3\x6c\xef\xd7\xf7\xe8\x23\x25\x59\xa1\xbd\x1e\x89\x45\x64\x32\xf7\x92" + "\xee\x9e\xd8\x64\xd9\x54\xf4\xc0\x24\xa6\x95\xec\xf5\x1b\xed\x58\x75\x4f\x12\xc1\xdd\x4b" + "\xc6\x40\xfd\x0f\xd8\x11", + "\xb1\x9c\x54\x82\xff\xc8\x4a\x8a\xac\x28\x49\xcc\xdb\x73\x4f\x94\xde\xa8\x0e\x74\x22\x30" + "\x0d\x4e\x3e\x95\x31\x6f\x68\x9c\xa4\xcb\xc1\x2d\x78\x81\xe2\x90\xcc\x62\x3d\x6e\x66\xb9" + "\xf4\x64\xd9\x1c\x2e\x31\x11\x2b\xa8\x19\xed\xbe\x0f\x75\xe0\xdb\xc1\x3b\x74\x43\x23\xac" + "\xf4\xba\x7d\x95\x42\x3f\x5b\x65\x32\x86\xa4\xea\xbb\x77\xa7\x16\x10\x72\x88\xdb\x4f\x1d" + "\x7b\x76\x4d\xa1\xe9\x90\x3c\x28\x25\xfc\xb9\x74\x5a\xfe\xd0\x33\x0d\x6c\xb9\x50\x09\xd2" + "\xcd\xb1\xf7\x3a\x1a\x8d\x02\x8f\xbe\x51\xd0\x7b\xef\x6c\x33\xeb\x70\xa5\xdd\x01\xba\x4e" + "\x8a\x08\xec\x0e\xc9\x14\x09\x0e\xba\xcf\xd5\x0d\xef\x79\x85\x41\x83\x38\xb7\x13\xe4\x8f" + "\xe4\xf4\xf5\xc2\xea\x5e\x15\xfb\xf7\xbe\xfb\x03\xe2\x6e\xd1\x74\x09\x94\xaa\xf4\xa2" + "\xf0", + 1, 1280 }, + { 128, 128, 14, "\xa9\xd7\xdd\x48\xaf\x2c\xe4\xa3\x5a\x5a\x4e\x61\x02\x60\xcc\xde", + "\x78\x85\xb2\x28\xbc\xdc\x45\x6e\xf7\x7d\x1a\xe7\x5b\x34\x11\x5b", + "\xfd\xd7\x66\x37\x86\x80\xf6\xb7\x5e\xf1\x97\x07\xfa\xfd\x1f\x2c\xa3\x58\x03\xc8\x5a\x73" + "\x0a\xa5\x43\x9b\x71\x83\x05\x8c\x06\x51\x6f\x48\xad\xc5\x5c\xcf\x9e\x72\x47\xad\x91\x06" + "\x27\x19\x1d\x9e\x33\x33\x8f\x9a\x03\x2e\x22\xc5\x23\xc6\x2a\x04\x05\xb4\xaa\xdc\x44\x22" + "\x49\x85\xa1\xfa\x91\x81\x50\x90\xe9\x7d\xb8\x3c\x17\x43\x23\x88\x73\xb2\xa0\xfc\x1a\x82" + "\x40\x8c\x52\x73\x77\xde\x62\x43\x6b\x0d\x47\x19\xbd\x29\x97\x5e\xe1\xc6\x1d\x9a\xa1\x7b" + "\xbc\x0f\x2a\x22\x4d\x37\x02\x8a\x37\x78\x65\x3e\xdb\x85\xca\x4c\xe3\xc2\x73\xe9\xc8\x36" + "\xac\x69\x36\x7d\x62\x35\x7c\x4d\x0e\x7a\xec\xa9\x74\xfb\x65\x3d\xed\xa5\xf5\x51\xd9\x45" + "\x21\xb4\xcd\x48\xbc\xc3\x2c\xc6\xd7\x1e\x9b\x76\x96\x9c\xa5\xd3\xc2\xcd\x21\xcf\x25\x0e" + "\x25\x6e\xdc\x06\xc2\xa3\x47\x08\x00\xaa\x79\xe8\xfa\xbb\x6f\xd3\xea\x40\x88\x88\xf0\x4b" + "\x0e\x00\xa6\xaa\xf8\xf3\x6d\x33\x73\x68\x02\xe2\xcd\x56\x22\x68\xee\xcd\xa6\x33\xec\x92" + "\xff\x0f\x6d\xc0\xa9\x4a\xad\xfa\x42\x9a\xb5\x51\x1a\x78\x1e\x20\xef\xf9\xed\x7f\xe2\x0a" + "\xec\xef\xfc\xad\x30\x3f\x38\x16\x98\x06\x60\x9b\x42\x4a\x35\xcc\x29\xe1\x3c\xfa\xeb\xac" + "\x46\x0e\x2c\xe3\xde\x29\x0a\x5f\x64\xd0\x01\xac\xf9\x16\x2f\xb2\x77\x7c\xf7\xaa\xa2\xb2" + "\x9a\x95\x11\xf6\xfa\x0c\xad\x14\xc1\xb4\x60\xa4\xc1\xea\x82\xf2\x11\x7a\x9a\x97\x44\xd9" + "\xb7\x37\x50\x2c\xcb\x6c\x7c\xe8\xc9\x0b\xb6\x46\xed\xd9\x4e\x8f\x8c\x27\x54\x70\xd1\x8c" + "\xdd\x86\x28\xbc\xed\x74\x40\x52\x1a\xf6\xaf\xd5\x35\xa5\xab\xee\xe2\xbd\x68\x6c\x28\x15" + "\x14\x36\x67\xf2\x17\xae\x38\x8b\x59\x05\x9b\x85\xdd\xbf\xb2\xbf\xf4\xb7\xe7\x1e\x5a\x11" + "\x0f\xa8\x5c\x1e\xdf\x92\xbd\x76\x9b\x78\x64\x93\x2a\x50\x90\xe9\x4a\xe2\x15\xa4\x66\x9b" + "\x9d\x9a\xbf\xec\x72\xd4\x7b\x80\xc2\xc2\x1d\x16\x6e\xfc\xae\x2b\x32\x27\xbd\x00\x09\x73" + "\xbf\x3c\x7f\x53\xf1\xb4\x89\xdc\x85\xbd\x09\xc2\x3d\x43\x6d\x1f\x91\xf7\xca\x5a\x89\x04" + "\x3d\xd3\x3a\x30\xbe\x15\xd9\x58\xb6\x2e\xa8\xd7\x49\x26\xad\xfc\x90\xe8\x1a\x82\xb0\x8f" + "\x12\x87\x67\xa7\x8f\x14\xe3\xc7\xf6\x79\xcf\xe9\x69\x96\x7c\x66\x2c\xf8", + "\x7f\x05\x54\xdb\xee\xcd\xa0\xfc\xda\x76\x64\x15\xf4\xdd\x23\x10\x65\x95\x72\xbf\x57\x15" + "\xfd\x5a\xad\xbb\x30\xc1\x2e\xb2\x30\x0a\x3a\x5f\xf0\xe0\xb6\xa9\x56\x20\x0d\x81\x63\xa1" + "\x16\x4c\xc0\x0c\x58\x17\x85\x42\x79\xda\x82\xa4\xa6\xc0\xa7\x1e\x26\xba\xb5\x4a\xf6\x12" + "\x76\x58\xb3\xab\x46\x48\x84\x45\xc6\xf5\x52\x69\x22\x25\xb9\x9b\xfa\x3f\xf3\x89\x25\x06" + "\x75\x13\x9f\x2b\x09\x1b\x45\xca\x80\x25\xca\xbb\x85\x40\x76\x5a\x50\xb0\x4d\x62\xcb\xff" + "\x76\xd8\x77\xda\x3d\x9e\xf6\x67\xdf\xe6\xae\x25\xdc\x28\x9d\x15\x9c\x04\x3a\x32\xae\xf8" + "\xe9\x31\x37\x81\x02\xec\x1b\x6b\xce\xbe\x56\x87\x00\x01\x83\xc5\x80\x1f\x7b\x0c\x3f\x61" + "\x5b\xc8\xb5\x2a\x91\x95\x8c\x1a\xb2\x87\x58\x73\x93\x43\xd8\xe4\x30\x9c\xdb\x53\xc7\x14" + "\x1f\x8d\xea\x77\xc7\x4f\x41\x7c\xa4\xfb\xbd\x35\x05\x8e\xca\x70\x15\x58\x0d\x6f\xb0\xb2" + "\xda\x2f\xbc\x83\x6c\xf0\x27\x9e\xe9\xba\x6a\xb4\x04\x2a\x4a\xdc\x46\x61\x74\xa1\x10\x2d" + "\x1a\x57\x96\xc0\x8c\x7b\xb1\xfa\xf9\xd9\xdc\x48\x2d\xda\xe0\xf3\x5c\xfc\xd5\x0d\xf5\xee" + "\xfc\x92\x00\x02\x9a\x2b\x6b\x9c\x90\xfa\xd2\x26\x87\x76\x0d\x40\x26\xe1\x76\x2a\x15\x37" + "\x23\x16\xfa\x75\x77\x01\x41\xbd\x74\x66\x28\x5c\x5c\xb6\xb6\xfa\x13\x0a\xb2\x7c\x98\x40" + "\x1a\xa0\xd5\xb7\x77\xd5\x30\x8f\xde\xca\x9f\x71\x97\xd2\xe8\x93\x6b\x57\x5b\x25\xd7\xac" + "\x24\x15\x62\x75\x83\x07\x4c\xa5\xa8\x6b\x40\x70\xc8\xe4\xb3\xf5\x73\xfe\x8b\x91\x14\x81" + "\xa4\x2d\xfc\x7f\xa1\x76\xb4\x3c\x19\xeb\x0c\xb5\x70\x41\xba\x58\xce\x93\x16\xb4\x09\xad" + "\xfd\x84\x03\x0c\xf9\x15\x73\x07\x27\xc2\xa8\x76\x71\x9f\x13\x05\x3a\x01\xfb\x0c\xa3\x13" + "\xb2\xb8\x8c\xea\x71\xc5\xbf\x55\x9b\xe1\x1a\xe7\x95\xf4\x20\x67\x7e\xb5\x06\x3f\xbe\x7e" + "\xde\xf1\x4f\x05\x60\xb5\xf1\x8c\x6e\x04\xf5\x59\x14\x43\xda\x0c\xd2\xb1\xe8\x67\xaa\x8d" + "\x0a\x67\xc5\x9c\xef\xee\xdf\x8f\xe5\x65\x55\x52\xa8\xb0\xd2\xd6\x7f\xc0\x19\x63\xcd\x9b" + "\xd4\x13\x86\xc1\xbf\x79\xa9\xfd\xbe\x05\x80\xc8\x75\x4b\xd3\xf4\x05\xc4\x0e\x94\xf8\x00" + "\x48\x6f\xf2\xc9\x25\xeb\xa9\x75\xae\x46\x51\x21\x03\xaa\x15\x0b\x7b\x4f\xe5\x21\xf9\xce" + "\xfb\x3f\xde\xb1\xcc\xdb\x45\xc0\x47\xfb\x35\x01", + 1, 3840 }, + { 128, 128, 15, "\xae\x10\xaf\xd3\xeb\xa4\x9a\xd7\x47\x7b\x54\x4d\x09\x4f\xd1\xeb", + "\x65\x8c\x6b\x62\xc1\x9d\x45\x5e\x5e\x95\xbb\x14\xb3\xf7\x0f\x4a", + "\x56\xd7\xcf\x68\xa5\x31\x3f\x14\x0a\xfc\xd2\x48\xb4\x25\x1e\xac\x6c\x58\x53\x43\x7c\xa5" + "\x21\x34\x6d\xc8\x71\x80\x36\x0e\x1a\x3d\x40\xab\xac\x8f\xd8\x7a\xfa\xf8\x9d\xa0\xca\x14" + "\x09\x93\x4a\x3f\xf3\x9b\x58\xe4\x5b\xfd\x02\x06\xe1\x71\x2e\x76\xfd\x81\xb8\x40", + "\x69\x5b\xab\x96\xd9\xeb\xcc\x29\x8f\x8f\xc7\x8a\x12\x47\xdd\xcc\x6a\x82\xe6\x50\x89\x4b" + "\x1f\xb9\xf0\xd3\xd4\x04\xb7\x42\x93\x67\x02\x65\x01\x38\x9d\x4f\x1f\xf9\xd7\xaa\x16\x43" + "\xd1\xbb\xf4\xce\x01\x6e\x74\x56\x41\x81\x76\xc2\x4a\x28\xc3\xdd\xa1\x73\xb5\xc9\x56\x1d" + "\x64\xf0\xd6\xba\x73\x17\x48\xb8\x36\x01\x9b\xb7\x59\x94", + 1, 512 }, + { 128, 128, 16, "\x30\x4e\x57\x4d\x55\x26\x5d\xb8\x7e\xf2\x31\x09\xfe\x52\xb4\x48", + "\x24\xcd\xf5\x71\x5c\x50\x75\x18\x4c\xd4\x1f\xd5\xd3\xe1\x14\x14", + "\xbe\xc2\x85\x27\x7f\x0f\xc9\xfc\x90\x10\x6c\xa1\x93\x2f\xbb\x6e\xee\x86\x77\xd8\xbe\x4c" + "\xf0\x5d\x4a\xe7\x46\xdb\xd6\xcd\x6b\x22\x66\x14\x95\xd0\x19\x40\x8d\x3d\xf8\x0e\x19\xaa" + "\x40\xac\x4c\x0f\xdb\x02\xb8\x61\xa2\x42\xf7\xfe\x51\x6e\x49\x56\x1b\x6c\xb2\xfa\x00\xb8" + "\xad\x11\x41\x24\x70\x68\x00\xc5\x18\x6e\x5a\xda\x49\x1e\xf6\x6a\x58\x83\x14\xf2\x2b\xd3" + "\xc7\x40\xbe\x14\x45\x49\x28\xac\x41\x61\x48\xcb\xfb\x11\xf2\x29\xb8\x9e\x3a\xaa\x8d\x89" + "\x95\xa1\x92\xb3\x95\xcd\x37\xde\x30\x6a\xa6\x63\x83\x00\xbe\x51\xca\x91\xa7\x5e\x88\x55" + "\x59\x3b\x5d\x61\xe7\x01\x1f\x85\x6e\x80\x84\x6c\xc0\xd3\x79\xa0\xc7\x7e\x21\x60\x46\xcb" + "\x87\x64\x94\x12\x89\xa6\xf7\x9e\xc2\xad\x05\x21\x1b\xd2\x2d\xd3\xef\xfd\x3e\x93\xc7\x62" + "\xd9\x60\xe6\x5f\x4c\x2c\xa9\x46\xe1\x9b\xcb\xd3\x5c\x2c\x2e\xba\xe9\xdc\xfb\xd3\xd8\x0f" + "\x05\x65\x61\xe3\x22\x4e\x45\xdc\x87\x27\xad\x11\x91\xdf\x9c\x33\x3e\x32\xd5\xa1\x16\x95" + "\x32\xc0\x56\xdb\x4e\x04\x10\xc5\x35\x39\xb7\x1d\xb6\x34\x56\xf8\xd3\xc4\xd4\x7e\x30\xcb" + "\x3b\x46\x43\x2f\xe5\x03\xfb\x42\x80\xb4\xc3\x1f\x50\x23\x30\xa1\xf1\xe4\x8b\xf5\x17\x59" + "\x1a\xe0\xdb\x02\xcd\x76\x5d\x3f\xc3\x53\xf8\x02\x3c\x8f\xc5\x2f\xe8\xd6\x4e\xd1\x8f\x68" + "\x2f\x10\x6a\x94\xb2\x7b\xa2\xf1\xf9\xeb\x11\x5d\xb7\xe2\xec\x0f\x0e\xc3\x5d\xb6\x7e\xd9" + "\xef\xf6\x1c\xc8\x6b\x18\xf7\x41\xb4\xf5\xe4\x5a", + "\xd5\x6e\x44\x2f\x76\xa3\x5e\xb8\x41\x6a\x3a\xd0\xb9\x4c\x22\x22\x6a\xf3\xa9\x15\x0d\x04" + "\xba\xf0\xda\x0c\x5d\xcd\x6d\x97\x53\xd3\x65\x27\xcb\xeb\x18\x4f\x8e\xf5\x28\x97\x84\x1d" + "\xcc\x42\x44\x2b\xe2\x80\x61\x5a\xeb\x09\xe4\x7f\x92\xf1\x3a\x3f\xd5\x66\x67\x22\x8b\xae" + "\x52\x4b\x98\x04\xd0\x99\x56\x1f\xda\x84\x56\xb9\x81\x47\xa9\xe7\x51\x8e\xc4\x77\x2e\x5e" + "\x70\xea\x2d\x9d\x59\xf8\xa8\x6e\xa7\x55\x6a\x50\x16\x31\x40\xa5\xd1\xf5\x3f\xc0\xdf\x3d" + "\xeb\xb7\xc0\xb5\x79\xfb\x32\xa3\x48\x59\xf0\x3f\x09\xf3\xdc\x55\xff\x77\xd8\xa8\x85\x33" + "\x7a\x9d\xe7\x7e\x34\x08\x91\xec\x23\x71\x63\x0e\xa5\x61\x70\xcb\x64\x6c\x6e\x24\xd2\x78" + "\xd5\xe5\xd8\x6c\x42\x19\xf7\xb0\xab\x78\x65\x57\x18\xb0\xb2\x00\x31\xb7\xf0\x5b\x02\xc5" + "\x45\x86\x78\x60\xd5\x36\xe2\xda\xe8\x84\x26\xf6\xce\x98\x9a\x49\x2e\xbe\xb4\x4c\xb1\x4b" + "\x23\x09\x02\x46\xca\x72\x41\x2b\xce\x76\x48\xd6\xb8\x98\xea\x24\x51\x3b\xe3\x05\xc4\x44" + "\x99\xaa\xd1\x36\x53\x94\x4a\x20\xfe\xae\x61\xca\xe5\x35\xc7\xe5\xbb\x17\xf2\x93\x56\xc1" + "\x0a\xd7\x5c\x54\x76\xab\x2f\x30\xf3\x8b\x5a\x1f\xd4\xc4\x1a\x20\xd2\xf0\x56\x17\xdd\x11" + "\x3d\x6a\x93\xfd\xdb\x1b\xe6\x68\x35\x26\x55\x79\x5b\x91\x75\x53\xe8\xf4\xf0\x07\x44\xd2" + "\xa8\xba\xdd\xa6\x67\xea\xb6\x79\x90\x93\xea\xb6\x6a\x29\x16\x73\xa3\x19\xd9\x75\x1d\x58" + "\x57\xae\x69\x9e\x42\x4d\x84\x83\x6e\x66\x5b\x0e\x5b\x2b\x64\x05\x59\x69\xa4\xee\xed\xc2" + "\xbe\x85\x42\xff\xae\x6f", + 1, 2560 }, + { 128, 128, 17, "\xcc\xe3\xfb\x93\x59\x62\x0a\x01\xd5\xc7\x31\xf3\x9a\xf0\x0e\x4b", + "\xdf\x0e\x7e\x4c\xb3\xd8\x18\x37\x2d\x7e\xc2\x6e\x0b\x8d\x56\x6a", + "\x13\xa1\xcb\x11\x53\xe9\xfe\xd8\x4d\x76\x03\xba\x68\x22\x6c\x35\x86\x81\x9f\xae\x58\x4a" + "\x70\x93\x70\xa9\x21\xe5\x2d\x6b\x1e\x66\x56\x79\xe6\xd7\x95\x7e\x3e\x61\x55\x79\xbd\x18" + "\xe3\x0e\x4d\x53\xe2\xa2\x43\x26\xb1\xb8\x3f\x81\x2d\xba\x6c\xd1\x40\xcf\x8a\x8d\xfd\x91" + "\x06\x3d\x64\x13\x4c\x05\xcb\x7b\x42\xc5\xa6\xdb\x87\x7f\x53\x47\x86\x64\xd5\xa4\xe0\x54" + "\x25\xf5\xff\xa0\x5b\x0a\x58\xa3\xdc\xdc\x13\xf6\xce\x0b\x6d\x89\xd2\x7c\x16\xd3\xb8\xf1" + "\xdd\x7c\x52\x95\xd2\x78\xf6\xb0\xe4\x59\xce\xf1\xf0\xd5\x23\x1a\xe5\x7b\x53\xa8\x28\xe6" + "\x69\x5f\x59\x4b\x9e\x95\x7f\x76\x2d\x58\x84\x1a\x3e\x8f\x9a\x6c\x81\x2c\x87\x6f\x8e\xb6" + "\xbe\xe6\x39\xac\x53\x93\x86\xa2\x72\x01\x46\x7f\x07\xa8\x71\x19\x8f\xac\x66\xeb\xa1\x66" + "\xc5\x50\x1d\x2c\x5c\x03\x0d\x4d\x9d\x5a\xb5\xc1\x4f\xdc\xde\x5e\xdb\xf9\x00\x33\x4f\x46" + "\x2a\xfe\x9b\x10\x5b\x60\x40\x9d\x46\x46\x25\x94\x11\xa8\x13\xba\xbc\x5a\x59\xca\x6d\xf3" + "\x05\xc6\x7a\xc2\xc4\xa6\xf5\xa8\xef\x6f\x98\xfe\x9d\x05\xac\x91\xb3\xc9\x27\x10\x0a\x3c" + "\x4f\x0c\x40\x88\x99\xdb\x20\x1b\x62\xc1\x1a\xec\x67\x02\xd4\x83\xcd\xad\x1e\xc1\x41\xf6" + "\x92\x7e\x89\x1e\xb5\x22\xc6\x94\x6a\xfb\xb4\xc6\x23\x75\xe1\x2f\x90\xe0\x03\x9a\x94\xe0" + "\xb5\xfe\xad\x0c\xcf\xb3\x86\x4c\x8c\xb3\x2f\x9b\x1b\x04\x00\x84\x56\xa9\x26\x4f\x9b\xe0" + "\xbf\x72\x40\xea\x32\x1e\xe4\xeb\xdf\x65\x9e\xdb\xda\xac\x4f\x28\x58\x9d\x6b\x44\x67\xb6" + "\x12\x31\x67\x71\xda\x9e\x76\xca\x33\x4e\x0f\x94\x1f\xac\xa0\x72\x66\xe1\xdc\xa2\xd5\x83" + "\xa9\xaf\x84\x62\xcb\x1d\x56\x55\x77\x63\xfe\x10\x2d\xc5\x97\xe2\x63\x45\x49\x6d\x23\xef" + "\xac\x22\x90\x5e\x50\x1f\x68\x38\x6d\xc1\x3b\x29\x1a\xde\xab\x5d\x86\x11\x32\x62\x25\x4a" + "\x4e\xa6\xcb\xdc\x31\x3d\x8a\x55\xf3\x3b\xf3\xb8\xb3\x8d\xc9\x48\x54\xb1\x06\x12\x5e\x17" + "\xb8\x10\x8a\xce\x28\x51\x5e\x89\x16\x00\x8c\xd7\xe9\x52\x61\x44\x7b\x5b\xe4\x7e\xbf\xba" + "\x89\xd1\x19\xc8\xc8\xcc\x05\x60", + "\x12\x28\x51\x19\xc5\x98\xb1\xb8\xf3\x97\xac\x26\x66\x88\xac\xee\xb9\xf5\xdb\xf6\x8c\x4d" + "\xcf\x59\x7a\x0c\xa2\xd5\x83\xc0\x9e\xe4\x8c\x0f\x6f\xdd\x58\x67\x0e\x0b\xc8\x8f\x3a\x62" + "\x5e\xd6\x7f\xe5\xa4\x84\xf5\x5b\x78\x60\xa4\x3c\x23\x05\x63\x90\x4d\xd6\x92\x66\x82\xac" + "\x80\x60\x46\x5d\x43\x6c\xca\x23\x43\x45\xfd\xb0\x94\xbd\x3c\x00\x3b\x37\x09\x29\xd3\x22" + "\x1e\x36\x0a\x08\x52\x08\xbf\xe7\x29\xe1\xf6\x84\x64\xdd\xa3\x45\x0a\x9d\x72\xa4\x71\xd3" + "\x8c\x17\x77\x1f\xb5\xff\xfc\x72\xb2\x10\x98\xc8\xd1\x4c\x9b\x30\xdb\x13\x48\xad\x69\x5d" + "\x15\x6b\x92\x83\x1a\x9e\xa2\x28\x88\xa0\x50\xcc\xaf\xf7\x85\xed\xad\x2c\x55\x11\xcf\x65" + "\x77\x3c\x9e\x15\xe8\x38\x6e\x1a\xfe\xcd\x42\x6c\xcd\x42\xc7\x29\x81\xca\xe7\xf4\xb7\x8e" + "\x15\x3e\xa8\xea\xff\xa8\x21\xb5\x85\xfd\xe8\xa7\x93\xb3\xca\x6c\xf7\x6b\x4e\x95\xa5\x06" + "\x98\xbd\xa1\x37\x2e\xca\xc6\x00\xc4\x99\xdd\x4a\xd4\x10\x6e\x6d\xc0\xdc\x6d\x4c\x33\x00" + "\x94\x58\xb3\x14\xd4\x28\x20\xc1\x43\x79\x25\xfc\x6b\x5c\xcd\x0d\xc7\x48\xdd\xc6\xd2\x8b" + "\xde\x32\x11\x60\xef\xe7\x68\x92\x64\x2b\x1d\x7c\x3d\xba\x35\x65\xa6\xc8\xfe\x7e\x42\x7c" + "\x1d\x2d\xbd\x8d\x17\x03\x96\xf6\x00\x60\xa6\x7b\xbf\x9a\x2c\x7d\xb8\x35\xf6\x25\x47\x64" + "\x28\xa8\xe8\x14\x41\x27\xb7\x88\x3c\x46\x15\x3b\xf3\xcc\xe9\xa2\x17\x64\xb6\xc6\x93\x12" + "\xbc\xf5\x9a\x55\xac\x34\xd8\xae\x23\xd1\x7c\x81\xe2\xe9\x0f\x3d\x28\x98\xba\x79\x44\x7e" + "\x63\x57\x0d\xb8\xf0\xc1\xfb\x73\x1c\xd6\x93\xe1\x5e\x01\x75\xec\xac\xa4\x3a\xf2\x53\x7e" + "\x42\x7b\x4b\x5e\xf7\x97\x60\x36\x5f\x2a\xdb\x25\x31\x71\xa0\xc8\x81\xb6\x1d\x2f\x80\x73" + "\xfc\xe9\x06\x3b\xf2\x83\xcd\xbe\x84\xe8\xc7\x6d\x6f\x94\x42\x6b\x0c\x41\x52\x1c\x19\x09" + "\xd2\x95\x0a\xa9\xee\x5f\xf5\x0b\x33\x69\x1c\xa8\x83\xae\x80\x28\xdb\x7a\xdf\x09\x93\x50" + "\xc8\x62\x37\x8e\x7d\x3a\x65\x6b\x18\x49\xb3\x8e\xc0\x4b\x5f\xc8\x4e\xca\xcc\xe2\xce\x1c" + "\xde\x82\xd7\xf7\x08\xf0\x6a\x4a\x97\x8e\xb9\x21\x71\xd1\x85\xd3\xf5\xa8\x48\x3f\x09\x3e" + "\x75\xd2", + 1, 3584 }, + { 128, 128, 18, "\xf2\xb0\xfb\x0c\xa1\xbc\x6f\x96\x34\x67\xb8\x80\x22\x46\xb5\xdc", + "\x0c\xb1\x36\xc7\xd7\xa2\xff\x75\xbb\x78\x7d\x75\x3c\x27\x48\x53", + "\xa6\x95\x7d\x52\x1a\x4a\x98\x38\x53\x95\x3d\x2d\x2a\xf8\x11\x81\x77\x0c\x10\xb3\xa9\x04" + "\x59\x14\xb1\xca\xf4\x99\xde\x10\x14\x58\x61\x11\xc7\xa0\xb8\xe2\x15\x5b\x09\x99\x4b\x06" + "\x53\xd7\x25\xc5\x34\x55\x28\xff\xc7\xb9\x6e\x59\xe3\x3a\xe0\x04\x0e\x9e\xf3\x31\xa3\xeb" + "\xd1\xd2\x7a\xc6\xe5\x4f\x72\x00\xb0\xc4\xaf\xea\xcf\x93\x04\x81\xfd\x28\x48\x73\xd7\x7b" + "\x3a\x14\x07\x75\x44\x5f\x5b\xdd\x6f\xb3\xf4\x81\xf1\xe0\x2a\xfc\x08\x96\x2f\x23\x95\x34" + "\x37\x25\x40\xd7\x1e\xae\xe8\x06\xd0\x2f\x10\x96\xf4\xd1\x33\xa3\x78\xcb\x18\x3c\x1b\x32" + "\x8b\xfe\x36\x16\x28\x44\x30\x8f\xab\x93\x63\x5f\xd3\x6e\x32\x23\x0f\x07\x4e\xba\x7c\xf1" + "\x74\xfc\x16\x43\x76\x80\xdf\x80\xa6\x91\xb6\x1c\x3b\x33\xb9\x85\xb5\x72\x8b\x30\x73\x1a" + "\xdc\x39\xd1\x86\xac\xba\x0a\xdc\x9b\x00\x81\x05\xe5\x88\x7f\xaa\xd1\x04\x45\x1f\x8c\x79" + "\xb6\xbb\xcc\x72\x52\xa0\x50\x7b\x1c\xd5\x42\x16\x89\x68\x9d\xef\xbf\x4b\x4d\x20\x29\x69" + "\xda\x63\xdd\x71\xee\x9e\x9d\x8c\x05\x1a\x7b\xce\x60\xd0\x62\xf4\x5d\x43\xcb\x2e\xe0\xc5" + "\x91\x06\xfe\x6d\x41\x3e\xa5\x0a\xc3\x29\x8d\xce\xe3\xf5\xa0\xdf\x5b\xaf\xee\xea\x3c\x34" + "\x3e\x86\xf5\x2b\x55\x9d\x09\x76\x68\x6f\x0f\x86\xd5\xd1\x85\x32\xbc\x3d\x3d\x7c\x87\x7c" + "\xcf\x66\xf5\x98\x94\x33\x0b\xc9\x6b\x84\x81\xef\x0d\x35\x55\x8f\xb7\x8f\xc0\x6c\x07\x6e" + "\x93\xae\xee\xd7\xc9\x9d\x68\x47\x76\x37\xaa\x63\x86\x1f\x26\xac\x6e\xc1\x00\x57\x0e\x17" + "\x80\x25\x23\x2a\x74\x95\x39\xc9\x3b\x34\x84\x88\xee\xa5\xf0\xa9\x8e\x0e\xde\x63\x1b\x5c" + "\xac\x25\x6d\x33\xd8\xa1\xea\x41\xb5\xcd\x49\x7b\x0a\xc4\x5a\xfe\x91\x1a\x89\x22\xa7\x62" + "\xa5\xf7\x42\x42\x0b\x1c\x66\x09\x66\xbc\xc2\x77\x43\x25\x48\x84\x4d\x9d\x87\x32\x9c\xc0" + "\x75\x7c\xcc\x24\x08\x3e\x7f\x2e\xe3\x46\xe1\x5c\x1b\x5e\x2e\x1d\x9d\x74\xe9\xfe\x50\x98" + "\x8d\x1c\x55\xc1\x3b\x3e\x17\xaf\xf0\xb5\x0e\xe0\x5c\x9a\x8b\x53\x85\x86\x13\x1c\xf8\xaf" + "\x2d\xc2\x8f\x26\x42\x63\x7a\x61\x07\x40\x02\x97\xf4\xdb\x36\x3b\x68\x8f\x80\x63\x45\x7e" + "\xe3\x25", + "\x88\x31\x75\x8a\x23\xc3\xfd\x15\x99\xab\xcc\x8f\xc4\x94\x3b\x91\x9f\x31\xab\x8b\x19\x48" + "\xcb\xa2\xf3\x34\x5f\x70\x00\xe9\x7f\xe4\x0d\x1f\xae\xf8\xe3\xf2\x0f\x20\xc8\x0c\x2c\x30" + "\x59\x8c\xa8\xa9\xbf\x5d\x12\xa3\x31\xad\x34\x8f\x0e\xbb\x4c\xe7\x2a\xf9\xa9\xbb\x2c\x96" + "\x39\x6d\x49\xfb\x10\x5a\xb8\x65\xfc\xe5\x67\x56\x05\x00\x1b\x33\x26\xff\xee\xaa\x63\x2c" + "\xc5\x57\x3f\x55\x7b\x09\x86\xe3\x72\x17\xaa\x2f\x53\x74\x50\x64\xd6\xe3\xf1\x4f\x3a\xce" + "\xef\x07\xed\xf6\x81\x60\xdd\xf3\x7f\x7b\x5d\xeb\x66\x52\x5d\x9f\x67\x34\xbf\xc8\x4d\xa7" + "\xe8\xdc\xf7\x5d\x9d\x65\xd2\x7d\x78\x5a\xd8\x06\x9c\xa6\x2b\x6e\xb0\x27\x57\x89\xb5\x1c" + "\x57\x03\x96\x68\x33\x1c\xb4\x8d\x00\x03\xc4\x2d\xd3\x89\x89\x3c\xf5\x3c\x89\xb3\x4d\x60" + "\x08\xd7\xa5\xf7\xee\xe1\xb1\x66\xd9\xbf\x2a\x0c\xbb\x1e\x2a\x30\x98\xeb\x6d\x94\xca\xfd" + "\x5c\x04\xd3\x91\x22\x84\x5e\xf8\x65\x52\x9f\xa5\xbf\x4c\x40\xcb\xda\x74\xd9\xf1\x84\x7f" + "\xa2\xbc\x68\xe5\x63\xc7\xc7\xfa\x07\x3d\xa5\x76\xa8\x37\x6b\x48\xf5\x48\xc1\x4a\xe7\x85" + "\x0a\x6c\x3f\x52\x72\x9f\x3c\x42\x9f\x7d\xad\x96\x93\x03\x02\x3d\x24\xcc\x83\x03\x0a\x61" + "\x57\xd4\xcb\x02\x56\x2b\x6c\x3d\xc3\xd0\x56\xb9\xf1\xff\x44\xf1\x09\xc2\x2b\x4f\x24\xee" + "\x5f\x28\x9c\x77\xd7\x50\x24\xdf\xd2\xb1\x56\xf9\x99\xc1\xf3\x5f\xf2\x14\x5a\xae\xea\xaa" + "\xe5\xc0\xe4\x07\xf7\xf2\xa1\x0e\x69\xed\x1c\x23\x1f\x3c\xf7\x1b\x58\xef\xdd\x70\xca\x71" + "\xb4\x26\x3e\x48\x79\x1e\x5f\x99\x8c\x0d\x8c\x89\x6f\x48\x08\x85\x35\x10\xec\x2d\x28\x51" + "\xb2\xf3\xdf\x2d\x13\xdf\x76\xa4\x0e\x44\xb7\x60\x2b\x1d\xc9\x36\x60\x1b\xb5\xa2\x06\x99" + "\x85\x57\x20\x19\xed\xea\xc5\x98\x5e\x03\x1e\x1a\xaf\x8e\xb7\xb7\x8e\x88\x87\xcd\xf7\x34" + "\x68\x7f\x3e\xf6\x28\x97\x8a\xfd\x80\x75\x01\x0b\xea\xb3\x80\x82\x39\x52\x54\x72\x8a\x6f" + "\x26\x73\x11\xb5\xd2\x04\x82\xa8\x2c\x11\x33\x6b\x89\xb8\x01\xb0\xbf\xf5\x74\x07\x39\x05" + "\xfa\xc6\x2e\x95\x11\x18\x18\x0c\xfc\x05\x21\xec\xa1\x60\x46\xf8\x6d\xf1\x31\x49\x75\x26" + "\xb0\x37\xef\x39\x5e\xa8\x3f\xaf\xf0\xa6\x49\x0f\xa0\xc1\xfa\xa2\x53\xbc", + 1, 3712 }, + { 128, 128, 19, "\xeb\x8b\x7d\x20\xf9\xa4\x3f\x58\x9e\xde\xd2\xf1\xc2\x92\x56\xd1", + "\xf0\x51\x82\x2f\x4d\x94\xe2\xad\x23\x25\x96\x45\xd3\xbe\x4a\x0f", + "\xe3\x6a\x67\x5c\xdc\x16\xb4\xc9\x91\x37\xd9\xb2\xa4\xab\xce\x29\xc1\x80\xf3\x99\x61\x4f" + "\xee\x43\x0b\xf5\xe4\x4c\x4c\xe3\x7a\x7f\x56\x9e\x67\xb0\xfe\x0b\x37\x08\xe3\x14\x2f\x59" + "\x86\xb9\xd6\x75\x56\x44\xe0\x23\x79\x5e\xcc\x9a\x66\x6b\x30\xcf\xd7\x8f\xd4\x1e\x6a\x73" + "\x91\x09\xcf\x25\x0b\x4a\x3e\x01\x3b\x2f\x50\xd9\xfe\x34\x13\xc8\xed\x82\x84\x85\x27\x19" + "\x5f\xef\xe0\x8a\x7e\x63\x12\x44\x7a\x35\xa1\xec\xee\x40\x46\xc7\x1b\x0e\x56\x4d\x10\x55" + "\x18\x10\x8d\x25\x19\xd0\xb9\x2c\x32\x39\xb1\x46\x25\xe8\x04\xef\x88\x31\xd3\x8f\x1e\xaa" + "\x51\xc2\x3d\x20\x71\x55\x45\xd5\xa0\xcc\x88\xc4\xd6\xba\xc6\x66\xc3\x95\x77\x4d\xff\xad" + "\xdf\xcd\x4c\x53\x7c\x8b\x85\x99\xa3\xf4\xe9\x5a\x00\x4e\x29\x41\x0b\x5a\x93\x85\xd0\xa0" + "\x7b\x2f\xf5\x7f\xb2\x9e\x77\xb3\x43\x7e\xa0\xe1\xb8\x74\xe4\x38\x16\x7d\x19\x68\x13\x7a" + "\x5e\x19\x10\xee\xa1\xcb\x39\x5f\xca\xa8\x66\x50\x5d\x65\x64\x7e\xf3\x5c\x98\xde\x10\xc7" + "\x7a\x42\xf6\xeb\x96\x78\x0e\x42\xf0\x5f\x76\x3f\x04\x55\x21\xb3\x26\xf6\x63\x70\x72\xf2" + "\x49\x2f\x82\x5c\x81\xfc\x96\x6f\x8c\x1e\x21\x8b\xe1\x1d\x60\xb4\x2f\x9b\xcc\x27\xfe\xd7" + "\x1f\x9f\x4b\x66\x9e\x76\x26\x03\xbc\x5f\x35\x2b\x53\xcf\x09\x83\xe8\x18\x2b\x65\x10\xe8" + "\xc4\x3c", + "\x56\xc5\xd5\x2e\x6a\xbe\x53\x6f\xe7\xa4\x8b\x07\xaa\xf3\x50\x83\xd6\x7a\xaa\x11\xec\x4f" + "\x92\xda\x0c\x9f\xb9\x08\xb7\xcf\xf4\x27\x17\xf8\x4b\x14\x31\x6c\x71\x0b\x56\x4c\xbf\x60" + "\x12\x3e\x76\x95\xc0\x2f\x63\xf4\xd2\x2e\x1e\x9e\xfb\x75\x8b\xb2\x14\x68\xfb\xa6\xbf\x0e" + "\xf5\xad\xae\x5f\xff\xe5\x7b\x18\x0e\x0c\x17\xa1\xd8\xf7\xf6\xd1\xcf\x6d\xa3\xac\x03\x5e" + "\x5c\xd3\x33\xa1\xf9\x09\x2f\xf5\x8b\xe2\xb6\x66\x37\x76\x2e\x13\xc2\x2a\xb0\xc2\xf2\x81" + "\xed\x0c\x8b\x2d\x1a\x32\x52\x61\x94\xf3\xcb\xaa\x74\x03\xda\x45\xe2\x49\xae\x97\xb6\xf1" + "\x8c\x5c\x8a\xf6\x1c\x66\xdb\xa9\xb7\xf0\x3b\xeb\x46\x33\x2f\x9d\x30\xf5\x49\xd6\xa1\x28" + "\xae\xc5\x4a\xc3\xf4\x19\xbf\x1c\xac\x68\x4b\xb5\x34\x70\x70\x44\x63\x98\x7f\x31\x9b\xf9" + "\x70\xc9\x88\x90\x05\xf2\x5a\x98\x96\xbe\xeb\x87\xd1\x8b\x1d\x2b\x19\x0e\xc9\x29\x89\xb7" + "\xd2\x65\x3e\x81\xe2\x6e\xb1\x61\xc8\x3f\x5d\xdd\x65\x13\x83\xdf\x09\x54\x7e\xd4\xd6\xd6" + "\xb7\xda\x79\xb0\x68\x29\x5a\x7c\x60\x7d\x93\x52\x1a\xe1\x9d\x9e\x95\xb7\xa4\x42\x24\x31" + "\x52\x3b\xee\x09\x02\x51\x4b\xa0\xab\x70\x9a\x79\x7e\x14\xbc\xbf\x9d\x6c\xb5\xcf\x67\x1e" + "\x85\x28\xc8\x3f\x6a\xac\xb0\x51\x35\xf9\x66\x4f\x4a\xc7\x8e\xcb\x53\x62\x10\x46\x87\xe4" + "\xe3\x3c\xa2\x8c\xad\x30\xb6\x90\xe8\x3b\x19\x19\x1a\xcd\x6a\x8c\x1b\x7e", + 1, 2304 }, + { 128, 128, 20, "\x1e\x69\xfd\x14\xca\x7f\x1b\xad\x99\x14\xac\x42\xf0\xb3\x27\x82", + "\x28\xda\xa5\x2b\xab\x92\xb4\xd3\x04\xc2\xa9\x6f\x89\x88\xf8\xd7", + "\x95\xc5\xbf\x47\x39\x9c\xfc\x40\xaa\xa0\xcb\x4e\xd5\xec\x9b\x52\xe2\xbc\xd0\xfe\x55\x91" + "\x66\x3a\x36\xd0\xb6\x69\xf3\x3d\x1e\xa4\x56\x16\x8d\x93\x0a\x33\x5f\xb0\xf3\xe5\x02\xb7" + "\x1a\x1b\x30\xd5\x9d\xec\xb0\xdd\xe9\xc6\xb4\x57\x6b\x35\x56\x1b\x3a\x30\xf0\x92\xa6\x96" + "\x33\x4d\xdc\xa5\xfe\xca\xad\xcc\xe7\x5a\xcc\x00\xb7\x35\x41\xc0\x63\x34\x75\xaa\x6f\x5c" + "\x6a\xaf\x82\x6d\x81\xa3\x41\x7d\x86\xb1\x5c\x6b\x77\x8b\xe9\x30\xcf\x05\xd5\xe1\x44\x6e" + "\xee\x09\x78\x22\xb3\x44\xda\xdd\x0e\x86\xdb\x5f\x35\x3e\xbf\x2f\x63\x77\xfa\x45\xe9\x15" + "\x1e\x2d\x02\x43\x3d\xa2\x4a\x8c\x88\x14\xd4\xa0\xb9\xdb\xbb\x0e\x93\xfb\xa1\x4d\xde\xd1" + "\xbe\x3c\xac\x9b\xc8\x10\xe5\xe6\x5d\x2a\x1d\xd5\xfa\x37\x20\xcb\x88\x9c\x9e\x4a\x81\x1b" + "\x38\x0d\x1a\xeb\x16\x66\x57\xdf\xe9\xa0\xbb\x0e\x30\x28\x63\x43", + "\x10\xad\x71\xf5\x54\x9f\xcd\x67\x3d\x23\x0f\xc5\xc2\x60\x69\x52\x04\x3a\x3e\x59\x8b\x6b" + "\x40\x8b\x64\x79\x0f\xec\x4a\x3d\x62\xe7\x48\x59\x02\x8a\x28\xd1\xad\xe2\x1d\x5f\x03\xcd" + "\x4f\x4d\x57\x86\x4f\x2c\x4e\x2a\x0e\x35\x7c\xab\x02\x27\x4b\x38\x89\x1d\xf0\xe5\xfd\x92" + "\xc8\xd4\x0f\x09\xef\x1e\x29\xd8\x50\x0b\x3f\x5e\xde\xaf\x07\x45\x25\x3a\x3a\x6c\x5b\x4a" + "\xc7\x69\x9d\x66\x33\xe5\xd2\x07\xb0\x04\xdd\xc4\xcd\x54\x4a\xaf\xd8\x0f\x55\x59\x38\x6f" + "\xaf\xba\x16\x27\xe7\xbb\xa2\x2d\xc1\x31\xbf\x16\xa3\x66\x8d\x39\x3f\xf1\xb5\xf3\x00\xfb" + "\x65\xc8\x71\xb1\x20\x2f\x21\x27\x87\xdf\xde\x77\x52\x02\x45\x9a\xf6\x9a\x5b\xc3\xe0\xcc" + "\x66\x72\xeb\xaf\xfc\xd3\xa0\x42\x8c\xf0\x35\xf8\xa6\x74\xf5\x9c\x5d\x03\x84\xeb\x1d\xc1" + "\x9d\xa2\x7d\x15\x4b\x13\x93\xf9\xff\x1f\xc7\xb1\x6a\x36\x97\x8f\x90\xb8\x81\x2c\xf0\x53" + "\x5f\xf4\x08\xe6\xe3\xbd\x17\x22\x49\x6e", + 1, 1536 }, + { 128, 128, 21, "\x66\x6b\xba\xcb\xcb\xe2\x6e\x2c\xdf\x2b\x42\x73\x00\x5e\x51\x32", + "\x6b\x26\x34\xfc\x87\xbd\xf7\x65\xe8\x2d\xf0\x67\x2d\xf3\x67\x60", + "\x50\x03\x5e\x36\xeb\xe4\xca\xc4\x0c\x72\x8b\x91\x50\xec\xc1\x1c\x00\xb0\xf4\xf1\xed\x2c" + "\xa0\x26\xe6\xb5\x28\xdc\x96\x83\x47\x0b\x44\x12\xb5\xc6\xdb\xd6\x41\x90\x4e\xec\xa3\xcc" + "\xb7\x48\x4c\x5f\x8c\x17\x3b\x17\xb4\x4d\xfa\xce\x7c\xdf\xc4\x2a\x29\xd8\x00\xf5\x0c\x36" + "\xea\xc2\x5f\x66\xde\xa7\x48\x73\x15\x90\x97\x11\xb7\x02\xaa\x69\xf8\x75\x56\x53\x21\xd2" + "\xce\x3f\x15\xec\xb5\x90\xd1\x82\x7c\x10\x11\x7e\x6f\x43\x3c\x7e\x4e\x07\x6f\xe6\x9f\x45" + "\x4c\x53\x31\x44\xb8\x1c\x14\xc6\x17\x0b\x48\xa6\x56\x53\x53\xbe\xfa\xaf\x98\xb8\x94\x94" + "\x66\x6c\x6b\x37\x33\x61\x84\xdb\x1b\x8d\xdc\x27\xea\xc9\xfc\xb0\x91\x6d\x5a\x56\x5a\x7c" + "\xee\xbb\x07\x50\xaf\xcb\xa5\xcb\x90\xeb\xaf\xe8\x9e\x8a\x7e\x82\xae\x5a\x0b\x55\x38\x00" + "\xd7\xe4\xd5\x11\x07\x79\x66\x07\x7a\xab\xc7\xfd\x5c\x09\x4c\xee\xd3\x81\xd6\x9c\xd8\x18" + "\x08\xd6\xe4\xe8\xe5\xb1\x41\x6f\x89\xa0\x2e\x86\x63\x57\xe5\x54\x43\x2e\xb7\x38\x5c\x8f" + "\x5e\xe5\x06\xf6\x27\x45\x63\xaf\x52\x1b\x11\x64\xef\xea\xa5\x52\x5d\xd8\x4e\x4e\xad\x52" + "\x25\xfa\x06\xda\x5e\x15\xee\x02\x23\x69\xd5\x85\x51\xff\x98\x48\xd3\x33\xc0\x3a\xaf\xff" + "\x18\xf6\xb5\xd2\x06\x89\x2a\xb6\x60\xb0\x11\xf1\x4a\x25\x7c\xc8\x8e\xb1\x11\x77\x7f\xd5" + "\xb0\xc4\x78\xba\xf8\x74\x52\x2c\xba\x34\x83\xd6\x9c\x0d\x6a\xa6\x35\x70\x0e\x02\x5a\x5d" + "\x39\x96\x32\x6a\x9a\x2d\x85\xd4\xce\xca\xe9\x26\x54\xe0\xd8\x9b\x90\x50\x27\xa7\x77\x9f" + "\xcf\x6f\x32\xac\x11\xda\xd0\x1a\x6b\xb4\x05\x12\x6a\x31\x41\x00\x37\xb7\xcd\xde\x4f\x7b" + "\xb7\xda\x2b\x11\xeb\xaf\xf6\xef\xc8\x80\x31\x87\xdc\x50\xfd\xb8\xec\x91\x32\xa8\x5b\x57" + "\xb9\x32\x4d\x1f\xc4\xc2\xde\x81\xf0\x3b\x75\xca\x61\x02\x51\xdb\xd7\xba\xed\x67\x71\x50" + "\xd3\x13\xf3\xcb\xd8\xc4\xc5\x0b\x17\x07\x45\x44\xd1\x3a\x99\x5a\x5e\x43\x78\x59", + "\x3d\xc8\xcf\xf6\x56\x7b\x3d\x8a\x5f\x9a\x8b\x7a\x36\xeb\xcb\x93\x1e\x6c\xd9\xd0\xb3\x6a" + "\x35\x45\xe4\x05\x98\x3b\x30\x6a\xd6\x1d\xe9\xca\x11\x57\x17\x50\x48\x45\x3c\x09\x71\x58" + "\x44\x0e\xfb\x24\x4b\xae\xb2\x05\xa0\x2f\x73\xae\x40\x1a\x7a\x6d\x61\x73\x5a\xe6\xc8\xa3" + "\x5a\xd6\x53\x4d\x2c\x23\xd6\x23\x9b\x36\x0a\xe4\x56\x5b\xf7\x1e\x7a\xd4\x34\xa5\x2b\xc6" + "\x3c\x35\x39\xe9\x72\xa1\x95\xd4\x92\xff\x7f\x50\x8a\x33\x74\x8f\xef\xbf\xb2\x59\x9d\x65" + "\x89\xf1\x46\x1c\xf9\xc6\x00\xc3\x1b\xf0\x92\xf9\xd6\x5b\x36\x02\x08\x68\x9a\xc8\x43\x4c" + "\xa6\xee\xd1\x13\x9b\x57\x9c\xbe\x1c\x19\x01\xac\x83\x58\x90\x0f\x4e\x72\xca\x9e\x7f\xfc" + "\x19\x3c\xcb\x53\x13\x2f\xd9\x06\x3c\x8f\x02\xb3\x16\x56\x30\xe1\x1a\x83\x91\x9f\xb2\x23" + "\xbd\x65\xbc\x46\xa6\x14\xaa\xae\x7f\xf5\x9f\x3d\xba\x09\x54\x88\xae\x00\x7f\xf7\x36\x5b" + "\x4d\x86\x77\x32\x11\xb8\x29\x3f\xed\x60\xcb\xa8\xf6\x74\x03\x6c\x66\xd3\x2a\x13\x91\x98" + "\x26\x04\x32\x61\xb6\xbe\x46\x01\x2a\x85\x77\x76\xc5\x0d\xca\x95\x6d\x27\x55\x8c\xa0\xe7" + "\x6c\x31\x03\xcb\x8e\x06\xe9\x3f\xf1\xdf\x0f\xcc\x23\x79\xd0\x96\xdd\xa5\x98\x0a\xb4\x5a" + "\xd2\x9d\xc7\x79\x51\x03\x74\x28\x27\x22\xdd\x9b\x25\xdc\xbe\x20\x3c\x74\x47\x0b\xb7\x79" + "\x4c\x2d\xbc\x37\x47\x9c\xa6\xbd\xeb\x87\x6d\x65\xf2\xe9\x4a\xf8\xdf\x18\xf3\x0d\xfe\x23" + "\x82\x21\x32\x8f\x29\x7f\x22\x43\x99\x2e\x88\x85\x5e\x83\x49\x05\x00\x6e\xd8\xf5\x94\x75" + "\x59\x34\x30\x58\xae\x21\x35\x55\xab\x02\x2e\x98\xa4\x8a\xe6\x92\xe4\x7d\x8b\xba\xeb\x94" + "\xab\x0d\x55\x8a\xf5\x05\xae\xd6\x70\x12\x54\xe5\xa6\xeb\x38\xa0\xe2\xbf\x10\x2c\xcb\x61" + "\x6c\x9b\x58\xe0\x3e\x53\xe2\x76\xd4\x4c\xc7\x0d\x12\x4c\xf0\x2f\xf9\x07\x97\x82\xe7\x20" + "\x0a\x09\xd5\xe1\x0b\xdb\xc8\xf7\xbe\x78\x06\x28\xd3\xe4\x27\x3c\x17\x94\x45\x19\xdb\x7d" + "\x5a\x73\x4f\xea\x10\x8e\x29\xe4\xf2\x20\x99\x8e\x0d\x51", + 1, 3328 }, + { 128, 128, 22, "\x57\x08\x26\xef\x18\x8e\x84\x50\x5f\x30\x24\x7e\x3f\x43\x85\xae", + "\x60\xf6\x70\x1b\x64\x23\x9e\x82\xf6\x3c\x4e\xc9\x20\xb6\xce\xe4", + "\x94\xd4\x02\x1b\xec\x59\xc2\xbb\xf6\x26\x0f\xa9\xab\x83\x79\x55\x1b\x8b\x1a\x41\x4f\xf1" + "\xac\x22\x85\xde\xc8\xda\x41\x7d\xa3\x65\x3b\x51\x36\xda\x9c\xff\x1a\xd2\x93\xcf\x88\x75" + "\xaf\x1c\x90\x9a\xf9\xe9\x95\x00\xc1\xc9\x0f\xa3\x47\xfc\x41\x61\x03\xa2\x02\x35\x76\xf6" + "\x3b\x3f\xf2\x5f\xa0\x2b\xf8\x72\x8a\xe1\x29\xf5\xd9\x10\xa7\xad\xf6\x13\x64\xac\xe3\x17" + "\x51\xb7\x93\xfc\x4d\x0b\x87\xad\x43\xf3\xa3\x24\xa5\xca\x16\x24\xfa\x11\xfb\xdb\x94\x54" + "\xda\xf6\x0b\x73\x32\xe3\x0f\x83\xff\xed\x1e\x3b\xe9\x01\x4c\xca\x4d\x31\x89\x2a\xdf\xd2" + "\x47\xaf\x95\x0f\xb2\x6f\xdd\x9b\xc3\xda\x29\x08\x8b\x49\xcf\x53\xc4\xd6\x24\x94\x2d\xfc" + "\xf9\xf5\xf1\x92\x35\x48", + "\x64\xf1\xda\x6b\x99\x7a\x1f\xba\x0d\x84\x64\xf2\x26\x26\x00\x7b\xd0\x93\xe8\x03\xd5\xad" + "\xc3\xa8\xff\x0a\x28\x47\xbd\xbd\x0f\x21\x2f\xda\xb7\x2a\x50\x75\x69\x13\x17\xc1\xbc\xda" + "\xc1\x4d\x40\x3b\x30\x25\x67\x48\xe3\xab\x4f\x46\x44\x37\x2f\x14\xaf\x08\xe9\x66\xce\x3b" + "\xdc\x7b\xf3\xf9\xac\x2a\xaa\x1c\xf0\x31\x70\x89\x7b\x25\x9b\xdd\xd2\x5d\x24\x83\x82\x0d" + "\x48\x66\xef\x82\xc9\x23\x75\x8e\xaf\x76\xec\x7d\x7b\xcd\xab\xfe\xf3\x64\x89\xf3\x23\xcf" + "\xa5\x89\x05\x3c\x87\x9e\x01\x4e\x48\xb5\x74\xcc\xa6\xf9\x41\x24\x36\x50\x8c\x57\x69\x71" + "\xbb\xdb\x6f\x9c\x8f\xb9\xd5\xa7\xdf\xac\x01\x51\x66\xda\x3b\x25\x62\x03\xd3\xc2\xec\x8c" + "\x15\x2e\x2f\x0b\x20\xbc\xb2\x44\xfc\x1c\x69\x23\xfb\x2f\xbe\x55\xf1\x08\x0f\xfe\xa7" + "\xef", + 1, 1280 }, + { 128, 128, 23, "\xc6\x17\xae\x85\xa7\x7a\xc3\xf0\xdc\x29\xca\x6f\xcb\x82\x31\x26", + "\x59\x20\x3e\x5e\x7f\x7a\xa8\x24\x4d\x27\xbc\x5c\x13\x4a\xbe\xbb", + "\xc7\x56\x86\xf2\x2f\x10\xbd\xa9\x65\x65\x14\xd5\x9b\x81\xd1\x9b\xe7\x71\x93\x97\x15\x17" + "\x62\x2b\x92\xf1\x19\x67\x78\x98\x93\xd5\xaa\xd9\x01\x83\x2c\xa9\x33\x9a\x0f\x18\xab\x92" + "\x89\x37\x51\x69\xf3\x0e\x97\xd7\x92\xc1\x74\x49\xd3\x80\x4e\x74\x5f\x76\x5b\x7c\x0c\xe4" + "\x0a\x2c\x84\x51\x13\x80\x76\xc5\x3d\x21\xaf\x7e\x7c\x6c\xac\x53\xd8\xa6\xb9\xdf\xcc\x27" + "\x1a\x50\xf6\x3a\x11\x2b\xc1\x0f\xb9\xcc\xd7\x51\x23\x1a\x9f\xbf\x58\xfc\xda\x8f\xb9\x25" + "\x2b\xb5\xa4\x1e\xdc\x76\x0d\x57\x8a\x81\x43\x63\x8a\xd3\xac\x02\xe9\xe9\x62\x09\xa8\x13" + "\x0d\x48\xce\xa0\x6e\x69\x51\xcb\xd1\x4a\x14\xc9", + "\x65\x80\xda\x16\xb2\x84\x42\x2e\xdf\x75\x10\xe8\x14\x16\xf5\x36\x23\xf8\x90\x97\x04\xd5" + "\x4b\xee\x26\x5a\x38\xfa\x59\xe4\xed\xbb\xf2\x6c\xb2\xbb\x0d\x10\x8e\x88\x1e\xd1\xfa\xcc" + "\xc8\xe2\x3c\xb4\x9c\xf7\x71\x35\x26\x37\xc1\x55\xf6\x24\x46\x1a\x7e\x0d\x82\xc9\x39\x7c" + "\x1b\xf7\x15\x3a\x9f\x9e\xe8\x2d\x54\xe2\xf0\xd4\xaf\x01\xce\xb0\xef\x40\x98\x0c\x5c\x3b" + "\x19\xef\x9c\x8c\x26\x49\x63\x7c\x87\x9f\x48\xc8\xf4\xdc\x9f\xf9\x25\x61\xd5\x7a\xf8\x11" + "\xdd\xde\xc1\x99\x10\xe6\x8b\xdf\xaf\xc6\x6c\xce\x09\xd9\x9d\xec\x97\x06\x1e\x7d\x5e\x13" + "\x2b\xff\x88\x20\xed\xa2\x87\xe1\x58\x4b\xfa\xba\xeb\x9a\x89\x13\x5c\xba\x3e\xef\x52\x1b" + "\xe0\xfb\xa9\x74\xf7\x09", + 1, 1152 }, + { 128, 128, 24, "\xd9\x57\xd6\xc3\xa8\xe2\x32\x83\x3a\xc4\x88\x33\xce\x67\xcc\x43", + "\xdb\x75\x4e\x4a\xde\xfa\xa9\xa0\x90\x5e\x72\xf4\xf3\x3c\x65\x96", + "\x86\x89\x63\xfc\xff\xf3\x7f\x82\x5b\xba\xd9\x47\xcc\x1f\x87\xcd\x8d\xde\xe9\xa1\xec\x7d" + "\x29\x9e\xa8\x0d\x74\xbe\x28\xe8\x41\x4b\x8d\x0f\x82\x2d\x86\x5e\x5f\x92\x03\xfc\x9b\xf3" + "\xc8\x85\xdc\x07\x9b\x9d\xc8\xf6\xe9\x69\x4d\x63\x66\x2e\x4c\x11\xdd\x37\xff\xfc\x14\xd9" + "\xd8\xf4\xd4\x27\xc5\xa5\x32\xc7\x73\x88\x89\xc5\x31\xc8\xcb\x89\xc7\x20\xed\x68\xfe\xf2" + "\x9c\x63\xd0\x94\x8b\x64\x1f\x4c\xae\x1a\xce\x36\x5d\x62\x50\x08\xb2\x1b\xf0\x2f\x00\x9d" + "\xf0\x7b\x7e\x97\xd9\x80\xfb\x34\xa5\xca\x2c\xd3\x8d\xe3\x1d\x41\xf3\x55\x6b\xb2\x66\x2b" + "\xf3\x4a\x3e\x09\x5a\xbd\xe1\x03\xa6\x60\x7f\xaf\xa1\xdd\x1f\x99\xd5\xbe\xda\xc9\x3b\xab" + "\xa9\xe1\xd5\xf4\xcf\x85\x3d\x49\xf8\x49\x49\xb3\xcd\x18\x5d\x19\x8a\xaf\xc7\x2f\x79\x7b" + "\xf6\x90\xde\x58\xc2\xb5\x74\x63\x43\x41\xb6\x94\x2f\xd6\xec\xb2\x28\x15\xa4\xd1\x31\xc6" + "\xec\x98\xd2\xba\x09\xa7\xd4\x9e\x4f\x37\xe8\x6a\x96\x46\xe0\xa5\x8d\x42\xdc\xc7\x0d\xe8" + "\x52\x60\xc6\x87\x69\x7e\x41\xfc\x3f\x96\xcb\xfe\x42\x53\xa2\x00\xcf\xbe\x92\xaa\x74\xc7" + "\x1a\xa8\xea\x49\xb2\x10\x0a\xf2\x1a\xa0\x07\xfe\xbe\x77\x7d\xdb\xcd\x9d\xee\xb6\xbd\x94" + "\xb7\xae\xd5\x2e\x82\x24\x2d\x60\xa7\xc3\x37\xad\xf8\xfe\x4b\x40\xcd\xe3\x00\x22\xbd\x93" + "\xa3\x27\x1a\xd3\x06\x94\x98\x4f\x1e\x7b\x7c\x80\xd7\x5a\x51\xda\x80\x7c\xdf\x96\x07\x95" + "\x47\x64\x5d\x7a\xa8\x6b\x59\x72\x77\x2f\x30\xa0\x35\xaf\x56\x20\xe3\x6a\x67\x35\x4b\x8b" + "\xad\x5b\x94\xed\xf4\x16\x84\x99\xe1\xaa\x0e\x7d\xee\x0d\xe4\x24\x43\xf6\xdd\x33\x54\xf6" + "\x01\x4d\x65\x6c\x53\xff\xaf\x94\xf3\x09\x2d\x76\x55\x55\x6d\xed\x34\xb5\xde\xf3\x24\xf6" + "\x2d\x86\x32\xab\xab\xdd\x91\x66\xdc\xa9\x36\xe9\xf7\x87\x4a\x9a\xc6\x71\x78\x1b\x48\x98" + "\xfa\x93\x33\xc9", + "\xfe\x1e\x71\x13\x30\x61\x89\x90\xb7\xd2\xec\x2b\x2c\x5f\xfd\xba\x0b\x6c\x92\x00\xd8\xff" + "\xde\xf0\x5d\xf0\xd8\x02\xa4\x5b\x2c\x3d\x99\x35\xbf\x59\xa6\xfb\x39\x5a\x9a\x99\xa9\x9a" + "\xf2\x2f\x5a\xe4\x2d\xa5\x42\x1c\x7d\x7b\xfa\xa1\x49\x89\xbc\x2f\x5f\x4b\x69\xc1\xee\x02" + "\xb9\xfb\x62\x0e\x8a\x4e\xd7\xb3\x97\xe8\x0d\xf3\x50\x4b\x9e\xfe\x60\xe5\x06\x43\x0e\xae" + "\xcb\x1a\x4a\x42\xea\x73\x96\x66\xe6\xbe\x23\x7e\x9a\x64\xa3\x01\x0a\xb9\x96\x19\x4b\x7b" + "\x42\x6e\xb1\xa4\x4c\x12\x03\x1a\x89\x2c\x0a\xe3\x8d\x6a\x0b\xc9\x84\xeb\x89\x31\xb1\xb8" + "\xfb\x56\x28\xec\x57\xf3\x68\x04\x15\x8a\x4f\xc9\x4a\x08\xa9\x1e\x6c\xc7\x20\xd1\x12\x35" + "\x53\x07\xbf\xe1\x40\x10\x1f\xea\x88\xc5\xb3\x2e\xd8\xf7\xda\x52\xc4\xf4\x82\x65\x60\xdd" + "\xc6\x7f\x62\x99\x88\x50\x10\xc1\x8f\x43\xb1\x64\xdb\x70\x7c\xc2\xcf\xa5\x41\x55\x32\x34" + "\x25\x8c\xcc\xce\xd5\xc4\xd9\x17\x84\x39\xd7\x04\xc7\xf2\xc6\x4c\x50\x9f\x1c\x40\xd5\x7e" + "\xe7\x6f\x6b\xd4\x57\xe8\xdd\x2d\x7c\x57\x86\xc7\xd6\x4d\x6e\x89\x1a\xa4\xd2\x4a\x1a\x39" + "\xfc\x9b\xc9\x5f\x8d\xa8\x56\x46\x92\xb9\x3f\xd1\x79\xfb\x51\x8f\xe2\x51\x03\x3d\x60\x85" + "\x30\xe3\x3e\x5d\x52\x51\xf0\xfa\xe7\x8d\x1c\xcf\xb8\xfb\xdb\xba\x17\x45\xa3\x55\x9e\x39" + "\xaa\xf3\x2f\xbf\xee\x8c\x08\xa6\x9b\xce\x54\xb5\x54\x00\x8f\xcd\x95\x37\x4b\xae\xbb\xe8" + "\xf2\x6f\x1a\x08\x74\xe6\xf4\x7c\x71\x73\x9a\x64\xb5\x5f\x1f\x28\x40\x10\x17\x39\x78\xe8" + "\xc0\x4b\xe7\x2a\x71\xa7\x4e\xa3\x8c\x9e\x30\x2c\xdb\x8f\x0f\xba\x98\x77\xb9\x96\xb8\x8b" + "\x5e\x32\xda\x92\xd1\xe8\xa8\x31\x57\x9f\xe1\x77\x96\x2e\x54\x11\x34\x43\x56\xfd\x29\x48" + "\xaf\x3a\xdb\xcf\xf3\x58\xdb\x02\x4b\xa1\x13\x94\x8c\x2f\xc6\x4c\x1b\xd9\x1c\x11\xbd\xcd" + "\x21\xdf\xaa\x32\xfb\xee\x9c\x72\xfc\xa0\x56\x2a\x89\xa4\xdb\x46\x52\x4d\x34\xc4", + 1, 3200 }, + { 128, 128, 25, "\x66\x96\x4f\x8f\x9b\xa4\x24\x9c\xa0\x24\x0e\xdb\x0a\xaa\xef\xe2", + "\x78\x5a\x3e\xe0\x66\x48\x43\x07\xa2\xad\x18\xec\x7c\x9c\x8f\x4a", + "\x08\x44\x02\x22\xe7\x65\x3c\x4c\x16\x33\xa6\xa1\x8d\xac\x02\x04\x8d\x8e\x66\x0f\xc2\x4e" + "\xbf\x53\x6c\x61\xbe\x10\x7d\x59\xb6\x0f\xd0\xb1\xe5\x3b\x90\x75\x74\xfd\x71\xcf\x29\x1c" + "\x84\xd8\xa7\x14\x63\xd6\x8e\xd3\x22\xa8\xe1\xca\x28\xea\xb1\x87\x37\x63\x01\xb1", + "\x48\x73\xae\x1d\xab\x98\x42\x05\x7f\x53\xb2\x2b\x15\x11\x93\x01\x40\xce\xb2\xa6\xf4\x71" + "\x7b\x64\xd6\xb8\xf7\x87\xc2\x18\xaa\x5a\xfc\x3c\x75\x89\x09\x08\xca\x1a\x39\xa3\x57\x51" + "\xea\xdf\x5d\xf3\xcd\x89\x89\x61\x92\x73\xc4\x41\x55\xe3\x21\xd9\xc4\xd1\x02\x05\xca\xaa" + "\x5f\x89\x19\x61\xb4\xde\xef\xa6\x16\xe4\xf5\x69\xa3\x38", + 1, 512 }, + { 128, 128, 26, "\x51\xe7\x1e\xae\x30\xd1\x3e\x2e\x38\x87\x7b\xe2\xb9\x26\xfc\x8c", + "\x94\x57\x44\x51\x75\xd6\xb7\x70\x34\xcc\x9c\x64\x05\x3f\xe5\x18", + "\x35\xe7\xa4\x7e\x7f\x27\x81\x91\x07\xde\x29\x75\x1c\xcf\x84\x24\xdf\xea\x59\x8d\xb2\x9b" + "\x5e\x2b\x20\x1d\x7c\x23\x55\x22\x3e\x21\x4c\x6d\x47\x59\x31\x0a\x92\x8b\x00\x9b\x8a\x2a" + "\x07\x2c\xa3\x1d", + "\x8c\x9f\xfd\x00\xf0\x97\xb2\xc3\x0b\xdf\x1f\x49\xcc\x64\x00\x22\xed\x1a\xfb\x2f\xab\x45" + "\xf4\x46\x3e\xf7\xfd\x39\xbe\x0c\x5b\x30\x40\x75\x3f\x57\x8f\x64\x43\xc3\x2c\xcd\xcf\x8f" + "\x2d\xe2\x57\x2c\xd8\x24\x95\xcd\x88\x67\xee\x3e\x46\xd1\x7c\xe6\x21\x13\x40\x11", + 1, 384 }, + { 128, 128, 27, "\x91\x88\x58\x06\x3b\x1b\x0f\xc8\x20\x7c\xf8\xbc\x5f\xdc\x07\x3d", + "\x18\x0f\xdc\x55\x61\x4d\x37\x44\x9e\x60\x18\x0c\x24\xa0\x61\x3e", + "\xdf\x93\xb5\x13\x28\x23\xeb\x8f\xa3\xce\x47\xa1\x04\xd6\xc8\x37\x0e\xba\x95\x3c\xa2\x7e" + "\xb4\x00\x98\x93\xdf\x43\x74\x80\xcf\xa8\xe9\xf2\x02\x04\xfa\x03\xa3\xc9\x08\x2c\x24\xeb" + "\x2f\x56\x2a\x74\x1a\x2f\xcb\xbd\x13\xc5\xab\x74\x2f\x1b\x57\x65\x01\x83\x11\x3e\xc7\x91" + "\xec\x76\xcb\x70\x65\x08\x13\xad\xef\x86\xef\xc8\xca\xc2\x5c\xf0\x13\x1a\x77\x2e\xb5\x47" + "\xd7\xe2\x27\x24\x79\x43\xd0\xfc\x45\x26\xee\x0d\x18\xb0\xa8\xc9\xbb\xc8\x21\xed\x30\x2d" + "\x61\x13\xe9\x57\x7e\x17\x92\x9d\x36\x25\x04\xf6\xb6\xe7\x70\x9b\xe4\x98\x65\x8e\x4c\x30" + "\xb8\x32\x54\x90\xcc\x77\x58\x65\xac\x6e\x06\xcd\xb4\x21\xb4\x90\x74\x62\x50\x3e\xff\x96" + "\xc0\x46\xcb\x8e\x86\x87\xa9\xa5\x96\xaa\x61\x2b\xaa\x21\xb1\xd5\x31\xa3\xec\xec\xd4\xb2" + "\x52\x83\xbf\xbb\xd3\xf2\x79\x9c\x69\x6b\x41\x68\xa4\xd3\x1c\xbc", + "\x21\x93\x30\xe9\x81\x5a\x69\x38\x32\x67\x42\x65\x41\x0e\xe3\x89\xdb\xfb\xc4\x99\xa8\x19" + "\x0c\x78\x1a\xa0\x4d\x52\xd2\x0a\xf8\x38\xcf\x8d\xff\x09\xdf\x27\x59\x25\x6c\xbf\x4d\x29" + "\xc3\xf7\x17\x97\xf9\x52\xf5\x96\x84\x92\xe4\x1b\x4f\xa2\xbe\x7a\x47\x9a\xa1\xc3\xba\x5a" + "\xbd\xb9\x01\xfa\x9b\x57\x35\xe6\xf0\x19\xc0\xa7\xad\x22\x39\x58\x78\x73\xc7\xc0\x01\xa6" + "\x49\x0b\x2b\xcc\xff\x77\xac\x93\xfa\x8f\x1f\xc7\xc1\x2f\xf3\xbf\xd9\xe9\x30\x9d\x95\x42" + "\xa3\x09\x04\x2f\xe6\xc4\x9c\x13\xad\x06\x17\xe8\x4e\x4c\x60\x7c\x82\xe6\x91\x05\xbd\x85" + "\x37\xc6\xb5\xf0\x7a\x5c\x87\xe8\x61\xe0\xa1\xa6\xe1\x04\x50\x56\x0a\x4e\x50\xbc\x7d\x29" + "\x9c\x53\xef\xeb\x0b\x46\xd0\x2d\x39\x89\x99\x60\x8a\xb8\xbb\xb5\x1e\xa8\xe6\x0d\xb6\x6f" + "\x84\x49\x62\x2e\x2b\xeb\x53\x60\x02\xb5\x41\x6e\xb3\x19\xf2\x9a\xf5\x50\x92\x78\xc6\x94" + "\x1e\xec\xbb\x89\x01\x19\xf3\x5c\xd3\x21", + 1, 1536 }, + { 128, 128, 28, "\x57\x22\x7f\x8b\xbc\x1a\xd7\x8d\xed\x0b\x5a\x3c\x4c\x84\x31\x0f", + "\x95\x53\xc9\x2c\xea\x37\x00\xde\x74\x46\x2b\x41\xf6\x78\x72\xc2", + "\x13\xed\x14\x1c\x52\xd6\x98\x76\x25\x5c\x4e\xb1\x58\x31\x15\x44\x23\x34\xaa\x79\x50\x52" + "\xdb\x60\x28\x34\x38\xa1\xb2\xaa\x18\x3d\x36\xea\xfd\x3f\xf7\x2c\xdc\x8b\x4d\x77\x4c\x9c" + "\x62\xff\xb1\x91\x96\x2a\xaf\xc9\xf8\xda\xdf\x7e\x8c\xaa\x7f\xb6\xf8\xa4\x3a\x1b\x30\x2e" + "\x32\x1c\x77\xab\xcd\x79\x6f\x1e\xda\x9d\x1a\x5b\xb4\x69\x7a\x1c\x4b\xd3\x13\x34\x86\x36" + "\xa1\x7b\x1f\x5f\x74\xf5\x9e\xc9\x44\x18\xaa\xe1\x08\xeb\xfc\xc5\x17\x7e\x79\x89\x9c\xfd" + "\x71\xf1\x01\x16\x7b\xf0\x09\x37\x3a\x84\x05\x35\xda\x36\x96\x5d\x1d\xa7\x9e\xf4\xf0\xde" + "\x43\xbd\xf4\xa3\x60\xe0\x2f\xf2\x4c\x77\x5a\x10\xa9\x64\x10\x78\x6a\x00\x08\x21\x70\xcc" + "\xc5\x3a\x4d\xd4\x27\xfd\x5f\xee\xf0\xc1\x61\x21\xb5\xed\x00\x8e\x63\x92\x38\x39\x47\x8e" + "\xc9\x04\x05\x6e\xd9\x58\xbd\x01\xac\x6c\xa7\x78\xfc\xda\xee\x6e\x5f\xd1\x9b\xae\x0b\x3a" + "\xf3\xd8\xcb\xf5\x35\xa5\xc7\x65\x9b\x69\xd3\xc0\xf8\xd3\xc6\xc2\xd1\xca\x2a\x32\x67\xd0" + "\xa1\x88\xbf\xb5\xca\x5b\xb9\xe1\xfb\x57\x91\xd5\xa4\x76\x83\x94\xe3\x49\x41\x13\x02\xc6" + "\xa9\x2d\x5e\xe1\x5a\xb7\x84\x48\x35\xc8\x65\x4f\xa4\x24\x9c\xc1\x60\xb6\xf4\xa4\x82\xf6" + "\x30\xb1\x0d\xd4\x8d\x5a\x60\xff\xd0\xb0\x25\xd2\x53\x24\xb8\x27\xff\x75\x2d\xfc\x4e\xfa" + "\xcf\x94\x89\x39\x52\xeb\x79\xdb\x4e\x1e\x98\x45\x50\xe4\x9c\xda\x78\xea\x5b\x34\x02\x16" + "\x96\x59\xaa\x61\xd8\x3a\xba\x0e\x75\x1b\x5e\xfb\xc7\x8b\x4f\x73\x44\xd6\xdd\xbf\x63\xe3" + "\xb4\x9b\x88\xc3\x34\x53\x8a\x55\x60\x08\x1d\x95\x9e\xb6\x1a\x92\x48\x05\xba\x5f\x1c\xe4" + "\x21\x4f\x35\x85\xb4\x88\x02\xef\x53\x9d\x09\x7b\xd9\xf1\x61\x5c\x38\x1d\x3d\xe3\x35\x38" + "\x00\x88\x2b\xe0\x54\xbd\x02\xa1\x62\x28\x70\xc6\x5b\xce\x55\x89\x18\xf3\x16\xf7\x56\x62" + "\x9d\xa1\x1f\xdd\x9c\x26\xc3\xd6\x66\x08\x4d\x3d\x88\x2a\xce\x32\xd5\x82\x0b\xc8\x24\xf3" + "\x45\x4d\xa4\xa1\x70\x72\x35\xb7\xb5\x08\x80\xcf\xdc\x6a\x8e\x26\xd0\x48\xeb\xaa\x80\xa6" + "\x70\xc3\x57\xd9\x93\x2b\xbd\x0e", + "\x22\xcd\x43\x71\x2e\x6c\xd7\xa4\xb7\xf0\x66\xf7\x20\x29\x9c\xc8\x96\x04\x58\xcd\x8b\xdb" + "\x36\x73\x14\xf4\x0b\xf4\x7d\xcc\x87\xc3\x45\x51\x9b\x40\x5d\x9f\x2a\xe9\x50\x6e\x38\x4c" + "\x02\x44\xf3\xf6\xa4\x02\xc0\x3f\xaa\xed\x67\x38\x34\x16\x9e\x71\x90\x73\xe3\x8c\x0a\x70" + "\x9e\x94\xcf\x5d\xe9\x7e\xde\xa4\xf9\x79\x79\xe3\x02\x24\x6e\x59\x7d\x0f\xf3\x78\xd8\xcd" + "\x29\x26\x06\x10\xe8\xd2\x55\xf2\xc9\xd7\x21\x19\x0e\xc5\x40\xe4\xfa\x5c\xcc\x2c\x46\xec" + "\x35\x8c\xd4\x21\x7b\x3e\x31\x40\x18\xd8\xcc\x16\xa2\x14\xea\x1d\x0e\x2a\x2b\x71\xf8\xab" + "\x4a\x23\x67\x66\xe1\xfb\xaa\x1b\x6c\xb1\xfc\x1f\x76\xb2\xb1\x2d\x57\xc5\x6a\x89\x88\xde" + "\xf7\xc8\x6e\x60\x11\xb2\x45\x59\xc7\xd5\x1d\x6a\x0e\x47\xe3\xa7\x42\xdc\x15\x45\x64\xcb" + "\xc9\x20\x66\xba\x52\x9f\xb1\x66\x4a\xe5\x16\x6e\x92\xe7\x1f\x9e\xcd\x3a\x8a\xf7\xbd\x51" + "\xdc\xe7\xc7\x3b\x10\x4d\x1e\x1e\xde\x47\x2b\x36\x57\xb6\xb3\x2b\xd4\x78\x4a\xec\xa9\xb5" + "\x32\x6a\x80\xbb\x96\x58\x07\x35\xa9\x76\x74\xf8\x5b\x2a\xbd\x69\x3e\x4c\x9a\x26\x23\x35" + "\x0a\xe1\xa6\x43\xcb\xe1\x68\x07\x37\x9b\x5a\xa7\x28\x0a\xbb\xdd\x2f\x34\x20\xee\x64\xc4" + "\x5c\x5e\x3b\x69\x70\x58\x7d\x7b\x26\xda\x3d\x9b\x77\x0a\xcb\xad\xfe\xd6\xcb\xe6\x7f\x2b" + "\x95\x89\xdb\x17\xda\xe5\xa5\xd6\x4b\xd4\x0a\xf7\xa4\x4a\x17\xa1\x3f\x06\xa8\xe3\x2e\x5d" + "\x2e\xa9\x0c\x29\x4e\xbe\x7a\x52\x9a\x38\x9c\xc7\x5e\x44\x7b\xe8\xf1\x26\x0d\x74\x3d\x1a" + "\x88\x09\x10\x0a\xb7\x4c\x59\xb0\x55\x3d\x12\x65\xb6\x18\x07\xae\xd2\x5d\x49\x31\x1b\x2f" + "\xa7\xad\x49\x02\xfb\xc4\xa7\xc5\xab\x43\x75\x08\x41\xcd\xa7\xf2\xf6\xf0\xe6\xe1\x9a\xde" + "\xfd\x58\xb4\x15\x94\x13\x8a\xb0\x36\xb8\xe6\x4e\x18\x3c\x22\x1d\x40\xec\x79\x90\xfb\x25" + "\xb6\xb5\x0c\xac\xa5\x96\x78\xf0\x0a\xeb\xc1\x8b\xfb\x7b\xb3\x9e\x96\xd4\x47\x15\x94\xc4" + "\x94\xac\x54\x0b\x5f\xff\x31\xfc\xf7\x3e\xbb\x99\xe3\x3c\x15\xed\x51\xe1\xc2\x42\x20\x83" + "\x36\x45\xc2\xad\xf0\xdb\x63\x23\xc1\x78\xf2\x38\x33\xeb\x7b\x6b\x82\xaa\x6d\x0c\xf9\xb5" + "\x2b\x59", + 1, 3584 }, + { 128, 128, 29, "\x3a\x95\xb8\x71\x86\x18\x6e\x1b\x51\xb0\xc9\x19\x28\xe8\x2c\x25", + "\x1a\x75\x0e\xea\x95\x6d\xea\xef\xf5\x74\xdb\x03\x83\x68\xba\x00", + "\x79\xd2\x88\x9c\xe6\x58\x44\xfa\x9a\x04\xc4\x82\x02\x86\xb1\x1d\x4b\x80\xf2\x38\x01\x77" + "\x9f\xb7\x38\x8a\xb5\xae\x85\x83\x2f\x5e\x71\x72\xe6\x3d\x2e\xb7\xe1\x4f\x2c\x62\x95\x75" + "\x13\x85\xd6\xb5\x80\x95\xbd\x13\xc2\xe9\x20\x88\xc6\x9b\xaa\x82\x45\xe4\x74\xef\xa0\x8f" + "\xab\x3b\x59\x38\x71\x3f\x52\x81\xd8\xa6\x9b\x69\x3c\x01\xcf\xa2\xc3\x03\x90\x2f\x3b\x17" + "\x19\x9d\xd2\x89\x5b\xf4\x6e\x20\x27\x31\xdd\xc5\x18\x42\x8f\xbd\x7f\x62\xcc\x19\xbd\x83" + "\x10\x60\x67\x97\xfa\x9c\xac\xe9\x2a\xa9\x81\x20\xbb\x8a\xbe\x06\xb3\xac\xfd\x80\x64\x62" + "\xca\x75\x73\x1a\x00\x8c\x97\x37\x99\x08\x11\x74\x0c\x36\x20\x17\x01\xf9\xda\x18\x25\x41" + "\xdb\xd1\xbf\x12\x48\x45\x1c\x1a\x1a\xb6\x74\xdf\xbe\xfb\xfd\x8b\x4a\xc7\xd7\x3a\x6a\xc2" + "\x28\x25\xd2\x07\x50\xef\xd8\xb8\x1f\xf2\x73\x28\xfb\x96\x28\x51\x61\xd5\x9b\x25\x1c\x66" + "\x1b\xec\x48\xc9\xec\xf4\x96\x65\x0a\xc6\x50\xe9\xcb\x56\xf3\x79\x3a\x09\xbf\xb3\x68\x06" + "\xde\xfd\x76\xd3\x4c\x2c\x80\xee\xc2\x68\x62\xef\x8d\x84\x7f\xd5\x3a\x42\x52\xfe\x8d\x63" + "\xfe\x07\xd7\x2a\x86\xe6\xf4\x38\x19\xa4\xdf\x10\x46\xbd\x67\x1e\x4f\xd2\xe8\x5b\x48\xa2" + "\xa4\x8f\x3d\x5f\xab\xc9\xc8\xc6\xcf\x70\x6b\xad\x6a\x85\x13\x75\xf8\xb2\x52\xf9\x0e\xf4" + "\xe3\xca\x9f\x30\xe3\xe7\x9d\x70\x7a\x92\x8a\x6e\x62\x53\x34\xa0\x92\x45\x20\xaf\xfe\x4e" + "\xde\xa9\x6a\x37\xb3\xc8\xd5\x5d\x65\xb2\x0d\x8e\x6f\x8d\xfe\xfa\x9c\xca\x7c\xa1\x21\x8a" + "\xa9\x73\x1c\x75\x94\x34\x92\xad\x68\x6e\xc6\xa6\xa0\x47\x92\xd5\x0a\x57\x1c\x0f\x92\x99" + "\x17\x3b\x58\x8a\xf2\x0b\x04\xa7\x14\xb4\xf0\x99\x5b\x28\x4b\x72\x7b\xe9\x3b\x57\x65\xf9" + "\x8a\xde\x0c\xb4\xcc\x5d\x1d\xf3\x14\x6f\xca\xc6\xb3\x17\x8e\xe5\x38\x44\x11\x9f\x00\x73" + "\xa5\x47\x98\x2b\x8f\x2c\xbb\x66\x19\xa4\xc4\x8a\xc1\xc6\x90\xaf\x7e\x79\x29\x94\x43\xc2" + "\xed\x09\x2f\xc2\x67\x35\x87\x23\x44\xc7\x61\x3d\xa6\x35\x1a\x46\x72\x80\x16\xa6\x85\x31" + "\x06\xb6\x82\xc2\x35\xd3\x55\x21\x85\xf0\x2f\x6b\x1b\x25\xa1\x26\x53\x0f\x16\xf1\xd6\xca" + "\x06\x48\x95\x93\x54\x78\xcc\x4a\x88\x6f\x1d\x67\x58\x12\xe6\x1d\x2b\xa9", + "\xff\xfd\x99\x8b\xaf\x2b\x52\x4e\x55\x29\x73\x86\x22\x15\x3c\x69\x14\x18\x1c\x37\x56\x95" + "\xc8\x5d\xf9\x15\xfd\xd8\xe6\xb1\x3a\xc1\x7a\x1d\xb5\x20\x1b\x2b\xab\x86\x6a\x6b\x8f\x2f" + "\x5d\x16\x96\x72\x29\x72\x7b\xd5\xf4\xc5\x4d\x51\xf2\x9e\xa3\x67\xe0\x5e\xa5\xf6\xee\x66" + "\x9a\xb7\xe0\x76\xb2\x39\xc9\x5c\x11\x80\x3b\x39\xde\x6c\xc4\x23\x2f\xae\x97\x42\x6d\xbe" + "\x8d\xa3\x24\x04\x72\xdf\xca\x01\xb6\x82\xc1\x3a\xa0\xd8\x3f\x44\x8b\x1c\x40\xa5\x5a\x2d" + "\x57\x56\x4d\x62\x21\xab\x67\x14\xfd\x97\x02\xdb\xe5\x63\x93\x8e\xc3\xbf\x57\xb1\x88\x3d" + "\x5d\xd1\xd0\x18\x04\xba\x6b\x43\x8d\xf2\x3a\x75\xe4\x00\x4f\x03\xef\x61\x87\x9d\xd9\x02" + "\xb1\xe8\xe8\x9e\x56\xb5\xdf\xa8\x1a\xf4\xfc\x00\x39\x3c\x07\x00\x3e\xcb\x42\x22\xd6\x20" + "\x00\xcc\x79\x5b\xdf\x41\x5e\x2e\x43\x24\xe1\x14\x51\x2c\x3b\x43\xbd\x06\xa9\x44\x78\xef" + "\xcb\xd0\x62\x3f\x84\xad\x30\xdf\x7b\xda\xaa\x86\xef\x63\x26\x2e\x31\xe7\xff\xf3\x6e\xf5" + "\x7e\x59\xa5\x80\x4b\xee\x56\xb1\xa6\x94\x72\xc2\x95\x12\x5b\xf9\x3f\xdc\x47\xfb\x75\x50" + "\xf8\x6f\x51\xd0\xc6\x9e\xeb\x08\x48\xea\x29\x3a\x98\xbe\xcb\x5d\xc2\xde\x78\x89\x11\x2b" + "\x2a\x52\xd9\xdb\xb1\x82\xe2\xff\xb1\xa2\x4e\x55\xc7\x93\xf1\x77\x6a\x52\x37\xc1\xf0\x5d" + "\xc4\x17\x58\x5f\x2d\x69\xcd\x81\xe4\xce\xf7\x8b\x8d\xb7\x21\xb2\x0c\x8a\x89\x5c\x17\xfb" + "\xb9\x24\x67\x05\x60\x0e\x7b\xa7\x82\x28\x2a\x3a\x21\xbd\xad\xdf\x5e\x7c\x18\xd0\x1b\x02" + "\xd8\x02\x0f\x55\xb2\x6d\x17\x85\xa9\xc1\x27\xd4\xf4\x2d\x59\xcd\xd6\x45\x68\xaf\x71\x89" + "\x94\x59\x59\x3c\x22\x38\x79\xc0\x32\x74\x04\x5f\xdb\xea\xb3\x5b\xc1\xc2\xbb\x68\x4d\x0f" + "\x0d\xdf\x18\x29\x10\x68\xc0\x66\x54\x4d\xdd\x53\xb5\x8a\x94\x9e\x6a\x85\xf9\x12\xff\x4e" + "\x91\x3f\x58\xe4\x8c\x1c\x27\xa0\x69\xbc\x5a\xa3\xbb\xf9\xbb\x89\xaa\xdd\x3b\x37\x85\xe1" + "\x2e\x59\x70\x71\x51\x5d\x4f\xe6\xd2\x24\x60\x81\x34\xc7\xfd\xbc\xa9\xbe\x78\x91\x03\x1c" + "\x1d\x62\x70\xe5\x01\x69\xfa\x02\xc8\x77\xa9\xaf\x59\x9a\x3a\x6d\x83\xb1\x22\xe0\x44\xf9" + "\x7c\x76\xe1\x4a\x70\x5c\xf4\x53\xa1\x77\x12\x36\x1b\x89\xc8\xc5\xdf\xda\x52\x6c\x25\x68" + "\xce\xef\xc9\x70\xa1\x7c\x84\x92\xb5\xf8\xa5\x20", + 1, 3840 }, + { 128, 128, 30, "\x99\xfd\x0c\x36\xce\x13\x67\x66\x41\x0a\x3d\x8c\xcd\xb7\x96\xb2", + "\xaa\x96\xc3\xbe\x3a\x1a\x91\x2b\xce\x62\x67\x65\xfb\x9b\x6e\x0e", + "\xb7\x15\x85\xe1\xde\xf6\x7a\x2c\x95\xb2\x46\x08\x06\xd5\xac\x78\xc5\xf3\x09\x01\x9f\x1d" + "\xe0\xe6\x2b\xa2\x5e\x01\x38\x02\xe3\xf4\x4f\x27\xb9\x1a\x68\x5b\xb3\xd2\x2d\x16\xb2\xa4" + "\xda\x4b\x6a\x0e\xc9\x5d\xe4\x55\x1b\xad\x63\x5a\x56\x7d\x96\x7c\x76\x25\x5b\xa4\xc4\x78" + "\x4d\xd8\xd7\xc0\xf5\xdb\x25\x65\x5a\x45\x78\xb8\xf3\xb7\x31\xce\x08\xe2\x42\x9c\x16\x94" + "\xcf\x73\x89\xc4\x8e\x14\x84\x63\x4f\xf9\x93\xaf\x55\x50\x30\xe4\xc3\xc1\x79\x6a\x01\xb7" + "\xe5\x98", + "\x5a\xb5\x8a\x3c\xc6\x74\x5c\x94\x02\x05\x36\xdb\xb3\xfc\x19\xb2\x4b\x27\x6f\xaf\x86\x8d" + "\x8d\xdf\xf5\x0a\x64\xf1\x20\x8c\x59\x1b\x24\xa4\xf4\xcf\x5d\xaa\x1e\x06\x17\x94\x03\x7b" + "\x53\x7b\x50\xa6\xae\xa0\x26\x2c\xa9\x8e\xf3\x55\xc9\x06\x47\xd4\x32\xe2\x35\x2e\xad\xf5" + "\x0b\xb2\xfa\x24\x91\x06\x35\xa2\x33\x60\xcb\xda\x45\xd9\x0e\x25\x6d\xac\x8e\xc6\xa0\x24" + "\x08\xe4\x4f\x7d\x7b\xb4\xce\x17\x91\x87\x41\xee\x30\x00\xcb\x1c\x18\xc3\x6e\x05\xc3\x1a" + "\x39\x7f\x72\xde\x2a\x07\x2e\x79\xe4\xe4\xc6\x0c\xad\x01\x44\x4c\x8e\xe5", + 1, 896 }, + { 128, 128, 31, "\xe4\x0f\x9c\x22\x00\x63\x60\x9b\x3a\xb2\xaf\x5e\xe2\x6d\x68\xa9", + "\x10\xb6\x37\x5f\xec\xb9\x42\x82\x2f\xa2\x90\xc7\xaa\xa7\x66\xcd", + "\x4e\x38\xf6\x57\xc8\x14\x97\xcc\x1f\xb8\xc0\xb4\x29\xa1\x8c\x42\xa9\xe0\xad\xf1\x24\x8c" + "\x1f\xc8\xd2\x0c\x8c\x48\xe3\xd1\xd1\x94\xe2\x24\x29\x1c\xc3\x39\x3b\xc6\xb3\x62\xd1\x36" + "\x4b\x4b\x05\xae\x3c\x2d\xc0\x85\x85\x31\x65\x45\x50\xcd\xba\xc8\x49\xc2\xeb\x4a\x86\xfa" + "\x2a\xc8\x32\x92\x68\x62\xef\x56\x4e\xc1\x08\x9b\x45\x55\x82\x29\x7c\x05\x0f\x5c\x1b\x97" + "\x15\x11\x9b\xe9\x91\x0d\x5e\x42\x33\xfa\xec\x54\x84\xd9\xe9\xb7\xb0\x41\x66\x1d\x61\x34" + "\x6c\xa2\x2a\xd0\x30\xc8\x43\x33\x4b\x61\x34\xc4\x3d\xee\xa6\x69\x82\x92\x46\x5c\x8a\x9f" + "\x4f\x0c\x26\x54\x4b\xda\x6e\xb7\x25\xa8\x37\x1b\xc7\x6c\xcf\x56\xb9\xe3\xde\x64\x9e\x52" + "\x3f\xd8\x00\x6d\x7b\x3e\x12\x4f\x1b\xa4\x67\x14\x5f\xba\xb7\x93\x8b\xd1\x4b\x28\x74\xa2" + "\x5e\x3b\x80\x33\x1b\x98\x0b\x09\x2d\x2b\xa6\x3b\xac\xb8\x58\x0e\x49\x1a\xfb\xbc\x64\x0f" + "\x81\x45\xd8\xcd\x42\xe3\xea\x48\x44\x11", + "\x33\x68\xd1\x72\x10\xa5\x1c\xa0\x0e\x9a\x8d\x26\xc8\x6b\x41\x60\xbf\x14\xd0\x44\x4f\x54" + "\xb3\xad\xc6\xf2\x27\x2e\x19\x99\x23\x73\x01\xc3\x24\x6d\xbf\x83\x9f\x3d\x53\xc7\x55\x44" + "\x6c\xb7\x6b\xb6\x03\xcd\xa9\x3d\x33\x05\xd6\xdf\xae\x18\xf7\x3e\xb2\x3a\xfc\x90\x13\x70" + "\x2b\x4a\x2e\xd3\xad\x8e\x2a\xd4\x00\x19\x77\x92\x8b\x81\xf6\xd7\x24\x96\x84\xc5\x7c\x38" + "\xfb\x6a\x4e\x23\x14\xa9\x26\x1e\xfc\x50\xf1\x5a\x21\xa1\xdd\xac\x8f\x8e\x1a\xef\x87\x92" + "\xf7\x42\xa8\x27\xea\x50\x6a\x0e\xa2\xfa\x2a\x38\x67\xc3\x83\xa3\x96\x55\xd8\x00\x1a\x82" + "\x58\x62\x7e\xf5\x2a\xb9\x60\x3e\x7b\xc5\xc9\x08\xee\x93\xba\x71\x87\xf8\x65\xe9\xc5\x50" + "\xe7\x59\xf7\x15\x0a\xfe\x61\x1c\x66\x0c\x6d\xbd\xc9\x79\xc1\xff\xc6\x3b\xbd\x9e\xe9\x9b" + "\x01\xaf\x7b\x8f\x09\xc5\xca\x0c\x81\xd2\x78\x25\x3f\x79\x7c\xca\x72\x2c\x89\x6c\xa9\xea" + "\xe7\x86\x71\x25\xd7\x27\xd1\x7c\x05\xbf\x8a\x57\x15\x8e\xb8\xe7\x4d\xe9\x53\xb1\xb3\x4e" + "\xd0\x38\x9b\x45", + 1, 1664 }, + /* Vector from https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 */ + { 128, 128, 32, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", "\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD" "\xEE\xEE\xEE\xEE\xFF\xFF\xFF\xFF\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB", diff --git a/test/kat-app/sm4_ecb_test.json.c b/test/kat-app/sm4_ecb_test.json.c index 9aa4b19c..8048ff24 100644 --- a/test/kat-app/sm4_ecb_test.json.c +++ b/test/kat-app/sm4_ecb_test.json.c @@ -28,12 +28,968 @@ /* SM4-ECB */ #include "cipher_test.h" const struct cipher_test sm4_ecb_test_json[] = { + /* Generated vectors by 3rd party library */ + { 0, 128, 1, "\x4f\xae\xca\xe5\x31\xaf\xc0\xed\x41\xf4\xaf\xe4\xb4\x3a\x68\xcd", NULL, + "\xf1\x7b\xe7\x3b\x74\x08\x40\x66\xd1\x5f\x0f\x9e\xd6\xcf\x29\xd3\x25\xc1\xe9\xce\x6e\x61" + "\xe7\xf4\x7c\xcf\x2c\xe7\x22\x04\xb5\x07\x83\x5a\xf3\x3e\xb1\x07\xa2\x71\x31\x4a\x65\x8c" + "\x76\xbd\x53\xff\x7f\xbd\x03\x08\x25\x7f\x7e\x16\x0f\xd2\x41\x06\x07\x52\x06\xf3\xff\x36" + "\x37\x68\x2e\x59\x33\xfd\xe3\x94\xea\x81\x82\x30\x16\x4b\xea\x28\xeb\x3d\x1f\x52\x3c\x62" + "\x96\xcf\xee\x91\x4c\x54\x28\xda\xdd\x6a\xa9\xad\x88\x84\xce\xd3\x68\x2d\xd8\x4e\x3f\x89" + "\x42\x20\xe2\x3d\x37\x4d\x51\x71\xc0\xf1\x11\xaa\xd7\xe3\xdd\x03\xfa\x65\x3e\xfa\x38\xe6" + "\x6c\x2a\xf4\x2c\xb0\xca\x71\x5a\x54\xc5\xb5\xfc", + "\x7e\xae\x35\x39\x69\x3c\x5e\xc2\x28\x65\x43\x6f\x49\x88\x4b\xeb\x08\xa3\xcd\xe2\x8d\x50" + "\x18\x45\xb5\x69\x2d\xda\x95\x9e\xe8\xc2\x69\x3d\x56\xdb\xec\x8c\x1e\x53\xb3\x3d\xc1\xe6" + "\x83\x42\x73\xf7\xb6\x49\x58\xfd\xae\x40\x76\x31\x06\xa7\xe9\xcd\x2e\x93\x65\x79\x4a\x98" + "\x8c\x53\x85\x08\x14\x35\x96\x7c\xad\x64\xe2\x3a\x16\x68\xcd\xd4\x63\x4f\x65\x0b\x87\x4a" + "\xe0\x00\x84\x49\xe6\xfa\x07\xde\xe5\x19\xe1\xc9\x1b\xf6\x84\x59\x0c\x98\x13\x6b\x84\x10" + "\x3c\x04\xe6\x0c\x3d\xa5\xa7\x6f\x14\x03\x3d\x92\xd1\xc0\x85\xa8\x3a\xdc\xde\x80\x9d\x3b" + "\x4e\x48\x21\x9e\x14\x5e\x3b\x8e\x99\xbb\xcd\xd4\x51\x0e\xef\x89\x81\xc0\xb3\xfb\x9d\x7b" + "\x8d\x0d\xf9\x5d\xf6\x08", + 1, 1152 }, + { 0, 128, 2, "\xe5\x46\x62\xa0\x34\xce\x5b\x8d\x57\x57\xd0\x1b\x8b\x96\xd7\x38", NULL, + "\x36\x94\xf6\x7b\x8a\x58\x4d\xed\x0a\xa0\x42\xa3\x96\xd8\x5d\xdf\xcc\x03\x2f\xf4\xfb\x25" + "\x0e\x5d\xe9\xec\x00\x14\x57\x99\xb0\xc6\x05\xa0\xfa\x01\x8f\xcf\x82\xd8\xf0\x1e\x3a\xcd" + "\x3b\xfd\x25\x71\xb4\x02\xa9\x5b\x17\xc4\x8b\x7a\x40\x2d\xc0\x4b\x26\xe4\x45\x47\x72\x08" + "\x5f\x20\x7e\x8d\x02\x7a\xd5\x66\x06\x8f\xa7\xbc\x11\xb8\x59\x57\x39\x9a\xd4\xbd\xe5\xbb" + "\xf4\xf1\xcc\x58\x6e\x3d\xce\x73\x73\xe9\x30\xf1\x83\x26\x7e\xeb\x8a\x16\xa5\xb6\x40\xa7" + "\x92\xa1\x9b\x29\x15\x3b\x1b\xfc\x29\x6e\xc4\xc5\xa7\x1c\xef\xba\x2f\x10\x59\x2e\xd7\x19" + "\x0e\xdf\xe5\xe0\x17\xfc\x7c\x0d\x61\x7c\x34\xc3\x91\x76\xf2\x0f\x64\xdd\x83\x7e\xb7\x4a" + "\x98\x0a\x5e\xe0\xba\x48\xd4\xc7\x91\x86\xad\x94\x73\x37\x14\x2e\x60\x24\x28\xcf\xfd\x5b" + "\x96\x89\x6f\xae\x4b\x9f\x16\x8a\x61\xa2\xef\x71\x7f\xee\xde\x61\xe2\xe4\x9a\x24\x4f\xe6" + "\x1b\xcd\x3e\xbc\xd8\xba\xe4\x00\xa5\x08\x87\xc8\x7b\xa1\xc2\xf9\x58\x44\x19\x87\xd3\x43" + "\xd9\x1a\x2f\xba\x3f\x2b\x3a\x8b\x4d\x61\x84\xe1\x36\xfe\x9e\x35\x79\x86\x37\x4a\x61\xea" + "\x12\x4b\xa8\x0c\xc4\xf8\xd7\x20\xd6\x71\xc0\x5f\x13\x30\x2c\x6c\xac\xc4\xf1\x0c\x69\x23" + "\xc2\x32\xfa\x82\xe1\x49\xda\x2e\x2c\x9a\xc4\x87\x4c\xdc\x45\x42\x0f\xc7\x27\xb8\x5a\x32" + "\x09\x70", + "\xf7\x5a\xca\xb8\xb4\xe3\x7a\x8b\xd2\xa8\xec\x69\x1f\xe5\xee\x3f\xd1\xe7\x64\xff\x59\x3c" + "\x01\xed\xf4\xc4\x5d\x86\x32\x58\xe9\x11\x2a\xbd\x6c\x87\x45\xe7\x1f\xd5\x4e\x24\xf6\xd6" + "\x81\xce\xb8\x09\x87\x33\x13\xe3\xfc\xd0\x0f\xe9\xfd\xc1\xd6\xfb\xfc\x9e\xb6\xa0\xd0\x9e" + "\xb2\x84\x10\x0e\x80\xba\x73\x4f\xd1\x9d\x38\x34\x93\x36\x44\xc1\x4b\x90\xc5\xac\x5c\xd6" + "\x46\x5b\x69\xd5\xda\x69\xd8\x62\x8f\x02\xf1\x82\x2e\x81\x33\x60\xc5\x0b\x84\x08\xa3\x5e" + "\x60\x23\x79\x54\xbf\xcc\x86\x43\x02\x16\x2c\x05\xd4\x9a\xa3\x5b\x10\xdb\x19\xb0\x81\x92" + "\x18\xad\xb6\x86\x96\x0d\xd1\x13\x91\x25\xe3\x23\xc0\x2a\x53\x5e\x9f\x2c\x15\x40\x98\xac" + "\x3d\xf1\x7e\x4a\x75\xf7\x0b\x05\xbb\xff\x29\xd2\x09\x2e\xf1\xdb\xc9\x99\x19\xce\xa6\xfe" + "\x51\xae\xe6\x89\xd7\x2f\xfb\x52\x45\x6c\x36\x65\xc8\xbd\xb4\x8f\x91\x4f\x10\x4e\x19\x64" + "\xc8\x8b\x3e\x73\xef\x01\x9f\x74\x8d\xb3\xde\xc8\x6a\xf1\xa9\xc7\x15\xb0\x06\x2d\xe2\xd7" + "\x7d\x44\xe7\xeb\x67\x73\x4d\x6d\x87\x1d\x72\x52\xb7\x48\xcc\xa6\xc0\x6e\x32\x6e\x60\x66" + "\xe9\x4d\xba\x09\xbc\x6f\x9f\x4d\x2f\x97\xba\x3e\x5f\xf1\x99\xff\x49\xa3\x45\x88\x13\xbe" + "\x44\x0f\x63\x20\x74\xaa\x48\x28\x3b\xc7\x09\x84\xed\x27\xb0\xf8\x01\x72\x12\xc2\x63\x21" + "\xe7\x32\xf3\xf8\x5b\x3f\x4b\x07\xc7\x31\xa9\x42\x08\xc5\xa7\x87\x3b\xdc", + 1, 2304 }, + { 0, 128, 3, "\x7f\x09\x45\xc4\xce\xab\x69\xc1\x6e\xbe\xc9\x2d\xa7\xaa\x1f\xc5", NULL, + "\x88\x10\x28\x5f\x76\xb3\xad\x45\x27\xce\x35\x78\x51\x8a\x38\x94\x21\xa4\xb3\x67\x3e\x4a" + "\xac\x5b\x89\xec\x2a\x83\x2e\x7e\x93\x2b\x56\xb4\x0b\xce\xc6\x4d\x6a\xde\x76\xc6\xca\xe0" + "\x57\x5e\x2c\xd0\xc3\xa6\x1f\xff\xe6\x36\x44\x6a\xc5\xc0\x87\xeb\x1a\xe5\x0d\xc4\x54\x60" + "\x36\x14\xfa\x6b\xb3\x29\xaf\x6a\xe9\x8a\x50\x2d\x8f\x9b\x6b\xdd\x26\xa5\xa1\x7c\xab\xa6" + "\x27\xf1\xcd\xf2\x83\xad\xa1\xf5\x55\x56\xdc\x72\x2b\x85\x74\x6a\xd0\x2b\x6c\x79\x4a\x93" + "\x97\x39\xfc\xa1\x65\x96\x3f\xa7\x24\x18\x2e\xc1\xaf\xae\xe1\xb9\x70\x48\xa8\xbe\xf3\x0b" + "\x73\x1e\xfb\x64\x9a\x28\x58\x55\x2c\xe2\x99\x4c\x33\x3d\x3e\x06\x69\x9f\x76\x42\x1f\x48" + "\x99\x9f\x1c\x6a\x0c\xa0\x5d\x5d\xdc\xf1\x37\xf0\xca\xbe\xc2\x91\xe7\x14\xad\xbf\x8a\x12" + "\x67\x86\xa5\x61\xb9\x03\xef\xa4\xfe\x8d\x97\xe4\x20\xce\xcc\xa0\x97\xbb\x5b\x7d\x64\x31" + "\x91\xfc\xaa\xb1\x12\x21\xc7\x43\x80\x95\xfb\x73\x21\xab\xfc\x1c\x16\x6a\x88\x32\xbb\xef" + "\x16\x30\x81\xf7\x4b\x06\x74\xa8\xba\x9c\xac\x2e\x13\x62\x49\x33\x2f\xa4\xae\x63\x8f\xf8" + "\x0e\xd5\x9a\xc9\x87\xbb\x30\x63\xad\x07\x4a\x1f\x44\x2a\x4f\x69\x29\x9b\x98\x84\x17\x2a" + "\x9a\x6f\x4d\x7c\x6b\x5e\x35\x76\x32\xdd\x97\x86\x65\xf6\xf4\x70\x5c\xc4\xb4\xc9\xf2\xb3" + "\x78\xe2\x1c\x46\xd6\xda\x0f\x33\x1a\x6a\xec\xdf\xda\xc3\xa6\x34\xce\xad\x93\xe5\x7b\x81" + "\xcc\x57\xcb\xab\xd6\x59\xa1\xbe\x95\x0c\xf1\x94\xb1\xdf\x03\x24\x26\x42\xe3\xfc\x4f\xec" + "\x4f\x6f\x8d\xf6\xbe\xe8\xc1\x8a\xb9\x0e\xfb\xa4\xae\xa9\x12\x40\x25\x5e\xab\x5c\x5b\x1a" + "\xe5\x09\x40\x9e\x39\x67\x9b\xb7\xc1\x79\x21\x88\x6a\x55\x29\xf4\x68\x3d\x78\x61\x40\x52" + "\xb7\x38\xf0\x66\x0b\xcf\x85\xf7\x3e\x48\xee\x7d\x7f\x47\xbf\x53\xc8\xd4\x49\xfe\xd7\x19" + "\x15\x07\x31\x2c\x2b\xa7\xda\x0d\xc2\x2a\x5f\x1b\xbd\x06\xdd\xd9\xf3\x6e\x6e\xc3\x53\xbb" + "\xa3\x04\x99\x22\x49\x92\x15\x37\x42\x3e\x20\xc2\xf7\xd3", + "\xad\xc7\x51\xcc\xfc\xa5\xef\x41\x71\x55\xe7\xa6\x93\xbf\x0b\xf0\x1c\x78\x37\x8f\x03\x29" + "\x3c\xe2\xe4\xbf\xb3\x30\xcf\x26\x5d\x74\x17\xf4\xc6\xa3\x9e\xdb\x4a\xf4\xfb\x1c\xbc\xb0" + "\x1d\x47\x41\xab\xf0\xd0\x12\x68\x0b\x9f\x92\x74\xc3\xbd\xb4\xd5\x81\xa7\x68\x10\x03\x30" + "\xca\xaf\x4a\x51\x40\x54\x87\xe8\x08\xfc\x29\xb8\xea\x10\x8e\xfc\xac\xed\xd2\xfe\xe3\x83" + "\x72\xa4\xbb\x63\xc8\x66\xb1\x49\x1f\x35\x63\x8c\x1d\xcb\xe8\x7f\x81\x0f\x42\x57\x08\x19" + "\x22\xf4\xdd\xef\xb0\xac\x3b\xaa\x28\x87\x31\x3c\xfd\x2d\xd5\xcb\xee\x28\x1f\x64\x24\x52" + "\x5f\x80\x1d\x19\x5c\xfb\x71\x64\x9b\xaa\xfe\x08\xfe\x08\x97\x91\xd9\x97\x22\x89\x90\xa4" + "\xae\xa6\x72\xf4\xf6\x27\x09\x00\x69\xe7\xdf\xb4\xc9\x6a\xd6\xd1\x47\x26\x07\x20\xef\x67" + "\x32\xbe\xf5\x6d\x26\xf7\x65\x0e\x2c\xcb\x20\xc4\xac\x85\x05\x62\xe1\x85\xf4\xbf\x03\x18" + "\x6e\xab\xfd\x0a\x41\xed\xb1\x7f\x22\x97\x21\x40\xbf\xf7\xb2\x55\x31\xd4\x33\x33\xad\x32" + "\x89\x38\x97\xcb\x7d\xde\xe8\xf1\x0c\x7f\x42\x25\x7d\x54\x16\x1a\xaf\xb3\xd6\x96\xde\x2d" + "\xcf\xd9\xa7\x5a\x91\xc3\xd8\xf1\xe3\x16\xe1\xdf\x09\xf8\xaa\xfa\x55\x35\xd0\xf1\x63\x3e" + "\x4e\x3c\xd6\x4b\x45\x3d\x39\xbd\xb1\x0b\x30\xff\x03\xf1\x9d\x22\x57\xbe\x72\xc2\xe2\x28" + "\x91\xe7\x8b\x7f\xe5\xa6\xa8\x34\xad\x2e\xdd\x29\xaa\xe5\xd4\x86\xf9\x00\x60\xcc\x80\xce" + "\xe7\x37\x39\x19\x32\x01\x83\xd6\xc1\x7e\xaf\x4b\xd4\x39\x78\xbb\x9f\x49\x0b\x3f\x2d\x84" + "\x69\x27\x13\x5b\xd8\xe9\x38\xcf\x0c\x92\xb9\x1a\x35\x2e\x47\x0d\x39\xe1\x04\x55\x36\x5e" + "\xe1\x69\xf3\xb8\x16\x4c\x91\x95\xfc\x2e\x40\xea\xee\x01\xfc\xf8\x90\x60\x85\x46\xa8\xc4" + "\x68\x16\x7c\x4e\x0e\xf8\xf2\x4b\xe3\xbb\x6c\xdd\xe5\x65\x9f\x94\x06\x7b\xa5\x39\xda\x70" + "\x6f\xb9\x9c\x05\xb9\xc8\x67\xb2\x83\x80\xa5\x75\x54\x41\x35\xb6\x7c\xfd\x2b\xb1\xfe\xc0" + "\x80\x2e\x42\x17\x52\x4f\x4b\x6e\x1f\xb1\x90\x44\x36\x9a\xa0\xf6\x1a\x9e\xef\x0d\x06\x01" + "\x6e\x51\xd2\x1b\x49\x41\x12\x6a", + 1, 3456 }, + { 0, 128, 4, "\x43\x17\x00\xf4\xa6\x05\xd4\x91\x76\xe9\xc7\x1b\x50\xea\x2c\xd6", NULL, + "\x17\xd5\xf0\xe6\x88\x41\xd0\x12\xa3\xe6\xe1\x8c\x10\xd3\x5d\xaa\x43\x86\xac\xea\xc8\x92" + "\x0d\xf7\x8a\x42\xaa\xdb\x88\xa8\x4b\xe7\x5d\x27\x46\x5d\xc0\x18\xe3\xc9\x85\x55\xea\xa6" + "\x52\xd1\xab\xda\xf2\xf4\x98\x44\x41\xcb\xaf\x68\xa7\xa6\x10\x5f\xa4\xd8\x8c\xf6\xd3\x2d" + "\x58\x2a\xa9\xce\x34\x42\xde\x8e\x77\x3f\x5c\x18\x23\x68\xab\x42\xfd\x27\xee\x08\x42\xae" + "\x63\x92\x42\x27\x3f\xb0\x1d\x37\x23\x35\x05\xc7\xdb\xd5\xff\x66\xac\xd4\x0f\x8b\x3d\x3f" + "\xab\x38\x0f\x19\x17\x79\xda\xcd\x7a\xeb\xd0\x44\xef\xc0\x45\xc6\x07\xe7\x01\x31\x0a\xde" + "\x61\x6f\x7b\x56\x06\x6d\x08\x95\xed\xc9\xcc\xb9\x0c\xa9\x11\x97\x46\x04\x0d\xee\xe7\xc0" + "\x74\x07\xa2\x8c\x45\x06\x40\xec\x58\xd7\xd1\x19\xc4\x11\xa6\xb9\xe1\xe1\xdc\x0a\xbf\xfe" + "\x08\x89\xb5\x7c\x5c\xca\x75\x85\x57\x77\x33\x81\x09\x32\x78\xca\xdd\x46\x95\x63\xe8\x85" + "\x83\x35\x68\xb8\x8c\xd5\x17\x56\xe7\xfc\xe1\x3e\x2a\x4a\x44\x9a\x2c\x4b\xe2\xe8\x97\x46" + "\xee\x6a\xa3\x4d\x3d\x08\xb4\x71\x44\xb7\x0a\x22\x2f\x6f\x6e\x87\x2a\x37\x52\xbf\x7a\x84" + "\xaa\xb9\x18\xb0\xb9\x47\xa4\x46\x43\x56\x9b\xfd\xe1\x52\x47\xf7\x0d\x29\xea\x26\x0b\xb2" + "\x26\x87\x7e\xf8\xbc\x9c\x75\x2a\x00\x4f\x5b\xa4\xbe\x44\xe8\xb9\x6a\xf2\x97\x5d\xb4\xe8" + "\x20\x4c\x1a\x49\x0f\xb6\xb4\xcf\x31\x7b\x56\xbb\x53\xb6\xf4\x01\x2d\x02\xa2\x75\x7f\x1c" + "\x51\x25\x27\xbb\xe5\x86\xe4\x0f\x3c\x63\x62\x21\x31\x68\x25\xca\xca\xa7\xc7\xaa\x7c\x34" + "\xf9\xce\xb8\x95\xd5\x73\x04\x18\x40\x21\xdc\x79\x66\x64\x27\x9c\xc0\x34\x84\x3b\x74\xc0" + "\xc8\x4c\x25\xaf\x0f\xa5\x57\x73\x48\xc6\x02\xb8\x33\x4f\xd9\x0d\x23\x4e\x7b\x91\x03\x3a" + "\x5c\x34\x56\x51\xa2\xf1\x2c\x6e\x9b\x9f\x23\xf4\x1d\x55\x26\xee\x9d\xc6\xd0\xf4\x2b\xd5" + "\x75\x45\x28\x17", + "\x28\x87\x9c\xcb\xa9\x3f\xae\x1d\x79\x53\x49\x16\xd5\x18\xb2\x46\x3f\xcf\xc1\xfd\x1e\x60" + "\xe1\xbc\xcd\xb9\x39\xdb\xb6\x88\x03\x2a\x1c\x07\x51\x3f\x54\x6b\xad\x24\x54\x86\xcf\x52" + "\x4c\xe5\xbf\x24\x2c\x48\xc1\xea\x68\xad\x34\xcc\xc3\xb4\xd9\xd9\x60\x99\xf3\xa4\x87\x11" + "\x9a\x22\x2f\x60\x39\x92\x8d\xf0\x37\x6b\x4c\xff\x29\x17\x41\xc6\xc4\x46\x9f\xa2\x8d\xf6" + "\xa8\x5d\x01\xcf\x3f\xdf\xc9\x08\x02\x03\x1f\xdf\xe6\x0e\x0c\x8f\x0d\xe8\x2d\x0b\x30\xba" + "\x24\xf9\xd8\x10\x57\x73\xa1\xa4\xbc\x5e\xf8\xb8\x6c\xf0\x3c\x02\x96\xc5\x16\x08\xec\x8d" + "\x47\x5d\x14\xfd\xc7\x73\xfa\x7e\x64\x41\x98\x3f\x06\xc5\x84\x5c\x00\xc9\xf0\x5e\x19\xca" + "\xe4\x38\x06\x71\xae\xaa\x5b\x91\xfe\x9f\xa0\x17\x73\x97\xf1\x28\x71\x7e\xbb\xf4\xbc\xdb" + "\xcb\x09\xe8\xfd\x42\xd4\x03\x83\x8c\x53\x87\xd2\xa8\xc0\x1f\xfe\x32\x2f\xfb\xc4\x1a\xed" + "\x94\xfa\x4d\x51\xe4\x68\xda\x13\x45\xb2\x99\x5f\x1e\x84\xc1\x5d\x80\x6f\x49\x82\x38\xfc" + "\xb3\xae\xb2\x57\x54\xb5\x2a\x82\x60\xb1\x71\xae\xa0\xd1\x14\x86\xba\xc1\xea\xd2\x66\x0a" + "\x2b\x48\x5c\x63\x00\x45\xc1\xd2\xaa\xb6\x3f\x45\x44\x2c\x49\xfc\x40\x93\xe8\x88\x4f\x2f" + "\x42\xd2\xe6\x7c\x8f\xc6\x05\x8a\x0a\xa2\x4a\xa2\x76\x6d\x2c\xa0\xf4\xbe\x6e\x2d\x58\xcf" + "\x56\x75\x8f\x74\xb8\x79\x53\xe2\x00\x8e\x7e\xb9\xd4\x50\x05\xe8\x6f\x10\x8b\x81\xd1\x1f" + "\x6a\x3c\xc9\xc9\x6c\x53\x52\xd2\x77\x37\x29\x03\x13\x60\xac\x6d\x26\x24\xca\xaa\x70\xab" + "\x89\x6f\xe3\xea\x0b\xe1\x7b\x47\x7e\x5e\x59\x78\xce\xd3\xd2\x66\xac\xed\xde\x3f\x33\xc5" + "\x88\xfc\xa0\x30\x11\x35\x31\x18\xb1\xf8\x6c\x54\xc8\xb9\xa7\xd9\x36\x72\xb1\xc3\x34\xfa" + "\x4b\xbb\x85\x01\x28\x14\x09\x0e\xdc\xb1\x15\x1f\x25\x98\x51\x40\x16\xf3\x6d\xf2\xb7\x36" + "\x3c\x9a\xda\x96\x2e\x38\xc1\x85\x90\x1d\x4a\x25\x03\x9a\xdc\xe8\x9b\x55\xa6\x42", + 1, 3200 }, + { 0, 128, 5, "\x3a\x48\xe9\x64\x0f\xb9\x40\xbd\xb9\x30\x9c\x27\x5f\x59\x18\x1b", NULL, + "\x70\x0b\xe9\xff\x7c\xad\x73\xb6\x62\x4a\xd2\x87\xcd\xb3\x6d\x98\xa2\x48\x85\x67\x98\xa9" + "\xdd\x2e\xd9\x9d\x88\x3d\xee\xe9\x42\xcb\x17\x9d\xf1\x5e\x5e\x78\xaa\x33\x42\x2c\xdf\xe2" + "\xa4\xba\xb9\x13\x44\x8d\xa9\x69\x03\x7f\x97\x67\x43\x30\x2c\x2f\x75\x46\x40\x3e\xfc\x5f" + "\xab\xb1\x3c\x7d\x51\xdb\xd6\x3c\x29\x84\x99\xe3\xf1\x64\xdb\x3c\x80\x08\x50\xa7\x2c\x1e" + "\xb5\x6c\x17\x20\x59\xf1\x46\xb7\xfe\xb7\x61\x65\x85\xd2\xc9\x68\x50\x7a\x91\xe6\x13\x77" + "\x5c\x0d\x63\xd1\x07\x9d\x6e\x1e\xa7\x86\x2d\x34\x04\xa7\xe8\x08\x76\xd1\x3e\x99\x67\xa9" + "\x21\xd0\xea\xa2\xdb\xf1\x58\xd9\x12\x06\xb1\x77\x66\x9c\xf5\xa1\x24\xea\xae\xed\x6d\x80" + "\x79\x0c\xaf\xbe\x9a\xe5\x11\xb9\x8f\xec\x5d\x0e\x0b\x83\xb3\x32\x41\x99\x24\xa8\x7a\x26" + "\x24\x5c\x0d\x23\xa5\xc5\x83\x1d\xc3\xda\x2b\x8e\x79\x6c\xd9\xfc\x05\x28\x94\x0d\x83\xd9" + "\xe2\x78\xf1\x79\x1f\x20\x53\x29\x06\xa0\x91\x86\xe6\x0e\x44\x18\x41\x86\x7d\x0a\xba\x03" + "\xe7\x28\xc3\x9b\xc6\x1f\x6f\xa3\xe7\x13\x76\x61\x90\xe4\x7f\xdf\x42\x72\xe1\x7d\xe3\x0a" + "\xfd\xb4\x87\x6c\x2f\x13\x80\x62\x32\xfb\xd0\x61\xfe\x3e\x1c\x7f\x5b\x2a\x43\x9a\x63\xbc" + "\x33\xca\x7d\xc0\xfa\x2b\x17\x79\x13\xf3\x1f\x10\xec\x42\x52\x8f\xe2\x17\x5d\xd1\x99\xdb" + "\x9c\xbf\x85\x58\x59\x01\x2d\xf1\x10\x22\xbf\xd0\xa4\x05\x92\xb9\x0d\x08\x3b\xbd\x5e\xe1" + "\xf0\x67\xd8\xef\xa5\xab\x1c\x9b\x9a\xfc\x6b\x2f\xee\x89\x2e\x42\x27\x17\x9c\x2a\xd0\x19" + "\xba\x45\x82\x6b\x16\xa9\x29\xcf\xcb\xf9\x51\x21\xab\x47\x00\xa7\xa4\xe1\xe7\xe4\xc6" + "\xde", + "\x1f\x0c\x7c\x69\xe8\xef\x71\xa4\x29\x42\xab\x3e\xda\x7f\x6c\x2a\x01\x59\xf0\xbe\xec\xd2" + "\xc9\xda\xac\xb4\xdd\x93\xf9\xb0\x36\x49\x3f\x4e\xba\xfe\x11\x16\x1b\x00\x20\xfc\x0e\x70" + "\x1a\x1d\x77\xe4\xb0\x6d\xc5\xe9\x67\x9c\xe3\x23\xf4\x5e\x28\xd1\x32\x9d\x2f\x3e\x2f\xc3" + "\xb3\x63\xea\x3e\x0f\x28\x77\x33\xd7\x37\x25\x22\xd2\xd8\x9a\x35\x5d\x9b\x0b\x36\x55\x89" + "\xc2\x7c\xac\xb7\xde\xb0\x76\x44\x69\xa0\x82\x9d\xa9\x9a\x34\x51\x54\x46\x96\x17\x0a\x19" + "\xe4\xf1\x0e\x10\xbb\x92\x03\x8a\xdb\x5c\x76\x74\xee\x52\xf5\xcf\xb3\x58\x37\xa9\xfc\x75" + "\xfe\x70\xf2\x91\x66\xb6\x2a\x9e\x30\x25\xd3\x79\xb2\x0d\x4b\x56\x8f\x9b\x05\x1f\x77\x1b" + "\xe4\x5f\xcf\x2b\x98\x07\x2c\x06\xaa\xac\xda\x4d\x61\x5f\x97\x4a\xa1\xa4\xa1\x5c\xe5\x30" + "\x98\x45\xb9\xda\x8e\xc2\x65\xc8\x89\x4c\xdb\x57\x1e\x60\xb7\xb5\x69\x26\xb9\xc6\xb4\x2b" + "\x8b\x56\x6b\xa2\xcb\xdd\xc3\xa8\x1d\x2f\x7c\xab\xea\xa9\xa9\x9e\x0a\x6f\x3b\x25\x11\x65" + "\x77\x2c\xf8\x59\x2a\x4d\x86\xd4\x1e\xa4\x77\x71\x30\x94\x16\xd4\x08\x38\xa6\xab\x52\x06" + "\x16\x08\x8a\x9f\x52\x22\x72\x50\xf7\x2d\x74\xa9\x73\x02\x13\xb8\x87\xb4\xb4\x55\x70\x9c" + "\x08\x82\xf6\xee\xa1\x47\xd8\xdc\x91\xa6\x6e\x0a\xb1\x54\x54\xd3\x9d\x66\xee\xad\x46\x60" + "\x27\xf4\x80\x7c\x90\x05\x44\x04\x1e\xf6\x19\xe7\x0f\xa1\xf0\xc1\xfd\x7a\x7c\xe4\x12\x5a" + "\x9b\xef\x48\x23\xe6\x6b\x69\x34\xf4\x9f\x3c\x61\x5b\x6e\xe9\xcd\xc7\xff\x89\xea\x41\x9e" + "\x6a\x9a\x67\x42\xbe\xa2\xbf\x8f\x97\x91\x2c\x6e\xa8\xa8\xb7\xc2\xe3\x44\x86\x61\x01\xdb" + "\x60\xea\x5e\x30\x06\x67\x88\x9c\x72\x88\xdf\x3c\x79\x4b\x08\x01", + 1, 2816 }, + { 0, 128, 6, "\x4f\x33\x8c\x0e\x7e\xc6\x12\x36\x38\xb2\x95\xaa\x77\x2c\xf3\xe4", NULL, + "\x5a\x57\x24\xab\x97\x4d\x72\x59\x24\x79\x8a\x33\xb3\xbe\xb3\x46\x6a\x0c\x11\x04\x9e\x56" + "\x05\x7e\x1f\xe3\xc8\xc3\x70\x80\xd5\xf9\xdc\x32\x70\xa0\x4e\x43\xa5\x65\xd8\xb8\xb2\xd0" + "\x45\x35\xd8\xfe\xfa\x6a\x4e\x90\xb3\x5e\x25\xe4\x26\xcc\xad\x7f\xd1\xa3\x7e\xa8\xa7\x07" + "\x7a\x48\x06\xfd\x44\x16\xf4\x64\x8f\xbb\xc3\x7e\xbd\x8a\xb7\x00\x63\x5b\xcb\xd5\x23\x31" + "\x76\x92\x77\x17\x7a\xdc\x5a\x32\xf5\xb2\x96\x5b\x9e\x50\xa2\x04\x3c\x13\x17\xde\xa4\xc3" + "\x68\x4f\xfd\x9a\x59\x92\x26\x27\xc8\x57\x44\x80\xa0\x05\x42\xca\x79\x17\xde\x8c\x2f\x06" + "\x43\x4b\x70\xb9\x62\x3c\x17\xae\x77\x1a\x67\x6a\x78\xb6\xc3\xd2\x78\x0d\x6a\x0a\x64\xfc" + "\xb6\xc7\xc7\x0c\xb8\x4d\xae\x07\xd7\xe5\x77\xcd\xb9\x5a\x32\x57\x27\x21\x1c\x2c\x0e\x54" + "\xb3\x09\x4e\xc2\x7a\x15\x15\xf0\xf6\xfe\x69\xed\x71\x26\xad\xbd\x1d\x1e\xd8\x7c\x66\xb0" + "\x27\x47\x30\x5c\x54\xc2\xc9\x41\x69\x75\xb5\x0f\x19\x37\x04\xd9\x31\x23\x00\xc2\x4d\x18" + "\xcf\x11\x34\xb0\x40\xf6\x0b\x39\xbb\x43\xda\x16\xbb\xac\x08\xcf\xf2\xa0\xdb\x50\x31\xdf" + "\xd0\x5e\xc7\x24\xa2\x86\x6e\xd8\xac\x2a\x74\xe5\x74\x38\x3e\x50\xad\x44\x7a\x06\xac\xad" + "\x8f\xc7\xbd\x45\xee\x0c\x50\xa8\x1f\x11\xd9\xec\x7c\x5b\x00\xd3\x3d\xa7\x64\x0e\xc9\x76" + "\x6f\x12\xa1\x74\x75\x44\xa6\x9d\xd2\x64\x50\x51\x1d\x1d\xde\xe8\x88\x41\x36\x0b\xf8\x56" + "\x9e\x29\x81\x71\x40\xf1\x61\x06\x72\xcf\xdc\xe4\x91\xdc\xb9\xf2\xf1\xe9\xe2\xf0\xa2\xd1" + "\xc6\x89\xb5\xf6\xe4\xe3\xba\x4c\x50\xbf\x06\x97\x24\xa9\xdd\xdf\x5a\x60\x0b\x31\x51" + "\x5d", + "\x19\xf9\x37\x7d\xcb\x2a\x40\x2b\xea\xcd\xb1\x1e\xbe\x75\x61\x3f\x59\x64\x96\xf9\x12\xa2" + "\x5b\x6e\x18\x6c\x48\x5e\xc4\xc6\x47\x2b\x27\xf8\x4d\x12\xc9\xa6\x7d\xd5\x15\x2f\x11\xfa" + "\xee\xc7\xb1\x3c\x21\x5f\x95\xb6\x05\x20\x55\x77\x06\x60\xbe\xb8\x52\xbb\x55\xd0\xd2\x64" + "\x51\x47\x69\xc9\xd7\xc4\xd3\x8a\x87\x48\x5f\x4d\xf5\xdf\x07\x99\x12\x80\x3b\x9d\xa3\x55" + "\x1c\xb7\xd6\xd6\x4e\x6b\x54\x0a\x47\xae\x0d\x9e\x7b\xa5\xfb\x95\xdc\xce\xc6\x1e\x0b\xed" + "\xb1\xab\x85\xb1\x50\xab\x6a\xcb\x2c\x86\xf5\xde\x4b\x8f\x23\x2b\xf2\x52\x3e\x95\xb3\x4b" + "\x2b\x18\xe1\x88\x6b\xcf\xe8\x3d\x6e\xd4\x1e\x95\x88\x49\x7c\x31\x63\x96\xc3\xe0\x52\x65" + "\x8d\x9b\xa0\x5f\x7e\x81\x36\x06\x86\x2e\xe6\x5c\x35\x4c\x4f\x73\x52\x85\x93\x2a\xbe\xf6" + "\x8c\x5d\xfb\x39\xd0\xa1\x46\xba\x86\x48\x2a\xf6\x78\x24\x1d\x83\xfa\x6d\x96\x07\xe9\xbf" + "\x0b\x6d\xaf\x9b\x28\xd9\x78\x2b\x37\x6f\x74\x9c\x3d\x44\xff\x89\x87\x14\xb4\xc3\xa3\x16" + "\xf9\x6d\xdc\x49\x70\xbd\x7f\x55\xc9\xf8\xbe\x75\x71\x2f\x09\x80\x66\xf9\xf8\x77\xd8\x28" + "\xcf\xeb\xa8\xa6\x62\x40\x07\x86\x81\xfe\x7a\xe0\x60\x4f\x45\xb8\xee\x91\x88\x9c\x46\x97" + "\x00\x9c\x89\xcc\x91\xdb\x3b\x2d\x37\xeb\x8f\xc1\x94\x79\x21\xaf\x25\xf9\x96\x86\x43\x12" + "\x33\x0d\xd6\x10\x1a\x66\xa4\x32\x08\x2c\xd6\xc7\x2f\x8d\x22\x3f\x71\x5b\xc3\x4d\x8e\xe7" + "\x81\x12\x0d\x08\x89\xcb\xb3\xd5\xd8\x3a\xd8\xc6\x75\x53\x59\x98\x44\x8f\xec\x20\x0e\x8d" + "\xe0\xef\x24\xe8\x54\xa2\x82\x8e\xca\x69\x21\xd5\x62\xc1\xf9\x2d\x60\x1e\x69\x11\x09\xb4" + "\x3a\x41\x85\xde\x38\xf7\xac\x02\x02\x01\xd8\x67\x4d\xbd\xe2\x7c", + 1, 2816 }, + { 0, 128, 7, "\xa1\xb8\xf6\x26\x30\x1c\x67\x4e\x5a\xeb\xdf\x7a\x1c\xce\x62\xe8", NULL, + "\xb9\x23\xa6\xc3\x88\xd4\xc4\xa2\x9d\x17\x8a\x66\x3d\x06\xf4\xea\x16\x7e\x0a\x78\xe6\x73" + "\x12\x8a\xac\xdb\x6f\x5c\x8d\x37\xbd\x84\x7e\x08\xd7\x88\x91\xeb\x34\x58\x76\x1e\x39\x16" + "\xa9\x8e\xe4\x26\x27\x01\xf8\x43\x7a\x82\x64\xac\x78\x16\x7c\x09\xd5\xb2\x18\x8b\x18\x7b" + "\x15\x1e\xce\x5c\x04\xce\x0a\xd6\xa9\x23\xf5\xef\xc7\x99\x8e\x95\xcd\xb7\xc5\xc6\xbf\x11" + "\x9a\x63\x18\x6a\xe6\x62\x64\xc6\x6b\x83\xd8\x9b\xf0\x6b\x7e\xa5\xe8\xcc\x0f\x45\x62\x09" + "\x27\x57\xbd\xdb\x95\x9c\xdd\x19\x21\x3a\xc2\x6c\xfd\x11\x47\x18\x95\x84", + "\xdd\x20\xfb\x2a\x98\xd9\x63\x5e\xae\xf7\x1a\x82\xcc\x01\xde\xcf\xb9\xe1\x0a\x47\x24\x49" + "\xdc\x21\x9c\x35\xa2\x5d\x5b\x68\x89\xb1\x47\x19\x01\xfc\x0f\x2d\xc1\xbd\x96\xdc\x0c\x24" + "\xa8\x74\x24\xd9\x99\x0d\x45\xc3\x6d\x39\xa5\x82\xb9\xc7\x44\x90\xae\x55\xf5\xc3\x3b\x21" + "\x84\x80\xeb\x96\x98\xb4\x5e\xcd\x2d\x4c\x89\x01\x0d\xa6\x73\x9d\xaf\xaa\x6e\xb8\xb0\xaa" + "\x61\xe0\x3a\xd4\x5b\x30\x87\x52\xad\xe1\xbb\x7d\xf9\xa2\xef\xa6\xa3\xa0\x7e\xbc\x65\x7f" + "\xed\xbb\xad\x6f\xfa\xed\x45\xe0\xd1\xe7\xdb\xa0\xf1\x77\xec\x7f\x07\xab\xc3\x43\x02\x8e" + "\x96\x57\xda\x87\xe0\x33\xfc\xe3\x27\x48\x13\x8e", + 1, 1024 }, + { 0, 128, 8, "\xc3\x35\xe9\xf4\x8d\xb2\x32\xda\x37\x36\x50\x82\x1b\xef\x29\xc5", NULL, + "\x50\x5a\x9f\x69\x9a\x63\xcd\x2e\xcb\x8a\x04\x55\xf9\xb8\x62\xb6\xc8\x38\x8a\x66\x2c\xe4" + "\xd3\x04\xb6\xae\x05\x90\x05\x32\xdf\x57\xec\xc0\x67\xd6\x43\xf7\x6b\x74\xc2\x8f\xb3\xc0" + "\x28\x44\xa1\x17\x71\x80\xb4\xbc\xb6\x75\xa8\xe4\x9c\x99\x82\x7a\x93\xb0\x10\x53\xa3\x90" + "\xea\xe5\x98\xf7\x4d\x38\x1e\x99\xd6\x1e\xd1\x7b\x50\x23\xc1\x69\xae\xb1\x24\xf3\x2b\xb9" + "\x73\x0b\x97\x25\xc6\x7d\x94\x56\x4f\xb5\x58\x56\xd1\x51\xc3\x87\xb3\x1c\x20\x47\xcc\x1f" + "\x82\x11\xa0\x2e\xfd\xdb\x6e\x7e\x66\x1c\x4b\xd1\x9e\xf5\x2d\x8b\x11\x47\xb9\x6e\xf0\xb4" + "\x4e\x8a\x46\x52\x62\x76\xcf\x57\xba\x07\xff\xff\x37\xa4\xcb\xdc\xca\xc4\x12\x8e\x67\x37" + "\x39\x38\x10\x1f\xe9\xa8\xe4\x48\xbd\xaa\x6f\x10\x2c\x7c\x75\x35\x16\x87\xdb\x0b\x41\xb1" + "\xbc\xb2\x71\xd2\xef\x8a\x56\x70\x38\x93\xe5\x79\xb9\x63\x2a\x09", + "\xe0\xf5\x93\x6b\xaf\x10\xdb\xf7\xf7\xbd\x45\xe8\x33\x19\x9e\x62\x4e\x6c\xb0\xe2\x88\x95" + "\x80\x40\xe0\x2e\x8f\xfa\x8d\x8c\x5a\x5d\x4b\xaf\xbc\x07\x7f\xec\xa8\x7d\x19\x66\x63\xc0" + "\xe0\x53\x7e\x35\x1d\x63\xb2\x1f\x92\x88\xb4\x01\x9f\xd1\x3d\x95\x2d\x7e\x11\x05\xd3\x0a" + "\x85\x74\x03\x08\x50\xff\xf7\x0c\x16\xb3\x3c\x0a\x09\xaa\x95\xb5\xad\x83\x9e\x04\x89\x54" + "\x1d\xa9\xb6\xb3\xd5\x42\x10\xbf\x5b\x37\x55\x8e\x09\x3f\x7a\x91\x1c\x41\xe5\xfc\x99\xe9" + "\x91\x34\x2e\x2e\xab\x82\x68\x81\x99\x83\x49\xb1\x68\xc4\x91\x11\xcd\x6d\x9e\xa7\xc8\x7e" + "\xd4\x39\xc7\x55\x59\xcd\xb9\x99\x4a\xda\x47\xee\xe5\x0f\x51\x21\x4d\xed\xf7\x28\x00\xc4" + "\xad\x7a\x7b\x03\x62\xe6\x37\xea\x41\xb0\x00\x19\x5b\x66\xfb\xfe\x39\xf3\xeb\x88\x2a\x46" + "\x0f\x5b\xe3\x88\xb4\x53\x55\x55\x50\x06\x1c\x4a\xf4\x3d\x83\x38\x73\xbd\x6d\xb1\x78\x28" + "\x41\x83\xc6\x16\xba\x68\xdc\x87\xc3\xaa", + 1, 1536 }, + { 0, 128, 9, "\x8d\xbd\x89\xe8\x7a\x10\x28\xe9\x47\x2d\xf7\xe5\x98\x5f\x73\x9b", NULL, + "\xf0\xae\x1c\x83\xd0\x88\x72\x90\xc4\xb5\x60\x94\xf7\xcc\xd3\x8f\x23\x08\xe5\x25\x60\x5b" + "\xd6\xab\xcc\x1a\x7d\x17\xa8\x46\x82\x26\x1c\x30\x13\x60\xfc\xa6\xca\x8b\x53\x26\x09\xb9" + "\xb1\x0a\x3e\x4c\xb3\x27\x7c\x18\x58\x37\xc2\xd3\x77\x67\xed\xec\xe9\xd7\x40\xb0\x1a\x93" + "\xb6\x7e\x31\xc7\xa4\x86\x63\x3a\xa3\x28\xb1\xc1\xb2\xb1\x3e\xe0\x7d\xfc\x14\x2d\xed\xc2" + "\x47\xd3\xaf\xa7\xa8\x0f\x56\xca\xc3\x8b\x4e\x8d\x2b\xa1\x65\x71\xf9\x1e\xb3\xc5\x53\xd7" + "\x91\x83\x9b\x0d\xf2\x2e\x83\x0e\xa6\x31\xb4\x63\x67\x34\x23\x3b\xac\x9f\x3d\x2a\xd6\x38" + "\x52\x9a\xfc\x38\x18\x0f\x62\x4d\xe8\x4b\xb8\x7e\x45\x5f\x28\xfe\x44\xc4\x16\xf9\x1f\x03" + "\x06\x67\xc9\x2b\x3d\x98\xd5\xff\xe6\xdb\x8b\x70\x0f\xaa\x02\x20\xe9\x83\xeb\x3a\x42\x8e" + "\xc3\x90\x79\xb0\x07\xa3\xf6\x5e\xb9\xa9\xe3\x81\x3c\x4c\xc9\xec\xac\x10\x3f\xcb\x35\x46" + "\x98\xf7\xab\xd0\x13\xbf\x75\x6b\x41\x90\xaa\x4c\xa0\x99\x06\x25\x5a\x31\x2a\x5a\xc3\x09" + "\x08\x35\x2d\x80", + "\xf5\x5a\x03\x02\x06\x76\x68\x8f\x8c\xee\xac\x94\x19\x56\x0f\xa9\x87\x6d\x24\x99\x2d\x5d" + "\xb2\x35\xe4\xaf\x7b\x4c\xcb\xfb\x54\x90\xdb\x01\xcc\xb8\x77\xdc\x49\x27\xa4\x45\xd8\x0b" + "\x45\xdc\xaa\x03\xf5\x2a\x7c\x6c\xed\xb4\xdb\xaf\x7e\x14\x14\x3b\x42\xa0\x41\xe3\x53\xba" + "\x22\x1c\x95\x06\x5a\xa1\xb5\xa4\x89\x8f\xe2\xc1\x1e\x6f\x05\xb4\xfa\x2d\xcc\x4f\x38\x8e" + "\x9c\xbe\x95\xb5\x88\xc9\xdb\x12\x82\x23\xce\xac\xf6\x4e\xc2\x2c\x21\x3f\x3b\x1a\x62\x5f" + "\xa0\xed\x35\xb8\xfe\x0c\xff\xd8\x03\xe2\xfe\xc9\x11\xcc\xaf\x4d\x82\x33\x4e\x7a\xfe\x31" + "\xc3\x9c\xf0\x1e\x42\x98\x91\x37\xf2\x9b\x46\x74\x29\x69\x6b\x83\x38\x68\xc9\x2b\xa1\x74" + "\x33\x65\x2d\xb4\xc0\x14\xa0\xbe\x03\xd7\x6e\x14\xb1\x34\x83\xfc\xd6\x2b\x05\x09\x03\x93" + "\xc7\xbb\x0d\x2b\xb4\x09\x8e\xe3\x0f\xab\x28\xb0\x09\x7f\x1a\x0b\xef\xdd\x6c\xb4\xbc\x98" + "\xc7\x46\xa2\x50\xce\x7d\xcc\xa1\xf4\x5b\xb6\x9c\x77\x11\x56\xe0\x0c\xd2\xaa\x7a\x87\x8a" + "\xee\x84\xb5\xc8\x7f\x5a\x19\xd5\xb1\x62\x98\x2c\x2f\x6b\xe0\x29\xd4\xb2\xb6\xd7", + 1, 1792 }, + { 0, 128, 10, "\x19\x2a\x67\xd5\x19\xf7\xea\x54\x16\x54\x0c\x42\x1e\x46\xd4\x11", NULL, + "\xb1\x28\xe5\x67\x81\xc1\x53\xc7\xbe\xa7\xfa\xb9\x0b\xf0\x6e\x73\xf5\x09\x3e\xe3\x90\xa5" + "\x3a\x1c\xe8\x08\x28\x56\xb8\xbe\xe1\x38\xb1\x68\x09\xae\x25\x11\x28\x03\x0e\x7c\x38\xbd" + "\x80\x8d\x0b\x7e\x46\x5e\x00\xa0\x70\x50\xac\x7c\x92\x72\x45\xb7\xe1\x4a\x40\xd3\xf3\xf5" + "\x17\x5d\xd3\xc3\x9a\x63\xa4\x5e\x0c\x69\x32\xad\x62\x55\x62\x14\x74\x87\x16\xdd\x34\x93" + "\x60\x8e\xb7\xb6\x6b\x44\xa6\x07\x77\x51\xa3\x86\xe6\x0b\xbf\xf6\xd9\x52\x3e\xa0\x06\x03" + "\x4a\xbd\xac\xdb\x23\x79\x71\x6f\x4c\x0d\xfa\xe5\xa4\x2f\x71\xe3\xbf\x9d\x96\xff\xf2\x53" + "\x0a\xec\xc8\x26\x90\xdc\x97\xba\xd7\xeb\xe1\x55\x49\x10\x5c\x3f\x30\x8f\xfc\x72\xd1\xcc" + "\xc5\xcc\x58\x36\x60\xbf\xe0\xe2\x74\x53\xca\x06\xa0\x88\xbb\xf0\x6e\x25\x8b\xa2\x1e\xcf" + "\x2e\xa3\x53\xd8\x6b\x4c\xaf\xa6\xe4\xfc\x01\xc0\x74\xb8\xea\x96\xd3\x1a\x49\x52\xdb\x1f" + "\x49\x6c\xe5\xb4\x5c\xfa\x8d\xb0\xd1\x5d\x04\x76\xe2\xc4\x6d\x58\x50\x9e\x67\x3f\x60\x56" + "\x4a\x26\x36\x20\xbc\x88\x72\x7f\xdd\xda\x28\xda\x21\x1a\x1d\x30\x3d\xe4\xb4\x8b\x95\xb7" + "\x1e\x9c\xb0\x98\x41\xe2\x8c\xd7\x37\x76\x15\x5f\xb5\x93\x3b\x74\xc1\xca\x69\xfb\xcf\x06" + "\x89\x76\xdb\xd0\x52\xc5\xf0\xac\xc5\xfb\x26\x74\x86\xca\x33\x31\xb8\x0b\xef\x64\x62\xa2" + "\xdf\xcd\x06\x4a\xe3\xf3\x09\x5d\x8c\x7a\xca\xfd\xba\x52\x5b\x78\xa1\x22\xce\xc6\x66\x4b" + "\xc8\x55\x54\xd7\xbf\xe3\x62\xa9\xb3\x3e\xb1\x19\xae\x8a\xf8\x95\x0e\xee\x88\x0f\x25\x2f" + "\x08\x8a\x59\xab\xdf\x4a\xb9\xda\x9f\x9c\xce\x65\xd5\xa8\x94\xa3\x52\xe3\x6c\x60\x93\x0c" + "\x76\x8a\x66\xf0\x06\x5d\x8a\x7e\x84\x6b\x88\xac\x46\xb5\x8e\x05\xa0\xa1\xf6\xe7\xd6\x42" + "\xe8\x4d\xee\x67\xf7\x24\xfe\x5a\xc6\x67\x81\xe3\xc0\xf0\x07\x5a\x43\x09\x57\x5b\x5b\x02" + "\x54\x5d\x8e\xcf\x6d\xab\x92\x6c\x47\x4b\x0f\xb1\xa8\xa7\x1b\x0c\x49\xfe\x3d\xc6\xa2\xcb" + "\x12\xcd\xec\x66\x90\xc2\x76\xd7\x49\xfe\x77\x3e\xdf\x88\x0f\x39\x91\x60\x26\xc6\xff\xc0" + "\x36\xdb\xd4\x4d\xe1\x90\xca\x96\x5e\x33\x85\x4f\x94\xb4\x42\x48\x42\xea\x06\x88\x3e\x8e" + "\xd8\x30\xd6\x68\x57\x2f\x4f\xd8\x81\x60\x09\x84\xb4\xd0\xeb\xcb\x01\xb1", + "\xb0\x7e\xc8\x17\x8e\xf0\x22\x28\x7b\xa1\xcf\x5f\xe9\xde\xb4\x68\xc9\x2d\x84\x69\x5b\x5b" + "\x21\x40\x31\xd0\x84\xe6\x0f\xce\xd3\x20\x00\xdc\x86\x6e\x17\x46\x82\xd4\xcd\x05\xf3\xb3" + "\x92\xad\x84\xe5\x6a\x94\xe8\xe8\x5e\xec\xab\xf7\xd1\x44\x7f\x47\xfc\xac\x3d\xc1\xd5\xf9" + "\x8e\xbe\x98\x0e\xa7\x5b\x73\xbe\x72\x53\x67\xad\xbf\x69\xe1\xcc\xa6\xa8\x6c\xbb\x3b\x9d" + "\x63\x3e\x3d\x13\xb2\x26\x25\xf1\x16\x9a\x7d\xd3\xf6\x1b\x37\x1a\x04\x0a\x0f\xd2\xff\x24" + "\xb7\xcf\x67\xdb\x20\x37\xd0\x38\xb6\xe4\xc9\x60\x43\x25\x6b\x69\x01\x74\xe4\x7c\x83\xa1" + "\x11\x97\x5f\xd9\x3b\x3d\x76\xdf\x3c\xfb\x21\x35\xc9\xfb\xe2\x30\x4c\x85\x64\xf6\x31\x73" + "\xbf\x3d\xd7\x82\x28\x19\xda\xc5\x64\xbd\x94\x56\xbe\xa5\xe8\x9a\x7c\xb5\x9e\xd7\xd4\x82" + "\x32\x37\x40\x49\x26\x21\xd4\x6e\x78\x67\x7b\xd5\xc1\x3f\x64\xd3\x81\xfe\xb8\x0e\x01\xb9" + "\x5b\x9f\x22\xd8\x66\xfb\xc1\xd3\x50\x9f\xe6\xbf\xc4\x99\xef\xbf\x26\x32\x6b\xd1\x13\x50" + "\x49\xc7\xa1\xfe\xb8\x45\x9e\xc8\x2d\xad\x8b\x67\x64\x54\xeb\x8e\xc0\xdc\xc1\x23\xb4\xb0" + "\xbc\x9c\x1b\xda\xcb\x8f\x5d\x97\x23\xc8\x35\x4c\xe8\x4e\x2b\x4e\xd9\xca\x15\x8e\xf4\x3f" + "\x9a\xd0\x8a\x81\x8f\xf5\xd2\xf4\xd5\x3c\x4a\x4b\xf9\xac\x57\x34\x72\xdd\x01\xb8\x8a\xe8" + "\xab\x0d\x25\x23\x38\x2f\xee\x91\xa5\xc2\x79\xf2\x69\x5f\x60\x24\x52\x7a\x14\x2f\xe4\x41" + "\x29\x21\x21\xa1\x52\x51\x04\x5c\x5e\x84\x5d\xaf\x0c\x1d\x0f\x58\x32\x15\xa5\x59\x40\x84" + "\xd0\xaa\x4b\x39\x95\xda\x9c\x13\x77\x09\x2c\x76\xd7\xbf\x3d\xa4\xb9\xb8\x35\x7a\xf4\x37" + "\xfe\x6f\x57\x3a\x4e\x3f\xee\x5e\xdc\x52\x8b\x42\xf4\x33\x36\x25\x2c\xe5\x0a\xf6\xc7\x52" + "\x6e\xa3\x06\x3d\x70\xe5\x64\xd2\xa6\x95\xcd\x9e\xd9\xcb\x56\xc9\x3f\x19\x06\x53\x1d\xe5" + "\xfc\x84\xf4\x4a\x66\x15\x09\xa6\x4f\x83\xe0\x6e\x3a\xa4\xf1\xe3\x79\x0b\x3a\xfd\x28\xba" + "\x5a\x60\xe5\x2e\x36\x50\xc8\x5f\xd6\xcc\xa9\x25\x62\x1d\x75\x61\xae\x1b\xed\x78\x30\x48" + "\x58\x9d\x06\xca\x73\xa6\xe0\x17\x6f\xa2\xce\x01\x14\x3a\xf1\xad\x32\x31\x55\x2b\x36\x5f" + "\xcf\x4e\x0c\xa2\x99\x91\x99\x6d\x94\xab\xef\xac\x7c\xf1\x84\x1e\x1d\x40\xcb\xf2\xd9\x1d" + "\xab\x94\x05\x1d\xbc\x33\xfb\x34\xe7\x1d\x6c\xdf", + 1, 3840 }, + { 0, 128, 11, "\xc9\x73\x46\xa5\xdf\xed\x38\x43\xc7\x58\x33\x30\xa5\x2c\x1a\x69", NULL, + "\x31\xd0\x36\xee\xad\xee\xce\x1b\x36\x96\x1c\x96\x7b\xce\x5a\xf6\xdf\x72\xe7\xbb\x8c\x33" + "\x0f\x99\x14\x4d\x68\x37\x22\x8f\x1a\xa3\x49\xb9\xaa\x25\xf2\x3c\x7b\xcf\x46\x6f\x9f\xa7" + "\xb0\xdb\x14\x69\x98\xd2\xa2\x82\x42\x13\x3f\x0a\x42\xd8\xce\x9a\x23\x92\xc5\x2e\x25\x7e" + "\x7d\xd1\xf3\xa5\xd6\x4d\xac\xfc\xaa\x02\xe8\x93\xca\x8d\xf0\x0f\x43\xde\xe2\xb3\x9d\x33" + "\x85\xf4\x62\xaf\x91\x7b\x6d\x4e\x4c\x48\x30\xc7\x93\x64\xac\x4c\xac\xb8\xc6\xc3\xbc\x2a" + "\xfc\xae\xbb\xec\x4a\x33\xad\x6d\x2b\xb0\xc0\xec\xe1\xd1\x33\xcd\xd4\xbb\x2d\x87\xeb\xe4" + "\x25\xdf\x74\xac\xf2\xd5\x4c\xf9\xc1\x93\x39\x31\x42\x71\x6b\x4d\x29\xcc\x18\x76\xe3\xb4" + "\x8f\x96\x49\xb5\x66\x74\xb6\x7b\x39\x6a\xbd\x38\x1a\x53\x6a\xda\x22\x47\x2c\xe8\xcf\x7b" + "\x35\x7e\x4d\xe7\xbc\x17\xc8\xc7\xb4\x8a\x71\x6b\x94\xbf\x09\x0d\x8a\x6f\x00\xf6\x87\x2a" + "\xe2\xe7\x93\x1f\xab\x78\x9d\x44\x3d\xc4\xa1\x74\x60\x9f\x44\xb5\x61\x84\xc4\xe7\x1b\xed" + "\xa8\x13\xc7\xc5\x84\x69\xaa\xa2\xb0\xf3\x0d\x31\x6d\x60\xd9\xef\x84\x44\xef\x4a", + "\x7d\xd2\x9b\xc5\x17\x55\x34\x40\x0f\xf6\x99\xb8\x5a\x90\x53\xe8\xb7\x83\x55\x1a\x18\x67" + "\xc9\x00\xcc\xd7\x43\x7c\x1b\x65\x9d\x11\x66\xa1\xa0\x32\x07\x43\xeb\xf0\x47\xe1\x74\x98" + "\x5a\xda\x31\x27\xa8\x5f\xa1\xea\x3f\x67\xca\xb4\xa7\xbb\xe7\x40\xd0\x91\x43\xbd\xf3\x55" + "\xda\x95\xb4\xfc\x0f\xc4\x0a\xdd\x99\x5c\xe4\xa0\x6c\x6d\x57\x4c\xa3\xfa\x9c\x78\x20\xee" + "\x55\xfe\x5c\xb7\x57\x1e\xee\x88\xe6\x40\xcc\x47\x44\xcf\x71\x92\x75\x0f\xc1\x74\x59\xb4" + "\xbb\x05\xc4\x19\x58\x52\x73\xc4\xc0\x24\x75\x5c\xcb\xb7\x84\xa6\x17\x32\xe8\xbb\x1c\xf9" + "\xc3\x46\x6f\x2c\x1b\x7b\x5d\x20\x90\x6e\x72\xe7\x86\xe4\xce\x60\xc0\x1d\x69\xac\xc9\x62" + "\xcf\xbf\x1a\x22\x56\xb9\xb1\x4b\x75\xf3\xbd\xa3\x0e\x4d\x31\xa1\xd3\xa1\x36\x42\x35\x6a" + "\xca\x4f\x42\xc2\x09\x15\x6e\xc3\xbb\xab\xd3\x6d\x9b\x36\x2b\x8a\xe9\xc0\xf6\xcd\x52\xdb" + "\x64\x0a\x83\xb1\x25\xd8\x4c\x3a\x18\x3a\x84\xe3\x0d\xae\xc7\x8d\x55\xdf\x2e\xf7\x7a\x45" + "\xd1\x34\x5b\xb0\xf0\x56\xd2\xb4\x77\x61\x5a\x72\x9b\x54\x00\x5f\xf2\x29\x3f\x2c\x30\xa3" + "\x57\x01\x58\xb7\x03\x9b\x2f\xed\x4c\x48\x95\x80\x4d\xf5", + 1, 1920 }, + { 0, 128, 12, "\x6f\x1e\x3a\xf9\xd9\xcc\x23\x6f\x77\x2c\x02\x52\xca\x40\xb5\x1f", NULL, + "\x1e\x65\x63\x2c\x8f\xe7\x23\x01\x6d\xf2\x6d\x3d\xcd\x44\x3e\x0d\xf8\xe4\x9d\x5f\x25\xc6" + "\x16\x0b\x9b\x28\x52\x93\x97\x9a\x12\xd4\xec\x90\x95\x52\xdf\x00\x60\x02\x48\xe1\x8b\x36" + "\x80\xc5\xc3\x22\x47\x52\x47\xce\x1e\x6c\x8e\xd3\x3c\x4d\x6b\xe1\x08\xdb\xf1\xa7\x17\xd2" + "\x17\x32\x8c\x7b\x18\x26\x37\xf7\xaa\x93\xc6\xec\xd9\x69\x39\xd5\x61\x78\x85\x3a\xf6\x43" + "\x43\x84\x0e\x38\x71\xc2\x03\x57\x05\xea\x37\xa0\x52\x48\x3b\x97\x2b\x33\x81\xe8\xf2\x6f" + "\xf3\xed\xaa\xa2\xf1\xc4\x66\x68\x99\xf8\xb7\xaf\xbf\xaf\x00\x82\x6a\x92\x09\x2f\x24\x77" + "\x4d\x2b\x34\xc9\x23\x2b\x0b\x20\x12\x2b\x7c\x4b\x2d\x1b\x83\x67\x82\xdf\x23\xf8\xc4\x90" + "\x10\x5b\x6e\x61\xa9\x33\x21\xe5\xd2\xbe\x88\xe0\x96\xb2\x14\xa2\xfd\xb9\x34\xbb\x62\xda" + "\xb1\x06\x49\xed\xbe\xb7\x3b\xa7\x78\x22\xfe\xb6\x5a\x4a\xe6\xdd\x52\x6a\x8c\xdd\x00\xb0" + "\xc1\x8b\xca\xce\x40\x17\x67\x21\x5b\x18\xf8\x66\x6b\xa4\xca\xb3\x92\x61\x92\x9d\xb0\xb1" + "\x1f\x2d\x14\x86\x62\x57\x74\x2a\x30\xe7\x7e\xc7\xcf\xb6\x5b\xb3\x1b\x52\xf7\x83\x48\x08" + "\x13\x2f\xae\x63\xbc\x0e\x06\x88\x0c\x21\xcc\xc7\x9a\x26\x99\xcc\xb3\x6c\xef\xd7\xf7\xe8" + "\x23\x25\x59\xa1\xbd\x1e\x89\x45\x64\x32\xf7\x92\xee\x9e\xd8\x64\xd9\x54\xf4\xc0\x24\xa6" + "\x95\xec\xf5\x1b\xed\x58\x75\x4f\x12\xc1\xdd\x4b\xc6\x40\xfd\x0f\xd8\x11\x94\x30\x7d\x11" + "\xa9\xb2\x60\x14\x40\x24\xad\x18\x25\xa5\x84\x87", + "\xb1\xb3\x7d\x0c\xe1\x06\x62\x22\xa6\xdc\x91\x51\x61\x95\x25\xc3\x79\x84\xa7\x7e\xbf\x40" + "\x3b\x74\xf9\x04\xc6\xda\x82\x78\x5d\x21\x89\xf2\xdf\xca\xf9\xd1\xca\xff\x2c\x6d\xb0\xa1" + "\x1f\xba\xea\x87\x77\x7c\x76\xcc\x98\xaf\x51\x12\x3a\x56\x65\x4d\x90\xc1\x7b\x08\x8f\xa6" + "\x80\x0b\x50\x30\xd6\xaa\xa0\xe9\x94\xcd\x1b\x77\xf7\x22\x98\xbd\xc2\xfb\x3b\xd3\x50\xff" + "\x8d\xcd\x25\xfb\x48\xd5\x18\x41\xe0\xd0\xaf\xdb\x71\x7e\xf5\x3b\x0a\x81\x94\xb2\x73\x5f" + "\x50\xdb\xfa\x48\x17\x18\x37\x08\x55\x70\x83\xb9\xe4\xe5\x2c\x7b\xdc\xf0\xf5\x0e\x5e\x5b" + "\xb3\xec\xe0\xe4\xc9\x74\xee\xf7\x25\xdd\xd6\x9e\xa3\xae\xc6\xf7\xba\xf5\x78\x7c\x83\xac" + "\x6c\xec\xe5\x68\x98\xf7\x62\x0a\xd0\x0f\xad\xcc\x29\x90\xf3\xe2\x26\x60\x5a\xbc\x06\xb4" + "\xff\x28\x66\xe8\x9a\x6a\xfb\x83\xef\xe9\xcb\x7d\xa2\xe1\xf6\x09\x52\x69\x60\x02\x06\x95" + "\x6d\x20\xe3\x18\x40\x7d\x1e\xe6\x68\x2c\xd0\x2a\x32\xbe\x07\x38\xb3\xb9\x96\x5a\xdf\x65" + "\xbb\x24\xf9\xaa\xf3\x99\x53\x92\x71\x51\x2e\x73\xfc\xc4\x81\xb1\xb7\xee\x66\x69\xff\xfd" + "\x83\x3a\x26\xfe\x7e\xec\x80\x55\xc4\x60\xcb\x16\x1a\x60\x93\xdd\x9d\xd4\x16\xa4\x8b\xb6" + "\xcd\x87\x59\x37\xbf\x95\x44\x9f\x83\xd3\x0a\x80\x45\x7f\x51\xbd\x02\x86\xca\xce\x73\x03" + "\xa3\x73\xb4\x2a\xf2\xf6\x81\xda\xb7\x5d\x3a\xf8\x67\xab\xbd\x62\x72\xa7\xb3\xd1\xdb\xfa" + "\x52\x71\x0f\x88\x79\xea\xf7\x7e\x8d\x9b\xfe\x0d\x4c\x61\x62\xf9\x70\x91\x26\x2b\x15\xaf" + "\x23\x2d\x04\xf6\xef\x76", + 1, 2560 }, + { 0, 128, 13, "\x78\x85\xb2\x28\xbc\xdc\x45\x6e\xf7\x7d\x1a\xe7\x5b\x34\x11\x5b", NULL, + "\xfd\xd7\x66\x37\x86\x80\xf6\xb7\x5e\xf1\x97\x07\xfa\xfd\x1f\x2c\xa3\x58\x03\xc8\x5a\x73" + "\x0a\xa5\x43\x9b\x71\x83\x05\x8c\x06\x51\x6f\x48\xad\xc5\x5c\xcf\x9e\x72\x47\xad\x91\x06" + "\x27\x19\x1d\x9e\x33\x33\x8f\x9a\x03\x2e\x22\xc5\x23\xc6\x2a\x04\x05\xb4\xaa\xdc\x44\x22" + "\x49\x85\xa1\xfa\x91\x81\x50\x90\xe9\x7d\xb8\x3c\x17\x43\x23\x88\x73\xb2\xa0\xfc\x1a\x82" + "\x40\x8c\x52\x73\x77\xde\x62\x43\x6b\x0d\x47\x19\xbd\x29\x97\x5e\xe1\xc6\x1d\x9a\xa1\x7b" + "\xbc\x0f\x2a\x22\x4d\x37\x02\x8a\x37\x78\x65\x3e\xdb\x85\xca\x4c\xe3\xc2\x73\xe9\xc8\x36" + "\xac\x69\x36\x7d\x62\x35\x7c\x4d\x0e\x7a\xec\xa9\x74\xfb\x65\x3d\xed\xa5\xf5\x51\xd9\x45" + "\x21\xb4\xcd\x48\xbc\xc3\x2c\xc6\xd7\x1e\x9b\x76\x96\x9c\xa5\xd3\xc2\xcd\x21\xcf\x25\x0e" + "\x25\x6e\xdc\x06\xc2\xa3\x47\x08\x00\xaa\x79\xe8\xfa\xbb\x6f\xd3\xea\x40\x88\x88\xf0\x4b" + "\x0e\x00\xa6\xaa\xf8\xf3\x6d\x33\x73\x68\x02\xe2\xcd\x56\x22\x68\xee\xcd\xa6\x33\xec\x92" + "\xff\x0f\x6d\xc0\xa9\x4a\xad\xfa\x42\x9a\xb5\x51\x1a\x78\x1e\x20\xef\xf9\xed\x7f\xe2\x0a" + "\xec\xef\xfc\xad\x30\x3f\x38\x16\x98\x06\x60\x9b\x42\x4a\x35\xcc\x29\xe1\x3c\xfa\xeb\xac" + "\x46\x0e\x2c\xe3\xde\x29\x0a\x5f\x64\xd0\x01\xac\xf9\x16\x2f\xb2\x77\x7c\xf7\xaa\xa2\xb2" + "\x9a\x95\x11\xf6\xfa\x0c\xad\x14\xc1\xb4\x60\xa4\xc1\xea\x82\xf2\x11\x7a\x9a\x97\x44\xd9" + "\xb7\x37\x50\x2c\xcb\x6c\x7c\xe8\xc9\x0b\xb6\x46\xed\xd9\x4e\x8f\x8c\x27\x54\x70\xd1\x8c" + "\xdd\x86\x28\xbc\xed\x74\x40\x52\x1a\xf6\xaf\xd5\x35\xa5\xab\xee\xe2\xbd\x68\x6c\x28\x15" + "\x14\x36\x67\xf2\x17\xae\x38\x8b\x59\x05\x9b\x85\xdd\xbf\xb2\xbf\xf4\xb7\xe7\x1e\x5a\x11" + "\x0f\xa8\x5c\x1e\xdf\x92\xbd\x76\x9b\x78\x64\x93\x2a\x50\x90\xe9\x4a\xe2\x15\xa4\x66\x9b" + "\x9d\x9a\xbf\xec\x72\xd4\x7b\x80\xc2\xc2\x1d\x16\x6e\xfc\xae\x2b\x32\x27\xbd\x00\x09\x73" + "\xbf\x3c\x7f\x53\xf1\xb4\x89\xdc\x85\xbd\x09\xc2\x3d\x43\x6d\x1f\x91\xf7\xca\x5a\x89\x04" + "\x3d\xd3\x3a\x30\xbe\x15\xd9\x58\xb6\x2e\xa8\xd7\x49\x26\xad\xfc\x90\xe8\x1a\x82\xb0\x8f" + "\x12\x87\x67\xa7\x8f\x14\xe3\xc7\xf6\x79\xcf\xe9\x69\x96\x7c\x66\x2c\xf8", + "\x95\x4a\x59\x9c\xbe\x49\x1a\x87\xea\xb1\x52\x1f\x1a\xa4\x12\xad\x0f\x1e\xc1\x4d\x25\xa8" + "\xe6\x4c\x85\x93\x81\x9e\x0b\x79\x89\x52\x8e\x30\x41\x09\xf0\xbb\x95\x3d\xed\x44\x15\xcc" + "\xcd\xf1\xe1\x14\xce\x20\x20\xbb\xb4\xe8\x0f\x9a\x6a\xcf\x10\x65\xbc\xb9\x3e\x18\xee\x03" + "\x1e\x67\xfe\x0a\x4f\x51\x28\x3b\x74\xa4\x06\xd6\xfb\xd2\x03\x6b\xc0\x8c\xcc\x8a\xa4\xe7" + "\x62\xb6\xfa\x29\xb4\xa0\x24\x1f\x46\x9e\x70\xa9\x2f\x88\x3e\x29\x54\xd8\x4a\x94\xda\xbd" + "\x93\x28\xad\x9e\xc2\xd9\x2d\x4c\x62\x59\xfe\x0b\xa9\xe1\x2d\x16\xf1\xb2\xe5\x12\x95\x70" + "\xa8\x32\xdb\xc2\xfe\x5f\x6b\x32\x5e\xb3\xc8\x3f\x61\xd1\xd7\xff\xf3\x45\x24\x3e\x76\xb0" + "\xc2\xd9\x21\xec\xf7\xfd\xd0\x18\xcf\x47\xd8\x64\x12\x5b\x66\x58\xde\xb0\x15\xef\x01\x64" + "\x6a\x26\xd8\xa3\x22\x3b\xdc\x45\x61\x0f\x36\x7b\x00\xaa\xf0\xcb\xdb\xef\x6f\x35\xef\x16" + "\x7a\x82\x89\x18\x13\x72\x5c\xa1\x24\x6d\xea\x80\xc3\x12\xbe\x3f\x70\x44\x3a\xe5\xc5\x65" + "\x20\x9f\x98\xdc\x7d\xee\x7c\x5d\xec\x21\x63\xb7\x70\xe2\x3e\x8e\xd2\x60\x0e\xaf\x01\xaa" + "\xef\xf3\x8f\x06\x08\x12\x01\xab\xf0\xbc\xb0\xcc\xb5\x1d\x1e\xee\xe3\xe3\x6f\xad\x18\xa7" + "\xf5\x73\x5d\xa2\x7b\xae\xc4\xed\x05\x7a\x2a\xad\x14\x70\x73\x0e\x9f\xa4\x21\xa9\x72\x7b" + "\xa9\xf1\xf7\xe5\xa4\x40\x9e\xc7\xf8\xd6\x02\x09\xe6\xeb\xb1\x41\x84\x32\x41\xc5\xc0\x3c" + "\x5f\x59\x84\xfe\x51\xc9\xc6\xa5\x5e\x63\x13\x43\x46\x17\x73\x7b\xeb\x2f\xbf\xa0\xf0\x72" + "\x61\xb3\x22\x26\x7d\x50\x02\x88\xba\xb6\x49\xa5\x3f\x81\xa4\xe2\x2f\x36\xf7\x10\x1d\xa6" + "\xc3\xed\x5e\xa6\x72\x75\x35\x63\x15\x1f\xe7\xed\x59\xc2\xde\xee\x99\xef\xa6\x75\x4d\x10" + "\x38\x1a\x16\x0c\x82\x06\x73\xbc\x35\x38\x72\x5b\x47\xda\x44\x5d\x2b\xbe\x0c\xbf\xdf\xd4" + "\xed\x2e\x54\xce\x2f\x92\x27\xd3\xbc\xf9\xb0\xcd\x68\xba\x17\x31\x4c\xe9\xc8\xcb\xaa\x8a" + "\xc5\xd9\x0d\x66\x03\x04\xa8\x5e\x6f\xf4\x22\xe8\x52\x65\x44\x03\x6f\x9c\xbd\x13\xba\x46" + "\xd9\xb4\xe9\x28\xf0\x69\x22\x23\xbe\xec\x48\x00\x26\xd8\x7d\x93\x87\x8f\xd0\x86\xae\x72" + "\x93\xb4\xd3\x80\xbd\x82\x11\xb0\xb7\xfc\x74\x0c\x70\x7b\x69\x8f\xe0\xb1\x08\x38\xe8\x79" + "\xac\x4d\x19\xac\x38\xf5\x95\xbe\x8f\xc5\x8f\x8a", + 1, 3840 }, + { 0, 128, 14, "\x40\xac\x4c\x0f\xdb\x02\xb8\x61\xa2\x42\xf7\xfe\x51\x6e\x49\x56", NULL, + "\xaf\x2c\xe4\xa3\x5a\x5a\x4e\x61\x02\x60\xcc\xde\x07\xe2\x1e\x1e\x56\xd7\xcf\x68\xa5\x31" + "\x3f\x14\x0a\xfc\xd2\x48\xb4\x25\x1e\xac\x6c\x58\x53\x43\x7c\xa5\x21\x34\x6d\xc8\x71\x80" + "\x36\x0e\x1a\x3d\x40\xab\xac\x8f\xd8\x7a\xfa\xf8\x9d\xa0\xca\x14\x09\x93\x4a\x3f\xf3\x9b" + "\x58\xe4\x5b\xfd\x02\x06\xe1\x71\x2e\x76\xfd\x81\xb8\x40\x65\x8c\x6b\x62\xc1\x9d\x45\x5e" + "\x5e\x95\xbb\x14\xb3\xf7\x0f\x4a\xae\x10\xaf\xd3\xeb\xa4\x9a\xd7\x47\x7b\x54\x4d\x09\x4f" + "\xd1\xeb\x56\xd5\xd2\x9d\xbe\xc2\x85\x27\x7f\x0f\xc9\xfc\x90\x10\x6c\xa1\x93\x2f\xbb\x6e" + "\xee\x86\x77\xd8\xbe\x4c\xf0\x5d\x4a\xe7\x46\xdb\xd6\xcd\x6b\x22\x66\x14\x95\xd0\x19\x40" + "\x8d\x3d\xf8\x0e\x19\xaa", + "\x8a\xe0\xe3\x59\x95\x48\x1c\xb8\xef\xb7\xa6\x57\xf3\xaf\x98\x59\xa0\x0b\x3a\x6e\x97\x08" + "\x5f\x64\x4e\x68\x70\xe2\x7c\x82\xb8\x7c\xe4\x5c\xf8\x90\x2f\x62\xb3\xe6\x5b\x39\xf6\xbb" + "\x32\xb5\xed\x87\x2c\xee\xff\xff\x27\xdf\xc8\x49\x1a\x58\xcb\xb7\x68\xfe\x64\x93\x4c\x20" + "\xe0\xae\x3a\x70\x0f\xc3\xe8\xca\x63\x2e\xc3\xbe\xff\x95\x1d\xc9\x78\x9a\xff\xb0\x28\x65" + "\x53\xe2\xfc\xd7\xc0\xdf\xa0\x95\x0c\x4d\x6d\x31\xf3\x93\xa3\xb1\x16\xf1\x6e\x14\x97\x5c" + "\x38\x48\x39\xb7\x8b\xe5\x60\x65\x65\xfb\x03\x87\xa4\x8f\x81\x71\x54\x01\x95\x25\x27\x01" + "\xa2\xaa\x3d\xd2\x96\x58\x88\x96\x8a\x7e\x9f\xf5\xc3\x76\xd9\xcd\x8e\xd0\x90\x60\xfe\x2a" + "\x3b\xe2\x77\x31\xd7\xc8\x91\x18\x3d\xd3\x1d\xce\x3e\x63\x3b\x9a\x1f\xa0\xb4\xd1\x16" + "\x8f", + 1, 1280 }, + { 0, 128, 15, "\x37\xde\x30\x6a\xa6\x63\x83\x00\xbe\x51\xca\x91\xa7\x5e\x88\x55", NULL, + "\x41\x24\x70\x68\x00\xc5\x18\x6e\x5a\xda\x49\x1e\xf6\x6a\x58\x83\x14\xf2\x2b\xd3\xc7\x40" + "\xbe\x14\x45\x49\x28\xac\x41\x61\x48\xcb\xfb\x11\xf2\x29\xb8\x9e\x3a\xaa\x8d\x89\x95\xa1" + "\x92\xb3\x95\xcd", + "\x8e\xbe\xc5\x20\x4a\xf0\x3a\xcd\xc4\x5f\x46\xc6\x3d\xa4\xe5\xd9\x2c\x26\x8d\x4b\xef\x39" + "\xa8\xc7\x1a\xa4\xa6\xf6\x72\x21\xf8\xa1\x9f\xf4\x98\x29\x88\xf9\x87\x22\x80\xda\x37\xe5" + "\xe2\xea\x12\x3a\x5f\xc3\x62\x14\x74\xe4\x46\xc8\xe7\xee\x52\x62\x09\xb1\xe2\x25", + 1, 384 }, + { 0, 128, 16, "\x7e\xf2\x31\x09\xfe\x52\xb4\x48\x21\xa0\xae\xdc\x13\xa1\xcb\x11", NULL, + "\xe7\x01\x1f\x85\x6e\x80\x84\x6c\xc0\xd3\x79\xa0\xc7\x7e\x21\x60\x46\xcb\x87\x64\x94\x12" + "\x89\xa6\xf7\x9e\xc2\xad\x05\x21\x1b\xd2\x2d\xd3\xef\xfd\x3e\x93\xc7\x62\xd9\x60\xe6\x5f" + "\x4c\x2c\xa9\x46\xe1\x9b\xcb\xd3\x5c\x2c\x2e\xba\xe9\xdc\xfb\xd3\xd8\x0f\x05\x65\x61\xe3" + "\x22\x4e\x45\xdc\x87\x27\xad\x11\x91\xdf\x9c\x33\x3e\x32\xd5\xa1\x16\x95\x32\xc0\x56\xdb" + "\x4e\x04\x10\xc5\x35\x39\xb7\x1d\xb6\x34\x56\xf8\xd3\xc4\xd4\x7e\x30\xcb\x3b\x46\x43\x2f" + "\xe5\x03\xfb\x42\x80\xb4\xc3\x1f\x50\x23\x30\xa1\xf1\xe4\x8b\xf5\x17\x59\x1a\xe0\xdb\x02" + "\xcd\x76\x5d\x3f\xc3\x53\xf8\x02\x3c\x8f\xc5\x2f\xe8\xd6\x4e\xd1\x8f\x68\x2f\x10\x6a\x94" + "\xb2\x7b\xa2\xf1\xf9\xeb\x11\x5d\xb7\xe2\xec\x0f\x0e\xc3\x5d\xb6\x7e\xd9\xef\xf6\x1c\xc8" + "\x6b\x18\xf7\x41\xb4\xf5\xe4\x5a\x24\xcd\xf5\x71\x5c\x50\x75\x18\x4c\xd4\x1f\xd5\xd3\xe1" + "\x14\x14\x30\x4e\x57\x4d\x55\x26\x5d\xb8", + "\xd3\x99\x89\xfa\xb6\xb3\xc9\x85\x0e\xb6\xd1\x62\x5a\xbe\x8f\x67\xf9\x3c\xea\x9b\x16\xf7" + "\xb9\xc2\x95\x12\x58\x98\x82\xa1\xcb\xd9\xc8\x75\xcf\x18\xa1\x93\xe5\x1d\x50\x96\x8a\xf2" + "\xed\x41\xfc\x4a\x31\x5b\xdd\x47\xcc\xf0\xfb\xfa\xe3\xea\xa0\x8c\xb4\xbc\x4e\x33\x6d\x0c" + "\x67\x9e\x1a\xaa\x8b\xe0\x85\xc1\xc5\x31\x69\xee\xa9\x75\xb9\xbb\x00\x72\x5a\x10\xd4\xcb" + "\x6a\xe5\x5d\xc0\xde\x62\x00\x2b\x31\x41\x84\xce\xa1\xb7\xe5\xca\xbd\x9d\xb8\xd6\xff\x71" + "\xda\x9f\xe0\x41\xee\x5e\x8b\xa6\x21\xd4\x4b\x65\xe0\x1a\xe2\x3a\x7e\x1e\xd5\x07\xa7\x78" + "\x1c\x5e\x58\x5a\xdb\x21\xfd\x63\x79\xc0\xd8\x83\x37\x78\xc3\xdd\xc5\x8a\x7d\x91\xed\xdd" + "\x68\x89\x52\xce\x37\x73\x99\x01\x32\x84\xd5\xb8\x08\xac\x0d\xd3\x70\x58\x6d\x61\x89\x3b" + "\x5c\x33\x6c\x89\x86\xd1\x10\xa0\x59\xac\xe9\x0c\xf8\x54\x69\x77\x79\x44\x01\x83\x3c\x3a" + "\x13\xa2\x44\xe1\x17\x37\xa5\x96\xbf\x08\xfd\x03\xe8\x25\xc4\xe0\xeb\xee\x7b\x41\x76\x54" + "\xf7\x5c\x1c\x94", + 1, 1664 }, + { 0, 128, 17, "\x2d\x7e\xc2\x6e\x0b\x8d\x56\x6a\xcc\xe3\xfb\x93\x59\x62\x0a\x01", NULL, + "\x4d\x76\x03\xba\x68\x22\x6c\x35\x86\x81\x9f\xae\x58\x4a\x70\x93\x70\xa9\x21\xe5\x2d\x6b" + "\x1e\x66\x56\x79\xe6\xd7\x95\x7e\x3e\x61\x55\x79\xbd\x18\xe3\x0e\x4d\x53\xe2\xa2\x43\x26" + "\xb1\xb8\x3f\x81\x2d\xba\x6c\xd1\x40\xcf\x8a\x8d\xfd\x91\x06\x3d\x64\x13\x4c\x05\xcb\x7b" + "\x42\xc5\xa6\xdb\x87\x7f\x53\x47\x86\x64\xd5\xa4\xe0\x54\x25\xf5\xff\xa0\x5b\x0a\x58\xa3" + "\xdc\xdc\x13\xf6\xce\x0b\x6d\x89\xd2\x7c\x16\xd3\xb8\xf1\xdd\x7c\x52\x95\xd2\x78\xf6\xb0" + "\xe4\x59\xce\xf1\xf0\xd5\x23\x1a\xe5\x7b\x53\xa8\x28\xe6\x69\x5f\x59\x4b\x9e\x95\x7f\x76" + "\x2d\x58\x84\x1a\x3e\x8f\x9a\x6c\x81\x2c\x87\x6f\x8e\xb6\xbe\xe6\x39\xac\x53\x93\x86\xa2" + "\x72\x01\x46\x7f\x07\xa8\x71\x19\x8f\xac\x66\xeb\xa1\x66\xc5\x50\x1d\x2c\x5c\x03\x0d\x4d" + "\x9d\x5a\xb5\xc1\x4f\xdc\xde\x5e\xdb\xf9\x00\x33\x4f\x46\x2a\xfe\x9b\x10\x5b\x60\x40\x9d" + "\x46\x46\x25\x94\x11\xa8\x13\xba\xbc\x5a\x59\xca\x6d\xf3\x05\xc6\x7a\xc2\xc4\xa6\xf5\xa8" + "\xef\x6f\x98\xfe\x9d\x05\xac\x91\xb3\xc9\x27\x10\x0a\x3c\x4f\x0c\x40\x88\x99\xdb\x20\x1b" + "\x62\xc1\x1a\xec\x67\x02\xd4\x83\xcd\xad\x1e\xc1\x41\xf6\x92\x7e\x89\x1e\xb5\x22\xc6\x94" + "\x6a\xfb\xb4\xc6\x23\x75\xe1\x2f\x90\xe0\x03\x9a\x94\xe0\xb5\xfe\xad\x0c\xcf\xb3\x86\x4c" + "\x8c\xb3\x2f\x9b\x1b\x04\x00\x84\x56\xa9\x26\x4f\x9b\xe0\xbf\x72\x40\xea\x32\x1e\xe4\xeb" + "\xdf\x65\x9e\xdb\xda\xac\x4f\x28\x58\x9d\x6b\x44\x67\xb6\x12\x31\x67\x71\xda\x9e\x76\xca" + "\x33\x4e\x0f\x94\x1f\xac\xa0\x72\x66\xe1\xdc\xa2\xd5\x83\xa9\xaf\x84\x62\xcb\x1d\x56\x55" + "\x77\x63\xfe\x10\x2d\xc5\x97\xe2\x63\x45\x49\x6d\x23\xef\xac\x22\x90\x5e\x50\x1f\x68\x38" + "\x6d\xc1\x3b\x29\x1a\xde\xab\x5d\x86\x11\x32\x62\x25\x4a\x4e\xa6\xcb\xdc\x31\x3d\x8a\x55" + "\xf3\x3b\xf3\xb8\xb3\x8d\xc9\x48\x54\xb1\x06\x12\x5e\x17\xb8\x10\x8a\xce\x28\x51\x5e\x89" + "\x16\x00\x8c\xd7\xe9\x52\x61\x44\x7b\x5b\xe4\x7e\xbf\xba\x89\xd1\x19\xc8\xc8\xcc\x05\x60" + "\xdf\x0e\x7e\x4c\xb3\xd8\x18\x37", + "\x33\x42\xf9\xbb\x43\x5d\x11\x0d\xd8\x0f\x73\x32\x2f\x42\x1e\x10\x42\xf6\x8d\xaf\xf1\xe9" + "\xb6\xec\x51\xc5\x76\x4e\xd3\xd8\xf8\x48\x79\x56\x07\x4c\x24\xd8\x08\x08\x16\x8a\x13\xee" + "\xab\x0c\x1a\xd4\x76\xc3\x98\xba\xd2\x10\x01\x10\x19\x35\x41\x1a\xd1\x0d\x47\x3a\xc8\xdc" + "\xfa\x9b\xb9\x06\xb9\x9b\x80\x8a\xfb\x4c\x0a\x46\xc7\xa2\x92\x89\xed\x82\x15\xcd\x97\xd1" + "\x61\x5e\x41\xa6\x3e\x73\x84\x57\x81\x66\xfc\xeb\x3e\x0f\x0f\xb6\x6a\x1d\x1a\xbf\xf0\x6c" + "\x79\x2c\x7c\x37\x90\x73\xc8\x45\x24\xba\x22\x8e\x42\x9a\x5e\xde\xb5\x66\xec\xc4\x67\x81" + "\x87\xbc\x3b\xdf\x9b\x67\x6d\xb3\x48\x8a\x07\x49\xfa\x99\x58\xbb\xd5\x18\x83\x4e\x68\x77" + "\x3d\x3c\xad\x49\x7c\xc5\x48\xfe\xb4\x92\x4d\xcc\x04\xaf\x64\x3c\xc7\x8b\x29\x60\x5d\x2e" + "\xda\x8f\x1e\x09\xf3\xbd\xa6\x94\xbb\xc5\x90\xd8\x3b\x14\xdd\xbb\xaf\xb2\x34\x3b\xfa\x4c" + "\xc7\x22\xc5\x84\x9c\x5c\x77\xd5\xca\xfc\xc3\x06\x26\x17\x2c\x80\x29\x62\xdc\x29\x00\x5b" + "\x61\x2f\x99\xcf\x7b\xd3\xb2\x09\xe5\x31\x66\x3d\xd0\x1d\xc0\x45\xdf\x6c\x24\x5d\xb6\x1a" + "\x84\xbb\xf5\xdc\x48\x8d\x1a\x3d\x1e\x3e\xdd\xb7\x7b\x37\x88\x34\x20\x2c\x84\xf5\x02\x84" + "\x7f\x33\xf3\xe1\xb3\xb0\x8e\x48\xb8\x9d\x4f\x8d\x62\xf0\x3a\xfd\x3e\x2e\x22\x8b\xc9\x25" + "\x45\x21\x16\xae\xee\x52\x31\x87\xbb\x0e\x13\x26\x12\xdd\xc2\x50\x1d\x91\xc5\xa1\x94\x87" + "\x9f\x94\x75\xf5\x89\xb6\xc3\x90\x1e\x84\x25\x86\xfa\x1d\x27\x7b\xc2\x3e\xd9\x78\x10\x3c" + "\xc0\xce\xf7\x92\xc8\xbc\x81\x27\x49\x02\xc1\xea\xbc\x6e\x21\xf7\xaa\x73\xc8\xa0\x4e\xcd" + "\xc7\xb2\x78\x59\xae\xe8\xa5\x66\x81\xdb\x70\xbd\x43\x34\x07\xc0\x32\xff\x72\x0f\x51\x57" + "\xce\xff\x21\x6e\x61\x33\x6d\x00\x9c\xd0\xb5\xf5\x31\xda\x3d\x29\x59\x38\xe2\x4c\x2e\x13" + "\xf4\x5b\xe9\xb6\x00\x3c\x76\x20\xfb\x59\x0a\x40\xbb\x9f\x0c\x1e\x15\xc3\x36\xcd\x60\xae" + "\xb5\xf9\xbf\x38\xc5\xeb\xbf\xae\xe4\x1e\xb1\x14\xfe\x9b\x3b\x90\x31\xf1\x72\x53\x69\xb8" + "\x98\xd2\xa4\x1c\x65\x2a\xa5\x8d\x99\xb3\x14\xf3\xa9\xaf\x08\xe2\xb3\x93\x00\xca\x96\xfc" + "\x29\x8f", + 1, 3584 }, + { 0, 128, 18, "\x34\x67\xb8\x80\x22\x46\xb5\xdc\xa3\x14\xe1\x8c\xe3\x6a\x67\x5c", NULL, + "\x9a\xf0\x0e\x4b\x2b\xff\x2b\xe1\xa6\x95\x7d\x52\x1a\x4a\x98\x38\x53\x95\x3d\x2d\x2a\xf8" + "\x11\x81\x77\x0c\x10\xb3\xa9\x04\x59\x14\xb1\xca\xf4\x99\xde\x10\x14\x58\x61\x11\xc7\xa0" + "\xb8\xe2\x15\x5b\x09\x99\x4b\x06\x53\xd7\x25\xc5\x34\x55\x28\xff\xc7\xb9\x6e\x59\xe3\x3a" + "\xe0\x04\x0e\x9e\xf3\x31\xa3\xeb\xd1\xd2\x7a\xc6\xe5\x4f\x72\x00\xb0\xc4\xaf\xea\xcf\x93" + "\x04\x81\xfd\x28\x48\x73\xd7\x7b\x3a\x14\x07\x75\x44\x5f\x5b\xdd\x6f\xb3\xf4\x81\xf1\xe0" + "\x2a\xfc\x08\x96\x2f\x23\x95\x34\x37\x25\x40\xd7\x1e\xae\xe8\x06\xd0\x2f\x10\x96\xf4\xd1" + "\x33\xa3\x78\xcb\x18\x3c\x1b\x32\x8b\xfe\x36\x16\x28\x44\x30\x8f\xab\x93\x63\x5f\xd3\x6e" + "\x32\x23\x0f\x07\x4e\xba\x7c\xf1\x74\xfc\x16\x43\x76\x80\xdf\x80\xa6\x91\xb6\x1c\x3b\x33" + "\xb9\x85\xb5\x72\x8b\x30\x73\x1a\xdc\x39\xd1\x86\xac\xba\x0a\xdc\x9b\x00\x81\x05\xe5\x88" + "\x7f\xaa\xd1\x04\x45\x1f\x8c\x79\xb6\xbb\xcc\x72\x52\xa0\x50\x7b\x1c\xd5\x42\x16\x89\x68" + "\x9d\xef\xbf\x4b\x4d\x20\x29\x69\xda\x63\xdd\x71\xee\x9e\x9d\x8c\x05\x1a\x7b\xce\x60\xd0" + "\x62\xf4\x5d\x43\xcb\x2e\xe0\xc5\x91\x06\xfe\x6d\x41\x3e\xa5\x0a\xc3\x29\x8d\xce\xe3\xf5" + "\xa0\xdf\x5b\xaf\xee\xea\x3c\x34\x3e\x86\xf5\x2b\x55\x9d\x09\x76\x68\x6f\x0f\x86\xd5\xd1" + "\x85\x32\xbc\x3d\x3d\x7c\x87\x7c\xcf\x66\xf5\x98\x94\x33\x0b\xc9\x6b\x84\x81\xef\x0d\x35" + "\x55\x8f\xb7\x8f\xc0\x6c\x07\x6e\x93\xae\xee\xd7\xc9\x9d\x68\x47\x76\x37\xaa\x63\x86\x1f" + "\x26\xac\x6e\xc1\x00\x57\x0e\x17\x80\x25\x23\x2a\x74\x95\x39\xc9\x3b\x34\x84\x88\xee\xa5" + "\xf0\xa9\x8e\x0e\xde\x63\x1b\x5c\xac\x25\x6d\x33\xd8\xa1\xea\x41\xb5\xcd\x49\x7b\x0a\xc4" + "\x5a\xfe\x91\x1a\x89\x22\xa7\x62\xa5\xf7\x42\x42\x0b\x1c\x66\x09\x66\xbc\xc2\x77\x43\x25" + "\x48\x84\x4d\x9d\x87\x32\x9c\xc0\x75\x7c\xcc\x24\x08\x3e\x7f\x2e\xe3\x46\xe1\x5c\x1b\x5e" + "\x2e\x1d\x9d\x74\xe9\xfe\x50\x98\x8d\x1c\x55\xc1\x3b\x3e\x17\xaf\xf0\xb5\x0e\xe0\x5c\x9a" + "\x8b\x53\x85\x86\x13\x1c\xf8\xaf\x2d\xc2\x8f\x26\x42\x63\x7a\x61\x07\x40\x02\x97\xf4\xdb" + "\x36\x3b\x68\x8f\x80\x63\x45\x7e\xe3\x25\x0c\xb1\x36\xc7\xd7\xa2\xff\x75\xbb\x78\x7d\x75" + "\x3c\x27\x48\x53\xf2\xb0\xfb\x0c\xa1\xbc\x6f\x96", + "\x03\xb9\x48\xd4\xa8\x7e\x1e\xc8\x0e\x34\xbf\xfa\x72\xb9\xf4\x40\x8c\xcc\x1f\x98\xd2\xe1" + "\xb0\x2d\x5d\xb6\x45\xe6\xbe\x80\x93\x82\x1d\x68\x3f\x0b\x4f\x47\xaa\x5f\xa8\x20\x91\x29" + "\x4f\x2f\x18\x43\xf1\x85\x26\x2e\x5c\x71\x5a\x47\x29\xdc\x97\x47\x3a\x54\x26\x76\x4a\x3a" + "\x7b\xa4\x0d\x1c\xa0\x63\xba\x78\x91\xb1\x7f\x43\x43\x7c\xb9\xbb\x01\xff\x30\xd0\x90\x59" + "\xad\x77\x99\x29\xd3\xba\xcb\x9c\xbe\x60\x2a\x0b\xf5\xc4\x23\xcc\x17\x71\x6d\x0a\x48\x1c" + "\x37\x8d\x10\x9f\x4a\x89\x30\x2d\x38\x45\xe7\x60\xe2\x19\xdc\x95\x6d\x80\xb3\x1f\x6c\x71" + "\x47\xfd\x02\xcb\x0a\xa4\xb9\x25\xca\x77\xc7\xd2\x73\x45\xeb\x41\x65\x2f\x6b\x73\x23\xea" + "\xe5\xe6\x9d\x22\xf9\x44\x23\x78\x07\xe3\x4b\x7d\xe9\xec\xa4\xf3\x3a\xea\x34\x4c\x37\x39" + "\x7e\xb2\xd5\x94\x38\x18\x4f\xcc\xac\x07\x90\x14\x94\x42\xfc\xca\x96\x6f\x05\xf5\x0d\xcd" + "\xab\xb3\x68\x65\x35\x78\x19\x85\x08\x19\x7f\x7c\x9b\x5d\x93\x8b\x1d\x02\x8d\xab\x3b\x8d" + "\x40\x21\x2f\x94\xb3\x97\xf7\x25\x08\x5d\xc6\xc6\x32\x4e\x3a\x07\x8a\xe4\xb8\x85\xf7\xd3" + "\x58\xb2\x4e\x8b\x29\x7a\x0c\xdf\x7f\x0a\xa3\x86\x46\x48\x42\xfe\xce\x4a\xc8\xec\x00\x7b" + "\x1e\x44\x24\x42\xda\x5d\x5b\x11\xd6\x3d\x3e\x7b\xcd\x68\x07\x05\x80\x14\xbb\x17\x6a\x08" + "\x46\xd7\x06\x37\x06\x73\x66\xe7\x46\xe5\x0d\xed\x1b\xec\x1b\x1a\x14\x75\x09\x5c\xf4\xce" + "\x6e\x37\x3a\x54\x01\xbf\x00\x89\x1a\x49\x6d\x53\x3f\x52\x55\xec\xf6\xa7\x1c\x11\x98\x3f" + "\xe7\xfd\xc3\xc5\x06\x95\x09\x1b\x50\x6d\xd5\x0a\x30\x84\x93\xa5\x3f\x7a\x5d\x54\xf2\x1a" + "\x89\x99\x6f\xcb\xd0\xc8\x0e\xc2\x2c\x4b\xbc\xd6\x9a\x0d\xca\xb8\xa8\xec\x40\x8e\x8e\xb4" + "\x8f\xec\x0e\x0b\x59\x88\x87\x62\x87\xf4\x69\x47\x3d\x52\x25\x6f\x48\x66\x2e\x6d\x87\x54" + "\x03\x6f\xc1\x5d\x48\x4c\xf3\xa1\x27\x52\x2f\x35\x3f\x84\x1e\xb0\x06\x19\xae\x33\xfe\x8f" + "\x28\x0c\xcc\xa9\x89\x8c\x96\x96\x07\xa9\xde\x81\xba\xdc\xc2\x75\x28\xbd\xf2\x75\x9c\xee" + "\x05\xd8\x9c\xb6\xe8\x38\xdb\x2a\xb3\x85\xfe\xc5\x4e\x21\x66\x1a\x7f\xb4\x08\xca\x16\xe6" + "\x78\x26\x51\x50\xa5\x46\x4f\x68\x7c\xff\xcf\x44\x49\xe2\xcd\xbe\x35\x09\x44\xc8\xa3\x1e" + "\xb1\x80\x2a\x34\xe1\x7c\xd4\x46\x9e\xfc\x15\xc7\x0d\xfb\x4c\x40\xda\x81\xe1\xe0\xef\x18" + "\x4a\x33\x39\x12\xf3\x4c", + 1, 3968 }, + { 0, 128, 19, "\x77\x8b\xe9\x30\xcf\x05\xd5\xe1\x44\x6e\xee\x09\x78\x22\xb3\x44", NULL, + "\x91\x37\xd9\xb2\xa4\xab\xce\x29\xc1\x80\xf3\x99\x61\x4f\xee\x43\x0b\xf5\xe4\x4c\x4c\xe3" + "\x7a\x7f\x56\x9e\x67\xb0\xfe\x0b\x37\x08\xe3\x14\x2f\x59\x86\xb9\xd6\x75\x56\x44\xe0\x23" + "\x79\x5e\xcc\x9a\x66\x6b\x30\xcf\xd7\x8f\xd4\x1e\x6a\x73\x91\x09\xcf\x25\x0b\x4a\x3e\x01" + "\x3b\x2f\x50\xd9\xfe\x34\x13\xc8\xed\x82\x84\x85\x27\x19\x5f\xef\xe0\x8a\x7e\x63\x12\x44" + "\x7a\x35\xa1\xec\xee\x40\x46\xc7\x1b\x0e\x56\x4d\x10\x55\x18\x10\x8d\x25\x19\xd0\xb9\x2c" + "\x32\x39\xb1\x46\x25\xe8\x04\xef\x88\x31\xd3\x8f\x1e\xaa\x51\xc2\x3d\x20\x71\x55\x45\xd5" + "\xa0\xcc\x88\xc4\xd6\xba\xc6\x66\xc3\x95\x77\x4d\xff\xad\xdf\xcd\x4c\x53\x7c\x8b\x85\x99" + "\xa3\xf4\xe9\x5a\x00\x4e\x29\x41\x0b\x5a\x93\x85\xd0\xa0\x7b\x2f\xf5\x7f\xb2\x9e\x77\xb3" + "\x43\x7e\xa0\xe1\xb8\x74\xe4\x38\x16\x7d\x19\x68\x13\x7a\x5e\x19\x10\xee\xa1\xcb\x39\x5f" + "\xca\xa8\x66\x50\x5d\x65\x64\x7e\xf3\x5c\x98\xde\x10\xc7\x7a\x42\xf6\xeb\x96\x78\x0e\x42" + "\xf0\x5f\x76\x3f\x04\x55\x21\xb3\x26\xf6\x63\x70\x72\xf2\x49\x2f\x82\x5c\x81\xfc\x96\x6f" + "\x8c\x1e\x21\x8b\xe1\x1d\x60\xb4\x2f\x9b\xcc\x27\xfe\xd7\x1f\x9f\x4b\x66\x9e\x76\x26\x03" + "\xbc\x5f\x35\x2b\x53\xcf\x09\x83\xe8\x18\x2b\x65\x10\xe8\xc4\x3c\xf0\x51\x82\x2f\x4d\x94" + "\xe2\xad\x23\x25\x96\x45\xd3\xbe\x4a\x0f\xeb\x8b\x7d\x20\xf9\xa4\x3f\x58\x9e\xde\xd2\xf1" + "\xc2\x92\x56\xd1\xbb\xf0\x2a\x58\x95\xc5\xbf\x47\x39\x9c\xfc\x40\xaa\xa0\xcb\x4e\xd5\xec" + "\x9b\x52\xe2\xbc\xd0\xfe\x55\x91\x66\x3a\x36\xd0\xb6\x69\xf3\x3d\x1e\xa4\x56\x16\x8d\x93" + "\x0a\x33\x5f\xb0\xf3\xe5\x02\xb7\x1a\x1b\x30\xd5\x9d\xec\xb0\xdd\xe9\xc6\xb4\x57\x6b\x35" + "\x56\x1b\x3a\x30\xf0\x92\xa6\x96\x33\x4d\xdc\xa5\xfe\xca\xad\xcc\xe7\x5a\xcc\x00\xb7\x35" + "\x41\xc0\x63\x34\x75\xaa\x6f\x5c\x6a\xaf\x82\x6d\x81\xa3\x41\x7d\x86\xb1\x5c\x6b", + "\xef\x6a\x35\x8d\x6e\xa2\xc9\xe4\x34\xb2\xa0\xa6\x55\x76\xe5\x9f\xe4\x22\x5b\x44\x15\x7c" + "\xf9\x33\x27\xac\x19\xbd\x09\x98\x30\x3d\xd3\xdf\xdb\x7d\x94\xe0\xd2\x08\x05\x3c\x7d\xc7" + "\x42\x4d\xe0\x95\x80\xf4\x0f\xb6\x46\x2e\xb9\x1a\x5b\xb1\x12\x46\xaf\x66\xab\x11\xae\xd6" + "\xb9\x98\xf0\xc2\x6b\x03\x1b\x23\xb8\x89\xff\x43\x24\x7c\x5f\xe8\x04\xc2\x22\xc6\xc2\xd8" + "\x2d\xe7\xee\xff\xa1\x81\xff\x5d\x8b\xef\xef\xd4\xd8\x79\x06\x92\xad\x55\xa6\x0d\xd5\x9c" + "\x63\x06\xff\xa1\x79\xcd\x67\x9c\xb7\x0b\x0c\x02\xdc\x97\x27\x8c\x6f\xa3\x77\xd3\x43\xdf" + "\x24\xa0\xb1\xea\x7c\x40\xbb\x50\xf0\xf3\xb1\x57\xe9\xc7\xe4\x66\x39\xe5\x63\x02\x89\xb1" + "\xc9\xbc\xec\xb3\x16\x42\x0f\x1f\xa2\x1d\x34\x3c\xcb\x83\xc6\x31\xc3\x09\x1d\x5c\x39\x6b" + "\x28\xb8\xd7\x71\xc0\x73\x61\x6e\x28\x71\xa6\xac\x1e\x8d\xd7\x46\xf2\x1b\x82\xc5\xc1\x19" + "\x1c\x2d\x74\x7a\x32\x95\x68\x4d\x42\x42\x00\x2c\x03\x49\xc7\xf2\x29\x34\x28\x8b\xbd\xa7" + "\x39\x41\x67\x71\x82\x47\x50\x61\xcf\x52\xd3\x51\x1f\x58\x48\xc2\x1d\xee\x41\x75\xe6\x7b" + "\x1a\xb7\xbc\x0b\x1c\xe6\x60\xa4\xbc\x80\xa4\x69\xfb\x04\x34\xb6\x73\x9e\xfd\xda\xb8\x70" + "\xf2\xbb\xfb\x50\xe4\xe7\xe3\xbf\x47\xad\x87\x33\xf3\x80\x0d\x04\x5b\x7b\xa0\xf7\x60\x34" + "\x70\x46\x81\x10\xef\x22\x63\xbf\x56\x31\xdc\x0a\x9d\xf6\xec\x13\x9d\xa8\x7d\x77\x25\x4b" + "\x89\xf3\xbf\xcd\xec\x92\x38\xdf\x73\xbb\x44\x9b\x60\x3e\xd2\xc3\x00\xe7\x11\xf8\x96\xfa" + "\x43\x45\xf0\x35\xce\x0d\x75\xfd\x42\x39\x84\xfd\xec\x3e\x21\xdd\x2d\x45\x3a\x1f\x5f\x38" + "\xdd\x83\x8d\x52\x43\xc9\x97\x42\x4e\xa6\xe7\xb5\x9e\x85\xa8\xc7\xfb\x3d\x28\x2d\x3d\xe9" + "\x2d\xea\x82\xdc\x10\xa2\xda\xee\xbc\xb4\x80\x38\xad\x3b\x7b\xe9\x07\xcd\x19\xa1\xb4\x40" + "\x78\xcc\x6b\xfd\xb3\x0f\x64\x42\x58\x20\x67\x8d\x02\xe7\xe3\x60\xe6\x47\x7b\xdf\x5e\x50" + "\x6b\x11\xb3\xc5\x96\x25\x54\x8a\xeb\xdd\x07\xb1\xd0\xe4", + 1, 3328 }, + { 0, 128, 20, "\xaf\xe8\x9e\x8a\x7e\x82\xae\x5a\x0b\x55\x38\x00\xd7\xe4\xd5\x11", NULL, + "\xdb\x5f\x35\x3e\xbf\x2f\x63\x77\xfa\x45\xe9\x15\x1e\x2d\x02\x43\x3d\xa2\x4a\x8c\x88\x14" + "\xd4\xa0\xb9\xdb\xbb\x0e\x93\xfb\xa1\x4d\xde\xd1\xbe\x3c\xac\x9b\xc8\x10\xe5\xe6\x5d\x2a" + "\x1d\xd5\xfa\x37\x20\xcb\x88\x9c\x9e\x4a\x81\x1b\x38\x0d\x1a\xeb\x16\x66\x57\xdf\xe9\xa0" + "\xbb\x0e\x30\x28\x63\x43\x28\xda\xa5\x2b\xab\x92\xb4\xd3\x04\xc2\xa9\x6f\x89\x88\xf8\xd7" + "\x1e\x69\xfd\x14\xca\x7f\x1b\xad\x99\x14\xac\x42\xf0\xb3\x27\x82\x33\x50\xf9\xc9\x50\x03" + "\x5e\x36\xeb\xe4\xca\xc4\x0c\x72\x8b\x91\x50\xec\xc1\x1c\x00\xb0\xf4\xf1\xed\x2c\xa0\x26" + "\xe6\xb5\x28\xdc\x96\x83\x47\x0b\x44\x12\xb5\xc6\xdb\xd6\x41\x90\x4e\xec\xa3\xcc\xb7\x48" + "\x4c\x5f\x8c\x17\x3b\x17\xb4\x4d\xfa\xce\x7c\xdf\xc4\x2a\x29\xd8\x00\xf5\x0c\x36\xea\xc2" + "\x5f\x66\xde\xa7\x48\x73\x15\x90\x97\x11\xb7\x02\xaa\x69\xf8\x75\x56\x53\x21\xd2\xce\x3f" + "\x15\xec\xb5\x90\xd1\x82\x7c\x10\x11\x7e\x6f\x43\x3c\x7e\x4e\x07\x6f\xe6\x9f\x45\x4c\x53" + "\x31\x44\xb8\x1c\x14\xc6\x17\x0b\x48\xa6\x56\x53\x53\xbe\xfa\xaf\x98\xb8\x94\x94\x66\x6c" + "\x6b\x37\x33\x61\x84\xdb\x1b\x8d\xdc\x27\xea\xc9\xfc\xb0\x91\x6d\x5a\x56\x5a\x7c\xee\xbb" + "\x07\x50\xaf\xcb\xa5\xcb\x90\xeb", + "\x8f\xde\x94\xbd\x31\x63\x76\x9c\x08\x2d\xbc\x2d\xda\x6d\x33\xad\x1d\x65\xff\x19\xb0\x7e" + "\x46\x07\x36\xf9\x83\x5a\x05\xea\xc5\x7b\x7e\x83\x4c\x77\x39\xb7\x1a\x4b\xeb\xac\xfd\xa6" + "\xa1\x8a\xc0\x41\xfb\x00\x47\xf4\x48\xab\x87\x6a\x16\x50\x5b\x65\x13\x7c\xa6\x2d\x3c\xc7" + "\x3f\xc3\x3b\x8d\x5f\x9a\x1e\x69\xee\x70\x07\x31\x1d\x74\xa4\x06\xa2\xd4\x5c\x87\xec\x49" + "\x5a\xa2\xad\x2f\x58\xd6\x0d\xd2\x07\x48\x13\x3f\x9e\x4e\xc5\x7a\x1b\x6f\x28\x12\xf7\xd1" + "\xf7\xdd\x0b\xa1\x6f\xad\xa4\xa9\x25\xd4\xcd\xdf\x3f\x06\x78\x3f\x41\x8a\xd1\x6c\x66\x5a" + "\x62\xac\xc8\x0e\x4d\x13\xa2\x01\x70\x0c\x3c\xf4\xd5\x46\x9e\x4d\x04\x0f\xe5\x23\x4e\x4f" + "\xc6\x83\x28\x6e\x73\x93\x6d\x75\x31\xd5\x2e\x2f\x35\xdf\xc8\x16\xdf\x73\x5d\xfe\x2b\xac" + "\x10\x17\x20\x8f\x21\x27\x2b\xf3\xcc\xb9\xaa\x6b\xf9\x1c\x40\xe2\xd3\x21\xbb\x83\x70\x28" + "\x21\xae\x3d\x09\xdf\x21\xfe\xdc\xa4\x8f\xad\x27\x9b\x76\x00\xd5\x1a\x88\x2f\x45\x5c\x09" + "\x84\x7c\x3b\x78\x4c\xce\xe3\xe2\x53\x0f\x86\x8e\x33\x31\xa2\x3a\x91\xe9\xfb\x88\x1a\xc9" + "\xb1\xb5\x85\xa2\xba\x6a\x01\xc1\xdf\x70\x32\xd4\xfe\x00\xe4\xab\x7e\x45\x2d\x11\xc5\x23" + "\xa0\xf3\x74\x10\xef\x61\x68\x04\x8b\xda\x5b\x82\x83\x13\xbb\x59\xfa\x96\x48\xe8\x31\x99" + "\xc7\x85", + 1, 2176 }, + { 0, 128, 21, "\xe4\xe8\xe5\xb1\x41\x6f\x89\xa0\x2e\x86\x63\x57\xe5\x54\x43\x2e", NULL, + "\x7a\xab\xc7\xfd\x5c\x09\x4c\xee\xd3\x81\xd6\x9c\xd8\x18\x08\xd6", + "\x4f\xd8\xf9\x77\x4a\xbc\xde\x91\x78\xc3\x76\x5d\x76\x8e\x16\x82\x74\x8d\x1d\x99\x0c\x4a" + "\x8d\x0b\x73\x6c\xe6\x4a\x54\x27\x02\xb8", + 1, 128 }, + { 0, 128, 22, "\x47\xfc\x41\x61\x03\xa2\x02\x35\x76\xf6\x3b\x3f\xf2\x5f\xa0\x2b", NULL, + "\x5e\xe5\x06\xf6\x27\x45\x63\xaf\x52\x1b\x11\x64\xef\xea\xa5\x52\x5d\xd8\x4e\x4e\xad\x52" + "\x25\xfa\x06\xda\x5e\x15\xee\x02\x23\x69\xd5\x85\x51\xff\x98\x48\xd3\x33\xc0\x3a\xaf\xff" + "\x18\xf6\xb5\xd2\x06\x89\x2a\xb6\x60\xb0\x11\xf1\x4a\x25\x7c\xc8\x8e\xb1\x11\x77\x7f\xd5" + "\xb0\xc4\x78\xba\xf8\x74\x52\x2c\xba\x34\x83\xd6\x9c\x0d\x6a\xa6\x35\x70\x0e\x02\x5a\x5d" + "\x39\x96\x32\x6a\x9a\x2d\x85\xd4\xce\xca\xe9\x26\x54\xe0\xd8\x9b\x90\x50\x27\xa7\x77\x9f" + "\xcf\x6f\x32\xac\x11\xda\xd0\x1a\x6b\xb4\x05\x12\x6a\x31\x41\x00\x37\xb7\xcd\xde\x4f\x7b" + "\xb7\xda\x2b\x11\xeb\xaf\xf6\xef\xc8\x80\x31\x87\xdc\x50\xfd\xb8\xec\x91\x32\xa8\x5b\x57" + "\xb9\x32\x4d\x1f\xc4\xc2\xde\x81\xf0\x3b\x75\xca\x61\x02\x51\xdb\xd7\xba\xed\x67\x71\x50" + "\xd3\x13\xf3\xcb\xd8\xc4\xc5\x0b\x17\x07\x45\x44\xd1\x3a\x99\x5a\x5e\x43\x78\x59\x6b\x26" + "\x34\xfc\x87\xbd\xf7\x65\xe8\x2d\xf0\x67\x2d\xf3\x67\x60\x66\x6b\xba\xcb\xcb\xe2\x6e\x2c" + "\xdf\x2b\x42\x73\x00\x5e\x51\x32\x25\xa0\xf4\x49\x94\xd4\x02\x1b\xec\x59\xc2\xbb\xf6\x26" + "\x0f\xa9\xab\x83\x79\x55\x1b\x8b\x1a\x41\x4f\xf1\xac\x22\x85\xde\xc8\xda\x41\x7d\xa3\x65" + "\x3b\x51\x36\xda\x9c\xff\x1a\xd2\x93\xcf\x88\x75\xaf\x1c\x90\x9a\xf9\xe9\x95\x00\xc1\xc9" + "\x0f\xa3", + "\x24\xcb\xc1\x52\xad\x1f\x9f\x1d\xd7\x1f\x13\x14\x9b\x61\x51\x04\xb8\xee\x12\x01\x82\x24" + "\xee\x9d\x82\xc1\x4c\x98\xe6\xa6\x1b\xf4\x1a\xc4\x7f\xc0\xa5\xb5\xe5\x8f\x11\x53\x65\x0f" + "\x92\xe8\xc3\xad\x58\x8e\x45\xd2\x63\x93\xf6\x27\x65\x7c\x0b\x36\xe3\x4f\x5a\x32\x5c\x86" + "\xd6\xf0\x6c\xd5\xab\x2b\x14\xcd\x95\xa8\xe7\x9b\x13\xc3\x5e\x1a\xc2\x1b\x29\xab\xf4\xdb" + "\xc2\x9a\x5b\x50\x42\x5c\x84\xe8\x6c\x7a\x55\xd5\xf4\x26\x55\xb2\xf1\x6d\x26\xd7\x5a\x09" + "\x5b\xa7\x06\x1a\x69\x2f\x2c\x3f\xf5\x91\xea\xb1\x5d\x50\xe7\xb0\xac\x05\xd4\x9e\xe1\xcd" + "\xd9\x1b\x80\x11\x26\xec\xb2\x70\x4c\xd4\x42\x04\x88\xb5\xf7\x3d\x2c\xfa\x3e\xdc\x0f\xce" + "\x20\xc6\x2b\xbe\x72\xd1\xb6\xdc\xa1\xe2\x15\x61\x86\x17\xb7\x65\x33\x02\xac\xde\xa2\xca" + "\x28\xe3\x27\xd9\xc9\xcf\x8e\x08\x4c\xc7\x78\x01\xc3\x91\x48\xf6\x41\x97\xcb\x14\xb2\x08" + "\xbe\x61\x23\xa9\x28\xb9\x7d\xb9\x42\x9c\x1b\xc6\xdc\x17\x9b\xf7\xe9\xfb\x4b\xf2\xdd\xf5" + "\xb2\x95\x4c\x2f\x1b\xb2\x00\x44\x10\x3e\x3f\x6b\xf0\x6b\x76\x03\xdf\x8e\x3f\x1c\x4d\xdc" + "\x86\x04\x56\xd4\x53\x9c\xed\xb8\xe2\x3a\x31\xeb\x92\x84\xdf\xd1\x44\x49\x51\x81\xdf\x0d" + "\x27\x62\xa8\x95\x02\x42\x42\xb3\xf2\x44\x0f\x4f\x13\x06\xc8\x23\x73\xda\x58\xea\xb2\x33" + "\xf0\x10\x7c\x9d\x49\xe0\xe4\x7d\x2b\x44\xa5\xa2\x98\xae\x69\xc3\x5c\xee", + 1, 2304 }, + { 0, 128, 23, "\x49\xb3\xcd\x18\x5d\x19\x8a\xaf\xc7\x2f\x79\x7b\xf6\x90\xde\x58", NULL, + "\x29\xf5\xd9\x10\xa7\xad\xf6\x13\x64\xac\xe3\x17\x51\xb7\x93\xfc\x4d\x0b\x87\xad\x43\xf3" + "\xa3\x24\xa5\xca\x16\x24\xfa\x11\xfb\xdb\x94\x54\xda\xf6\x0b\x73\x32\xe3\x0f\x83\xff\xed" + "\x1e\x3b\xe9\x01\x4c\xca\x4d\x31\x89\x2a\xdf\xd2\x47\xaf\x95\x0f\xb2\x6f\xdd\x9b\xc3\xda" + "\x29\x08\x8b\x49\xcf\x53\xc4\xd6\x24\x94\x2d\xfc\xf9\xf5\xf1\x92\x35\x48\x60\xf6\x70\x1b" + "\x64\x23\x9e\x82\xf6\x3c\x4e\xc9\x20\xb6\xce\xe4\x57\x08\x26\xef\x18\x8e\x84\x50\x5f\x30" + "\x24\x7e\x3f\x43\x85\xae\x01\x58\x62\x44\xc7\x56\x86\xf2\x2f\x10\xbd\xa9\x65\x65\x14\xd5" + "\x9b\x81\xd1\x9b\xe7\x71\x93\x97\x15\x17\x62\x2b\x92\xf1\x19\x67\x78\x98\x93\xd5\xaa\xd9" + "\x01\x83\x2c\xa9\x33\x9a\x0f\x18\xab\x92\x89\x37\x51\x69\xf3\x0e\x97\xd7\x92\xc1\x74\x49" + "\xd3\x80\x4e\x74\x5f\x76\x5b\x7c\x0c\xe4\x0a\x2c\x84\x51\x13\x80\x76\xc5\x3d\x21\xaf\x7e" + "\x7c\x6c\xac\x53\xd8\xa6\xb9\xdf\xcc\x27\x1a\x50\xf6\x3a\x11\x2b\xc1\x0f\xb9\xcc\xd7\x51" + "\x23\x1a\x9f\xbf\x58\xfc\xda\x8f\xb9\x25\x2b\xb5\xa4\x1e\xdc\x76\x0d\x57\x8a\x81\x43\x63" + "\x8a\xd3\xac\x02\xe9\xe9\x62\x09\xa8\x13\x0d\x48\xce\xa0\x6e\x69\x51\xcb\xd1\x4a\x14\xc9" + "\x59\x20\x3e\x5e\x7f\x7a\xa8\x24\x4d\x27\xbc\x5c\x13\x4a\xbe\xbb\xc6\x17\xae\x85\xa7\x7a" + "\xc3\xf0\xdc\x29\xca\x6f\xcb\x82\x31\x26\xce\xb2\x73\xc3\x86\x89\x63\xfc\xff\xf3\x7f\x82" + "\x5b\xba\xd9\x47\xcc\x1f\x87\xcd\x8d\xde\xe9\xa1\xec\x7d\x29\x9e\xa8\x0d\x74\xbe\x28\xe8" + "\x41\x4b\x8d\x0f\x82\x2d\x86\x5e\x5f\x92\x03\xfc\x9b\xf3\xc8\x85\xdc\x07\x9b\x9d\xc8\xf6" + "\xe9\x69\x4d\x63\x66\x2e\x4c\x11\xdd\x37\xff\xfc\x14\xd9\xd8\xf4\xd4\x27\xc5\xa5\x32\xc7" + "\x73\x88\x89\xc5\x31\xc8\xcb\x89\xc7\x20\xed\x68\xfe\xf2\x9c\x63\xd0\x94\x8b\x64\x1f\x4c" + "\xae\x1a\xce\x36\x5d\x62\x50\x08\xb2\x1b\xf0\x2f\x00\x9d\xf0\x7b\x7e\x97\xd9\x80\xfb\x34" + "\xa5\xca\x2c\xd3\x8d\xe3\x1d\x41\xf3\x55\x6b\xb2\x66\x2b\xf3\x4a\x3e\x09\x5a\xbd\xe1\x03" + "\xa6\x60\x7f\xaf\xa1\xdd\x1f\x99\xd5\xbe\xda\xc9\x3b\xab\xa9\xe1\xd5\xf4\xcf\x85\x3d\x49" + "\xf8\x49", + "\xe2\x26\xe0\xcc\x33\x1c\xb3\x38\x62\x67\x66\xad\x42\xea\x0c\x76\x67\xdc\x60\x32\xfa\x04" + "\x72\xf0\xc0\xc4\xf4\x18\x94\x54\x33\xdb\x2c\xaf\x45\x03\xd7\xa3\xd9\x8d\x4d\xf8\x5f\x7f" + "\x32\x8b\xb6\x15\x60\x00\x34\x89\x1d\xd7\x67\xb5\xba\xb7\x45\x9a\x62\xfd\x37\x09\xdc\xaf" + "\x3a\x63\x40\xb4\xb2\x89\xf9\x59\x69\xa4\xd9\xaa\x9e\xe7\x2d\x2b\x38\xc5\x85\x7d\x26\xb6" + "\xb5\xab\x8d\x5c\x0e\x96\xd0\x73\xd4\xc6\x68\x3b\x61\xf9\x44\xf5\xa5\x79\x5a\x2a\x76\xc1" + "\x37\x26\xf0\x97\xbd\x9b\x86\x9c\x48\xfd\xaf\x6f\x32\x44\x87\x7f\x9a\x81\x9b\x89\x65\xe9" + "\x87\x2f\xc6\x00\x11\xd9\x3b\x0a\x17\xf3\x55\x37\xdf\x72\x83\x60\xf7\x30\xf7\x1a\x95\xd7" + "\x30\x4a\x61\xbf\xdb\xf5\x54\x81\xce\xd9\x45\x81\xc3\x4d\xfd\x8b\x5e\xc7\x96\x1a\x07\xb9" + "\xf9\x91\xbe\x44\xa3\xbb\xb8\xde\xb4\x94\x82\x32\x3f\x62\xb5\xd4\xe7\x49\x41\x76\x10\x81" + "\x96\x97\xfe\x1f\x6a\x64\x04\xbe\x98\x43\x35\xbd\xcc\x40\x10\xf7\xc4\x5d\xb1\x5f\x5b\x3a" + "\x01\xb0\x19\xbb\xf1\xbb\x25\x57\x16\x87\xdc\xd1\x12\x99\x42\x9f\x38\x63\x26\x96\x05\xb0" + "\xb5\x12\xd8\xe7\xbd\xed\x57\x86\x41\xfd\x2f\xbe\x36\xf4\x12\x49\x3f\x81\x64\xb1\x52\xb9" + "\x98\x51\x33\x83\x62\x67\xe5\x57\x88\xb3\xa1\xc9\xdc\x68\x1c\x7d\x05\x5a\x5d\x40\x52\xc2" + "\x20\x39\xbf\x40\xed\xbf\xcd\x60\xae\xf0\xfe\x8e\xb2\x5f\xda\x81\xde\x55\xa9\x1a\x38\x46" + "\x9e\x01\x33\x61\xa9\x20\x94\x10\xbd\xbe\x80\x7a\xd2\xbc\x51\xe5\x5b\xa1\x44\xa8\x20\x8d" + "\x0e\x90\xfe\xc2\xbe\x1c\x8f\x1f\xb1\x3e\x7e\xef\x38\x6e\x83\xc4\x67\xd8\x7f\x85\x77\xc9" + "\x2c\x6d\x7c\x73\xa5\x0e\x6e\xe8\xf7\xe0\x2e\x19\x98\x06\x5a\x80\x82\xa6\xb0\xcc\x1e\xec" + "\x64\xd9\x70\xe1\x7b\x14\x79\xb8\x74\x00\xde\xb9\xdf\xb0\x5b\x31\xc8\xaa\x03\xf4\x5e\x2a" + "\x62\xf1\x55\x42\x39\x27\xcb\xb7\x18\x89\xf2\x42\xcd\x72\xdb\xfb\xfb\xc6\x93\x1e\x4c\x03" + "\xc5\x93\x64\x29\xd8\x5e\x44\x37\x06\x29\x9d\xc8\xff\x2c\xfe\x63\xd9\x39\x09\xd0\xf3\x0c" + "\x25\x33\x1f\xdd\xa1\xcb\x1f\x72\x18\x2f\x9b\xcf\x1a\xfe\x44\x41\xd3\x7e\x5d\x66\xa9\xf6" + "\x1a\xa3\x3e\x40\x33\x6e\x1c\x77\xba\xc9\x45\xaf\x35\xa6\xe4\x30\x91\x79", + 1, 3712 }, + { 0, 128, 24, "\x78\x1b\x48\x98\xfa\x93\x33\xc9\xdb\x75\x4e\x4a\xde\xfa\xa9\xa0", NULL, + "\x43\x41\xb6\x94\x2f\xd6\xec\xb2\x28\x15\xa4\xd1\x31\xc6\xec\x98\xd2\xba\x09\xa7\xd4\x9e" + "\x4f\x37\xe8\x6a\x96\x46\xe0\xa5\x8d\x42\xdc\xc7\x0d\xe8\x52\x60\xc6\x87\x69\x7e\x41\xfc" + "\x3f\x96\xcb\xfe\x42\x53\xa2\x00\xcf\xbe\x92\xaa\x74\xc7\x1a\xa8\xea\x49\xb2\x10\x0a\xf2" + "\x1a\xa0\x07\xfe\xbe\x77\x7d\xdb\xcd\x9d\xee\xb6\xbd\x94\xb7\xae\xd5\x2e\x82\x24\x2d\x60" + "\xa7\xc3\x37\xad\xf8\xfe\x4b\x40\xcd\xe3\x00\x22\xbd\x93\xa3\x27\x1a\xd3\x06\x94\x98\x4f" + "\x1e\x7b\x7c\x80\xd7\x5a\x51\xda\x80\x7c\xdf\x96\x07\x95\x47\x64\x5d\x7a\xa8\x6b\x59\x72" + "\x77\x2f\x30\xa0\x35\xaf\x56\x20\xe3\x6a\x67\x35\x4b\x8b\xad\x5b\x94\xed\xf4\x16\x84\x99" + "\xe1\xaa\x0e\x7d\xee\x0d\xe4\x24\x43\xf6\xdd\x33\x54\xf6\x01\x4d\x65\x6c\x53\xff\xaf\x94" + "\xf3\x09\x2d\x76\x55\x55\x6d\xed\x34\xb5\xde\xf3\x24\xf6\x2d\x86\x32\xab\xab\xdd\x91\x66" + "\xdc\xa9\x36\xe9\xf7\x87\x4a\x9a\xc6\x71", + "\xf1\x06\x4f\x35\xd4\x20\x48\xa7\x05\xbe\x10\xea\xe0\x94\x59\x99\x4f\x4b\x33\x26\xe0\x7c" + "\x39\xea\x6f\x5b\xc2\xaf\x90\xf8\xbf\x5f\x22\xaa\xd4\x4b\xad\x9f\x78\xe7\x7a\xe4\x29\x48" + "\x46\x59\x86\x24\x71\x0a\x55\x7f\x8c\xd7\x19\xbd\x85\x56\x49\xc0\x83\xe1\x31\xd0\xcd\x4c" + "\x22\xd9\x86\x3a\x2a\x87\xb2\xf3\x31\x0c\xdd\x8c\xd4\x58\x35\x3b\xcc\xc6\x0c\x1d\x56\xb9" + "\xf3\x0b\xf9\xf3\x42\x78\x6c\xd9\xd3\x90\xbb\x5c\x30\xc8\x8b\x28\x17\xb8\x4b\x91\x63\x4c" + "\x50\x5f\xbb\x9e\x5e\x21\xa1\x6a\x20\x2f\xb1\x5f\x86\xca\xc6\x0f\x6d\x69\x1e\x6c\x42\x6b" + "\xd3\x26\x14\xc9\x45\x3f\x2b\x1d\x1b\xaf\xb0\x11\xef\x98\xed\x93\xfd\xcf\xe3\xa1\xa5\x17" + "\x10\xbe\x1e\x94\x0e\x5c\x29\xd3\xb5\x8f\x46\x78\xa7\x69\x84\x89\x36\xcc\xf4\x67\x59\x66" + "\x9a\x18\xc9\xef\xce\x24\x9e\xf2\x8f\x62\xda\x0f\xc9\xca\xe9\x4d\x12\x86\x83\xf8\xb1\x43" + "\x56\x60\x00\xca\x6f\x25\xc2\x15\x8c\x17\xff\xd4\x32\x1d\x49\x41\xfd\x9a\xc2\x40\x63\x6e" + "\x9a\xd6\x8b\x9b", + 1, 1664 }, + { 0, 128, 25, "\xf8\xa4\x3a\x1b\x30\x2e\x32\x1c\x77\xab\xcd\x79\x6f\x1e\xda\x9d", NULL, + "\xf3\x3c\x65\x96\xd9\x57\xd6\xc3\xa8\xe2\x32\x83\x3a\xc4\x88\x33\xce\x67\xcc\x43\x00\x22" + "\xf6\x1d\x08\x44\x02\x22\xe7\x65\x3c\x4c\x16\x33\xa6\xa1\x8d\xac\x02\x04\x8d\x8e\x66\x0f" + "\xc2\x4e\xbf\x53\x6c\x61\xbe\x10\x7d\x59\xb6\x0f\xd0\xb1\xe5\x3b\x90\x75\x74\xfd\x71\xcf" + "\x29\x1c\x84\xd8\xa7\x14\x63\xd6\x8e\xd3\x22\xa8\xe1\xca\x28\xea\xb1\x87\x37\x63\x01\xb1" + "\x78\x5a\x3e\xe0\x66\x48\x43\x07\xa2\xad\x18\xec\x7c\x9c\x8f\x4a\x66\x96\x4f\x8f\x9b\xa4" + "\x24\x9c\xa0\x24\x0e\xdb\x0a\xaa\xef\xe2\xb9\xd8\x0d\x12\x35\xe7\xa4\x7e\x7f\x27\x81\x91" + "\x07\xde\x29\x75\x1c\xcf\x84\x24\xdf\xea\x59\x8d\xb2\x9b\x5e\x2b\x20\x1d\x7c\x23\x55\x22" + "\x3e\x21\x4c\x6d\x47\x59\x31\x0a\x92\x8b\x00\x9b\x8a\x2a\x07\x2c\xa3\x1d\x94\x57\x44\x51" + "\x75\xd6\xb7\x70\x34\xcc\x9c\x64\x05\x3f\xe5\x18\x51\xe7\x1e\xae\x30\xd1\x3e\x2e\x38\x87" + "\x7b\xe2\xb9\x26\xfc\x8c\xac\x91\xba\x5c\xdf\x93\xb5\x13\x28\x23\xeb\x8f\xa3\xce\x47\xa1" + "\x04\xd6\xc8\x37\x0e\xba\x95\x3c\xa2\x7e\xb4\x00\x98\x93\xdf\x43\x74\x80\xcf\xa8\xe9\xf2" + "\x02\x04\xfa\x03\xa3\xc9\x08\x2c\x24\xeb\x2f\x56\x2a\x74\x1a\x2f\xcb\xbd\x13\xc5\xab\x74" + "\x2f\x1b\x57\x65\x01\x83\x11\x3e\xc7\x91\xec\x76\xcb\x70\x65\x08\x13\xad\xef\x86\xef\xc8" + "\xca\xc2\x5c\xf0\x13\x1a\x77\x2e\xb5\x47\xd7\xe2\x27\x24\x79\x43\xd0\xfc\x45\x26\xee\x0d" + "\x18\xb0\xa8\xc9\xbb\xc8\x21\xed\x30\x2d\x61\x13\xe9\x57\x7e\x17\x92\x9d\x36\x25\x04\xf6" + "\xb6\xe7\x70\x9b\xe4\x98\x65\x8e\x4c\x30\xb8\x32\x54\x90\xcc\x77\x58\x65\xac\x6e\x06\xcd" + "\xb4\x21\xb4\x90\x74\x62\x50\x3e\xff\x96\xc0\x46\xcb\x8e\x86\x87\xa9\xa5\x96\xaa\x61\x2b" + "\xaa\x21\xb1\xd5\x31\xa3\xec\xec\xd4\xb2\x52\x83\xbf\xbb\xd3\xf2\x79\x9c\x69\x6b\x41\x68" + "\xa4\xd3\x1c\xbc\x18\x0f\xdc\x55\x61\x4d\x37\x44\x9e\x60\x18\x0c\x24\xa0\x61\x3e\x91\x88" + "\x58\x06\x3b\x1b\x0f\xc8\x20\x7c\xf8\xbc\x5f\xdc\x07\x3d\x10\x6b\x0d\xdb\x13\xed\x14\x1c" + "\x52\xd6\x98\x76\x25\x5c\x4e\xb1\x58\x31\x15\x44\x23\x34\xaa\x79\x50\x52\xdb\x60\x28\x34" + "\x38\xa1\xb2\xaa\x18\x3d\x36\xea\xfd\x3f\xf7\x2c\xdc\x8b\x4d\x77\x4c\x9c\x62\xff\xb1\x91" + "\x96\x2a\xaf\xc9\xf8\xda\xdf\x7e\x8c\xaa\x7f\xb6", + "\x82\x69\x32\xe2\x45\xa5\x27\xae\x1e\xad\x11\x99\xfa\xf3\xf7\x49\xbf\x19\xa3\x83\xcc\x8d" + "\x14\x19\xe2\xc9\xea\xdf\x15\x44\xdb\xec\xd2\xdb\x72\x1f\x71\x2d\xed\xea\xcf\x9c\xfc\x61" + "\xee\xe5\x42\x5a\x93\x67\xb3\x2d\x3c\x77\x0b\xaa\xd1\x8b\x35\xbe\x9b\xc8\xfd\x4f\x77\x72" + "\xf5\x93\x2b\x37\x1c\x42\x74\x63\xff\x8a\x92\xb2\xd0\x4e\x81\xe7\xd2\x45\x35\xde\xf4\x99" + "\x20\xf7\x14\x1f\xd1\x69\xf8\xef\xc9\xd3\xf5\xca\x66\x17\xd6\x0e\xc5\xd4\xd4\x2a\xc3\x35" + "\x61\x1f\x02\xe6\x78\x7b\x20\x66\xcd\x17\xb8\x28\x1f\x3c\x82\x92\x57\x76\x82\xf9\x92\xe0" + "\x51\x70\x9e\x22\x1b\x53\xbe\x18\xbb\xbe\x0d\xa2\x0b\x01\x0e\xff\x83\x2f\xd6\x3e\x52\xf5" + "\xc4\xc4\x6b\xca\xfc\xb2\x88\x6b\xee\x5a\x3f\x4f\x89\xaf\x13\xac\xc5\x4f\x70\x70\x44\xe9" + "\x11\x6f\xc8\xe5\xd3\xf1\xac\x01\xb4\x38\x60\x04\x58\x89\x7e\x32\x8a\x37\xad\xce\x07\xb7" + "\x83\x55\xcc\xa2\x7b\xfe\x7f\x32\x91\x5d\x51\x8b\xc5\x77\x86\x13\x86\xb6\xc4\x71\xc9\x9e" + "\x7b\x67\x08\x5b\x76\xfe\x46\x0a\x76\x01\x49\xc1\xe5\xa3\x8c\xc0\x76\x0e\x60\x11\xa3\x76" + "\x9c\x0f\xd0\x1c\x27\x65\xc5\xa4\x8f\xf4\x2d\x98\x54\xf8\x26\xe1\xda\x15\x28\xba\xe7\xe7" + "\xb7\x7d\xe9\x1f\x4a\x5a\xc6\x2a\x0f\xd8\xf4\x13\xd4\xd4\xde\x0a\xc4\x12\x0a\x8e\x06\xc2" + "\xb9\xe9\x35\xe6\x34\xea\x86\xff\x4b\x33\xf5\x4e\xa8\xba\xf8\x6b\x42\x43\xb6\x15\x16\xb0" + "\xdf\x4f\x42\xb6\xfb\xd6\x50\x51\x44\xa0\x54\x80\xb9\x1f\x8d\x4f\x8b\x4d\x83\x36\x02\xea" + "\xb6\x89\xb8\x28\xe8\x71\xc4\xab\x5f\xec\xa2\xf9\xd8\xb2\xdf\x24\x11\x4a\x65\x5b\x69\x08" + "\xb8\x82\x29\x74\xba\xe4\x19\x84\x3c\xc0\x94\x96\xec\xd5\xd4\x34\xd2\xaf\x47\x7e\xa5\x3d" + "\x96\x9a\x1c\xec\xe0\x44\x71\x82\x99\x06\xff\x0a\x69\x55\x7c\x5d\xff\x44\x50\xa0\x4d\x0e" + "\xef\x17\xb6\xd9\x8a\x39\x5d\xe1\xc6\x15\xa9\x67\x0e\x09\xfd\x96\x17\x1a\x5a\x0d\xf5\x3e" + "\xd3\xf7\xd0\x56\x57\x3e\x17\x14\x9f\xba\x3f\x56\x2f\xff\xa9\x3d\xc5\x40\xa8\x54\x84\x01" + "\x81\xb8\x9c\x13\x5c\xf7\x57\x50\x69\xc7\x09\x23\xc2\x56\x2d\x29\x3a\xe9\x80\x7a\x76\x83" + "\x6e\x9e\x3c\x48\x7d\xf1\xc0\x6c\xfb\xad\xd7\x7c\x71\x39\xe3\xc4\xc2\xf5\xd2\x87\x2b\xf0" + "\x98\xa2\xa3\x42\x72\x62\xa8\x00\xa9\x93\xb2\xee\xbd\xff\xee\x70\x8b\xa5\x98\xcf\x55\xa2" + "\xe6\x4c\x98\xf5\x76\xfb", + 1, 3968 }, + { 0, 128, 26, "\x5b\x34\x02\x16\x96\x59\xaa\x61\xd8\x3a\xba\x0e\x75\x1b\x5e\xfb", NULL, + "\x7a\x1c\x4b\xd3\x13\x34\x86\x36\xa1\x7b\x1f\x5f\x74\xf5\x9e\xc9\x44\x18\xaa\xe1\x08\xeb" + "\xfc\xc5\x17\x7e\x79\x89\x9c\xfd\x71\xf1\x01\x16\x7b\xf0\x09\x37\x3a\x84\x05\x35\xda\x36" + "\x96\x5d\x1d\xa7\x9e\xf4\xf0\xde\x43\xbd\xf4\xa3\x60\xe0\x2f\xf2\x4c\x77\x5a\x10\xa9\x64" + "\x10\x78\x6a\x00\x08\x21\x70\xcc\xc5\x3a\x4d\xd4\x27\xfd\x5f\xee\xf0\xc1\x61\x21\xb5\xed" + "\x00\x8e\x63\x92\x38\x39\x47\x8e\xc9\x04\x05\x6e\xd9\x58\xbd\x01\xac\x6c\xa7\x78\xfc\xda" + "\xee\x6e\x5f\xd1\x9b\xae\x0b\x3a\xf3\xd8\xcb\xf5\x35\xa5\xc7\x65\x9b\x69\xd3\xc0\xf8\xd3" + "\xc6\xc2\xd1\xca\x2a\x32\x67\xd0\xa1\x88\xbf\xb5\xca\x5b\xb9\xe1\xfb\x57\x91\xd5\xa4\x76" + "\x83\x94\xe3\x49\x41\x13\x02\xc6\xa9\x2d\x5e\xe1\x5a\xb7\x84\x48\x35\xc8\x65\x4f\xa4\x24" + "\x9c\xc1\x60\xb6\xf4\xa4\x82\xf6\x30\xb1\x0d\xd4\x8d\x5a\x60\xff\xd0\xb0\x25\xd2\x53\x24" + "\xb8\x27\xff\x75\x2d\xfc\x4e\xfa\xcf\x94\x89\x39\x52\xeb\x79\xdb\x4e\x1e\x98\x45\x50\xe4" + "\x9c\xda\x78\xea", + "\x3f\x59\x28\xa4\xa4\x7d\xc2\x54\x7e\x2a\xc8\x30\xe5\x53\xc2\x7f\x0e\x5e\x7c\x2b\x9a\x96" + "\xff\x4b\x03\x3f\x89\x36\x38\x54\xbc\xea\x6d\x99\x73\x12\x83\xa3\x46\xdc\x1b\x5c\xc9\x2c" + "\x70\x96\x94\x39\x75\x67\x2f\x32\x6b\x62\x4c\x19\x0f\x38\xbd\xb5\x6b\x1f\xa2\x89\xf6\x5a" + "\xe3\xc2\xd3\x71\x0c\xbd\xf4\xe7\x6e\xc5\xd5\x51\x87\x71\x9c\xfe\x03\x90\xc8\x93\x23\x78" + "\x9b\x3f\x98\x64\xc4\x8d\xb5\x3b\x6b\x8c\xee\xfb\x32\x0b\xee\x58\x6b\x9a\x7f\x5b\x01\xc2" + "\x9e\x01\xe4\xc9\xb2\x3c\x35\x03\x05\x6c\x22\x12\xe5\x57\x34\x34\xb9\xe2\x5b\xaa\xef\x88" + "\x66\x30\x62\xbe\x22\x18\x46\xcd\x3f\xba\x3e\xd9\x12\x39\x29\x45\x7b\x2a\x02\x7b\xe0\x2d" + "\x5f\xad\xdc\x85\xcd\x65\xaa\xb3\x87\x1d\x24\x77\xfc\xde\xdb\xec\x42\x08\x86\xe1\x42\xaf" + "\xd0\xfb\xbf\x2d\xdf\xe0\x01\xf8\x90\x0d\x48\x1c\x4a\xa7\x39\x0a\x76\x8a\x79\x66\x28\x2b" + "\xb0\x06\x1b\x55\xa8\x59\x87\x8c\x08\x60\x83\xf7\xc4\xa7\x6f\xdb\x75\x3c\xfd\x55\xa4\x4a" + "\xf7\x4a\xb2\xb0\xbe\xa8\x97\xcf\x68\x6b\x1d\x34\xb3\xc6\xf2\x42\xbd\x24\x0c\x5c", + 1, 1792 }, + { 0, 128, 27, "\xcf\xa2\xc3\x03\x90\x2f\x3b\x17\x19\x9d\xd2\x89\x5b\xf4\x6e\x20", NULL, + "\x44\xd6\xdd\xbf\x63\xe3\xb4\x9b\x88\xc3\x34\x53\x8a\x55\x60\x08\x1d\x95\x9e\xb6\x1a\x92" + "\x48\x05\xba\x5f\x1c\xe4\x21\x4f\x35\x85\xb4\x88\x02\xef\x53\x9d\x09\x7b\xd9\xf1\x61\x5c" + "\x38\x1d\x3d\xe3\x35\x38\x00\x88\x2b\xe0\x54\xbd\x02\xa1\x62\x28\x70\xc6\x5b\xce\x55\x89" + "\x18\xf3\x16\xf7\x56\x62\x9d\xa1\x1f\xdd\x9c\x26\xc3\xd6\x66\x08\x4d\x3d\x88\x2a\xce\x32" + "\xd5\x82\x0b\xc8\x24\xf3\x45\x4d\xa4\xa1\x70\x72\x35\xb7\xb5\x08\x80\xcf\xdc\x6a\x8e\x26" + "\xd0\x48\xeb\xaa\x80\xa6\x70\xc3\x57\xd9\x93\x2b\xbd\x0e\x95\x53\xc9\x2c\xea\x37\x00\xde" + "\x74\x46\x2b\x41\xf6\x78\x72\xc2\x57\x22\x7f\x8b\xbc\x1a\xd7\x8d\xed\x0b\x5a\x3c\x4c\x84" + "\x31\x0f\x87\x0e\x12\xec\x79\xd2\x88\x9c\xe6\x58\x44\xfa\x9a\x04\xc4\x82\x02\x86\xb1\x1d" + "\x4b\x80\xf2\x38\x01\x77\x9f\xb7\x38\x8a\xb5\xae\x85\x83\x2f\x5e\x71\x72\xe6\x3d\x2e\xb7" + "\xe1\x4f\x2c\x62\x95\x75\x13\x85\xd6\xb5\x80\x95\xbd\x13\xc2\xe9\x20\x88\xc6\x9b\xaa\x82" + "\x45\xe4\x74\xef\xa0\x8f\xab\x3b\x59\x38\x71\x3f\x52\x81\xd8\xa6\x9b\x69\x3c\x01", + "\x8f\xb5\x55\x30\xd0\xed\x74\x28\x7b\x4d\x6a\xe9\x12\x0a\x72\xf9\x44\x98\x1d\x79\xa6\x01" + "\x06\xee\x26\x0f\x42\xb7\x1c\x87\x88\x6d\xef\x3a\x2d\x28\xf3\x74\xb0\x54\xb3\x2f\x73\x10" + "\xd4\xc4\xc1\xb5\x77\x78\xbc\xf1\x55\x1a\x10\x1b\xad\x16\x1a\x72\x45\x00\x96\xb2\x12\xeb" + "\xcc\xb3\xe0\x05\x86\x94\x9f\x1d\x18\xcb\x9c\x27\x79\x33\xd6\x42\x7a\x8b\x19\xab\xcb\x65" + "\x89\xaf\x4e\x3a\x71\x4a\x6e\x50\x5c\x07\xf7\x75\x82\x00\x78\x68\x75\x2d\xcf\x5d\xa4\x1f" + "\xf5\x2d\xde\xc0\xb1\xb2\xaa\x88\x51\x9d\xf4\x41\xbe\x9a\x55\x8c\x34\x76\x6e\xe0\xf3\x5a" + "\xbe\xbc\x24\xf3\xc1\x9f\x85\x0d\x35\xa6\x7b\x07\x49\xe3\x9d\x78\x4c\x13\x66\x42\xda\x50" + "\x47\xe5\x6e\x0d\xc5\x4c\x74\xf9\x27\x76\xc7\x2e\x4e\xcb\x98\x01\xf6\x6e\xca\xc0\x84\xfa" + "\x47\x6d\x1c\x64\x54\xe5\x92\xcd\x9d\xe5\x6a\x3f\xcb\x32\x6e\x54\xe2\xea\xbc\x6b\x5a\xa5" + "\x50\x30\xf6\x05\x20\x98\x89\xde\xdb\xe1\x50\x20\xc2\x4e\x61\x96\x13\x5f\x83\xc2\x86\x9d" + "\x43\x17\xde\x6a\xf2\x11\x4f\xdf\x74\xe5\xbc\x46\x5f\xd0\x2e\x9b\x10\x81\x1a\xe0\xc6\x35" + "\x9c\x11\x2a\x40\xa0\xf1\xaf\x87\x60\x65\x24\x91\xc1\xa0", + 1, 1920 }, + { 0, 128, 28, "\x86\x18\x6e\x1b\x51\xb0\xc9\x19\x28\xe8\x2c\x25\x37\xbd\xdc\x37", NULL, + "\x18\x42\x8f\xbd\x7f\x62\xcc\x19\xbd\x83\x10\x60\x67\x97\xfa\x9c\xac\xe9\x2a\xa9\x81\x20" + "\xbb\x8a\xbe\x06\xb3\xac\xfd\x80\x64\x62\xca\x75\x73\x1a\x00\x8c\x97\x37\x99\x08\x11\x74" + "\x0c\x36\x20\x17\x01\xf9\xda\x18\x25\x41\xdb\xd1\xbf\x12\x48\x45\x1c\x1a\x1a\xb6\x74\xdf" + "\xbe\xfb\xfd\x8b\x4a\xc7\xd7\x3a\x6a\xc2\x28\x25\xd2\x07\x50\xef\xd8\xb8\x1f\xf2\x73\x28" + "\xfb\x96\x28\x51\x61\xd5\x9b\x25\x1c\x66\x1b\xec\x48\xc9\xec\xf4\x96\x65\x0a\xc6\x50\xe9" + "\xcb\x56\xf3\x79\x3a\x09\xbf\xb3\x68\x06\xde\xfd\x76\xd3\x4c\x2c\x80\xee\xc2\x68\x62\xef" + "\x8d\x84\x7f\xd5\x3a\x42\x52\xfe\x8d\x63\xfe\x07\xd7\x2a\x86\xe6\xf4\x38\x19\xa4\xdf\x10" + "\x46\xbd\x67\x1e\x4f\xd2\xe8\x5b\x48\xa2\xa4\x8f\x3d\x5f\xab\xc9\xc8\xc6\xcf\x70\x6b\xad" + "\x6a\x85\x13\x75\xf8\xb2\x52\xf9\x0e\xf4\xe3\xca\x9f\x30\xe3\xe7\x9d\x70\x7a\x92\x8a\x6e" + "\x62\x53\x34\xa0\x92\x45\x20\xaf\xfe\x4e\xde\xa9\x6a\x37\xb3\xc8\xd5\x5d\x65\xb2\x0d\x8e" + "\x6f\x8d\xfe\xfa\x9c\xca\x7c\xa1\x21\x8a\xa9\x73\x1c\x75\x94\x34\x92\xad\x68\x6e\xc6\xa6" + "\xa0\x47\x92\xd5\x0a\x57\x1c\x0f\x92\x99\x17\x3b\x58\x8a\xf2\x0b\x04\xa7\x14\xb4\xf0\x99" + "\x5b\x28\x4b\x72\x7b\xe9\x3b\x57\x65\xf9\x8a\xde\x0c\xb4\xcc\x5d\x1d\xf3\x14\x6f\xca\xc6" + "\xb3\x17\x8e\xe5\x38\x44\x11\x9f\x00\x73\xa5\x47\x98\x2b\x8f\x2c\xbb\x66\x19\xa4\xc4\x8a" + "\xc1\xc6\x90\xaf\x7e\x79\x29\x94\x43\xc2\xed\x09\x2f\xc2\x67\x35\x87\x23\x44\xc7\x61\x3d" + "\xa6\x35\x1a\x46\x72\x80\x16\xa6\x85\x31\x06\xb6\x82\xc2\x35\xd3\x55\x21\x85\xf0\x2f\x6b" + "\x1b\x25\xa1\x26\x53\x0f\x16\xf1\xd6\xca\x06\x48\x95\x93\x54\x78\xcc\x4a\x88\x6f\x1d\x67" + "\x58\x12\xe6\x1d\x2b\xa9\x1a\x75\x0e\xea\x95\x6d\xea\xef\xf5\x74\xdb\x03\x83\x68\xba\x00" + "\x3a\x95\xb8\x71", + "\x65\x6b\x7e\x2a\xf9\x3a\x2e\xab\x65\xf3\x3e\x76\x6c\xb4\x98\xf7\xa0\x7e\x26\x46\xca\x97" + "\xba\x16\x79\x71\xcd\xb2\xa2\x28\x4b\x13\x05\x7c\x24\x2b\x04\x26\xec\x7d\xeb\xb7\xed\x75" + "\x29\x8c\x18\x2f\x1d\x51\xd7\xcb\x53\x2c\x9c\x5d\xc7\x99\x28\xab\xdc\xf1\x66\x6f\xde\xcc" + "\x4b\x8f\x15\x49\xb3\x18\xc4\x40\xa4\x40\x71\x15\x38\x63\xf1\x70\x32\xde\x97\x59\x54\x35" + "\xe3\x12\x15\xda\xe8\x32\x05\x0f\x9e\xde\x42\x7b\x9f\x2a\x5a\xa2\xae\x10\x00\xf0\xa7\x43" + "\xc4\x9c\x26\x7c\x00\x41\xb8\xab\xd0\x9a\xda\x85\xfc\x77\xc8\xc8\x62\xd3\x97\x9e\xff\x7b" + "\x7f\x9a\xaf\x47\x47\x53\x71\x2e\x6f\xce\xf1\x84\xdd\x0d\x8e\xb2\x44\xd7\x72\x8e\xa1\x83" + "\x11\xe9\x75\x80\x46\x24\x7b\x40\xb5\x1e\xc0\x98\x97\xa3\x32\x90\x09\x1b\x02\x08\x7b\x4c" + "\xf6\x71\xe8\xe9\xf0\x3c\xb2\x9b\xb9\x36\xab\x6a\xba\xe6\x8b\xaa\xd4\x34\x3d\x91\xe8\x14" + "\xa5\xaa\x61\x18\xf9\x34\x42\x28\x63\xd0\x6f\xe3\x95\x49\x06\x11\xfd\xc8\x9e\xc5\xe5\x21" + "\xaa\x83\x2b\xdb\xe9\x12\xde\xca\xf2\xde\x28\x46\x5d\x11\xa9\x3d\x60\x2c\x60\xdb\x3f\xa1" + "\x13\xc3\x4a\xfa\x4f\x2f\x22\x5b\xe5\x00\x47\x5d\x77\xbc\x57\x5b\x79\x4c\xe6\x35\x3f\xae" + "\xb1\xba\xf3\xc9\x01\x12\xcf\x80\x0f\x38\xc5\x50\x41\x34\xec\x68\x32\x37\x0b\x9d\x53\xc8" + "\x24\xda\x82\x21\x09\xf4\x98\x57\xe6\x2e\xd0\xce\x88\x67\xb4\x21\x91\x4d\xc0\x12\x20\x76" + "\xec\xd8\x95\xe1\x02\x37\xac\xd8\x5b\x52\x42\xad\x44\x4a\x28\x84\x19\xd7\xe5\xf0\xef\x38" + "\x8d\x54\x37\xbe\xbe\x87\x2d\xdb\x55\x34\xdc\xaf\x65\x3d\xd5\x39\x10\xee\x38\x48\x85\x79" + "\x06\xce\xc8\x1e\xf9\xca\x3f\xe6\xa1\x2a\xfa\x9f\x48\x50\xf5\x68\x99\xcf\x00\xab\x86\x89" + "\x6e\x53\x6e\x33\xb8\xbf\xdd\x72\x80\xb4\x15\xb7\x11\x86\x65\xf7\x6b\xc0\x56\x25\x29\x11" + "\xc8\x2c\x19\x56\x0e\x0d\xd9\xcc\x2b\x36\xcd\xf3\xd0\xf5\xf3\x7b\xd9\x02\xe1\xc4", + 1, 3200 }, + { 0, 128, 29, "\x62\x1b\x7f\xab\x39\x8d\x59\x3c\x41\xba\xa2\xe9\x74\xda\x44\xea", NULL, + "\xde\xf6\x7a\x2c\x95\xb2\x46\x08\x06\xd5\xac\x78\xc5\xf3\x09\x01\x9f\x1d\xe0\xe6\x2b\xa2" + "\x5e\x01\x38\x02\xe3\xf4\x4f\x27\xb9\x1a\x68\x5b\xb3\xd2\x2d\x16\xb2\xa4\xda\x4b\x6a\x0e" + "\xc9\x5d\xe4\x55\x1b\xad\x63\x5a\x56\x7d\x96\x7c\x76\x25\x5b\xa4\xc4\x78\x4d\xd8\xd7\xc0" + "\xf5\xdb\x25\x65\x5a\x45\x78\xb8\xf3\xb7\x31\xce\x08\xe2\x42\x9c\x16\x94\xcf\x73\x89\xc4" + "\x8e\x14\x84\x63\x4f\xf9\x93\xaf\x55\x50\x30\xe4\xc3\xc1\x79\x6a\x01\xb7\xe5\x98\xaa\x96" + "\xc3\xbe\x3a\x1a\x91\x2b\xce\x62\x67\x65\xfb\x9b\x6e\x0e\x99\xfd\x0c\x36\xce\x13\x67\x66" + "\x41\x0a\x3d\x8c\xcd\xb7\x96\xb2\xbc\xb7\x37\x67\x4e\x38\xf6\x57\xc8\x14\x97\xcc\x1f\xb8" + "\xc0\xb4\x29\xa1\x8c\x42\xa9\xe0\xad\xf1\x24\x8c\x1f\xc8\xd2\x0c\x8c\x48\xe3\xd1\xd1\x94" + "\xe2\x24\x29\x1c\xc3\x39\x3b\xc6\xb3\x62\xd1\x36\x4b\x4b\x05\xae\x3c\x2d\xc0\x85\x85\x31" + "\x65\x45\x50\xcd\xba\xc8\x49\xc2\xeb\x4a\x86\xfa\x2a\xc8\x32\x92\x68\x62\xef\x56\x4e\xc1" + "\x08\x9b\x45\x55\x82\x29\x7c\x05\x0f\x5c\x1b\x97\x15\x11\x9b\xe9\x91\x0d\x5e\x42\x33\xfa" + "\xec\x54\x84\xd9\xe9\xb7\xb0\x41\x66\x1d\x61\x34\x6c\xa2\x2a\xd0\x30\xc8\x43\x33\x4b\x61" + "\x34\xc4\x3d\xee\xa6\x69\x82\x92\x46\x5c\x8a\x9f\x4f\x0c\x26\x54\x4b\xda\x6e\xb7\x25\xa8" + "\x37\x1b\xc7\x6c\xcf\x56\xb9\xe3\xde\x64\x9e\x52\x3f\xd8\x00\x6d\x7b\x3e\x12\x4f\x1b\xa4" + "\x67\x14\x5f\xba\xb7\x93\x8b\xd1\x4b\x28\x74\xa2\x5e\x3b\x80\x33\x1b\x98\x0b\x09\x2d\x2b" + "\xa6\x3b\xac\xb8\x58\x0e\x49\x1a\xfb\xbc\x64\x0f\x81\x45\xd8\xcd\x42\xe3\xea\x48\x44\x11" + "\x10\xb6\x37\x5f\xec\xb9\x42\x82\x2f\xa2\x90\xc7\xaa\xa7\x66\xcd\xe4\x0f\x9c\x22\x00\x63" + "\x60\x9b\x3a\xb2\xaf\x5e\xe2\x6d\x68\xa9\xca\xf7\xed\x1b\x86\x02\x4b\xc4\x51\xc4\xe4\x82" + "\x2d\xfd\x5c\x9f\xf7\xa0\xcb\x84\x80\x84\x6b\x8e\xa1\xa4\xee\x33\x9c\x98\xbe\x46\x4a\x13" + "\xb7\x4c\xe2\x4a\x76\x7f\xdd\xe6\x54\x5d\xa4\x3c\x32\x4b\x00\xb3\xd2\x55\x81\x4c\xbb\xaf" + "\xba\x4c\xd9\xb9\x47\xe1\xde\xed\x77\xb4\x11\x26\x66\x08\x8e\x63\x54\xa2\x51\x01\xe9\x7d" + "\xdf\xb3", + "\x36\x7e\x98\x57\x40\xc4\x9d\x9b\xc8\xbc\xd3\x9c\x8e\x24\x81\xd5\x87\xc3\x37\x55\x12\x8d" + "\xb6\x42\x87\xa1\xbb\x13\x27\x26\xcd\x4d\xc1\x6d\x0e\x81\xbb\xc8\x97\x2f\x3e\x86\x74\x3b" + "\x51\x5e\x11\x4a\xd1\x76\x96\x5d\xf0\x1f\x2f\xd4\xc6\xa1\x7d\x55\xe2\x35\xea\x22\x3c\xa1" + "\x49\xbf\x1a\x29\xca\x45\x89\x84\x5b\x61\x26\xef\xf0\x93\xb1\x8e\xcd\x68\xfe\x0e\x68\x6e" + "\xdc\xf6\xdb\xa1\x26\xdf\xef\x6d\x28\x19\x6c\xfa\x4c\x6a\x53\x95\xd8\x74\xa0\x1d\x4f\x69" + "\xb8\x07\xcf\x4d\x34\x04\x7f\x5d\x04\x2f\x31\xb1\x4c\x69\x8c\xd1\x93\x59\xbc\x70\x7a\x30" + "\xe1\x07\xe0\x09\xb7\xf7\x6c\x21\xde\x65\x4a\x07\xa4\x2e\x81\x9a\x4a\x5b\x5e\x1c\x0c\x3c" + "\xce\x4c\x94\xa2\x01\xcb\x21\x5b\x36\xf0\x40\xa2\xdd\x2a\xfa\x5e\xbe\x2d\x21\xfa\xb8\x27" + "\x7a\x21\x00\xfc\x22\x65\x15\xa9\x82\xb3\xa5\x1e\xee\xe2\xff\xb3\x9e\xd4\xc1\x0d\xa5\x85" + "\x42\xcc\x71\x05\x4e\xad\xff\xf8\x90\x8c\x7c\xad\xf5\x62\xe9\x7e\x3b\xaa\x23\xf1\x70\x22" + "\x61\x52\x02\x5c\x4b\xe9\xd4\xf5\x40\xc2\x49\x44\x02\xa6\x35\xb7\xb1\x05\x25\x6f\x8d\x08" + "\x7f\x15\x6d\x60\x6f\x98\xed\x07\xa1\x42\xbe\x94\x55\x05\x26\x2e\xc6\x7d\xa9\x35\xb0\xdd" + "\x08\xb2\x2d\xc9\x0f\x5e\x40\x68\xc7\xd3\x55\x25\xe9\x59\x1d\xfb\xcd\x08\x5b\x09\x79\xe3" + "\xf6\xfd\x57\x77\xee\x5b\x87\x9a\x99\xbd\x4d\xa1\x16\xef\x55\xe5\x38\x3f\xe6\xbf\xcc\x5e" + "\x5a\x28\x80\xcf\xb5\x19\xaf\xc8\xaa\x5c\xb2\xaf\xad\xe9\xe6\xce\x66\x82\xbf\x86\xdb\x4c" + "\xa0\x3c\xf0\xc2\x25\x2b\xa9\xa0\xee\x88\x16\x22\x44\x83\xb1\x7a\x46\x50\xc4\xba\xc4\x7d" + "\x3e\x39\xab\xba\xd8\x21\xc6\x39\x17\x82\xcf\x47\x73\x7f\xb1\x91\xb2\x77\x73\x0d\x58\xc6" + "\xe7\x72\xb0\xb7\xb5\x57\x08\xca\x38\x3f\x23\x81\x9a\xa0\x7c\x91\x85\x6d\x36\x8f\x01\x3b" + "\x75\xbb\xab\x7d\x4d\x75\x0b\x95\x12\xe9\x0b\x99\xa9\x0c\xdc\x6b\xf8\x36\xd2\x8f\x4f\x84" + "\xc6\x53\x21\xaf\x67\x2d\x7b\xcd\x74\xe0\x6b\x77\xee\x1c\xb1\x9f\x96\xc7\x7a\x88\xc7\xb0" + "\x0a\xda\xfe\xaf\xd8\xc1\x6a\xfa\x9f\x34\x78\x99\xb6\x48\x5d\x0b\x21\x54\x16\x86\xd8\x21" + "\xfb\xe8\x6d\x12\x23\x82\x18\x03\xe1\x75\xbb\x76\xb1\xfd\x98\x94\x02\x74", + 1, 3712 }, + { 0, 128, 30, "\xef\x3f\x9a\xbb\x74\x72\x7c\x7f\xad\xa0\xb5\x4a\x46\x21\x83\x56", NULL, + "\x4d\x32\xf9\x19\x63\x1b\x7e\xc3\xd8\x01\xa1\x52\xcd\x03\x93\xde\x26\xff\x93\x34\xa1\x3e" + "\xa5\xfb\xa5\x33\x20\xf3\xcd\xf2\xc7\xc8\x5c\x40\x46\xce\xe9\x7d\x4b\x7c\xd6\x7a\xf6\x61" + "\x1d\x10\x27\x20\x3c\x94\x90\xb4\x9d\x85\xc8\x91\xe4\x5e\xe9\x48\x13\x85\x49\xa0", + "\x73\x3d\xeb\x19\x13\x2b\x03\x6d\x0d\x9d\xa7\xf1\x08\xfc\xdd\xcb\x42\xfe\x31\x03\x8e\x8f" + "\x7f\xce\x96\xab\xf0\xdc\xa8\xde\xb9\x0d\x97\xf0\x82\x91\x1c\x42\x5f\x9a\x9a\xed\x76\x2a" + "\xa3\x66\x4d\x7a\x83\xd6\x0a\x1b\xa8\xac\x04\x32\xb5\x6e\xfa\x03\xe7\xe2\x8d\x74\x8a\x68" + "\x7a\xee\xe3\x8b\x2d\x90\x81\x3b\xf6\x94\x5a\x65\x90\x1e", + 1, 512 }, + { 0, 128, 31, "\xd9\x0e\x46\x86\xe4\xf8\xdc\x98\xd1\xc4\x07\xbe\xe7\xd5\xe0\x3f", NULL, + "\x5b\xbd\x34\xc7\xda\xb4\x41\xa6\xa3\x03\xb3\x58\x2e\x84\xe6\xee\xf9\x18\x07\xe5\x77\xa0" + "\x02\xcb\x4b\xa5\x27\x66\x10\xe7\x9a\x3f\x92\x4a\x97\xa1\x00\x20\x1d\xa4\xcc\x62\xb0\xc9" + "\xb8\x26\x96\xc7\x8c\x8b\x87\x0a\x86\xb0\x09\x4d\xf8\x24\x51\xaa\xff\xa2\x4d\x15\x2c\x81" + "\xe5\x98\x46\x1b\xd3\x69\xeb\xc3\xaa\x0a\x9a\x4f\x5f\x06\x87\xd4\xaf\xed\x06\xc5\xca\x5c" + "\xd6\xc4\xf6\x3c\x83\x2b\xb3\x47\xbb\xb8\x3c\x73\x83\xb5\x6b\xb4\x60\xdd\x83\x03\xd1\x42" + "\xdd\x1e\xfa\xb5\x2e\x63\x31\x35\xf1\x82\xf5\xf0\xc6\xe7\xad\x97\x9b\x29\xc4\x5f\x4c\x5b" + "\x0d\xb2\xcf\x11\x9d\x1f\x8e\x86\x4d\x06\x3f\xee\x95\xb0\x23\xf0\x23\x23\xa8\x3d\x4c\xf6" + "\x23\xc8\x7d\x55\x54\x22\xc0\x8a\xe8\xda\x11\xd6\x3b\x67\xac\x6a\x68\xb4\x39\x2b\x70\xcb" + "\x97\xfb\x2a\x55\xd3\x8d\x15\x8d\x42\x65\x98\x3d\x57\x75\x2d\x79\x09\xb3\x80\x32\xe2\x2f" + "\xb5\x7b\xf1\x7e\xe6\xce\x58\xce\x83\x10\x1b\xb3\x0d\x92\x0d\xb3\xa6\xf1\x45\xc8\xd4\x05" + "\x57\x6b\x9c\x43\xa7\xf4\xbb\x6a\xd9\x79\xbe\x5e\x9e\xdc\x08\x23\x92\x91\x78\x0b\x3a\xe4" + "\x4f\xff\xe1\xff\xec\x45\x56\x8d\xde\xec\x08\xbd\x20\xf4\x83\xab\x0f\xa9\x7e\x14\x6c\x7f" + "\x49\x4a\x00\x92\x6d\x6a\xbe\x97\xf9\x85\x09\x93\x87\x9c\x48\x1f\x00\xb2\xc6\x98\x17\xd3" + "\xfd\x86", + "\xa3\x6c\x2d\x35\x0f\x62\x10\x15\x44\xdc\x24\xe6\x5d\x0e\x58\xa5\x13\x0c\x23\x5b\x25\xb4" + "\xf1\x79\x7a\x3a\xb9\x8d\x54\x2a\x37\xe5\x22\x1d\x63\x73\x67\x6f\x16\x4b\xc4\x08\xe2\x9f" + "\xd3\x09\x99\x03\x40\x64\x68\x9c\x1d\x0f\xdb\xf1\x16\x5f\x68\x2f\xcd\x78\xb7\x44\x07\x90" + "\xf4\x8d\xe7\xbc\xd0\xf2\xc5\x7d\x99\xe1\x3f\x99\xa3\x24\xe7\xbf\xff\x27\x44\x4c\x08\xa6" + "\x37\x5e\x67\x70\x53\x1f\x11\xcd\x00\x9e\x9e\xd9\xbe\x6b\x15\x92\xe4\xa2\xe8\xb2\xb4\x3a" + "\xd3\x4b\xc6\x13\x88\x5b\x8c\x70\x0e\x5d\xbe\x50\xef\x0c\x2e\xbb\x2f\x38\x3e\xef\x7f\xeb" + "\x73\x50\xc4\x70\xbf\xa9\xbc\x07\xbc\xbf\xf0\x78\xe4\xae\xe9\x1b\xb5\x7c\x32\x18\x1f\x52" + "\xcf\x3b\x18\xa6\x3e\x5b\xf5\x48\x16\x34\xe8\x1a\x96\x10\x72\x06\x06\xb8\xc6\xbe\xc1\xa6" + "\x5d\x58\x0a\x27\x7b\x1f\x64\x84\xf1\xcb\xfb\xef\xac\x90\x68\xfd\x45\x62\x9e\xd2\x10\xa0" + "\xe5\x5c\xf8\xfe\xf4\xd7\xc3\x20\x0c\x2a\x0d\x91\x67\x6e\x48\x4d\xb4\x33\x75\x14\x97\x53" + "\xdb\x66\x20\xbb\x6f\x42\xc7\x03\x30\x7b\xb6\xdd\x30\x57\xb1\x7a\x9b\xd2\x90\x17\xb4\xc0" + "\x55\xb0\x15\x0a\xfd\x79\x0c\xa9\x8e\x65\xe7\xe3\xa9\x7d\x0c\x1d\xa5\x70\xd6\x20\x3c\x63" + "\xcf\x8e\x9b\x13\x83\x1d\xf5\xbe\x76\x5c\x28\xdd\x66\xb7\x91\xd4\x29\x6d\x69\x2d\xe4\x61" + "\xae\xbe\x89\x48\xd2\x62\xb7\xb2\x80\xf2\x6b\xe8\xc8\xc2\x76\xff\x81\x5c", + 1, 2304 }, /* Vectors from https://datatracker.ietf.org/doc/draft-ribose-cfrg-sm4/00/ and https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 */ - { 0, 128, 1, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", NULL, + { 0, 128, 32, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", NULL, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", "\x68\x1E\xDF\x34\xD2\x06\x96\x5E\x86\xB3\xE9\x4F\x53\x6E\x42\x46", 1, 128 }, - { 0, 128, 2, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", NULL, + { 0, 128, 33, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", NULL, "\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD" "\xEE\xEE\xEE\xEE\xFF\xFF\xFF\xFF\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB", "\x5E\xC8\x14\x3D\xE5\x09\xCF\xF7\xB5\x17\x9F\x8F\x47\x4B\x86\x19" -- GitLab From d0cb8e83f8e2fcb5293a63c11cab70cc28ddce5f Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 22 Sep 2023 14:53:23 +0100 Subject: [PATCH 089/204] perf: [cmake] copy scripts to bin directory on Linux & BSD --- perf/cmake/unix.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/perf/cmake/unix.cmake b/perf/cmake/unix.cmake index 3db98a36..c1431eca 100644 --- a/perf/cmake/unix.cmake +++ b/perf/cmake/unix.cmake @@ -61,8 +61,15 @@ if(CMAKE_COMPILER_IS_GNUCC) string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") endif() +# set destination dir to copy scripts +if(IMB_BIN_DIR) + set(COPY_DST_DIR ${IMB_BIN_DIR}) +else() + set(COPY_DST_DIR ${CMAKE_CURRENT_BINARY_DIR}) +endif() + # copy perf scripts to binary directory configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipsec_diff_tool.py - ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) + ${COPY_DST_DIR}/ipsec_diff_tool.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipsec_perf_tool.py - ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) + ${COPY_DST_DIR}/ipsec_perf_tool.py COPYONLY) -- GitLab From 5decadb4a7e244deef651ba77026e30e5aa02a84 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 20 Sep 2023 10:51:49 +0100 Subject: [PATCH 090/204] lib: [sm3] add generic support for SM3 hash algorithm --- README.md | 1 + ReleaseNotes.txt | 3 + lib/Makefile | 3 +- lib/include/mb_mgr_job_api.h | 31 ++++- lib/include/mb_mgr_job_check.h | 15 ++ lib/include/sm3.h | 44 ++++++ lib/ipsec-mb.h | 4 + lib/win_x64.mak | 1 + lib/x86_64/sm3.c | 243 +++++++++++++++++++++++++++++++++ 9 files changed, 340 insertions(+), 5 deletions(-) create mode 100644 lib/include/sm3.h create mode 100644 lib/x86_64/sm3.c diff --git a/README.md b/README.md index 8ff9980b..e7f7a6f4 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ Table 2. List of supported integrity algorithms and their implementations. | GHASH | N | Y by8 | N | Y by8 | Y by8 | Y by32 | N | | CRC(6) | N | Y by8 | Y by8 | N | N | Y by16 | N | | PON-CRC-BIP(7) | N | Y | Y | N | N | Y | N | +| SM3 | Y | N | N | N | N | N | N | +-----------------------------------------------------------------------------------+ ``` Notes: diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 2fef9bb1..d6c9b7f0 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -9,15 +9,18 @@ Library - AVX2-VAES AES-CTR implementation added. - SM4-ECB SSE implementation added. - SM4-CBC SSE implementation added. +- x86-64 SM3 implementation added. Test Applications - QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. - SM4-ECB and SM4-CBC tests added. +- SM3 tests added. Performance Applications - New parameter added to benchmark QUIC `--quic-api`. - Burst API is benchmarked by default now. - SM4-ECB and SM4-CBC support added. +- SM3 support added. v1.4 June 2023 ======================================================================== diff --git a/lib/Makefile b/lib/Makefile index 2e061735..cffee1b5 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -465,7 +465,8 @@ asm_generic_lib_objs := \ poly1305.o \ chacha20_poly1305.o \ mbcpuid.o \ - atomic.o + atomic.o \ + sm3.o # # List of ASM modules (no-aesni directory) diff --git a/lib/include/mb_mgr_job_api.h b/lib/include/mb_mgr_job_api.h index 654468a1..1a2e87c3 100644 --- a/lib/include/mb_mgr_job_api.h +++ b/lib/include/mb_mgr_job_api.h @@ -56,6 +56,7 @@ #include "include/job_api_kasumi.h" #endif /* __aarch64__ */ #include "include/mb_mgr_job_check.h" /* is_job_invalid() */ +#include "include/sm3.h" #ifndef __aarch64__ #define CRC(func, state, job) \ @@ -2818,6 +2819,12 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) return job; case IMB_AUTH_GHASH: return process_ghash(state, job); + case IMB_AUTH_SM3: + sm3_msg(job->auth_tag_output, job->auth_tag_output_len_in_bytes, + job->src + job->hash_start_src_offset_in_bytes, + job->msg_len_to_hash_in_bytes); + job->status |= IMB_STATUS_COMPLETED_AUTH; + return job; #endif /* __aarch64__ */ default: /** @@ -3213,6 +3220,12 @@ submit_hash_ghash(IMB_MGR *state, IMB_JOB *job) } #endif /* __aarch64__ */ +static IMB_JOB * +submit_hash_sm3(IMB_MGR *state, IMB_JOB *job) +{ + return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SM3); +} + static const submit_flush_fn_t tab_submit_hash[] = { /* [0] invalid entry */ NULL, @@ -3333,12 +3346,14 @@ static const submit_flush_fn_t tab_submit_hash[] = { submit_hash_crc6_iuup_header, /* [46] GHASH */ submit_hash_ghash, + /* [47] SM3 */ + submit_hash_sm3, #else /* __aarch64__ */ - /* [32] - [46] NULL */ + /* [32] - [47] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, #endif /* __aarch64__ */ /* add new hash algorithms here */ }; @@ -3633,6 +3648,12 @@ flush_hash_ghash(IMB_MGR *state, IMB_JOB *job) } #endif /* __aarch64__ */ +static IMB_JOB * +flush_hash_sm3(IMB_MGR *state, IMB_JOB *job) +{ + return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SM3); +} + static const submit_flush_fn_t tab_flush_hash[] = { /* [0] invalid entry */ NULL, @@ -3753,12 +3774,14 @@ static const submit_flush_fn_t tab_flush_hash[] = { flush_hash_crc6_iuup_header, /* [46] GHASH */ flush_hash_ghash, + /* [47] SM3 */ + flush_hash_sm3, #else /* __aarch64__ */ - /* [32] - [46] NULL */ + /* [32] - [47] NULL */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, #endif /* __aarch64__ */ /* add new hash algorithms here */ }; diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 28e90edf..7623ca36 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -1491,6 +1491,21 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ return 1; } break; + case IMB_AUTH_SM3: + if (job->auth_tag_output_len_in_bytes == 0 || + job->auth_tag_output_len_in_bytes > IMB_SM3_DIGEST_SIZE) { + imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); + return 1; + } + if (job->src == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (job->auth_tag_output == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_AUTH); + return 1; + } + break; #endif /* __aarch64__ */ default: imb_set_errno(state, IMB_ERR_HASH_ALGO); diff --git a/lib/include/sm3.h b/lib/include/sm3.h new file mode 100644 index 00000000..7224ae2c --- /dev/null +++ b/lib/include/sm3.h @@ -0,0 +1,44 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +#include "ipsec-mb.h" + +#ifndef SM3_H +#define SM3_H + +/** + * @brief Initializes SM3 hash context structure + * + * @param tag pointer to store computed SM3 digest + * @param tag_length output tag length in bytes + * @param msg pointer to input message to compute digest over + * @param msg_length length of the message in bytes + */ +IMB_DLL_LOCAL void +sm3_msg(void *tag, const uint64_t tag_len, const void *msg, const uint64_t msg_length); + +#endif /* SM3_H */ diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index cf0718b0..8c299353 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -168,6 +168,9 @@ typedef enum { #define IMB_SNOW3G_DIGEST_LEN 4 #define IMB_SNOW3G_IV_LEN_IN_BYTES 16 +#define IMB_SM3_DIGEST_SIZE 32 +#define IMB_SM3_BLOCK_SIZE 64 + /** * Minimum Ethernet frame size to calculate CRC32 * Source Address (6 bytes) + Destination Address (6 bytes) + Type/Len (2 bytes) @@ -340,6 +343,7 @@ typedef enum { IMB_AUTH_CRC7_FP_HEADER, /**< CRC7-FP-HEADER */ IMB_AUTH_CRC6_IUUP_HEADER, /**< CRC6-IUUP-HEADER */ IMB_AUTH_GHASH, /**< GHASH */ + IMB_AUTH_SM3, /**< SM3 */ IMB_AUTH_NUM } IMB_HASH_ALG; diff --git a/lib/win_x64.mak b/lib/win_x64.mak index 68a1b5cf..e226dbdf 100644 --- a/lib/win_x64.mak +++ b/lib/win_x64.mak @@ -224,6 +224,7 @@ lib_objs1 = \ $(OBJ_DIR)\save_xmms.obj \ $(OBJ_DIR)\mbcpuid.obj \ $(OBJ_DIR)\atomic.obj \ + $(OBJ_DIR)\sm3.obj \ $(OBJ_DIR)\clear_regs_mem_fns.obj \ $(OBJ_DIR)\sha1_x4_avx.obj \ $(OBJ_DIR)\sha1_x4_sse.obj \ diff --git a/lib/x86_64/sm3.c b/lib/x86_64/sm3.c new file mode 100644 index 00000000..06da3e9b --- /dev/null +++ b/lib/x86_64/sm3.c @@ -0,0 +1,243 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +#include "ipsec-mb.h" +#include +#include "include/error.h" +#include "include/sm3.h" +#include "include/clear_regs_mem.h" + +/* https://datatracker.ietf.org/doc/html/draft-shen-sm3-hash */ + +#ifdef LINUX +#define BSWAP32 __builtin_bswap32 +#define BSWAP64 __builtin_bswap64 +#else +#define BSWAP32 _byteswap_ulong +#define BSWAP64 _byteswap_uint64 +#endif + +/** + * @note \a outp needs to be of volatile type to avoid the operation being + * optimized out in some scenarios + */ +__forceinline void +store8_be(volatile void *outp, const uint64_t val) +{ + *((volatile uint64_t *) outp) = BSWAP64(val); +} + +__forceinline uint32_t +XOR3(const uint32_t x, const uint32_t y, const uint32_t z) +{ + return x ^ y ^ z; +} + +__forceinline uint32_t +FF0(const uint32_t x, const uint32_t y, const uint32_t z) +{ + return XOR3(x, y, z); +} + +__forceinline uint32_t +GG0(const uint32_t x, const uint32_t y, const uint32_t z) +{ + return XOR3(x, y, z); +} + +__forceinline uint32_t +FF1(const uint32_t x, const uint32_t y, const uint32_t z) +{ + return (x & y) | ((x | y) & z); +} + +__forceinline uint32_t +GG1(const uint32_t x, const uint32_t y, const uint32_t z) +{ + return z ^ (x & (y ^ z)); +} + +__forceinline uint32_t +ROL32(const uint32_t a, const unsigned b) +{ + return (a << b) | (a >> (32 - b)); +} + +__forceinline uint32_t +P0(const uint32_t x) +{ + return x ^ ROL32(x, 9) ^ ROL32(x, 17); +} + +__forceinline uint32_t +P1(const uint32_t x) +{ + return x ^ ROL32(x, 15) ^ ROL32(x, 23); +} + +static const uint32_t K[64] = { + 0x79cc4519, 0xf3988a32, 0xe7311465, 0xce6228cb, 0x9cc45197, 0x3988a32f, 0x7311465e, + 0xe6228cbc, 0xcc451979, 0x988a32f3, 0x311465e7, 0x6228cbce, 0xc451979c, 0x88a32f39, + 0x11465e73, 0x228cbce6, 0x9d8a7a87, 0x3b14f50f, 0x7629ea1e, 0xec53d43c, 0xd8a7a879, + 0xb14f50f3, 0x629ea1e7, 0xc53d43ce, 0x8a7a879d, 0x14f50f3b, 0x29ea1e76, 0x53d43cec, + 0xa7a879d8, 0x4f50f3b1, 0x9ea1e762, 0x3d43cec5, 0x7a879d8a, 0xf50f3b14, 0xea1e7629, + 0xd43cec53, 0xa879d8a7, 0x50f3b14f, 0xa1e7629e, 0x43cec53d, 0x879d8a7a, 0x0f3b14f5, + 0x1e7629ea, 0x3cec53d4, 0x79d8a7a8, 0xf3b14f50, 0xe7629ea1, 0xcec53d43, 0x9d8a7a87, + 0x3b14f50f, 0x7629ea1e, 0xec53d43c, 0xd8a7a879, 0xb14f50f3, 0x629ea1e7, 0xc53d43ce, + 0x8a7a879d, 0x14f50f3b, 0x29ea1e76, 0x53d43cec, 0xa7a879d8, 0x4f50f3b1, 0x9ea1e762, + 0x3d43cec5 +}; + +static void +sm3_init(uint32_t digest[8]) +{ + digest[0] = 0x7380166f; + digest[1] = 0x4914b2b9; + digest[2] = 0x172442d7; + digest[3] = 0xda8a0600; + digest[4] = 0xa96f30bc; + digest[5] = 0x163138aa; + digest[6] = 0xe38dee4d; + digest[7] = 0xb0fb0e4e; +} + +static void +sm3_update(uint32_t digest[8], const void *input, uint64_t num_blocks) +{ + const uint32_t *data = (const uint32_t *) input; + uint32_t W[68]; + + while (num_blocks--) { + /* prepare W[] - read data first */ + for (int i = 0; i < 16; i++) + W[i] = BSWAP32(data[i]); + + /* expand W[] */ + for (int i = 16; i < 68; i++) + W[i] = P1(W[i - 16] ^ W[i - 9] ^ ROL32(W[i - 3], 15)) ^ + ROL32(W[i - 13], 7) ^ W[i - 6]; + + /* read current digest */ + register uint32_t A = digest[0]; + register uint32_t B = digest[1]; + register uint32_t C = digest[2]; + register uint32_t D = digest[3]; + register uint32_t E = digest[4]; + register uint32_t F = digest[5]; + register uint32_t G = digest[6]; + register uint32_t H = digest[7]; + + /* compress */ + for (int i = 0; i < 16; i++) { + const uint32_t SS1 = ROL32((ROL32(A, 12) + E + K[i]), 7); + const uint32_t SS2 = SS1 ^ ROL32(A, 12); + const uint32_t TT1 = FF0(A, B, C) + D + SS2 + (W[i] ^ W[i + 4]); + const uint32_t TT2 = GG0(E, F, G) + H + SS1 + W[i]; + + D = C; + C = ROL32(B, 9); + B = A; + A = TT1; + H = G; + G = ROL32(F, 19); + F = E; + E = P0(TT2); + } + + for (int i = 16; i < 64; i++) { + const uint32_t SS1 = ROL32((ROL32(A, 12) + E + K[i]), 7); + const uint32_t SS2 = SS1 ^ ROL32(A, 12); + const uint32_t TT1 = FF1(A, B, C) + D + SS2 + (W[i] ^ W[i + 4]); + const uint32_t TT2 = GG1(E, F, G) + H + SS1 + W[i]; + + D = C; + C = ROL32(B, 9); + B = A; + A = TT1; + H = G; + G = ROL32(F, 19); + F = E; + E = P0(TT2); + } + + /* update digest and move data pointer */ + digest[0] ^= A; + digest[1] ^= B; + digest[2] ^= C; + digest[3] ^= D; + digest[4] ^= E; + digest[5] ^= F; + digest[6] ^= G; + digest[7] ^= H; + + data += (IMB_SM3_BLOCK_SIZE / sizeof(uint32_t)); + } + +#ifdef SAFE_DATA + clear_mem(W, sizeof(W)); +#endif +} + +void +sm3_msg(void *tag, const uint64_t tag_length, const void *msg, const uint64_t msg_length) +{ + uint32_t digest[8]; + uint8_t block[IMB_SM3_BLOCK_SIZE]; + + sm3_init(digest); + sm3_update(digest, msg, msg_length / IMB_SM3_BLOCK_SIZE); + + const uint64_t partial_bytes = msg_length % IMB_SM3_BLOCK_SIZE; + const uint8_t *trail = &((const uint8_t *) msg)[msg_length - partial_bytes]; + + memset(block, 0, sizeof(block)); + memcpy(block, trail, partial_bytes); + block[partial_bytes] = 0x80; + + if (partial_bytes >= (IMB_SM3_BLOCK_SIZE - 8)) { + /* + * length field doesn't fit into this block + * - compute digest on the current block + * - clear the block for the length to be put into it next + */ + sm3_update(digest, block, 1); + memset(block, 0, sizeof(block)); + } + + store8_be(&block[IMB_SM3_BLOCK_SIZE - 8], msg_length * 8 /* bit length */); + + sm3_update(digest, block, 1); + + for (unsigned i = 0; i < IMB_DIM(digest); i++) + digest[i] = BSWAP32(digest[i]); + + memcpy(tag, digest, tag_length); + +#ifdef SAFE_DATA + clear_mem(block, sizeof(block)); +#endif +} -- GitLab From d4d5cde3648512df63072b785a7f14f003448a14 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 20 Sep 2023 16:47:31 +0100 Subject: [PATCH 091/204] test: [kat-app] added sm3 test module --- test/kat-app/CMakeLists.txt | 2 + test/kat-app/Makefile | 2 +- test/kat-app/api_test.c | 7 +- test/kat-app/main.c | 5 +- test/kat-app/sm3_test.c | 193 ++++++++++++++++++++ test/kat-app/sm3_test.json.c | 338 +++++++++++++++++++++++++++++++++++ test/kat-app/win_x64.mak | 2 +- 7 files changed, 545 insertions(+), 4 deletions(-) create mode 100644 test/kat-app/sm3_test.c create mode 100644 test/kat-app/sm3_test.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 1302aecc..f0be3b7a 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -118,6 +118,8 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/sm4_ecb_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/sm4_cbc_test.c ${CMAKE_CURRENT_SOURCE_DIR}/sm4_cbc_test.json.c + ${CMAKE_CURRENT_SOURCE_DIR}/sm3_test.c + ${CMAKE_CURRENT_SOURCE_DIR}/sm3_test.json.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index d503bb4b..8915e3ea 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -44,7 +44,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ - sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c + sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c sm3_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 576ddee0..871d4e22 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -242,6 +242,7 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, 4, /* IMB_AUTH_CRC7_FP_HEADER */ 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ 16, /* IMB_AUTH_GHASH */ + 32, /* IMB_AUTH_SM3 */ }; static DECLARE_ALIGNED(uint8_t dust_bin[2048], 64); static void *ks_ptrs[3]; @@ -548,6 +549,9 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, job->iv_len_in_bytes = 16; job->auth_tag_output_len_in_bytes = 16; break; + case IMB_AUTH_SM3: + job->auth_tag_output_len_in_bytes = IMB_SM3_DIGEST_SIZE; + break; #endif /* __aarch64__ */ default: break; @@ -1205,7 +1209,8 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) hash == IMB_AUTH_CRC8_WIMAX_OFDMA_HCS || hash == IMB_AUTH_CRC7_FP_HEADER || hash == IMB_AUTH_CRC6_IUUP_HEADER || - hash == IMB_AUTH_POLY1305 || hash == IMB_AUTH_GHASH) + hash == IMB_AUTH_POLY1305 || hash == IMB_AUTH_GHASH || + hash == IMB_AUTH_SM3) continue; #ifdef __aarch64__ if (hash != IMB_AUTH_SNOW3G_UIA2_BITLEN && diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 7675972f..f3836971 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -107,6 +107,8 @@ extern int sm4_ecb_test(struct IMB_MGR *mb_mgr); extern int sm4_cbc_test(struct IMB_MGR *mb_mgr); +extern int +sm3_test(struct IMB_MGR *mb_mg); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); @@ -175,7 +177,8 @@ struct imb_test tests[] = { { .str = "QUIC-ECB", .fn = quic_ecb_test, .enabled = 1 }, { .str = "QUIC-CHACHA20", .fn = quic_chacha20_test, .enabled = 1 }, { .str = "SM4-ECB", .fn = sm4_ecb_test, .enabled = 1 }, - { .str = "SM4-CBC", .fn = sm4_cbc_test, .enabled = 1 } + { .str = "SM4-CBC", .fn = sm4_cbc_test, .enabled = 1 }, + { .str = "SM3", .fn = sm3_test, .enabled = 1 } #endif /* __aarch64__ */ }; diff --git a/test/kat-app/sm3_test.c b/test/kat-app/sm3_test.c new file mode 100644 index 00000000..23db103a --- /dev/null +++ b/test/kat-app/sm3_test.c @@ -0,0 +1,193 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include +#include +#include +#include + +#include +#include "utils.h" +#include "mac_test.h" + +int +sm3_test(struct IMB_MGR *mb_mgr); + +extern const struct mac_test sm3_test_json[]; + +static int +sm3_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const uint8_t *auth, + const uint8_t *padding, const size_t sizeof_padding) +{ + if (job->status != IMB_STATUS_COMPLETED) { + printf("line:%d job error status:%d ", __LINE__, job->status); + return 0; + } + + /* hash checks */ + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { + printf("hash overwrite tail\n"); + hexdump(stderr, "Target", &auth[sizeof_padding + (vec->tagSize / 8)], + sizeof_padding); + return 0; + } + + if (memcmp(padding, &auth[0], sizeof_padding)) { + printf("hash overwrite head\n"); + hexdump(stderr, "Target", &auth[0], sizeof_padding); + return 0; + } + + if (memcmp((const void *) vec->tag, &auth[sizeof_padding], vec->tagSize / 8)) { + printf("hash mismatched\n"); + hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); + hexdump(stderr, "Expected", (const void *) vec->tag, vec->tagSize / 8); + return 0; + } + return 1; +} + +static int +test_sm3(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const int num_jobs) +{ + struct IMB_JOB *job; + uint8_t padding[16]; + uint8_t **auths = malloc(num_jobs * sizeof(void *)); + int i = 0, jobs_rx = 0, ret = -1; + + if (auths == NULL) { + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end2; + } + + memset(padding, -1, sizeof(padding)); + memset(auths, 0, num_jobs * sizeof(void *)); + + for (i = 0; i < num_jobs; i++) { + const size_t alloc_len = vec->tagSize / 8 + (sizeof(padding) * 2); + + auths[i] = malloc(alloc_len); + if (auths[i] == NULL) { + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end; + } + memset(auths[i], -1, alloc_len); + } + + /* empty the manager */ + while (IMB_FLUSH_JOB(mb_mgr) != NULL) + ; + + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(mb_mgr); + + memset(job, 0, sizeof(*job)); + job->cipher_direction = IMB_DIR_ENCRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + job->auth_tag_output = auths[i] + sizeof(padding); + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; + job->src = (const void *) vec->msg; + job->msg_len_to_hash_in_bytes = vec->msgSize / 8; + job->cipher_mode = IMB_CIPHER_NULL; + job->hash_alg = IMB_AUTH_SM3; + + job->user_data = auths[i]; + + job = IMB_SUBMIT_JOB(mb_mgr); + if (job) { + jobs_rx++; + if (!sm3_job_ok(vec, job, job->user_data, padding, sizeof(padding))) + goto end; + } + } + + while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { + jobs_rx++; + if (!sm3_job_ok(vec, job, job->user_data, padding, sizeof(padding))) + goto end; + } + + if (jobs_rx != num_jobs) { + printf("Expected %d jobs, received %d\n", num_jobs, jobs_rx); + goto end; + } + ret = 0; + +end: + /* empty the manager before next tests */ + while (IMB_FLUSH_JOB(mb_mgr) != NULL) + ; + + for (i = 0; i < num_jobs; i++) { + if (auths[i] != NULL) + free(auths[i]); + } + +end2: + if (auths != NULL) + free(auths); + + return ret; +} + +static void +test_sm3_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const int num_jobs) +{ + const struct mac_test *v = sm3_test_json; + + if (!quiet_mode) + printf("SHA standard test vectors (N jobs = %d):\n", num_jobs); + for (; v->msg != NULL; v++) { +#ifdef DEBUG + if (!quiet_mode) { + printf("SM3 Test Case %zu " + "data_len:%zu digest_len:%zu\n", + v->tcId, v->msgSize / 8, v->tagSize / 8); + } +#endif + if (test_sm3(mb_mgr, v, num_jobs)) { + test_suite_update(ctx, 0, 1); + } else { + test_suite_update(ctx, 1, 0); + } + } +} + +int +sm3_test(struct IMB_MGR *mb_mgr) +{ + struct test_suite_context ctx; + + test_suite_start(&ctx, "SM3"); + + for (unsigned i = 1; i <= 17; i++) + test_sm3_vectors(mb_mgr, &ctx, i); + + const int errors = test_suite_end(&ctx); + + return errors; +} diff --git a/test/kat-app/sm3_test.json.c b/test/kat-app/sm3_test.json.c new file mode 100644 index 00000000..0f0a0b19 --- /dev/null +++ b/test/kat-app/sm3_test.json.c @@ -0,0 +1,338 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* SM3 */ +#include "mac_test.h" + +const struct mac_test sm3_test_json[] = { + /* Vectors from a generator script */ + { 0, 256, 1, NULL, + "\x21\xf2\x27\x41\xf1\x7b\xe7\x3b\x74\x08\x40\x66\xd1\x5f\x0f\x9e\xd6\xcf\x29\xd3\x25\xc1" + "\xe9\xce\x6e\x61\xe7\xf4\x7c\xcf\x2c\xe7\x22\x04\xb5\x07\x83\x5a\xf3\x3e\xb1\x07\xa2\x71" + "\x31\x4a\x65\x8c\x76\xbd\x53\xff\x7f\xbd\x03\x08", + "\x7a\xd6\x85\xe5\x90\x99\xd6\xeb\x11\x6e\x3e\x6e\x39\x08\x3f\x44\x36\xf2\x02\x1a\x89\x0e" + "\x93\xb9\x1a\x3b\x8d\x1d\xbd\x50\xb6\x4b", + 1, 448, NULL, 0 }, + { 0, 256, 2, NULL, + "\x25\x7f\x7e\x16\x0f\xd2\x41\x06\x07\x52\x06\xf3\xff\x36\x37\x68\x2e\x59\x33\xfd\xe3\x94" + "\xea\x81\x82\x30\x16\x4b\xea\x28\xeb\x3d\x1f\x52\x3c\x62\x96\xcf\xee\x91\x4c\x54\x28\xda" + "\xdd\x6a\xa9\xad\x88\x84\xce\xd3\x2d\xd8\x4e", + "\x6e\xcc\x9a\x09\x46\xe1\x3b\x3b\x27\x9c\x01\x42\x4d\x15\xb7\x41\x32\xfb\x72\xd9\x03\xe9" + "\x48\xc3\x29\x4f\xf2\x75\x2a\x4a\x85\x7e", + 1, 440, NULL, 0 }, + { 0, 256, 3, NULL, + "\x3f\x89\x42\x20\xe2\x3d\x37\x4d\x51\x71\xc0\xf1\x11\xaa\xd7\xe3\xdd\x03\xfa\x65\x3e\xfa" + "\x38\xe6\x6c\x2a\xf4\x2c\xb0\xca\x71\x5a\x54\xc5\xb5\xfc\x4f\xae\xca\xe5\x31\xaf\xc0\xed" + "\x41\xf4\xaf\xe4\xb4\x3a\x68\xcd\xca\xa9\x35\x88\x36\x94\xf6\x7b\x8a\x58\x4d\xed\x0a\xa0" + "\x42\xa3\x96\xd8\x5d\xdf\xcc\x03\x2f\xf4\xfb\x25\x0e\x5d\xe9\xec\x00\x14\x57\x99\xb0\xc6" + "\x05\xa0\xfa\x01\x8f\xcf\x82\xd8\xf0\x1e\x3a\xcd\x3b\xfd\x25\x71\xb4\x02\xa9\x5b\x17\xc4" + "\x8b\x7a\x40\x2d\xc0\x4b\x26\xe4\x45\x47", + "\x61\xc6\x17\xfa\x5d\x1f\xf2\xda\x3d\x46\xb7\x21\x02\x4d\xde\x5f\xe7\x3b\x1e\xf8\x50\x8b" + "\x31\xe8\xa3\xc6\x3a\xde\xf2\x62\x8f\xb2", + 1, 960, NULL, 0 }, + { 0, 256, 4, NULL, + "\x72\x08\x5f\x20\x7e\x8d\x02\x7a\xd5\x66\x06\x8f\xa7\xbc\x11\xb8\x59\x57\x39\x9a\xd4\xbd" + "\xe5\xbb\xf4\xf1\xcc\x58\x6e\x3d\xce\x73\x73\xe9\x30\xf1\x83\x26\x7e\xeb\x8a\x16\xa5\xb6" + "\x40\xa7\x92\xa1\x9b\x29\x15\x3b\x1b\xfc\x29\x6e\xc4\xc5\xa7\x1c\xef\xba\x2f\x10\x59\x2e" + "\xd7\x19\x0e\xdf\xe5\xe0\x17\xfc\x7c\x0d\x61\x7c\x34\xc3\x91\x76\xf2\x0f\x64\xdd\x83\x7e" + "\xb7\x4a\x98\x0a\x5e\xe0\xba\x48\xd4\xc7\x91\x86\xad\x94\x73\x37\x14\x2e\x60\x24\x28\xcf" + "\xfd\x5b\x96\x89\x6f\xae\x9f\x16\x8a", + "\xcb\x82\x5d\x42\xa9\x5e\xec\x9c\x91\x7c\x8c\x70\xc6\x49\x63\xbc\x0a\x65\xdd\xdc\x9a\x59" + "\xcc\xf3\x9b\xe2\x57\x97\x7d\x5d\x53\xeb", + 1, 952, NULL, 0 }, + { 0, 256, 5, NULL, + "\x61\xa2\xef\x71\x7f\xee\xde\x61\xe2\xe4\x9a\x24\x4f\xe6\x1b\xcd\x3e\xbc\xd8\xba\xe4\x00" + "\xa5\x08\x87\xc8\x7b\xa1\xc2\xf9\x58\x44\x19\x87\xd3\x43\xd9\x1a\x2f\xba\x3f\x2b\x3a\x8b" + "\xe1", + "\x1c\xd0\x5b\xe1\xb3\x60\x78\xf3\x3e\x7b\xe5\xb2\xb6\x8b\x47\xa3\x80\x43\x70\x69\x0d\x1a" + "\x16\xe1\x3d\xfc\x16\x00\x80\xd1\x6c\x2c", + 1, 360, NULL, 0 }, + { 0, 256, 6, NULL, + "\x36\xfe\x9e\x35\x79\x86\x37\x4a\x61\xea\x12\x4b\xa8\x0c\xc4\xf8\xd7\x20\xd6\x71\xc0\x5f" + "\x13\x30\x2c\x6c\xac\xc4\xf1\x0c\x69\x23\xc2\x32\xfa\x82\xe1\x49\xda\x2e\x2c\x9a\xc4\x87" + "\x4c\xdc\x45\x42\x0f\xc7\x27\xb8\x09\x70", + "\x4d\x34\x8b\xdf\x16\x10\xb6\xa6\x14\xe9\x08\xef\x3c\x27\x16\x63\x0f\x86\x13\xeb\xe5\x33" + "\x3d\x85\x3b\xa8\x1b\x6f\xdf\x43\xfe\xfb", + 1, 432, NULL, 0 }, + { 0, 256, 7, NULL, + "\xe5\x46\x62\xa0\x34\xce\x5b\x8d\x57\x57\xd0\x1b\x8b\x96\xd7\x38\x25\x44\x51\xd6\x88\x10" + "\x28\x5f\x76\xb3\xad\x45\x27\xce\x35\x78\x51\x8a\x38\x94\x21\xa4\xb3\x67\x3e\x4a\xac\x5b" + "\x89\xec\x2a\x83\x2e\x7e\x93\x2b\x56\xb4\x0b\xce\xc6\x4d\x6a\xde\xc6\xca\xe0", + "\x17\x83\x38\x9f\x15\x6e\xdf\xc4\x8e\x91\xc9\x6a\xe2\xdd\xb2\x7c\x46\xce\x40\x5d\x99\x3b" + "\x53\x24\x38\xc4\xf4\x81\x76\x04\x28\x8f", + 1, 504, NULL, 0 }, + { 0, 256, 8, NULL, + "\x57\x5e\x2c\xd0\xc3\xa6\x1f\xff\xe6\x36\x44\x6a\xc5\xc0\x87\xeb\x1a\xe5\x0d\xc4\x54\x60" + "\x36\x14\xfa\x6b\xb3\x29\xaf\x6a\xe9\x8a\x50\x2d\x8f\x9b\x6b\xdd\x26\xa5\xa1\x7c\xab\xa6" + "\x27\xf1\xcd\xf2\x83\xad\xa1\xf5\x55\x56\xdc\x72\x2b\x85\x74\x6a\xd0\x2b\x6c\x79\x4a\x93" + "\x97\x39\xfc\xa1\x65\x96", + "\x5a\xdc\xb3\xfc\x04\x9e\xfa\x4f\xd9\xb0\xd7\xf0\x08\xc4\x07\xee\x8c\xe3\x99\x45\x0a\x46" + "\xf1\x83\xe3\xb9\x0c\xe7\xa4\x7c\x92\x7a", + 1, 576, NULL, 0 }, + { 0, 256, 9, NULL, + "\x3f\xa7\x24\x18\x2e\xc1\xaf\xae\xe1\xb9\x70\x48\xa8\xbe\xf3\x0b\x73\x1e\xfb\x64\x9a\x28" + "\x58\x55\x2c\xe2\x99\x4c\x33\x3d\x3e\x06\x69\x9f\x76\x42\x1f\x48\x99\x9f\x1c\x6a\x0c\xa0" + "\x5d\x5d\xdc\xf1\x37\xf0\xca\xbe\xc2\x91\xe7\x14\xad\xbf\x8a\x12\x67\x86\xa5\x61\xb9\x03" + "\xef\xa4\xfe\x8d\x97\xe4\x20\xce\xcc\xa0\x97\xbb\x5b\x7d\xfc", + "\xc7\xe5\xb3\xe2\xc5\x34\x91\x3d\x8a\xe5\x62\x74\x90\x9c\x71\x16\xdb\xbe\x0d\x0d\x97\x7b" + "\xda\xb0\x9b\xe7\x73\xed\x4e\xcf\x21\x4f", + 1, 648, NULL, 0 }, + { 0, 256, 10, NULL, + "\xaa\xb1\x12\x21\xc7\x43\x80\x95\xfb\x73\x21\xab\xfc\x1c\x16\x6a\x88\x32\xbb\xef\x16\x30" + "\x81\xf7\x4b\x06\x74\xa8\xba\x9c\xac\x2e\x13\x62\x49\x33\x2f\xa4\xae\x63\x8f\xf8\x0e\xd5" + "\x9a\xc9\x87\xbb\x30\x63\xad\x07\x4a\x1f\x44\x2a\x4f\x69\x29\x9b\x98\x84\x17\x2a\x9a\x6f" + "\x4d\x7c\x6b\x5e\x35\x76\x32\xdd\x97\x86\x65\xf6\xf4\x70\x5c\xc4\xb4\xc9\xf2\xb3\x78\xe2" + "\xd6\xda", + "\x24\xa9\xd6\x5c\xb5\xb0\xb3\xa5\xd5\x79\x93\xb1\x07\xd4\x84\xcc\x7b\x7a\x16\x3d\xeb\xe8" + "\x2b\x7e\x93\xf8\x56\x9e\x12\x1c\xaf\x4e", + 1, 720, NULL, 0 }, + { 0, 256, 11, NULL, + "\x0f\x33\x1a\x6a\xec\xdf\xda\xc3\xa6\x34\xce\xad\x93\xe5\x7b\x81\xcc\x57\xcb\xab\xd6\x59" + "\xa1\xbe\x95\x0c\xf1\x94\xb1\xdf\x03\x24\x26\x42\xe3\xfc\x4f\xec\x4f\x6f\x8d\xf6\xbe\xe8" + "\xc1\x8a\xb9\x0e\xfb\xa4\xae\xa9\x12\x40\x25\x5e\xab\x5c\x5b\x1a\xe5\x09\x40\x9e\x39\x67" + "\x9b\xb7\xc1\x79\x21\x88\x6a\x55\x29\xf4\x68\x3d\x78\x61\x40\x52\xb7\x38\xf0\x66\x0b\xcf" + "\x85\xf7\x3e\x48\xee\x7d\x7f\x47\x53\xc8\xd4", + "\xde\xf9\xa4\xa7\x56\x2e\xc4\xda\x8a\xa7\x35\xd4\x63\x3f\xf5\x88\x10\x75\x70\x91\xdc\xaf" + "\x32\xd6\xb1\xf1\x93\xeb\x69\x24\x3d\x7b", + 1, 792, NULL, 0 }, + { 0, 256, 12, NULL, + "\x49\xfe\xd7\x19\x15\x07\x31\x2c\x2b\xa7\xda\x0d\xc2\x2a\x5f\x1b\xbd\x06\xdd\xd9\xf3\x6e" + "\x6e\xc3\x53\xbb\xa3\x04\x99\x22\x49\x92\x15\x37\x42\x3e\x20\xc2\xf7\xd3\x7f\x09\x45\xc4" + "\xce\xab\x69\xc1\x6e\xbe\xc9\x2d\xa7\xaa\x1f\xc5\xbf\xa4\xa9\xc1\x17\xd5\xf0\xe6\x88\x41" + "\xd0\x12\xa3\xe6\xe1\x8c\x10\xd3\x5d\xaa\x43\x86\xac\xea\xc8\x92\x0d\xf7\x8a\x42\xaa\xdb" + "\x88\xa8\x4b\xe7\x5d\x27\x46\x5d\xc0\x18\xe3\xc9\x85\x55\xea\xa6\x52\xd1\xab\xda", + "\x6f\x89\xc8\x23\x77\x53\x08\x09\x8d\xaf\x45\x0f\xcc\x41\xd1\xa9\xa8\x27\xc9\x2c\x79\x33" + "\xf6\x24\x0a\x2d\x51\xec\xcb\x8b\x6b\x99", + 1, 864, NULL, 0 }, + { 0, 256, 13, NULL, + "\xf2\xf4\x98\x44\x41\xcb\xaf\x68\xa7\xa6\x10\x5f\xa4\xd8\x8c\xf6\xd3\x2d\x58\x2a\xa9\xce" + "\x34\x42\xde\x8e\x77\x3f\x5c\x18\x23\x68\xab\x42\xfd\x27\xee\x08\x42\xae\x63\x92\x42\x27" + "\x3f\xb0\x1d\x37\x23\x35\x05\xc7\xdb\xd5\xff\x66\xac\xd4\x0f\x8b\x3d\x3f\xab\x38\x0f\x19" + "\x17\x79\xda\xcd\x7a\xeb\xd0\x44\xef\xc0\x45\xc6\x07\xe7\x01\x31\x0a\xde\x61\x6f\x7b\x56" + "\x06\x6d\x08\x95\xed\xc9\xcc\xb9\x0c\xa9\x11\x97\x46\x04\x0d\xee\xe7\xc0\x74\x07\xa2\x8c" + "\x45\x06\x40\xec\x58\xd7\x11", + "\x25\x0e\xf6\xf0\xd2\x84\x99\x2a\xad\x3a\x07\xc2\x36\xbc\x02\xbc\x56\xf3\xb2\x3e\x1d\xb4" + "\x3d\x54\xaa\x62\x2d\x4d\xf2\x11\x8e\x28", + 1, 936, NULL, 0 }, + { 0, 256, 14, NULL, + "\xa6\xb9\xe1\xe1\xdc\x0a\xbf\xfe\x08\x89\xb5\x7c\x5c\xca\x75\x85\x57\x77\x33\x81\x09\x32" + "\x78\xca\xdd\x46\x95\x63\xe8\x85\x83\x35\x68\xb8\x8c\xd5\x17\x56\xe7\xfc\xe1\x3e\x2a\x4a" + "\x44\x9a\x2c\x4b\xe2\xe8\x97\x46\xee\x6a\xa3\x4d\x3d\x08\xb4\x71\x44\xb7\x0a\x22\x2f\x6f" + "\x6e\x87\x2a\x37\x52\xbf\x7a\x84\xaa\xb9\x18\xb0\xb9\x47\xa4\x46\x43\x56\x9b\xfd\xe1\x52" + "\x47\xf7\x0d\x29\xea\x26\x0b\xb2\x26\x87\x7e\xf8\xbc\x9c\x75\x2a\x00\x4f\x5b\xa4\xbe\x44" + "\xe8\xb9\x6a\xf2\x97\x5d\xb4\xe8\x20\x4c\x1a\x49\x0f\xb6\x31\x7b", + "\xce\xea\x45\x7e\x5b\x0a\xd1\x09\xaf\x69\xb8\x66\x0a\x80\x0b\x4f\x88\x59\xa0\xde\xfe\x26" + "\x2b\x6c\x00\xa4\xd8\x4e\xbb\x9d\x17\x3d", + 1, 1008, NULL, 0 }, + { 0, 256, 15, NULL, + "\x56\xbb\x53\xb6\xf4\x01\x2d\x02\xa2\x75\x7f\x1c\x51\x25\x27\xbb\xe5\x86\xe4\x0f\x3c\x63" + "\x62\x21\x31\x68\x25\xca\xca\xa7\xc7\xaa\x7c\x34\xf9\xce\xb8\x95\xd5\x73\x04\x18\x40\x21" + "\xdc\x79\x66\x64\x27\x9c\xc0\x34\x84\x3b\x74\xc0\xc8\x4c\x25\xaf\x0f\xa5\x57\x73\x48\xc6" + "\x02\xb8\x33\x4f\xd9\x0d\x23\x4e\x7b\x91\x03\x3a\x5c\x34\x56\x51\xa2\xf1\x2c\x6e\x9b\x9f" + "\x23\xf4\x1d\x55\x26\xee\x9d\xc6\xd0\xf4\x2b\xd5\x75\x45\x28\x17\x43\x17\x00\xf4\xa6\x05" + "\xd4\x91\x76\xe9\xc7\x1b\x50\xea\x2c\xd6\x1d\xfd\x14\xa9\x70\x0b\xe9\xff\x7c\xad\x73\xb6" + "\x4a\xd2\x87", + "\x81\xf2\xe0\xcc\x32\x5b\x46\xf5\xb5\xa3\x18\xc5\x11\x1a\x7c\x0e\x88\x36\x4c\xdc\xdc\x8b" + "\x35\xa1\x74\x34\x98\x28\x2c\x29\xcf\x37", + 1, 1080, NULL, 0 }, + { 0, 256, 16, NULL, + "\xcd\xb3\x6d\x98\xa2\x48\x85\x67\x98\xa9\xdd\x2e\xd9\x9d\x88\x3d\xee\xe9\x42\xcb\x17\x9d" + "\xf1\x5e\x5e\x78\xaa\x33\x42\x2c\xdf\xe2\xa4\xba\xb9\x13\x44\x8d\xa9\x69\x03\x7f\x97\x67" + "\x43\x30\x2c\x2f\x75\x46\x40\x3e\xfc\x5f\xab\xb1\x3c\x7d\x51\xdb\xd6\x3c\x29\x84\x99\xe3" + "\xf1\x64\xdb\x3c\x80\x08\x50\xa7\x2c\x1e\xb5\x6c\x17\x20\x59\xf1\x46\xb7\xfe\xb7\x61\x65" + "\x85\xd2\xc9\x68\x50\x7a\x91\xe6\x13\x77\x5c\x0d\x63\xd1\x07\x9d\x6e\x1e\xa7\x86\x2d\x34" + "\x04\xa7\xe8\x08\x76\xd1\x3e\x99\x67\xa9\x21\xd0\xea\xa2\xdb\xf1\x58\xd9\x12\x06\xb1\x77" + "\x66\x9c\xf5\xa1\x24\xea\xae\xed\x6d\x80\x79\x0c", + "\x5c\x39\x16\xff\xa8\x14\x63\x80\x11\x9e\xbc\x96\xdd\xab\xa8\x3f\x02\x93\x24\xf9\xa7\x81" + "\xc7\xd3\x95\x11\x9f\xbf\x69\x05\xd8\x4c", + 1, 1152, NULL, 0 }, + { 0, 256, 17, NULL, + "\x11\xb9\x8f\xec\x5d\x0e\x0b\x83\xb3\x32\x41\x99\x24\xa8\x7a\x26\x24\x5c\x0d\x23\xa5\xc5" + "\x83\x1d\xc3\xda\x2b\x8e\x79\x6c\xd9\xfc\x05\x28\x94\x0d\x83\xd9\xe2\x78\xf1\x79\x1f\x20" + "\x53\x29\x06\xa0\x91\x86\xe6\x0e\x44\x18\x41\x86\x7d\x0a\xba\x03\xe7\x28\xc3\x9b\xc6\x1f" + "\x6f\xa3\xe7\x13\x76\x61\x90\xe4\x7f\xdf\x42\x72\xe1\x7d\xe3\x0a\xfd\xb4\x87\x6c\x2f\x13" + "\x80\x62\x32\xfb\xd0\x61\xfe\x3e\x1c\x7f\x5b\x2a\x43\x9a\x63\xbc\x33\xca\x7d\xc0\xfa\x2b" + "\x17\x79\x13\xf3\x1f\x10\xec\x42\x52\x8f\xe2\x17\x5d\xd1\x99\xdb\x9c\xbf\x85\x58\x59\x01" + "\x2d\xf1\x10\x22\xbf\xd0\xa4\x05\x92\xb9\x0d\x08\x3b\xbd\x5e\xe1\xf0\x67\xd8\xef\xa5\xab" + "\x1c\x9b\x9a\xfc\x6b\x2f\xee\x89\x2e\x42\x27\x17\x9c\x2a\xd0\x19\xba\x45\x82\x6b\x16\xa9" + "\xcf\xcb\xf9", + "\x28\xa5\xae\xdc\x2f\x58\x1a\x86\x36\xcb\x08\xf4\x78\x05\xdf\xad\x97\x2b\x38\xbe\xeb\x77" + "\x1b\x69\xba\x8d\x15\xa3\xda\x4f\xb3\xe7", + 1, 1432, NULL, 0 }, + { 0, 256, 18, NULL, + "\x00\xa7\xa4\xe1\xe7\xe4\xc6\xde\x3a\x48\xe9\x64\x0f\xb9\x40\xbd\xb9\x30\x9c\x27\x5f\x59" + "\x18\x1b\x72\xf3\x6e\xac\x5a\x57\x24\xab\x97\x4d\x72\x59\x24\x79\x8a\x33\xb3\xbe\xb3\x46" + "\x6a\x0c\x11\x04\x9e\x56\x05\x7e\x1f\xe3\xc8\xc3\x70\x80\xd5\xf9\xdc\x32\x70\xa0\x4e\x43" + "\xa5\x65\xd8\xb8\xb2\xd0\x45\x35\xd8\xfe\xfa\x6a\x4e\x90\xb3\x5e\x25\xe4\x26\xcc\xad\x7f" + "\xd1\xa3\x7e\xa8\xa7\x07\x7a\x48\x06\xfd\x44\x16", + "\xd6\x53\xba\x62\x3c\x60\x3e\x86\x23\x39\x7c\xec\x03\xc8\x81\xcf\x85\x37\x8d\x47\x8f\x82" + "\x63\x7a\x5c\xc8\x7d\x54\xfa\x23\x31\x6f", + 1, 800, NULL, 0 }, + { 0, 256, 19, NULL, + "\xc3\x7e\xbd\x8a\xb7\x00\x63\x5b\xcb\xd5\x23\x31\x76\x92\x77\x17\x7a\xdc\x5a\x32\xf5\xb2" + "\x96\x5b\x9e\x50\xa2\x04\x3c\x13\x17\xde\xa4\xc3\x68\x4f\xfd\x9a\x59\x92\x26\x27\xc8\x57" + "\x44\x80\xa0\x05\x42\xca\x79\x17\xde\x8c\x2f\x06\x43\x4b\x70\xb9\x62\x3c\x17\xae\x77\x1a" + "\x67\x6a\x78\xb6\xc3\xd2\x78\x0d\x6a\x0a\x64\xfc\xb6\xc7\xc7\x0c\xb8\x4d\xae\x07\xd7\xe5" + "\x77\xcd\xb9\x5a\x32\x57\x27\x21\x1c\x2c\x0e\x54\xb3\x09\x4e\xc2\x7a\x15\x15\xf0\xf6\xfe" + "\x69\xed\x71\x26\xad\xbd\x1d\x1e\xd8\x7c\x66\xb0\x27\x47\x30\x5c\x54\xc2\xc9\x41\x69\x75" + "\xb5\x0f\x19\x37\x04\xd9\x31\x23\x00\xc2\x4d\x18\xcf\x11\x34\xb0\x40\xf6\x0b\x39\xbb\x43" + "\xda\x16\x08\xcf", + "\x0d\x6b\x5d\x11\xcd\x3b\x50\x67\x76\xab\xa6\xe0\x76\x12\x76\x67\x88\x29\x59\xfa\xb2\xdc" + "\x7a\x3b\x2e\x98\xd5\x8a\x33\xa7\xe3\x56", + 1, 1264, NULL, 0 }, + { 0, 256, 20, NULL, + "\x31\xdf\xd0\x5e\xc7\x24\xa2\x86\x6e\xd8\xac\x2a\x74\xe5\x74\x38\x3e\x50\xad\x44\x7a\x06" + "\xac\xad\x8f\xc7\xbd\x45\xee\x0c\x50\xa8\x1f\x11\xd9\xec\x7c\x5b\x00\xd3\x3d\xa7\x64\x0e" + "\xc9\x76\x6f\x12\xa1\x74\x75\x44\xa6\x9d\xd2\x64\x50\x51\x1d\x1d\xde\xe8\x88\x41\x36\x0b" + "\xf8\x56\x9e\x29\x81\x71\x40\xf1\x61\x06\x72\xcf\xdc\xe4\x91\xdc\xb9\xf2\xf1\xe9\xe2\xf0" + "\xa2\xd1\xc6\x89\xb5\xf6\xe4\xe3\xba\x4c\x50\xbf\x06\x97\x24\xa9\x60", + "\xda\xcc\x85\x43\x6b\x2e\x57\xcd\x5d\x8b\xb7\xd5\x17\x38\x3c\x71\xc3\xcc\x5e\x4b\x2c\xe9" + "\x30\xda\x23\x81\xd7\x2a\x59\xe4\x0a\x73", + 1, 840, NULL, 0 }, + { 0, 256, 21, NULL, + "\x4f\x33\x8c\x0e\x7e\xc6\x12\x36\x38\xb2\x95\xaa\x77\x2c\xf3\xe4\x4b\xb8\x0c\x3a\xb9\x23" + "\xa6\xc3\x88\xd4\xc4\xa2\x9d\x17\x8a\x66\x3d\x06\xf4\xea\x16\x7e\x0a\x78\xe6\x73\x12\x8a" + "\xac\xdb\x6f\x5c\x8d\x37\xbd\x84\x7e\x08\xd7\x88\x91\xeb\x34\x58\x76\x1e\x39\x16\xa9\x8e" + "\xe4\x26\x27\x01\xf8\x43\x7a\x82\x64\xac\x78\x16\x7c\x09\xd5\xb2\x18\x8b\x18\x7b\x15\x1e" + "\xce\x5c\x04\xce\x0a\xd6\xa9\x23\xf5\xef\xc7\x99\x8e\x95\xcd\xb7\xc5\xc6\xbf\x11\x63\x18" + "\x6a", + "\x56\x55\x1b\x88\x96\xb2\x98\x4f\x86\xee\x2a\x64\x69\xed\x5d\x55\xc9\x04\x55\xe6\xa8\xcb" + "\x9c\x98\xb4\xee\x7e\xf3\x03\xbd\xa4\x91", + 1, 888, NULL, 0 }, + { 0, 256, 22, NULL, + "\x6b\x83\xd8\x9b\xf0\x6b\x7e\xa5\xe8\xcc\x0f\x45\x62\x09\x27\x57\xbd\xdb\x95\x9c\xdd\x19" + "\x21\x3a\xc2\x6c\xfd\x11\x47\x18\x95\x84\xa1\xb8\xf6\x26\x30\x1c\x67\x4e\x5a\xeb\xdf\x7a" + "\x1c\xce\x62\xe8\x64\xb9\xe4\x5f\x50\x5a\x9f\x69\x9a\x63\xcd\x2e\xcb\x8a\x04\x55\xf9\xb8" + "\x62\xb6\xc8\x38\x8a\x66\x2c\xe4\xd3\x04\xb6\xae\x05\x90\x05\x32\xdf\x57\xec\xc0\x67\xd6" + "\x43\xf7\x6b\x74\xc2\x8f\xb3\xc0\x28\x44\xa1\x17\x71\x80\xb4\xbc\xb6\x75\xa8\xe4\x9c\x99" + "\x82\x7a\x93\xb0\x10\x53\xa3\x90\xea\xe5\x98\xf7\x4d\x38\x1e\x99\xd6\x1e\xd1\x7b\x50\x23" + "\xc1\x69\xae\xb1\x24\xf3\x2b\xb9\x73\x0b\x97\x25\xc6\x7d\x94\x56\x4f\xb5\x58\x56\xd1\x51" + "\xc3\x87\xb3\x1c\x20\x47\xcc\x1f\x82\x11", + "\x82\x9c\xcb\x68\xad\xb2\xbb\x82\x77\xf3\xaf\x89\x11\xe5\xc7\x50\x8e\x6c\x11\x85\xb1\xc6" + "\xaa\xe8\xbc\x66\x79\xa2\x17\xba\xcb\x8a", + 1, 1312, NULL, 0 }, + { 0, 256, 23, NULL, + "\x6e\x7e\x66\x1c\x4b\xd1\x9e\xf5\x2d\x8b\x11\x47\xb9\x6e\xf0\xb4\x4e\x8a\x46\x52\x62\x76" + "\xcf\x57\xba\x07\xff\xff\x37\xa4\xcb\xdc\xca\xc4\x12\x8e\x67\x37\x39\x38\x10\x1f\xe9\xa8" + "\xe4\x48\xbd\xaa\x6f\x10\x2c\x7c\x75\x35\x16\x87\xdb\x0b\x41\xb1\xbc\xb2\x71\xd2\xef\x8a" + "\x56\x70\x38\x93\xe5\x79\xb9\x63\x2a\x09\xc3\x35\xe9\xf4\x8d\xb2\x32\xda\x37\x36\x50\x82" + "\x1b\xef\x29\xc5\xf4\x71\xac\xfb\x7f\x8b\x65\x6d\xf0\xae\x1c\x83\xd0\x88\x72\x90\xc4\xb5" + "\x60\x94\xf7\xcc\xd3\x8f\x23\x08\xe5\x25\x60\x5b\xd6\xab\xcc\x1a\x7d\x17\xa8\x46\x82\x26" + "\x1c\x30\x13\x60\xfc\xa6\xca\x8b\x53\x26\x09\xb9\xb1\x0a\x3e\x4c\xb3\x27\x7c\x18\x58\x37" + "\xc2\xd3\x77\x67\xed\xec\xe9\xd7\x40\xb0\x1a\x93\xb6\x7e\x31\xc7\xa4\x86\xa3\x28", + "\x56\x79\x32\x7d\x12\xc4\x9d\x5b\xa5\xc2\x38\xb1\x50\x34\x26\x91\x9c\xcb\xc6\xd9\x54\xf0" + "\x7c\x0c\xdf\xc0\xa0\xe8\xff\xa2\xfc\x74", + 1, 1392, NULL, 0 }, + { 0, 256, 24, NULL, + "\x3e\xe0\x7d\xfc\x14\x2d\xed\xc2\x47\xd3\xaf\xa7\xa8\x0f\x56\xca\xc3\x8b\x4e\x8d\x2b\xa1" + "\x65\x71\xf9\x1e\xb3\xc5\x53\xd7\x91\x83\x9b\x0d\xf2\x2e\x83\x0e\xa6\x31\xb4\x63\x67\x34" + "\x23\x3b\xac\x9f\x3d\x2a\xd6\x38\x52\x9a\xfc\x38\x18\x0f\x62\x4d\xe8\x4b\xb8\x7e\x45\x5f" + "\x28\xfe\x44\xc4\x16\xf9\x1f\x03\x06\x67\xc9\x2b\x3d\x98\xd5\xff\xe6\xdb\x8b\x70\x0f\xaa" + "\x02\x20\xe9\x83\xeb\x3a\x42\x8e\xc3\x90\x79\xb0\x07\xa3\xf6\x5e\xb9\xa9\xe3\x81\x3c\x4c" + "\xc9\xec\xac\x10\x3f\xcb\x35\x46\x98\xf7\xab\xd0\x13\xbf\x75\x6b\x41\x90\xaa\x4c\xa0\x99" + "\x06\x25\x5a\x31\x2a\x5a\xc3\x09\x08\x35\x2d\x80\x8d\xbd\x89\xe8\x7a\x10\x28\xe9\xe5", + "\x61\xf0\x05\x61\x80\x5c\x56\x16\x67\xb1\x07\x9b\x31\x10\x55\xc9\x4c\x99\x39\xf6\x68\xb4" + "\x7b\x56\x71\x7f\x67\xc8\x12\xde\xca\x0a", + 1, 1224, NULL, 0 }, + { 0, 256, 25, NULL, + "\xd9\x23\x41\xec\xb1\x28\xe5\x67\x81\xc1\x53\xc7\xbe\xa7\xfa\xb9\x0b\xf0\x6e\x73\xf5\x09" + "\x3e\xe3\x90\xa5\x3a\x1c\xe8\x08\x28\x56\xb8\xbe\xe1\x38\xb1\x68\x09\xae\x25\x11\x28\x03" + "\x0e\x7c\x38\xbd\x80\x8d\x0b\x7e\x46\x5e\x00\xa0\x70\x50\xac\x7c\x92\x72\x45\xb7\xe1\x4a" + "\x40\xd3\xf3\xf5\x17\x5d\xd3\xc3\x9a\x63\xa4\x5e\x0c\x69\x32\xad\x62\x55\x62\x14\x74\x87" + "\x16\xdd\x34\x93\x60\x8e\xb7\xb6\x6b\x44\xa6\x07\x77\x51\xa3\x86\xe6\x0b\xbf\xf6\xd9\x52" + "\x3e\xa0\x06\x03\x4a\xbd\xac\xdb\x23\x79\x71\x6f\x4c\x0d\xfa\xe5\xa4\x2f\x71\xe3\xbf\x9d" + "\x96\xff\xf2\x53\x0a\xec\xc8\x26\x97\xba", + "\xf3\x43\xff\xfe\xa2\xcb\xc7\x88\xc7\xa7\x16\x33\xba\xfe\x9d\x26\x64\xd4\xb1\xfc\xbb\x07" + "\x7e\xa6\xc2\x9a\x1f\xe0\x55\x42\x2e\xdd", + 1, 1136, NULL, 0 }, + { 0, 256, 26, NULL, + "\x49\x10\x5c\x3f\x30\x8f\xfc\x72\xd1\xcc\xc5\xcc\x58\x36\x60\xbf\xe0\xe2\x74\x53\xca\x06" + "\xa0\x88\xbb\xf0\x6e\x25\x8b\xa2\x1e\xcf\x2e\xa3\x53\xd8\x6b\x4c\xaf\xa6\xe4\xfc\x01\xc0" + "\x74\xb8\xea\x96\xd3\x1a\x49\x52\xdb\x1f\x49\x6c\xe5\xb4\x5c\xfa\x8d\xb0\xd1\x5d\x04\x76" + "\xe2\xc4\x6d\x58\x50\x9e\x67\x3f\x60\x56\x4a\x26\x36\x20\xbc\x88\x72\x7f\xdd\xda\x28\xda" + "\x21\x1a\x1d\x30\x3d\xe4\xb4\x8b\x95\xb7\x1e\x9c\xb0\x98\x41\xe2\xd7\x37\x76", + "\x7f\x37\x3a\x4b\xd3\xdd\xf1\x1e\x5d\x51\xbf\x2c\xd5\x4e\xea\x0b\x60\xd2\xea\x11\xaf\xfd" + "\xae\x3f\x20\xcb\x1f\xa2\x9a\xa5\xd8\xf9", + 1, 856, NULL, 0 }, + { 0, 256, 27, NULL, + "\x3b\x74\xc1\xca\x69\xfb\xcf\x06\x89\x76\xdb\xd0\x52\xc5\xf0\xac\xc5\xfb\x26\x74\x86\xca" + "\x33\x31\xb8\x0b\xef\x64\x62\xa2\xdf\xcd\x06\x4a\xe3\xf3\x09\x5d\x8c\x7a\xca\xfd\xba\x52" + "\x5b\x78\xa1\x22\xce\xc6\x66\x4b\xc8\x55\x54\xd7\xbf\xe3\x62\xa9\xb3\x3e\xb1\x19\xae\x8a" + "\xf8\x95\x0e\xee\x88\x0f\x25\x2f\x08\x8a\x59\xab\xdf\x4a\xb9\xda\x9f\x9c\xce\x65\xd5\xa8" + "\x94\xa3\x52\xe3\x6c\x60\x93\x0c\x76\x8a\x66\xf0\x06\x5d\x8a\x7e\x84\x6b\x88\xac\x46\xb5" + "\x8e\x05\xa0\xa1\xf6\xe7\xd6\x42\xe8\x4d\xee\x67\xf7\x24\xfe\x5a\xc6\x67\x81\xe3\xc0\xf0" + "\x07\x5a\x43\x09\x5b\x02", + "\x89\x46\x13\x60\x20\xf0\x44\x7d\x70\xb6\x80\x9c\xf4\x4c\x5c\xc0\x85\xeb\xb7\x97\x19\x86" + "\x82\x85\x7e\xb0\x2f\x1b\x8e\xe2\x44\xeb", + 1, 1104, NULL, 0 }, + { 0, 256, 28, NULL, + "\x6d\xab\x92\x6c\x47\x4b\x0f\xb1\xa8\xa7\x1b\x0c\x49\xfe\x3d\xc6\xa2\xcb\x12\xcd\xec\x66" + "\x90\xc2\x76\xd7\x49\xfe\x77\x3e\xdf\x88\x0f\x39\x91\x60\x26\xc6\xff\xc0\x36\xdb\xd4\x4d" + "\xe1\x90\xca\x96\x5e\x33\x85\x4f\x94\xb4\x42\x48\x42\xea\x06\x88\x3e\x8e\xd8\x30\xd6\x68" + "\x57\x2f\x4f\xd8\x81\x60\x09\x84\xb4\xd0\xeb\xcb\x01\xb1\x19\x2a\x67\xd5\x19\xf7\xea\x54" + "\x16\x54\x0c\x42\x1e\x46\xd4\x11\x4f\x49\x49\x72\x31\xd0\x36\xee\xad\xee\xce\x1b\x36\x96" + "\x1c\x96\x7b\xce\x5a\xf6\xdf\x72\xe7\xbb\x8c\x33\x0f\x99\x14\x4d\x68\x37\x22\x8f\x1a\xa3" + "\x49\xb9\xaa\x25\xf2\x3c\x7b\xcf\x46\x6f\x9f\xa7\xb0\xdb\x14\x69\x98\xd2\xa2\x82\x42\x13" + "\x3f\x0a\x42\xd8\xce\x9a\x23\x92\xc5\x2e\x25\x7e\x7d\xd1", + "\xef\x06\x38\x39\xc1\xb9\xa2\x6a\xe6\xe1\x16\x92\xc3\xf9\xe4\x74\x14\x1b\x4f\x12\xc1\x32" + "\x2c\xf8\xae\xef\x4b\x83\x48\x43\x78\xf8", + 1, 1344, NULL, 0 }, + { 0, 256, 29, NULL, + "\xac\xfc\xaa\x02\xe8\x93\xca\x8d\xf0\x0f\x43\xde\xe2\xb3\x9d\x33\x85\xf4\x62\xaf\x91\x7b" + "\x6d\x4e\x4c\x48\x30\xc7\x93\x64\xac\x4c\xac\xb8\xc6\xc3\xbc\x2a\xfc\xae\xbb\xec\x4a\x33" + "\xad\x6d\x2b\xb0\xc0\xec\xe1\xd1\x33\xcd\xd4\xbb\x2d\x87\xeb\xe4\x25\xdf\x74\xac\xf2\xd5" + "\x4c\xf9\xc1\x93\x39\x31\x42\x71\x6b\x4d\x29\xcc\x18\x76\xe3\xb4\x8f\x96\x49\xb5\x66\x74" + "\xb6\x7b\x39\x6a\xbd\x38\x1a\x53\x6a\xda\x22\x47\xe8\xcf\x7b", + "\x2d\x49\x56\xa6\x1f\x3f\x70\x07\x5a\x78\xb5\x30\xde\xa5\x76\xae\x0f\x8b\x24\x41\x33\x88" + "\x42\x8a\x8c\x8e\xe2\x78\xb8\x6f\x46\x2b", + 1, 824, NULL, 0 }, + { 0, 256, 30, NULL, + "\xbc\x17\xc8\xc7\xb4\x8a\x71\x6b\x94\xbf\x09\x0d\x8a\x6f\x00\xf6\x87\x2a\xe2\xe7\x93\x1f" + "\xab\x78\x9d\x44\x3d\xc4\xa1\x74\x60\x9f\x44\xb5\x61\x84\xc4\xe7\x1b\xed\xa8\x13\xc7\xc5" + "\x84\x69\xaa\xa2\xb0\xf3\x0d\x31\x6d\x60\xd9\xef\x84\x44\xef\x4a\xc9\x73\x46\xa5\xdf\xed" + "\x38\x43\xc7\x58\x33\x30\xa5\x2c\x1a\x69\x0b\x76\x8e\x9c\x1e\x65\x63\x2c\x8f\xe7\x23\x01" + "\x6d\xf2\x6d\x3d\xcd\x44\x3e\x0d\xf8\xe4\x9d\x5f\x25\xc6\x16\x0b\x9b\x28\x52\x93\x97\x9a" + "\x12\xd4\xec\x90\x95\x52\xdf\x00\x60\x02\x48\xe1\x8b\x36\x80\xc5\xc3\x22\x47\x52\x47\xce" + "\x1e\x6c\x8e\xd3\x3c\x4d\x6b\xe1\x08\xdb\xf1\xa7\x17\xd2\x17\x32\x8c\x7b\x18\x26\x37\xf7" + "\xaa\x93\xc6\xec\xd9\x69\x39\xd5\x61\x78\x85\x3a\xf6\x43\x43\x84\x0e\x38\x71\xc2\x03\x57" + "\x05\xea\x37\xa0", + "\x19\x6e\x86\xc2\x11\xd7\x57\x7f\x6e\x8e\xda\x9c\x1e\xe0\x07\x58\x73\xaa\xb6\x40\x22\x8a" + "\x76\xf0\xf0\x04\x8a\x66\x9d\x3b\xc3\x04", + 1, 1440, NULL, 0 }, + { 0, 256, 31, NULL, + "\x2b\x33\x81\xe8\xf2\x6f\xf3\xed\xaa\xa2\xf1\xc4\x66\x68\x99\xf8\xb7\xaf\xbf\xaf\x00\x82" + "\x6a\x92\x09\x2f\x24\x77\x4d\x2b\x34\xc9\x23\x2b\x0b\x20\x12\x2b\x7c\x4b\x2d\x1b\x83\x67" + "\x82\xdf\x23\xf8\xc4\x90\x10\x5b\x6e\x61\xa9\x33\x21\xe5\xd2\xbe\x88\xe0\x96\xb2\x14\xa2" + "\xfd\xb9\x34\xbb\x62\xda\xb1\x06\x49\xed\xbe\xb7\x3b\xa7\x78\x22\xfe\xb6\x5a\x4a\xe6\xdd" + "\x52\x6a\x8c\xdd\x00\xb0\xc1\x8b\xca\xce\x40\x17\x67\x21\x5b\x18\xf8\x66\x6b\xa4\xca\xb3" + "\x92\x61\x92\x9d\xb0\xb1\x1f\x2d\x14\x86\x62\x57\x74\x2a\x30\xe7\x7e\xc7\xcf\xb6\x5b\xb3" + "\x1b\x52\xf7\x83\x48\x08\x13\x2f", + "\xb6\xce\xaa\xeb\xe7\x14\x8a\x9a\x13\x6a\xa5\x32\x02\xd5\xb9\xb7\x87\xf8\xb4\x30\x24\xfb" + "\x90\x06\xd8\xcf\x07\x16\x02\x17\xc3\x43", + 1, 1120, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 4246a324..cb32fdd8 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From cf8096c93f80de26bc4c39f76b9ffe4212f49da0 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 20 Sep 2023 16:54:36 +0100 Subject: [PATCH 092/204] test: [xvalid-app] added SM3 support --- test/xvalid-app/ipsec_xvalid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 4badec9f..07de0395 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -461,6 +461,12 @@ struct str_value_mapping hash_algo_str_map[] = { .hash_alg = IMB_AUTH_CRC6_IUUP_HEADER, } }, + { + .name = "SM3", + .values.job_params = { + .hash_alg = IMB_AUTH_SM3, + } + }, #endif /* __aarch64__ */ }; @@ -557,6 +563,7 @@ const uint8_t auth_tag_len_bytes[] = { 4, /* IMB_AUTH_CRC7_FP_HEADER */ 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ 16, /* IMB_AUTH_GHASH */ + 32, /* IMB_AUTH_SM3 */ }; /* Minimum, maximum and step values of key sizes */ @@ -977,6 +984,7 @@ fill_job(IMB_JOB *job, const struct params_s *params, uint8_t *buf, uint8_t *dig case IMB_AUTH_CRC8_WIMAX_OFDMA_HCS: case IMB_AUTH_CRC7_FP_HEADER: case IMB_AUTH_CRC6_IUUP_HEADER: + case IMB_AUTH_SM3: /* No operation needed */ break; case IMB_AUTH_DOCSIS_CRC32: @@ -1213,6 +1221,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph case IMB_AUTH_CRC8_WIMAX_OFDMA_HCS: case IMB_AUTH_CRC7_FP_HEADER: case IMB_AUTH_CRC6_IUUP_HEADER: + case IMB_AUTH_SM3: /* No operation needed */ break; case IMB_AUTH_AES_GMAC_128: @@ -1353,6 +1362,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph case IMB_AUTH_CRC8_WIMAX_OFDMA_HCS: case IMB_AUTH_CRC7_FP_HEADER: case IMB_AUTH_CRC6_IUUP_HEADER: + case IMB_AUTH_SM3: /* No operation needed */ break; case IMB_AUTH_POLY1305: -- GitLab From 9b918e6e0798f9b03bde9c9e71fc0fe320497901 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 20 Sep 2023 17:03:04 +0100 Subject: [PATCH 093/204] perf: [sm3] added SM3 hash support --- perf/ipsec_perf.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 8c8fff6d..1a43bee6 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -208,6 +208,7 @@ enum test_hash_alg_e { TEST_CRC7_FP_HEADER, TEST_CRC6_IUUP_HEADER, TEST_AUTH_GHASH, + TEST_AUTH_SM3, TEST_NUM_HASH_TESTS }; @@ -558,6 +559,12 @@ const struct str_value_mapping hash_algo_str_map[] = { .hash_alg = TEST_AUTH_GHASH, } }, + { + .name = "sm3", + .values.job_params = { + .hash_alg = TEST_AUTH_SM3, + } + }, #endif /* __aarch64__ */ }; @@ -688,6 +695,7 @@ const uint32_t auth_tag_length_bytes[] = { 4, /* IMB_AUTH_CRC7_FP_HEADER */ 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ 16, /* IMB_AUTH_GHASH */ + 32, /* IMB_AUTH_SM3 */ }; uint32_t index_limit; uint32_t key_idxs[NUM_OFFSETS]; @@ -2018,6 +2026,9 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 case TEST_CRC6_IUUP_HEADER: job_template.hash_alg = IMB_AUTH_CRC6_IUUP_HEADER; break; + case TEST_AUTH_SM3: + job_template.hash_alg = IMB_AUTH_SM3; + break; default: /* HMAC hash alg is SHA1 or MD5 */ job_template.u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) ipad; @@ -3011,7 +3022,8 @@ print_times(struct variant_s *variant_list, struct params_s *params, const uint3 "CRC8_WIMAX_HCS", "CRC7_FP_HEADER", "CRC6_IUUP_HEADER", - "GHASH" }; + "GHASH", + "SM3" }; struct params_s par; printf("ARCH"); -- GitLab From d640004d28218a34d5cbe5798ab716d7465b6a6b Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 25 Sep 2023 09:55:47 +0100 Subject: [PATCH 094/204] x86_64: [SM3] clear SIMD registers at the end Clear SIMD registers at the end of the SM3 authentication, to prevent plaintext to remain in them. --- lib/x86_64/sm3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/x86_64/sm3.c b/lib/x86_64/sm3.c index 06da3e9b..7cc0f43a 100644 --- a/lib/x86_64/sm3.c +++ b/lib/x86_64/sm3.c @@ -238,6 +238,7 @@ sm3_msg(void *tag, const uint64_t tag_length, const void *msg, const uint64_t ms memcpy(tag, digest, tag_length); #ifdef SAFE_DATA + clear_scratch_xmms_sse(); clear_mem(block, sizeof(block)); #endif } -- GitLab From bf1c2befe5672f666af6c1c38c0df7e4518e38aa Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 28 Sep 2023 14:36:58 +0100 Subject: [PATCH 095/204] test: [XVALID] fix SM4-ECB/CBC output name --- test/xvalid-app/ipsec_xvalid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 07de0395..32172978 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -230,9 +230,9 @@ struct str_value_mapping cipher_algo_str_map[] = { .values.job_params = { .cipher_mode = IMB_CIPHER_CHACHA20, .key_size = 32 } }, { .name = "SNOW-V", .values.job_params = { .cipher_mode = IMB_CIPHER_SNOW_V, .key_size = 32 } }, - { .name = "SM4-ECB", + { .name = "SM4-ECB-128", .values.job_params = { .cipher_mode = IMB_CIPHER_SM4_ECB, .key_size = 16 } }, - { .name = "SM4-CBC", + { .name = "SM4-CBC-128", .values.job_params = { .cipher_mode = IMB_CIPHER_SM4_CBC, .key_size = 16 } }, #endif /* __aarch64__ */ { .name = "NULL-CIPHER", -- GitLab From ca7ee98da9f33c7611c0de5b1c37b9aebfbb3536 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 25 Sep 2023 16:55:24 +0100 Subject: [PATCH 096/204] cmake: build with CET when available --- cmake/utils.cmake | 3 +++ lib/cmake/unix.cmake | 5 +++++ perf/cmake/unix.cmake | 5 +++++ test/cmake/unix.cmake | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index a4243901..15a32455 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -23,6 +23,8 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +include(CheckCCompilerFlag) + # extract library version from header file macro(imb_get_version IMB_HDR_FILE) file(STRINGS ${IMB_HDR_FILE} VER_STR REGEX "^.*IMB_VERSION_STR.*$") @@ -131,6 +133,7 @@ macro(imb_compiler_check) (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)) message(FATAL_ERROR "GNU C Compiler version must be 5.0 or higher") endif() + check_c_compiler_flag("-fcf-protection" CC_HAS_CET) endmacro() # add uninstall target diff --git a/lib/cmake/unix.cmake b/lib/cmake/unix.cmake index cc98ff89..3cdf3dbe 100644 --- a/lib/cmake/unix.cmake +++ b/lib/cmake/unix.cmake @@ -64,6 +64,11 @@ if(CMAKE_COMPILER_IS_GNUCC) string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") endif() +if(CC_HAS_CET) + string(APPEND CMAKE_C_FLAGS " -fcf-protection=full") + string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error") +endif() + # set directory specific C compiler flags if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") set_source_files_properties( diff --git a/perf/cmake/unix.cmake b/perf/cmake/unix.cmake index c1431eca..9c9d897e 100644 --- a/perf/cmake/unix.cmake +++ b/perf/cmake/unix.cmake @@ -61,6 +61,11 @@ if(CMAKE_COMPILER_IS_GNUCC) string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") endif() +if(CC_HAS_CET) + string(APPEND CMAKE_C_FLAGS " -fcf-protection=full") + string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error") +endif() + # set destination dir to copy scripts if(IMB_BIN_DIR) set(COPY_DST_DIR ${IMB_BIN_DIR}) diff --git a/test/cmake/unix.cmake b/test/cmake/unix.cmake index a035677f..c8949fc3 100644 --- a/test/cmake/unix.cmake +++ b/test/cmake/unix.cmake @@ -62,3 +62,7 @@ if(CMAKE_COMPILER_IS_GNUCC) string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") endif() +if(CC_HAS_CET) + string(APPEND CMAKE_C_FLAGS " -fcf-protection=full") + string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error") +endif() -- GitLab From b1205c557f9c76351a8a3a134ecbab7315132b08 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 25 Sep 2023 17:31:55 +0100 Subject: [PATCH 097/204] lib: remove unneeded linker operations for CET --- lib/Makefile | 59 +--------------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index cffee1b5..781e6334 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -124,7 +124,6 @@ ifeq ($(ARCH),x86_64) ifeq ($(MINGW),0) CC_HAS_CET = $(and $(shell $(CC) --target-help 2> /dev/null | grep -m1 -e "-z ibt" | wc -l), \ $(shell $(CC) --help=common 2> /dev/null | grep -m1 -e "-fcf-protection" | wc -l)) -CET_LDFLAGS=-r -z ibt -z shstk endif CFLAGS := -fPIC $(EXTRA_CFLAGS) $(INCLUDES) \ -W -Wall -Wextra -Wmissing-declarations -Wpointer-arith \ @@ -308,18 +307,13 @@ endif LIBPERM = 0755 ifeq ($(ARCH),x86_64) ifeq ($(CC_HAS_CET),1) -LDFLAGS += -fcf-protection=full -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error +LDFLAGS += -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error endif endif else LIBNAME = $(LIB).a LIBPERM = 0644 LDFLAGS += -g -ifeq ($(ARCH),x86_64) -ifeq ($(CC_HAS_CET),1) -LDFLAGS += -fcf-protection=full -endif -endif # x86_64 endif endif # style target @@ -1004,10 +998,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:sse_t1/%.c $(CC) -MMD $(OPT_SSE) -c $(CFLAGS) $< -o $@ @@ -1018,10 +1008,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:sse_t2/%.c $(CC) -MMD $(OPT_SSE) -c $(CFLAGS) $< -o $@ @@ -1032,10 +1018,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:sse_t3/%.c $(CC) -MMD $(OPT_SSE) -c $(CFLAGS) $< -o $@ @@ -1046,10 +1028,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:avx_t1/%.c $(CC) -MMD $(OPT_AVX) -c $(CFLAGS) $< -o $@ @@ -1060,10 +1038,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:avx_t2/%.c $(CC) -MMD $(OPT_AVX) -c $(CFLAGS) $< -o $@ @@ -1074,11 +1048,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif - $(OBJ_DIR)/%.o:avx2_t1/%.c $(CC) -MMD $(OPT_AVX2) -c $(CFLAGS) $< -o $@ @@ -1088,11 +1057,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif - $(OBJ_DIR)/%.o:avx2_t2/%.c $(CC) -MMD $(OPT_AVX2) -c $(CFLAGS) $< -o $@ @@ -1102,11 +1066,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif - $(OBJ_DIR)/%.o:avx2_t3/%.c $(CC) -MMD $(OPT_AVX2) -c $(CFLAGS) $< -o $@ @@ -1116,10 +1075,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:avx512_t1/%.c $(CC) -MMD $(OPT_AVX512) -c $(CFLAGS) $< -o $@ @@ -1130,10 +1085,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:avx512_t2/%.c $(CC) -MMD $(OPT_AVX512) -c $(CFLAGS) $< -o $@ @@ -1144,10 +1095,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif $(OBJ_DIR)/%.o:no-aesni/%.c $(CC) -MMD $(OPT_NOAESNI) -c $(CFLAGS_NO_SIMD) $< -o $@ @@ -1158,10 +1105,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif endif # aarch64 $(OBJ_DIR): -- GitLab From c7549dc950cbdea1637f7a6c22b1f62e40a868c7 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 25 Sep 2023 17:33:02 +0100 Subject: [PATCH 098/204] perf: remove unneeded linker operations for CET --- perf/Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/perf/Makefile b/perf/Makefile index a8e72891..b84797ca 100644 --- a/perf/Makefile +++ b/perf/Makefile @@ -69,7 +69,6 @@ ifneq ($(ARCH),aarch64) ifeq ($(MINGW),0) CC_HAS_CET = $(and $(shell $(CC) --target-help 2> /dev/null | grep -m1 -e "-z ibt" | wc -l), \ $(shell $(CC) --help=common 2> /dev/null | grep -m1 -e "-fcf-protection" | wc -l)) -CET_LDFLAGS=-r -z ibt -z shstk endif ifeq ($(CC_HAS_CET),1) CFLAGS += -fcf-protection=full @@ -81,7 +80,7 @@ LDFLAGS = -fPIE -z noexecstack -z relro -z now -pthread endif ifneq ($(ARCH),aarch64) ifeq ($(CC_HAS_CET),1) -LDFLAGS += -fcf-protection=full -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error +LDFLAGS += -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error endif endif # aarch64 LDLIBS = -lIPSec_MB @@ -122,10 +121,6 @@ CPPCHECK ?= cppcheck ifneq ($(ARCH),aarch64) %.o:%.asm $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif else %.o:%.S $(CC) -c $(CFLAGS) $< -o $@ -- GitLab From 0af59d8558b703cc708b5305ffae0772204ec780 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 25 Sep 2023 17:33:34 +0100 Subject: [PATCH 099/204] test: remove unneeded linker operations for CET --- test/common/common.mk | 3 +-- test/xvalid-app/Makefile | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/test/common/common.mk b/test/common/common.mk index a6a32add..fb32078c 100644 --- a/test/common/common.mk +++ b/test/common/common.mk @@ -68,7 +68,6 @@ ifeq ($(ARCH),x86_64) ifeq ($(MINGW),0) CC_HAS_CET = $(and $(shell $(CC) --target-help 2> /dev/null | grep -m1 -e "-z ibt" | wc -l), \ $(shell $(CC) --help=common 2> /dev/null | grep -m1 -e "-fcf-protection" | wc -l)) -CET_LDFLAGS=-r -z ibt -z shstk endif ifeq ($(CC_HAS_CET),1) @@ -96,7 +95,7 @@ endif ifeq ($(ARCH),x86_64) ifeq ($(CC_HAS_CET),1) -LDFLAGS += -fcf-protection=full -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error +LDFLAGS += -Wl,-z,ibt -Wl,-z,shstk -Wl,-z,cet-report=error endif endif # x86_64 diff --git a/test/xvalid-app/Makefile b/test/xvalid-app/Makefile index 3d947a21..52c25bfd 100644 --- a/test/xvalid-app/Makefile +++ b/test/xvalid-app/Makefile @@ -43,10 +43,6 @@ ifeq ($(USE_YASM),y) else $(NASM) -MD $(@:.o=.d) -MT $@ -o $@ $(NASM_FLAGS) $< endif -ifeq ($(CC_HAS_CET),1) - $(LD) $(CET_LDFLAGS) -o $@.tmp $@ - mv $@.tmp $@ -endif else # x86_64 ASM := misc_aarch64.S -- GitLab From a26c0ca326842f31e63b781296cff2da09ff7163 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 25 Sep 2023 21:23:26 +0100 Subject: [PATCH 100/204] lib: [cmake] move nasm version check --- lib/CMakeLists.txt | 69 +++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 93de640d..9ec187bf 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -32,6 +32,37 @@ if(NOT FULL_PROJECT_BUILD) message(FATAL_ERROR "Please run CMake from project root directory") endif() +######################################## +# setup NASM +######################################## +enable_language(ASM_NASM) +if(NOT CMAKE_ASM_NASM_COMPILER_LOADED) + message(FATAL_ERROR "Can't find assembler") +endif() + +set(NASM_VERSION_REQUIRED "2.14") + +execute_process( + COMMAND ${CMAKE_ASM_NASM_COMPILER} -v + OUTPUT_VARIABLE NASM_VERSION_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE) +string(REGEX MATCH "NASM version ([0-9]*.[0-9]*)" NASM_VERSION + "${NASM_VERSION_OUTPUT}") +if(NASM_VERSION) + if(NASM_VERSION_REQUIRED VERSION_GREATER ${CMAKE_MATCH_1}) + message( + FATAL_ERROR "NASM version must be at least ${NASM_VERSION_REQUIRED}!") + endif() + message(STATUS "NASM version: ${CMAKE_MATCH_1}") +else() + message( + WARNING + "Could not parse NASM version string: ${NASM_VERSION_OUTPUT}.\nPlease, be sure that ${CMAKE_ASM_NASM_COMPILER} version is >= ${NASM_VERSION_REQUIRED}" + ) +endif() + +set(CAN_USE_ASSEMBLER 1) + ####################################### # set library directories ####################################### @@ -210,44 +241,6 @@ if(AVX_IFMA) list(APPEND LIB_DEFINES AVX_IFMA) endif() -######################################## -# setup NASM -######################################## -if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") - enable_language(ASM) - if(NOT CMAKE_ASM_COMPILER_LOADED) - message(FATAL_ERROR "Can't find assembler") - endif() -else() - enable_language(ASM_NASM) - if(NOT CMAKE_ASM_NASM_COMPILER_LOADED) - message(FATAL_ERROR "Can't find assembler") - endif() -endif() - -set(NASM_VERSION_REQUIRED "2.14") - -execute_process( - COMMAND ${CMAKE_ASM_NASM_COMPILER} -v - OUTPUT_VARIABLE NASM_VERSION_OUTPUT - OUTPUT_STRIP_TRAILING_WHITESPACE) -string(REGEX MATCH "NASM version ([0-9]*.[0-9]*)" NASM_VERSION - "${NASM_VERSION_OUTPUT}") -if(NASM_VERSION) - if(NASM_VERSION_REQUIRED VERSION_GREATER ${CMAKE_MATCH_1}) - message( - FATAL_ERROR "NASM version must be at least ${NASM_VERSION_REQUIRED}!") - endif() - message(STATUS "NASM version: ${CMAKE_MATCH_1}") -else() - message( - WARNING - "Could not parse NASM version string: ${NASM_VERSION_OUTPUT}.\nPlease, be sure that ${CMAKE_ASM_NASM_COMPILER} version is >= ${NASM_VERSION_REQUIRED}" - ) -endif() - -set(CAN_USE_ASSEMBLER 1) - ######################################## # add OS specific options ######################################## -- GitLab From 4d7217fb094ca92f800d8249797873a79d0dd68a Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 25 Sep 2023 21:29:45 +0100 Subject: [PATCH 101/204] lib: [cmake] compile AVX IFMA modules if supported by NASM --- lib/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 9ec187bf..95b77eec 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -41,6 +41,7 @@ if(NOT CMAKE_ASM_NASM_COMPILER_LOADED) endif() set(NASM_VERSION_REQUIRED "2.14") +set(NASM_VERSION_AVX_IFMA "2.16") execute_process( COMMAND ${CMAKE_ASM_NASM_COMPILER} -v @@ -54,6 +55,15 @@ if(NASM_VERSION) FATAL_ERROR "NASM version must be at least ${NASM_VERSION_REQUIRED}!") endif() message(STATUS "NASM version: ${CMAKE_MATCH_1}") + if(NASM_VERSION_AVX_IFMA VERSION_GREATER ${CMAKE_MATCH_1}) + message( + WARNING + "Minimum required NASM version for AVX-IFMA: ${NASM_VERSION_AVX_IFMA}. AVX-IFMA code not compiled - update NASM." + ) + else() + # AVX IFMA supported by NASM + set(AVX_IFMA 1) + endif() else() message( WARNING -- GitLab From 649a4f7256b41c3584d7ea4aa6372b304afc7b2e Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Tue, 26 Sep 2023 10:32:01 +0100 Subject: [PATCH 102/204] lib: [cmake] fix windows def file copy --- lib/cmake/windows.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/cmake/windows.cmake b/lib/cmake/windows.cmake index ba54b4ee..f4760f52 100644 --- a/lib/cmake/windows.cmake +++ b/lib/cmake/windows.cmake @@ -81,9 +81,15 @@ endif() # filter unused symbol exports if(NOT STR_FILTER) - set(GEN_DEF_FILE_CMD "copy /Y ${LIB}.def ${SRC_DEF_FILE}") + execute_process( + COMMAND ${CMAKE_COMMAND} -E copy ${LIB}.def ${SRC_DEF_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) else() - set(GEN_DEF_FILE_CMD "findstr /v ${STR_FILTER} ${LIB}.def > ${SRC_DEF_FILE}") + execute_process( + COMMAND cmd /C "findstr /v ${STR_FILTER} ${LIB}.def > ${SRC_DEF_FILE}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) endif() ######################################## @@ -115,9 +121,4 @@ if(BUILD_SHARED_LIBS) DESTINATION $ENV{WINDIR}/system32) endif() -execute_process( - COMMAND cmd /C ${GEN_DEF_FILE_CMD} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_QUIET -) -- GitLab From 0c452f29950c6315b69b32ec8d9528f63a2245b6 Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Thu, 28 Sep 2023 10:51:23 +0200 Subject: [PATCH 103/204] lib/mb_mgr_burst_async: cover full queue still processing case It is possible for the MB_MGR job queue to have all its jobs busy, so `submit_burst_and_check()` will not be able to return number of completions greater than 0. In that case, instead of marking the queue as "empty", just return 0 and check if we ran into this corner case during job flush. Signed-off-by: Krzysztof Karas --- lib/include/mb_mgr_burst_async.h | 17 ++++++++++---- test/kat-app/api_test.c | 39 +++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/lib/include/mb_mgr_burst_async.h b/lib/include/mb_mgr_burst_async.h index b6d98801..86790f11 100644 --- a/lib/include/mb_mgr_burst_async.h +++ b/lib/include/mb_mgr_burst_async.h @@ -208,8 +208,13 @@ return_jobs_done: ADV_N_JOBS(&state->earliest_job, n_ret_jobs); if (state->earliest_job == state->next_job) { - state->earliest_job = -1; /* becomes empty */ - state->next_job = 0; + /* check if any jobs completed in this run + * if not, then we wrapped around the queue, but earliest job is still processing + */ + if (n_ret_jobs != 0) { + state->earliest_job = -1; /* becomes empty */ + state->next_job = 0; + } } return n_ret_jobs; @@ -248,8 +253,12 @@ FLUSH_BURST(IMB_MGR *state, const uint32_t max_jobs, IMB_JOB **jobs) #endif /* check if any jobs in queue */ max_ret_jobs = queue_sz(state); - if (max_ret_jobs == 0) - return 0; + if (max_ret_jobs == 0) { + if (state->earliest_job == -1) + return 0; + else + max_ret_jobs = IMB_MAX_JOBS; + } /* set max number of jobs to return */ if (max_ret_jobs > max_jobs) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 871d4e22..866fb758 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -706,7 +706,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) struct IMB_JOB *job = NULL, *jobs[MAX_BURST_JOBS] = { NULL }; uint32_t i, completed_jobs, n_jobs = MAX_BURST_JOBS; struct IMB_JOB **null_jobs = NULL; - int err; + int err, earliest_job, next_job; printf("SUBMIT_BURST() API behavior test:\n"); @@ -855,12 +855,39 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (!quiet_mode) printf("\n"); - if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) + if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) { + /* ======== test 6: full job queue wprapping around */ + earliest_job = mb_mgr->earliest_job; + next_job = mb_mgr->next_job; + /* simulate mb_mgr job queue being almost full of jobs that are still processing */ + mb_mgr->earliest_job = mb_mgr->next_job = 0; + /* mark one job as complete, so SUBMIT_BURST has something to return */ + mb_mgr->jobs[0].status = IMB_STATUS_COMPLETED; + for (i = 1; i < IMB_MAX_JOBS; i++) { + mb_mgr->jobs[i].status = IMB_STATUS_BEING_PROCESSED; + } + /* just collect completions */ + IMB_SUBMIT_BURST_NOCHECK(mb_mgr, 0, jobs); + + /* ensure that mbr_mgr job buffer was not marked as "empty" in the process */ + if (mb_mgr->earliest_job == -1) { + printf("%s: test %d, job buffer unexpectedly marked 'empty'\n", + __func__, TEST_INVALID_BURST); + return 1; + } + /* restore job queue state */ + for (i = 0; i < IMB_MAX_JOBS; i++) { + mb_mgr->jobs[i].status = IMB_STATUS_COMPLETED; + } + mb_mgr->earliest_job = earliest_job; + mb_mgr->next_job = next_job; + return 0; + } printf("GET_NEXT_BURST() API behavior test:\n"); - /* ======== test 6 : NULL pointer to burst job array */ + /* ======== test 7 : NULL pointer to burst job array */ completed_jobs = IMB_GET_NEXT_BURST(mb_mgr, n_jobs, null_jobs); if (completed_jobs != 0) { @@ -878,7 +905,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) } print_progress(); - /* ======== test 7 : Invalid burst size */ + /* ======== test 8 : Invalid burst size */ completed_jobs = IMB_GET_NEXT_BURST(mb_mgr, IMB_MAX_BURST_SIZE + 1, jobs); if (completed_jobs != 0) { @@ -916,7 +943,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) } print_progress(); - /* ======== test 8 : invalid suite_id */ + /* ======== test 9 : invalid suite_id */ while (IMB_GET_NEXT_BURST(mb_mgr, n_jobs, jobs) < n_jobs) IMB_FLUSH_BURST(mb_mgr, n_jobs, jobs); @@ -955,7 +982,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) } print_progress(); - /* ======== test 9 : session_d */ + /* ======== test 10 : session_d */ while (IMB_GET_NEXT_BURST(mb_mgr, n_jobs, jobs) < n_jobs) IMB_FLUSH_BURST(mb_mgr, n_jobs, jobs); -- GitLab From f4bcc00871376410f9607d3ce741f6ecb9b23212 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 29 Sep 2023 15:24:40 +0100 Subject: [PATCH 104/204] test: [KAT-APP] fix style issues --- test/kat-app/api_test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 866fb758..191e5059 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -855,10 +855,10 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (!quiet_mode) printf("\n"); - if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) { + if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) { /* ======== test 6: full job queue wprapping around */ - earliest_job = mb_mgr->earliest_job; - next_job = mb_mgr->next_job; + earliest_job = mb_mgr->earliest_job; + next_job = mb_mgr->next_job; /* simulate mb_mgr job queue being almost full of jobs that are still processing */ mb_mgr->earliest_job = mb_mgr->next_job = 0; /* mark one job as complete, so SUBMIT_BURST has something to return */ @@ -871,19 +871,19 @@ test_burst_api(struct IMB_MGR *mb_mgr) /* ensure that mbr_mgr job buffer was not marked as "empty" in the process */ if (mb_mgr->earliest_job == -1) { - printf("%s: test %d, job buffer unexpectedly marked 'empty'\n", - __func__, TEST_INVALID_BURST); + printf("%s: test %d, job buffer unexpectedly marked 'empty'\n", __func__, + TEST_INVALID_BURST); return 1; } - /* restore job queue state */ + /* restore job queue state */ for (i = 0; i < IMB_MAX_JOBS; i++) { mb_mgr->jobs[i].status = IMB_STATUS_COMPLETED; } - mb_mgr->earliest_job = earliest_job; - mb_mgr->next_job = next_job; + mb_mgr->earliest_job = earliest_job; + mb_mgr->next_job = next_job; return 0; - } + } printf("GET_NEXT_BURST() API behavior test:\n"); -- GitLab From 875a8d098a4fe656f56e760351719d35a9334900 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 29 Sep 2023 15:15:25 +0100 Subject: [PATCH 105/204] lib: update queue_sz() to detect when queue is full --- lib/include/mb_mgr_code.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/include/mb_mgr_code.h b/lib/include/mb_mgr_code.h index f3f23ae9..10e2dbf6 100644 --- a/lib/include/mb_mgr_code.h +++ b/lib/include/mb_mgr_code.h @@ -63,7 +63,10 @@ queue_sz(IMB_MGR *state) if (state->earliest_job < 0) return 0; - return get_queue_sz(state); + const uint32_t queue_size = get_queue_sz(state); + + /* zero here means queue is full */ + return queue_size ? queue_size : IMB_MAX_JOBS; } /* ========================================================================= */ -- GitLab From dfca0ffb86c115a306e31592a33711e2d220d5e5 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 29 Sep 2023 15:18:11 +0100 Subject: [PATCH 106/204] lib: update queue_sz_remaining() to call queue_sz() This is needed to get the correct queue size when the queue is full --- lib/include/mb_mgr_burst_async.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/include/mb_mgr_burst_async.h b/lib/include/mb_mgr_burst_async.h index 86790f11..c4a095a2 100644 --- a/lib/include/mb_mgr_burst_async.h +++ b/lib/include/mb_mgr_burst_async.h @@ -52,10 +52,7 @@ get_queue_sz_end(const int job_offset) __forceinline uint32_t queue_sz_remaining(IMB_MGR *state) { - if (state->earliest_job < 0) - return IMB_MAX_JOBS; - - return IMB_MAX_JOBS - get_queue_sz(state); + return IMB_MAX_JOBS - queue_sz(state); } uint32_t -- GitLab From d2fad2ff878a089349b76f83260d82cf0c40ca0b Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 29 Sep 2023 15:20:27 +0100 Subject: [PATCH 107/204] lib: flush jobs when queue reaches max capacity --- lib/include/mb_mgr_burst_async.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/include/mb_mgr_burst_async.h b/lib/include/mb_mgr_burst_async.h index c4a095a2..60efcbc4 100644 --- a/lib/include/mb_mgr_burst_async.h +++ b/lib/include/mb_mgr_burst_async.h @@ -211,6 +211,8 @@ return_jobs_done: if (n_ret_jobs != 0) { state->earliest_job = -1; /* becomes empty */ state->next_job = 0; + } else { + return FLUSH_BURST(state, n_jobs, jobs); } } -- GitLab From 9ebb53b2f7b0055e4ab29d423d2ef0cc3f156c4f Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 29 Sep 2023 15:21:29 +0100 Subject: [PATCH 108/204] lib: remove full queue check in flush This check is now done in the queue_sz() function --- lib/include/mb_mgr_burst_async.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/include/mb_mgr_burst_async.h b/lib/include/mb_mgr_burst_async.h index 60efcbc4..7aaae16b 100644 --- a/lib/include/mb_mgr_burst_async.h +++ b/lib/include/mb_mgr_burst_async.h @@ -252,12 +252,8 @@ FLUSH_BURST(IMB_MGR *state, const uint32_t max_jobs, IMB_JOB **jobs) #endif /* check if any jobs in queue */ max_ret_jobs = queue_sz(state); - if (max_ret_jobs == 0) { - if (state->earliest_job == -1) - return 0; - else - max_ret_jobs = IMB_MAX_JOBS; - } + if (max_ret_jobs == 0) + return 0; /* set max number of jobs to return */ if (max_ret_jobs > max_jobs) -- GitLab From 9674a1642dc993fac60fa1cb1a82ef1913cec3a8 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 2 Oct 2023 11:13:23 +0100 Subject: [PATCH 109/204] test: [KAT-APP] update API test for new burst API behavior --- test/kat-app/api_test.c | 138 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 137 insertions(+), 1 deletion(-) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 191e5059..9c7af038 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -706,7 +706,10 @@ test_burst_api(struct IMB_MGR *mb_mgr) struct IMB_JOB *job = NULL, *jobs[MAX_BURST_JOBS] = { NULL }; uint32_t i, completed_jobs, n_jobs = MAX_BURST_JOBS; struct IMB_JOB **null_jobs = NULL; - int err, earliest_job, next_job; + int err; +#ifdef __aarch64__ + int earliest_job, next_job; +#endif printf("SUBMIT_BURST() API behavior test:\n"); @@ -855,6 +858,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (!quiet_mode) printf("\n"); +#ifdef __aarch64__ if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) { /* ======== test 6: full job queue wprapping around */ earliest_job = mb_mgr->earliest_job; @@ -884,7 +888,139 @@ test_burst_api(struct IMB_MGR *mb_mgr) return 0; } +#else + /* ======== test 6: full job queue wrapping around */ + + struct IMB_JOB *burst_jobs[IMB_MAX_BURST_SIZE] = { NULL }; + const int LG_BUFFER_SIZE = 1024 * 16; + uint32_t num_jobs = 0; + uint8_t *large_buffer = malloc(LG_BUFFER_SIZE); + + if (large_buffer == NULL) { + printf("Failed to allocate large buffer\n"); + return 1; + } + + /* ensure all jobs flushed */ + while (IMB_FLUSH_BURST(mb_mgr, IMB_MAX_BURST_SIZE, burst_jobs) != 0) + ; + + if (IMB_QUEUE_SIZE(mb_mgr) != 0) { + printf("%s: test %d, unexpected number of jobs in queue\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* get first 128 jobs from job queue */ + num_jobs = IMB_GET_NEXT_BURST(mb_mgr, IMB_MAX_BURST_SIZE, burst_jobs); + if (num_jobs != IMB_MAX_BURST_SIZE) { + printf("%s: test %d, unexpected number of burst jobs\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* fill in valid jobs */ + for (i = 0; i < num_jobs; i++) { + job = burst_jobs[i]; + fill_in_job(job, IMB_CIPHER_CBC, IMB_DIR_ENCRYPT, IMB_AUTH_NULL, + IMB_ORDER_CIPHER_HASH, NULL, NULL); + imb_set_session(mb_mgr, job); + } + + /* use large buffer for first (earliest) job */ + burst_jobs[0]->msg_len_to_cipher_in_bytes = LG_BUFFER_SIZE; + burst_jobs[0]->src = large_buffer; + burst_jobs[0]->dst = large_buffer; + + /* no jobs should complete since earliest will not be fully processed */ + completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, burst_jobs); + if (completed_jobs != 0) { + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* ensure correct number of jobs in queue */ + if (IMB_QUEUE_SIZE(mb_mgr) != num_jobs) { + printf("%s: test %d, unexpected number of jobs in queue\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* ensure that mbr_mgr job buffer was not marked as "empty" in the process */ + if (mb_mgr->earliest_job == -1) { + printf("%s: test %d, job buffer unexpectedly marked 'empty'\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* get last 128 jobs from job queue */ + num_jobs = IMB_GET_NEXT_BURST(mb_mgr, IMB_MAX_BURST_SIZE, burst_jobs); + if (num_jobs != IMB_MAX_BURST_SIZE) { + printf("%s: test %d, unexpected number of burst jobs\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* fill in valid jobs */ + for (i = 0; i < num_jobs; i++) { + job = burst_jobs[i]; + fill_in_job(job, IMB_CIPHER_CBC, IMB_DIR_ENCRYPT, IMB_AUTH_NULL, + IMB_ORDER_CIPHER_HASH, NULL, NULL); + imb_set_session(mb_mgr, job); + } + + /* fill queue to capacity and force flushing number of jobs submitted */ + completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, burst_jobs); + if (completed_jobs != num_jobs) { + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* ensure correct number of jobs remain in queue after forced flush */ + if (IMB_QUEUE_SIZE(mb_mgr) != (IMB_MAX_JOBS - num_jobs)) { + printf("%s: test %d, unexpected number of jobs in queue\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* ensure that mbr_mgr job buffer not marked as "empty" */ + if (mb_mgr->earliest_job == -1) { + printf("%s: test %d, job buffer unexpectedly NOT marked 'empty'\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* flush second set of burst jobs */ + completed_jobs = IMB_FLUSH_BURST(mb_mgr, IMB_MAX_BURST_SIZE, burst_jobs); + if (completed_jobs != IMB_MAX_BURST_SIZE) { + printf("%s: test %d, unexpected number of completed jobs\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* 0 jobs in queue after flush */ + if (IMB_QUEUE_SIZE(mb_mgr) != 0) { + printf("%s: test %d, unexpected number of jobs in queue\n", __func__, + TEST_INVALID_BURST); + return 1; + } + + /* ensure that mbr_mgr job buffer WAS marked as "empty" */ + if (mb_mgr->earliest_job != -1) { + printf("%s: test %d, job buffer unexpectedly NOT marked 'empty'\n", __func__, + TEST_INVALID_BURST); + return 1; + } + free(large_buffer); + + print_progress(); + + if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) + return 0; +#endif printf("GET_NEXT_BURST() API behavior test:\n"); /* ======== test 7 : NULL pointer to burst job array */ -- GitLab From 5c055daae2f1be453360e9b0835cb89367294f54 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 4 Oct 2023 13:34:27 +0100 Subject: [PATCH 110/204] test: [KAT] fix SM3 output --- test/kat-app/sm3_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kat-app/sm3_test.c b/test/kat-app/sm3_test.c index 23db103a..3b13ef45 100644 --- a/test/kat-app/sm3_test.c +++ b/test/kat-app/sm3_test.c @@ -160,7 +160,7 @@ test_sm3_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const i const struct mac_test *v = sm3_test_json; if (!quiet_mode) - printf("SHA standard test vectors (N jobs = %d):\n", num_jobs); + printf("SM3 standard test vectors (N jobs = %d):\n", num_jobs); for (; v->msg != NULL; v++) { #ifdef DEBUG if (!quiet_mode) { -- GitLab From 1600fff2553b573ebb80f07cf4a8ee1f5ae7307a Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 5 Oct 2023 11:49:06 +0100 Subject: [PATCH 111/204] lib: [QUIC] rename chacha20 hp prototypes --- lib/avx2_t1/chacha20_avx2.asm | 4 ++-- lib/avx2_t1/mb_mgr_avx2_t1.c | 2 +- lib/avx2_t2/mb_mgr_avx2_t2.c | 2 +- lib/avx2_t3/mb_mgr_avx2_t3.c | 2 +- lib/avx512_t1/chacha20_avx512.asm | 8 ++++---- lib/avx512_t1/mb_mgr_avx512_t1.c | 2 +- lib/avx512_t2/mb_mgr_avx512_t2.c | 2 +- lib/avx_t1/mb_mgr_avx_t1.c | 2 +- lib/avx_t2/mb_mgr_avx_t2.c | 2 +- lib/include/chacha20_poly1305.h | 12 ++++++------ lib/no-aesni/mb_mgr_sse_no_aesni.c | 2 +- lib/sse_t1/chacha20_sse.asm | 4 ++-- lib/sse_t1/mb_mgr_sse_t1.c | 2 +- lib/sse_t2/mb_mgr_sse_t2.c | 2 +- lib/sse_t3/mb_mgr_sse_t3.c | 2 +- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/avx2_t1/chacha20_avx2.asm b/lib/avx2_t1/chacha20_avx2.asm index dd57221d..1cf1e86f 100644 --- a/lib/avx2_t1/chacha20_avx2.asm +++ b/lib/avx2_t1/chacha20_avx2.asm @@ -1464,8 +1464,8 @@ exit_ks: ret align 32 -MKGLOBAL(quic_chacha20_avx2,function,internal) -quic_chacha20_avx2: +MKGLOBAL(quic_hp_chacha20_avx2,function,internal) +quic_hp_chacha20_avx2: endbranch64 %define tmp rax %define off r11 diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index 3151f36d..c40f37e0 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -487,7 +487,7 @@ init_mb_mgr_avx2_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_avx2; + state->chacha20_hp_quic = quic_hp_chacha20_avx2; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index 57959ba0..56dbe1a5 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -490,7 +490,7 @@ init_mb_mgr_avx2_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_avx2; + state->chacha20_hp_quic = quic_hp_chacha20_avx2; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index 32e60d7d..509945a1 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -493,7 +493,7 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx2; - state->chacha20_hp_quic = quic_chacha20_avx2; + state->chacha20_hp_quic = quic_hp_chacha20_avx2; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/avx512_t1/chacha20_avx512.asm b/lib/avx512_t1/chacha20_avx512.asm index 5514265f..8b1c7170 100644 --- a/lib/avx512_t1/chacha20_avx512.asm +++ b/lib/avx512_t1/chacha20_avx512.asm @@ -2654,11 +2654,11 @@ exit_ks: ret ;; -;; quic_chacha20_avx512(void *key, const uint8_t *src_ptr_array, -;; void *dst_ptr_array, const uint64_t num_buffers); +;; quic_hp_chacha20_avx512(void *key, const uint8_t *src_ptr_array, +;; void *dst_ptr_array, const uint64_t num_buffers); align 32 -MKGLOBAL(quic_chacha20_avx512,function,internal) -quic_chacha20_avx512: +MKGLOBAL(quic_hp_chacha20_avx512,function,internal) +quic_hp_chacha20_avx512: endbranch64 %define tmp rax diff --git a/lib/avx512_t1/mb_mgr_avx512_t1.c b/lib/avx512_t1/mb_mgr_avx512_t1.c index 1010a465..e3ab847e 100644 --- a/lib/avx512_t1/mb_mgr_avx512_t1.c +++ b/lib/avx512_t1/mb_mgr_avx512_t1.c @@ -582,7 +582,7 @@ init_mb_mgr_avx512_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; - state->chacha20_hp_quic = quic_chacha20_avx512; + state->chacha20_hp_quic = quic_hp_chacha20_avx512; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/avx512_t2/mb_mgr_avx512_t2.c b/lib/avx512_t2/mb_mgr_avx512_t2.c index d1dd02ec..55d237ac 100644 --- a/lib/avx512_t2/mb_mgr_avx512_t2.c +++ b/lib/avx512_t2/mb_mgr_avx512_t2.c @@ -594,7 +594,7 @@ init_mb_mgr_avx512_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_128_quic = aes_ecb_quic_enc_128_vaes_avx512; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_vaes_avx512; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx512; - state->chacha20_hp_quic = quic_chacha20_avx512; + state->chacha20_hp_quic = quic_hp_chacha20_avx512; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/avx_t1/mb_mgr_avx_t1.c b/lib/avx_t1/mb_mgr_avx_t1.c index cb67ab03..2c2274bb 100644 --- a/lib/avx_t1/mb_mgr_avx_t1.c +++ b/lib/avx_t1/mb_mgr_avx_t1.c @@ -486,7 +486,7 @@ init_mb_mgr_avx_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_hp_chacha20_sse; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/avx_t2/mb_mgr_avx_t2.c b/lib/avx_t2/mb_mgr_avx_t2.c index 0ff6404b..397c72e7 100644 --- a/lib/avx_t2/mb_mgr_avx_t2.c +++ b/lib/avx_t2/mb_mgr_avx_t2.c @@ -491,7 +491,7 @@ init_mb_mgr_avx_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; state->chacha20_poly1305_quic = aead_chacha20_poly1305_avx; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_hp_chacha20_sse; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/include/chacha20_poly1305.h b/lib/include/chacha20_poly1305.h index c2254209..7e360e5f 100644 --- a/lib/include/chacha20_poly1305.h +++ b/lib/include/chacha20_poly1305.h @@ -190,13 +190,13 @@ finalize_chacha20_poly1305_fma_avx512(struct chacha20_poly1305_context_data *ctx const uint64_t tag_len); void -quic_chacha20_sse(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], - const uint64_t num_buffers); +quic_hp_chacha20_sse(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], + const uint64_t num_buffers); void -quic_chacha20_avx2(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], - const uint64_t num_buffers); +quic_hp_chacha20_avx2(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], + const uint64_t num_buffers); void -quic_chacha20_avx512(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], - const uint64_t num_buffers); +quic_hp_chacha20_avx512(const void *key, const void *const src_ptr_array[], void *dst_ptr_array[], + const uint64_t num_buffers); #endif /* IMB_CHACHA20POLY1305_H */ diff --git a/lib/no-aesni/mb_mgr_sse_no_aesni.c b/lib/no-aesni/mb_mgr_sse_no_aesni.c index 974fe63f..aba57b42 100644 --- a/lib/no-aesni/mb_mgr_sse_no_aesni.c +++ b/lib/no-aesni/mb_mgr_sse_no_aesni.c @@ -462,7 +462,7 @@ init_mb_mgr_sse_no_aesni_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse_no_aesni; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_hp_chacha20_sse; state->set_suite_id = SET_SUITE_ID_FN; diff --git a/lib/sse_t1/chacha20_sse.asm b/lib/sse_t1/chacha20_sse.asm index 528b9e03..5f983c73 100644 --- a/lib/sse_t1/chacha20_sse.asm +++ b/lib/sse_t1/chacha20_sse.asm @@ -2922,8 +2922,8 @@ exit_gen: jmp restore_gen_keystr align 32 -MKGLOBAL(quic_chacha20_sse,function,internal) -quic_chacha20_sse: +MKGLOBAL(quic_hp_chacha20_sse,function,internal) +quic_hp_chacha20_sse: endbranch64 %define tmp rax diff --git a/lib/sse_t1/mb_mgr_sse_t1.c b/lib/sse_t1/mb_mgr_sse_t1.c index 0b4db58e..0ff964d6 100644 --- a/lib/sse_t1/mb_mgr_sse_t1.c +++ b/lib/sse_t1/mb_mgr_sse_t1.c @@ -492,7 +492,7 @@ init_mb_mgr_sse_t1_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_hp_chacha20_sse; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/sse_t2/mb_mgr_sse_t2.c b/lib/sse_t2/mb_mgr_sse_t2.c index 6b4fcdac..074d55f0 100644 --- a/lib/sse_t2/mb_mgr_sse_t2.c +++ b/lib/sse_t2/mb_mgr_sse_t2.c @@ -494,7 +494,7 @@ init_mb_mgr_sse_t2_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_hp_chacha20_sse; state->sm4_keyexp = sm4_set_key_sse; } diff --git a/lib/sse_t3/mb_mgr_sse_t3.c b/lib/sse_t3/mb_mgr_sse_t3.c index 2fc41355..ac8f36f0 100644 --- a/lib/sse_t3/mb_mgr_sse_t3.c +++ b/lib/sse_t3/mb_mgr_sse_t3.c @@ -495,7 +495,7 @@ init_mb_mgr_sse_t3_internal(IMB_MGR *state, const int reset_mgrs) state->aes_ecb_256_quic = aes_ecb_quic_enc_256_sse; state->chacha20_poly1305_quic = aead_chacha20_poly1305_sse; - state->chacha20_hp_quic = quic_chacha20_sse; + state->chacha20_hp_quic = quic_hp_chacha20_sse; state->sm4_keyexp = sm4_set_key_sse; } -- GitLab From 925fdb01610a81890807fcd95baacd4eccd7b942 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 4 Oct 2023 11:55:56 +0100 Subject: [PATCH 112/204] lib: [CHACHA20-POLY1305] add new defines Expose key and IV sizes defines for Chacha20-Poly1305. --- lib/ipsec-mb.h | 31 ++++++++++------- lib/x86_64/quic_chacha20_poly1305.c | 8 +++-- test/kat-app/chacha20_poly1305_test.c | 50 +++++++++++++-------------- 3 files changed, 47 insertions(+), 42 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 8c299353..9afcc2a2 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -171,6 +171,10 @@ typedef enum { #define IMB_SM3_DIGEST_SIZE 32 #define IMB_SM3_BLOCK_SIZE 64 +#define IMB_CHACHA20_POLY1305_KEY_SIZE 32 +#define IMB_CHACHA20_POLY1305_IV_SIZE 12 +#define IMB_POLY1305_BLOCK_SIZE 16 + /** * Minimum Ethernet frame size to calculate CRC32 * Source Address (6 bytes) + Destination Address (6 bytes) + Type/Len (2 bytes) @@ -587,19 +591,20 @@ struct gcm_context_data { * @brief holds Chacha20-Poly1305 operation context */ struct chacha20_poly1305_context_data { - uint64_t hash[3]; /**< Intermediate computation of hash value */ - uint64_t aad_len; /**< Total AAD length */ - uint64_t hash_len; /**< Total length to digest (excluding AAD) */ - uint8_t last_ks[64]; /**< Last 64 bytes of KS */ - uint8_t poly_key[32]; /**< Poly key */ - uint8_t poly_scratch[16]; /**< Scratchpad to compute Poly on 16 bytes */ - uint64_t last_block_count; /**< Last block count used in last segment */ - uint64_t remain_ks_bytes; /**< Amount of bytes still to use of keystream - (up to 63 bytes) */ - uint64_t remain_ct_bytes; /**< Amount of ciphertext bytes still to use - of previous segment to authenticate - (up to 16 bytes) */ - uint8_t IV[12]; /**< IV (12 bytes) */ + uint64_t hash[3]; /**< Intermediate computation of hash value */ + uint64_t aad_len; /**< Total AAD length */ + uint64_t hash_len; /**< Total length to digest (excluding AAD) */ + uint8_t last_ks[64]; /**< Last 64 bytes of KS */ + uint8_t poly_key[IMB_CHACHA20_POLY1305_KEY_SIZE]; /**< Poly key */ + uint8_t poly_scratch[IMB_POLY1305_BLOCK_SIZE]; /**< Scratchpad to compute Poly on 16 bytes + */ + uint64_t last_block_count; /**< Last block count used in last segment */ + uint64_t remain_ks_bytes; /**< Amount of bytes still to use of keystream + (up to 63 bytes) */ + uint64_t remain_ct_bytes; /**< Amount of ciphertext bytes still to use + of previous segment to authenticate + (up to 16 bytes) */ + uint8_t IV[IMB_CHACHA20_POLY1305_IV_SIZE]; /**< IV (12 bytes) */ }; /* 32 precomputed (4-byte) rounds for SM4 key schedule (128 bytes in total) */ diff --git a/lib/x86_64/quic_chacha20_poly1305.c b/lib/x86_64/quic_chacha20_poly1305.c index ab585fe7..b18f87ad 100644 --- a/lib/x86_64/quic_chacha20_poly1305.c +++ b/lib/x86_64/quic_chacha20_poly1305.c @@ -29,6 +29,8 @@ #include "include/error.h" #include "include/chacha20_poly1305.h" +#define CHACHA20_POLY1305_QUIC_TAG_LENGTH 16 + IMB_DLL_EXPORT void imb_quic_chacha20_poly1305(IMB_MGR *state, const void *key, const IMB_CIPHER_DIRECTION cipher_dir, void *dst_ptr_array[], const void *const src_ptr_array[], @@ -106,12 +108,12 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, const void *key, const IMB_CIPHER_DIR IMB_JOB job; - job.key_len_in_bytes = 32; + job.key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job.enc_keys = key; - job.iv_len_in_bytes = 12; + job.iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job.cipher_start_src_offset_in_bytes = 0; job.hash_start_src_offset_in_bytes = 0; - job.auth_tag_output_len_in_bytes = tag_len; + job.auth_tag_output_len_in_bytes = CHACHA20_POLY1305_QUIC_TAG_LENGTH; job.u.CHACHA20_POLY1305.aad_len_in_bytes = aad_len; job.cipher_direction = cipher_dir; diff --git a/test/kat-app/chacha20_poly1305_test.c b/test/kat-app/chacha20_poly1305_test.c index 9454f97f..1ab53065 100644 --- a/test/kat-app/chacha20_poly1305_test.c +++ b/test/kat-app/chacha20_poly1305_test.c @@ -35,8 +35,6 @@ #include "aead_test.h" #define AAD_SZ 24 -#define IV_SZ 12 -#define KEY_SZ 32 #define DIGEST_SZ 16 int @@ -207,7 +205,7 @@ test_aead(struct IMB_MGR *mb_mgr, const struct aead_test *vec, const int dir, co job->hash_alg = IMB_AUTH_CHACHA20_POLY1305; job->enc_keys = vec->key; job->dec_keys = vec->key; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = (const void *) vec->aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aadSize / 8; @@ -221,7 +219,7 @@ test_aead(struct IMB_MGR *mb_mgr, const struct aead_test *vec, const int dir, co job->dst = targets[i] + sizeof(padding); job->iv = (const void *) vec->iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->msg_len_to_cipher_in_bytes = vec->msgSize / 8; job->cipher_start_src_offset_in_bytes = 0; @@ -317,7 +315,7 @@ test_aead(struct IMB_MGR *mb_mgr, const struct aead_test *vec, const int dir, co job->hash_alg = IMB_AUTH_CHACHA20_POLY1305; job->enc_keys = vec->key; job->dec_keys = vec->key; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = vec->aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = vec->aadSize / 8; @@ -331,7 +329,7 @@ test_aead(struct IMB_MGR *mb_mgr, const struct aead_test *vec, const int dir, co job->dst = targets[i] + sizeof(padding); job->iv = (const void *) vec->iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->msg_len_to_cipher_in_bytes = vec->msgSize / 8; job->cipher_start_src_offset_in_bytes = 0; @@ -479,10 +477,10 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, uint8_t **segments = NULL; uint8_t linear_digest[DIGEST_SZ]; uint8_t sgl_digest[DIGEST_SZ]; - uint8_t key[KEY_SZ]; + uint8_t key[IMB_CHACHA20_POLY1305_KEY_SIZE]; unsigned i; uint8_t aad[AAD_SZ]; - uint8_t iv[IV_SZ]; + uint8_t iv[IMB_CHACHA20_POLY1305_IV_SIZE]; struct chacha20_poly1305_context_data chacha_ctx; uint32_t last_seg_sz = buffer_sz % seg_sz; struct IMB_SGL_IOV *sgl_segs = NULL; @@ -513,8 +511,8 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, memset(linear_digest, 0xFF, DIGEST_SZ); generate_random_buf(in_buffer, buffer_sz); - generate_random_buf(key, KEY_SZ); - generate_random_buf(iv, IV_SZ); + generate_random_buf(key, IMB_CHACHA20_POLY1305_KEY_SIZE); + generate_random_buf(iv, IMB_CHACHA20_POLY1305_IV_SIZE); generate_random_buf(aad, AAD_SZ); segments = malloc(num_segments * sizeof(*segments)); @@ -558,13 +556,13 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, job->dec_keys = key; job->src = in_buffer; job->dst = in_buffer; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = AAD_SZ; job->iv = iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->msg_len_to_cipher_in_bytes = buffer_sz; job->cipher_start_src_offset_in_bytes = 0; @@ -592,14 +590,14 @@ test_single_job_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, job->hash_alg = IMB_AUTH_CHACHA20_POLY1305_SGL; job->enc_keys = key; job->dec_keys = key; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = AAD_SZ; job->u.CHACHA20_POLY1305.ctx = &chacha_ctx; job->iv = iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->cipher_start_src_offset_in_bytes = 0; job->hash_start_src_offset_in_bytes = 0; @@ -669,10 +667,10 @@ test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t uint32_t num_segments; uint8_t linear_digest[DIGEST_SZ]; uint8_t sgl_digest[DIGEST_SZ]; - uint8_t key[KEY_SZ]; + uint8_t key[IMB_CHACHA20_POLY1305_KEY_SIZE]; unsigned int i, segments_to_update; uint8_t aad[AAD_SZ]; - uint8_t iv[IV_SZ]; + uint8_t iv[IMB_CHACHA20_POLY1305_IV_SIZE]; struct chacha20_poly1305_context_data chacha_ctx; uint32_t last_seg_sz = buffer_sz % seg_sz; @@ -695,8 +693,8 @@ test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t memset(linear_digest, 0xFF, DIGEST_SZ); generate_random_buf(in_buffer, buffer_sz); - generate_random_buf(key, KEY_SZ); - generate_random_buf(iv, IV_SZ); + generate_random_buf(key, IMB_CHACHA20_POLY1305_KEY_SIZE); + generate_random_buf(iv, IMB_CHACHA20_POLY1305_IV_SIZE); generate_random_buf(aad, AAD_SZ); segments = malloc(num_segments * sizeof(*segments)); @@ -743,13 +741,13 @@ test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t job->dec_keys = key; job->src = in_buffer; job->dst = in_buffer; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = AAD_SZ; job->iv = iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->msg_len_to_cipher_in_bytes = buffer_sz; job->cipher_start_src_offset_in_bytes = 0; @@ -778,14 +776,14 @@ test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t job->hash_alg = IMB_AUTH_CHACHA20_POLY1305_SGL; job->enc_keys = key; job->dec_keys = key; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = AAD_SZ; job->u.CHACHA20_POLY1305.ctx = &chacha_ctx; job->iv = iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->cipher_start_src_offset_in_bytes = 0; job->hash_start_src_offset_in_bytes = 0; @@ -824,14 +822,14 @@ test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t job->hash_alg = IMB_AUTH_CHACHA20_POLY1305_SGL; job->enc_keys = key; job->dec_keys = key; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = AAD_SZ; job->u.CHACHA20_POLY1305.ctx = &chacha_ctx; job->iv = iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->cipher_start_src_offset_in_bytes = 0; job->hash_start_src_offset_in_bytes = 0; @@ -863,14 +861,14 @@ test_sgl(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const uint32_t job->hash_alg = IMB_AUTH_CHACHA20_POLY1305_SGL; job->enc_keys = key; job->dec_keys = key; - job->key_len_in_bytes = KEY_SZ; + job->key_len_in_bytes = IMB_CHACHA20_POLY1305_KEY_SIZE; job->u.CHACHA20_POLY1305.aad = aad; job->u.CHACHA20_POLY1305.aad_len_in_bytes = AAD_SZ; job->u.CHACHA20_POLY1305.ctx = &chacha_ctx; job->iv = iv; - job->iv_len_in_bytes = IV_SZ; + job->iv_len_in_bytes = IMB_CHACHA20_POLY1305_IV_SIZE; job->cipher_start_src_offset_in_bytes = 0; job->hash_start_src_offset_in_bytes = 0; -- GitLab From 1ef89d48145a7a9be22939af35fd1e00155d62a9 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 4 Oct 2023 13:24:56 +0100 Subject: [PATCH 113/204] lib: [QUIC] remove tag length parameter QUIC protocol does not require tag length to be different than 16 bytes, so there is no point in having it as a parameter. --- lib/ipsec-mb.h | 4 +--- lib/x86_64/quic_chacha20_poly1305.c | 3 +-- perf/ipsec_perf.c | 5 ++--- test/kat-app/chacha20_poly1305_test.c | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 9afcc2a2..6bb83619 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -3837,7 +3837,6 @@ imb_quic_hp_aes_ecb(IMB_MGR *state, const void *exp_key_data, void *dst_ptr_arra * @param [in] aad_ptr_array array with AAD pointers * @param [in] aad_len AAD length in bytes * @param [out] tag_ptr_array array with authentication TAG pointers - * @param [in] tag_len authentication TAG length in bytes * @param [in] num_packets number of packets in this batch */ IMB_DLL_EXPORT void @@ -3845,8 +3844,7 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, const void *key, const IMB_CIPHER_DIR void *dst_ptr_array[], const void *const src_ptr_array[], const uint64_t len_array[], const void *const iv_ptr_array[], const void *const aad_ptr_array[], const uint64_t aad_len, - void *tag_ptr_array[], const uint64_t tag_len, - const uint64_t num_packets); + void *tag_ptr_array[], const uint64_t num_packets); /** * @brief Batch of ChaCha20 encrypt operations with the same key diff --git a/lib/x86_64/quic_chacha20_poly1305.c b/lib/x86_64/quic_chacha20_poly1305.c index b18f87ad..9df41ea5 100644 --- a/lib/x86_64/quic_chacha20_poly1305.c +++ b/lib/x86_64/quic_chacha20_poly1305.c @@ -36,8 +36,7 @@ imb_quic_chacha20_poly1305(IMB_MGR *state, const void *key, const IMB_CIPHER_DIR void *dst_ptr_array[], const void *const src_ptr_array[], const uint64_t len_array[], const void *const iv_ptr_array[], const void *const aad_ptr_array[], const uint64_t aad_len, - void *tag_ptr_array[], const uint64_t tag_len, - const uint64_t num_packets) + void *tag_ptr_array[], const uint64_t num_packets) { /** * @note it can be out of place operation diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 1a43bee6..c7f12529 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -1606,14 +1606,13 @@ do_test_quic_chacha_poly(struct params_s *params, const uint32_t num_iter, IMB_M for (n = 0; n < full_num_iter; n++) imb_quic_chacha20_poly1305(p_mgr, kp, params->cipher_dir, (void **) out, (const void *const *) in, len, (const void *const *) iv, - (const void *const *) &aad, aad_size, (void **) tag, - TAG_LEN, K); + (const void *const *) &aad, aad_size, (void **) tag, K); if (last_iter != 0) imb_quic_chacha20_poly1305(p_mgr, kp, params->cipher_dir, (void **) out, (const void *const *) in, len, (const void *const *) iv, (const void *const *) &aad, aad_size, (void **) tag, - TAG_LEN, last_iter); + last_iter); #ifndef _WIN32 if (use_unhalted_cycles) diff --git a/test/kat-app/chacha20_poly1305_test.c b/test/kat-app/chacha20_poly1305_test.c index 1ab53065..dc4853de 100644 --- a/test/kat-app/chacha20_poly1305_test.c +++ b/test/kat-app/chacha20_poly1305_test.c @@ -169,7 +169,7 @@ test_aead(struct IMB_MGR *mb_mgr, const struct aead_test *vec, const int dir, co imb_quic_chacha20_poly1305(mb_mgr, vec->key, dir, dst_ptr_array, src_ptr_array, len_array, iv_ptr_array, aad_ptr_array, vec->aadSize / 8, tag_ptr_array, - DIGEST_SZ, num_jobs); + num_jobs); for (i = 0; i < num_jobs; i++) { if (!aead_ok(vec, DIGEST_SZ, dst_ptr_array[i], dir, auths[i], padding, -- GitLab From 048a9138dceb1e54d89ffd3ae7d137cf7df74298 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 6 Oct 2023 16:29:51 +0100 Subject: [PATCH 114/204] lib: [CMAKE] add mingw support --- lib/CMakeLists.txt | 6 +- lib/cmake/windows-mingw.cmake | 130 ++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 lib/cmake/windows-mingw.cmake diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 95b77eec..60d665be 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -255,7 +255,11 @@ endif() # add OS specific options ######################################## if(WINDOWS) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows.cmake) + if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows-mingw.cmake) + else() + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows.cmake) + endif() else() include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/unix.cmake) endif() diff --git a/lib/cmake/windows-mingw.cmake b/lib/cmake/windows-mingw.cmake new file mode 100644 index 00000000..3e34dbbb --- /dev/null +++ b/lib/cmake/windows-mingw.cmake @@ -0,0 +1,130 @@ +# Copyright (c) 2023, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors may +# be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# ############################################################################## +# IPSec_MB library CMake MinGW config +# ############################################################################## + +set(LIB IPSec_MB) # 'lib' prefix assumed with MinGW +set(SRC_DEF_FILE ${CMAKE_CURRENT_BINARY_DIR}/lib${LIB}_lnk.def) + +# set NASM flags +string(APPEND CMAKE_ASM_NASM_FLAGS " -Werror -fwin64 -Xvc -gcv8 -DWIN_ABI") + +# set C compiler flags +set(CMAKE_C_FLAGS + "-fPIC -W -Wall -Wextra -Wmissing-declarations \ +-Wpointer-arith -Wcast-qual -Wundef -Wwrite-strings -Wformat \ +-Wformat-security -Wunreachable-code -Wmissing-noreturn \ +-Wsign-compare -Wno-endif-labels -Wstrict-prototypes \ +-Wmissing-prototypes -Wold-style-definition \ +-fno-delete-null-pointer-checks -fwrapv -std=c99") + +if(NOT DEBUG_OPT) + set(DEBUG_OPT "-O0") +endif() + +set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG ${DEBUG_OPT}") +set(CMAKE_C_FLAGS_RELEASE "-O2") +set(CMAKE_SHARED_LINKER_FLAGS "-s") + +# -fno-strict-overflow is not supported by clang +if(CMAKE_COMPILER_IS_GNUCC) + string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") +endif() + +# set directory specific C compiler flags +set_source_files_properties( + ${SRC_FILES_AVX_T1} ${SRC_FILES_AVX_T2} + PPROPERTIES COMPILE_FLAGS + "-march=sandybridge -maes -mpclmul") +set_source_files_properties( + ${SRC_FILES_AVX2_T1} ${SRC_FILES_AVX2_T2} ${SRC_FILES_AVX2_T3} + PPROPERTIES COMPILE_FLAGS + "-march=haswell -maes -mpclmul") +set_source_files_properties( + ${SRC_FILES_AVX512_T1} ${SRC_FILES_AVX512_T2} + PROPERTIES COMPILE_FLAGS + "-march=broadwell -maes -mpclmul") +set_source_files_properties( + ${SRC_FILES_SSE_T1} ${SRC_FILES_SSE_T2} ${SRC_FILES_SSE_T3} + PROPERTIES COMPILE_FLAGS + "-march=nehalem -maes -mpclmul") +set_source_files_properties(${SRC_FILES_X86_64} + PROPERTIES COMPILE_FLAGS + "-msse4.2") +if(AESNI_EMU) + set_source_files_properties( + ${SRC_FILES_NO_AESNI} + PROPERTIES COMPILE_FLAGS + "-march=nehalem -mno-pclmul") +endif() + +# generate windows DEF file +if(NOT AESNI_EMU) + set(STR_FILTER "/c:_no_aesni") +endif() +if(NOT AVX_IFMA) + set(STR_FILTER "${STR_FILTER} /c:_avx2_t3") +endif() + +# filter unused symbol exports +if(NOT STR_FILTER) + execute_process( + COMMAND ${CMAKE_COMMAND} -E copy "lib${LIB}.def" ${SRC_DEF_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +else() + execute_process( + COMMAND cmd /C "findstr /v ${STR_FILTER} lib${LIB}.def > ${SRC_DEF_FILE}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endif() + +######################################## +# add library target +######################################## + +add_library(${LIB} ${SRC_FILES_ASM} ${SRC_FILES_C} ${SRC_DEF_FILE}) + +# set install rules +if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "c:/Program Files" + CACHE STRING "Set default installation directory" FORCE) +endif() +message(STATUS "CMAKE_INSTALL_PREFIX... ${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${LIB} + DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}) +install(FILES + ${IMB_HDR} + ${SRC_DEF_FILE} + DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}) +if(BUILD_SHARED_LIBS) + install(FILES + $/lib${LIB}.dll + DESTINATION $ENV{WINDIR}/system32) +endif() + -- GitLab From 6c515868834bdf66d1ae2db5a01463479eb00c20 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 6 Oct 2023 16:30:45 +0100 Subject: [PATCH 115/204] perf: [CMAKE] add mingw support --- perf/CMakeLists.txt | 6 +++- perf/cmake/windows-mingw.cmake | 63 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 perf/cmake/windows-mingw.cmake diff --git a/perf/CMakeLists.txt b/perf/CMakeLists.txt index 59be4a2c..fc934463 100644 --- a/perf/CMakeLists.txt +++ b/perf/CMakeLists.txt @@ -78,7 +78,11 @@ set(CAN_USE_ASSEMBLER TRUE) ######################################## # add OS specific options if(WINDOWS) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows.cmake) + if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows-mingw.cmake) + else() + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows.cmake) + endif() else() include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/unix.cmake) endif() diff --git a/perf/cmake/windows-mingw.cmake b/perf/cmake/windows-mingw.cmake new file mode 100644 index 00000000..f84746fb --- /dev/null +++ b/perf/cmake/windows-mingw.cmake @@ -0,0 +1,63 @@ +# Copyright (c) 2023, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors may +# be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# ############################################################################## +# Performance application CMake MinGW config +# ############################################################################## + +set(IPSEC_MB_LIB IPSec_MB) + +# set NASM flags +set(CMAKE_ASM_NASM_FLAGS " -Werror -fwin64 -Xvc -gcv8 -DWIN_ABI") + +# set C compiler flags +set(CMAKE_C_FLAGS + "-W -Wall -Wextra -Wmissing-declarations \ +-Wpointer-arith -Wcast-qual -Wundef -Wwrite-strings -Wformat \ +-Wformat-security -Wunreachable-code -Wmissing-noreturn -Wsign-compare \ +-Wno-endif-labels -Wstrict-prototypes -Wmissing-prototypes \ +-Wold-style-definition -fno-delete-null-pointer-checks -fwrapv -std=c99") +set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG -O0") +set(CMAKE_C_FLAGS_RELEASE "-O2") +set(CMAKE_EXE_LINKER_FLAGS "-fPIE") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g") +# -fno-strict-overflow is not supported by clang +if(CMAKE_COMPILER_IS_GNUCC) + string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") +endif() + +# set destination dir to copy scripts +if(IMB_BIN_DIR) + set(COPY_DST_DIR ${IMB_BIN_DIR}) +else() + set(COPY_DST_DIR ${CMAKE_CURRENT_BINARY_DIR}) +endif() + +# copy perf scripts to binary directory +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipsec_diff_tool.py + ${COPY_DST_DIR}/ipsec_diff_tool.py COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipsec_perf_tool.py + ${COPY_DST_DIR}/ipsec_perf_tool.py COPYONLY) + -- GitLab From db728b6299e448e2fdad56ba7e3534d8ccb3822a Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 6 Oct 2023 16:32:23 +0100 Subject: [PATCH 116/204] test: [CMAKE] add mingw support --- test/cmake/windows-mingw.cmake | 55 ++++++++++++++++++++++++++++++ test/kat-app/CMakeLists.txt | 6 +++- test/wycheproof-app/CMakeLists.txt | 6 +++- test/xvalid-app/CMakeLists.txt | 6 +++- 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 test/cmake/windows-mingw.cmake diff --git a/test/cmake/windows-mingw.cmake b/test/cmake/windows-mingw.cmake new file mode 100644 index 00000000..1acfe83f --- /dev/null +++ b/test/cmake/windows-mingw.cmake @@ -0,0 +1,55 @@ +# Copyright (c) 2023, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors may +# be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# ############################################################################## +# Test application CMake MinGW config +# ############################################################################## + +set(IPSEC_MB_LIB IPSec_MB) + +# set NASM flags +set(CMAKE_ASM_NASM_FLAGS "-Werror -fwin64 -Xvc -gcv8 -DWIN_ABI") + +# set compiler definitions +set(APP_DEFINES _GNU_SOURCE) + +# set C compiler flags +set(CMAKE_C_FLAGS + "-W -Wall -Wextra -Wmissing-declarations \ +-Wpointer-arith -Wcast-qual -Wundef -Wwrite-strings -Wformat \ +-Wformat-security -Wunreachable-code -Wmissing-noreturn -Wsign-compare \ +-Wno-endif-labels -Wstrict-prototypes -Wmissing-prototypes \ +-Wold-style-definition -fno-delete-null-pointer-checks -fwrapv -std=c99") +set(CMAKE_C_FLAGS_DEBUG "-O0 -DDEBUG -g") +set(CMAKE_C_FLAGS_RELEASE "-O2") +set(CMAKE_EXE_LINKER_FLAGS "-fPIE") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g") + +# -fno-strict-overflow is not supported by clang +if(CMAKE_COMPILER_IS_GNUCC) + string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") +endif() + + diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index f0be3b7a..6fb231e0 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -130,7 +130,11 @@ endif() ######################################## # add OS specific options if(WINDOWS) - include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows-mingw.cmake) + else() + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + endif() else() include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/unix.cmake) endif() diff --git a/test/wycheproof-app/CMakeLists.txt b/test/wycheproof-app/CMakeLists.txt index eb16016f..c10bc62e 100644 --- a/test/wycheproof-app/CMakeLists.txt +++ b/test/wycheproof-app/CMakeLists.txt @@ -58,7 +58,11 @@ set(WYCHEPROOF_APP_SRC_FILES_C ######################################## # add OS specific options if(WINDOWS) - include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows-mingw.cmake) + else() + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + endif() else() include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/unix.cmake) endif() diff --git a/test/xvalid-app/CMakeLists.txt b/test/xvalid-app/CMakeLists.txt index f416ab32..db02fcbd 100644 --- a/test/xvalid-app/CMakeLists.txt +++ b/test/xvalid-app/CMakeLists.txt @@ -73,7 +73,11 @@ set(CAN_USE_ASSEMBLER TRUE) ######################################## # add OS specific options if(WINDOWS) - include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows-mingw.cmake) + else() + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + endif() else() include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/unix.cmake) endif() -- GitLab From 8dd7cc0af6e2755479b5b0d6bef8d9f989a23367 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 6 Oct 2023 16:33:06 +0100 Subject: [PATCH 117/204] examples: [CMAKE] add mingw support --- examples/burst-app/CMakeLists.txt | 6 +++- examples/cmake/windows-mingw.cmake | 52 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 examples/cmake/windows-mingw.cmake diff --git a/examples/burst-app/CMakeLists.txt b/examples/burst-app/CMakeLists.txt index de391d81..dba30c12 100644 --- a/examples/burst-app/CMakeLists.txt +++ b/examples/burst-app/CMakeLists.txt @@ -49,7 +49,11 @@ set(SAMPLE_APP_SRC_FILES_C if(CMAKE_HOST_UNIX) include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/unix.cmake) else() - include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows-mingw.cmake) + else() + include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/windows.cmake) + endif() endif() diff --git a/examples/cmake/windows-mingw.cmake b/examples/cmake/windows-mingw.cmake new file mode 100644 index 00000000..7d72433e --- /dev/null +++ b/examples/cmake/windows-mingw.cmake @@ -0,0 +1,52 @@ +# Copyright (c) 2023, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors may +# be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# ############################################################################## +# Test application CMake MinGW config +# ############################################################################## + +set(WINDOWS 1) +set(IPSEC_MB_LIB IPSec_MB) + +# set NASM flags +set(CMAKE_ASM_NASM_FLAGS "-Werror -fwin64 -Xvc -gcv8 -DWIN_ABI") + +# set C compiler flags +set(CMAKE_C_FLAGS + "-W -Wall -Wextra -Wmissing-declarations \ +-Wpointer-arith -Wcast-qual -Wundef -Wwrite-strings -Wformat \ +-Wformat-security -Wunreachable-code -Wmissing-noreturn -Wsign-compare \ +-Wno-endif-labels -Wstrict-prototypes -Wmissing-prototypes \ +-Wold-style-definition -fno-delete-null-pointer-checks -fwrapv -std=c99") +set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG -O0") +set(CMAKE_C_FLAGS_RELEASE "-O2") +set(CMAKE_EXE_LINKER_FLAGS "-fPIE") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g") + +# -fno-strict-overflow is not supported by clang +if(CMAKE_COMPILER_IS_GNUCC) + string(APPEND CMAKE_C_FLAGS " -fno-strict-overflow") +endif() + -- GitLab From b29a7fd51eb7327828a1244cfbfa55bb73ff84dc Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 9 Oct 2023 11:10:11 +0100 Subject: [PATCH 118/204] burst-app: update build flags - update linker flags - update compiler flags to enable debug code paths --- examples/burst-app/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/examples/burst-app/Makefile b/examples/burst-app/Makefile index 0375cb36..45fb451e 100644 --- a/examples/burst-app/Makefile +++ b/examples/burst-app/Makefile @@ -37,17 +37,35 @@ CFLAGS = -D_GNU_SOURCE -DNO_COMPAT_IMB_API_053 $(INCLUDES) \ -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition \ -pthread -fno-delete-null-pointer-checks -fwrapv -std=c99 +MINGW ?= $(shell $(CC) -dM -E - < /dev/null | grep -i mingw | wc -l | sed 's/^ *//') + # -fno-strict-overflow is not supported by clang ifneq ($(CC),clang) CFLAGS += -fno-strict-overflow endif LDLIBS = -lIPSec_MB +ifeq ($(MINGW),0) +LDFLAGS = -fPIE -z noexecstack -z relro -z now -pthread +else +LDFLAGS = -fPIE +endif # imb-burst modules SOURCES := main.c OBJECTS := $(SOURCES:%.c=%.o) +ifeq ($(DEBUG),y) +CFLAGS += -O0 -DDEBUG -g +LDFLAGS += -g +else +ifeq ($(MINGW),0) +CFLAGS += -O3 +else +CFLAGS += -O2 +endif +endif + # library not installed CFLAGS += -I$(LIB_DIR) LDFLAGS += -L$(LIB_DIR) -- GitLab From 58b81235bda70e471238875bf35b89ee46d00486 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 9 Oct 2023 11:13:20 +0100 Subject: [PATCH 119/204] burst-app: don't decrement n_jobs_left after flush Not necessary since n_jobs_left is decremented after submission --- examples/burst-app/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/burst-app/main.c b/examples/burst-app/main.c index cd501cbc..80831ce9 100644 --- a/examples/burst-app/main.c +++ b/examples/burst-app/main.c @@ -157,7 +157,6 @@ main(void) completed_jobs = IMB_FLUSH_BURST(mb_mgr, BURST_SIZE, jobs); total_jobs_rx += completed_jobs; - n_jobs_left -= completed_jobs; #ifdef DEBUG for (i = 0; i < completed_jobs; i++) { if (jobs[i]->status != IMB_STATUS_COMPLETED) { -- GitLab From 3a13652a91fa762381006193282aa39943394dd8 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 09:24:31 +0100 Subject: [PATCH 120/204] lib: SM4 key expansion API comment --- lib/ipsec-mb.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 6bb83619..b141a8e9 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -2602,6 +2602,9 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); */ #define IMB_CRC8_WIMAX_OFDMA_HCS(_mgr, _src, _len) (_mgr)->crc8_wimax_ofdma_hcs(_src, _len) +/** + * SM4 key expansion + */ #define IMB_SM4_KEYEXP(_mgr, _key, _exp_enc_key, _exp_dec_key) \ ((_mgr)->sm4_keyexp((_key), (_exp_enc_key), (_exp_dec_key))) -- GitLab From 251b7147903f773492dc0a1596dd9b5d68cefa2d Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 09:28:28 +0100 Subject: [PATCH 121/204] lib: [self-test] add callback functionality Callback set and get functions have been implemented. The new API allows to track self-test progress, algorithms tested and debug potential test failures. --- lib/ipsec-mb.h | 46 ++ lib/libIPSec_MB.def | 2 + lib/x86_64/self_test.c | 1234 ++++++++++++++++++++++------------------ 3 files changed, 721 insertions(+), 561 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index b141a8e9..aecf0475 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -890,6 +890,8 @@ typedef void (*chacha20_hp_quic_t)(const void *, const void *const *, void **, c typedef void (*sm4_keyexp_t)(const void *, void *, void *); +typedef void (*imb_self_test_cb_t)(void *cb_arg, const char *phase, const char *type, + const char *descr); /* Multi-buffer manager flags passed to alloc_mb_mgr() */ #define IMB_FLAG_SHANI_OFF (1ULL << 0) /**< disable use of SHANI extension */ @@ -930,6 +932,17 @@ typedef void (*sm4_keyexp_t)(const void *, void *, void *); #define IMB_FEATURE_SELF_TEST_PASS (1ULL << 21) /* self-test passed */ #define IMB_FEATURE_AVX_IFMA (1ULL << 22) +/** + * Self test defines + */ +#define IMB_SELF_TEST_PHASE_START "START" +#define IMB_SELF_TEST_PHASE_PASS "PASS" +#define IMB_SELF_TEST_PHASE_FAIL "FAIL" + +#define IMB_SELF_TEST_TYPE_KAT_CIPHER "KAT_Cipher" +#define IMB_SELF_TEST_TYPE_KAT_AUTH "KAT_Auth" +#define IMB_SELF_TEST_TYPE_KAT_AEAD "KAT_AEAD" + /** * CPU flags needed for each implementation */ @@ -1123,6 +1136,9 @@ typedef struct IMB_MGR { sm4_keyexp_t sm4_keyexp; + imb_self_test_cb_t self_test_cb_fn; + void *self_test_cb_arg; + /* in-order scheduler fields */ int earliest_job; /**< byte offset, -1 if none */ int next_job; /**< byte offset */ @@ -3908,6 +3924,36 @@ imb_quic_hp_chacha20(IMB_MGR *state, const void *key, void *dst_ptr_array[], IMB_DLL_EXPORT uint32_t imb_set_session(IMB_MGR *state, IMB_JOB *job); +/** + * @brief Sets callback function to be invoked when running a self test. + * + * If \a cb_fn is NULL then self test callback functionality gets disabled. + * + * @param [in] state pointer to IMB_MGR + * @param [in] cb_fn pointer to self test callback function + * @param [in] cb_arg argument to be passed to the callback function \a cb_fn + * + * @return Operation status of \a IMB_ERR type + * @retval 0 on success + */ +IMB_DLL_EXPORT int +imb_self_test_set_cb(IMB_MGR *state, imb_self_test_cb_t cb_fn, void *cb_arg); + +/** + * @brief Retrieves details of callback function to be invoked when running a self test. + * + * It may be useful to check status of self test callback or daisy chain + * a few callbacks together. + * + * @param [in] state pointer to IMB_MGR + * @param [in,out] cb_fn pointer to place pointer to self test callback function + * @param [in,out] cb_arg pointer to place callback function argument + * + * @return Operation status of \a IMB_ERR type + * @retval 0 on success + */ +IMB_DLL_EXPORT int +imb_self_test_get_cb(IMB_MGR *state, imb_self_test_cb_t *cb_fn, void **cb_arg); #ifdef __cplusplus } #endif diff --git a/lib/libIPSec_MB.def b/lib/libIPSec_MB.def index aeab91c4..5cb115d9 100644 --- a/lib/libIPSec_MB.def +++ b/lib/libIPSec_MB.def @@ -712,3 +712,5 @@ EXPORTS sha256_one_block_sse_shani @686 imb_quic_chacha20_poly1305 @687 imb_quic_hp_chacha20 @688 + imb_self_test_set_cb @689 + imb_self_test_get_cb @690 diff --git a/lib/x86_64/self_test.c b/lib/x86_64/self_test.c index 208673d0..57a0bf9f 100644 --- a/lib/x86_64/self_test.c +++ b/lib/x86_64/self_test.c @@ -30,6 +30,52 @@ #include "ipsec-mb.h" #include "arch_x86_64.h" +#include "include/error.h" + +/* + * ============================================================================= + * SELF-TEST CALLBACK + * ============================================================================= + */ +IMB_DLL_EXPORT int +imb_self_test_set_cb(IMB_MGR *p_mgr, imb_self_test_cb_t cb_fn, void *cb_arg) +{ + if (p_mgr == NULL) + return IMB_ERR_NULL_MBMGR; + + p_mgr->self_test_cb_fn = cb_fn; + p_mgr->self_test_cb_arg = cb_arg; + return 0; +} + +IMB_DLL_EXPORT int +imb_self_test_get_cb(IMB_MGR *p_mgr, imb_self_test_cb_t *cb_fn, void **cb_arg) +{ + if (p_mgr == NULL) + return IMB_ERR_NULL_MBMGR; + + if (cb_fn == NULL || cb_arg == NULL) + return EINVAL; + + *cb_fn = p_mgr->self_test_cb_fn; + *cb_arg = p_mgr->self_test_cb_arg; + return 0; +} + +static void +make_callback(IMB_MGR *p_mgr, const char *phase, const char *type, const char *descr) +{ + if (p_mgr->self_test_cb_fn == NULL) + return; + + p_mgr->self_test_cb_fn(p_mgr->self_test_cb_arg, phase, type, descr); +} + +/* + * ============================================================================= + * SELF-TEST EXECUTION + * ============================================================================= + */ #ifndef NO_SELF_TEST_DEV @@ -75,6 +121,7 @@ struct self_test_cipher_vector { const uint8_t *plain_text; size_t plain_text_size; const uint8_t *cipher_text; + const char *description; }; /* @@ -276,38 +323,39 @@ static const uint8_t tdes_ede_cbc_cipher_text[] = { 0xf2, 0x7f, 0x73, 0xae, 0x26, 0xab, 0xbf, 0x74 }; -#define ADD_CIPHER_VECTOR(_cmode, _key, _iv, _plain, _cipher) \ +#define ADD_CIPHER_VECTOR(_cmode, _key, _iv, _plain, _cipher, _descr) \ { \ - _cmode, _key, sizeof(_key), _iv, sizeof(_iv), _plain, sizeof(_plain), _cipher \ + _cmode, _key, sizeof(_key), _iv, sizeof(_iv), _plain, sizeof(_plain), _cipher, \ + _descr \ } -struct self_test_cipher_vector cipher_vectors[] = { +static const struct self_test_cipher_vector cipher_vectors[] = { ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_128_key, aes_cbc_128_iv, aes_cbc_128_plain_text, - aes_cbc_128_cipher_text), + aes_cbc_128_cipher_text, "AES128-CBC"), ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_192_key, aes_cbc_192_iv, aes_cbc_192_plain_text, - aes_cbc_192_cipher_text), + aes_cbc_192_cipher_text, "AES192-CBC"), ADD_CIPHER_VECTOR(IMB_CIPHER_CBC, aes_cbc_256_key, aes_cbc_256_iv, aes_cbc_256_plain_text, - aes_cbc_256_cipher_text), + aes_cbc_256_cipher_text, "AES256-CBC"), ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_128_key, aes_ctr_128_iv, aes_ctr_128_plain_text, - aes_ctr_128_cipher_text), + aes_ctr_128_cipher_text, "AES128-CTR"), ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_192_key, aes_ctr_192_iv, aes_ctr_192_plain_text, - aes_ctr_192_cipher_text), + aes_ctr_192_cipher_text, "AES192-CTR"), ADD_CIPHER_VECTOR(IMB_CIPHER_CNTR, aes_ctr_256_key, aes_ctr_256_iv, aes_ctr_256_plain_text, - aes_ctr_256_cipher_text), + aes_ctr_256_cipher_text, "AES256-CTR"), ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_128_key, null_iv, aes_ecb_128_plain_text, - aes_ecb_128_cipher_text), + aes_ecb_128_cipher_text, "AES128-ECB"), ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_192_key, null_iv, aes_ecb_192_plain_text, - aes_ecb_192_cipher_text), + aes_ecb_192_cipher_text, "AES192-ECB"), ADD_CIPHER_VECTOR(IMB_CIPHER_ECB, aes_ecb_256_key, null_iv, aes_ecb_256_plain_text, - aes_ecb_256_cipher_text), + aes_ecb_256_cipher_text, "AES256-ECB"), ADD_CIPHER_VECTOR(IMB_CIPHER_DES3, tdes_ede_cbc_key, tdes_ede_cbc_iv, - tdes_ede_cbc_plain_text, tdes_ede_cbc_cipher_text), + tdes_ede_cbc_plain_text, tdes_ede_cbc_cipher_text, "TDES-EDE-CBC"), }; #define DES_KEY_SCHED_WORDS (IMB_DES_KEY_SCHED_SIZE / sizeof(uint64_t)) static int -self_test_ciphers(IMB_MGR *p_mgr) +self_test_cipher(IMB_MGR *p_mgr, const struct self_test_cipher_vector *v) { union { struct { @@ -322,124 +370,141 @@ self_test_ciphers(IMB_MGR *p_mgr) } tdes; } ks; uint8_t scratch[256]; - unsigned i; - - while (IMB_FLUSH_JOB(p_mgr) != NULL) - ; - for (i = 0; i < IMB_DIM(cipher_vectors); i++) { - struct self_test_cipher_vector *v = &cipher_vectors[i]; + IMB_ASSERT(v->plain_text_size <= sizeof(scratch)); - IMB_ASSERT(v->plain_text_size <= sizeof(scratch)); + /* message too long */ + if (v->plain_text_size > sizeof(scratch)) + return 0; - /* message too long */ - if (v->plain_text_size > sizeof(scratch)) + if (v->cipher_mode == IMB_CIPHER_DES3) { + if (v->cipher_key_size != IMB_KEY_192_BYTES) { + /* invalid key size */ return 0; - - if (v->cipher_mode == IMB_CIPHER_DES3) { - if (v->cipher_key_size != IMB_KEY_192_BYTES) { - /* invalid key size */ - return 0; - } - des_key_schedule(ks.tdes.key_sched1, &v->cipher_key[0]); - des_key_schedule(ks.tdes.key_sched2, &v->cipher_key[8]); - des_key_schedule(ks.tdes.key_sched3, &v->cipher_key[16]); - ks.tdes.keys[0] = ks.tdes.key_sched1; - ks.tdes.keys[1] = ks.tdes.key_sched2; - ks.tdes.keys[2] = ks.tdes.key_sched3; - } else { - switch (v->cipher_key_size) { - case IMB_KEY_128_BYTES: - IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, ks.aes.expkey_enc, - ks.aes.expkey_dec); - break; - case IMB_KEY_192_BYTES: - IMB_AES_KEYEXP_192(p_mgr, v->cipher_key, ks.aes.expkey_enc, - ks.aes.expkey_dec); - break; - case IMB_KEY_256_BYTES: - IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, ks.aes.expkey_enc, - ks.aes.expkey_dec); - break; - default: - /* invalid key size */ - return 0; - } } - - /* test encrypt direction */ - IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); - - job->hash_alg = IMB_AUTH_NULL; - job->cipher_direction = IMB_DIR_ENCRYPT; - job->chain_order = IMB_ORDER_CIPHER_HASH; - job->src = v->plain_text; - job->dst = scratch; - job->cipher_mode = v->cipher_mode; - if (v->cipher_mode == IMB_CIPHER_DES3) { - job->enc_keys = ks.tdes.keys; - } else { - job->enc_keys = ks.aes.expkey_enc; - if (v->cipher_mode != IMB_CIPHER_CNTR) - job->dec_keys = ks.aes.expkey_dec; - } - job->key_len_in_bytes = v->cipher_key_size; - if (v->cipher_mode != IMB_CIPHER_ECB) { - job->iv = v->cipher_iv; - job->iv_len_in_bytes = v->cipher_iv_size; + des_key_schedule(ks.tdes.key_sched1, &v->cipher_key[0]); + des_key_schedule(ks.tdes.key_sched2, &v->cipher_key[8]); + des_key_schedule(ks.tdes.key_sched3, &v->cipher_key[16]); + ks.tdes.keys[0] = ks.tdes.key_sched1; + ks.tdes.keys[1] = ks.tdes.key_sched2; + ks.tdes.keys[2] = ks.tdes.key_sched3; + } else { + switch (v->cipher_key_size) { + case IMB_KEY_128_BYTES: + IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, ks.aes.expkey_enc, + ks.aes.expkey_dec); + break; + case IMB_KEY_192_BYTES: + IMB_AES_KEYEXP_192(p_mgr, v->cipher_key, ks.aes.expkey_enc, + ks.aes.expkey_dec); + break; + case IMB_KEY_256_BYTES: + IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, ks.aes.expkey_enc, + ks.aes.expkey_dec); + break; + default: + /* invalid key size */ + return 0; } - job->cipher_start_src_offset_in_bytes = 0; - job->msg_len_to_cipher_in_bytes = v->plain_text_size; + } - memset(scratch, 0, sizeof(scratch)); + /* test encrypt direction */ + IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); + + job->hash_alg = IMB_AUTH_NULL; + job->cipher_direction = IMB_DIR_ENCRYPT; + job->chain_order = IMB_ORDER_CIPHER_HASH; + job->src = v->plain_text; + job->dst = scratch; + job->cipher_mode = v->cipher_mode; + if (v->cipher_mode == IMB_CIPHER_DES3) { + job->enc_keys = ks.tdes.keys; + } else { + job->enc_keys = ks.aes.expkey_enc; + if (v->cipher_mode != IMB_CIPHER_CNTR) + job->dec_keys = ks.aes.expkey_dec; + } + job->key_len_in_bytes = v->cipher_key_size; + if (v->cipher_mode != IMB_CIPHER_ECB) { + job->iv = v->cipher_iv; + job->iv_len_in_bytes = v->cipher_iv_size; + } + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = v->plain_text_size; - /* submit job and get it processed */ - if (!process_job(p_mgr)) - return 0; + memset(scratch, 0, sizeof(scratch)); - /* check for cipher text mismatch */ - if (memcmp(scratch, v->cipher_text, v->plain_text_size)) - return 0; + /* submit job and get it processed */ + if (!process_job(p_mgr)) + return 0; - /* test decrypt direction */ - job = IMB_GET_NEXT_JOB(p_mgr); - - job->hash_alg = IMB_AUTH_NULL; - job->cipher_direction = IMB_DIR_DECRYPT; - job->chain_order = IMB_ORDER_HASH_CIPHER; - job->src = v->cipher_text; - job->dst = scratch; - job->cipher_mode = v->cipher_mode; - if (v->cipher_mode == IMB_CIPHER_DES3) { - job->dec_keys = ks.tdes.keys; - } else { - job->dec_keys = ks.aes.expkey_dec; - if (v->cipher_mode == IMB_CIPHER_CNTR) - job->enc_keys = ks.aes.expkey_enc; - } - job->key_len_in_bytes = v->cipher_key_size; - if (v->cipher_mode != IMB_CIPHER_ECB) { - job->iv = v->cipher_iv; - job->iv_len_in_bytes = v->cipher_iv_size; - } - job->cipher_start_src_offset_in_bytes = 0; - job->msg_len_to_cipher_in_bytes = v->plain_text_size; + /* check for cipher text mismatch */ + if (memcmp(scratch, v->cipher_text, v->plain_text_size)) + return 0; - memset(scratch, 0, sizeof(scratch)); + /* test decrypt direction */ + job = IMB_GET_NEXT_JOB(p_mgr); + + job->hash_alg = IMB_AUTH_NULL; + job->cipher_direction = IMB_DIR_DECRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + job->src = v->cipher_text; + job->dst = scratch; + job->cipher_mode = v->cipher_mode; + if (v->cipher_mode == IMB_CIPHER_DES3) { + job->dec_keys = ks.tdes.keys; + } else { + job->dec_keys = ks.aes.expkey_dec; + if (v->cipher_mode == IMB_CIPHER_CNTR) + job->enc_keys = ks.aes.expkey_enc; + } + job->key_len_in_bytes = v->cipher_key_size; + if (v->cipher_mode != IMB_CIPHER_ECB) { + job->iv = v->cipher_iv; + job->iv_len_in_bytes = v->cipher_iv_size; + } + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = v->plain_text_size; - /* submit job and get it processed */ - if (!process_job(p_mgr)) - return 0; + memset(scratch, 0, sizeof(scratch)); - /* check for plain text mismatch */ - if (memcmp(scratch, v->plain_text, v->plain_text_size)) - return 0; + /* submit job and get it processed */ + if (!process_job(p_mgr)) + return 0; - } /* for(cipher_vectors) */ + /* check for plain text mismatch */ + if (memcmp(scratch, v->plain_text, v->plain_text_size)) + return 0; return 1; } +static int +self_test_ciphers(IMB_MGR *p_mgr) +{ + int ret = 1; + + while (IMB_FLUSH_JOB(p_mgr) != NULL) + ; + + for (unsigned i = 0; i < IMB_DIM(cipher_vectors); i++) { + const struct self_test_cipher_vector *v = &cipher_vectors[i]; + + make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_CIPHER, + v->description); + const int r = self_test_cipher(p_mgr, v); + + if (r == 0) { + ret = 0; + make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + } else { + make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + } + } + + return ret; +} + /* * ============================================================================= * HASH SELF-TEST @@ -456,6 +521,7 @@ struct self_test_hash_vector { size_t tag_size; const uint8_t *hash_iv; /* gmac */ size_t hash_iv_size; + const char *description; }; /* @@ -496,9 +562,9 @@ const uint8_t sha512_digest[] = { 0x20, 0x4a, 0x8f, 0xc6, 0xdd, 0xa8, 0x2f, 0x0a 0x57, 0x78, 0x9c, 0xa0, 0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7, 0x03, 0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45 }; -#define ADD_SHA_VECTOR(_hmode, _msg, _digest) \ +#define ADD_SHA_VECTOR(_hmode, _msg, _digest, _descr) \ { \ - _hmode, NULL, 0, _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0 \ + _hmode, NULL, 0, _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0, _descr \ } /* @@ -605,9 +671,10 @@ static const uint8_t hmac_sha512_digest[] = { 0xfc, 0x25, 0xe2, 0x40, 0x65, 0x8c 0x48, 0xcf, 0xa2, 0x6a, 0x8a, 0x36, 0x6b, 0xf2, 0xcd, 0x1f, 0x83, 0x6b, 0x05, 0xfc, 0xb0, 0x24 }; -#define ADD_HMAC_SHA_VECTOR(_hmode, _key, _msg, _digest) \ +#define ADD_HMAC_SHA_VECTOR(_hmode, _key, _msg, _digest, _descr) \ { \ - _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0 \ + _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0, \ + _descr \ } /* @@ -631,9 +698,10 @@ static const uint8_t aes_cmac_256_message[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x static const uint8_t aes_cmac_256_tag[] = { 0x15, 0x67, 0x27, 0xDC, 0x08, 0x78, 0x94, 0x4A, 0x02, 0x3C, 0x1F, 0xE0, 0x3B, 0xAD, 0x6D, 0x93 }; -#define ADD_CMAC_VECTOR(_hmode, _key, _msg, _digest) \ +#define ADD_CMAC_VECTOR(_hmode, _key, _msg, _digest, _descr) \ { \ - _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0 \ + _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _digest, sizeof(_digest), NULL, 0, \ + _descr \ } /* @@ -687,42 +755,42 @@ static const uint8_t aes_gmac_256_message[] = { static const uint8_t aes_gmac_256_tag[] = { 0x77, 0x46, 0x0D, 0x6F, 0xB1, 0x87, 0xDB, 0xA9, 0x46, 0xAD, 0xCD, 0xFB, 0xB7, 0xF9, 0x13, 0xA1 }; -#define ADD_GMAC_VECTOR(_hmode, _key, _iv, _msg, _tag) \ +#define ADD_GMAC_VECTOR(_hmode, _key, _iv, _msg, _tag, _descr) \ { \ _hmode, _key, sizeof(_key), _msg, sizeof(_msg), _tag, sizeof(_tag), _iv, \ - sizeof(_iv) \ + sizeof(_iv), _descr \ } -struct self_test_hash_vector hash_vectors[] = { - ADD_SHA_VECTOR(IMB_AUTH_SHA_1, sha_message, sha1_digest), - ADD_SHA_VECTOR(IMB_AUTH_SHA_224, sha_message, sha224_digest), - ADD_SHA_VECTOR(IMB_AUTH_SHA_256, sha_message, sha256_digest), - ADD_SHA_VECTOR(IMB_AUTH_SHA_384, sha_message, sha384_digest), - ADD_SHA_VECTOR(IMB_AUTH_SHA_512, sha_message, sha512_digest), - ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_1, hmac_sha1_key, hmac_sha1_message, - hmac_sha1_digest), +static const struct self_test_hash_vector hash_vectors[] = { + ADD_SHA_VECTOR(IMB_AUTH_SHA_1, sha_message, sha1_digest, "SHA1"), + ADD_SHA_VECTOR(IMB_AUTH_SHA_224, sha_message, sha224_digest, "SHA2-224"), + ADD_SHA_VECTOR(IMB_AUTH_SHA_256, sha_message, sha256_digest, "SHA2-256"), + ADD_SHA_VECTOR(IMB_AUTH_SHA_384, sha_message, sha384_digest, "SHA2-384"), + ADD_SHA_VECTOR(IMB_AUTH_SHA_512, sha_message, sha512_digest, "SHA2-512"), + ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_1, hmac_sha1_key, hmac_sha1_message, hmac_sha1_digest, + "HMAC-SHA1"), ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_224, hmac_sha224_key, hmac_sha224_message, - hmac_sha224_digest), + hmac_sha224_digest, "HMAC-SHA2-224"), ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_256, hmac_sha256_key, hmac_sha256_message, - hmac_sha256_digest), + hmac_sha256_digest, "HMAC-SHA2-256"), ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_384, hmac_sha384_key, hmac_sha384_message, - hmac_sha384_digest), + hmac_sha384_digest, "HMAC-SHA2-384"), ADD_HMAC_SHA_VECTOR(IMB_AUTH_HMAC_SHA_512, hmac_sha512_key, hmac_sha512_message, - hmac_sha512_digest), - ADD_CMAC_VECTOR(IMB_AUTH_AES_CMAC, aes_cmac_128_key, aes_cmac_128_message, - aes_cmac_128_tag), + hmac_sha512_digest, "HMAC-SHA2-512"), + ADD_CMAC_VECTOR(IMB_AUTH_AES_CMAC, aes_cmac_128_key, aes_cmac_128_message, aes_cmac_128_tag, + "AES128-CMAC"), ADD_CMAC_VECTOR(IMB_AUTH_AES_CMAC_256, aes_cmac_256_key, aes_cmac_256_message, - aes_cmac_256_tag), + aes_cmac_256_tag, "AES256-CMAC"), ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_128, aes_gmac_128_key, aes_gmac_128_iv, - aes_gmac_128_message, aes_gmac_128_tag), + aes_gmac_128_message, aes_gmac_128_tag, "AES128-GMAC"), ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_192, aes_gmac_192_key, aes_gmac_192_iv, - aes_gmac_192_message, aes_gmac_192_tag), + aes_gmac_192_message, aes_gmac_192_tag, "AES192-GMAC"), ADD_GMAC_VECTOR(IMB_AUTH_AES_GMAC_256, aes_gmac_256_key, aes_gmac_256_iv, - aes_gmac_256_message, aes_gmac_256_tag), + aes_gmac_256_message, aes_gmac_256_tag, "AES256-GMAC"), }; static int -self_test_hash(IMB_MGR *p_mgr) +self_test_hash(IMB_MGR *p_mgr, const struct self_test_hash_vector *v) { /* hmac */ DECLARE_ALIGNED(uint8_t hmac_ipad[IMB_SHA512_DIGEST_SIZE_IN_BYTES], 16); @@ -735,156 +803,174 @@ self_test_hash(IMB_MGR *p_mgr) struct gcm_key_data gmac_key; /* all */ uint8_t scratch[IMB_SHA_512_BLOCK_SIZE]; - unsigned i; - while (IMB_FLUSH_JOB(p_mgr) != NULL) - ; + IMB_ASSERT(v->tag_size <= sizeof(scratch)); - for (i = 0; i < IMB_DIM(hash_vectors); i++) { - struct self_test_hash_vector *v = &hash_vectors[i]; + /* tag too long */ + if (v->tag_size > sizeof(scratch)) + return 0; - IMB_ASSERT(v->tag_size <= sizeof(scratch)); + /* test JOB API */ + IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); + + job->hash_alg = v->hash_mode; + job->cipher_mode = IMB_CIPHER_NULL; + job->cipher_direction = IMB_DIR_ENCRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + job->src = v->message; + job->hash_start_src_offset_in_bytes = 0; + job->msg_len_to_hash_in_bytes = v->message_size; + job->auth_tag_output = scratch; + job->auth_tag_output_len_in_bytes = v->tag_size; + if (v->hash_mode >= IMB_AUTH_HMAC_SHA_1 && v->hash_mode <= IMB_AUTH_HMAC_SHA_512) { + imb_hmac_ipad_opad(p_mgr, v->hash_mode, v->hash_key, v->hash_key_size, hmac_ipad, + hmac_opad); + job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; + job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; + } + if (v->hash_mode == IMB_AUTH_AES_CMAC) { + IMB_AES_KEYEXP_128(p_mgr, v->hash_key, expkey, dust); + IMB_AES_CMAC_SUBKEY_GEN_128(p_mgr, expkey, skey1, skey2); + job->u.CMAC._key_expanded = expkey; + job->u.CMAC._skey1 = skey1; + job->u.CMAC._skey2 = skey2; + } - /* tag too long */ - if (v->tag_size > sizeof(scratch)) - return 0; + if (v->hash_mode == IMB_AUTH_AES_CMAC_256) { + IMB_AES_KEYEXP_256(p_mgr, v->hash_key, expkey, dust); + IMB_AES_CMAC_SUBKEY_GEN_256(p_mgr, expkey, skey1, skey2); + job->u.CMAC._key_expanded = expkey; + job->u.CMAC._skey1 = skey1; + job->u.CMAC._skey2 = skey2; + } - /* test JOB API */ - IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); - - job->hash_alg = v->hash_mode; - job->cipher_mode = IMB_CIPHER_NULL; - job->cipher_direction = IMB_DIR_ENCRYPT; - job->chain_order = IMB_ORDER_HASH_CIPHER; - job->src = v->message; - job->hash_start_src_offset_in_bytes = 0; - job->msg_len_to_hash_in_bytes = v->message_size; - job->auth_tag_output = scratch; - job->auth_tag_output_len_in_bytes = v->tag_size; - if (v->hash_mode >= IMB_AUTH_HMAC_SHA_1 && v->hash_mode <= IMB_AUTH_HMAC_SHA_512) { - imb_hmac_ipad_opad(p_mgr, v->hash_mode, v->hash_key, v->hash_key_size, - hmac_ipad, hmac_opad); - job->u.HMAC._hashed_auth_key_xor_ipad = hmac_ipad; - job->u.HMAC._hashed_auth_key_xor_opad = hmac_opad; - } - if (v->hash_mode == IMB_AUTH_AES_CMAC) { - IMB_AES_KEYEXP_128(p_mgr, v->hash_key, expkey, dust); - IMB_AES_CMAC_SUBKEY_GEN_128(p_mgr, expkey, skey1, skey2); - job->u.CMAC._key_expanded = expkey; - job->u.CMAC._skey1 = skey1; - job->u.CMAC._skey2 = skey2; - } + if (v->hash_mode == IMB_AUTH_AES_GMAC_128) { + IMB_AES128_GCM_PRE(p_mgr, v->hash_key, &gmac_key); + job->u.GMAC._key = &gmac_key; + job->u.GMAC._iv = v->hash_iv; + job->u.GMAC.iv_len_in_bytes = v->hash_iv_size; + } - if (v->hash_mode == IMB_AUTH_AES_CMAC_256) { - IMB_AES_KEYEXP_256(p_mgr, v->hash_key, expkey, dust); - IMB_AES_CMAC_SUBKEY_GEN_256(p_mgr, expkey, skey1, skey2); - job->u.CMAC._key_expanded = expkey; - job->u.CMAC._skey1 = skey1; - job->u.CMAC._skey2 = skey2; - } + if (v->hash_mode == IMB_AUTH_AES_GMAC_192) { + IMB_AES192_GCM_PRE(p_mgr, v->hash_key, &gmac_key); + job->u.GMAC._key = &gmac_key; + job->u.GMAC._iv = v->hash_iv; + job->u.GMAC.iv_len_in_bytes = v->hash_iv_size; + } - if (v->hash_mode == IMB_AUTH_AES_GMAC_128) { - IMB_AES128_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - job->u.GMAC._key = &gmac_key; - job->u.GMAC._iv = v->hash_iv; - job->u.GMAC.iv_len_in_bytes = v->hash_iv_size; - } + if (v->hash_mode == IMB_AUTH_AES_GMAC_256) { + IMB_AES256_GCM_PRE(p_mgr, v->hash_key, &gmac_key); + job->u.GMAC._key = &gmac_key; + job->u.GMAC._iv = v->hash_iv; + job->u.GMAC.iv_len_in_bytes = v->hash_iv_size; + } - if (v->hash_mode == IMB_AUTH_AES_GMAC_192) { - IMB_AES192_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - job->u.GMAC._key = &gmac_key; - job->u.GMAC._iv = v->hash_iv; - job->u.GMAC.iv_len_in_bytes = v->hash_iv_size; - } + /* clear space where computed TAG is put into */ + memset(scratch, 0, sizeof(scratch)); - if (v->hash_mode == IMB_AUTH_AES_GMAC_256) { - IMB_AES256_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - job->u.GMAC._key = &gmac_key; - job->u.GMAC._iv = v->hash_iv; - job->u.GMAC.iv_len_in_bytes = v->hash_iv_size; - } + /* submit job and get it processed */ + if (!process_job(p_mgr)) + return 0; + + /* check for TAG mismatch */ + if (memcmp(scratch, v->tag, v->tag_size)) + return 0; + + /* exercise direct API test if available */ + memset(scratch, 0, sizeof(scratch)); - /* clear space where computed TAG is put into */ + if (v->hash_mode == IMB_AUTH_SHA_1) { memset(scratch, 0, sizeof(scratch)); + IMB_SHA1(p_mgr, v->message, v->message_size, scratch); + if (memcmp(scratch, v->tag, v->tag_size)) + return 0; + } + if (v->hash_mode == IMB_AUTH_SHA_224) { + memset(scratch, 0, sizeof(scratch)); + IMB_SHA224(p_mgr, v->message, v->message_size, scratch); + if (memcmp(scratch, v->tag, v->tag_size)) + return 0; + } + if (v->hash_mode == IMB_AUTH_SHA_256) { + memset(scratch, 0, sizeof(scratch)); + IMB_SHA256(p_mgr, v->message, v->message_size, scratch); + if (memcmp(scratch, v->tag, v->tag_size)) + return 0; + } + if (v->hash_mode == IMB_AUTH_SHA_384) { + memset(scratch, 0, sizeof(scratch)); + IMB_SHA384(p_mgr, v->message, v->message_size, scratch); + if (memcmp(scratch, v->tag, v->tag_size)) + return 0; + } + if (v->hash_mode == IMB_AUTH_SHA_512) { + memset(scratch, 0, sizeof(scratch)); + IMB_SHA512(p_mgr, v->message, v->message_size, scratch); + if (memcmp(scratch, v->tag, v->tag_size)) + return 0; + } + if (v->hash_mode == IMB_AUTH_AES_GMAC_128) { + struct gcm_context_data ctx; - /* submit job and get it processed */ - if (!process_job(p_mgr)) + memset(scratch, 0, sizeof(scratch)); + IMB_AES128_GCM_PRE(p_mgr, v->hash_key, &gmac_key); + IMB_AES128_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); + IMB_AES128_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); + IMB_AES128_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); + if (memcmp(scratch, v->tag, v->tag_size)) return 0; + } + if (v->hash_mode == IMB_AUTH_AES_GMAC_192) { + struct gcm_context_data ctx; - /* check for TAG mismatch */ + memset(scratch, 0, sizeof(scratch)); + IMB_AES192_GCM_PRE(p_mgr, v->hash_key, &gmac_key); + IMB_AES192_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); + IMB_AES192_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); + IMB_AES192_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); if (memcmp(scratch, v->tag, v->tag_size)) return 0; + } + if (v->hash_mode == IMB_AUTH_AES_GMAC_256) { + struct gcm_context_data ctx; - /* exercise direct API test if available */ memset(scratch, 0, sizeof(scratch)); + IMB_AES256_GCM_PRE(p_mgr, v->hash_key, &gmac_key); + IMB_AES256_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); + IMB_AES256_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); + IMB_AES256_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); + if (memcmp(scratch, v->tag, v->tag_size)) + return 0; + } - if (v->hash_mode == IMB_AUTH_SHA_1) { - memset(scratch, 0, sizeof(scratch)); - IMB_SHA1(p_mgr, v->message, v->message_size, scratch); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } - if (v->hash_mode == IMB_AUTH_SHA_224) { - memset(scratch, 0, sizeof(scratch)); - IMB_SHA224(p_mgr, v->message, v->message_size, scratch); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } - if (v->hash_mode == IMB_AUTH_SHA_256) { - memset(scratch, 0, sizeof(scratch)); - IMB_SHA256(p_mgr, v->message, v->message_size, scratch); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } - if (v->hash_mode == IMB_AUTH_SHA_384) { - memset(scratch, 0, sizeof(scratch)); - IMB_SHA384(p_mgr, v->message, v->message_size, scratch); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } - if (v->hash_mode == IMB_AUTH_SHA_512) { - memset(scratch, 0, sizeof(scratch)); - IMB_SHA512(p_mgr, v->message, v->message_size, scratch); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } - if (v->hash_mode == IMB_AUTH_AES_GMAC_128) { - struct gcm_context_data ctx; - - memset(scratch, 0, sizeof(scratch)); - IMB_AES128_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - IMB_AES128_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); - IMB_AES128_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); - IMB_AES128_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } - if (v->hash_mode == IMB_AUTH_AES_GMAC_192) { - struct gcm_context_data ctx; - - memset(scratch, 0, sizeof(scratch)); - IMB_AES192_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - IMB_AES192_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); - IMB_AES192_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); - IMB_AES192_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } - if (v->hash_mode == IMB_AUTH_AES_GMAC_256) { - struct gcm_context_data ctx; - - memset(scratch, 0, sizeof(scratch)); - IMB_AES256_GCM_PRE(p_mgr, v->hash_key, &gmac_key); - IMB_AES256_GMAC_INIT(p_mgr, &gmac_key, &ctx, v->hash_iv, v->hash_iv_size); - IMB_AES256_GMAC_UPDATE(p_mgr, &gmac_key, &ctx, v->message, v->message_size); - IMB_AES256_GMAC_FINALIZE(p_mgr, &gmac_key, &ctx, scratch, v->tag_size); - if (memcmp(scratch, v->tag, v->tag_size)) - return 0; - } + return 1; +} - } /* for(hash_vectors) */ +static int +self_test_hashes(IMB_MGR *p_mgr) +{ + int ret = 1; - return 1; + while (IMB_FLUSH_JOB(p_mgr) != NULL) + ; + + for (unsigned i = 0; i < IMB_DIM(hash_vectors); i++) { + const struct self_test_hash_vector *v = &hash_vectors[i]; + + make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AUTH, + v->description); + + const int r = self_test_hash(p_mgr, v); + + if (r == 0) { + ret = 0; + make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + } else { + make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + } + } + + return ret; } /* @@ -893,7 +979,7 @@ self_test_hash(IMB_MGR *p_mgr) * ============================================================================= */ -struct self_test_gcm_vector { +struct self_test_aead_gcm_vector { IMB_HASH_ALG hash_mode; IMB_CIPHER_MODE cipher_mode; const uint8_t *cipher_key; @@ -907,6 +993,7 @@ struct self_test_gcm_vector { const uint8_t *cipher_text; const uint8_t *tag; size_t tag_size; + const char *description; }; /* @@ -982,209 +1069,200 @@ static const uint8_t aes_gcm_256_cipher_text[] = { static const uint8_t aes_gcm_256_tag[] = { 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b }; -#define ADD_GCM_VECTOR(_key, _iv, _aad, _plain, _cipher, _tag) \ +#define ADD_GCM_VECTOR(_key, _iv, _aad, _plain, _cipher, _tag, _descr) \ { \ IMB_AUTH_AES_GMAC, IMB_CIPHER_GCM, _key, sizeof(_key), _iv, sizeof(_iv), _aad, \ - sizeof(_aad), _plain, sizeof(_plain), _cipher, _tag, sizeof(_tag) \ + sizeof(_aad), _plain, sizeof(_plain), _cipher, _tag, sizeof(_tag), _descr \ } -struct self_test_gcm_vector aead_gcm_vectors[] = { +static const struct self_test_aead_gcm_vector aead_gcm_vectors[] = { ADD_GCM_VECTOR(aes_gcm_128_key, aes_gcm_128_iv, aes_gcm_128_aad, aes_gcm_128_plain_text, - aes_gcm_128_cipher_text, aes_gcm_128_tag), + aes_gcm_128_cipher_text, aes_gcm_128_tag, "AES128-GCM"), ADD_GCM_VECTOR(aes_gcm_192_key, aes_gcm_192_iv, aes_gcm_192_aad, aes_gcm_192_plain_text, - aes_gcm_192_cipher_text, aes_gcm_192_tag), + aes_gcm_192_cipher_text, aes_gcm_192_tag, "AES192-GCM"), ADD_GCM_VECTOR(aes_gcm_256_key, aes_gcm_256_iv, aes_gcm_256_aad, aes_gcm_256_plain_text, - aes_gcm_256_cipher_text, aes_gcm_256_tag) + aes_gcm_256_cipher_text, aes_gcm_256_tag, "AES256-GCM") }; static int -self_test_aead_gcm(IMB_MGR *p_mgr) +self_test_aead_gcm(IMB_MGR *p_mgr, const struct self_test_aead_gcm_vector *v) { struct gcm_key_data gcm_key; struct gcm_context_data ctx; uint8_t text[128], tag[16]; - unsigned i; - - while (IMB_FLUSH_JOB(p_mgr) != NULL) - ; - - for (i = 0; i < IMB_DIM(aead_gcm_vectors); i++) { - struct self_test_gcm_vector *v = &aead_gcm_vectors[i]; - IMB_ASSERT(v->tag_size <= sizeof(tag)); - IMB_ASSERT(v->plain_text_size <= sizeof(text)); - - /* tag too long */ - if (v->tag_size > sizeof(tag)) - return 0; - - /* message too long */ - if (v->plain_text_size > sizeof(text)) - return 0; - - switch (v->cipher_key_size) { - case IMB_KEY_128_BYTES: - IMB_AES128_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); - break; - case IMB_KEY_192_BYTES: - IMB_AES192_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); - break; - case IMB_KEY_256_BYTES: - IMB_AES256_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); - break; - default: - return 0; - } + IMB_ASSERT(v->tag_size <= sizeof(tag)); + IMB_ASSERT(v->plain_text_size <= sizeof(text)); - /* test JOB API */ - IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); - - /* encrypt test */ - job->cipher_mode = v->cipher_mode; - job->cipher_direction = IMB_DIR_ENCRYPT; - job->chain_order = IMB_ORDER_CIPHER_HASH; - job->key_len_in_bytes = v->cipher_key_size; - job->src = v->plain_text; - job->dst = text; - job->msg_len_to_cipher_in_bytes = v->plain_text_size; - job->cipher_start_src_offset_in_bytes = UINT64_C(0); - job->iv = v->cipher_iv; - job->iv_len_in_bytes = v->cipher_iv_size; - job->auth_tag_output = tag; - job->auth_tag_output_len_in_bytes = v->tag_size; - job->hash_alg = v->hash_mode; - job->enc_keys = &gcm_key; - job->dec_keys = &gcm_key; - job->u.GCM.aad = v->aad; - job->u.GCM.aad_len_in_bytes = v->aad_size; - - memset(text, 0, sizeof(text)); - memset(tag, 0, sizeof(tag)); - - /* submit job and get it processed */ - if (!process_job(p_mgr)) - return 0; + /* tag too long */ + if (v->tag_size > sizeof(tag)) + return 0; - /* check for TAG mismatch */ - if (memcmp(tag, v->tag, v->tag_size)) - return 0; + /* message too long */ + if (v->plain_text_size > sizeof(text)) + return 0; - /* check for text mismatch */ - if (memcmp(text, v->cipher_text, v->plain_text_size)) - return 0; + switch (v->cipher_key_size) { + case IMB_KEY_128_BYTES: + IMB_AES128_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); + break; + case IMB_KEY_192_BYTES: + IMB_AES192_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); + break; + case IMB_KEY_256_BYTES: + IMB_AES256_GCM_PRE(p_mgr, v->cipher_key, &gcm_key); + break; + default: + return 0; + } - /* decrypt test */ - job = IMB_GET_NEXT_JOB(p_mgr); - - job->cipher_mode = v->cipher_mode; - job->cipher_direction = IMB_DIR_DECRYPT; - job->chain_order = IMB_ORDER_HASH_CIPHER; - job->key_len_in_bytes = v->cipher_key_size; - job->src = v->cipher_text; - job->dst = text; - job->msg_len_to_cipher_in_bytes = v->plain_text_size; - job->cipher_start_src_offset_in_bytes = UINT64_C(0); - job->iv = v->cipher_iv; - job->iv_len_in_bytes = v->cipher_iv_size; - job->auth_tag_output = tag; - job->auth_tag_output_len_in_bytes = v->tag_size; - job->hash_alg = v->hash_mode; - job->enc_keys = &gcm_key; - job->dec_keys = &gcm_key; - job->u.GCM.aad = v->aad; - job->u.GCM.aad_len_in_bytes = v->aad_size; - - memset(text, 0, sizeof(text)); - memset(tag, 0, sizeof(tag)); - - /* submit job and get it processed */ - if (!process_job(p_mgr)) - return 0; + /* test JOB API */ + IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); + + /* encrypt test */ + job->cipher_mode = v->cipher_mode; + job->cipher_direction = IMB_DIR_ENCRYPT; + job->chain_order = IMB_ORDER_CIPHER_HASH; + job->key_len_in_bytes = v->cipher_key_size; + job->src = v->plain_text; + job->dst = text; + job->msg_len_to_cipher_in_bytes = v->plain_text_size; + job->cipher_start_src_offset_in_bytes = UINT64_C(0); + job->iv = v->cipher_iv; + job->iv_len_in_bytes = v->cipher_iv_size; + job->auth_tag_output = tag; + job->auth_tag_output_len_in_bytes = v->tag_size; + job->hash_alg = v->hash_mode; + job->enc_keys = &gcm_key; + job->dec_keys = &gcm_key; + job->u.GCM.aad = v->aad; + job->u.GCM.aad_len_in_bytes = v->aad_size; + + memset(text, 0, sizeof(text)); + memset(tag, 0, sizeof(tag)); + + /* submit job and get it processed */ + if (!process_job(p_mgr)) + return 0; - /* check for TAG mismatch */ - if (memcmp(tag, v->tag, v->tag_size)) - return 0; + /* check for TAG mismatch */ + if (memcmp(tag, v->tag, v->tag_size)) + return 0; - /* check for text mismatch */ - if (memcmp(text, v->plain_text, v->plain_text_size)) - return 0; + /* check for text mismatch */ + if (memcmp(text, v->cipher_text, v->plain_text_size)) + return 0; - /* test direct API */ + /* decrypt test */ + job = IMB_GET_NEXT_JOB(p_mgr); + + job->cipher_mode = v->cipher_mode; + job->cipher_direction = IMB_DIR_DECRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + job->key_len_in_bytes = v->cipher_key_size; + job->src = v->cipher_text; + job->dst = text; + job->msg_len_to_cipher_in_bytes = v->plain_text_size; + job->cipher_start_src_offset_in_bytes = UINT64_C(0); + job->iv = v->cipher_iv; + job->iv_len_in_bytes = v->cipher_iv_size; + job->auth_tag_output = tag; + job->auth_tag_output_len_in_bytes = v->tag_size; + job->hash_alg = v->hash_mode; + job->enc_keys = &gcm_key; + job->dec_keys = &gcm_key; + job->u.GCM.aad = v->aad; + job->u.GCM.aad_len_in_bytes = v->aad_size; + + memset(text, 0, sizeof(text)); + memset(tag, 0, sizeof(tag)); + + /* submit job and get it processed */ + if (!process_job(p_mgr)) + return 0; - /* encrypt direction */ - memset(text, 0, sizeof(text)); - memset(tag, 0, sizeof(tag)); + /* check for TAG mismatch */ + if (memcmp(tag, v->tag, v->tag_size)) + return 0; - switch (v->cipher_key_size) { - case IMB_KEY_128_BYTES: - IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, - v->cipher_iv_size, v->aad, v->aad_size); - IMB_AES128_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, - v->plain_text_size); - IMB_AES128_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); - break; - case IMB_KEY_192_BYTES: - IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, - v->cipher_iv_size, v->aad, v->aad_size); - IMB_AES192_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, - v->plain_text_size); - IMB_AES192_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); - break; - case IMB_KEY_256_BYTES: - IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, - v->cipher_iv_size, v->aad, v->aad_size); - IMB_AES256_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, - v->plain_text_size); - IMB_AES256_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); - break; - default: - return 0; - } - /* check for TAG mismatch */ - if (memcmp(tag, v->tag, v->tag_size)) - return 0; + /* check for text mismatch */ + if (memcmp(text, v->plain_text, v->plain_text_size)) + return 0; - /* check for text mismatch */ - if (memcmp(text, v->cipher_text, v->plain_text_size)) - return 0; + /* test direct API */ + + /* encrypt direction */ + memset(text, 0, sizeof(text)); + memset(tag, 0, sizeof(tag)); + + switch (v->cipher_key_size) { + case IMB_KEY_128_BYTES: + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, v->cipher_iv_size, + v->aad, v->aad_size); + IMB_AES128_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, + v->plain_text_size); + IMB_AES128_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); + break; + case IMB_KEY_192_BYTES: + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, v->cipher_iv_size, + v->aad, v->aad_size); + IMB_AES192_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, + v->plain_text_size); + IMB_AES192_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); + break; + case IMB_KEY_256_BYTES: + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, v->cipher_iv_size, + v->aad, v->aad_size); + IMB_AES256_GCM_ENC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->plain_text, + v->plain_text_size); + IMB_AES256_GCM_ENC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); + break; + default: + return 0; + } + /* check for TAG mismatch */ + if (memcmp(tag, v->tag, v->tag_size)) + return 0; - /* decrypt direction */ - memset(text, 0, sizeof(text)); - memset(tag, 0, sizeof(tag)); - switch (v->cipher_key_size) { - case IMB_KEY_128_BYTES: - IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, - v->cipher_iv_size, v->aad, v->aad_size); - IMB_AES128_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, - v->plain_text_size); - IMB_AES128_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); - break; - case IMB_KEY_192_BYTES: - IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, - v->cipher_iv_size, v->aad, v->aad_size); - IMB_AES192_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, - v->plain_text_size); - IMB_AES192_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); - break; - case IMB_KEY_256_BYTES: - IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, - v->cipher_iv_size, v->aad, v->aad_size); - IMB_AES256_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, - v->plain_text_size); - IMB_AES256_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); - break; - default: - return 0; - } - /* check for TAG mismatch */ - if (memcmp(tag, v->tag, v->tag_size)) - return 0; + /* check for text mismatch */ + if (memcmp(text, v->cipher_text, v->plain_text_size)) + return 0; - /* check for text mismatch */ - if (memcmp(text, v->plain_text, v->plain_text_size)) - return 0; + /* decrypt direction */ + memset(text, 0, sizeof(text)); + memset(tag, 0, sizeof(tag)); + switch (v->cipher_key_size) { + case IMB_KEY_128_BYTES: + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, v->cipher_iv_size, + v->aad, v->aad_size); + IMB_AES128_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, + v->plain_text_size); + IMB_AES128_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); + break; + case IMB_KEY_192_BYTES: + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, v->cipher_iv_size, + v->aad, v->aad_size); + IMB_AES192_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, + v->plain_text_size); + IMB_AES192_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); + break; + case IMB_KEY_256_BYTES: + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, &gcm_key, &ctx, v->cipher_iv, v->cipher_iv_size, + v->aad, v->aad_size); + IMB_AES256_GCM_DEC_UPDATE(p_mgr, &gcm_key, &ctx, text, v->cipher_text, + v->plain_text_size); + IMB_AES256_GCM_DEC_FINALIZE(p_mgr, &gcm_key, &ctx, tag, v->tag_size); + break; + default: + return 0; + } + /* check for TAG mismatch */ + if (memcmp(tag, v->tag, v->tag_size)) + return 0; - } /* for(gcm_vectors) */ + /* check for text mismatch */ + if (memcmp(text, v->plain_text, v->plain_text_size)) + return 0; return 1; } @@ -1203,6 +1281,7 @@ struct self_test_aead_ccm_vector { const uint8_t *cipher_text; const uint8_t *tag; size_t tag_size; + const char *description; }; /* @@ -1239,131 +1318,124 @@ static const uint8_t aes_ccm_256_cipher_text[] = { 0x21, 0x61, 0x63, 0xDE, 0xCF, 0x1F, 0xA5, 0x96, 0xD7, 0x0F, 0x76, 0x91 }; static const uint8_t aes_ccm_256_tag[] = { 0xCA, 0x8A, 0xFA, 0xA2, 0x3F, 0x22, 0x3E, 0x64 }; -#define ADD_CCM_VECTOR(_key, _nonce, _aad, _plain, _cipher, _tag) \ +#define ADD_CCM_VECTOR(_key, _nonce, _aad, _plain, _cipher, _tag, _descr) \ { \ IMB_AUTH_AES_CCM, IMB_CIPHER_CCM, _key, sizeof(_key), _nonce, sizeof(_nonce), \ - _aad, sizeof(_aad), _plain, sizeof(_plain), _cipher, _tag, sizeof(_tag) \ + _aad, sizeof(_aad), _plain, sizeof(_plain), _cipher, _tag, sizeof(_tag), \ + _descr \ } -struct self_test_aead_ccm_vector aead_ccm_vectors[] = { +static const struct self_test_aead_ccm_vector aead_ccm_vectors[] = { ADD_CCM_VECTOR(aes_ccm_128_key, aes_ccm_128_nonce, aes_ccm_128_aad, aes_ccm_128_plain_text, - aes_ccm_128_cipher_text, aes_ccm_128_tag), + aes_ccm_128_cipher_text, aes_ccm_128_tag, "AES128-CCM"), ADD_CCM_VECTOR(aes_ccm_256_key, aes_ccm_256_nonce, aes_ccm_256_aad, aes_ccm_256_plain_text, - aes_ccm_256_cipher_text, aes_ccm_256_tag) + aes_ccm_256_cipher_text, aes_ccm_256_tag, "AES256-CCM") }; static int -self_test_aead_ccm(IMB_MGR *p_mgr) +self_test_aead_ccm(IMB_MGR *p_mgr, const struct self_test_aead_ccm_vector *v) { DECLARE_ALIGNED(uint32_t expkey[4 * 15], 16); DECLARE_ALIGNED(uint32_t dust[4 * 15], 16); uint8_t text[128], tag[16]; - unsigned i; - - while (IMB_FLUSH_JOB(p_mgr) != NULL) - ; - for (i = 0; i < IMB_DIM(aead_ccm_vectors); i++) { - struct self_test_aead_ccm_vector *v = &aead_ccm_vectors[i]; + IMB_ASSERT(v->tag_size <= sizeof(tag)); + IMB_ASSERT(v->plain_text_size <= sizeof(text)); - IMB_ASSERT(v->tag_size <= sizeof(tag)); - IMB_ASSERT(v->plain_text_size <= sizeof(text)); - - /* tag too long */ - if (v->tag_size > sizeof(tag)) - return 0; + /* tag too long */ + if (v->tag_size > sizeof(tag)) + return 0; - /* message too long */ - if (v->plain_text_size > sizeof(text)) - return 0; + /* message too long */ + if (v->plain_text_size > sizeof(text)) + return 0; - switch (v->cipher_key_size) { - case IMB_KEY_128_BYTES: - IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, expkey, dust); - break; - case IMB_KEY_256_BYTES: - IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, expkey, dust); - break; - default: - return 0; - } + switch (v->cipher_key_size) { + case IMB_KEY_128_BYTES: + IMB_AES_KEYEXP_128(p_mgr, v->cipher_key, expkey, dust); + break; + case IMB_KEY_256_BYTES: + IMB_AES_KEYEXP_256(p_mgr, v->cipher_key, expkey, dust); + break; + default: + return 0; + } - IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); - - /* encrypt test */ - job->cipher_mode = v->cipher_mode; - job->cipher_direction = IMB_DIR_ENCRYPT; - job->chain_order = IMB_ORDER_HASH_CIPHER; - job->key_len_in_bytes = v->cipher_key_size; - job->src = v->plain_text; - job->dst = text; - job->msg_len_to_cipher_in_bytes = v->plain_text_size; - job->cipher_start_src_offset_in_bytes = UINT64_C(0); - job->msg_len_to_hash_in_bytes = v->plain_text_size; - job->hash_start_src_offset_in_bytes = UINT64_C(0); - job->iv = v->cipher_nonce; - job->iv_len_in_bytes = v->cipher_nonce_size; - job->auth_tag_output = tag; - job->auth_tag_output_len_in_bytes = v->tag_size; - job->hash_alg = v->hash_mode; - job->enc_keys = expkey; - job->dec_keys = expkey; - job->u.CCM.aad_len_in_bytes = v->aad_size; - job->u.CCM.aad = v->aad; - - memset(text, 0, sizeof(text)); - memset(tag, 0, sizeof(tag)); - - /* submit job and get it processed */ - if (!process_job(p_mgr)) - return 0; + IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); + + /* encrypt test */ + job->cipher_mode = v->cipher_mode; + job->cipher_direction = IMB_DIR_ENCRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + job->key_len_in_bytes = v->cipher_key_size; + job->src = v->plain_text; + job->dst = text; + job->msg_len_to_cipher_in_bytes = v->plain_text_size; + job->cipher_start_src_offset_in_bytes = UINT64_C(0); + job->msg_len_to_hash_in_bytes = v->plain_text_size; + job->hash_start_src_offset_in_bytes = UINT64_C(0); + job->iv = v->cipher_nonce; + job->iv_len_in_bytes = v->cipher_nonce_size; + job->auth_tag_output = tag; + job->auth_tag_output_len_in_bytes = v->tag_size; + job->hash_alg = v->hash_mode; + job->enc_keys = expkey; + job->dec_keys = expkey; + job->u.CCM.aad_len_in_bytes = v->aad_size; + job->u.CCM.aad = v->aad; + + memset(text, 0, sizeof(text)); + memset(tag, 0, sizeof(tag)); + + /* submit job and get it processed */ + if (!process_job(p_mgr)) + return 0; - /* check for TAG mismatch */ - if (memcmp(tag, v->tag, v->tag_size)) - return 0; + /* check for TAG mismatch */ + if (memcmp(tag, v->tag, v->tag_size)) + return 0; - /* check for text mismatch */ - if (memcmp(text, v->cipher_text, v->plain_text_size)) - return 0; + /* check for text mismatch */ + if (memcmp(text, v->cipher_text, v->plain_text_size)) + return 0; - /* decrypt test */ - job = IMB_GET_NEXT_JOB(p_mgr); - - job->cipher_mode = v->cipher_mode; - job->cipher_direction = IMB_DIR_DECRYPT; - job->chain_order = IMB_ORDER_CIPHER_HASH; - job->key_len_in_bytes = v->cipher_key_size; - job->src = v->cipher_text; - job->dst = text; - job->msg_len_to_cipher_in_bytes = v->plain_text_size; - job->cipher_start_src_offset_in_bytes = UINT64_C(0); - job->msg_len_to_hash_in_bytes = v->plain_text_size; - job->hash_start_src_offset_in_bytes = UINT64_C(0); - job->iv = v->cipher_nonce; - job->iv_len_in_bytes = v->cipher_nonce_size; - job->auth_tag_output = tag; - job->auth_tag_output_len_in_bytes = v->tag_size; - job->hash_alg = v->hash_mode; - job->enc_keys = expkey; - job->dec_keys = expkey; - job->u.CCM.aad_len_in_bytes = v->aad_size; - job->u.CCM.aad = v->aad; - - memset(text, 0, sizeof(text)); - memset(tag, 0, sizeof(tag)); - - /* submit job and get it processed */ - if (!process_job(p_mgr)) - return 0; + /* decrypt test */ + job = IMB_GET_NEXT_JOB(p_mgr); + + job->cipher_mode = v->cipher_mode; + job->cipher_direction = IMB_DIR_DECRYPT; + job->chain_order = IMB_ORDER_CIPHER_HASH; + job->key_len_in_bytes = v->cipher_key_size; + job->src = v->cipher_text; + job->dst = text; + job->msg_len_to_cipher_in_bytes = v->plain_text_size; + job->cipher_start_src_offset_in_bytes = UINT64_C(0); + job->msg_len_to_hash_in_bytes = v->plain_text_size; + job->hash_start_src_offset_in_bytes = UINT64_C(0); + job->iv = v->cipher_nonce; + job->iv_len_in_bytes = v->cipher_nonce_size; + job->auth_tag_output = tag; + job->auth_tag_output_len_in_bytes = v->tag_size; + job->hash_alg = v->hash_mode; + job->enc_keys = expkey; + job->dec_keys = expkey; + job->u.CCM.aad_len_in_bytes = v->aad_size; + job->u.CCM.aad = v->aad; + + memset(text, 0, sizeof(text)); + memset(tag, 0, sizeof(tag)); + + /* submit job and get it processed */ + if (!process_job(p_mgr)) + return 0; - /* check for TAG mismatch */ - if (memcmp(tag, v->tag, v->tag_size)) - return 0; + /* check for TAG mismatch */ + if (memcmp(tag, v->tag, v->tag_size)) + return 0; - /* check for text mismatch */ - if (memcmp(text, v->plain_text, v->plain_text_size)) - return 0; - } /* for(ccm_vectors) */ + /* check for text mismatch */ + if (memcmp(text, v->plain_text, v->plain_text_size)) + return 0; return 1; } @@ -1371,15 +1443,62 @@ self_test_aead_ccm(IMB_MGR *p_mgr) static int self_test_aead(IMB_MGR *p_mgr) { - if (!self_test_aead_gcm(p_mgr)) - return 0; - if (!self_test_aead_ccm(p_mgr)) - return 0; - return 1; + int ret = 1; + + for (unsigned i = 0; i < IMB_DIM(aead_gcm_vectors); i++) { + const struct self_test_aead_gcm_vector *v = &aead_gcm_vectors[i]; + + make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AEAD, + v->description); + + const int r = self_test_aead_gcm(p_mgr, v); + + if (r == 0) { + ret = 0; + make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + } else { + make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + } + } + + for (unsigned i = 0; i < IMB_DIM(aead_ccm_vectors); i++) { + const struct self_test_aead_ccm_vector *v = &aead_ccm_vectors[i]; + + make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AEAD, + v->description); + + const int r = self_test_aead_ccm(p_mgr, v); + + if (r == 0) { + ret = 0; + make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + } else { + make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + } + } + + return ret; } #endif /* NO_SELF_TEST_DEV */ +static int +self_test_exec(IMB_MGR *p_mgr) +{ + int ret = 1; + + if (!self_test_ciphers(p_mgr)) + ret = 0; + + if (!self_test_hashes(p_mgr)) + ret = 0; + + if (!self_test_aead(p_mgr)) + ret = 0; + + return ret; +} + /* * ============================================================================= * SELF-TEST INTERNAL API @@ -1397,18 +1516,11 @@ self_test(IMB_MGR *p_mgr) p_mgr->features |= IMB_FEATURE_SELF_TEST; p_mgr->features &= ~IMB_FEATURE_SELF_TEST_PASS; - if (!self_test_ciphers(p_mgr)) - ret = 0; - - if (!self_test_hash(p_mgr)) - ret = 0; - - if (!self_test_aead(p_mgr)) + if (!self_test_exec(p_mgr)) ret = 0; if (ret) p_mgr->features |= IMB_FEATURE_SELF_TEST_PASS; - #endif return ret; -- GitLab From 9d5015d116cbded757a69519727b7837965878a6 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 09:45:23 +0100 Subject: [PATCH 122/204] test: [kat-app] enabled option to provide execution self-test details --- test/kat-app/main.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/test/kat-app/main.c b/test/kat-app/main.c index f3836971..13aa2faa 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -234,7 +234,8 @@ usage(const char *name) "--gfni-off: Don't use Galois Field extensions\n" "--shani-on: Use SHA extensions, default: auto-detect\n" "--shani-off: Don't use SHA extensions\n" - "--quiet: Enable quiet mode with reduced text output\n", + "--quiet: Enable quiet mode with reduced text output\n" + "--self-test-info: provides information about self-test progress\n", name, test_types); free(test_types); @@ -314,12 +315,38 @@ check_err_no_aesni_emu(const uint64_t feature_flags, IMB_MGR *p_mgr) return 0; } +static void +self_test_cb(void *arg, const char *phase, const char *type, const char *descr) +{ + const char *pphase = ""; + const char *ptype = ""; + const char *pdescr = ""; + + (void) arg; + + if (phase != NULL) + pphase = phase; + + if (type != NULL) + ptype = type; + + if (descr != NULL) + pdescr = descr; + + if (strcmp(pphase, IMB_SELF_TEST_PHASE_START) == 0) + printf("%s : %s : ", ptype, pdescr); + + if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0 || + strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) + printf("%s\n", pphase); +} + int main(int argc, char **argv) { uint8_t arch_support[IMB_ARCH_NUM]; uint8_t arch_select[IMB_ARCH_NUM]; - int i, atype, auto_detect = 0; + int i, atype, auto_detect = 0, self_test_info = 0; uint64_t flags = 0; int errors = 0; unsigned int stop_on_fail = 0; @@ -339,6 +366,8 @@ main(int argc, char **argv) stop_on_fail = 1; else if (strcmp(argv[i], "--quiet") == 0) quiet_mode = 1; + else if (strcmp(argv[i], "--self-test-info") == 0) + self_test_info = 1; else if (strcmp(argv[i], "--test-type") == 0) { unsigned selected_test; @@ -404,6 +433,9 @@ main(int argc, char **argv) return EXIT_FAILURE; } + if (self_test_info) + imb_self_test_set_cb(p_mgr, self_test_cb, NULL); + switch (atype) { #ifdef __aarch64__ case IMB_ARCH_NOAESNI: -- GitLab From 2ffd1c34be1dab0c9142673f68dab11e0fc1aad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Wed, 19 Jun 2024 13:13:57 +0100 Subject: [PATCH 123/204] Stub imb_self_test_set_cb for aarch64 This method isn't supported on AArch64, but needs to be stubbed to have an implementation, in order to maintain ABI compatibility with x86_64 ipsec-mb library. --- lib/Makefile | 3 +- lib/aarch64/self_test_aarch64.c | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 lib/aarch64/self_test_aarch64.c diff --git a/lib/Makefile b/lib/Makefile index 781e6334..eecb22fb 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -363,7 +363,8 @@ c_lib_objs := \ snow3g_aarch64_sve256.o \ cipher_suite_id.o \ ooo_mgr_reset.o \ - hmac_ipad_opad_aarch64.o + hmac_ipad_opad_aarch64.o \ + self_test_aarch64.o asm_generic_lib_objs := \ lookup_16x8bit_neon.o \ snow3g_impl_aarch64_neon.o \ diff --git a/lib/aarch64/self_test_aarch64.c b/lib/aarch64/self_test_aarch64.c new file mode 100644 index 00000000..6f7cc578 --- /dev/null +++ b/lib/aarch64/self_test_aarch64.c @@ -0,0 +1,53 @@ +/******************************************************************************* + Copyright (c) 2022-2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ +/* + * ============================================================================= + * SELF-TEST CALLBACK + * ============================================================================= + */ +#include +#include +#include +#include + +#include "ipsec-mb.h" +#include "include/error.h" + +IMB_DLL_EXPORT +__attribute__((noreturn)) int +imb_self_test_set_cb(IMB_MGR *p_mgr, imb_self_test_cb_t cb_fn, void *cb_arg) + +{ + /* + * This method isn't supported on AArch64. However, it is stubbed to + * ensure ABI compatibility with the x86_64 ipsec-mb library. + * + * As this should never be called, it crashes. + */ + fprintf(stderr, "imb_self_test_set_cb() is unimplemented for AArch64.\n"); + abort(); +} -- GitLab From dbfc85872ceade285247ff42284b4133750218a8 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 13:02:59 +0100 Subject: [PATCH 124/204] lib: [self-test] change prototype of the callback function to return an integer --- lib/ipsec-mb.h | 4 ++-- lib/x86_64/self_test.c | 36 ++++++++++++++++++------------------ test/kat-app/main.c | 4 +++- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index aecf0475..ca247a95 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -890,8 +890,8 @@ typedef void (*chacha20_hp_quic_t)(const void *, const void *const *, void **, c typedef void (*sm4_keyexp_t)(const void *, void *, void *); -typedef void (*imb_self_test_cb_t)(void *cb_arg, const char *phase, const char *type, - const char *descr); +typedef int (*imb_self_test_cb_t)(void *cb_arg, const char *phase, const char *type, + const char *descr); /* Multi-buffer manager flags passed to alloc_mb_mgr() */ #define IMB_FLAG_SHANI_OFF (1ULL << 0) /**< disable use of SHANI extension */ diff --git a/lib/x86_64/self_test.c b/lib/x86_64/self_test.c index 57a0bf9f..6c7c5894 100644 --- a/lib/x86_64/self_test.c +++ b/lib/x86_64/self_test.c @@ -62,13 +62,13 @@ imb_self_test_get_cb(IMB_MGR *p_mgr, imb_self_test_cb_t *cb_fn, void **cb_arg) return 0; } -static void +static int make_callback(IMB_MGR *p_mgr, const char *phase, const char *type, const char *descr) { if (p_mgr->self_test_cb_fn == NULL) return; - p_mgr->self_test_cb_fn(p_mgr->self_test_cb_arg, phase, type, descr); + return p_mgr->self_test_cb_fn(p_mgr->self_test_cb_arg, phase, type, descr); } /* @@ -490,15 +490,15 @@ self_test_ciphers(IMB_MGR *p_mgr) for (unsigned i = 0; i < IMB_DIM(cipher_vectors); i++) { const struct self_test_cipher_vector *v = &cipher_vectors[i]; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_CIPHER, - v->description); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, + IMB_SELF_TEST_TYPE_KAT_CIPHER, v->description); const int r = self_test_cipher(p_mgr, v); if (r == 0) { ret = 0; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); } else { - make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); } } @@ -957,16 +957,16 @@ self_test_hashes(IMB_MGR *p_mgr) for (unsigned i = 0; i < IMB_DIM(hash_vectors); i++) { const struct self_test_hash_vector *v = &hash_vectors[i]; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AUTH, - v->description); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AUTH, + v->description); const int r = self_test_hash(p_mgr, v); if (r == 0) { ret = 0; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); } else { - make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); } } @@ -1448,32 +1448,32 @@ self_test_aead(IMB_MGR *p_mgr) for (unsigned i = 0; i < IMB_DIM(aead_gcm_vectors); i++) { const struct self_test_aead_gcm_vector *v = &aead_gcm_vectors[i]; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AEAD, - v->description); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AEAD, + v->description); const int r = self_test_aead_gcm(p_mgr, v); if (r == 0) { ret = 0; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); } else { - make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); } } for (unsigned i = 0; i < IMB_DIM(aead_ccm_vectors); i++) { const struct self_test_aead_ccm_vector *v = &aead_ccm_vectors[i]; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AEAD, - v->description); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_AEAD, + v->description); const int r = self_test_aead_ccm(p_mgr, v); if (r == 0) { ret = 0; - make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_FAIL, NULL, NULL); } else { - make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); + (void) make_callback(p_mgr, IMB_SELF_TEST_PHASE_PASS, NULL, NULL); } } diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 13aa2faa..614ac69f 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -315,7 +315,7 @@ check_err_no_aesni_emu(const uint64_t feature_flags, IMB_MGR *p_mgr) return 0; } -static void +static int self_test_cb(void *arg, const char *phase, const char *type, const char *descr) { const char *pphase = ""; @@ -339,6 +339,8 @@ self_test_cb(void *arg, const char *phase, const char *type, const char *descr) if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0 || strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) printf("%s\n", pphase); + + return 1; } int -- GitLab From 9db997ae1bddeb178d3a0406cb5ecbe5ee536ba9 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 14:57:33 +0100 Subject: [PATCH 125/204] lib: [self-test] use read-write buffer as source for running the tests Read-only buffer was used until now. --- lib/x86_64/self_test.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/lib/x86_64/self_test.c b/lib/x86_64/self_test.c index 6c7c5894..3cac59ed 100644 --- a/lib/x86_64/self_test.c +++ b/lib/x86_64/self_test.c @@ -66,7 +66,7 @@ static int make_callback(IMB_MGR *p_mgr, const char *phase, const char *type, const char *descr) { if (p_mgr->self_test_cb_fn == NULL) - return; + return 1; return p_mgr->self_test_cb_fn(p_mgr->self_test_cb_arg, phase, type, descr); } @@ -414,7 +414,7 @@ self_test_cipher(IMB_MGR *p_mgr, const struct self_test_cipher_vector *v) job->hash_alg = IMB_AUTH_NULL; job->cipher_direction = IMB_DIR_ENCRYPT; job->chain_order = IMB_ORDER_CIPHER_HASH; - job->src = v->plain_text; + job->src = scratch; job->dst = scratch; job->cipher_mode = v->cipher_mode; if (v->cipher_mode == IMB_CIPHER_DES3) { @@ -433,6 +433,7 @@ self_test_cipher(IMB_MGR *p_mgr, const struct self_test_cipher_vector *v) job->msg_len_to_cipher_in_bytes = v->plain_text_size; memset(scratch, 0, sizeof(scratch)); + memcpy(scratch, v->plain_text, v->plain_text_size); /* submit job and get it processed */ if (!process_job(p_mgr)) @@ -448,7 +449,7 @@ self_test_cipher(IMB_MGR *p_mgr, const struct self_test_cipher_vector *v) job->hash_alg = IMB_AUTH_NULL; job->cipher_direction = IMB_DIR_DECRYPT; job->chain_order = IMB_ORDER_HASH_CIPHER; - job->src = v->cipher_text; + job->src = scratch; job->dst = scratch; job->cipher_mode = v->cipher_mode; if (v->cipher_mode == IMB_CIPHER_DES3) { @@ -467,6 +468,7 @@ self_test_cipher(IMB_MGR *p_mgr, const struct self_test_cipher_vector *v) job->msg_len_to_cipher_in_bytes = v->plain_text_size; memset(scratch, 0, sizeof(scratch)); + memcpy(scratch, v->cipher_text, v->plain_text_size); /* submit job and get it processed */ if (!process_job(p_mgr)) @@ -803,6 +805,7 @@ self_test_hash(IMB_MGR *p_mgr, const struct self_test_hash_vector *v) struct gcm_key_data gmac_key; /* all */ uint8_t scratch[IMB_SHA_512_BLOCK_SIZE]; + uint8_t msg[256]; IMB_ASSERT(v->tag_size <= sizeof(scratch)); @@ -810,14 +813,23 @@ self_test_hash(IMB_MGR *p_mgr, const struct self_test_hash_vector *v) if (v->tag_size > sizeof(scratch)) return 0; + IMB_ASSERT(v->message_size <= sizeof(msg)); + + /* message too long */ + if (v->message_size > sizeof(msg)) + return 0; + /* test JOB API */ IMB_JOB *job = IMB_GET_NEXT_JOB(p_mgr); + memset(msg, 0, sizeof(msg)); + memcpy(msg, v->message, v->message_size); + job->hash_alg = v->hash_mode; job->cipher_mode = IMB_CIPHER_NULL; job->cipher_direction = IMB_DIR_ENCRYPT; job->chain_order = IMB_ORDER_HASH_CIPHER; - job->src = v->message; + job->src = msg; job->hash_start_src_offset_in_bytes = 0; job->msg_len_to_hash_in_bytes = v->message_size; job->auth_tag_output = scratch; @@ -1124,7 +1136,7 @@ self_test_aead_gcm(IMB_MGR *p_mgr, const struct self_test_aead_gcm_vector *v) job->cipher_direction = IMB_DIR_ENCRYPT; job->chain_order = IMB_ORDER_CIPHER_HASH; job->key_len_in_bytes = v->cipher_key_size; - job->src = v->plain_text; + job->src = text; job->dst = text; job->msg_len_to_cipher_in_bytes = v->plain_text_size; job->cipher_start_src_offset_in_bytes = UINT64_C(0); @@ -1139,6 +1151,8 @@ self_test_aead_gcm(IMB_MGR *p_mgr, const struct self_test_aead_gcm_vector *v) job->u.GCM.aad_len_in_bytes = v->aad_size; memset(text, 0, sizeof(text)); + memcpy(text, v->plain_text, v->plain_text_size); + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ @@ -1160,7 +1174,7 @@ self_test_aead_gcm(IMB_MGR *p_mgr, const struct self_test_aead_gcm_vector *v) job->cipher_direction = IMB_DIR_DECRYPT; job->chain_order = IMB_ORDER_HASH_CIPHER; job->key_len_in_bytes = v->cipher_key_size; - job->src = v->cipher_text; + job->src = text; job->dst = text; job->msg_len_to_cipher_in_bytes = v->plain_text_size; job->cipher_start_src_offset_in_bytes = UINT64_C(0); @@ -1175,6 +1189,8 @@ self_test_aead_gcm(IMB_MGR *p_mgr, const struct self_test_aead_gcm_vector *v) job->u.GCM.aad_len_in_bytes = v->aad_size; memset(text, 0, sizeof(text)); + memcpy(text, v->cipher_text, v->plain_text_size); + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ @@ -1368,7 +1384,7 @@ self_test_aead_ccm(IMB_MGR *p_mgr, const struct self_test_aead_ccm_vector *v) job->cipher_direction = IMB_DIR_ENCRYPT; job->chain_order = IMB_ORDER_HASH_CIPHER; job->key_len_in_bytes = v->cipher_key_size; - job->src = v->plain_text; + job->src = text; job->dst = text; job->msg_len_to_cipher_in_bytes = v->plain_text_size; job->cipher_start_src_offset_in_bytes = UINT64_C(0); @@ -1385,6 +1401,8 @@ self_test_aead_ccm(IMB_MGR *p_mgr, const struct self_test_aead_ccm_vector *v) job->u.CCM.aad = v->aad; memset(text, 0, sizeof(text)); + memcpy(text, v->plain_text, v->plain_text_size); + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ @@ -1406,7 +1424,7 @@ self_test_aead_ccm(IMB_MGR *p_mgr, const struct self_test_aead_ccm_vector *v) job->cipher_direction = IMB_DIR_DECRYPT; job->chain_order = IMB_ORDER_CIPHER_HASH; job->key_len_in_bytes = v->cipher_key_size; - job->src = v->cipher_text; + job->src = text; job->dst = text; job->msg_len_to_cipher_in_bytes = v->plain_text_size; job->cipher_start_src_offset_in_bytes = UINT64_C(0); @@ -1423,6 +1441,8 @@ self_test_aead_ccm(IMB_MGR *p_mgr, const struct self_test_aead_ccm_vector *v) job->u.CCM.aad = v->aad; memset(text, 0, sizeof(text)); + memcpy(text, v->cipher_text, v->plain_text_size); + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ -- GitLab From 519d2c11c298df29761d4672b7ab6bb412908b99 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 16:20:04 +0100 Subject: [PATCH 126/204] test: [kat-app] change test names into constant string --- test/kat-app/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 614ac69f..1eb4fd62 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -120,10 +120,8 @@ typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); #define strcasecmp _stricmp #endif -#define MAX_STR_LENGTH 32 - struct imb_test { - char str[MAX_STR_LENGTH]; + const char *str; imb_test_t fn; unsigned enabled; }; -- GitLab From 6cc69cd63c3be3d7933298b144ddecd395b8de81 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 16:20:54 +0100 Subject: [PATCH 127/204] lib: version number bump --- lib/ipsec-mb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index ca247a95..006cf7f5 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -85,8 +85,8 @@ typedef struct { /** * Library version */ -#define IMB_VERSION_STR "1.4.0" -#define IMB_VERSION_NUM 0x10400 +#define IMB_VERSION_STR "1.5.0" +#define IMB_VERSION_NUM 0x10500 /** * Macro to translate version number -- GitLab From f59bbbd909a358717bb412cf2495b2803ffe0f37 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 16:27:57 +0100 Subject: [PATCH 128/204] lib: [self-test] enable corrupt phase in the callback This commit also adds support for corrupt phase in the KAT test application. --- lib/ipsec-mb.h | 7 ++++--- lib/x86_64/self_test.c | 30 ++++++++++++++++++++++++++++++ test/kat-app/main.c | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 69 insertions(+), 6 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 006cf7f5..f169437e 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -935,9 +935,10 @@ typedef int (*imb_self_test_cb_t)(void *cb_arg, const char *phase, const char *t /** * Self test defines */ -#define IMB_SELF_TEST_PHASE_START "START" -#define IMB_SELF_TEST_PHASE_PASS "PASS" -#define IMB_SELF_TEST_PHASE_FAIL "FAIL" +#define IMB_SELF_TEST_PHASE_START "START" +#define IMB_SELF_TEST_PHASE_PASS "PASS" +#define IMB_SELF_TEST_PHASE_FAIL "FAIL" +#define IMB_SELF_TEST_PHASE_CORRUPT "CORRUPT" #define IMB_SELF_TEST_TYPE_KAT_CIPHER "KAT_Cipher" #define IMB_SELF_TEST_TYPE_KAT_AUTH "KAT_Auth" diff --git a/lib/x86_64/self_test.c b/lib/x86_64/self_test.c index 3cac59ed..9688267f 100644 --- a/lib/x86_64/self_test.c +++ b/lib/x86_64/self_test.c @@ -435,6 +435,9 @@ self_test_cipher(IMB_MGR *p_mgr, const struct self_test_cipher_vector *v) memset(scratch, 0, sizeof(scratch)); memcpy(scratch, v->plain_text, v->plain_text_size); + if (make_callback(p_mgr, IMB_SELF_TEST_PHASE_CORRUPT, NULL, NULL) == 0) + scratch[0] ^= 1; + /* submit job and get it processed */ if (!process_job(p_mgr)) return 0; @@ -470,6 +473,12 @@ self_test_cipher(IMB_MGR *p_mgr, const struct self_test_cipher_vector *v) memset(scratch, 0, sizeof(scratch)); memcpy(scratch, v->cipher_text, v->plain_text_size); + /* + * Don't make callback for corrupt decrypt direction. + * In the future split cipher tests into encrypt and decrypt + * direction then do corrupt callbacks as normal. + */ + /* submit job and get it processed */ if (!process_job(p_mgr)) return 0; @@ -825,6 +834,9 @@ self_test_hash(IMB_MGR *p_mgr, const struct self_test_hash_vector *v) memset(msg, 0, sizeof(msg)); memcpy(msg, v->message, v->message_size); + if (make_callback(p_mgr, IMB_SELF_TEST_PHASE_CORRUPT, NULL, NULL) == 0) + msg[0] ^= 1; + job->hash_alg = v->hash_mode; job->cipher_mode = IMB_CIPHER_NULL; job->cipher_direction = IMB_DIR_ENCRYPT; @@ -1153,6 +1165,9 @@ self_test_aead_gcm(IMB_MGR *p_mgr, const struct self_test_aead_gcm_vector *v) memset(text, 0, sizeof(text)); memcpy(text, v->plain_text, v->plain_text_size); + if (make_callback(p_mgr, IMB_SELF_TEST_PHASE_CORRUPT, NULL, NULL) == 0) + text[0] ^= 1; + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ @@ -1191,6 +1206,12 @@ self_test_aead_gcm(IMB_MGR *p_mgr, const struct self_test_aead_gcm_vector *v) memset(text, 0, sizeof(text)); memcpy(text, v->cipher_text, v->plain_text_size); + /* + * Don't make callback for corrupt decrypt direction. + * In the future split AEAD tests into encrypt and decrypt + * direction then do corrupt callbacks as normal. + */ + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ @@ -1403,6 +1424,9 @@ self_test_aead_ccm(IMB_MGR *p_mgr, const struct self_test_aead_ccm_vector *v) memset(text, 0, sizeof(text)); memcpy(text, v->plain_text, v->plain_text_size); + if (make_callback(p_mgr, IMB_SELF_TEST_PHASE_CORRUPT, NULL, NULL) == 0) + text[0] ^= 1; + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ @@ -1443,6 +1467,12 @@ self_test_aead_ccm(IMB_MGR *p_mgr, const struct self_test_aead_ccm_vector *v) memset(text, 0, sizeof(text)); memcpy(text, v->cipher_text, v->plain_text_size); + /* + * Don't make callback for corrupt decrypt direction. + * In the future split AEAD tests into encrypt and decrypt + * direction then do corrupt callbacks as normal. + */ + memset(tag, 0, sizeof(tag)); /* submit job and get it processed */ diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 1eb4fd62..baac1cd3 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -180,6 +180,8 @@ struct imb_test tests[] = { #endif /* __aarch64__ */ }; +static int self_test_corrupt = 0; + static char * get_test_types(void) { @@ -233,7 +235,9 @@ usage(const char *name) "--shani-on: Use SHA extensions, default: auto-detect\n" "--shani-off: Don't use SHA extensions\n" "--quiet: Enable quiet mode with reduced text output\n" - "--self-test-info: provides information about self-test progress\n", + "--self-test-info: provides information about self-test progress (> v1.4)\n" + "--self-test-corrupt: corrupt message during self-test (> v1.4; expect " + "initialization fail)\n", name, test_types); free(test_types); @@ -334,6 +338,9 @@ self_test_cb(void *arg, const char *phase, const char *type, const char *descr) if (strcmp(pphase, IMB_SELF_TEST_PHASE_START) == 0) printf("%s : %s : ", ptype, pdescr); + if ((strcmp(pphase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) && (self_test_corrupt == 1)) + return 0; + if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0 || strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) printf("%s\n", pphase); @@ -368,6 +375,8 @@ main(int argc, char **argv) quiet_mode = 1; else if (strcmp(argv[i], "--self-test-info") == 0) self_test_info = 1; + else if (strcmp(argv[i], "--self-test-corrupt") == 0) + self_test_corrupt = 1; else if (strcmp(argv[i], "--test-type") == 0) { unsigned selected_test; @@ -394,6 +403,16 @@ main(int argc, char **argv) printf("Tool version: %s\n", IMB_VERSION_STR); } + if (imb_get_version() <= IMB_VERSION(1, 4, 0) && self_test_info) { + printf("`self-test-info` not supported in this library version!\n"); + return EXIT_FAILURE; + } + + if (imb_get_version() <= IMB_VERSION(1, 4, 0) && self_test_corrupt) { + printf("`self-test-corrupt` not supported in this library version!\n"); + return EXIT_FAILURE; + } + /* Print available CPU features */ print_hw_features(); @@ -462,11 +481,24 @@ main(int argc, char **argv) #endif } - if (p_mgr->features & IMB_FEATURE_SELF_TEST) + if (p_mgr->features & IMB_FEATURE_SELF_TEST) { printf("SELF-TEST: %s\n", (p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) ? "PASS" : "FAIL"); - else + + if (self_test_corrupt) { + printf("SELF-TEST: CORRUPT option enabled. %s\n", + ((p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) == 0) + ? "FAIL expected." + : "ERROR: PASS NOT EXPECTED!"); + + if ((p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) != 0) { + free_mb_mgr(p_mgr); + return EXIT_FAILURE; + } + } + } else { printf("SELF-TEST: N/A (requires library >= v1.3)\n"); + } if (imb_get_errno(p_mgr) != 0) { printf("Error initializing MB_MGR structure! %s\n", -- GitLab From 323bc517cdfc1ee381543c63178fbc4b090a77cd Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 4 Oct 2023 16:49:11 +0100 Subject: [PATCH 129/204] doc: [README] Self-Test section update --- README.md | 105 ++++++++++++++++++++++++++++++++++++++--------- ReleaseNotes.txt | 2 + 2 files changed, 88 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index e7f7a6f4..938a2d09 100644 --- a/README.md +++ b/README.md @@ -828,25 +828,43 @@ In order to support CMVP, the library implements Self-Test functionality that is The test is always performed as part of library initialization (power-up). There is no conditional self-test functionality as none of such conditions occur (i.e. pair-wise consistency test, software/firmware load test, manual key entry test, continuous random number generator test, and bypass test). -The self-test consists of Cryptographic algorithm test (known answer test) on following algorithms: -- AES-GCM -- AES-GMAC -- AES-CCM -- AES-CBC -- AES-CTR -- AES-ECB -- TDES-EDE-CBC -- AES-CMAC -- SHA1 -- SHA224 -- SHA256 -- SHA384 -- SHA512 -- HMAC-SHA1 -- HMAC-SHA224 -- HMAC-SHA256 -- HMAC-SHA384 -- HMAC-SHA512 + +Application can register self-test callback function to track test progress. Optionally application can corrupt input message for selected tests and observe change in the test result. + +Typical sequence of callbacks received by application is: +- callback(IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_CIPHER, "AES128-CBC") +- callback(IMB_SELF_TEST_PHASE_CORRUPT, NULL, NULL) + - return 1: no message corruption + - return 0: corrupt the 1st byte +- callback(IMB_SELF_TEST_PHASE_PASS or IMB_SELF_TEST_PHASE_PASS, NULL, NULL) => return 1 +- callback(IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_CIPHER, "AES192-CBC") => return 1 +- ... +Note that value returned by application self-test callback function only matters in the corrupt phase. + +The self-test consists of Cryptographic algorithm test (known answer test) on following types and algorithms: +- KAT_AEAD: + - AES-GCM + - AES-CCM +- KAT_Cipher: + - AES-CBC + - AES-CTR + - AES-ECB + - TDES-EDE-CBC +- KAT_Auth: + - AES-GMAC + - AES-CMAC + - SHA1 + - SHA224 + - SHA256 + - SHA384 + - SHA512 + - HMAC-SHA1 + - HMAC-SHA224 + - HMAC-SHA256 + - HMAC-SHA384 + - HMAC-SHA512 + +KAT_Cipher and KAT_AEAD types conduct tests in encrypt and decrypt cipher directions. However, the corrupt callback is made only for the encrypt direction. No callback is made for the decrypt direction at the moment. Example detection of library self-test completion & error in the application: ``` @@ -877,6 +895,55 @@ if (imb_get_errno(p_mgr) == IMB_ERR_SELFTEST) { } ``` +Example registration of self-test callback function: +``` +int self_test_corrupt = 0; + +int callback(void *arg, const char *phase, const char *type, const char *descr) +{ + const char *pphase = ""; + const char *ptype = ""; + const char *pdescr = ""; + + if (phase != NULL) + pphase = phase; + + if (type != NULL) + ptype = type; + + if (descr != NULL) + pdescr = descr; + + if (strcmp(pphase, IMB_SELF_TEST_PHASE_START) == 0) + printf("%s : %s : ", ptype, pdescr); + + if ((strcmp(pphase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) && (self_test_corrupt == 1)) + return 0; /* corrupt input message */ + + if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0 || + strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) + printf("%s\n", pphase); + + return 1; +} + +... + +IMB_ARCH arch; +IMB_MGR *p_mgr = alloc_mb_mgr(0); + +/* + * Register self-test callback that will be invoked during + * subsequent init operation + */ +imb_self_test_set_cb(p_mgr, callback, NULL); + +init_mb_mgr_auto(p_mgr, &arch); /* or init_mb_mgr_sse/avx/avx2/avx512 */ + +... + +``` + ## 13.DLL Injection Attack ### Problem diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index d6c9b7f0..a698595e 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -10,11 +10,13 @@ Library - SM4-ECB SSE implementation added. - SM4-CBC SSE implementation added. - x86-64 SM3 implementation added. +- Self-Test callback functionality added with message corrupt option. Test Applications - QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. - SM4-ECB and SM4-CBC tests added. - SM3 tests added. +- Self-Test callback support added to the KAT-APP. Performance Applications - New parameter added to benchmark QUIC `--quic-api`. -- GitLab From 6432e4a91dd5294343d0007bbe5a09281d4ae66a Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 5 Oct 2023 13:48:21 +0100 Subject: [PATCH 130/204] test: [api-test] added tests for self-test functionality --- test/kat-app/api_test.c | 241 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 9c7af038..f65b035b 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -2635,6 +2635,242 @@ test_reset_api(struct IMB_MGR *mb_mgr) return 0; } +/* + * @brief Test Self-Test API + */ +struct self_test_context { + int is_corrupt; + + int to_corrupt; + int corrupted_counter; + + int error_counter; + + int start_counter; + int corrupt_counter; + int fail_counter; + int pass_counter; + int all_counter; +}; + +static int +self_test_callback(void *arg, const char *phase, const char *type, const char *descr) +{ + struct self_test_context *p = (struct self_test_context *) arg; + const char *pphase = ""; + + p->all_counter++; + + if (phase != NULL) + pphase = phase; + else + p->error_counter++; + + if (strcmp(pphase, IMB_SELF_TEST_PHASE_START) == 0) { + p->start_counter++; + if (type == NULL || descr == NULL) + p->error_counter++; + } else if (strcmp(pphase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) { + p->corrupt_counter++; + if (p->is_corrupt) { + /* + * if this is corrupt test then what value + * should be returned (0 -> corrupt) + */ + if (p->to_corrupt > p->corrupted_counter) { + p->corrupted_counter++; + return 0; + } + } + return 1; + } else if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0) { + p->pass_counter++; + } else if (strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) { + p->fail_counter++; + } else { + p->error_counter++; + } + + return 1; +} + +static int +self_test_check_context(const struct self_test_context *p) +{ + if (p->start_counter != p->corrupt_counter) + return 0; + + if (p->start_counter != (p->fail_counter + p->pass_counter)) + return 0; + + if (p->all_counter != + (p->fail_counter + p->pass_counter + p->corrupt_counter + p->start_counter)) + return 0; + + if (p->is_corrupt) { + if (p->fail_counter != p->corrupted_counter) + return 0; + if (p->to_corrupt != p->corrupted_counter) + return 0; + } + + if (p->error_counter != 0) + return 0; + return 1; +} + +static void +self_test_set_context(struct self_test_context *p, const int is_corrupt, const int to_corrupt) +{ + memset(p, 0, sizeof(*p)); + p->is_corrupt = is_corrupt; + p->to_corrupt = to_corrupt; +} + +static int +test_self_test_api(struct IMB_MGR *mb_mgr) +{ + printf("Self-Test API test:\n"); + + /* invalid get test scenarios */ + imb_self_test_cb_t cb_fn; + void *cb_arg; + + if (imb_self_test_get_cb(NULL, &cb_fn, &cb_arg) != IMB_ERR_NULL_MBMGR) + return 1; + + if (imb_self_test_get_cb(mb_mgr, NULL, &cb_arg) != EINVAL) + return 1; + + if (imb_self_test_get_cb(mb_mgr, &cb_fn, NULL) != EINVAL) + return 1; + + if (imb_self_test_get_cb(mb_mgr, NULL, NULL) != EINVAL) + return 1; + + if (imb_self_test_get_cb(NULL, NULL, NULL) != IMB_ERR_NULL_MBMGR) + return 1; + + if (!quiet_mode) + printf("."); + + /* invalid set test scenarios */ + if (imb_self_test_set_cb(NULL, NULL, NULL) != IMB_ERR_NULL_MBMGR) + return 1; + + if (!quiet_mode) + printf("."); + + /* valid test scenarios */ + imb_self_test_cb_t cb_fn1, cb_fn2; + void *cb_arg1, *cb_arg2; + + /* check if get called twice returns same values */ + if (imb_self_test_get_cb(mb_mgr, &cb_fn1, &cb_arg1) != 0) + return 1; + + if (imb_self_test_get_cb(mb_mgr, &cb_fn2, &cb_arg2) != 0) + return 1; + + if ((cb_fn1 != cb_fn2) || (cb_arg1 != cb_arg2)) + return 1; + + if (!quiet_mode) + printf("."); + + /* check set followed by get */ + if (imb_self_test_set_cb(mb_mgr, self_test_callback, mb_mgr) != 0) + return 1; + + if (imb_self_test_get_cb(mb_mgr, &cb_fn1, &cb_arg1) != 0) + return 1; + + if ((cb_fn1 != self_test_callback) || (cb_arg1 != (void *) mb_mgr)) + return 1; + + /* check set with NULL argument */ + if (imb_self_test_set_cb(mb_mgr, self_test_callback, NULL) != 0) + return 1; + + if (imb_self_test_get_cb(mb_mgr, &cb_fn1, &cb_arg1) != 0) + return 1; + + if ((cb_fn1 != self_test_callback) || (cb_arg1 != NULL)) + return 1; + + if (!quiet_mode) + printf("."); + + /* check set with NULL callback */ + if (imb_self_test_set_cb(mb_mgr, NULL, mb_mgr) != 0) + return 1; + + if (imb_self_test_get_cb(mb_mgr, &cb_fn1, &cb_arg1) != 0) + return 1; + + if ((cb_fn1 != NULL) || (cb_arg1 != (void *) mb_mgr)) + return 1; + + if (!quiet_mode) + printf("."); + + /* check callback set followed by init - success scenario */ + struct IMB_MGR *t_mgr = alloc_mb_mgr(0); + struct self_test_context test_ctx; + IMB_ARCH arch; + + if (t_mgr == NULL) + return 1; + + self_test_set_context(&test_ctx, 0, 0); + + if (imb_self_test_set_cb(t_mgr, self_test_callback, &test_ctx) != 0) { + free_mb_mgr(t_mgr); + return 1; + } + + init_mb_mgr_auto(t_mgr, &arch); + free_mb_mgr(t_mgr); + + if (self_test_check_context(&test_ctx) == 0) + return 1; + + const int num_tests = test_ctx.start_counter; + + if (!quiet_mode) + printf("."); + + /* check callback set followed by init - fail scenario */ + for (int i = 0; i <= num_tests; i++) { + t_mgr = alloc_mb_mgr(0); + + if (t_mgr == NULL) + return 1; + + self_test_set_context(&test_ctx, 1, i); + + if (imb_self_test_set_cb(t_mgr, self_test_callback, &test_ctx) != 0) { + free_mb_mgr(t_mgr); + return 1; + } + + init_mb_mgr_auto(t_mgr, &arch); + free_mb_mgr(t_mgr); + + if (self_test_check_context(&test_ctx) == 0) + return 1; + + if (!quiet_mode) + printf("."); + } + + /* check callback set, set NULL and then init - callback disabled */ + + if (!quiet_mode) + printf("\n"); + return 0; +} + int api_test(struct IMB_MGR *mb_mgr) { @@ -2661,6 +2897,11 @@ api_test(struct IMB_MGR *mb_mgr) errors += test_reset_api(mb_mgr); run++; +#ifndef __aarch64__ + errors += test_self_test_api(mb_mgr); + run++; +#endif + test_suite_update(&ctx, run - errors, errors); test_suite_end(&ctx); -- GitLab From 48ae1ac8734757e3deafffaee99313f5f62535ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Wed, 19 Jun 2024 14:04:42 +0100 Subject: [PATCH 131/204] Stub imb_self_test_get_cb for aarch64 This method isn't supported on AArch64, but needs to be stubbed to have an implementation, in order to maintain ABI compatibility with x86_64 ipsec-mb library. --- lib/aarch64/self_test_aarch64.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/aarch64/self_test_aarch64.c b/lib/aarch64/self_test_aarch64.c index 6f7cc578..7a7a0e09 100644 --- a/lib/aarch64/self_test_aarch64.c +++ b/lib/aarch64/self_test_aarch64.c @@ -51,3 +51,17 @@ imb_self_test_set_cb(IMB_MGR *p_mgr, imb_self_test_cb_t cb_fn, void *cb_arg) fprintf(stderr, "imb_self_test_set_cb() is unimplemented for AArch64.\n"); abort(); } + +IMB_DLL_EXPORT +__attribute__((noreturn)) int +imb_self_test_get_cb(IMB_MGR *p_mgr, imb_self_test_cb_t *cb_fn, void **cb_arg) +{ + /* + * This method isn't supported on AArch64. However, it is stubbed to + * ensure ABI compatibility with the x86_64 ipsec-mb library. + * + * As this should never be called, it crashes. + */ + fprintf(stderr, "imb_self_test_get_cb() is unimplemented for AArch64.\n"); + abort(); +} -- GitLab From 53cc66c94ab3a169c2bb492b96d54346a7cefdac Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 9 Oct 2023 14:55:19 +0100 Subject: [PATCH 132/204] test: [CMAKE] add support to build imb-acvp app --- test/CMakeLists.txt | 19 ++++++++++++ test/acvp-app/CMakeLists.txt | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 test/acvp-app/CMakeLists.txt diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a746466e..851a4a03 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -39,3 +39,22 @@ if(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") add_subdirectory(wycheproof-app) endif() +if(NOT WINDOWS) + # build imb-acvp if libacvp available + if(NOT ACVP_LOC) + set(ACVP_LOC "/usr/local/acvp") + endif() + set(ACVP_INCLUDE_DIR "${ACVP_LOC}/include") + + # find libacvp + find_library( + ACVP_LIB libacvp.a libacvp + PATHS ${ACVP_LOC} + PATH_SUFFIXES lib) + + # add imb-acvp app if found + if(ACVP_LIB) + message(STATUS "ACVP_LIB... ${ACVP_LIB}") + add_subdirectory(acvp-app) + endif() +endif() diff --git a/test/acvp-app/CMakeLists.txt b/test/acvp-app/CMakeLists.txt new file mode 100644 index 00000000..37755ed0 --- /dev/null +++ b/test/acvp-app/CMakeLists.txt @@ -0,0 +1,57 @@ +# Copyright (c) 2023, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors may +# be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Ensure building entire project +if(NOT FULL_PROJECT_BUILD) + message(FATAL_ERROR "Please run CMake from project root directory") +endif() + +# ############################################################################## +# set app and library names +# ############################################################################## +set(ACVP_APP imb-acvp) +set(LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../lib) +set(TEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +# ############################################################################## +# set imb-acvp source files +# ############################################################################## +set(ACVP_APP_SRC_FILES_C ${CMAKE_CURRENT_SOURCE_DIR}/acvp_app_main.c + ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c) + +# ############################################################################## +# set toolchain options +# ############################################################################## +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/unix.cmake) + +include_directories(${LIB_DIR} ${TEST_INCLUDE_DIR} ${ACVP_INCLUDE_DIR}) +link_directories(${LIB_DIR}) + +# ############################################################################## +# add target +# ############################################################################## +add_executable(${ACVP_APP} ${ACVP_APP_SRC_FILES_C}) +target_link_libraries(${ACVP_APP} PRIVATE ${IPSEC_MB_LIB} ${ACVP_LIB}) +target_compile_definitions(${ACVP_APP} PRIVATE ${APP_DEFINES}) -- GitLab From edaffddd65abd99d9df6731d13a98b12fa6f4c73 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 10 Oct 2023 14:02:26 +0100 Subject: [PATCH 133/204] test: [acvp-app] remove 'utils.o' file during 'make clean' (fix for issue #130) --- test/acvp-app/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acvp-app/Makefile b/test/acvp-app/Makefile index 90d1c102..cfb57a3a 100644 --- a/test/acvp-app/Makefile +++ b/test/acvp-app/Makefile @@ -55,7 +55,7 @@ utils.o: ../common/utils.c .PHONY: clean clean: - -rm -f $(DEP_FILES) $(APP) + -rm -f $(DEP_FILES) $(APP) utils.o # if target not clean then make dependencies ifneq ($(MAKECMDGOALS),clean) -- GitLab From 1bea4196a6a25a215d5da396a05c3eae43637ff9 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Tue, 10 Oct 2023 13:28:49 +0100 Subject: [PATCH 134/204] test: [CMAKE] add support to build fuzz apps --- test/CMakeLists.txt | 5 +++ test/fuzz-app/CMakeLists.txt | 62 ++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 test/fuzz-app/CMakeLists.txt diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 851a4a03..5e3ba2e9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -57,4 +57,9 @@ if(NOT WINDOWS) message(STATUS "ACVP_LIB... ${ACVP_LIB}") add_subdirectory(acvp-app) endif() + + # add fuzz apps if using clang + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + add_subdirectory(fuzz-app) + endif() endif() diff --git a/test/fuzz-app/CMakeLists.txt b/test/fuzz-app/CMakeLists.txt new file mode 100644 index 00000000..eef2d58c --- /dev/null +++ b/test/fuzz-app/CMakeLists.txt @@ -0,0 +1,62 @@ +# Copyright (c) 2023, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors may +# be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Ensure building entire project +if(NOT FULL_PROJECT_BUILD) + message(FATAL_ERROR "Please run CMake from project root directory") +endif() + +# ############################################################################## +# set app and library names +# ############################################################################## +set(FUZZ_APP imb-fuzz-api) +set(DIRECT_FUZZ_APP imb-fuzz-direct-api) +set(LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../lib) +set(TEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +# ############################################################################## +# set source files +# ############################################################################## +set(FUZZ_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/job_api_fuzz_test.c) +set(DIRECT_FUZZ_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/direct_api_fuzz_test.c) + +# ############################################################################## +# set toolchain options +# ############################################################################## +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/unix.cmake) +string(APPEND CMAKE_C_FLAGS " -g -fsanitize=fuzzer,address,leak") + +include_directories(${LIB_DIR} ${TEST_INCLUDE_DIR}) + +# ############################################################################## +# add targets +# ############################################################################## +add_executable(${FUZZ_APP} ${FUZZ_SOURCES}) +target_link_libraries(${FUZZ_APP} PRIVATE ${IPSEC_MB_LIB}) +target_compile_definitions(${FUZZ_APP} PRIVATE ${APP_DEFINES}) + +add_executable(${DIRECT_FUZZ_APP} ${DIRECT_FUZZ_SOURCES}) +target_link_libraries(${DIRECT_FUZZ_APP} PRIVATE ${IPSEC_MB_LIB}) +target_compile_definitions(${DIRECT_FUZZ_APP} PRIVATE ${APP_DEFINES}) -- GitLab From 531a8b37ac2d447d82b3505e0e422b8377e27583 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Tue, 10 Oct 2023 13:47:06 +0100 Subject: [PATCH 135/204] fuzz-app: remove unused variable --- test/fuzz-app/job_api_fuzz_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fuzz-app/job_api_fuzz_test.c b/test/fuzz-app/job_api_fuzz_test.c index 7bb3e461..528663df 100644 --- a/test/fuzz-app/job_api_fuzz_test.c +++ b/test/fuzz-app/job_api_fuzz_test.c @@ -556,7 +556,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) fill_job_data(job, buff); fill_additional_cipher_data(job, buff, buffsize); fill_additional_hash_data(job, buff, buffsize); - job = IMB_SUBMIT_JOB(p_mgr); + IMB_SUBMIT_JOB(p_mgr); } } else if (burst) { IMB_JOB *jobs[MAX_BURST_JOBS] = { NULL }; -- GitLab From de884374f2b5746dafec0c8805dc2c5f508881bb Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 11 Oct 2023 14:28:52 +0100 Subject: [PATCH 136/204] test: [kat-app] fix 'large_buffer' memory leak --- test/kat-app/api_test.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index f65b035b..6979d413 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -892,14 +892,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) /* ======== test 6: full job queue wrapping around */ struct IMB_JOB *burst_jobs[IMB_MAX_BURST_SIZE] = { NULL }; - const int LG_BUFFER_SIZE = 1024 * 16; uint32_t num_jobs = 0; - uint8_t *large_buffer = malloc(LG_BUFFER_SIZE); - - if (large_buffer == NULL) { - printf("Failed to allocate large buffer\n"); - return 1; - } /* ensure all jobs flushed */ while (IMB_FLUSH_BURST(mb_mgr, IMB_MAX_BURST_SIZE, burst_jobs) != 0) @@ -928,6 +921,14 @@ test_burst_api(struct IMB_MGR *mb_mgr) } /* use large buffer for first (earliest) job */ + const size_t LG_BUFFER_SIZE = 1024 * 16; + uint8_t *large_buffer = malloc(LG_BUFFER_SIZE); + + if (large_buffer == NULL) { + printf("Failed to allocate large buffer\n"); + return 1; + } + burst_jobs[0]->msg_len_to_cipher_in_bytes = LG_BUFFER_SIZE; burst_jobs[0]->src = large_buffer; burst_jobs[0]->dst = large_buffer; @@ -937,6 +938,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (completed_jobs != 0) { printf("%s: test %d, unexpected number of completed jobs\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } @@ -944,6 +946,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (IMB_QUEUE_SIZE(mb_mgr) != num_jobs) { printf("%s: test %d, unexpected number of jobs in queue\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } @@ -951,6 +954,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (mb_mgr->earliest_job == -1) { printf("%s: test %d, job buffer unexpectedly marked 'empty'\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } @@ -959,6 +963,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (num_jobs != IMB_MAX_BURST_SIZE) { printf("%s: test %d, unexpected number of burst jobs\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } @@ -975,6 +980,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (completed_jobs != num_jobs) { printf("%s: test %d, unexpected number of completed jobs\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } @@ -982,6 +988,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (IMB_QUEUE_SIZE(mb_mgr) != (IMB_MAX_JOBS - num_jobs)) { printf("%s: test %d, unexpected number of jobs in queue\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } @@ -989,6 +996,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (mb_mgr->earliest_job == -1) { printf("%s: test %d, job buffer unexpectedly NOT marked 'empty'\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } @@ -997,9 +1005,12 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (completed_jobs != IMB_MAX_BURST_SIZE) { printf("%s: test %d, unexpected number of completed jobs\n", __func__, TEST_INVALID_BURST); + free(large_buffer); return 1; } + free(large_buffer); + /* 0 jobs in queue after flush */ if (IMB_QUEUE_SIZE(mb_mgr) != 0) { printf("%s: test %d, unexpected number of jobs in queue\n", __func__, @@ -1014,8 +1025,6 @@ test_burst_api(struct IMB_MGR *mb_mgr) return 1; } - free(large_buffer); - print_progress(); if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) -- GitLab From a34a5f440daf9b8d5ba9a414cdcb66b9d7a5f61f Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 11 Oct 2023 14:34:59 +0100 Subject: [PATCH 137/204] test: [acvp-app] simplify condition 'A || (!A && B)' into 'A || B' --- test/acvp-app/acvp_app_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/acvp-app/acvp_app_main.c b/test/acvp-app/acvp_app_main.c index b59c4d92..978c778c 100644 --- a/test/acvp-app/acvp_app_main.c +++ b/test/acvp-app/acvp_app_main.c @@ -615,8 +615,7 @@ tdes_cbc_handler(ACVP_TEST_CASE *test_case) } /* Create key schedules */ - if (tc->test_type != ACVP_SYM_TEST_TYPE_MCT || - (tc->test_type == ACVP_SYM_TEST_TYPE_MCT && tc->mct_index == 0)) { + if (tc->test_type != ACVP_SYM_TEST_TYPE_MCT || tc->mct_index == 0) { /* * Always create key schedules unless this is continuation of * Monte Carlo inner loop. -- GitLab From 570271e32fe3459eddae5ce717144291936a37cd Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 11 Oct 2023 14:36:30 +0100 Subject: [PATCH 138/204] lib: [cpuid] eliminate duplicate condition check --- lib/x86_64/cpu_feature.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/x86_64/cpu_feature.c b/lib/x86_64/cpu_feature.c index a70d7f72..4267815c 100644 --- a/lib/x86_64/cpu_feature.c +++ b/lib/x86_64/cpu_feature.c @@ -221,11 +221,10 @@ cpu_feature_detect(void) if (hi_leaf_number >= 1) mbcpuid(0x1, 0x0, &cpuid_1_0); - if (hi_leaf_number >= 7) + if (hi_leaf_number >= 7) { mbcpuid(0x7, 0x0, &cpuid_7_0); - - if (hi_leaf_number >= 7) mbcpuid(0x7, 0x1, &cpuid_7_1); + } for (i = 0; i < IMB_DIM(feat_tab); i++) { if (hi_leaf_number < feat_tab[i].req_leaf_number) -- GitLab From 54f17ee0f148eb5a6a9ef0f234999837dc6728fe Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 11 Oct 2023 15:51:14 +0100 Subject: [PATCH 139/204] lib: [self-test] self-test callback data wrapped into single structure --- README.md | 48 +++++++++++++++++++++-------------------- lib/ipsec-mb.h | 10 +++++++-- lib/x86_64/self_test.c | 4 +++- test/kat-app/api_test.c | 28 ++++++++++++++++-------- test/kat-app/main.c | 36 +++++++++++++++---------------- 5 files changed, 73 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 938a2d09..2ba26505 100644 --- a/README.md +++ b/README.md @@ -831,13 +831,13 @@ bypass test). Application can register self-test callback function to track test progress. Optionally application can corrupt input message for selected tests and observe change in the test result. -Typical sequence of callbacks received by application is: -- callback(IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_CIPHER, "AES128-CBC") -- callback(IMB_SELF_TEST_PHASE_CORRUPT, NULL, NULL) +Example sequence of callbacks received by an application is: +- callback(data.phase = IMB_SELF_TEST_PHASE_START, data.type = IMB_SELF_TEST_TYPE_KAT_CIPHER, data.descr = "AES128-CBC") => return 1 +- callback(data.phase = IMB_SELF_TEST_PHASE_CORRUPT) - return 1: no message corruption - - return 0: corrupt the 1st byte -- callback(IMB_SELF_TEST_PHASE_PASS or IMB_SELF_TEST_PHASE_PASS, NULL, NULL) => return 1 -- callback(IMB_SELF_TEST_PHASE_START, IMB_SELF_TEST_TYPE_KAT_CIPHER, "AES192-CBC") => return 1 + - return 0: corrupt single bit in the 1st byte +- callback(data.phase = IMB_SELF_TEST_PHASE_PASS or IMB_SELF_TEST_PHASE_PASS) => return 1 +- callback(data.phase = IMB_SELF_TEST_PHASE_START, data.type = IMB_SELF_TEST_TYPE_KAT_CIPHER, data.descr = "AES192-CBC") => return 1 - ... Note that value returned by application self-test callback function only matters in the corrupt phase. @@ -899,30 +899,32 @@ Example registration of self-test callback function: ``` int self_test_corrupt = 0; -int callback(void *arg, const char *phase, const char *type, const char *descr) +int callback(void *arg, const IMB_SELF_TEST_CALLBACK_DATA *data) { - const char *pphase = ""; - const char *ptype = ""; - const char *pdescr = ""; + const char *phase = ""; + const char *type = ""; + const char *descr = ""; - if (phase != NULL) - pphase = phase; + (void) arg; - if (type != NULL) - ptype = type; + if (data != NULL) { + if (data->phase != NULL) + phase = data->phase; + if (data->type != NULL) + type = data->type; + if (data->descr != NULL) + descr = data->descr; + } - if (descr != NULL) - pdescr = descr; + if (strcmp(phase, IMB_SELF_TEST_PHASE_START) == 0) + printf("%s : %s : ", type, descr); - if (strcmp(pphase, IMB_SELF_TEST_PHASE_START) == 0) - printf("%s : %s : ", ptype, pdescr); - - if ((strcmp(pphase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) && (self_test_corrupt == 1)) + if ((strcmp(phase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) && (self_test_corrupt == 1)) return 0; /* corrupt input message */ - if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0 || - strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) - printf("%s\n", pphase); + if (strcmp(phase, IMB_SELF_TEST_PHASE_PASS) == 0 || + strcmp(phase, IMB_SELF_TEST_PHASE_FAIL) == 0) + printf("%s\n", phase); return 1; } diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index f169437e..0a96605e 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -890,8 +890,14 @@ typedef void (*chacha20_hp_quic_t)(const void *, const void *const *, void **, c typedef void (*sm4_keyexp_t)(const void *, void *, void *); -typedef int (*imb_self_test_cb_t)(void *cb_arg, const char *phase, const char *type, - const char *descr); +/* Self-Test callback definitions */ +typedef struct { + const char *phase; + const char *type; + const char *descr; +} IMB_SELF_TEST_CALLBACK_DATA; + +typedef int (*imb_self_test_cb_t)(void *cb_arg, const IMB_SELF_TEST_CALLBACK_DATA *data); /* Multi-buffer manager flags passed to alloc_mb_mgr() */ #define IMB_FLAG_SHANI_OFF (1ULL << 0) /**< disable use of SHANI extension */ diff --git a/lib/x86_64/self_test.c b/lib/x86_64/self_test.c index 9688267f..aecacef7 100644 --- a/lib/x86_64/self_test.c +++ b/lib/x86_64/self_test.c @@ -68,7 +68,9 @@ make_callback(IMB_MGR *p_mgr, const char *phase, const char *type, const char *d if (p_mgr->self_test_cb_fn == NULL) return 1; - return p_mgr->self_test_cb_fn(p_mgr->self_test_cb_arg, phase, type, descr); + const IMB_SELF_TEST_CALLBACK_DATA data = { .phase = phase, .type = type, .descr = descr }; + + return p_mgr->self_test_cb_fn(p_mgr->self_test_cb_arg, &data); } /* diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 6979d413..9f2fa597 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -2663,23 +2663,33 @@ struct self_test_context { }; static int -self_test_callback(void *arg, const char *phase, const char *type, const char *descr) +self_test_callback(void *arg, const IMB_SELF_TEST_CALLBACK_DATA *data) { struct self_test_context *p = (struct self_test_context *) arg; - const char *pphase = ""; + const char *phase = ""; + + IMB_ASSERT(p != NULL); + if (p == NULL) + return 1; p->all_counter++; - if (phase != NULL) - pphase = phase; + IMB_ASSERT(data != NULL); + if (data == NULL) { + p->error_counter++; + return 1; + } + + if (data->phase != NULL) + phase = data->phase; else p->error_counter++; - if (strcmp(pphase, IMB_SELF_TEST_PHASE_START) == 0) { + if (strcmp(phase, IMB_SELF_TEST_PHASE_START) == 0) { p->start_counter++; - if (type == NULL || descr == NULL) + if (data->type == NULL || data->descr == NULL) p->error_counter++; - } else if (strcmp(pphase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) { + } else if (strcmp(phase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) { p->corrupt_counter++; if (p->is_corrupt) { /* @@ -2692,9 +2702,9 @@ self_test_callback(void *arg, const char *phase, const char *type, const char *d } } return 1; - } else if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0) { + } else if (strcmp(phase, IMB_SELF_TEST_PHASE_PASS) == 0) { p->pass_counter++; - } else if (strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) { + } else if (strcmp(phase, IMB_SELF_TEST_PHASE_FAIL) == 0) { p->fail_counter++; } else { p->error_counter++; diff --git a/test/kat-app/main.c b/test/kat-app/main.c index baac1cd3..cc6c112e 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -318,32 +318,32 @@ check_err_no_aesni_emu(const uint64_t feature_flags, IMB_MGR *p_mgr) } static int -self_test_cb(void *arg, const char *phase, const char *type, const char *descr) +self_test_cb(void *arg, const IMB_SELF_TEST_CALLBACK_DATA *data) { - const char *pphase = ""; - const char *ptype = ""; - const char *pdescr = ""; + const char *phase = ""; + const char *type = ""; + const char *descr = ""; (void) arg; - if (phase != NULL) - pphase = phase; - - if (type != NULL) - ptype = type; - - if (descr != NULL) - pdescr = descr; + if (data != NULL) { + if (data->phase != NULL) + phase = data->phase; + if (data->type != NULL) + type = data->type; + if (data->descr != NULL) + descr = data->descr; + } - if (strcmp(pphase, IMB_SELF_TEST_PHASE_START) == 0) - printf("%s : %s : ", ptype, pdescr); + if (strcmp(phase, IMB_SELF_TEST_PHASE_START) == 0) + printf("%s : %s : ", type, descr); - if ((strcmp(pphase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) && (self_test_corrupt == 1)) + if ((strcmp(phase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) && (self_test_corrupt == 1)) return 0; - if (strcmp(pphase, IMB_SELF_TEST_PHASE_PASS) == 0 || - strcmp(pphase, IMB_SELF_TEST_PHASE_FAIL) == 0) - printf("%s\n", pphase); + if (strcmp(phase, IMB_SELF_TEST_PHASE_PASS) == 0 || + strcmp(phase, IMB_SELF_TEST_PHASE_FAIL) == 0) + printf("%s\n", phase); return 1; } -- GitLab From 88947a59789ab430ad978be360fac2adb1c08940 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 16 Oct 2023 11:42:09 +0100 Subject: [PATCH 140/204] lib: [snow3g] fix for potential buffer over-run in cipher (UEA2) and bit length messages Issue observed in IMB_SNOW3G_F8_1_BUFFER_BIT(). --- lib/include/snow3g_common.h | 18 ++-- lib/include/wireless_common.h | 160 ++++++++++++++++++++-------------- 2 files changed, 105 insertions(+), 73 deletions(-) diff --git a/lib/include/snow3g_common.h b/lib/include/snow3g_common.h index 6e413719..a58a5ef9 100644 --- a/lib/include/snow3g_common.h +++ b/lib/include/snow3g_common.h @@ -2411,16 +2411,22 @@ SNOW3G_F8_1_BUFFER_BIT(const snow3g_key_schedule_t *pHandle, const void *pIV, co return; } #endif + const size_t off_bytes = offsetInBits / 8; + uint8_t *dst = ((uint8_t *) pBufferOut) + off_bytes; + const uint8_t *src = ((const uint8_t *) pBufferIn) + off_bytes; + uint8_t save_start = 0, save_end = 0; - uint8_t *dst = &((uint8_t *) pBufferOut)[offsetInBits >> 3]; + const size_t off_bits = offsetInBits & 7; + + msg_save_start_end(dst, off_bits, lengthInBits, &save_start, &save_end); + msg_shl_copy(dst, src, off_bits, lengthInBits); - save_msg_start_end(dst, offsetInBits & 7, lengthInBits, &save_start, &save_end); - copy_bits(dst, pBufferIn, offsetInBits, lengthInBits); + const uint32_t len_bytes = (lengthInBits + 7) / 8; /* round up */ - SNOW3G_F8_1_BUFFER(pHandle, pIV, dst, dst, (lengthInBits + 7) / 8); + SNOW3G_F8_1_BUFFER(pHandle, pIV, dst, dst, len_bytes); - shift_bits(dst, offsetInBits & 7, lengthInBits); - restore_msg_start_end(dst, offsetInBits & 7, lengthInBits, save_start, save_end); + msg_shr(dst, off_bits, lengthInBits); + msg_restore_start_end(dst, off_bits, lengthInBits, save_start, save_end); } /** diff --git a/lib/include/wireless_common.h b/lib/include/wireless_common.h index ae964784..d0fc7c63 100644 --- a/lib/include/wireless_common.h +++ b/lib/include/wireless_common.h @@ -183,35 +183,38 @@ memcpy_keystrm(uint8_t *pDst, const uint8_t *pSrc, const uint32_t len) * @brief Save start and end of the buffer around message * * @param msg message buffer (destination buffer) - * @param bit_offset message offset in bits + * @param bit_offset message offset in bits (0- 7) * @param bit_length message length in bits * @param save_start place to store start byte * @param save_end place to store end byte */ static inline void -save_msg_start_end(const void *msg, const size_t bit_offset, const size_t bit_length, +msg_save_start_end(const void *msg, const size_t bit_offset, const size_t bit_length, uint8_t *save_start, uint8_t *save_end) { - const uint8_t *msg_ptr = (const uint8_t *) msg; - const size_t mstart_bit = bit_offset & 7; /* inclusive */ - const size_t mend_bit = (mstart_bit + bit_length) & 7; /* non-inclusive */ - *save_start = 0; *save_end = 0; - if (bit_length == 0) + if (bit_length == 0 || bit_offset == 0) return; - if (mstart_bit != 0) { - const uint8_t msg_start = msg_ptr[bit_offset >> 3]; + /* 0xff << (8 - i) */ + static const uint8_t mtab_shl[8] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; + const uint8_t *msg_ptr = (const uint8_t *) msg; - *save_start = msg_start & (0xff << (8 - mstart_bit)); - } + *save_start = *msg_ptr & mtab_shl[bit_offset]; - if (mend_bit != 0) { - const uint8_t msg_end = msg_ptr[(bit_offset + bit_length) >> 3]; + /* 0xff >> i */ + static const uint8_t mtab_shr[8] = { 0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; + const size_t blast = bit_offset + bit_length; + const size_t bend = blast & 7; /* non-inclusive */ - *save_end = msg_end & (0xff >> mend_bit); + if (blast < 8) { + *save_end = msg_ptr[0] & mtab_shr[bend]; + } else { + const size_t i = ((bend == 0) ? (blast - 8) : blast) / 8; + + *save_end = msg_ptr[i] & mtab_shr[bend]; } } @@ -225,60 +228,87 @@ save_msg_start_end(const void *msg, const size_t bit_offset, const size_t bit_le * @param save_end saved end byte to be restored */ static inline void -restore_msg_start_end(void *msg, const size_t bit_offset, const size_t bit_length, +msg_restore_start_end(void *msg, const size_t bit_offset, const size_t bit_length, const uint8_t save_start, const uint8_t save_end) { - uint8_t *msg_ptr = (uint8_t *) msg; - - if (bit_length == 0) + if (bit_length == 0 || bit_offset == 0) return; + uint8_t *msg_ptr = (uint8_t *) msg; + if (save_start != 0) msg_ptr[bit_offset >> 3] |= save_start; - if (save_end != 0) - msg_ptr[(bit_offset + bit_length) >> 3] |= save_end; + if (save_end != 0) { + const size_t blast = bit_offset + bit_length; + + if (blast < 8) { + msg_ptr[0] |= save_end; + } else { + const size_t bend = blast & 7; /* non-inclusive */ + const size_t i = ((bend == 0) ? (blast - 8) : blast) / 8; + + msg_ptr[i] |= save_end; + } + } } /** * @brief Copy bit message from \a src to \dst * + * When reading data from \a src, shift left \a src by \a src_bit_offset number bits + * * @param dst destination buffer * @param src source buffer - * @param bit_offset offset from in bits from \a src + * @param src_bit_offset offset from in bits from \a src (0 - 7) * @param bit_length message length in bits */ static inline void -copy_bits(void *dst, const void *src, const size_t bit_offset, const size_t bit_length) +msg_shl_copy(void *dst, const void *src, const size_t src_bit_offset, const size_t bit_length) { uint8_t *dp = (uint8_t *) dst; - const uint8_t *sp = &((const uint8_t *) src)[bit_offset >> 3]; - const size_t mstart_bit = bit_offset & 7; - const size_t mend_bit = (bit_offset + bit_length) & 7; - size_t byte_length = (bit_length + 7) >> 3; + const uint8_t *sp = (const uint8_t *) src; - if (bit_length == 0) - return; + const size_t bit_start = src_bit_offset; + const size_t byte_length = bit_length / 8; - for (; byte_length >= 1; byte_length--) { - if (mstart_bit == 0) { - *dp++ = *sp++; + size_t i; + + for (i = 0; i < byte_length; i++) { + if (bit_start == 0) { + dp[i] = sp[i]; } else { - *dp++ = (sp[0] << mstart_bit) | (sp[1] >> (8 - mstart_bit)); - sp++; + const uint8_t nibble1 = sp[i] << bit_start; + const uint8_t nibble2 = sp[i + 1] >> (8 - bit_start); + + dp[i] = nibble1 | nibble2; } } - if (mstart_bit == 0) { - if (mend_bit == 0) - *dp = *sp; - else - *dp = *sp & (0xff << (8 - mend_bit)); - } else { - if (mend_bit == 0) - *dp = *sp << mstart_bit; - else - *dp = (*sp & (0xff << (8 - mend_bit))) << mstart_bit; + const size_t last_byte_bits = bit_length & 7; + + if (last_byte_bits != 0) { + if (bit_start == 0) { + dp[i] = sp[i]; + } else { + if (last_byte_bits <= (8 - bit_start)) { + const uint8_t nibble = sp[i] << bit_start; + + dp[i] = nibble; + } else { + const uint8_t nibble1 = sp[i] << bit_start; + const uint8_t nibble2 = sp[i + 1] >> (8 - bit_start); + + dp[i] = nibble1 | nibble2; + } + } + + /* 0xff << (8 - i) */ + static const uint8_t mtab_shl[8] = { + 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe + }; + + dp[i] = dp[i] & mtab_shl[last_byte_bits]; } } @@ -294,40 +324,36 @@ copy_bits(void *dst, const void *src, const size_t bit_offset, const size_t bit_ * 00A7A6A5A4A3A2A1 A0B7B6B5B4B3B2B1 B0 * * @param msg message buffer - * @param bit_offset number of bits to shift \a msg right by + * @param bit_offset number of bits to shift \a msg right by (0 to 7) * @param bit_length message length in bits */ static inline void -shift_bits(void *msg, const size_t bit_offset, const size_t bit_length) +msg_shr(void *msg, const size_t nbits, const size_t bit_length) { - uint8_t *dst = (uint8_t *) msg; - const size_t mstart_bit = bit_offset & 7; - const size_t mend_bit = (bit_offset + bit_length) & 7; - size_t byte_length = (bit_length + 7) >> 3; - - if (bit_length == 0) + if (nbits == 0 || bit_length == 0) return; - if (mstart_bit != 0) { - uint8_t byte_save = 0; + uint8_t *dp = (uint8_t *) msg; + const size_t byte_length = bit_length / 8; + uint8_t carry = 0; + size_t i; - if (byte_length == 1) { - *dst = (*dst & (0xff << (8 - mend_bit))) >> mstart_bit; - return; - } + for (i = 0; i < byte_length; i++) { + const uint8_t nibble = dp[i]; + + dp[i] = (carry << (8 - nbits)) | (nibble >> nbits); + carry = nibble; + } - for (; byte_length >= 1; byte_length--) { - const uint8_t c = *dst; + /* 0xff << (8 - i) */ + static const uint8_t mtab_shl[8] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; + const size_t last_byte_bits = bit_length & 7; + const uint8_t nibble = (last_byte_bits != 0) ? (dp[i] & mtab_shl[last_byte_bits]) : 0; - *dst++ = (c >> mstart_bit) | byte_save; - byte_save = c << (8 - mstart_bit); - } + dp[i] = (carry << (8 - nbits)) | (nibble >> nbits); - *dst = byte_save; - } else { - if (mend_bit != 0) - dst[byte_length] &= (0xff << (8 - mend_bit)); - } + if ((last_byte_bits + nbits) > 8) + dp[i + 1] = nibble << (8 - nbits); } /** -- GitLab From 6dc1fc65c19abf261d8df26cf7b28d0c4a417e8f Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 16 Oct 2023 11:45:48 +0100 Subject: [PATCH 141/204] test: [fuzz-app] direct API fuzz-app update - fixes to issues with correct API usage - all test return feedback value to the fuzzer - imb_clear_mem() test added - imb_quic_aes_gcm() test added --- test/fuzz-app/direct_api_fuzz_test.c | 525 ++++++++++++++++----------- 1 file changed, 311 insertions(+), 214 deletions(-) diff --git a/test/fuzz-app/direct_api_fuzz_test.c b/test/fuzz-app/direct_api_fuzz_test.c index 73d40d3b..e19e9866 100644 --- a/test/fuzz-app/direct_api_fuzz_test.c +++ b/test/fuzz-app/direct_api_fuzz_test.c @@ -51,14 +51,10 @@ enum ar { enum ar arch; -int count = 8; - static void parse_matched(int argc, char **argv) { - int i; - - for (i = 0; i < argc; i++) { + for (int i = 0; i < argc; i++) { #ifndef __aarch64__ if (strcmp(argv[i], "SSE") == 0) arch = SSE; @@ -80,9 +76,7 @@ parse_matched(int argc, char **argv) int LLVMFuzzerInitialize(int *argc, char ***argv) { - int i; - - for (i = 0; i < *argc; i++) { + for (int i = 0; i < *argc; i++) { /* * Check if the current argument matches the * argument we are looking for. @@ -101,123 +95,115 @@ LLVMFuzzerInitialize(int *argc, char ***argv) return 0; } -static void +static int test_snow3g_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *init_key = buff; - snow3g_key_schedule_t exp_key_s; - snow3g_key_schedule_t *exp_key = &exp_key_s; + snow3g_key_schedule_t exp_key; - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < sizeof(exp_key)) + return -1; - IMB_SNOW3G_INIT_KEY_SCHED(p_mgr, init_key, exp_key); + IMB_SNOW3G_INIT_KEY_SCHED(p_mgr, init_key, &exp_key); + return 0; } -static void +static int test_snow3g_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES || dataSize < sizeof(snow3g_key_schedule_t)) + return -1; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - - len = len * 8; const uint8_t *iv = buff; - const uint32_t offset = *(uint32_t *) buff; + const size_t dataSizeBits = dataSize * 8; + const size_t offsetBits = buff[0] % dataSizeBits; + const uint64_t lenBits = dataSizeBits - offsetBits; + snow3g_key_schedule_t exp_key; - IMB_SNOW3G_F8_1_BUFFER_BIT(p_mgr, exp_key, iv, in, out, len, offset); + IMB_SNOW3G_F8_1_BUFFER_BIT(p_mgr, &exp_key, iv, in, out, lenBits, offsetBits); + return 0; } -static void +static int test_snow3g_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + return -1; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint8_t *iv = buff; + snow3g_key_schedule_t exp_key; - IMB_SNOW3G_F8_1_BUFFER(p_mgr, exp_key, iv, in, out, len); + IMB_SNOW3G_F8_1_BUFFER(p_mgr, &exp_key, iv, in, out, len); + return 0; } -static void +static int test_snow3g_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + return -1; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint8_t *iv = buff; + snow3g_key_schedule_t exp_key; - IMB_SNOW3G_F8_2_BUFFER(p_mgr, exp_key, iv, iv, in, out, len, in, out, len); + IMB_SNOW3G_F8_2_BUFFER(p_mgr, &exp_key, iv, iv, in, out, len, in, out, len); + return 0; } -static void +static int test_snow3g_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + return -1; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint8_t *iv = buff; + snow3g_key_schedule_t exp_key; - IMB_SNOW3G_F8_4_BUFFER(p_mgr, exp_key, iv, iv, iv, iv, in, out, len, in, out, len, in, out, + IMB_SNOW3G_F8_4_BUFFER(p_mgr, &exp_key, iv, iv, iv, iv, in, out, len, in, out, len, in, out, len, in, out, len); + return 0; } -static void +static int test_snow3g_f8_8_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + return -1; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint8_t *iv = buff; + snow3g_key_schedule_t exp_key; - IMB_SNOW3G_F8_8_BUFFER(p_mgr, exp_key, iv, iv, iv, iv, iv, iv, iv, iv, in, out, len, in, + IMB_SNOW3G_F8_8_BUFFER(p_mgr, &exp_key, iv, iv, iv, iv, iv, iv, iv, iv, in, out, len, in, out, len, in, out, len, in, out, len, in, out, len, in, out, len, in, out, len, in, out, len); + return 0; } -static void +static int test_snow3g_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + return -1; const void *iv[8]; const void *in[8]; void *out[8]; uint32_t len[8]; + snow3g_key_schedule_t exp_key; for (int i = 0; i < 8; i++) { iv[i] = buff; @@ -226,81 +212,80 @@ test_snow3g_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) len[i] = dataSize; } - IMB_SNOW3G_F8_N_BUFFER(p_mgr, exp_key, iv, in, out, len, count); + IMB_SNOW3G_F8_N_BUFFER(p_mgr, &exp_key, iv, in, out, len, 8); + return 0; } -static void +static int test_snow3g_f8_8_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + return -1; const void *iv[8]; const void *in[8]; void *out[8]; uint32_t len[8]; + snow3g_key_schedule_t key_sched; + const snow3g_key_schedule_t *exp_key[8]; for (int i = 0; i < 8; i++) { iv[i] = buff; in[i] = buff; out[i] = buff; len[i] = dataSize; + exp_key[i] = &key_sched; } - IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(p_mgr, &exp_key, iv, in, out, len); + IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(p_mgr, exp_key, iv, in, out, len); + return 0; } -static void +static int test_snow3g_f8_n_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; + if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + return -1; const void *iv[8]; const void *in[8]; void *out[8]; uint32_t len[8]; + snow3g_key_schedule_t key_sched; + const snow3g_key_schedule_t *exp_key[8]; for (int i = 0; i < 8; i++) { iv[i] = buff; in[i] = buff; out[i] = buff; len[i] = dataSize; + exp_key[i] = &key_sched; } - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(p_mgr, &exp_key, iv, in, out, len, count); + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(p_mgr, exp_key, iv, in, out, len, 8); + return 0; } -static void +static int test_snow3g_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const snow3g_key_schedule_t exp_key_s; - const snow3g_key_schedule_t *exp_key = &exp_key_s; - - if (dataSize < sizeof(exp_key_s)) - return; - + snow3g_key_schedule_t exp_key; const uint8_t *in = buff; uint64_t len = dataSize; const uint8_t *iv = buff; uint8_t *auth_tag = buff; - IMB_SNOW3G_F9_1_BUFFER(p_mgr, exp_key, iv, in, len, auth_tag); + IMB_SNOW3G_F9_1_BUFFER(p_mgr, &exp_key, iv, in, len, auth_tag); + return 0; } #ifndef __aarch64__ -static void +static int test_aes128_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -314,14 +299,15 @@ test_aes128_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint64_t tag_len = (uint64_t) *buff; IMB_AES128_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + return 0; } -static void +static int test_aes128_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -335,14 +321,15 @@ test_aes128_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint64_t tag_len = (uint64_t) *buff; IMB_AES128_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + return 0; } -static void +static int test_aes192_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -356,14 +343,15 @@ test_aes192_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint64_t tag_len = (uint64_t) *buff; IMB_AES192_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + return 0; } -static void +static int test_aes192_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -377,14 +365,15 @@ test_aes192_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint64_t tag_len = (uint64_t) *buff; IMB_AES192_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + return 0; } -static void +static int test_aes256_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -398,14 +387,15 @@ test_aes256_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint64_t tag_len = (uint64_t) *buff; IMB_AES256_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + return 0; } -static void +static int test_aes256_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -419,14 +409,15 @@ test_aes256_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint64_t tag_len = (uint64_t) *buff; IMB_AES256_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + return 0; } -static void +static int test_aes128_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -442,14 +433,15 @@ test_aes128_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_AES128_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); IMB_AES128_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); IMB_AES128_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + return 0; } -static void +static int test_aes128_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -465,14 +457,15 @@ test_aes128_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_AES128_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); IMB_AES128_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); IMB_AES128_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + return 0; } -static void +static int test_aes192_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -488,14 +481,15 @@ test_aes192_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_AES192_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); IMB_AES192_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); IMB_AES192_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + return 0; } -static void +static int test_aes192_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -511,14 +505,16 @@ test_aes192_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_AES192_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); IMB_AES192_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); IMB_AES192_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + return 0; } -static void +static int test_aes256_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; + const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; @@ -533,14 +529,15 @@ test_aes256_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_AES256_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); IMB_AES256_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); IMB_AES256_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + return 0; } -static void +static int test_aes256_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { if ((dataSize < sizeof(struct gcm_key_data)) || (dataSize < sizeof(struct gcm_context_data))) - return; + return -1; const struct gcm_key_data *key = (const struct gcm_key_data *) buff; struct gcm_context_data *ctx = (struct gcm_context_data *) buff; @@ -556,16 +553,17 @@ test_aes256_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) IMB_AES256_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); IMB_AES256_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); IMB_AES256_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + return 0; } #endif /* __aarch64__ */ -static void +static int test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) - return; + return -1; void *out = buff; const void *in = buff; @@ -573,15 +571,16 @@ test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) const void *iv = (const void *) buff; IMB_ZUC_EEA3_1_BUFFER(p_mgr, key, iv, in, out, len); + return 0; } -static void +static int test_zuc_eea3_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key[4]; if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) - return; + return -1; const void *iv[4]; const void *in[4]; @@ -597,22 +596,23 @@ test_zuc_eea3_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) } IMB_ZUC_EEA3_4_BUFFER(p_mgr, key, iv, in, out, len); + return 0; } -static void +static int test_zuc_eea3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key[8]; if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) - return; + return -1; const void *iv[8]; const void *in[8]; void *out[8]; uint32_t len[8]; - for (int i = 0; i < count; i++) { + for (int i = 0; i < 8; i++) { key[i] = buff; iv[i] = buff; in[i] = buff; @@ -620,16 +620,17 @@ test_zuc_eea3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) len[i] = dataSize; } - IMB_ZUC_EEA3_N_BUFFER(p_mgr, key, iv, in, out, len, count); + IMB_ZUC_EEA3_N_BUFFER(p_mgr, key, iv, in, out, len, 8); + return 0; } -static void +static int test_zuc_eia3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) - return; + return -1; const void *in = buff; uint32_t len = dataSize * 8; @@ -637,23 +638,23 @@ test_zuc_eia3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) uint32_t *tag = (uint32_t *) buff; IMB_ZUC_EIA3_1_BUFFER(p_mgr, key, iv, in, len, tag); + return 0; } -static void +static int test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *key[8]; - if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) - return; + return -1; const void *iv[8]; const void *in[8]; void *tag_ptr_array[8]; uint32_t len[8]; uint32_t *tag[8]; + const void *key[8]; - for (int i = 0; i < count; i++) { + for (int i = 0; i < 8; i++) { key[i] = buff; iv[i] = buff; in[i] = buff; @@ -662,307 +663,396 @@ test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) len[i] = dataSize * 8; } - IMB_ZUC_EIA3_N_BUFFER(p_mgr, key, iv, in, len, tag, count); + IMB_ZUC_EIA3_N_BUFFER(p_mgr, key, iv, in, len, tag, 8); + return 0; } #ifndef __aarch64__ -static void +static int test_chacha_poly_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < sizeof(struct chacha20_poly1305_context_data)) - return; + if (dataSize < IMB_CHACHA20_POLY1305_KEY_SIZE || dataSize < IMB_CHACHA20_POLY1305_IV_SIZE) + return -1; - struct chacha20_poly1305_context_data *ctx = (struct chacha20_poly1305_context_data *) buff; + struct chacha20_poly1305_context_data ctx; const void *key = buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; + const uint64_t len = dataSize; const uint8_t *iv = buff; const uint8_t *aad = buff; - uint64_t aad_len = dataSize; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t aad_len = dataSize; + uint8_t auth_tag[256]; + const uint64_t tag_len = (uint64_t) buff[0]; - IMB_CHACHA20_POLY1305_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_CHACHA20_POLY1305_ENC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_CHACHA20_POLY1305_ENC_FINALIZE(p_mgr, ctx, auth_tag, tag_len); + IMB_CHACHA20_POLY1305_INIT(p_mgr, key, &ctx, iv, aad, aad_len); + IMB_CHACHA20_POLY1305_ENC_UPDATE(p_mgr, key, &ctx, out, in, len); + IMB_CHACHA20_POLY1305_ENC_FINALIZE(p_mgr, &ctx, auth_tag, tag_len); + return 0; } -static void +static int test_chacha_poly_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < sizeof(struct chacha20_poly1305_context_data)) - return; + if (dataSize < IMB_CHACHA20_POLY1305_KEY_SIZE || dataSize < IMB_CHACHA20_POLY1305_IV_SIZE) + return -1; - struct chacha20_poly1305_context_data *ctx = (struct chacha20_poly1305_context_data *) buff; + struct chacha20_poly1305_context_data ctx; const void *key = buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; + const uint64_t len = dataSize; const uint8_t *iv = buff; const uint8_t *aad = buff; - uint64_t aad_len = dataSize; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t aad_len = dataSize; + uint8_t auth_tag[256]; + const uint64_t tag_len = (uint64_t) buff[0]; - IMB_CHACHA20_POLY1305_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_CHACHA20_POLY1305_DEC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_CHACHA20_POLY1305_DEC_FINALIZE(p_mgr, ctx, auth_tag, tag_len); + IMB_CHACHA20_POLY1305_INIT(p_mgr, key, &ctx, iv, aad, aad_len); + IMB_CHACHA20_POLY1305_DEC_UPDATE(p_mgr, key, &ctx, out, in, len); + IMB_CHACHA20_POLY1305_DEC_FINALIZE(p_mgr, &ctx, auth_tag, tag_len); + return 0; } -static void +static int test_crc32_ethernet_fcs(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC32_ETHERNET_FCS(p_mgr, in, len); + return 0; } -static void +static int test_crc16_x25(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC16_X25(p_mgr, in, len); + return 0; } -static void +static int test_crc32_sctp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC32_SCTP(p_mgr, in, len); + return 0; } -static void +static int test_crc24_lte_a(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC24_LTE_A(p_mgr, in, len); + return 0; } -static void +static int test_crc24_lte_b(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC24_LTE_B(p_mgr, in, len); + return 0; } -static void +static int test_crc16_fp_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC16_FP_DATA(p_mgr, in, len); + return 0; } -static void +static int test_crc11_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC11_FP_HEADER(p_mgr, in, len); + return 0; } -static void +static int test_crc7_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC7_FP_HEADER(p_mgr, in, len); + return 0; } -static void +static int test_crc10_iuup_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC10_IUUP_DATA(p_mgr, in, len); + return 0; } -static void +static int test_crc6_iuup_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC6_IUUP_HEADER(p_mgr, in, len); + return 0; } -static void +static int test_crc32_wimax_ofdma_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC32_WIMAX_OFDMA_DATA(p_mgr, in, len); + return 0; } -static void +static int test_crc8_wimax_ofdma_hcs(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *in = buff; const uint64_t len = dataSize; IMB_CRC8_WIMAX_OFDMA_HCS(p_mgr, in, len); + return 0; } -static void +static int test_kasumi_f8_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; - kasumi_key_sched_t exp_key_s; - kasumi_key_sched_t *exp_key = &exp_key_s; + kasumi_key_sched_t exp_key; if (dataSize < IMB_KASUMI_KEY_SIZE) - return; + return -1; - IMB_KASUMI_INIT_F8_KEY_SCHED(p_mgr, key, exp_key); + IMB_KASUMI_INIT_F8_KEY_SCHED(p_mgr, key, &exp_key); + return 0; } -static void +static int test_kasumi_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; - const uint32_t offset = (uint32_t) *buff * 8; - - if (offset >= (dataSize * 8)) - return; + if (dataSize < IMB_KASUMI_IV_SIZE) + return -1; + kasumi_key_sched_t exp_key; + const uint32_t offset = ((uint32_t) *buff * 8) % (dataSize * 8); uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = (dataSize * 8) - offset; + const uint64_t len = (dataSize * 8) - offset; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_1_BUFFER_BIT(p_mgr, exp_key, iv, in, out, len, offset); + IMB_KASUMI_F8_1_BUFFER_BIT(p_mgr, &exp_key, iv, in, out, len, offset); + return 0; } -static void +static int test_kasumi_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; + if (dataSize < IMB_KASUMI_IV_SIZE) + return -1; + + kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_1_BUFFER(p_mgr, exp_key, iv, in, out, len); + IMB_KASUMI_F8_1_BUFFER(p_mgr, &exp_key, iv, in, out, len); + return 0; } -static void +static int test_kasumi_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; + if (dataSize < IMB_KASUMI_IV_SIZE) + return -1; + + kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_2_BUFFER(p_mgr, exp_key, iv, iv, in, out, len, in, out, len); + IMB_KASUMI_F8_2_BUFFER(p_mgr, &exp_key, iv, iv, in, out, len, in, out, len); + return 0; } -static void +static int test_kasumi_f8_3_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; + if (dataSize < IMB_KASUMI_IV_SIZE) + return -1; + + kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_3_BUFFER(p_mgr, exp_key, iv, iv, iv, in, out, in, out, in, out, len); + IMB_KASUMI_F8_3_BUFFER(p_mgr, &exp_key, iv, iv, iv, in, out, in, out, in, out, len); + return 0; } -static void +static int test_kasumi_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; + if (dataSize < IMB_KASUMI_IV_SIZE) + return -1; + + kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_4_BUFFER(p_mgr, exp_key, iv, iv, iv, iv, in, out, in, out, in, out, in, out, + IMB_KASUMI_F8_4_BUFFER(p_mgr, &exp_key, iv, iv, iv, iv, in, out, in, out, in, out, in, out, len); + return 0; } -static void +static int test_kasumi_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; + kasumi_key_sched_t exp_key; const uint64_t *iv = (uint64_t *) buff; const void *in[8]; void *out[8]; uint32_t len[8]; - for (int i = 0; i < count; i++) { + if (dataSize < (IMB_KASUMI_IV_SIZE * 8)) + return -1; + + for (int i = 0; i < 8; i++) { in[i] = buff; out[i] = buff; len[i] = dataSize; } - IMB_KASUMI_F8_N_BUFFER(p_mgr, exp_key, iv, in, out, len, count); + IMB_KASUMI_F8_N_BUFFER(p_mgr, &exp_key, iv, in, out, len, 8); + return 0; } -static void +static int test_kasumi_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const kasumi_key_sched_t exp_key_s; const kasumi_key_sched_t *exp_key = &exp_key_s; const uint8_t *in = buff; - uint64_t len = dataSize; + const uint64_t len = dataSize; uint8_t *tag = buff; + if (dataSize < IMB_KASUMI_DIGEST_SIZE) + return -1; + IMB_KASUMI_F9_1_BUFFER(p_mgr, exp_key, in, len, tag); + return 0; } -static void +static int test_kasumi_f9_1_buff_user(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; + kasumi_key_sched_t exp_key; const uint8_t *in = buff; - uint64_t len = dataSize * 8; + const uint64_t len = dataSize * 8; uint8_t *tag = buff; const uint64_t iv = (uint64_t) buff; const uint32_t dir = (uint32_t) *buff * 8; - IMB_KASUMI_F9_1_BUFFER_USER(p_mgr, exp_key, iv, in, len, tag, dir); + if (dataSize < IMB_KASUMI_IV_SIZE) + return -1; + + IMB_KASUMI_F9_1_BUFFER_USER(p_mgr, &exp_key, iv, in, len, tag, dir); + return 0; } -static void +static int test_kasumi_f9_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { const void *key = buff; - kasumi_key_sched_t exp_key_s; - kasumi_key_sched_t *exp_key = &exp_key_s; + kasumi_key_sched_t exp_key; if (dataSize < IMB_KASUMI_KEY_SIZE) - return; + return -1; - IMB_KASUMI_INIT_F9_KEY_SCHED(p_mgr, key, exp_key); + IMB_KASUMI_INIT_F9_KEY_SCHED(p_mgr, key, &exp_key); + return 0; +} + +static int +test_imb_clear_mem(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + imb_clear_mem(buff, dataSize); + return 0; +} + +static int +test_imb_quic_aes_gcm(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct quic_aes_gcm_ctx { + IMB_KEY_SIZE_BYTES key_size; + IMB_CIPHER_DIRECTION cipher_dir; + uint8_t aad_len; + uint8_t tag_len; + uint8_t num_packets; + uint8_t data; + }; + struct quic_aes_gcm_ctx *ctx = (struct quic_aes_gcm_ctx *) buff; + + if (dataSize <= sizeof(*ctx) || dataSize < 16) + return -1; + + struct gcm_key_data key; + uint8_t tag[256]; + + const uint64_t n = (uint64_t) ctx->num_packets; + const uint64_t len = dataSize - sizeof(struct quic_aes_gcm_ctx) + sizeof(ctx->data); + const uint64_t tag_len = (uint64_t) ctx->tag_len; + const uint64_t aad_len = ((uint64_t) ctx->aad_len) > len ? len : ((uint64_t) ctx->aad_len); + + void *dst[n]; + const void *src[n]; + const void *aad[n]; + void *t[n]; + uint64_t l[n]; + const void *iv[n]; + + for (uint64_t i = 0; i < n; i++) { + dst[i] = &ctx->data; + src[i] = &ctx->data; + aad[i] = &ctx->data; + t[i] = tag; + l[i] = len; + iv[i] = buff; + } + imb_quic_aes_gcm(p_mgr, &key, ctx->key_size, ctx->cipher_dir, dst, src, l, iv, aad, aad_len, + t, tag_len, n); + return 0; } #endif /* __aarch64__ */ struct { - void (*func)(IMB_MGR *mb_mgr, uint8_t *buff, size_t dataSize); + int (*func)(IMB_MGR *mb_mgr, uint8_t *buff, size_t dataSize); const char *func_name; } direct_apis[] = { { test_snow3g_init_key_sched, "test_snow3g_init_key_sched" }, @@ -1019,20 +1109,26 @@ struct { { test_kasumi_f9_1_buff, "test_kasumi_f9_1_buff" }, { test_kasumi_f9_1_buff_user, "test_kasumi_f9_1_buff_user" }, { test_kasumi_f9_init_key_sched, "test_kasumi_f9_init_key_sched" }, + { test_imb_clear_mem, "test_imb_clear_mem" }, + { test_imb_quic_aes_gcm, "test_imb_quic_aes_gcm" }, #endif /* __aarch64__ */ }; int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) { - IMB_ARCH arch_to_run = IMB_ARCH_NUM; static IMB_MGR *p_mgr = NULL; - uint8_t *buff; - buff = malloc(dataSize); + if (dataSize < sizeof(int)) + return -1; + + const size_t newDataSize = dataSize - sizeof(int); + uint8_t *buff = malloc(newDataSize); + if (buff == NULL) - return EXIT_FAILURE; - memcpy(buff, data, dataSize); + return -1; + + memcpy(buff, &data[sizeof(int)], newDataSize); /* allocate multi-buffer manager */ if (p_mgr == NULL) { @@ -1040,9 +1136,11 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) if (p_mgr == NULL) { printf("Error allocating MB_MGR structure!\n"); free(buff); - return EXIT_FAILURE; + return -1; } + IMB_ARCH arch_to_run = IMB_ARCH_NUM; + #ifndef __aarch64__ if (arch == SSE) init_mb_mgr_sse(p_mgr); @@ -1062,10 +1160,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) init_mb_mgr_auto(p_mgr, &arch_to_run); } - const int idx = data[0] % DIM(direct_apis); - - direct_apis[idx].func(p_mgr, buff, dataSize); + const int idx = ((const int *) data)[0] % DIM(direct_apis); + const int ret = direct_apis[idx].func(p_mgr, buff, newDataSize); free(buff); - return 0; + return ret; } -- GitLab From d7adf46e978bce2fd38a39bb5a746585f2e9a351 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 16 Oct 2023 16:53:14 +0100 Subject: [PATCH 142/204] avx2: [chacha20] fix reading outside the key bounds --- lib/avx2_t1/chacha20_avx2.asm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/avx2_t1/chacha20_avx2.asm b/lib/avx2_t1/chacha20_avx2.asm index 1cf1e86f..fcd778f9 100644 --- a/lib/avx2_t1/chacha20_avx2.asm +++ b/lib/avx2_t1/chacha20_avx2.asm @@ -521,10 +521,8 @@ mksection .text %define %%NUM_BLOCKS %11 ;; [in] Number of state blocks to prepare (numerical) ;; Prepare next 4 states (or 2, if 2 or less blocks left) - vmovdqu %%STATE_IN_B_L, [%%KEY] ; Load key bytes 0-15 - vmovdqu %%STATE_IN_C_L, [%%KEY + 16] ; Load key bytes 16-31 - vperm2i128 %%STATE_IN_B_L,%%STATE_IN_B_L, 0x0 - vperm2i128 %%STATE_IN_C_L, %%STATE_IN_C_L, 0x0 + vbroadcasti128 %%STATE_IN_B_L, [%%KEY] ; Load key bytes 0-15 + vbroadcasti128 %%STATE_IN_C_L, [%%KEY + 16] ; Load key bytes 16-31 vmovq XWORD(%%STATE_IN_D_L), [%%IV] vpinsrd XWORD(%%STATE_IN_D_L), [%%IV + 8], 2 vpslldq %%STATE_IN_D_L, 4 -- GitLab From a7e4699b74bb8f6ddf170d6068505a7ff1531490 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 16 Oct 2023 16:57:25 +0100 Subject: [PATCH 143/204] test: [fuzz-app] Enable memory sanitizer checks plus test extensions - rework existing tests to work on dynamically allocated memory - add GHASH tests - add GMAC tests - extend GCM tests --- test/fuzz-app/direct_api_fuzz_test.c | 1256 ++++++++++++++++---------- 1 file changed, 800 insertions(+), 456 deletions(-) diff --git a/test/fuzz-app/direct_api_fuzz_test.c b/test/fuzz-app/direct_api_fuzz_test.c index e19e9866..5eedc342 100644 --- a/test/fuzz-app/direct_api_fuzz_test.c +++ b/test/fuzz-app/direct_api_fuzz_test.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "utils.h" @@ -41,15 +42,7 @@ LLVMFuzzerTestOneInput(const uint8_t *, size_t); int LLVMFuzzerInitialize(int *, char ***); -enum ar { -#ifndef __aarch64__ - SSE = 1, AVX, AVX2, AVX512 -#else - AARCH64 = 1, SVE256 -#endif -}; - -enum ar arch; +IMB_ARCH arch = IMB_ARCH_NONE; static void parse_matched(int argc, char **argv) @@ -57,18 +50,18 @@ parse_matched(int argc, char **argv) for (int i = 0; i < argc; i++) { #ifndef __aarch64__ if (strcmp(argv[i], "SSE") == 0) - arch = SSE; + arch = IMB_ARCH_SSE; else if (strcmp(argv[i], "AVX") == 0) - arch = AVX; + arch = IMB_ARCH_AVX; else if (strcmp(argv[i], "AVX2") == 0) - arch = AVX2; + arch = IMB_ARCH_AVX2; else if (strcmp(argv[i], "AVX512") == 0) - arch = AVX512; + arch = IMB_ARCH_AVX512; #else if (strcmp(argv[i], "AARCH64") == 0) - arch = AARCH64; + arch = IMB_ARCH_AARCH64; else if (strcmp(argv[i], "SVE256") == 0) - arch = SVE256; + arch = IMB_ARCH_SVE256; #endif } } @@ -95,187 +88,393 @@ LLVMFuzzerInitialize(int *argc, char ***argv) return 0; } +/* ========================================================================== */ +/* ========================================================================== */ + +static void +fill_data(void *d, const size_t d_size, const void *s, const size_t s_size) +{ + if (d == NULL || d_size == 0) + return; + + memset(d, 0, d_size); + + if (s == NULL || s_size == 0) + return; + + const size_t m_size = (s_size > d_size) ? d_size : s_size; + memcpy(d, s, m_size); +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static snow3g_key_schedule_t *snow3g_exp_key = NULL; +static uint8_t *snow3g_iv = NULL; +static uint32_t *snow3g_digest = NULL; + +static void +snow3g_end(void) +{ + if (snow3g_digest != NULL) + free(snow3g_digest); + if (snow3g_exp_key != NULL) + free(snow3g_exp_key); + if (snow3g_iv != NULL) + free(snow3g_iv); + snow3g_exp_key = NULL; + snow3g_iv = NULL; + snow3g_digest = NULL; +} + +static int +snow3g_start(void) +{ + snow3g_exp_key = (snow3g_key_schedule_t *) malloc(sizeof(snow3g_key_schedule_t)); + snow3g_iv = (uint8_t *) malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); + snow3g_digest = (uint32_t *) malloc(IMB_SNOW3G_DIGEST_LEN); + if (snow3g_iv == NULL || snow3g_exp_key == NULL || snow3g_digest) { + snow3g_end(); + return -1; + } + return 0; +} + static int test_snow3g_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *init_key = buff; - snow3g_key_schedule_t exp_key; + if (dataSize < sizeof(snow3g_key_schedule_t)) + return -1; - if (dataSize < sizeof(exp_key)) + if (snow3g_start()) return -1; - IMB_SNOW3G_INIT_KEY_SCHED(p_mgr, init_key, &exp_key); + IMB_SNOW3G_INIT_KEY_SCHED(p_mgr, buff, snow3g_exp_key); + + snow3g_end(); return 0; } static int test_snow3g_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES || dataSize < sizeof(snow3g_key_schedule_t)) + if (snow3g_start()) return -1; - uint8_t *out = buff; - const uint8_t *in = buff; - const uint8_t *iv = buff; const size_t dataSizeBits = dataSize * 8; const size_t offsetBits = buff[0] % dataSizeBits; const uint64_t lenBits = dataSizeBits - offsetBits; - snow3g_key_schedule_t exp_key; - IMB_SNOW3G_F8_1_BUFFER_BIT(p_mgr, &exp_key, iv, in, out, lenBits, offsetBits); + IMB_SNOW3G_F8_1_BUFFER_BIT(p_mgr, snow3g_exp_key, snow3g_iv, buff, buff, lenBits, + offsetBits); + snow3g_end(); return 0; } static int test_snow3g_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + if (snow3g_start()) return -1; - uint8_t *out = buff; - const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - snow3g_key_schedule_t exp_key; - - IMB_SNOW3G_F8_1_BUFFER(p_mgr, &exp_key, iv, in, out, len); + IMB_SNOW3G_F8_1_BUFFER(p_mgr, snow3g_exp_key, snow3g_iv, buff, buff, dataSize); + snow3g_end(); return 0; } static int test_snow3g_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + if (snow3g_start()) return -1; - uint8_t *out = buff; - const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - snow3g_key_schedule_t exp_key; - - IMB_SNOW3G_F8_2_BUFFER(p_mgr, &exp_key, iv, iv, in, out, len, in, out, len); + IMB_SNOW3G_F8_2_BUFFER(p_mgr, snow3g_exp_key, snow3g_iv, snow3g_iv, buff, buff, dataSize, + buff, buff, dataSize); + snow3g_end(); return 0; } static int test_snow3g_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + if (snow3g_start()) return -1; - uint8_t *out = buff; - const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - snow3g_key_schedule_t exp_key; - - IMB_SNOW3G_F8_4_BUFFER(p_mgr, &exp_key, iv, iv, iv, iv, in, out, len, in, out, len, in, out, - len, in, out, len); + IMB_SNOW3G_F8_4_BUFFER(p_mgr, snow3g_exp_key, snow3g_iv, snow3g_iv, snow3g_iv, snow3g_iv, + buff, buff, dataSize, buff, buff, dataSize, buff, buff, dataSize, + buff, buff, dataSize); + snow3g_end(); return 0; } static int test_snow3g_f8_8_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + if (snow3g_start()) return -1; - uint8_t *out = buff; - const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - snow3g_key_schedule_t exp_key; - - IMB_SNOW3G_F8_8_BUFFER(p_mgr, &exp_key, iv, iv, iv, iv, iv, iv, iv, iv, in, out, len, in, - out, len, in, out, len, in, out, len, in, out, len, in, out, len, in, - out, len, in, out, len); + IMB_SNOW3G_F8_8_BUFFER(p_mgr, snow3g_exp_key, snow3g_iv, snow3g_iv, snow3g_iv, snow3g_iv, + snow3g_iv, snow3g_iv, snow3g_iv, snow3g_iv, buff, buff, dataSize, + buff, buff, dataSize, buff, buff, dataSize, buff, buff, dataSize, + buff, buff, dataSize, buff, buff, dataSize, buff, buff, dataSize, + buff, buff, dataSize); + snow3g_end(); return 0; } static int test_snow3g_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + if (snow3g_start()) return -1; const void *iv[8]; const void *in[8]; void *out[8]; uint32_t len[8]; - snow3g_key_schedule_t exp_key; for (int i = 0; i < 8; i++) { - iv[i] = buff; + iv[i] = snow3g_iv; in[i] = buff; out[i] = buff; len[i] = dataSize; } - IMB_SNOW3G_F8_N_BUFFER(p_mgr, &exp_key, iv, in, out, len, 8); + IMB_SNOW3G_F8_N_BUFFER(p_mgr, snow3g_exp_key, iv, in, out, len, 8); + snow3g_end(); return 0; } +struct test_snow3g_mb { + size_t n; + const void **iv; + const void **in; + void **out; + uint32_t *len; + const snow3g_key_schedule_t **key; +}; + +static void +test_snow3g_mb_free(struct test_snow3g_mb *ts) +{ + if (ts->key != NULL) + free(ts->key); + if (ts->iv != NULL) + free(ts->iv); + if (ts->out != NULL) + free(ts->out); + if (ts->in != NULL) + free(ts->in); + if (ts->len != NULL) + free(ts->len); + memset(ts, 0, sizeof(*ts)); +} + static int -test_snow3g_f8_8_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +test_snow3g_mb_alloc(struct test_snow3g_mb *ts, const size_t n) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + ts->n = n; + ts->key = malloc(n * sizeof(ts->key[0])); + ts->iv = malloc(n * sizeof(ts->iv[0])); + ts->in = malloc(n * sizeof(ts->in[0])); + ts->out = malloc(n * sizeof(ts->out[0])); + ts->len = malloc(n * sizeof(ts->len[0])); + + if (ts->key == NULL || ts->iv == NULL || ts->in == NULL || ts->out == NULL || + ts->len == NULL) { + test_snow3g_mb_free(ts); return -1; + } - const void *iv[8]; - const void *in[8]; - void *out[8]; - uint32_t len[8]; - snow3g_key_schedule_t key_sched; - const snow3g_key_schedule_t *exp_key[8]; + return 0; +} - for (int i = 0; i < 8; i++) { - iv[i] = buff; - in[i] = buff; - out[i] = buff; - len[i] = dataSize; - exp_key[i] = &key_sched; +static void +test_snow3g_mb_set1(struct test_snow3g_mb *ts, const snow3g_key_schedule_t *key, const void *iv, + const void *in, void *out, const uint32_t len) +{ + for (size_t i = 0; i < ts->n; i++) { + ts->key[i] = key; + ts->iv[i] = iv; + ts->in[i] = in; + ts->out[i] = out; + ts->len[i] = len; } +} - IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(p_mgr, exp_key, iv, in, out, len); +static int +test_snow3g_f8_8_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (snow3g_start()) + return -1; + + struct test_snow3g_mb ts; + const uint32_t n = 8; + + if (test_snow3g_mb_alloc(&ts, n) != 0) { + snow3g_end(); + return -1; + } + test_snow3g_mb_set1(&ts, snow3g_exp_key, snow3g_iv, buff, buff, (uint32_t) dataSize); + IMB_SNOW3G_F8_8_BUFFER_MULTIKEY(p_mgr, ts.key, ts.iv, ts.in, ts.out, ts.len); + test_snow3g_mb_free(&ts); + snow3g_end(); return 0; } static int test_snow3g_f8_n_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_SNOW3G_IV_LEN_IN_BYTES) + if (snow3g_start()) return -1; - const void *iv[8]; - const void *in[8]; - void *out[8]; - uint32_t len[8]; - snow3g_key_schedule_t key_sched; - const snow3g_key_schedule_t *exp_key[8]; + struct test_snow3g_mb ts; + const uint32_t n = 9; - for (int i = 0; i < 8; i++) { - iv[i] = buff; - in[i] = buff; - out[i] = buff; - len[i] = dataSize; - exp_key[i] = &key_sched; + if (test_snow3g_mb_alloc(&ts, n) != 0) { + snow3g_end(); + return -1; } - - IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(p_mgr, exp_key, iv, in, out, len, 8); + test_snow3g_mb_set1(&ts, snow3g_exp_key, snow3g_iv, buff, buff, (uint32_t) dataSize); + IMB_SNOW3G_F8_N_BUFFER_MULTIKEY(p_mgr, ts.key, ts.iv, ts.in, ts.out, ts.len, n); + test_snow3g_mb_free(&ts); + snow3g_end(); return 0; } static int test_snow3g_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - snow3g_key_schedule_t exp_key; - const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - uint8_t *auth_tag = buff; + if (snow3g_start()) + return -1; + IMB_SNOW3G_F9_1_BUFFER(p_mgr, snow3g_exp_key, snow3g_iv, buff, dataSize, snow3g_digest); + snow3g_end(); + return 0; +} - IMB_SNOW3G_F9_1_BUFFER(p_mgr, &exp_key, iv, in, len, auth_tag); +/* ========================================================================== */ +/* ========================================================================== */ + +static struct gcm_key_data *gcm_key = NULL; +static struct gcm_context_data *gcm_ctx = NULL; +static uint8_t *gcm_iv = NULL; +static uint8_t *gcm_aad = NULL; +static uint64_t gcm_aad_len; +static uint8_t *gcm_auth_tag = NULL; +static uint64_t gcm_tag_len; + +static void +gcm_end(void) +{ + if (gcm_key != NULL) + free(gcm_key); + if (gcm_ctx != NULL) + free(gcm_ctx); + if (gcm_iv != NULL) + free(gcm_iv); + if (gcm_aad != NULL) + free(gcm_aad); + if (gcm_auth_tag != NULL) + free(gcm_auth_tag); + gcm_key = NULL; + gcm_ctx = NULL; + gcm_iv = NULL; + gcm_aad = NULL; + gcm_aad_len = 0; + gcm_auth_tag = NULL; + gcm_tag_len = 0; +} + +static int +gcm_start(const size_t dataSize, const uint8_t *data) +{ + gcm_key = (struct gcm_key_data *) memalign(16, sizeof(struct gcm_key_data)); + gcm_ctx = (struct gcm_context_data *) memalign(16, sizeof(struct gcm_context_data)); + gcm_iv = (uint8_t *) malloc(IMB_GCM_IV_DATA_LEN); + gcm_aad_len = dataSize; + gcm_aad = (uint8_t *) malloc(gcm_aad_len); + gcm_tag_len = dataSize; + gcm_auth_tag = (uint8_t *) malloc(gcm_tag_len); + if (gcm_key == NULL || gcm_ctx == NULL || gcm_iv == NULL || gcm_aad == NULL || + gcm_auth_tag == NULL) { + gcm_end(); + return -1; + } + fill_data(gcm_key, sizeof(struct gcm_key_data), data, dataSize); + fill_data(gcm_ctx, sizeof(struct gcm_context_data), data, dataSize); + fill_data(gcm_iv, IMB_GCM_IV_DATA_LEN, data, dataSize); + fill_data(gcm_aad, gcm_aad_len, data, dataSize); + fill_data(gcm_auth_tag, gcm_tag_len, data, dataSize); + return 0; +} + +static int +test_aes_gcm_precomp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (gcm_start(dataSize, buff) != 0) + return -1; + + if (dataSize >= IMB_KEY_256_BYTES) + IMB_AES256_GCM_PRECOMP(p_mgr, gcm_key); + else if (dataSize >= IMB_KEY_192_BYTES) + IMB_AES192_GCM_PRECOMP(p_mgr, gcm_key); + else + IMB_AES128_GCM_PRECOMP(p_mgr, gcm_key); + + gcm_end(); + return 0; +} + +static int +test_aes128_gcm_init_var_iv(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (gcm_start(dataSize, buff) != 0) + return -1; + + IMB_AES128_GCM_INIT_VAR_IV(p_mgr, gcm_key, gcm_ctx, buff, dataSize, gcm_aad, gcm_aad_len); + gcm_end(); + return 0; +} + +static int +test_aes192_gcm_init_var_iv(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (gcm_start(dataSize, buff) != 0) + return -1; + + IMB_AES192_GCM_INIT_VAR_IV(p_mgr, gcm_key, gcm_ctx, buff, dataSize, gcm_aad, gcm_aad_len); + gcm_end(); + return 0; +} + +static int +test_aes256_gcm_init_var_iv(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (gcm_start(dataSize, buff) != 0) + return -1; + + IMB_AES256_GCM_INIT_VAR_IV(p_mgr, gcm_key, gcm_ctx, buff, dataSize, gcm_aad, gcm_aad_len); + gcm_end(); + return 0; +} + +static int +test_aes_gcm_pre(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (dataSize < IMB_KEY_128_BYTES) + return -1; + + if (gcm_start(dataSize, buff) != 0) + return -1; + + if (dataSize >= IMB_KEY_256_BYTES) + IMB_AES256_GCM_PRE(p_mgr, buff, gcm_key); + else if (dataSize >= IMB_KEY_192_BYTES) + IMB_AES192_GCM_PRE(p_mgr, buff, gcm_key); + else + IMB_AES128_GCM_PRE(p_mgr, buff, gcm_key); + + gcm_end(); return 0; } @@ -283,361 +482,441 @@ test_snow3g_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) static int test_aes128_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES128_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + IMB_AES128_GCM_ENC(p_mgr, gcm_key, gcm_ctx, out, in, len, gcm_iv, gcm_aad, gcm_aad_len, + gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes128_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES128_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + IMB_AES128_GCM_DEC(p_mgr, gcm_key, gcm_ctx, out, in, len, gcm_iv, gcm_aad, gcm_aad_len, + gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes192_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES192_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + IMB_AES192_GCM_ENC(p_mgr, gcm_key, gcm_ctx, out, in, len, gcm_iv, gcm_aad, gcm_aad_len, + gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes192_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES192_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + IMB_AES192_GCM_DEC(p_mgr, gcm_key, gcm_ctx, out, in, len, gcm_iv, gcm_aad, gcm_aad_len, + gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes256_gcm_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES256_GCM_ENC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + IMB_AES256_GCM_ENC(p_mgr, gcm_key, gcm_ctx, out, in, len, gcm_iv, gcm_aad, gcm_aad_len, + gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes256_gcm_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES256_GCM_DEC(p_mgr, key, ctx, out, in, len, iv, aad, aad_len, auth_tag, tag_len); + IMB_AES256_GCM_DEC(p_mgr, gcm_key, gcm_ctx, out, in, len, gcm_iv, gcm_aad, gcm_aad_len, + gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes128_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES128_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_AES128_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_AES128_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + IMB_AES128_GCM_INIT(p_mgr, gcm_key, gcm_ctx, gcm_iv, gcm_aad, gcm_aad_len); + IMB_AES128_GCM_ENC_UPDATE(p_mgr, gcm_key, gcm_ctx, out, in, len); + IMB_AES128_GCM_ENC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes128_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES128_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_AES128_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_AES128_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + IMB_AES128_GCM_INIT(p_mgr, gcm_key, gcm_ctx, gcm_iv, gcm_aad, gcm_aad_len); + IMB_AES128_GCM_DEC_UPDATE(p_mgr, gcm_key, gcm_ctx, out, in, len); + IMB_AES128_GCM_DEC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes192_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; - IMB_AES192_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_AES192_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_AES192_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + IMB_AES192_GCM_INIT(p_mgr, gcm_key, gcm_ctx, gcm_iv, gcm_aad, gcm_aad_len); + IMB_AES192_GCM_ENC_UPDATE(p_mgr, gcm_key, gcm_ctx, out, in, len); + IMB_AES192_GCM_ENC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes192_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES192_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_AES192_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_AES192_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + IMB_AES192_GCM_INIT(p_mgr, gcm_key, gcm_ctx, gcm_iv, gcm_aad, gcm_aad_len); + IMB_AES192_GCM_DEC_UPDATE(p_mgr, gcm_key, gcm_ctx, out, in, len); + IMB_AES192_GCM_DEC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes256_gcm_enc_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES256_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_AES256_GCM_ENC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_AES256_GCM_ENC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + IMB_AES256_GCM_INIT(p_mgr, gcm_key, gcm_ctx, gcm_iv, gcm_aad, gcm_aad_len); + IMB_AES256_GCM_ENC_UPDATE(p_mgr, gcm_key, gcm_ctx, out, in, len); + IMB_AES256_GCM_ENC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } static int test_aes256_gcm_dec_sgl(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if ((dataSize < sizeof(struct gcm_key_data)) || - (dataSize < sizeof(struct gcm_context_data))) + if (gcm_start(dataSize, buff) != 0) return -1; - const struct gcm_key_data *key = (const struct gcm_key_data *) buff; - struct gcm_context_data *ctx = (struct gcm_context_data *) buff; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - uint64_t aad_len = (uint64_t) *buff; - uint8_t *auth_tag = buff; - uint64_t tag_len = (uint64_t) *buff; + const uint64_t len = dataSize; - IMB_AES256_GCM_INIT(p_mgr, key, ctx, iv, aad, aad_len); - IMB_AES256_GCM_DEC_UPDATE(p_mgr, key, ctx, out, in, len); - IMB_AES256_GCM_DEC_FINALIZE(p_mgr, key, ctx, auth_tag, tag_len); + IMB_AES256_GCM_INIT(p_mgr, gcm_key, gcm_ctx, gcm_iv, gcm_aad, gcm_aad_len); + IMB_AES256_GCM_DEC_UPDATE(p_mgr, gcm_key, gcm_ctx, out, in, len); + IMB_AES256_GCM_DEC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } -#endif /* __aarch64__ */ + +/* ========================================================================== */ +/* ========================================================================== */ static int -test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +test_aes128_gmac(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *key = buff; + if (gcm_start(dataSize, buff) != 0) + return -1; - if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) + /* use GCM AAD field as GMAC IV */ + IMB_AES128_GMAC_INIT(p_mgr, gcm_key, gcm_ctx, gcm_aad, gcm_aad_len); + IMB_AES128_GMAC_UPDATE(p_mgr, gcm_key, gcm_ctx, buff, dataSize); + IMB_AES128_GMAC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); + return 0; +} + +static int +test_aes192_gmac(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (gcm_start(dataSize, buff) != 0) return -1; - void *out = buff; - const void *in = buff; - const uint32_t len = dataSize; - const void *iv = (const void *) buff; + /* use GCM AAD field as GMAC IV */ + IMB_AES192_GMAC_INIT(p_mgr, gcm_key, gcm_ctx, gcm_aad, gcm_aad_len); + IMB_AES192_GMAC_UPDATE(p_mgr, gcm_key, gcm_ctx, buff, dataSize); + IMB_AES192_GMAC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); + return 0; +} - IMB_ZUC_EEA3_1_BUFFER(p_mgr, key, iv, in, out, len); +static int +test_aes256_gmac(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (gcm_start(dataSize, buff) != 0) + return -1; + + /* use GCM AAD field as GMAC IV */ + IMB_AES256_GMAC_INIT(p_mgr, gcm_key, gcm_ctx, gcm_aad, gcm_aad_len); + IMB_AES256_GMAC_UPDATE(p_mgr, gcm_key, gcm_ctx, buff, dataSize); + IMB_AES256_GMAC_FINALIZE(p_mgr, gcm_key, gcm_ctx, gcm_auth_tag, gcm_tag_len); + gcm_end(); return 0; } +/* ========================================================================== */ +/* ========================================================================== */ + static int -test_zuc_eea3_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +test_ghash_pre(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *key[4]; + /* GHASH key size */ + if (dataSize < 16) + return -1; - if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) + if (gcm_start(dataSize, buff) != 0) return -1; - const void *iv[4]; - const void *in[4]; - void *out[4]; - uint32_t len[4]; + IMB_GHASH_PRE(p_mgr, buff, gcm_key); - for (int i = 0; i < 4; i++) { - key[i] = buff; - iv[i] = buff; - in[i] = buff; - out[i] = buff; - len[i] = dataSize; + gcm_end(); + return 0; +} + +static int +test_ghash(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (gcm_start(dataSize, buff) != 0) + return -1; + + IMB_GHASH(p_mgr, gcm_key, buff, dataSize, gcm_auth_tag, gcm_tag_len); + + gcm_end(); + return 0; +} +#endif /* __aarch64__ */ + +/* ========================================================================== */ +/* ========================================================================== */ + +static uint8_t *zuc_iv = NULL; +static uint8_t *zuc_key = NULL; +static uint32_t *zuc_tag = NULL; + +static void +zuc_end(void) +{ + if (zuc_key != NULL) + free(zuc_key); + if (zuc_iv != NULL) + free(zuc_iv); + if (zuc_tag != NULL) + free(zuc_tag); + zuc_key = NULL; + zuc_iv = NULL; + zuc_tag = NULL; +} + +static int +zuc_start(const size_t dataSize, const uint8_t *data) +{ + zuc_key = (uint8_t *) malloc(IMB_ZUC_KEY_LEN_IN_BYTES); + zuc_iv = (uint8_t *) malloc(IMB_ZUC_IV_LEN_IN_BYTES); + zuc_tag = (uint32_t *) malloc(IMB_ZUC_DIGEST_LEN_IN_BYTES); + + if (zuc_key == NULL || zuc_iv == NULL || zuc_tag == NULL) { + zuc_end(); + return -1; } + fill_data(zuc_key, IMB_ZUC_KEY_LEN_IN_BYTES, data, dataSize); + fill_data(zuc_iv, IMB_ZUC_IV_LEN_IN_BYTES, data, dataSize); + fill_data(zuc_tag, IMB_ZUC_DIGEST_LEN_IN_BYTES, data, dataSize); + return 0; +} + +static int +test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (zuc_start(dataSize, buff) != 0) + return -1; - IMB_ZUC_EEA3_4_BUFFER(p_mgr, key, iv, in, out, len); + IMB_ZUC_EEA3_1_BUFFER(p_mgr, zuc_key, zuc_iv, buff, buff, dataSize); + zuc_end(); return 0; } +struct test_zuc_mb { + size_t n; + const void **key; + const void **iv; + const void **in; + void **out; /* eea3 specific */ + uint32_t *len; + uint32_t **tag; /* eia3 specific */ +}; + +static void +test_zuc_mb_free(struct test_zuc_mb *ts) +{ + if (ts->key != NULL) + free(ts->key); + if (ts->iv != NULL) + free(ts->iv); + if (ts->out != NULL) + free(ts->out); + if (ts->in != NULL) + free(ts->in); + if (ts->len != NULL) + free(ts->len); + if (ts->tag != NULL) + free(ts->tag); + memset(ts, 0, sizeof(*ts)); +} + static int -test_zuc_eea3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +test_zuc_mb_alloc(struct test_zuc_mb *ts, const size_t n) { - const void *key[8]; + ts->n = n; - if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) + ts->key = malloc(n * sizeof(ts->key[0])); + ts->iv = malloc(n * sizeof(ts->iv[0])); + ts->in = malloc(n * sizeof(ts->in[0])); + ts->out = malloc(n * sizeof(ts->out[0])); + ts->len = malloc(n * sizeof(ts->len[0])); + + ts->tag = malloc(n * sizeof(ts->tag[0])); + + if (ts->key == NULL || ts->iv == NULL || ts->in == NULL || ts->out == NULL || + ts->len == NULL || ts->tag == NULL) { + test_zuc_mb_free(ts); return -1; + } - const void *iv[8]; - const void *in[8]; - void *out[8]; - uint32_t len[8]; + return 0; +} - for (int i = 0; i < 8; i++) { - key[i] = buff; - iv[i] = buff; - in[i] = buff; - out[i] = buff; - len[i] = dataSize; +static void +test_zuc_mb_set1(struct test_zuc_mb *ts, const void *key, const void *iv, const void *in, void *out, + const uint32_t len, uint32_t *tag) +{ + for (size_t i = 0; i < ts->n; i++) { + ts->key[i] = key; + ts->iv[i] = iv; + ts->in[i] = in; + ts->out[i] = out; + ts->len[i] = len; + ts->tag[i] = tag; } +} - IMB_ZUC_EEA3_N_BUFFER(p_mgr, key, iv, in, out, len, 8); +static int +test_zuc_eea3_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (zuc_start(dataSize, buff) != 0) + return -1; + + struct test_zuc_mb ts; + const uint32_t n = 4; + + if (test_zuc_mb_alloc(&ts, n) != 0) { + zuc_end(); + return -1; + } + test_zuc_mb_set1(&ts, zuc_key, zuc_iv, buff, buff, dataSize, NULL); + IMB_ZUC_EEA3_4_BUFFER(p_mgr, ts.key, ts.iv, ts.in, ts.out, ts.len); + test_zuc_mb_free(&ts); + zuc_end(); return 0; } static int -test_zuc_eia3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +test_zuc_eea3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *key = buff; + if (zuc_start(dataSize, buff) != 0) + return -1; - if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) + struct test_zuc_mb ts; + const uint32_t n = 8; + + if (test_zuc_mb_alloc(&ts, n) != 0) { + zuc_end(); + return -1; + } + test_zuc_mb_set1(&ts, zuc_key, zuc_iv, buff, buff, dataSize, NULL); + IMB_ZUC_EEA3_N_BUFFER(p_mgr, ts.key, ts.iv, ts.in, ts.out, ts.len, n); + test_zuc_mb_free(&ts); + zuc_end(); + return 0; +} + +static int +test_zuc_eia3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (zuc_start(dataSize, buff) != 0) return -1; - const void *in = buff; - uint32_t len = dataSize * 8; - const void *iv = (const void *) buff; - uint32_t *tag = (uint32_t *) buff; + const uint32_t len = dataSize * 8; - IMB_ZUC_EIA3_1_BUFFER(p_mgr, key, iv, in, len, tag); + IMB_ZUC_EIA3_1_BUFFER(p_mgr, zuc_key, zuc_iv, buff, len, zuc_tag); + zuc_end(); return 0; } @@ -647,23 +926,74 @@ test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) if (dataSize < IMB_ZUC_KEY_LEN_IN_BYTES) return -1; - const void *iv[8]; - const void *in[8]; - void *tag_ptr_array[8]; - uint32_t len[8]; - uint32_t *tag[8]; - const void *key[8]; + struct test_zuc_mb ts; + const uint32_t n = 9; - for (int i = 0; i < 8; i++) { - key[i] = buff; - iv[i] = buff; - in[i] = buff; - tag_ptr_array[i] = buff; - tag[i] = (uint32_t *) buff; - len[i] = dataSize * 8; + if (test_zuc_mb_alloc(&ts, n) != 0) { + zuc_end(); + return -1; } + test_zuc_mb_set1(&ts, zuc_key, zuc_iv, buff, NULL, dataSize * 8, zuc_tag); + IMB_ZUC_EIA3_N_BUFFER(p_mgr, ts.key, ts.iv, ts.in, ts.len, ts.tag, n); + test_zuc_mb_free(&ts); + zuc_end(); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static uint8_t *ccp_key = NULL; +static struct chacha20_poly1305_context_data *ccp_ctx = NULL; +static uint8_t *ccp_iv = NULL; +static uint8_t *ccp_aad = NULL; +static uint64_t ccp_aad_len; +static uint8_t *ccp_auth_tag = NULL; +static uint64_t ccp_tag_len; - IMB_ZUC_EIA3_N_BUFFER(p_mgr, key, iv, in, len, tag, 8); +static void +ccp_end(void) +{ + if (ccp_key != NULL) + free(ccp_key); + if (ccp_ctx != NULL) + free(ccp_ctx); + if (ccp_iv != NULL) + free(ccp_iv); + if (ccp_aad != NULL) + free(ccp_aad); + if (ccp_auth_tag != NULL) + free(ccp_auth_tag); + ccp_key = NULL; + ccp_ctx = NULL; + ccp_iv = NULL; + ccp_aad = NULL; + ccp_aad_len = 0; + ccp_auth_tag = NULL; + ccp_tag_len = 0; +} + +static int +ccp_start(const size_t dataSize, const uint8_t *data) +{ + ccp_key = (uint8_t *) malloc(IMB_CHACHA20_POLY1305_KEY_SIZE); + ccp_ctx = (struct chacha20_poly1305_context_data *) memalign( + 16, sizeof(struct chacha20_poly1305_context_data)); + ccp_iv = (uint8_t *) malloc(IMB_CHACHA20_POLY1305_IV_SIZE); + ccp_aad_len = dataSize; + ccp_aad = (uint8_t *) malloc(ccp_aad_len); + ccp_tag_len = dataSize; + ccp_auth_tag = (uint8_t *) malloc(ccp_tag_len); + if (ccp_key == NULL || ccp_ctx == NULL || ccp_iv == NULL || ccp_aad == NULL || + ccp_auth_tag == NULL) { + ccp_end(); + return -1; + } + fill_data(ccp_key, IMB_CHACHA20_POLY1305_KEY_SIZE, data, dataSize); + fill_data(ccp_ctx, sizeof(struct chacha20_poly1305_context_data), data, dataSize); + fill_data(ccp_iv, IMB_CHACHA20_POLY1305_IV_SIZE, data, dataSize); + fill_data(ccp_aad, ccp_aad_len, data, dataSize); + fill_data(ccp_auth_tag, ccp_tag_len, data, dataSize); return 0; } @@ -671,332 +1001,334 @@ test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) static int test_chacha_poly_enc(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_CHACHA20_POLY1305_KEY_SIZE || dataSize < IMB_CHACHA20_POLY1305_IV_SIZE) + if (ccp_start(dataSize, buff) != 0) return -1; - struct chacha20_poly1305_context_data ctx; - const void *key = buff; uint8_t *out = buff; const uint8_t *in = buff; const uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - const uint64_t aad_len = dataSize; - uint8_t auth_tag[256]; - const uint64_t tag_len = (uint64_t) buff[0]; - IMB_CHACHA20_POLY1305_INIT(p_mgr, key, &ctx, iv, aad, aad_len); - IMB_CHACHA20_POLY1305_ENC_UPDATE(p_mgr, key, &ctx, out, in, len); - IMB_CHACHA20_POLY1305_ENC_FINALIZE(p_mgr, &ctx, auth_tag, tag_len); + IMB_CHACHA20_POLY1305_INIT(p_mgr, ccp_key, ccp_ctx, ccp_iv, ccp_aad, ccp_aad_len); + IMB_CHACHA20_POLY1305_ENC_UPDATE(p_mgr, ccp_key, ccp_ctx, out, in, len); + IMB_CHACHA20_POLY1305_ENC_FINALIZE(p_mgr, ccp_ctx, ccp_auth_tag, ccp_tag_len); + + ccp_end(); return 0; } static int test_chacha_poly_dec(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_CHACHA20_POLY1305_KEY_SIZE || dataSize < IMB_CHACHA20_POLY1305_IV_SIZE) + if (ccp_start(dataSize, buff) != 0) return -1; - struct chacha20_poly1305_context_data ctx; - const void *key = buff; uint8_t *out = buff; const uint8_t *in = buff; const uint64_t len = dataSize; - const uint8_t *iv = buff; - const uint8_t *aad = buff; - const uint64_t aad_len = dataSize; - uint8_t auth_tag[256]; - const uint64_t tag_len = (uint64_t) buff[0]; - IMB_CHACHA20_POLY1305_INIT(p_mgr, key, &ctx, iv, aad, aad_len); - IMB_CHACHA20_POLY1305_DEC_UPDATE(p_mgr, key, &ctx, out, in, len); - IMB_CHACHA20_POLY1305_DEC_FINALIZE(p_mgr, &ctx, auth_tag, tag_len); + IMB_CHACHA20_POLY1305_INIT(p_mgr, ccp_key, ccp_ctx, ccp_iv, ccp_aad, ccp_aad_len); + IMB_CHACHA20_POLY1305_DEC_UPDATE(p_mgr, ccp_key, ccp_ctx, out, in, len); + IMB_CHACHA20_POLY1305_DEC_FINALIZE(p_mgr, ccp_ctx, ccp_auth_tag, ccp_tag_len); + + ccp_end(); return 0; } +/* ========================================================================== */ +/* ========================================================================== */ + static int test_crc32_ethernet_fcs(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC32_ETHERNET_FCS(p_mgr, in, len); + IMB_CRC32_ETHERNET_FCS(p_mgr, buff, dataSize); return 0; } static int test_crc16_x25(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC16_X25(p_mgr, in, len); + IMB_CRC16_X25(p_mgr, buff, dataSize); return 0; } static int test_crc32_sctp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC32_SCTP(p_mgr, in, len); + IMB_CRC32_SCTP(p_mgr, buff, dataSize); return 0; } static int test_crc24_lte_a(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC24_LTE_A(p_mgr, in, len); + IMB_CRC24_LTE_A(p_mgr, buff, dataSize); return 0; } static int test_crc24_lte_b(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC24_LTE_B(p_mgr, in, len); + IMB_CRC24_LTE_B(p_mgr, buff, dataSize); return 0; } static int test_crc16_fp_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC16_FP_DATA(p_mgr, in, len); + IMB_CRC16_FP_DATA(p_mgr, buff, dataSize); return 0; } static int test_crc11_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC11_FP_HEADER(p_mgr, in, len); + IMB_CRC11_FP_HEADER(p_mgr, buff, dataSize); return 0; } static int test_crc7_fp_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC7_FP_HEADER(p_mgr, in, len); + IMB_CRC7_FP_HEADER(p_mgr, buff, dataSize); return 0; } static int test_crc10_iuup_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC10_IUUP_DATA(p_mgr, in, len); + IMB_CRC10_IUUP_DATA(p_mgr, buff, dataSize); return 0; } static int test_crc6_iuup_header(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC6_IUUP_HEADER(p_mgr, in, len); + IMB_CRC6_IUUP_HEADER(p_mgr, buff, dataSize); return 0; } static int test_crc32_wimax_ofdma_data(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; - - IMB_CRC32_WIMAX_OFDMA_DATA(p_mgr, in, len); + IMB_CRC32_WIMAX_OFDMA_DATA(p_mgr, buff, dataSize); return 0; } static int test_crc8_wimax_ofdma_hcs(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *in = buff; - const uint64_t len = dataSize; + IMB_CRC8_WIMAX_OFDMA_HCS(p_mgr, buff, dataSize); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static uint64_t *kasumi_iv = NULL; +static kasumi_key_sched_t *kasumi_key = NULL; +static uint32_t *kasumi_tag = NULL; + +static void +kasumi_end(void) +{ + if (kasumi_key != NULL) + free(kasumi_key); + if (kasumi_iv != NULL) + free(kasumi_iv); + if (kasumi_tag != NULL) + free(kasumi_tag); + kasumi_key = NULL; + kasumi_iv = NULL; + kasumi_tag = NULL; +} + +static int +kasumi_start(const size_t dataSize, const uint8_t *data) +{ + kasumi_key = (kasumi_key_sched_t *) malloc(sizeof(kasumi_key_sched_t)); + kasumi_iv = (uint64_t *) malloc(IMB_KASUMI_IV_SIZE); + kasumi_tag = (uint32_t *) malloc(IMB_KASUMI_DIGEST_SIZE); - IMB_CRC8_WIMAX_OFDMA_HCS(p_mgr, in, len); + if (kasumi_key == NULL || kasumi_iv == NULL || kasumi_tag == NULL) { + kasumi_end(); + return -1; + } + fill_data(kasumi_key, sizeof(kasumi_key_sched_t), data, dataSize); + fill_data(kasumi_iv, IMB_KASUMI_IV_SIZE, data, dataSize); + fill_data(kasumi_tag, IMB_KASUMI_DIGEST_SIZE, data, dataSize); return 0; } static int test_kasumi_f8_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *key = buff; - kasumi_key_sched_t exp_key; - if (dataSize < IMB_KASUMI_KEY_SIZE) return -1; - IMB_KASUMI_INIT_F8_KEY_SCHED(p_mgr, key, &exp_key); + if (kasumi_start(dataSize, buff) != 0) + return -1; + + IMB_KASUMI_INIT_F8_KEY_SCHED(p_mgr, buff, kasumi_key); + kasumi_end(); return 0; } static int test_kasumi_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_KASUMI_IV_SIZE) + if (kasumi_start(dataSize, buff) != 0) return -1; - kasumi_key_sched_t exp_key; - const uint32_t offset = ((uint32_t) *buff * 8) % (dataSize * 8); + const uint32_t offset = (dataSize > 0) ? (buff[0] % (dataSize * 8)) : 0; uint8_t *out = buff; const uint8_t *in = buff; const uint64_t len = (dataSize * 8) - offset; - const uint64_t iv = *((uint64_t *) buff); - IMB_KASUMI_F8_1_BUFFER_BIT(p_mgr, &exp_key, iv, in, out, len, offset); + IMB_KASUMI_F8_1_BUFFER_BIT(p_mgr, kasumi_key, kasumi_iv[0], in, out, len, offset); + kasumi_end(); return 0; } static int test_kasumi_f8_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_KASUMI_IV_SIZE) + if (kasumi_start(dataSize, buff) != 0) return -1; - kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint64_t iv = *((uint64_t *) buff); + const uint64_t len = dataSize; - IMB_KASUMI_F8_1_BUFFER(p_mgr, &exp_key, iv, in, out, len); + IMB_KASUMI_F8_1_BUFFER(p_mgr, kasumi_key, kasumi_iv[0], in, out, len); + kasumi_end(); return 0; } static int test_kasumi_f8_2_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_KASUMI_IV_SIZE) + if (kasumi_start(dataSize, buff) != 0) return -1; - kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint64_t iv = *((uint64_t *) buff); + const uint64_t len = dataSize; - IMB_KASUMI_F8_2_BUFFER(p_mgr, &exp_key, iv, iv, in, out, len, in, out, len); + IMB_KASUMI_F8_2_BUFFER(p_mgr, kasumi_key, kasumi_iv[0], kasumi_iv[0], in, out, len, in, out, + len); + kasumi_end(); return 0; } static int test_kasumi_f8_3_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_KASUMI_IV_SIZE) + if (kasumi_start(dataSize, buff) != 0) return -1; - kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint64_t iv = *((uint64_t *) buff); + const uint64_t len = dataSize; - IMB_KASUMI_F8_3_BUFFER(p_mgr, &exp_key, iv, iv, iv, in, out, in, out, in, out, len); + IMB_KASUMI_F8_3_BUFFER(p_mgr, kasumi_key, kasumi_iv[0], kasumi_iv[0], kasumi_iv[0], in, out, + in, out, in, out, len); + kasumi_end(); return 0; } static int test_kasumi_f8_4_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - if (dataSize < IMB_KASUMI_IV_SIZE) + if (kasumi_start(dataSize, buff) != 0) return -1; - kasumi_key_sched_t exp_key; uint8_t *out = buff; const uint8_t *in = buff; - uint64_t len = dataSize; - const uint64_t iv = *((uint64_t *) buff); + const uint64_t len = dataSize; - IMB_KASUMI_F8_4_BUFFER(p_mgr, &exp_key, iv, iv, iv, iv, in, out, in, out, in, out, in, out, - len); + IMB_KASUMI_F8_4_BUFFER(p_mgr, kasumi_key, kasumi_iv[0], kasumi_iv[0], kasumi_iv[0], + kasumi_iv[0], in, out, in, out, in, out, in, out, len); + kasumi_end(); return 0; } static int test_kasumi_f8_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - kasumi_key_sched_t exp_key; - const uint64_t *iv = (uint64_t *) buff; + uint64_t *iv = malloc(8 * IMB_KASUMI_IV_SIZE); + + if (iv == NULL) + return -1; + + if (kasumi_start(dataSize, buff) != 0) { + free(iv); + return -1; + } + const void *in[8]; void *out[8]; uint32_t len[8]; - if (dataSize < (IMB_KASUMI_IV_SIZE * 8)) - return -1; - for (int i = 0; i < 8; i++) { in[i] = buff; out[i] = buff; len[i] = dataSize; } - IMB_KASUMI_F8_N_BUFFER(p_mgr, &exp_key, iv, in, out, len, 8); + IMB_KASUMI_F8_N_BUFFER(p_mgr, kasumi_key, iv, in, out, len, 8); + kasumi_end(); + free(iv); return 0; } static int test_kasumi_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const kasumi_key_sched_t exp_key_s; - const kasumi_key_sched_t *exp_key = &exp_key_s; + if (kasumi_start(dataSize, buff) != 0) + return -1; + const uint8_t *in = buff; const uint64_t len = dataSize; - uint8_t *tag = buff; - if (dataSize < IMB_KASUMI_DIGEST_SIZE) - return -1; - - IMB_KASUMI_F9_1_BUFFER(p_mgr, exp_key, in, len, tag); + IMB_KASUMI_F9_1_BUFFER(p_mgr, kasumi_key, in, len, kasumi_tag); + kasumi_end(); return 0; } static int test_kasumi_f9_1_buff_user(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - kasumi_key_sched_t exp_key; + if (kasumi_start(dataSize, buff) != 0) + return -1; + const uint8_t *in = buff; const uint64_t len = dataSize * 8; - uint8_t *tag = buff; - const uint64_t iv = (uint64_t) buff; - const uint32_t dir = (uint32_t) *buff * 8; - if (dataSize < IMB_KASUMI_IV_SIZE) - return -1; + const uint64_t iv = (dataSize > 0) ? (uint64_t) buff[0] : 0; + const uint32_t dir = (dataSize > 0) ? (uint32_t) buff[0] * 8 : 0; - IMB_KASUMI_F9_1_BUFFER_USER(p_mgr, &exp_key, iv, in, len, tag, dir); + IMB_KASUMI_F9_1_BUFFER_USER(p_mgr, kasumi_key, iv, in, len, kasumi_tag, dir); + kasumi_end(); return 0; } static int test_kasumi_f9_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - const void *key = buff; - kasumi_key_sched_t exp_key; - if (dataSize < IMB_KASUMI_KEY_SIZE) return -1; - IMB_KASUMI_INIT_F9_KEY_SCHED(p_mgr, key, &exp_key); + if (kasumi_start(dataSize, buff) != 0) + return -1; + + IMB_KASUMI_INIT_F9_KEY_SCHED(p_mgr, buff, kasumi_key); + kasumi_end(); return 0; } +/* ========================================================================== */ +/* ========================================================================== */ + static int test_imb_clear_mem(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { @@ -1006,29 +1338,21 @@ test_imb_clear_mem(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return 0; } +/* ========================================================================== */ +/* ========================================================================== */ + static int test_imb_quic_aes_gcm(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { - struct quic_aes_gcm_ctx { - IMB_KEY_SIZE_BYTES key_size; - IMB_CIPHER_DIRECTION cipher_dir; - uint8_t aad_len; - uint8_t tag_len; - uint8_t num_packets; - uint8_t data; - }; - struct quic_aes_gcm_ctx *ctx = (struct quic_aes_gcm_ctx *) buff; - - if (dataSize <= sizeof(*ctx) || dataSize < 16) + if (dataSize < 1) return -1; - struct gcm_key_data key; - uint8_t tag[256]; + if (gcm_start(dataSize, buff) != 0) + return -1; - const uint64_t n = (uint64_t) ctx->num_packets; - const uint64_t len = dataSize - sizeof(struct quic_aes_gcm_ctx) + sizeof(ctx->data); - const uint64_t tag_len = (uint64_t) ctx->tag_len; - const uint64_t aad_len = ((uint64_t) ctx->aad_len) > len ? len : ((uint64_t) ctx->aad_len); + const uint64_t n = (uint64_t) buff[0]; + const IMB_CIPHER_DIRECTION cipher_dir = (IMB_CIPHER_DIRECTION) (buff[0] >> 6); + const IMB_KEY_SIZE_BYTES key_size = (IMB_KEY_SIZE_BYTES) buff[0]; void *dst[n]; const void *src[n]; @@ -1038,19 +1362,23 @@ test_imb_quic_aes_gcm(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) const void *iv[n]; for (uint64_t i = 0; i < n; i++) { - dst[i] = &ctx->data; - src[i] = &ctx->data; - aad[i] = &ctx->data; - t[i] = tag; - l[i] = len; - iv[i] = buff; + dst[i] = buff; + src[i] = buff; + aad[i] = gcm_aad; + t[i] = gcm_auth_tag; + l[i] = dataSize; + iv[i] = gcm_iv; } - imb_quic_aes_gcm(p_mgr, &key, ctx->key_size, ctx->cipher_dir, dst, src, l, iv, aad, aad_len, - t, tag_len, n); + imb_quic_aes_gcm(p_mgr, gcm_key, key_size, cipher_dir, dst, src, l, iv, aad, gcm_aad_len, t, + gcm_tag_len, n); + gcm_end(); return 0; } #endif /* __aarch64__ */ +/* ========================================================================== */ +/* ========================================================================== */ + struct { int (*func)(IMB_MGR *mb_mgr, uint8_t *buff, size_t dataSize); const char *func_name; @@ -1066,6 +1394,8 @@ struct { { test_snow3g_f8_n_multikey, "test_snow3g_f8_n_multikey" }, { test_snow3g_f9_1_buff, "test_snow3g_f9_1_buff" }, #ifndef __aarch64__ + { test_aes_gcm_pre, "test_aes_gcm_pre" }, + { test_aes_gcm_precomp, "test_aes_gcm_precomp" }, { test_aes128_gcm_enc_sgl, "test_aes128_gcm_enc_sgl" }, { test_aes128_gcm_dec_sgl, "test_aes128_gcm_dec_sgl" }, { test_aes192_gcm_enc_sgl, "test_aes192_gcm_enc_sgl" }, @@ -1078,6 +1408,16 @@ struct { { test_aes192_gcm_dec, "test_aes192_gcm_dec" }, { test_aes256_gcm_enc, "test_aes256_gcm_enc" }, { test_aes256_gcm_dec, "test_aes256_gcm_dec" }, + { test_aes128_gcm_init_var_iv, "test_aes128_gcm_init_var_iv" }, + { test_aes192_gcm_init_var_iv, "test_aes192_gcm_init_var_iv" }, + { test_aes256_gcm_init_var_iv, "test_aes256_gcm_init_var_iv" }, + + { test_aes128_gmac, "test_aes128_gmac" }, + { test_aes192_gmac, "test_aes192_gmac" }, + { test_aes256_gmac, "test_aes256_gmac" }, + + { test_ghash, "test_ghash" }, + { test_ghash_pre, "test_ghash_pre" }, #endif /* __aarch64__ */ { test_zuc_eea3_1_buff, "test_zuc_eea3_1_buff" }, { test_zuc_eea3_4_buff, "test_zuc_eea3_4_buff" }, @@ -1087,6 +1427,7 @@ struct { #ifndef __aarch64__ { test_chacha_poly_enc, "test_chacha_poly_enc" }, { test_chacha_poly_dec, "test_chacha_poly_dec" }, + { test_crc32_ethernet_fcs, "test_crc32_ethernet_fcs" }, { test_crc16_x25, "test_crc16_x25" }, { test_crc32_sctp, "test_crc32_sctp" }, @@ -1099,6 +1440,7 @@ struct { { test_crc6_iuup_header, "test_crc6_iuup_header" }, { test_crc32_wimax_ofdma_data, "test_crc32_wimax_ofdma_data" }, { test_crc8_wimax_ofdma_hcs, "test_crc8_wimax_ofdma_hcs" }, + { test_kasumi_f8_init_key_sched, "test_kasumi_f8_init_key_sched" }, { test_kasumi_f8_1_buff_bit, "test_kasumi_f8_1_buff_bit" }, { test_kasumi_f8_1_buff, "test_kasumi_f8_1_buff" }, @@ -1109,7 +1451,9 @@ struct { { test_kasumi_f9_1_buff, "test_kasumi_f9_1_buff" }, { test_kasumi_f9_1_buff_user, "test_kasumi_f9_1_buff_user" }, { test_kasumi_f9_init_key_sched, "test_kasumi_f9_init_key_sched" }, + { test_imb_clear_mem, "test_imb_clear_mem" }, + { test_imb_quic_aes_gcm, "test_imb_quic_aes_gcm" }, #endif /* __aarch64__ */ }; @@ -1142,18 +1486,18 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) IMB_ARCH arch_to_run = IMB_ARCH_NUM; #ifndef __aarch64__ - if (arch == SSE) + if (arch == IMB_ARCH_SSE) init_mb_mgr_sse(p_mgr); - else if (arch == AVX) + else if (arch == IMB_ARCH_AVX) init_mb_mgr_avx(p_mgr); - else if (arch == AVX2) + else if (arch == IMB_ARCH_AVX2) init_mb_mgr_avx2(p_mgr); - else if (arch == AVX512) + else if (arch == IMB_ARCH_AVX512) init_mb_mgr_avx512(p_mgr); #else /* __aarch64__ */ - if (arch == AARCH64) + if (arch == IMB_ARCH_AARCH64) init_mb_mgr_aarch64(p_mgr); - else if (arch == SVE256) + else if (arch == IMB_ARCH_SVE256) init_mb_mgr_aarch64_sve256(p_mgr); #endif /* __aarch64__ */ else -- GitLab From b2e187c77c96b9fde89882c762b8e98741db7d77 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 16 Oct 2023 15:42:08 +0100 Subject: [PATCH 144/204] test: [KAT-APP] convert ZUC-EIA3 128 vectors to standard format --- test/kat-app/CMakeLists.txt | 72 +----------- test/kat-app/Makefile | 6 +- test/kat-app/win_x64.mak | 2 +- test/kat-app/zuc_eia3_128.json.c | 118 ++++++++++++++++++++ test/kat-app/zuc_test.c | 127 +++++++++++++-------- test/kat-app/zuc_test_vectors.h | 185 ------------------------------- 6 files changed, 207 insertions(+), 303 deletions(-) create mode 100644 test/kat-app/zuc_eia3_128.json.c diff --git a/test/kat-app/CMakeLists.txt b/test/kat-app/CMakeLists.txt index 6fb231e0..2f64b0f2 100644 --- a/test/kat-app/CMakeLists.txt +++ b/test/kat-app/CMakeLists.txt @@ -52,76 +52,8 @@ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c ) else() - set(TEST_APP_SRC_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/main.c - ${CMAKE_CURRENT_SOURCE_DIR}/gcm_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/ctr_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/customop_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/des_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/ccm_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/cmac_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha1_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256_sha512_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_md5_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/aes_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/sha_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/chained_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/api_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/pon_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/ecb_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/zuc_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/kasumi_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/direct_api_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/clear_mem_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/hec_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/xcbc_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbcs_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/crc_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/chacha_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/poly1305_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/chacha20_poly1305_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/null_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/snow_v_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/direct_api_param_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/quic_ecb_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/quic_chacha20_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/gmac_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/ghash_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/aes_cfb_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha1.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha224.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha384.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha512.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/hmac_md5.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/gmac_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/ghash_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/poly1305_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/cmac_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/xcbc_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/sha_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbcs_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/aes_cbc_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/aes_cfb_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/ctr_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/ecb_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/chacha_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/des_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/gcm_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/chacha20_poly1305_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/ccm_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f8_vectors.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/snow3g_test_f9_vectors.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/sm4_ecb_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/sm4_ecb_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/sm4_cbc_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/sm4_cbc_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/sm3_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/sm3_test.json.c - ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c - ) + file(GLOB TEST_APP_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.c") + list(APPEND TEST_APP_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils.c) endif() diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 8915e3ea..d421b1cf 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -44,10 +44,12 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ ecb_test.json.c aes_cfb_test.json.c aes_cbc_test.c aes_cbc_test.json.c ctr_test.json.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ - sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c sm3_test.json.c + sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ + sm3_test.json.c zuc_eia3_128.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ - snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c + snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ + zuc_eia3_128.json.c endif # aarch64 OBJECTS := $(SOURCES:%.c=%.o) utils.o diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index cb32fdd8..df39617a 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep diff --git a/test/kat-app/zuc_eia3_128.json.c b/test/kat-app/zuc_eia3_128.json.c new file mode 100644 index 00000000..d2a0e1af --- /dev/null +++ b/test/kat-app/zuc_eia3_128.json.c @@ -0,0 +1,118 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/* ZUC-EIA3 128 */ +#include "mac_test.h" + +/** + * Note: ZUC IV params stored in vector IV field + * uin32_t count = iv[0-3] + * uint8_t Bearer = iv[4] + * uint8_t Direction = iv[5] + */ +const struct mac_test zuc_eia3_128_test_json[] = { + { 128, 32, 1, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00", "\xc8\xa9\x59\x5e", 1, 1, "\x00\x00\x00\x00\x00\x00", 48 }, + { 128, 32, 2, "\x47\x05\x41\x25\x56\x1e\xb2\xdd\xa9\x40\x59\xda\x05\x09\x78\x50", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x67\x19\xa0\x88", 1, 90, + "\xdd\xb2\x1e\x56\x14\x00", 48 }, + { 128, 32, 3, "\xc9\xe6\xce\xc4\x60\x7c\x72\xdb\x00\x0a\xef\xa8\x83\x85\xab\x0a", + "\x98\x3b\x41\xd4\x7d\x78\x0c\x9e\x1a\xd1\x1d\x7e\xb7\x03\x91\xb1\xde\x0b\x35\xda\x2d\xc6" + "\x2f\x83\xe7\xb7\x8d\x63\x06\xca\x0e\xa0\x7e\x94\x1b\x7b\xe9\x13\x48\xf9\xfc\xb1\x70\xe2" + "\x21\x7f\xec\xd9\x7f\x9f\x68\xad\xb1\x6e\x5d\x7d\x21\xe5\x69\xd2\x80\xed\x77\x5c\xeb\xde" + "\x3f\x40\x93\xc5\x38\x81\x00\x00\x00\x00", + "\xfa\xe8\xff\x0b", 1, 577, "\xda\x59\x40\xa9\x0a\x01", 48 }, + { 128, 32, 4, "\xc8\xa4\x82\x62\xd0\xc2\xe2\xba\xc4\xb9\x6e\xf7\x7e\x80\xca\x59", + "\xb5\x46\x43\x0b\xf8\x7b\x4f\x1e\xe8\x34\x70\x4c\xd6\x95\x1c\x36\xe2\x6f\x10\x8c\xf7\x31" + "\x78\x8f\x48\xdc\x34\xf1\x67\x8c\x05\x22\x1c\x8f\xa7\xff\x2f\x39\xf4\x77\xe7\xe4\x9e\xf6" + "\x0a\x4e\xc2\xc3\xde\x24\x31\x2a\x96\xaa\x26\xe1\xcf\xba\x57\x56\x38\x38\xb2\x97\xf4\x7e" + "\x85\x10\xc7\x79\xfd\x66\x54\xb1\x43\x38\x6f\xa6\x39\xd3\x1e\xdb\xd6\xc0\x6e\x47\xd1\x59" + "\xd9\x43\x62\xf2\x6a\xee\xed\xee\x0e\x4f\x49\xd9\xbf\x84\x12\x99\x54\x15\xbf\xad\x56\xee" + "\x82\xd1\xca\x74\x63\xab\xf0\x85\xb0\x82\xb0\x99\x04\xd6\xd9\x90\xd4\x3c\xf2\xe0\x62\xf4" + "\x08\x39\xd9\x32\x48\xb1\xeb\x92\xcd\xfe\xd5\x30\x0b\xc1\x48\x28\x04\x30\xb6\xd0\xca\xa0" + "\x94\xb6\xec\x89\x11\xab\x7d\xc3\x68\x24\xb8\x24\xdc\x0a\xf6\x68\x2b\x09\x35\xfd\xe7\xb4" + "\x92\xa1\x4d\xc2\xf4\x36\x48\x03\x8d\xa2\xcf\x79\x17\x0d\x2d\x50\x13\x3f\xd4\x94\x16\xcb" + "\x6e\x33\xbe\xa9\x0b\x8b\xf4\x55\x9b\x03\x73\x2a\x01\xea\x29\x0e\x6d\x07\x4f\x79\xbb\x83" + "\xc1\x0e\x58\x00\x15\xcc\x1a\x85\xb3\x6b\x55\x01\x04\x6e\x9c\x4b\xdc\xae\x51\x35\x69\x0b" + "\x86\x66\xbd\x54\xb7\xa7\x03\xea\x7b\x6f\x22\x0a\x54\x69\xa5\x68\x02\x7e", + "\x00\x4a\xc4\xd6", 1, 2079, "\x50\x78\x09\x05\x10\x01", 48 }, + { 128, 32, 5, "\x6b\x8b\x08\xee\x79\xe0\xb5\x98\x2d\x6d\x12\x8e\xa9\xf2\x20\xcb", + "\x5b\xad\x72\x47\x10\xba\x1c\x56\xd5\xa3\x15\xf8\xd4\x0f\x6e\x09\x37\x80\xbe\x8e\x8d\xe0" + "\x7b\x69\x92\x43\x20\x18\xe0\x8e\xd9\x6a\x57\x34\xaf\x8b\xad\x8a\x57\x5d\x3a\x1f\x16\x2f" + "\x85\x04\x5c\xc7\x70\x92\x55\x71\xd9\xf5\xb9\x4e\x45\x4a\x77\xc1\x6e\x72\x93\x6b\xf0\x16" + "\xae\x15\x74\x99\xf0\x54\x3b\x5d\x52\xca\xa6\xdb\xea\xb6\x97\xd2\xbb\x73\xe4\x1b\x80\x75" + "\xdc\xe7\x9b\x4b\x86\x04\x4f\x66\x1d\x44\x85\xa5\x43\xdd\x78\x60\x6e\x04\x19\xe8\x05\x98" + "\x59\xd3\xcb\x2b\x67\xce\x09\x77\x60\x3f\x81\xff\x83\x9e\x33\x18\x59\x54\x4c\xfb\xc8\xd0" + "\x0f\xef\x1a\x4c\x85\x10\xfb\x54\x7d\x6b\x06\xc6\x11\xef\x44\xf1\xbc\xe1\x07\xcf\xa4\x5a" + "\x06\xaa\xb3\x60\x15\x2b\x28\xdc\x1e\xbe\x6f\x7f\xe0\x9b\x05\x16\xf9\xa5\xb0\x2a\x1b\xd8" + "\x4b\xb0\x18\x1e\x2e\x89\xe1\x9b\xd8\x12\x59\x30\xd1\x78\x68\x2f\x38\x62\xdc\x51\xb6\x36" + "\xf0\x4e\x72\x0c\x47\xc3\xce\x51\xad\x70\xd9\x4b\x9b\x22\x55\xfb\xae\x90\x65\x49\xf4\x99" + "\xf8\xc6\xd3\x99\x47\xed\x5e\x5d\xf8\xe2\xde\xf1\x13\x25\x3e\x7b\x08\xd0\xa7\x6b\x6b\xfc" + "\x68\xc8\x12\xf3\x75\xc7\x9b\x8f\xe5\xfd\x85\x97\x6a\xa6\xd4\x6b\x4a\x23\x39\xd8\xae\x51" + "\x47\xf6\x80\xfb\xe7\x0f\x97\x8b\x38\xef\xfd\x7b\x2f\x78\x66\xa2\x25\x54\xe1\x93\xa9\x4e" + "\x98\xa6\x8b\x74\xbd\x25\xbb\x2b\x3f\x5f\xb0\xa5\xfd\x59\x88\x7f\x9a\xb6\x81\x59\xb7\x17" + "\x8d\x5b\x7b\x67\x7c\xb5\x46\xbf\x41\xea\xdc\xa2\x16\xfc\x10\x85\x01\x28\xf8\xbd\xef\x5c" + "\x8d\x89\xf9\x6a\xfa\x4f\xa8\xb5\x48\x85\x56\x5e\xd8\x38\xa9\x50\xfe\xe5\xf1\xc3\xb0\xa4" + "\xf6\xfb\x71\xe5\x4d\xfd\x16\x9e\x82\xce\xcc\x72\x66\xc8\x50\xe6\x7c\x5e\xf0\xba\x96\x0f" + "\x52\x14\x06\x0e\x71\xeb\x17\x2a\x75\xfc\x14\x86\x83\x5c\xbe\xa6\x53\x44\x65\xb0\x55\xc9" + "\x6a\x72\xe4\x10\x52\x24\x18\x23\x25\xd8\x30\x41\x4b\x40\x21\x4d\xaa\x80\x91\xd2\xe0\xfb" + "\x01\x0a\xe1\x5c\x6d\xe9\x08\x50\x97\x3b\xdf\x1e\x42\x3b\xe1\x48\xa2\x37\xb8\x7a\x0c\x9f" + "\x34\xd4\xb4\x76\x05\xb8\x03\xd7\x43\xa8\x6a\x90\x39\x9a\x4a\xf3\x96\xd3\xa1\x20\x0a\x62" + "\xf3\xd9\x50\x79\x62\xe8\xe5\xbe\xe6\xd3\xda\x2b\xb3\xf7\x23\x76\x64\xac\x7a\x29\x28\x23" + "\x90\x0b\xc6\x35\x03\xb2\x9e\x80\xd6\x3f\x60\x67\xbf\x8e\x17\x16\xac\x25\xbe\xba\x35\x0d" + "\xeb\x62\xa9\x9f\xe0\x31\x85\xeb\x4f\x69\x93\x7e\xcd\x38\x79\x41\xfd\xa5\x44\xba\x67\xdb" + "\x09\x11\x77\x49\x38\xb0\x18\x27\xbc\xc6\x9c\x92\xb3\xf7\x72\xa9\xd2\x85\x9e\xf0\x03\x39" + "\x8b\x1f\x6b\xba\xd7\xb5\x74\xf7\x98\x9a\x1d\x10\xb2\xdf\x79\x8e\x0d\xbf\x30\xd6\x58\x74" + "\x64\xd2\x48\x78\xcd\x00\xc0\xea\xee\x8a\x1a\x0c\xc7\x53\xa2\x79\x79\xe1\x1b\x41\xdb\x1d" + "\xe3\xd5\x03\x8a\xfa\xf4\x9f\x5c\x68\x2c\x37\x48\xd8\xa3\xa9\xec\x54\xe6\xa3\x71\x27\x5f" + "\x16\x83\x51\x0f\x8e\x4f\x90\x93\x8f\x9a\xb6\xe1\x34\xc2\xcf\xdf\x48\x41\xcb\xa8\x8e\x0c" + "\xff\x2b\x0b\xcc\x8e\x6a\xdc\xb7\x11\x09\xb5\x19\x8f\xec\xf1\xbb\x7e\x5c\x53\x1a\xca\x50" + "\xa5\x6a\x8a\x3b\x6d\xe5\x98\x62\xd4\x1f\xa1\x13\xd9\xcd\x95\x78\x08\xf0\x85\x71\xd9\xa4" + "\xbb\x79\x2a\xf2\x71\xf6\xcc\x6d\xbb\x8d\xc7\xec\x36\xe3\x6b\xe1\xed\x30\x81\x64\xc3\x1c" + "\x7c\x0a\xfc\x54\x1c", + "\x0c\xa1\x27\x92", 1, 5670, "\xdd\xb2\x1e\x56\x1c\x00", 48 }, + { 128, 32, 6, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x5b\xad\x72\x47\x10\xba\x1c\x56", "\x84\x9a\xca\xdb", 1, 63, "\x67\x45\x23\x01\x0a\x00", + 48 }, + { 128, 32, 7, "\xc9\xe6\xce\xc4\x60\x7c\x72\xdb\x00\x0a\xef\xa8\x83\x85\xab\x0a", + "\x98\x3b\x41\xd4\x7d\x78\x0c\x9e\x1a\xd1\x1d\x7e\xb7\x03\x91\xb1", "\x81\x17\x55\x81", 1, + 62, "\xda\x59\x40\xa9\x0a\x01", 48 }, + { 128, 32, 8, "\xc9\xe6\xce\xc4\x60\x7c\x72\xdb\x00\x0a\xef\xa8\x83\x85\xab\x0a", + "\x98\x3b\x41\xd4\x7d\x78\x0c\x9e\x1a\xd1\x1d\x7e\xb7\x03\x91\xb1\xde\x0b\x35\xda\x2d\xc6" + "\x2f\x83\xe7\xb7\x8d\x63\x06\xca\x0e\xa0\x7e\x94\x1b\x7b\xe9\x13\x48\xf9\xfc\xb1\x70\xe2" + "\x21\x7f\xec\xd9\x7f\x9f\x68\xad\xb1\x6e\x5d\x7d\x21\xe5\x69\xd2\x80\xed\x77\x5c", + "\xbb\xaf\x2f\xc3", 1, 512, "\xda\x59\x40\xa9\x0a\x00", 48 }, + { 128, 32, 9, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + "\x5b\xad\x72\x47\x10\xba\x1c\x56", "\x1b\x3d\x0f\x74", 1, 64, "\x67\x45\x23\x01\x0a\x00", + 48 }, + { 128, 32, 10, "\xc9\xe6\xce\xc4\x60\x7c\x72\xdb\x00\x0a\xef\xa8\x83\x85\xab\x0a", + "\x98\x3b\x41\xd4\x7d\x78\x0c\x9e\x1a\xd1\x1d\x7e\xb7\x03\x91\xb1\xde\x0b\x35\xda\x2d\xc6" + "\x2f\x83\xe7\xb7\x8d\x63\x06\xca\x0e\xa0\x7e\x94\x1b\x7b\xe9\x13\x48\xf9\xfc\xb1\x70\xe2" + "\x21\x7f\xec\xd9\x7f\x9f\x68\xad\xb1\x6e\x5d\x7d\x21\xe5\x69\xd2\x80\xed\x77\x5c", + "\x39\x5c\x11\x92", 1, 480, "\xda\x59\x40\xa9\x0a\x01", 48 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; diff --git a/test/kat-app/zuc_test.c b/test/kat-app/zuc_test.c index d4707921..2d108ae1 100644 --- a/test/kat-app/zuc_test.c +++ b/test/kat-app/zuc_test.c @@ -43,6 +43,7 @@ #include "zuc_test_vectors.h" #include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "mac_test.h" #define MAXBUFS 17 #define PASS_STATUS 0 @@ -56,6 +57,14 @@ enum api_type { TEST_DIRECT_API, TEST_SINGLE_JOB_API, TEST_BURST_JOB_API }; int zuc_test(struct IMB_MGR *mb_mgr); +extern const struct mac_test zuc_eia3_128_test_json[]; + +struct zuc_eia3_128_params { + const uint32_t *count; + const uint8_t *bearer; + const uint8_t *direction; +}; + int validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV); @@ -1074,6 +1083,19 @@ validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD return ret; } +/** + * Count, Bearer and Direction stored in vector IV field + */ +static void +zuc_eia3_128_set_params(const struct mac_test *v, struct zuc_eia3_128_params *p) +{ + const uint8_t *params = (const uint8_t *) v->iv; + + p->count = (const uint32_t *) ¶ms[0]; + p->bearer = ¶ms[4]; + p->direction = ¶ms[5]; +} + int validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, const enum api_type type) @@ -1081,19 +1103,21 @@ validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDs uint32_t i; int ret = 0; uint32_t bitLength; + const struct mac_test *v = zuc_eia3_128_test_json; - for (i = 0; i < NUM_ZUC_EIA3_TESTS; i++) { + for (i = 0; v[i].msg != NULL; i++) { const unsigned int iv_len = IMB_ZUC_IV_LEN_IN_BYTES; + struct zuc_eia3_128_params p = { 0 }; - memcpy(pKeys, testEIA3_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); + memcpy(pKeys, v[i].key, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eia3_iv_gen(testEIA3_vectors[i].count, testEIA3_vectors[i].Bearer, - testEIA3_vectors[i].Direction, pIV); - bitLength = testEIA3_vectors[i].length_in_bits; + zuc_eia3_128_set_params(&v[i], &p); + zuc_eia3_iv_gen(*p.count, *p.bearer, *p.direction, pIV); + bitLength = (uint32_t) v[i].msgSize; const uint32_t byteLength = (bitLength + 7) / 8; - memcpy(pSrcData, testEIA3_vectors[i].message, byteLength); + memcpy(pSrcData, v[i].msg, byteLength); if (type == TEST_SINGLE_JOB_API) submit_eia3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &bitLength, 1, IMB_ZUC_KEY_LEN_IN_BYTES, IMB_ZUC_DIGEST_LEN_IN_BYTES, @@ -1101,11 +1125,10 @@ validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDs else /* TEST_DIRECT_API */ IMB_ZUC_EIA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, bitLength, (uint32_t *) pDstData); - const int retTmp = memcmp(pDstData, &testEIA3_vectors[i].mac, - sizeof(((struct test128EIA3_vectors_t *) 0)->mac)); + const int retTmp = memcmp(pDstData, v[i].tag, v[i].tagSize / 8); if (retTmp) { - printf("Validate ZUC 1 block test %u (Int): FAIL\n", i + 1); - byte_hexdump("Expected", (const uint8_t *) &testEIA3_vectors[i].mac, + printf("Validate ZUC 1 block test %zu (Int): FAIL\n", v[i].tcId); + byte_hexdump("Expected", (const uint8_t *) v[i].tag, IMB_ZUC_DIGEST_LEN_IN_BYTES); byte_hexdump("Found", pDstData, IMB_ZUC_DIGEST_LEN_IN_BYTES); ret = retTmp; @@ -1113,9 +1136,9 @@ validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDs #ifdef DEBUG else { if (!quiet_mode) - printf("Validate ZUC 1 block test %u (Int): " - "PASS\n", - i + 1); + printf("ZUC-EIA3 128 1 block vector %zu Message length: %zu, " + "Tag length: %zu\n", + v[i].tcId, v[i].msgSize / 8, v[i].tagSize / 8); } #endif fflush(stdout); @@ -1128,22 +1151,32 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) { - uint32_t i, j; + uint32_t i, j, num_vectors = 0; int retTmp, ret = 0; uint32_t byteLength; uint32_t bitLength[MAXBUFS]; - struct test128EIA3_vectors_t vector; unsigned int iv_lens[MAXBUFS]; + const struct mac_test *v = zuc_eia3_128_test_json; + + /* calculate number of test vectors */ + for (i = 0; v[i].msg != NULL; i++) + num_vectors++; - for (i = 0; i < NUM_ZUC_EIA3_TESTS; i++) { - vector = testEIA3_vectors[i]; + if (num_vectors == 0) { + printf("ZUC-EIA3 128 N block - No vectors found!\n"); + return 1; + } + + for (i = 0; i < num_vectors; i++) { for (j = 0; j < numBuffs; j++) { - memcpy(pKeys[j], vector.CK, IMB_ZUC_KEY_LEN_IN_BYTES); + struct zuc_eia3_128_params p = { 0 }; + memcpy(pKeys[j], v[i].key, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eia3_iv_gen(vector.count, vector.Bearer, vector.Direction, pIV[j]); - bitLength[j] = vector.length_in_bits; + zuc_eia3_128_set_params(&v[i], &p); + zuc_eia3_iv_gen(*p.count, *p.bearer, *p.direction, pIV[j]); + bitLength[j] = (uint32_t) v[i].msgSize; byteLength = (bitLength[j] + 7) / 8; - memcpy(pSrcData[j], vector.message, byteLength); + memcpy(pSrcData[j], v[i].msg, byteLength); iv_lens[j] = IMB_ZUC_IV_LEN_IN_BYTES; } if (type == TEST_SINGLE_JOB_API) @@ -1161,12 +1194,12 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p (uint32_t **) pDstData, numBuffs); for (j = 0; j < numBuffs; j++) { - retTmp = memcmp(pDstData[j], &vector.mac, IMB_ZUC_DIGEST_LEN_IN_BYTES); + retTmp = memcmp(pDstData[j], v[i].tag, IMB_ZUC_DIGEST_LEN_IN_BYTES); if (retTmp) { - printf("Validate ZUC n block test %u, index %u " - "(Int): FAIL\n", - i + 1, j); - byte_hexdump("Expected", (const uint8_t *) &vector.mac, + printf("ZUC-EIA3 128 N block #jobs: %d, vector %zu Message " + "length: %zu, Tag length: %zu\n", + numBuffs, v[i].tcId, v[i].msgSize / 8, v[i].tagSize / 8); + byte_hexdump("Expected", (const uint8_t *) v[i].tag, IMB_ZUC_DIGEST_LEN_IN_BYTES); byte_hexdump("Found", pDstData[j], IMB_ZUC_DIGEST_LEN_IN_BYTES); ret = retTmp; @@ -1174,9 +1207,10 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p #ifdef DEBUG else { if (!quiet_mode) - printf("Validate ZUC n block test %u, " - "index %u (Int): PASS\n", - i + 1, j); + printf("ZUC-EIA3 128 N block #jobs: %d, vector %zu Message " + "length: %zu, Tag length: %zu\n", + numBuffs, v[i].tcId, v[i].msgSize / 8, + v[i].tagSize / 8); } #endif fflush(stdout); @@ -1186,14 +1220,16 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p /* Generate digests for n different test vectors, * grouping all available tests vectors in groups of N buffers */ for (i = 0; i < numBuffs; i++) { - vector = testEIA3_vectors[i % NUM_ZUC_EIA3_TESTS]; - memcpy(pKeys[i], vector.CK, IMB_ZUC_KEY_LEN_IN_BYTES); + const int vec_idx = i % num_vectors; + struct zuc_eia3_128_params p = { 0 }; + memcpy(pKeys[i], v[vec_idx].key, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eia3_iv_gen(vector.count, vector.Bearer, vector.Direction, pIV[i]); - bitLength[i] = vector.length_in_bits; + zuc_eia3_128_set_params(&v[vec_idx], &p); + zuc_eia3_iv_gen(*p.count, *p.bearer, *p.direction, pIV[i]); + bitLength[i] = (uint32_t) v[vec_idx].msgSize; byteLength = (bitLength[i] + 7) / 8; - memcpy(pSrcData[i], vector.message, byteLength); - iv_lens[j] = IMB_ZUC_IV_LEN_IN_BYTES; + memcpy(pSrcData[i], v[vec_idx].msg, byteLength); + iv_lens[i] = IMB_ZUC_IV_LEN_IN_BYTES; } if (type == TEST_SINGLE_JOB_API) @@ -1209,14 +1245,14 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p bitLength, (uint32_t **) pDstData, numBuffs); for (i = 0; i < numBuffs; i++) { - vector = testEIA3_vectors[i % NUM_ZUC_EIA3_TESTS]; - retTmp = memcmp(pDstData[i], &vector.mac, - sizeof(((struct test128EIA3_vectors_t *) 0)->mac)); + const int vec_idx = i % num_vectors; + retTmp = memcmp(pDstData[i], v[vec_idx].tag, v[vec_idx].tagSize / 8); if (retTmp) { - printf("Validate ZUC n block multi-vector test " - "# jobs = %u, index %u (Int): FAIL\n", - numBuffs, i); - byte_hexdump("Expected", (const uint8_t *) &vector.mac, + printf("ZUC-EIA3 128 N block #jobs: %d, vector %zu Message " + "length: %zu, Tag length: %zu\n", + numBuffs, v[vec_idx].tcId, v[vec_idx].msgSize / 8, + v[vec_idx].tagSize / 8); + byte_hexdump("Expected", (const uint8_t *) v[vec_idx].tag, IMB_ZUC_DIGEST_LEN_IN_BYTES); byte_hexdump("Found", pDstData[i], IMB_ZUC_DIGEST_LEN_IN_BYTES); ret = retTmp; @@ -1224,9 +1260,10 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p #ifdef DEBUG else { if (!quiet_mode) - printf("Validate ZUC n block multi-vector test," - " #jobs = %u, index %u (Int): PASS\n", - numBuffs, i); + printf("ZUC-EIA3 128 N block #jobs: %d, vector %zu Message " + "length: %zu, Tag length: %zu\n", + numBuffs, v[vec_idx].tcId, v[vec_idx].msgSize / 8, + v[vec_idx].tagSize / 8); } #endif fflush(stdout); diff --git a/test/kat-app/zuc_test_vectors.h b/test/kat-app/zuc_test_vectors.h index 9664c559..ba4da2c5 100644 --- a/test/kat-app/zuc_test_vectors.h +++ b/test/kat-app/zuc_test_vectors.h @@ -65,16 +65,6 @@ typedef struct test256EEA3_vectors_t { uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; } test256EEA_vectors_t; -typedef struct test128EIA3_vectors_t { - uint8_t CK[16]; - uint32_t count; - uint8_t Bearer; - uint8_t Direction; - uint32_t length_in_bits; - uint8_t message[MAX_BUFFER_LENGTH_IN_BYTES]; - uint8_t mac[4]; -} test128EIA_vectors_t; - typedef struct test256EIA3_vectors_t { uint8_t CK[32]; uint8_t IV[25]; @@ -612,181 +602,6 @@ const struct test256EEA3_vectors_t test256EEA3_vectors[] = { 0x89, 0x3F, 0x34, 0xFF, 0x9F, 0xF1, 0x3D, 0x80, 0xE8, 0x54 } }, }; -const struct test128EIA3_vectors_t testEIA3_vectors[] = { - { /*Test 1*/ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 }, - 0x00000000, - 0x0, - 0x0, - 1, - { 0x00, 0x00, 0x00, 0x00 }, - { 0xC8, 0xA9, 0x59, 0x5E } }, - { /*Test 2*/ - { 0x47, 0x05, 0x41, 0x25, 0x56, 0x1e, 0xb2, 0xdd, 0xa9, 0x40, 0x59, 0xda, 0x05, 0x09, - 0x78, 0x50 }, - 0x561EB2DD, - 0x14, - 0, - 90, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x67, 0x19, 0xA0, 0x88 } }, - /*Test 3*/ - { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, - 0xAB, 0x0A }, - 0xA94059DA, - 0xA, - 0x1, - 577, - { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, - 0x03, 0x91, 0xB1, 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, 0xE7, 0xB7, - 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, - 0xF9, 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, 0x7F, 0x9F, 0x68, 0xAD, - 0xB1, 0x6E, 0x5D, 0x7D, 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C, 0xEB, - 0xDE, 0x3F, 0x40, 0x93, 0xC5, 0x38, 0x81, 0x00, 0x00, 0x00, 0x00 }, - { 0xFA, 0xE8, 0xFF, 0x0B } }, - /*Test 4*/ - { { 0xc8, 0xa4, 0x82, 0x62, 0xd0, 0xc2, 0xe2, 0xba, 0xc4, 0xb9, 0x6e, 0xf7, 0x7e, 0x80, - 0xca, 0x59 }, - 0x5097850, - 0x10, - 0x1, - 2079, - { 0xb5, 0x46, 0x43, 0x0b, 0xf8, 0x7b, 0x4f, 0x1e, 0xe8, 0x34, 0x70, 0x4c, 0xd6, 0x95, - 0x1c, 0x36, 0xe2, 0x6f, 0x10, 0x8c, 0xf7, 0x31, 0x78, 0x8f, 0x48, 0xdc, 0x34, 0xf1, - 0x67, 0x8c, 0x05, 0x22, 0x1c, 0x8f, 0xa7, 0xff, 0x2f, 0x39, 0xf4, 0x77, 0xe7, 0xe4, - 0x9e, 0xf6, 0x0a, 0x4e, 0xc2, 0xc3, 0xde, 0x24, 0x31, 0x2a, 0x96, 0xaa, 0x26, 0xe1, - 0xcf, 0xba, 0x57, 0x56, 0x38, 0x38, 0xb2, 0x97, 0xf4, 0x7e, 0x85, 0x10, 0xc7, 0x79, - 0xfd, 0x66, 0x54, 0xb1, 0x43, 0x38, 0x6f, 0xa6, 0x39, 0xd3, 0x1e, 0xdb, 0xd6, 0xc0, - 0x6e, 0x47, 0xd1, 0x59, 0xd9, 0x43, 0x62, 0xf2, 0x6a, 0xee, 0xed, 0xee, 0x0e, 0x4f, - 0x49, 0xd9, 0xbf, 0x84, 0x12, 0x99, 0x54, 0x15, 0xbf, 0xad, 0x56, 0xee, 0x82, 0xd1, - 0xca, 0x74, 0x63, 0xab, 0xf0, 0x85, 0xb0, 0x82, 0xb0, 0x99, 0x04, 0xd6, 0xd9, 0x90, - 0xd4, 0x3c, 0xf2, 0xe0, 0x62, 0xf4, 0x08, 0x39, 0xd9, 0x32, 0x48, 0xb1, 0xeb, 0x92, - 0xcd, 0xfe, 0xd5, 0x30, 0x0b, 0xc1, 0x48, 0x28, 0x04, 0x30, 0xb6, 0xd0, 0xca, 0xa0, - 0x94, 0xb6, 0xec, 0x89, 0x11, 0xab, 0x7d, 0xc3, 0x68, 0x24, 0xb8, 0x24, 0xdc, 0x0a, - 0xf6, 0x68, 0x2b, 0x09, 0x35, 0xfd, 0xe7, 0xb4, 0x92, 0xa1, 0x4d, 0xc2, 0xf4, 0x36, - 0x48, 0x03, 0x8d, 0xa2, 0xcf, 0x79, 0x17, 0x0d, 0x2d, 0x50, 0x13, 0x3f, 0xd4, 0x94, - 0x16, 0xcb, 0x6e, 0x33, 0xbe, 0xa9, 0x0b, 0x8b, 0xf4, 0x55, 0x9b, 0x03, 0x73, 0x2a, - 0x01, 0xea, 0x29, 0x0e, 0x6d, 0x07, 0x4f, 0x79, 0xbb, 0x83, 0xc1, 0x0e, 0x58, 0x00, - 0x15, 0xcc, 0x1a, 0x85, 0xb3, 0x6b, 0x55, 0x01, 0x04, 0x6e, 0x9c, 0x4b, 0xdc, 0xae, - 0x51, 0x35, 0x69, 0x0b, 0x86, 0x66, 0xbd, 0x54, 0xb7, 0xa7, 0x03, 0xea, 0x7b, 0x6f, - 0x22, 0x0a, 0x54, 0x69, 0xa5, 0x68, 0x02, 0x7e }, - { 0x00, 0x4A, 0xC4, 0xD6 } }, - /*Test 5*/ - { { 0x6B, 0x8B, 0x08, 0xEE, 0x79, 0xE0, 0xB5, 0x98, 0x2D, 0x6D, 0x12, 0x8E, 0xA9, 0xF2, - 0x20, 0xCB }, - 0x561EB2DD, - 0x1C, - 0x0, - 5670, - { 0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56, 0xD5, 0xA3, 0x15, 0xF8, 0xD4, 0x0F, - 0x6E, 0x09, 0x37, 0x80, 0xBE, 0x8E, 0x8D, 0xE0, 0x7B, 0x69, 0x92, 0x43, 0x20, 0x18, - 0xE0, 0x8E, 0xD9, 0x6A, 0x57, 0x34, 0xAF, 0x8B, 0xAD, 0x8A, 0x57, 0x5D, 0x3A, 0x1F, - 0x16, 0x2F, 0x85, 0x04, 0x5C, 0xC7, 0x70, 0x92, 0x55, 0x71, 0xD9, 0xF5, 0xB9, 0x4E, - 0x45, 0x4A, 0x77, 0xC1, 0x6E, 0x72, 0x93, 0x6B, 0xF0, 0x16, 0xAE, 0x15, 0x74, 0x99, - 0xF0, 0x54, 0x3B, 0x5D, 0x52, 0xCA, 0xA6, 0xDB, 0xEA, 0xB6, 0x97, 0xD2, 0xBB, 0x73, - 0xE4, 0x1B, 0x80, 0x75, 0xDC, 0xE7, 0x9B, 0x4B, 0x86, 0x04, 0x4F, 0x66, 0x1D, 0x44, - 0x85, 0xA5, 0x43, 0xDD, 0x78, 0x60, 0x6E, 0x04, 0x19, 0xE8, 0x05, 0x98, 0x59, 0xD3, - 0xCB, 0x2B, 0x67, 0xCE, 0x09, 0x77, 0x60, 0x3F, 0x81, 0xFF, 0x83, 0x9E, 0x33, 0x18, - 0x59, 0x54, 0x4C, 0xFB, 0xC8, 0xD0, 0x0F, 0xEF, 0x1A, 0x4C, 0x85, 0x10, 0xFB, 0x54, - 0x7D, 0x6B, 0x06, 0xC6, 0x11, 0xEF, 0x44, 0xF1, 0xBC, 0xE1, 0x07, 0xCF, 0xA4, 0x5A, - 0x06, 0xAA, 0xB3, 0x60, 0x15, 0x2B, 0x28, 0xDC, 0x1E, 0xBE, 0x6F, 0x7F, 0xE0, 0x9B, - 0x05, 0x16, 0xF9, 0xA5, 0xB0, 0x2A, 0x1B, 0xD8, 0x4B, 0xB0, 0x18, 0x1E, 0x2E, 0x89, - 0xE1, 0x9B, 0xD8, 0x12, 0x59, 0x30, 0xD1, 0x78, 0x68, 0x2F, 0x38, 0x62, 0xDC, 0x51, - 0xB6, 0x36, 0xF0, 0x4E, 0x72, 0x0C, 0x47, 0xC3, 0xCE, 0x51, 0xAD, 0x70, 0xD9, 0x4B, - 0x9B, 0x22, 0x55, 0xFB, 0xAE, 0x90, 0x65, 0x49, 0xF4, 0x99, 0xF8, 0xC6, 0xD3, 0x99, - 0x47, 0xED, 0x5E, 0x5D, 0xF8, 0xE2, 0xDE, 0xF1, 0x13, 0x25, 0x3E, 0x7B, 0x08, 0xD0, - 0xA7, 0x6B, 0x6B, 0xFC, 0x68, 0xC8, 0x12, 0xF3, 0x75, 0xC7, 0x9B, 0x8F, 0xE5, 0xFD, - 0x85, 0x97, 0x6A, 0xA6, 0xD4, 0x6B, 0x4A, 0x23, 0x39, 0xD8, 0xAE, 0x51, 0x47, 0xF6, - 0x80, 0xFB, 0xE7, 0x0F, 0x97, 0x8B, 0x38, 0xEF, 0xFD, 0x7B, 0x2F, 0x78, 0x66, 0xA2, - 0x25, 0x54, 0xE1, 0x93, 0xA9, 0x4E, 0x98, 0xA6, 0x8B, 0x74, 0xBD, 0x25, 0xBB, 0x2B, - 0x3F, 0x5F, 0xB0, 0xA5, 0xFD, 0x59, 0x88, 0x7F, 0x9A, 0xB6, 0x81, 0x59, 0xB7, 0x17, - 0x8D, 0x5B, 0x7B, 0x67, 0x7C, 0xB5, 0x46, 0xBF, 0x41, 0xEA, 0xDC, 0xA2, 0x16, 0xFC, - 0x10, 0x85, 0x01, 0x28, 0xF8, 0xBD, 0xEF, 0x5C, 0x8D, 0x89, 0xF9, 0x6A, 0xFA, 0x4F, - 0xA8, 0xB5, 0x48, 0x85, 0x56, 0x5E, 0xD8, 0x38, 0xA9, 0x50, 0xFE, 0xE5, 0xF1, 0xC3, - 0xB0, 0xA4, 0xF6, 0xFB, 0x71, 0xE5, 0x4D, 0xFD, 0x16, 0x9E, 0x82, 0xCE, 0xCC, 0x72, - 0x66, 0xC8, 0x50, 0xE6, 0x7C, 0x5E, 0xF0, 0xBA, 0x96, 0x0F, 0x52, 0x14, 0x06, 0x0E, - 0x71, 0xEB, 0x17, 0x2A, 0x75, 0xFC, 0x14, 0x86, 0x83, 0x5C, 0xBE, 0xA6, 0x53, 0x44, - 0x65, 0xB0, 0x55, 0xC9, 0x6A, 0x72, 0xE4, 0x10, 0x52, 0x24, 0x18, 0x23, 0x25, 0xD8, - 0x30, 0x41, 0x4B, 0x40, 0x21, 0x4D, 0xAA, 0x80, 0x91, 0xD2, 0xE0, 0xFB, 0x01, 0x0A, - 0xE1, 0x5C, 0x6D, 0xE9, 0x08, 0x50, 0x97, 0x3B, 0xDF, 0x1E, 0x42, 0x3B, 0xE1, 0x48, - 0xA2, 0x37, 0xB8, 0x7A, 0x0C, 0x9F, 0x34, 0xD4, 0xB4, 0x76, 0x05, 0xB8, 0x03, 0xD7, - 0x43, 0xA8, 0x6A, 0x90, 0x39, 0x9A, 0x4A, 0xF3, 0x96, 0xD3, 0xA1, 0x20, 0x0A, 0x62, - 0xF3, 0xD9, 0x50, 0x79, 0x62, 0xE8, 0xE5, 0xBE, 0xE6, 0xD3, 0xDA, 0x2B, 0xB3, 0xF7, - 0x23, 0x76, 0x64, 0xAC, 0x7A, 0x29, 0x28, 0x23, 0x90, 0x0B, 0xC6, 0x35, 0x03, 0xB2, - 0x9E, 0x80, 0xD6, 0x3F, 0x60, 0x67, 0xBF, 0x8E, 0x17, 0x16, 0xAC, 0x25, 0xBE, 0xBA, - 0x35, 0x0D, 0xEB, 0x62, 0xA9, 0x9F, 0xE0, 0x31, 0x85, 0xEB, 0x4F, 0x69, 0x93, 0x7E, - 0xCD, 0x38, 0x79, 0x41, 0xFD, 0xA5, 0x44, 0xBA, 0x67, 0xDB, 0x09, 0x11, 0x77, 0x49, - 0x38, 0xB0, 0x18, 0x27, 0xBC, 0xC6, 0x9C, 0x92, 0xB3, 0xF7, 0x72, 0xA9, 0xD2, 0x85, - 0x9E, 0xF0, 0x03, 0x39, 0x8B, 0x1F, 0x6B, 0xBA, 0xD7, 0xB5, 0x74, 0xF7, 0x98, 0x9A, - 0x1D, 0x10, 0xB2, 0xDF, 0x79, 0x8E, 0x0D, 0xBF, 0x30, 0xD6, 0x58, 0x74, 0x64, 0xD2, - 0x48, 0x78, 0xCD, 0x00, 0xC0, 0xEA, 0xEE, 0x8A, 0x1A, 0x0C, 0xC7, 0x53, 0xA2, 0x79, - 0x79, 0xE1, 0x1B, 0x41, 0xDB, 0x1D, 0xE3, 0xD5, 0x03, 0x8A, 0xFA, 0xF4, 0x9F, 0x5C, - 0x68, 0x2C, 0x37, 0x48, 0xD8, 0xA3, 0xA9, 0xEC, 0x54, 0xE6, 0xA3, 0x71, 0x27, 0x5F, - 0x16, 0x83, 0x51, 0x0F, 0x8E, 0x4F, 0x90, 0x93, 0x8F, 0x9A, 0xB6, 0xE1, 0x34, 0xC2, - 0xCF, 0xDF, 0x48, 0x41, 0xCB, 0xA8, 0x8E, 0x0C, 0xFF, 0x2B, 0x0B, 0xCC, 0x8E, 0x6A, - 0xDC, 0xB7, 0x11, 0x09, 0xB5, 0x19, 0x8F, 0xEC, 0xF1, 0xBB, 0x7E, 0x5C, 0x53, 0x1A, - 0xCA, 0x50, 0xA5, 0x6A, 0x8A, 0x3B, 0x6D, 0xE5, 0x98, 0x62, 0xD4, 0x1F, 0xA1, 0x13, - 0xD9, 0xCD, 0x95, 0x78, 0x08, 0xF0, 0x85, 0x71, 0xD9, 0xA4, 0xBB, 0x79, 0x2A, 0xF2, - 0x71, 0xF6, 0xCC, 0x6D, 0xBB, 0x8D, 0xC7, 0xEC, 0x36, 0xE3, 0x6B, 0xE1, 0xED, 0x30, - 0x81, 0x64, 0xC3, 0x1C, 0x7C, 0x0A, 0xFC, 0x54, 0x1C }, - { 0x0C, 0xA1, 0x27, 0x92 } }, - /*Custom test 1*/ - { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, - 0x0E, 0x0F }, - 0x01234567, - 0xA, - 0x0, - 63, - { 0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56 }, - { 0x84, 0x9A, 0xCA, 0xDB } }, - /*Custom test 2*/ - { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, - 0xAB, 0x0A }, - 0xA94059DA, - 0xA, - 0x1, - 62, - { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, 0x03, - 0x91, 0xB1 }, - { 0x81, 0x17, 0x55, 0x81 } }, - /*Custom test 3*/ - { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, - 0xAB, 0x0A }, - 0xA94059DA, - 0xA, - 0x0, - 512, - { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, - 0x03, 0x91, 0xB1, 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, 0xE7, 0xB7, - 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, - 0xF9, 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, 0x7F, 0x9F, 0x68, 0xAD, - 0xB1, 0x6E, 0x5D, 0x7D, 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C }, - { 0xBB, 0xAF, 0x2F, 0xC3 } }, - /*Custom test 4*/ - { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, - 0x0E, 0x0F }, - 0x01234567, - 0xA, - 0x0, - 64, - { 0x5B, 0xAD, 0x72, 0x47, 0x10, 0xBA, 0x1C, 0x56 }, - { 0x1B, 0x3D, 0x0f, 0x74 } }, - /*Custom test 5*/ - { { 0xC9, 0xE6, 0xCE, 0xC4, 0x60, 0x7C, 0x72, 0xDB, 0x00, 0x0A, 0xEF, 0xA8, 0x83, 0x85, - 0xAB, 0x0A }, - 0xA94059DA, - 0xA, - 0x1, - 480, - { 0x98, 0x3B, 0x41, 0xD4, 0x7D, 0x78, 0x0C, 0x9E, 0x1A, 0xD1, 0x1D, 0x7E, 0xB7, - 0x03, 0x91, 0xB1, 0xDE, 0x0B, 0x35, 0xDA, 0x2D, 0xC6, 0x2F, 0x83, 0xE7, 0xB7, - 0x8D, 0x63, 0x06, 0xCA, 0x0E, 0xA0, 0x7E, 0x94, 0x1B, 0x7B, 0xE9, 0x13, 0x48, - 0xF9, 0xFC, 0xB1, 0x70, 0xE2, 0x21, 0x7F, 0xEC, 0xD9, 0x7F, 0x9F, 0x68, 0xAD, - 0xB1, 0x6E, 0x5D, 0x7D, 0x21, 0xE5, 0x69, 0xD2, 0x80, 0xED, 0x77, 0x5C }, - { 0x39, 0x5C, 0x11, 0x92 } }, -}; - const struct test256EIA3_vectors_t test256EIA3_vectors[] = { { /* Test 1 */ -- GitLab From 29e9e62ab7386350a15138fe81eed0df48f95a28 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 19 Oct 2023 13:23:00 +0100 Subject: [PATCH 145/204] lib: detect hybrid core CPU flag --- lib/ipsec-mb.h | 1 + lib/x86_64/cpu_feature.c | 8 ++++++++ test/kat-app/main.c | 1 + 3 files changed, 10 insertions(+) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 0a96605e..55fc6160 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -937,6 +937,7 @@ typedef int (*imb_self_test_cb_t)(void *cb_arg, const IMB_SELF_TEST_CALLBACK_DAT #define IMB_FEATURE_SELF_TEST (1ULL << 20) /* self-test feature present */ #define IMB_FEATURE_SELF_TEST_PASS (1ULL << 21) /* self-test passed */ #define IMB_FEATURE_AVX_IFMA (1ULL << 22) +#define IMB_FEATURE_HYBRID (1ULL << 23) /* Hybrid core */ /** * Self test defines diff --git a/lib/x86_64/cpu_feature.c b/lib/x86_64/cpu_feature.c index 4267815c..8b5f4f7d 100644 --- a/lib/x86_64/cpu_feature.c +++ b/lib/x86_64/cpu_feature.c @@ -181,6 +181,13 @@ detect_bmi2(void) return (cpuid_7_0.ebx & (1UL << 8)); } +static uint32_t +detect_hybrid(void) +{ + /* Check presence of Hybrid core - bit 15 of EDX */ + return (cpuid_7_0.edx & (1UL << 15)); +} + uint64_t cpu_feature_detect(void) { @@ -207,6 +214,7 @@ cpu_feature_detect(void) { 7, IMB_FEATURE_AVX512_IFMA, detect_avx512_ifma }, { 7, IMB_FEATURE_BMI2, detect_bmi2 }, { 7, IMB_FEATURE_AVX_IFMA, detect_avx_ifma }, + { 7, IMB_FEATURE_HYBRID, detect_hybrid }, }; struct cpuid_regs r; unsigned hi_leaf_number = 0; diff --git a/test/kat-app/main.c b/test/kat-app/main.c index cc6c112e..327719bb 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -257,6 +257,7 @@ print_hw_features(void) { IMB_FEATURE_VAES, "VAES" }, { IMB_FEATURE_VPCLMULQDQ, "VPCLMULQDQ" }, { IMB_FEATURE_GFNI, "GFNI" }, { IMB_FEATURE_AVX512_IFMA, "AVX512-IFMA" }, { IMB_FEATURE_AVX_IFMA, "AVX-IFMA" }, { IMB_FEATURE_BMI2, "BMI2" }, + { IMB_FEATURE_HYBRID, "HYBRID-CORE" }, { IMB_FEATURE_AARCH64, "AARCH64" }, { IMB_FEATURE_SVE256, "SVE256" }, }; IMB_MGR *p_mgr = NULL; -- GitLab From fe655eea106cd4012009cfd31bda7adc93a9b8f2 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 19 Oct 2023 13:16:49 +0100 Subject: [PATCH 146/204] lib: [ZUC-EIA3] add separate OOO for 8B and 16B tags --- lib/avx2_t1/mb_mgr_avx2_t1.c | 2 ++ lib/avx2_t2/mb_mgr_avx2_t2.c | 2 ++ lib/avx2_t3/mb_mgr_avx2_t3.c | 2 ++ lib/avx512_t1/mb_mgr_avx512_t1.c | 2 ++ lib/avx512_t2/mb_mgr_avx512_t2.c | 2 ++ lib/avx_t1/mb_mgr_avx_t1.c | 2 ++ lib/avx_t2/mb_mgr_avx_t2.c | 2 ++ lib/include/mb_mgr_job_api.h | 21 ++++++++++++++++++++- lib/ipsec-mb.h | 2 ++ lib/no-aesni/mb_mgr_sse_no_aesni.c | 2 ++ lib/sse_t1/mb_mgr_sse_t1.c | 2 ++ lib/sse_t2/mb_mgr_sse_t2.c | 2 ++ lib/sse_t3/mb_mgr_sse_t3.c | 2 ++ lib/x86_64/alloc.c | 4 +++- 14 files changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/avx2_t1/mb_mgr_avx2_t1.c b/lib/avx2_t1/mb_mgr_avx2_t1.c index c40f37e0..b6294df3 100644 --- a/lib/avx2_t1/mb_mgr_avx2_t1.c +++ b/lib/avx2_t1/mb_mgr_avx2_t1.c @@ -271,6 +271,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 8); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 8); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 8); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 8); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 8); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX2_NUM_SHA1_LANES); diff --git a/lib/avx2_t2/mb_mgr_avx2_t2.c b/lib/avx2_t2/mb_mgr_avx2_t2.c index 56dbe1a5..fa4d7821 100644 --- a/lib/avx2_t2/mb_mgr_avx2_t2.c +++ b/lib/avx2_t2/mb_mgr_avx2_t2.c @@ -274,6 +274,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 8); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 8); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 8); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 8); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 8); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX2_NUM_SHA1_LANES); diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index 509945a1..54f2f623 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -275,6 +275,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 8); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 8); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 8); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 8); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 8); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX2_NUM_SHA1_LANES); diff --git a/lib/avx512_t1/mb_mgr_avx512_t1.c b/lib/avx512_t1/mb_mgr_avx512_t1.c index e3ab847e..d20f9059 100644 --- a/lib/avx512_t1/mb_mgr_avx512_t1.c +++ b/lib/avx512_t1/mb_mgr_avx512_t1.c @@ -369,6 +369,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 16); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 16); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 16); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 16); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 16); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX512_NUM_SHA1_LANES); diff --git a/lib/avx512_t2/mb_mgr_avx512_t2.c b/lib/avx512_t2/mb_mgr_avx512_t2.c index 55d237ac..e8cc7ea4 100644 --- a/lib/avx512_t2/mb_mgr_avx512_t2.c +++ b/lib/avx512_t2/mb_mgr_avx512_t2.c @@ -376,6 +376,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 16); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 16); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 16); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 16); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 16); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX512_NUM_SHA1_LANES); diff --git a/lib/avx_t1/mb_mgr_avx_t1.c b/lib/avx_t1/mb_mgr_avx_t1.c index 2c2274bb..e18b5d66 100644 --- a/lib/avx_t1/mb_mgr_avx_t1.c +++ b/lib/avx_t1/mb_mgr_avx_t1.c @@ -270,6 +270,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 4); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX_NUM_SHA1_LANES); diff --git a/lib/avx_t2/mb_mgr_avx_t2.c b/lib/avx_t2/mb_mgr_avx_t2.c index 397c72e7..2d49fda0 100644 --- a/lib/avx_t2/mb_mgr_avx_t2.c +++ b/lib/avx_t2/mb_mgr_avx_t2.c @@ -275,6 +275,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 4); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, 2); diff --git a/lib/include/mb_mgr_job_api.h b/lib/include/mb_mgr_job_api.h index 1a2e87c3..db04b44b 100644 --- a/lib/include/mb_mgr_job_api.h +++ b/lib/include/mb_mgr_job_api.h @@ -2665,6 +2665,8 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) MB_MGR_ZUC_OOO *zuc_eia3_ooo = state->zuc_eia3_ooo; MB_MGR_ZUC_OOO *zuc256_eia3_ooo = state->zuc256_eia3_ooo; #ifndef __aarch64__ + MB_MGR_ZUC_OOO *zuc256_eia3_8B_ooo = state->zuc256_eia3_8B_ooo; + MB_MGR_ZUC_OOO *zuc256_eia3_16B_ooo = state->zuc256_eia3_16B_ooo; MB_MGR_SHA_1_OOO *sha_1_ooo = state->sha_1_ooo; MB_MGR_SHA_256_OOO *sha_224_ooo = state->sha_224_ooo; MB_MGR_SHA_256_OOO *sha_256_ooo = state->sha_256_ooo; @@ -2727,8 +2729,17 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) case IMB_AUTH_ZUC_EIA3_BITLEN: return SUBMIT_JOB_ZUC_EIA3(zuc_eia3_ooo, job); case IMB_AUTH_ZUC256_EIA3_BITLEN: +#ifndef __aarch64__ + if (job->auth_tag_output_len_in_bytes == 4) + return SUBMIT_JOB_ZUC256_EIA3(zuc256_eia3_ooo, job, 4); + if (job->auth_tag_output_len_in_bytes == 8) + return SUBMIT_JOB_ZUC256_EIA3(zuc256_eia3_8B_ooo, job, 8); + else /* tag size == 16 */ + return SUBMIT_JOB_ZUC256_EIA3(zuc256_eia3_16B_ooo, job, 16); +#else return SUBMIT_JOB_ZUC256_EIA3(zuc256_eia3_ooo, job, job->auth_tag_output_len_in_bytes); +#endif case IMB_AUTH_SNOW3G_UIA2_BITLEN: #ifndef __aarch64__ #if (defined(SAFE_LOOKUP) || defined(AVX512)) && !defined(SSE_AESNI_EMU) @@ -2855,6 +2866,8 @@ FLUSH_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) MB_MGR_ZUC_OOO *zuc_eia3_ooo = state->zuc_eia3_ooo; MB_MGR_ZUC_OOO *zuc256_eia3_ooo = state->zuc256_eia3_ooo; #ifndef __aarch64__ + MB_MGR_ZUC_OOO *zuc256_eia3_8B_ooo = state->zuc256_eia3_8B_ooo; + MB_MGR_ZUC_OOO *zuc256_eia3_16B_ooo = state->zuc256_eia3_16B_ooo; MB_MGR_SHA_1_OOO *sha_1_ooo = state->sha_1_ooo; MB_MGR_SHA_256_OOO *sha_224_ooo = state->sha_224_ooo; MB_MGR_SHA_256_OOO *sha_256_ooo = state->sha_256_ooo; @@ -2910,13 +2923,19 @@ FLUSH_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) case IMB_AUTH_ZUC_EIA3_BITLEN: return FLUSH_JOB_ZUC_EIA3(zuc_eia3_ooo); case IMB_AUTH_ZUC256_EIA3_BITLEN: - return FLUSH_JOB_ZUC256_EIA3(zuc256_eia3_ooo, job->auth_tag_output_len_in_bytes); #ifndef __aarch64__ + if (job->auth_tag_output_len_in_bytes == 4) + return FLUSH_JOB_ZUC256_EIA3(zuc256_eia3_ooo, 4); + if (job->auth_tag_output_len_in_bytes == 8) + return FLUSH_JOB_ZUC256_EIA3(zuc256_eia3_8B_ooo, 8); + else /* tag size == 16 */ + return FLUSH_JOB_ZUC256_EIA3(zuc256_eia3_16B_ooo, 16); #if (defined(SAFE_LOOKUP) || defined(AVX512)) && !defined(SSE_AESNI_EMU) case IMB_AUTH_SNOW3G_UIA2_BITLEN: return FLUSH_JOB_SNOW3G_UIA2(snow3g_uia2_ooo); #endif #else /* __aarch64__ */ + return FLUSH_JOB_ZUC256_EIA3(zuc256_eia3_ooo, job->auth_tag_output_len_in_bytes); case IMB_AUTH_SNOW3G_UIA2_BITLEN: return FLUSH_JOB_SNOW3G_UIA2(snow3g_uia2_ooo); #endif /* __aarch64__ */ diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 55fc6160..383a2ff5 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -1190,6 +1190,8 @@ typedef struct IMB_MGR { void *sha_256_ooo; void *sha_384_ooo; void *sha_512_ooo; + void *zuc256_eia3_8B_ooo; + void *zuc256_eia3_16B_ooo; void *end_ooo; /* add new out-of-order managers above this line */ } IMB_MGR; diff --git a/lib/no-aesni/mb_mgr_sse_no_aesni.c b/lib/no-aesni/mb_mgr_sse_no_aesni.c index aba57b42..f02c1673 100644 --- a/lib/no-aesni/mb_mgr_sse_no_aesni.c +++ b/lib/no-aesni/mb_mgr_sse_no_aesni.c @@ -244,6 +244,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 4); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, SSE_NUM_SHA1_LANES); diff --git a/lib/sse_t1/mb_mgr_sse_t1.c b/lib/sse_t1/mb_mgr_sse_t1.c index 0ff964d6..3adfd951 100644 --- a/lib/sse_t1/mb_mgr_sse_t1.c +++ b/lib/sse_t1/mb_mgr_sse_t1.c @@ -276,6 +276,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 4); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, SSE_NUM_SHA1_LANES); diff --git a/lib/sse_t2/mb_mgr_sse_t2.c b/lib/sse_t2/mb_mgr_sse_t2.c index 074d55f0..54097df3 100644 --- a/lib/sse_t2/mb_mgr_sse_t2.c +++ b/lib/sse_t2/mb_mgr_sse_t2.c @@ -278,6 +278,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 4); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, 2); diff --git a/lib/sse_t3/mb_mgr_sse_t3.c b/lib/sse_t3/mb_mgr_sse_t3.c index ac8f36f0..f3339185 100644 --- a/lib/sse_t3/mb_mgr_sse_t3.c +++ b/lib/sse_t3/mb_mgr_sse_t3.c @@ -279,6 +279,8 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc_eia3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eea3_ooo, 4); ooo_mgr_zuc_reset(state->zuc256_eia3_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_8B_ooo, 4); + ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 4); /* Init HMAC/SHA1 out-of-order fields */ ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, 2); diff --git a/lib/x86_64/alloc.c b/lib/x86_64/alloc.c index b792fc3d..9f7644b7 100644 --- a/lib/x86_64/alloc.c +++ b/lib/x86_64/alloc.c @@ -90,7 +90,9 @@ const struct { OOO_INFO(sha_224_ooo, MB_MGR_SHA_256_OOO), OOO_INFO(sha_256_ooo, MB_MGR_SHA_256_OOO), OOO_INFO(sha_384_ooo, MB_MGR_SHA_512_OOO), - OOO_INFO(sha_512_ooo, MB_MGR_SHA_512_OOO) }; + OOO_INFO(sha_512_ooo, MB_MGR_SHA_512_OOO), + OOO_INFO(zuc256_eia3_8B_ooo, MB_MGR_ZUC_OOO), + OOO_INFO(zuc256_eia3_16B_ooo, MB_MGR_ZUC_OOO) }; /** * @brief Calculates necessary memory size for IMB_MGR. -- GitLab From 8835d6b2cdc048611bfbf6daec705eed28e331f9 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 16 Oct 2023 17:10:29 +0100 Subject: [PATCH 147/204] test: [ACVP] support libacvp v2.0.x --- README.md | 2 ++ ReleaseNotes.txt | 1 + test/acvp-app/README.md | 2 ++ test/acvp-app/acvp_app_main.c | 7 ++++++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ba26505..8e2b2176 100644 --- a/README.md +++ b/README.md @@ -753,6 +753,8 @@ ACVP test application located in `test` directory is to support CAVP process. It - HMAC-SHA384 (HMAC-SHA2-384) - HMAC-SHA512 (HMAC-SHA2-512) +Note: the acvp-app requires libacvp 2.0+ to be built. + ### CAVP Algorithm Parameters **Note:** all sizes in bits diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index a698595e..370413d5 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -17,6 +17,7 @@ Test Applications - SM4-ECB and SM4-CBC tests added. - SM3 tests added. - Self-Test callback support added to the KAT-APP. +- Updated ACVP app (imb-acvp) to support libacvp v2.0+. Performance Applications - New parameter added to benchmark QUIC `--quic-api`. diff --git a/test/acvp-app/README.md b/test/acvp-app/README.md index 7432c5a4..2f11db7b 100644 --- a/test/acvp-app/README.md +++ b/test/acvp-app/README.md @@ -21,6 +21,8 @@ See intel-ipsec-mb [README](https://github.com/intel/intel-ipsec-mb/blob/main/RE Before running the application, ensure the library is installed by following the instructions in the [README](https://github.com/intel/intel-ipsec-mb/tree/main/test#library-installation). Installation of [libacvp](https://github.com/cisco/libacvp) is also required. Please follow its build and install instructions. +Minimum version of libacvp is v2.0. + ### Linux To perform AES-GCM validation: `./imb-acvp --req AES-GCM-req.json --resp AES-GCM-resp.json` diff --git a/test/acvp-app/acvp_app_main.c b/test/acvp-app/acvp_app_main.c index 978c778c..86db19e2 100644 --- a/test/acvp-app/acvp_app_main.c +++ b/test/acvp-app/acvp_app_main.c @@ -37,8 +37,13 @@ #define MAX_TAG_LENGTH 16 static ACVP_RESULT -logger(char *msg) +logger(char *msg, ACVP_LOG_LVL level) { + if (level == ACVP_LOG_LVL_ERR) + printf("[ERROR] "); + else if (level == ACVP_LOG_LVL_WARN) + printf("[WARNING] "); + printf("%s", msg); return ACVP_SUCCESS; } -- GitLab From 06b8ca71fcfe15073a722b0dccb8321fe899f923 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 18 Oct 2023 17:14:49 +0100 Subject: [PATCH 148/204] test: [kat-app] rename zuc iv params in note --- test/kat-app/zuc_eia3_128.json.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/kat-app/zuc_eia3_128.json.c b/test/kat-app/zuc_eia3_128.json.c index d2a0e1af..02477531 100644 --- a/test/kat-app/zuc_eia3_128.json.c +++ b/test/kat-app/zuc_eia3_128.json.c @@ -31,8 +31,8 @@ /** * Note: ZUC IV params stored in vector IV field * uin32_t count = iv[0-3] - * uint8_t Bearer = iv[4] - * uint8_t Direction = iv[5] + * uint8_t bearer = iv[4] + * uint8_t direction = iv[5] */ const struct mac_test zuc_eia3_128_test_json[] = { { 128, 32, 1, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", -- GitLab From 8e95f20ad00d3f2b3c8e7190c7fb042f442e5d9d Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 18 Oct 2023 17:15:54 +0100 Subject: [PATCH 149/204] test: [kat-app] add ZUC-EIA3 256 reformatted vectors --- test/kat-app/zuc_eia3_256.json.c | 615 +++++++++++++++++++++++++++++++ 1 file changed, 615 insertions(+) create mode 100644 test/kat-app/zuc_eia3_256.json.c diff --git a/test/kat-app/zuc_eia3_256.json.c b/test/kat-app/zuc_eia3_256.json.c new file mode 100644 index 00000000..2cb609fb --- /dev/null +++ b/test/kat-app/zuc_eia3_256.json.c @@ -0,0 +1,615 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/* ZUC-EIA3 256 */ +#include "mac_test.h" + +const struct mac_test zuc_eia3_256_test_json[] = { + { 256, 32, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x9b\x97\x2a\x74", 1, 400, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 2, + "\x8f\x8e\xf9\xd8\xfb\x0a\xce\x2b\x23\x19\x48\x42\xcb\x5c\x6d\x98\x1e\x71\x68\x74\xe1\xdf" + "\xeb\xe0\xf2\x46\x02\x71\xbb\x69\x0d\x9e", + "\x05\xa8\xc3\x4b\x70\x9c\x97\x71\x67\x70\xa5\xa3\x08\x60\xca\x25\x0a\x8b\xb5\xc1\xc9\xd5" + "\x8c\x7d\xfb\x00\x3b\xc0\x9d\xe1\x09\x9f\xcc\x22\x8c\xf6\x12\x6f\xb9\x1e\xc9\x45\x43\x43" + "\x25\x7a\x2b\xba\x64\x4b\x8c\x91\x77\xc8\xfd\xce\x01\xcf\xab\x6b\xe6\xc2\x48\x80\x82\x77" + "\xad\xb8\xb9\x8d\x1f\xd7\x48\x0b\x73\x4d\x98\x96\x12\xd5\xf1\x86\xfd\xa1\x12\x50\x9a\x38" + "\x07\x37\xd5\xa3\xd0\x21\xfe\x55\x7a\x8f\xff\xe0\x4f\x25\x9c\x73\x01\x06\x66\xff\x10\xa4" + "\xdd\xd4\x2a\xbf\x0f\x5a\xa2\x29\x64\xd9\x99\xc8\x46\xe6\x46\x48\x4d\x56\xe9\x02\x17\xa8" + "\x14\x28\x13\x22\xf0\xd4\x43\xbe\xa0\x64\xd5\x28\x99\x27\x24\x5d\x7c\x25\x46\xd6\xdf\x2c" + "\x05\x70\x5a\x55\xcd\xf6\xe7\xdb\x3d\x94\x67\xfa\x67\x15\xe3\x84\x96\x26\xee\xf4\x22\xaf" + "\x2f\xa4\x6e\xda\x2f\x4a\xa0\xcd\x10\x72\x85\xb6\x45\x3b\x22\xb8\x1f\xe0\x3c\xf9\x64\x29" + "\xb4\x46", + "\x8d\x74\x8b\x71", 1, 1600, + "\x2c\xe8\x87\x0f\x8c\x7f\x47\x2a\x02\x2d\x24\xcd\x23\x3f\x4d\x0a\x40\x0d\x12\xdd\xc4\x16" + "\x26", + 184 }, + { 256, 32, 3, + "\x92\xf9\x27\xe8\xab\x48\x46\xdb\x2f\xa3\x61\x36\x7e\x89\xe1\x17\xc9\x99\x57\x63\xe0\xe4" + "\x4c\xce\x20\x03\x8a\x9c\x9a\x44\xca\x64", + "\xf6\x6e\x21\x54\xb9\x60\xb5\x90\xdc\x35\xaf\xb9\x9d\x03\xf9\xbe\x58\xf8\x7c\x5c\x03\xdb" + "\x72\x2e\xa6\x34\xff\x43\x8d\xcf\xd4\xa7\x2a\x52\xae\x3a\xb8\xc7\x11\xd8\x19\xd3\x94\x66" + "\x84\x10\xf0\x81\x45\xc5\x0b\x05\xe6\x89\xc6\xc9\xb4\x25\x7b\xb7\x89\x42\xd4\x6c\x1a\xfd" + "\x00\x42\x80\x9d\x10\x5e\x68\xd6\x02\x13\x07\x55\x08\x24\xe5\x9e\x6b\xf3\xea\x04\xd7\xd7" + "\x8f\x0a\x48\x02\x8c\x98\xd5\x68\xee\x11\x93\x22", + "\xf2\xef\xfb\xf7", 1, 800, + "\x7d\x51\xfb\x42\xf8\x7e\x62\xfa\x60\x25\xb9\x2b\x4e\xd6\x1c\x2e\xcc\x6c\x65\x18\x1e\x9d" + "\x04", + 184 }, + { 256, 32, 4, + "\xa7\x72\xf5\xfe\x9d\x81\xd1\xcf\x22\x8e\x45\x53\x67\x75\xac\xc9\x04\x19\x57\x55\x0f\x6c" + "\x39\xf9\xc5\x1b\x1e\x9e\xbb\x22\xa2\xf5", + "\xad\x2a\x9a\x9a\x7e\xb8\xb9\x72\xc5\x50\xe8\x28\x5e\x17\xda\xa2\x4c\x9a\xeb\x61\x72\xc6" + "\xa7\x06\x54\x32\xa6\x5b\xc5\x8b\xd7\xa2\xe0\x5e\x18\xf5\x41\x8e\xa8\x6e\x50\xd9\xde\x67" + "\x28\x04\xee\x22\xa5\x72", + "\x18\x3d\xf5\xf7", 1, 400, + "\xce\x51\x11\x83\x9b\x64\x4d\x20\x51\x92\x71\x3b\x43\x47\xf9\x38\x79\x0f\xd2\x59\xbc\x35" + "\xd3", + 184 }, + { 256, 32, 5, + "\xf8\xa0\x45\x4f\x6d\xea\x74\x6e\x4c\xd1\x6e\xb0\xc3\xa2\x1f\x57\xeb\x6f\x35\x2d\x6a\x02" + "\x5b\x35\x32\xba\x47\x3f\x1f\x0e\xdd\xc9", + "\xf7\xc3\xc4\x82\xe7\x20\x76\xa2\x78\x5d\xe1\xcb\xa5\x3f\x7d\x7c\xa3\x84\x0b\x69\xff\x3b" + "\x19\xb5\x6b\x9f\x25\x04\x35\xad\x89\x3b\xad\xba\xa5\xe1\xe8\x4e\xa4\xf5\x49\x84\x9a\x2c" + "\x71\xb1\xd6\xc1\x1b\xdc", + "\xb8\xbf\x02\x13", 1, 400, + "\x07\x90\xeb\x7d\x09\x6d\xc1\xf1\x86\x47\xea\x57\xe4\xb8\x92\xb1\x4e\x3b\x2d\x62\xaa\x53" + "\x6f", + 184 }, + { 256, 32, 6, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x87\x54\xf5\xcf", 1, 4000, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 7, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x1f\x30\x79\xb4", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 32, 8, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x5c\x7c\x8b\x88", 1, 4000, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 32, 9, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x1f\x30\x79\xb4", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff", + 184 }, + { 256, 32, 10, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe7\x38\x1d\x2a", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 11, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x56\x7b\x05\xfa", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 12, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11", + "\x72\xc4\x7d\x50", 1, 5120, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 13, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x67\x3e\x54\x99\x00\x34\xd3\x8c", 1, 400, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 14, + "\x8f\x8e\xf9\xd8\xfb\x0a\xce\x2b\x23\x19\x48\x42\xcb\x5c\x6d\x98\x1e\x71\x68\x74\xe1\xdf" + "\xeb\xe0\xf2\x46\x02\x71\xbb\x69\x0d\x9e", + "\x05\xa8\xc3\x4b\x70\x9c\x97\x71\x67\x70\xa5\xa3\x08\x60\xca\x25\x0a\x8b\xb5\xc1\xc9\xd5" + "\x8c\x7d\xfb\x00\x3b\xc0\x9d\xe1\x09\x9f\xcc\x22\x8c\xf6\x12\x6f\xb9\x1e\xc9\x45\x43\x43" + "\x25\x7a\x2b\xba\x64\x4b\x8c\x91\x77\xc8\xfd\xce\x01\xcf\xab\x6b\xe6\xc2\x48\x80\x82\x77" + "\xad\xb8\xb9\x8d\x1f\xd7\x48\x0b\x73\x4d\x98\x96\x12\xd5\xf1\x86\xfd\xa1\x12\x50\x9a\x38" + "\x07\x37\xd5\xa3\xd0\x21\xfe\x55\x7a\x8f\xff\xe0\x4f\x25\x9c\x73\x01\x06\x66\xff\x10\xa4" + "\xdd\xd4\x2a\xbf\x0f\x5a\xa2\x29\x64\xd9\x99\xc8\x46\xe6\x46\x48\x4d\x56\xe9\x02\x17\xa8" + "\x14\x28\x13\x22\xf0\xd4\x43\xbe\xa0\x64\xd5\x28\x99\x27\x24\x5d\x7c\x25\x46\xd6\xdf\x2c" + "\x05\x70\x5a\x55\xcd\xf6\xe7\xdb\x3d\x94\x67\xfa\x67\x15\xe3\x84\x96\x26\xee\xf4\x22\xaf" + "\x2f\xa4\x6e\xda\x2f\x4a\xa0\xcd\x10\x72\x85\xb6\x45\x3b\x22\xb8\x1f\xe0\x3c\xf9\x64\x29" + "\xb4\x46", + "\xe5\x1d\xf2\x0a\x9e\x74\x06\xac", 1, 1600, + "\x2c\xe8\x87\x0f\x8c\x7f\x47\x2a\x02\x2d\x24\xcd\x23\x3f\x4d\x0a\x40\x0d\x12\xdd\xc4\x16" + "\x26", + 184 }, + { 256, 64, 15, + "\x92\xf9\x27\xe8\xab\x48\x46\xdb\x2f\xa3\x61\x36\x7e\x89\xe1\x17\xc9\x99\x57\x63\xe0\xe4" + "\x4c\xce\x20\x03\x8a\x9c\x9a\x44\xca\x64", + "\xf6\x6e\x21\x54\xb9\x60\xb5\x90\xdc\x35\xaf\xb9\x9d\x03\xf9\xbe\x58\xf8\x7c\x5c\x03\xdb" + "\x72\x2e\xa6\x34\xff\x43\x8d\xcf\xd4\xa7\x2a\x52\xae\x3a\xb8\xc7\x11\xd8\x19\xd3\x94\x66" + "\x84\x10\xf0\x81\x45\xc5\x0b\x05\xe6\x89\xc6\xc9\xb4\x25\x7b\xb7\x89\x42\xd4\x6c\x1a\xfd" + "\x00\x42\x80\x9d\x10\x5e\x68\xd6\x02\x13\x07\x55\x08\x24\xe5\x9e\x6b\xf3\xea\x04\xd7\xd7" + "\x8f\x0a\x48\x02\x8c\x98\xd5\x68\xee\x11\x93\x22", + "\x5a\x99\xe9\x23\xfa\xf1\xec\xbb", 1, 800, + "\x7d\x51\xfb\x42\xf8\x7e\x62\xfa\x60\x25\xb9\x2b\x4e\xd6\x1c\x2e\xcc\x6c\x65\x18\x1e\x9d" + "\x04", + 184 }, + { 256, 64, 16, + "\xa7\x72\xf5\xfe\x9d\x81\xd1\xcf\x22\x8e\x45\x53\x67\x75\xac\xc9\x04\x19\x57\x55\x0f\x6c" + "\x39\xf9\xc5\x1b\x1e\x9e\xbb\x22\xa2\xf5", + "\xad\x2a\x9a\x9a\x7e\xb8\xb9\x72\xc5\x50\xe8\x28\x5e\x17\xda\xa2\x4c\x9a\xeb\x61\x72\xc6" + "\xa7\x06\x54\x32\xa6\x5b\xc5\x8b\xd7\xa2\xe0\x5e\x18\xf5\x41\x8e\xa8\x6e\x50\xd9\xde\x67" + "\x28\x04\xee\x22\xa5\x72", + "\x50\xa0\xc4\x24\xa9\x25\xf4\x5b", 1, 400, + "\xce\x51\x11\x83\x9b\x64\x4d\x20\x51\x92\x71\x3b\x43\x47\xf9\x38\x79\x0f\xd2\x59\xbc\x35" + "\xd3", + 184 }, + { 256, 64, 17, + "\xf8\xa0\x45\x4f\x6d\xea\x74\x6e\x4c\xd1\x6e\xb0\xc3\xa2\x1f\x57\xeb\x6f\x35\x2d\x6a\x02" + "\x5b\x35\x32\xba\x47\x3f\x1f\x0e\xdd\xc9", + "\xf7\xc3\xc4\x82\xe7\x20\x76\xa2\x78\x5d\xe1\xcb\xa5\x3f\x7d\x7c\xa3\x84\x0b\x69\xff\x3b" + "\x19\xb5\x6b\x9f\x25\x04\x35\xad\x89\x3b\xad\xba\xa5\xe1\xe8\x4e\xa4\xf5\x49\x84\x9a\x2c" + "\x71\xb1\xd6\xc1\x1b\xdc", + "\x2c\xfc\xa3\x59\x33\x50\xd8\xee", 1, 400, + "\x07\x90\xeb\x7d\x09\x6d\xc1\xf1\x86\x47\xea\x57\xe4\xb8\x92\xb1\x4e\x3b\x2d\x62\xaa\x53" + "\x6f", + 184 }, + { 256, 64, 18, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x13\x0d\xc2\x25\xe7\x22\x40\xcc", 1, 4000, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 19, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x8c\x71\x39\x4d\x39\x95\x77\x25", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 64, 20, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\xea\x1d\xee\x54\x4b\xb6\x22\x3b", 1, 4000, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 64, 21, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x8c\x71\x39\x4d\x39\x95\x77\x25", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff", + 184 }, + { 256, 64, 22, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\xa6\xe4\xa4\x94\xe7\x26\x0c", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 184, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\xdc\x6b\x62\x68\x7e\x90\xf1\x00", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 24, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11", + "\xa5\x3b\x6c\xd6\x50\xef\xb5\x73", 1, 5120, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 200, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\xd8\x5e\x54\xbb\xcb\x96\x00\x96\x70\x84\xc9\x52\xa1\x65\x4b\x26", 1, 400, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 26, + "\x8f\x8e\xf9\xd8\xfb\x0a\xce\x2b\x23\x19\x48\x42\xcb\x5c\x6d\x98\x1e\x71\x68\x74\xe1\xdf" + "\xeb\xe0\xf2\x46\x02\x71\xbb\x69\x0d\x9e", + "\x05\xa8\xc3\x4b\x70\x9c\x97\x71\x67\x70\xa5\xa3\x08\x60\xca\x25\x0a\x8b\xb5\xc1\xc9\xd5" + "\x8c\x7d\xfb\x00\x3b\xc0\x9d\xe1\x09\x9f\xcc\x22\x8c\xf6\x12\x6f\xb9\x1e\xc9\x45\x43\x43" + "\x25\x7a\x2b\xba\x64\x4b\x8c\x91\x77\xc8\xfd\xce\x01\xcf\xab\x6b\xe6\xc2\x48\x80\x82\x77" + "\xad\xb8\xb9\x8d\x1f\xd7\x48\x0b\x73\x4d\x98\x96\x12\xd5\xf1\x86\xfd\xa1\x12\x50\x9a\x38" + "\x07\x37\xd5\xa3\xd0\x21\xfe\x55\x7a\x8f\xff\xe0\x4f\x25\x9c\x73\x01\x06\x66\xff\x10\xa4" + "\xdd\xd4\x2a\xbf\x0f\x5a\xa2\x29\x64\xd9\x99\xc8\x46\xe6\x46\x48\x4d\x56\xe9\x02\x17\xa8" + "\x14\x28\x13\x22\xf0\xd4\x43\xbe\xa0\x64\xd5\x28\x99\x27\x24\x5d\x7c\x25\x46\xd6\xdf\x2c" + "\x05\x70\x5a\x55\xcd\xf6\xe7\xdb\x3d\x94\x67\xfa\x67\x15\xe3\x84\x96\x26\xee\xf4\x22\xaf" + "\x2f\xa4\x6e\xda\x2f\x4a\xa0\xcd\x10\x72\x85\xb6\x45\x3b\x22\xb8\x1f\xe0\x3c\xf9\x64\x29" + "\xb4\x46", + "\x4d\x40\x5d\x6e\xf7\xf8\xaf\xad\xd6\x71\x71\x03\xdf\x92\x28\x20", 1, 1600, + "\x2c\xe8\x87\x0f\x8c\x7f\x47\x2a\x02\x2d\x24\xcd\x23\x3f\x4d\x0a\x40\x0d\x12\xdd\xc4\x16" + "\x26", + 184 }, + { 256, 128, 27, + "\x92\xf9\x27\xe8\xab\x48\x46\xdb\x2f\xa3\x61\x36\x7e\x89\xe1\x17\xc9\x99\x57\x63\xe0\xe4" + "\x4c\xce\x20\x03\x8a\x9c\x9a\x44\xca\x64", + "\xf6\x6e\x21\x54\xb9\x60\xb5\x90\xdc\x35\xaf\xb9\x9d\x03\xf9\xbe\x58\xf8\x7c\x5c\x03\xdb" + "\x72\x2e\xa6\x34\xff\x43\x8d\xcf\xd4\xa7\x2a\x52\xae\x3a\xb8\xc7\x11\xd8\x19\xd3\x94\x66" + "\x84\x10\xf0\x81\x45\xc5\x0b\x05\xe6\x89\xc6\xc9\xb4\x25\x7b\xb7\x89\x42\xd4\x6c\x1a\xfd" + "\x00\x42\x80\x9d\x10\x5e\x68\xd6\x02\x13\x07\x55\x08\x24\xe5\x9e\x6b\xf3\xea\x04\xd7\xd7" + "\x8f\x0a\x48\x02\x8c\x98\xd5\x68\xee\x11\x93\x22", + "\x0b\xfb\x8f\xff\x65\xaf\x6a\x69\xea\xde\xbd\x94\x79\x7b\x08\xa5", 1, 800, + "\x7d\x51\xfb\x42\xf8\x7e\x62\xfa\x60\x25\xb9\x2b\x4e\xd6\x1c\x2e\xcc\x6c\x65\x18\x1e\x9d" + "\x04", + 184 }, + { 256, 128, 28, + "\xa7\x72\xf5\xfe\x9d\x81\xd1\xcf\x22\x8e\x45\x53\x67\x75\xac\xc9\x04\x19\x57\x55\x0f\x6c" + "\x39\xf9\xc5\x1b\x1e\x9e\xbb\x22\xa2\xf5", + "\xad\x2a\x9a\x9a\x7e\xb8\xb9\x72\xc5\x50\xe8\x28\x5e\x17\xda\xa2\x4c\x9a\xeb\x61\x72\xc6" + "\xa7\x06\x54\x32\xa6\x5b\xc5\x8b\xd7\xa2\xe0\x5e\x18\xf5\x41\x8e\xa8\x6e\x50\xd9\xde\x67" + "\x28\x04\xee\x22\xa5\x72", + "\x4b\xde\xd3\x15\xa4\x80\xa7\xe4\x02\xe4\xc4\x48\x90\xfe\x62\xf5", 1, 400, + "\xce\x51\x11\x83\x9b\x64\x4d\x20\x51\x92\x71\x3b\x43\x47\xf9\x38\x79\x0f\xd2\x59\xbc\x35" + "\xd3", + 184 }, + { 256, 128, 29, + "\xf8\xa0\x45\x4f\x6d\xea\x74\x6e\x4c\xd1\x6e\xb0\xc3\xa2\x1f\x57\xeb\x6f\x35\x2d\x6a\x02" + "\x5b\x35\x32\xba\x47\x3f\x1f\x0e\xdd\xc9", + "\xf7\xc3\xc4\x82\xe7\x20\x76\xa2\x78\x5d\xe1\xcb\xa5\x3f\x7d\x7c\xa3\x84\x0b\x69\xff\x3b" + "\x19\xb5\x6b\x9f\x25\x04\x35\xad\x89\x3b\xad\xba\xa5\xe1\xe8\x4e\xa4\xf5\x49\x84\x9a\x2c" + "\x71\xb1\xd6\xc1\x1b\xdc", + "\x9c\x6e\xd5\xf9\x63\x95\xa7\x28\xe1\x6b\xb2\x8a\x0e\x5b\x90\x72", 1, 400, + "\x07\x90\xeb\x7d\x09\x6d\xc1\xf1\x86\x47\xea\x57\xe4\xb8\x92\xb1\x4e\x3b\x2d\x62\xaa\x53" + "\x6f", + 184 }, + { 256, 128, 30, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\xdf\x1e\x83\x07\xb3\x1c\xc6\x2b\xec\xa1\xac\x6f\x81\x90\xc2\x2f", 1, 4000, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 31, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\xa3\x5b\xb2\x74\xb5\x67\xc4\x8b\x28\x31\x9f\x11\x1a\xf3\x4f\xbd", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 128, 32, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x3a\x83\xb5\x54\xbe\x40\x8c\xa5\x49\x41\x24\xed\x9d\x47\x32\x05", 1, 4000, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 128, 33, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\xa3\x5b\xb2\x74\xb5\x67\xc4\x8b\x28\x31\x9f\x11\x1a\xf3\x4f\xbd", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff", + 184 }, + { 256, 128, 34, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x41\x07\x03\x9b\x7d\x83\xb8\xb6\x57\xc2\x34\xb3\xd1\xa7\x20\x6a", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 35, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\xdb\xc6\x76\xad\xd9\xb2\x23\x2d\xa3\xc5\xf2\xfd\xf0\xfb\xe9\x8a", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 36, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11", + "\xe7\xbc\x9c\x1b\x02\x79\x27\x7b\x23\x48\x4b\xcf\x2e\x70\xe9\x5b", 1, 5120, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; -- GitLab From 07c22638016a1c7325edbdf8e1d0969b6c3210d9 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 18 Oct 2023 17:19:04 +0100 Subject: [PATCH 150/204] test: [kat-app] use reformatted ZUC-EIA3 256 vectors --- test/kat-app/Makefile | 4 +- test/kat-app/win_x64.mak | 2 +- test/kat-app/zuc_test.c | 229 +++++++++++++++++++++++++++++---------- 3 files changed, 175 insertions(+), 60 deletions(-) diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index d421b1cf..9f8cc11c 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -45,11 +45,11 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ - sm3_test.json.c zuc_eia3_128.json.c + sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c else # aarch64 SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ - zuc_eia3_128.json.c + zuc_eia3_128.json.c zuc_eia3_256.json.c endif # aarch64 OBJECTS := $(SOURCES:%.c=%.o) utils.o diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index df39617a..f556c82f 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep diff --git a/test/kat-app/zuc_test.c b/test/kat-app/zuc_test.c index 2d108ae1..1ace3a49 100644 --- a/test/kat-app/zuc_test.c +++ b/test/kat-app/zuc_test.c @@ -58,6 +58,7 @@ int zuc_test(struct IMB_MGR *mb_mgr); extern const struct mac_test zuc_eia3_128_test_json[]; +extern const struct mac_test zuc_eia3_256_test_json[]; struct zuc_eia3_128_params { const uint32_t *count; @@ -92,6 +93,9 @@ validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t * int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, const enum api_type type); +int +validate_zuc256_EIA3_direct_api(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs); #endif int validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, @@ -557,7 +561,7 @@ static inline int submit_burst_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const iv, uint8_t **const src, uint8_t **const tags, const uint32_t *lens, const unsigned int num_jobs, const unsigned int key_sz, - const unsigned int tag_sz, const unsigned int *iv_lens) + const size_t *tag_lens, const size_t *iv_lens) { IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; unsigned int i; @@ -589,7 +593,7 @@ submit_burst_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **c else job->hash_alg = IMB_AUTH_ZUC256_EIA3_BITLEN; job->auth_tag_output = tags[i]; - job->auth_tag_output_len_in_bytes = tag_sz; + job->auth_tag_output_len_in_bytes = tag_lens[i]; imb_set_session(mb_mgr, job); } @@ -628,8 +632,8 @@ check_eia3_burst_jobs: static inline int submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const iv, uint8_t **const src, uint8_t **const tags, const uint32_t *lens, - const unsigned int num_jobs, const unsigned int key_sz, const unsigned int tag_sz, - const unsigned int *iv_lens) + const unsigned int num_jobs, const unsigned int key_sz, const size_t *tag_lens, + const size_t *iv_lens) { IMB_JOB *job; unsigned int i; @@ -656,7 +660,7 @@ submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const i else job->hash_alg = IMB_AUTH_ZUC256_EIA3_BITLEN; job->auth_tag_output = tags[i]; - job->auth_tag_output_len_in_bytes = tag_sz; + job->auth_tag_output_len_in_bytes = tag_lens[i]; job = IMB_SUBMIT_JOB(mb_mgr); if (job != NULL) { @@ -1106,8 +1110,9 @@ validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDs const struct mac_test *v = zuc_eia3_128_test_json; for (i = 0; v[i].msg != NULL; i++) { - const unsigned int iv_len = IMB_ZUC_IV_LEN_IN_BYTES; struct zuc_eia3_128_params p = { 0 }; + const size_t iv_len = v[i].ivSize / 8; + const size_t tag_len = IMB_ZUC_DIGEST_LEN_IN_BYTES; memcpy(pKeys, v[i].key, IMB_ZUC_KEY_LEN_IN_BYTES); @@ -1120,14 +1125,13 @@ validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDs memcpy(pSrcData, v[i].msg, byteLength); if (type == TEST_SINGLE_JOB_API) submit_eia3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &bitLength, 1, - IMB_ZUC_KEY_LEN_IN_BYTES, IMB_ZUC_DIGEST_LEN_IN_BYTES, - &iv_len); + IMB_ZUC_KEY_LEN_IN_BYTES, &tag_len, &iv_len); else /* TEST_DIRECT_API */ IMB_ZUC_EIA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, bitLength, (uint32_t *) pDstData); const int retTmp = memcmp(pDstData, v[i].tag, v[i].tagSize / 8); if (retTmp) { - printf("Validate ZUC 1 block test %zu (Int): FAIL\n", v[i].tcId); + printf("Validate ZUC 1 block test %zu (Int): FAIL\n", v[i].tcId); byte_hexdump("Expected", (const uint8_t *) v[i].tag, IMB_ZUC_DIGEST_LEN_IN_BYTES); byte_hexdump("Found", pDstData, IMB_ZUC_DIGEST_LEN_IN_BYTES); @@ -1155,7 +1159,8 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p int retTmp, ret = 0; uint32_t byteLength; uint32_t bitLength[MAXBUFS]; - unsigned int iv_lens[MAXBUFS]; + size_t iv_lens[MAXBUFS]; + size_t tag_lens[MAXBUFS]; const struct mac_test *v = zuc_eia3_128_test_json; /* calculate number of test vectors */ @@ -1178,15 +1183,15 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p byteLength = (bitLength[j] + 7) / 8; memcpy(pSrcData[j], v[i].msg, byteLength); iv_lens[j] = IMB_ZUC_IV_LEN_IN_BYTES; + tag_lens[j] = v[i].tagSize / 8; } if (type == TEST_SINGLE_JOB_API) submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, - numBuffs, IMB_ZUC_KEY_LEN_IN_BYTES, - IMB_ZUC_DIGEST_LEN_IN_BYTES, iv_lens); + numBuffs, IMB_ZUC_KEY_LEN_IN_BYTES, tag_lens, iv_lens); else if (type == TEST_BURST_JOB_API) submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, - numBuffs, IMB_ZUC_KEY_LEN_IN_BYTES, - IMB_ZUC_DIGEST_LEN_IN_BYTES, iv_lens); + numBuffs, IMB_ZUC_KEY_LEN_IN_BYTES, tag_lens, + iv_lens); else /* TEST_BURST_JOB_API */ IMB_ZUC_EIA3_N_BUFFER(mb_mgr, (const void *const *) pKeys, (const void *const *) pIV, @@ -1230,15 +1235,15 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p byteLength = (bitLength[i] + 7) / 8; memcpy(pSrcData[i], v[vec_idx].msg, byteLength); iv_lens[i] = IMB_ZUC_IV_LEN_IN_BYTES; + tag_lens[i] = v[vec_idx].tagSize / 8; } if (type == TEST_SINGLE_JOB_API) submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, - IMB_ZUC_KEY_LEN_IN_BYTES, IMB_ZUC_DIGEST_LEN_IN_BYTES, iv_lens); + IMB_ZUC_KEY_LEN_IN_BYTES, tag_lens, iv_lens); else if (type == TEST_BURST_JOB_API) submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, - IMB_ZUC_KEY_LEN_IN_BYTES, IMB_ZUC_DIGEST_LEN_IN_BYTES, - iv_lens); + IMB_ZUC_KEY_LEN_IN_BYTES, tag_lens, iv_lens); else /* TEST_BURST_JOB_API */ IMB_ZUC_EIA3_N_BUFFER(mb_mgr, (const void *const *) pKeys, (const void *const *) pIV, (const void *const *) pSrcData, @@ -1271,8 +1276,9 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p return ret; }; +#ifdef __aarch64__ static int -verify_tag_256(void *mac, const struct test256EIA3_vectors_t *vector, const unsigned tag_sz, +verify_tag_256_direct(void *mac, const struct test256EIA3_vectors_t *vector, const unsigned tag_sz, const uint32_t test_idx, const uint32_t vector_idx, const int multi_vector) { const void *ref_mac = NULL; @@ -1321,6 +1327,49 @@ verify_tag_256(void *mac, const struct test256EIA3_vectors_t *vector, const unsi return ret; } +#endif + +static int +verify_tag_256(void *mac, const struct mac_test *vector, uint32_t n_jobs, uint32_t job_idx, + const int multi_vector) +{ + int ret = memcmp(mac, vector->tag, vector->tagSize / 8); + if (ret) { + if (multi_vector) { + printf("Validate ZUC-256 n block multi-vector test " + "# jobs = %u, job idx: %u, test: %zu (Int - %zu bytes): FAIL\n", + n_jobs, job_idx, vector->tcId, vector->tagSize / 8); + + } else { + printf("Validate ZUC-256 n block test " + "# jobs = %u, job idx: %u, test: %zu (Int - %zu bytes): FAIL\n", + n_jobs, job_idx, vector->tcId, vector->tagSize / 8); + } + byte_hexdump("Expected", (const uint8_t *) vector->tag, (int) vector->tagSize / 8); + byte_hexdump("Found", mac, (int) vector->tagSize / 8); + } +#ifdef DEBUG + else { + if (!quiet_mode) { + if (multi_vector) { + printf("Validate ZUC-256 n block multi-vector test " + "# jobs = %u, job idx: %u, test: %zu (Int - %zu bytes): " + "PASS\n", + n_jobs, job_idx, vector->tcId, vector->tagSize / 8); + + } else { + printf("Validate ZUC-256 n block test " + "# jobs = %u, job idx: %u, test: %zu (Int - %zu bytes): " + "PASS\n", + n_jobs, job_idx, vector->tcId, vector->tagSize / 8); + } + } + } +#endif + fflush(stdout); + + return ret; +} #ifdef __aarch64__ int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, @@ -1331,8 +1380,9 @@ int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, int ret = 0; uint32_t bitLength, byteLength; const struct test256EIA3_vectors_t *vector; - unsigned int iv_len; + size_t iv_len[1]; unsigned tag_sz; + size_t tag_szs[1]; const void *ref_mac = NULL; for (i = 0; i < NUM_ZUC_256_EIA3_TESTS; i++) { @@ -1342,16 +1392,17 @@ int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, bitLength = vector->length_in_bits; byteLength = (bitLength + 7) / 8; memcpy(pSrcData, vector->message, byteLength); - iv_len = vector->iv_length; + iv_len[0] = vector->iv_length; for (tag_sz = 4; tag_sz <= 16; tag_sz *= 2) { + tag_szs[0] = tag_sz; if (type == TEST_SINGLE_JOB_API) submit_eia3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &bitLength, 1, - IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, - &iv_len); + IMB_ZUC256_KEY_LEN_IN_BYTES, tag_szs, + iv_len); else if (type == TEST_DIRECT_API) - IMB_ZUC256_EIA3_1_BUFFER(mb_mgr, pKeys, pIV, iv_len, pSrcData, + IMB_ZUC256_EIA3_1_BUFFER(mb_mgr, pKeys, pIV, iv_len[0], pSrcData, bitLength, (uint32_t *)pDstData, tag_sz); if (tag_sz == 4) @@ -1387,9 +1438,9 @@ int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, }; #endif -int -validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) +#ifdef __aarch64__ +int validate_zuc256_EIA3_direct_api(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs) { uint32_t i, j; int retTmp, ret = 0; @@ -1410,24 +1461,12 @@ validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD iv_lens[j] = vector->iv_length; } for (tag_sz = 4; tag_sz <= 16; tag_sz *= 2) { - if (type == TEST_SINGLE_JOB_API) - submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, - numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, - iv_lens); -#ifdef __aarch64__ - else if (type == TEST_DIRECT_API) - IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, - (const void * const *)pIV, iv_lens, - (const void * const *)pSrcData, bitLength, - (uint32_t **)pDstData, tag_sz, numBuffs); -#endif - else /* TEST_BURST_JOB_API */ - submit_burst_eia3_jobs( - mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, - IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, iv_lens); - + IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, + (const void * const *)pIV, iv_lens, + (const void * const *)pSrcData, bitLength, + (uint32_t **)pDstData, tag_sz, numBuffs); for (j = 0; j < numBuffs; j++) { - retTmp = verify_tag_256(pDstData[j], vector, tag_sz, i, j, 0); + retTmp = verify_tag_256_direct(pDstData[j], vector, tag_sz, i, j, 0); if (retTmp) ret = retTmp; } @@ -1448,30 +1487,106 @@ validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD } for (tag_sz = 4; tag_sz <= 16; tag_sz *= 2) { - if (type == TEST_SINGLE_JOB_API) - submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, - numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, iv_lens); + IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, + (const void * const *)pIV, iv_lens, + (const void * const *)pSrcData, bitLength, + (uint32_t **)pDstData, tag_sz, numBuffs); + for (i = 0; i < numBuffs; i++) { + const uint32_t vector_idx = i % NUM_ZUC_256_EIA3_TESTS; + + vector = &test256EIA3_vectors[vector_idx]; + retTmp = verify_tag_256_direct(pDstData[i], vector, tag_sz, numBuffs, i, 1); + if (retTmp) + ret = retTmp; + } + } + return ret; +} +#endif + +int +validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) +{ + #ifdef __aarch64__ - else if (type == TEST_DIRECT_API) - IMB_ZUC256_EIA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, - (const void * const *)pIV, iv_lens, - (const void * const *)pSrcData, bitLength, - (uint32_t **)pDstData, tag_sz, numBuffs); + if (type == TEST_DIRECT_API) + return validate_zuc256_EIA3_direct_api(mb_mgr, pSrcData, pDstData, pKeys, pIV, + numBuffs); #endif + + uint32_t i, j, num_vectors = 0; + int retTmp, ret = 0; + uint32_t byteLength; + uint32_t bitLength[MAXBUFS]; + size_t iv_lens[MAXBUFS]; + size_t tag_lens[MAXBUFS]; + + const struct mac_test *vector = zuc_eia3_256_test_json; + + /* calculate number of test vectors */ + for (i = 0; vector[i].msg != NULL; i++) + num_vectors++; + + if (num_vectors == 0) { + printf("ZUC-EIA3 256 N block - No vectors found!\n"); + return 1; + } + + for (i = 0; i < num_vectors; i++) { + for (j = 0; j < numBuffs; j++) { + /* copy data for N buffers / jobs */ + memcpy(pKeys[j], vector[i].key, IMB_ZUC256_KEY_LEN_IN_BYTES); + memcpy(pIV[j], vector[i].iv, vector[i].ivSize / 8); + bitLength[j] = (uint32_t) vector[i].msgSize; + byteLength = (bitLength[j] + 7) / 8; + memcpy(pSrcData[j], vector[i].msg, byteLength); + iv_lens[j] = vector[i].ivSize / 8; + tag_lens[j] = vector[i].tagSize / 8; + } + if (type == TEST_SINGLE_JOB_API) + submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, + numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_lens, iv_lens); else /* TEST_BURST_JOB_API */ submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, - numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_sz, + numBuffs, IMB_ZUC256_KEY_LEN_IN_BYTES, tag_lens, iv_lens); - for (i = 0; i < numBuffs; i++) { - const uint32_t vector_idx = i % NUM_ZUC_256_EIA3_TESTS; - - vector = &test256EIA3_vectors[vector_idx]; - retTmp = verify_tag_256(pDstData[i], vector, tag_sz, numBuffs, i, 1); + for (j = 0; j < numBuffs; j++) { + retTmp = verify_tag_256(pDstData[j], &vector[i], numBuffs, j, 0); if (retTmp) ret = retTmp; } } + + /* Generate digests for n different test vectors, + * grouping all available tests vectors in groups of N buffers */ + for (i = 0; i < numBuffs; i++) { + const int vec_idx = i % num_vectors; + memcpy(pKeys[i], vector[vec_idx].key, IMB_ZUC256_KEY_LEN_IN_BYTES); + memcpy(pIV[i], vector[vec_idx].iv, vector[vec_idx].ivSize / 8); + + bitLength[i] = (uint32_t) vector[vec_idx].msgSize; + byteLength = (bitLength[i] + 7) / 8; + memcpy(pSrcData[i], vector[vec_idx].msg, byteLength); + iv_lens[i] = vector[vec_idx].ivSize / 8; + tag_lens[i] = vector[vec_idx].tagSize / 8; + } + + if (type == TEST_SINGLE_JOB_API) + submit_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, + IMB_ZUC256_KEY_LEN_IN_BYTES, tag_lens, iv_lens); + else /* TEST_BURST_JOB_API */ + submit_burst_eia3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, bitLength, numBuffs, + IMB_ZUC256_KEY_LEN_IN_BYTES, tag_lens, iv_lens); + + for (i = 0; i < numBuffs; i++) { + const int vec_idx = i % num_vectors; + + retTmp = verify_tag_256(pDstData[i], &vector[vec_idx], numBuffs, i, 1); + if (retTmp) + ret = retTmp; + } return ret; }; -- GitLab From 0811d51090a5195e4cefe007a7986abb692b0587 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 18 Oct 2023 17:19:59 +0100 Subject: [PATCH 151/204] test: [kat-app] remove old ZUC-EIA3 test vectors --- test/kat-app/zuc_test_vectors.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/kat-app/zuc_test_vectors.h b/test/kat-app/zuc_test_vectors.h index ba4da2c5..3a760989 100644 --- a/test/kat-app/zuc_test_vectors.h +++ b/test/kat-app/zuc_test_vectors.h @@ -33,12 +33,9 @@ #define NUM_ZUC_ALG_TESTS 3 #define NUM_ZUC_EEA3_TESTS 5 #define NUM_ZUC_256_EEA3_TESTS 10 -#ifndef __aarch64__ -#define NUM_ZUC_256_EIA3_TESTS 12 -#else +#ifdef __aarch64__ #define NUM_ZUC_256_EIA3_TESTS 15 #endif -#define NUM_ZUC_EIA3_TESTS 10 typedef struct testZUC_vectors_t { uint8_t CK[16]; @@ -65,6 +62,7 @@ typedef struct test256EEA3_vectors_t { uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; } test256EEA_vectors_t; +#ifdef __aarch64__ typedef struct test256EIA3_vectors_t { uint8_t CK[32]; uint8_t IV[25]; @@ -75,6 +73,7 @@ typedef struct test256EIA3_vectors_t { uint8_t mac8[8]; uint8_t mac16[16]; } test256EIA_vectors_t; +#endif /* * ZUC algorithm tests from 3GPP Document3: Implementator's Test Data. @@ -602,6 +601,7 @@ const struct test256EEA3_vectors_t test256EEA3_vectors[] = { 0x89, 0x3F, 0x34, 0xFF, 0x9F, 0xF1, 0x3D, 0x80, 0xE8, 0x54 } }, }; +#ifdef __aarch64__ const struct test256EIA3_vectors_t test256EIA3_vectors[] = { { /* Test 1 */ @@ -985,7 +985,6 @@ const struct test256EIA3_vectors_t test256EIA3_vectors[] = { { 0xe7, 0xbc, 0x9c, 0x1b, 0x02, 0x79, 0x27, 0x7b, 0x23, 0x48, 0x4b, 0xcf, 0x2e, 0x70, 0xe9, 0x5b }, }, -#ifdef __aarch64__ /* Add 3 cases, whose message length is not N*8 */ { /* Test 13 */ @@ -1101,6 +1100,6 @@ const struct test256EIA3_vectors_t test256EIA3_vectors[] = { 0x9F, 0xDA, 0x15, 0x0F, 0x35, 0x4E, 0xE8, 0x26}, }, -#endif /* __aarch64__ */ }; +#endif /* __aarch64__ */ #endif -- GitLab From 965fae0a205ce98bc4bcc4810c6cf0a3e56d66e7 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Thu, 19 Oct 2023 14:20:21 +0100 Subject: [PATCH 152/204] test: [kat-app] mix ZUC-EIA3 256 vectors This ensures multi-vector test covers various tag sizes submitted together --- test/kat-app/zuc_eia3_256.json.c | 588 +++++++++++++++++++++++++++++++ 1 file changed, 588 insertions(+) diff --git a/test/kat-app/zuc_eia3_256.json.c b/test/kat-app/zuc_eia3_256.json.c index 2cb609fb..9357702f 100644 --- a/test/kat-app/zuc_eia3_256.json.c +++ b/test/kat-app/zuc_eia3_256.json.c @@ -28,6 +28,593 @@ /* ZUC-EIA3 256 */ #include "mac_test.h" +#ifndef __aarch64__ +const struct mac_test zuc_eia3_256_test_json[] = { + { 256, 32, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x9b\x97\x2a\x74", 1, 400, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 2, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x67\x3e\x54\x99\x00\x34\xd3\x8c", 1, 400, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 3, + "\x8f\x8e\xf9\xd8\xfb\x0a\xce\x2b\x23\x19\x48\x42\xcb\x5c\x6d\x98\x1e\x71\x68\x74\xe1\xdf" + "\xeb\xe0\xf2\x46\x02\x71\xbb\x69\x0d\x9e", + "\x05\xa8\xc3\x4b\x70\x9c\x97\x71\x67\x70\xa5\xa3\x08\x60\xca\x25\x0a\x8b\xb5\xc1\xc9\xd5" + "\x8c\x7d\xfb\x00\x3b\xc0\x9d\xe1\x09\x9f\xcc\x22\x8c\xf6\x12\x6f\xb9\x1e\xc9\x45\x43\x43" + "\x25\x7a\x2b\xba\x64\x4b\x8c\x91\x77\xc8\xfd\xce\x01\xcf\xab\x6b\xe6\xc2\x48\x80\x82\x77" + "\xad\xb8\xb9\x8d\x1f\xd7\x48\x0b\x73\x4d\x98\x96\x12\xd5\xf1\x86\xfd\xa1\x12\x50\x9a\x38" + "\x07\x37\xd5\xa3\xd0\x21\xfe\x55\x7a\x8f\xff\xe0\x4f\x25\x9c\x73\x01\x06\x66\xff\x10\xa4" + "\xdd\xd4\x2a\xbf\x0f\x5a\xa2\x29\x64\xd9\x99\xc8\x46\xe6\x46\x48\x4d\x56\xe9\x02\x17\xa8" + "\x14\x28\x13\x22\xf0\xd4\x43\xbe\xa0\x64\xd5\x28\x99\x27\x24\x5d\x7c\x25\x46\xd6\xdf\x2c" + "\x05\x70\x5a\x55\xcd\xf6\xe7\xdb\x3d\x94\x67\xfa\x67\x15\xe3\x84\x96\x26\xee\xf4\x22\xaf" + "\x2f\xa4\x6e\xda\x2f\x4a\xa0\xcd\x10\x72\x85\xb6\x45\x3b\x22\xb8\x1f\xe0\x3c\xf9\x64\x29" + "\xb4\x46", + "\x8d\x74\x8b\x71", 1, 1600, + "\x2c\xe8\x87\x0f\x8c\x7f\x47\x2a\x02\x2d\x24\xcd\x23\x3f\x4d\x0a\x40\x0d\x12\xdd\xc4\x16" + "\x26", + 184 }, + { 256, 128, 4, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\xd8\x5e\x54\xbb\xcb\x96\x00\x96\x70\x84\xc9\x52\xa1\x65\x4b\x26", 1, 400, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 5, + "\x92\xf9\x27\xe8\xab\x48\x46\xdb\x2f\xa3\x61\x36\x7e\x89\xe1\x17\xc9\x99\x57\x63\xe0\xe4" + "\x4c\xce\x20\x03\x8a\x9c\x9a\x44\xca\x64", + "\xf6\x6e\x21\x54\xb9\x60\xb5\x90\xdc\x35\xaf\xb9\x9d\x03\xf9\xbe\x58\xf8\x7c\x5c\x03\xdb" + "\x72\x2e\xa6\x34\xff\x43\x8d\xcf\xd4\xa7\x2a\x52\xae\x3a\xb8\xc7\x11\xd8\x19\xd3\x94\x66" + "\x84\x10\xf0\x81\x45\xc5\x0b\x05\xe6\x89\xc6\xc9\xb4\x25\x7b\xb7\x89\x42\xd4\x6c\x1a\xfd" + "\x00\x42\x80\x9d\x10\x5e\x68\xd6\x02\x13\x07\x55\x08\x24\xe5\x9e\x6b\xf3\xea\x04\xd7\xd7" + "\x8f\x0a\x48\x02\x8c\x98\xd5\x68\xee\x11\x93\x22", + "\xf2\xef\xfb\xf7", 1, 800, + "\x7d\x51\xfb\x42\xf8\x7e\x62\xfa\x60\x25\xb9\x2b\x4e\xd6\x1c\x2e\xcc\x6c\x65\x18\x1e\x9d" + "\x04", + 184 }, + { 256, 32, 6, + "\xa7\x72\xf5\xfe\x9d\x81\xd1\xcf\x22\x8e\x45\x53\x67\x75\xac\xc9\x04\x19\x57\x55\x0f\x6c" + "\x39\xf9\xc5\x1b\x1e\x9e\xbb\x22\xa2\xf5", + "\xad\x2a\x9a\x9a\x7e\xb8\xb9\x72\xc5\x50\xe8\x28\x5e\x17\xda\xa2\x4c\x9a\xeb\x61\x72\xc6" + "\xa7\x06\x54\x32\xa6\x5b\xc5\x8b\xd7\xa2\xe0\x5e\x18\xf5\x41\x8e\xa8\x6e\x50\xd9\xde\x67" + "\x28\x04\xee\x22\xa5\x72", + "\x18\x3d\xf5\xf7", 1, 400, + "\xce\x51\x11\x83\x9b\x64\x4d\x20\x51\x92\x71\x3b\x43\x47\xf9\x38\x79\x0f\xd2\x59\xbc\x35" + "\xd3", + 184 }, + { 256, 32, 7, + "\xf8\xa0\x45\x4f\x6d\xea\x74\x6e\x4c\xd1\x6e\xb0\xc3\xa2\x1f\x57\xeb\x6f\x35\x2d\x6a\x02" + "\x5b\x35\x32\xba\x47\x3f\x1f\x0e\xdd\xc9", + "\xf7\xc3\xc4\x82\xe7\x20\x76\xa2\x78\x5d\xe1\xcb\xa5\x3f\x7d\x7c\xa3\x84\x0b\x69\xff\x3b" + "\x19\xb5\x6b\x9f\x25\x04\x35\xad\x89\x3b\xad\xba\xa5\xe1\xe8\x4e\xa4\xf5\x49\x84\x9a\x2c" + "\x71\xb1\xd6\xc1\x1b\xdc", + "\xb8\xbf\x02\x13", 1, 400, + "\x07\x90\xeb\x7d\x09\x6d\xc1\xf1\x86\x47\xea\x57\xe4\xb8\x92\xb1\x4e\x3b\x2d\x62\xaa\x53" + "\x6f", + 184 }, + { 256, 32, 8, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x87\x54\xf5\xcf", 1, 4000, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 9, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x1f\x30\x79\xb4", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 32, 10, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x5c\x7c\x8b\x88", 1, 4000, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 32, 11, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x1f\x30\x79\xb4", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff", + 184 }, + { 256, 64, 12, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x13\x0d\xc2\x25\xe7\x22\x40\xcc", 1, 4000, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 13, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe7\x38\x1d\x2a", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 14, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\x56\x7b\x05\xfa", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 32, 15, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11", + "\x72\xc4\x7d\x50", 1, 5120, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 16, + "\x8f\x8e\xf9\xd8\xfb\x0a\xce\x2b\x23\x19\x48\x42\xcb\x5c\x6d\x98\x1e\x71\x68\x74\xe1\xdf" + "\xeb\xe0\xf2\x46\x02\x71\xbb\x69\x0d\x9e", + "\x05\xa8\xc3\x4b\x70\x9c\x97\x71\x67\x70\xa5\xa3\x08\x60\xca\x25\x0a\x8b\xb5\xc1\xc9\xd5" + "\x8c\x7d\xfb\x00\x3b\xc0\x9d\xe1\x09\x9f\xcc\x22\x8c\xf6\x12\x6f\xb9\x1e\xc9\x45\x43\x43" + "\x25\x7a\x2b\xba\x64\x4b\x8c\x91\x77\xc8\xfd\xce\x01\xcf\xab\x6b\xe6\xc2\x48\x80\x82\x77" + "\xad\xb8\xb9\x8d\x1f\xd7\x48\x0b\x73\x4d\x98\x96\x12\xd5\xf1\x86\xfd\xa1\x12\x50\x9a\x38" + "\x07\x37\xd5\xa3\xd0\x21\xfe\x55\x7a\x8f\xff\xe0\x4f\x25\x9c\x73\x01\x06\x66\xff\x10\xa4" + "\xdd\xd4\x2a\xbf\x0f\x5a\xa2\x29\x64\xd9\x99\xc8\x46\xe6\x46\x48\x4d\x56\xe9\x02\x17\xa8" + "\x14\x28\x13\x22\xf0\xd4\x43\xbe\xa0\x64\xd5\x28\x99\x27\x24\x5d\x7c\x25\x46\xd6\xdf\x2c" + "\x05\x70\x5a\x55\xcd\xf6\xe7\xdb\x3d\x94\x67\xfa\x67\x15\xe3\x84\x96\x26\xee\xf4\x22\xaf" + "\x2f\xa4\x6e\xda\x2f\x4a\xa0\xcd\x10\x72\x85\xb6\x45\x3b\x22\xb8\x1f\xe0\x3c\xf9\x64\x29" + "\xb4\x46", + "\xe5\x1d\xf2\x0a\x9e\x74\x06\xac", 1, 1600, + "\x2c\xe8\x87\x0f\x8c\x7f\x47\x2a\x02\x2d\x24\xcd\x23\x3f\x4d\x0a\x40\x0d\x12\xdd\xc4\x16" + "\x26", + 184 }, + { 256, 128, 17, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\xa3\x5b\xb2\x74\xb5\x67\xc4\x8b\x28\x31\x9f\x11\x1a\xf3\x4f\xbd", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff", + 184 }, + { 256, 64, 18, + "\x92\xf9\x27\xe8\xab\x48\x46\xdb\x2f\xa3\x61\x36\x7e\x89\xe1\x17\xc9\x99\x57\x63\xe0\xe4" + "\x4c\xce\x20\x03\x8a\x9c\x9a\x44\xca\x64", + "\xf6\x6e\x21\x54\xb9\x60\xb5\x90\xdc\x35\xaf\xb9\x9d\x03\xf9\xbe\x58\xf8\x7c\x5c\x03\xdb" + "\x72\x2e\xa6\x34\xff\x43\x8d\xcf\xd4\xa7\x2a\x52\xae\x3a\xb8\xc7\x11\xd8\x19\xd3\x94\x66" + "\x84\x10\xf0\x81\x45\xc5\x0b\x05\xe6\x89\xc6\xc9\xb4\x25\x7b\xb7\x89\x42\xd4\x6c\x1a\xfd" + "\x00\x42\x80\x9d\x10\x5e\x68\xd6\x02\x13\x07\x55\x08\x24\xe5\x9e\x6b\xf3\xea\x04\xd7\xd7" + "\x8f\x0a\x48\x02\x8c\x98\xd5\x68\xee\x11\x93\x22", + "\x5a\x99\xe9\x23\xfa\xf1\xec\xbb", 1, 800, + "\x7d\x51\xfb\x42\xf8\x7e\x62\xfa\x60\x25\xb9\x2b\x4e\xd6\x1c\x2e\xcc\x6c\x65\x18\x1e\x9d" + "\x04", + 184 }, + { 256, 64, 19, + "\xa7\x72\xf5\xfe\x9d\x81\xd1\xcf\x22\x8e\x45\x53\x67\x75\xac\xc9\x04\x19\x57\x55\x0f\x6c" + "\x39\xf9\xc5\x1b\x1e\x9e\xbb\x22\xa2\xf5", + "\xad\x2a\x9a\x9a\x7e\xb8\xb9\x72\xc5\x50\xe8\x28\x5e\x17\xda\xa2\x4c\x9a\xeb\x61\x72\xc6" + "\xa7\x06\x54\x32\xa6\x5b\xc5\x8b\xd7\xa2\xe0\x5e\x18\xf5\x41\x8e\xa8\x6e\x50\xd9\xde\x67" + "\x28\x04\xee\x22\xa5\x72", + "\x50\xa0\xc4\x24\xa9\x25\xf4\x5b", 1, 400, + "\xce\x51\x11\x83\x9b\x64\x4d\x20\x51\x92\x71\x3b\x43\x47\xf9\x38\x79\x0f\xd2\x59\xbc\x35" + "\xd3", + 184 }, + { 256, 64, 20, + "\xf8\xa0\x45\x4f\x6d\xea\x74\x6e\x4c\xd1\x6e\xb0\xc3\xa2\x1f\x57\xeb\x6f\x35\x2d\x6a\x02" + "\x5b\x35\x32\xba\x47\x3f\x1f\x0e\xdd\xc9", + "\xf7\xc3\xc4\x82\xe7\x20\x76\xa2\x78\x5d\xe1\xcb\xa5\x3f\x7d\x7c\xa3\x84\x0b\x69\xff\x3b" + "\x19\xb5\x6b\x9f\x25\x04\x35\xad\x89\x3b\xad\xba\xa5\xe1\xe8\x4e\xa4\xf5\x49\x84\x9a\x2c" + "\x71\xb1\xd6\xc1\x1b\xdc", + "\x2c\xfc\xa3\x59\x33\x50\xd8\xee", 1, 400, + "\x07\x90\xeb\x7d\x09\x6d\xc1\xf1\x86\x47\xea\x57\xe4\xb8\x92\xb1\x4e\x3b\x2d\x62\xaa\x53" + "\x6f", + 184 }, + { 256, 64, 21, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x8c\x71\x39\x4d\x39\x95\x77\x25", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 64, 22, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\xea\x1d\xee\x54\x4b\xb6\x22\x3b", 1, 4000, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 64, 23, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\x8c\x71\x39\x4d\x39\x95\x77\x25", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff", + 184 }, + { 256, 64, 24, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x03\xa6\xe4\xa4\x94\xe7\x26\x0c", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 25, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\xdc\x6b\x62\x68\x7e\x90\xf1\x00", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 64, 26, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11", + "\xa5\x3b\x6c\xd6\x50\xef\xb5\x73", 1, 5120, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 27, + "\x8f\x8e\xf9\xd8\xfb\x0a\xce\x2b\x23\x19\x48\x42\xcb\x5c\x6d\x98\x1e\x71\x68\x74\xe1\xdf" + "\xeb\xe0\xf2\x46\x02\x71\xbb\x69\x0d\x9e", + "\x05\xa8\xc3\x4b\x70\x9c\x97\x71\x67\x70\xa5\xa3\x08\x60\xca\x25\x0a\x8b\xb5\xc1\xc9\xd5" + "\x8c\x7d\xfb\x00\x3b\xc0\x9d\xe1\x09\x9f\xcc\x22\x8c\xf6\x12\x6f\xb9\x1e\xc9\x45\x43\x43" + "\x25\x7a\x2b\xba\x64\x4b\x8c\x91\x77\xc8\xfd\xce\x01\xcf\xab\x6b\xe6\xc2\x48\x80\x82\x77" + "\xad\xb8\xb9\x8d\x1f\xd7\x48\x0b\x73\x4d\x98\x96\x12\xd5\xf1\x86\xfd\xa1\x12\x50\x9a\x38" + "\x07\x37\xd5\xa3\xd0\x21\xfe\x55\x7a\x8f\xff\xe0\x4f\x25\x9c\x73\x01\x06\x66\xff\x10\xa4" + "\xdd\xd4\x2a\xbf\x0f\x5a\xa2\x29\x64\xd9\x99\xc8\x46\xe6\x46\x48\x4d\x56\xe9\x02\x17\xa8" + "\x14\x28\x13\x22\xf0\xd4\x43\xbe\xa0\x64\xd5\x28\x99\x27\x24\x5d\x7c\x25\x46\xd6\xdf\x2c" + "\x05\x70\x5a\x55\xcd\xf6\xe7\xdb\x3d\x94\x67\xfa\x67\x15\xe3\x84\x96\x26\xee\xf4\x22\xaf" + "\x2f\xa4\x6e\xda\x2f\x4a\xa0\xcd\x10\x72\x85\xb6\x45\x3b\x22\xb8\x1f\xe0\x3c\xf9\x64\x29" + "\xb4\x46", + "\x4d\x40\x5d\x6e\xf7\xf8\xaf\xad\xd6\x71\x71\x03\xdf\x92\x28\x20", 1, 1600, + "\x2c\xe8\x87\x0f\x8c\x7f\x47\x2a\x02\x2d\x24\xcd\x23\x3f\x4d\x0a\x40\x0d\x12\xdd\xc4\x16" + "\x26", + 184 }, + { 256, 128, 28, + "\x92\xf9\x27\xe8\xab\x48\x46\xdb\x2f\xa3\x61\x36\x7e\x89\xe1\x17\xc9\x99\x57\x63\xe0\xe4" + "\x4c\xce\x20\x03\x8a\x9c\x9a\x44\xca\x64", + "\xf6\x6e\x21\x54\xb9\x60\xb5\x90\xdc\x35\xaf\xb9\x9d\x03\xf9\xbe\x58\xf8\x7c\x5c\x03\xdb" + "\x72\x2e\xa6\x34\xff\x43\x8d\xcf\xd4\xa7\x2a\x52\xae\x3a\xb8\xc7\x11\xd8\x19\xd3\x94\x66" + "\x84\x10\xf0\x81\x45\xc5\x0b\x05\xe6\x89\xc6\xc9\xb4\x25\x7b\xb7\x89\x42\xd4\x6c\x1a\xfd" + "\x00\x42\x80\x9d\x10\x5e\x68\xd6\x02\x13\x07\x55\x08\x24\xe5\x9e\x6b\xf3\xea\x04\xd7\xd7" + "\x8f\x0a\x48\x02\x8c\x98\xd5\x68\xee\x11\x93\x22", + "\x0b\xfb\x8f\xff\x65\xaf\x6a\x69\xea\xde\xbd\x94\x79\x7b\x08\xa5", 1, 800, + "\x7d\x51\xfb\x42\xf8\x7e\x62\xfa\x60\x25\xb9\x2b\x4e\xd6\x1c\x2e\xcc\x6c\x65\x18\x1e\x9d" + "\x04", + 184 }, + { 256, 128, 29, + "\xa7\x72\xf5\xfe\x9d\x81\xd1\xcf\x22\x8e\x45\x53\x67\x75\xac\xc9\x04\x19\x57\x55\x0f\x6c" + "\x39\xf9\xc5\x1b\x1e\x9e\xbb\x22\xa2\xf5", + "\xad\x2a\x9a\x9a\x7e\xb8\xb9\x72\xc5\x50\xe8\x28\x5e\x17\xda\xa2\x4c\x9a\xeb\x61\x72\xc6" + "\xa7\x06\x54\x32\xa6\x5b\xc5\x8b\xd7\xa2\xe0\x5e\x18\xf5\x41\x8e\xa8\x6e\x50\xd9\xde\x67" + "\x28\x04\xee\x22\xa5\x72", + "\x4b\xde\xd3\x15\xa4\x80\xa7\xe4\x02\xe4\xc4\x48\x90\xfe\x62\xf5", 1, 400, + "\xce\x51\x11\x83\x9b\x64\x4d\x20\x51\x92\x71\x3b\x43\x47\xf9\x38\x79\x0f\xd2\x59\xbc\x35" + "\xd3", + 184 }, + { 256, 128, 30, + "\xf8\xa0\x45\x4f\x6d\xea\x74\x6e\x4c\xd1\x6e\xb0\xc3\xa2\x1f\x57\xeb\x6f\x35\x2d\x6a\x02" + "\x5b\x35\x32\xba\x47\x3f\x1f\x0e\xdd\xc9", + "\xf7\xc3\xc4\x82\xe7\x20\x76\xa2\x78\x5d\xe1\xcb\xa5\x3f\x7d\x7c\xa3\x84\x0b\x69\xff\x3b" + "\x19\xb5\x6b\x9f\x25\x04\x35\xad\x89\x3b\xad\xba\xa5\xe1\xe8\x4e\xa4\xf5\x49\x84\x9a\x2c" + "\x71\xb1\xd6\xc1\x1b\xdc", + "\x9c\x6e\xd5\xf9\x63\x95\xa7\x28\xe1\x6b\xb2\x8a\x0e\x5b\x90\x72", 1, 400, + "\x07\x90\xeb\x7d\x09\x6d\xc1\xf1\x86\x47\xea\x57\xe4\xb8\x92\xb1\x4e\x3b\x2d\x62\xaa\x53" + "\x6f", + 184 }, + { 256, 128, 31, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\xdf\x1e\x83\x07\xb3\x1c\xc6\x2b\xec\xa1\xac\x6f\x81\x90\xc2\x2f", 1, 4000, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 32, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00", + "\xa3\x5b\xb2\x74\xb5\x67\xc4\x8b\x28\x31\x9f\x11\x1a\xf3\x4f\xbd", 1, 400, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 128, 33, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11", + "\x3a\x83\xb5\x54\xbe\x40\x8c\xa5\x49\x41\x24\xed\x9d\x47\x32\x05", 1, 4000, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + 200 }, + { 256, 128, 34, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x41\x07\x03\x9b\x7d\x83\xb8\xb6\x57\xc2\x34\xb3\xd1\xa7\x20\x6a", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 35, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" + "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", + "\xdb\xc6\x76\xad\xd9\xb2\x23\x2d\xa3\xc5\xf2\xfd\xf0\xfb\xe9\x8a", 1, 272, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 256, 128, 36, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + "\x11\x11", + "\xe7\xbc\x9c\x1b\x02\x79\x27\x7b\x23\x48\x4b\xcf\x2e\x70\xe9\x5b", 1, 5120, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + 200 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; +#else const struct mac_test zuc_eia3_256_test_json[] = { { 256, 32, 1, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" @@ -613,3 +1200,4 @@ const struct mac_test zuc_eia3_256_test_json[] = { 200 }, { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; +#endif -- GitLab From 37f5476c206bdbd205700f2e0d7a1f8a2497c262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Tue, 2 Jul 2024 13:08:52 +0100 Subject: [PATCH 153/204] Keep old ZUC-EIA3-256 test vectors for aarch64 aarch64 currently fails the multi-vector test with various tag sizes submitted together so the old test vector was preserved instead. Add a TODO message to replace this one when the functionality is implemented/ the test passes. --- test/kat-app/zuc_eia3_256.json.c | 3 +++ test/kat-app/zuc_test.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/kat-app/zuc_eia3_256.json.c b/test/kat-app/zuc_eia3_256.json.c index 9357702f..ac62e6c6 100644 --- a/test/kat-app/zuc_eia3_256.json.c +++ b/test/kat-app/zuc_eia3_256.json.c @@ -615,6 +615,9 @@ const struct mac_test zuc_eia3_256_test_json[] = { { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } }; #else +/* + For aarch64, multi-vector test fails with various tag sizes submitted together. + TODO: Replace test vector when multi-vector test covers various tag sizes submitted together */ const struct mac_test zuc_eia3_256_test_json[] = { { 256, 32, 1, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" diff --git a/test/kat-app/zuc_test.c b/test/kat-app/zuc_test.c index 1ace3a49..fd7fee36 100644 --- a/test/kat-app/zuc_test.c +++ b/test/kat-app/zuc_test.c @@ -1522,6 +1522,9 @@ validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD size_t iv_lens[MAXBUFS]; size_t tag_lens[MAXBUFS]; + /* + For aarch64, multi-vector test fails with various tag sizes submitted together. + TODO: Replace test vector when multi-vector test covers various tag sizes submitted together */ const struct mac_test *vector = zuc_eia3_256_test_json; /* calculate number of test vectors */ -- GitLab From 9171df82c1d150297d487a8fc041ec36fb7704bc Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 20 Oct 2023 16:45:45 +0100 Subject: [PATCH 154/204] perf: add missing new line character --- perf/ipsec_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index c7f12529..a622b20f 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -3364,7 +3364,7 @@ usage(void) "--gfni-on: use Galois Field extensions, default: auto-detect\n" "--gfni-off: don't use Galois Field extensions\n" #endif - "--job-api: use JOB API" + "--job-api: use JOB API\n" #ifndef __aarch64__ "--direct-api: use direct API when available\n" "--gcm-sgl-api: use direct SGL API for GCM perf tests" -- GitLab From fa37898ef5f1ac05b2236326fac21fed1afb3920 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 20 Oct 2023 17:01:18 +0100 Subject: [PATCH 155/204] lib: disable extra unneeded code when passing -DNO_SELF_TEST_DEV --- lib/x86_64/self_test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/x86_64/self_test.c b/lib/x86_64/self_test.c index aecacef7..7bd66782 100644 --- a/lib/x86_64/self_test.c +++ b/lib/x86_64/self_test.c @@ -62,6 +62,7 @@ imb_self_test_get_cb(IMB_MGR *p_mgr, imb_self_test_cb_t *cb_fn, void **cb_arg) return 0; } +#ifndef NO_SELF_TEST_DEV static int make_callback(IMB_MGR *p_mgr, const char *phase, const char *type, const char *descr) { @@ -79,8 +80,6 @@ make_callback(IMB_MGR *p_mgr, const char *phase, const char *type, const char *d * ============================================================================= */ -#ifndef NO_SELF_TEST_DEV - static int process_job(IMB_MGR *p_mgr) { @@ -1532,8 +1531,6 @@ self_test_aead(IMB_MGR *p_mgr) return ret; } -#endif /* NO_SELF_TEST_DEV */ - static int self_test_exec(IMB_MGR *p_mgr) { @@ -1551,6 +1548,8 @@ self_test_exec(IMB_MGR *p_mgr) return ret; } +#endif /* NO_SELF_TEST_DEV */ + /* * ============================================================================= * SELF-TEST INTERNAL API -- GitLab From db0f41efd501c94c36929539588a7bbee1725bd3 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Sun, 15 Oct 2023 15:13:06 +0100 Subject: [PATCH 156/204] test: [xvalid] fix PLI setting When testing PON, PLI is set in buffer header, based on the buffer size to be tested. However, on IMIX testing, multiple buffers with different sizes are processed and the same PLI with the last size was used in all buffers, leading to an incorrect output. --- test/xvalid-app/ipsec_xvalid.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 32172978..68fc9245 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -1665,7 +1665,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const uint8_t *auth_key = data->auth_key; unsigned int num_processed_jobs = 0; uint8_t next_iv[IMB_AES_BLOCK_SIZE]; - uint16_t pli = 0; + uint16_t pli[MAX_NUM_JOBS] = { 0 }; uint8_t tag_size = data->tag_size; if (num_jobs == 0) @@ -1741,7 +1741,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const if (params->hash_alg == IMB_AUTH_PON_CRC_BIP) { /* Buf size is XGEM payload, including CRC, * allocate space for XGEM header and padding */ - pli = buf_sizes[i]; + pli[i] = buf_sizes[i]; buf_sizes[i] += 8; if (buf_sizes[i] < 16) buf_sizes[i] = 16; @@ -1768,7 +1768,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const /* For PON, construct the XGEM header, setting valid PLI */ if (params->hash_alg == IMB_AUTH_PON_CRC_BIP) { /* create XGEM header template */ - const uint16_t shifted_pli = (pli << 2) & 0xffff; + const uint16_t shifted_pli = (pli[i] << 2) & 0xffff; uint64_t *p_src = (uint64_t *) test_buf[i]; xgem_hdr[i] = ((shifted_pli >> 8) & 0xff) | ((shifted_pli & 0xff) << 8); @@ -1892,7 +1892,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const num_processed_jobs++; if (params->hash_alg == IMB_AUTH_PON_CRC_BIP) { - if (modify_pon_test_buf(test_buf[idx], job, pli, xgem_hdr[idx]) < 0) + if (modify_pon_test_buf(test_buf[idx], job, pli[idx], xgem_hdr[idx]) < 0) goto exit; } @@ -2082,8 +2082,8 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const goto_exit = 1; } - if ((params->hash_alg == IMB_AUTH_PON_CRC_BIP) && (pli > 4)) { - const uint64_t plen = 8 + pli - 4; + if ((params->hash_alg == IMB_AUTH_PON_CRC_BIP) && (pli[i] > 4)) { + const uint64_t plen = 8 + pli[i] - 4; if (memcmp(src_dst_buf[i] + plen, out_digest[i] + 4, 4) != 0) { fprintf(stderr, "\nDecrypted CRC and " -- GitLab From 057b8f663f38c05e2c77f70be58bbc695bcfd7da Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 13 Oct 2023 10:24:37 +0100 Subject: [PATCH 157/204] test: [XVALID] add option to test burst API Add --burst-api parameter to test burst API instead of the single job API. This is mainly useful when testing alongside IMIX testing (--imix), as it tests multiple jobs in a single call. --- test/xvalid-app/ipsec_xvalid.c | 365 ++++++++++++++++++++------------- 1 file changed, 224 insertions(+), 141 deletions(-) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index 68fc9245..a8919a57 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -630,6 +630,8 @@ uint64_t flags = 0; /* flags passed to alloc_mb_mgr() */ /* 0 => not possible, 1 => possible */ int is_avx_sse_check_possible = 0; +int burst_api = 0; + #ifndef __aarch64__ static void avx_sse_check(const char *ctx_str, const IMB_HASH_ALG hash_alg, const IMB_CIPHER_MODE cipher_mode) @@ -1640,6 +1642,46 @@ perform_safe_checks(IMB_MGR *mgr, const IMB_ARCH arch, const char *dir) return 0; } +static int +post_job(IMB_MGR *mgr, IMB_JOB *job, unsigned *num_processed_jobs, const struct params_s *params, + uint8_t **test_buf, const unsigned *buf_sizes, const uint16_t *pli, + const uint64_t *xgem_hdr, const IMB_CIPHER_DIRECTION dir) +{ + + const unsigned idx = (unsigned) ((uintptr_t) job->user_data); + + if (job->status != IMB_STATUS_COMPLETED) { + int errc = imb_get_errno(mgr); + + fprintf(stderr, + "failed job, status:%d, " + "error code:%d '%s'\n", + job->status, errc, imb_get_strerror(errc)); + return -1; + } + if (idx != *num_processed_jobs) { + fprintf(stderr, + "enc-submit job returned out of order, " + "received %u, expected %u\n", + idx, *num_processed_jobs); + return -1; + } + (*num_processed_jobs)++; + + /* Only need to modify the buffer after encryption */ + if (dir == IMB_DIR_ENCRYPT) { + if (params->hash_alg == IMB_AUTH_PON_CRC_BIP) { + if (modify_pon_test_buf(test_buf[idx], job, pli[idx], xgem_hdr[idx]) < 0) + return -1; + } + + if (params->hash_alg == IMB_AUTH_DOCSIS_CRC32) + modify_docsis_crc32_test_buf(test_buf[idx], job, buf_sizes[idx]); + } + + return 0; +} + /* Performs test using AES_HMAC or DOCSIS */ static int do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const IMB_ARCH dec_arch, @@ -1647,7 +1689,7 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const const unsigned imix, const unsigned num_jobs) { IMB_JOB *job; - uint32_t i, imix_job_idx = 0; + uint32_t i; int ret = -1; uint64_t xgem_hdr[MAX_NUM_JOBS] = { 0 }; uint8_t tag_size_to_check[MAX_NUM_JOBS]; @@ -1696,8 +1738,6 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const if (imix) { uint32_t random_num = rand() % DEFAULT_JOB_SIZE_MAX; - imix_job_idx = i; - /* If random number is 0, change the size to 16 */ if (random_num == 0) random_num = 16; @@ -1845,96 +1885,112 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k3, sizeof(dec_keys->k3)); #endif - for (i = 0; i < num_jobs; i++) { - imix_job_idx = i; + if (burst_api) { + unsigned num_rx_jobs; - job = IMB_GET_NEXT_JOB(enc_mb_mgr); - /* - * Encrypt + generate digest from encrypted message - * using architecture under test - */ - nosimd_memcpy(src_dst_buf[i], test_buf[i], buf_sizes[i]); - if (fill_job(job, params, src_dst_buf[i], in_digest[i], aad, buf_sizes[i], tag_size, - IMB_DIR_ENCRYPT, enc_keys, cipher_iv, auth_iv, i, next_iv) < 0) + IMB_JOB *burst_jobs[IMB_MAX_BURST_SIZE]; + /* num_jobs will always be lower than IMB_MAX_BURST_SIZE */ + num_rx_jobs = IMB_GET_NEXT_BURST(enc_mb_mgr, num_jobs, burst_jobs); + + if (num_rx_jobs != num_jobs) { + fprintf(stderr, "Number of jobs received less than requested\n"); goto exit; + } + for (i = 0; i < num_jobs; i++) { + IMB_JOB *job = burst_jobs[i]; + /* + * Encrypt + generate digest from encrypted message + * using architecture under test + */ + nosimd_memcpy(src_dst_buf[i], test_buf[i], buf_sizes[i]); + if (fill_job(job, params, src_dst_buf[i], in_digest[i], aad, buf_sizes[i], + tag_size, IMB_DIR_ENCRYPT, enc_keys, cipher_iv, auth_iv, i, + next_iv) < 0) + goto exit; - /* Randomize memory for input digest */ - generate_random_buf(in_digest[i], tag_size); + /* Randomize memory for input digest */ + generate_random_buf(in_digest[i], tag_size); - /* Clear scratch registers before submitting job to prevent - * other functions from storing sensitive data in stack */ - job = IMB_SUBMIT_JOB(enc_mb_mgr); + imb_set_session(enc_mb_mgr, job); + } + num_rx_jobs = IMB_SUBMIT_BURST(enc_mb_mgr, num_jobs, burst_jobs); #ifndef __aarch64__ - avx_sse_check("enc-submit", (unsigned) params->hash_alg, - (unsigned) params->cipher_mode); + avx_sse_check("enc-submit-burst", (unsigned) params->hash_alg, + (unsigned) params->cipher_mode); #endif + if (num_rx_jobs < num_jobs) { + num_rx_jobs += IMB_FLUSH_BURST(enc_mb_mgr, (num_jobs - num_rx_jobs), + &burst_jobs[num_rx_jobs]); +#ifndef __aarch64__ + avx_sse_check("enc-flush-burst", (unsigned) params->hash_alg, + (unsigned) params->cipher_mode); +#endif + } - if (job) { - const unsigned idx = (unsigned) ((uintptr_t) job->user_data); + if (num_rx_jobs != num_jobs) { + fprintf(stderr, "Number of processed jobs less than submitted\n"); + goto exit; + } - if (job->status != IMB_STATUS_COMPLETED) { - int errc = imb_get_errno(enc_mb_mgr); + for (i = 0; i < num_rx_jobs; i++) { + IMB_JOB *job = burst_jobs[i]; - fprintf(stderr, - "failed job, status:%d, " - "error code:%d '%s'\n", - job->status, errc, imb_get_strerror(errc)); + if (post_job(enc_mb_mgr, job, &num_processed_jobs, params, test_buf, + buf_sizes, pli, xgem_hdr, IMB_DIR_ENCRYPT) < 0) goto exit; - } - if (idx != num_processed_jobs) { - fprintf(stderr, - "enc-submit job returned out of order, " - "received %u, expected %u\n", - idx, num_processed_jobs); + } + + } else { + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(enc_mb_mgr); + /* + * Encrypt + generate digest from encrypted message + * using architecture under test + */ + nosimd_memcpy(src_dst_buf[i], test_buf[i], buf_sizes[i]); + if (fill_job(job, params, src_dst_buf[i], in_digest[i], aad, buf_sizes[i], + tag_size, IMB_DIR_ENCRYPT, enc_keys, cipher_iv, auth_iv, i, + next_iv) < 0) goto exit; - } - num_processed_jobs++; - if (params->hash_alg == IMB_AUTH_PON_CRC_BIP) { - if (modify_pon_test_buf(test_buf[idx], job, pli[idx], xgem_hdr[idx]) < 0) + /* Randomize memory for input digest */ + generate_random_buf(in_digest[i], tag_size); + + /* Clear scratch registers before submitting job to prevent + * other functions from storing sensitive data in stack */ + job = IMB_SUBMIT_JOB(enc_mb_mgr); + +#ifndef __aarch64__ + avx_sse_check("enc-submit", (unsigned) params->hash_alg, + (unsigned) params->cipher_mode); +#endif + if (job) { + if (post_job(enc_mb_mgr, job, &num_processed_jobs, params, test_buf, + buf_sizes, pli, xgem_hdr, IMB_DIR_ENCRYPT) < 0) { + i = (unsigned) ((uintptr_t) job->user_data); goto exit; + } } - - if (params->hash_alg == IMB_AUTH_DOCSIS_CRC32) - modify_docsis_crc32_test_buf(test_buf[idx], job, buf_sizes[idx]); } - } - /* Flush rest of the jobs, if there are outstanding jobs */ - while (num_processed_jobs != num_jobs) { - job = IMB_FLUSH_JOB(enc_mb_mgr); + /* Flush rest of the jobs, if there are outstanding jobs */ + while (num_processed_jobs != num_jobs) { + job = IMB_FLUSH_JOB(enc_mb_mgr); #ifndef __aarch64__ - avx_sse_check("enc-flush", (unsigned) params->hash_alg, - (unsigned) params->cipher_mode); + avx_sse_check("enc-flush", (unsigned) params->hash_alg, + (unsigned) params->cipher_mode); #endif + while (job != NULL) { + if (post_job(enc_mb_mgr, job, &num_processed_jobs, params, test_buf, + buf_sizes, pli, xgem_hdr, IMB_DIR_ENCRYPT) < 0) { + i = (unsigned) ((uintptr_t) job->user_data); + goto exit; + } - while (job != NULL) { - const unsigned idx = (unsigned) ((uintptr_t) job->user_data); - - if (job->status != IMB_STATUS_COMPLETED) { - int errc = imb_get_errno(enc_mb_mgr); - - fprintf(stderr, - "failed job, status:%d, " - "error code:%d '%s'\n", - job->status, errc, imb_get_strerror(errc)); - goto exit; - } - if (idx != num_processed_jobs) { - fprintf(stderr, - "enc-flush job returned out of order, " - "received %u, expected %u\n", - idx, num_processed_jobs); - goto exit; + /* Get more completed jobs */ + job = IMB_GET_COMPLETED_JOB(enc_mb_mgr); } - num_processed_jobs++; - - if (params->hash_alg == IMB_AUTH_DOCSIS_CRC32) - modify_docsis_crc32_test_buf(test_buf[idx], job, buf_sizes[idx]); - - /* Get more completed jobs */ - job = IMB_GET_COMPLETED_JOB(enc_mb_mgr); } } @@ -1965,87 +2021,110 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const PinBasedCEC_MarkSecret((uintptr_t) dec_keys->k3, sizeof(dec_keys->k3)); #endif - for (i = 0; i < num_jobs; i++) { - imix_job_idx = i; - - job = IMB_GET_NEXT_JOB(dec_mb_mgr); + if (burst_api) { + unsigned num_rx_jobs; - /* Randomize memory for output digest */ - generate_random_buf(out_digest[i], tag_size); + IMB_JOB *burst_jobs[IMB_MAX_BURST_SIZE]; + /* num_jobs will always be lower than IMB_MAX_BURST_SIZE */ + num_rx_jobs = IMB_GET_NEXT_BURST(dec_mb_mgr, num_jobs, burst_jobs); - /* - * Generate digest from encrypted message and decrypt - * using reference architecture - */ - if (fill_job(job, params, src_dst_buf[i], out_digest[i], aad, buf_sizes[i], - tag_size, IMB_DIR_DECRYPT, dec_keys, cipher_iv, auth_iv, i, - next_iv) < 0) + if (num_rx_jobs != num_jobs) { + fprintf(stderr, "Number of jobs received less than requested\n"); goto exit; + } - /* Clear scratch registers before submitting job to prevent - * other functions from storing sensitive data in stack */ - job = IMB_SUBMIT_JOB(dec_mb_mgr); + for (i = 0; i < num_jobs; i++) { + IMB_JOB *job = burst_jobs[i]; + + /* Randomize memory for output digest */ + generate_random_buf(out_digest[i], tag_size); + + /* + * Generate digest from encrypted message and decrypt + * using reference architecture + */ + if (fill_job(job, params, src_dst_buf[i], out_digest[i], aad, buf_sizes[i], + tag_size, IMB_DIR_DECRYPT, dec_keys, cipher_iv, auth_iv, i, + next_iv) < 0) + goto exit; + + imb_set_session(dec_mb_mgr, job); + } + num_rx_jobs = IMB_SUBMIT_BURST(dec_mb_mgr, num_jobs, burst_jobs); #ifndef __aarch64__ - avx_sse_check("dec-submit", (unsigned) params->hash_alg, + avx_sse_check("dec-submit-burst", (unsigned) params->hash_alg, (unsigned) params->cipher_mode); #endif - if (job != NULL) { - const unsigned idx = (unsigned) ((uintptr_t) job->user_data); + if (num_rx_jobs < num_jobs) + num_rx_jobs += IMB_FLUSH_BURST(dec_mb_mgr, (num_jobs - num_rx_jobs), + &burst_jobs[num_rx_jobs]); - if (job->status != IMB_STATUS_COMPLETED) { - int errc = imb_get_errno(dec_mb_mgr); + if (num_rx_jobs != num_jobs) { + fprintf(stderr, "Number of processed jobs less than submitted\n"); + goto exit; + } - fprintf(stderr, - "failed job, status:%d, " - "error code:%d '%s'\n", - job->status, errc, imb_get_strerror(errc)); - goto exit; - } + for (i = 0; i < num_rx_jobs; i++) { + IMB_JOB *job = burst_jobs[i]; - if (idx != num_processed_jobs) { - fprintf(stderr, - "dec-submit job returned out of order, " - "received %u, expected %u\n", - idx, num_processed_jobs); + if (post_job(dec_mb_mgr, job, &num_processed_jobs, params, test_buf, + buf_sizes, pli, xgem_hdr, IMB_DIR_DECRYPT) < 0) goto exit; - } - num_processed_jobs++; } - } + } else { + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(dec_mb_mgr); + + /* Randomize memory for output digest */ + generate_random_buf(out_digest[i], tag_size); + + /* + * Generate digest from encrypted message and decrypt + * using reference architecture + */ + if (fill_job(job, params, src_dst_buf[i], out_digest[i], aad, buf_sizes[i], + tag_size, IMB_DIR_DECRYPT, dec_keys, cipher_iv, auth_iv, i, + next_iv) < 0) + goto exit; - /* Flush rest of the jobs, if there are outstanding jobs */ - while (num_processed_jobs != num_jobs) { - job = IMB_FLUSH_JOB(dec_mb_mgr); + /* Clear scratch registers before submitting job to prevent + * other functions from storing sensitive data in stack */ + job = IMB_SUBMIT_JOB(dec_mb_mgr); #ifndef __aarch64__ - avx_sse_check("dec-flush", (unsigned) params->hash_alg, - (unsigned) params->cipher_mode); + avx_sse_check("dec-submit", (unsigned) params->hash_alg, + (unsigned) params->cipher_mode); #endif - while (job != NULL) { - const unsigned idx = (unsigned) ((uintptr_t) job->user_data); + if (job != NULL) { + if (post_job(dec_mb_mgr, job, &num_processed_jobs, params, test_buf, + buf_sizes, pli, xgem_hdr, IMB_DIR_DECRYPT) < 0) { + i = (unsigned) ((uintptr_t) job->user_data); + goto exit; + } + } + } + + /* Flush rest of the jobs, if there are outstanding jobs */ + while (num_processed_jobs != num_jobs) { + job = IMB_FLUSH_JOB(dec_mb_mgr); - if (job->status != IMB_STATUS_COMPLETED) { - int errc = imb_get_errno(enc_mb_mgr); +#ifndef __aarch64__ + avx_sse_check("dec-flush", (unsigned) params->hash_alg, + (unsigned) params->cipher_mode); +#endif - fprintf(stderr, - "failed job, status:%d, " - "error code:%d '%s'\n", - job->status, errc, imb_get_strerror(errc)); - goto exit; - } - if (idx != num_processed_jobs) { - fprintf(stderr, - "dec-flush job returned out of order, " - "received %u, expected %u\n", - idx, num_processed_jobs); - goto exit; + while (job != NULL) { + if (post_job(dec_mb_mgr, job, &num_processed_jobs, params, test_buf, + buf_sizes, pli, xgem_hdr, IMB_DIR_DECRYPT) < 0) { + i = (unsigned) ((uintptr_t) job->user_data); + goto exit; + } + /* Get more completed jobs */ + job = IMB_GET_COMPLETED_JOB(dec_mb_mgr); } - num_processed_jobs++; - /* Get more completed jobs */ - job = IMB_GET_COMPLETED_JOB(dec_mb_mgr); } } @@ -2061,8 +2140,6 @@ do_test(IMB_MGR *enc_mb_mgr, const IMB_ARCH enc_arch, IMB_MGR *dec_mb_mgr, const for (i = 0; i < num_jobs; i++) { int goto_exit = 0; - imix_job_idx = i; - if (params->hash_alg != IMB_AUTH_NULL && memcmp(in_digest[i], out_digest[i], tag_size_to_check[i]) != 0) { fprintf(stderr, "\nInput and output tags " @@ -2112,14 +2189,17 @@ exit: print_tested_arch(enc_mb_mgr->features, enc_arch); printf("Decrypting "); print_tested_arch(dec_mb_mgr->features, dec_arch); - if (imix) { - printf("Job #%u, buffer size = %u\n", imix_job_idx, - buf_sizes[imix_job_idx]); + /* Print buffer size info if the failure was caused by an actual job, + where "i" indicates the index of the job failing */ + if (i < num_jobs) { + if (imix) { + printf("Job #%u, buffer size = %u\n", i, buf_sizes[i]); - for (i = 0; i < num_jobs; i++) - printf("Other sizes = %u\n", buf_sizes[i]); - } else - printf("Buffer size = %u\n", params->buf_size); + for (i = 0; i < num_jobs; i++) + printf("Other sizes = %u\n", buf_sizes[i]); + } else + printf("Buffer size = %u\n", params->buf_size); + } printf("Key size = %u\n", params->key_size); printf("Tag size = %u\n", tag_size); printf("AAD size = %u\n", (uint32_t) params->aad_size); @@ -2630,7 +2710,8 @@ usage(const char *app_name) "get cleared from IMB_MGR upon job completion (off by default; " "requires library compiled with SAFE_DATA)\n" "--avx-sse: if XGETBV is available then check for potential " - "AVX-SSE transition problems\n", + "AVX-SSE transition problems\n" + "--burst-api: use burst API instead of single job API\n", app_name, MAX_NUM_JOBS); } @@ -2936,6 +3017,8 @@ main(int argc, char *argv[]) if (!is_avx_sse_check_possible) fprintf(stderr, "XGETBV not available\n"); #endif + } else if (strcmp(argv[i], "--burst-api") == 0) { + burst_api = 1; } else { usage(argv[0]); return EXIT_FAILURE; -- GitLab From 20084a46b3b4e019dea40fda9ef921f4b5ea38c2 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 18 Oct 2023 18:03:27 +0100 Subject: [PATCH 158/204] lib: [doc] comment updates to the library header file - DES key schedule API comment added - added HEC32 and HEC64 API comments - corrected description of kasumi IV generation API - corrected comments for SHA224_ONE_BLOCK and SHA384_ONE_BLOCK API --- lib/ipsec-mb.h | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 383a2ff5..c7813631 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -1793,6 +1793,13 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); #define IMB_AES_XCBC_KEYEXP(_mgr, _key, _exp_key, _exp_key2, _exp_key3) \ ((_mgr)->xcbc_keyexp((_key), (_exp_key), (_exp_key2), (_exp_key3))) +/** + * Generate DES key schedule + * + * @param[in] _mgr Pointer to multi-buffer structure + * @param[out] _exp_key DES key schedule + * @param[in] _key input key + */ #define IMB_DES_KEYSCHED(_mgr, _exp_key, _key) ((_mgr)->des_key_sched((_exp_key), (_key))) /* Hash API's */ @@ -1818,9 +1825,13 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); /** * Authenticate 64-byte data buffer with SHA224. * + * @note The output \a tag is 32 bytes long (not 28 bytes). + * This is needed for HMAC IPAD and OPAD computation + * where full 8 word digest is required. + * * @param[in] _mgr Pointer to multi-buffer structure * @param[in] _src 64-byte data buffer - * @param[out] _tag Digest output (28 bytes) + * @param[out] _tag Digest output (32 bytes) */ #define IMB_SHA224_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->sha224_one_block((_src), (_tag))) @@ -1853,9 +1864,13 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); /** * Authenticate 128-byte data buffer with SHA384. * + * @note The output \a tag is 64 bytes long, not 48 bytes. + * This is needed for HMAC IPAD and OPAD computation + * where full 8 word digest is required. + * * @param[in] _mgr Pointer to multi-buffer structure * @param[in] _src 128-byte data buffer - * @param[out] _tag Digest output (48 bytes) + * @param[out] _tag Digest output (64 bytes) */ #define IMB_SHA384_ONE_BLOCK(_mgr, _src, _tag) ((_mgr)->sha384_one_block((_src), (_tag))) /** @@ -2563,9 +2578,23 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); #define IMB_SNOW3G_KEY_SCHED_SIZE(_mgr) ((_mgr)->snow3g_key_sched_size()) /** - * HEC compute functions + * HEC (hybrid error coding) compute and header update for 32-bit XGEM header + * + * @param [in] _mgr Pointer to initialized IMB_MGR structure + * @param [in] _src Pointer to XGEM header (4 bytes) + * + * @return 32-bit XGEM header with updated HEC in BE format (ready for store) */ #define IMB_HEC_32(_mgr, _src) ((_mgr)->hec_32(_src)) + +/** + * HEC (hybrid error coding) compute and header update for 64-bit XGEM header + * + * @param [in] _mgr Pointer to initialized IMB_MGR structure + * @param [in] _src Pointer to XGEM header (8 bytes) + * + * @return 64-bit XGEM header with updated HEC in BE format (ready for store) + */ #define IMB_HEC_64(_mgr, _src) ((_mgr)->hec_64(_src)) /** @@ -2629,7 +2658,12 @@ init_mb_mgr_auto(IMB_MGR *state, IMB_ARCH *arch); #define IMB_CRC8_WIMAX_OFDMA_HCS(_mgr, _src, _len) (_mgr)->crc8_wimax_ofdma_hcs(_src, _len) /** - * SM4 key expansion + * SM4 key expansion + * + * @param [in] _mgr Pointer to initialized IMB_MGR structure + * @param [in] _key Input key (16 bytes) + * @param [out] _exp_enc_key Encrypt direction key schedule (128 bytes) + * @param [out] _exp_dec_key Decrypt direction key schedule (128 bytes) */ #define IMB_SM4_KEYEXP(_mgr, _key, _exp_enc_key, _exp_dec_key) \ ((_mgr)->sm4_keyexp((_key), (_exp_enc_key), (_exp_dec_key))) @@ -3738,7 +3772,7 @@ zuc_eia3_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, v * @param [in] count COUNT (4 bytes in Little Endian) * @param [in] bearer BEARER (5 bits) * @param [in] dir DIRECTION (1 bit) - * @param [out] iv_ptr Pointer to generated IV (16 bytes) + * @param [out] iv_ptr Pointer to generated IV (8 bytes) * * @return Operation status * @retval 0 success @@ -3751,7 +3785,7 @@ kasumi_f8_iv_gen(const uint32_t count, const uint8_t bearer, const uint8_t dir, * * @param [in] count COUNT (4 bytes in Little Endian) * @param [in] fresh FRESH (4 bytes in Little Endian) - * @param [out] iv_ptr Pointer to generated IV (16 bytes) + * @param [out] iv_ptr Pointer to generated IV (8 bytes) * * @return Operation status * @retval 0 success -- GitLab From 50cb7e0479d6eac5ae2b6776d73a4e1dc6f2d34e Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 18 Oct 2023 18:04:58 +0100 Subject: [PATCH 159/204] lib: [aes-xcbc] declare key expansion input blocks as constant --- lib/x86_64/aes_xcbc_expand_key.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/x86_64/aes_xcbc_expand_key.c b/lib/x86_64/aes_xcbc_expand_key.c index d7d5d1d0..be601036 100644 --- a/lib/x86_64/aes_xcbc_expand_key.c +++ b/lib/x86_64/aes_xcbc_expand_key.c @@ -36,9 +36,9 @@ #include "include/arch_sse_type1.h" #include "include/arch_avx_type1.h" -static uint32_t in[4 * 3] = { 0x01010101, 0x01010101, 0x01010101, 0x01010101, - 0x02020202, 0x02020202, 0x02020202, 0x02020202, - 0x03030303, 0x03030303, 0x03030303, 0x03030303 }; +static const uint32_t in[4 * 3] = { 0x01010101, 0x01010101, 0x01010101, 0x01010101, + 0x02020202, 0x02020202, 0x02020202, 0x02020202, + 0x03030303, 0x03030303, 0x03030303, 0x03030303 }; void aes_xcbc_expand_key_sse(const void *key, void *k1_exp, void *k2, void *k3) -- GitLab From 622c4ed0db158047e6d95643ff4e0fbd264b1d20 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 19 Oct 2023 15:46:33 +0100 Subject: [PATCH 160/204] avx2: [quic-hp-chacha20] fix reading outside the key bounds --- lib/avx2_t1/chacha20_avx2.asm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/avx2_t1/chacha20_avx2.asm b/lib/avx2_t1/chacha20_avx2.asm index fcd778f9..333690c0 100644 --- a/lib/avx2_t1/chacha20_avx2.asm +++ b/lib/avx2_t1/chacha20_avx2.asm @@ -567,10 +567,8 @@ mksection .text %define %%NUM_BUFFERS %12 ;; [in] Number of ChaCha states to prepare (numerical) ;; Prepare next 4 states (or 2, if 2 or less blocks left) - vmovdqu %%STATE_IN_B_L, [%%KEY] ; Load key bytes 0-15 - vmovdqu %%STATE_IN_C_L, [%%KEY + 16] ; Load key bytes 16-31 - vperm2i128 %%STATE_IN_B_L,%%STATE_IN_B_L, 0x0 - vperm2i128 %%STATE_IN_C_L, %%STATE_IN_C_L, 0x0 + vbroadcasti128 %%STATE_IN_B_L, [%%KEY] ; Load key bytes 0-15 + vbroadcasti128 %%STATE_IN_C_L, [%%KEY + 16] ; Load key bytes 16-31 mov %%TMP, [%%SRC + %%OFF] vmovdqu XWORD(%%STATE_IN_D_L), [%%TMP] vmovdqa %%STATE_IN_A_L, [rel constants] -- GitLab From a6675819444a60437a8066dff4d994bd4c2e5a0b Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 19 Oct 2023 15:48:46 +0100 Subject: [PATCH 161/204] lib: add job validity check to the set session API --- lib/include/mb_mgr_job_check.h | 225 +++++++++++++++++++++++++++++++++ lib/x86_64/cipher_suite_id.c | 4 + 2 files changed, 229 insertions(+) diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 7623ca36..3aefdf88 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -30,12 +30,237 @@ #include "ipsec-mb.h" #include "include/error.h" +#include "include/kasumi_interface.h" +#include "include/zuc_internal.h" /* GCM NIST standard: len(M) < 2^39 - 256 */ #define GCM_MAX_LEN UINT64_C(((1ULL << 39) - 256) - 1) #define SNOW3G_MAX_BITLEN (UINT32_MAX) #define MB_MAX_LEN16 ((1 << 16) - 2) +/* used to validate template job structure before computing session_id */ +static inline int +is_job_invalid_light(IMB_MGR *state, const IMB_CIPHER_MODE cipher_mode, const IMB_HASH_ALG hash_alg, + const IMB_CIPHER_DIRECTION cipher_direction, + const IMB_KEY_SIZE_BYTES key_len_in_bytes) +{ + if (cipher_direction != IMB_DIR_DECRYPT && cipher_direction != IMB_DIR_ENCRYPT && + cipher_mode != IMB_CIPHER_NULL) { + imb_set_errno(state, IMB_ERR_JOB_CIPH_DIR); + return 1; + } + switch (cipher_mode) { + case IMB_CIPHER_NULL: + case IMB_CIPHER_CUSTOM: + case IMB_CIPHER_SM4_CBC: + case IMB_CIPHER_SM4_ECB: + break; + case IMB_CIPHER_CBC: + case IMB_CIPHER_CBCS_1_9: + case IMB_CIPHER_ECB: + case IMB_CIPHER_CNTR: + case IMB_CIPHER_CNTR_BITLEN: + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(24) && + key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_DOCSIS_SEC_BPI: + if ((key_len_in_bytes != UINT64_C(16)) && (key_len_in_bytes != UINT64_C(32))) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_GCM: + case IMB_CIPHER_GCM_SGL: + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(24) && + key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + if (cipher_mode == IMB_CIPHER_GCM && hash_alg != IMB_AUTH_AES_GMAC) { + imb_set_errno(state, IMB_ERR_HASH_ALGO); + return 1; + } + if (cipher_mode == IMB_CIPHER_GCM_SGL && hash_alg != IMB_AUTH_GCM_SGL) { + imb_set_errno(state, IMB_ERR_HASH_ALGO); + return 1; + } + break; + case IMB_CIPHER_DES: + case IMB_CIPHER_DOCSIS_DES: + if (key_len_in_bytes != UINT64_C(8)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_CCM: + /* currently only AES-CCM-128 and AES-CCM-256 supported */ + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + if (hash_alg != IMB_AUTH_AES_CCM) { + imb_set_errno(state, IMB_ERR_HASH_ALGO); + return 1; + } + break; + case IMB_CIPHER_DES3: + if (key_len_in_bytes != UINT64_C(24)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_PON_AES_CNTR: + if (hash_alg != IMB_AUTH_PON_CRC_BIP) { + imb_set_errno(state, IMB_ERR_HASH_ALGO); + return 1; + } + break; + case IMB_CIPHER_ZUC_EEA3: + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_SNOW3G_UEA2_BITLEN: + if (key_len_in_bytes != UINT64_C(16)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_KASUMI_UEA1_BITLEN: + if (key_len_in_bytes != UINT64_C(16)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_CHACHA20: + if (key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_CHACHA20_POLY1305: + case IMB_CIPHER_CHACHA20_POLY1305_SGL: + if (key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + break; + case IMB_CIPHER_SNOW_V_AEAD: + case IMB_CIPHER_SNOW_V: + if (key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + if (cipher_mode == IMB_CIPHER_SNOW_V_AEAD && hash_alg != IMB_AUTH_SNOW_V_AEAD) { + imb_set_errno(state, IMB_ERR_HASH_ALGO); + return 1; + } + break; + default: + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + + switch (hash_alg) { + case IMB_AUTH_HMAC_SHA_1: + case IMB_AUTH_MD5: + case IMB_AUTH_HMAC_SHA_224: + case IMB_AUTH_HMAC_SHA_256: + case IMB_AUTH_HMAC_SHA_384: + case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_AES_XCBC: + case IMB_AUTH_NULL: + case IMB_AUTH_CRC32_ETHERNET_FCS: + case IMB_AUTH_CRC32_SCTP: + case IMB_AUTH_CRC32_WIMAX_OFDMA_DATA: + case IMB_AUTH_CRC24_LTE_A: + case IMB_AUTH_CRC24_LTE_B: + case IMB_AUTH_CRC16_X25: + case IMB_AUTH_CRC16_FP_DATA: + case IMB_AUTH_CRC11_FP_HEADER: + case IMB_AUTH_CRC10_IUUP_DATA: + case IMB_AUTH_CRC8_WIMAX_OFDMA_HCS: + case IMB_AUTH_CRC7_FP_HEADER: + case IMB_AUTH_CRC6_IUUP_HEADER: + case IMB_AUTH_GHASH: + case IMB_AUTH_CUSTOM: + case IMB_AUTH_AES_CMAC: + case IMB_AUTH_AES_CMAC_BITLEN: + case IMB_AUTH_AES_CMAC_256: + case IMB_AUTH_SHA_1: + case IMB_AUTH_SHA_224: + case IMB_AUTH_SHA_256: + case IMB_AUTH_SHA_384: + case IMB_AUTH_SHA_512: + case IMB_AUTH_ZUC_EIA3_BITLEN: + case IMB_AUTH_ZUC256_EIA3_BITLEN: + case IMB_AUTH_SNOW3G_UIA2_BITLEN: + case IMB_AUTH_KASUMI_UIA1: + case IMB_AUTH_POLY1305: + case IMB_AUTH_SM3: + case IMB_AUTH_AES_GMAC_128: + case IMB_AUTH_AES_GMAC_192: + case IMB_AUTH_AES_GMAC_256: + break; + case IMB_AUTH_AES_GMAC: + if (cipher_mode != IMB_CIPHER_GCM) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + case IMB_AUTH_GCM_SGL: + if (cipher_mode != IMB_CIPHER_GCM_SGL) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + case IMB_AUTH_AES_CCM: + if (cipher_mode != IMB_CIPHER_CCM) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + case IMB_AUTH_PON_CRC_BIP: + if (cipher_mode != IMB_CIPHER_PON_AES_CNTR) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + case IMB_AUTH_DOCSIS_CRC32: + if (cipher_mode != IMB_CIPHER_DOCSIS_SEC_BPI) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + case IMB_AUTH_CHACHA20_POLY1305: + if (cipher_mode != IMB_CIPHER_CHACHA20_POLY1305) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + case IMB_AUTH_CHACHA20_POLY1305_SGL: + if (cipher_mode != IMB_CIPHER_CHACHA20_POLY1305_SGL) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + case IMB_AUTH_SNOW_V_AEAD: + if (cipher_mode != IMB_CIPHER_SNOW_V_AEAD) { + imb_set_errno(state, IMB_ERR_CIPH_MODE); + return 1; + } + break; + default: + imb_set_errno(state, IMB_ERR_HASH_ALGO); + return 1; + } + return 0; +} + __forceinline int is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, const IMB_HASH_ALG hash_alg, const IMB_CIPHER_DIRECTION cipher_direction, diff --git a/lib/x86_64/cipher_suite_id.c b/lib/x86_64/cipher_suite_id.c index 46da5222..4ed08d56 100644 --- a/lib/x86_64/cipher_suite_id.c +++ b/lib/x86_64/cipher_suite_id.c @@ -32,6 +32,7 @@ #else #include #endif +#include "include/mb_mgr_job_check.h" IMB_DLL_EXPORT uint32_t imb_set_session(IMB_MGR *state, IMB_JOB *job) @@ -54,6 +55,9 @@ imb_set_session(IMB_MGR *state, IMB_JOB *job) imb_set_errno(state, IMB_ERR_NULL_JOB); return 0; } + if (is_job_invalid_light(state, job->cipher_mode, job->hash_alg, job->cipher_direction, + job->key_len_in_bytes)) + return 0; /* errno is set inside is_job_invalid() */ imb_set_errno(state, 0); #endif /* Fill in suite_id[] structure in \a job */ -- GitLab From edef6cf14b60f84f48aa772702eb3eee067c10a9 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Fri, 20 Oct 2023 10:57:25 +0100 Subject: [PATCH 162/204] sse: [pon] change HEC function alignment from 64 to 32 bytes --- lib/sse_t1/pon_by8_sse.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sse_t1/pon_by8_sse.asm b/lib/sse_t1/pon_by8_sse.asm index 948a95f7..3f00589b 100644 --- a/lib/sse_t1/pon_by8_sse.asm +++ b/lib/sse_t1/pon_by8_sse.asm @@ -937,7 +937,7 @@ DEC_NO_CTR_FN_NAME: ret ;; uint32_t hec_32_sse(const uint8_t *in) -align 64 +align 32 MKGLOBAL(HEC_32,function,) HEC_32: endbranch64 @@ -973,7 +973,7 @@ error_hec32: %endif ;; uint32_t hec_64_sse(const uint8_t *in) -align 64 +align 32 MKGLOBAL(HEC_64,function,) HEC_64: endbranch64 -- GitLab From 1f9c07e0a97996f61f13edea36b2f89019a9e0bb Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 18 Oct 2023 18:05:57 +0100 Subject: [PATCH 163/204] test: [fuzz-app] added more tests for direct API's - key expansion API tests - hash API tests - QUIC API tests - set session and self test API tests - IV generation API tests - HEC API tests --- test/fuzz-app/direct_api_fuzz_test.c | 1235 ++++++++++++++++++++++++-- 1 file changed, 1142 insertions(+), 93 deletions(-) diff --git a/test/fuzz-app/direct_api_fuzz_test.c b/test/fuzz-app/direct_api_fuzz_test.c index 5eedc342..86bbab35 100644 --- a/test/fuzz-app/direct_api_fuzz_test.c +++ b/test/fuzz-app/direct_api_fuzz_test.c @@ -322,6 +322,28 @@ test_snow3g_f8_8_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return 0; } +static int +test_snow3g_f8_iv_gen(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + struct { + uint32_t count; + uint8_t bearer; + uint8_t dir; + } params; + + fill_data(¶ms, sizeof(params), buff, dataSize); + + void *iv = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); + + if (iv == NULL) + return -1; + snow3g_f8_iv_gen(params.count, params.bearer, params.dir, iv); + free(iv); + return 0; +} + static int test_snow3g_f8_n_multikey(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { @@ -352,6 +374,28 @@ test_snow3g_f9_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return 0; } +static int +test_snow3g_f9_iv_gen(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + struct { + uint32_t count; + uint32_t fresh; + uint8_t dir; + } params; + + fill_data(¶ms, sizeof(params), buff, dataSize); + + void *iv = malloc(IMB_SNOW3G_IV_LEN_IN_BYTES); + + if (iv == NULL) + return -1; + snow3g_f9_iv_gen(params.count, params.fresh, params.dir, iv); + free(iv); + return 0; +} + /* ========================================================================== */ /* ========================================================================== */ @@ -803,6 +847,28 @@ test_zuc_eea3_1_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return 0; } +static int +test_zuc_eea3_iv_gen(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + struct { + uint32_t count; + uint8_t bearer; + uint8_t dir; + } params; + + fill_data(¶ms, sizeof(params), buff, dataSize); + + void *iv = malloc(IMB_ZUC_IV_LEN_IN_BYTES); + + if (iv == NULL) + return -1; + zuc_eea3_iv_gen(params.count, params.bearer, params.dir, iv); + free(iv); + return 0; +} + struct test_zuc_mb { size_t n; const void **key; @@ -940,6 +1006,28 @@ test_zuc_eia3_n_buff(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return 0; } +static int +test_zuc_eia3_iv_gen(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + struct { + uint32_t count; + uint8_t bearer; + uint8_t dir; + } params; + + fill_data(¶ms, sizeof(params), buff, dataSize); + + void *iv = malloc(IMB_ZUC_IV_LEN_IN_BYTES); + + if (iv == NULL) + return -1; + zuc_eia3_iv_gen(params.count, params.bearer, params.dir, iv); + free(iv); + return 0; +} + /* ========================================================================== */ /* ========================================================================== */ @@ -1173,6 +1261,28 @@ test_kasumi_f8_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return 0; } +static int +test_kasumi_f8_iv_gen(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + struct { + uint32_t count; + uint8_t bearer; + uint8_t dir; + } params; + + fill_data(¶ms, sizeof(params), buff, dataSize); + + void *iv = malloc(IMB_KASUMI_IV_SIZE); + + if (iv == NULL) + return -1; + kasumi_f8_iv_gen(params.count, params.bearer, params.dir, iv); + free(iv); + return 0; +} + static int test_kasumi_f8_1_buff_bit(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) { @@ -1326,6 +1436,28 @@ test_kasumi_f9_init_key_sched(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return 0; } +static int +test_kasumi_f9_iv_gen(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + struct { + uint32_t count; + uint32_t fresh; + } params; + + fill_data(¶ms, sizeof(params), buff, dataSize); + + void *iv = malloc(IMB_KASUMI_IV_SIZE); + + if (iv == NULL) + return -1; + kasumi_f9_iv_gen(params.count, params.fresh, iv); + free(iv); + return 0; +} + + /* ========================================================================== */ /* ========================================================================== */ @@ -1337,124 +1469,1041 @@ test_imb_clear_mem(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) imb_clear_mem(buff, dataSize); return 0; } - /* ========================================================================== */ /* ========================================================================== */ +struct test_quic_mb { + size_t n; + const void **array_src; + void **array_dst; + const void **array_aad; + void **array_tag; + const void **array_iv; + uint64_t *array_len; +}; + +static void +test_quic_mb_free(struct test_quic_mb *ts) +{ + if (ts->array_tag != NULL) + free(ts->array_tag); + if (ts->array_src != NULL) + free(ts->array_src); + if (ts->array_dst != NULL) + free(ts->array_dst); + if (ts->array_aad != NULL) + free(ts->array_aad); + if (ts->array_iv != NULL) + free(ts->array_iv); + if (ts->array_len != NULL) + free(ts->array_len); + memset(ts, 0, sizeof(*ts)); +} + static int -test_imb_quic_aes_gcm(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +test_quic_mb_alloc(struct test_quic_mb *ts, const size_t n) { - if (dataSize < 1) + ts->n = n; + ts->array_tag = malloc(n * sizeof(ts->array_tag[0])); + ts->array_src = malloc(n * sizeof(ts->array_src[0])); + ts->array_dst = malloc(n * sizeof(ts->array_dst[0])); + ts->array_iv = malloc(n * sizeof(ts->array_iv[0])); + ts->array_len = malloc(n * sizeof(ts->array_len[0])); + ts->array_aad = malloc(n * sizeof(ts->array_aad[0])); + + if (ts->array_tag == NULL || ts->array_src == NULL || ts->array_dst == NULL || + ts->array_aad == NULL || ts->array_len == NULL || ts->array_iv == NULL) { + test_quic_mb_free(ts); return -1; + } + return 0; +} + +static void +test_quic_mb_set1(struct test_quic_mb *ts, const void *aad, const void *src, void *dst, void *tag, + const void *iv, const uint64_t len) +{ + for (size_t i = 0; i < ts->n; i++) { + ts->array_tag[i] = tag; + ts->array_src[i] = src; + ts->array_dst[i] = dst; + ts->array_len[i] = len; + ts->array_aad[i] = aad; + ts->array_iv[i] = iv; + } +} +static int +test_imb_quic_aes_gcm(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ if (gcm_start(dataSize, buff) != 0) return -1; - const uint64_t n = (uint64_t) buff[0]; - const IMB_CIPHER_DIRECTION cipher_dir = (IMB_CIPHER_DIRECTION) (buff[0] >> 6); - const IMB_KEY_SIZE_BYTES key_size = (IMB_KEY_SIZE_BYTES) buff[0]; - - void *dst[n]; - const void *src[n]; - const void *aad[n]; - void *t[n]; - uint64_t l[n]; - const void *iv[n]; - - for (uint64_t i = 0; i < n; i++) { - dst[i] = buff; - src[i] = buff; - aad[i] = gcm_aad; - t[i] = gcm_auth_tag; - l[i] = dataSize; - iv[i] = gcm_iv; + const uint64_t n = (dataSize > 0) ? (uint64_t) buff[0] : 4; + struct test_quic_mb ts; + + if (test_quic_mb_alloc(&ts, n) != 0) { + gcm_end(); + return -1; } - imb_quic_aes_gcm(p_mgr, gcm_key, key_size, cipher_dir, dst, src, l, iv, aad, gcm_aad_len, t, + + const IMB_CIPHER_DIRECTION cipher_dir = + (dataSize > 0) ? (IMB_CIPHER_DIRECTION) (buff[0] >> 6) : 0; + const IMB_KEY_SIZE_BYTES key_size = + (dataSize > 0) ? (IMB_KEY_SIZE_BYTES) (buff[0] & 0x38) : IMB_KEY_128_BYTES; + + test_quic_mb_set1(&ts, gcm_aad, buff, buff, gcm_auth_tag, gcm_iv, dataSize); + + imb_quic_aes_gcm(p_mgr, gcm_key, key_size, cipher_dir, ts.array_dst, ts.array_src, + ts.array_len, ts.array_iv, ts.array_aad, gcm_aad_len, ts.array_tag, gcm_tag_len, n); + test_quic_mb_free(&ts); gcm_end(); return 0; } -#endif /* __aarch64__ */ + +static int +test_imb_quic_chacha20_poly1305(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (ccp_start(dataSize, buff) != 0) + return -1; + + const uint64_t n = (dataSize > 0) ? (uint64_t) buff[0] : 4; + struct test_quic_mb ts; + + if (test_quic_mb_alloc(&ts, n) != 0) { + ccp_end(); + return -1; + } + + const IMB_CIPHER_DIRECTION cipher_dir = + (dataSize > 0) ? (IMB_CIPHER_DIRECTION) (buff[0] >> 6) : 0; + + test_quic_mb_set1(&ts, ccp_aad, buff, buff, ccp_auth_tag, ccp_iv, dataSize); + + imb_quic_chacha20_poly1305(p_mgr, ccp_key, cipher_dir, ts.array_dst, ts.array_src, + ts.array_len, ts.array_iv, ts.array_aad, ccp_aad_len, + ts.array_tag, n); + test_quic_mb_free(&ts); + ccp_end(); + return 0; +} + +static int +test_imb_quic_hp_aes_ecb(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const IMB_KEY_SIZE_BYTES key_size = + (dataSize > 0) ? (IMB_KEY_SIZE_BYTES) (buff[0] & 0x38) : IMB_KEY_128_BYTES; + + void *dst = malloc(5); + + if (dst == NULL) + return -1; + fill_data(dst, 5, buff, dataSize); + + void *src = malloc(16); + + if (src == NULL) { + free(dst); + return -1; + } + fill_data(src, 16, buff, dataSize); + + size_t expkey_size; + + if (key_size >= IMB_KEY_256_BYTES) + expkey_size = 15 * 16; + else if (key_size >= IMB_KEY_192_BYTES) + expkey_size = 13 * 16; + else + expkey_size = 11 * 16; + + void *expkey = malloc(expkey_size); + + if (expkey == NULL) { + free(dst); + free(src); + return -1; + } + fill_data(expkey, expkey_size, buff, dataSize); + + const uint64_t n = (dataSize > 0) ? (uint64_t) buff[0] : 4; + struct test_quic_mb ts; + + if (test_quic_mb_alloc(&ts, n) != 0) { + free(dst); + free(src); + free(expkey); + return -1; + } + + test_quic_mb_set1(&ts, NULL, src, dst, NULL, NULL, 0); + + imb_quic_hp_aes_ecb(p_mgr, expkey, ts.array_dst, ts.array_src, n, key_size); + + test_quic_mb_free(&ts); + free(dst); + free(src); + free(expkey); + return 0; +} + +static int +test_imb_quic_hp_chacha20(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + void *dst = malloc(5); + + if (dst == NULL) + return -1; + fill_data(dst, 5, buff, dataSize); + + void *src = malloc(16); + + if (src == NULL) { + free(dst); + return -1; + } + fill_data(src, 16, buff, dataSize); + + const size_t key_size = IMB_KEY_256_BYTES; + void *key = malloc(key_size); + + if (key == NULL) { + free(dst); + free(src); + return -1; + } + fill_data(key, key_size, buff, dataSize); + + const uint64_t n = (dataSize > 0) ? (uint64_t) buff[0] : 4; + struct test_quic_mb ts; + + if (test_quic_mb_alloc(&ts, n) != 0) { + free(dst); + free(src); + free(key); + return -1; + } + + test_quic_mb_set1(&ts, NULL, src, dst, NULL, NULL, 0); + + imb_quic_hp_chacha20(p_mgr, key, ts.array_dst, ts.array_src, n); + + test_quic_mb_free(&ts); + free(dst); + free(src); + free(key); + return 0; +} /* ========================================================================== */ /* ========================================================================== */ -struct { - int (*func)(IMB_MGR *mb_mgr, uint8_t *buff, size_t dataSize); - const char *func_name; -} direct_apis[] = { - { test_snow3g_init_key_sched, "test_snow3g_init_key_sched" }, - { test_snow3g_f8_1_buff_bit, "test_snow3g_f8_1_buff_bit" }, - { test_snow3g_f8_1_buff, "test_snow3g_f8_1_buff" }, - { test_snow3g_f8_2_buff, "test_snow3g_f8_2_buff" }, - { test_snow3g_f8_4_buff, "test_snow3g_f8_4_buff" }, - { test_snow3g_f8_8_buff, "test_snow3g_f8_8_buff" }, - { test_snow3g_f8_n_buff, "test_snow3g_f8_n_buff" }, - { test_snow3g_f8_8_multikey, "test_snow3g_f8_8_multikey" }, - { test_snow3g_f8_n_multikey, "test_snow3g_f8_n_multikey" }, - { test_snow3g_f9_1_buff, "test_snow3g_f9_1_buff" }, -#ifndef __aarch64__ - { test_aes_gcm_pre, "test_aes_gcm_pre" }, - { test_aes_gcm_precomp, "test_aes_gcm_precomp" }, - { test_aes128_gcm_enc_sgl, "test_aes128_gcm_enc_sgl" }, - { test_aes128_gcm_dec_sgl, "test_aes128_gcm_dec_sgl" }, - { test_aes192_gcm_enc_sgl, "test_aes192_gcm_enc_sgl" }, - { test_aes192_gcm_dec_sgl, "test_aes192_gcm_dec_sgl" }, - { test_aes256_gcm_enc_sgl, "test_aes256_gcm_enc_sgl" }, - { test_aes256_gcm_dec_sgl, "test_aes256_gcm_dec_sgl" }, - { test_aes128_gcm_enc, "test_aes128_gcm_enc" }, - { test_aes128_gcm_dec, "test_aes128_gcm_dec" }, - { test_aes192_gcm_enc, "test_aes192_gcm_enc" }, - { test_aes192_gcm_dec, "test_aes192_gcm_dec" }, - { test_aes256_gcm_enc, "test_aes256_gcm_enc" }, - { test_aes256_gcm_dec, "test_aes256_gcm_dec" }, - { test_aes128_gcm_init_var_iv, "test_aes128_gcm_init_var_iv" }, - { test_aes192_gcm_init_var_iv, "test_aes192_gcm_init_var_iv" }, - { test_aes256_gcm_init_var_iv, "test_aes256_gcm_init_var_iv" }, +static void +test_aes_exp_free(void **ekey, void **dkey) +{ + void *e = *ekey; + void *d = *dkey; - { test_aes128_gmac, "test_aes128_gmac" }, - { test_aes192_gmac, "test_aes192_gmac" }, - { test_aes256_gmac, "test_aes256_gmac" }, + if (e != NULL) + free(e); + if (d != NULL) + free(d); + *ekey = NULL; + *dkey = NULL; +} - { test_ghash, "test_ghash" }, - { test_ghash_pre, "test_ghash_pre" }, -#endif /* __aarch64__ */ - { test_zuc_eea3_1_buff, "test_zuc_eea3_1_buff" }, - { test_zuc_eea3_4_buff, "test_zuc_eea3_4_buff" }, - { test_zuc_eea3_n_buff, "test_zuc_eea3_n_buff" }, - { test_zuc_eia3_1_buff, "test_zuc_eia3_1_buff" }, - { test_zuc_eia3_n_buff, "test_zuc_eia3_n_buff" }, -#ifndef __aarch64__ - { test_chacha_poly_enc, "test_chacha_poly_enc" }, - { test_chacha_poly_dec, "test_chacha_poly_dec" }, +static int +test_aes_exp_alloc(const unsigned rounds, void **ekey, void **dkey) +{ + void *e = malloc(rounds * 16); + void *d = malloc(rounds * 16); - { test_crc32_ethernet_fcs, "test_crc32_ethernet_fcs" }, - { test_crc16_x25, "test_crc16_x25" }, - { test_crc32_sctp, "test_crc32_sctp" }, - { test_crc16_fp_data, "test_crc16_fp_data" }, - { test_crc11_fp_header, "test_crc11_fp_header" }, - { test_crc24_lte_a, "test_crc24_lte_a" }, - { test_crc24_lte_b, "test_crc24_lte_b" }, - { test_crc7_fp_header, "test_crc7_fp_header" }, - { test_crc10_iuup_data, "test_crc10_iuup_data" }, - { test_crc6_iuup_header, "test_crc6_iuup_header" }, - { test_crc32_wimax_ofdma_data, "test_crc32_wimax_ofdma_data" }, - { test_crc8_wimax_ofdma_hcs, "test_crc8_wimax_ofdma_hcs" }, + *ekey = e; + *dkey = d; - { test_kasumi_f8_init_key_sched, "test_kasumi_f8_init_key_sched" }, - { test_kasumi_f8_1_buff_bit, "test_kasumi_f8_1_buff_bit" }, - { test_kasumi_f8_1_buff, "test_kasumi_f8_1_buff" }, - { test_kasumi_f8_2_buff, "test_kasumi_f8_2_buff" }, - { test_kasumi_f8_3_buff, "test_kasumi_f8_3_buff" }, - { test_kasumi_f8_4_buff, "test_kasumi_f8_4_buff" }, - { test_kasumi_f8_n_buff, "test_kasumi_f8_n_buff" }, - { test_kasumi_f9_1_buff, "test_kasumi_f9_1_buff" }, - { test_kasumi_f9_1_buff_user, "test_kasumi_f9_1_buff_user" }, - { test_kasumi_f9_init_key_sched, "test_kasumi_f9_init_key_sched" }, + if (e == NULL || d == NULL) { + test_aes_exp_free(ekey, dkey); + return -1; + } - { test_imb_clear_mem, "test_imb_clear_mem" }, + return 0; +} - { test_imb_quic_aes_gcm, "test_imb_quic_aes_gcm" }, +static int +test_imb_aes_keyexp_128(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (dataSize < IMB_KEY_128_BYTES) + return -1; + + void *ekey, *dkey; + + if (test_aes_exp_alloc(11, &ekey, &dkey) != 0) + return -1; + + IMB_AES_KEYEXP_128(p_mgr, buff, ekey, dkey); + test_aes_exp_free(&ekey, &dkey); + return 0; +} + +static int +test_imb_aes_keyexp_192(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (dataSize < IMB_KEY_192_BYTES) + return -1; + + void *ekey, *dkey; + + if (test_aes_exp_alloc(13, &ekey, &dkey) != 0) + return -1; + + IMB_AES_KEYEXP_192(p_mgr, buff, ekey, dkey); + test_aes_exp_free(&ekey, &dkey); + return 0; +} + +static int +test_imb_aes_keyexp_256(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + if (dataSize < IMB_KEY_256_BYTES) + return -1; + + void *ekey, *dkey; + + if (test_aes_exp_alloc(15, &ekey, &dkey) != 0) + return -1; + + IMB_AES_KEYEXP_256(p_mgr, buff, ekey, dkey); + test_aes_exp_free(&ekey, &dkey); + return 0; +} + +static int +test_imb_aes_subkey_cmac128(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + void *skey1, *skey2, *ekey, *dkey; + + if (test_aes_exp_alloc(1, &skey1, &skey2) != 0) + return -1; + + if (test_aes_exp_alloc(11, &ekey, &dkey) != 0) { + test_aes_exp_free(&skey1, &skey2); + return -1; + } + + const size_t sz_ekey = 11 * 16; + + memset(ekey, 0, sz_ekey); + memcpy(ekey, buff, (dataSize > sz_ekey) ? sz_ekey : dataSize); + + IMB_AES_CMAC_SUBKEY_GEN_128(p_mgr, ekey, skey1, skey2); + + test_aes_exp_free(&skey1, &skey2); + test_aes_exp_free(&ekey, &dkey); + return 0; +} + +static int +test_imb_aes_subkey_cmac256(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + void *skey1, *skey2, *ekey, *dkey; + + if (test_aes_exp_alloc(1, &skey1, &skey2) != 0) + return -1; + + if (test_aes_exp_alloc(15, &ekey, &dkey) != 0) { + test_aes_exp_free(&skey1, &skey2); + return -1; + } + + const size_t sz_ekey = 15 * 16; + + memset(ekey, 0, sz_ekey); + memcpy(ekey, buff, (dataSize > sz_ekey) ? sz_ekey : dataSize); + + IMB_AES_CMAC_SUBKEY_GEN_256(p_mgr, ekey, skey1, skey2); + + test_aes_exp_free(&skey1, &skey2); + test_aes_exp_free(&ekey, &dkey); + return 0; +} + +static int +test_imb_aes_keyexp_xcbc128(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + void *key2, *key3, *key, *key_dust; + void *expkey, *expkey_dust; + + if (test_aes_exp_alloc(1, &key2, &key3) != 0) + return -1; + + if (test_aes_exp_alloc(1, &key, &key_dust) != 0) { + test_aes_exp_free(&key2, &key3); + return -1; + } + + if (test_aes_exp_alloc(11, &expkey, &expkey_dust) != 0) { + test_aes_exp_free(&key2, &key3); + test_aes_exp_free(&key, &key_dust); + return -1; + } + + memset(key, 0, 16); + memcpy(key, buff, (dataSize > 16) ? 16 : dataSize); + + IMB_AES_XCBC_KEYEXP(p_mgr, key, expkey, key2, key3); + + test_aes_exp_free(&key2, &key3); + test_aes_exp_free(&key, &key_dust); + test_aes_exp_free(&expkey, &expkey_dust); + return 0; +} + +static int +test_imb_des_keyexp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + void *key = malloc(sizeof(uint64_t)); + + if (key == NULL) + return -1; + + void *expkey = malloc(IMB_DES_KEY_SCHED_SIZE); + + if (expkey == NULL) { + free(key); + return -1; + } + + memset(key, 0, sizeof(uint64_t)); + memcpy(key, buff, (dataSize > sizeof(uint64_t)) ? sizeof(uint64_t) : dataSize); + + IMB_DES_KEYSCHED(p_mgr, expkey, key); + + free(key); + free(expkey); + return 0; +} + +static int +test_imb_sm4_keyexp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + void *key = malloc(IMB_KEY_128_BYTES); + if (key == NULL) + return -1; + + fill_data(key, IMB_KEY_128_BYTES, buff, dataSize); + + void *ekey, *dkey; + + if (test_aes_exp_alloc((IMB_SM4_KEY_SCHEDULE * 4) / 16, &ekey, &dkey) != 0) { + free(key); + return -1; + } + + IMB_SM4_KEYEXP(p_mgr, key, ekey, dkey); + test_aes_exp_free(&ekey, &dkey); + free(key); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static int +test_imb_sha1(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t tag_sz = IMB_SHA1_DIGEST_SIZE_IN_BYTES; + void *tag = malloc(tag_sz); + + if (tag == NULL) + return -1; + + IMB_SHA1(p_mgr, buff, dataSize, tag); + + free(tag); + return 0; +} + +static int +test_imb_sha224(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t tag_sz = IMB_SHA224_DIGEST_SIZE_IN_BYTES; + void *tag = malloc(tag_sz); + + if (tag == NULL) + return -1; + + IMB_SHA224(p_mgr, buff, dataSize, tag); + + free(tag); + return 0; +} + +static int +test_imb_sha256(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t tag_sz = IMB_SHA256_DIGEST_SIZE_IN_BYTES; + void *tag = malloc(tag_sz); + + if (tag == NULL) + return -1; + + IMB_SHA256(p_mgr, buff, dataSize, tag); + + free(tag); + return 0; +} + +static int +test_imb_sha384(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t tag_sz = IMB_SHA384_DIGEST_SIZE_IN_BYTES; + void *tag = malloc(tag_sz); + + if (tag == NULL) + return -1; + + IMB_SHA384(p_mgr, buff, dataSize, tag); + + free(tag); + return 0; +} + +static int +test_imb_sha512(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t tag_sz = IMB_SHA512_DIGEST_SIZE_IN_BYTES; + void *tag = malloc(tag_sz); + + if (tag == NULL) + return -1; + + IMB_SHA512(p_mgr, buff, dataSize, tag); + + free(tag); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static int +test_imb_hec32(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t xgem_sz = 4; + void *xgem = malloc(xgem_sz); + + if (xgem == NULL) + return -1; + + fill_data(xgem, xgem_sz, buff, dataSize); + + IMB_HEC_32(p_mgr, xgem); + + free(xgem); + return 0; +} + +static int +test_imb_hec64(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t xgem_sz = 8; + void *xgem = malloc(xgem_sz); + + if (xgem == NULL) + return -1; + + fill_data(xgem, xgem_sz, buff, dataSize); + + IMB_HEC_64(p_mgr, xgem); + + free(xgem); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +struct test_hash_one_block { + void *tag; + void *block; +}; + +static void +test_hash_one_block_free(struct test_hash_one_block *ts) +{ + if (ts->tag != NULL) + free(ts->tag); + if (ts->block != NULL) + free(ts->block); + memset(ts, 0, sizeof(*ts)); +} + +static int +test_hash_one_block_alloc(struct test_hash_one_block *ts, const size_t tag_size, + const size_t block_size) +{ + ts->tag = malloc(tag_size); + ts->block = malloc(block_size); + if (ts->tag == NULL || ts->block == NULL) { + test_hash_one_block_free(ts); + return -1; + } + return 0; +} + +static int +test_imb_sha1_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_hash_one_block ts; + + if (test_hash_one_block_alloc(&ts, IMB_SHA1_DIGEST_SIZE_IN_BYTES, IMB_SHA1_BLOCK_SIZE) != 0) + return -1; + + fill_data(ts.block, IMB_SHA1_BLOCK_SIZE, buff, dataSize); + + IMB_SHA1_ONE_BLOCK(p_mgr, ts.block, ts.tag); + + test_hash_one_block_free(&ts); + return 0; +} + +static int +test_imb_sha224_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_hash_one_block ts; + + if (test_hash_one_block_alloc(&ts, IMB_SHA256_DIGEST_SIZE_IN_BYTES, + IMB_SHA_224_BLOCK_SIZE) != 0) + return -1; + + fill_data(ts.block, IMB_SHA_224_BLOCK_SIZE, buff, dataSize); + + IMB_SHA224_ONE_BLOCK(p_mgr, ts.block, ts.tag); + + test_hash_one_block_free(&ts); + return 0; +} + +static int +test_imb_sha256_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_hash_one_block ts; + + if (test_hash_one_block_alloc(&ts, IMB_SHA256_DIGEST_SIZE_IN_BYTES, + IMB_SHA_256_BLOCK_SIZE) != 0) + return -1; + + fill_data(ts.block, IMB_SHA_256_BLOCK_SIZE, buff, dataSize); + + IMB_SHA256_ONE_BLOCK(p_mgr, ts.block, ts.tag); + + test_hash_one_block_free(&ts); + return 0; +} + +static int +test_imb_sha384_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_hash_one_block ts; + + if (test_hash_one_block_alloc(&ts, IMB_SHA512_DIGEST_SIZE_IN_BYTES, + IMB_SHA_384_BLOCK_SIZE) != 0) + return -1; + + fill_data(ts.block, IMB_SHA_384_BLOCK_SIZE, buff, dataSize); + + IMB_SHA384_ONE_BLOCK(p_mgr, ts.block, ts.tag); + + test_hash_one_block_free(&ts); + return 0; +} + +static int +test_imb_sha512_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_hash_one_block ts; + + if (test_hash_one_block_alloc(&ts, IMB_SHA512_DIGEST_SIZE_IN_BYTES, + IMB_SHA_512_BLOCK_SIZE) != 0) + return -1; + + fill_data(ts.block, IMB_SHA_512_BLOCK_SIZE, buff, dataSize); + + IMB_SHA512_ONE_BLOCK(p_mgr, ts.block, ts.tag); + + test_hash_one_block_free(&ts); + return 0; +} + +static int +test_imb_md5_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_hash_one_block ts; + + if (test_hash_one_block_alloc(&ts, IMB_MD5_DIGEST_SIZE_IN_BYTES, IMB_MD5_BLOCK_SIZE) != 0) + return -1; + + fill_data(ts.block, IMB_MD5_BLOCK_SIZE, buff, dataSize); + + IMB_MD5_ONE_BLOCK(p_mgr, ts.block, ts.tag); + + test_hash_one_block_free(&ts); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static int +test_imb_hmac_ipad_opad(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const struct { + IMB_HASH_ALG hash; + size_t digest_size; + } htab[] = { + { IMB_AUTH_HMAC_SHA_1, IMB_SHA1_DIGEST_SIZE_IN_BYTES }, + { IMB_AUTH_HMAC_SHA_224, IMB_SHA256_DIGEST_SIZE_IN_BYTES }, + { IMB_AUTH_HMAC_SHA_256, IMB_SHA256_DIGEST_SIZE_IN_BYTES }, + { IMB_AUTH_HMAC_SHA_384, IMB_SHA512_DIGEST_SIZE_IN_BYTES }, + { IMB_AUTH_HMAC_SHA_512, IMB_SHA512_DIGEST_SIZE_IN_BYTES }, + { IMB_AUTH_MD5, IMB_MD5_DIGEST_SIZE_IN_BYTES }, + { IMB_AUTH_GHASH, 1 }, /* invalid */ + }; + const size_t index = dataSize > 0 ? (buff[0] % IMB_DIM(htab)) : 0; + + void *opad = malloc(htab[index].digest_size); + + if (opad == NULL) + return -1; + + void *ipad = malloc(htab[index].digest_size); + + if (ipad == NULL) { + free(opad); + return -1; + } + + imb_hmac_ipad_opad(p_mgr, htab[index].hash, buff, dataSize, ipad, opad); + + free(opad); + free(ipad); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +struct test_cfb_one_block { + void *iv; + void *expkey; +}; + +static void +test_cfb_one_block_free(struct test_cfb_one_block *ts) +{ + if (ts->iv != NULL) + free(ts->iv); + if (ts->expkey != NULL) + free(ts->expkey); + memset(ts, 0, sizeof(*ts)); +} + +static int +test_cfb_one_block_alloc(struct test_cfb_one_block *ts, const size_t rounds, const int is_aes) +{ + if (is_aes) { + /* AES */ + ts->iv = malloc(16); + ts->expkey = malloc(rounds * 16); + } else { + /* DES */ + ts->iv = malloc(8); + ts->expkey = malloc(IMB_DES_KEY_SCHED_SIZE); + } + if (ts->iv == NULL || ts->expkey == NULL) { + test_cfb_one_block_free(ts); + return -1; + } + return 0; +} + +static int +test_imb_cfb128_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_cfb_one_block ts; + const size_t aes_rounds = 11; + + if (test_cfb_one_block_alloc(&ts, aes_rounds, 1 /* AES */) != 0) + return -1; + + fill_data(ts.iv, 16, buff, dataSize); + fill_data(ts.expkey, aes_rounds * 16, buff, dataSize); + + IMB_AES128_CFB_ONE(p_mgr, buff, buff, ts.iv, ts.expkey, dataSize); + + test_cfb_one_block_free(&ts); + return 0; +} + +static int +test_imb_cfb256_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + struct test_cfb_one_block ts; + const size_t aes_rounds = 15; + + if (test_cfb_one_block_alloc(&ts, aes_rounds, 1 /* AES */) != 0) + return -1; + + fill_data(ts.iv, 16, buff, dataSize); + fill_data(ts.expkey, aes_rounds * 16, buff, dataSize); + + IMB_AES256_CFB_ONE(p_mgr, buff, buff, ts.iv, ts.expkey, dataSize); + + test_cfb_one_block_free(&ts); + return 0; +} + +static int +test_imb_des_cfb_one_block(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + struct test_cfb_one_block ts; + + if (test_cfb_one_block_alloc(&ts, 0, 0 /* DES */) != 0) + return -1; + + fill_data(ts.iv, 8, buff, dataSize); + fill_data(ts.expkey, IMB_DES_KEY_SCHED_SIZE, buff, dataSize); + + des_cfb_one(buff, buff, ts.iv, ts.expkey, dataSize); + + test_cfb_one_block_free(&ts); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static int +test_imb_set_session(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + IMB_JOB *job = malloc(sizeof(*job)); + + if (job == NULL) + return -1; + fill_data(job, sizeof(*job), buff, dataSize); + + imb_set_session(p_mgr, job); + free(job); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static int +test_imb_self_test_cb_fn(void *cb_arg, const IMB_SELF_TEST_CALLBACK_DATA *data) +{ + (void) cb_arg; + (void) data; + return 0; +} + +static int +test_imb_self_test_set_cb(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + const size_t cb_arg_size = 8; + void *cb_arg = malloc(cb_arg_size); + + if (cb_arg == NULL) + return -1; + + fill_data(cb_arg, cb_arg_size, buff, dataSize); + + imb_self_test_set_cb(p_mgr, test_imb_self_test_cb_fn, cb_arg); + imb_self_test_set_cb(p_mgr, NULL, NULL); + + free(cb_arg); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static int +test_imb_self_test_get_cb(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) buff; + (void) dataSize; + + imb_self_test_cb_t *cb_fn = malloc(sizeof(*cb_fn)); + + if (cb_fn == NULL) + return -1; + + void **cb_arg = malloc(sizeof(*cb_arg)); + + if (cb_arg == NULL) { + free(cb_fn); + return -1; + } + + imb_self_test_get_cb(p_mgr, cb_fn, cb_arg); + + free(cb_fn); + free(cb_arg); + return 0; +} + +/* ========================================================================== */ +/* ========================================================================== */ + +static int +test_imb_get_strerror(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) +{ + (void) p_mgr; + + int *errnum = malloc(sizeof(*errnum)); + + if (errnum == NULL) + return -1; + fill_data(errnum, sizeof(*errnum), buff, dataSize); + + imb_get_strerror(*errnum); + + free(errnum); + return 0; +} +#endif /* __aarch64__ */ + +/* ========================================================================== */ +/* ========================================================================== */ + +struct { + int (*func)(IMB_MGR *mb_mgr, uint8_t *buff, size_t dataSize); + const char *func_name; +} direct_apis[] = { +#ifndef __aarch64__ + { test_imb_aes_keyexp_128, "test_imb_aes_keyexp_128" }, + { test_imb_aes_keyexp_192, "test_imb_aes_keyexp_192" }, + { test_imb_aes_keyexp_256, "test_imb_aes_keyexp_256" }, + { test_imb_aes_subkey_cmac128, "test_imb_aes_subkey_cmac128" }, + { test_imb_aes_subkey_cmac256, "test_imb_aes_subkey_cmac256" }, + { test_imb_aes_keyexp_xcbc128, "test_imb_aes_keyexp_xcbc128" }, + { test_imb_des_keyexp, "test_imb_des_keyexp" }, + { test_imb_sm4_keyexp, "test_imb_sm4_keyexp" }, + + { test_imb_sha1, "test_imb_sha1" }, + { test_imb_sha224, "test_imb_sha224" }, + { test_imb_sha256, "test_imb_sha256" }, + { test_imb_sha384, "test_imb_sha384" }, + { test_imb_sha512, "test_imb_sha512" }, + + { test_imb_sha1_one_block, "test_imb_sha1_one_block" }, + { test_imb_sha224_one_block, "test_imb_sha224_one_block" }, + { test_imb_sha256_one_block, "test_imb_sha256_one_block" }, + { test_imb_sha384_one_block, "test_imb_sha384_one_block" }, + { test_imb_sha512_one_block, "test_imb_sha512_one_block" }, + { test_imb_md5_one_block, "test_imb_md5_one_block" }, + + { test_imb_hmac_ipad_opad, "test_imb_hmac_ipad_opad" }, + + { test_imb_cfb128_one_block, "test_imb_cfb128_one_block" }, + { test_imb_cfb256_one_block, "test_imb_cfb256_one_block" }, + { test_imb_des_cfb_one_block, "test_imb_des_cfb_one_block" }, + +#endif /* __aarch64__ */ + { test_snow3g_init_key_sched, "test_snow3g_init_key_sched" }, + { test_snow3g_f8_1_buff_bit, "test_snow3g_f8_1_buff_bit" }, + { test_snow3g_f8_1_buff, "test_snow3g_f8_1_buff" }, + { test_snow3g_f8_2_buff, "test_snow3g_f8_2_buff" }, + { test_snow3g_f8_4_buff, "test_snow3g_f8_4_buff" }, + { test_snow3g_f8_8_buff, "test_snow3g_f8_8_buff" }, + { test_snow3g_f8_n_buff, "test_snow3g_f8_n_buff" }, + { test_snow3g_f8_8_multikey, "test_snow3g_f8_8_multikey" }, + { test_snow3g_f8_n_multikey, "test_snow3g_f8_n_multikey" }, + { test_snow3g_f8_iv_gen, "test_snow3g_f8_iv_gen" }, + { test_snow3g_f9_1_buff, "test_snow3g_f9_1_buff" }, + { test_snow3g_f9_iv_gen, "test_snow3g_f9_iv_gen" }, +#ifndef __aarch64__ + { test_aes_gcm_pre, "test_aes_gcm_pre" }, + { test_aes_gcm_precomp, "test_aes_gcm_precomp" }, + { test_aes128_gcm_enc_sgl, "test_aes128_gcm_enc_sgl" }, + { test_aes128_gcm_dec_sgl, "test_aes128_gcm_dec_sgl" }, + { test_aes192_gcm_enc_sgl, "test_aes192_gcm_enc_sgl" }, + { test_aes192_gcm_dec_sgl, "test_aes192_gcm_dec_sgl" }, + { test_aes256_gcm_enc_sgl, "test_aes256_gcm_enc_sgl" }, + { test_aes256_gcm_dec_sgl, "test_aes256_gcm_dec_sgl" }, + { test_aes128_gcm_enc, "test_aes128_gcm_enc" }, + { test_aes128_gcm_dec, "test_aes128_gcm_dec" }, + { test_aes192_gcm_enc, "test_aes192_gcm_enc" }, + { test_aes192_gcm_dec, "test_aes192_gcm_dec" }, + { test_aes256_gcm_enc, "test_aes256_gcm_enc" }, + { test_aes256_gcm_dec, "test_aes256_gcm_dec" }, + { test_aes128_gcm_init_var_iv, "test_aes128_gcm_init_var_iv" }, + { test_aes192_gcm_init_var_iv, "test_aes192_gcm_init_var_iv" }, + { test_aes256_gcm_init_var_iv, "test_aes256_gcm_init_var_iv" }, + + { test_aes128_gmac, "test_aes128_gmac" }, + { test_aes192_gmac, "test_aes192_gmac" }, + { test_aes256_gmac, "test_aes256_gmac" }, + + { test_ghash, "test_ghash" }, + { test_ghash_pre, "test_ghash_pre" }, +#endif /* __aarch64__ */ + { test_zuc_eea3_1_buff, "test_zuc_eea3_1_buff" }, + { test_zuc_eea3_4_buff, "test_zuc_eea3_4_buff" }, + { test_zuc_eea3_n_buff, "test_zuc_eea3_n_buff" }, + { test_zuc_eea3_iv_gen, "test_zuc_eea3_iv_gen" }, + { test_zuc_eia3_1_buff, "test_zuc_eia3_1_buff" }, + { test_zuc_eia3_n_buff, "test_zuc_eia3_n_buff" }, + { test_zuc_eia3_iv_gen, "test_zuc_eia3_iv_gen" }, +#ifndef __aarch64__ + { test_chacha_poly_enc, "test_chacha_poly_enc" }, + { test_chacha_poly_dec, "test_chacha_poly_dec" }, + + { test_crc32_ethernet_fcs, "test_crc32_ethernet_fcs" }, + { test_crc16_x25, "test_crc16_x25" }, + { test_crc32_sctp, "test_crc32_sctp" }, + { test_crc16_fp_data, "test_crc16_fp_data" }, + { test_crc11_fp_header, "test_crc11_fp_header" }, + { test_crc24_lte_a, "test_crc24_lte_a" }, + { test_crc24_lte_b, "test_crc24_lte_b" }, + { test_crc7_fp_header, "test_crc7_fp_header" }, + { test_crc10_iuup_data, "test_crc10_iuup_data" }, + { test_crc6_iuup_header, "test_crc6_iuup_header" }, + { test_crc32_wimax_ofdma_data, "test_crc32_wimax_ofdma_data" }, + { test_crc8_wimax_ofdma_hcs, "test_crc8_wimax_ofdma_hcs" }, + + { test_kasumi_f8_init_key_sched, "test_kasumi_f8_init_key_sched" }, + { test_kasumi_f8_1_buff_bit, "test_kasumi_f8_1_buff_bit" }, + { test_kasumi_f8_1_buff, "test_kasumi_f8_1_buff" }, + { test_kasumi_f8_2_buff, "test_kasumi_f8_2_buff" }, + { test_kasumi_f8_3_buff, "test_kasumi_f8_3_buff" }, + { test_kasumi_f8_4_buff, "test_kasumi_f8_4_buff" }, + { test_kasumi_f8_n_buff, "test_kasumi_f8_n_buff" }, + { test_kasumi_f8_iv_gen, "test_kasumi_f8_iv_gen" }, + { test_kasumi_f9_1_buff, "test_kasumi_f9_1_buff" }, + { test_kasumi_f9_1_buff_user, "test_kasumi_f9_1_buff_user" }, + { test_kasumi_f9_init_key_sched, "test_kasumi_f9_init_key_sched" }, + { test_kasumi_f9_iv_gen, "test_kasumi_f9_iv_gen" }, + + { test_imb_clear_mem, "test_imb_clear_mem" }, + + { test_imb_quic_aes_gcm, "test_imb_quic_aes_gcm" }, + { test_imb_quic_chacha20_poly1305, "test_imb_quic_chacha20_poly1305" }, + { test_imb_quic_hp_aes_ecb, "test_imb_quic_hp_aes_ecb" }, + { test_imb_quic_hp_chacha20, "test_imb_quic_hp_chacha20" }, + + { test_imb_set_session, "test_imb_set_session" }, + { test_imb_self_test_set_cb, "test_imb_self_test_set_cb" }, + { test_imb_self_test_get_cb, "test_imb_self_test_get_cb" }, + { test_imb_get_strerror, "test_imb_get_strerror" }, + + { test_imb_hec32, "test_imb_hec32" }, + { test_imb_hec64, "test_imb_hec64" }, #endif /* __aarch64__ */ }; -- GitLab From 7163a820ec07f561b911e4526b2d784faa96f831 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Fri, 20 Oct 2023 15:40:51 +0100 Subject: [PATCH 164/204] test: [fuzz-app] add gfni-off and shani-off options --- test/fuzz-app/direct_api_fuzz_test.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/fuzz-app/direct_api_fuzz_test.c b/test/fuzz-app/direct_api_fuzz_test.c index 86bbab35..35628b78 100644 --- a/test/fuzz-app/direct_api_fuzz_test.c +++ b/test/fuzz-app/direct_api_fuzz_test.c @@ -43,26 +43,31 @@ int LLVMFuzzerInitialize(int *, char ***); IMB_ARCH arch = IMB_ARCH_NONE; +uint64_t flags = 0; static void parse_matched(int argc, char **argv) { for (int i = 0; i < argc; i++) { #ifndef __aarch64__ - if (strcmp(argv[i], "SSE") == 0) + if (strcasecmp(argv[i], "SSE") == 0) arch = IMB_ARCH_SSE; - else if (strcmp(argv[i], "AVX") == 0) + else if (strcasecmp(argv[i], "AVX") == 0) arch = IMB_ARCH_AVX; - else if (strcmp(argv[i], "AVX2") == 0) + else if (strcasecmp(argv[i], "AVX2") == 0) arch = IMB_ARCH_AVX2; - else if (strcmp(argv[i], "AVX512") == 0) + else if (strcasecmp(argv[i], "AVX512") == 0) arch = IMB_ARCH_AVX512; #else - if (strcmp(argv[i], "AARCH64") == 0) + if (strcasecmp(argv[i], "AARCH64") == 0) arch = IMB_ARCH_AARCH64; - else if (strcmp(argv[i], "SVE256") == 0) + else if (strcasecmp(argv[i], "SVE256") == 0) arch = IMB_ARCH_SVE256; #endif + else if (strcasecmp(argv[i], "SHANI-OFF") == 0) + flags |= IMB_FLAG_SHANI_OFF; + else if (strcasecmp(argv[i], "GFNI-OFF") == 0) + flags |= IMB_FLAG_GFNI_OFF; } } @@ -74,7 +79,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) * Check if the current argument matches the * argument we are looking for. */ - if (strcmp((*argv)[i], "custom") == 0) { + if (strcasecmp((*argv)[i], "custom") == 0) { parse_matched(*argc - (i + 1), &((*argv)[i + 1])); /* * Remove the matching argument and all arguments @@ -2525,7 +2530,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) /* allocate multi-buffer manager */ if (p_mgr == NULL) { - p_mgr = alloc_mb_mgr(0); + p_mgr = alloc_mb_mgr(flags); if (p_mgr == NULL) { printf("Error allocating MB_MGR structure!\n"); free(buff); -- GitLab From eb3f3df571a786065d6fb960ff25752f902e13fc Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 24 Oct 2023 11:39:16 +0100 Subject: [PATCH 165/204] avx2: [GCM] use non-VAES GCM implementation on Type 3 --- README.md | 3 +- lib/avx2_t3/mb_mgr_avx2_t3.c | 98 ++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 8e2b2176..3d85d8eb 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,8 @@ Notes: (8) - decryption is by16 and encryption is x16 (9) - currently 1:9 crypt:skip pattern supported (10) - by default, decryption and encryption are AVX by8. - On CPUs supporting VAES, decryption and encryption are AVX2-VAES by16. + On CPUs supporting VAES, decryption and encryption might use AVX2-VAES by16, + if beneficial. Legend: ` byY` - single buffer Y blocks at a time diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index 54f2f623..f588ca18 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -86,12 +86,12 @@ #define SUBMIT_JOB_CIPHER_DEC SUBMIT_JOB_CIPHER_DEC_AVX2 /* AES-GCM */ -#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_vaes_avx2 -#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_vaes_avx2 -#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_vaes_avx2 -#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_vaes_avx2 -#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_vaes_avx2 -#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_vaes_avx2 +#define AES_GCM_DEC_IV_128 aes_gcm_dec_var_iv_128_avx_gen4 +#define AES_GCM_ENC_IV_128 aes_gcm_enc_var_iv_128_avx_gen4 +#define AES_GCM_DEC_IV_192 aes_gcm_dec_var_iv_192_avx_gen4 +#define AES_GCM_ENC_IV_192 aes_gcm_enc_var_iv_192_avx_gen4 +#define AES_GCM_DEC_IV_256 aes_gcm_dec_var_iv_256_avx_gen4 +#define AES_GCM_ENC_IV_256 aes_gcm_enc_var_iv_256_avx_gen4 #define SUBMIT_JOB_AES_GCM_DEC submit_job_gcm_dec_avx2 #define SUBMIT_JOB_AES_GCM_ENC submit_job_gcm_enc_avx2 @@ -447,49 +447,49 @@ init_mb_mgr_avx2_t3_internal(IMB_MGR *state, const int reset_mgrs) state->chacha20_poly1305_finalize = finalize_chacha20_poly1305_fma_avx2; #endif - state->gcm128_enc = aes_gcm_enc_128_vaes_avx2; - state->gcm192_enc = aes_gcm_enc_192_vaes_avx2; - state->gcm256_enc = aes_gcm_enc_256_vaes_avx2; - state->gcm128_dec = aes_gcm_dec_128_vaes_avx2; - state->gcm192_dec = aes_gcm_dec_192_vaes_avx2; - state->gcm256_dec = aes_gcm_dec_256_vaes_avx2; - state->gcm128_init = aes_gcm_init_128_vaes_avx2; - state->gcm192_init = aes_gcm_init_192_vaes_avx2; - state->gcm256_init = aes_gcm_init_256_vaes_avx2; - state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_vaes_avx2; - state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_vaes_avx2; - state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_vaes_avx2; - state->gcm128_enc_update = aes_gcm_enc_128_update_vaes_avx2; - state->gcm192_enc_update = aes_gcm_enc_192_update_vaes_avx2; - state->gcm256_enc_update = aes_gcm_enc_256_update_vaes_avx2; - state->gcm128_dec_update = aes_gcm_dec_128_update_vaes_avx2; - state->gcm192_dec_update = aes_gcm_dec_192_update_vaes_avx2; - state->gcm256_dec_update = aes_gcm_dec_256_update_vaes_avx2; - state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_vaes_avx2; - state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_vaes_avx2; - state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_vaes_avx2; - state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_vaes_avx2; - state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_vaes_avx2; - state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_vaes_avx2; - state->gcm128_precomp = aes_gcm_precomp_128_vaes_avx2; - state->gcm192_precomp = aes_gcm_precomp_192_vaes_avx2; - state->gcm256_precomp = aes_gcm_precomp_256_vaes_avx2; - state->gcm128_pre = aes_gcm_pre_128_vaes_avx2; - state->gcm192_pre = aes_gcm_pre_192_vaes_avx2; - state->gcm256_pre = aes_gcm_pre_256_vaes_avx2; - - state->ghash = ghash_vaes_avx2; - state->ghash_pre = ghash_pre_vaes_avx2; - - state->gmac128_init = imb_aes_gmac_init_128_vaes_avx2; - state->gmac192_init = imb_aes_gmac_init_192_vaes_avx2; - state->gmac256_init = imb_aes_gmac_init_256_vaes_avx2; - state->gmac128_update = imb_aes_gmac_update_128_vaes_avx2; - state->gmac192_update = imb_aes_gmac_update_192_vaes_avx2; - state->gmac256_update = imb_aes_gmac_update_256_vaes_avx2; - state->gmac128_finalize = imb_aes_gmac_finalize_128_vaes_avx2; - state->gmac192_finalize = imb_aes_gmac_finalize_192_vaes_avx2; - state->gmac256_finalize = imb_aes_gmac_finalize_256_vaes_avx2; + state->gcm128_enc = aes_gcm_enc_128_avx_gen4; + state->gcm192_enc = aes_gcm_enc_192_avx_gen4; + state->gcm256_enc = aes_gcm_enc_256_avx_gen4; + state->gcm128_dec = aes_gcm_dec_128_avx_gen4; + state->gcm192_dec = aes_gcm_dec_192_avx_gen4; + state->gcm256_dec = aes_gcm_dec_256_avx_gen4; + state->gcm128_init = aes_gcm_init_128_avx_gen4; + state->gcm192_init = aes_gcm_init_192_avx_gen4; + state->gcm256_init = aes_gcm_init_256_avx_gen4; + state->gcm128_init_var_iv = aes_gcm_init_var_iv_128_avx_gen4; + state->gcm192_init_var_iv = aes_gcm_init_var_iv_192_avx_gen4; + state->gcm256_init_var_iv = aes_gcm_init_var_iv_256_avx_gen4; + state->gcm128_enc_update = aes_gcm_enc_128_update_avx_gen4; + state->gcm192_enc_update = aes_gcm_enc_192_update_avx_gen4; + state->gcm256_enc_update = aes_gcm_enc_256_update_avx_gen4; + state->gcm128_dec_update = aes_gcm_dec_128_update_avx_gen4; + state->gcm192_dec_update = aes_gcm_dec_192_update_avx_gen4; + state->gcm256_dec_update = aes_gcm_dec_256_update_avx_gen4; + state->gcm128_enc_finalize = aes_gcm_enc_128_finalize_avx_gen4; + state->gcm192_enc_finalize = aes_gcm_enc_192_finalize_avx_gen4; + state->gcm256_enc_finalize = aes_gcm_enc_256_finalize_avx_gen4; + state->gcm128_dec_finalize = aes_gcm_dec_128_finalize_avx_gen4; + state->gcm192_dec_finalize = aes_gcm_dec_192_finalize_avx_gen4; + state->gcm256_dec_finalize = aes_gcm_dec_256_finalize_avx_gen4; + state->gcm128_precomp = aes_gcm_precomp_128_avx_gen4; + state->gcm192_precomp = aes_gcm_precomp_192_avx_gen4; + state->gcm256_precomp = aes_gcm_precomp_256_avx_gen4; + state->gcm128_pre = aes_gcm_pre_128_avx_gen4; + state->gcm192_pre = aes_gcm_pre_192_avx_gen4; + state->gcm256_pre = aes_gcm_pre_256_avx_gen4; + + state->ghash = ghash_avx_gen4; + state->ghash_pre = ghash_pre_avx_gen4; + + state->gmac128_init = imb_aes_gmac_init_128_avx_gen4; + state->gmac192_init = imb_aes_gmac_init_192_avx_gen4; + state->gmac256_init = imb_aes_gmac_init_256_avx_gen4; + state->gmac128_update = imb_aes_gmac_update_128_avx_gen4; + state->gmac192_update = imb_aes_gmac_update_192_avx_gen4; + state->gmac256_update = imb_aes_gmac_update_256_avx_gen4; + state->gmac128_finalize = imb_aes_gmac_finalize_128_avx_gen4; + state->gmac192_finalize = imb_aes_gmac_finalize_192_avx_gen4; + state->gmac256_finalize = imb_aes_gmac_finalize_256_avx_gen4; state->aes_ecb_128_quic = aes_ecb_quic_enc_128_avx; state->aes_ecb_256_quic = aes_ecb_quic_enc_256_avx; -- GitLab From 72a884b66ada8a337f095054da7f943e512e4e84 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 24 Oct 2023 11:41:15 +0100 Subject: [PATCH 166/204] avx2: [SHA1] use SHA1-NI implementation on Type 3 --- README.md | 12 ++++++------ lib/avx2_t3/mb_mgr_avx2_t3.c | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3d85d8eb..306064bf 100644 --- a/README.md +++ b/README.md @@ -128,14 +128,14 @@ Table 2. List of supported integrity algorithms and their implementations. |-------------------+--------+--------+--------+--------+--------+--------|---------| | AES-XCBC-96 | N | Y x4 | Y x8 | N | N | Y x16 | N | | HMAC-MD5-96 | Y(1) | Y x4x2 | Y x4x2 | Y x8x2 | N | N | N | -| HMAC-SHA1-96 | N | Y(2)x4 | Y x4 | Y x8 | Y x16 | N | N | -| HMAC-SHA2-224_112 | N | Y(2)x4 | Y x4 | Y x8 | Y x16 | N | N | -| HMAC-SHA2-256_128 | N | Y(2)x4 | Y x4 | Y x8 | Y x16 | N | N | +| HMAC-SHA1-96 | N | Y(2)x4 | Y(2)x4 | Y(2)x8 | Y x16 | N | N | +| HMAC-SHA2-224_112 | N | Y(2)x4 | Y(2)x4 | Y(2)x8 | Y x16 | N | N | +| HMAC-SHA2-256_128 | N | Y(2)x4 | Y(2)x4 | Y(2)x8 | Y x16 | N | N | | HMAC-SHA2-384_192 | N | Y x2 | Y x2 | Y x4 | Y x8 | N | N | | HMAC-SHA2-512_256 | N | Y x2 | Y x2 | Y x4 | Y x8 | N | N | -| SHA1 | N | Y(2)x4 | Y x4 | Y x8 | Y x16 | N | N | -| SHA2-224 | N | Y(2)x4 | Y x4 | Y x8 | Y x16 | N | N | -| SHA2-256 | N | Y(2)x4 | Y x4 | Y x8 | Y x16 | N | N | +| SHA1 | N | Y(2)x4 | Y(2)x4 | Y(2)x8 | Y x16 | N | N | +| SHA2-224 | N | Y(2)x4 | Y(2)x4 | Y(2)x8 | Y x16 | N | N | +| SHA2-256 | N | Y(2)x4 | Y(2)x4 | Y(2)x8 | Y x16 | N | N | | SHA2-384 | N | Y x2 | Y x2 | Y x4 | Y x8 | N | N | | SHA2-512 | N | Y x2 | Y x2 | Y x4 | Y x8 | N | N | | AES128-GMAC | N | Y by8 | N | Y by8 | Y by8 | Y by32 | N | diff --git a/lib/avx2_t3/mb_mgr_avx2_t3.c b/lib/avx2_t3/mb_mgr_avx2_t3.c index f588ca18..3e200dd1 100644 --- a/lib/avx2_t3/mb_mgr_avx2_t3.c +++ b/lib/avx2_t3/mb_mgr_avx2_t3.c @@ -174,9 +174,8 @@ #define SUBMIT_JOB_PON_DEC_NO_CTR submit_job_pon_dec_no_ctr_avx /* SHA1/224/256/384/512 */ -/* note: SHA1 MB is better than SHANI on Xeon processors */ -#define SUBMIT_JOB_SHA1 submit_job_sha1_avx2 -#define FLUSH_JOB_SHA1 flush_job_sha1_avx2 +#define SUBMIT_JOB_SHA1 submit_job_sha1_ni_sse +#define FLUSH_JOB_SHA1 flush_job_sha1_ni_sse #define SUBMIT_JOB_SHA224 submit_job_sha224_ni_sse #define FLUSH_JOB_SHA224 flush_job_sha224_ni_sse #define SUBMIT_JOB_SHA256 submit_job_sha256_ni_sse @@ -187,8 +186,8 @@ #define FLUSH_JOB_SHA512 flush_job_sha512_avx2 /* HMAC-SHA1/224/256/384/512 */ -#define SUBMIT_JOB_HMAC submit_job_hmac_avx2 -#define FLUSH_JOB_HMAC flush_job_hmac_avx2 +#define SUBMIT_JOB_HMAC submit_job_hmac_ni_sse +#define FLUSH_JOB_HMAC flush_job_hmac_ni_sse #define SUBMIT_JOB_HMAC_SHA_224 submit_job_hmac_sha_224_ni_sse #define FLUSH_JOB_HMAC_SHA_224 flush_job_hmac_sha_224_ni_sse #define SUBMIT_JOB_HMAC_SHA_256 submit_job_hmac_sha_256_ni_sse @@ -279,7 +278,7 @@ reset_ooo_mgrs(IMB_MGR *state) ooo_mgr_zuc_reset(state->zuc256_eia3_16B_ooo, 8); /* Init HMAC/SHA1 out-of-order fields */ - ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, AVX2_NUM_SHA1_LANES); + ooo_mgr_hmac_sha1_reset(state->hmac_sha_1_ooo, 2); /* Init HMAC/SHA224 out-of-order fields */ ooo_mgr_hmac_sha224_reset(state->hmac_sha_224_ooo, 2); -- GitLab From 80572fa90a91bfa38722be7680cd0ba543100c24 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 23 Oct 2023 14:01:35 +0100 Subject: [PATCH 167/204] test: [kat-app] split zuc into cipher and auth modules --- test/kat-app/Makefile | 4 +- test/kat-app/main.c | 7 +- test/kat-app/win_x64.mak | 2 +- test/kat-app/zuc_eea3_test.c | 916 +++++++++++++++++++ test/kat-app/{zuc_test.c => zuc_eia3_test.c} | 687 +------------- 5 files changed, 937 insertions(+), 679 deletions(-) create mode 100644 test/kat-app/zuc_eea3_test.c rename test/kat-app/{zuc_test.c => zuc_eia3_test.c} (59%) diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 9f8cc11c..fb352ba0 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -35,7 +35,7 @@ ifneq ($(ARCH),aarch64) SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ cmac_test.c hmac_sha1_test.c hmac_sha256_sha512_test.c \ hmac_md5_test.c aes_test.c sha_test.c chained_test.c api_test.c pon_test.c \ - ecb_test.c zuc_test.c kasumi_test.c snow3g_test.c direct_api_test.c clear_mem_test.c \ + ecb_test.c zuc_eea3_test.c zuc_eia3_test.c kasumi_test.c snow3g_test.c direct_api_test.c clear_mem_test.c \ hec_test.c xcbc_test.c aes_cbcs_test.c crc_test.c chacha_test.c poly1305_test.c \ chacha20_poly1305_test.c null_test.c snow_v_test.c direct_api_param_test.c quic_ecb_test.c \ hmac_sha1.json.c hmac_sha224.json.c hmac_sha256.json.c hmac_sha384.json.c hmac_sha512.json.c \ @@ -47,7 +47,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c else # aarch64 -SOURCES := main.c api_test.c zuc_test.c snow3g_test.c direct_api_test.c \ +SOURCES := main.c api_test.c zuc_eea3_test.c zuc_eia3_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ zuc_eia3_128.json.c zuc_eia3_256.json.c endif # aarch64 diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 327719bb..2db7af78 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -60,7 +60,9 @@ api_test(struct IMB_MGR *mb_mgr); extern int pon_test(struct IMB_MGR *mb_mgr); extern int -zuc_test(struct IMB_MGR *mb_mgr); +zuc_eea3_test(struct IMB_MGR *mb_mgr); +extern int +zuc_eia3_test(struct IMB_MGR *mb_mgr); extern int kasumi_test(struct IMB_MGR *mb_mgr); extern int @@ -143,7 +145,8 @@ struct imb_test tests[] = { { .str = "CCM", .fn = ccm_test, .enabled = 1 }, { .str = "CMAC", .fn = cmac_test, .enabled = 1 }, #endif /* __aarch64__ */ - { .str = "ZUC", .fn = zuc_test, .enabled = 1 }, + { .str = "ZUC_EEA3", .fn = zuc_eea3_test, .enabled = 1 }, + { .str = "ZUC_EIA3", .fn = zuc_eia3_test, .enabled = 1 }, #ifndef __aarch64__ { .str = "KASUMI", .fn = kasumi_test, .enabled = 1 }, #endif /* __aarch64__ */ diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index f556c82f..fc4c5865 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep diff --git a/test/kat-app/zuc_eea3_test.c b/test/kat-app/zuc_eea3_test.c new file mode 100644 index 00000000..4a23c2ef --- /dev/null +++ b/test/kat-app/zuc_eea3_test.c @@ -0,0 +1,916 @@ +/***************************************************************************** + Copyright (c) 2009-2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/*----------------------------------------------------------------------- + * Zuc functional test + *----------------------------------------------------------------------- + * + * A simple functional test for ZUC + * + *-----------------------------------------------------------------------*/ + +#include +#include +#include +#include + +#include + +#include "zuc_test_vectors.h" +#include "gcm_ctr_vectors_test.h" +#include "utils.h" + +#define MAXBUFS 17 +#define PASS_STATUS 0 +#define FAIL_STATUS -1 +#define DIM(_x) (sizeof(_x) / sizeof(_x[0])) + +#define MAX_BURST_JOBS 32 + +enum api_type { TEST_DIRECT_API, TEST_SINGLE_JOB_API, TEST_BURST_JOB_API }; + +int +zuc_eea3_test(struct IMB_MGR *mb_mgr); + +struct zuc_eea3_128_params { + const uint32_t *count; + const uint8_t *bearer; + const uint8_t *direction; +}; + +int +validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, + uint8_t *pIV); +int +validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type); +int +validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, enum api_type type); +int +validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, + const enum api_type type); +#ifdef __aarch64__ +int +validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type); +#endif +int +validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); +static void +byte_hexdump(const char *message, const uint8_t *ptr, int len); + +/****************************************************************************** + * @ingroup zuc_functionalTest_app + * + * @description + * This function allocates memory for buffers and set random data in each buffer + * + * pSrcData = pointers to the new source buffers + * numOfBuffs = number of buffers + * ************************************************/ +static uint32_t +createData(uint8_t *pSrcData[MAXBUFS], uint32_t numOfBuffs) +{ + uint32_t i = 0; + + for (i = 0; i < numOfBuffs; i++) { + pSrcData[i] = (uint8_t *) malloc(MAX_BUFFER_LENGTH_IN_BYTES); + + if (!pSrcData[i]) { + uint32_t j; + + printf("malloc(pSrcData[i]): failed!\n"); + + for (j = 0; j < i; j++) { + free(pSrcData[j]); + pSrcData[j] = NULL; + } + + return FAIL_STATUS; + } + } + return PASS_STATUS; +} + +/****************************************************************************** + * @ingroup zuc_functionalTest_app + * + * @description + * This function creates source data and vector buffers. + * + * keyLen = key length + * pKeys = array of pointers to the new key buffers + * ivLen = vector length + * pIV = array of pointers to the new vector buffers + * numOfBuffs = number of buffers + ************************************************/ +static uint32_t +createKeyVecData(uint32_t keyLen, uint8_t *pKeys[MAXBUFS], uint32_t ivLen, uint8_t *pIV[MAXBUFS], + uint32_t numOfBuffs) +{ + uint32_t i = 0; + + for (i = 0; i < numOfBuffs; i++) { + uint32_t j; + + pIV[i] = (uint8_t *) malloc(ivLen); + + if (!pIV[i]) { + printf("malloc(pIV[i]): failed!\n"); + + for (j = 0; j < i; j++) { + free(pIV[j]); + free(pKeys[j]); + } + + return FAIL_STATUS; + } + + pKeys[i] = malloc(keyLen); + + if (!pKeys[i]) { + printf("malloc(pKeys[i]): failed!\n"); + + for (j = 0; j <= i; j++) { + free(pIV[j]); + + if (j < i) + free(pKeys[j]); + } + return FAIL_STATUS; + } + } + + return PASS_STATUS; +} + +/****************************************************************************** + * @ingroup zuc_benchmark_app + * + * @description + * This function free memory pointed to by an array of pointers + * + * arr = array of memory pointers + * length = length of pointer array (or number of pointers whose buffers + * should be freed) + * ************************************************/ +static void +freePtrArray(uint8_t *pArr[MAXBUFS], uint32_t arrayLength) +{ + uint32_t i = 0; + + for (i = 0; i < arrayLength; i++) + free(pArr[i]); +} + +static uint32_t +bswap4(const uint32_t val) +{ + return ((val >> 24) | /**< A*/ + ((val & 0xff0000) >> 8) | /**< B*/ + ((val & 0xff00) << 8) | /**< C*/ + (val << 24)); /**< D*/ +} + +int +zuc_eea3_test(struct IMB_MGR *mb_mgr) +{ + + const uint32_t numBuffs[] = { 4, 8, 9, 16, 17 }; + uint32_t i; + int errors = 0; + uint8_t *pKeys[MAXBUFS] = { 0 }; + uint8_t *pIV[MAXBUFS] = { 0 }; + uint8_t *pSrcData[MAXBUFS] = { 0 }; + uint8_t *pDstData[MAXBUFS] = { 0 }; + struct test_suite_context eea3_ctx; + struct test_suite_context eea3_256_ctx; + + test_suite_start(&eea3_ctx, "ZUC-EEA3"); + test_suite_start(&eea3_256_ctx, "ZUC-EEA3-256"); + + /*Create test data buffers + populate with random data*/ + if (createData(pSrcData, MAXBUFS)) { + printf("createData() error\n"); + test_suite_update(&eea3_ctx, 0, 1); + goto exit_zuc_eea3_test; + } + if (createData(pDstData, MAXBUFS)) { + printf("createData() error\n"); + freePtrArray(pSrcData, MAXBUFS); + test_suite_update(&eea3_ctx, 0, 1); + goto exit_zuc_eea3_test; + } + + /* Create random keys and vectors */ + if (createKeyVecData(IMB_ZUC256_KEY_LEN_IN_BYTES, pKeys, IMB_ZUC256_IV_LEN_IN_BYTES_MAX, + pIV, MAXBUFS)) { + printf("createKeyVecData() error\n"); + freePtrArray(pSrcData, MAXBUFS); + freePtrArray(pDstData, MAXBUFS); + test_suite_update(&eea3_ctx, 0, 1); + goto exit_zuc_eea3_test; + } + + if (validate_zuc_algorithm(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0])) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + + /* Direct API tests */ + if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0], + TEST_DIRECT_API)) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + + if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, TEST_DIRECT_API)) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + + for (i = 0; i < DIM(numBuffs); i++) { + if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_DIRECT_API)) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + } + +#ifdef __aarch64__ + if (validate_zuc256_EEA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], + pIV[0], TEST_DIRECT_API)) + test_suite_update(&eea3_256_ctx, 0, 1); + else + test_suite_update(&eea3_256_ctx, 1, 0); + + for (i = 0; i < DIM(numBuffs); i++) { + if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, + pIV, numBuffs[i], TEST_DIRECT_API)) + test_suite_update(&eea3_256_ctx, 0, 1); + else + test_suite_update(&eea3_256_ctx, 1, 0); + } +#endif + + /* Job API tests */ + if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0], + TEST_SINGLE_JOB_API)) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + + if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, TEST_SINGLE_JOB_API)) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + + for (i = 0; i < DIM(numBuffs); i++) { + if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_SINGLE_JOB_API)) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + } + + for (i = 0; i < DIM(numBuffs); i++) { + if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_SINGLE_JOB_API)) + test_suite_update(&eea3_256_ctx, 0, 1); + else + test_suite_update(&eea3_256_ctx, 1, 0); + } + + +#ifdef __aarch64__ + if (validate_zuc256_EEA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], + pIV[0], TEST_SINGLE_JOB_API)) + test_suite_update(&eea3_256_ctx, 0, 1); + else + test_suite_update(&eea3_256_ctx, 1, 0); +#endif + + /* Burst job API tests */ + for (i = 0; i < DIM(numBuffs); i++) { + if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_BURST_JOB_API)) + test_suite_update(&eea3_ctx, 0, 1); + else + test_suite_update(&eea3_ctx, 1, 0); + } + + for (i = 0; i < DIM(numBuffs); i++) { + if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], + TEST_BURST_JOB_API)) + test_suite_update(&eea3_256_ctx, 0, 1); + else + test_suite_update(&eea3_256_ctx, 1, 0); + } + +exit_zuc_eea3_test: + freePtrArray(pKeys, MAXBUFS); /*Free the key buffers*/ + freePtrArray(pIV, MAXBUFS); /*Free the vector buffers*/ + freePtrArray(pSrcData, MAXBUFS); /*Free the source buffers*/ + freePtrArray(pDstData, MAXBUFS); /*Free the destination buffers*/ + + errors += test_suite_end(&eea3_ctx); + errors += test_suite_end(&eea3_256_ctx); + + return errors; +} + +static inline int +submit_burst_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const ivs, + uint8_t **const src, uint8_t **const dst, const uint32_t *lens, int dir, + const unsigned int num_jobs, const unsigned int key_len, + const unsigned int *iv_lens) +{ + IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; + unsigned int i; + unsigned int jobs_rx = 0; + uint32_t completed_jobs = 0; + int err; + + while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < num_jobs) + IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); + + for (i = 0; i < num_jobs; i++) { + job = jobs[i]; + job->cipher_direction = dir; + job->chain_order = IMB_ORDER_CIPHER_HASH; + job->cipher_mode = IMB_CIPHER_ZUC_EEA3; + job->src = src[i]; + job->dst = dst[i]; + job->iv = ivs[i]; + job->iv_len_in_bytes = iv_lens[i]; + job->enc_keys = keys[i]; + job->key_len_in_bytes = key_len; + + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = lens[i]; + job->hash_alg = IMB_AUTH_NULL; + + imb_set_session(mb_mgr, job); + } + + completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, jobs); + err = imb_get_errno(mb_mgr); + + if (err != 0) { + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); + return -1; + } + +check_eea3_burst_jobs: + for (i = 0; i < completed_jobs; i++) { + job = jobs[i]; + + if (job->status != IMB_STATUS_COMPLETED) { + printf("job %u status not complete!\n", i + 1); + return -1; + } + + jobs_rx++; + } + + if (jobs_rx != num_jobs) { + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); + if (completed_jobs == 0) { + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); + return -1; + } + goto check_eea3_burst_jobs; + } + + return 0; +} + +static inline int +submit_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const ivs, + uint8_t **const src, uint8_t **const dst, const uint32_t *lens, int dir, + const unsigned int num_jobs, const unsigned int key_len, + const unsigned int *iv_lens) +{ + IMB_JOB *job; + unsigned int i; + unsigned int jobs_rx = 0; + + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(mb_mgr); + job->cipher_direction = dir; + job->chain_order = IMB_ORDER_CIPHER_HASH; + job->cipher_mode = IMB_CIPHER_ZUC_EEA3; + job->src = src[i]; + job->dst = dst[i]; + job->iv = ivs[i]; + job->iv_len_in_bytes = iv_lens[i]; + job->enc_keys = keys[i]; + job->key_len_in_bytes = key_len; + + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = lens[i]; + job->hash_alg = IMB_AUTH_NULL; + + job = IMB_SUBMIT_JOB(mb_mgr); + if (job != NULL) { + jobs_rx++; + if (job->status != IMB_STATUS_COMPLETED) { + printf("%d error status:%d, job %u", __LINE__, job->status, i); + return -1; + } + } + } + + while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { + jobs_rx++; + if (job->status != IMB_STATUS_COMPLETED) { + printf("%d error status:%d, job %u", __LINE__, job->status, i); + return -1; + } + } + + if (jobs_rx != num_jobs) { + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); + return -1; + } + + return 0; +} + +static int +test_output(const uint8_t *out, const uint8_t *ref, const uint32_t bytelen, const uint32_t bitlen, + const char *err_msg) +{ + int ret = 0; + uint32_t byteResidue; + uint32_t bitResidue; + + if (bitlen % 8) + /* Last byte is not a full byte */ + ret = memcmp(out, ref, bytelen - 1); + else + /* Last byte is a full byte */ + ret = memcmp(out, ref, bytelen); + + if (ret) { + printf("%s : FAIL\n", err_msg); + byte_hexdump("Expected", ref, bytelen); + byte_hexdump("Found", out, bytelen); + ret = -1; + /* + * Check last partial byte if there is one and + * all previous full bytes are correct + */ + } else if (bitlen % 8) { + bitResidue = (0xFF00 >> (bitlen % 8)) & 0x00FF; + byteResidue = (ref[bitlen / 8] ^ out[bitlen / 8]) & bitResidue; + if (byteResidue) { + printf("%s : FAIL\n", err_msg); + printf("Expected: 0x%02X (last byte)\n", 0xFF & ref[bitlen / 8]); + printf("Found: 0x%02X (last byte)\n", 0xFF & out[bitlen / 8]); + ret = -1; + } +#ifdef DEBUG + else { + if (!quiet_mode) + printf("%s : PASS\n", err_msg); + } +#endif + } +#ifdef DEBUG + else { + if (!quiet_mode) + printf("%s : PASS\n", err_msg); + } +#endif + fflush(stdout); + + return ret; +} + +int +validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, + uint8_t *pKeys, uint8_t *pIV, const enum api_type type) +{ + uint32_t i; + int ret = 0; + + /* ZUC-128-EEA3 */ + for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { + char msg[50]; + int retTmp; + uint32_t byteLength; + const unsigned int iv_len = IMB_ZUC_IV_LEN_IN_BYTES; + + memcpy(pKeys, testEEA3_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); + zuc_eea3_iv_gen(testEEA3_vectors[i].count, testEEA3_vectors[i].Bearer, + testEEA3_vectors[i].Direction, pIV); + byteLength = (testEEA3_vectors[i].length_in_bits + 7) / 8; + memcpy(pSrcData, testEEA3_vectors[i].plaintext, byteLength); + if (type == TEST_SINGLE_JOB_API) + submit_eea3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &byteLength, + IMB_DIR_ENCRYPT, 1, IMB_ZUC_KEY_LEN_IN_BYTES, &iv_len); + else + IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, byteLength); + + snprintf(msg, sizeof(msg), "Validate ZUC 1 block test %u (Enc):", i + 1); + retTmp = test_output(pDstData, testEEA3_vectors[i].ciphertext, byteLength, + testEEA3_vectors[i].length_in_bits, msg); + if (retTmp < 0) + ret = retTmp; + } + + return ret; +}; + +static int +submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, + uint8_t **pIV, const enum api_type type, IMB_CIPHER_DIRECTION dir, + const unsigned int var_bufs, const unsigned int num_buffers, + const uint32_t *buf_idx) +{ + unsigned int i; + uint32_t packetLen[MAXBUFS]; + int ret = 0; + const struct test128EEA3_vectors_t *vector; + unsigned int iv_lens[MAXBUFS]; + + for (i = 0; i < num_buffers; i++) { + vector = &testEEA3_vectors[buf_idx[i]]; + packetLen[i] = (vector->length_in_bits + 7) / 8; + memcpy(pKeys[i], vector->CK, IMB_ZUC_KEY_LEN_IN_BYTES); + zuc_eea3_iv_gen(vector->count, vector->Bearer, vector->Direction, pIV[i]); + iv_lens[i] = IMB_ZUC_IV_LEN_IN_BYTES; + if (dir == IMB_DIR_ENCRYPT) + memcpy(pSrcData[i], vector->plaintext, packetLen[i]); + else + memcpy(pSrcData[i], vector->ciphertext, packetLen[i]); + } + + if (type == TEST_SINGLE_JOB_API) + submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); + else if (type == TEST_BURST_JOB_API) + submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); + else { + if (num_buffers == 4) + IMB_ZUC_EEA3_4_BUFFER( + mb_mgr, (const void *const *) pKeys, (const void *const *) pIV, + (const void *const *) pSrcData, (void **) pDstData, packetLen); + else + IMB_ZUC_EEA3_N_BUFFER(mb_mgr, (const void *const *) pKeys, + (const void *const *) pIV, + (const void *const *) pSrcData, (void **) pDstData, + packetLen, num_buffers); + } + + for (i = 0; i < num_buffers; i++) { + uint8_t *pDst8 = (uint8_t *) pDstData[i]; + int retTmp; + char msg_start[50]; + char msg[100]; + + vector = &testEEA3_vectors[buf_idx[i]]; + if (var_bufs) + snprintf(msg_start, sizeof(msg_start), "Validate ZUC %c block multi-vector", + num_buffers == 4 ? '4' : 'N'); + else + snprintf(msg_start, sizeof(msg_start), "Validate ZUC %c block", + num_buffers == 4 ? '4' : 'N'); + + if (dir == IMB_DIR_ENCRYPT) { + snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], + vector->length_in_bits, msg); + } else { /* DECRYPT */ + snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->plaintext, packetLen[i], + vector->length_in_bits, msg); + } + if (retTmp < 0) + ret = retTmp; + } + + return ret; +} + +static int +submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, const enum api_type type, + IMB_CIPHER_DIRECTION dir, const unsigned int var_bufs, + const unsigned int num_buffers, const uint32_t *buf_idx) +{ + unsigned int i; + uint32_t packetLen[MAXBUFS]; + int ret = 0; + const struct test256EEA3_vectors_t *vector; + unsigned int iv_lens[MAXBUFS]; + + for (i = 0; i < num_buffers; i++) { + vector = &test256EEA3_vectors[buf_idx[i]]; + packetLen[i] = (vector->length_in_bits + 7) / 8; + memcpy(pKeys[i], vector->CK, IMB_ZUC256_KEY_LEN_IN_BYTES); + memcpy(pIV[i], vector->IV, vector->iv_length); + if (dir == IMB_DIR_ENCRYPT) + memcpy(pSrcData[i], vector->plaintext, packetLen[i]); + else + memcpy(pSrcData[i], vector->ciphertext, packetLen[i]); + iv_lens[i] = vector->iv_length; + } + + if (type == TEST_SINGLE_JOB_API) + submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); + else if (type == TEST_BURST_JOB_API) + submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, + num_buffers, IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); +#ifdef __aarch64__ + else + IMB_ZUC256_EEA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, + (const void * const *)pIV, iv_lens, + (const void * const *)pSrcData, (void **)pDstData, + packetLen, num_buffers); +#endif + + for (i = 0; i < num_buffers; i++) { + uint8_t *pDst8 = (uint8_t *) pDstData[i]; + int retTmp; + char msg_start[50]; + char msg[100]; + + vector = &test256EEA3_vectors[buf_idx[i]]; + if (var_bufs) + snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256 multi-vector"); + else + snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256"); + + if (dir == IMB_DIR_ENCRYPT) { + snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], + vector->length_in_bits, msg); + } else { /* DECRYPT */ + snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, + buf_idx[i] + 1, i); + retTmp = test_output(pDst8, vector->plaintext, packetLen[i], + vector->length_in_bits, msg); + } + if (retTmp < 0) + ret = retTmp; + } + + return ret; +} + +int +validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, const enum api_type type) +{ + uint32_t i, j; + int ret = 0; + int retTmp; + uint32_t buf_idx[4]; + + for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { + for (j = 0; j < 4; j++) + buf_idx[j] = i; + + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 0, 4, buf_idx); + if (retTmp < 0) + ret = retTmp; + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 0, 4, buf_idx); + if (retTmp < 0) + ret = retTmp; + } + + /* Encrypt 4 different buffers, grouping all available test vectors + * in groups of 4 */ + for (i = 0; i < (NUM_ZUC_EEA3_TESTS - 4); i++) { + for (j = 0; j < 4; j++) + buf_idx[j] = i + j; + + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 1, 4, buf_idx); + if (retTmp < 0) + ret = retTmp; + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 1, 4, buf_idx); + if (retTmp < 0) + ret = retTmp; + } + + return ret; +}; + +int +validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, + const enum api_type type) +{ + uint32_t i, j; + int ret = 0; + int retTmp; + uint32_t buf_idx[MAXBUFS]; + + assert(numBuffs > 0); + for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { + for (j = 0; j < numBuffs; j++) + buf_idx[j] = i; + + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 0, numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 0, numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + } + + /* Get all test vectors and encrypt them together */ + for (i = 0; i < numBuffs; i++) + buf_idx[i] = i % NUM_ZUC_EEA3_TESTS; + + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_ENCRYPT, 1, + numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + + retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_DECRYPT, 1, + numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + + return ret; +}; + +#ifdef __aarch64__ +int +validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, + uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, + const enum api_type type) +{ + uint32_t i; + int ret = 0; + + /* ZUC-256-EEA3 */ + for (i = 0; i < NUM_ZUC_256_EEA3_TESTS; i++) { + char msg[50]; + int retTmp; + uint32_t byteLength; + uint32_t iv_len; + byteLength = (test256EEA3_vectors[i].length_in_bits + 7) / 8; + iv_len = test256EEA3_vectors[i].iv_length; + memcpy(pKeys, test256EEA3_vectors[i].CK, IMB_ZUC256_KEY_LEN_IN_BYTES); + memcpy(pIV, test256EEA3_vectors[i].IV, iv_len); + memcpy(pSrcData, test256EEA3_vectors[i].plaintext, byteLength); + + if (type == TEST_SINGLE_JOB_API) + submit_eea3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, + &pDstData, &byteLength, + IMB_DIR_ENCRYPT, 1, + IMB_ZUC256_KEY_LEN_IN_BYTES, + &iv_len); + else if (type == TEST_DIRECT_API) + IMB_ZUC256_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, iv_len, pSrcData, + pDstData, byteLength); + + snprintf(msg, sizeof(msg), + "Validate ZUC-256 1 block test %u (Enc):", i + 1); + retTmp = test_output(pDstData, test256EEA3_vectors[i].ciphertext, + byteLength, + test256EEA3_vectors[i].length_in_bits, msg); + if (retTmp < 0) + ret = retTmp; + } + + return ret; +}; +#endif + +int +validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, + uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) +{ + uint32_t i, j; + int ret = 0; + int retTmp; + uint32_t buf_idx[MAXBUFS]; + + assert(numBuffs > 0); + for (i = 0; i < NUM_ZUC_256_EEA3_TESTS; i++) { + for (j = 0; j < numBuffs; j++) + buf_idx[j] = i; + + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 0, numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 0, numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + } + + /* Get all test vectors and encrypt them together */ + for (i = 0; i < numBuffs; i++) + buf_idx[i] = i % NUM_ZUC_256_EEA3_TESTS; + + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_ENCRYPT, 1, numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + + retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, + IMB_DIR_DECRYPT, 1, numBuffs, buf_idx); + if (retTmp < 0) + ret = retTmp; + + return ret; +} + +int +validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, + uint8_t *pIV) +{ + uint32_t i; + int ret = 0; + union SwapBytes { + uint8_t sbb[8]; + uint32_t sbw[2]; + } swapBytes; + + for (i = 0; i < NUM_ZUC_ALG_TESTS; i++) { + memcpy(pKeys, testZUC_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); + memcpy(pIV, testZUC_vectors[i].IV, IMB_ZUC_IV_LEN_IN_BYTES); + memset(pSrcData, 0, 8); + IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, 8); + swapBytes.sbw[0] = bswap4(testZUC_vectors[i].Z[0]); + swapBytes.sbw[1] = bswap4(testZUC_vectors[i].Z[1]); + ret = memcmp(pDstData, swapBytes.sbb, 8); + if (ret) + printf("ZUC 1 algorithm test %u: FAIL\n", i); +#ifdef DEBUG + else { + if (!quiet_mode) + printf("ZUC 1 algorithm test %u: PASS\n", i); + } +#endif + } + return ret; +}; +/***************************************************************************** + ** @description - utility function to dump test buffers$ + ** $ + ** @param message [IN] - debug message to print$ + ** @param ptr [IN] - pointer to beginning of buffer.$ + ** @param len [IN] - length of buffer.$ + *****************************************************************************/ +static void +byte_hexdump(const char *message, const uint8_t *ptr, int len) +{ + int ctr; + + printf("%s:\n", message); + for (ctr = 0; ctr < len; ctr++) { + printf("0x%02X ", ptr[ctr] & 0xff); + if (!((ctr + 1) % 16)) + printf("\n"); + } + printf("\n"); + printf("\n"); +}; diff --git a/test/kat-app/zuc_test.c b/test/kat-app/zuc_eia3_test.c similarity index 59% rename from test/kat-app/zuc_test.c rename to test/kat-app/zuc_eia3_test.c index fd7fee36..c058430b 100644 --- a/test/kat-app/zuc_test.c +++ b/test/kat-app/zuc_eia3_test.c @@ -50,12 +50,15 @@ #define FAIL_STATUS -1 #define DIM(_x) (sizeof(_x) / sizeof(_x[0])) +#define MAX_BUFFER_LENGTH_IN_BITS 5670 /* biggest test is EIA test 5 */ +#define MAX_BUFFER_LENGTH_IN_BYTES ((MAX_BUFFER_LENGTH_IN_BITS) + 7) / 8 + #define MAX_BURST_JOBS 32 enum api_type { TEST_DIRECT_API, TEST_SINGLE_JOB_API, TEST_BURST_JOB_API }; int -zuc_test(struct IMB_MGR *mb_mgr); +zuc_eia3_test(struct IMB_MGR *mb_mgr); extern const struct mac_test zuc_eia3_128_test_json[]; extern const struct mac_test zuc_eia3_256_test_json[]; @@ -70,36 +73,22 @@ int validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV); int -validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, - uint8_t *pKeys, uint8_t *pIV, const enum api_type type); -int -validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, enum api_type type); -int -validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, - const enum api_type type); -int validate_zuc_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, const enum api_type type); int validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); + #ifdef __aarch64__ int -validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, - uint8_t *pKeys, uint8_t *pIV, const enum api_type type); -int validate_zuc256_EIA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, const enum api_type type); int validate_zuc256_EIA3_direct_api(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs); #endif -int -validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); + int validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); @@ -211,17 +200,8 @@ freePtrArray(uint8_t *pArr[MAXBUFS], uint32_t arrayLength) free(pArr[i]); } -static uint32_t -bswap4(const uint32_t val) -{ - return ((val >> 24) | /**< A*/ - ((val & 0xff0000) >> 8) | /**< B*/ - ((val & 0xff00) << 8) | /**< C*/ - (val << 24)); /**< D*/ -} - int -zuc_test(struct IMB_MGR *mb_mgr) +zuc_eia3_test(struct IMB_MGR *mb_mgr) { const uint32_t numBuffs[] = { 4, 8, 9, 16, 17 }; @@ -231,29 +211,23 @@ zuc_test(struct IMB_MGR *mb_mgr) uint8_t *pIV[MAXBUFS] = { 0 }; uint8_t *pSrcData[MAXBUFS] = { 0 }; uint8_t *pDstData[MAXBUFS] = { 0 }; - struct test_suite_context eea3_ctx; struct test_suite_context eia3_ctx; - struct test_suite_context eea3_256_ctx; struct test_suite_context eia3_256_ctx; - test_suite_start(&eea3_ctx, "ZUC-EEA3"); test_suite_start(&eia3_ctx, "ZUC-EIA3"); - test_suite_start(&eea3_256_ctx, "ZUC-EEA3-256"); test_suite_start(&eia3_256_ctx, "ZUC-EIA3-256"); /*Create test data buffers + populate with random data*/ if (createData(pSrcData, MAXBUFS)) { printf("createData() error\n"); - test_suite_update(&eea3_ctx, 0, 1); test_suite_update(&eia3_ctx, 0, 1); - goto exit_zuc_test; + goto exit_zuc_eia3_test; } if (createData(pDstData, MAXBUFS)) { printf("createData() error\n"); freePtrArray(pSrcData, MAXBUFS); - test_suite_update(&eea3_ctx, 0, 1); test_suite_update(&eia3_ctx, 0, 1); - goto exit_zuc_test; + goto exit_zuc_eia3_test; } /* Create random keys and vectors */ @@ -262,36 +236,11 @@ zuc_test(struct IMB_MGR *mb_mgr) printf("createKeyVecData() error\n"); freePtrArray(pSrcData, MAXBUFS); freePtrArray(pDstData, MAXBUFS); - test_suite_update(&eea3_ctx, 0, 1); test_suite_update(&eia3_ctx, 0, 1); - goto exit_zuc_test; + goto exit_zuc_eia3_test; } - if (validate_zuc_algorithm(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0])) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - /* Direct API tests */ - if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0], - TEST_DIRECT_API)) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - - if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, TEST_DIRECT_API)) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - - for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], - TEST_DIRECT_API)) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - } - if (validate_zuc_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], pIV[0], TEST_DIRECT_API)) test_suite_update(&eia3_ctx, 0, 1); @@ -307,20 +256,6 @@ zuc_test(struct IMB_MGR *mb_mgr) } #ifdef __aarch64__ - if (validate_zuc256_EEA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], - pIV[0], TEST_DIRECT_API)) - test_suite_update(&eea3_256_ctx, 0, 1); - else - test_suite_update(&eea3_256_ctx, 1, 0); - - for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, - pIV, numBuffs[i], TEST_DIRECT_API)) - test_suite_update(&eea3_256_ctx, 0, 1); - else - test_suite_update(&eea3_256_ctx, 1, 0); - } - if (validate_zuc256_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], pIV[0], TEST_DIRECT_API)) test_suite_update(&eia3_256_ctx, 0, 1); @@ -337,33 +272,6 @@ zuc_test(struct IMB_MGR *mb_mgr) #endif /* Job API tests */ - if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0], - TEST_SINGLE_JOB_API)) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - - if (validate_zuc_EEA_4_block(mb_mgr, pSrcData, pSrcData, pKeys, pIV, TEST_SINGLE_JOB_API)) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - - for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], - TEST_SINGLE_JOB_API)) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - } - - for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], - TEST_SINGLE_JOB_API)) - test_suite_update(&eea3_256_ctx, 0, 1); - else - test_suite_update(&eea3_256_ctx, 1, 0); - } - if (validate_zuc_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], pIV[0], TEST_SINGLE_JOB_API)) test_suite_update(&eia3_ctx, 0, 1); @@ -387,12 +295,6 @@ zuc_test(struct IMB_MGR *mb_mgr) } #ifdef __aarch64__ - if (validate_zuc256_EEA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], - pIV[0], TEST_SINGLE_JOB_API)) - test_suite_update(&eea3_256_ctx, 0, 1); - else - test_suite_update(&eea3_256_ctx, 1, 0); - if (validate_zuc256_EIA_1_block(mb_mgr, pSrcData[0], pDstData[0], pKeys[0], pIV[0], TEST_SINGLE_JOB_API)) test_suite_update(&eia3_256_ctx, 0, 1); @@ -401,22 +303,6 @@ zuc_test(struct IMB_MGR *mb_mgr) #endif /* Burst job API tests */ - for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc_EEA_n_block(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], - TEST_BURST_JOB_API)) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - } - - for (i = 0; i < DIM(numBuffs); i++) { - if (validate_zuc256_EEA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], - TEST_BURST_JOB_API)) - test_suite_update(&eea3_256_ctx, 0, 1); - else - test_suite_update(&eea3_256_ctx, 1, 0); - } - for (i = 0; i < DIM(numBuffs); i++) { if (validate_zuc256_EIA3(mb_mgr, pSrcData, pDstData, pKeys, pIV, numBuffs[i], TEST_BURST_JOB_API)) @@ -425,138 +311,18 @@ zuc_test(struct IMB_MGR *mb_mgr) test_suite_update(&eia3_256_ctx, 1, 0); } -exit_zuc_test: +exit_zuc_eia3_test: freePtrArray(pKeys, MAXBUFS); /*Free the key buffers*/ freePtrArray(pIV, MAXBUFS); /*Free the vector buffers*/ freePtrArray(pSrcData, MAXBUFS); /*Free the source buffers*/ freePtrArray(pDstData, MAXBUFS); /*Free the destination buffers*/ - errors += test_suite_end(&eea3_ctx); errors += test_suite_end(&eia3_ctx); - errors += test_suite_end(&eea3_256_ctx); errors += test_suite_end(&eia3_256_ctx); return errors; } -static inline int -submit_burst_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const ivs, - uint8_t **const src, uint8_t **const dst, const uint32_t *lens, int dir, - const unsigned int num_jobs, const unsigned int key_len, - const unsigned int *iv_lens) -{ - IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; - unsigned int i; - unsigned int jobs_rx = 0; - uint32_t completed_jobs = 0; - int err; - - while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < num_jobs) - IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); - - for (i = 0; i < num_jobs; i++) { - job = jobs[i]; - job->cipher_direction = dir; - job->chain_order = IMB_ORDER_CIPHER_HASH; - job->cipher_mode = IMB_CIPHER_ZUC_EEA3; - job->src = src[i]; - job->dst = dst[i]; - job->iv = ivs[i]; - job->iv_len_in_bytes = iv_lens[i]; - job->enc_keys = keys[i]; - job->key_len_in_bytes = key_len; - - job->cipher_start_src_offset_in_bytes = 0; - job->msg_len_to_cipher_in_bytes = lens[i]; - job->hash_alg = IMB_AUTH_NULL; - - imb_set_session(mb_mgr, job); - } - - completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, jobs); - err = imb_get_errno(mb_mgr); - - if (err != 0) { - printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); - return -1; - } - -check_eea3_burst_jobs: - for (i = 0; i < completed_jobs; i++) { - job = jobs[i]; - - if (job->status != IMB_STATUS_COMPLETED) { - printf("job %u status not complete!\n", i + 1); - return -1; - } - - jobs_rx++; - } - - if (jobs_rx != num_jobs) { - completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); - if (completed_jobs == 0) { - printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); - return -1; - } - goto check_eea3_burst_jobs; - } - - return 0; -} - -static inline int -submit_eea3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const ivs, - uint8_t **const src, uint8_t **const dst, const uint32_t *lens, int dir, - const unsigned int num_jobs, const unsigned int key_len, - const unsigned int *iv_lens) -{ - IMB_JOB *job; - unsigned int i; - unsigned int jobs_rx = 0; - - for (i = 0; i < num_jobs; i++) { - job = IMB_GET_NEXT_JOB(mb_mgr); - job->cipher_direction = dir; - job->chain_order = IMB_ORDER_CIPHER_HASH; - job->cipher_mode = IMB_CIPHER_ZUC_EEA3; - job->src = src[i]; - job->dst = dst[i]; - job->iv = ivs[i]; - job->iv_len_in_bytes = iv_lens[i]; - job->enc_keys = keys[i]; - job->key_len_in_bytes = key_len; - - job->cipher_start_src_offset_in_bytes = 0; - job->msg_len_to_cipher_in_bytes = lens[i]; - job->hash_alg = IMB_AUTH_NULL; - - job = IMB_SUBMIT_JOB(mb_mgr); - if (job != NULL) { - jobs_rx++; - if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", __LINE__, job->status, i); - return -1; - } - } - } - - while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { - jobs_rx++; - if (job->status != IMB_STATUS_COMPLETED) { - printf("%d error status:%d, job %u", __LINE__, job->status, i); - return -1; - } - } - - if (jobs_rx != num_jobs) { - printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); - return -1; - } - - return 0; -} - static inline int submit_burst_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const iv, uint8_t **const src, uint8_t **const tags, const uint32_t *lens, @@ -688,405 +454,6 @@ submit_eia3_jobs(struct IMB_MGR *mb_mgr, uint8_t **const keys, uint8_t **const i return 0; } -static int -test_output(const uint8_t *out, const uint8_t *ref, const uint32_t bytelen, const uint32_t bitlen, - const char *err_msg) -{ - int ret = 0; - uint32_t byteResidue; - uint32_t bitResidue; - - if (bitlen % 8) - /* Last byte is not a full byte */ - ret = memcmp(out, ref, bytelen - 1); - else - /* Last byte is a full byte */ - ret = memcmp(out, ref, bytelen); - - if (ret) { - printf("%s : FAIL\n", err_msg); - byte_hexdump("Expected", ref, bytelen); - byte_hexdump("Found", out, bytelen); - ret = -1; - /* - * Check last partial byte if there is one and - * all previous full bytes are correct - */ - } else if (bitlen % 8) { - bitResidue = (0xFF00 >> (bitlen % 8)) & 0x00FF; - byteResidue = (ref[bitlen / 8] ^ out[bitlen / 8]) & bitResidue; - if (byteResidue) { - printf("%s : FAIL\n", err_msg); - printf("Expected: 0x%02X (last byte)\n", 0xFF & ref[bitlen / 8]); - printf("Found: 0x%02X (last byte)\n", 0xFF & out[bitlen / 8]); - ret = -1; - } -#ifdef DEBUG - else { - if (!quiet_mode) - printf("%s : PASS\n", err_msg); - } -#endif - } -#ifdef DEBUG - else { - if (!quiet_mode) - printf("%s : PASS\n", err_msg); - } -#endif - fflush(stdout); - - return ret; -} - -int -validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, - uint8_t *pKeys, uint8_t *pIV, const enum api_type type) -{ - uint32_t i; - int ret = 0; - - /* ZUC-128-EEA3 */ - for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { - char msg[50]; - int retTmp; - uint32_t byteLength; - const unsigned int iv_len = IMB_ZUC_IV_LEN_IN_BYTES; - - memcpy(pKeys, testEEA3_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_iv_gen(testEEA3_vectors[i].count, testEEA3_vectors[i].Bearer, - testEEA3_vectors[i].Direction, pIV); - byteLength = (testEEA3_vectors[i].length_in_bits + 7) / 8; - memcpy(pSrcData, testEEA3_vectors[i].plaintext, byteLength); - if (type == TEST_SINGLE_JOB_API) - submit_eea3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &byteLength, - IMB_DIR_ENCRYPT, 1, IMB_ZUC_KEY_LEN_IN_BYTES, &iv_len); - else - IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, byteLength); - - snprintf(msg, sizeof(msg), "Validate ZUC 1 block test %u (Enc):", i + 1); - retTmp = test_output(pDstData, testEEA3_vectors[i].ciphertext, byteLength, - testEEA3_vectors[i].length_in_bits, msg); - if (retTmp < 0) - ret = retTmp; - } - - return ret; -}; - -static int -submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, - uint8_t **pIV, const enum api_type type, IMB_CIPHER_DIRECTION dir, - const unsigned int var_bufs, const unsigned int num_buffers, - const uint32_t *buf_idx) -{ - unsigned int i; - uint32_t packetLen[MAXBUFS]; - int ret = 0; - const struct test128EEA3_vectors_t *vector; - unsigned int iv_lens[MAXBUFS]; - - for (i = 0; i < num_buffers; i++) { - vector = &testEEA3_vectors[buf_idx[i]]; - packetLen[i] = (vector->length_in_bits + 7) / 8; - memcpy(pKeys[i], vector->CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_iv_gen(vector->count, vector->Bearer, vector->Direction, pIV[i]); - iv_lens[i] = IMB_ZUC_IV_LEN_IN_BYTES; - if (dir == IMB_DIR_ENCRYPT) - memcpy(pSrcData[i], vector->plaintext, packetLen[i]); - else - memcpy(pSrcData[i], vector->ciphertext, packetLen[i]); - } - - if (type == TEST_SINGLE_JOB_API) - submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, - num_buffers, IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); - else if (type == TEST_BURST_JOB_API) - submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, - num_buffers, IMB_ZUC_KEY_LEN_IN_BYTES, iv_lens); - else { - if (num_buffers == 4) - IMB_ZUC_EEA3_4_BUFFER( - mb_mgr, (const void *const *) pKeys, (const void *const *) pIV, - (const void *const *) pSrcData, (void **) pDstData, packetLen); - else - IMB_ZUC_EEA3_N_BUFFER(mb_mgr, (const void *const *) pKeys, - (const void *const *) pIV, - (const void *const *) pSrcData, (void **) pDstData, - packetLen, num_buffers); - } - - for (i = 0; i < num_buffers; i++) { - uint8_t *pDst8 = (uint8_t *) pDstData[i]; - int retTmp; - char msg_start[50]; - char msg[100]; - - vector = &testEEA3_vectors[buf_idx[i]]; - if (var_bufs) - snprintf(msg_start, sizeof(msg_start), "Validate ZUC %c block multi-vector", - num_buffers == 4 ? '4' : 'N'); - else - snprintf(msg_start, sizeof(msg_start), "Validate ZUC %c block", - num_buffers == 4 ? '4' : 'N'); - - if (dir == IMB_DIR_ENCRYPT) { - snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], - vector->length_in_bits, msg); - } else { /* DECRYPT */ - snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->plaintext, packetLen[i], - vector->length_in_bits, msg); - } - if (retTmp < 0) - ret = retTmp; - } - - return ret; -} - -static int -submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, const enum api_type type, - IMB_CIPHER_DIRECTION dir, const unsigned int var_bufs, - const unsigned int num_buffers, const uint32_t *buf_idx) -{ - unsigned int i; - uint32_t packetLen[MAXBUFS]; - int ret = 0; - const struct test256EEA3_vectors_t *vector; - unsigned int iv_lens[MAXBUFS]; - - for (i = 0; i < num_buffers; i++) { - vector = &test256EEA3_vectors[buf_idx[i]]; - packetLen[i] = (vector->length_in_bits + 7) / 8; - memcpy(pKeys[i], vector->CK, IMB_ZUC256_KEY_LEN_IN_BYTES); - memcpy(pIV[i], vector->IV, vector->iv_length); - if (dir == IMB_DIR_ENCRYPT) - memcpy(pSrcData[i], vector->plaintext, packetLen[i]); - else - memcpy(pSrcData[i], vector->ciphertext, packetLen[i]); - iv_lens[i] = vector->iv_length; - } - - if (type == TEST_SINGLE_JOB_API) - submit_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, - num_buffers, IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); - else if (type == TEST_BURST_JOB_API) - submit_burst_eea3_jobs(mb_mgr, pKeys, pIV, pSrcData, pDstData, packetLen, dir, - num_buffers, IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); -#ifdef __aarch64__ - else - IMB_ZUC256_EEA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, - (const void * const *)pIV, iv_lens, - (const void * const *)pSrcData, (void **)pDstData, - packetLen, num_buffers); -#endif - - for (i = 0; i < num_buffers; i++) { - uint8_t *pDst8 = (uint8_t *) pDstData[i]; - int retTmp; - char msg_start[50]; - char msg[100]; - - vector = &test256EEA3_vectors[buf_idx[i]]; - if (var_bufs) - snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256 multi-vector"); - else - snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256"); - - if (dir == IMB_DIR_ENCRYPT) { - snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], - vector->length_in_bits, msg); - } else { /* DECRYPT */ - snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->plaintext, packetLen[i], - vector->length_in_bits, msg); - } - if (retTmp < 0) - ret = retTmp; - } - - return ret; -} - -int -validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, const enum api_type type) -{ - uint32_t i, j; - int ret = 0; - int retTmp; - uint32_t buf_idx[4]; - - for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { - for (j = 0; j < 4; j++) - buf_idx[j] = i; - - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_ENCRYPT, 0, 4, buf_idx); - if (retTmp < 0) - ret = retTmp; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_DECRYPT, 0, 4, buf_idx); - if (retTmp < 0) - ret = retTmp; - } - - /* Encrypt 4 different buffers, grouping all available test vectors - * in groups of 4 */ - for (i = 0; i < (NUM_ZUC_EEA3_TESTS - 4); i++) { - for (j = 0; j < 4; j++) - buf_idx[j] = i + j; - - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_ENCRYPT, 1, 4, buf_idx); - if (retTmp < 0) - ret = retTmp; - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_DECRYPT, 1, 4, buf_idx); - if (retTmp < 0) - ret = retTmp; - } - - return ret; -}; - -int -validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, - const enum api_type type) -{ - uint32_t i, j; - int ret = 0; - int retTmp; - uint32_t buf_idx[MAXBUFS]; - - assert(numBuffs > 0); - for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { - for (j = 0; j < numBuffs; j++) - buf_idx[j] = i; - - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_ENCRYPT, 0, numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_DECRYPT, 0, numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - } - - /* Get all test vectors and encrypt them together */ - for (i = 0; i < numBuffs; i++) - buf_idx[i] = i % NUM_ZUC_EEA3_TESTS; - - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_ENCRYPT, 1, - numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - - retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_DECRYPT, 1, - numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - - return ret; -}; - -#ifdef __aarch64__ -int -validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, - uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, - const enum api_type type) -{ - uint32_t i; - int ret = 0; - - /* ZUC-256-EEA3 */ - for (i = 0; i < NUM_ZUC_256_EEA3_TESTS; i++) { - char msg[50]; - int retTmp; - uint32_t byteLength; - uint32_t iv_len; - byteLength = (test256EEA3_vectors[i].length_in_bits + 7) / 8; - iv_len = test256EEA3_vectors[i].iv_length; - memcpy(pKeys, test256EEA3_vectors[i].CK, IMB_ZUC256_KEY_LEN_IN_BYTES); - memcpy(pIV, test256EEA3_vectors[i].IV, iv_len); - memcpy(pSrcData, test256EEA3_vectors[i].plaintext, byteLength); - - if (type == TEST_SINGLE_JOB_API) - submit_eea3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, - &pDstData, &byteLength, - IMB_DIR_ENCRYPT, 1, - IMB_ZUC256_KEY_LEN_IN_BYTES, - &iv_len); - else if (type == TEST_DIRECT_API) - IMB_ZUC256_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, iv_len, pSrcData, - pDstData, byteLength); - - snprintf(msg, sizeof(msg), - "Validate ZUC-256 1 block test %u (Enc):", i + 1); - retTmp = test_output(pDstData, test256EEA3_vectors[i].ciphertext, - byteLength, - test256EEA3_vectors[i].length_in_bits, msg); - if (retTmp < 0) - ret = retTmp; - } - - return ret; -}; -#endif - -int -validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, - uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) -{ - uint32_t i, j; - int ret = 0; - int retTmp; - uint32_t buf_idx[MAXBUFS]; - - assert(numBuffs > 0); - for (i = 0; i < NUM_ZUC_256_EEA3_TESTS; i++) { - for (j = 0; j < numBuffs; j++) - buf_idx[j] = i; - - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_ENCRYPT, 0, numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_DECRYPT, 0, numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - } - - /* Get all test vectors and encrypt them together */ - for (i = 0; i < numBuffs; i++) - buf_idx[i] = i % NUM_ZUC_256_EEA3_TESTS; - - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_ENCRYPT, 1, numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - - retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, - IMB_DIR_DECRYPT, 1, numBuffs, buf_idx); - if (retTmp < 0) - ret = retTmp; - - return ret; -} - /** * Count, Bearer and Direction stored in vector IV field */ @@ -1276,6 +643,7 @@ validate_zuc_EIA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p return ret; }; + #ifdef __aarch64__ static int verify_tag_256_direct(void *mac, const struct test256EIA3_vectors_t *vector, const unsigned tag_sz, @@ -1556,6 +924,7 @@ validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD iv_lens); for (j = 0; j < numBuffs; j++) { + retTmp = verify_tag_256(pDstData[j], &vector[i], numBuffs, j, 0); if (retTmp) ret = retTmp; @@ -1593,36 +962,6 @@ validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD return ret; }; -int -validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, - uint8_t *pIV) -{ - uint32_t i; - int ret = 0; - union SwapBytes { - uint8_t sbb[8]; - uint32_t sbw[2]; - } swapBytes; - - for (i = 0; i < NUM_ZUC_ALG_TESTS; i++) { - memcpy(pKeys, testZUC_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); - memcpy(pIV, testZUC_vectors[i].IV, IMB_ZUC_IV_LEN_IN_BYTES); - memset(pSrcData, 0, 8); - IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, 8); - swapBytes.sbw[0] = bswap4(testZUC_vectors[i].Z[0]); - swapBytes.sbw[1] = bswap4(testZUC_vectors[i].Z[1]); - ret = memcmp(pDstData, swapBytes.sbb, 8); - if (ret) - printf("ZUC 1 algorithm test %u: FAIL\n", i); -#ifdef DEBUG - else { - if (!quiet_mode) - printf("ZUC 1 algorithm test %u: PASS\n", i); - } -#endif - } - return ret; -}; /***************************************************************************** ** @description - utility function to dump test buffers$ ** $ -- GitLab From 912f9f4dac57c53feb2fc1783c9bc85cc206d8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Agust=C3=ADn=20Gonz=C3=A1lez=20Orlando?= Date: Thu, 27 Jun 2024 21:07:14 +0100 Subject: [PATCH 168/204] test: [kat-app] split zuc_test_vectors.h for eia3 --- test/kat-app/zuc_eia3_test.c | 2 +- test/kat-app/zuc_eia3_test_vectors.h | 554 +++++++++++++++++++++++++++ test/kat-app/zuc_test_vectors.h | 514 ------------------------- 3 files changed, 555 insertions(+), 515 deletions(-) create mode 100644 test/kat-app/zuc_eia3_test_vectors.h diff --git a/test/kat-app/zuc_eia3_test.c b/test/kat-app/zuc_eia3_test.c index c058430b..5cc65d67 100644 --- a/test/kat-app/zuc_eia3_test.c +++ b/test/kat-app/zuc_eia3_test.c @@ -40,7 +40,7 @@ #include -#include "zuc_test_vectors.h" +#include "zuc_eia3_test_vectors.h" #include "gcm_ctr_vectors_test.h" #include "utils.h" #include "mac_test.h" diff --git a/test/kat-app/zuc_eia3_test_vectors.h b/test/kat-app/zuc_eia3_test_vectors.h new file mode 100644 index 00000000..8529aa46 --- /dev/null +++ b/test/kat-app/zuc_eia3_test_vectors.h @@ -0,0 +1,554 @@ +/***************************************************************************** + Copyright (c) 2009-2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#ifndef __ZUC_TEST_VECTORS_H__ +#define __ZUC_TEST_VECTORS_H__ + +#define MAX_BUFFER_LENGTH_IN_BITS 5670 /* biggest test is EIA test 5 */ +#define MAX_BUFFER_LENGTH_IN_BYTES ((MAX_BUFFER_LENGTH_IN_BITS) + 7) / 8 +#define NUM_ZUC_ALG_TESTS 3 +#define NUM_ZUC_EEA3_TESTS 5 +#define NUM_ZUC_256_EEA3_TESTS 10 +#ifdef __aarch64__ +#define NUM_ZUC_256_EIA3_TESTS 15 +#endif + +#ifdef __aarch64__ +typedef struct test256EIA3_vectors_t { + uint8_t CK[32]; + uint8_t IV[25]; + uint32_t length_in_bits; + uint32_t iv_length; + uint8_t message[MAX_BUFFER_LENGTH_IN_BYTES]; + uint8_t mac4[4]; + uint8_t mac8[8]; + uint8_t mac16[16]; +} test256EIA_vectors_t; +#endif + +#ifdef __aarch64__ +const struct test256EIA3_vectors_t test256EIA3_vectors[] = { + { + /* Test 1 */ + /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 400, + /* IV length */ + 25, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x9B, 0x97, 0x2A, 0x74 }, + { 0x67, 0x3e, 0x54, 0x99, 0x00, 0x34, 0xd3, 0x8c }, + { 0xd8, 0x5e, 0x54, 0xbb, 0xcb, 0x96, 0x00, 0x96, 0x70, 0x84, 0xc9, 0x52, 0xa1, + 0x65, 0x4b, 0x26 }, + }, + /* Test 2 */ + { + /* Key */ + { 0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, 0x23, 0x19, 0x48, + 0x42, 0xcb, 0x5c, 0x6d, 0x98, 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, + 0xeb, 0xe0, 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e }, + /* IV */ + { 0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, 0x02, 0x2d, 0x24, 0xcd, + 0x23, 0x3f, 0x4d, 0x0a, 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 }, + 1600, + /* IV length */ + 23, + { 0x05, 0xa8, 0xc3, 0x4b, 0x70, 0x9c, 0x97, 0x71, 0x67, 0x70, 0xa5, 0xa3, 0x08, + 0x60, 0xca, 0x25, 0x0a, 0x8b, 0xb5, 0xc1, 0xc9, 0xd5, 0x8c, 0x7d, 0xfb, 0x00, + 0x3b, 0xc0, 0x9d, 0xe1, 0x09, 0x9f, 0xcc, 0x22, 0x8c, 0xf6, 0x12, 0x6f, 0xb9, + 0x1e, 0xc9, 0x45, 0x43, 0x43, 0x25, 0x7a, 0x2b, 0xba, 0x64, 0x4b, 0x8c, 0x91, + 0x77, 0xc8, 0xfd, 0xce, 0x01, 0xcf, 0xab, 0x6b, 0xe6, 0xc2, 0x48, 0x80, 0x82, + 0x77, 0xad, 0xb8, 0xb9, 0x8d, 0x1f, 0xd7, 0x48, 0x0b, 0x73, 0x4d, 0x98, 0x96, + 0x12, 0xd5, 0xf1, 0x86, 0xfd, 0xa1, 0x12, 0x50, 0x9a, 0x38, 0x07, 0x37, 0xd5, + 0xa3, 0xd0, 0x21, 0xfe, 0x55, 0x7a, 0x8f, 0xff, 0xe0, 0x4f, 0x25, 0x9c, 0x73, + 0x01, 0x06, 0x66, 0xff, 0x10, 0xa4, 0xdd, 0xd4, 0x2a, 0xbf, 0x0f, 0x5a, 0xa2, + 0x29, 0x64, 0xd9, 0x99, 0xc8, 0x46, 0xe6, 0x46, 0x48, 0x4d, 0x56, 0xe9, 0x02, + 0x17, 0xa8, 0x14, 0x28, 0x13, 0x22, 0xf0, 0xd4, 0x43, 0xbe, 0xa0, 0x64, 0xd5, + 0x28, 0x99, 0x27, 0x24, 0x5d, 0x7c, 0x25, 0x46, 0xd6, 0xdf, 0x2c, 0x05, 0x70, + 0x5a, 0x55, 0xcd, 0xf6, 0xe7, 0xdb, 0x3d, 0x94, 0x67, 0xfa, 0x67, 0x15, 0xe3, + 0x84, 0x96, 0x26, 0xee, 0xf4, 0x22, 0xaf, 0x2f, 0xa4, 0x6e, 0xda, 0x2f, 0x4a, + 0xa0, 0xcd, 0x10, 0x72, 0x85, 0xb6, 0x45, 0x3b, 0x22, 0xb8, 0x1f, 0xe0, 0x3c, + 0xf9, 0x64, 0x29, 0xb4, 0x46 }, + { 0x8d, 0x74, 0x8b, 0x71 }, + { 0xe5, 0x1d, 0xf2, 0x0a, 0x9e, 0x74, 0x06, 0xac }, + { 0x4d, 0x40, 0x5d, 0x6e, 0xf7, 0xf8, 0xaf, 0xad, 0xd6, 0x71, 0x71, 0x03, 0xdf, + 0x92, 0x28, 0x20 }, + }, + { + /* Test 3 */ + /* Key */ + { 0x92, 0xf9, 0x27, 0xe8, 0xab, 0x48, 0x46, 0xdb, 0x2f, 0xa3, 0x61, + 0x36, 0x7e, 0x89, 0xe1, 0x17, 0xc9, 0x99, 0x57, 0x63, 0xe0, 0xe4, + 0x4c, 0xce, 0x20, 0x03, 0x8a, 0x9c, 0x9a, 0x44, 0xca, 0x64 }, + /* IV */ + { 0x7d, 0x51, 0xfb, 0x42, 0xf8, 0x7e, 0x62, 0xfa, 0x60, 0x25, 0xb9, 0x2b, + 0x4e, 0xd6, 0x1c, 0x2e, 0xcc, 0x6c, 0x65, 0x18, 0x1e, 0x9d, 0x04 }, + 800, + /* IV length */ + 23, + { 0xf6, 0x6e, 0x21, 0x54, 0xb9, 0x60, 0xb5, 0x90, 0xdc, 0x35, 0xaf, 0xb9, 0x9d, + 0x03, 0xf9, 0xbe, 0x58, 0xf8, 0x7c, 0x5c, 0x03, 0xdb, 0x72, 0x2e, 0xa6, 0x34, + 0xff, 0x43, 0x8d, 0xcf, 0xd4, 0xa7, 0x2a, 0x52, 0xae, 0x3a, 0xb8, 0xc7, 0x11, + 0xd8, 0x19, 0xd3, 0x94, 0x66, 0x84, 0x10, 0xf0, 0x81, 0x45, 0xc5, 0x0b, 0x05, + 0xe6, 0x89, 0xc6, 0xc9, 0xb4, 0x25, 0x7b, 0xb7, 0x89, 0x42, 0xd4, 0x6c, 0x1a, + 0xfd, 0x00, 0x42, 0x80, 0x9d, 0x10, 0x5e, 0x68, 0xd6, 0x02, 0x13, 0x07, 0x55, + 0x08, 0x24, 0xe5, 0x9e, 0x6b, 0xf3, 0xea, 0x04, 0xd7, 0xd7, 0x8f, 0x0a, 0x48, + 0x02, 0x8c, 0x98, 0xd5, 0x68, 0xee, 0x11, 0x93, 0x22 }, + { 0xf2, 0xef, 0xfb, 0xf7 }, + { 0x5a, 0x99, 0xe9, 0x23, 0xfa, 0xf1, 0xec, 0xbb }, + { 0x0b, 0xfb, 0x8f, 0xff, 0x65, 0xaf, 0x6a, 0x69, 0xea, 0xde, 0xbd, 0x94, 0x79, + 0x7b, 0x08, 0xa5 }, + }, + { + /* Test 4 */ + /* Key */ + { 0xa7, 0x72, 0xf5, 0xfe, 0x9d, 0x81, 0xd1, 0xcf, 0x22, 0x8e, 0x45, + 0x53, 0x67, 0x75, 0xac, 0xc9, 0x04, 0x19, 0x57, 0x55, 0x0f, 0x6c, + 0x39, 0xf9, 0xc5, 0x1b, 0x1e, 0x9e, 0xbb, 0x22, 0xa2, 0xf5 }, + /* IV */ + { 0xce, 0x51, 0x11, 0x83, 0x9b, 0x64, 0x4d, 0x20, 0x51, 0x92, 0x71, 0x3b, + 0x43, 0x47, 0xf9, 0x38, 0x79, 0x0f, 0xd2, 0x59, 0xbc, 0x35, 0xd3 }, + 400, + /* IV length */ + 23, + { 0xad, 0x2a, 0x9a, 0x9a, 0x7e, 0xb8, 0xb9, 0x72, 0xc5, 0x50, 0xe8, 0x28, 0x5e, + 0x17, 0xda, 0xa2, 0x4c, 0x9a, 0xeb, 0x61, 0x72, 0xc6, 0xa7, 0x06, 0x54, 0x32, + 0xa6, 0x5b, 0xc5, 0x8b, 0xd7, 0xa2, 0xe0, 0x5e, 0x18, 0xf5, 0x41, 0x8e, 0xa8, + 0x6e, 0x50, 0xd9, 0xde, 0x67, 0x28, 0x04, 0xee, 0x22, 0xa5, 0x72 }, + { 0x18, 0x3d, 0xf5, 0xf7 }, + { 0x50, 0xa0, 0xc4, 0x24, 0xa9, 0x25, 0xf4, 0x5b }, + { 0x4b, 0xde, 0xd3, 0x15, 0xa4, 0x80, 0xa7, 0xe4, 0x02, 0xe4, 0xc4, 0x48, 0x90, + 0xfe, 0x62, 0xf5 }, + }, + { /* Test 5 */ + /* Key */ + { 0xf8, 0xa0, 0x45, 0x4f, 0x6d, 0xea, 0x74, 0x6e, 0x4c, 0xd1, 0x6e, + 0xb0, 0xc3, 0xa2, 0x1f, 0x57, 0xeb, 0x6f, 0x35, 0x2d, 0x6a, 0x02, + 0x5b, 0x35, 0x32, 0xba, 0x47, 0x3f, 0x1f, 0x0e, 0xdd, 0xc9 }, + /* IV */ + { 0x07, 0x90, 0xeb, 0x7d, 0x09, 0x6d, 0xc1, 0xf1, 0x86, 0x47, 0xea, 0x57, + 0xe4, 0xb8, 0x92, 0xb1, 0x4e, 0x3b, 0x2d, 0x62, 0xaa, 0x53, 0x6f }, + 400, + /* IV length */ + 23, + { 0xf7, 0xc3, 0xc4, 0x82, 0xe7, 0x20, 0x76, 0xa2, 0x78, 0x5d, 0xe1, 0xcb, 0xa5, + 0x3f, 0x7d, 0x7c, 0xa3, 0x84, 0x0b, 0x69, 0xff, 0x3b, 0x19, 0xb5, 0x6b, 0x9f, + 0x25, 0x04, 0x35, 0xad, 0x89, 0x3b, 0xad, 0xba, 0xa5, 0xe1, 0xe8, 0x4e, 0xa4, + 0xf5, 0x49, 0x84, 0x9a, 0x2c, 0x71, 0xb1, 0xd6, 0xc1, 0x1b, 0xdc }, + { 0xb8, 0xbf, 0x02, 0x13 }, + { 0x2c, 0xfc, 0xa3, 0x59, 0x33, 0x50, 0xd8, 0xee }, + { 0x9c, 0x6e, 0xd5, 0xf9, 0x63, 0x95, 0xa7, 0x28, 0xe1, 0x6b, 0xb2, 0x8a, 0x0e, 0x5b, + 0x90, 0x72 } }, + { + /* Test 6 */ + /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 4000, + /* IV length */ + 25, + { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }, + { 0x87, 0x54, 0xf5, 0xcf }, + { 0x13, 0x0d, 0xc2, 0x25, 0xe7, 0x22, 0x40, 0xcc }, + { 0xdf, 0x1e, 0x83, 0x07, 0xb3, 0x1c, 0xc6, 0x2b, 0xec, 0xa1, 0xac, 0x6f, 0x81, + 0x90, 0xc2, 0x2f }, + }, + { + /* Test 7 */ + /* Key */ + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + /* IV */ + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + 400, + /* IV length */ + 25, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x1f, 0x30, 0x79, 0xb4 }, + { 0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25 }, + { 0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, 0x28, 0x31, 0x9f, 0x11, 0x1a, + 0xf3, 0x4f, 0xbd }, + }, + { + /* Test 8 */ + /* Key */ + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + /* IV */ + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + 4000, + /* IV length */ + 25, + { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }, + { 0x5c, 0x7c, 0x8b, 0x88 }, + { 0xea, 0x1d, 0xee, 0x54, 0x4b, 0xb6, 0x22, 0x3b }, + { 0x3a, 0x83, 0xb5, 0x54, 0xbe, 0x40, 0x8c, 0xa5, 0x49, 0x41, 0x24, 0xed, 0x9d, + 0x47, 0x32, 0x05 }, + }, + { + /* Test 9 */ + /* Key */ + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + /* IV */ + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + 400, + /* IV length */ + 23, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x1f, 0x30, 0x79, 0xb4 }, + { 0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25 }, + { 0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, 0x28, 0x31, 0x9f, 0x11, 0x1a, + 0xf3, 0x4f, 0xbd }, + }, + { /* Test 10 */ + /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 272, + /* IV length */ + 25, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xe7, 0x38, 0x1d, 0x2a }, + { 0x03, 0xa6, 0xe4, 0xa4, 0x94, 0xe7, 0x26, 0x0c }, + { 0x41, 0x07, 0x03, 0x9b, 0x7d, 0x83, 0xb8, 0xb6, 0x57, 0xc2, 0x34, 0xb3, 0xd1, 0xa7, + 0x20, 0x6a } }, + { /* Test 11 */ + /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 272, + /* IV length */ + 25, + { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x56, 0x7b, 0x5, 0xfa }, + { 0xdc, 0x6b, 0x62, 0x68, 0x7e, 0x90, 0xf1, 0x00 }, + { 0xdb, 0xc6, 0x76, 0xad, 0xd9, 0xb2, 0x23, 0x2d, 0xa3, 0xc5, 0xf2, 0xfd, 0xf0, 0xfb, + 0xe9, 0x8a } }, + { + /* Test 12 */ + /* Key */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + /* IV */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 5120, + /* IV length */ + 25, + { + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, + }, + { 0x72, 0xc4, 0x7d, 0x50 }, + { 0xa5, 0x3b, 0x6c, 0xd6, 0x50, 0xef, 0xb5, 0x73 }, + { 0xe7, 0xbc, 0x9c, 0x1b, 0x02, 0x79, 0x27, 0x7b, 0x23, 0x48, 0x4b, 0xcf, 0x2e, + 0x70, 0xe9, 0x5b }, + }, + /* Add 3 cases, whose message length is not N*8 */ + { + /* Test 13 */ + /* Key */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }, + /* IV */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00 + }, + 399, + /* IV length */ + 25, + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }, + {0x46, 0x49, 0x70, 0xCC}, + {0xCF, 0x8E, 0x99, 0x98, 0x7A, 0xE5, 0x67, 0x63}, + {0x44, 0x6B, 0xF3, 0xEC, 0x73, 0xD4, 0xE0, 0x4C, + 0x5B, 0x4F, 0x1F, 0x23, 0xD9, 0x26, 0xA8, 0x15 + }, + }, + { + /* Test 14 */ + /* Key */ + {0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, + 0x23, 0x19, 0x48, 0x42, 0xcb, 0x5c, 0x6d, 0x98, + 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, 0xeb, 0xe0, + 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e + }, + /* IV */ + {0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, + 0x02, 0x2d, 0x24, 0xcd, 0x23, 0x3f, 0x4d, 0x0a, + 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 + }, + 501, + /* IV length */ + 23, + {0x05, 0xa8, 0xc3, 0x4b, 0x70, 0x9c, 0x97, 0x71, + 0x67, 0x70, 0xa5, 0xa3, 0x08, 0x60, 0xca, 0x25, + 0x0a, 0x8b, 0xb5, 0xc1, 0xc9, 0xd5, 0x8c, 0x7d, + 0xfb, 0x00, 0x3b, 0xc0, 0x9d, 0xe1, 0x09, 0x9f, + 0xcc, 0x22, 0x8c, 0xf6, 0x12, 0x6f, 0xb9, 0x1e, + 0xc9, 0x45, 0x43, 0x43, 0x25, 0x7a, 0x2b, 0xba, + 0x64, 0x4b, 0x8c, 0x91, 0x77, 0xc8, 0xfd, 0xce, + 0x01, 0xcf, 0xab, 0x6b, 0xe6, 0xc2, 0x48, 0x80, + 0x82, 0x77, 0xad, 0xb8, 0xb9, 0x8d, 0x1f, 0xd7, + 0x48, 0x0b, 0x73, 0x4d, 0x98, 0x96, 0x12, 0xd5, + 0xf1, 0x86, 0xfd, 0xa1, 0x12, 0x50, 0x9a, 0x38, + 0x07, 0x37, 0xd5, 0xa3, 0xd0, 0x21, 0xfe, 0x55, + 0x7a, 0x8f, 0xff, 0xe0, 0x4f, 0x25, 0x9c, 0x73, + 0x01, 0x06, 0x66, 0xff, 0x10, 0xa4, 0xdd, 0xd4, + 0x2a, 0xbf, 0x0f, 0x5a, 0xa2, 0x29, 0x64, 0xd9, + 0x99, 0xc8, 0x46, 0xe6, 0x46, 0x48, 0x4d, 0x56, + 0xe9, 0x02, 0x17, 0xa8, 0x14, 0x28, 0x13, 0x22, + 0xf0, 0xd4, 0x43, 0xbe, 0xa0, 0x64, 0xd5, 0x28, + 0x99, 0x27, 0x24, 0x5d, 0x7c, 0x25, 0x46, 0xd6, + 0xdf, 0x2c, 0x05, 0x70, 0x5a, 0x55, 0xcd, 0xf6, + 0xe7, 0xdb, 0x3d, 0x94, 0x67, 0xfa, 0x67, 0x15, + 0xe3, 0x84, 0x96, 0x26, 0xee, 0xf4, 0x22, 0xaf, + 0x2f, 0xa4, 0x6e, 0xda, 0x2f, 0x4a, 0xa0, 0xcd, + 0x10, 0x72, 0x85, 0xb6, 0x45, 0x3b, 0x22, 0xb8, + 0x1f, 0xe0, 0x3c, 0xf9, 0x64, 0x29, 0xb4, 0x46 + }, + {0xE2, 0x98, 0x92, 0x88}, + {0xD8, 0xC0, 0xDE, 0xBE, + 0x14, 0xA5, 0x15, 0xD2}, + {0x82, 0xE0, 0x1E, 0xFF, + 0x0F, 0x86, 0xCB, 0xD5, + 0x46, 0xAC, 0xBB, 0x96, + 0xE8, 0xCE, 0xAB, 0x9E}, + }, + { + /* Test 15 */ + /* Key */ + {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + }, + /* IV */ + {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0x3f + }, + 396, + /* IV length */ + 25, + {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff + }, + {0x94, 0x19, 0xE9, 0xBE}, + {0x9B, 0x93, 0xA9, 0x40, + 0xAF, 0x55, 0xC2, 0xF9}, + {0xFD, 0xA6, 0x5D, 0xDB, + 0xA7, 0xF0, 0x74, 0x4F, + 0x9F, 0xDA, 0x15, 0x0F, + 0x35, 0x4E, 0xE8, 0x26}, + }, +}; +#endif /* __aarch64__ */ +#endif diff --git a/test/kat-app/zuc_test_vectors.h b/test/kat-app/zuc_test_vectors.h index 3a760989..4f1833f8 100644 --- a/test/kat-app/zuc_test_vectors.h +++ b/test/kat-app/zuc_test_vectors.h @@ -62,19 +62,6 @@ typedef struct test256EEA3_vectors_t { uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; } test256EEA_vectors_t; -#ifdef __aarch64__ -typedef struct test256EIA3_vectors_t { - uint8_t CK[32]; - uint8_t IV[25]; - uint32_t length_in_bits; - uint32_t iv_length; - uint8_t message[MAX_BUFFER_LENGTH_IN_BYTES]; - uint8_t mac4[4]; - uint8_t mac8[8]; - uint8_t mac16[16]; -} test256EIA_vectors_t; -#endif - /* * ZUC algorithm tests from 3GPP Document3: Implementator's Test Data. * Version 1.1 (4th Jan. 2011). @@ -601,505 +588,4 @@ const struct test256EEA3_vectors_t test256EEA3_vectors[] = { 0x89, 0x3F, 0x34, 0xFF, 0x9F, 0xF1, 0x3D, 0x80, 0xE8, 0x54 } }, }; -#ifdef __aarch64__ -const struct test256EIA3_vectors_t test256EIA3_vectors[] = { - { - /* Test 1 */ - /* Key */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - /* IV */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - 400, - /* IV length */ - 25, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x9B, 0x97, 0x2A, 0x74 }, - { 0x67, 0x3e, 0x54, 0x99, 0x00, 0x34, 0xd3, 0x8c }, - { 0xd8, 0x5e, 0x54, 0xbb, 0xcb, 0x96, 0x00, 0x96, 0x70, 0x84, 0xc9, 0x52, 0xa1, - 0x65, 0x4b, 0x26 }, - }, - /* Test 2 */ - { - /* Key */ - { 0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, 0x23, 0x19, 0x48, - 0x42, 0xcb, 0x5c, 0x6d, 0x98, 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, - 0xeb, 0xe0, 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e }, - /* IV */ - { 0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, 0x02, 0x2d, 0x24, 0xcd, - 0x23, 0x3f, 0x4d, 0x0a, 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 }, - 1600, - /* IV length */ - 23, - { 0x05, 0xa8, 0xc3, 0x4b, 0x70, 0x9c, 0x97, 0x71, 0x67, 0x70, 0xa5, 0xa3, 0x08, - 0x60, 0xca, 0x25, 0x0a, 0x8b, 0xb5, 0xc1, 0xc9, 0xd5, 0x8c, 0x7d, 0xfb, 0x00, - 0x3b, 0xc0, 0x9d, 0xe1, 0x09, 0x9f, 0xcc, 0x22, 0x8c, 0xf6, 0x12, 0x6f, 0xb9, - 0x1e, 0xc9, 0x45, 0x43, 0x43, 0x25, 0x7a, 0x2b, 0xba, 0x64, 0x4b, 0x8c, 0x91, - 0x77, 0xc8, 0xfd, 0xce, 0x01, 0xcf, 0xab, 0x6b, 0xe6, 0xc2, 0x48, 0x80, 0x82, - 0x77, 0xad, 0xb8, 0xb9, 0x8d, 0x1f, 0xd7, 0x48, 0x0b, 0x73, 0x4d, 0x98, 0x96, - 0x12, 0xd5, 0xf1, 0x86, 0xfd, 0xa1, 0x12, 0x50, 0x9a, 0x38, 0x07, 0x37, 0xd5, - 0xa3, 0xd0, 0x21, 0xfe, 0x55, 0x7a, 0x8f, 0xff, 0xe0, 0x4f, 0x25, 0x9c, 0x73, - 0x01, 0x06, 0x66, 0xff, 0x10, 0xa4, 0xdd, 0xd4, 0x2a, 0xbf, 0x0f, 0x5a, 0xa2, - 0x29, 0x64, 0xd9, 0x99, 0xc8, 0x46, 0xe6, 0x46, 0x48, 0x4d, 0x56, 0xe9, 0x02, - 0x17, 0xa8, 0x14, 0x28, 0x13, 0x22, 0xf0, 0xd4, 0x43, 0xbe, 0xa0, 0x64, 0xd5, - 0x28, 0x99, 0x27, 0x24, 0x5d, 0x7c, 0x25, 0x46, 0xd6, 0xdf, 0x2c, 0x05, 0x70, - 0x5a, 0x55, 0xcd, 0xf6, 0xe7, 0xdb, 0x3d, 0x94, 0x67, 0xfa, 0x67, 0x15, 0xe3, - 0x84, 0x96, 0x26, 0xee, 0xf4, 0x22, 0xaf, 0x2f, 0xa4, 0x6e, 0xda, 0x2f, 0x4a, - 0xa0, 0xcd, 0x10, 0x72, 0x85, 0xb6, 0x45, 0x3b, 0x22, 0xb8, 0x1f, 0xe0, 0x3c, - 0xf9, 0x64, 0x29, 0xb4, 0x46 }, - { 0x8d, 0x74, 0x8b, 0x71 }, - { 0xe5, 0x1d, 0xf2, 0x0a, 0x9e, 0x74, 0x06, 0xac }, - { 0x4d, 0x40, 0x5d, 0x6e, 0xf7, 0xf8, 0xaf, 0xad, 0xd6, 0x71, 0x71, 0x03, 0xdf, - 0x92, 0x28, 0x20 }, - }, - { - /* Test 3 */ - /* Key */ - { 0x92, 0xf9, 0x27, 0xe8, 0xab, 0x48, 0x46, 0xdb, 0x2f, 0xa3, 0x61, - 0x36, 0x7e, 0x89, 0xe1, 0x17, 0xc9, 0x99, 0x57, 0x63, 0xe0, 0xe4, - 0x4c, 0xce, 0x20, 0x03, 0x8a, 0x9c, 0x9a, 0x44, 0xca, 0x64 }, - /* IV */ - { 0x7d, 0x51, 0xfb, 0x42, 0xf8, 0x7e, 0x62, 0xfa, 0x60, 0x25, 0xb9, 0x2b, - 0x4e, 0xd6, 0x1c, 0x2e, 0xcc, 0x6c, 0x65, 0x18, 0x1e, 0x9d, 0x04 }, - 800, - /* IV length */ - 23, - { 0xf6, 0x6e, 0x21, 0x54, 0xb9, 0x60, 0xb5, 0x90, 0xdc, 0x35, 0xaf, 0xb9, 0x9d, - 0x03, 0xf9, 0xbe, 0x58, 0xf8, 0x7c, 0x5c, 0x03, 0xdb, 0x72, 0x2e, 0xa6, 0x34, - 0xff, 0x43, 0x8d, 0xcf, 0xd4, 0xa7, 0x2a, 0x52, 0xae, 0x3a, 0xb8, 0xc7, 0x11, - 0xd8, 0x19, 0xd3, 0x94, 0x66, 0x84, 0x10, 0xf0, 0x81, 0x45, 0xc5, 0x0b, 0x05, - 0xe6, 0x89, 0xc6, 0xc9, 0xb4, 0x25, 0x7b, 0xb7, 0x89, 0x42, 0xd4, 0x6c, 0x1a, - 0xfd, 0x00, 0x42, 0x80, 0x9d, 0x10, 0x5e, 0x68, 0xd6, 0x02, 0x13, 0x07, 0x55, - 0x08, 0x24, 0xe5, 0x9e, 0x6b, 0xf3, 0xea, 0x04, 0xd7, 0xd7, 0x8f, 0x0a, 0x48, - 0x02, 0x8c, 0x98, 0xd5, 0x68, 0xee, 0x11, 0x93, 0x22 }, - { 0xf2, 0xef, 0xfb, 0xf7 }, - { 0x5a, 0x99, 0xe9, 0x23, 0xfa, 0xf1, 0xec, 0xbb }, - { 0x0b, 0xfb, 0x8f, 0xff, 0x65, 0xaf, 0x6a, 0x69, 0xea, 0xde, 0xbd, 0x94, 0x79, - 0x7b, 0x08, 0xa5 }, - }, - { - /* Test 4 */ - /* Key */ - { 0xa7, 0x72, 0xf5, 0xfe, 0x9d, 0x81, 0xd1, 0xcf, 0x22, 0x8e, 0x45, - 0x53, 0x67, 0x75, 0xac, 0xc9, 0x04, 0x19, 0x57, 0x55, 0x0f, 0x6c, - 0x39, 0xf9, 0xc5, 0x1b, 0x1e, 0x9e, 0xbb, 0x22, 0xa2, 0xf5 }, - /* IV */ - { 0xce, 0x51, 0x11, 0x83, 0x9b, 0x64, 0x4d, 0x20, 0x51, 0x92, 0x71, 0x3b, - 0x43, 0x47, 0xf9, 0x38, 0x79, 0x0f, 0xd2, 0x59, 0xbc, 0x35, 0xd3 }, - 400, - /* IV length */ - 23, - { 0xad, 0x2a, 0x9a, 0x9a, 0x7e, 0xb8, 0xb9, 0x72, 0xc5, 0x50, 0xe8, 0x28, 0x5e, - 0x17, 0xda, 0xa2, 0x4c, 0x9a, 0xeb, 0x61, 0x72, 0xc6, 0xa7, 0x06, 0x54, 0x32, - 0xa6, 0x5b, 0xc5, 0x8b, 0xd7, 0xa2, 0xe0, 0x5e, 0x18, 0xf5, 0x41, 0x8e, 0xa8, - 0x6e, 0x50, 0xd9, 0xde, 0x67, 0x28, 0x04, 0xee, 0x22, 0xa5, 0x72 }, - { 0x18, 0x3d, 0xf5, 0xf7 }, - { 0x50, 0xa0, 0xc4, 0x24, 0xa9, 0x25, 0xf4, 0x5b }, - { 0x4b, 0xde, 0xd3, 0x15, 0xa4, 0x80, 0xa7, 0xe4, 0x02, 0xe4, 0xc4, 0x48, 0x90, - 0xfe, 0x62, 0xf5 }, - }, - { /* Test 5 */ - /* Key */ - { 0xf8, 0xa0, 0x45, 0x4f, 0x6d, 0xea, 0x74, 0x6e, 0x4c, 0xd1, 0x6e, - 0xb0, 0xc3, 0xa2, 0x1f, 0x57, 0xeb, 0x6f, 0x35, 0x2d, 0x6a, 0x02, - 0x5b, 0x35, 0x32, 0xba, 0x47, 0x3f, 0x1f, 0x0e, 0xdd, 0xc9 }, - /* IV */ - { 0x07, 0x90, 0xeb, 0x7d, 0x09, 0x6d, 0xc1, 0xf1, 0x86, 0x47, 0xea, 0x57, - 0xe4, 0xb8, 0x92, 0xb1, 0x4e, 0x3b, 0x2d, 0x62, 0xaa, 0x53, 0x6f }, - 400, - /* IV length */ - 23, - { 0xf7, 0xc3, 0xc4, 0x82, 0xe7, 0x20, 0x76, 0xa2, 0x78, 0x5d, 0xe1, 0xcb, 0xa5, - 0x3f, 0x7d, 0x7c, 0xa3, 0x84, 0x0b, 0x69, 0xff, 0x3b, 0x19, 0xb5, 0x6b, 0x9f, - 0x25, 0x04, 0x35, 0xad, 0x89, 0x3b, 0xad, 0xba, 0xa5, 0xe1, 0xe8, 0x4e, 0xa4, - 0xf5, 0x49, 0x84, 0x9a, 0x2c, 0x71, 0xb1, 0xd6, 0xc1, 0x1b, 0xdc }, - { 0xb8, 0xbf, 0x02, 0x13 }, - { 0x2c, 0xfc, 0xa3, 0x59, 0x33, 0x50, 0xd8, 0xee }, - { 0x9c, 0x6e, 0xd5, 0xf9, 0x63, 0x95, 0xa7, 0x28, 0xe1, 0x6b, 0xb2, 0x8a, 0x0e, 0x5b, - 0x90, 0x72 } }, - { - /* Test 6 */ - /* Key */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - /* IV */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - 4000, - /* IV length */ - 25, - { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }, - { 0x87, 0x54, 0xf5, 0xcf }, - { 0x13, 0x0d, 0xc2, 0x25, 0xe7, 0x22, 0x40, 0xcc }, - { 0xdf, 0x1e, 0x83, 0x07, 0xb3, 0x1c, 0xc6, 0x2b, 0xec, 0xa1, 0xac, 0x6f, 0x81, - 0x90, 0xc2, 0x2f }, - }, - { - /* Test 7 */ - /* Key */ - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, - /* IV */ - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, - 400, - /* IV length */ - 25, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x1f, 0x30, 0x79, 0xb4 }, - { 0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25 }, - { 0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, 0x28, 0x31, 0x9f, 0x11, 0x1a, - 0xf3, 0x4f, 0xbd }, - }, - { - /* Test 8 */ - /* Key */ - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, - /* IV */ - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, - 4000, - /* IV length */ - 25, - { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }, - { 0x5c, 0x7c, 0x8b, 0x88 }, - { 0xea, 0x1d, 0xee, 0x54, 0x4b, 0xb6, 0x22, 0x3b }, - { 0x3a, 0x83, 0xb5, 0x54, 0xbe, 0x40, 0x8c, 0xa5, 0x49, 0x41, 0x24, 0xed, 0x9d, - 0x47, 0x32, 0x05 }, - }, - { - /* Test 9 */ - /* Key */ - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, - /* IV */ - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, - 400, - /* IV length */ - 23, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x1f, 0x30, 0x79, 0xb4 }, - { 0x8c, 0x71, 0x39, 0x4d, 0x39, 0x95, 0x77, 0x25 }, - { 0xa3, 0x5b, 0xb2, 0x74, 0xb5, 0x67, 0xc4, 0x8b, 0x28, 0x31, 0x9f, 0x11, 0x1a, - 0xf3, 0x4f, 0xbd }, - }, - { /* Test 10 */ - /* Key */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - /* IV */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - 272, - /* IV length */ - 25, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xe7, 0x38, 0x1d, 0x2a }, - { 0x03, 0xa6, 0xe4, 0xa4, 0x94, 0xe7, 0x26, 0x0c }, - { 0x41, 0x07, 0x03, 0x9b, 0x7d, 0x83, 0xb8, 0xb6, 0x57, 0xc2, 0x34, 0xb3, 0xd1, 0xa7, - 0x20, 0x6a } }, - { /* Test 11 */ - /* Key */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - /* IV */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - 272, - /* IV length */ - 25, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, - { 0x56, 0x7b, 0x5, 0xfa }, - { 0xdc, 0x6b, 0x62, 0x68, 0x7e, 0x90, 0xf1, 0x00 }, - { 0xdb, 0xc6, 0x76, 0xad, 0xd9, 0xb2, 0x23, 0x2d, 0xa3, 0xc5, 0xf2, 0xfd, 0xf0, 0xfb, - 0xe9, 0x8a } }, - { - /* Test 12 */ - /* Key */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - /* IV */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - 5120, - /* IV length */ - 25, - { - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, - }, - { 0x72, 0xc4, 0x7d, 0x50 }, - { 0xa5, 0x3b, 0x6c, 0xd6, 0x50, 0xef, 0xb5, 0x73 }, - { 0xe7, 0xbc, 0x9c, 0x1b, 0x02, 0x79, 0x27, 0x7b, 0x23, 0x48, 0x4b, 0xcf, 0x2e, - 0x70, 0xe9, 0x5b }, - }, - /* Add 3 cases, whose message length is not N*8 */ - { - /* Test 13 */ - /* Key */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - /* IV */ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }, - 399, - /* IV length */ - 25, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 - }, - {0x46, 0x49, 0x70, 0xCC}, - {0xCF, 0x8E, 0x99, 0x98, 0x7A, 0xE5, 0x67, 0x63}, - {0x44, 0x6B, 0xF3, 0xEC, 0x73, 0xD4, 0xE0, 0x4C, - 0x5B, 0x4F, 0x1F, 0x23, 0xD9, 0x26, 0xA8, 0x15 - }, - }, - { - /* Test 14 */ - /* Key */ - {0x8f, 0x8e, 0xf9, 0xd8, 0xfb, 0x0a, 0xce, 0x2b, - 0x23, 0x19, 0x48, 0x42, 0xcb, 0x5c, 0x6d, 0x98, - 0x1e, 0x71, 0x68, 0x74, 0xe1, 0xdf, 0xeb, 0xe0, - 0xf2, 0x46, 0x02, 0x71, 0xbb, 0x69, 0x0d, 0x9e - }, - /* IV */ - {0x2c, 0xe8, 0x87, 0x0f, 0x8c, 0x7f, 0x47, 0x2a, - 0x02, 0x2d, 0x24, 0xcd, 0x23, 0x3f, 0x4d, 0x0a, - 0x40, 0x0d, 0x12, 0xdd, 0xc4, 0x16, 0x26 - }, - 501, - /* IV length */ - 23, - {0x05, 0xa8, 0xc3, 0x4b, 0x70, 0x9c, 0x97, 0x71, - 0x67, 0x70, 0xa5, 0xa3, 0x08, 0x60, 0xca, 0x25, - 0x0a, 0x8b, 0xb5, 0xc1, 0xc9, 0xd5, 0x8c, 0x7d, - 0xfb, 0x00, 0x3b, 0xc0, 0x9d, 0xe1, 0x09, 0x9f, - 0xcc, 0x22, 0x8c, 0xf6, 0x12, 0x6f, 0xb9, 0x1e, - 0xc9, 0x45, 0x43, 0x43, 0x25, 0x7a, 0x2b, 0xba, - 0x64, 0x4b, 0x8c, 0x91, 0x77, 0xc8, 0xfd, 0xce, - 0x01, 0xcf, 0xab, 0x6b, 0xe6, 0xc2, 0x48, 0x80, - 0x82, 0x77, 0xad, 0xb8, 0xb9, 0x8d, 0x1f, 0xd7, - 0x48, 0x0b, 0x73, 0x4d, 0x98, 0x96, 0x12, 0xd5, - 0xf1, 0x86, 0xfd, 0xa1, 0x12, 0x50, 0x9a, 0x38, - 0x07, 0x37, 0xd5, 0xa3, 0xd0, 0x21, 0xfe, 0x55, - 0x7a, 0x8f, 0xff, 0xe0, 0x4f, 0x25, 0x9c, 0x73, - 0x01, 0x06, 0x66, 0xff, 0x10, 0xa4, 0xdd, 0xd4, - 0x2a, 0xbf, 0x0f, 0x5a, 0xa2, 0x29, 0x64, 0xd9, - 0x99, 0xc8, 0x46, 0xe6, 0x46, 0x48, 0x4d, 0x56, - 0xe9, 0x02, 0x17, 0xa8, 0x14, 0x28, 0x13, 0x22, - 0xf0, 0xd4, 0x43, 0xbe, 0xa0, 0x64, 0xd5, 0x28, - 0x99, 0x27, 0x24, 0x5d, 0x7c, 0x25, 0x46, 0xd6, - 0xdf, 0x2c, 0x05, 0x70, 0x5a, 0x55, 0xcd, 0xf6, - 0xe7, 0xdb, 0x3d, 0x94, 0x67, 0xfa, 0x67, 0x15, - 0xe3, 0x84, 0x96, 0x26, 0xee, 0xf4, 0x22, 0xaf, - 0x2f, 0xa4, 0x6e, 0xda, 0x2f, 0x4a, 0xa0, 0xcd, - 0x10, 0x72, 0x85, 0xb6, 0x45, 0x3b, 0x22, 0xb8, - 0x1f, 0xe0, 0x3c, 0xf9, 0x64, 0x29, 0xb4, 0x46 - }, - {0xE2, 0x98, 0x92, 0x88}, - {0xD8, 0xC0, 0xDE, 0xBE, - 0x14, 0xA5, 0x15, 0xD2}, - {0x82, 0xE0, 0x1E, 0xFF, - 0x0F, 0x86, 0xCB, 0xD5, - 0x46, 0xAC, 0xBB, 0x96, - 0xE8, 0xCE, 0xAB, 0x9E}, - }, - { - /* Test 15 */ - /* Key */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }, - /* IV */ - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, - 0x3f - }, - 396, - /* IV length */ - 25, - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff - }, - {0x94, 0x19, 0xE9, 0xBE}, - {0x9B, 0x93, 0xA9, 0x40, - 0xAF, 0x55, 0xC2, 0xF9}, - {0xFD, 0xA6, 0x5D, 0xDB, - 0xA7, 0xF0, 0x74, 0x4F, - 0x9F, 0xDA, 0x15, 0x0F, - 0x35, 0x4E, 0xE8, 0x26}, - }, -}; -#endif /* __aarch64__ */ #endif -- GitLab From 1c7da703a58cf0541482cde41240f3ed54780dc2 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Tue, 24 Oct 2023 16:02:55 +0100 Subject: [PATCH 169/204] test: [kat-app] convert ZUC-EEA3 128 vectors to standard format --- test/kat-app/Makefile | 4 +- test/kat-app/win_x64.mak | 2 +- test/kat-app/zuc_eea3_128.json.c | 168 ++++++++++++++++++++++ test/kat-app/zuc_eea3_test.c | 71 ++++++---- test/kat-app/zuc_test_vectors.h | 231 +------------------------------ 5 files changed, 218 insertions(+), 258 deletions(-) create mode 100644 test/kat-app/zuc_eea3_128.json.c diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index fb352ba0..409ab414 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -45,11 +45,11 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ - sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c + sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c else # aarch64 SOURCES := main.c api_test.c zuc_eea3_test.c zuc_eia3_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ - zuc_eia3_128.json.c zuc_eia3_256.json.c + zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c endif # aarch64 OBJECTS := $(SOURCES:%.c=%.o) utils.o diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index fc4c5865..4d8de1c5 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep diff --git a/test/kat-app/zuc_eea3_128.json.c b/test/kat-app/zuc_eea3_128.json.c new file mode 100644 index 00000000..175068c8 --- /dev/null +++ b/test/kat-app/zuc_eea3_128.json.c @@ -0,0 +1,168 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/* ZUC-EEA3 128, */ +#include "cipher_test.h" + +/** + * Note: ZUC IV params stored in vector IV field + * uin32_t count = iv[0-3] + * uint8_t bearer = iv[4] + * uint8_t direction = iv[5] + */ +const struct cipher_test zuc_eea3_128_test_json[] = { + { 48, 128, 1, "\x17\x3d\x14\xba\x50\x03\x73\x1d\x7a\x60\x04\x94\x70\xf0\x0a\x29", + "\x92\x54\x03\x66\x0f\x00", + "\x6c\xf6\x53\x40\x73\x55\x52\xab\x0c\x97\x52\xfa\x6f\x90\x25\xfe\x0b\xd6\x75\xd9\x00\x58" + "\x75\xb2\x00\x00\x00\x00", + "\xa6\xc8\x5f\xc6\x6a\xfb\x85\x33\xaa\xfc\x25\x18\xdf\xe7\x84\x94\x0e\xe1\xe4\xb0\x30\x23" + "\x8c\xc8\x00\x00\x00\x00", + 1, 193 }, + { 48, 128, 2, "\xe5\xbd\x3e\xa0\xeb\x55\xad\xe8\x66\xc6\xac\x58\xbd\x54\x30\x2a", + "\x23\x68\x05\x00\x18\x01", + "\x14\xa8\xef\x69\x3d\x67\x85\x07\xbb\xe7\x27\x0a\x7f\x67\xff\x50\x06\xc3\x52\x5b\x98\x07" + "\xe4\x67\xc4\xe5\x60\x00\xba\x33\x8f\x5d\x42\x95\x59\x03\x67\x51\x82\x22\x46\xc8\x0d\x3b" + "\x38\xf0\x7f\x4b\xe2\xd8\xff\x58\x05\xf5\x13\x22\x29\xbd\xe9\x3b\xbb\xdc\xaf\x38\x2b\xf1" + "\xee\x97\x2f\xbf\x99\x77\xba\xda\x89\x45\x84\x7a\x2a\x6c\x9a\xd3\x4a\x66\x75\x54\xe0\x4d" + "\x1f\x7f\xa2\xc3\x32\x41\xbd\x8f\x01\xba\x22\x0d", + "\x13\x1d\x43\xe0\xde\xa1\xbe\x5c\x5a\x1b\xfd\x97\x1d\x85\x2c\xbf\x71\x2d\x7b\x4f\x57\x96" + "\x1f\xea\x32\x08\xaf\xa8\xbc\xa4\x33\xf4\x56\xad\x09\xc7\x41\x7e\x58\xbc\x69\xcf\x88\x66" + "\xd1\x35\x3f\x74\x86\x5e\x80\x78\x1d\x20\x2d\xfb\x3e\xcf\xf7\xfc\xbc\x3b\x19\x0f\xe8\x2a" + "\x20\x4e\xd0\xe3\x50\xfc\x0f\x6f\x26\x13\xb2\xf2\xbc\xa6\xdf\x5a\x47\x3a\x57\xa4\xa0\x0d" + "\x98\x5e\xba\xd8\x80\xd6\xf2\x38\x64\xa0\x7b\x01", + 1, 800 }, + { 48, 128, 3, "\xd4\x55\x2a\x8f\xd6\xe6\x1c\xc8\x1a\x20\x09\x14\x1a\x29\xc1\x0b", + "\xC1\x2E\x45\x76\x02\x01", + "\x38\xf0\x7f\x4b\xe2\xd8\xff\x58\x05\xf5\x13\x22\x29\xbd\xe9\x3b\xbb\xdc\xaf\x38\x2b\xf1" + "\xee\x97\x2f\xbf\x99\x77\xba\xda\x89\x45\x84\x7a\x2a\x6c\x9a\xd3\x4a\x66\x75\x54\xe0\x4d" + "\x1f\x7f\xa2\xc3\x32\x41\xbd\x8f\x01\xba\x22\x0d\x3c\xa4\xec\x41\xe0\x74\x59\x5f\x54\xae" + "\x2b\x45\x4f\xd9\x71\x43\x20\x43\x60\x19\x65\xcc\xa8\x5c\x24\x17\xed\x6c\xbe\xc3\xba\xda" + "\x84\xfc\x8a\x57\x9a\xea\x78\x37\xb0\x27\x11\x77\x24\x2a\x64\xdc\x0a\x9d\xe7\x1a\x8e\xde" + "\xe8\x6c\xa3\xd4\x7d\x03\x3d\x6b\xf5\x39\x80\x4e\xca\x86\xc5\x84\xa9\x05\x2d\xe4\x6a\xd3" + "\xfc\xed\x65\x54\x3b\xd9\x02\x07\x37\x2b\x27\xaf\xb7\x92\x34\xf5\xff\x43\xea\x87\x08\x20" + "\xe2\xc2\xb7\x8a\x8a\xae\x61\xcc\xe5\x2a\x05\x15\xe3\x48\xd1\x96\x66\x4a\x34\x56\xb1\x82" + "\xa0\x7c\x40\x6e\x4a\x20\x79\x12\x71\xcf\xed\xa1\x65\xd5\x35\xec\x5e\xa2\xd4\xdf\x40\x00" + "\x00\x00", + "\x83\x83\xb0\x22\x9f\xcc\x0b\x9d\x22\x95\xec\x41\xc9\x77\xe9\xc2\xbb\x72\xe2\x20\x37\x81" + "\x41\xf9\xc8\x31\x8f\x3a\x27\x0d\xfb\xcd\xee\x64\x11\xc2\xb3\x04\x4f\x17\x6d\xc6\xe0\x0f" + "\x89\x60\xf9\x7a\xfa\xcd\x13\x1a\xd6\xa3\xb4\x9b\x16\xb7\xba\xbc\xf2\xa5\x09\xeb\xb1\x6a" + "\x75\xdc\xab\x14\xff\x27\x5d\xbe\xee\xa1\xa2\xb1\x55\xf9\xd5\x2c\x26\x45\x2d\x01\x87\xc3" + "\x10\xa4\xee\x55\xbe\xaa\x78\xab\x40\x24\x61\x5b\xa9\xf5\xd5\xad\xc7\x72\x8f\x73\x56\x06" + "\x71\xf0\x13\xe5\xe5\x50\x08\x5d\x32\x91\xdf\x7d\x5f\xec\xed\xde\xd5\x59\x64\x1b\x6c\x2f" + "\x58\x52\x33\xbc\x71\xe9\x60\x2b\xd2\x30\x58\x55\xbb\xd2\x5f\xfa\x7f\x17\xec\xbc\x04\x2d" + "\xaa\xe3\x8c\x1f\x57\xad\x8e\x8e\xbd\x37\x34\x6f\x71\xbe\xfd\xbb\x74\x32\xe0\xe0\xbb\x2c" + "\xfc\x09\xbc\xd9\x65\x70\xcb\x0c\x0c\x39\xdf\x5e\x29\x29\x4e\x82\x70\x3a\x63\x7f\x80\x00" + "\x00\x00", + 1, 1570 }, + { 48, 128, 4, "\xdb\x84\xb4\xfb\xcc\xda\x56\x3b\x66\x22\x7b\xfe\x45\x6f\x0f\x77", + "\xE1\x0F\x85\xE4\x10\x01", + "\xe5\x39\xf3\xb8\x97\x32\x40\xda\x03\xf2\xb8\xaa\x05\xee\x0a\x00\xdb\xaf\xc0\xe1\x82\x05" + "\x5d\xfe\x3d\x73\x83\xd9\x2c\xef\x40\xe9\x29\x28\x60\x5d\x52\xd0\x5f\x4f\x90\x18\xa1\xf1" + "\x89\xae\x39\x97\xce\x19\x15\x5f\xb1\x22\x1d\xb8\xbb\x09\x51\xa8\x53\xad\x85\x2c\xe1\x6c" + "\xff\x07\x38\x2c\x93\xa1\x57\xde\x00\xdd\xb1\x25\xc7\x53\x9f\xd8\x50\x45\xe4\xee\x07\xe0" + "\xc4\x3f\x9e\x9d\x6f\x41\x4f\xc4\xd1\xc6\x29\x17\x81\x3f\x74\xc0\x0f\xc8\x3f\x3e\x2e\xd7" + "\xc4\x5b\xa5\x83\x52\x64\xb4\x3e\x0b\x20\xaf\xda\x6b\x30\x53\xbf\xb6\x42\x3b\x7f\xce\x25" + "\x47\x9f\xf5\xf1\x39\xdd\x9b\x5b\x99\x55\x58\xe2\xa5\x6b\xe1\x8d\xd5\x81\xcd\x01\x7c\x73" + "\x5e\x6f\x0d\x0d\x97\xc4\xdd\xc1\xd1\xda\x70\xc6\xdb\x4a\x12\xcc\x92\x77\x8e\x2f\xbb\xd6" + "\xf3\xba\x52\xaf\x91\xc9\xc6\xb6\x4e\x8d\xa4\xf7\xa2\xc2\x66\xd0\x2d\x00\x17\x53\xdf\x08" + "\x96\x03\x93\xc5\xd5\x68\x88\xbf\x49\xeb\x5c\x16\xd9\xa8\x04\x27\xa4\x16\xbc\xb5\x97\xdf" + "\x5b\xfe\x6f\x13\x89\x0a\x07\xee\x13\x40\xe6\x47\x6b\x0d\x9a\xa8\xf8\x22\xab\x0f\xd1\xab" + "\x0d\x20\x4f\x40\xb7\xce\x6f\x2e\x13\x6e\xb6\x74\x85\xe5\x07\x80\x4d\x50\x45\x88\xad\x37" + "\xff\xd8\x16\x56\x8b\x2d\xc4\x03\x11\xdf\xb6\x54\xcd\xea\xd4\x7e\x23\x85\xc3\x43\x62\x03" + "\xdd\x83\x6f\x9c\x64\xd9\x74\x62\xad\x5d\xfa\x63\xb5\xcf\xe0\x8a\xcb\x95\x32\x86\x6f\x5c" + "\xa7\x87\x56\x6f\xca\x93\xe6\xb1\x69\x3e\xe1\x5c\xf6\xf7\xa2\xd6\x89\xd9\x74\x17\x98\xdc" + "\x1c\x23\x8e\x1b\xe6\x50\x73\x3b\x18\xfb\x34\xff\x88\x0e\x16\xbb\xd2\x1b\x47\xac\x00" + "\x00", + "\x4b\xbf\xa9\x1b\xa2\x5d\x47\xdb\x9a\x9f\x19\x0d\x96\x2a\x19\xab\x32\x39\x26\xb3\x51\xfb" + "\xd3\x9e\x35\x1e\x05\xda\x8b\x89\x25\xe3\x0b\x1c\xce\x0d\x12\x21\x10\x10\x95\x81\x5c\xc7" + "\xcb\x63\x19\x50\x9e\xc0\xd6\x79\x40\x49\x19\x87\xe1\x3f\x0a\xff\xac\x33\x2a\xa6\xaa\x64" + "\x62\x6d\x3e\x9a\x19\x17\x51\x9e\x0b\x97\xb6\x55\xc6\xa1\x65\xe4\x4c\xa9\xfe\xac\x07\x90" + "\xd2\xa3\x21\xad\x3d\x86\xb7\x9c\x51\x38\x73\x9f\xa3\x8d\x88\x7e\xc7\xde\xf4\x49\xce\x8a" + "\xbd\xd3\xe7\xf8\xdc\x4c\xa9\xe7\xb7\x33\x14\xad\x31\x0f\x90\x25\xe6\x19\x46\xb3\xa5\x6d" + "\xc6\x49\xec\x0d\xa0\xd6\x39\x43\xdf\xf5\x92\xcf\x96\x2a\x7e\xfb\x2c\x85\x24\xe3\x5a\x2a" + "\x6e\x78\x79\xd6\x26\x04\xef\x26\x86\x95\xfa\x40\x03\x02\x7e\x22\xe6\x08\x30\x77\x52\x20" + "\x64\xbd\x4a\x5b\x90\x6b\x5f\x53\x12\x74\xf2\x35\xed\x50\x6c\xff\x01\x54\xc7\x54\x92\x8a" + "\x0c\xe5\x47\x6f\x2c\xb1\x02\x0a\x12\x22\xd3\x2c\x14\x55\xec\xae\xf1\xe3\x68\xfb\x34\x4d" + "\x17\x35\xbf\xbe\xde\xb7\x1d\x0a\x33\xa2\xa5\x4b\x1d\xa5\xa2\x94\xe6\x79\x14\x4d\xdf\x11" + "\xeb\x1a\x3d\xe8\xcf\x0c\xc0\x61\x91\x79\x74\xf3\x5c\x1d\x9c\xa0\xac\x81\x80\x7f\x8f\xcc" + "\xe6\x19\x9a\x6c\x77\x12\xda\x86\x50\x21\xb0\x4c\xe0\x43\x95\x16\xf1\xa5\x26\xcc\xda\x9f" + "\xd9\xab\xbd\x53\xc3\xa6\x84\xf9\xae\x1e\x7e\xe6\xb1\x1d\xa1\x38\xea\x82\x6c\x55\x16\xb5" + "\xaa\xdf\x1a\xbb\xe3\x6f\xa7\xff\xf9\x2e\x3a\x11\x76\x06\x4e\x8d\x95\xf2\xe4\x88\x2b\x55" + "\x00\xb9\x32\x28\xb2\x19\x4a\x47\x5c\x1a\x27\xf6\x3f\x9f\xfd\x26\x49\x89\xa1\xbc\x00" + "\x00", + 1, 2798 }, + { 48, 128, 5, "\xe1\x3f\xed\x21\xb4\x6e\x4e\x7e\xc3\x12\x53\xb2\xbb\x17\xb3\xe0", + "\xAA\xCD\x38\x27\x1a\x00", + "\x8d\x74\xe2\x0d\x54\x89\x4e\x06\xd3\xcb\x13\xcb\x39\x33\x06\x5e\x86\x74\xbe\x62\xad\xb1" + "\xc7\x2b\x3a\x64\x69\x65\xab\x63\xcb\x7b\x78\x54\xdf\xdc\x27\xe8\x49\x29\xf4\x9c\x64\xb8" + "\x72\xa4\x90\xb1\x3f\x95\x7b\x64\x82\x7e\x71\xf4\x1f\xbd\x42\x69\xa4\x2c\x97\xf8\x24\x53" + "\x70\x27\xf8\x6e\x9f\x4a\xd8\x2d\x1d\xf4\x51\x69\x0f\xdd\x98\xb6\xd0\x3f\x3a\x0e\xbe\x3a" + "\x31\x2d\x6b\x84\x0b\xa5\xa1\x82\x0b\x2a\x2c\x97\x09\xc0\x90\xd2\x45\xed\x26\x7c\xf8\x45" + "\xae\x41\xfa\x97\x5d\x33\x33\xac\x30\x09\xfd\x40\xeb\xa9\xeb\x5b\x88\x57\x14\xb7\x68\xb6" + "\x97\x13\x8b\xaf\x21\x38\x0e\xca\x49\xf6\x44\xd4\x86\x89\xe4\x21\x57\x60\xb9\x06\x73\x9f" + "\x0d\x2b\x3f\x09\x11\x33\xca\x15\xd9\x81\xcb\xe4\x01\xba\xf7\x2d\x05\xac\xe0\x5c\xcc\xb2" + "\xd2\x97\xf4\xef\x6a\x5f\x58\xd9\x12\x46\xcf\xa7\x72\x15\xb8\x92\xab\x44\x1d\x52\x78\x45" + "\x27\x95\xcc\xb7\xf5\xd7\x90\x57\xa1\xc4\xf7\x7f\x80\xd4\x6d\xb2\x03\x3c\xb7\x9b\xed\xf8" + "\xe6\x05\x51\xce\x10\xc6\x67\xf6\x2a\x97\xab\xaf\xab\xbc\xd6\x77\x20\x18\xdf\x96\xa2\x82" + "\xea\x73\x7c\xe2\xcb\x33\x12\x11\xf6\x0d\x53\x54\xce\x78\xf9\x91\x8d\x9c\x20\x6c\xa0\x42" + "\xc9\xb6\x23\x87\xdd\x70\x96\x04\xa5\x0a\xf1\x6d\x8d\x35\xa8\x90\x6b\xe4\x84\xcf\x2e\x74" + "\xa9\x28\x99\x40\x36\x43\x53\x24\x9b\x27\xb4\xc9\xae\x29\xed\xdf\xc7\xda\x64\x18\x79\x1a" + "\x4e\x7b\xaa\x06\x60\xfa\x64\x51\x1f\x2d\x68\x5c\xc3\xa5\xff\x70\xe0\xd2\xb7\x42\x92\xe3" + "\xb8\xa0\xcd\x6b\x04\xb1\xc7\x90\xb8\xea\xd2\x70\x37\x08\x54\x0d\xea\x2f\xc0\x9c\x3d\xa7" + "\x70\xf6\x54\x49\xe8\x4d\x81\x7a\x4f\x55\x10\x55\xe1\x9a\xb8\x50\x18\xa0\x02\x8b\x71\xa1" + "\x44\xd9\x67\x91\xe9\xa3\x57\x79\x33\x50\x4e\xee\x00\x60\x34\x0c\x69\xd2\x74\xe1\xbf\x9d" + "\x80\x5d\xcb\xcc\x1a\x6f\xaa\x97\x68\x00\xb6\xff\x2b\x67\x1d\xc4\x63\x65\x2f\xa8\xa3\x3e" + "\xe5\x09\x74\xc1\xc2\x1b\xe0\x1e\xab\xb2\x16\x74\x30\x26\x9d\x72\xee\x51\x1c\x9d\xde\x30" + "\x79\x7c\x9a\x25\xd8\x6c\xe7\x4f\x5b\x96\x1b\xe5\xfd\xfb\x68\x07\x81\x40\x39\xe7\x13\x76" + "\x36\xbd\x1d\x7f\xa9\xe0\x9e\xfd\x20\x07\x50\x59\x06\xa5\xac\x45\xdf\xde\xed\x77\x57\xbb" + "\xee\x74\x57\x49\xc2\x96\x33\x35\x0b\xee\x0e\xa6\xf4\x09\xdf\x45\x80\x16\x00\x00", + "\x94\xea\xa4\xaa\x30\xa5\x71\x37\xdd\xf0\x9b\x97\xb2\x56\x18\xa2\x0a\x13\xe2\xf1\x0f\xa5" + "\xbf\x81\x61\xa8\x79\xcc\x2a\xe7\x97\xa6\xb4\xcf\x2d\x9d\xf3\x1d\xeb\xb9\x90\x5c\xcf\xec" + "\x97\xde\x60\x5d\x21\xc6\x1a\xb8\x53\x1b\x7f\x3c\x9d\xa5\xf0\x39\x31\xf8\xa0\x64\x2d\xe4" + "\x82\x11\xf5\xf5\x2f\xfe\xa1\x0f\x39\x2a\x04\x76\x69\x98\x5d\xa4\x54\xa2\x8f\x08\x09\x61" + "\xa6\xc2\xb6\x2d\xaa\x17\xf3\x3c\xd6\x0a\x49\x71\xf4\x8d\x2d\x90\x93\x94\xa5\x5f\x48\x11" + "\x7a\xce\x43\xd7\x08\xe6\xb7\x7d\x3d\xc4\x6d\x8b\xc0\x17\xd4\xd1\xab\xb7\x7b\x74\x28\xc0" + "\x42\xb0\x6f\x2f\x99\xd8\xd0\x7c\x98\x79\xd9\x96\x00\x12\x7a\x31\x98\x5f\x10\x99\xbb\xd7" + "\xd6\xc1\x51\x9e\xde\x8f\x5e\xeb\x4a\x61\x0b\x34\x9a\xc0\x1e\xa2\x35\x06\x91\x75\x6b\xd1" + "\x05\xc9\x74\xa5\x3e\xdd\xb3\x5d\x1d\x41\x00\xb0\x12\xe5\x22\xab\x41\xf4\xc5\xf2\xfd\xe7" + "\x6b\x59\xcb\x8b\x96\xd8\x85\xcf\xe4\x08\x0d\x13\x28\xa0\xd6\x36\xcc\x0e\xdc\x05\x80\x0b" + "\x76\xac\xca\x8f\xef\x67\x20\x84\xd1\xf5\x2a\x8b\xbd\x8e\x09\x93\x32\x09\x92\xc7\xff\xba" + "\xe1\x7c\x40\x84\x41\xe0\xee\x88\x3f\xc8\xa8\xb0\x5e\x22\xf5\xff\x7f\x8d\x1b\x48\xc7\x4c" + "\x46\x8c\x46\x7a\x02\x8f\x09\xfd\x7c\xe9\x11\x09\xa5\x70\xa2\xd5\xc4\xd5\xf4\xfa\x18\xc5" + "\xdd\x3e\x45\x62\xaf\xe2\x4e\xf7\x71\x90\x1f\x59\xaf\x64\x58\x98\xac\xef\x08\x8a\xba\xe0" + "\x7e\x92\xd5\x2e\xb2\xde\x55\x04\x5b\xb1\xb7\xc4\x16\x4e\xf2\xd7\xa6\xca\xc1\x5e\xeb\x92" + "\x6d\x7e\xa2\xf0\x8b\x66\xe1\xf7\x59\xf3\xae\xe4\x46\x14\x72\x5a\xa3\xc7\x48\x2b\x30\x84" + "\x4c\x14\x3f\xf8\x5b\x53\xf1\xe5\x83\xc5\x01\x25\x7d\xdd\xd0\x96\xb8\x12\x68\xda\xa3\x03" + "\xf1\x72\x34\xc2\x33\x35\x41\xf0\xbb\x8e\x19\x06\x48\xc5\x80\x7c\x86\x6d\x71\x93\x22\x86" + "\x09\xad\xb9\x48\x68\x6f\x7d\xe2\x94\xa8\x02\xcc\x38\xf7\xfe\x52\x08\xf5\xea\x31\x96\xd0" + "\x16\x7b\x9b\xdd\x02\xf0\xd2\xa5\x22\x1c\xa5\x08\xf8\x93\xaf\x5c\x4b\x4b\xb9\xf4\xf5\x20" + "\xfd\x84\x28\x9b\x3d\xbe\x7e\x61\x49\x7a\x7e\x2a\x58\x40\x37\xea\x63\x7b\x69\x81\x12\x71" + "\x74\xaf\x57\xb4\x71\xdf\x4b\x27\x68\xfd\x79\xc1\x54\x0f\xb3\xed\xf2\xea\x22\xcb\x69\xbe" + "\xc0\xcf\x8d\x93\x3d\x9c\x6f\xdd\x64\x5e\x85\x05\x91\xcc\xa3\xd6\x2c\x0c\xc0\x00", + 1, 4019 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } +}; diff --git a/test/kat-app/zuc_eea3_test.c b/test/kat-app/zuc_eea3_test.c index 4a23c2ef..6d695a86 100644 --- a/test/kat-app/zuc_eea3_test.c +++ b/test/kat-app/zuc_eea3_test.c @@ -43,6 +43,7 @@ #include "zuc_test_vectors.h" #include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "cipher_test.h" #define MAXBUFS 17 #define PASS_STATUS 0 @@ -56,6 +57,8 @@ enum api_type { TEST_DIRECT_API, TEST_SINGLE_JOB_API, TEST_BURST_JOB_API }; int zuc_eea3_test(struct IMB_MGR *mb_mgr); +extern const struct cipher_test zuc_eea3_128_test_json[]; + struct zuc_eea3_128_params { const uint32_t *count; const uint8_t *bearer; @@ -515,34 +518,49 @@ test_output(const uint8_t *out, const uint8_t *ref, const uint32_t bytelen, cons return ret; } +/** + * Count, Bearer and Direction stored in vector IV field + */ +static void +zuc_eea3_128_set_params(const struct cipher_test *v, struct zuc_eea3_128_params *p) +{ + const uint8_t *params = (const uint8_t *) v->iv; + + p->count = (const uint32_t *) ¶ms[0]; + p->bearer = ¶ms[4]; + p->direction = ¶ms[5]; +} + int validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, uint8_t *pIV, const enum api_type type) { uint32_t i; int ret = 0; + const struct cipher_test *vectors = zuc_eea3_128_test_json; /* ZUC-128-EEA3 */ - for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { + for (i = 0; vectors[i].msg != NULL; i++) { char msg[50]; int retTmp; uint32_t byteLength; const unsigned int iv_len = IMB_ZUC_IV_LEN_IN_BYTES; + struct zuc_eea3_128_params p = { 0 }; - memcpy(pKeys, testEEA3_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_iv_gen(testEEA3_vectors[i].count, testEEA3_vectors[i].Bearer, - testEEA3_vectors[i].Direction, pIV); - byteLength = (testEEA3_vectors[i].length_in_bits + 7) / 8; - memcpy(pSrcData, testEEA3_vectors[i].plaintext, byteLength); + memcpy(pKeys, vectors[i].key, IMB_ZUC_KEY_LEN_IN_BYTES); + zuc_eea3_128_set_params(&vectors[i], &p); + zuc_eea3_iv_gen(*p.count, *p.bearer, *p.direction, pIV); + byteLength = (uint32_t) (vectors[i].msgSize + 7) / 8; + memcpy(pSrcData, vectors[i].msg, byteLength); if (type == TEST_SINGLE_JOB_API) submit_eea3_jobs(mb_mgr, &pKeys, &pIV, &pSrcData, &pDstData, &byteLength, IMB_DIR_ENCRYPT, 1, IMB_ZUC_KEY_LEN_IN_BYTES, &iv_len); else IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, byteLength); - snprintf(msg, sizeof(msg), "Validate ZUC 1 block test %u (Enc):", i + 1); - retTmp = test_output(pDstData, testEEA3_vectors[i].ciphertext, byteLength, - testEEA3_vectors[i].length_in_bits, msg); + snprintf(msg, sizeof(msg), "Validate ZUC 1 block test %zu (Enc):", vectors[i].tcId); + retTmp = test_output(pDstData, (const uint8_t *) vectors[i].ct, byteLength, + (uint32_t) vectors[i].msgSize, msg); if (retTmp < 0) ret = retTmp; } @@ -559,19 +577,22 @@ submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData unsigned int i; uint32_t packetLen[MAXBUFS]; int ret = 0; - const struct test128EEA3_vectors_t *vector; unsigned int iv_lens[MAXBUFS]; + const struct cipher_test *vectors = zuc_eea3_128_test_json; for (i = 0; i < num_buffers; i++) { - vector = &testEEA3_vectors[buf_idx[i]]; - packetLen[i] = (vector->length_in_bits + 7) / 8; - memcpy(pKeys[i], vector->CK, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_iv_gen(vector->count, vector->Bearer, vector->Direction, pIV[i]); + const struct cipher_test *vector = &vectors[buf_idx[i]]; + struct zuc_eea3_128_params p = { 0 }; + + packetLen[i] = (uint32_t) (vector->msgSize + 7) / 8; + memcpy(pKeys[i], vector->key, IMB_ZUC_KEY_LEN_IN_BYTES); + zuc_eea3_128_set_params(&vectors[buf_idx[i]], &p); + zuc_eea3_iv_gen(*p.count, *p.bearer, *p.direction, pIV[i]); iv_lens[i] = IMB_ZUC_IV_LEN_IN_BYTES; if (dir == IMB_DIR_ENCRYPT) - memcpy(pSrcData[i], vector->plaintext, packetLen[i]); + memcpy(pSrcData[i], vector->msg, packetLen[i]); else - memcpy(pSrcData[i], vector->ciphertext, packetLen[i]); + memcpy(pSrcData[i], vector->ct, packetLen[i]); } if (type == TEST_SINGLE_JOB_API) @@ -597,8 +618,8 @@ submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData int retTmp; char msg_start[50]; char msg[100]; + const struct cipher_test *vector = &vectors[buf_idx[i]]; - vector = &testEEA3_vectors[buf_idx[i]]; if (var_bufs) snprintf(msg_start, sizeof(msg_start), "Validate ZUC %c block multi-vector", num_buffers == 4 ? '4' : 'N'); @@ -607,15 +628,15 @@ submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData num_buffers == 4 ? '4' : 'N'); if (dir == IMB_DIR_ENCRYPT) { - snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], - vector->length_in_bits, msg); + snprintf(msg, sizeof(msg), "%s test %zu, index %u (Enc):", msg_start, + vector->tcId, i); + retTmp = test_output(pDst8, (const uint8_t *) vector->ct, packetLen[i], + (uint32_t) vector->msgSize, msg); } else { /* DECRYPT */ - snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->plaintext, packetLen[i], - vector->length_in_bits, msg); + snprintf(msg, sizeof(msg), "%s test %zu, index %u (Dec):", msg_start, + vector->tcId, i); + retTmp = test_output(pDst8, (const uint8_t *) vector->msg, packetLen[i], + (uint32_t) vector->msgSize, msg); } if (retTmp < 0) ret = retTmp; diff --git a/test/kat-app/zuc_test_vectors.h b/test/kat-app/zuc_test_vectors.h index 4f1833f8..4f4b5bc5 100644 --- a/test/kat-app/zuc_test_vectors.h +++ b/test/kat-app/zuc_test_vectors.h @@ -43,15 +43,6 @@ typedef struct testZUC_vectors_t { uint32_t Z[2]; } testZUC_vectors_t; -typedef struct test128EEA3_vectors_t { - uint8_t CK[16]; - uint32_t count; - uint8_t Bearer; - uint8_t Direction; - uint32_t length_in_bits; - uint8_t plaintext[MAX_BUFFER_LENGTH_IN_BYTES]; - uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; -} test128EEA_vectors_t; typedef struct test256EEA3_vectors_t { uint8_t CK[32]; @@ -86,227 +77,7 @@ const struct testZUC_vectors_t testZUC_vectors[] = { 0xB5, 0x74 }, { 0xED4400E7, 0x0633E5C5 } }, }; -const struct test128EEA3_vectors_t testEEA3_vectors[] = { - /* TestSet1*/ - { { 0x17, 0x3D, 0x14, 0xBA, 0x50, 0x03, 0x73, 0x1D, 0x7A, 0x60, 0x04, 0x94, 0x70, 0xF0, - 0x0A, 0x29 }, - 0x66035492, - 0x0F, - 0x0, - 193, - /* plaintext*/ - { 0x6C, 0xF6, 0x53, 0x40, 0x73, 0x55, 0x52, 0xAB, 0x0C, 0x97, 0x52, 0xFA, 0x6F, 0x90, - 0x25, 0xFE, 0x0B, 0xD6, 0x75, 0xD9, 0x00, 0x58, 0x75, 0xB2, 0x00, 0x00, 0x00, 0x00 }, - /*ciphertext*/ - { 0xA6, 0xC8, 0x5F, 0xC6, 0x6A, 0xFB, 0x85, 0x33, 0xAA, 0xFC, 0x25, 0x18, 0xDF, 0xE7, - 0x84, 0x94, 0x0E, 0xE1, 0xE4, 0xB0, 0x30, 0x23, 0x8C, 0xC8, 0x00, 0x00, 0x00, 0x00 } }, - /*TestSet2*/ - { { 0xE5, 0xBD, 0x3E, 0xA0, 0xEB, 0x55, 0xAD, 0xE8, 0x66, 0xC6, 0xAC, 0x58, 0xBD, 0x54, - 0x30, 0x2A }, - 0x56823, - 0x18, - 0x1, - 800, - /*plaintext*/ - { 0x14, 0xA8, 0xEF, 0x69, 0x3D, 0x67, 0x85, 0x07, 0xBB, 0xE7, 0x27, 0x0A, 0x7F, - 0x67, 0xFF, 0x50, 0x06, 0xC3, 0x52, 0x5B, 0x98, 0x07, 0xE4, 0x67, 0xC4, 0xE5, - 0x60, 0x00, 0xBA, 0x33, 0x8F, 0x5D, 0x42, 0x95, 0x59, 0x03, 0x67, 0x51, 0x82, - 0x22, 0x46, 0xC8, 0x0D, 0x3B, 0x38, 0xF0, 0x7F, 0x4B, 0xE2, 0xD8, 0xFF, 0x58, - 0x05, 0xF5, 0x13, 0x22, 0x29, 0xBD, 0xE9, 0x3B, 0xBB, 0xDC, 0xAF, 0x38, 0x2B, - 0xF1, 0xEE, 0x97, 0x2F, 0xBF, 0x99, 0x77, 0xBA, 0xDA, 0x89, 0x45, 0x84, 0x7A, - 0x2A, 0x6C, 0x9A, 0xD3, 0x4A, 0x66, 0x75, 0x54, 0xE0, 0x4D, 0x1F, 0x7F, 0xA2, - 0xC3, 0x32, 0x41, 0xBD, 0x8F, 0x01, 0xBA, 0x22, 0x0D }, - /*ciphertext*/ - { 0x13, 0x1D, 0x43, 0xE0, 0xDE, 0xA1, 0xBE, 0x5C, 0x5A, 0x1B, 0xFD, 0x97, 0x1D, - 0x85, 0x2C, 0xBF, 0x71, 0x2D, 0x7B, 0x4F, 0x57, 0x96, 0x1F, 0xEA, 0x32, 0x08, - 0xAF, 0xA8, 0xBC, 0xA4, 0x33, 0xF4, 0x56, 0xAD, 0x09, 0xC7, 0x41, 0x7E, 0x58, - 0xBC, 0x69, 0xCF, 0x88, 0x66, 0xD1, 0x35, 0x3F, 0x74, 0x86, 0x5E, 0x80, 0x78, - 0x1D, 0x20, 0x2D, 0xFB, 0x3E, 0xCF, 0xF7, 0xFC, 0xBC, 0x3B, 0x19, 0x0F, 0xE8, - 0x2A, 0x20, 0x4E, 0xD0, 0xE3, 0x50, 0xFC, 0x0F, 0x6F, 0x26, 0x13, 0xB2, 0xF2, - 0xBC, 0xA6, 0xDF, 0x5A, 0x47, 0x3A, 0x57, 0xA4, 0xA0, 0x0D, 0x98, 0x5E, 0xBA, - 0xD8, 0x80, 0xD6, 0xF2, 0x38, 0x64, 0xA0, 0x7B, 0x01 } }, - /*TestSet3*/ - { { 0xD4, 0x55, 0x2A, 0x8F, 0xD6, 0xE6, 0x1C, 0xC8, 0x1A, 0x20, 0x09, 0x14, 0x1A, 0x29, - 0xC1, 0x0B }, - 0x76452EC1, - 0x2, - 0x1, - 1570, - /* plaintext*/ - { 0x38, 0xF0, 0x7F, 0x4B, 0xE2, 0xD8, 0xFF, 0x58, 0x05, 0xF5, 0x13, 0x22, 0x29, 0xBD, - 0xE9, 0x3B, 0xBB, 0xDC, 0xAF, 0x38, 0x2B, 0xF1, 0xEE, 0x97, 0x2F, 0xBF, 0x99, 0x77, - 0xBA, 0xDA, 0x89, 0x45, 0x84, 0x7A, 0x2A, 0x6C, 0x9A, 0xD3, 0x4A, 0x66, 0x75, 0x54, - 0xE0, 0x4D, 0x1F, 0x7F, 0xA2, 0xC3, 0x32, 0x41, 0xBD, 0x8F, 0x01, 0xBA, 0x22, 0x0D, - 0x3C, 0xA4, 0xEC, 0x41, 0xE0, 0x74, 0x59, 0x5F, 0x54, 0xAE, 0x2B, 0x45, 0x4F, 0xD9, - 0x71, 0x43, 0x20, 0x43, 0x60, 0x19, 0x65, 0xCC, 0xA8, 0x5C, 0x24, 0x17, 0xED, 0x6C, - 0xBE, 0xC3, 0xBA, 0xDA, 0x84, 0xFC, 0x8A, 0x57, 0x9A, 0xEA, 0x78, 0x37, 0xB0, 0x27, - 0x11, 0x77, 0x24, 0x2A, 0x64, 0xDC, 0x0A, 0x9D, 0xE7, 0x1A, 0x8E, 0xDE, 0xE8, 0x6C, - 0xA3, 0xD4, 0x7D, 0x03, 0x3D, 0x6B, 0xF5, 0x39, 0x80, 0x4E, 0xCA, 0x86, 0xC5, 0x84, - 0xA9, 0x05, 0x2D, 0xE4, 0x6A, 0xD3, 0xFC, 0xED, 0x65, 0x54, 0x3B, 0xD9, 0x02, 0x07, - 0x37, 0x2B, 0x27, 0xAF, 0xB7, 0x92, 0x34, 0xF5, 0xFF, 0x43, 0xEA, 0x87, 0x08, 0x20, - 0xE2, 0xC2, 0xB7, 0x8A, 0x8A, 0xAE, 0x61, 0xCC, 0xE5, 0x2A, 0x05, 0x15, 0xE3, 0x48, - 0xD1, 0x96, 0x66, 0x4A, 0x34, 0x56, 0xB1, 0x82, 0xA0, 0x7C, 0x40, 0x6E, 0x4A, 0x20, - 0x79, 0x12, 0x71, 0xCF, 0xED, 0xA1, 0x65, 0xD5, 0x35, 0xEC, 0x5E, 0xA2, 0xD4, 0xDF, - 0x40, 0x00, 0x00, 0x00 }, - /*ciphertext*/ - { 0x83, 0x83, 0xB0, 0x22, 0x9F, 0xCC, 0x0B, 0x9D, 0x22, 0x95, 0xEC, 0x41, 0xC9, 0x77, - 0xE9, 0xC2, 0xBB, 0x72, 0xE2, 0x20, 0x37, 0x81, 0x41, 0xF9, 0xC8, 0x31, 0x8F, 0x3A, - 0x27, 0x0D, 0xFB, 0xCD, 0xEE, 0x64, 0x11, 0xC2, 0xB3, 0x04, 0x4F, 0x17, 0x6D, 0xC6, - 0xE0, 0x0F, 0x89, 0x60, 0xF9, 0x7A, 0xFA, 0xCD, 0x13, 0x1A, 0xD6, 0xA3, 0xB4, 0x9B, - 0x16, 0xB7, 0xBA, 0xBC, 0xF2, 0xA5, 0x09, 0xEB, 0xB1, 0x6A, 0x75, 0xDC, 0xAB, 0x14, - 0xFF, 0x27, 0x5D, 0xBE, 0xEE, 0xA1, 0xA2, 0xB1, 0x55, 0xF9, 0xD5, 0x2C, 0x26, 0x45, - 0x2D, 0x01, 0x87, 0xC3, 0x10, 0xA4, 0xEE, 0x55, 0xBE, 0xAA, 0x78, 0xAB, 0x40, 0x24, - 0x61, 0x5B, 0xA9, 0xF5, 0xD5, 0xAD, 0xC7, 0x72, 0x8F, 0x73, 0x56, 0x06, 0x71, 0xF0, - 0x13, 0xE5, 0xE5, 0x50, 0x08, 0x5D, 0x32, 0x91, 0xDF, 0x7D, 0x5F, 0xEC, 0xED, 0xDE, - 0xD5, 0x59, 0x64, 0x1B, 0x6C, 0x2F, 0x58, 0x52, 0x33, 0xBC, 0x71, 0xE9, 0x60, 0x2B, - 0xD2, 0x30, 0x58, 0x55, 0xBB, 0xD2, 0x5F, 0xFA, 0x7F, 0x17, 0xEC, 0xBC, 0x04, 0x2D, - 0xAA, 0xE3, 0x8C, 0x1F, 0x57, 0xAD, 0x8E, 0x8E, 0xBD, 0x37, 0x34, 0x6F, 0x71, 0xBE, - 0xFD, 0xBB, 0x74, 0x32, 0xE0, 0xE0, 0xBB, 0x2C, 0xFC, 0x09, 0xBC, 0xD9, 0x65, 0x70, - 0xCB, 0x0C, 0x0C, 0x39, 0xDF, 0x5E, 0x29, 0x29, 0x4E, 0x82, 0x70, 0x3A, 0x63, 0x7F, - 0x80, 0x00, 0x00, 0x00 } }, - /*TestSet4*/ - { { 0xDB, 0x84, 0xB4, 0xFB, 0xCC, 0xDA, 0x56, 0x3B, 0x66, 0x22, 0x7B, 0xFE, 0x45, 0x6F, - 0x0F, 0x77 }, - 0xE4850FE1, - 0x10, - 0x1, - 2798, - /*plaintext*/ - { 0xE5, 0x39, 0xF3, 0xB8, 0x97, 0x32, 0x40, 0xDA, 0x03, 0xF2, 0xB8, 0xAA, 0x05, 0xEE, - 0x0A, 0x00, 0xDB, 0xAF, 0xC0, 0xE1, 0x82, 0x05, 0x5D, 0xFE, 0x3D, 0x73, 0x83, 0xD9, - 0x2C, 0xEF, 0x40, 0xE9, 0x29, 0x28, 0x60, 0x5D, 0x52, 0xD0, 0x5F, 0x4F, 0x90, 0x18, - 0xA1, 0xF1, 0x89, 0xAE, 0x39, 0x97, 0xCE, 0x19, 0x15, 0x5F, 0xB1, 0x22, 0x1D, 0xB8, - 0xBB, 0x09, 0x51, 0xA8, 0x53, 0xAD, 0x85, 0x2C, 0xE1, 0x6C, 0xFF, 0x07, 0x38, 0x2C, - 0x93, 0xA1, 0x57, 0xDE, 0x00, 0xDD, 0xB1, 0x25, 0xC7, 0x53, 0x9F, 0xD8, 0x50, 0x45, - 0xE4, 0xEE, 0x07, 0xE0, 0xC4, 0x3F, 0x9E, 0x9D, 0x6F, 0x41, 0x4F, 0xC4, 0xD1, 0xC6, - 0x29, 0x17, 0x81, 0x3F, 0x74, 0xC0, 0x0F, 0xC8, 0x3F, 0x3E, 0x2E, 0xD7, 0xC4, 0x5B, - 0xA5, 0x83, 0x52, 0x64, 0xB4, 0x3E, 0x0B, 0x20, 0xAF, 0xDA, 0x6B, 0x30, 0x53, 0xBF, - 0xB6, 0x42, 0x3B, 0x7F, 0xCE, 0x25, 0x47, 0x9F, 0xF5, 0xF1, 0x39, 0xDD, 0x9B, 0x5B, - 0x99, 0x55, 0x58, 0xE2, 0xA5, 0x6B, 0xE1, 0x8D, 0xD5, 0x81, 0xCD, 0x01, 0x7C, 0x73, - 0x5E, 0x6F, 0x0D, 0x0D, 0x97, 0xC4, 0xDD, 0xC1, 0xD1, 0xDA, 0x70, 0xC6, 0xDB, 0x4A, - 0x12, 0xCC, 0x92, 0x77, 0x8E, 0x2F, 0xBB, 0xD6, 0xF3, 0xBA, 0x52, 0xAF, 0x91, 0xC9, - 0xC6, 0xB6, 0x4E, 0x8D, 0xA4, 0xF7, 0xA2, 0xC2, 0x66, 0xD0, 0x2D, 0x00, 0x17, 0x53, - 0xDF, 0x08, 0x96, 0x03, 0x93, 0xC5, 0xD5, 0x68, 0x88, 0xBF, 0x49, 0xEB, 0x5C, 0x16, - 0xD9, 0xA8, 0x04, 0x27, 0xA4, 0x16, 0xBC, 0xB5, 0x97, 0xDF, 0x5B, 0xFE, 0x6F, 0x13, - 0x89, 0x0A, 0x07, 0xEE, 0x13, 0x40, 0xE6, 0x47, 0x6B, 0x0D, 0x9A, 0xA8, 0xF8, 0x22, - 0xAB, 0x0F, 0xD1, 0xAB, 0x0D, 0x20, 0x4F, 0x40, 0xB7, 0xCE, 0x6F, 0x2E, 0x13, 0x6E, - 0xB6, 0x74, 0x85, 0xE5, 0x07, 0x80, 0x4D, 0x50, 0x45, 0x88, 0xAD, 0x37, 0xFF, 0xD8, - 0x16, 0x56, 0x8B, 0x2D, 0xC4, 0x03, 0x11, 0xDF, 0xB6, 0x54, 0xCD, 0xEA, 0xD4, 0x7E, - 0x23, 0x85, 0xC3, 0x43, 0x62, 0x03, 0xDD, 0x83, 0x6F, 0x9C, 0x64, 0xD9, 0x74, 0x62, - 0xAD, 0x5D, 0xFA, 0x63, 0xB5, 0xCF, 0xE0, 0x8A, 0xCB, 0x95, 0x32, 0x86, 0x6F, 0x5C, - 0xA7, 0x87, 0x56, 0x6F, 0xCA, 0x93, 0xE6, 0xB1, 0x69, 0x3E, 0xE1, 0x5C, 0xF6, 0xF7, - 0xA2, 0xD6, 0x89, 0xD9, 0x74, 0x17, 0x98, 0xDC, 0x1C, 0x23, 0x8E, 0x1B, 0xE6, 0x50, - 0x73, 0x3B, 0x18, 0xFB, 0x34, 0xFF, 0x88, 0x0E, 0x16, 0xBB, 0xD2, 0x1B, 0x47, 0xAC, - 0x00, 0x00 }, - /*ciphertext*/ - { 0x4B, 0xBF, 0xA9, 0x1B, 0xA2, 0x5D, 0x47, 0xDB, 0x9A, 0x9F, 0x19, 0x0D, 0x96, 0x2A, - 0x19, 0xAB, 0x32, 0x39, 0x26, 0xB3, 0x51, 0xFB, 0xD3, 0x9E, 0x35, 0x1E, 0x05, 0xDA, - 0x8B, 0x89, 0x25, 0xE3, 0x0B, 0x1C, 0xCE, 0x0D, 0x12, 0x21, 0x10, 0x10, 0x95, 0x81, - 0x5C, 0xC7, 0xCB, 0x63, 0x19, 0x50, 0x9E, 0xC0, 0xD6, 0x79, 0x40, 0x49, 0x19, 0x87, - 0xE1, 0x3F, 0x0A, 0xFF, 0xAC, 0x33, 0x2A, 0xA6, 0xAA, 0x64, 0x62, 0x6D, 0x3E, 0x9A, - 0x19, 0x17, 0x51, 0x9E, 0x0B, 0x97, 0xB6, 0x55, 0xC6, 0xA1, 0x65, 0xE4, 0x4C, 0xA9, - 0xFE, 0xAC, 0x07, 0x90, 0xD2, 0xA3, 0x21, 0xAD, 0x3D, 0x86, 0xB7, 0x9C, 0x51, 0x38, - 0x73, 0x9F, 0xA3, 0x8D, 0x88, 0x7E, 0xC7, 0xDE, 0xF4, 0x49, 0xCE, 0x8A, 0xBD, 0xD3, - 0xE7, 0xF8, 0xDC, 0x4C, 0xA9, 0xE7, 0xB7, 0x33, 0x14, 0xAD, 0x31, 0x0F, 0x90, 0x25, - 0xE6, 0x19, 0x46, 0xB3, 0xA5, 0x6D, 0xC6, 0x49, 0xEC, 0x0D, 0xA0, 0xD6, 0x39, 0x43, - 0xDF, 0xF5, 0x92, 0xCF, 0x96, 0x2A, 0x7E, 0xFB, 0x2C, 0x85, 0x24, 0xE3, 0x5A, 0x2A, - 0x6E, 0x78, 0x79, 0xD6, 0x26, 0x04, 0xEF, 0x26, 0x86, 0x95, 0xFA, 0x40, 0x03, 0x02, - 0x7E, 0x22, 0xE6, 0x08, 0x30, 0x77, 0x52, 0x20, 0x64, 0xBD, 0x4A, 0x5B, 0x90, 0x6B, - 0x5F, 0x53, 0x12, 0x74, 0xF2, 0x35, 0xED, 0x50, 0x6C, 0xFF, 0x01, 0x54, 0xC7, 0x54, - 0x92, 0x8A, 0x0C, 0xE5, 0x47, 0x6F, 0x2C, 0xB1, 0x02, 0x0A, 0x12, 0x22, 0xD3, 0x2C, - 0x14, 0x55, 0xEC, 0xAE, 0xF1, 0xE3, 0x68, 0xFB, 0x34, 0x4D, 0x17, 0x35, 0xBF, 0xBE, - 0xDE, 0xB7, 0x1D, 0x0A, 0x33, 0xA2, 0xA5, 0x4B, 0x1D, 0xA5, 0xA2, 0x94, 0xE6, 0x79, - 0x14, 0x4D, 0xDF, 0x11, 0xEB, 0x1A, 0x3D, 0xE8, 0xCF, 0x0C, 0xC0, 0x61, 0x91, 0x79, - 0x74, 0xF3, 0x5C, 0x1D, 0x9C, 0xA0, 0xAC, 0x81, 0x80, 0x7F, 0x8F, 0xCC, 0xE6, 0x19, - 0x9A, 0x6C, 0x77, 0x12, 0xDA, 0x86, 0x50, 0x21, 0xB0, 0x4C, 0xE0, 0x43, 0x95, 0x16, - 0xF1, 0xA5, 0x26, 0xCC, 0xDA, 0x9F, 0xD9, 0xAB, 0xBD, 0x53, 0xC3, 0xA6, 0x84, 0xF9, - 0xAE, 0x1E, 0x7E, 0xE6, 0xB1, 0x1D, 0xA1, 0x38, 0xEA, 0x82, 0x6C, 0x55, 0x16, 0xB5, - 0xAA, 0xDF, 0x1A, 0xBB, 0xE3, 0x6F, 0xA7, 0xFF, 0xF9, 0x2E, 0x3A, 0x11, 0x76, 0x06, - 0x4E, 0x8D, 0x95, 0xF2, 0xE4, 0x88, 0x2B, 0x55, 0x00, 0xB9, 0x32, 0x28, 0xB2, 0x19, - 0x4A, 0x47, 0x5C, 0x1A, 0x27, 0xF6, 0x3F, 0x9F, 0xFD, 0x26, 0x49, 0x89, 0xA1, 0xBC, - 0x00, 0x00 } }, - /*TestSet5*/ - { { 0xE1, 0x3F, 0xED, 0x21, 0xB4, 0x6E, 0x4E, 0x7E, 0xC3, 0x12, 0x53, 0xB2, 0xBB, 0x17, - 0xB3, 0xE0 }, - 0x2738CDAA, - 0x1A, - 0x0, - 4019, - /*plaintext*/ - { 0x8D, 0x74, 0xE2, 0x0D, 0x54, 0x89, 0x4E, 0x06, 0xD3, 0xCB, 0x13, 0xCB, 0x39, 0x33, - 0x06, 0x5E, 0x86, 0x74, 0xBE, 0x62, 0xAD, 0xB1, 0xC7, 0x2B, 0x3A, 0x64, 0x69, 0x65, - 0xAB, 0x63, 0xCB, 0x7B, 0x78, 0x54, 0xDF, 0xDC, 0x27, 0xE8, 0x49, 0x29, 0xF4, 0x9C, - 0x64, 0xB8, 0x72, 0xA4, 0x90, 0xB1, 0x3F, 0x95, 0x7B, 0x64, 0x82, 0x7E, 0x71, 0xF4, - 0x1F, 0xBD, 0x42, 0x69, 0xA4, 0x2C, 0x97, 0xF8, 0x24, 0x53, 0x70, 0x27, 0xF8, 0x6E, - 0x9F, 0x4A, 0xD8, 0x2D, 0x1D, 0xF4, 0x51, 0x69, 0x0F, 0xDD, 0x98, 0xB6, 0xD0, 0x3F, - 0x3A, 0x0E, 0xBE, 0x3A, 0x31, 0x2D, 0x6B, 0x84, 0x0B, 0xA5, 0xA1, 0x82, 0x0B, 0x2A, - 0x2C, 0x97, 0x09, 0xC0, 0x90, 0xD2, 0x45, 0xED, 0x26, 0x7C, 0xF8, 0x45, 0xAE, 0x41, - 0xFA, 0x97, 0x5D, 0x33, 0x33, 0xAC, 0x30, 0x09, 0xFD, 0x40, 0xEB, 0xA9, 0xEB, 0x5B, - 0x88, 0x57, 0x14, 0xB7, 0x68, 0xB6, 0x97, 0x13, 0x8B, 0xAF, 0x21, 0x38, 0x0E, 0xCA, - 0x49, 0xF6, 0x44, 0xD4, 0x86, 0x89, 0xE4, 0x21, 0x57, 0x60, 0xB9, 0x06, 0x73, 0x9F, - 0x0D, 0x2B, 0x3F, 0x09, 0x11, 0x33, 0xCA, 0x15, 0xD9, 0x81, 0xCB, 0xE4, 0x01, 0xBA, - 0xF7, 0x2D, 0x05, 0xAC, 0xE0, 0x5C, 0xCC, 0xB2, 0xD2, 0x97, 0xF4, 0xEF, 0x6A, 0x5F, - 0x58, 0xD9, 0x12, 0x46, 0xCF, 0xA7, 0x72, 0x15, 0xB8, 0x92, 0xAB, 0x44, 0x1D, 0x52, - 0x78, 0x45, 0x27, 0x95, 0xCC, 0xB7, 0xF5, 0xD7, 0x90, 0x57, 0xA1, 0xC4, 0xF7, 0x7F, - 0x80, 0xD4, 0x6D, 0xB2, 0x03, 0x3C, 0xB7, 0x9B, 0xED, 0xF8, 0xE6, 0x05, 0x51, 0xCE, - 0x10, 0xC6, 0x67, 0xF6, 0x2A, 0x97, 0xAB, 0xAF, 0xAB, 0xBC, 0xD6, 0x77, 0x20, 0x18, - 0xDF, 0x96, 0xA2, 0x82, 0xEA, 0x73, 0x7C, 0xE2, 0xCB, 0x33, 0x12, 0x11, 0xF6, 0x0D, - 0x53, 0x54, 0xCE, 0x78, 0xF9, 0x91, 0x8D, 0x9C, 0x20, 0x6C, 0xA0, 0x42, 0xC9, 0xB6, - 0x23, 0x87, 0xDD, 0x70, 0x96, 0x04, 0xA5, 0x0A, 0xF1, 0x6D, 0x8D, 0x35, 0xA8, 0x90, - 0x6B, 0xE4, 0x84, 0xCF, 0x2E, 0x74, 0xA9, 0x28, 0x99, 0x40, 0x36, 0x43, 0x53, 0x24, - 0x9B, 0x27, 0xB4, 0xC9, 0xAE, 0x29, 0xED, 0xDF, 0xC7, 0xDA, 0x64, 0x18, 0x79, 0x1A, - 0x4E, 0x7B, 0xAA, 0x06, 0x60, 0xFA, 0x64, 0x51, 0x1F, 0x2D, 0x68, 0x5C, 0xC3, 0xA5, - 0xFF, 0x70, 0xE0, 0xD2, 0xB7, 0x42, 0x92, 0xE3, 0xB8, 0xA0, 0xCD, 0x6B, 0x04, 0xB1, - 0xC7, 0x90, 0xB8, 0xEA, 0xD2, 0x70, 0x37, 0x08, 0x54, 0x0D, 0xEA, 0x2F, 0xC0, 0x9C, - 0x3D, 0xA7, 0x70, 0xF6, 0x54, 0x49, 0xE8, 0x4D, 0x81, 0x7A, 0x4F, 0x55, 0x10, 0x55, - 0xE1, 0x9A, 0xB8, 0x50, 0x18, 0xA0, 0x02, 0x8B, 0x71, 0xA1, 0x44, 0xD9, 0x67, 0x91, - 0xE9, 0xA3, 0x57, 0x79, 0x33, 0x50, 0x4E, 0xEE, 0x00, 0x60, 0x34, 0x0C, 0x69, 0xD2, - 0x74, 0xE1, 0xBF, 0x9D, 0x80, 0x5D, 0xCB, 0xCC, 0x1A, 0x6F, 0xAA, 0x97, 0x68, 0x00, - 0xB6, 0xFF, 0x2B, 0x67, 0x1D, 0xC4, 0x63, 0x65, 0x2F, 0xA8, 0xA3, 0x3E, 0xE5, 0x09, - 0x74, 0xC1, 0xC2, 0x1B, 0xE0, 0x1E, 0xAB, 0xB2, 0x16, 0x74, 0x30, 0x26, 0x9D, 0x72, - 0xEE, 0x51, 0x1C, 0x9D, 0xDE, 0x30, 0x79, 0x7C, 0x9A, 0x25, 0xD8, 0x6C, 0xE7, 0x4F, - 0x5B, 0x96, 0x1B, 0xE5, 0xFD, 0xFB, 0x68, 0x07, 0x81, 0x40, 0x39, 0xE7, 0x13, 0x76, - 0x36, 0xBD, 0x1D, 0x7F, 0xA9, 0xE0, 0x9E, 0xFD, 0x20, 0x07, 0x50, 0x59, 0x06, 0xA5, - 0xAC, 0x45, 0xDF, 0xDE, 0xED, 0x77, 0x57, 0xBB, 0xEE, 0x74, 0x57, 0x49, 0xC2, 0x96, - 0x33, 0x35, 0x0B, 0xEE, 0x0E, 0xA6, 0xF4, 0x09, 0xDF, 0x45, 0x80, 0x16, 0x00, 0x00 }, - /*ciphertext*/ - { 0x94, 0xEA, 0xA4, 0xAA, 0x30, 0xA5, 0x71, 0x37, 0xDD, 0xF0, 0x9B, 0x97, 0xB2, 0x56, - 0x18, 0xA2, 0x0A, 0x13, 0xE2, 0xF1, 0x0F, 0xA5, 0xBF, 0x81, 0x61, 0xA8, 0x79, 0xCC, - 0x2A, 0xE7, 0x97, 0xA6, 0xB4, 0xCF, 0x2D, 0x9D, 0xF3, 0x1D, 0xEB, 0xB9, 0x90, 0x5C, - 0xCF, 0xEC, 0x97, 0xDE, 0x60, 0x5D, 0x21, 0xC6, 0x1A, 0xB8, 0x53, 0x1B, 0x7F, 0x3C, - 0x9D, 0xA5, 0xF0, 0x39, 0x31, 0xF8, 0xA0, 0x64, 0x2D, 0xE4, 0x82, 0x11, 0xF5, 0xF5, - 0x2F, 0xFE, 0xA1, 0x0F, 0x39, 0x2A, 0x04, 0x76, 0x69, 0x98, 0x5D, 0xA4, 0x54, 0xA2, - 0x8F, 0x08, 0x09, 0x61, 0xA6, 0xC2, 0xB6, 0x2D, 0xAA, 0x17, 0xF3, 0x3C, 0xD6, 0x0A, - 0x49, 0x71, 0xF4, 0x8D, 0x2D, 0x90, 0x93, 0x94, 0xA5, 0x5F, 0x48, 0x11, 0x7A, 0xCE, - 0x43, 0xD7, 0x08, 0xE6, 0xB7, 0x7D, 0x3D, 0xC4, 0x6D, 0x8B, 0xC0, 0x17, 0xD4, 0xD1, - 0xAB, 0xB7, 0x7B, 0x74, 0x28, 0xC0, 0x42, 0xB0, 0x6F, 0x2F, 0x99, 0xD8, 0xD0, 0x7C, - 0x98, 0x79, 0xD9, 0x96, 0x00, 0x12, 0x7A, 0x31, 0x98, 0x5F, 0x10, 0x99, 0xBB, 0xD7, - 0xD6, 0xC1, 0x51, 0x9E, 0xDE, 0x8F, 0x5E, 0xEB, 0x4A, 0x61, 0x0B, 0x34, 0x9A, 0xC0, - 0x1E, 0xA2, 0x35, 0x06, 0x91, 0x75, 0x6B, 0xD1, 0x05, 0xC9, 0x74, 0xA5, 0x3E, 0xDD, - 0xB3, 0x5D, 0x1D, 0x41, 0x00, 0xB0, 0x12, 0xE5, 0x22, 0xAB, 0x41, 0xF4, 0xC5, 0xF2, - 0xFD, 0xE7, 0x6B, 0x59, 0xCB, 0x8B, 0x96, 0xD8, 0x85, 0xCF, 0xE4, 0x08, 0x0D, 0x13, - 0x28, 0xA0, 0xD6, 0x36, 0xCC, 0x0E, 0xDC, 0x05, 0x80, 0x0B, 0x76, 0xAC, 0xCA, 0x8F, - 0xEF, 0x67, 0x20, 0x84, 0xD1, 0xF5, 0x2A, 0x8B, 0xBD, 0x8E, 0x09, 0x93, 0x32, 0x09, - 0x92, 0xC7, 0xFF, 0xBA, 0xE1, 0x7C, 0x40, 0x84, 0x41, 0xE0, 0xEE, 0x88, 0x3F, 0xC8, - 0xA8, 0xB0, 0x5E, 0x22, 0xF5, 0xFF, 0x7F, 0x8D, 0x1B, 0x48, 0xC7, 0x4C, 0x46, 0x8C, - 0x46, 0x7A, 0x02, 0x8F, 0x09, 0xFD, 0x7C, 0xE9, 0x11, 0x09, 0xA5, 0x70, 0xA2, 0xD5, - 0xC4, 0xD5, 0xF4, 0xFA, 0x18, 0xC5, 0xDD, 0x3E, 0x45, 0x62, 0xAF, 0xE2, 0x4E, 0xF7, - 0x71, 0x90, 0x1F, 0x59, 0xAF, 0x64, 0x58, 0x98, 0xAC, 0xEF, 0x08, 0x8A, 0xBA, 0xE0, - 0x7E, 0x92, 0xD5, 0x2E, 0xB2, 0xDE, 0x55, 0x04, 0x5B, 0xB1, 0xB7, 0xC4, 0x16, 0x4E, - 0xF2, 0xD7, 0xA6, 0xCA, 0xC1, 0x5E, 0xEB, 0x92, 0x6D, 0x7E, 0xA2, 0xF0, 0x8B, 0x66, - 0xE1, 0xF7, 0x59, 0xF3, 0xAE, 0xE4, 0x46, 0x14, 0x72, 0x5A, 0xA3, 0xC7, 0x48, 0x2B, - 0x30, 0x84, 0x4C, 0x14, 0x3F, 0xF8, 0x5B, 0x53, 0xF1, 0xE5, 0x83, 0xC5, 0x01, 0x25, - 0x7D, 0xDD, 0xD0, 0x96, 0xB8, 0x12, 0x68, 0xDA, 0xA3, 0x03, 0xF1, 0x72, 0x34, 0xC2, - 0x33, 0x35, 0x41, 0xF0, 0xBB, 0x8E, 0x19, 0x06, 0x48, 0xC5, 0x80, 0x7C, 0x86, 0x6D, - 0x71, 0x93, 0x22, 0x86, 0x09, 0xAD, 0xB9, 0x48, 0x68, 0x6F, 0x7D, 0xE2, 0x94, 0xA8, - 0x02, 0xCC, 0x38, 0xF7, 0xFE, 0x52, 0x08, 0xF5, 0xEA, 0x31, 0x96, 0xD0, 0x16, 0x7B, - 0x9B, 0xDD, 0x02, 0xF0, 0xD2, 0xA5, 0x22, 0x1C, 0xA5, 0x08, 0xF8, 0x93, 0xAF, 0x5C, - 0x4B, 0x4B, 0xB9, 0xF4, 0xF5, 0x20, 0xFD, 0x84, 0x28, 0x9B, 0x3D, 0xBE, 0x7E, 0x61, - 0x49, 0x7A, 0x7E, 0x2A, 0x58, 0x40, 0x37, 0xEA, 0x63, 0x7B, 0x69, 0x81, 0x12, 0x71, - 0x74, 0xAF, 0x57, 0xB4, 0x71, 0xDF, 0x4B, 0x27, 0x68, 0xFD, 0x79, 0xC1, 0x54, 0x0F, - 0xB3, 0xED, 0xF2, 0xEA, 0x22, 0xCB, 0x69, 0xBE, 0xC0, 0xCF, 0x8D, 0x93, 0x3D, 0x9C, - 0x6F, 0xDD, 0x64, 0x5E, 0x85, 0x05, 0x91, 0xCC, 0xA3, 0xD6, 0x2C, 0x0C, 0xC0, 0x00 } }, -}; + /* ZUC-256 */ const struct test256EEA3_vectors_t test256EEA3_vectors[] = { /* TestSet 1 */ -- GitLab From 2be9a313a2614fa39458bde0e8386c2b2b4b54b7 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Tue, 24 Oct 2023 16:28:55 +0100 Subject: [PATCH 170/204] test: [utils] move byte_hexdump function to utils module --- test/common/utils.c | 22 ++++++++++++++++++++++ test/include/utils.h | 2 ++ test/kat-app/zuc_eea3_test.c | 23 ----------------------- test/kat-app/zuc_eia3_test.c | 25 ------------------------- 4 files changed, 24 insertions(+), 48 deletions(-) diff --git a/test/common/utils.c b/test/common/utils.c index 401f11d6..6e0faef0 100644 --- a/test/common/utils.c +++ b/test/common/utils.c @@ -458,3 +458,25 @@ membitcmp(const uint8_t *input, const uint8_t *output, const uint32_t bitlength, } return 0; } + +/***************************************************************************** + ** @description - utility function to dump test buffers$ + ** $ + ** @param message [IN] - debug message to print$ + ** @param ptr [IN] - pointer to beginning of buffer.$ + ** @param len [IN] - length of buffer.$ + *****************************************************************************/ +void +byte_hexdump(const char *message, const uint8_t *ptr, int len) +{ + int ctr; + + printf("%s:\n", message); + for (ctr = 0; ctr < len; ctr++) { + printf("0x%02X ", ptr[ctr] & 0xff); + if (!((ctr + 1) % 16)) + printf("\n"); + } + printf("\n"); + printf("\n"); +}; diff --git a/test/include/utils.h b/test/include/utils.h index 9d620c3c..181d935c 100644 --- a/test/include/utils.h +++ b/test/include/utils.h @@ -40,6 +40,8 @@ void hexdump(FILE *fp, const char *msg, const void *p, size_t len); void hexdump_ex(FILE *fp, const char *msg, const void *p, size_t len, const void *start_ptr); +void +byte_hexdump(const char *message, const uint8_t *ptr, int len); int update_flags_and_archs(const char *arg, uint8_t arch_support[IMB_ARCH_NUM], uint64_t *flags); diff --git a/test/kat-app/zuc_eea3_test.c b/test/kat-app/zuc_eea3_test.c index 6d695a86..0a22231a 100644 --- a/test/kat-app/zuc_eea3_test.c +++ b/test/kat-app/zuc_eea3_test.c @@ -86,8 +86,6 @@ validate_zuc256_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t * int validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); -static void -byte_hexdump(const char *message, const uint8_t *ptr, int len); /****************************************************************************** * @ingroup zuc_functionalTest_app @@ -914,24 +912,3 @@ validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstD } return ret; }; -/***************************************************************************** - ** @description - utility function to dump test buffers$ - ** $ - ** @param message [IN] - debug message to print$ - ** @param ptr [IN] - pointer to beginning of buffer.$ - ** @param len [IN] - length of buffer.$ - *****************************************************************************/ -static void -byte_hexdump(const char *message, const uint8_t *ptr, int len) -{ - int ctr; - - printf("%s:\n", message); - for (ctr = 0; ctr < len; ctr++) { - printf("0x%02X ", ptr[ctr] & 0xff); - if (!((ctr + 1) % 16)) - printf("\n"); - } - printf("\n"); - printf("\n"); -}; diff --git a/test/kat-app/zuc_eia3_test.c b/test/kat-app/zuc_eia3_test.c index 5cc65d67..b0774290 100644 --- a/test/kat-app/zuc_eia3_test.c +++ b/test/kat-app/zuc_eia3_test.c @@ -93,9 +93,6 @@ int validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type); -static void -byte_hexdump(const char *message, const uint8_t *ptr, int len); - /****************************************************************************** * @ingroup zuc_functionalTest_app * @@ -961,25 +958,3 @@ validate_zuc256_EIA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD } return ret; }; - -/***************************************************************************** - ** @description - utility function to dump test buffers$ - ** $ - ** @param message [IN] - debug message to print$ - ** @param ptr [IN] - pointer to beginning of buffer.$ - ** @param len [IN] - length of buffer.$ - *****************************************************************************/ -static void -byte_hexdump(const char *message, const uint8_t *ptr, int len) -{ - int ctr; - - printf("%s:\n", message); - for (ctr = 0; ctr < len; ctr++) { - printf("0x%02X ", ptr[ctr] & 0xff); - if (!((ctr + 1) % 16)) - printf("\n"); - } - printf("\n"); - printf("\n"); -}; -- GitLab From c559430631ec9a906ead24d8a5732806caba0819 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 25 Oct 2023 16:44:40 +0100 Subject: [PATCH 171/204] test: [kat-app] convert remaining ZUC-EIA3 vectors to standard format --- test/kat-app/zuc_eea3_128.json.c | 16 +++++ test/kat-app/zuc_eea3_test.c | 108 ++++++++++++++----------------- test/kat-app/zuc_test_vectors.h | 34 ---------- 3 files changed, 65 insertions(+), 93 deletions(-) diff --git a/test/kat-app/zuc_eea3_128.json.c b/test/kat-app/zuc_eea3_128.json.c index 175068c8..f148c43b 100644 --- a/test/kat-app/zuc_eea3_128.json.c +++ b/test/kat-app/zuc_eea3_128.json.c @@ -164,5 +164,21 @@ const struct cipher_test zuc_eea3_128_test_json[] = { "\x74\xaf\x57\xb4\x71\xdf\x4b\x27\x68\xfd\x79\xc1\x54\x0f\xb3\xed\xf2\xea\x22\xcb\x69\xbe" "\xc0\xcf\x8d\x93\x3d\x9c\x6f\xdd\x64\x5e\x85\x05\x91\xcc\xa3\xd6\x2c\x0c\xc0\x00", 1, 4019 }, + /* + * ZUC algorithm tests from 3GPP Document3: Implementator's Test Data. + * Version 1.1 (4th Jan. 2011). + */ + { 128, 128, 6, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00", "\x27\xbe\xde\x74\x01\x80\x82\xda", 1, 64 }, + { 128, 128, 7, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00", "\x06\x57\xcf\xa0\x70\x96\x39\x8b", 1, 64 }, + { 128, 128, 8, "\x3d\x4c\x4b\xe9\x6a\x82\xfd\xae\xb5\x8f\x64\x1d\xb1\x7b\x45\x5b", + "\x84\x31\x9a\xa8\xde\x69\x15\xca\x1f\x6b\xda\x6b\xfb\xd8\xc7\x66", + "\x00\x00\x00\x00\x00\x00\x00\x00", "\x14\xf1\xc2\x72\x32\x79\xc4\x19", 1, 64 }, + { 128, 128, 9, "\x4d\x32\x0b\xfa\xd4\xc2\x85\xbf\xd6\xb8\xbd\x00\xf3\x9d\x8b\x41", + "\x52\x95\x9d\xab\xa0\xbf\x17\x6e\xce\x2d\xc3\x15\x04\x9e\xb5\x74", + "\x00\x00\x00\x00\x00\x00\x00\x00", "\xed\x44\x00\xe7\x06\x33\xe5\xc5", 1, 64 }, { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/zuc_eea3_test.c b/test/kat-app/zuc_eea3_test.c index 0a22231a..29eb1b07 100644 --- a/test/kat-app/zuc_eea3_test.c +++ b/test/kat-app/zuc_eea3_test.c @@ -191,15 +191,6 @@ freePtrArray(uint8_t *pArr[MAXBUFS], uint32_t arrayLength) free(pArr[i]); } -static uint32_t -bswap4(const uint32_t val) -{ - return ((val >> 24) | /**< A*/ - ((val & 0xff0000) >> 8) | /**< B*/ - ((val & 0xff00) << 8) | /**< C*/ - (val << 24)); /**< D*/ -} - int zuc_eea3_test(struct IMB_MGR *mb_mgr) { @@ -240,11 +231,6 @@ zuc_eea3_test(struct IMB_MGR *mb_mgr) goto exit_zuc_eea3_test; } - if (validate_zuc_algorithm(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0])) - test_suite_update(&eea3_ctx, 0, 1); - else - test_suite_update(&eea3_ctx, 1, 0); - /* Direct API tests */ if (validate_zuc_EEA_1_block(mb_mgr, pSrcData[0], pSrcData[0], pKeys[0], pIV[0], TEST_DIRECT_API)) @@ -543,11 +529,18 @@ validate_zuc_EEA_1_block(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDs int retTmp; uint32_t byteLength; const unsigned int iv_len = IMB_ZUC_IV_LEN_IN_BYTES; - struct zuc_eea3_128_params p = { 0 }; + + /* generate IV if params stored in vector */ + if ((vectors[i].ivSize / 8) != iv_len) { + struct zuc_eea3_128_params p = { 0 }; + + zuc_eea3_128_set_params(&vectors[i], &p); + zuc_eea3_iv_gen(*p.count, *p.bearer, *p.direction, pIV); + } else + /* actual iv stored in vector */ + memcpy(pIV, vectors[i].iv, IMB_ZUC_IV_LEN_IN_BYTES); memcpy(pKeys, vectors[i].key, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_128_set_params(&vectors[i], &p); - zuc_eea3_iv_gen(*p.count, *p.bearer, *p.direction, pIV); byteLength = (uint32_t) (vectors[i].msgSize + 7) / 8; memcpy(pSrcData, vectors[i].msg, byteLength); if (type == TEST_SINGLE_JOB_API) @@ -580,13 +573,21 @@ submit_and_verify(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData for (i = 0; i < num_buffers; i++) { const struct cipher_test *vector = &vectors[buf_idx[i]]; - struct zuc_eea3_128_params p = { 0 }; packetLen[i] = (uint32_t) (vector->msgSize + 7) / 8; - memcpy(pKeys[i], vector->key, IMB_ZUC_KEY_LEN_IN_BYTES); - zuc_eea3_128_set_params(&vectors[buf_idx[i]], &p); - zuc_eea3_iv_gen(*p.count, *p.bearer, *p.direction, pIV[i]); iv_lens[i] = IMB_ZUC_IV_LEN_IN_BYTES; + + /* generate IV if params stored in vector */ + if ((vector->ivSize / 8) != iv_lens[i]) { + struct zuc_eea3_128_params p = { 0 }; + + zuc_eea3_128_set_params(vector, &p); + zuc_eea3_iv_gen(*p.count, *p.bearer, *p.direction, pIV[i]); + } else + /* actual iv stored in vector */ + memcpy(pIV[i], vector->iv, IMB_ZUC_IV_LEN_IN_BYTES); + + memcpy(pKeys[i], vector->key, IMB_ZUC_KEY_LEN_IN_BYTES); if (dir == IMB_DIR_ENCRYPT) memcpy(pSrcData[i], vector->msg, packetLen[i]); else @@ -715,12 +716,22 @@ int validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, const enum api_type type) { - uint32_t i, j; + uint32_t i, j, num_vectors = 0; int ret = 0; int retTmp; uint32_t buf_idx[4]; + const struct cipher_test *vectors = zuc_eea3_128_test_json; + + /* calculate number of vectors */ + for (i = 0; vectors[i].msg != NULL; i++) + num_vectors++; + + if (num_vectors == 0) { + printf("ZUC-EEA3 128 4 block - No vectors found!\n"); + return -1; + } - for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { + for (i = 0; i < num_vectors; i++) { for (j = 0; j < 4; j++) buf_idx[j] = i; @@ -736,9 +747,9 @@ validate_zuc_EEA_4_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p /* Encrypt 4 different buffers, grouping all available test vectors * in groups of 4 */ - for (i = 0; i < (NUM_ZUC_EEA3_TESTS - 4); i++) { + for (i = 0; i < num_vectors; i++) { for (j = 0; j < 4; j++) - buf_idx[j] = i + j; + buf_idx[j] = (i + j) % num_vectors; retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_ENCRYPT, 1, 4, buf_idx); @@ -758,13 +769,23 @@ validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) { - uint32_t i, j; + uint32_t i, j, num_vectors = 0; int ret = 0; int retTmp; uint32_t buf_idx[MAXBUFS]; + const struct cipher_test *vectors = zuc_eea3_128_test_json; + + /* calculate number of vectors */ + for (i = 0; vectors[i].msg != NULL; i++) + num_vectors++; + + if (num_vectors == 0) { + printf("ZUC-EEA3 128 N block - No vectors found!\n"); + return -1; + } assert(numBuffs > 0); - for (i = 0; i < NUM_ZUC_EEA3_TESTS; i++) { + for (i = 0; i < num_vectors; i++) { for (j = 0; j < numBuffs; j++) buf_idx[j] = i; @@ -781,7 +802,7 @@ validate_zuc_EEA_n_block(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p /* Get all test vectors and encrypt them together */ for (i = 0; i < numBuffs; i++) - buf_idx[i] = i % NUM_ZUC_EEA3_TESTS; + buf_idx[i] = i % num_vectors; retTmp = submit_and_verify(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_ENCRYPT, 1, numBuffs, buf_idx); @@ -881,34 +902,3 @@ validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD return ret; } - -int -validate_zuc_algorithm(struct IMB_MGR *mb_mgr, uint8_t *pSrcData, uint8_t *pDstData, uint8_t *pKeys, - uint8_t *pIV) -{ - uint32_t i; - int ret = 0; - union SwapBytes { - uint8_t sbb[8]; - uint32_t sbw[2]; - } swapBytes; - - for (i = 0; i < NUM_ZUC_ALG_TESTS; i++) { - memcpy(pKeys, testZUC_vectors[i].CK, IMB_ZUC_KEY_LEN_IN_BYTES); - memcpy(pIV, testZUC_vectors[i].IV, IMB_ZUC_IV_LEN_IN_BYTES); - memset(pSrcData, 0, 8); - IMB_ZUC_EEA3_1_BUFFER(mb_mgr, pKeys, pIV, pSrcData, pDstData, 8); - swapBytes.sbw[0] = bswap4(testZUC_vectors[i].Z[0]); - swapBytes.sbw[1] = bswap4(testZUC_vectors[i].Z[1]); - ret = memcmp(pDstData, swapBytes.sbb, 8); - if (ret) - printf("ZUC 1 algorithm test %u: FAIL\n", i); -#ifdef DEBUG - else { - if (!quiet_mode) - printf("ZUC 1 algorithm test %u: PASS\n", i); - } -#endif - } - return ret; -}; diff --git a/test/kat-app/zuc_test_vectors.h b/test/kat-app/zuc_test_vectors.h index 4f4b5bc5..e8e36cc8 100644 --- a/test/kat-app/zuc_test_vectors.h +++ b/test/kat-app/zuc_test_vectors.h @@ -30,20 +30,11 @@ #define MAX_BUFFER_LENGTH_IN_BITS 5670 /* biggest test is EIA test 5 */ #define MAX_BUFFER_LENGTH_IN_BYTES ((MAX_BUFFER_LENGTH_IN_BITS) + 7) / 8 -#define NUM_ZUC_ALG_TESTS 3 -#define NUM_ZUC_EEA3_TESTS 5 #define NUM_ZUC_256_EEA3_TESTS 10 #ifdef __aarch64__ #define NUM_ZUC_256_EIA3_TESTS 15 #endif -typedef struct testZUC_vectors_t { - uint8_t CK[16]; - uint8_t IV[16]; - uint32_t Z[2]; - -} testZUC_vectors_t; - typedef struct test256EEA3_vectors_t { uint8_t CK[32]; uint8_t IV[25]; @@ -53,31 +44,6 @@ typedef struct test256EEA3_vectors_t { uint8_t ciphertext[MAX_BUFFER_LENGTH_IN_BYTES]; } test256EEA_vectors_t; -/* - * ZUC algorithm tests from 3GPP Document3: Implementator's Test Data. - * Version 1.1 (4th Jan. 2011). - */ -const struct testZUC_vectors_t testZUC_vectors[] = { - { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0x27BEDE74, 0x018082DA } }, - { { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF }, - { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF }, - { 0x0657CFA0, 0x7096398B } }, - { { 0x3D, 0x4C, 0x4B, 0xE9, 0x6A, 0x82, 0xFD, 0xAE, 0xB5, 0x8F, 0x64, 0x1D, 0xB1, 0x7B, - 0x45, 0x5B }, - { 0x84, 0x31, 0x9A, 0xA8, 0xDE, 0x69, 0x15, 0xCA, 0x1F, 0x6B, 0xDA, 0x6B, 0xFB, 0xD8, - 0xC7, 0x66 }, - { 0x14F1C272, 0x3279C419 } }, - { { 0x4D, 0x32, 0x0B, 0xFA, 0xD4, 0xC2, 0x85, 0xBF, 0xD6, 0xB8, 0xBD, 0x00, 0xF3, 0x9D, - 0x8B, 0x41 }, - { 0x52, 0x95, 0x9D, 0xAB, 0xA0, 0xBF, 0x17, 0x6E, 0xCE, 0x2D, 0xC3, 0x15, 0x04, 0x9E, - 0xB5, 0x74 }, - { 0xED4400E7, 0x0633E5C5 } }, -}; - /* ZUC-256 */ const struct test256EEA3_vectors_t test256EEA3_vectors[] = { /* TestSet 1 */ -- GitLab From bb3b7039cbcde3a72d9c5d516dcfd5b514dfab05 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 24 Oct 2023 18:52:46 +0100 Subject: [PATCH 172/204] test: [kat-app] add KASUMI vectors in new format --- test/kat-app/Makefile | 3 +- test/kat-app/kasumi_f8.json.c | 400 ++++++++++++++++++++++++++++++++++ test/kat-app/kasumi_f9.json.c | 125 +++++++++++ test/kat-app/win_x64.mak | 3 +- 4 files changed, 529 insertions(+), 2 deletions(-) create mode 100644 test/kat-app/kasumi_f8.json.c create mode 100644 test/kat-app/kasumi_f9.json.c diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index 409ab414..b0b954c0 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -45,7 +45,8 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ - sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c + sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c kasumi_f8.json.c \ + kasumi_f9.json.c else # aarch64 SOURCES := main.c api_test.c zuc_eea3_test.c zuc_eia3_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ diff --git a/test/kat-app/kasumi_f8.json.c b/test/kat-app/kasumi_f8.json.c new file mode 100644 index 00000000..92a63ed3 --- /dev/null +++ b/test/kat-app/kasumi_f8.json.c @@ -0,0 +1,400 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* KASUMI F9 UEA1, */ +#include "cipher_test.h" + +const struct cipher_test kasumi_f8_json[] = { + { 64, 128, 201, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 202, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 203, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 204, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 205, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 206, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 207, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 208, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 209, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 210, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 211, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 212, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 213, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 214, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 215, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 216, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 217, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 218, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 219, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 220, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 221, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 222, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 223, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 224, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 225, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 226, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 227, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 228, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xd8", + "\xbf\x35\xde\x33\x7a\xa3\xb8\x32\x60\x20\x2f\x16\x4d\x9a\xa9\xd0\xf1\x7b\x6f\x4b\xfd\x76" + "\xad\xf5\x08\x37\x01\xd0\xda\x5d\x8e\x16\x9c\x83\x05\x65\x5b\xed\xcb\x56\xd2\xe4\x0f\x28" + "\x14\xa7\xee\x7d\xb9\xc0\xb2\x9c\xf1\x3d\xb4\xb1\xf3\x70\x6b\xb6\xb3\x81\xf8\x92", + 1, 512 }, + { 64, 128, 229, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x80", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 800 }, + { 64, 128, 301, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x72\xa4\xf2\x0f\x64\x00\x00\x00", + "\x7e\xc6\x12\x72\x74\x3b\xf1\x61\x47\x26\x44\x6a\x6c\x38\xce\xd1\x66\xf6\xca\x76\xeb\x54" + "\x30\x04\x42\x86\x34\x6c\xef\x13\x0f\x92\x92\x2b\x03\x45\x0d\x3a\x99\x75\xe5\xbd\x2e\xa0" + "\xeb\x55\xad\x8e\x1b\x19\x9e\x3e\xc4\x31\x60\x20\xe9\xa1\xb2\x85\xe7\x62\x79\x53\x59\xb7" + "\xbd\xfd\x39\xbe\xf4\xb2\x48\x45\x83\xd5\xaf\xe0\x82\xae\xe6\x38\xbf\x5f\xd5\xa6\x06\x19" + "\x39\x01\xa0\x8f\x4a\xb4\x1a\xab\x9b\x13\x48\x83", + "\xd1\xe2\xde\x70\xee\xf8\x6c\x69\x64\xfb\x54\x2b\xc2\xd4\x60\xaa\xbf\xaa\x10\xa4\xa0\x93" + "\x26\x2b\x7d\x19\x9e\x70\x6f\xc2\xd4\x89\x15\x53\x29\x69\x10\xf3\xa9\x73\x01\x26\x82\xe4" + "\x1c\x4e\x2b\x02\xbe\x20\x17\xb7\x25\x3b\xbf\x93\x09\xde\x58\x19\xcb\x42\xe8\x19\x56\xf4" + "\xc9\x9b\xc9\x76\x5c\xaf\x53\xb1\xd0\xbb\x82\x79\x82\x6a\xdb\xbc\x55\x22\xe9\x15\xc1\x20" + "\xa6\x18\xa5\xa7\xf5\xe8\x97\x08\x93\x39\x65\x0f", + 1, 798 }, + { 64, 128, 302, "\xef\xa8\xb2\x22\x9e\x72\x0c\x2a\x7c\x36\xea\x55\xe9\x60\x56\x95", + "\xe2\x8b\xcf\x7b\xc0\x00\x00\x00", + "\x10\x11\x12\x31\xe0\x60\x25\x3a\x43\xfd\x3f\x57\xe3\x76\x07\xab\x28\x27\xb5\x99\xb6\xb1" + "\xbb\xda\x37\xa8\xab\xcc\x5a\x8c\x55\x0d\x1b\xfb\x2f\x49\x46\x24\xfb\x50\x36\x7f\xa3\x6c" + "\xe3\xbc\x68\xf1\x1c\xf9\x3b\x15\x10\x37\x6b\x02\x13\x0f\x81\x2a\x9f\xa1\x69\xdb", + "\x3d\xea\xcc\x7c\x15\x82\x1c\xaa\x89\xee\xca\xde\x9b\x5b\xd3\x61\x4b\xd0\xc8\x41\x9d\x71" + "\x03\x85\xdd\xbe\x58\x49\xef\x1b\xac\x5a\xe8\xb1\x4a\x5b\x0a\x67\x41\x52\x1e\xb4\xe0\x0b" + "\xb9\xec\xf3\xe9\xf7\xcc\xb9\xca\xe7\x41\x52\xd7\xf4\xe2\xa0\x34\xb6\xea\x00\xef", + 1, 510 }, + { 64, 128, 303, "\xd3\xc5\xd5\x92\x32\x7f\xb1\x1c\x40\x35\xc6\x68\x0a\xf8\xc6\xd1", + "\x39\x8a\x59\xb4\x2c\x00\x00\x00", + "\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c\xe3\x3e\x2c\xc3\xc0" + "\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x66\xb1\xf7", + "\x5b\xb9\x43\x1b\xb1\xe9\x8b\xd1\x1b\x93\xdb\x7c\x3d\x45\x13\x65\x59\xbb\x86\xa2\x95\xaa" + "\x20\x4e\xcb\xeb\xf6\xf7\xa5\x10\x15\x17", + 1, 253 }, + { 64, 128, 304, "\x5a\xcb\x1d\x64\x4c\x0d\x51\x20\x4e\xa5\xf1\x45\x10\x10\xd8\x52", + "\xfa\x55\x6b\x26\x1c\x00\x00\x00", + "\xad\x9c\x44\x1f\x89\x0b\x38\xc4\x57\xa4\x9d\x42\x14\x07\xe8", + "\x9b\xc9\x2c\xa8\x03\xc6\x7b\x28\xa1\x1a\x4b\xee\x5a\x0c\x25", 1, 120 }, + { 64, 128, 305, "\x60\x90\xea\xe0\x4c\x83\x70\x6e\xec\xbf\x65\x2b\xe8\xe3\x65\x66", + "\x72\xa4\xf2\x0f\x48\x00\x00\x00", + "\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x42\x86\xb2\x99\x78\x3d\xaf\x44\x2c\x09\x9f\x7a\xb0\xf5" + "\x8d\x5c\x8e\x46\xb1\x04\xf0\x8f\x01\xb4\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x36\xbd\x1a\x3d" + "\x90\xdc\x3a\x41\xb4\x6d\x51\x67\x2a\xc4\xc9\x66\x3a\x2b\xe0\x63\xda\x4b\xc8\xd2\x80\x8c" + "\xe3\x3e\x2c\xcc\xbf\xc6\x34\xe1\xb2\x59\x06\x08\x76\xa0\xfb\xb5\xa4\x37\xeb\xcc\x8d\x31" + "\xc1\x9e\x44\x54\x31\x87\x45\xe3\x98\x76\x45\x98\x7a\x98\x6f\x2c\xb7", + "\xdd\xb3\x64\xdd\x2a\xae\xc2\x4d\xff\x29\x19\x57\xb7\x8b\xad\x06\x3a\xc5\x79\xcd\x90\x41" + "\xba\xbe\x89\xfd\x19\x5c\x05\x78\xcb\x9f\xde\x42\x17\x56\x61\x78\xd2\x02\x40\x20\x6d\x07" + "\xcf\xa6\x19\xec\x05\x9f\x63\x51\x44\x59\xfc\x10\xd4\x2d\xc9\x93\x4e\x56\xeb\xc0\xcb\xc6" + "\x0d\x4d\x2d\xf1\x74\x77\x4c\xbd\xcd\x5d\xa4\xa3\x50\x31\x7a\x7f\x12\xe1\x94\x94\x71\xf8" + "\xa2\x95\xf2\x72\xe6\x8f\xc0\x71\x59\xb0\x7d\x8e\x2d\x26\xe4\x59\x9f", + 1, 837 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } +}; diff --git a/test/kat-app/kasumi_f9.json.c b/test/kat-app/kasumi_f9.json.c new file mode 100644 index 00000000..e13192c0 --- /dev/null +++ b/test/kat-app/kasumi_f9.json.c @@ -0,0 +1,125 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* KASUMI F9 UIA1, */ +#include "mac_test.h" + +const struct mac_test kasumi_f9_json[] = { + /* Vectors from 3GPP */ + { 128, 32, 1, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x38\xa6\xf0\x56\x05\xd2\xec\x49\x6b\x22\x77\x37\x29\x6f\x39\x3c\x80\x79\x35\x3e\xdc\x87" + "\xe2\xe8\x05\xd2\xec\x49\xa4\xf2\xd8\xe2", + "\xf6\x3b\xd7\x2c", 1, 256, "", 0 }, + { 128, 32, 2, "\xd4\x2f\x68\x24\x28\x20\x1c\xaf\xcd\x9f\x97\x94\x5e\x6d\xe7\xb7", + "\x3e\xdc\x87\xe2\xa4\xf2\xd8\xe2\xb5\x92\x43\x84\x32\x8a\x4a\xe0\x0b\x73\x71\x09\xf8\xb6" + "\xc8\xdd\x2b\x4d\xb6\x3d\xd5\x33\x98\x1c\xeb\x19\xaa\xd5\x2a\x5b\x2b\xc3", + "\xa9\xda\xf1\xff", 1, 320, "", 0 }, + { 128, 32, 3, "\xc7\x36\xc6\xaa\xb2\x2b\xff\xf9\x1e\x26\x98\xd2\xe2\x2a\xd5\x7e", + "\x14\x79\x3e\x41\x03\x97\xe8\xfd\xd0\xa7\xd4\x63\xdf\x9f\xb2\xb2\x78\x83\x3f\xa0\x2e\x23" + "\x5a\xa1\x72\xbd\x97\x0c\x14\x73\xe1\x29\x07\xfb\x64\x8b\x65\x99\xaa\xa0\xb2\x4a\x03\x86" + "\x65\x42\x2b\x20\xa4\x99\x27\x6a\x50\x42\x70\x09\xc0", + "\xdd\x7d\xfa\xdd", 1, 456, "", 0 }, + { 128, 32, 4, "\x7e\x5e\x94\x43\x1e\x11\xd7\x38\x28\xd7\x39\xcc\x6c\xed\x45\x73", + "\x36\xaf\x61\x44\x98\x38\xf0\x3a\xb3\xd3\xc9\x17\x0a\x4e\x16\x32\xf6\x0f\x86\x10\x13\xd2" + "\x2d\x84\xb7\x26\xb6\xa2\x78\xd8\x02\xd1\xee\xaf\x13\x21\xba\x59\x29\xdf", + "\x2b\xee\xf3\xac", 1, 320, "", 0 }, + { 128, 32, 5, "\xfd\xb9\xcf\xdf\x28\x93\x6c\xc4\x83\xa3\x18\x69\xd8\x1b\x8f\xab", + "\x36\xaf\x61\x44\x98\x38\xf0\x3a\x59\x32\xbc\x0a\xce\x2b\x0a\xba\x33\xd8\xac\x18\x8a\xc5" + "\x4f\x34\x6f\xad\x10\xbf\x9d\xee\x29\x20\xb4\x3b\xd0\xc5\x3a\x91\x5c\xb7\xdf\x6c\xaa\x72" + "\x05\x3a\xbf\xf3\x80", + "\x15\x37\xd3\x16", 1, 392, "", 0 }, + { 128, 32, 6, "\x68\x32\xa6\x5c\xff\x44\x73\x62\x1e\xbd\xd4\xba\x26\xa9\x21\xfe", + "\x36\xaf\x61\x44\x98\x38\xf0\x3a\xd3\xc5\x38\x39\x62\x68\x20\x71\x77\x65\x66\x76\x20\x32" + "\x38\x37\x63\x62\x40\x98\x1b\xa6\x82\x4c\x1b\xfb\x1a\xb4\x85\x47\x20\x29\xb7\x1d\x80\x8c" + "\xe3\x3e\x2c\xc3\xc0\xb5\xfc\x1f\x3d\xe8\xa6\xdc\x80", + "\x8b\x2d\x57\x0f", 1, 456, "", 0 }, + { 128, 32, 7, "\xd3\x41\x9b\xe8\x21\x08\x7a\xcd\x02\x12\x3a\x92\x48\x03\x33\x59", + "\xc7\x59\x0e\xa9\x57\xd5\xdf\x7d\xbb\xb0\x57\x03\x88\x09\x49\x6b\xcf\xf8\x6d\x6f\xbc\x8c" + "\xe5\xb1\x35\xa0\x6b\x16\x60\x54\xf2\xd5\x65\xbe\x8a\xce\x75\xdc\x85\x1e\x0b\xcd\xd8\xf0" + "\x71\x41\xc4\x95\x87\x2f\xb5\xd8\xc0\xc6\x6a\x8b\x6d\xa5\x56\x66\x3e\x4e\x46\x12\x05\xd8" + "\x45\x80\xbe\xe5\xbc\x7e\x80", + "\x02\x15\x81\x70", 1, 584, "", 0 }, + { 128, 32, 8, "\x83\xfd\x23\xa2\x44\xa7\x4c\xf3\x58\xda\x30\x19\xf1\x72\x26\x35", + "\x36\xaf\x61\x44\x4f\x30\x2a\xd2\x35\xc6\x87\x16\x63\x3c\x66\xfb\x75\x0c\x26\x68\x65\xd5" + "\x3c\x11\xea\x05\xb1\xe9\xfa\x49\xc8\x39\x8d\x48\xe1\xef\xa5\x90\x9d\x39\x47\x90\x28\x37" + "\xf5\xae\x96\xd5\xa0\x5b\xc8\xd6\x1c\xa8\xdb\xef\x1b\x13\xa4\xb4\xab\xfe\x4f\xb1\x00\x60" + "\x45\xb6\x74\xbb\x54\x72\x93\x04\xc3\x82\xbe\x53\xa5\xaf\x05\x55\x61\x76\xf6\xea\xa2\xef" + "\x1d\x05\xe4\xb0\x83\x18\x1e\xe6\x74\xcd\xa5\xa4\x85\xf7\x4d\x7a\xc0", + "\x95\xae\x41\xba", 1, 840, "", 0 }, + { 128, 32, 9, "\xf4\xeb\xec\x69\xe7\x3e\xaf\x2e\xb2\xcf\x6a\xf4\xb3\x12\x0f\xfd", + "\x29\x6f\x39\x3c\x6b\x22\x77\x37\x10\xbf\xff\x83\x9e\x0c\x71\x65\x8d\xbb\x2d\x17\x07\xe1" + "\x45\x72\x4f\x41\xc1\x6f\x48\xbf\x40\x3c\x3b\x18\xe3\x8f\xd5\xd1\x66\x3b\x6f\x6d\x90\x01" + "\x93\xe3\xce\xa8\xbb\x4f\x1b\x4f\x5b\xe8\x22\x03\x22\x32\xa7\x8d\x7d\x75\x23\x8d\x5e\x6d" + "\xae\xcd\x3b\x43\x22\xcf\x59\xbc\x7e\xa8\x4a\xb1\x88\x11\xb5\xbf\xb7\xbc\x55\x3f\x4f\xe4" + "\x44\x78\xce\x28\x7a\x14\x87\x99\x90\xd1\x8d\x12\xca\x79\xd2\xc8\x55\x14\x90\x21\xcd\x5c" + "\xe8\xca\x03\x71\xca\x04\xfc\xce\x14\x3e\x3d\x7c\xfe\xe9\x45\x85\xb5\x88\x5c\xac\x46\x06" + "\x8b\xc0", + "\xc3\x83\x83\x9d", 1, 1072, "", 0 }, + { 128, 32, 10, "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", + "\x78\x27\xfa\xb2\xa5\x6c\x6c\xa2\x70\xde\xdf\x2d\xc4\x2c\x5c\xbd\x3a\x96\xf8\xa0\xb1\x14" + "\x18\xb3\x60\x8d\x57\x33\x60\x4a\x2c\xd3\x6a\xab\xc7\x0c\xe3\x19\x3b\xb5\x15\x3b\xe2\xd3" + "\xc0\x6d\xfd\xb2\xd1\x6e\x9c\x35\x71\x58\xbe\x6a\x41\xd6\xb8\x61\xe4\x91\xdb\x3f\xbf\xeb" + "\x51\x8e\xfc\xf0\x48\xd7\xd5\x89\x53\x73\x0f\xf3\x0c\x9e\xc4\x70\xff\xcd\x66\x3d\xc3\x42" + "\x01\xc3\x6a\xdd\xc0\x11\x1c\x35\xb3\x8a\xfe\xe7\xcf\xdb\x58\x2e\x37\x31\xf8\xb4\xba\xa8" + "\xd1\xa8\x9c\x06\xe8\x11\x99\xa9\x71\x62\x27\xbe\x34\x4e\xfc\xb4\x36\xdd\xd0\xf0\x96\xc0" + "\x64\xc3\xb5\xe2\xc3\x99\x99\x3f\xc7\x73\x94\xf9\xe0\x97\x20\xa8\x11\x85\x0e\xf2\x3b\x2e" + "\xe0\x5d\x9e\x61\x73\x60\x9d\x86\xe1\xc0\xc1\x8e\xa5\x1a\x01\x2a\x00\xbb\x41\x3b\x9c\xb8" + "\x18\x8a\x70\x3c\xd6\xba\xe3\x1c\xc6\x7b\x34\xb1\xb0\x00\x19\xe6\xa2\xb2\xa6\x90\xf0\x26" + "\x71\xfe\x7c\x9e\xf8\xde\xc0\x09\x4e\x53\x37\x63\x47\x8d\x58\xd2\xc5\xf5\xb8\x27\xa0\x14" + "\x8c\x59\x48\xa9\x69\x31\xac\xf8\x4f\x46\x5a\x64\xe6\x2c\xe7\x40\x07\xe9\x91\xe3\x7e\xa8" + "\x23\xfa\x0f\xb2\x19\x23\xb7\x99\x05\xb7\x33\xb6\x31\xe6\xc7\xd6\x86\x0a\x38\x31\xac\x35" + "\x1a\x9c\x73\x0c\x52\xff\x72\xd9\xd3\x08\xee\xdb\xab\x21\xfd\xe1\x43\xa0\xea\x17\xe2\x3e" + "\xdc\x1f\x74\xcb\xb3\x63\x8a\x20\x33\xaa\xa1\x54\x64\xea\xa7\x33\x38\x5d\xbb\xeb\x6f\xd7" + "\x35\x09\xb8\x57\xe6\xa4\x19\xdc\xa1\xd8\x90\x7a\xf9\x77\xfb\xac\x4d\xfa\x35\xef", + "\x3a\xe4\xbf\xf3", 1, 2624, "", 0 }, + { 128, 32, 101, "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00\x95\x2c\x49\x10\x48\x81\xff\x48", + "\x6b\x22\x77\x37\x29\x6f\x39\x3c\x80\x79\x35\x3e\xdc\x87\xe2\xe8\x05\xd2\xec\x49\xa4\xf2" + "\xd8\xe0", + "\xf6\x3b\xd7\x2c", 1, 189, "\x00\x38\xa6\xf0\x56\x05\xd2\xec\x49", 72 }, + { 128, 32, 102, "\xd4\x2f\x68\x24\x28\x20\x1c\xaf\xcd\x9f\x97\x94\x5e\x6d\xe7\xb7", + "\xb5\x92\x43\x84\x32\x8a\x4a\xe0\x0b\x73\x71\x09\xf8\xb6\xc8\xdd\x2b\x4d\xb6\x3d\xd5\x33" + "\x98\x1c\xeb\x19\xaa\xd5\x2a\x5b\x2b\xc0", + "\xa9\xda\xf1\xff", 1, 254, "\x01\x3e\xdc\x87\xe2\xa4\xf2\xd8\xe2", 72 }, + { 128, 32, 103, "\xfd\xb9\xcf\xdf\x28\x93\x6c\xc4\x83\xa3\x18\x69\xd8\x1b\x8f\xab", + "\x59\x32\xbc\x0a\xce\x2b\x0a\xba\x33\xd8\xac\x18\x8a\xc5\x4f\x34\x6f\xad\x10\xbf\x9d\xee" + "\x29\x20\xb4\x3b\xd0\xc5\x3a\x91\x5c\xb7\xdf\x6c\xaa\x72\x05\x3a\xbf\xf2", + "\x15\x37\xd3\x16", 1, 319, "\x01\x36\xaf\x61\x44\x98\x38\xf0\x3a", 72 }, + { 128, 32, 104, "\xc7\x36\xc6\xaa\xb2\x2b\xff\xf9\x1e\x26\x98\xd2\xe2\x2a\xd5\x7e", + "\xd0\xa7\xd4\x63\xdf\x9f\xb2\xb2\x78\x83\x3f\xa0\x2e\x23\x5a\xa1\x72\xbd\x97\x0c\x14\x73" + "\xe1\x29\x07\xfb\x64\x8b\x65\x99\xaa\xa0\xb2\x4a\x03\x86\x65\x42\x2b\x20\xa4\x99\x27\x6a" + "\x50\x42\x70\x09", + "\xdd\x7d\xfa\xdd", 1, 384, "\x01\x14\x79\x3e\x41\x03\x97\xe8\xfd", 72 }, + { 128, 32, 105, "\xf4\xeb\xec\x69\xe7\x3e\xaf\x2e\xb2\xcf\x6a\xf4\xb3\x12\x0f\xfd", + "\x10\xbf\xff\x83\x9e\x0c\x71\x65\x8d\xbb\x2d\x17\x07\xe1\x45\x72\x4f\x41\xc1\x6f\x48\xbf" + "\x40\x3c\x3b\x18\xe3\x8f\xd5\xd1\x66\x3b\x6f\x6d\x90\x01\x93\xe3\xce\xa8\xbb\x4f\x1b\x4f" + "\x5b\xe8\x22\x03\x22\x32\xa7\x8d\x7d\x75\x23\x8d\x5e\x6d\xae\xcd\x3b\x43\x22\xcf\x59\xbc" + "\x7e\xa8\x4a\xb1\x88\x11\xb5\xbf\xb7\xbc\x55\x3f\x4f\xe4\x44\x78\xce\x28\x7a\x14\x87\x99" + "\x90\xd1\x8d\x12\xca\x79\xd2\xc8\x55\x14\x90\x21\xcd\x5c\xe8\xca\x03\x71\xca\x04\xfc\xce" + "\x14\x3e\x3d\x7c\xfe\xe9\x45\x85\xb5\x88\x5c\xac\x46\x06\x8b", + "\xc3\x83\x83\x9d", 1, 1000, "\x01\x29\x6f\x39\x3c\x6b\x22\x77\x37", 72 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 4d8de1c5..1f6713fc 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,8 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj kasumi_f8.json.obj kasumi_f9.json.obj + TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) all: $(APP).exe tests.dep -- GitLab From b7b5906094dcb5e3037257f6125466fba68eae6a Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 24 Oct 2023 18:54:15 +0100 Subject: [PATCH 173/204] test: [kat-app] change KASUMI F8 test code to use new vector format --- test/kat-app/kasumi_test.c | 1558 ++++++++++++++---------------------- 1 file changed, 616 insertions(+), 942 deletions(-) diff --git a/test/kat-app/kasumi_test.c b/test/kat-app/kasumi_test.c index 4b52819e..6f2a6616 100644 --- a/test/kat-app/kasumi_test.c +++ b/test/kat-app/kasumi_test.c @@ -39,9 +39,11 @@ #include "gcm_ctr_vectors_test.h" #include "kasumi_test_vectors.h" #include "utils.h" +#include "mac_test.h" +#include "cipher_test.h" -#define KASUMIIVLEN 8 -#define PAD_LEN 16 +extern const struct mac_test kasumi_f9_json[]; +extern const struct cipher_test kasumi_f8_json[]; int kasumi_test(struct IMB_MGR *mb_mgr); @@ -163,110 +165,6 @@ submit_kasumi_f9_job(struct IMB_MGR *mb_mgr, kasumi_key_sched_t *key, uint8_t *s return 0; } -static int -validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) -{ - int numKasumiTestVectors, i = 0; - uint8_t *pKey = NULL; - int keyLen = MAX_KEY_LEN; - uint8_t srcBuff[MAX_DATA_LEN]; - uint8_t dstBuff[MAX_DATA_LEN]; - uint64_t IV; - kasumi_key_sched_t *pKeySched = NULL; - cipher_test_vector_t *kasumi_test_vectors = NULL; - uint8_t *pSrcBuff = srcBuff; - uint64_t *pIV = &IV; - - printf("Testing IMB_KASUMI_F8_1_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); - - kasumi_test_vectors = kasumi_f8_vectors; - numKasumiTestVectors = numCipherTestVectors[0]; - - if (!numKasumiTestVectors) { - printf("No Kasumi vectors found !\n"); - return 1; - } - pKey = malloc(keyLen); - if (!pKey) { - printf("malloc(pKey):failed !\n"); - return 1; - } - pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); - if (!pKeySched) { - printf("malloc(IMB_KASUMI_KEY_SCHED_SIZE()): failed !\n"); - free(pKey); - return 1; - } - - /* Copy the data for for Kasumi_f8 1 Packet version */ - for (i = 0; i < numKasumiTestVectors; i++) { - uint32_t byteLen = kasumi_test_vectors[i].dataLenInBytes; - uint32_t bitLen = byteLen * 8; - uint32_t bitOffset = 0; - - memcpy(pKey, kasumi_test_vectors[i].key, kasumi_test_vectors[i].keyLenInBytes); - memcpy(srcBuff, kasumi_test_vectors[i].plaintext, - kasumi_test_vectors[i].dataLenInBytes); - memcpy(dstBuff, kasumi_test_vectors[i].ciphertext, - kasumi_test_vectors[i].dataLenInBytes); - memcpy((uint8_t *) &IV, kasumi_test_vectors[i].iv, - kasumi_test_vectors[i].ivLenInBytes); - - /*setup the keysched to be used*/ - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, pKey, pKeySched)) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - free(pKey); - free(pKeySched); - return 1; - } - - /* Validate Encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pSrcBuff, &pSrcBuff, &bitLen, - &bitOffset, IMB_DIR_ENCRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER(mgr, pKeySched, IV, srcBuff, srcBuff, byteLen); - - /*check against the cipher test in the vector against the - * encrypted - * plaintext*/ - if (memcmp(srcBuff, dstBuff, kasumi_test_vectors[i].dataLenInBytes) != 0) { - printf("kasumi_f8_1_block(Enc) vector:%d\n", i); - hexdump(stdout, "Actual:", srcBuff, kasumi_test_vectors[i].dataLenInBytes); - hexdump(stdout, "Expected:", dstBuff, - kasumi_test_vectors[i].dataLenInBytes); - free(pKey); - free(pKeySched); - return 1; - } - - memcpy(dstBuff, kasumi_test_vectors[i].plaintext, - kasumi_test_vectors[i].dataLenInBytes); - - /*Validate Decrypt*/ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pSrcBuff, &pSrcBuff, &bitLen, - &bitOffset, IMB_DIR_DECRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER(mgr, pKeySched, IV, srcBuff, srcBuff, byteLen); - - if (memcmp(srcBuff, dstBuff, kasumi_test_vectors[i].dataLenInBytes) != 0) { - printf("kasumi_f8_1_block(Dec) vector:%d\n", i); - hexdump(stdout, "Actual:", srcBuff, kasumi_test_vectors[i].dataLenInBytes); - hexdump(stdout, "Expected:", dstBuff, - kasumi_test_vectors[i].dataLenInBytes); - free(pKey); - free(pKeySched); - return 1; - } - } - - free(pKey); - free(pKeySched); - printf("[%s]: PASS, for %d single buffers.\n", __FUNCTION__, i); - return 0; -} - /* Shift right a buffer by "offset" bits, "offset" < 8 */ static void buffer_shift_right(uint8_t *buffer, uint32_t length, uint8_t offset) @@ -287,998 +185,774 @@ buffer_shift_right(uint8_t *buffer, uint32_t length, uint8_t offset) } } +struct kasumi_f8_x_blocks { + size_t n; + void **key; + kasumi_key_sched_t **keySched; + uint64_t **pIV; + uint64_t *IV; /* for n buffer direct API */ + uint32_t *packetLen; + uint32_t *bitLens; + uint32_t *bitOffsets; + const struct cipher_test **vt; + + uint8_t **encBuff; + uint8_t **decBuff; +}; + static void -copy_test_bufs(uint8_t *plainBuff, uint8_t *wrkBuff, uint8_t *ciphBuff, const uint8_t *src_test, - const uint8_t *dst_test, const uint32_t byte_len) +kasumi_f8_x_block_free(struct kasumi_f8_x_blocks *s) { - /* Reset all buffers to -1 (for padding check) and copy test vectors */ - memset(wrkBuff, -1, (byte_len + PAD_LEN * 2)); - memset(plainBuff, -1, (byte_len + PAD_LEN * 2)); - memset(ciphBuff, -1, (byte_len + PAD_LEN * 2)); - memcpy(plainBuff + PAD_LEN, src_test, byte_len); - memcpy(ciphBuff + PAD_LEN, dst_test, byte_len); + for (size_t i = 0; i < s->n; i++) { + if (s->pIV) + if (s->pIV[i]) + free(s->pIV[i]); + if (s->key) + if (s->key[i]) + free(s->key[i]); + if (s->keySched) + if (s->keySched[i]) + free(s->keySched[i]); + if (s->encBuff) + if (s->encBuff[i]) + free(s->encBuff[i]); + if (s->decBuff) + if (s->decBuff[i]) + free(s->decBuff[i]); + } + + if (s->key) + free(s->key); + if (s->keySched) + free(s->keySched); + if (s->pIV) + free(s->pIV); + if (s->IV) + free(s->IV); + if (s->packetLen) + free(s->packetLen); + if (s->bitLens) + free(s->bitLens); + if (s->bitOffsets) + free(s->bitOffsets); + if (s->vt) + free(s->vt); + if (s->encBuff) + free(s->encBuff); + if (s->decBuff) + free(s->decBuff); + + memset(s, 0, sizeof(*s)); } static int -validate_kasumi_f8_1_bitblock(IMB_MGR *mgr, const unsigned job_api) +kasumi_f8_x_block_alloc(IMB_MGR *mgr, struct kasumi_f8_x_blocks *s, const size_t n) { - int numKasumiTestVectors, i = 0; - kasumi_key_sched_t *pKeySched = NULL; - const cipherbit_test_vector_t *kasumi_bit_vectors = NULL; + memset(s, 0, sizeof(*s)); + s->n = n; - printf("Testing IMB_KASUMI_F8_1_BUFFER_BIT (%s):\n", job_api ? "Job API" : "Direct API"); + s->key = malloc(n * sizeof(s->key[0])); + if (s->key) + memset(s->key, 0, n * sizeof(s->key[0])); - kasumi_bit_vectors = kasumi_f8_bitvectors; - numKasumiTestVectors = numCipherTestVectors[1]; + s->keySched = malloc(n * sizeof(s->keySched[0])); + if (s->keySched) + memset(s->keySched, 0, n * sizeof(s->keySched[0])); - uint8_t *pKey = NULL; - int keyLen = MAX_KEY_LEN; - uint8_t plainBuff[MAX_DATA_LEN]; - uint8_t ciphBuff[MAX_DATA_LEN]; - uint8_t wrkBuff[MAX_DATA_LEN]; - /* Adding extra byte for offset tests (shifting 4 bits) */ - uint8_t padding[PAD_LEN + 1]; - uint64_t IV; - int ret = 1; - uint64_t *pIV = &IV; + s->pIV = malloc(n * sizeof(s->pIV[0])); + if (s->pIV) + memset(s->pIV, 0, n * sizeof(s->pIV[0])); - memset(padding, -1, PAD_LEN + 1); + s->IV = malloc(n * sizeof(s->IV[0])); + if (s->IV) + memset(s->IV, 0, n * sizeof(s->IV[0])); - if (!numKasumiTestVectors) { - printf("No Kasumi vectors found !\n"); - return 1; - } - pKey = malloc(keyLen); - if (!pKey) { - printf("malloc(pKey):failed !\n"); - return 1; - } - pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); - if (!pKeySched) { - printf("malloc(IMB_KASUMI_KEY_SCHED_SIZE()): failed !\n"); - free(pKey); - return 1; - } + s->packetLen = malloc(n * sizeof(s->packetLen[0])); + if (s->packetLen) + memset(s->packetLen, 0, n * sizeof(s->packetLen[0])); - /* Copy the data for for Kasumi_f8 1 Packet version*/ - for (i = 0; i < numKasumiTestVectors; i++) { - uint8_t *wrkBufBefPad = wrkBuff; - uint8_t *wrkBufAftPad = wrkBuff + PAD_LEN; - uint8_t *plainBufBefPad = plainBuff; - uint8_t *plainBufAftPad = plainBuff + PAD_LEN; - uint8_t *ciphBufBefPad = ciphBuff; - uint8_t *ciphBufAftPad = ciphBuff + PAD_LEN; - - uint32_t bit_offset = 0; - const uint32_t byte_len = (kasumi_bit_vectors[i].LenInBits + 7) / CHAR_BIT; - const uint32_t bit_len = kasumi_bit_vectors[i].LenInBits; - - memcpy(pKey, kasumi_bit_vectors[i].key, kasumi_bit_vectors[i].keyLenInBytes); - memcpy((uint8_t *) &IV, kasumi_bit_vectors[i].iv, - kasumi_bit_vectors[i].ivLenInBytes); - copy_test_bufs(plainBufBefPad, wrkBufBefPad, ciphBufBefPad, - kasumi_bit_vectors[i].plaintext, kasumi_bit_vectors[i].ciphertext, - byte_len); - - /* Setup the keysched to be used */ - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, pKey, pKeySched)) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - goto end; - } + s->bitLens = malloc(n * sizeof(s->bitLens[0])); + if (s->bitLens) + memset(s->bitLens, 0, n * sizeof(s->bitLens[0])); - /* Validate Encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &plainBufAftPad, &wrkBufAftPad, - &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, plainBufAftPad, wrkBufAftPad, - bit_len, bit_offset); - - /* Check the ciphertext in the vector against the - * encrypted plaintext */ - if (membitcmp(wrkBufAftPad, ciphBufAftPad, 0, bit_len) != 0) { - printf("kasumi_f8_1_block(Enc) offset=0 vector:%d\n", i); - hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); - hexdump(stdout, "Expected:", ciphBufAftPad, byte_len); - goto end; - } - /* Check that data not to be ciphered was not overwritten */ - if (memcmp(wrkBufBefPad, ciphBufBefPad, PAD_LEN)) { - printf("overwrite head\n"); - hexdump(stdout, "Head", wrkBufBefPad, PAD_LEN); - goto end; - } - if (memcmp(wrkBufAftPad + byte_len - 1, ciphBufAftPad + byte_len - 1, - PAD_LEN + 1)) { - printf("overwrite tail\n"); - hexdump(stdout, "Tail", wrkBufAftPad + byte_len - 1, PAD_LEN + 1); - goto end; - } - /* Validate Decrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &ciphBufAftPad, &wrkBufAftPad, - &bit_len, &bit_offset, IMB_DIR_DECRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, ciphBufAftPad, wrkBufAftPad, - bit_len, bit_offset); - - if (membitcmp(wrkBufAftPad, plainBufAftPad, kasumi_bit_vectors[i].LenInBits, 0) != - 0) { - printf("kasumi_f8_1_block(Dec) offset=0 vector:%d\n", i); - hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); - hexdump(stdout, "Expected:", plainBufAftPad, byte_len); - goto end; - } - copy_test_bufs(plainBufBefPad, wrkBufBefPad, ciphBufBefPad, - kasumi_bit_vectors[i].plaintext, kasumi_bit_vectors[i].ciphertext, - byte_len); - buffer_shift_right(plainBufBefPad, (byte_len + PAD_LEN * 2) * 8, 4); - buffer_shift_right(ciphBufBefPad, (byte_len + PAD_LEN * 2) * 8, 4); - bit_offset = 4; - - /* Validate Encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &plainBufAftPad, &wrkBufAftPad, - &bit_len, &bit_offset, IMB_DIR_ENCRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, plainBufAftPad, wrkBufAftPad, - bit_len, bit_offset); - - /* Check the ciphertext in the vector against the - * encrypted plaintext */ - if (membitcmp(wrkBufAftPad, ciphBufAftPad, bit_len, 4) != 0) { - printf("kasumi_f8_1_block(Enc) offset=4 vector:%d\n", i); - hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); - hexdump(stdout, "Expected:", ciphBufAftPad, byte_len); - goto end; - } - /*Validate Decrypt*/ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &ciphBufAftPad, &wrkBufAftPad, - &bit_len, &bit_offset, IMB_DIR_DECRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, ciphBufAftPad, wrkBufAftPad, - bit_len, bit_offset); - - if (membitcmp(plainBufAftPad, plainBufAftPad, bit_len, 4) != 0) { - printf("kasumi_f8_1_block(Dec) offset=4 vector:%d\n", i); - hexdump(stdout, "Actual:", wrkBufAftPad, byte_len); - hexdump(stdout, "Expected:", plainBufAftPad, byte_len); - goto end; - } - } - - ret = 0; - printf("[%s]: PASS, for %d single buffers.\n", __FUNCTION__, i); -end: - free(pKey); - free(pKeySched); - return ret; -} + s->bitOffsets = malloc(n * sizeof(s->bitOffsets[0])); + if (s->bitOffsets) + memset(s->bitOffsets, 0, n * sizeof(s->bitOffsets[0])); -static int -validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, const unsigned job_api) -{ - int numKasumiTestVectors, i = 0; - kasumi_key_sched_t *pKeySched = NULL; - const cipherbit_test_linear_vector_t *kasumi_bit_vectors = NULL; + s->vt = malloc(n * sizeof(s->vt[0])); + if (s->vt) + memset(s->vt, 0, n * sizeof(s->vt[0])); - printf("Testing IMB_KASUMI_F8_1_BUFFER_BIT (offset) (%s):\n", - job_api ? "Job API" : "Direct API"); + s->encBuff = malloc(n * sizeof(s->encBuff[0])); + if (s->encBuff) + memset(s->encBuff, 0, n * sizeof(s->encBuff[0])); - kasumi_bit_vectors = &kasumi_f8_linear_bitvectors; - numKasumiTestVectors = numCipherTestVectors[1]; + s->decBuff = malloc(n * sizeof(s->decBuff[0])); + if (s->decBuff) + memset(s->decBuff, 0, n * sizeof(s->decBuff[0])); - uint8_t *pKey = NULL; - int keyLen = MAX_KEY_LEN, ret; - uint8_t srcBuff[MAX_DATA_LEN]; - uint8_t dstBuff[MAX_DATA_LEN]; - uint64_t IV; - uint32_t bufferbytesize = 0; - uint8_t wrkbuf[MAX_DATA_LEN]; - uint32_t offset = 0, byteoffset = 0; - uint8_t *pSrcBuff = srcBuff; - uint8_t *pDstBuff = dstBuff; - uint8_t *pWrkBuff = wrkbuf; - uint64_t *pIV = &IV; - - memset(srcBuff, 0, sizeof(srcBuff)); - memset(dstBuff, 0, sizeof(dstBuff)); - memset(wrkbuf, 0, sizeof(wrkbuf)); - - if (!numKasumiTestVectors) { - printf("No Kasumi vectors found !\n"); - return 1; + if (s->key == NULL || s->keySched == NULL || s->pIV == NULL || s->vt == NULL || + s->packetLen == NULL || s->bitLens == NULL || s->bitOffsets == NULL || s->IV == NULL) { + kasumi_f8_x_block_free(s); + return 0; } - pKey = malloc(keyLen); - if (!pKey) { - printf("malloc(pKey):failed !\n"); - return 1; - } - pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); - if (!pKeySched) { - printf("malloc(IMB_KASUMI_KEY_SCHED_SIZE()): failed !\n"); - free(pKey); - return 1; - } - for (i = 0; i < numKasumiTestVectors; i++) - bufferbytesize += kasumi_bit_vectors->LenInBits[i]; - - bufferbytesize = (bufferbytesize + 7) / CHAR_BIT; - memcpy(srcBuff, kasumi_bit_vectors->plaintext, bufferbytesize); - memcpy(dstBuff, kasumi_bit_vectors->ciphertext, bufferbytesize); - - /* Copy the data for for Kasumi_f8 1 Packet version */ - for (i = 0, offset = 0, byteoffset = 0; i < numKasumiTestVectors; i++) { - uint32_t bit_len = kasumi_bit_vectors->LenInBits[i]; - - memcpy(pKey, &kasumi_bit_vectors->key[i][0], kasumi_bit_vectors->keyLenInBytes); - memcpy((uint8_t *) &IV, &kasumi_bit_vectors->iv[i][0], - kasumi_bit_vectors->ivLenInBytes); - - /* Setup the keysched to be used */ - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, pKey, pKeySched)) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - free(pKey); - free(pKeySched); - return 1; - } - /* Validate Encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pSrcBuff, &pWrkBuff, &bit_len, - &offset, IMB_DIR_ENCRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, srcBuff, wrkbuf, bit_len, - offset); - - /* Check against the ciphertext in the vector against the - * encrypted plaintext */ - ret = membitcmp(wrkbuf, dstBuff, kasumi_bit_vectors->LenInBits[i], offset); - if (ret != 0) { - printf("kasumi_f8_1_block_linear(Enc) vector:%d, " - "index:%d\n", - i, ret); - hexdump(stdout, "Actual:", &wrkbuf[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); - hexdump(stdout, "Expected:", &dstBuff[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); - free(pKey); - free(pKeySched); - return 1; + for (size_t i = 0; i < n; i++) { + s->pIV[i] = malloc(IMB_KASUMI_IV_SIZE); + s->key[i] = malloc(IMB_KASUMI_KEY_SIZE); + s->keySched[i] = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); + s->bitOffsets[i] = 0; + if (s->pIV[i] == NULL || s->key[i] == NULL || s->keySched[i] == NULL) { + kasumi_f8_x_block_free(s); + return 0; } - offset += kasumi_bit_vectors->LenInBits[i]; - byteoffset = offset / CHAR_BIT; } - for (i = 0, offset = 0, byteoffset = 0; i < numKasumiTestVectors; i++) { - uint32_t bit_len = kasumi_bit_vectors->LenInBits[i]; - memcpy(pKey, &kasumi_bit_vectors->key[i][0], kasumi_bit_vectors->keyLenInBytes); - memcpy((uint8_t *) &IV, &kasumi_bit_vectors->iv[i][0], - kasumi_bit_vectors->ivLenInBytes); + return 1; +} - /* Setup the keysched to be used */ - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, pKey, pKeySched)) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - free(pKey); - free(pKeySched); - return 1; +static void +kasumi_f8_x_block_clean_op(struct kasumi_f8_x_blocks *s) +{ + for (size_t i = 0; i < s->n; i++) { + if (s->encBuff) { + if (s->encBuff[i]) { + free(s->encBuff[i]); + s->encBuff[i] = NULL; + } } - - /* Validate Decrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, &pKeySched, &pIV, &pDstBuff, &pWrkBuff, &bit_len, - &offset, IMB_DIR_DECRYPT, 1); - else - IMB_KASUMI_F8_1_BUFFER_BIT(mgr, pKeySched, IV, dstBuff, wrkbuf, bit_len, - offset); - - ret = membitcmp(wrkbuf, srcBuff, kasumi_bit_vectors->LenInBits[i], offset); - if (ret != 0) { - printf("kasumi_f8_1_block_linear(Dec) " - "vector:%d,index:%d\n", - i, ret); - hexdump(stdout, "Actual:", &wrkbuf[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); - hexdump(stdout, "Expected:", &srcBuff[byteoffset], - (kasumi_bit_vectors->LenInBits[i] + 7) / CHAR_BIT); - free(pKey); - free(pKeySched); - return 1; + if (s->decBuff) { + if (s->decBuff[i]) { + free(s->decBuff[i]); + s->decBuff[i] = NULL; + } } - offset += kasumi_bit_vectors->LenInBits[i]; - byteoffset = offset / CHAR_BIT; } - - free(pKey); - free(pKeySched); - printf("[%s]: PASS, for %d single buffers.\n", __FUNCTION__, i); - return 0; } static int -validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) +kasumi_f8_x_block_prep_op(IMB_MGR *mgr, struct kasumi_f8_x_blocks *s, const struct cipher_test *v, + const struct cipher_test *vstart, const unsigned job_api, + const int same_size, const uint32_t bit_offset) { - unsigned i = 0, numPackets = 2; - const cipher_test_vector_t *kasumi_test_vectors = cipher_test_vectors[0]; - kasumi_key_sched_t *keySched[3] = { NULL }; - const int numKasumiTestVectors = numCipherTestVectors[0]; - uint8_t *key[3] = { NULL }; - int keyLen = MAX_KEY_LEN; - uint64_t iv[3]; - uint8_t *srcBuff[3] = { NULL }; - uint8_t *dstBuff[3] = { NULL }; - uint32_t packetLen[3]; - uint32_t bitLens[3]; - uint32_t bitOffsets[3]; - uint64_t *pIV[3] = { NULL }; - int ret = 1; - - printf("Testing IMB_KASUMI_F8_2_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); + /* set up vt[] */ + s->vt[0] = v; + + for (size_t i = 1; i < s->n; i++) { + const struct cipher_test *vc = s->vt[i - 1]; + + vc++; + if (vc->msg == NULL) + vc = vstart; + + if (!job_api) { + /* find same key match for direct API and byte length */ + while ((vc->msgSize % CHAR_BIT) != 0 || + memcmp(vc->key, v->key, v->keySize / CHAR_BIT) != 0) { + vc++; + if (vc->msg == NULL) + vc = vstart; + } + } else { + /* find byte aligned length vector */ + while ((vc->msgSize % CHAR_BIT) != 0) { + vc++; + if (vc->msg == NULL) + vc = vstart; + } + } - if (!numKasumiTestVectors) { - printf("No Kasumi vectors found !\n"); - goto exit; + s->vt[i] = vc; } - /* Create test Data for num Packets + 1 */ - for (i = 0; i < numPackets + 1; i++) { - packetLen[i] = kasumi_test_vectors[i].dataLenInBytes; - bitLens[i] = packetLen[i] * 8; - bitOffsets[i] = 0; - pIV[i] = &iv[i]; + /* + * - copy key + * - alloc src/dst buffers + * - copy src/dst buffers + * - copy IV + */ - key[i] = malloc(keyLen); - if (!key[i]) { - printf("malloc(key):failed !\n"); - goto exit; - } - keySched[i] = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); - if (!keySched[i]) { - printf("malloc(IMB_KASUMI_KEY_SCHED_SIZE()): " - "failed !\n"); - goto exit; - } - srcBuff[i] = malloc(packetLen[i]); - if (!srcBuff[i]) { - printf("malloc(srcBuff[%u]:failed !\n", i); - goto exit; - } - dstBuff[i] = malloc(packetLen[i]); - if (!dstBuff[i]) { - printf("malloc(dstBuff[%u]:failed !\n", i); - goto exit; - } + uint32_t min_size_bits = UINT32_MAX; - memcpy(key[i], kasumi_test_vectors[i].key, kasumi_test_vectors[i].keyLenInBytes); + for (size_t i = 0; i < s->n; i++) + if (s->vt[i]->msgSize < min_size_bits) + min_size_bits = (uint32_t) s->vt[i]->msgSize; - memcpy(srcBuff[i], kasumi_test_vectors[i].plaintext, - kasumi_test_vectors[i].dataLenInBytes); + const uint32_t min_size = (min_size_bits + 7) / CHAR_BIT; - memcpy(dstBuff[i], kasumi_test_vectors[i].ciphertext, - kasumi_test_vectors[i].dataLenInBytes); + for (size_t i = 0; i < s->n; i++) { + const size_t msg_len_vec = + ((!job_api) && same_size) ? min_size : (s->vt[i]->msgSize + 7) / CHAR_BIT; + const size_t msg_len = (bit_offset != 0) ? (msg_len_vec + 1) : msg_len_vec; + const size_t msg_len_bits = + ((!job_api) && same_size) ? min_size_bits : s->vt[i]->msgSize; - memcpy(&iv[i], kasumi_test_vectors[i].iv, kasumi_test_vectors[i].ivLenInBytes); + memcpy(s->key[i], s->vt[i]->key, s->vt[i]->keySize / CHAR_BIT); - /* init key schedule */ - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, key[i], keySched[i])) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - goto exit; + s->packetLen[i] = (uint32_t) msg_len; + s->bitLens[i] = (uint32_t) msg_len_bits; + s->bitOffsets[i] = bit_offset; + + s->encBuff[i] = malloc(msg_len); + if (!s->encBuff[i]) { + printf("malloc(encBuff[]):failed !\n"); + kasumi_f8_x_block_clean_op(s); + return 0; } + + s->decBuff[i] = malloc(msg_len); + if (!s->decBuff[i]) { + printf("malloc(decBuff[]): failed !\n"); + kasumi_f8_x_block_clean_op(s); + return 0; + } + + memcpy(s->encBuff[i], s->vt[i]->msg, msg_len); + memcpy(s->decBuff[i], s->vt[i]->ct, msg_len); + + if (bit_offset != 0) { + buffer_shift_right(s->encBuff[i], s->packetLen[i], s->bitOffsets[i]); + buffer_shift_right(s->decBuff[i], s->packetLen[i], s->bitOffsets[i]); + } + + memcpy(s->pIV[i], s->vt[i]->iv, s->vt[i]->ivSize / CHAR_BIT); + memcpy(&s->IV[i], s->vt[i]->iv, s->vt[i]->ivSize / CHAR_BIT); } - /* Test the encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &srcBuff, - (uint8_t **) &srcBuff, (uint32_t *) &bitLens, - (uint32_t *) &bitOffsets, IMB_DIR_ENCRYPT, 2); - else - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], srcBuff[0], srcBuff[0], - packetLen[0], srcBuff[1], srcBuff[1], packetLen[1]); - - /* Compare the ciphertext with the encrypted plaintext */ - for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], kasumi_test_vectors[i].ciphertext, packetLen[i]) != 0) { - printf("kasumi_f8_2_buffer(Enc) vector:%u\n", i); - hexdump(stdout, "Actual:", srcBuff[i], packetLen[i]); - hexdump(stdout, "Expected:", kasumi_test_vectors[i].ciphertext, - packetLen[i]); - goto exit; + /* init key schedule */ + for (size_t i = 0; i < s->n; i++) { + if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, s->key[i], s->keySched[i])) { + printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); + kasumi_f8_x_block_clean_op(s); + return 0; } } - for (i = 0; i < numPackets; i++) - memcpy(srcBuff[i], kasumi_test_vectors[i].plaintext, - kasumi_test_vectors[i].dataLenInBytes); - /* Test the encrypt reverse order (direct API only) */ - if (!job_api) { - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], srcBuff[1], srcBuff[1], - packetLen[1], srcBuff[0], srcBuff[0], packetLen[0]); + return 1; +} +static int +kasumi_f8_x_block_check_op(struct kasumi_f8_x_blocks *s, const char *name, const int bit_length) +{ + if (!bit_length) { /* Compare the ciphertext with the encrypted plaintext */ - for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], kasumi_test_vectors[i].ciphertext, packetLen[i]) != - 0) { - printf("kasumi_f8_2_buffer(Enc) " - "vector:%u\n", - i); - hexdump(stdout, "Actual:", srcBuff[i], packetLen[i]); - hexdump(stdout, "Expected:", kasumi_test_vectors[i].ciphertext, - packetLen[i]); - goto exit; + for (size_t i = 0; i < s->n; i++) { + if (memcmp(s->encBuff[i], s->vt[i]->ct, s->packetLen[i]) != 0) { + printf("%s(Enc) tcId:%zu\n", name, s->vt[i]->tcId); + hexdump(stdout, "Actual:", s->encBuff[i], s->packetLen[i]); + hexdump(stdout, "Expected:", s->vt[i]->ct, s->packetLen[i]); + return 0; } } - for (i = 0; i < numPackets + 1; i++) - memcpy(srcBuff[i], kasumi_test_vectors[i].plaintext, - kasumi_test_vectors[i].dataLenInBytes); - - /* Test the encrypt reverse order (direct API only) */ - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], srcBuff[0], srcBuff[0], - packetLen[0], srcBuff[2], srcBuff[2], packetLen[2]); - /* Compare the ciphertext with the encrypted plaintext*/ - for (i = 0; i < numPackets + 1; i++) { - if (i == 1) - continue; - if (memcmp(srcBuff[i], kasumi_test_vectors[i].ciphertext, packetLen[i]) != - 0) { - printf("kasumi_f8_2_buffer(Enc) " - "vector:%u\n", - i); - hexdump(stdout, "Actual:", srcBuff[i], packetLen[i]); - hexdump(stdout, "Expected:", kasumi_test_vectors[i].ciphertext, - packetLen[i]); - goto exit; + /* Compare the plaintext with the decrypted ciphertext */ + for (size_t i = 0; i < s->n; i++) { + if (memcmp(s->decBuff[i], s->vt[i]->msg, s->packetLen[i]) != 0) { + printf("%s(Dec) tcId:%zu\n", name, s->vt[i]->tcId); + hexdump(stdout, "Actual:", s->decBuff[i], s->packetLen[i]); + hexdump(stdout, "Expected:", s->vt[i]->msg, s->packetLen[i]); + return 0; } } - } - /* Test the decrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &dstBuff, - (uint8_t **) &dstBuff, (uint32_t *) &bitLens, - (uint32_t *) &bitOffsets, IMB_DIR_DECRYPT, 2); - else - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], dstBuff[0], dstBuff[0], - packetLen[0], dstBuff[1], dstBuff[1], packetLen[1]); - - /* Compare the plaintext with the decrypted ciphertext */ - for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[i].plaintext, packetLen[i]) != 0) { - printf("kasumi_f8_2_buffer(Dec) vector:%u\n", i); - hexdump(stdout, "Actual:", dstBuff[i], packetLen[i]); - hexdump(stdout, "Expected:", kasumi_test_vectors[i].plaintext, - packetLen[i]); - goto exit; + } else { + /* Compare the ciphertext with the encrypted plaintext */ + for (size_t i = 0; i < s->n; i++) { + uint8_t *cp = malloc(s->packetLen[i] + 1); + + if (cp == NULL) + return 0; + + memset(cp, 0, s->packetLen[i] + 1); + memcpy(cp, s->vt[i]->ct, s->packetLen[i]); + buffer_shift_right(cp, s->packetLen[i], s->bitOffsets[i]); + + if (membitcmp(s->encBuff[i], cp, s->bitLens[i], s->bitOffsets[i]) != 0) { + printf("%s(Enc) bit_offset:%u tcId:%zu\n", name, s->bitOffsets[i], + s->vt[i]->tcId); + hexdump(stdout, "Actual:", s->encBuff[i], s->packetLen[i]); + hexdump(stdout, "Expected:", s->vt[i]->ct, s->packetLen[i]); + free(cp); + return 0; + } + + free(cp); } - } - /* Test the decrypt reverse order (direct API only) */ - if (!job_api) { - for (i = 0; i < numPackets; i++) - memcpy(dstBuff[i], kasumi_test_vectors[i].ciphertext, - kasumi_test_vectors[i].dataLenInBytes); + for (size_t i = 0; i < s->n; i++) { + uint8_t *cp = malloc(s->packetLen[i] + 1); - IMB_KASUMI_F8_2_BUFFER(mgr, keySched[0], iv[0], iv[1], dstBuff[1], dstBuff[1], - packetLen[1], dstBuff[0], dstBuff[0], packetLen[0]); + if (cp == NULL) + return 0; - /* Compare the plaintext with the decrypted ciphertext */ - for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[i].plaintext, packetLen[i]) != - 0) { - printf("kasumi_f8_2_buffer(Dec) " - "vector:%u\n", - i); - hexdump(stdout, "Actual:", dstBuff[i], packetLen[i]); - hexdump(stdout, "Expected:", kasumi_test_vectors[i].plaintext, - packetLen[i]); - goto exit; + memset(cp, 0, s->packetLen[i] + 1); + memcpy(cp, s->vt[i]->msg, s->packetLen[i]); + buffer_shift_right(cp, s->packetLen[i], s->bitOffsets[i]); + + if (membitcmp(s->decBuff[i], cp, s->bitLens[i], s->bitOffsets[i]) != 0) { + printf("%s(Dec) bit_offset:%u tcId:%zu\n", name, s->bitOffsets[i], + s->vt[i]->tcId); + hexdump(stdout, "Actual:", s->decBuff[i], s->packetLen[i]); + hexdump(stdout, "Expected:", s->vt[i]->msg, s->packetLen[i]); + free(cp); + return 0; } - } - } - ret = 0; - printf("[%s]: PASS.\n", __FUNCTION__); -exit: - for (i = 0; i < numPackets + 1; i++) { - free(key[i]); - free(keySched[i]); - free(srcBuff[i]); - free(dstBuff[i]); + free(cp); + } } - return ret; + return 1; } static int -validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) +validate_kasumi_f8_1_bitblock(IMB_MGR *mgr, const unsigned job_api) { - unsigned i = 0, numPackets = 3; - const cipher_test_vector_t *kasumi_test_vectors = NULL; - kasumi_key_sched_t *keySched[3] = { NULL }; - - printf("Testing IMB_KASUMI_F8_3_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); - - kasumi_test_vectors = cipher_test_vectors[0]; - const int numKasumiTestVectors = numCipherTestVectors[0]; + const uint32_t n = 1; + struct kasumi_f8_x_blocks s; + const struct cipher_test *v; - uint8_t *key[3] = { NULL }; - int keyLen = MAX_KEY_LEN; - uint64_t iv[3]; - uint8_t *srcBuff[3] = { NULL }; - uint8_t *dstBuff[3] = { NULL }; - uint32_t packetLen[3]; - uint32_t bitLens[3]; - uint32_t bitOffsets[3]; - uint64_t *pIV[3] = { NULL }; - int ret = 1; + printf("Testing IMB_KASUMI_F8_1_BUFFER_BIT (%s):\n", job_api ? "Job API" : "Direct API"); - if (!numKasumiTestVectors) { - printf("No Kasumi vectors found !\n"); - goto exit; + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; } - /* Create test Data for num Packets */ - for (i = 0; i < numPackets; i++) { - packetLen[i] = kasumi_test_vectors[0].dataLenInBytes; - bitLens[i] = packetLen[i] * 8; - bitOffsets[i] = 0; - pIV[i] = &iv[i]; + for (v = kasumi_f8_json; v->msg != NULL; v++) { - key[i] = malloc(keyLen); - if (!key[i]) { - printf("malloc(key):failed !\n"); - goto exit; - } - keySched[i] = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); - if (!keySched[i]) { - printf("malloc(IMB_KASUMI_KEY_SCHED_SIZE()): " - "failed !\n"); - goto exit; - } - srcBuff[i] = malloc(packetLen[0]); - if (!srcBuff[i]) { - printf("malloc(srcBuff[%u]:failed !\n", i); - goto exit; - } - dstBuff[i] = malloc(packetLen[0]); - if (!dstBuff[i]) { - printf("malloc(dstBuff[%u]:failed !\n", i); - goto exit; + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 0, 0)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; } - memcpy(key[i], kasumi_test_vectors[0].key, kasumi_test_vectors[0].keyLenInBytes); - - memcpy(srcBuff[i], kasumi_test_vectors[0].plaintext, - kasumi_test_vectors[0].dataLenInBytes); - - memcpy(dstBuff[i], kasumi_test_vectors[0].ciphertext, - kasumi_test_vectors[0].dataLenInBytes); + /* Validate Encrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); + else + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, s.keySched[0], *s.pIV[0], s.encBuff[0], + s.encBuff[0], s.bitLens[0], s.bitOffsets[0]); - memcpy(&iv[i], kasumi_test_vectors[0].iv, kasumi_test_vectors[0].ivLenInBytes); + /* Validate Decrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); + else + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, s.keySched[0], *s.pIV[0], s.decBuff[0], + s.decBuff[0], s.bitLens[0], s.bitOffsets[0]); - /* init key schedule */ - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, key[0], keySched[i])) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - goto exit; + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 1)) { + kasumi_f8_x_block_free(&s); + return 1; } - } - /* Test the encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &srcBuff, - (uint8_t **) &srcBuff, (uint32_t *) &bitLens, - (uint32_t *) &bitOffsets, IMB_DIR_ENCRYPT, 3); - else - IMB_KASUMI_F8_3_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], srcBuff[0], - srcBuff[0], srcBuff[1], srcBuff[1], srcBuff[2], srcBuff[2], - packetLen[0]); - - /* Compare the ciphertext with the encrypted plaintext */ - for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], kasumi_test_vectors[0].ciphertext, packetLen[0]) != 0) { - printf("kasumi_f8_3_buffer(Enc) vector:%u\n", i); - hexdump(stdout, "Actual:", srcBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", kasumi_test_vectors[0].ciphertext, - packetLen[0]); - goto exit; - } + kasumi_f8_x_block_clean_op(&s); } - /* Test the decrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &dstBuff, - (uint8_t **) &dstBuff, (uint32_t *) &bitLens, - (uint32_t *) &bitOffsets, IMB_DIR_DECRYPT, 3); - else - IMB_KASUMI_F8_3_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], dstBuff[0], - dstBuff[0], dstBuff[1], dstBuff[1], dstBuff[2], dstBuff[2], - packetLen[0]); - - /* Compare the plaintext with the decrypted ciphertext */ - for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[0].plaintext, packetLen[0]) != 0) { - printf("kasumi_f8_3_buffer(Dec) vector:%u\n", i); - hexdump(stdout, "Actual:", dstBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", kasumi_test_vectors[0].plaintext, - packetLen[0]); - goto exit; - } - } + printf("[%s]: PASS, for single buffers.\n", __FUNCTION__); + kasumi_f8_x_block_free(&s); - ret = 0; - printf("[%s]: PASS.\n", __FUNCTION__); -exit: - for (i = 0; i < numPackets; i++) { - free(key[i]); - free(keySched[i]); - free(srcBuff[i]); - free(dstBuff[i]); - } - return ret; + return 0; } static int -validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) +validate_kasumi_f8_1_bitblock_offset(IMB_MGR *mgr, const unsigned job_api) { - unsigned i = 0, numPackets = 4; - const cipher_test_vector_t *kasumi_test_vectors = NULL; - kasumi_key_sched_t *keySched[4] = { NULL }; + const uint32_t n = 1; + struct kasumi_f8_x_blocks s; + const struct cipher_test *v; - printf("Testing IMB_KASUMI_F8_4_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_1_BUFFER_BIT (offset) (%s):\n", + job_api ? "Job API" : "Direct API"); - kasumi_test_vectors = cipher_test_vectors[0]; - const int numKasumiTestVectors = numCipherTestVectors[0]; + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; + } - uint8_t *key[4] = { NULL }; - int keyLen = MAX_KEY_LEN; - uint64_t iv[4]; - uint8_t *srcBuff[4] = { NULL }; - uint8_t *dstBuff[4] = { NULL }; - uint32_t packetLen[4]; - uint32_t bitLens[4]; - uint32_t bitOffsets[4]; - uint64_t *pIV[4] = { NULL }; - int ret = 1; + for (v = kasumi_f8_json; v->msg != NULL; v++) { - if (!numKasumiTestVectors) { - printf("No Kasumi vectors found !\n"); - goto exit; - } + for (uint32_t bitoff = 0; bitoff < 8; bitoff++) { + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 0, + bitoff)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; + } - /* Create test Data for num Packets */ - for (i = 0; i < numPackets; i++) { - packetLen[i] = kasumi_test_vectors[0].dataLenInBytes; - bitLens[i] = packetLen[i] * 8; - bitOffsets[i] = 0; - pIV[i] = &iv[i]; + /* Validate Encrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); + else + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, s.keySched[0], *s.pIV[0], + s.encBuff[0], s.encBuff[0], s.bitLens[0], + s.bitOffsets[0]); + + /* Validate Decrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); + else + IMB_KASUMI_F8_1_BUFFER_BIT(mgr, s.keySched[0], *s.pIV[0], + s.decBuff[0], s.decBuff[0], s.bitLens[0], + s.bitOffsets[0]); + + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 1)) { + kasumi_f8_x_block_free(&s); + return 1; + } - key[i] = malloc(keyLen); - if (!key[i]) { - printf("malloc(key):failed !\n"); - goto exit; - } - keySched[i] = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); - if (!keySched[i]) { - printf("malloc(IMB_KASUMI_KEY_SCHED_SIZE()): " - "failed !\n"); - goto exit; - } - srcBuff[i] = malloc(packetLen[0]); - if (!srcBuff[i]) { - printf("malloc(srcBuff[%u]:failed !\n", i); - goto exit; - } - dstBuff[i] = malloc(packetLen[0]); - if (!dstBuff[i]) { - printf("malloc(dstBuff[%u]:failed !\n", i); - goto exit; + kasumi_f8_x_block_clean_op(&s); } + } - memcpy(key[i], kasumi_test_vectors[0].key, kasumi_test_vectors[0].keyLenInBytes); - - memcpy(srcBuff[i], kasumi_test_vectors[0].plaintext, - kasumi_test_vectors[0].dataLenInBytes); + printf("[%s]: PASS, for single buffers.\n", __FUNCTION__); + kasumi_f8_x_block_free(&s); - memcpy(dstBuff[i], kasumi_test_vectors[0].ciphertext, - kasumi_test_vectors[0].dataLenInBytes); + return 0; +} +static int +validate_kasumi_f8_1_block(IMB_MGR *mgr, const unsigned job_api) +{ + const uint32_t n = 1; + struct kasumi_f8_x_blocks s; + const struct cipher_test *v; - memcpy(&iv[i], kasumi_test_vectors[0].iv, kasumi_test_vectors[0].ivLenInBytes); + printf("Testing IMB_KASUMI_F8_1_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); - /* init key schedule */ - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, key[0], keySched[i])) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - goto exit; - } + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; } - /* Test the encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &srcBuff, - (uint8_t **) &srcBuff, (uint32_t *) &bitLens, - (uint32_t *) &bitOffsets, IMB_DIR_ENCRYPT, 4); - else - IMB_KASUMI_F8_4_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], iv[3], srcBuff[0], - srcBuff[0], srcBuff[1], srcBuff[1], srcBuff[2], srcBuff[2], - srcBuff[3], srcBuff[3], packetLen[0]); - - /* Compare the ciphertext with the encrypted plaintext */ - for (i = 0; i < numPackets; i++) { - if (memcmp(srcBuff[i], kasumi_test_vectors[0].ciphertext, packetLen[0]) != 0) { - printf("kasumi_f8_4_buffer(Enc) vector:%u\n", i); - hexdump(stdout, "Actual:", srcBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", kasumi_test_vectors[0].ciphertext, - packetLen[0]); - goto exit; + for (v = kasumi_f8_json; v->msg != NULL; v++) { + + if ((v->msgSize % CHAR_BIT) != 0) + continue; + + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 0, 0)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; } - } - /* Test the decrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, keySched, (uint64_t **) &pIV, (uint8_t **) &dstBuff, - (uint8_t **) &dstBuff, (uint32_t *) &bitLens, - (uint32_t *) &bitOffsets, IMB_DIR_DECRYPT, 4); - else - IMB_KASUMI_F8_4_BUFFER(mgr, keySched[0], iv[0], iv[1], iv[2], iv[3], dstBuff[0], - dstBuff[0], dstBuff[1], dstBuff[1], dstBuff[2], dstBuff[2], - dstBuff[3], dstBuff[3], packetLen[0]); - - /*Compare the plaintext with the decrypted cipher text*/ - for (i = 0; i < numPackets; i++) { - if (memcmp(dstBuff[i], kasumi_test_vectors[0].plaintext, packetLen[0]) != 0) { - printf("kasumi_f8_4_buffer(Dec) vector:%u\n", i); - hexdump(stdout, "Actual:", dstBuff[i], packetLen[0]); - hexdump(stdout, "Expected:", kasumi_test_vectors[0].plaintext, - packetLen[0]); - goto exit; + /* Validate Encrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); + else + IMB_KASUMI_F8_1_BUFFER(mgr, s.keySched[0], *s.pIV[0], s.encBuff[0], + s.encBuff[0], s.packetLen[0]); + + /*Validate Decrypt*/ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); + else + IMB_KASUMI_F8_1_BUFFER(mgr, s.keySched[0], *s.pIV[0], s.decBuff[0], + s.decBuff[0], s.packetLen[0]); + + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 0)) { + kasumi_f8_x_block_free(&s); + return 1; } - } - ret = 0; - printf("[%s]: PASS.\n", __FUNCTION__); -exit: - for (i = 0; i < numPackets; i++) { - free(key[i]); - free(keySched[i]); - free(srcBuff[i]); - free(dstBuff[i]); + kasumi_f8_x_block_clean_op(&s); } - return ret; + + printf("[%s]: PASS, for single buffers.\n", __FUNCTION__); + kasumi_f8_x_block_free(&s); + return 0; } static int -validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) +validate_kasumi_f8_2_blocks(IMB_MGR *mgr, const unsigned job_api) { - kasumi_key_sched_t *pKeySched[NUM_SUPPORTED_BUFFERS] = { NULL }; - uint64_t IV[NUM_SUPPORTED_BUFFERS]; - uint64_t *pIV[NUM_SUPPORTED_BUFFERS]; - uint32_t buffLenInBytes[NUM_SUPPORTED_BUFFERS]; - uint8_t *srcBuff[NUM_SUPPORTED_BUFFERS] = { NULL }; - uint8_t *refBuff[NUM_SUPPORTED_BUFFERS] = { NULL }; - uint8_t *key[NUM_SUPPORTED_BUFFERS] = { NULL }; - uint32_t bitLens[NUM_SUPPORTED_BUFFERS]; - uint32_t bitOffsets[NUM_SUPPORTED_BUFFERS]; - - unsigned i = 0, j = 0; - int ret = -1; + const uint32_t n = 2; + struct kasumi_f8_x_blocks s; + const struct cipher_test *v; - printf("Testing IMB_KASUMI_F8_N_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F8_2_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); - /* Allocate memory for the buffers fill them with data */ - for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { - bitOffsets[i] = 0; + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; + } - key[i] = malloc(IMB_KASUMI_KEY_SIZE); - if (!key[i]) { - printf("malloc(key[%u]:failed !\n", i); - goto exit; - } + for (v = kasumi_f8_json; v->msg != NULL; v++) { - pKeySched[i] = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); - if (!pKeySched[i]) { - printf("malloc(pKeySched[%u]:failed !\n", i); - goto exit; - } + if ((v->msgSize % CHAR_BIT) != 0) + continue; - srcBuff[i] = malloc(MAX_DATA_LEN); - if (!srcBuff[i]) { - printf("malloc(srcBuff[%u]:failed !\n", i); - goto exit; - } - refBuff[i] = malloc(MAX_DATA_LEN); - if (!refBuff[i]) { - printf("malloc(refBuff[%u]:failed !\n", i); - goto exit; + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 0, 0)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; } - memset(key[i], 0xAA, IMB_KASUMI_KEY_SIZE); - if (IMB_KASUMI_INIT_F8_KEY_SCHED(mgr, key[i], pKeySched[i])) { - printf("IMB_KASUMI_INIT_F8_KEY_SCHED() error\n"); - goto exit; + /* Test the encrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); + else + IMB_KASUMI_F8_2_BUFFER(mgr, s.keySched[0], *s.pIV[0], *s.pIV[1], + s.encBuff[0], s.encBuff[0], s.packetLen[0], + s.encBuff[1], s.encBuff[1], s.packetLen[1]); + + /* Test the decrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); + else + IMB_KASUMI_F8_2_BUFFER(mgr, s.keySched[0], *s.pIV[0], *s.pIV[1], + s.decBuff[0], s.decBuff[0], s.packetLen[0], + s.decBuff[1], s.decBuff[1], s.packetLen[1]); + + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 0)) { + kasumi_f8_x_block_free(&s); + return 1; } - IV[i] = (uint64_t) i; - pIV[i] = &IV[i]; + kasumi_f8_x_block_clean_op(&s); + } + + printf("[%s]: PASS.\n", __FUNCTION__); + + kasumi_f8_x_block_free(&s); + return 0; +} + +static int +validate_kasumi_f8_3_blocks(IMB_MGR *mgr, const unsigned job_api) +{ + const uint32_t n = 3; + struct kasumi_f8_x_blocks s; + const struct cipher_test *v; + + printf("Testing IMB_KASUMI_F8_3_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); + + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; } - /* Testing multiple buffers of equal size */ - for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { - /* Testing Buffer sizes for 128 */ - buffLenInBytes[i] = 128; + for (v = kasumi_f8_json; v->msg != NULL; v++) { - for (j = 0; j <= i; j++) { - bitLens[j] = buffLenInBytes[i] * 8; + if ((v->msgSize % CHAR_BIT) != 0) + continue; - /* Reset input buffers with test data */ - memset(srcBuff[j], i, buffLenInBytes[i]); - memset(refBuff[j], i, buffLenInBytes[i]); + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 1, 0)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; } /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, - (uint8_t **) srcBuff, (uint8_t **) srcBuff, - (uint32_t *) bitLens, (uint32_t *) bitOffsets, - IMB_DIR_ENCRYPT, i + 1); + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); else - /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, - (void **) srcBuff, buffLenInBytes, i + 1); - if (srcBuff[i] == NULL) { - printf("N buffer failure\n"); - goto exit; - } + IMB_KASUMI_F8_3_BUFFER(mgr, s.keySched[0], *s.pIV[0], *s.pIV[1], *s.pIV[2], + s.encBuff[0], s.encBuff[0], s.encBuff[1], + s.encBuff[1], s.encBuff[2], s.encBuff[2], + s.packetLen[0]); - /* Test the Decrypt */ + /* Test the decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, - (uint8_t **) srcBuff, (uint8_t **) srcBuff, - (uint32_t *) bitLens, (uint32_t *) bitOffsets, - IMB_DIR_DECRYPT, i + 1); + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); else - /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, - (void **) srcBuff, buffLenInBytes, i + 1); - if (srcBuff[i] == NULL) { - printf("N buffer failure\n"); - goto exit; - } + IMB_KASUMI_F8_3_BUFFER(mgr, s.keySched[0], *s.pIV[0], *s.pIV[1], *s.pIV[2], + s.decBuff[0], s.decBuff[0], s.decBuff[1], + s.decBuff[1], s.decBuff[2], s.decBuff[2], + s.packetLen[0]); - for (j = 0; j <= i; j++) { - if (memcmp(srcBuff[j], refBuff[j], buffLenInBytes[j]) != 0) { - printf("kasumi_f8_n_buffer equal sizes, " - "numBuffs:%u\n", - i + 1); - hexdump(stdout, "Actual:", srcBuff[j], buffLenInBytes[j]); - hexdump(stdout, "Expected:", refBuff[j], buffLenInBytes[j]); - goto exit; - } + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 0)) { + kasumi_f8_x_block_free(&s); + return 1; } + + kasumi_f8_x_block_clean_op(&s); } - printf("[%s]: PASS, 1 to %u buffers of equal size.\n", __FUNCTION__, i); - /* Testing multiple buffers of increasing size */ - for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { + printf("[%s]: PASS.\n", __FUNCTION__); + kasumi_f8_x_block_free(&s); + return 0; +} + +static int +validate_kasumi_f8_4_blocks(IMB_MGR *mgr, const unsigned job_api) +{ + const uint32_t n = 4; + struct kasumi_f8_x_blocks s; + const struct cipher_test *v; + + printf("Testing IMB_KASUMI_F8_4_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); + + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; + } - /* Testing different Buffer sizes*/ - buffLenInBytes[i] = i + 131 * 8; + for (v = kasumi_f8_json; v->msg != NULL; v++) { - for (j = 0; j <= i; j++) { - bitLens[j] = buffLenInBytes[i] * 8; + if ((v->msgSize % CHAR_BIT) != 0) + continue; - /* Reset input buffers with test data */ - memset(srcBuff[j], i, buffLenInBytes[i]); - memset(refBuff[j], i, buffLenInBytes[i]); + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 1, 0)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; } /* Test the encrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, - (uint8_t **) srcBuff, (uint8_t **) srcBuff, - (uint32_t *) bitLens, (uint32_t *) bitOffsets, - IMB_DIR_DECRYPT, i + 1); + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); else - /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, - (void **) srcBuff, buffLenInBytes, i + 1); - if (srcBuff[i] == NULL) { - printf("N buffer failure\n"); - goto exit; - } + IMB_KASUMI_F8_4_BUFFER(mgr, s.keySched[0], *s.pIV[0], *s.pIV[1], *s.pIV[2], + *s.pIV[3], s.encBuff[0], s.encBuff[0], s.encBuff[1], + s.encBuff[1], s.encBuff[2], s.encBuff[2], + s.encBuff[3], s.encBuff[3], s.packetLen[0]); - /* Test the Decrypt */ + /* Test the decrypt */ if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, - (uint8_t **) srcBuff, (uint8_t **) srcBuff, - (uint32_t *) bitLens, (uint32_t *) bitOffsets, - IMB_DIR_DECRYPT, i + 1); + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); else - /* All buffers share the same key */ - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, - (void **) srcBuff, buffLenInBytes, i + 1); - if (srcBuff[i] == NULL) { - printf("N buffer failure\n"); - goto exit; - } + IMB_KASUMI_F8_4_BUFFER(mgr, s.keySched[0], *s.pIV[0], *s.pIV[1], *s.pIV[2], + *s.pIV[3], s.decBuff[0], s.decBuff[0], s.decBuff[1], + s.decBuff[1], s.decBuff[2], s.decBuff[2], + s.decBuff[3], s.decBuff[3], s.packetLen[0]); - for (j = 0; j <= i; j++) { - if (memcmp(srcBuff[j], refBuff[j], buffLenInBytes[j]) != 0) { - printf("kasumi_f8_n_buffer increasing sizes, " - "numBuffs:%u\n", - i + 1); - hexdump(stdout, "Actual:", srcBuff[j], buffLenInBytes[j]); - hexdump(stdout, "Expected:", refBuff[j], buffLenInBytes[j]); - goto exit; - } + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 0)) { + kasumi_f8_x_block_free(&s); + return 1; } + + kasumi_f8_x_block_clean_op(&s); } - printf("[%s]: PASS, 1 to %u buffers of increasing size.\n", __FUNCTION__, i); + printf("[%s]: PASS.\n", __FUNCTION__); + kasumi_f8_x_block_free(&s); + return 0; +} - /* Testing multiple buffers of decreasing size */ - for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { +static int +validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) +{ + const size_t max_n = 16; - /* Testing Buffer sizes from 3048 to 190 */ - buffLenInBytes[i] = MAX_DATA_LEN / (1 + i); + printf("Testing IMB_KASUMI_F8_N_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); - for (j = 0; j <= i; j++) { - bitLens[j] = buffLenInBytes[i] * 8; + for (uint32_t n = 1; n <= max_n; n++) { + struct kasumi_f8_x_blocks s; - /* Reset input buffers with test data */ - memset(srcBuff[j], i, buffLenInBytes[i]); - memset(refBuff[j], i, buffLenInBytes[i]); + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; } - /* Test the encrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, - (uint8_t **) srcBuff, (uint8_t **) srcBuff, - (uint32_t *) bitLens, (uint32_t *) bitOffsets, - IMB_DIR_DECRYPT, i + 1); - else - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, - (void **) srcBuff, buffLenInBytes, i + 1); - if (srcBuff[i] == NULL) { - printf("N buffer failure\n"); - goto exit; - } + for (const struct cipher_test *v = kasumi_f8_json; v->msg != NULL; v++) { - /* Test the Decrypt */ - if (job_api) - submit_kasumi_f8_jobs(mgr, pKeySched, (uint64_t **) pIV, - (uint8_t **) srcBuff, (uint8_t **) srcBuff, - (uint32_t *) bitLens, (uint32_t *) bitOffsets, - IMB_DIR_DECRYPT, i + 1); - else - IMB_KASUMI_F8_N_BUFFER(mgr, pKeySched[i], IV, (const void *const *) srcBuff, - (void **) srcBuff, buffLenInBytes, i + 1); - if (srcBuff[i] == NULL) { - printf("N buffer failure\n"); - goto exit; - } + if ((v->msgSize % CHAR_BIT) != 0) + continue; - for (j = 0; j <= i; j++) { - if (memcmp(srcBuff[j], refBuff[j], buffLenInBytes[j]) != 0) { - printf("kasumi_f8_n_buffer decreasing sizes, " - "numBuffs:%u\n", - i + 1); - hexdump(stdout, "Actual:", srcBuff[j], buffLenInBytes[j]); - hexdump(stdout, "Expected:", refBuff[j], buffLenInBytes[j]); - goto exit; + /* same size */ + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 1, 0)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; } - } + + /* Test the encrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); + else + /* All buffers share the same key */ + IMB_KASUMI_F8_N_BUFFER(mgr, s.keySched[0], s.IV, + (const void *const *) s.encBuff, + (void **) s.encBuff, s.packetLen, n); + + /* Test the decrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); + else + /* All buffers share the same key */ + IMB_KASUMI_F8_N_BUFFER(mgr, s.keySched[0], s.IV, + (const void *const *) s.decBuff, + (void **) s.decBuff, s.packetLen, n); + + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 0)) { + kasumi_f8_x_block_free(&s); + return 1; + } + + kasumi_f8_x_block_clean_op(&s); + } /* json vectors */ + + kasumi_f8_x_block_free(&s); } - ret = 0; - printf("[%s]: PASS, 1 to %u buffers of decreasing size.\n", __FUNCTION__, i); -exit: - /* free up test buffers */ - for (i = 0; i < NUM_SUPPORTED_BUFFERS; i++) { - free(key[i]); - free(pKeySched[i]); - free(srcBuff[i]); - free(refBuff[i]); + printf("[%s]: PASS, 1 to %zu buffers equal sizes.\n", __FUNCTION__, max_n); + + for (uint32_t n = 1; n <= max_n; n++) { + struct kasumi_f8_x_blocks s; + + if (!kasumi_f8_x_block_alloc(mgr, &s, n)) { + printf("F8 alloc failed !\n"); + return 1; + } + + for (const struct cipher_test *v = kasumi_f8_json; v->msg != NULL; v++) { + + if ((v->msgSize % CHAR_BIT) != 0) + continue; + + /* different sizes */ + if (!kasumi_f8_x_block_prep_op(mgr, &s, v, kasumi_f8_json, job_api, 0, 0)) { + kasumi_f8_x_block_free(&s); + printf("F8 prep failed !\n"); + return 1; + } + + /* Test the encrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.encBuff, s.encBuff, + s.bitLens, s.bitOffsets, IMB_DIR_ENCRYPT, n); + else + /* All buffers share the same key */ + IMB_KASUMI_F8_N_BUFFER(mgr, s.keySched[0], s.IV, + (const void *const *) s.encBuff, + (void **) s.encBuff, s.packetLen, n); + + /* Test the decrypt */ + if (job_api) + submit_kasumi_f8_jobs(mgr, s.keySched, s.pIV, s.decBuff, s.decBuff, + s.bitLens, s.bitOffsets, IMB_DIR_DECRYPT, n); + else + /* All buffers share the same key */ + IMB_KASUMI_F8_N_BUFFER(mgr, s.keySched[0], s.IV, + (const void *const *) s.decBuff, + (void **) s.decBuff, s.packetLen, n); + + if (!kasumi_f8_x_block_check_op(&s, __FUNCTION__, 0)) { + kasumi_f8_x_block_free(&s); + return 1; + } + + kasumi_f8_x_block_clean_op(&s); + } /* json vectors */ + + kasumi_f8_x_block_free(&s); } - return ret; + printf("[%s]: PASS, 1 to %zu buffers.\n", __FUNCTION__, max_n); + + return 0; } static int -- GitLab From 3bebe47f3b566aad3f2291e5ead3b09d52727588 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 24 Oct 2023 20:16:46 +0100 Subject: [PATCH 174/204] test: [kat-app] remove unused KASUMI F8 vectors --- test/kat-app/kasumi_test_vectors.h | 748 ----------------------------- 1 file changed, 748 deletions(-) diff --git a/test/kat-app/kasumi_test_vectors.h b/test/kat-app/kasumi_test_vectors.h index d5ffc7b1..4ae5c708 100644 --- a/test/kat-app/kasumi_test_vectors.h +++ b/test/kat-app/kasumi_test_vectors.h @@ -36,34 +36,6 @@ #define MAX_SIZE_IN_BYTES_1024 (1024) #define MAX_BIT_BUFFERS (6) -typedef struct cipher_test_vector_s { - uint32_t dataLenInBytes; - uint32_t keyLenInBytes; - uint32_t ivLenInBytes; - uint8_t plaintext[MAX_DATA_LEN]; - uint8_t ciphertext[MAX_DATA_LEN]; - uint8_t key[MAX_KEY_LEN]; - uint8_t iv[MAX_IV_LEN]; -} cipher_test_vector_t; -typedef struct cipherbit_test_vector_s { - uint32_t LenInBits; - uint32_t keyLenInBytes; - uint32_t ivLenInBytes; - uint8_t plaintext[MAX_DATA_LEN]; - uint8_t ciphertext[MAX_DATA_LEN]; - uint8_t key[MAX_KEY_LEN]; - uint8_t iv[MAX_IV_LEN]; -} cipherbit_test_vector_t; -typedef struct cipherbit_test_linear_vector_s { - uint32_t LenInBits[MAX_BIT_BUFFERS]; - uint32_t keyLenInBytes; - uint32_t ivLenInBytes; - uint8_t plaintext[MAX_DATA_LEN]; - uint8_t ciphertext[MAX_DATA_LEN]; - uint8_t key[MAX_BIT_BUFFERS][MAX_KEY_LEN]; - uint8_t iv[MAX_BIT_BUFFERS][MAX_IV_LEN]; -} cipherbit_test_linear_vector_t; - typedef struct hash_test_vector_s { uint8_t input[MAX_DATA_LEN]; uint32_t lengthInBytes; @@ -83,721 +55,6 @@ typedef struct hash_iv_test_vector_s { uint32_t direction; } hash_iv_test_vector_t; -static const cipherbit_test_linear_vector_t kasumi_f8_linear_bitvectors = { - - { 798, 510, 253, 120, 837 }, - 16, - 8, - { 0x7e, 0xc6, 0x12, 0x72, 0x74, 0x3b, 0xf1, 0x61, 0x47, 0x26, 0x44, 0x6a, 0x6c, 0x38, 0xce, - 0xd1, 0x66, 0xf6, 0xca, 0x76, 0xeb, 0x54, 0x30, 0x4, 0x42, 0x86, 0x34, 0x6c, 0xef, 0x13, - 0xf, 0x92, 0x92, 0x2b, 0x3, 0x45, 0xd, 0x3a, 0x99, 0x75, 0xe5, 0xbd, 0x2e, 0xa0, 0xeb, - 0x55, 0xad, 0x8e, 0x1b, 0x19, 0x9e, 0x3e, 0xc4, 0x31, 0x60, 0x20, 0xe9, 0xa1, 0xb2, 0x85, - 0xe7, 0x62, 0x79, 0x53, 0x59, 0xb7, 0xbd, 0xfd, 0x39, 0xbe, 0xf4, 0xb2, 0x48, 0x45, 0x83, - 0xd5, 0xaf, 0xe0, 0x82, 0xae, 0xe6, 0x38, 0xbf, 0x5f, 0xd5, 0xa6, 0x6, 0x19, 0x39, 0x1, - 0xa0, 0x8f, 0x4a, 0xb4, 0x1a, 0xab, 0x9b, 0x13, 0x48, 0x80, 0x40, 0x44, 0x48, 0xc7, 0x81, - 0x80, 0x94, 0xe9, 0xf, 0xf4, 0xfd, 0x5f, 0x8d, 0xd8, 0x1e, 0xac, 0xa0, 0x9e, 0xd6, 0x66, - 0xda, 0xc6, 0xef, 0x68, 0xde, 0xa2, 0xaf, 0x31, 0x6a, 0x31, 0x54, 0x34, 0x6f, 0xec, 0xbd, - 0x25, 0x18, 0x93, 0xed, 0x40, 0xd9, 0xfe, 0x8d, 0xb3, 0x8e, 0xf1, 0xa3, 0xc4, 0x73, 0xe4, - 0xec, 0x54, 0x40, 0xdd, 0xac, 0x8, 0x4c, 0x3e, 0x4, 0xaa, 0x7e, 0x85, 0xa7, 0x69, 0x81, - 0xba, 0x68, 0x24, 0xc1, 0xbf, 0xb1, 0xab, 0x48, 0x54, 0x72, 0x2, 0x9b, 0x71, 0xd8, 0x8, - 0xce, 0x33, 0xe2, 0xcc, 0x3c, 0xb, 0x5f, 0xc1, 0xf3, 0xde, 0x8a, 0x6d, 0xc6, 0x6b, 0x1f, - 0x56, 0xce, 0x22, 0xf, 0xc4, 0x85, 0x9c, 0x62, 0x2b, 0xd2, 0x4e, 0xa1, 0xa, 0x3, 0xf4, - 0x20, 0x4c, 0xd, 0xd3, 0x41, 0x26, 0xd, 0xfd, 0xa1, 0x43, 0x59, 0x4c, 0xbc, 0x1e, 0xd7, - 0xa2, 0x16, 0x4, 0xcf, 0xbd, 0x58, 0x7a, 0xc6, 0xae, 0x47, 0x23, 0x58, 0x82, 0x78, 0x47, - 0x80, 0xda, 0xd, 0x5a, 0x42, 0xa3, 0x90, 0x14, 0xdb, 0x8e, 0x9b, 0x5e, 0x8d, 0x1e, 0xc8, - 0x6e, 0x1d, 0x20, 0xda, 0x36, 0xa8, 0xb3, 0x95, 0x62, 0x64, 0xb3, 0x1d, 0x15, 0xf0, 0x31, - 0xed, 0x25, 0xe4, 0x69, 0x40, 0x46, 0x71, 0x9f, 0x16, 0x66, 0x5f, 0xe3, 0x1a, 0x70, 0xd9, - 0x2c, 0x83, 0x4, 0x3b, 0x50, 0x7d, 0xda, 0xd2, 0x1b, 0xf5, 0xe6, 0x46, 0x98, 0xe0, 0xcf, - 0x22, 0x2a, 0x18, 0xc3, 0xa2, 0xf1, 0xcc, 0x3b, 0x22, 0xcc, 0x3d, 0x4c, 0x37, 0x96, 0x58, - 0x0 }, - { 0xd1, 0xe2, 0xde, 0x70, 0xee, 0xf8, 0x6c, 0x69, 0x64, 0xfb, 0x54, 0x2b, 0xc2, 0xd4, 0x60, - 0xaa, 0xbf, 0xaa, 0x10, 0xa4, 0xa0, 0x93, 0x26, 0x2b, 0x7d, 0x19, 0x9e, 0x70, 0x6f, 0xc2, - 0xd4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xf3, 0xa9, 0x73, 0x1, 0x26, 0x82, 0xe4, 0x1c, - 0x4e, 0x2b, 0x2, 0xbe, 0x20, 0x17, 0xb7, 0x25, 0x3b, 0xbf, 0x93, 0x9, 0xde, 0x58, 0x19, - 0xcb, 0x42, 0xe8, 0x19, 0x56, 0xf4, 0xc9, 0x9b, 0xc9, 0x76, 0x5c, 0xaf, 0x53, 0xb1, 0xd0, - 0xbb, 0x82, 0x79, 0x82, 0x6a, 0xdb, 0xbc, 0x55, 0x22, 0xe9, 0x15, 0xc1, 0x20, 0xa6, 0x18, - 0xa5, 0xa7, 0xf5, 0xe8, 0x97, 0x8, 0x93, 0x39, 0x65, 0xc, 0xf7, 0xab, 0x31, 0xf0, 0x56, - 0x8, 0x72, 0xaa, 0x27, 0xbb, 0x2b, 0x7a, 0x6d, 0x6f, 0x4d, 0x85, 0x2f, 0x43, 0x21, 0x6, - 0x75, 0xc4, 0xe, 0x17, 0x76, 0xf9, 0x61, 0x27, 0xbc, 0x6e, 0xb1, 0x6b, 0xa2, 0xc5, 0x29, - 0x6c, 0x29, 0x9d, 0x5, 0x48, 0x7a, 0xd3, 0x80, 0x2e, 0xe7, 0xb3, 0xcf, 0xa7, 0xdf, 0x32, - 0xe7, 0x2b, 0x9d, 0x5, 0x4b, 0x5f, 0xd3, 0x8a, 0x80, 0xd2, 0xdb, 0xa8, 0x3, 0xb5, 0xbb, - 0x94, 0x31, 0xbb, 0x1e, 0x98, 0xbd, 0x11, 0xb9, 0x3d, 0xb7, 0xc3, 0xd4, 0x51, 0x36, 0x55, - 0x9b, 0xb8, 0x6a, 0x29, 0x5a, 0xa2, 0x4, 0xec, 0xbe, 0xbf, 0x6f, 0x7a, 0x51, 0x1, 0x51, - 0x4d, 0xe4, 0x96, 0x54, 0x1, 0xe3, 0x3d, 0x94, 0x50, 0x8d, 0x25, 0xf7, 0x2d, 0x6, 0x12, - 0xee, 0xd9, 0xb2, 0x6e, 0x95, 0x57, 0x61, 0x26, 0xff, 0x94, 0x8c, 0xab, 0xdb, 0xc5, 0xd6, - 0x83, 0x1d, 0x62, 0xbc, 0xe6, 0xc8, 0x20, 0xdd, 0x5f, 0x44, 0xfe, 0x8c, 0xae, 0x2, 0xbc, - 0x65, 0xcf, 0xef, 0x21, 0xb, 0xab, 0x30, 0xbc, 0x69, 0x1, 0x20, 0x10, 0x36, 0x83, 0xe7, - 0xd3, 0xc, 0xf6, 0x2, 0xcf, 0xb1, 0xa8, 0xa2, 0x2c, 0xfe, 0x8, 0x6a, 0x16, 0xe4, 0xc9, - 0xa7, 0x2b, 0x75, 0xe0, 0x65, 0xe3, 0x6, 0xa6, 0x96, 0xf8, 0xba, 0x3b, 0xa6, 0x5e, 0xe6, - 0xae, 0xd2, 0x51, 0xa8, 0x18, 0xbd, 0x3f, 0x89, 0x70, 0xca, 0x4a, 0x38, 0xfc, 0x51, 0x4a, - 0xf9, 0x39, 0x73, 0x47, 0xe0, 0x38, 0xac, 0xd8, 0x3e, 0xc7, 0x16, 0x93, 0x72, 0x2c, 0xcc, - 0x0 }, - { - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, - 0x81, 0xFF, 0x48 }, - { 0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, 0x55, 0xE9, - 0x60, 0x56, 0x95 }, - { 0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, 0x68, 0x0A, - 0xF8, 0xC6, 0xD1 }, - { 0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, 0x45, 0x10, - 0x10, 0xD8, 0x52 }, - { 0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, 0x2B, 0xE8, - 0xE3, 0x65, 0x66 }, - }, - { - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 }, - { 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00 }, - { 0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00 }, - { 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00 }, - } - -}; - -static const cipherbit_test_vector_t kasumi_f8_bitvectors[] = { - { 798, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x83 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer0*/ - { 510, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xDB }, - - { 0x3D, 0xEA, 0xCC, 0x7C, 0x15, 0x82, 0x1C, 0xAA, 0x89, 0xEE, 0xCA, 0xDE, 0x9B, - 0x5B, 0xD3, 0x61, 0x4B, 0xD0, 0xC8, 0x41, 0x9D, 0x71, 0x03, 0x85, 0xDD, 0xBE, - 0x58, 0x49, 0xEF, 0x1B, 0xAC, 0x5A, 0xE8, 0xB1, 0x4A, 0x5B, 0x0A, 0x67, 0x41, - 0x52, 0x1E, 0xB4, 0xE0, 0x0B, 0xB9, 0xEC, 0xF3, 0xE9, 0xF7, 0xCC, 0xB9, 0xCA, - 0xE7, 0x41, 0x52, 0xD7, 0xF4, 0xE2, 0xA0, 0x34, 0xB6, 0xEA, 0x00, 0xEF }, - - { 0xEF, 0xA8, 0xB2, 0x22, 0x9E, 0x72, 0x0C, 0x2A, 0x7C, 0x36, 0xEA, 0x55, 0xE9, 0x60, - 0x56, 0x95 }, - { 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00 } }, /*buffer1*/ - { 253, - 16, - 8, - { 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, 0xB4, 0x85, 0x47, - 0x20, 0x29, 0xB7, 0x1D, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, 0xC0, - 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x66, 0xB1, 0xF7 }, - { 0x5B, 0xB9, 0x43, 0x1B, 0xB1, 0xE9, 0x8B, 0xD1, 0x1B, 0x93, 0xDB, - 0x7C, 0x3D, 0x45, 0x13, 0x65, 0x59, 0xBB, 0x86, 0xA2, 0x95, 0xAA, - 0x20, 0x4E, 0xCB, 0xEB, 0xF6, 0xF7, 0xA5, 0x10, 0x15, 0x17 }, - { 0xD3, 0xC5, 0xD5, 0x92, 0x32, 0x7F, 0xB1, 0x1C, 0x40, 0x35, 0xC6, 0x68, 0x0A, 0xF8, - 0xC6, 0xD1 }, - { 0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00 } }, /*buffer2*/ - { 120, - 16, - 8, - { 0xAD, 0x9C, 0x44, 0x1F, 0x89, 0x0B, 0x38, 0xC4, 0x57, 0xA4, 0x9D, 0x42, 0x14, 0x07, - 0xE8 }, - { 0x9B, 0xC9, 0x2C, 0xA8, 0x03, 0xC6, 0x7B, 0x28, 0xA1, 0x1A, 0x4B, 0xEE, 0x5A, 0x0C, - 0x25 }, - { 0x5A, 0xCB, 0x1D, 0x64, 0x4C, 0x0D, 0x51, 0x20, 0x4E, 0xA5, 0xF1, 0x45, 0x10, 0x10, - 0xD8, 0x52 }, - { 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00 } }, /*buffer3*/ - { 837, - 16, - 8, - { 0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x42, 0x86, 0xB2, 0x99, 0x78, 0x3D, - 0xAF, 0x44, 0x2C, 0x09, 0x9F, 0x7A, 0xB0, 0xF5, 0x8D, 0x5C, 0x8E, 0x46, 0xB1, 0x04, - 0xF0, 0x8F, 0x01, 0xB4, 0x1A, 0xB4, 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, 0x36, 0xBD, - 0x1A, 0x3D, 0x90, 0xDC, 0x3A, 0x41, 0xB4, 0x6D, 0x51, 0x67, 0x2A, 0xC4, 0xC9, 0x66, - 0x3A, 0x2B, 0xE0, 0x63, 0xDA, 0x4B, 0xC8, 0xD2, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xCC, - 0xBF, 0xC6, 0x34, 0xE1, 0xB2, 0x59, 0x06, 0x08, 0x76, 0xA0, 0xFB, 0xB5, 0xA4, 0x37, - 0xEB, 0xCC, 0x8D, 0x31, 0xC1, 0x9E, 0x44, 0x54, 0x31, 0x87, 0x45, 0xE3, 0x98, 0x76, - 0x45, 0x98, 0x7A, 0x98, 0x6F, 0x2C, 0xB7 }, - { 0xDD, 0xB3, 0x64, 0xDD, 0x2A, 0xAE, 0xC2, 0x4D, 0xFF, 0x29, 0x19, 0x57, 0xB7, 0x8B, - 0xAD, 0x06, 0x3A, 0xC5, 0x79, 0xCD, 0x90, 0x41, 0xBA, 0xBE, 0x89, 0xFD, 0x19, 0x5C, - 0x05, 0x78, 0xCB, 0x9F, 0xDE, 0x42, 0x17, 0x56, 0x61, 0x78, 0xD2, 0x02, 0x40, 0x20, - 0x6D, 0x07, 0xCF, 0xA6, 0x19, 0xEC, 0x05, 0x9F, 0x63, 0x51, 0x44, 0x59, 0xFC, 0x10, - 0xD4, 0x2D, 0xC9, 0x93, 0x4E, 0x56, 0xEB, 0xC0, 0xCB, 0xC6, 0x0D, 0x4D, 0x2D, 0xF1, - 0x74, 0x77, 0x4C, 0xBD, 0xCD, 0x5D, 0xA4, 0xA3, 0x50, 0x31, 0x7A, 0x7F, 0x12, 0xE1, - 0x94, 0x94, 0x71, 0xF8, 0xA2, 0x95, 0xF2, 0x72, 0xE6, 0x8F, 0xC0, 0x71, 0x59, 0xB0, - 0x7D, 0x8E, 0x2D, 0x26, 0xE4, 0x59, 0x9F }, - { 0x60, 0x90, 0xEA, 0xE0, 0x4C, 0x83, 0x70, 0x6E, 0xEC, 0xBF, 0x65, 0x2B, 0xE8, 0xE3, - 0x65, 0x66 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00 } }, /*buffer3*/ -}; - -static cipher_test_vector_t kasumi_f8_vectors[] = { - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer0*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer1*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer2*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer3*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer4*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer5*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer6*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer7*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer8*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer9*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer10*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer11*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer12*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer13*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer14*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer15*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer16*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer17*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer18*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer19*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer20*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer21*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer22*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer23*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer24*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer25*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer26*/ - { 64, - 16, - 8, - { 0x10, 0x11, 0x12, 0x31, 0xE0, 0x60, 0x25, 0x3A, 0x43, 0xFD, 0x3F, 0x57, 0xE3, - 0x76, 0x07, 0xAB, 0x28, 0x27, 0xB5, 0x99, 0xB6, 0xB1, 0xBB, 0xDA, 0x37, 0xA8, - 0xAB, 0xCC, 0x5A, 0x8C, 0x55, 0x0D, 0x1B, 0xFB, 0x2F, 0x49, 0x46, 0x24, 0xFB, - 0x50, 0x36, 0x7F, 0xA3, 0x6C, 0xE3, 0xBC, 0x68, 0xF1, 0x1C, 0xF9, 0x3B, 0x15, - 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - { 0xBF, 0x35, 0xDE, 0x33, 0x7A, 0xA3, 0xB8, 0x32, 0x60, 0x20, 0x2F, 0x16, 0x4D, - 0x9A, 0xA9, 0xD0, 0xF1, 0x7B, 0x6F, 0x4B, 0xFD, 0x76, 0xAD, 0xF5, 0x08, 0x37, - 0x01, 0xD0, 0xDA, 0x5D, 0x8E, 0x16, 0x9C, 0x83, 0x05, 0x65, 0x5B, 0xED, 0xCB, - 0x56, 0xD2, 0xE4, 0x0F, 0x28, 0x14, 0xA7, 0xEE, 0x7D, 0xB9, 0xC0, 0xB2, 0x9C, - 0xF1, 0x3D, 0xB4, 0xB1, 0xF3, 0x70, 0x6B, 0xB6, 0xB3, 0x81, 0xF8, 0x92 }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } }, /*buffer27*/ - { 100, - 16, - 8, - { 0x7E, 0xC6, 0x12, 0x72, 0x74, 0x3B, 0xF1, 0x61, 0x47, 0x26, 0x44, 0x6A, 0x6C, - 0x38, 0xCE, 0xD1, 0x66, 0xF6, 0xCA, 0x76, 0xEB, 0x54, 0x30, 0x04, 0x42, 0x86, - 0x34, 0x6C, 0xEF, 0x13, 0x0F, 0x92, 0x92, 0x2B, 0x03, 0x45, 0x0D, 0x3A, 0x99, - 0x75, 0xE5, 0xBD, 0x2E, 0xA0, 0xEB, 0x55, 0xAD, 0x8E, 0x1B, 0x19, 0x9E, 0x3E, - 0xC4, 0x31, 0x60, 0x20, 0xE9, 0xA1, 0xB2, 0x85, 0xE7, 0x62, 0x79, 0x53, 0x59, - 0xB7, 0xBD, 0xFD, 0x39, 0xBE, 0xF4, 0xB2, 0x48, 0x45, 0x83, 0xD5, 0xAF, 0xE0, - 0x82, 0xAE, 0xE6, 0x38, 0xBF, 0x5F, 0xD5, 0xA6, 0x06, 0x19, 0x39, 0x01, 0xA0, - 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - { 0xD1, 0xE2, 0xDE, 0x70, 0xEE, 0xF8, 0x6C, 0x69, 0x64, 0xFB, 0x54, 0x2B, 0xC2, - 0xD4, 0x60, 0xAA, 0xBF, 0xAA, 0x10, 0xA4, 0xA0, 0x93, 0x26, 0x2B, 0x7D, 0x19, - 0x9E, 0x70, 0x6F, 0xC2, 0xD4, 0x89, 0x15, 0x53, 0x29, 0x69, 0x10, 0xF3, 0xA9, - 0x73, 0x01, 0x26, 0x82, 0xE4, 0x1C, 0x4E, 0x2B, 0x02, 0xBE, 0x20, 0x17, 0xB7, - 0x25, 0x3B, 0xBF, 0x93, 0x09, 0xDE, 0x58, 0x19, 0xCB, 0x42, 0xE8, 0x19, 0x56, - 0xF4, 0xC9, 0x9B, 0xC9, 0x76, 0x5C, 0xAF, 0x53, 0xB1, 0xD0, 0xBB, 0x82, 0x79, - 0x82, 0x6A, 0xDB, 0xBC, 0x55, 0x22, 0xE9, 0x15, 0xC1, 0x20, 0xA6, 0x18, 0xA5, - 0xA7, 0xF5, 0xE8, 0x97, 0x08, 0x93, 0x39, 0x65, 0x0F }, - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 } } /*buffer28*/ -}; - static hash_test_vector_t kasumi_f9_vectors[] = { { /*input*/ { 0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49, 0x6B, 0x22, 0x77, @@ -1050,11 +307,6 @@ static hash_iv_test_vector_t kasumi_f9_IV_vectors[] = { } }; -const cipher_test_vector_t *cipher_test_vectors[] = { kasumi_f8_vectors }; -const uint32_t numCipherTestVectors[] = { sizeof(kasumi_f8_vectors) / sizeof(cipher_test_vector_t), - sizeof(kasumi_f8_bitvectors) / - sizeof(cipherbit_test_vector_t) }; - const uint32_t numHashTestVectors[] = { sizeof(kasumi_f9_vectors) / sizeof(hash_test_vector_t), sizeof(kasumi_f9_IV_vectors) / sizeof(hash_iv_test_vector_t) }; -- GitLab From 393399234cdb3916fa4971c2d08ac9158d241d71 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 25 Oct 2023 13:21:28 +0100 Subject: [PATCH 175/204] test: [kat-app] use new vector format in KASUMI F9 tests --- test/kat-app/kasumi_test.c | 156 +++++++++++++++---------------------- 1 file changed, 62 insertions(+), 94 deletions(-) diff --git a/test/kat-app/kasumi_test.c b/test/kat-app/kasumi_test.c index 6f2a6616..c8c096d8 100644 --- a/test/kat-app/kasumi_test.c +++ b/test/kat-app/kasumi_test.c @@ -72,7 +72,7 @@ struct kasumi_test_case { }; /* kasumi f8 validation function pointer table */ -struct kasumi_test_case kasumi_f8_func_tab[] = { +static const struct kasumi_test_case kasumi_f8_func_tab[] = { { validate_kasumi_f8_1_block, "validate_kasumi_f8_1_block" }, { validate_kasumi_f8_1_bitblock, "validate_kasumi_f8_1_bitblock" }, { validate_kasumi_f8_1_bitblock_offset, "validate_kasumi_f8_1_bitblock_offset" }, @@ -83,9 +83,10 @@ struct kasumi_test_case kasumi_f8_func_tab[] = { }; /* kasumi f9 validation function pointer table */ -struct kasumi_test_case kasumi_f9_func_tab[] = { { validate_kasumi_f9, "validate_kasumi_f9" }, - { validate_kasumi_f9_user, - "validate_kasumi_f9_user" } }; +static const struct kasumi_test_case kasumi_f9_func_tab[] = { + { validate_kasumi_f9, "validate_kasumi_f9" }, + { validate_kasumi_f9_user, "validate_kasumi_f9_user" } +}; static int submit_kasumi_f8_jobs(struct IMB_MGR *mb_mgr, kasumi_key_sched_t **keys, uint64_t **ivs, @@ -134,7 +135,7 @@ submit_kasumi_f8_jobs(struct IMB_MGR *mb_mgr, kasumi_key_sched_t **keys, uint64_ } static int -submit_kasumi_f9_job(struct IMB_MGR *mb_mgr, kasumi_key_sched_t *key, uint8_t *src, uint8_t *tag, +submit_kasumi_f9_job(struct IMB_MGR *mb_mgr, kasumi_key_sched_t *key, const void *src, void *tag, const uint32_t len) { IMB_JOB *job; @@ -194,7 +195,7 @@ struct kasumi_f8_x_blocks { uint32_t *packetLen; uint32_t *bitLens; uint32_t *bitOffsets; - const struct cipher_test **vt; + struct cipher_test **vt; uint8_t **encBuff; uint8_t **decBuff; @@ -435,7 +436,7 @@ static int kasumi_f8_x_block_check_op(struct kasumi_f8_x_blocks *s, const char *name, const int bit_length) { if (!bit_length) { - /* Compare the ciphertext with the encrypted plaintext */ + /* Compare the cipher-text with the encrypted plain-text */ for (size_t i = 0; i < s->n; i++) { if (memcmp(s->encBuff[i], s->vt[i]->ct, s->packetLen[i]) != 0) { printf("%s(Enc) tcId:%zu\n", name, s->vt[i]->tcId); @@ -445,7 +446,7 @@ kasumi_f8_x_block_check_op(struct kasumi_f8_x_blocks *s, const char *name, const } } - /* Compare the plaintext with the decrypted ciphertext */ + /* Compare the plain-text with the decrypted cipher-text */ for (size_t i = 0; i < s->n; i++) { if (memcmp(s->decBuff[i], s->vt[i]->msg, s->packetLen[i]) != 0) { printf("%s(Dec) tcId:%zu\n", name, s->vt[i]->tcId); @@ -455,7 +456,7 @@ kasumi_f8_x_block_check_op(struct kasumi_f8_x_blocks *s, const char *name, const } } } else { - /* Compare the ciphertext with the encrypted plaintext */ + /* Compare the cipher-text with the encrypted plain-text */ for (size_t i = 0; i < s->n; i++) { uint8_t *cp = malloc(s->packetLen[i] + 1); @@ -958,71 +959,52 @@ validate_kasumi_f8_n_blocks(IMB_MGR *mgr, const unsigned job_api) static int validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) { - kasumi_key_sched_t *pKeySched = NULL; - uint8_t *pKey = NULL; - int keyLen = 16; - uint8_t srcBuff[MAX_DATA_LEN]; - uint8_t digest[IMB_KASUMI_DIGEST_SIZE]; - int numKasumiF9TestVectors, i; - hash_test_vector_t *kasumiF9_test_vectors = NULL; - int ret = 1; + int ret = 1; /* assume error */ printf("Testing IMB_KASUMI_F9_1_BUFFER (%s):\n", job_api ? "Job API" : "Direct API"); - kasumiF9_test_vectors = kasumi_f9_vectors; - numKasumiF9TestVectors = numHashTestVectors[0]; - - if (!numKasumiF9TestVectors) { - printf("No Kasumi vectors found !\n"); - goto exit; - } - pKey = malloc(keyLen); - if (!pKey) { - printf("malloc(pkey):failed!\n"); - goto exit; - } - - pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); + kasumi_key_sched_t *pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); if (!pKeySched) { printf("malloc (IMB_KASUMI_KEY_SCHED_SIZE()): failed !\n"); goto exit; } - /* Create the test Data */ - for (i = 0; i < numKasumiF9TestVectors; i++) { - uint32_t byteLen = kasumiF9_test_vectors[i].lengthInBytes; + for (const struct mac_test *v = kasumi_f9_json; v->msg != NULL; v++) { - memcpy(pKey, kasumiF9_test_vectors[i].key, kasumiF9_test_vectors[i].keyLenInBytes); + /* in this test skip vectors with non-empty IV */ + if (v->ivSize != 0) + continue; - memcpy(srcBuff, kasumiF9_test_vectors[i].input, byteLen); + const uint32_t byteLen = (uint32_t)((v->msgSize + 7) / CHAR_BIT); - memcpy(digest, kasumiF9_test_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE); + IMB_ASSERT(v->keySize == (IMB_KASUMI_KEY_SIZE * CHAR_BIT)); - if (IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, pKey, pKeySched)) { + if (IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, v->key, pKeySched)) { printf("IMB_KASUMI_INIT_F9_KEY_SCHED()error\n"); goto exit; } + uint8_t digest[IMB_KASUMI_DIGEST_SIZE] = { 0 }; + /* Test F9 integrity */ if (job_api) - submit_kasumi_f9_job(mgr, pKeySched, srcBuff, digest, byteLen); + submit_kasumi_f9_job(mgr, pKeySched, v->msg, digest, byteLen); else - IMB_KASUMI_F9_1_BUFFER(mgr, pKeySched, srcBuff, byteLen, digest); + IMB_KASUMI_F9_1_BUFFER(mgr, pKeySched, v->msg, byteLen, digest); /* Compare the digest with the expected in the vectors */ - if (memcmp(digest, kasumiF9_test_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE) != 0) { + IMB_ASSERT(v->tagSize == (IMB_KASUMI_DIGEST_SIZE * CHAR_BIT)); + if (memcmp(digest, v->tag, IMB_KASUMI_DIGEST_SIZE) != 0) { hexdump(stdout, "Actual", digest, IMB_KASUMI_DIGEST_SIZE); - hexdump(stdout, "Expected", kasumiF9_test_vectors[i].exp_out, - IMB_KASUMI_DIGEST_SIZE); - printf("F9 integrity %d Failed\n", i); + hexdump(stdout, "Expected", v->tag, v->tagSize / CHAR_BIT); + printf("F9 integrity tcId:%zu Failed\n", v->tcId); goto exit; } } ret = 0; - printf("[%s]: PASS, for %d single buffers.\n", __FUNCTION__, numKasumiF9TestVectors); + printf("[%s]: PASS, for single buffers.\n", __FUNCTION__); exit: - free(pKey); free(pKeySched); return ret; } @@ -1030,76 +1012,62 @@ exit: static int validate_kasumi_f9_user(IMB_MGR *mgr, const unsigned job_api) { - int numKasumiF9IV_TestVectors = 0, i = 0; - hash_iv_test_vector_t *kasumiF9_vectors = NULL; - - kasumiF9_vectors = kasumi_f9_IV_vectors; - numKasumiF9IV_TestVectors = numHashTestVectors[1]; - - kasumi_key_sched_t *pKeySched = NULL; - uint8_t *pKey = NULL; - int keyLen = MAX_KEY_LEN; - - uint64_t iv[MAX_IV_LEN]; - uint8_t srcBuff[MAX_DATA_LEN]; - uint8_t digest[IMB_KASUMI_DIGEST_SIZE]; - uint32_t direction; - int ret = 1; - - (void) job_api; /* unused parameter */ + /* only direct API available here */ + if (job_api) + return 0; - if (!numKasumiF9IV_TestVectors) { - printf("No Kasumi vectors found !\n"); - goto exit; - } + int ret = 1; /* assume error */ - pKey = malloc(keyLen); - if (!pKey) { - printf("malloc(pkey):failed!\n"); - goto exit; - } + printf("Testing IMB_KASUMI_F9_1_BUFFER_USER (%s):\n", job_api ? "Job API" : "Direct API"); - pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); + kasumi_key_sched_t *pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); if (!pKeySched) { printf("malloc (IMB_KASUMI_KEY_SCHED_SIZE()): failed !\n"); goto exit; } - /* Create the test data */ - for (i = 0; i < numKasumiF9IV_TestVectors; i++) { - memcpy(pKey, kasumiF9_vectors[i].key, kasumiF9_vectors[i].keyLenInBytes); + for (const struct mac_test *v = kasumi_f9_json; v->msg != NULL; v++) { - memcpy(srcBuff, kasumiF9_vectors[i].input, - (kasumiF9_vectors[i].lengthInBits + 7 / CHAR_BIT)); + /* in this test skip vectors with empty IV */ + if (v->ivSize != ((IMB_KASUMI_IV_SIZE + 1) * CHAR_BIT)) + continue; + + uint64_t iv = 0; + + IMB_ASSERT(sizeof(iv) == IMB_KASUMI_IV_SIZE); + memcpy(&iv, &v->iv[1], IMB_KASUMI_IV_SIZE); - memcpy(iv, kasumiF9_vectors[i].iv, kasumiF9_vectors[i].ivLenInBytes); + const uint32_t direction = (uint32_t) v->iv[0]; - direction = kasumiF9_vectors[i].direction; + IMB_ASSERT(v->keySize == (IMB_KASUMI_KEY_SIZE * CHAR_BIT)); - /* Only 1 key sched is used */ - if (IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, pKey, pKeySched)) { + if (IMB_KASUMI_INIT_F9_KEY_SCHED(mgr, v->key, pKeySched)) { printf("IMB_KASUMI_INIT_F9_KEY_SCHED() error\n"); goto exit; } + + uint8_t digest[IMB_KASUMI_DIGEST_SIZE] = { 0 }; + /* Test the integrity for f9_user with IV */ - IMB_KASUMI_F9_1_BUFFER_USER(mgr, pKeySched, iv[0], srcBuff, - kasumiF9_vectors[i].lengthInBits, digest, direction); + IMB_ASSERT(v->msgSize < UINT32_MAX); + IMB_KASUMI_F9_1_BUFFER_USER(mgr, pKeySched, iv, v->msg, (uint32_t) v->msgSize, + digest, direction); /* Compare the digest with the expected in the vectors */ - if (memcmp(digest, kasumiF9_vectors[i].exp_out, IMB_KASUMI_DIGEST_SIZE) != 0) { + IMB_ASSERT(v->tagSize == (IMB_KASUMI_DIGEST_SIZE * CHAR_BIT)); + if (memcmp(digest, v->tag, IMB_KASUMI_DIGEST_SIZE) != 0) { hexdump(stdout, "digest", digest, IMB_KASUMI_DIGEST_SIZE); - hexdump(stdout, "exp_out", kasumiF9_vectors[i].exp_out, - IMB_KASUMI_DIGEST_SIZE); + hexdump(stdout, "expected", v->tag, v->tagSize / CHAR_BIT); printf("direction %u\n", direction); - printf("F9 integrity %d Failed\n", i); + printf("F9 integrity tcId:%zu Failed\n", v->tcId); goto exit; } } + printf("[%s]: PASS, for single buffers.\n", __FUNCTION__); ret = 0; - printf("[%s]: PASS, for %d single buffers.\n", __FUNCTION__, i); + exit: - free(pKey); free(pKeySched); return ret; } @@ -1113,7 +1081,7 @@ kasumi_test(struct IMB_MGR *mb_mgr) test_suite_start(&ts, "KASUMI-F8"); for (i = 0; i < DIM(kasumi_f8_func_tab); i++) { - /* validate direct api */ + /* validate direct API */ if (kasumi_f8_func_tab[i].func(mb_mgr, 0)) { printf("%s: FAIL\n", kasumi_f8_func_tab[i].func_name); test_suite_update(&ts, 0, 1); @@ -1121,7 +1089,7 @@ kasumi_test(struct IMB_MGR *mb_mgr) test_suite_update(&ts, 1, 0); } - /* validate job api */ + /* validate job API */ if (kasumi_f8_func_tab[i].func(mb_mgr, 1)) { printf("%s: FAIL\n", kasumi_f8_func_tab[i].func_name); test_suite_update(&ts, 0, 1); @@ -1133,7 +1101,7 @@ kasumi_test(struct IMB_MGR *mb_mgr) test_suite_start(&ts, "KASUMI-F9"); for (i = 0; i < DIM(kasumi_f9_func_tab); i++) { - /* validate direct api */ + /* validate direct API */ if (kasumi_f9_func_tab[i].func(mb_mgr, 0)) { printf("%s: FAIL\n", kasumi_f9_func_tab[i].func_name); test_suite_update(&ts, 0, 1); @@ -1141,7 +1109,7 @@ kasumi_test(struct IMB_MGR *mb_mgr) test_suite_update(&ts, 1, 0); } - /* validate job api */ + /* validate job API */ if (kasumi_f9_func_tab[i].func(mb_mgr, 1)) { printf("%s: FAIL\n", kasumi_f9_func_tab[i].func_name); test_suite_update(&ts, 0, 1); -- GitLab From 49a853df39b8e47dca56c2e659f03ef1d3ad3eed Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Wed, 25 Oct 2023 14:03:07 +0100 Subject: [PATCH 176/204] test: [kat-app] remove unused KASUMI F9 vectors --- test/kat-app/kasumi_test.c | 16 +- test/kat-app/kasumi_test_vectors.h | 314 ----------------------------- 2 files changed, 8 insertions(+), 322 deletions(-) delete mode 100644 test/kat-app/kasumi_test_vectors.h diff --git a/test/kat-app/kasumi_test.c b/test/kat-app/kasumi_test.c index c8c096d8..b43ba78c 100644 --- a/test/kat-app/kasumi_test.c +++ b/test/kat-app/kasumi_test.c @@ -36,8 +36,6 @@ #include -#include "gcm_ctr_vectors_test.h" -#include "kasumi_test_vectors.h" #include "utils.h" #include "mac_test.h" #include "cipher_test.h" @@ -195,7 +193,7 @@ struct kasumi_f8_x_blocks { uint32_t *packetLen; uint32_t *bitLens; uint32_t *bitOffsets; - struct cipher_test **vt; + const struct cipher_test **vt; uint8_t **encBuff; uint8_t **decBuff; @@ -237,7 +235,7 @@ kasumi_f8_x_block_free(struct kasumi_f8_x_blocks *s) if (s->bitOffsets) free(s->bitOffsets); if (s->vt) - free(s->vt); + free((void *) s->vt); if (s->encBuff) free(s->encBuff); if (s->decBuff) @@ -281,8 +279,10 @@ kasumi_f8_x_block_alloc(IMB_MGR *mgr, struct kasumi_f8_x_blocks *s, const size_t memset(s->bitOffsets, 0, n * sizeof(s->bitOffsets[0])); s->vt = malloc(n * sizeof(s->vt[0])); - if (s->vt) - memset(s->vt, 0, n * sizeof(s->vt[0])); + if (s->vt) { + for (size_t i = 0; i < n; i++) + s->vt[i] = NULL; + } s->encBuff = malloc(n * sizeof(s->encBuff[0])); if (s->encBuff) @@ -975,7 +975,7 @@ validate_kasumi_f9(IMB_MGR *mgr, const unsigned job_api) if (v->ivSize != 0) continue; - const uint32_t byteLen = (uint32_t)((v->msgSize + 7) / CHAR_BIT); + const uint32_t byteLen = (uint32_t) ((v->msgSize + 7) / CHAR_BIT); IMB_ASSERT(v->keySize == (IMB_KASUMI_KEY_SIZE * CHAR_BIT)); @@ -1018,7 +1018,7 @@ validate_kasumi_f9_user(IMB_MGR *mgr, const unsigned job_api) int ret = 1; /* assume error */ - printf("Testing IMB_KASUMI_F9_1_BUFFER_USER (%s):\n", job_api ? "Job API" : "Direct API"); + printf("Testing IMB_KASUMI_F9_1_BUFFER_USER (Direct API):\n"); kasumi_key_sched_t *pKeySched = malloc(IMB_KASUMI_KEY_SCHED_SIZE(mgr)); if (!pKeySched) { diff --git a/test/kat-app/kasumi_test_vectors.h b/test/kat-app/kasumi_test_vectors.h deleted file mode 100644 index 4ae5c708..00000000 --- a/test/kat-app/kasumi_test_vectors.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 2009-2023, Intel Corporation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __KASUMI_TEST_VECTORS_H__ -#define __KASUMI_TEST_VECTORS_H__ - -#define MAX_DATA_LEN (2500) -#define MAX_KEY_LEN (32) -#define MAX_IV_LEN (16) -#define NUM_SUPPORTED_BUFFERS (16) -#define MAX_SIZE_IN_BYTES_1024 (1024) -#define MAX_BIT_BUFFERS (6) - -typedef struct hash_test_vector_s { - uint8_t input[MAX_DATA_LEN]; - uint32_t lengthInBytes; - uint8_t key[MAX_DATA_LEN]; - uint32_t keyLenInBytes; - uint8_t exp_out[IMB_KASUMI_BLOCK_SIZE]; -} hash_test_vector_t; - -typedef struct hash_iv_test_vector_s { - uint8_t input[MAX_DATA_LEN]; - uint32_t lengthInBits; - uint8_t key[MAX_DATA_LEN]; - uint32_t keyLenInBytes; - uint8_t exp_out[IMB_KASUMI_BLOCK_SIZE]; - uint8_t iv[MAX_DATA_LEN]; - uint32_t ivLenInBytes; - uint32_t direction; -} hash_iv_test_vector_t; - -static hash_test_vector_t kasumi_f9_vectors[] = { - { /*input*/ - { 0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49, 0x6B, 0x22, 0x77, - 0x37, 0x29, 0x6F, 0x39, 0x3C, 0x80, 0x79, 0x35, 0x3E, 0xDC, 0x87, - 0xE2, 0xE8, 0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE2 }, - /*inputlength*/ - 32, - /*key*/ - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, - 0xFF, 0x48 }, - /*keylength*/ - 16, - /*expectedout*/ - { 0xF6, 0x3B, 0xD7, 0x2C } }, - { { 0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2, 0xB5, 0x92, 0x43, 0x84, 0x32, 0x8A, - 0x4A, 0xE0, 0x0B, 0x73, 0x71, 0x09, 0xF8, 0xB6, 0xC8, 0xDD, 0x2B, 0x4D, 0xB6, 0x3D, - 0xD5, 0x33, 0x98, 0x1C, 0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC3 }, - 40, - { 0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF, 0xCD, 0x9F, 0x97, 0x94, 0x5E, 0x6D, - 0xE7, 0xB7 }, - 16, - { 0xA9, 0xDA, 0xF1, 0xFF } }, - { { 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, 0xD0, 0xA7, 0xD4, 0x63, - 0xDF, 0x9F, 0xB2, 0xB2, 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, - 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, 0x07, 0xFB, 0x64, 0x8B, - 0x65, 0x99, 0xAA, 0xA0, 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, - 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09, 0xC0 }, - 57, - { 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, - 0xD5, 0x7E }, - 16, - { 0xDD, 0x7D, 0xFA, 0xDD } }, - { { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0xB3, 0xD3, 0xC9, 0x17, 0x0A, 0x4E, - 0x16, 0x32, 0xF6, 0x0F, 0x86, 0x10, 0x13, 0xD2, 0x2D, 0x84, 0xB7, 0x26, 0xB6, 0xA2, - 0x78, 0xD8, 0x02, 0xD1, 0xEE, 0xAF, 0x13, 0x21, 0xBA, 0x59, 0x29, 0xDF }, - 40, - { 0x7E, 0x5E, 0x94, 0x43, 0x1E, 0x11, 0xD7, 0x38, 0x28, 0xD7, 0x39, 0xCC, 0x6C, 0xED, - 0x45, 0x73 }, - 16, - { 0x2B, 0xEE, 0xF3, 0xAC } - - }, - { { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0x59, 0x32, 0xBC, 0x0A, 0xCE, - 0x2B, 0x0A, 0xBA, 0x33, 0xD8, 0xAC, 0x18, 0x8A, 0xC5, 0x4F, 0x34, 0x6F, 0xAD, - 0x10, 0xBF, 0x9D, 0xEE, 0x29, 0x20, 0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, 0x5C, - 0xB7, 0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF3, 0x80 }, - 49, - { 0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4, 0x83, 0xA3, 0x18, 0x69, 0xD8, 0x1B, - 0x8F, 0xAB }, - 16, - { 0x15, 0x37, 0xD3, 0x16 } }, - { { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A, 0xD3, 0xC5, 0x38, 0x39, - 0x62, 0x68, 0x20, 0x71, 0x77, 0x65, 0x66, 0x76, 0x20, 0x32, 0x38, 0x37, - 0x63, 0x62, 0x40, 0x98, 0x1B, 0xA6, 0x82, 0x4C, 0x1B, 0xFB, 0x1A, 0xB4, - 0x85, 0x47, 0x20, 0x29, 0xB7, 0x1D, 0x80, 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, - 0xC0, 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x80 }, - 57, - { 0x68, 0x32, 0xA6, 0x5C, 0xFF, 0x44, 0x73, 0x62, 0x1E, 0xBD, 0xD4, 0xBA, 0x26, 0xA9, - 0x21, 0xFE }, - 16, - { 0x8B, 0x2D, 0x57, 0x0F } }, - { { 0xC7, 0x59, 0x0E, 0xA9, 0x57, 0xD5, 0xDF, 0x7D, 0xBB, 0xB0, 0x57, 0x03, 0x88, - 0x09, 0x49, 0x6B, 0xCF, 0xF8, 0x6D, 0x6F, 0xBC, 0x8C, 0xE5, 0xB1, 0x35, 0xA0, - 0x6B, 0x16, 0x60, 0x54, 0xF2, 0xD5, 0x65, 0xBE, 0x8A, 0xCE, 0x75, 0xDC, 0x85, - 0x1E, 0x0B, 0xCD, 0xD8, 0xF0, 0x71, 0x41, 0xC4, 0x95, 0x87, 0x2F, 0xB5, 0xD8, - 0xC0, 0xC6, 0x6A, 0x8B, 0x6D, 0xA5, 0x56, 0x66, 0x3E, 0x4E, 0x46, 0x12, 0x05, - 0xD8, 0x45, 0x80, 0xBE, 0xE5, 0xBC, 0x7E, 0x80 }, - 73, - { 0xD3, 0x41, 0x9B, 0xE8, 0x21, 0x08, 0x7A, 0xCD, 0x02, 0x12, 0x3A, 0x92, 0x48, 0x03, - 0x33, 0x59 }, - 16, - { 0x02, 0x15, 0x81, 0x70 } }, - { { 0x36, 0xAF, 0x61, 0x44, 0x4F, 0x30, 0x2A, 0xD2, 0x35, 0xC6, 0x87, 0x16, 0x63, 0x3C, - 0x66, 0xFB, 0x75, 0x0C, 0x26, 0x68, 0x65, 0xD5, 0x3C, 0x11, 0xEA, 0x05, 0xB1, 0xE9, - 0xFA, 0x49, 0xC8, 0x39, 0x8D, 0x48, 0xE1, 0xEF, 0xA5, 0x90, 0x9D, 0x39, 0x47, 0x90, - 0x28, 0x37, 0xF5, 0xAE, 0x96, 0xD5, 0xA0, 0x5B, 0xC8, 0xD6, 0x1C, 0xA8, 0xDB, 0xEF, - 0x1B, 0x13, 0xA4, 0xB4, 0xAB, 0xFE, 0x4F, 0xB1, 0x00, 0x60, 0x45, 0xB6, 0x74, 0xBB, - 0x54, 0x72, 0x93, 0x04, 0xC3, 0x82, 0xBE, 0x53, 0xA5, 0xAF, 0x05, 0x55, 0x61, 0x76, - 0xF6, 0xEA, 0xA2, 0xEF, 0x1D, 0x05, 0xE4, 0xB0, 0x83, 0x18, 0x1E, 0xE6, 0x74, 0xCD, - 0xA5, 0xA4, 0x85, 0xF7, 0x4D, 0x7A, 0xC0 }, - 105, - { 0x83, 0xFD, 0x23, 0xA2, 0x44, 0xA7, 0x4C, 0xF3, 0x58, 0xDA, 0x30, 0x19, 0xF1, 0x72, - 0x26, 0x35 }, - 16, - { 0x95, 0xAE, 0x41, 0xBA } }, - { { 0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37, 0x10, 0xBF, 0xFF, 0x83, 0x9E, 0x0C, - 0x71, 0x65, 0x8D, 0xBB, 0x2D, 0x17, 0x07, 0xE1, 0x45, 0x72, 0x4F, 0x41, 0xC1, 0x6F, - 0x48, 0xBF, 0x40, 0x3C, 0x3B, 0x18, 0xE3, 0x8F, 0xD5, 0xD1, 0x66, 0x3B, 0x6F, 0x6D, - 0x90, 0x01, 0x93, 0xE3, 0xCE, 0xA8, 0xBB, 0x4F, 0x1B, 0x4F, 0x5B, 0xE8, 0x22, 0x03, - 0x22, 0x32, 0xA7, 0x8D, 0x7D, 0x75, 0x23, 0x8D, 0x5E, 0x6D, 0xAE, 0xCD, 0x3B, 0x43, - 0x22, 0xCF, 0x59, 0xBC, 0x7E, 0xA8, 0x4A, 0xB1, 0x88, 0x11, 0xB5, 0xBF, 0xB7, 0xBC, - 0x55, 0x3F, 0x4F, 0xE4, 0x44, 0x78, 0xCE, 0x28, 0x7A, 0x14, 0x87, 0x99, 0x90, 0xD1, - 0x8D, 0x12, 0xCA, 0x79, 0xD2, 0xC8, 0x55, 0x14, 0x90, 0x21, 0xCD, 0x5C, 0xE8, 0xCA, - 0x03, 0x71, 0xCA, 0x04, 0xFC, 0xCE, 0x14, 0x3E, 0x3D, 0x7C, 0xFE, 0xE9, 0x45, 0x85, - 0xB5, 0x88, 0x5C, 0xAC, 0x46, 0x06, 0x8B, 0xC0 }, - 134, - { 0xF4, 0xEB, 0xEC, 0x69, 0xE7, 0x3E, 0xAF, 0x2E, 0xB2, 0xCF, 0x6A, 0xF4, 0xB3, 0x12, - 0x0F, 0xFD }, - 16, - { 0xC3, 0x83, 0x83, 0x9D } }, - { { 0x78, 0x27, 0xFA, 0xB2, 0xA5, 0x6C, 0x6C, 0xA2, 0x70, 0xDE, 0xDF, 0x2D, 0xC4, 0x2C, - 0x5C, 0xBD, 0x3A, 0x96, 0xF8, 0xA0, 0xB1, 0x14, 0x18, 0xB3, 0x60, 0x8D, 0x57, 0x33, - 0x60, 0x4A, 0x2C, 0xD3, 0x6A, 0xAB, 0xC7, 0x0C, 0xE3, 0x19, 0x3B, 0xB5, 0x15, 0x3B, - 0xE2, 0xD3, 0xC0, 0x6D, 0xFD, 0xB2, 0xD1, 0x6E, 0x9C, 0x35, 0x71, 0x58, 0xBE, 0x6A, - 0x41, 0xD6, 0xB8, 0x61, 0xE4, 0x91, 0xDB, 0x3F, 0xBF, 0xEB, 0x51, 0x8E, 0xFC, 0xF0, - 0x48, 0xD7, 0xD5, 0x89, 0x53, 0x73, 0x0F, 0xF3, 0x0C, 0x9E, 0xC4, 0x70, 0xFF, 0xCD, - 0x66, 0x3D, 0xC3, 0x42, 0x01, 0xC3, 0x6A, 0xDD, 0xC0, 0x11, 0x1C, 0x35, 0xB3, 0x8A, - 0xFE, 0xE7, 0xCF, 0xDB, 0x58, 0x2E, 0x37, 0x31, 0xF8, 0xB4, 0xBA, 0xA8, 0xD1, 0xA8, - 0x9C, 0x06, 0xE8, 0x11, 0x99, 0xA9, 0x71, 0x62, 0x27, 0xBE, 0x34, 0x4E, 0xFC, 0xB4, - 0x36, 0xDD, 0xD0, 0xF0, 0x96, 0xC0, 0x64, 0xC3, 0xB5, 0xE2, 0xC3, 0x99, 0x99, 0x3F, - 0xC7, 0x73, 0x94, 0xF9, 0xE0, 0x97, 0x20, 0xA8, 0x11, 0x85, 0x0E, 0xF2, 0x3B, 0x2E, - 0xE0, 0x5D, 0x9E, 0x61, 0x73, 0x60, 0x9D, 0x86, 0xE1, 0xC0, 0xC1, 0x8E, 0xA5, 0x1A, - 0x01, 0x2A, 0x00, 0xBB, 0x41, 0x3B, 0x9C, 0xB8, 0x18, 0x8A, 0x70, 0x3C, 0xD6, 0xBA, - 0xE3, 0x1C, 0xC6, 0x7B, 0x34, 0xB1, 0xB0, 0x00, 0x19, 0xE6, 0xA2, 0xB2, 0xA6, 0x90, - 0xF0, 0x26, 0x71, 0xFE, 0x7C, 0x9E, 0xF8, 0xDE, 0xC0, 0x09, 0x4E, 0x53, 0x37, 0x63, - 0x47, 0x8D, 0x58, 0xD2, 0xC5, 0xF5, 0xB8, 0x27, 0xA0, 0x14, 0x8C, 0x59, 0x48, 0xA9, - 0x69, 0x31, 0xAC, 0xF8, 0x4F, 0x46, 0x5A, 0x64, 0xE6, 0x2C, 0xE7, 0x40, 0x07, 0xE9, - 0x91, 0xE3, 0x7E, 0xA8, 0x23, 0xFA, 0x0F, 0xB2, 0x19, 0x23, 0xB7, 0x99, 0x05, 0xB7, - 0x33, 0xB6, 0x31, 0xE6, 0xC7, 0xD6, 0x86, 0x0A, 0x38, 0x31, 0xAC, 0x35, 0x1A, 0x9C, - 0x73, 0x0C, 0x52, 0xFF, 0x72, 0xD9, 0xD3, 0x08, 0xEE, 0xDB, 0xAB, 0x21, 0xFD, 0xE1, - 0x43, 0xA0, 0xEA, 0x17, 0xE2, 0x3E, 0xDC, 0x1F, 0x74, 0xCB, 0xB3, 0x63, 0x8A, 0x20, - 0x33, 0xAA, 0xA1, 0x54, 0x64, 0xEA, 0xA7, 0x33, 0x38, 0x5D, 0xBB, 0xEB, 0x6F, 0xD7, - 0x35, 0x09, 0xB8, 0x57, 0xE6, 0xA4, 0x19, 0xDC, 0xA1, 0xD8, 0x90, 0x7A, 0xF9, 0x77, - 0xFB, 0xAC, 0x4D, 0xFA, 0x35, 0xEF }, - 328, - { 0x5D, 0x0A, 0x80, 0xD8, 0x13, 0x4A, 0xE1, 0x96, 0x77, 0x82, 0x4B, 0x67, 0x1E, 0x83, - 0x8A, 0xF4 }, - 16, - { 0x3A, 0xE4, 0xBF, 0xF3 } } -}; - -static hash_iv_test_vector_t kasumi_f9_IV_vectors[] = { - { - /* 3GPP specs Test Set 1 */ - /*input*/ - { 0x6B, 0x22, 0x77, 0x37, 0x29, 0x6F, 0x39, 0x3C, 0x80, 0x79, 0x35, 0x3E, - 0xDC, 0x87, 0xE2, 0xE8, 0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE0 }, - /*length*/ - 189, - /*key*/ - { 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, - 0x81, 0xFF, 0x48 }, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - { 0xF6, 0x3B, 0xD7, 0x2C }, - /*iv*/ - { 0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49 }, - /*ivLeninbytes*/ - 8, - /*direction*/ - 0, - }, - { - /* 3GPP specs Test Set 2 */ - /*input*/ - { 0xB5, 0x92, 0x43, 0x84, 0x32, 0x8A, 0x4A, 0xE0, 0x0B, 0x73, 0x71, - 0x09, 0xF8, 0xB6, 0xC8, 0xDD, 0x2B, 0x4D, 0xB6, 0x3D, 0xD5, 0x33, - 0x98, 0x1C, 0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC0 }, - /*length*/ - 254, - /*key*/ - { 0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF, 0xCD, 0x9F, 0x97, 0x94, 0x5E, - 0x6D, 0xE7, 0xB7 }, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - { 0xA9, 0xDA, 0xF1, 0xFF }, - /*iv*/ - { 0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2 }, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - }, - { - /* 3GPP specs Test Set 3 */ - /*input*/ - { 0x59, 0x32, 0xBC, 0x0A, 0xCE, 0x2B, 0x0A, 0xBA, 0x33, 0xD8, - 0xAC, 0x18, 0x8A, 0xC5, 0x4F, 0x34, 0x6F, 0xAD, 0x10, 0xBF, - 0x9D, 0xEE, 0x29, 0x20, 0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, - 0x5C, 0xB7, 0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF2 }, - /*length*/ - 319, - /*key*/ - { 0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4, 0x83, 0xA3, 0x18, 0x69, 0xD8, - 0x1B, 0x8F, 0xAB }, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - { 0x15, 0x37, 0xD3, 0x16 }, - /*iv*/ - { 0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A }, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - }, - { - /* 3GPP specs Test Set 4 */ - /*input*/ - { 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, 0x78, 0x83, 0x3F, 0xA0, - 0x2E, 0x23, 0x5A, 0xA1, 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, - 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, 0xB2, 0x4A, 0x03, 0x86, - 0x65, 0x42, 0x2B, 0x20, 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 }, - /*length*/ - 384, - /*key*/ - { 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, 0x1E, 0x26, 0x98, 0xD2, 0xE2, - 0x2A, 0xD5, 0x7E }, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - { 0xDD, 0x7D, 0xFA, 0xDD }, - /*iv*/ - { 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD }, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - }, - { - /* 3GPP specs Test Set 5 */ - /*input*/ - { 0x10, 0xBF, 0xFF, 0x83, 0x9E, 0x0C, 0x71, 0x65, 0x8D, 0xBB, 0x2D, 0x17, 0x07, - 0xE1, 0x45, 0x72, 0x4F, 0x41, 0xC1, 0x6F, 0x48, 0xBF, 0x40, 0x3C, 0x3B, 0x18, - 0xE3, 0x8F, 0xD5, 0xD1, 0x66, 0x3B, 0x6F, 0x6D, 0x90, 0x01, 0x93, 0xE3, 0xCE, - 0xA8, 0xBB, 0x4F, 0x1B, 0x4F, 0x5B, 0xE8, 0x22, 0x03, 0x22, 0x32, 0xA7, 0x8D, - 0x7D, 0x75, 0x23, 0x8D, 0x5E, 0x6D, 0xAE, 0xCD, 0x3B, 0x43, 0x22, 0xCF, 0x59, - 0xBC, 0x7E, 0xA8, 0x4A, 0xB1, 0x88, 0x11, 0xB5, 0xBF, 0xB7, 0xBC, 0x55, 0x3F, - 0x4F, 0xE4, 0x44, 0x78, 0xCE, 0x28, 0x7A, 0x14, 0x87, 0x99, 0x90, 0xD1, 0x8D, - 0x12, 0xCA, 0x79, 0xD2, 0xC8, 0x55, 0x14, 0x90, 0x21, 0xCD, 0x5C, 0xE8, 0xCA, - 0x03, 0x71, 0xCA, 0x04, 0xFC, 0xCE, 0x14, 0x3E, 0x3D, 0x7C, 0xFE, 0xE9, 0x45, - 0x85, 0xB5, 0x88, 0x5C, 0xAC, 0x46, 0x06, 0x8B }, - /*length*/ - 1000, - /*key*/ - { 0xF4, 0xEB, 0xEC, 0x69, 0xE7, 0x3E, 0xAF, 0x2E, 0xB2, 0xCF, 0x6A, 0xF4, 0xB3, - 0x12, 0x0F, 0xFD }, - /*KeyLeninBytes*/ - 16, - /*exp out*/ - { 0xC3, 0x83, 0x83, 0x9D }, - /*iv*/ - { 0x29, 0x6F, 0x39, 0x3C, 0x6B, 0x22, 0x77, 0x37 }, - /*ivLeninbytes*/ - 8, - /*direction*/ - 1, - } -}; - -const uint32_t numHashTestVectors[] = { sizeof(kasumi_f9_vectors) / sizeof(hash_test_vector_t), - sizeof(kasumi_f9_IV_vectors) / - sizeof(hash_iv_test_vector_t) }; - -#endif /*__KASUMI_TEST_VECTORS_H__*/ -- GitLab From 57e48e4d9786fa4148f3d9b209b930e6ebae7dc8 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Thu, 26 Oct 2023 16:59:54 +0100 Subject: [PATCH 177/204] test: [kat-app] convert ZUC-EIA3 256 vectors to common format --- test/kat-app/Makefile | 6 +- test/kat-app/win_x64.mak | 2 +- test/kat-app/zuc_eea3_256.json.c | 181 +++++++++++++++++++++++++++ test/kat-app/zuc_eea3_test.c | 65 ++++++---- test/kat-app/zuc_eia3_test_vectors.h | 1 - 5 files changed, 225 insertions(+), 30 deletions(-) create mode 100644 test/kat-app/zuc_eea3_256.json.c diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index b0b954c0..f6288b51 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -45,12 +45,12 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ des_test.json.c chacha_test.json.c gcm_test.json.c ccm_test.json.c quic_chacha20_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ - sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c kasumi_f8.json.c \ - kasumi_f9.json.c + sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c zuc_eea3_256.json.c \ + kasumi_f8.json.c kasumi_f9.json.c else # aarch64 SOURCES := main.c api_test.c zuc_eea3_test.c zuc_eia3_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ - zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c + zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c zuc_eea3_256.json.c endif # aarch64 OBJECTS := $(SOURCES:%.c=%.o) utils.o diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 1f6713fc..5c98c0dd 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj kasumi_f8.json.obj kasumi_f9.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj zuc_eea3_256.json.obj kasumi_f8.json.obj kasumi_f9.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) diff --git a/test/kat-app/zuc_eea3_256.json.c b/test/kat-app/zuc_eea3_256.json.c new file mode 100644 index 00000000..eeff7d86 --- /dev/null +++ b/test/kat-app/zuc_eea3_256.json.c @@ -0,0 +1,181 @@ +/******************************************************************************* + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/* ZUC-EEA3-256, */ +#include "cipher_test.h" + +const struct cipher_test zuc_eea3_256_test_json[] = { + { 200, 256, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x58\xd0\x3a\xd6\x2e\x03\x2c\xe2\xda\xfc\x68\x3a\x39\xbd\xcb\x03\x52\xa2\xbc\x67\xf1\xb7" + "\xde\x74\x16\x3c\xe3\xa1\x01\xef\x55\x58\x96\x39\xd7\x5b\x95\xfa\x68\x1b\x7f\x09\x0d\xf7" + "\x56\x39\x1c\xcc\x90\x3b\x76\x12\x74\x4d\x54\x4c\x17\xbc\x3f\xad\x8b\x16\x3b\x08\x21\x78" + "\x7c\x0b\x97\x77\x5b\xb8\x49\x43\xc6\xbb\xe8\xad\x8a\xfd", + 1, 640 }, + { 184, 256, 2, + "\x8f\x8e\xf9\xd8\xfb\x0a\xce\x2b\x23\x19\x48\x42\xcb\x5c\x6d\x98\x1e\x71\x68\x74\xe1\xdf" + "\xeb\xe0\xf2\x46\x02\x71\xbb\x69\x0d\x9e", + "\x2c\xe8\x87\x0f\x8c\x7f\x47\x2a\x02\x2d\x24\xcd\x23\x3f\x4d\x0a\x40\x0d\x12\xdd\xc4\x16" + "\x26", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xc1\xce\x46\xd2\x4e\x78\x6f\x97\xcf\xc0\xa5\x3c\xec\x50\x6e\x17\xe0\x8c\x7e\x33\x84\x98" + "\x2b\xc1\x68\x97\x24\x83\x03\x7c\x0d\xc5\x19\xa1\xe8\xb1\xb7\x53\x4f\x3b\x8a\xa3\xce\x9b" + "\x3d\xd0\x1a\xf7\x7d\xae\x4c\x6b\xe4\xe3\x12\x70\x63\xc9\x4c\xcf\x1f\xf7\x18\xdf\xf1\x7d" + "\x96\xe4\x60\xa8\x3b\xf5\x71\x7d\x2a\x87\x1d\x82\xed\x92\xc5\xe7\x6e\xd9\x3c\x01\x0d\x87" + "\x13\x3b\x1a\x92\xa2\x83\x1a\x5b\x9a\xfb\x81\x1d\xdb\xbd\x82\x01\x3b\x32\x0e\x2c\x67\x3c" + "\x14\x13\x9d\x58\xf1\x88\x9d\xe5\xd6\xe3\x48\xaa\x43\xc2\x08\xa6\x64\xa8\xad\x71\x26\x7e" + "\xe7\xed\x0c\x58\xd3\x27\x42\x5e\x10\xb0\x03\x62\x18\x30\xde\xdb\x45\xcd\x78\xdd\xee\x4f" + "\xa1\x45\xa6\xbf\xc1\x37\x3e\x47\x5c\x1b\xb6\x8b\x63\x87\x49\xc4\x1b\x9e\xea\x01\x62\x2a" + "\x44\x65\x17\x0f\xee\xcc\x7f\xe6\xab\x05\x46\x25\x7d\xdc\x40\x1e", + 1, 1536 }, + { 184, 256, 3, + "\x92\xf9\x27\xe8\xab\x48\x46\xdb\x2f\xa3\x61\x36\x7e\x89\xe1\x17\xc9\x99\x57\x63\xe0\xe4" + "\x4c\xce\x20\x03\x8a\x9c\x9a\x44\xca\x64", + "\x7d\x51\xfb\x42\xf8\x7e\x62\xfa\x60\x25\xb9\x2b\x4e\xd6\x1c\x2e\xcc\x6c\x65\x18\x1e\x9d" + "\x04", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00", + "\xe4\x14\xf9\x26\x45\xc6\x2e\x12\xb0\xe1\x33\xf6\xa7\x96\x22\xfb\x0f\xe0\x07\x5c\x6e\xbe" + "\x10\x1b\x37\xe4\xf7\x1c\x94\xcf\xf1\x73\x02\x64\x61\x40\xb4\xf1\xfb\xcf\x8c\xc6\xa2\xda" + "\xd7\x3f\xb4\xcc\xa8\x7b\x13\xaa\xd2\x6e\x2a\x1b\x0a\x07\xef\x88\x41\xfb\x6c\x10\x3f\x41" + "\x60\xb3\x4c\x7d\x00\x9c\x72\x2f\x4a\xa2\xc1\x0c\xf4\x6f\xbf\xed\xec\xaf\xeb\xbc\xc8\x2a" + "\x54\x60\x48\x7d\xfe\x20\x38\x6a", + 1, 768 }, + { 184, 256, 4, + "\xa7\x72\xf5\xfe\x9d\x81\xd1\xcf\x22\x8e\x45\x53\x67\x75\xac\xc9\x04\x19\x57\x55\x0f\x6c" + "\x39\xf9\xc5\x1b\x1e\x9e\xbb\x22\xa2\xf5", + "\xce\x51\x11\x83\x9b\x64\x4d\x20\x51\x92\x71\x3b\x43\x47\xf9\x38\x79\x0f\xd2\x59\xbc\x35" + "\xd3", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00", + "\x89\x63\x69\xca\x77\xd3\x05\xf7\xa3\xcb\xf6\xba\xb3\x8c\x14\x4f\xc3\x73\xf4\xf0\xf5\x0c" + "\xf1\xad\x0f\x41\x65\x48\x40\x47\x5e\xef\xad\xea\x1c\x3c\x15\xa0\xd2\x72\x25\x14\x1d\x6f" + "\xa0\x0f\xe8\x9a", + 1, 384 }, + { 184, 256, 5, + "\xf8\xa0\x45\x4f\x6d\xea\x74\x6e\x4c\xd1\x6e\xb0\xc3\xa2\x1f\x57\xeb\x6f\x35\x2d\x6a\x02" + "\x5b\x35\x32\xba\x47\x3f\x1f\x0e\xdd\xc9", + "\x07\x90\xeb\x7d\x09\x6d\xc1\xf1\x86\x47\xea\x57\xe4\xb8\x92\xb1\x4e\x3b\x2d\x62\xaa\x53" + "\x6f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00", + "\xc6\x02\x3c\x58\x53\xc9\xae\xba\x0a\x47\x10\xdc\x85\x76\x13\x82\x08\x66\xbc\x3e\x9c\x2d" + "\xb2\x42\x20\x3a\x0a\x0c\x49\x1d\xe9\x44\x73\x87\xe5\x60\x9d\x98\xff\xf1\x33\xc3\xd0\x3d" + "\x49\xfc\x77\x07", + 1, 384 }, + { 200, 256, 6, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x33\x56\xcb\xae\xd1\xa1\xc1\x8b\x6b\xaa\x4f\xfe\x34\x3f\x77\x7c\x9e\x15\x12\x8f\x25\x1a" + "\xb6\x5b\x94\x9f\x7b\x26\xef\x71\x57\xf2\x96\xdd\x2f\xa9\xdf\x95\xe3\xee\x7a\x5b\xe0\x2e" + "\xc3\x2b\xa5\x85\x50\x5a\xf3\x16\xc2\xf9\xde\xd2\x7c\xdb\xd9\x35\xe4\x41\xce\x11\x15\xfd" + "\x0a\x80\xbb\x7a\xef\x67\x68\x98\x94\x16\xb8\xfa\xc8\xc2", + 1, 640 }, + { 200, 256, 7, + "\x67\xc6\x69\x73\x51\xff\x4a\xec\x29\xcd\xba\xab\xf2\xfb\xe3\x46\x7c\xc2\x54\xf8\x1b\xe8" + "\xe7\x8d\x76\x5a\x2e\x63\x33\x9f\xc9\x9a", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xb7\xa0\x40\x5e\xd0\xe5\xe4\x47\xba\x13\xf2\xb5\xa9\xed\x8a\x25\xe4\x3e\x8e\x62\xd7\xb3" + "\xe6\x46\xc5\x71\xa1\xc6\xcd\x76\xea\x59\x3a\x49\x3d\xe2\xf9\x52\x91\x00\xaf\x20\x69\x60" + "\xcc\xe8\x4b\x38\x0b\xb8\x42\xcd\x1b\x12\xac\xd9\x89\x50\x87\x46\x85\xd1\x57\x66\xfa\x65" + "\x85\x98\xff\xb7\x89\x3f\x34\xff\x9f\xf1\x3d\x80\xe8\x54", + 1, 640 }, + { 200, 256, 8, + "\xc2\x54\xf8\x1b\xe8\xe7\x8d\x76\x5a\x2e\x63\x33\x9f\xc9\x9a\x66\x32\x0d\xb7\x31\x58\xa3" + "\x5a\x25\x5d\x05\x17\x58\xe9\x5e\xd4\xab", + "\x67\xc6\x69\x73\x51\xff\x4a\xec\x29\xcd\xba\xab\xf2\xfb\xe3\x46\x7c\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3f", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x8d\x59\x00\x3c\xb9\x8f\xe2\x79\xc7\xe8\x85\x35\xef\xe5\xb5\x51\xde\xa5\xec\xb1\xca\xdc" + "\x55\x5a\x3c\xd3\xa9\xb4\x32\x22\x34\xd9\x42\xe2\x99\x4a\x9b\x87\xfd\x46\x73\x54\xdc\x68" + "\xea\xe8\xd4\xba\xdc\x1c\xb7\x44\x13\xa0\xa0\xa2\x18\x86\x3f\x35\x92\xd1\x1c\x8c\xae\xff" + "\xa3\x1b\x4e\xe8\x6f\xc6\x49\x37\xf9\x8a\xc6\x90\x7c\x36", + 1, 640 }, + { 200, 256, 9, + "\x8d\x76\x5a\x2e\x63\x33\x9f\xc9\x9a\x66\x32\x0d\xb7\x31\x58\xa3\x5a\x25\x5d\x05\x17\x58" + "\xe9\x5e\xd4\xab\xb2\xcd\xc6\x9b\xb4\x54", + "\x67\xc6\x69\x73\x51\xff\x4a\xec\x29\xcd\xba\xab\xf2\xfb\xe3\x46\x7c\x30\x25\x13\x38\x06" + "\x3e\x23\x27", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xd8\x2e\x40\x78\x2c\x03\xa7\x1a\x90\xa5\x05\xc5\x8e\x61\x26\x8b\xe2\x5f\x61\xf6\x1f\xd4" + "\x6d\x04\x0d\x9e\x48\x78\x38\xf3\x2f\x97\x46\x00\x4e\xac\xcc\x93\x09\x43\x92\x1a\x17\x42" + "\x38\xf8\x8c\x9b\x7e\x90\xc2\x9f\x4a\x16\x0c\x2a\x43\x3b\xbb\xd9\x50\xee\x85\xd9\x7d\x1e" + "\x3a\xb5\x57\xfb\x56\xd8\xb4\x34\x5c\x5c\x0b\x48\x67\x37", + 1, 640 }, + { 184, 256, 10, + "\x67\xc6\x69\x73\x51\xff\x4a\xec\x29\xcd\xba\xab\xf2\xfb\xe3\x46\x7c\xc2\x54\xf8\x1b\xe8" + "\xe7\x8d\x76\x5a\x2e\x63\x33\x9f\xc9\x9a", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xb7\xa0\x40\x5e\xd0\xe5\xe4\x47\xba\x13\xf2\xb5\xa9\xed\x8a\x25\xe4\x3e\x8e\x62\xd7\xb3" + "\xe6\x46\xc5\x71\xa1\xc6\xcd\x76\xea\x59\x3a\x49\x3d\xe2\xf9\x52\x91\x00\xaf\x20\x69\x60" + "\xcc\xe8\x4b\x38\x0b\xb8\x42\xcd\x1b\x12\xac\xd9\x89\x50\x87\x46\x85\xd1\x57\x66\xfa\x65" + "\x85\x98\xff\xb7\x89\x3f\x34\xff\x9f\xf1\x3d\x80\xe8\x54", + 1, 640 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } +}; diff --git a/test/kat-app/zuc_eea3_test.c b/test/kat-app/zuc_eea3_test.c index 29eb1b07..844e9f81 100644 --- a/test/kat-app/zuc_eea3_test.c +++ b/test/kat-app/zuc_eea3_test.c @@ -50,6 +50,9 @@ #define FAIL_STATUS -1 #define DIM(_x) (sizeof(_x) / sizeof(_x[0])) +#define MAX_BUFFER_LENGTH_IN_BITS 5670 /* biggest test is EIA test 5 */ +#define MAX_BUFFER_LENGTH_IN_BYTES ((MAX_BUFFER_LENGTH_IN_BITS) + 7) / 8 + #define MAX_BURST_JOBS 32 enum api_type { TEST_DIRECT_API, TEST_SINGLE_JOB_API, TEST_BURST_JOB_API }; @@ -58,6 +61,7 @@ int zuc_eea3_test(struct IMB_MGR *mb_mgr); extern const struct cipher_test zuc_eea3_128_test_json[]; +extern const struct cipher_test zuc_eea3_256_test_json[]; struct zuc_eea3_128_params { const uint32_t *count; @@ -651,21 +655,22 @@ submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p const unsigned int num_buffers, const uint32_t *buf_idx) { unsigned int i; - uint32_t packetLen[MAXBUFS]; + uint32_t packetLen[MAXBUFS] = {0}; int ret = 0; - const struct test256EEA3_vectors_t *vector; - unsigned int iv_lens[MAXBUFS]; + unsigned int iv_lens[MAXBUFS] = {0}; + const struct cipher_test *vectors = zuc_eea3_256_test_json; for (i = 0; i < num_buffers; i++) { - vector = &test256EEA3_vectors[buf_idx[i]]; - packetLen[i] = (vector->length_in_bits + 7) / 8; - memcpy(pKeys[i], vector->CK, IMB_ZUC256_KEY_LEN_IN_BYTES); - memcpy(pIV[i], vector->IV, vector->iv_length); + const struct cipher_test *vector = &vectors[buf_idx[i]]; + + packetLen[i] = (uint32_t) (vector->msgSize + 7) / 8; + memcpy(pKeys[i], vector->key, vector->keySize / 8); + memcpy(pIV[i], vector->iv, vector->ivSize / 8); if (dir == IMB_DIR_ENCRYPT) - memcpy(pSrcData[i], vector->plaintext, packetLen[i]); + memcpy(pSrcData[i], vector->msg, packetLen[i]); else - memcpy(pSrcData[i], vector->ciphertext, packetLen[i]); - iv_lens[i] = vector->iv_length; + memcpy(pSrcData[i], vector->ct, packetLen[i]); + iv_lens[i] = (uint32_t) vector->ivSize / 8; } if (type == TEST_SINGLE_JOB_API) @@ -676,9 +681,8 @@ submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p num_buffers, IMB_ZUC256_KEY_LEN_IN_BYTES, iv_lens); #ifdef __aarch64__ else - IMB_ZUC256_EEA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, - (const void * const *)pIV, iv_lens, - (const void * const *)pSrcData, (void **)pDstData, + IMB_ZUC256_EEA3_N_BUFFER(mb_mgr, (const void * const *)pKeys, (const void * const *)pIV, + iv_lens, (const void * const *)pSrcData, (void **)pDstData, packetLen, num_buffers); #endif @@ -687,23 +691,23 @@ submit_and_verify_zuc256(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **p int retTmp; char msg_start[50]; char msg[100]; + const struct cipher_test *vector = &vectors[buf_idx[i]]; - vector = &test256EEA3_vectors[buf_idx[i]]; if (var_bufs) snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256 multi-vector"); else snprintf(msg_start, sizeof(msg_start), "Validate ZUC-256"); if (dir == IMB_DIR_ENCRYPT) { - snprintf(msg, sizeof(msg), "%s test %u, index %u (Enc):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->ciphertext, packetLen[i], - vector->length_in_bits, msg); + snprintf(msg, sizeof(msg), "%s test %zu, index %u (Enc):", msg_start, + vector->tcId, i); + retTmp = test_output(pDst8, (const uint8_t *) vector->ct, packetLen[i], + (uint32_t) vector->msgSize, msg); } else { /* DECRYPT */ - snprintf(msg, sizeof(msg), "%s test %u, index %u (Dec):", msg_start, - buf_idx[i] + 1, i); - retTmp = test_output(pDst8, vector->plaintext, packetLen[i], - vector->length_in_bits, msg); + snprintf(msg, sizeof(msg), "%s test %zu, index %u (Dec):", msg_start, + vector->tcId, i); + retTmp = test_output(pDst8, (const uint8_t *) vector->msg, packetLen[i], + (uint32_t) vector->msgSize, msg); } if (retTmp < 0) ret = retTmp; @@ -865,13 +869,24 @@ int validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstData, uint8_t **pKeys, uint8_t **pIV, uint32_t numBuffs, const enum api_type type) { - uint32_t i, j; + uint32_t i, j, num_vectors = 0; int ret = 0; int retTmp; uint32_t buf_idx[MAXBUFS]; + const struct cipher_test *vectors = zuc_eea3_256_test_json; + + + /* calculate number of vectors */ + for (i = 0; vectors[i].msg != NULL; i++) + num_vectors++; + + if (num_vectors == 0) { + printf("ZUC-EEA3 256 - No vectors found!\n"); + return -1; + } assert(numBuffs > 0); - for (i = 0; i < NUM_ZUC_256_EEA3_TESTS; i++) { + for (i = 0; i < num_vectors; i++) { for (j = 0; j < numBuffs; j++) buf_idx[j] = i; @@ -888,7 +903,7 @@ validate_zuc256_EEA3(struct IMB_MGR *mb_mgr, uint8_t **pSrcData, uint8_t **pDstD /* Get all test vectors and encrypt them together */ for (i = 0; i < numBuffs; i++) - buf_idx[i] = i % NUM_ZUC_256_EEA3_TESTS; + buf_idx[i] = i % num_vectors; retTmp = submit_and_verify_zuc256(mb_mgr, pSrcData, pDstData, pKeys, pIV, type, IMB_DIR_ENCRYPT, 1, numBuffs, buf_idx); diff --git a/test/kat-app/zuc_eia3_test_vectors.h b/test/kat-app/zuc_eia3_test_vectors.h index 8529aa46..8b1a045d 100644 --- a/test/kat-app/zuc_eia3_test_vectors.h +++ b/test/kat-app/zuc_eia3_test_vectors.h @@ -32,7 +32,6 @@ #define MAX_BUFFER_LENGTH_IN_BYTES ((MAX_BUFFER_LENGTH_IN_BITS) + 7) / 8 #define NUM_ZUC_ALG_TESTS 3 #define NUM_ZUC_EEA3_TESTS 5 -#define NUM_ZUC_256_EEA3_TESTS 10 #ifdef __aarch64__ #define NUM_ZUC_256_EIA3_TESTS 15 #endif -- GitLab From ba451e9ea517d66c0f94cc8b14cf5a1b95dafe17 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Thu, 26 Oct 2023 19:26:59 +0100 Subject: [PATCH 178/204] test: [kat-app] snow-v cipher vectors changed into new format --- test/kat-app/Makefile | 2 +- test/kat-app/snow_v_test.c | 485 +------------------------------- test/kat-app/snow_v_test.json.c | 427 ++++++++++++++++++++++++++++ test/kat-app/win_x64.mak | 2 +- 4 files changed, 441 insertions(+), 475 deletions(-) create mode 100644 test/kat-app/snow_v_test.json.c diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index f6288b51..fed2c208 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -46,7 +46,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c zuc_eea3_256.json.c \ - kasumi_f8.json.c kasumi_f9.json.c + kasumi_f8.json.c kasumi_f9.json.c snow_v_test.json.c else # aarch64 SOURCES := main.c api_test.c zuc_eea3_test.c zuc_eia3_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ diff --git a/test/kat-app/snow_v_test.c b/test/kat-app/snow_v_test.c index 11f02109..0479a3a7 100644 --- a/test/kat-app/snow_v_test.c +++ b/test/kat-app/snow_v_test.c @@ -32,12 +32,14 @@ #include #include /* for memcmp() */ #include +#include #include #include "gcm_ctr_vectors_test.h" #include "utils.h" +#include "cipher_test.h" -#define MAX_BUFFER_LENGTH_IN_BYTES 128 +extern const struct cipher_test snow_v_test_json[]; int snow_v_test(IMB_MGR *p_mgr); @@ -51,17 +53,6 @@ static const uint8_t ZERO_KEY[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const uint8_t ZERO_IV[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const uint8_t MAX_KEY[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -static const uint8_t MAX_IV[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -static const uint8_t IV_spec[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, - 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; -static const uint8_t KEY_spec[] = { 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, - 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa }; static const uint8_t ZERO_PLAIN[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -73,459 +64,6 @@ static const uint8_t ZERO_PLAIN[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const uint8_t keystreams_from_spec[][128] = { - { 0x69, 0xca, 0x6d, 0xaf, 0x9a, 0xe3, 0xb7, 0x2d, 0xb1, 0x34, 0xa8, 0x5a, 0x83, 0x7e, 0x41, - 0x9d, 0xec, 0x08, 0xaa, 0xd3, 0x9d, 0x7b, 0x0f, 0x00, 0x9b, 0x60, 0xb2, 0x8c, 0x53, 0x43, - 0x00, 0xed, 0x84, 0xab, 0xf5, 0x94, 0xfb, 0x08, 0xa7, 0xf1, 0xf3, 0xa2, 0xdf, 0x18, 0xe6, - 0x17, 0x68, 0x3b, 0x48, 0x1f, 0xa3, 0x78, 0x07, 0x9d, 0xcf, 0x04, 0xdb, 0x53, 0xb5, 0xd6, - 0x29, 0xa9, 0xeb, 0x9d, 0x03, 0x1c, 0x15, 0x9d, 0xcc, 0xd0, 0xa5, 0x0c, 0x4d, 0x5d, 0xbf, - 0x51, 0x15, 0xd8, 0x70, 0x39, 0xc0, 0xd0, 0x3c, 0xa1, 0x37, 0x0c, 0x19, 0x40, 0x03, 0x47, - 0xa0, 0xb4, 0xd2, 0xe9, 0xdb, 0xe5, 0xcb, 0xca, 0x60, 0x82, 0x14, 0xa2, 0x65, 0x82, 0xcf, - 0x68, 0x09, 0x16, 0xb3, 0x45, 0x13, 0x21, 0x95, 0x4f, 0xdf, 0x30, 0x84, 0xaf, 0x02, 0xf6, - 0xa8, 0xe2, 0x48, 0x1d, 0xe6, 0xbf, 0x82, 0x79 }, - { 0x30, 0x76, 0x09, 0xfb, 0x10, 0x10, 0x12, 0x54, 0x4b, 0xc1, 0x75, 0xe3, 0x17, 0xfb, 0x25, - 0xff, 0x33, 0x0d, 0x0d, 0xe2, 0x5a, 0xf6, 0xaa, 0xd1, 0x05, 0x05, 0xb8, 0x9b, 0x1e, 0x09, - 0xa8, 0xec, 0xdd, 0x46, 0x72, 0xcc, 0xbb, 0x98, 0xc7, 0xf2, 0xc4, 0xe2, 0x4a, 0xf5, 0x27, - 0x28, 0x36, 0xc8, 0x7c, 0xc7, 0x3a, 0x81, 0x76, 0xb3, 0x9c, 0xe9, 0x30, 0x3b, 0x3e, 0x76, - 0x4e, 0x9b, 0xe3, 0xe7, 0x48, 0xf7, 0x65, 0x1a, 0x7c, 0x7e, 0x81, 0x3f, 0xd5, 0x24, 0x90, - 0x23, 0x1e, 0x56, 0xf7, 0xc1, 0x44, 0xe4, 0x38, 0xe7, 0x77, 0x11, 0xa6, 0xb0, 0xba, 0xfb, - 0x60, 0x45, 0x0c, 0x62, 0xd7, 0xd9, 0xb9, 0x24, 0x1d, 0x12, 0x44, 0xfc, 0xb4, 0x9d, 0xa1, - 0xe5, 0x2b, 0x80, 0x13, 0xde, 0xcd, 0xd4, 0x86, 0x04, 0xff, 0xfc, 0x62, 0x67, 0x6e, 0x70, - 0x3b, 0x3a, 0xb8, 0x49, 0xcb, 0xa6, 0xea, 0x09 }, - { 0xaa, 0x81, 0xea, 0xfb, 0x8b, 0x86, 0x16, 0xce, 0x3e, 0x5c, 0xe2, 0x22, 0x24, 0x61, 0xc5, - 0x0a, 0x6a, 0xb4, 0x48, 0x77, 0x56, 0xde, 0x4b, 0xd3, 0x1c, 0x90, 0x4f, 0x3d, 0x97, 0x8a, - 0xfe, 0x56, 0x33, 0x4f, 0x10, 0xdd, 0xdf, 0x2b, 0x95, 0x31, 0x76, 0x9a, 0x71, 0x05, 0x0b, - 0xe4, 0x38, 0x5f, 0xc2, 0xb6, 0x19, 0x2c, 0x7a, 0x85, 0x7b, 0xe8, 0xb4, 0xfc, 0x28, 0xb7, - 0x09, 0xf0, 0x8f, 0x11, 0xf2, 0x06, 0x49, 0xe2, 0xee, 0xf2, 0x49, 0x80, 0xf8, 0x6c, 0x4c, - 0x11, 0x36, 0x41, 0xfe, 0xd2, 0xf3, 0xf6, 0xfa, 0x2b, 0x91, 0x95, 0x12, 0x06, 0xb8, 0x01, - 0xdb, 0x15, 0x46, 0x65, 0x17, 0xa6, 0x33, 0x0a, 0xdd, 0xa6, 0xb3, 0x5b, 0x26, 0x5e, 0xfd, - 0x72, 0x2e, 0x86, 0x77, 0xb4, 0x8b, 0xfc, 0x15, 0xb4, 0x41, 0x18, 0xde, 0x52, 0xd0, 0x73, - 0xb0, 0xad, 0x0f, 0xe7, 0x59, 0x4d, 0x62, 0x91 } -}; - -static const uint8_t KEYs[][32] = { - { 0x67, 0xc6, 0x69, 0x73, 0x51, 0xff, 0x4a, 0xec, 0x29, 0xcd, 0xba, - 0xab, 0xf2, 0xfb, 0xe3, 0x46, 0x7c, 0xc2, 0x54, 0xf8, 0x1b, 0xe8, - 0xe7, 0x8d, 0x76, 0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a }, - { 0xab, 0xb2, 0xcd, 0xc6, 0x9b, 0xb4, 0x54, 0x11, 0x0e, 0x82, 0x74, - 0x41, 0x21, 0x3d, 0xdc, 0x87, 0x70, 0xe9, 0x3e, 0xa1, 0x41, 0xe1, - 0xfc, 0x67, 0x3e, 0x01, 0x7e, 0x97, 0xea, 0xdc, 0x6b, 0x96 }, - { 0x02, 0x1a, 0xfe, 0x43, 0xfb, 0xfa, 0xaa, 0x3a, 0xfb, 0x29, 0xd1, - 0xe6, 0x05, 0x3c, 0x7c, 0x94, 0x75, 0xd8, 0xbe, 0x61, 0x89, 0xf9, - 0x5c, 0xbb, 0xa8, 0x99, 0x0f, 0x95, 0xb1, 0xeb, 0xf1, 0xb3 }, - { 0x1f, 0x23, 0x1e, 0xa8, 0x1c, 0x7b, 0x64, 0xc5, 0x14, 0x73, 0x5a, - 0xc5, 0x5e, 0x4b, 0x79, 0x63, 0x3b, 0x70, 0x64, 0x24, 0x11, 0x9e, - 0x09, 0xdc, 0xaa, 0xd4, 0xac, 0xf2, 0x1b, 0x10, 0xaf, 0x3b }, - { 0x0b, 0xe1, 0x1a, 0x1c, 0x7f, 0x23, 0xf8, 0x29, 0xf8, 0xa4, 0x1b, - 0x13, 0xb5, 0xca, 0x4e, 0xe8, 0x98, 0x32, 0x38, 0xe0, 0x79, 0x4d, - 0x3d, 0x34, 0xbc, 0x5f, 0x4e, 0x77, 0xfa, 0xcb, 0x6c, 0x05 }, - { 0x36, 0x94, 0xb3, 0xaf, 0xe2, 0xf0, 0xe4, 0x9e, 0x4f, 0x32, 0x15, - 0x49, 0xfd, 0x82, 0x4e, 0xa9, 0x08, 0x70, 0xd4, 0xb2, 0x8a, 0x29, - 0x54, 0x48, 0x9a, 0x0a, 0xbc, 0xd5, 0x0e, 0x18, 0xa8, 0x44 }, - { 0xa3, 0x84, 0x7f, 0x2d, 0xad, 0xd4, 0x76, 0x47, 0xde, 0x32, 0x1c, - 0xec, 0x4a, 0xc4, 0x30, 0xf6, 0x20, 0x23, 0x85, 0x6c, 0xfb, 0xb2, - 0x07, 0x04, 0xf4, 0xec, 0x0b, 0xb9, 0x20, 0xba, 0x86, 0xc3 }, - { 0xf7, 0x5e, 0xa0, 0xf2, 0x10, 0xa8, 0xf6, 0x05, 0x94, 0x01, 0xbe, - 0xb4, 0xbc, 0x44, 0x78, 0xfa, 0x49, 0x69, 0xe6, 0x23, 0xd0, 0x1a, - 0xda, 0x69, 0x6a, 0x7e, 0x4c, 0x7e, 0x51, 0x25, 0xb3, 0x48 }, - { 0x25, 0xcf, 0x08, 0xf5, 0xe9, 0xe2, 0x5e, 0x53, 0x60, 0xaa, 0xd2, - 0xb2, 0xd0, 0x85, 0xfa, 0x54, 0xd8, 0x35, 0xe8, 0xd4, 0x66, 0x82, - 0x64, 0x98, 0xd9, 0xa8, 0x87, 0x75, 0x65, 0x70, 0x5a, 0x8a }, - { 0x86, 0x95, 0x80, 0xec, 0x17, 0xe4, 0x85, 0xf1, 0x8c, 0x0c, 0x66, - 0xf1, 0x7c, 0xc0, 0x7c, 0xbb, 0x22, 0xfc, 0xe4, 0x66, 0xda, 0x61, - 0x0b, 0x63, 0xaf, 0x62, 0xbc, 0x83, 0xb4, 0x69, 0x2f, 0x3a }, -}; /* KEYs */ - -static const uint8_t IVs[][16] = { - { 0x66, 0x32, 0x0d, 0xb7, 0x31, 0x58, 0xa3, 0x5a, 0x25, 0x5d, 0x05, 0x17, 0x58, 0xe9, 0x5e, - 0xd4 }, - { 0x8f, 0x38, 0x5c, 0x2a, 0xec, 0xb0, 0x3b, 0xfb, 0x32, 0xaf, 0x3c, 0x54, 0xec, 0x18, 0xdb, - 0x5c }, - { 0x05, 0xef, 0xf7, 0x00, 0xe9, 0xa1, 0x3a, 0xe5, 0xca, 0x0b, 0xcb, 0xd0, 0x48, 0x47, 0x64, - 0xbd }, - { 0x33, 0xcd, 0xe3, 0x50, 0x48, 0x47, 0x15, 0x5c, 0xbb, 0x6f, 0x22, 0x19, 0xba, 0x9b, 0x7d, - 0xf5 }, - { 0xac, 0x86, 0x21, 0x2b, 0xaa, 0x1a, 0x55, 0xa2, 0xbe, 0x70, 0xb5, 0x73, 0x3b, 0x04, 0x5c, - 0xd3 }, - { 0xac, 0x5b, 0xf3, 0x8e, 0x4c, 0xd7, 0x2d, 0x9b, 0x09, 0x42, 0xe5, 0x06, 0xc4, 0x33, 0xaf, - 0xcd }, - { 0x3e, 0x05, 0xf1, 0xec, 0xd9, 0x67, 0x33, 0xb7, 0x99, 0x50, 0xa3, 0xe3, 0x14, 0xd3, 0xd9, - 0x34 }, - { 0x84, 0x53, 0x3a, 0x94, 0xfb, 0x31, 0x99, 0x90, 0x32, 0x57, 0x44, 0xee, 0x9b, 0xbc, 0xe9, - 0xe5 }, - { 0x3f, 0x62, 0x80, 0x29, 0x44, 0xde, 0x7c, 0xa5, 0x89, 0x4e, 0x57, 0x59, 0xd3, 0x51, 0xad, - 0xac }, - { 0xff, 0xaf, 0x27, 0x16, 0x93, 0xac, 0x07, 0x1f, 0xb8, 0x6d, 0x11, 0x34, 0x2d, 0x8d, 0xef, - 0x4f }, -}; /* IVs */ - -static const uint8_t PLAIN_1[] = { 0x89 }; -static const uint8_t CIPHER_1[] = { 0x12 }; -static const uint8_t CIPHER_1_ZERO_KEY[] = { 0x0e }; -static const uint8_t CIPHER_1_MAX_KEY[] = { 0x2a }; -static const uint8_t CIPHER_1_MAX_KEY_IV[] = { 0xb9 }; -static const uint8_t CIPHER_1_ZERO_KEY_IV[] = { 0xe0 }; -static const uint8_t CIPHER_1_MAX_IV[] = { 0x35 }; -static const uint8_t CIPHER_1_ZERO_IV[] = { 0x03 }; -static const uint8_t PLAIN_8[] = { 0xd4, 0xb6, 0x63, 0x35, 0xc1, 0xc7, 0xe4, 0x24 }; -static const uint8_t CIPHER_8[] = { 0x46, 0xde, 0xc7, 0xed, 0xc3, 0xff, 0x4b, 0xd2 }; -static const uint8_t CIPHER_8_ZERO_KEY[] = { 0xbc, 0xd6, 0xd0, 0x0d, 0x57, 0x36, 0x7d, 0x3b }; -static const uint8_t CIPHER_8_MAX_KEY[] = { 0x7a, 0x47, 0x95, 0x16, 0xee, 0x25, 0xdd, 0x37 }; -static const uint8_t CIPHER_8_MAX_KEY_IV[] = { 0xe4, 0xc0, 0x6a, 0xce, 0xd1, 0xd7, 0xf6, 0x70 }; -static const uint8_t CIPHER_8_ZERO_KEY_IV[] = { 0xbd, 0x7c, 0x0e, 0x9a, 0x5b, 0x24, 0x53, 0x09 }; -static const uint8_t CIPHER_8_MAX_IV[] = { 0xab, 0x8b, 0xf1, 0xb2, 0xa5, 0xfb, 0x20, 0xfc }; -static const uint8_t CIPHER_8_ZERO_IV[] = { 0x70, 0xe9, 0x3f, 0x73, 0x20, 0xe0, 0xf6, 0xe5 }; -static const uint8_t PLAIN_15[] = { 0x83, 0x67, 0xd8, 0xed, 0x96, 0x12, 0xec, 0x45, - 0x39, 0x02, 0xd8, 0xe5, 0x0a, 0xf8, 0x9d }; -static const uint8_t CIPHER_15[] = { 0xd3, 0x15, 0x8d, 0x06, 0x49, 0x58, 0xcc, 0x57, - 0xc4, 0xa7, 0x39, 0x38, 0x9b, 0x25, 0xb6 }; -static const uint8_t CIPHER_15_ZERO_KEY[] = { 0x6e, 0xdd, 0x4a, 0xda, 0xf2, 0x30, 0x33, 0x57, - 0x74, 0x59, 0xd1, 0xbc, 0xe8, 0x40, 0xd5 }; -static const uint8_t CIPHER_15_MAX_KEY[] = { 0xb3, 0xd5, 0xa1, 0x7e, 0x78, 0xa0, 0x13, 0xb5, - 0xa8, 0xa8, 0x22, 0x86, 0xfc, 0x83, 0xc1 }; -static const uint8_t CIPHER_15_MAX_KEY_IV[] = { 0xb3, 0x11, 0xd1, 0x16, 0x86, 0x02, 0xfe, 0x11, - 0x72, 0xc3, 0xad, 0x06, 0x1d, 0x03, 0xb8 }; -static const uint8_t CIPHER_15_ZERO_KEY_IV[] = { 0xea, 0xad, 0xb5, 0x42, 0x0c, 0xf1, 0x5b, 0x68, - 0x88, 0x36, 0x70, 0xbf, 0x89, 0x86, 0xdc }; -static const uint8_t CIPHER_15_MAX_IV[] = { 0x3e, 0x43, 0x7d, 0x8b, 0xaa, 0xc6, 0x2d, 0x78, - 0x37, 0x16, 0x0f, 0xe9, 0xdd, 0x09, 0xc8 }; -static const uint8_t CIPHER_15_ZERO_IV[] = { 0x8c, 0x30, 0x1f, 0x67, 0x2e, 0xcf, 0x0d, 0x6f, - 0xea, 0x8b, 0x83, 0x51, 0x8a, 0x4f, 0x32 }; -static const uint8_t PLAIN_16[] = { 0x77, 0x09, 0xd1, 0xa5, 0x96, 0xc1, 0xf4, 0x1f, - 0x95, 0xaa, 0x82, 0xca, 0x6c, 0x49, 0xae, 0x90 }; -static const uint8_t CIPHER_16[] = { 0x16, 0x4c, 0x52, 0xa5, 0xed, 0x36, 0x8f, 0xaf, - 0x34, 0x17, 0x3b, 0x25, 0xd7, 0xb9, 0x96, 0x86 }; -static const uint8_t CIPHER_16_ZERO_KEY[] = { 0xae, 0xb6, 0x70, 0x05, 0x7c, 0xc2, 0xc0, 0x2b, - 0xcd, 0x8b, 0xc3, 0x60, 0x80, 0x61, 0xe5, 0x50 }; -static const uint8_t CIPHER_16_MAX_KEY[] = { 0x96, 0x19, 0xac, 0xd2, 0x52, 0xbf, 0xfb, 0x24, - 0x34, 0x82, 0x0c, 0xd1, 0xd9, 0x21, 0x41, 0xe9 }; -static const uint8_t CIPHER_16_MAX_KEY_IV[] = { 0x47, 0x7f, 0xd8, 0x5e, 0x86, 0xd1, 0xe6, 0x4b, - 0xde, 0x6b, 0xf7, 0x29, 0x7b, 0xb2, 0x8b, 0x6f }; -static const uint8_t CIPHER_16_ZERO_KEY_IV[] = { 0x1e, 0xc3, 0xbc, 0x0a, 0x0c, 0x22, 0x43, 0x32, - 0x24, 0x9e, 0x2a, 0x90, 0xef, 0x37, 0xef, 0x0d }; -static const uint8_t CIPHER_16_MAX_IV[] = { 0x70, 0x3d, 0x33, 0xd6, 0xae, 0xc6, 0x27, 0x47, - 0x57, 0xf7, 0xfa, 0x57, 0x77, 0xab, 0x6b, 0x14 }; -static const uint8_t CIPHER_16_ZERO_IV[] = { 0x41, 0x1c, 0xe0, 0xe4, 0x41, 0x7c, 0x9a, 0xa6, - 0xff, 0x00, 0x00, 0x83, 0xe6, 0xf9, 0xea, 0x8a }; -static const uint8_t PLAIN_17[] = { 0xcd, 0x16, 0x68, 0xba, 0xac, 0x7a, 0xa6, 0xf2, 0xb4, - 0xa8, 0xca, 0x99, 0xb2, 0xc2, 0x37, 0x2a, 0xcb }; -static const uint8_t CIPHER_17[] = { 0xd4, 0x61, 0x94, 0x70, 0x87, 0x9b, 0x83, 0xa8, 0x1f, - 0xc9, 0x94, 0xc4, 0x91, 0x4f, 0xa8, 0xe4, 0x29 }; -static const uint8_t CIPHER_17_ZERO_KEY[] = { 0x02, 0x78, 0xe0, 0xce, 0xed, 0xab, 0xeb, 0xb0, 0x19, - 0x65, 0xf5, 0xac, 0x31, 0x21, 0x1e, 0x43, 0xf0 }; -static const uint8_t CIPHER_17_MAX_KEY[] = { 0xbb, 0xce, 0x3a, 0x68, 0x13, 0x27, 0x79, 0xc9, 0x45, - 0x71, 0x2f, 0x6d, 0x20, 0xb4, 0x00, 0x06, 0xd5 }; -static const uint8_t CIPHER_17_MAX_KEY_IV[] = { 0xfd, 0x60, 0x61, 0x41, 0xbc, 0x6a, - 0xb4, 0xa6, 0xff, 0x69, 0xbf, 0x7a, - 0xa5, 0x39, 0x12, 0xd5, 0xf8 }; -static const uint8_t CIPHER_17_ZERO_KEY_IV[] = { 0xa4, 0xdc, 0x05, 0x15, 0x36, 0x99, - 0x11, 0xdf, 0x05, 0x9c, 0x62, 0xc3, - 0x31, 0xbc, 0x76, 0xb7, 0x27 }; -static const uint8_t CIPHER_17_MAX_IV[] = { 0x6c, 0x12, 0x44, 0x15, 0x4d, 0x28, 0xf1, 0xdb, 0x5f, - 0x3c, 0x49, 0x88, 0xa1, 0xb6, 0xce, 0x84, 0x5f }; -static const uint8_t CIPHER_17_ZERO_IV[] = { 0x0a, 0x61, 0x65, 0x53, 0x74, 0x0e, 0x7e, 0x01, 0x61, - 0xd2, 0xb2, 0xc9, 0x91, 0x3c, 0x80, 0x01, 0xda }; -static const uint8_t PLAIN_48[] = { 0x08, 0xcf, 0x61, 0xc9, 0xc3, 0x80, 0x5e, 0x6e, 0x03, 0x28, - 0xda, 0x4c, 0xd7, 0x6a, 0x19, 0xed, 0xd2, 0xd3, 0x99, 0x4c, - 0x79, 0x8b, 0x00, 0x22, 0x56, 0x9a, 0xd4, 0x18, 0xd1, 0xfe, - 0xe4, 0xd9, 0xcd, 0x45, 0xa3, 0x91, 0xc6, 0x01, 0xff, 0xc9, - 0x2a, 0xd9, 0x15, 0x01, 0x43, 0x2f, 0xee, 0x15 }; -static const uint8_t CIPHER_48[] = { 0xcd, 0x4a, 0x37, 0x9b, 0xc4, 0x8b, 0xa1, 0xd4, 0xda, 0x27, - 0x68, 0x12, 0xdf, 0xce, 0x9c, 0x32, 0x8a, 0x59, 0x1e, 0x3e, - 0x37, 0xe0, 0x04, 0xf7, 0xae, 0x31, 0x2f, 0xed, 0xe6, 0x0d, - 0x78, 0x7c, 0xe6, 0xd1, 0x6a, 0xde, 0x99, 0xb3, 0x0e, 0x42, - 0xca, 0x83, 0x62, 0x60, 0x99, 0xa7, 0x6f, 0xcc }; -static const uint8_t CIPHER_48_ZERO_KEY[] = { 0xed, 0x78, 0x21, 0x2b, 0x90, 0xa3, 0xd4, 0x3d, - 0xe9, 0x84, 0x77, 0x37, 0xca, 0xa6, 0x16, 0xa9, - 0x5d, 0x84, 0x2f, 0x25, 0xb0, 0xb9, 0x38, 0x8b, - 0xde, 0x28, 0x66, 0xee, 0x35, 0xe0, 0x05, 0x56, - 0x16, 0x40, 0x68, 0xcf, 0xcd, 0x33, 0xdc, 0xb8, - 0xe4, 0x74, 0x23, 0xf9, 0xef, 0xcf, 0x92, 0xc5 }; -static const uint8_t CIPHER_48_MAX_KEY[] = { 0x92, 0x9a, 0xd1, 0x31, 0x54, 0x33, 0xdb, 0x09, - 0x18, 0x43, 0x31, 0xb9, 0x04, 0x6f, 0x2e, 0x32, - 0x82, 0x25, 0x2d, 0xbf, 0x9e, 0x7b, 0x56, 0xd3, - 0xc8, 0x20, 0xd7, 0x5f, 0xb4, 0x34, 0x13, 0x9e, - 0xc1, 0x55, 0x44, 0xc1, 0xd0, 0xac, 0x61, 0x5b, - 0x27, 0x59, 0xc8, 0x23, 0x2d, 0x00, 0xf2, 0x95 }; -static const uint8_t CIPHER_48_MAX_KEY_IV[] = { 0x38, 0xb9, 0x68, 0x32, 0xd3, 0x90, 0x4c, 0x3a, - 0x48, 0xe9, 0xaf, 0xaf, 0xc0, 0x91, 0x3c, 0x12, - 0xe1, 0xde, 0x94, 0xae, 0x23, 0x7d, 0xaa, 0xf3, - 0x53, 0x9f, 0x6c, 0x83, 0xcf, 0xf7, 0x4c, 0x35, - 0x10, 0x03, 0xd1, 0x5d, 0x7d, 0x99, 0x38, 0x3b, - 0xee, 0x3b, 0x5f, 0xf4, 0x64, 0x07, 0xd8, 0xdd }; -static const uint8_t CIPHER_48_ZERO_KEY_IV[] = { 0x61, 0x05, 0x0c, 0x66, 0x59, 0x63, 0xe9, 0x43, - 0xb2, 0x1c, 0x72, 0x16, 0x54, 0x14, 0x58, 0x70, - 0x3e, 0xdb, 0x33, 0x9f, 0xe4, 0xf0, 0x0f, 0x22, - 0xcd, 0xfa, 0x66, 0x94, 0x82, 0xbd, 0xe4, 0x34, - 0x49, 0xee, 0x56, 0x05, 0x3d, 0x09, 0x58, 0x38, - 0xd9, 0x7b, 0xca, 0x19, 0xa5, 0x38, 0x86, 0x2e }; -static const uint8_t CIPHER_48_MAX_IV[] = { 0xba, 0xf1, 0x73, 0xa1, 0x57, 0x58, 0xf1, 0xf1, - 0x6b, 0x9e, 0x41, 0xa8, 0xc7, 0xdd, 0xef, 0x13, - 0x1e, 0x91, 0xb1, 0x45, 0x70, 0x5b, 0x83, 0x40, - 0x42, 0x5d, 0x70, 0xcf, 0x01, 0x7c, 0x8a, 0x90, - 0x0c, 0x10, 0x3b, 0x6d, 0xdd, 0x81, 0x04, 0xa2, - 0x66, 0x6e, 0x0f, 0xaf, 0xf3, 0x75, 0x92, 0x1f }; -static const uint8_t CIPHER_48_ZERO_IV[] = { 0x23, 0x46, 0x9f, 0xcd, 0x94, 0xd4, 0x9a, 0x62, - 0x5e, 0x37, 0xe9, 0x11, 0xc2, 0x90, 0x22, 0x16, - 0xe3, 0x78, 0xaf, 0x06, 0x9e, 0xf8, 0x68, 0x43, - 0x85, 0x20, 0x28, 0xae, 0xc6, 0x2e, 0x71, 0x64, - 0x4d, 0x4b, 0xae, 0xbf, 0x94, 0x69, 0x4c, 0xf4, - 0x6c, 0x93, 0xb0, 0x81, 0x40, 0xaf, 0xf2, 0x27 }; -static const uint8_t PLAIN_63[] = { 0x02, 0x87, 0x61, 0x7c, 0x13, 0x62, 0x9e, 0x69, 0xfc, - 0x72, 0x81, 0xcd, 0x71, 0x65, 0xa6, 0x3e, 0xab, 0x49, - 0xcf, 0x71, 0x4b, 0xce, 0x3a, 0x75, 0xa7, 0x4f, 0x76, - 0xea, 0x7e, 0x64, 0xff, 0x81, 0xeb, 0x61, 0xfd, 0xfe, - 0xc3, 0x9b, 0x67, 0xbf, 0x0d, 0xe9, 0x8c, 0x7e, 0x4e, - 0x32, 0xbd, 0xf9, 0x7c, 0x8c, 0x6a, 0xc7, 0x5b, 0xa4, - 0x3c, 0x02, 0xf4, 0xb2, 0xed, 0x72, 0x16, 0xec, 0xf3 }; -static const uint8_t CIPHER_63[] = { 0xbf, 0xc8, 0x9e, 0x4c, 0xcf, 0x93, 0x3e, 0x48, 0x66, - 0xe3, 0xc8, 0x15, 0x4d, 0xf9, 0x54, 0xcd, 0x9a, 0x03, - 0xae, 0xac, 0x2e, 0x8a, 0xa1, 0x83, 0xfb, 0x25, 0xa1, - 0xe3, 0x9b, 0xd0, 0x8f, 0x46, 0x19, 0x0d, 0x25, 0x12, - 0xd6, 0x97, 0x41, 0x79, 0xe9, 0x7e, 0x57, 0x56, 0x9a, - 0x27, 0xa2, 0x24, 0x8e, 0x04, 0xf2, 0x20, 0x42, 0xcf, - 0xff, 0x3e, 0x15, 0x4a, 0x1b, 0x9b, 0x57, 0x2e, 0xf7 }; -static const uint8_t CIPHER_63_ZERO_KEY[] = { - 0xd6, 0xb0, 0xe9, 0xb6, 0x89, 0x0c, 0xd0, 0x21, 0x15, 0x34, 0xf7, 0x47, 0xc2, - 0xd9, 0xf9, 0x9c, 0xcd, 0xec, 0x81, 0xa0, 0x06, 0x58, 0xe9, 0x0d, 0x6e, 0x12, - 0x1d, 0x0e, 0xb4, 0x4a, 0x02, 0xc2, 0x1d, 0xca, 0x52, 0x69, 0xf1, 0xfd, 0xdc, - 0x32, 0x48, 0x80, 0x94, 0x0f, 0x0c, 0x49, 0xd9, 0x15, 0x70, 0x87, 0xb0, 0x47, - 0x0c, 0xd3, 0x6f, 0x5a, 0x36, 0x5e, 0x5c, 0x4d, 0x6e, 0x39, 0x49 -}; -static const uint8_t CIPHER_63_MAX_KEY[] = { 0xe2, 0xfe, 0x73, 0x01, 0x6a, 0xfe, 0x53, 0x9f, 0xfd, - 0x08, 0x83, 0x8c, 0xf5, 0x4f, 0x7a, 0x83, 0xf2, 0x6d, - 0xef, 0x53, 0xfd, 0xa0, 0xf6, 0xa3, 0x6f, 0xf9, 0x6e, - 0xd5, 0xf2, 0xdd, 0x41, 0x94, 0x41, 0x81, 0x55, 0xe0, - 0x6b, 0xdc, 0xf3, 0x77, 0x8b, 0x1a, 0x8a, 0x69, 0xce, - 0xa9, 0xb6, 0x58, 0xb7, 0x61, 0x42, 0x17, 0x1a, 0xf2, - 0x46, 0x42, 0x78, 0xa8, 0x22, 0xeb, 0x29, 0x7c, 0xb8 }; -static const uint8_t CIPHER_63_MAX_KEY_IV[] = { - 0x32, 0xf1, 0x68, 0x87, 0x03, 0x72, 0x8c, 0x3d, 0xb7, 0xb3, 0xf4, 0x2e, 0x66, - 0x9e, 0x83, 0xc1, 0x98, 0x44, 0xc2, 0x93, 0x11, 0x38, 0x90, 0xa4, 0xa2, 0x4a, - 0xce, 0x71, 0x60, 0x6d, 0x57, 0x6d, 0x36, 0x27, 0x8f, 0x32, 0x78, 0x03, 0xa0, - 0x4d, 0xc9, 0x0b, 0xc6, 0x8b, 0x69, 0x1a, 0x8b, 0x31, 0x00, 0x4b, 0x50, 0x46, - 0x2d, 0x17, 0xa0, 0xeb, 0xc4, 0x89, 0xd3, 0x04, 0x58, 0x77, 0x10 -}; -static const uint8_t CIPHER_63_ZERO_KEY_IV[] = { - 0x6b, 0x4d, 0x0c, 0xd3, 0x89, 0x81, 0x29, 0x44, 0x4d, 0x46, 0x29, 0x97, 0xf2, - 0x1b, 0xe7, 0xa3, 0x47, 0x41, 0x65, 0xa2, 0xd6, 0xb5, 0x35, 0x75, 0x3c, 0x2f, - 0xc4, 0x66, 0x2d, 0x27, 0xff, 0x6c, 0x6f, 0xca, 0x08, 0x6a, 0x38, 0x93, 0xc0, - 0x4e, 0xfe, 0x4b, 0x53, 0x66, 0xa8, 0x25, 0xd5, 0xc2, 0x34, 0x93, 0xc9, 0xbf, - 0x5c, 0x39, 0xf3, 0x06, 0x2f, 0xe1, 0x58, 0xa4, 0x3f, 0x45, 0x18 -}; -static const uint8_t CIPHER_63_MAX_IV[] = { 0x0c, 0xbc, 0x6e, 0x7c, 0x67, 0xa7, 0x49, 0x0f, 0xd9, - 0x0a, 0x6e, 0x5a, 0xe0, 0xe0, 0x82, 0xbd, 0x32, 0x64, - 0xdf, 0xe4, 0xec, 0x68, 0x94, 0xe4, 0x7d, 0x77, 0x44, - 0x0d, 0x7f, 0x64, 0xfd, 0xb0, 0x51, 0xda, 0x68, 0x8a, - 0x17, 0x08, 0xce, 0x5d, 0x0d, 0x56, 0x38, 0x7d, 0x6a, - 0xf5, 0x3d, 0x41, 0x7a, 0xa1, 0xdd, 0xea, 0xd2, 0x58, - 0xb0, 0x45, 0xd0, 0xea, 0xcb, 0xd2, 0x43, 0x5e, 0x4d }; -static const uint8_t CIPHER_63_ZERO_IV[] = { 0x90, 0xfb, 0x35, 0x72, 0xf3, 0x45, 0x99, 0xed, 0x9c, - 0x72, 0x8d, 0xd7, 0x14, 0x38, 0xea, 0xd0, 0xbd, 0xea, - 0x2e, 0xd8, 0x27, 0x34, 0xc9, 0xa6, 0x50, 0x56, 0xb5, - 0xd0, 0x8c, 0x6f, 0xe9, 0x40, 0xbb, 0x98, 0xd2, 0xba, - 0xf3, 0x77, 0x1b, 0x79, 0x8f, 0x8a, 0x88, 0x2b, 0x13, - 0x91, 0x86, 0x20, 0x77, 0x73, 0x5b, 0x7d, 0xef, 0x34, - 0xfc, 0xde, 0x9b, 0xed, 0xff, 0xe1, 0x3d, 0x1d, 0xf5 }; -static const uint8_t PLAIN_64[] = { 0x01, 0x4d, 0xf0, 0x00, 0x10, 0x8b, 0x67, 0xcf, 0x99, 0x50, - 0x5b, 0x17, 0x9f, 0x8e, 0xd4, 0x98, 0x0a, 0x61, 0x03, 0xd1, - 0xbc, 0xa7, 0x0d, 0xbe, 0x9b, 0xbf, 0xab, 0x0e, 0xd5, 0x98, - 0x01, 0xd6, 0xe5, 0xf2, 0xd6, 0xf6, 0x7d, 0x3e, 0xc5, 0x16, - 0x8e, 0x21, 0x2e, 0x2d, 0xaf, 0x02, 0xc6, 0xb9, 0x63, 0xc9, - 0x8a, 0x1f, 0x70, 0x97, 0xde, 0x0c, 0x56, 0x89, 0x1a, 0x2b, - 0x21, 0x1b, 0x01, 0x07 }; -static const uint8_t CIPHER_64[] = { 0x34, 0x6c, 0xaa, 0xc1, 0xa3, 0x38, 0xad, 0x4e, 0xcf, 0x42, - 0x89, 0x2e, 0x30, 0xd4, 0x3d, 0xf5, 0x99, 0xce, 0xeb, 0xe3, - 0x15, 0x2d, 0xf4, 0xaa, 0x51, 0x67, 0x10, 0x8e, 0x75, 0x09, - 0xec, 0x45, 0x31, 0xd6, 0x0d, 0xa3, 0x4d, 0x90, 0x35, 0x37, - 0xb1, 0x16, 0xcb, 0xb5, 0x5c, 0x57, 0xc3, 0x4f, 0x04, 0x86, - 0x07, 0x66, 0x39, 0xb8, 0xba, 0xdf, 0x4b, 0x70, 0xaf, 0x84, - 0x4e, 0x06, 0xd1, 0x8c }; -static const uint8_t CIPHER_64_ZERO_KEY[] = { - 0x01, 0xcb, 0x4f, 0x84, 0x1a, 0xdd, 0x1e, 0x20, 0x4f, 0x7b, 0xb6, 0xe0, 0x81, - 0xbc, 0x6b, 0x17, 0x2e, 0x0d, 0xce, 0x24, 0x64, 0xea, 0x5e, 0xce, 0x75, 0x27, - 0xb5, 0xbd, 0xa0, 0x79, 0x1d, 0x22, 0xc5, 0xf3, 0xb0, 0x64, 0x65, 0x7c, 0x41, - 0x4c, 0x6a, 0xf7, 0xaf, 0x64, 0x3c, 0x31, 0x89, 0x5f, 0xb1, 0x45, 0x6b, 0x5b, - 0xbf, 0xc6, 0x82, 0x4e, 0xb4, 0xc3, 0x5d, 0x5d, 0xac, 0x4b, 0x0c, 0xf2 -}; -static const uint8_t CIPHER_64_MAX_KEY[] = { - 0xa3, 0x4a, 0x7d, 0xdc, 0xb2, 0x9d, 0xab, 0xf3, 0xf4, 0xb8, 0xa3, 0x48, 0x4a, - 0xf3, 0x24, 0x45, 0xd5, 0xa3, 0x19, 0xfc, 0xa4, 0x03, 0xdc, 0xc6, 0xd4, 0x1f, - 0x2d, 0xc4, 0xb4, 0xfc, 0xd6, 0xaf, 0xf5, 0x01, 0x81, 0xfc, 0xfd, 0x13, 0x5d, - 0x87, 0x46, 0x1c, 0xf6, 0xfc, 0xeb, 0x56, 0xff, 0xaa, 0xda, 0xaf, 0xdd, 0x7c, - 0xd3, 0xd3, 0xd0, 0xa9, 0x57, 0x16, 0x69, 0x1f, 0x41, 0xf0, 0x3d, 0x12 -}; -static const uint8_t CIPHER_64_MAX_KEY_IV[] = { - 0x31, 0x3b, 0xf9, 0xfb, 0x00, 0x9b, 0x75, 0x9b, 0xd2, 0x91, 0x2e, 0xf4, 0x88, - 0x75, 0xf1, 0x67, 0x39, 0x6c, 0x0e, 0x33, 0xe6, 0x51, 0xa7, 0x6f, 0x9e, 0xba, - 0x13, 0x95, 0xcb, 0x91, 0xa9, 0x3a, 0x38, 0xb4, 0xa4, 0x3a, 0xc6, 0xa6, 0x02, - 0xe4, 0x4a, 0xc3, 0x64, 0xd8, 0x88, 0x2a, 0xf0, 0x71, 0x1f, 0x0e, 0xb0, 0x9e, - 0x06, 0x24, 0x42, 0xe5, 0x66, 0xb2, 0x24, 0x5d, 0x6f, 0x80, 0xe2, 0xe0 -}; -static const uint8_t CIPHER_64_ZERO_KEY_IV[] = { - 0x68, 0x87, 0x9d, 0xaf, 0x8a, 0x68, 0xd0, 0xe2, 0x28, 0x64, 0xf3, 0x4d, 0x1c, - 0xf0, 0x95, 0x05, 0xe6, 0x69, 0xa9, 0x02, 0x21, 0xdc, 0x02, 0xbe, 0x00, 0xdf, - 0x19, 0x82, 0x86, 0xdb, 0x01, 0x3b, 0x61, 0x59, 0x23, 0x62, 0x86, 0x36, 0x62, - 0xe7, 0x7d, 0x83, 0xf1, 0x35, 0x49, 0x15, 0xae, 0x82, 0x2b, 0xd6, 0x29, 0x67, - 0x77, 0x0a, 0x11, 0x08, 0x8d, 0xda, 0xaf, 0xfd, 0x08, 0xb2, 0xea, 0x9a -}; -static const uint8_t CIPHER_64_MAX_IV[] = { - 0x6a, 0xd5, 0xae, 0xcf, 0x9a, 0xb0, 0xa7, 0x9f, 0xe4, 0xf7, 0xe9, 0x8c, 0x90, - 0x51, 0x4d, 0x75, 0x4b, 0xd6, 0x6c, 0xeb, 0xe4, 0xc3, 0x44, 0x9b, 0xd2, 0x72, - 0x23, 0xd5, 0xcb, 0xde, 0xd8, 0x7e, 0x56, 0xbd, 0x53, 0x75, 0xd6, 0x22, 0xaa, - 0x13, 0x44, 0x74, 0xe6, 0x5b, 0x50, 0xb6, 0x03, 0xb3, 0x29, 0x56, 0xa0, 0xc6, - 0x15, 0x38, 0x26, 0x6a, 0x32, 0xef, 0x44, 0xc3, 0x27, 0xdc, 0xf5, 0xe1 -}; -static const uint8_t CIPHER_64_ZERO_IV[] = { - 0x11, 0x9b, 0x07, 0x7a, 0x35, 0x62, 0xb7, 0x71, 0xbf, 0x1c, 0x06, 0x70, 0xc3, - 0xc8, 0xac, 0xa6, 0x57, 0x4f, 0xe1, 0x18, 0x04, 0xe2, 0x60, 0xe7, 0x8c, 0x07, - 0xf0, 0xd4, 0x14, 0xa0, 0xca, 0xb3, 0xec, 0xc0, 0x22, 0x8b, 0xa5, 0xcc, 0xd1, - 0x99, 0xb3, 0x46, 0x07, 0x7e, 0x48, 0xfd, 0x36, 0xb3, 0x06, 0x4e, 0x64, 0x9d, - 0x3c, 0x5a, 0x7e, 0xdc, 0x49, 0xbc, 0xc7, 0x2e, 0x4a, 0xad, 0x97, 0xd9 -}; -static const uint8_t PLAIN_65[] = { 0x0d, 0xd8, 0xfd, 0x8b, 0x16, 0xc2, 0xa1, 0xa4, 0xe3, 0xcf, - 0xd2, 0x92, 0xd2, 0x98, 0x4b, 0x35, 0x61, 0xd5, 0x55, 0xd1, - 0x6c, 0x33, 0xdd, 0xc2, 0xbc, 0xf7, 0xed, 0xde, 0x13, 0xef, - 0xe5, 0x20, 0xc7, 0xe2, 0xab, 0xdd, 0xa4, 0x4d, 0x81, 0x88, - 0x1c, 0x53, 0x1a, 0xee, 0xeb, 0x66, 0x24, 0x4c, 0x3b, 0x79, - 0x1e, 0xa8, 0xac, 0xfb, 0x6a, 0x68, 0xf3, 0x58, 0x46, 0x06, - 0x47, 0x2b, 0x26, 0x0e, 0x0d }; -static const uint8_t CIPHER_65[] = { 0xcd, 0x39, 0xb4, 0x9c, 0xdf, 0x0c, 0x8a, 0xae, 0x75, 0x31, - 0x1d, 0x7c, 0xce, 0x09, 0x0b, 0x7d, 0x3a, 0xf1, 0xc6, 0x9f, - 0x6c, 0x86, 0x16, 0xea, 0x51, 0x34, 0xe3, 0x79, 0x28, 0x91, - 0x91, 0xc2, 0x18, 0xf1, 0xd9, 0xc6, 0x6b, 0x3d, 0x78, 0xd4, - 0xbc, 0x1c, 0x78, 0x02, 0x21, 0x5e, 0x91, 0x4f, 0x26, 0x75, - 0x9b, 0xb9, 0xfd, 0xdd, 0xc5, 0xec, 0xda, 0x2f, 0x94, 0x05, - 0xeb, 0xe3, 0xd0, 0xc6, 0xd9 }; -static const uint8_t CIPHER_65_ZERO_KEY[] = { - 0xfa, 0x27, 0x86, 0x2d, 0x1b, 0x12, 0x7d, 0x2f, 0x8b, 0x89, 0x5c, 0x89, 0x0e, - 0x3c, 0x31, 0xb1, 0xdb, 0x7f, 0x5a, 0x41, 0xb0, 0xd7, 0x02, 0x18, 0xc6, 0x75, - 0xd6, 0x05, 0x54, 0xcc, 0x6f, 0xa4, 0x36, 0x00, 0xec, 0x19, 0xe6, 0x76, 0x2c, - 0x58, 0x43, 0x0c, 0x7b, 0xea, 0xbd, 0x45, 0x92, 0x32, 0x2a, 0xf4, 0xe6, 0x7b, - 0x23, 0x75, 0x5a, 0xf9, 0x38, 0x64, 0xd0, 0x95, 0x89, 0x48, 0x69, 0x07, 0x4e -}; -static const uint8_t CIPHER_65_MAX_KEY[] = { - 0x7a, 0x88, 0x66, 0xab, 0x26, 0xbc, 0xff, 0x20, 0xb1, 0xf8, 0x90, 0x45, 0xcc, - 0xd3, 0x00, 0x94, 0xcf, 0x73, 0xe2, 0xe5, 0x5e, 0x06, 0x43, 0xab, 0xe6, 0x7a, - 0x61, 0x3c, 0x76, 0x13, 0x62, 0x88, 0x8c, 0x22, 0xf5, 0x29, 0x2e, 0x0a, 0x05, - 0xf8, 0x31, 0xdf, 0x28, 0xe1, 0xd7, 0x6b, 0x7f, 0x57, 0xff, 0x67, 0x68, 0x15, - 0x3c, 0x90, 0x56, 0x47, 0x6d, 0x7f, 0x14, 0x3e, 0x45, 0x67, 0x69, 0x70, 0xcb -}; -static const uint8_t CIPHER_65_MAX_KEY_IV[] = { - 0x3d, 0xae, 0xf4, 0x70, 0x06, 0xd2, 0xb3, 0xf0, 0xa8, 0x0e, 0xa7, 0x71, 0xc5, - 0x63, 0x6e, 0xca, 0x52, 0xd8, 0x58, 0x33, 0x36, 0xc5, 0x77, 0x13, 0xb9, 0xf2, - 0x55, 0x45, 0x0d, 0xe6, 0x4d, 0xcc, 0x1a, 0xa4, 0xd9, 0x11, 0x1f, 0xd5, 0x46, - 0x7a, 0xd8, 0xb1, 0x50, 0x1b, 0xcc, 0x4e, 0x12, 0x84, 0x47, 0xbe, 0x24, 0x29, - 0xda, 0x48, 0xf6, 0x81, 0xc3, 0x63, 0x78, 0x70, 0x09, 0xb0, 0xc5, 0xe9, 0x45 -}; -static const uint8_t CIPHER_65_ZERO_KEY_IV[] = { - 0x64, 0x12, 0x90, 0x24, 0x8c, 0x21, 0x16, 0x89, 0x52, 0xfb, 0x7a, 0xc8, 0x51, - 0xe6, 0x0a, 0xa8, 0x8d, 0xdd, 0xff, 0x02, 0xf1, 0x48, 0xd2, 0xc2, 0x27, 0x97, - 0x5f, 0x52, 0x40, 0xac, 0xe5, 0xcd, 0x43, 0x49, 0x5e, 0x49, 0x5f, 0x45, 0x26, - 0x79, 0xef, 0xf1, 0xc5, 0xf6, 0x0d, 0x71, 0x4c, 0x77, 0x73, 0x66, 0xbd, 0xd0, - 0xab, 0x66, 0xa5, 0x6c, 0x28, 0x0b, 0xf3, 0xd0, 0x6e, 0x82, 0xcd, 0x93, 0x0e -}; -static const uint8_t CIPHER_65_MAX_IV[] = { - 0x13, 0xdb, 0x04, 0xcc, 0xdb, 0xd5, 0x09, 0x2e, 0xf9, 0xfb, 0x32, 0xdc, 0x56, - 0x28, 0x17, 0xfb, 0xfb, 0x8f, 0x35, 0x76, 0xa9, 0x7a, 0x38, 0xf6, 0xe2, 0xe5, - 0x39, 0x7d, 0x1a, 0x0e, 0x0c, 0xcf, 0x67, 0xe9, 0x37, 0xb4, 0x1e, 0x34, 0xeb, - 0xb7, 0x0e, 0x22, 0xed, 0x23, 0x72, 0xf9, 0xa0, 0xc1, 0x8d, 0x4b, 0xb7, 0xa8, - 0xf4, 0x47, 0xee, 0xa4, 0x62, 0xf2, 0xa2, 0xbe, 0xff, 0x9f, 0x8d, 0x66, 0xd4 -}; -static const uint8_t CIPHER_65_ZERO_IV[] = { - 0x09, 0xe6, 0xdb, 0x40, 0x1a, 0x5d, 0xf1, 0xbc, 0x3a, 0xf1, 0x08, 0xb5, 0xe9, - 0x9c, 0xc2, 0x5f, 0xa3, 0x21, 0xec, 0xc8, 0x24, 0xb1, 0xe1, 0x8e, 0x52, 0xf7, - 0x2b, 0x4b, 0xec, 0x2f, 0x8c, 0x69, 0xe9, 0x6a, 0x72, 0x54, 0xce, 0x98, 0x6b, - 0xbe, 0x85, 0x7e, 0xc0, 0xaf, 0x51, 0xf2, 0x1a, 0x3b, 0xdd, 0x46, 0xc6, 0x05, - 0xe2, 0x57, 0x95, 0xa0, 0x60, 0xf1, 0x6e, 0xe2, 0x9e, 0x22, 0xe4, 0x21, 0xcf -}; - -typedef struct snow_v_test_vectors_s { - const uint8_t *KEY; - const uint8_t *IV; - uint64_t length_in_bytes; - const uint8_t *plaintext; - const uint8_t *ciphertext; -} snow_v_test_vectors_t; - -static const snow_v_test_vectors_t snow_v_vectors_cov[] = { - /* { key, iv, bytes, plain, cipher } */ - /* == SNOW-V test vectors from spec #1, #2, #3 */ - { ZERO_KEY, ZERO_IV, 128, ZERO_PLAIN, keystreams_from_spec[0] }, - { MAX_KEY, MAX_IV, 128, ZERO_PLAIN, keystreams_from_spec[1] }, - { KEY_spec, IV_spec, 128, ZERO_PLAIN, keystreams_from_spec[2] }, - /* Vectors generated for better coverage*/ - { KEYs[0], IVs[0], 0, NULL, NULL }, - { KEYs[0], ZERO_IV, 0, NULL, NULL }, - { KEYs[0], MAX_IV, 0, NULL, NULL }, - { ZERO_KEY, IVs[0], 0, NULL, NULL }, - { ZERO_KEY, ZERO_IV, 0, NULL, NULL }, - { MAX_KEY, IVs[0], 0, NULL, NULL }, - { MAX_KEY, MAX_IV, 0, NULL, NULL }, - { KEYs[1], IVs[1], 1, PLAIN_1, CIPHER_1 }, - { KEYs[1], ZERO_IV, 1, PLAIN_1, CIPHER_1_ZERO_IV }, - { KEYs[1], MAX_IV, 1, PLAIN_1, CIPHER_1_MAX_IV }, - { ZERO_KEY, IVs[1], 1, PLAIN_1, CIPHER_1_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 1, PLAIN_1, CIPHER_1_ZERO_KEY_IV }, - { MAX_KEY, IVs[1], 1, PLAIN_1, CIPHER_1_MAX_KEY }, - { MAX_KEY, MAX_IV, 1, PLAIN_1, CIPHER_1_MAX_KEY_IV }, - { KEYs[2], IVs[2], 2, PLAIN_8, CIPHER_8 }, - { KEYs[2], ZERO_IV, 2, PLAIN_8, CIPHER_8_ZERO_IV }, - { KEYs[2], MAX_IV, 2, PLAIN_8, CIPHER_8_MAX_IV }, - { ZERO_KEY, IVs[2], 2, PLAIN_8, CIPHER_8_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 2, PLAIN_8, CIPHER_8_ZERO_KEY_IV }, - { MAX_KEY, IVs[2], 2, PLAIN_8, CIPHER_8_MAX_KEY }, - { MAX_KEY, MAX_IV, 2, PLAIN_8, CIPHER_8_MAX_KEY_IV }, - { KEYs[3], IVs[3], 3, PLAIN_15, CIPHER_15 }, - { KEYs[3], ZERO_IV, 3, PLAIN_15, CIPHER_15_ZERO_IV }, - { KEYs[3], MAX_IV, 3, PLAIN_15, CIPHER_15_MAX_IV }, - { ZERO_KEY, IVs[3], 3, PLAIN_15, CIPHER_15_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 3, PLAIN_15, CIPHER_15_ZERO_KEY_IV }, - { MAX_KEY, IVs[3], 3, PLAIN_15, CIPHER_15_MAX_KEY }, - { MAX_KEY, MAX_IV, 3, PLAIN_15, CIPHER_15_MAX_KEY_IV }, - { KEYs[4], IVs[4], 4, PLAIN_16, CIPHER_16 }, - { KEYs[4], ZERO_IV, 4, PLAIN_16, CIPHER_16_ZERO_IV }, - { KEYs[4], MAX_IV, 4, PLAIN_16, CIPHER_16_MAX_IV }, - { ZERO_KEY, IVs[4], 4, PLAIN_16, CIPHER_16_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 4, PLAIN_16, CIPHER_16_ZERO_KEY_IV }, - { MAX_KEY, IVs[4], 4, PLAIN_16, CIPHER_16_MAX_KEY }, - { MAX_KEY, MAX_IV, 4, PLAIN_16, CIPHER_16_MAX_KEY_IV }, - { KEYs[5], IVs[5], 5, PLAIN_17, CIPHER_17 }, - { KEYs[5], ZERO_IV, 5, PLAIN_17, CIPHER_17_ZERO_IV }, - { KEYs[5], MAX_IV, 5, PLAIN_17, CIPHER_17_MAX_IV }, - { ZERO_KEY, IVs[5], 5, PLAIN_17, CIPHER_17_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 5, PLAIN_17, CIPHER_17_ZERO_KEY_IV }, - { MAX_KEY, IVs[5], 5, PLAIN_17, CIPHER_17_MAX_KEY }, - { MAX_KEY, MAX_IV, 5, PLAIN_17, CIPHER_17_MAX_KEY_IV }, - { KEYs[6], IVs[6], 6, PLAIN_48, CIPHER_48 }, - { KEYs[6], ZERO_IV, 6, PLAIN_48, CIPHER_48_ZERO_IV }, - { KEYs[6], MAX_IV, 6, PLAIN_48, CIPHER_48_MAX_IV }, - { ZERO_KEY, IVs[6], 6, PLAIN_48, CIPHER_48_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 6, PLAIN_48, CIPHER_48_ZERO_KEY_IV }, - { MAX_KEY, IVs[6], 6, PLAIN_48, CIPHER_48_MAX_KEY }, - { MAX_KEY, MAX_IV, 6, PLAIN_48, CIPHER_48_MAX_KEY_IV }, - { KEYs[7], IVs[7], 7, PLAIN_63, CIPHER_63 }, - { KEYs[7], ZERO_IV, 7, PLAIN_63, CIPHER_63_ZERO_IV }, - { KEYs[7], MAX_IV, 7, PLAIN_63, CIPHER_63_MAX_IV }, - { ZERO_KEY, IVs[7], 7, PLAIN_63, CIPHER_63_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 7, PLAIN_63, CIPHER_63_ZERO_KEY_IV }, - { MAX_KEY, IVs[7], 7, PLAIN_63, CIPHER_63_MAX_KEY }, - { MAX_KEY, MAX_IV, 7, PLAIN_63, CIPHER_63_MAX_KEY_IV }, - { KEYs[8], IVs[8], 8, PLAIN_64, CIPHER_64 }, - { KEYs[8], ZERO_IV, 8, PLAIN_64, CIPHER_64_ZERO_IV }, - { KEYs[8], MAX_IV, 8, PLAIN_64, CIPHER_64_MAX_IV }, - { ZERO_KEY, IVs[8], 8, PLAIN_64, CIPHER_64_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 8, PLAIN_64, CIPHER_64_ZERO_KEY_IV }, - { MAX_KEY, IVs[8], 8, PLAIN_64, CIPHER_64_MAX_KEY }, - { MAX_KEY, MAX_IV, 8, PLAIN_64, CIPHER_64_MAX_KEY_IV }, - { KEYs[9], IVs[9], 9, PLAIN_65, CIPHER_65 }, - { KEYs[9], ZERO_IV, 9, PLAIN_65, CIPHER_65_ZERO_IV }, - { KEYs[9], MAX_IV, 9, PLAIN_65, CIPHER_65_MAX_IV }, - { ZERO_KEY, IVs[9], 9, PLAIN_65, CIPHER_65_ZERO_KEY }, - { ZERO_KEY, ZERO_IV, 9, PLAIN_65, CIPHER_65_ZERO_KEY_IV }, - { MAX_KEY, IVs[9], 9, PLAIN_65, CIPHER_65_MAX_KEY }, - { MAX_KEY, MAX_IV, 9, PLAIN_65, CIPHER_65_MAX_KEY_IV } -}; static const uint8_t SPEC_SNOW_V_GCM_AUTH_TAGs[][16] = { { 0x02, 0x9a, 0x62, 0x4c, 0xda, 0xa4, 0xd4, 0x6c, 0xb9, 0xa0, 0xef, 0x40, 0x46, 0x95, 0x6c, @@ -638,9 +176,8 @@ check_buffer_over_under_write(uint8_t *result, const int pad_pattern, const size } static void -snow_v_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const uint8_t *key, - const uint8_t *iv, const uint8_t *plain, const size_t size, - const uint8_t *expected) +snow_v_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const void *key, const void *iv, + const void *plain, const size_t size, const void *expected) { const size_t pad_size = 16; const size_t alloc_size = size + (2 * pad_size); @@ -795,11 +332,13 @@ snow_v_test(IMB_MGR *p_mgr) /* Test SNOW-V */ printf("SNOW-V test vectors\n"); test_suite_start(&ts_snow_v, "SNOW-V"); - for (i = 0; i < DIM(snow_v_vectors_cov); i++) - snow_v_single_test(p_mgr, &ts_snow_v, snow_v_vectors_cov[i].KEY, - snow_v_vectors_cov[i].IV, snow_v_vectors_cov[i].plaintext, - snow_v_vectors_cov[i].length_in_bytes, - snow_v_vectors_cov[i].ciphertext); + for (const struct cipher_test *v = snow_v_test_json; v->msg != NULL; v++) { + assert(v->keySize == (32 * CHAR_BIT)); + assert(v->ivSize == (16 * CHAR_BIT)); + assert((v->msgSize % CHAR_BIT) == 0); + snow_v_single_test(p_mgr, &ts_snow_v, v->key, v->iv, v->msg, v->msgSize / CHAR_BIT, + v->ct); + } errors += test_suite_end(&ts_snow_v); diff --git a/test/kat-app/snow_v_test.json.c b/test/kat-app/snow_v_test.json.c new file mode 100644 index 00000000..6539c260 --- /dev/null +++ b/test/kat-app/snow_v_test.json.c @@ -0,0 +1,427 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* SNOW-V */ +#include "cipher_test.h" + +const struct cipher_test snow_v_test_json[] = { + { 128, 256, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x69\xca\x6d\xaf\x9a\xe3\xb7\x2d\xb1\x34\xa8\x5a\x83\x7e\x41\x9d\xec\x08\xaa\xd3\x9d\x7b" + "\x0f\x00\x9b\x60\xb2\x8c\x53\x43\x00\xed\x84\xab\xf5\x94\xfb\x08\xa7\xf1\xf3\xa2\xdf\x18" + "\xe6\x17\x68\x3b\x48\x1f\xa3\x78\x07\x9d\xcf\x04\xdb\x53\xb5\xd6\x29\xa9\xeb\x9d\x03\x1c" + "\x15\x9d\xcc\xd0\xa5\x0c\x4d\x5d\xbf\x51\x15\xd8\x70\x39\xc0\xd0\x3c\xa1\x37\x0c\x19\x40" + "\x03\x47\xa0\xb4\xd2\xe9\xdb\xe5\xcb\xca\x60\x82\x14\xa2\x65\x82\xcf\x68\x09\x16\xb3\x45" + "\x13\x21\x95\x4f\xdf\x30\x84\xaf\x02\xf6\xa8\xe2\x48\x1d\xe6\xbf\x82\x79", + 1, 1024 }, + { 128, 256, 2, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x30\x76\x09\xfb\x10\x10\x12\x54\x4b\xc1\x75\xe3\x17\xfb\x25\xff\x33\x0d\x0d\xe2\x5a\xf6" + "\xaa\xd1\x05\x05\xb8\x9b\x1e\x09\xa8\xec\xdd\x46\x72\xcc\xbb\x98\xc7\xf2\xc4\xe2\x4a\xf5" + "\x27\x28\x36\xc8\x7c\xc7\x3a\x81\x76\xb3\x9c\xe9\x30\x3b\x3e\x76\x4e\x9b\xe3\xe7\x48\xf7" + "\x65\x1a\x7c\x7e\x81\x3f\xd5\x24\x90\x23\x1e\x56\xf7\xc1\x44\xe4\x38\xe7\x77\x11\xa6\xb0" + "\xba\xfb\x60\x45\x0c\x62\xd7\xd9\xb9\x24\x1d\x12\x44\xfc\xb4\x9d\xa1\xe5\x2b\x80\x13\xde" + "\xcd\xd4\x86\x04\xff\xfc\x62\x67\x6e\x70\x3b\x3a\xb8\x49\xcb\xa6\xea\x09", + 1, 1024 }, + { 128, 256, 3, + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x0a\x1a\x2a\x3a\x4a\x5a" + "\x6a\x7a\x8a\x9a\xaa\xba\xca\xda\xea\xfa", + "\x01\x23\x45\x67\x89\xab\xcd\xef\xfe\xdc\xba\x98\x76\x54\x32\x10", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xaa\x81\xea\xfb\x8b\x86\x16\xce\x3e\x5c\xe2\x22\x24\x61\xc5\x0a\x6a\xb4\x48\x77\x56\xde" + "\x4b\xd3\x1c\x90\x4f\x3d\x97\x8a\xfe\x56\x33\x4f\x10\xdd\xdf\x2b\x95\x31\x76\x9a\x71\x05" + "\x0b\xe4\x38\x5f\xc2\xb6\x19\x2c\x7a\x85\x7b\xe8\xb4\xfc\x28\xb7\x09\xf0\x8f\x11\xf2\x06" + "\x49\xe2\xee\xf2\x49\x80\xf8\x6c\x4c\x11\x36\x41\xfe\xd2\xf3\xf6\xfa\x2b\x91\x95\x12\x06" + "\xb8\x01\xdb\x15\x46\x65\x17\xa6\x33\x0a\xdd\xa6\xb3\x5b\x26\x5e\xfd\x72\x2e\x86\x77\xb4" + "\x8b\xfc\x15\xb4\x41\x18\xde\x52\xd0\x73\xb0\xad\x0f\xe7\x59\x4d\x62\x91", + 1, 1024 }, + { 128, 256, 4, + "\x67\xc6\x69\x73\x51\xff\x4a\xec\x29\xcd\xba\xab\xf2\xfb\xe3\x46\x7c\xc2\x54\xf8\x1b\xe8" + "\xe7\x8d\x76\x5a\x2e\x63\x33\x9f\xc9\x9a", + "\x66\x32\x0d\xb7\x31\x58\xa3\x5a\x25\x5d\x05\x17\x58\xe9\x5e\xd4", "", "", 1, 0 }, + { 128, 256, 5, + "\x67\xc6\x69\x73\x51\xff\x4a\xec\x29\xcd\xba\xab\xf2\xfb\xe3\x46\x7c\xc2\x54\xf8\x1b\xe8" + "\xe7\x8d\x76\x5a\x2e\x63\x33\x9f\xc9\x9a", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "", 1, 0 }, + { 128, 256, 6, + "\x67\xc6\x69\x73\x51\xff\x4a\xec\x29\xcd\xba\xab\xf2\xfb\xe3\x46\x7c\xc2\x54\xf8\x1b\xe8" + "\xe7\x8d\x76\x5a\x2e\x63\x33\x9f\xc9\x9a", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "", 1, 0 }, + { 128, 256, 7, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x66\x32\x0d\xb7\x31\x58\xa3\x5a\x25\x5d\x05\x17\x58\xe9\x5e\xd4", "", "", 1, 0 }, + { 128, 256, 8, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "", 1, 0 }, + { 128, 256, 9, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x66\x32\x0d\xb7\x31\x58\xa3\x5a\x25\x5d\x05\x17\x58\xe9\x5e\xd4", "", "", 1, 0 }, + { 128, 256, 10, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "", "", 1, 0 }, + { 128, 256, 11, + "\xab\xb2\xcd\xc6\x9b\xb4\x54\x11\x0e\x82\x74\x41\x21\x3d\xdc\x87\x70\xe9\x3e\xa1\x41\xe1" + "\xfc\x67\x3e\x01\x7e\x97\xea\xdc\x6b\x96", + "\x8f\x38\x5c\x2a\xec\xb0\x3b\xfb\x32\xaf\x3c\x54\xec\x18\xdb\x5c", "\x89", "\x12", 1, + 8 }, + { 128, 256, 12, + "\xab\xb2\xcd\xc6\x9b\xb4\x54\x11\x0e\x82\x74\x41\x21\x3d\xdc\x87\x70\xe9\x3e\xa1\x41\xe1" + "\xfc\x67\x3e\x01\x7e\x97\xea\xdc\x6b\x96", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x89", "\x03", 1, + 8 }, + { 128, 256, 13, + "\xab\xb2\xcd\xc6\x9b\xb4\x54\x11\x0e\x82\x74\x41\x21\x3d\xdc\x87\x70\xe9\x3e\xa1\x41\xe1" + "\xfc\x67\x3e\x01\x7e\x97\xea\xdc\x6b\x96", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\x89", "\x35", 1, + 8 }, + { 128, 256, 14, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x8f\x38\x5c\x2a\xec\xb0\x3b\xfb\x32\xaf\x3c\x54\xec\x18\xdb\x5c", "\x89", "\x0e", 1, + 8 }, + { 128, 256, 15, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x89", "\xe0", 1, + 8 }, + { 128, 256, 16, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x8f\x38\x5c\x2a\xec\xb0\x3b\xfb\x32\xaf\x3c\x54\xec\x18\xdb\x5c", "\x89", "\x2a", 1, + 8 }, + { 128, 256, 17, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\x89", "\xb9", 1, + 8 }, + { 128, 256, 18, + "\x02\x1a\xfe\x43\xfb\xfa\xaa\x3a\xfb\x29\xd1\xe6\x05\x3c\x7c\x94\x75\xd8\xbe\x61\x89\xf9" + "\x5c\xbb\xa8\x99\x0f\x95\xb1\xeb\xf1\xb3", + "\x05\xef\xf7\x00\xe9\xa1\x3a\xe5\xca\x0b\xcb\xd0\x48\x47\x64\xbd", "\xd4\xb6", + "\x46\xde", 1, 16 }, + { 128, 256, 19, + "\x02\x1a\xfe\x43\xfb\xfa\xaa\x3a\xfb\x29\xd1\xe6\x05\x3c\x7c\x94\x75\xd8\xbe\x61\x89\xf9" + "\x5c\xbb\xa8\x99\x0f\x95\xb1\xeb\xf1\xb3", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\xd4\xb6", + "\x70\xe9", 1, 16 }, + { 128, 256, 20, + "\x02\x1a\xfe\x43\xfb\xfa\xaa\x3a\xfb\x29\xd1\xe6\x05\x3c\x7c\x94\x75\xd8\xbe\x61\x89\xf9" + "\x5c\xbb\xa8\x99\x0f\x95\xb1\xeb\xf1\xb3", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\xd4\xb6", + "\xab\x8b", 1, 16 }, + { 128, 256, 21, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x05\xef\xf7\x00\xe9\xa1\x3a\xe5\xca\x0b\xcb\xd0\x48\x47\x64\xbd", "\xd4\xb6", + "\xbc\xd6", 1, 16 }, + { 128, 256, 22, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\xd4\xb6", + "\xbd\x7c", 1, 16 }, + { 128, 256, 23, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x05\xef\xf7\x00\xe9\xa1\x3a\xe5\xca\x0b\xcb\xd0\x48\x47\x64\xbd", "\xd4\xb6", + "\x7a\x47", 1, 16 }, + { 128, 256, 24, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\xd4\xb6", + "\xe4\xc0", 1, 16 }, + { 128, 256, 25, + "\x1f\x23\x1e\xa8\x1c\x7b\x64\xc5\x14\x73\x5a\xc5\x5e\x4b\x79\x63\x3b\x70\x64\x24\x11\x9e" + "\x09\xdc\xaa\xd4\xac\xf2\x1b\x10\xaf\x3b", + "\x33\xcd\xe3\x50\x48\x47\x15\x5c\xbb\x6f\x22\x19\xba\x9b\x7d\xf5", "\x83\x67\xd8", + "\xd3\x15\x8d", 1, 24 }, + { 128, 256, 26, + "\x1f\x23\x1e\xa8\x1c\x7b\x64\xc5\x14\x73\x5a\xc5\x5e\x4b\x79\x63\x3b\x70\x64\x24\x11\x9e" + "\x09\xdc\xaa\xd4\xac\xf2\x1b\x10\xaf\x3b", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x83\x67\xd8", + "\x8c\x30\x1f", 1, 24 }, + { 128, 256, 27, + "\x1f\x23\x1e\xa8\x1c\x7b\x64\xc5\x14\x73\x5a\xc5\x5e\x4b\x79\x63\x3b\x70\x64\x24\x11\x9e" + "\x09\xdc\xaa\xd4\xac\xf2\x1b\x10\xaf\x3b", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\x83\x67\xd8", + "\x3e\x43\x7d", 1, 24 }, + { 128, 256, 28, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x33\xcd\xe3\x50\x48\x47\x15\x5c\xbb\x6f\x22\x19\xba\x9b\x7d\xf5", "\x83\x67\xd8", + "\x6e\xdd\x4a", 1, 24 }, + { 128, 256, 29, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x83\x67\xd8", + "\xea\xad\xb5", 1, 24 }, + { 128, 256, 30, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x33\xcd\xe3\x50\x48\x47\x15\x5c\xbb\x6f\x22\x19\xba\x9b\x7d\xf5", "\x83\x67\xd8", + "\xb3\xd5\xa1", 1, 24 }, + { 128, 256, 31, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\x83\x67\xd8", + "\xb3\x11\xd1", 1, 24 }, + { 128, 256, 32, + "\x0b\xe1\x1a\x1c\x7f\x23\xf8\x29\xf8\xa4\x1b\x13\xb5\xca\x4e\xe8\x98\x32\x38\xe0\x79\x4d" + "\x3d\x34\xbc\x5f\x4e\x77\xfa\xcb\x6c\x05", + "\xac\x86\x21\x2b\xaa\x1a\x55\xa2\xbe\x70\xb5\x73\x3b\x04\x5c\xd3", "\x77\x09\xd1\xa5", + "\x16\x4c\x52\xa5", 1, 32 }, + { 128, 256, 33, + "\x0b\xe1\x1a\x1c\x7f\x23\xf8\x29\xf8\xa4\x1b\x13\xb5\xca\x4e\xe8\x98\x32\x38\xe0\x79\x4d" + "\x3d\x34\xbc\x5f\x4e\x77\xfa\xcb\x6c\x05", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x77\x09\xd1\xa5", + "\x41\x1c\xe0\xe4", 1, 32 }, + { 128, 256, 34, + "\x0b\xe1\x1a\x1c\x7f\x23\xf8\x29\xf8\xa4\x1b\x13\xb5\xca\x4e\xe8\x98\x32\x38\xe0\x79\x4d" + "\x3d\x34\xbc\x5f\x4e\x77\xfa\xcb\x6c\x05", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\x77\x09\xd1\xa5", + "\x70\x3d\x33\xd6", 1, 32 }, + { 128, 256, 35, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xac\x86\x21\x2b\xaa\x1a\x55\xa2\xbe\x70\xb5\x73\x3b\x04\x5c\xd3", "\x77\x09\xd1\xa5", + "\xae\xb6\x70\x05", 1, 32 }, + { 128, 256, 36, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x77\x09\xd1\xa5", + "\x1e\xc3\xbc\x0a", 1, 32 }, + { 128, 256, 37, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xac\x86\x21\x2b\xaa\x1a\x55\xa2\xbe\x70\xb5\x73\x3b\x04\x5c\xd3", "\x77\x09\xd1\xa5", + "\x96\x19\xac\xd2", 1, 32 }, + { 128, 256, 38, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", "\x77\x09\xd1\xa5", + "\x47\x7f\xd8\x5e", 1, 32 }, + { 128, 256, 39, + "\x36\x94\xb3\xaf\xe2\xf0\xe4\x9e\x4f\x32\x15\x49\xfd\x82\x4e\xa9\x08\x70\xd4\xb2\x8a\x29" + "\x54\x48\x9a\x0a\xbc\xd5\x0e\x18\xa8\x44", + "\xac\x5b\xf3\x8e\x4c\xd7\x2d\x9b\x09\x42\xe5\x06\xc4\x33\xaf\xcd", + "\xcd\x16\x68\xba\xac", "\xd4\x61\x94\x70\x87", 1, 40 }, + { 128, 256, 40, + "\x36\x94\xb3\xaf\xe2\xf0\xe4\x9e\x4f\x32\x15\x49\xfd\x82\x4e\xa9\x08\x70\xd4\xb2\x8a\x29" + "\x54\x48\x9a\x0a\xbc\xd5\x0e\x18\xa8\x44", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xcd\x16\x68\xba\xac", "\x0a\x61\x65\x53\x74", 1, 40 }, + { 128, 256, 41, + "\x36\x94\xb3\xaf\xe2\xf0\xe4\x9e\x4f\x32\x15\x49\xfd\x82\x4e\xa9\x08\x70\xd4\xb2\x8a\x29" + "\x54\x48\x9a\x0a\xbc\xd5\x0e\x18\xa8\x44", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xcd\x16\x68\xba\xac", "\x6c\x12\x44\x15\x4d", 1, 40 }, + { 128, 256, 42, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xac\x5b\xf3\x8e\x4c\xd7\x2d\x9b\x09\x42\xe5\x06\xc4\x33\xaf\xcd", + "\xcd\x16\x68\xba\xac", "\x02\x78\xe0\xce\xed", 1, 40 }, + { 128, 256, 43, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xcd\x16\x68\xba\xac", "\xa4\xdc\x05\x15\x36", 1, 40 }, + { 128, 256, 44, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xac\x5b\xf3\x8e\x4c\xd7\x2d\x9b\x09\x42\xe5\x06\xc4\x33\xaf\xcd", + "\xcd\x16\x68\xba\xac", "\xbb\xce\x3a\x68\x13", 1, 40 }, + { 128, 256, 45, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xcd\x16\x68\xba\xac", "\xfd\x60\x61\x41\xbc", 1, 40 }, + { 128, 256, 46, + "\xa3\x84\x7f\x2d\xad\xd4\x76\x47\xde\x32\x1c\xec\x4a\xc4\x30\xf6\x20\x23\x85\x6c\xfb\xb2" + "\x07\x04\xf4\xec\x0b\xb9\x20\xba\x86\xc3", + "\x3e\x05\xf1\xec\xd9\x67\x33\xb7\x99\x50\xa3\xe3\x14\xd3\xd9\x34", + "\x08\xcf\x61\xc9\xc3\x80", "\xcd\x4a\x37\x9b\xc4\x8b", 1, 48 }, + { 128, 256, 47, + "\xa3\x84\x7f\x2d\xad\xd4\x76\x47\xde\x32\x1c\xec\x4a\xc4\x30\xf6\x20\x23\x85\x6c\xfb\xb2" + "\x07\x04\xf4\xec\x0b\xb9\x20\xba\x86\xc3", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x08\xcf\x61\xc9\xc3\x80", "\x23\x46\x9f\xcd\x94\xd4", 1, 48 }, + { 128, 256, 48, + "\xa3\x84\x7f\x2d\xad\xd4\x76\x47\xde\x32\x1c\xec\x4a\xc4\x30\xf6\x20\x23\x85\x6c\xfb\xb2" + "\x07\x04\xf4\xec\x0b\xb9\x20\xba\x86\xc3", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x08\xcf\x61\xc9\xc3\x80", "\xba\xf1\x73\xa1\x57\x58", 1, 48 }, + { 128, 256, 49, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x3e\x05\xf1\xec\xd9\x67\x33\xb7\x99\x50\xa3\xe3\x14\xd3\xd9\x34", + "\x08\xcf\x61\xc9\xc3\x80", "\xed\x78\x21\x2b\x90\xa3", 1, 48 }, + { 128, 256, 50, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x08\xcf\x61\xc9\xc3\x80", "\x61\x05\x0c\x66\x59\x63", 1, 48 }, + { 128, 256, 51, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x3e\x05\xf1\xec\xd9\x67\x33\xb7\x99\x50\xa3\xe3\x14\xd3\xd9\x34", + "\x08\xcf\x61\xc9\xc3\x80", "\x92\x9a\xd1\x31\x54\x33", 1, 48 }, + { 128, 256, 52, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x08\xcf\x61\xc9\xc3\x80", "\x38\xb9\x68\x32\xd3\x90", 1, 48 }, + { 128, 256, 53, + "\xf7\x5e\xa0\xf2\x10\xa8\xf6\x05\x94\x01\xbe\xb4\xbc\x44\x78\xfa\x49\x69\xe6\x23\xd0\x1a" + "\xda\x69\x6a\x7e\x4c\x7e\x51\x25\xb3\x48", + "\x84\x53\x3a\x94\xfb\x31\x99\x90\x32\x57\x44\xee\x9b\xbc\xe9\xe5", + "\x02\x87\x61\x7c\x13\x62\x9e", "\xbf\xc8\x9e\x4c\xcf\x93\x3e", 1, 56 }, + { 128, 256, 54, + "\xf7\x5e\xa0\xf2\x10\xa8\xf6\x05\x94\x01\xbe\xb4\xbc\x44\x78\xfa\x49\x69\xe6\x23\xd0\x1a" + "\xda\x69\x6a\x7e\x4c\x7e\x51\x25\xb3\x48", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x02\x87\x61\x7c\x13\x62\x9e", "\x90\xfb\x35\x72\xf3\x45\x99", 1, 56 }, + { 128, 256, 55, + "\xf7\x5e\xa0\xf2\x10\xa8\xf6\x05\x94\x01\xbe\xb4\xbc\x44\x78\xfa\x49\x69\xe6\x23\xd0\x1a" + "\xda\x69\x6a\x7e\x4c\x7e\x51\x25\xb3\x48", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x02\x87\x61\x7c\x13\x62\x9e", "\x0c\xbc\x6e\x7c\x67\xa7\x49", 1, 56 }, + { 128, 256, 56, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x84\x53\x3a\x94\xfb\x31\x99\x90\x32\x57\x44\xee\x9b\xbc\xe9\xe5", + "\x02\x87\x61\x7c\x13\x62\x9e", "\xd6\xb0\xe9\xb6\x89\x0c\xd0", 1, 56 }, + { 128, 256, 57, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x02\x87\x61\x7c\x13\x62\x9e", "\x6b\x4d\x0c\xd3\x89\x81\x29", 1, 56 }, + { 128, 256, 58, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x84\x53\x3a\x94\xfb\x31\x99\x90\x32\x57\x44\xee\x9b\xbc\xe9\xe5", + "\x02\x87\x61\x7c\x13\x62\x9e", "\xe2\xfe\x73\x01\x6a\xfe\x53", 1, 56 }, + { 128, 256, 59, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x02\x87\x61\x7c\x13\x62\x9e", "\x32\xf1\x68\x87\x03\x72\x8c", 1, 56 }, + { 128, 256, 60, + "\x25\xcf\x08\xf5\xe9\xe2\x5e\x53\x60\xaa\xd2\xb2\xd0\x85\xfa\x54\xd8\x35\xe8\xd4\x66\x82" + "\x64\x98\xd9\xa8\x87\x75\x65\x70\x5a\x8a", + "\x3f\x62\x80\x29\x44\xde\x7c\xa5\x89\x4e\x57\x59\xd3\x51\xad\xac", + "\x01\x4d\xf0\x00\x10\x8b\x67\xcf", "\x34\x6c\xaa\xc1\xa3\x38\xad\x4e", 1, 64 }, + { 128, 256, 61, + "\x25\xcf\x08\xf5\xe9\xe2\x5e\x53\x60\xaa\xd2\xb2\xd0\x85\xfa\x54\xd8\x35\xe8\xd4\x66\x82" + "\x64\x98\xd9\xa8\x87\x75\x65\x70\x5a\x8a", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x4d\xf0\x00\x10\x8b\x67\xcf", "\x11\x9b\x07\x7a\x35\x62\xb7\x71", 1, 64 }, + { 128, 256, 62, + "\x25\xcf\x08\xf5\xe9\xe2\x5e\x53\x60\xaa\xd2\xb2\xd0\x85\xfa\x54\xd8\x35\xe8\xd4\x66\x82" + "\x64\x98\xd9\xa8\x87\x75\x65\x70\x5a\x8a", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x01\x4d\xf0\x00\x10\x8b\x67\xcf", "\x6a\xd5\xae\xcf\x9a\xb0\xa7\x9f", 1, 64 }, + { 128, 256, 63, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x3f\x62\x80\x29\x44\xde\x7c\xa5\x89\x4e\x57\x59\xd3\x51\xad\xac", + "\x01\x4d\xf0\x00\x10\x8b\x67\xcf", "\x01\xcb\x4f\x84\x1a\xdd\x1e\x20", 1, 64 }, + { 128, 256, 64, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x01\x4d\xf0\x00\x10\x8b\x67\xcf", "\x68\x87\x9d\xaf\x8a\x68\xd0\xe2", 1, 64 }, + { 128, 256, 65, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x3f\x62\x80\x29\x44\xde\x7c\xa5\x89\x4e\x57\x59\xd3\x51\xad\xac", + "\x01\x4d\xf0\x00\x10\x8b\x67\xcf", "\xa3\x4a\x7d\xdc\xb2\x9d\xab\xf3", 1, 64 }, + { 128, 256, 66, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x01\x4d\xf0\x00\x10\x8b\x67\xcf", "\x31\x3b\xf9\xfb\x00\x9b\x75\x9b", 1, 64 }, + { 128, 256, 67, + "\x86\x95\x80\xec\x17\xe4\x85\xf1\x8c\x0c\x66\xf1\x7c\xc0\x7c\xbb\x22\xfc\xe4\x66\xda\x61" + "\x0b\x63\xaf\x62\xbc\x83\xb4\x69\x2f\x3a", + "\xff\xaf\x27\x16\x93\xac\x07\x1f\xb8\x6d\x11\x34\x2d\x8d\xef\x4f", + "\x0d\xd8\xfd\x8b\x16\xc2\xa1\xa4\xe3", "\xcd\x39\xb4\x9c\xdf\x0c\x8a\xae\x75", 1, 72 }, + { 128, 256, 68, + "\x86\x95\x80\xec\x17\xe4\x85\xf1\x8c\x0c\x66\xf1\x7c\xc0\x7c\xbb\x22\xfc\xe4\x66\xda\x61" + "\x0b\x63\xaf\x62\xbc\x83\xb4\x69\x2f\x3a", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x0d\xd8\xfd\x8b\x16\xc2\xa1\xa4\xe3", "\x09\xe6\xdb\x40\x1a\x5d\xf1\xbc\x3a", 1, 72 }, + { 128, 256, 69, + "\x86\x95\x80\xec\x17\xe4\x85\xf1\x8c\x0c\x66\xf1\x7c\xc0\x7c\xbb\x22\xfc\xe4\x66\xda\x61" + "\x0b\x63\xaf\x62\xbc\x83\xb4\x69\x2f\x3a", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x0d\xd8\xfd\x8b\x16\xc2\xa1\xa4\xe3", "\x13\xdb\x04\xcc\xdb\xd5\x09\x2e\xf9", 1, 72 }, + { 128, 256, 70, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\xff\xaf\x27\x16\x93\xac\x07\x1f\xb8\x6d\x11\x34\x2d\x8d\xef\x4f", + "\x0d\xd8\xfd\x8b\x16\xc2\xa1\xa4\xe3", "\xfa\x27\x86\x2d\x1b\x12\x7d\x2f\x8b", 1, 72 }, + { 128, 256, 71, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x0d\xd8\xfd\x8b\x16\xc2\xa1\xa4\xe3", "\x64\x12\x90\x24\x8c\x21\x16\x89\x52", 1, 72 }, + { 128, 256, 72, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xaf\x27\x16\x93\xac\x07\x1f\xb8\x6d\x11\x34\x2d\x8d\xef\x4f", + "\x0d\xd8\xfd\x8b\x16\xc2\xa1\xa4\xe3", "\x7a\x88\x66\xab\x26\xbc\xff\x20\xb1", 1, 72 }, + { 128, 256, 73, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x0d\xd8\xfd\x8b\x16\xc2\xa1\xa4\xe3", "\x3d\xae\xf4\x70\x06\xd2\xb3\xf0\xa8", 1, 72 }, + { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } +}; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 5c98c0dd..c1623f0d 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj zuc_eea3_256.json.obj kasumi_f8.json.obj kasumi_f9.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj zuc_eea3_256.json.obj kasumi_f8.json.obj kasumi_f9.json.obj snow_v_test.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) -- GitLab From 49676a8d9992759cb4b3b5aacc9a8a19d488d5e0 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 27 Oct 2023 16:56:58 +0100 Subject: [PATCH 179/204] [doc] add INSTALL.md file and move README.md contents --- INSTALL.md | 295 ++++++++++++++++++++++++++++++++++++++ README.md | 402 +++------------------------------------------------- SECURITY.md | 98 ++++++++++++- 3 files changed, 408 insertions(+), 387 deletions(-) create mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 00000000..fd2cc010 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,295 @@ +# Building and installing the library + +## Contents + +1. [Compilation](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#compilation) +2. [Installation](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) + +## Compilation + +### Linux (64-bit only) + +Required tools: +- GNU make +- NASM version 2.14 (or newer) +- gcc (GCC) 4.8.3 (or newer) + +Shared library: +`> make` + +Static library: +`> make SHARED=n` + +Clean the build: +`> make clean` +or +`> make clean SHARED=n` + +Build with debugging information: +`> make DEBUG=y` + +Build with AESNI emulation support (disabled by default): +`> make AESNI_EMU=y` + +**Note:** Building with debugging information is not advised for production use. + +For more build options and their explanation run: +`> make help` + +### Windows MSVS (x64 only) + +Required tools: +- Microsoft (R) Visual Studio 2019: + - NMAKE: Microsoft (R) Program Maintenance Utility Version 14.29.30148.0 + - CL: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30148 for x64 + - LIB: Microsoft (R) Library Manager Version 14.29.30148.0 + - LINK: Microsoft (R) Incremental Linker Version 14.29.30148.0 + - Note: Building on later versions should work but is not verified +- NASM version 2.14 (or newer) + +Shared library (DLL): +`> nmake /f win_x64.mak` + +Static library: +`> nmake /f win_x64.mak SHARED=n` + +Clean the build: +`> nmake /f win_x64.mak clean` +or +`> nmake /f win_x64.mak clean SHARED=n` + +Build without safety features: +- SAFE_DATA clears sensitive information stored temporarily on stack, registers or internal data structures +- SAFE_PARAM adds extra checks on input parameters +- SAFE_LOOKUP uses constant-time lookups (enabled by default) +- SAFE_OPTIONS additional option to disable all safe options. Enabled by default. + Disable to turn off: SAFE_DATA, SAFE_PARAM and SAFE_LOOKUP. + +`> nmake /f win_x64.mak SAFE_DATA=n SAFE_PARAM=n` +`> nmake /f win_x64.mak SAFE_OPTIONS=n` + +Build with debugging information: +`> nmake /f win_x64.mak DEBUG=y` + +Build with AESNI emulation support (disabled by default): +`> nmake /f win_x64.mak AESNI_EMU=y` + +**Note:** Building with debugging information is not advised for production use. + +For more build options and their explanation run: +`> nmake /f win_x64.mak help` + +### Windows Mingw-w64 (64-bit only) + +Required tools: +- GNU mingw32-make.exe +- NASM version 2.14 (or newer) +- gcc (GCC) 10.3.0 (or newer) + +Shared library: +`> mingw32-make.exe` + +Static library: +`> mingw32-make.exe SHARED=n` + +Clean the build: +`> mingw32-make.exe clean` +or +`> mingw32-make.exe clean SHARED=n` + +Build with debugging information: +`> mingw32-make.exe DEBUG=y` + +**Note:** Building with debugging information is not advised for production use. + +For more build options and their explanation run: +`> mingw32-make.exe help` + +### FreeBSD (64-bit only) + +Required tools: +- GNU make +- NASM version 2.14 (or newer) +- gcc (GCC) 4.8.3 (or newer) / clang 5.0 (or newer) + +Shared library: +`> gmake` + +Static library: +`> gmake SHARED=n` + +Clean the build: +`> gmake clean` +or +`> gmake clean SHARED=n` + +Build with debugging information: +`> gmake DEBUG=y` + +**Note:** Building with debugging information is not advised for production use. + +For more build options and their explanation run: +`> gmake help` + +### Building with CMake (experimental) + +Minimum CMake version: 3.16 + +Create build directory: +``` +mkdir build +cd build +``` + +#### Unix Makefiles (Linux and FreeBSD) + +Shared library (default): +``` +cmake .. +cmake --build . --parallel +``` + +Static library: +``` +cmake -DBUILD_SHARED_LIBS=OFF .. +cmake --build . --parallel +``` + +Debug build: +``` +cmake -DCMAKE_BUILD_TYPE=Debug .. +cmake --build . --parallel +``` + +For more build options and their explanation run: +`cmake --build . --target print_help` + +#### Windows MSVS (x64 only) + +Shared library with debugging information (default for MSVS) +``` +cmake -Ax64 .. +cmake --build . +``` + +Release build: +``` +cmake -Ax64 .. +cmake --build . --config Release +``` + +Static library: +``` +cmake -Ax64 -DBUILD_SHARED_LIBS=OFF .. +cmake --build . --config Release +``` + +For more build options and their explanation run: +`cmake --build . --target print_help` + +#### Ninja (Linux, FreeBSD and Windows): +``` +cmake -G Ninja .. +cmake --build . +``` + +For more build options and their explanation run: +``` +cmake --build . --target print_help +``` + +Library and applications can be found in: +``` +build/lib +build/test +build/perf +``` +## Installation + +### Linux (64-bit only) + +First compile the library and then install: +`> make` +`> sudo make install` + +To uninstall the library run: +`> sudo make uninstall` + +If you want to change install location then define PREFIX: +`> sudo make install PREFIX=` + +If there is no need to run ldconfig at install stage please use NOLDCONFIG=y option: +`> sudo make install NOLDCONFIG=y` + +If library was compiled as an archive (not a default option) then install it using SHARED=n option: +`> sudo make install SHARED=n` + +### Windows (x64 only) + +First compile the library and then install from a command prompt in administrator mode: +`> nmake /f win_x64.mak` +`> nmake /f win_x64.mak install` + +To uninstall the library run: +`> nmake /f win_x64.mak uninstall` + +If you want to change install location then define PREFIX (default C:\Program Files): +`> nmake /f win_x64.mak install PREFIX=` + +If library was compiled as a static library (not a default option) then install it using SHARED=n option: +`> nmake /f win_x64.mak install SHARED=n` + +### FreeBSD (64-bit only) + +First compile the library and then install: +`> gmake` +`> sudo gmake install` + +To uninstall the library run: +`> sudo gmake uninstall` + +If you want to change install location then define PREFIX: +`> sudo gmake install PREFIX=` + +If there is no need to run ldconfig at install stage please use NOLDCONFIG=y option: +`> sudo gmake install NOLDCONFIG=y` + +If library was compiled as an archive (not a default option) then install it using SHARED=n option: +`> sudo gmake install SHARED=n` + +## Installing with CMake (experimental) + +### Unix (Linux and FreeBSD) + +First compile the library and then install: +``` +cmake --build . +sudo cmake --install . +``` + +To uninstall the library run: +`sudo cmake --build . --target uninstall` + +If you want to change install location then define PREFIX: +`sudo cmake --install . --prefix=` + +Or set install directory variables during configuration: +``` +cmake -DLIB_INSTALL_DIR=/usr/lib64 -DINCLUDE_INSTALL_DIR=/usr/include .. +cmake --build . --parallel +sudo cmake --install . +``` + +### Windows (x64 only) + +First compile the library and then install from a command prompt in administrator mode: +``` +cmake --build . --config Release +cmake --install . --config Release +``` + +To uninstall the library run: +`cmake --build . --target uninstall` + +If you want to change install location then define PREFIX (default C:\Program Files): +`cmake --install . --config Release --prefix=` diff --git a/README.md b/README.md index 306064bf..5d8d8239 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ Key differentiating features: 4. Package Content 5. Documentation 6. Compilation -7. Security Considerations & Options for Increased Security -8. Installation +7. Installation +8. Security Considerations & Options for Increased Security 9. Backwards compatibility 10. Disclaimer (ZUC, KASUMI, SNOW3G) 11. Legal Disclaimer @@ -291,16 +291,20 @@ security updates. - test - Library test applications - perf - Library performance application - lib - Library source files -- lib/sse - Intel(R) SSE optimized routines -- lib/avx - Intel(R) AVX optimized routines -- lib/avx2 - Intel(R) AVX2 optimized routines -- lib/avx512 - Intel(R) AVX512 optimized routines +- lib/x86_64 - Non-SIMD routines +- lib/sse_* - Intel(R) SSE optimized routines +- lib/avx_* - Intel(R) AVX optimized routines +- lib/avx2_* - Intel(R) AVX2 optimized routines +- lib/avx512_* - Intel(R) AVX512 optimized routines - lib/no-aesni - Non-AESNI accelerated routines - lib/aarch64 - aarch64 NEON optimized routines **Note:** There is just one branch used in the project. All development is done on the main branch. -Code taken from the tip of the main branch should not be considered fit for production. +Code taken from the tip of the main branch should not be considered fit for production. + +Refer to the releases tab for stable code versions: +https://github.com/intel/intel-ipsec-mb/releases ## 5. Documentation @@ -311,389 +315,15 @@ To generate documentation locally, run: ## 6. Compilation -### Linux (64-bit only) - -Required tools: -- GNU make -- NASM version 2.14 (or newer) -- gcc (GCC) 11.1.0 (or newer) - -Shared library: -`> make` - -Static library: -`> make SHARED=n` - -Clean the build: -`> make clean` -or -`> make clean SHARED=n` - -Build with debugging information: -`> make DEBUG=y` - -Build with AESNI emulation support (disabled by default): -`> make AESNI_EMU=y` - -**Note:** Building with debugging information is not advised for production use. - -For more build options and their explanation run: -`> make help` - -### Windows MSVS (x64 only) - -Required tools: -- Microsoft (R) Visual Studio 2019: - - NMAKE: Microsoft (R) Program Maintenance Utility Version 14.29.30148.0 - - CL: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30148 for x64 - - LIB: Microsoft (R) Library Manager Version 14.29.30148.0 - - LINK: Microsoft (R) Incremental Linker Version 14.29.30148.0 - - Note: Building on later versions should work but is not verified -- NASM version 2.14 (or newer) - -Shared library (DLL): -`> nmake /f win_x64.mak` - -Static library: -`> nmake /f win_x64.mak SHARED=n` - -Clean the build: -`> nmake /f win_x64.mak clean` -or -`> nmake /f win_x64.mak clean SHARED=n` - -Build without safety features: -- SAFE_DATA clears sensitive information stored temporarily on stack, registers or internal data structures -- SAFE_PARAM adds extra checks on input parameters -- SAFE_LOOKUP uses constant-time lookups (enabled by default) -- SAFE_OPTIONS additional option to disable all safe options. Enabled by default. - Disable to turn off: SAFE_DATA, SAFE_PARAM and SAFE_LOOKUP. - -`> nmake /f win_x64.mak SAFE_DATA=n SAFE_PARAM=n` -`> nmake /f win_x64.mak SAFE_OPTIONS=n` - -Build with debugging information: -`> nmake /f win_x64.mak DEBUG=y` - -Build with AESNI emulation support (disabled by default): -`> nmake /f win_x64.mak AESNI_EMU=y` - -**Note:** Building with debugging information is not advised for production use. - -For more build options and their explanation run: -`> nmake /f win_x64.mak help` - -### Windows Mingw-w64 (64-bit only) - -Required tools: -- GNU mingw32-make.exe -- NASM version 2.14 (or newer) -- gcc (GCC) 10.3.0 (or newer) - -Shared library: -`> mingw32-make.exe` - -Static library: -`> mingw32-make.exe SHARED=n` - -Clean the build: -`> mingw32-make.exe clean` -or -`> mingw32-make.exe clean SHARED=n` - -Build with debugging information: -`> mingw32-make.exe DEBUG=y` - -**Note:** Building with debugging information is not advised for production use. - -For more build options and their explanation run: -`> mingw32-make.exe help` - -### FreeBSD (64-bit only) - -Required tools: -- GNU make -- NASM version 2.14 (or newer) -- gcc (GCC) 11.1.0 (or newer) / clang 11.0.0 (or newer) - -Shared library: -`> gmake` - -Static library: -`> gmake SHARED=n` - -Clean the build: -`> gmake clean` -or -`> gmake clean SHARED=n` - -Build with debugging information: -`> gmake DEBUG=y` - -**Note:** Building with debugging information is not advised for production use. - -For more build options and their explanation run: -`> gmake help` - -### Building with CMake (experimental) - -Minimum CMake version: 3.16 - -Create build directory: -``` -mkdir build -cd build -``` - -#### Unix Makefiles (Linux and FreeBSD) - -Shared library (default): -``` -cmake .. -cmake --build . --parallel -``` - -Static library: -``` -cmake -DBUILD_SHARED_LIBS=OFF .. -cmake --build . --parallel -``` - -Debug build: -``` -cmake -DCMAKE_BUILD_TYPE=Debug .. -cmake --build . --parallel -``` - -For more build options and their explanation run: -`cmake --build . --target print_help` - -#### Windows MSVS (x64 only) +Refer to the compilation section of the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#compilation) file for instructions. -Shared library with debugging information (default for MSVS) -``` -cmake -Ax64 .. -cmake --build . -``` - -Release build: -``` -cmake -Ax64 .. -cmake --build . --config Release -``` - -Static library: -``` -cmake -Ax64 -DBUILD_SHARED_LIBS=OFF .. -cmake --build . --config Release -``` - -For more build options and their explanation run: -`cmake --build . --target print_help` - -#### Ninja (Linux, FreeBSD and Windows): -``` -cmake -G Ninja .. -cmake --build . -``` - -For more build options and their explanation run: -``` -cmake --build . --target print_help -``` - -Library and applications can be found in: -``` -build/lib -build/test -build/perf -``` - -## 7. Security Considerations & Options for Increased Security - -### Security Considerations -The security of a system that uses cryptography depends on the strength of -the cryptographic algorithms as well as the strength of the keys. -Cryptographic key strength is dependent on several factors, with some of the -most important factors including the length of the key, the entropy of the key -bits, and maintaining the secrecy of the key. - -The selection of an appropriate algorithm and mode of operation critically -affects the security of a system. Appropriate selection criteria is beyond the -scope of this document and should be determined based upon usage, appropriate -standards and consultation with a cryptographic expert. This library includes some -algorithms, which are considered cryptographically weak and are included only -for legacy and interoperability reasons. See the "Recommendations" section for -more details. - -Secure creation of key material is not a part of this library. This library -assumes that cryptographic keys have been created using approved methods with -an appropriate and secure entropy source. Users of this library are -referred to NIST SP800-133 Revision 1, Recommendation for Cryptographic Key -Generation, found at https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-133r1.pdf - -Even with the use of strong cryptographic algorithms and robustly generated -keys, software implementations of cryptographic algorithms may be attacked -at the implementation through cache-timing attacks, buffer-over-reads, and -other software vulnerabilities. Counter-measures against these types of -attacks are possible but require additional processing cycles. Whether a -particular system should provide such counter-measures depends on the threats -to that system, and cannot be determined by a general library such as this -one. In order to provide the most flexible implementation, this library allows -certain counter-measures to be enabled or disabled at compile time. These -options are listed below as the "Options for Increased Security" and are -enabled through various build flags. - -### Options for Increased Security - -There are three build options that are used to increase safety in -the code and help protect external functions from incorrect input data. -The SAFE_DATA, SAFE_PARAM and SAFE_LOOKUP options are enabled by default. -Due to the potential performance impact associated to the extra code, these -can be disabled by setting the parameter equal to "n" (e.g. make SAFE_LOOKUP=n). - -No specific code has been added, and no specific validation or security -tests have been performed to help protect against or check for side-channel -attacks. - -### SAFE_DATA - -Stack and registers containing sensitive information, such as keys or IVs, are -cleared upon completion of a function call. - -### SAFE_PARAM - -Input parameters are checked, looking generally for NULL pointers or an -incorrect input length. - -### SAFE_LOOKUP - -Lookups which depend on sensitive information are implemented with constant -time functions. - -Algorithms where these constant time functions are used are the following: -- AESNI emulation -- DES: SSE, AVX and AVX2 implementations -- KASUMI: all architectures -- SNOW3G: all architectures - -If SAFE_LOOKUP is not enabled in the build (e.g. make SAFE_LOOKUP=n) then the -algorithms listed above may be susceptible to timing attacks which could expose -the cryptographic key. - -### SAFE_OPTIONS - -SAFE_OPTIONS is a parameter that can be used to disable/enable -all supported safe options (i.e. SAFE_DATA, SAFE_PARAM, SAFE_LOOKUP). -It is set to `y` by default and all safe options are enabled. -`SAFE_OPTIONS=n` disables all safe options. - -### Security API - -**Force clearing/zeroing of memory** -```c -IMB_DLL_EXPORT void imb_clear_mem(void *mem, const size_t size); -``` -To assist in clearing sensitive application data such as keys, plaintext etc. -the library provides the `imb_clear_mem()` API. This API zeros _'size'_ bytes -of memory pointed to by _'mem'_ followed by the _sfence_ instruction to -ensure memory is cleared before the function returns. - -### Galois Counter Mode (GCM) TAG Size - -The library GCM and GMAC implementation provides flexibility as to tag size selection. -As explained in [NIST Special Publication 800-38D](https://csrc.nist.gov/publications/detail/sp/800-38d/final) section 5.2.1.2 and Appendix C, using tag sizes shorter than 96 bits can be insecure. -Please refer to the aforementioned sections to understand the details, trade offs and mitigations of using shorter tag sizes. - -## 8. Installation - -### Linux (64-bit only) - -First compile the library and then install: -`> make` -`> sudo make install` - -To uninstall the library run: -`> sudo make uninstall` - -If you want to change install location then define PREFIX: -`> sudo make install PREFIX=` +## 7. Installation -If there is no need to run ldconfig at install stage please use NOLDCONFIG=y option: -`> sudo make install NOLDCONFIG=y` - -If library was compiled as an archive (not a default option) then install it using SHARED=n option: -`> sudo make install SHARED=n` - -### Windows (x64 only) - -First compile the library and then install from a command prompt in administrator mode: -`> nmake /f win_x64.mak` -`> nmake /f win_x64.mak install` - -To uninstall the library run: -`> nmake /f win_x64.mak uninstall` - -If you want to change install location then define PREFIX (default C:\Program Files): -`> nmake /f win_x64.mak install PREFIX=` - -If library was compiled as a static library (not a default option) then install it using SHARED=n option: -`> nmake /f win_x64.mak install SHARED=n` - -### FreeBSD (64-bit only) - -First compile the library and then install: -`> gmake` -`> sudo gmake install` - -To uninstall the library run: -`> sudo gmake uninstall` - -If you want to change install location then define PREFIX: -`> sudo gmake install PREFIX=` - -If there is no need to run ldconfig at install stage please use NOLDCONFIG=y option: -`> sudo gmake install NOLDCONFIG=y` - -If library was compiled as an archive (not a default option) then install it using SHARED=n option: -`> sudo gmake install SHARED=n` - -## Installing with CMake (experimental) - -### Unix (Linux and FreeBSD) - -First compile the library and then install: -``` -cmake --build . -sudo cmake --install . -``` - -To uninstall the library run: -`sudo cmake --build . --target uninstall` - -If you want to change install location then define PREFIX: -`sudo cmake --install . --prefix=` - -Or set install directory variables during configuration: -``` -cmake -DLIB_INSTALL_DIR=/usr/lib64 -DINCLUDE_INSTALL_DIR=/usr/include .. -cmake --build . --parallel -sudo cmake --install . -``` - -### Windows (x64 only) - -First compile the library and then install from a command prompt in administrator mode: -``` -cmake --build . --config Release -cmake --install . --config Release -``` +Refer to the installation section of the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) file for instructions. -To uninstall the library run: -`cmake --build . --target uninstall` +## 8. Security Considerations & Options for Increased Security -If you want to change install location then define PREFIX (default C:\Program Files): -`cmake --install . --config Release --prefix=` +Refer to the [SECURITY](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#security-considerations--options-for-increased-security) file for security related information. ## 9. Backwards compatibility diff --git a/SECURITY.md b/SECURITY.md index db6fcc95..bfbfac09 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,5 +1,11 @@ # Security Policy +## Overview + +1. [Supported Versions](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#supported-versions) +2. [Reporting a Vulnerability](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#reporting-a-vulnerability) +3. [Security Considerations & Options for Increased Security](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#security-considerations--options-for-increased-security) + ## Supported Versions Versions of the library that are currently being supported with security updates. @@ -23,6 +29,96 @@ Timeline for providing an update depends on development complexity. ## Security Considerations & Options for Increased Security -Please refer to [Section of README](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb#7-security-considerations--options-for-increased-security) for the details on this topic. +### Security Considerations +The security of a system that uses cryptography depends on the strength of +the cryptographic algorithms as well as the strength of the keys. +Cryptographic key strength is dependent on several factors, with some of the +most important factors including the length of the key, the entropy of the key +bits, and maintaining the secrecy of the key. + +The selection of an appropriate algorithm and mode of operation critically +affects the security of a system. Appropriate selection criteria is beyond the +scope of this document and should be determined based upon usage, appropriate +standards and consultation with a cryptographic expert. This library includes some +algorithms, which are considered cryptographically weak and are included only +for legacy and interoperability reasons. See the "Recommendations" section for +more details. + +Secure creation of key material is not a part of this library. This library +assumes that cryptographic keys have been created using approved methods with +an appropriate and secure entropy source. Users of this library are +referred to NIST SP800-133 Revision 1, Recommendation for Cryptographic Key +Generation, found at https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-133r1.pdf + +Even with the use of strong cryptographic algorithms and robustly generated +keys, software implementations of cryptographic algorithms may be attacked +at the implementation through cache-timing attacks, buffer-over-reads, and +other software vulnerabilities. Counter-measures against these types of +attacks are possible but require additional processing cycles. Whether a +particular system should provide such counter-measures depends on the threats +to that system, and cannot be determined by a general library such as this +one. In order to provide the most flexible implementation, this library allows +certain counter-measures to be enabled or disabled at compile time. These +options are listed below as the "Options for Increased Security" and are +enabled through various build flags. + +### Options for Increased Security + +There are three build options that are used to increase safety in +the code and help protect external functions from incorrect input data. +The SAFE_DATA, SAFE_PARAM and SAFE_LOOKUP options are enabled by default. +Due to the potential performance impact associated to the extra code, these +can be disabled by setting the parameter equal to "n" (e.g. make SAFE_LOOKUP=n). + +No specific code has been added, and no specific validation or security +tests have been performed to help protect against or check for side-channel +attacks. + +### SAFE_DATA + +Stack and registers containing sensitive information, such as keys or IVs, are +cleared upon completion of a function call. + +### SAFE_PARAM + +Input parameters are checked, looking generally for NULL pointers or an +incorrect input length. + +### SAFE_LOOKUP + +Lookups which depend on sensitive information are implemented with constant +time functions. + +Algorithms where these constant time functions are used are the following: +- AESNI emulation +- DES: SSE, AVX and AVX2 implementations +- KASUMI: all architectures +- SNOW3G: all architectures + +If SAFE_LOOKUP is not enabled in the build (e.g. make SAFE_LOOKUP=n) then the +algorithms listed above may be susceptible to timing attacks which could expose +the cryptographic key. + +### SAFE_OPTIONS + +SAFE_OPTIONS is a parameter that can be used to disable/enable +all supported safe options (i.e. SAFE_DATA, SAFE_PARAM, SAFE_LOOKUP). +It is set to `y` by default and all safe options are enabled. +`SAFE_OPTIONS=n` disables all safe options. + +### Security API + +**Force clearing/zeroing of memory** +```c +IMB_DLL_EXPORT void imb_clear_mem(void *mem, const size_t size); +``` +To assist in clearing sensitive application data such as keys, plaintext etc. +the library provides the `imb_clear_mem()` API. This API zeros _'size'_ bytes +of memory pointed to by _'mem'_ followed by the _sfence_ instruction to +ensure memory is cleared before the function returns. +### Galois Counter Mode (GCM) TAG Size +The library GCM and GMAC implementation provides flexibility as to tag size selection. +As explained in [NIST Special Publication 800-38D](https://csrc.nist.gov/publications/detail/sp/800-38d/final) section 5.2.1.2 and Appendix C, using tag sizes shorter than 96 bits can be insecure. +Please refer to the aforementioned sections to understand the details, trade offs and mitigations of using shorter tag sizes. -- GitLab From d451448612699b0e3b364adc040259d664bc8f8f Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 27 Oct 2023 16:57:28 +0100 Subject: [PATCH 180/204] test: [doc] update installation link --- test/README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/README.md b/test/README.md index 4c8475fc..bc0d39c3 100644 --- a/test/README.md +++ b/test/README.md @@ -14,11 +14,5 @@ For instructions to install the library, see the Library Installation section be ## Library Installation -### Linux -- Use standard OS installer to install the "intel-ipsec-mb" package (`apt`, `dnf` etc.) -- Alternatively, install the library from source by following the instructions in the [README](https://github.com/intel/intel-ipsec-mb/#8-installation) - - -### Windows -- Install the library from source following the instructions in the [README](https://github.com/intel/intel-ipsec-mb\#8-installation) - +- On Linux, use standard OS installer to install the "intel-ipsec-mb" package (`apt`, `dnf` etc.) +- Alternatively, build and install the library from source by following the instructions in the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) file. -- GitLab From c643b5373aa89ddab934ef5f1d5566b59a5fa620 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Fri, 27 Oct 2023 16:57:49 +0100 Subject: [PATCH 181/204] perf: [doc] update README --- perf/README | 82 -------------------------------------------------- perf/README.md | 67 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 82 deletions(-) delete mode 100644 perf/README create mode 100644 perf/README.md diff --git a/perf/README b/perf/README deleted file mode 100644 index e3095fca..00000000 --- a/perf/README +++ /dev/null @@ -1,82 +0,0 @@ -======================================================================== -README for Intel(R) Multi-Buffer Crypto for IPsec Library API -performance measurement tool - -February 2017 -======================================================================== - - -Contents -======== - -- Overview -- Files -- Compilation -- Usage -- Legal Disclaimer - - -Overview -======== -This test tool performs multiple execution of functions included in -Intel Multi-Buffer Crypto for IPsec Library. - -Files -===== - -ipsec_perf.c - Tool which produces text formatted output representing - average times of ipsec_mb functions execution. -ipsec_diff_tool.py - Another tool which interprets text data given. - -Compilation -=========== - -Required tools: -- GNU make -- gcc (GCC) 4.8.3 (or newer) - -Simply run "make" to compile the tool. -To clean the build please run "make clean". - -You can point to another directory containing IPSec MB library by setting -LIB_LOC. for ex: - LIB_LOC=../ipsec_mb_lib make - -In order to perform static code analysis or style check you can do: - make cppcheck -or - make style - -Be aware that you will have cppcheck tool installed and checkpatch.pl -script copied into one of the directories listed in $PATH. -You can also set CPPCHECK and/or CHECKPATCH variables if you want give paths -to this tools being placed in different directories. for ex: - CPPCHECK=~/tools/cppcheck make cppcheck - CHECKPATCH=~/scripts/checkpatch.pl make style - -Usage -===== - -You can simply check list of arguments by typing: - ./imb-perf -h - -Usage example: - ./imb-perf -c --no-avx512 --no-gcm -o 24 - -Later you can pass output to ipsec_diff_tool.py for data -analysis: - ./ipsec_diff_tool.py out1.txt out2.txt 5 - -Run ipsec_diff_tool.py -h too see help page. - -Legal Disclaimer -================ - -THIS SOFTWARE IS PROVIDED BY INTEL"AS IS". NO LICENSE, EXPRESS OR -IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS -ARE GRANTED THROUGH USE. EXCEPT AS PROVIDED IN INTEL'S TERMS AND -CONDITIONS OF SALE, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL -DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR -USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO -FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT -OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. diff --git a/perf/README.md b/perf/README.md new file mode 100644 index 00000000..bf9a459c --- /dev/null +++ b/perf/README.md @@ -0,0 +1,67 @@ +# Intel(R) Multi-Buffer Crypto for IPsec Library - Performance Application + +## Contents + +- Overview +- Usage + +## Overview +The performance application is used to measure the performance of all supported algorithms in the Intel(R) Multi-Buffer Crypto for IPsec Library. +The application accepts a user specified algorithm as an input, and outputs the number of CPU cycles taken to process a range of buffer sizes for that algorithm. +By default, all supported architectural implementations (e.g. SSE, AVX, AVX2 & AVX512) are exercised. +The perf directory also contains scripts to add extra functionality to the application, and to post process the results. + +## Usage + +### Performance Application +Before running the application, ensure the library is installed by following the instructions +in the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) file. + +To measure AES-GCM-128 encryption performance for all supported architectural implementations: +`imb-perf --aead-algo aes-gcm-128 --cipher-dir encrypt > file.txt` + +To run AES-CBC-128 decryption 30,000 times on 16kB buffer exercising the AVX512 implementation: +`imb-perf --cipher-algo aes-cbc-128 --cipher-dir decrypt --arch AVX512 --job-size 16384 --job-iter 30000 > file.txt` + +To measure AES-CBC-128 encryption with HMAC-SHA1 using the best available architectural implementation: +`imb-perf --cipher-algo aes-cbc-128 --hash-algo sha1-hmac --arch-best > file.txt` + +To print system and available algorithms: +`imb-perf --print-info` + +For more options: +`imb-perf --help` + +### Post Processing + +The `ipsec_diff_tool.py` can be used to transform the output of the performance application into more human readable formats. + +To compare two result files: +`ipsec_diff_tool.py file_1.txt file_2.txt` + +To display results in the form of a linear equation (slope & intercept): +`ipsec_diff_tool.py -a file_1.txt` + +To pass packet size and clock speed as arguments and calculate throughput in Mbps: + `ipsec_diff_tool.py -t 512 2200 file_1.txt file_2.txt` + +For more information: +`ipsec_perf_tool.py -h` + + +### Running the ipsec_perf_tool.py script + +The performance application supports benchmarking specific algorithms **_only_**. To benchmark multiple algorithms, the `ipsec_perf_tool.py` script should be used. +This acts as a wrapper script around the updated `imb-perf` tool to provide extra functionality while maintaining compatibility with the `ipsec_diff_tool.py` to parse and display results. + +To benchmark all cipher, hash and AEAD algorithms on all available architectures: +`ipsec_perf_tool.py > file.txt` + +To benchmark all cipher algorithms in encrypt direction using SSE and AVX architectures: +`ipsec_perf_tool.py -t cipher-only -d encrypt -a SSE -a AVX > file.txt` + +To benchmark all cipher-hash combinations using AVX512 architecture: +`ipsec_perf_tool.py -t cipher-hash-all -a AVX512 > file.txt` + +To distribute algorithm benchmarks across a range of cores from 2 to 10: +`ipsec_perf_tool.py -c 2-10 > file.txt` -- GitLab From ede61a716622a983283e7ef8de81963c0764f80c Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Fri, 27 Oct 2023 13:29:23 +0100 Subject: [PATCH 182/204] test: [fuzz-app] ignore return value after self-test callback get operation --- test/fuzz-app/direct_api_fuzz_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fuzz-app/direct_api_fuzz_test.c b/test/fuzz-app/direct_api_fuzz_test.c index 35628b78..889ffc84 100644 --- a/test/fuzz-app/direct_api_fuzz_test.c +++ b/test/fuzz-app/direct_api_fuzz_test.c @@ -2355,7 +2355,7 @@ test_imb_self_test_get_cb(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) return -1; } - imb_self_test_get_cb(p_mgr, cb_fn, cb_arg); + (void) imb_self_test_get_cb(p_mgr, cb_fn, cb_arg); free(cb_fn); free(cb_arg); -- GitLab From ae65ac1e23fccf699d5d54055c4e9332222908b1 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 25 Oct 2023 18:21:07 +0100 Subject: [PATCH 183/204] lib: [SM3] fix function description --- lib/include/sm3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/include/sm3.h b/lib/include/sm3.h index 7224ae2c..1783e17e 100644 --- a/lib/include/sm3.h +++ b/lib/include/sm3.h @@ -31,7 +31,7 @@ #define SM3_H /** - * @brief Initializes SM3 hash context structure + * @brief Authenticates message with SM3 hash algorithm * * @param tag pointer to store computed SM3 digest * @param tag_length output tag length in bytes -- GitLab From b1e23b8c2c876aa6c55098d4c2f1adabe9189816 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 25 Oct 2023 22:10:55 +0100 Subject: [PATCH 184/204] test: [KAT] remove unneeded macro --- test/kat-app/hmac_sha1_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/kat-app/hmac_sha1_test.c b/test/kat-app/hmac_sha1_test.c index 21a71157..f9ded978 100644 --- a/test/kat-app/hmac_sha1_test.c +++ b/test/kat-app/hmac_sha1_test.c @@ -38,7 +38,6 @@ int hmac_sha1_test(struct IMB_MGR *mb_mgr); -#define DIGEST96_SIZE 12 #define MAX_BURST_JOBS 32 extern const struct mac_test hmac_sha1_test_kat_json[]; -- GitLab From c622ffcf30153873bc099671307198b725b23d2f Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Wed, 1 Nov 2023 09:14:03 +0000 Subject: [PATCH 185/204] test: [fuzz-app] fix cipher/hash burst algorithm selection --- test/fuzz-app/job_api_fuzz_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/fuzz-app/job_api_fuzz_test.c b/test/fuzz-app/job_api_fuzz_test.c index 528663df..334ad207 100644 --- a/test/fuzz-app/job_api_fuzz_test.c +++ b/test/fuzz-app/job_api_fuzz_test.c @@ -607,6 +607,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) */ if (cipher == 0) cipher = (job->cipher_mode % (IMB_CIPHER_NUM + 1)); + + job->cipher_mode = cipher; + clamp_lengths(job, buffsize); static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); @@ -630,6 +633,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) */ if (hash == 0) hash = (job->hash_alg % (IMB_AUTH_NUM + 1)); + + job->hash_alg = hash; + clamp_lengths(job, buffsize); static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); -- GitLab From c445ef32da20cc16701e5b86ebea1c1d2ced4e41 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Thu, 2 Nov 2023 22:00:24 +0000 Subject: [PATCH 186/204] test: [fuzz-app] setup SGL segments before submission --- test/fuzz-app/job_api_fuzz_test.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/test/fuzz-app/job_api_fuzz_test.c b/test/fuzz-app/job_api_fuzz_test.c index 334ad207..114bc8ee 100644 --- a/test/fuzz-app/job_api_fuzz_test.c +++ b/test/fuzz-app/job_api_fuzz_test.c @@ -36,6 +36,7 @@ #define BUFF_SIZE (32 * 1024 * 1024) #define MAX_BURST_JOBS 32 +#define MAX_SGL_SEGS 32 int LLVMFuzzerTestOneInput(const uint8_t *, size_t); @@ -63,6 +64,20 @@ clamp_lengths(struct IMB_JOB *job, const uint64_t buffsize) job->hash_start_src_offset_in_bytes = buffsize; } +static void +fill_job_sgl_segments(struct IMB_JOB *job, struct IMB_SGL_IOV *sgl_segs, const int num_sgl_segs, + void *buff, const uint64_t buffsize) +{ + for (int i = 0; i < num_sgl_segs; i++) { + sgl_segs->in = buff; + sgl_segs->out = buff; + sgl_segs->len = buffsize; + } + + job->sgl_io_segs = sgl_segs; + job->num_sgl_io_segs = (uint64_t) num_sgl_segs; +} + static void fill_job_data(struct IMB_JOB *job, void *buff) { @@ -81,7 +96,8 @@ fill_job_data(struct IMB_JOB *job, void *buff) } static void -fill_additional_cipher_data(struct IMB_JOB *job, void *buff, const uint64_t buffsize) +fill_additional_cipher_data(struct IMB_JOB *job, struct IMB_SGL_IOV *sgl_segs, + const int num_sgl_segs, void *buff, const uint64_t buffsize) { const IMB_CIPHER_MODE cipherMode = job->cipher_mode; @@ -114,6 +130,7 @@ fill_additional_cipher_data(struct IMB_JOB *job, void *buff, const uint64_t buff job->u.GCM.aad_len_in_bytes = buffsize; if (job->iv_len_in_bytes > buffsize) job->iv_len_in_bytes = buffsize; + fill_job_sgl_segments(job, sgl_segs, num_sgl_segs, buff, buffsize); break; case IMB_CIPHER_CHACHA20_POLY1305: if (job->u.CHACHA20_POLY1305.aad != NULL) @@ -131,6 +148,7 @@ fill_additional_cipher_data(struct IMB_JOB *job, void *buff, const uint64_t buff } if (job->u.CHACHA20_POLY1305.aad_len_in_bytes > buffsize) job->u.CHACHA20_POLY1305.aad_len_in_bytes = buffsize; + fill_job_sgl_segments(job, sgl_segs, num_sgl_segs, buff, buffsize); break; case IMB_CIPHER_SNOW_V_AEAD: if (job->u.SNOW_V_AEAD.aad != NULL) @@ -552,9 +570,10 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) job->cipher_mode = cipher; clamp_lengths(job, buffsize); static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); + static struct IMB_SGL_IOV sgl_segs[MAX_SGL_SEGS]; fill_job_data(job, buff); - fill_additional_cipher_data(job, buff, buffsize); + fill_additional_cipher_data(job, sgl_segs, MAX_SGL_SEGS, buff, buffsize); fill_additional_hash_data(job, buff, buffsize); IMB_SUBMIT_JOB(p_mgr); } @@ -585,9 +604,10 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) job->cipher_mode = cipher; clamp_lengths(job, buffsize); static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); + static struct IMB_SGL_IOV sgl_segs[MAX_SGL_SEGS]; fill_job_data(job, buff); - fill_additional_cipher_data(job, buff, buffsize); + fill_additional_cipher_data(job, sgl_segs, MAX_SGL_SEGS, buff, buffsize); fill_additional_hash_data(job, buff, buffsize); } @@ -612,9 +632,10 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) clamp_lengths(job, buffsize); static DECLARE_ALIGNED(uint8_t buff[2 * BUFF_SIZE], 64); + static struct IMB_SGL_IOV sgl_segs[MAX_SGL_SEGS]; fill_job_data(job, buff); - fill_additional_cipher_data(job, buff, buffsize); + fill_additional_cipher_data(job, sgl_segs, MAX_SGL_SEGS, buff, buffsize); } IMB_SUBMIT_CIPHER_BURST(p_mgr, jobs, num_jobs, cipher, dir, key_len); -- GitLab From a71311ef9509879dc9db10a04a3fa71e0e02327b Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 25 Oct 2023 22:07:05 +0100 Subject: [PATCH 187/204] lib: [SM3-HMAC] add SM3-HMAC enum --- lib/ipsec-mb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index c7813631..9ebb1ec7 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -348,6 +348,7 @@ typedef enum { IMB_AUTH_CRC6_IUUP_HEADER, /**< CRC6-IUUP-HEADER */ IMB_AUTH_GHASH, /**< GHASH */ IMB_AUTH_SM3, /**< SM3 */ + IMB_AUTH_HMAC_SM3, /**< SM3-HMAC */ IMB_AUTH_NUM } IMB_HASH_ALG; -- GitLab From 8c2eda6681cbe6a4f7ab2c45f3ef6f8b7e4c2d7c Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 25 Oct 2023 22:08:33 +0100 Subject: [PATCH 188/204] lib: [SM3-HMAC] support SM3-HMAC in ipad/opad calculation --- lib/include/sm3.h | 8 ++++++++ lib/x86_64/hmac_ipad_opad.c | 13 +++++++++++++ lib/x86_64/sm3.c | 16 ++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/lib/include/sm3.h b/lib/include/sm3.h index 1783e17e..3e3009fc 100644 --- a/lib/include/sm3.h +++ b/lib/include/sm3.h @@ -41,4 +41,12 @@ IMB_DLL_LOCAL void sm3_msg(void *tag, const uint64_t tag_len, const void *msg, const uint64_t msg_length); +/** + * @brief Authenticates one block with SM3 hash algorithm + * + * @param tag pointer to store computed SM3 digest + * @param msg pointer to input block compute digest over + */ +IMB_DLL_LOCAL void +sm3_one_block(void *tag, const void *msg); #endif /* SM3_H */ diff --git a/lib/x86_64/hmac_ipad_opad.c b/lib/x86_64/hmac_ipad_opad.c index 3a90ff06..46f8283a 100644 --- a/lib/x86_64/hmac_ipad_opad.c +++ b/lib/x86_64/hmac_ipad_opad.c @@ -32,6 +32,7 @@ #include #include "include/error.h" +#include "include/sm3.h" IMB_DLL_EXPORT void @@ -89,6 +90,9 @@ imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, const void *pke return; } break; + case IMB_AUTH_HMAC_SM3: + local_key_len = (key_len <= IMB_SM3_BLOCK_SIZE) ? key_len : IMB_SM3_DIGEST_SIZE; + break; default: imb_set_errno(NULL, IMB_ERR_HASH_ALGO); return; @@ -113,6 +117,9 @@ imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, const void *pke case IMB_AUTH_HMAC_SHA_384: IMB_SHA384(mb_mgr, pkey, key_len, key); break; + case IMB_AUTH_HMAC_SM3: + sm3_msg(key, IMB_SM3_DIGEST_SIZE, pkey, key_len); + break; default: /* For SHA-512 */ IMB_SHA512(mb_mgr, pkey, key_len, key); } @@ -138,6 +145,9 @@ imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, const void *pke case IMB_AUTH_HMAC_SHA_512: IMB_SHA512_ONE_BLOCK(mb_mgr, buf, ipad_hash); break; + case IMB_AUTH_HMAC_SM3: + sm3_one_block(ipad_hash, buf); + break; default: /* For MD5*/ IMB_MD5_ONE_BLOCK(mb_mgr, buf, ipad_hash); } @@ -164,6 +174,9 @@ imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, const void *pke case IMB_AUTH_HMAC_SHA_512: IMB_SHA512_ONE_BLOCK(mb_mgr, buf, opad_hash); break; + case IMB_AUTH_HMAC_SM3: + sm3_one_block(opad_hash, buf); + break; default: /* For MD5 */ IMB_MD5_ONE_BLOCK(mb_mgr, buf, opad_hash); } diff --git a/lib/x86_64/sm3.c b/lib/x86_64/sm3.c index 7cc0f43a..9479b771 100644 --- a/lib/x86_64/sm3.c +++ b/lib/x86_64/sm3.c @@ -242,3 +242,19 @@ sm3_msg(void *tag, const uint64_t tag_length, const void *msg, const uint64_t ms clear_mem(block, sizeof(block)); #endif } + +void +sm3_one_block(void *tag, const void *msg) +{ + uint32_t digest[8]; + + sm3_init(digest); + sm3_update(digest, msg, 1); + + memcpy(tag, digest, IMB_SM3_DIGEST_SIZE); + +#ifdef SAFE_DATA + clear_mem(digest, sizeof(digest)); + clear_scratch_xmms_sse(); +#endif +} -- GitLab From e82b320d1fea2e67b69efd4a4713c54e82000ba6 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 26 Oct 2023 09:29:49 +0100 Subject: [PATCH 189/204] lib: [SM3-HMAC] add base implementation --- README.md | 5 ++- ReleaseNotes.txt | 2 +- lib/include/clear_regs_mem.h | 3 ++ lib/include/mb_mgr_job_api.h | 29 ++++++++++++- lib/include/mb_mgr_job_check.h | 15 +++++++ lib/include/sm3.h | 15 +++++++ lib/x86_64/clear_regs_mem_fns.asm | 30 +++++++++++--- lib/x86_64/sm3.c | 67 ++++++++++++++++++++++++++++++- 8 files changed, 153 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5d8d8239..4a64af13 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ Table 2. List of supported integrity algorithms and their implementations. | CRC(6) | N | Y by8 | Y by8 | N | N | Y by16 | N | | PON-CRC-BIP(7) | N | Y | Y | N | N | Y | N | | SM3 | Y | N | N | N | N | N | N | +| HMAC-SM3 | Y | N | N | N | N | N | N | +-----------------------------------------------------------------------------------+ ``` Notes: @@ -208,8 +209,8 @@ Table 3. Encryption and integrity algorithm combinations | AES128-ECB, | ZUC-EIA3, ZUC-EIA3-256, | | AES192-ECB, | SNOW3G-UIA3, | | AES256-ECB, | POLY1305, | -| NULL, | AES128-GMAC, AES192-GMAC, AES256-GMAC, GHASH | -| AES128-DOCSIS,| | +| NULL, | AES128-GMAC, AES192-GMAC, AES256-GMAC, GHASH, | +| AES128-DOCSIS,| SM3, HMAC-SM3 | | AES256-DOCSIS,| | | DES-DOCSIS, | | | 3DES, | | diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 370413d5..2581c7ad 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -9,7 +9,7 @@ Library - AVX2-VAES AES-CTR implementation added. - SM4-ECB SSE implementation added. - SM4-CBC SSE implementation added. -- x86-64 SM3 implementation added. +- x86-64 SM3 and SM3-HMAC implementation added. - Self-Test callback functionality added with message corrupt option. Test Applications diff --git a/lib/include/clear_regs_mem.h b/lib/include/clear_regs_mem.h index 7c90b2a0..d57251cd 100644 --- a/lib/include/clear_regs_mem.h +++ b/lib/include/clear_regs_mem.h @@ -39,6 +39,9 @@ clear_mem(void *mem, const size_t size) force_memset_zero(mem, size); } +void +force_memset_zero_vol(volatile void *mem, const size_t size); + static inline void clear_var(void *var, const size_t size) { diff --git a/lib/include/mb_mgr_job_api.h b/lib/include/mb_mgr_job_api.h index db04b44b..3e49b54a 100644 --- a/lib/include/mb_mgr_job_api.h +++ b/lib/include/mb_mgr_job_api.h @@ -2691,6 +2691,13 @@ SUBMIT_JOB_HASH_EX(IMB_MGR *state, IMB_JOB *job, const IMB_HASH_ALG hash_alg) return SUBMIT_JOB_HMAC_SHA_384(hmac_sha_384_ooo, job); case IMB_AUTH_HMAC_SHA_512: return SUBMIT_JOB_HMAC_SHA_512(hmac_sha_512_ooo, job); + case IMB_AUTH_HMAC_SM3: + sm3_hmac_msg(job->auth_tag_output, job->auth_tag_output_len_in_bytes, + job->src + job->hash_start_src_offset_in_bytes, + job->msg_len_to_hash_in_bytes, job->u.HMAC._hashed_auth_key_xor_ipad, + job->u.HMAC._hashed_auth_key_xor_opad); + job->status |= IMB_STATUS_COMPLETED_AUTH; + return job; case IMB_AUTH_AES_XCBC: return SUBMIT_JOB_AES_XCBC(aes_xcbc_ooo, job); case IMB_AUTH_MD5: @@ -3245,6 +3252,12 @@ submit_hash_sm3(IMB_MGR *state, IMB_JOB *job) return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_SM3); } +static IMB_JOB * +submit_hash_hmac_sm3(IMB_MGR *state, IMB_JOB *job) +{ + return SUBMIT_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SM3); +} + static const submit_flush_fn_t tab_submit_hash[] = { /* [0] invalid entry */ NULL, @@ -3367,12 +3380,15 @@ static const submit_flush_fn_t tab_submit_hash[] = { submit_hash_ghash, /* [47] SM3 */ submit_hash_sm3, + /* [48] HMAC-SM3 */ + submit_hash_hmac_sm3, #else /* __aarch64__ */ - /* [32] - [47] NULL */ + /* [32] - [48] NULL */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, #endif /* __aarch64__ */ /* add new hash algorithms here */ }; @@ -3673,6 +3689,12 @@ flush_hash_sm3(IMB_MGR *state, IMB_JOB *job) return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_SM3); } +static IMB_JOB * +flush_hash_hmac_sm3(IMB_MGR *state, IMB_JOB *job) +{ + return FLUSH_JOB_HASH_EX(state, job, IMB_AUTH_HMAC_SM3); +} + static const submit_flush_fn_t tab_flush_hash[] = { /* [0] invalid entry */ NULL, @@ -3795,12 +3817,15 @@ static const submit_flush_fn_t tab_flush_hash[] = { flush_hash_ghash, /* [47] SM3 */ flush_hash_sm3, + /* [48] HMAC-SM3 */ + flush_hash_hmac_sm3, #else /* __aarch64__ */ - /* [32] - [47] NULL */ + /* [32] - [48] NULL */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, #endif /* __aarch64__ */ /* add new hash algorithms here */ }; diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 3aefdf88..2e47748e 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -172,6 +172,7 @@ is_job_invalid_light(IMB_MGR *state, const IMB_CIPHER_MODE cipher_mode, const IM case IMB_AUTH_HMAC_SHA_256: case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_HMAC_SM3: case IMB_AUTH_AES_XCBC: case IMB_AUTH_NULL: case IMB_AUTH_CRC32_ETHERNET_FCS: @@ -1716,6 +1717,20 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ return 1; } break; + case IMB_AUTH_HMAC_SM3: + if (job->u.HMAC._hashed_auth_key_xor_ipad == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_HMAC_IPAD); + return 1; + } + if (job->u.HMAC._hashed_auth_key_xor_opad == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_HMAC_OPAD); + return 1; + } + if (job->msg_len_to_hash_in_bytes == 0) { + imb_set_errno(state, IMB_ERR_JOB_AUTH_LEN); + return 1; + } + /* Fall-through */ case IMB_AUTH_SM3: if (job->auth_tag_output_len_in_bytes == 0 || job->auth_tag_output_len_in_bytes > IMB_SM3_DIGEST_SIZE) { diff --git a/lib/include/sm3.h b/lib/include/sm3.h index 3e3009fc..ca6e8273 100644 --- a/lib/include/sm3.h +++ b/lib/include/sm3.h @@ -49,4 +49,19 @@ sm3_msg(void *tag, const uint64_t tag_len, const void *msg, const uint64_t msg_l */ IMB_DLL_LOCAL void sm3_one_block(void *tag, const void *msg); + +/** + * @brief Authenticates message with SM3-HMAC hash algorithm + * + * @param tag pointer to store computed SM3 digest + * @param tag_length output tag length in bytes + * @param msg pointer to input message to compute digest over + * @param msg_length length of the message in bytes + * @param ipad_hash block-sized inner padding + * @param opad_hash block-sized outer padding + */ +IMB_DLL_LOCAL void +sm3_hmac_msg(void *tag, const uint64_t tag_len, const void *msg, const uint64_t msg_length, + const void *ipad_hash, const void *opad_hash); + #endif /* SM3_H */ diff --git a/lib/x86_64/clear_regs_mem_fns.asm b/lib/x86_64/clear_regs_mem_fns.asm index 0238b995..9763e996 100644 --- a/lib/x86_64/clear_regs_mem_fns.asm +++ b/lib/x86_64/clear_regs_mem_fns.asm @@ -96,12 +96,7 @@ clear_scratch_zmms: ret -; -; This function clears all memory passed -; -; void force_memset_zero(void *mem, const size_t size) -MKGLOBAL(force_memset_zero,function,internal) -force_memset_zero: +%macro MEMSET_ZERO 0 %ifdef LINUX mov rcx, rsi @@ -117,6 +112,29 @@ force_memset_zero: %ifndef LINUX pop rdi %endif + +%endmacro + +; +; This function clears all memory passed +; +; void force_memset_zero(void *mem, const size_t size) +MKGLOBAL(force_memset_zero,function,internal) +force_memset_zero: + + MEMSET_ZERO + + ret + +; +; This function clears all memory passed (volatile version) +; +; void force_memset_zero(volatile void *mem, const size_t size) +MKGLOBAL(force_memset_zero_vol,function,internal) +force_memset_zero_vol: + + MEMSET_ZERO + ret MKGLOBAL(imb_clear_mem,function,) diff --git a/lib/x86_64/sm3.c b/lib/x86_64/sm3.c index 9479b771..21324e5d 100644 --- a/lib/x86_64/sm3.c +++ b/lib/x86_64/sm3.c @@ -129,7 +129,7 @@ static void sm3_update(uint32_t digest[8], const void *input, uint64_t num_blocks) { const uint32_t *data = (const uint32_t *) input; - uint32_t W[68]; + volatile uint32_t W[68]; while (num_blocks--) { /* prepare W[] - read data first */ @@ -198,7 +198,7 @@ sm3_update(uint32_t digest[8], const void *input, uint64_t num_blocks) } #ifdef SAFE_DATA - clear_mem(W, sizeof(W)); + force_memset_zero_vol(W, sizeof(W)); #endif } @@ -258,3 +258,66 @@ sm3_one_block(void *tag, const void *msg) clear_scratch_xmms_sse(); #endif } + +void +sm3_hmac_msg(void *tag, const uint64_t tag_length, const void *msg, const uint64_t msg_length, + const void *ipad, const void *opad) +{ + uint32_t digest[8]; + uint8_t block[IMB_SM3_BLOCK_SIZE]; + uint32_t *block32 = (uint32_t *) block; + + /* Initialize internal digest with IPAD */ + memcpy(digest, ipad, IMB_SM3_DIGEST_SIZE); + + /* Digest full blocks */ + sm3_update(digest, msg, msg_length / IMB_SM3_BLOCK_SIZE); + + const uint64_t partial_bytes = msg_length % IMB_SM3_BLOCK_SIZE; + const uint8_t *trail = &((const uint8_t *) msg)[msg_length - partial_bytes]; + + /* Prepare last one or two blocks (depending on size of last partial block) */ + memset(block, 0, sizeof(block)); + memcpy(block, trail, partial_bytes); + block[partial_bytes] = 0x80; + + if (partial_bytes >= (IMB_SM3_BLOCK_SIZE - 8)) { + /* + * length field doesn't fit into this block + * - compute digest on the current block + * - clear the block for the length to be put into it next + */ + sm3_update(digest, block, 1); + memset(block, 0, sizeof(block)); + } + + /* Store message length plus block size (from IPAD) at the end of the block */ + store8_be(&block[IMB_SM3_BLOCK_SIZE - 8], + (IMB_SM3_BLOCK_SIZE + msg_length) * 8 /* bit length */); + + sm3_update(digest, block, 1); + + memset(block, 0, sizeof(block)); + for (unsigned i = 0; i < IMB_DIM(digest); i++) + block32[i] = BSWAP32(digest[i]); + + block[IMB_SM3_DIGEST_SIZE] = 0x80; + /* Store length of inner hash plus block size (from OPAD) at the end of the block */ + store8_be(&block[IMB_SM3_BLOCK_SIZE - 8], + (IMB_SM3_BLOCK_SIZE + IMB_SM3_DIGEST_SIZE) * 8 /* bit length */); + + /* Initialize internal digest with OPAD */ + memcpy(digest, opad, IMB_SM3_DIGEST_SIZE); + + sm3_update(digest, block, 1); + + for (unsigned i = 0; i < IMB_DIM(digest); i++) + digest[i] = BSWAP32(digest[i]); + + memcpy(tag, digest, tag_length); + +#ifdef SAFE_DATA + clear_scratch_xmms_sse(); + clear_mem(block, sizeof(block)); +#endif +} -- GitLab From 4c59309d63ea9cf150d87817994924d4e4893069 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 26 Oct 2023 09:28:44 +0100 Subject: [PATCH 190/204] test: [KAT] add SM3-HMAC tests --- ReleaseNotes.txt | 2 +- test/kat-app/Makefile | 2 +- test/kat-app/api_test.c | 6 +- test/kat-app/hmac_sm3.json.c | 50 ++++++ test/kat-app/hmac_sm3_test.c | 328 +++++++++++++++++++++++++++++++++++ test/kat-app/main.c | 12 +- test/kat-app/win_x64.mak | 2 +- 7 files changed, 394 insertions(+), 8 deletions(-) create mode 100644 test/kat-app/hmac_sm3.json.c create mode 100644 test/kat-app/hmac_sm3_test.c diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 2581c7ad..0c986b6e 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -15,7 +15,7 @@ Library Test Applications - QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. - SM4-ECB and SM4-CBC tests added. -- SM3 tests added. +- SM3 and SM3-HMAC tests added. - Self-Test callback support added to the KAT-APP. - Updated ACVP app (imb-acvp) to support libacvp v2.0+. diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index fed2c208..c5b1c256 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -46,7 +46,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c zuc_eea3_256.json.c \ - kasumi_f8.json.c kasumi_f9.json.c snow_v_test.json.c + kasumi_f8.json.c kasumi_f9.json.c snow_v_test.json.c hmac_sm3_test.c hmac_sm3.json.c else # aarch64 SOURCES := main.c api_test.c zuc_eea3_test.c zuc_eia3_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 9f2fa597..68bb8599 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -243,6 +243,7 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ 16, /* IMB_AUTH_GHASH */ 32, /* IMB_AUTH_SM3 */ + 32, /* IMB_AUTH_HMAC_SM3 */ }; static DECLARE_ALIGNED(uint8_t dust_bin[2048], 64); static void *ks_ptrs[3]; @@ -399,6 +400,7 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, case IMB_AUTH_HMAC_SHA_256: case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_HMAC_SM3: case IMB_AUTH_MD5: job->u.HMAC._hashed_auth_key_xor_ipad = dust_bin; job->u.HMAC._hashed_auth_key_xor_opad = dust_bin; @@ -1382,7 +1384,7 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) hash == IMB_AUTH_CRC7_FP_HEADER || hash == IMB_AUTH_CRC6_IUUP_HEADER || hash == IMB_AUTH_POLY1305 || hash == IMB_AUTH_GHASH || - hash == IMB_AUTH_SM3) + hash == IMB_AUTH_SM3 || hash == IMB_AUTH_HMAC_SM3) continue; #ifdef __aarch64__ if (hash != IMB_AUTH_SNOW3G_UIA2_BITLEN && @@ -1462,6 +1464,7 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) case IMB_AUTH_HMAC_SHA_256: case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_HMAC_SM3: case IMB_AUTH_MD5: case IMB_AUTH_KASUMI_UIA1: fill_in_job(&template_job, cipher, dir, hash, order, @@ -1551,6 +1554,7 @@ test_job_invalid_mac_args(struct IMB_MGR *mb_mgr) case IMB_AUTH_HMAC_SHA_256: case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_HMAC_SM3: case IMB_AUTH_MD5: skip = 0; break; diff --git a/test/kat-app/hmac_sm3.json.c b/test/kat-app/hmac_sm3.json.c new file mode 100644 index 00000000..a3b6be32 --- /dev/null +++ b/test/kat-app/hmac_sm3.json.c @@ -0,0 +1,50 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include "mac_test.h" + +const struct mac_test hmac_sm3_test_kat_json[] = { + /* + * Test vectors from GM/T 0042-2015 Appendix D.3 + */ + { 296, 256, 1, + "\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" + "\x11\x12\x13\x14\x15\x16\x17\x18" + "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20" + "\x21\x22\x23\x24\x25", + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" + "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", + "\x22\x0b\xf5\x79\xde\xd5\x55\x39" + "\x3f\x01\x59\xf6\x6c\x99\x87\x78" + "\x22\xa3\xec\xf6\x10\xd1\x55\x21" + "\x54\xb4\x1d\x44\xb9\x4d\xb3\xae", + 1, 400, NULL, 0 }, + { 0, 0, 0, NULL, NULL, NULL, 0, 0, NULL, 0 } +}; diff --git a/test/kat-app/hmac_sm3_test.c b/test/kat-app/hmac_sm3_test.c new file mode 100644 index 00000000..459c4392 --- /dev/null +++ b/test/kat-app/hmac_sm3_test.c @@ -0,0 +1,328 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +#include +#include +#include +#include + +#include +#include "gcm_ctr_vectors_test.h" +#include "utils.h" +#include "mac_test.h" + +int +hmac_sm3_test(struct IMB_MGR *mb_mgr); + +#define MAX_BURST_JOBS 32 + +extern const struct mac_test hmac_sm3_test_kat_json[]; +static int +hmac_sm3_job_ok(const struct mac_test *vec, const struct IMB_JOB *job, const uint8_t *auth, + const uint8_t *padding, const size_t sizeof_padding) +{ + if (job->status != IMB_STATUS_COMPLETED) { + printf("line:%d job error status:%d ", __LINE__, job->status); + return 0; + } + + /* hash checks */ + if (memcmp(padding, &auth[sizeof_padding + (vec->tagSize / 8)], sizeof_padding)) { + printf("hash overwrite tail\n"); + hexdump(stderr, "Target", &auth[sizeof_padding + (vec->tagSize / 8)], + sizeof_padding); + return 0; + } + + if (memcmp(padding, &auth[0], sizeof_padding)) { + printf("hash overwrite head\n"); + hexdump(stderr, "Target", &auth[0], sizeof_padding); + return 0; + } + + if (memcmp(vec->tag, &auth[sizeof_padding], vec->tagSize / 8)) { + printf("hash mismatched\n"); + hexdump(stderr, "Received", &auth[sizeof_padding], vec->tagSize / 8); + hexdump(stderr, "Expected", vec->tag, vec->tagSize / 8); + return 0; + } + return 1; +} + +static int +test_hmac_sm3(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const uint32_t num_jobs) +{ + struct IMB_JOB *job; + uint8_t padding[16]; + uint8_t **auths = malloc(num_jobs * sizeof(void *)); + uint32_t i = 0, jobs_rx = 0; + int ret = -1; + DECLARE_ALIGNED(uint8_t ipad_hash[IMB_SM3_DIGEST_SIZE], 16); + DECLARE_ALIGNED(uint8_t opad_hash[IMB_SM3_DIGEST_SIZE], 16); + + if (auths == NULL) { + fprintf(stderr, "Can't allocate buffer memory\n"); + return ret; + } + + memset(padding, -1, sizeof(padding)); + memset(auths, 0, num_jobs * sizeof(void *)); + + for (i = 0; i < num_jobs; i++) { + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); + + auths[i] = malloc(alloc_len); + if (auths[i] == NULL) { + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end; + } + memset(auths[i], -1, alloc_len); + } + + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SM3, vec->key, vec->keySize / 8, ipad_hash, + opad_hash); + + for (i = 0; i < num_jobs; i++) { + job = IMB_GET_NEXT_JOB(mb_mgr); + job->enc_keys = NULL; + job->dec_keys = NULL; + job->cipher_direction = IMB_DIR_ENCRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + job->dst = NULL; + job->key_len_in_bytes = 0; + job->auth_tag_output = auths[i] + sizeof(padding); + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; + job->iv = NULL; + job->iv_len_in_bytes = 0; + job->src = (const void *) vec->msg; + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = 0; + job->hash_start_src_offset_in_bytes = 0; + job->msg_len_to_hash_in_bytes = vec->msgSize / 8; + job->u.HMAC._hashed_auth_key_xor_ipad = ipad_hash; + job->u.HMAC._hashed_auth_key_xor_opad = opad_hash; + job->cipher_mode = IMB_CIPHER_NULL; + job->hash_alg = IMB_AUTH_HMAC_SM3; + + job->user_data = auths[i]; + + job = IMB_SUBMIT_JOB(mb_mgr); + if (job) { + jobs_rx++; + if (!hmac_sm3_job_ok(vec, job, job->user_data, padding, sizeof(padding))) + goto end; + } + } + + while ((job = IMB_FLUSH_JOB(mb_mgr)) != NULL) { + jobs_rx++; + if (!hmac_sm3_job_ok(vec, job, job->user_data, padding, sizeof(padding))) + goto end; + } + + if (jobs_rx != num_jobs) { + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); + goto end; + } + ret = 0; + +end: + /* empty the manager before next tests */ + while (IMB_FLUSH_JOB(mb_mgr) != NULL) + ; + + for (i = 0; i < num_jobs; i++) { + if (auths[i] != NULL) + free(auths[i]); + } + + if (auths != NULL) + free(auths); + + return ret; +} + +static int +test_hmac_sm3_burst(struct IMB_MGR *mb_mgr, const struct mac_test *vec, const uint32_t num_jobs) +{ + struct IMB_JOB *job, *jobs[MAX_BURST_JOBS] = { NULL }; + uint8_t padding[16]; + uint8_t **auths = malloc(num_jobs * sizeof(void *)); + uint32_t i = 0, jobs_rx = 0; + int ret = -1, err; + DECLARE_ALIGNED(uint8_t ipad_hash[IMB_SM3_DIGEST_SIZE], 16); + DECLARE_ALIGNED(uint8_t opad_hash[IMB_SM3_DIGEST_SIZE], 16); + uint32_t completed_jobs = 0; + + if (auths == NULL) { + fprintf(stderr, "Can't allocate buffer memory\n"); + return ret; + } + + memset(padding, -1, sizeof(padding)); + memset(auths, 0, num_jobs * sizeof(void *)); + + for (i = 0; i < num_jobs; i++) { + const size_t alloc_len = (vec->tagSize / 8) + (sizeof(padding) * 2); + + auths[i] = malloc(alloc_len); + if (auths[i] == NULL) { + fprintf(stderr, "Can't allocate buffer memory\n"); + goto end; + } + memset(auths[i], -1, alloc_len); + } + + imb_hmac_ipad_opad(mb_mgr, IMB_AUTH_HMAC_SM3, vec->key, vec->keySize / 8, ipad_hash, + opad_hash); + + while (IMB_GET_NEXT_BURST(mb_mgr, num_jobs, jobs) < num_jobs) + IMB_FLUSH_BURST(mb_mgr, num_jobs, jobs); + + for (i = 0; i < num_jobs; i++) { + job = jobs[i]; + job->enc_keys = NULL; + job->dec_keys = NULL; + job->cipher_direction = IMB_DIR_ENCRYPT; + job->chain_order = IMB_ORDER_HASH_CIPHER; + job->dst = NULL; + job->key_len_in_bytes = 0; + job->auth_tag_output = auths[i] + sizeof(padding); + job->auth_tag_output_len_in_bytes = vec->tagSize / 8; + job->iv = NULL; + job->iv_len_in_bytes = 0; + job->src = (const void *) vec->msg; + job->cipher_start_src_offset_in_bytes = 0; + job->msg_len_to_cipher_in_bytes = 0; + job->hash_start_src_offset_in_bytes = 0; + job->msg_len_to_hash_in_bytes = vec->msgSize / 8; + job->u.HMAC._hashed_auth_key_xor_ipad = ipad_hash; + job->u.HMAC._hashed_auth_key_xor_opad = opad_hash; + job->cipher_mode = IMB_CIPHER_NULL; + job->hash_alg = IMB_AUTH_HMAC_SM3; + + job->user_data = auths[i]; + + imb_set_session(mb_mgr, job); + } + + completed_jobs = IMB_SUBMIT_BURST(mb_mgr, num_jobs, jobs); + err = imb_get_errno(mb_mgr); + + if (err != 0) { + printf("submit_burst error %d : '%s'\n", err, imb_get_strerror(err)); + goto end; + } + +check_burst_jobs: + for (i = 0; i < completed_jobs; i++) { + job = jobs[i]; + + if (job->status != IMB_STATUS_COMPLETED) { + printf("job %u status not complete!\n", i + 1); + goto end; + } + + if (!hmac_sm3_job_ok(vec, job, job->user_data, padding, sizeof(padding))) + goto end; + jobs_rx++; + } + + if (jobs_rx != num_jobs) { + completed_jobs = IMB_FLUSH_BURST(mb_mgr, num_jobs - completed_jobs, jobs); + if (completed_jobs == 0) { + printf("Expected %u jobs, received %u\n", num_jobs, jobs_rx); + goto end; + } + goto check_burst_jobs; + } + ret = 0; + +end: + for (i = 0; i < num_jobs; i++) { + if (auths[i] != NULL) + free(auths[i]); + } + + if (auths != NULL) + free(auths); + + return ret; +} + +static void +test_hmac_sm3_std_vectors(struct IMB_MGR *mb_mgr, const uint32_t num_jobs, + struct test_suite_context *ts) +{ + const struct mac_test *v = hmac_sm3_test_kat_json; + + if (!quiet_mode) + printf("HMAC-SM3 standard test vectors (N jobs = %u):\n", num_jobs); + while (v->msg != NULL) { + if (!quiet_mode) { +#ifdef DEBUG + printf("Test Case %zu keySize:%zu " + "msgSize:%zu tagSize:%zu\n", + v->tcId, v->keySize / 8, v->msgSize / 8, v->tagSize / 8); +#else + printf("."); +#endif + } + + if (test_hmac_sm3(mb_mgr, v, num_jobs)) { + printf("error #%zu\n", v->tcId); + test_suite_update(ts, 0, 1); + } else { + test_suite_update(ts, 1, 0); + } + if (test_hmac_sm3_burst(mb_mgr, v, num_jobs)) { + printf("error #%zu - burst API\n", v->tcId); + test_suite_update(ts, 0, 1); + } else { + test_suite_update(ts, 1, 0); + } + + v++; + } + if (!quiet_mode) + printf("\n"); +} + +int +hmac_sm3_test(struct IMB_MGR *mb_mgr) +{ + struct test_suite_context ts; + int errors = 0; + uint32_t num_jobs; + + test_suite_start(&ts, "SM3"); + for (num_jobs = 1; num_jobs <= MAX_BURST_JOBS; num_jobs++) + test_hmac_sm3_std_vectors(mb_mgr, num_jobs, &ts); + errors = test_suite_end(&ts); + + return errors; +} diff --git a/test/kat-app/main.c b/test/kat-app/main.c index 2db7af78..3ba5cf22 100644 --- a/test/kat-app/main.c +++ b/test/kat-app/main.c @@ -111,6 +111,8 @@ extern int sm4_cbc_test(struct IMB_MGR *mb_mgr); extern int sm3_test(struct IMB_MGR *mb_mg); +extern int +hmac_sm3_test(struct IMB_MGR *mb_mg); typedef int (*imb_test_t)(struct IMB_MGR *mb_mgr); @@ -176,11 +178,13 @@ struct imb_test tests[] = { { .str = "DIRECT_API_PARAM", .fn = direct_api_param_test, .enabled = 1 }, #ifndef __aarch64__ { .str = "QUIC-ECB", .fn = quic_ecb_test, .enabled = 1 }, - { .str = "QUIC-CHACHA20", .fn = quic_chacha20_test, .enabled = 1 }, - { .str = "SM4-ECB", .fn = sm4_ecb_test, .enabled = 1 }, - { .str = "SM4-CBC", .fn = sm4_cbc_test, .enabled = 1 }, - { .str = "SM3", .fn = sm3_test, .enabled = 1 } + { .str = "QUIC_CHACHA20", .fn = quic_chacha20_test, .enabled = 1 }, + { .str = "SM4_ECB", .fn = sm4_ecb_test, .enabled = 1 }, + { .str = "SM4_CBC", .fn = sm4_cbc_test, .enabled = 1 }, + { .str = "SM3", .fn = sm3_test, .enabled = 1 }, + { .str = "HMAC_SM3", .fn = hmac_sm3_test, .enabled = 1 } #endif /* __aarch64__ */ + }; static int self_test_corrupt = 0; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index c1623f0d..445f1f4f 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj zuc_eea3_256.json.obj kasumi_f8.json.obj kasumi_f9.json.obj snow_v_test.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj zuc_eea3_256.json.obj kasumi_f8.json.obj kasumi_f9.json.obj snow_v_test.json.obj hmac_sm3_test.obj hmac_sm3.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) -- GitLab From 05f462f5777c1eaf7c097c3b68255523700c974e Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 27 Oct 2023 08:32:27 +0100 Subject: [PATCH 191/204] perf: add SM3-HMAC --- ReleaseNotes.txt | 2 +- perf/ipsec_perf.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 0c986b6e..57635d71 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -23,7 +23,7 @@ Performance Applications - New parameter added to benchmark QUIC `--quic-api`. - Burst API is benchmarked by default now. - SM4-ECB and SM4-CBC support added. -- SM3 support added. +- SM3 and SM3-HMAC support added. v1.4 June 2023 ======================================================================== diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index a622b20f..8ce1c71a 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -209,6 +209,7 @@ enum test_hash_alg_e { TEST_CRC6_IUUP_HEADER, TEST_AUTH_GHASH, TEST_AUTH_SM3, + TEST_SM3_HMAC, TEST_NUM_HASH_TESTS }; @@ -565,6 +566,12 @@ const struct str_value_mapping hash_algo_str_map[] = { .hash_alg = TEST_AUTH_SM3, } }, + { + .name = "sm3-hmac", + .values.job_params = { + .hash_alg = TEST_SM3_HMAC, + } + } #endif /* __aarch64__ */ }; @@ -696,6 +703,7 @@ const uint32_t auth_tag_length_bytes[] = { 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ 16, /* IMB_AUTH_GHASH */ 32, /* IMB_AUTH_SM3 */ + 32, /* IMB_AUTH_HMAC_SM3 */ }; uint32_t index_limit; uint32_t key_idxs[NUM_OFFSETS]; @@ -2028,8 +2036,13 @@ do_test(IMB_MGR *mb_mgr, struct params_s *params, const uint32_t num_iter, uint8 case TEST_AUTH_SM3: job_template.hash_alg = IMB_AUTH_SM3; break; + case TEST_SM3_HMAC: + job_template.u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) ipad; + job_template.u.HMAC._hashed_auth_key_xor_opad = (uint8_t *) opad; + job_template.hash_alg = IMB_AUTH_HMAC_SM3; + break; default: - /* HMAC hash alg is SHA1 or MD5 */ + /* HMAC hash algorithm */ job_template.u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) ipad; job_template.u.HMAC._hashed_auth_key_xor_opad = (uint8_t *) opad; job_template.hash_alg = (IMB_HASH_ALG) params->hash_alg; @@ -3022,7 +3035,8 @@ print_times(struct variant_s *variant_list, struct params_s *params, const uint3 "CRC7_FP_HEADER", "CRC6_IUUP_HEADER", "GHASH", - "SM3" }; + "SM3", + "SM3_HMAC" }; struct params_s par; printf("ARCH"); -- GitLab From fcafc93e3dcf0ca5987f09759d3393078e29f4ec Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 27 Oct 2023 08:33:13 +0100 Subject: [PATCH 192/204] test: [XVALID] add SM3-HMAC --- test/xvalid-app/ipsec_xvalid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/xvalid-app/ipsec_xvalid.c b/test/xvalid-app/ipsec_xvalid.c index a8919a57..e72d1883 100644 --- a/test/xvalid-app/ipsec_xvalid.c +++ b/test/xvalid-app/ipsec_xvalid.c @@ -467,6 +467,12 @@ struct str_value_mapping hash_algo_str_map[] = { .hash_alg = IMB_AUTH_SM3, } }, + { + .name = "HMAC-SM3", + .values.job_params = { + .hash_alg = IMB_AUTH_HMAC_SM3, + } + }, #endif /* __aarch64__ */ }; @@ -564,6 +570,7 @@ const uint8_t auth_tag_len_bytes[] = { 4, /* IMB_AUTH_CRC6_IUUP_HEADER */ 16, /* IMB_AUTH_GHASH */ 32, /* IMB_AUTH_SM3 */ + 32, /* IMB_AUTH_HMAC_SM3 */ }; /* Minimum, maximum and step values of key sizes */ @@ -920,6 +927,7 @@ fill_job(IMB_JOB *job, const struct params_s *params, uint8_t *buf, uint8_t *dig case IMB_AUTH_HMAC_SHA_256: case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_HMAC_SM3: case IMB_AUTH_MD5: /* HMAC hash alg is SHA1 or MD5 */ job->u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) ipad; @@ -1183,6 +1191,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph case IMB_AUTH_HMAC_SHA_256: case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_HMAC_SM3: case IMB_AUTH_MD5: nosimd_memset(ipad, pattern_auth_key, sizeof(keys->ipad)); nosimd_memset(opad, pattern_auth_key, sizeof(keys->opad)); @@ -1313,6 +1322,7 @@ prepare_keys(IMB_MGR *mb_mgr, struct cipher_auth_keys *keys, const uint8_t *ciph case IMB_AUTH_HMAC_SHA_256: case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: + case IMB_AUTH_HMAC_SM3: case IMB_AUTH_MD5: imb_hmac_ipad_opad(mb_mgr, params->hash_alg, auth_key, MAX_KEY_SIZE, ipad, opad); break; -- GitLab From d913019a4565982041d69b57d8da209971b18370 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 31 Oct 2023 13:36:02 +0000 Subject: [PATCH 193/204] lib: [SM4] rename SM4 KEY SCHEDULE macro --- lib/ipsec-mb.h | 2 +- test/fuzz-app/direct_api_fuzz_test.c | 2 +- test/kat-app/sm4_cbc_test.c | 4 ++-- test/kat-app/sm4_ecb_test.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 9ebb1ec7..138d339f 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -609,7 +609,7 @@ struct chacha20_poly1305_context_data { }; /* 32 precomputed (4-byte) rounds for SM4 key schedule (128 bytes in total) */ -#define IMB_SM4_KEY_SCHEDULE 32 +#define IMB_SM4_KEY_SCHEDULE_ROUNDS 32 /** * Maximum Authenticated Tag Length in bytes. diff --git a/test/fuzz-app/direct_api_fuzz_test.c b/test/fuzz-app/direct_api_fuzz_test.c index 889ffc84..dadae2db 100644 --- a/test/fuzz-app/direct_api_fuzz_test.c +++ b/test/fuzz-app/direct_api_fuzz_test.c @@ -1900,7 +1900,7 @@ test_imb_sm4_keyexp(IMB_MGR *p_mgr, uint8_t *buff, size_t dataSize) void *ekey, *dkey; - if (test_aes_exp_alloc((IMB_SM4_KEY_SCHEDULE * 4) / 16, &ekey, &dkey) != 0) { + if (test_aes_exp_alloc((IMB_SM4_KEY_SCHEDULE_ROUNDS * 4) / 16, &ekey, &dkey) != 0) { free(key); return -1; } diff --git a/test/kat-app/sm4_cbc_test.c b/test/kat-app/sm4_cbc_test.c index 82f8411c..81d8172e 100644 --- a/test/kat-app/sm4_cbc_test.c +++ b/test/kat-app/sm4_cbc_test.c @@ -188,8 +188,8 @@ test_sm4_cbc_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const IMB_CIPHER_MODE cipher, const int num_jobs) { const struct cipher_test *v = sm4_cbc_test_json; - DECLARE_ALIGNED(uint32_t exp_enc_keys[IMB_SM4_KEY_SCHEDULE], 16); - DECLARE_ALIGNED(uint32_t exp_dec_keys[IMB_SM4_KEY_SCHEDULE], 16); + DECLARE_ALIGNED(uint32_t exp_enc_keys[IMB_SM4_KEY_SCHEDULE_ROUNDS], 16); + DECLARE_ALIGNED(uint32_t exp_dec_keys[IMB_SM4_KEY_SCHEDULE_ROUNDS], 16); if (!quiet_mode) printf("SM4-CBC Test (N jobs = %d):\n", num_jobs); diff --git a/test/kat-app/sm4_ecb_test.c b/test/kat-app/sm4_ecb_test.c index 262c5683..ebbda744 100644 --- a/test/kat-app/sm4_ecb_test.c +++ b/test/kat-app/sm4_ecb_test.c @@ -186,8 +186,8 @@ test_sm4_ecb_vectors(struct IMB_MGR *mb_mgr, struct test_suite_context *ctx, const IMB_CIPHER_MODE cipher, const int num_jobs) { const struct cipher_test *v = sm4_ecb_test_json; - DECLARE_ALIGNED(uint32_t exp_enc_keys[IMB_SM4_KEY_SCHEDULE], 16); - DECLARE_ALIGNED(uint32_t exp_dec_keys[IMB_SM4_KEY_SCHEDULE], 16); + DECLARE_ALIGNED(uint32_t exp_enc_keys[IMB_SM4_KEY_SCHEDULE_ROUNDS], 16); + DECLARE_ALIGNED(uint32_t exp_dec_keys[IMB_SM4_KEY_SCHEDULE_ROUNDS], 16); if (!quiet_mode) printf("SM4-ECB Test (N jobs = %d):\n", num_jobs); -- GitLab From 3e424893b9c529ae0a87b4008e11e3e53b5391d8 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 31 Oct 2023 13:36:18 +0000 Subject: [PATCH 194/204] test: [KAT] add another SM4-ECB and SM4-CBC vector --- test/kat-app/sm4_cbc_test.json.c | 10 +++++++++- test/kat-app/sm4_ecb_test.json.c | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/test/kat-app/sm4_cbc_test.json.c b/test/kat-app/sm4_cbc_test.json.c index 37750386..21b1dddf 100644 --- a/test/kat-app/sm4_cbc_test.json.c +++ b/test/kat-app/sm4_cbc_test.json.c @@ -929,7 +929,8 @@ const struct cipher_test sm4_cbc_test_json[] = { "\xe7\x86\x71\x25\xd7\x27\xd1\x7c\x05\xbf\x8a\x57\x15\x8e\xb8\xe7\x4d\xe9\x53\xb1\xb3\x4e" "\xd0\x38\x9b\x45", 1, 1664 }, - /* Vector from https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 */ + /* Vectors from https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 and + https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-10 */ { 128, 128, 32, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", "\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD" @@ -937,5 +938,12 @@ const struct cipher_test sm4_cbc_test_json[] = { "\x78\xEB\xB1\x1C\xC4\x0B\x0A\x48\x31\x2A\xAE\xB2\x04\x02\x44\xCB" "\x4C\xB7\x01\x69\x51\x90\x92\x26\x97\x9B\x0D\x15\xDC\x6A\x8F\x6D", 1, 256 }, + { 128, 128, 33, "\xFE\xDC\xBA\x98\x76\x54\x32\x10\x01\x23\x45\x67\x89\xAB\xCD\xEF", + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", + "\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD" + "\xEE\xEE\xEE\xEE\xFF\xFF\xFF\xFF\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB", + "\x0D\x3A\x6D\xDC\x2D\x21\xC6\x98\x85\x72\x15\x58\x7B\x7B\xB5\x9A" + "\x91\xF2\xC1\x47\x91\x1A\x41\x44\x66\x5E\x1F\xA1\xD4\x0B\xAE\x38", + 1, 256 }, { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; diff --git a/test/kat-app/sm4_ecb_test.json.c b/test/kat-app/sm4_ecb_test.json.c index 8048ff24..15370161 100644 --- a/test/kat-app/sm4_ecb_test.json.c +++ b/test/kat-app/sm4_ecb_test.json.c @@ -985,7 +985,8 @@ const struct cipher_test sm4_ecb_test_json[] = { "\xae\xbe\x89\x48\xd2\x62\xb7\xb2\x80\xf2\x6b\xe8\xc8\xc2\x76\xff\x81\x5c", 1, 2304 }, /* Vectors from https://datatracker.ietf.org/doc/draft-ribose-cfrg-sm4/00/ and - https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 */ + https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-04 and + https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-10 */ { 0, 128, 32, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", NULL, "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xFE\xDC\xBA\x98\x76\x54\x32\x10", "\x68\x1E\xDF\x34\xD2\x06\x96\x5E\x86\xB3\xE9\x4F\x53\x6E\x42\x46", 1, 128 }, @@ -995,5 +996,11 @@ const struct cipher_test sm4_ecb_test_json[] = { "\x5E\xC8\x14\x3D\xE5\x09\xCF\xF7\xB5\x17\x9F\x8F\x47\x4B\x86\x19" "\x2F\x1D\x30\x5A\x7F\xB1\x7D\xF9\x85\xF8\x1C\x84\x82\x19\x23\x04", 1, 256 }, + { 0, 128, 34, "\xFE\xDC\xBA\x98\x76\x54\x32\x10\x01\x23\x45\x67\x89\xAB\xCD\xEF", NULL, + "\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\xDD\xDD\xDD\xDD" + "\xEE\xEE\xEE\xEE\xFF\xFF\xFF\xFF\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB", + "\xC5\x87\x68\x97\xE4\xA5\x9B\xBB\xA7\x2A\x10\xC8\x38\x72\x24\x5B" + "\x12\xDD\x90\xBC\x2D\x20\x06\x92\xB5\x29\xA4\x15\x5A\xC9\xE6\x00", + 1, 256 }, { 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 } }; -- GitLab From bfa07d45af06a2935848adec6053d1adea12dae5 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 2 Nov 2023 15:02:36 +0000 Subject: [PATCH 195/204] lib: add SGL state error --- lib/include/error.inc | 3 ++- lib/ipsec-mb.h | 1 + lib/x86_64/error.c | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/include/error.inc b/lib/include/error.inc index 28c39722..b5f642d6 100644 --- a/lib/include/error.inc +++ b/lib/include/error.inc @@ -99,7 +99,8 @@ SET_ERRNO_TYPES \ IMB_ERR_BURST_SIZE, \ IMB_ERR_BURST_OOO, \ IMB_ERR_SELFTEST, \ - IMB_ERR_BURST_SUITE_ID + IMB_ERR_BURST_SUITE_ID, \ + IMB_ERR_JOB_SGL_STATE ;; Reset global imb_errno to 0 %macro IMB_ERR_CHECK_RESET 0 diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index 138d339f..fe91cba8 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -255,6 +255,7 @@ typedef enum { IMB_ERR_BURST_OOO, IMB_ERR_SELFTEST, IMB_ERR_BURST_SUITE_ID, + IMB_ERR_JOB_SGL_STATE, /* add new error types above this comment */ IMB_ERR_MAX /* don't move this one */ } IMB_ERR; diff --git a/lib/x86_64/error.c b/lib/x86_64/error.c index 176b6ecf..a4a56c13 100644 --- a/lib/x86_64/error.c +++ b/lib/x86_64/error.c @@ -92,7 +92,8 @@ IMB_DLL_LOCAL const int imb_errno_types[] = { IMB_ERR_NULL_MBMGR, IMB_ERR_BURST_SIZE, IMB_ERR_BURST_OOO, IMB_ERR_SELFTEST, - IMB_ERR_BURST_SUITE_ID }; + IMB_ERR_BURST_SUITE_ID, + IMB_ERR_JOB_SGL_STATE }; int imb_get_errno(IMB_MGR *mb_mgr) @@ -226,6 +227,8 @@ imb_get_strerror(int errnum) return "Self-test failed"; case IMB_ERR_BURST_SUITE_ID: return "Invalid cipher suite ID (async burst API)"; + case IMB_ERR_JOB_SGL_STATE: + return "Invalid SGL state"; default: return strerror(errnum); } -- GitLab From fd1c5f2265082fb9f2db7f9a3fb804f13ed4b125 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 2 Nov 2023 15:22:25 +0000 Subject: [PATCH 196/204] lib: add maximum length macros for GCM/CHACHA20_POLY1305 --- lib/include/mb_mgr_job_check.h | 7 ++----- lib/ipsec-mb.h | 6 ++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 2e47748e..e258f0dc 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -33,8 +33,6 @@ #include "include/kasumi_interface.h" #include "include/zuc_internal.h" -/* GCM NIST standard: len(M) < 2^39 - 256 */ -#define GCM_MAX_LEN UINT64_C(((1ULL << 39) - 256) - 1) #define SNOW3G_MAX_BITLEN (UINT32_MAX) #define MB_MAX_LEN16 ((1 << 16) - 2) @@ -550,7 +548,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ break; case IMB_CIPHER_GCM: case IMB_CIPHER_GCM_SGL: - if (job->msg_len_to_cipher_in_bytes > GCM_MAX_LEN) { + if (job->msg_len_to_cipher_in_bytes > IMB_GCM_MAX_LEN) { imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); return 1; } @@ -1014,8 +1012,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); return 1; } - /* Per RFC 7539, max cipher size is (2^32 - 1) x 64 */ - if (job->msg_len_to_cipher_in_bytes > ((1ULL << 38) - 64)) { + if (job->msg_len_to_cipher_in_bytes > IMB_CHACHA20_POLY1305_MAX_LEN) { imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); return 1; } diff --git a/lib/ipsec-mb.h b/lib/ipsec-mb.h index fe91cba8..3ea415c6 100644 --- a/lib/ipsec-mb.h +++ b/lib/ipsec-mb.h @@ -635,6 +635,12 @@ struct chacha20_poly1305_context_data { #define IMB_GCM_ENC_KEY_LEN 16 #define IMB_GCM_KEY_SETS (15) /**< exp key + 14 exp round keys*/ +/* GCM NIST standard: len(M) < 2^39 - 256 */ +#define IMB_GCM_MAX_LEN UINT64_C(((1ULL << 39) - 256) - 1) + +/* Per RFC 7539, max cipher size is (2^32 - 1) x 64 */ +#define IMB_CHACHA20_POLY1305_MAX_LEN UINT64_C((1ULL << 38) - 64) + #define IMB_CCM_AAD_MAX_SIZE (46) /* Maximum CCM AAD size */ /** * @brief holds intermediate key data needed to improve performance -- GitLab From 6de61a8d7fef0d38cc9e4c827914ceca2a6d622e Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 2 Nov 2023 15:22:50 +0000 Subject: [PATCH 197/204] test: [KAT] fix typo --- test/kat-app/api_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index 68bb8599..acb9478a 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -1129,7 +1129,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) } print_progress(); - /* ======== test 10 : session_d */ + /* ======== test 10 : session_id */ while (IMB_GET_NEXT_BURST(mb_mgr, n_jobs, jobs) < n_jobs) IMB_FLUSH_BURST(mb_mgr, n_jobs, jobs); -- GitLab From 794bc84ca6868295bb30f4b6feb5a939c4e28776 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 2 Nov 2023 15:24:53 +0000 Subject: [PATCH 198/204] lib: check GCM tag and AAD length for single call SGL API --- lib/include/mb_mgr_job_check.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index e258f0dc..81e8c07d 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -1223,7 +1223,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ imb_set_errno(state, IMB_ERR_JOB_NULL_SGL_CTX); return 1; } - if (job->sgl_state == IMB_SGL_COMPLETE) { + if (job->sgl_state == IMB_SGL_COMPLETE || job->sgl_state == IMB_SGL_ALL) { if (job->auth_tag_output_len_in_bytes < UINT64_C(1) || job->auth_tag_output_len_in_bytes > UINT64_C(16)) { imb_set_errno(state, IMB_ERR_JOB_AUTH_TAG_LEN); @@ -1234,7 +1234,7 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ return 1; } } - if (job->sgl_state == IMB_SGL_INIT) { + if (job->sgl_state == IMB_SGL_INIT || job->sgl_state == IMB_SGL_ALL) { if ((job->u.GCM.aad_len_in_bytes > 0) && (job->u.GCM.aad == NULL)) { imb_set_errno(state, IMB_ERR_JOB_NULL_AAD); return 1; -- GitLab From d598078261078f47c721c11cce64e32eec2ed2c9 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 2 Nov 2023 15:26:13 +0000 Subject: [PATCH 199/204] lib: check SGL state for GCM and CHACHA20-POLY1305 --- lib/include/mb_mgr_job_check.h | 147 ++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 4 deletions(-) diff --git a/lib/include/mb_mgr_job_check.h b/lib/include/mb_mgr_job_check.h index 81e8c07d..05fc71d6 100644 --- a/lib/include/mb_mgr_job_check.h +++ b/lib/include/mb_mgr_job_check.h @@ -369,6 +369,8 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ * of XGEM header */ const uint64_t max_pon_len = (1 << 14) + 8; + uint64_t total_sgl_len; + if (cipher_direction != IMB_DIR_DECRYPT && cipher_direction != IMB_DIR_ENCRYPT && cipher_mode != IMB_CIPHER_NULL) { imb_set_errno(state, IMB_ERR_JOB_CIPH_DIR); @@ -547,7 +549,6 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ } break; case IMB_CIPHER_GCM: - case IMB_CIPHER_GCM_SGL: if (job->msg_len_to_cipher_in_bytes > IMB_GCM_MAX_LEN) { imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); return 1; @@ -582,14 +583,87 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ imb_set_errno(state, IMB_ERR_JOB_IV_LEN); return 1; } - if (cipher_mode == IMB_CIPHER_GCM && hash_alg != IMB_AUTH_AES_GMAC) { + if (hash_alg != IMB_AUTH_AES_GMAC) { imb_set_errno(state, IMB_ERR_HASH_ALGO); return 1; } - if (cipher_mode == IMB_CIPHER_GCM_SGL && hash_alg != IMB_AUTH_GCM_SGL) { + break; + case IMB_CIPHER_GCM_SGL: + if (hash_alg != IMB_AUTH_GCM_SGL) { imb_set_errno(state, IMB_ERR_HASH_ALGO); return 1; } + /* Same key structure used for encrypt and decrypt */ + if (cipher_direction == IMB_DIR_ENCRYPT && job->enc_keys == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); + return 1; + } + if (cipher_direction == IMB_DIR_DECRYPT && job->dec_keys == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); + return 1; + } + if (key_len_in_bytes != UINT64_C(16) && key_len_in_bytes != UINT64_C(24) && + key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + /* Check IV pointer and size */ + if (job->iv == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_IV); + return 1; + } + if (job->iv_len_in_bytes == 0) { + imb_set_errno(state, IMB_ERR_JOB_IV_LEN); + return 1; + } + switch (job->sgl_state) { + case IMB_SGL_INIT: + case IMB_SGL_UPDATE: + case IMB_SGL_COMPLETE: + /* Check message length (in this segment) */ + if (job->msg_len_to_cipher_in_bytes > IMB_GCM_MAX_LEN) { + imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); + return 1; + } + if (job->msg_len_to_cipher_in_bytes != 0 && job->src == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (job->msg_len_to_cipher_in_bytes != 0 && job->dst == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_DST); + return 1; + } + break; + case IMB_SGL_ALL: + total_sgl_len = 0; + + /* Check message length (per segment) */ + for (uint64_t i = 0; i < job->num_sgl_io_segs; i++) { + const struct IMB_SGL_IOV *seg = &job->sgl_io_segs[i]; + + if (seg == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (seg->len != 0 && seg->in == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (seg->len != 0 && seg->out == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_DST); + return 1; + } + total_sgl_len += seg->len; + } + if (total_sgl_len > IMB_GCM_MAX_LEN) { + imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); + return 1; + } + break; + default: + imb_set_errno(state, IMB_ERR_JOB_SGL_STATE); + return -1; + } break; case IMB_CIPHER_CUSTOM: /* no checks here */ @@ -991,7 +1065,6 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ } break; case IMB_CIPHER_CHACHA20_POLY1305: - case IMB_CIPHER_CHACHA20_POLY1305_SGL: if (job->msg_len_to_cipher_in_bytes != 0 && job->src == NULL) { imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); return 1; @@ -1021,6 +1094,72 @@ is_job_invalid(IMB_MGR *state, const IMB_JOB *job, const IMB_CIPHER_MODE cipher_ return 1; } break; + case IMB_CIPHER_CHACHA20_POLY1305_SGL: + if (job->iv == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_IV); + return 1; + } + if (job->iv_len_in_bytes != UINT64_C(12)) { + imb_set_errno(state, IMB_ERR_JOB_IV_LEN); + return 1; + } + if (job->enc_keys == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_KEY); + return 1; + } + if (key_len_in_bytes != UINT64_C(32)) { + imb_set_errno(state, IMB_ERR_JOB_KEY_LEN); + return 1; + } + switch (job->sgl_state) { + case IMB_SGL_INIT: + case IMB_SGL_UPDATE: + case IMB_SGL_COMPLETE: + /* Check message length (in this segment) */ + if (job->msg_len_to_cipher_in_bytes > IMB_CHACHA20_POLY1305_MAX_LEN) { + imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); + return 1; + } + if (job->msg_len_to_cipher_in_bytes != 0 && job->src == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (job->msg_len_to_cipher_in_bytes != 0 && job->dst == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_DST); + return 1; + } + break; + case IMB_SGL_ALL: + total_sgl_len = 0; + + /* Check message length (per segment) */ + for (uint64_t i = 0; i < job->num_sgl_io_segs; i++) { + const struct IMB_SGL_IOV *seg = &job->sgl_io_segs[i]; + + if (seg == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (seg->len != 0 && seg->in == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_SRC); + return 1; + } + if (seg->len != 0 && seg->out == NULL) { + imb_set_errno(state, IMB_ERR_JOB_NULL_DST); + return 1; + } + total_sgl_len += seg->len; + } + if (total_sgl_len > IMB_CHACHA20_POLY1305_MAX_LEN) { + imb_set_errno(state, IMB_ERR_JOB_CIPH_LEN); + return 1; + } + break; + default: + imb_set_errno(state, IMB_ERR_JOB_SGL_STATE); + return -1; + } + break; case IMB_CIPHER_SNOW_V_AEAD: case IMB_CIPHER_SNOW_V: if (job->msg_len_to_cipher_in_bytes != 0 && job->src == NULL) { -- GitLab From 04ed8808190b02ea1b44534a7d7367e117845cdc Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 2 Nov 2023 15:26:34 +0000 Subject: [PATCH 200/204] test: [KAT] add invalid test case for SGL parameters --- test/kat-app/api_test.c | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index acb9478a..f4b0d190 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -372,6 +372,7 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, job->hash_alg = IMB_AUTH_CHACHA20_POLY1305_SGL; job->key_len_in_bytes = UINT64_C(32); job->iv_len_in_bytes = 12; + job->sgl_state = IMB_SGL_UPDATE; break; case IMB_CIPHER_SNOW_V: job->hash_alg = IMB_AUTH_NULL; @@ -387,6 +388,7 @@ fill_in_job(struct IMB_JOB *job, const IMB_CIPHER_MODE cipher_mode, job->hash_alg = IMB_AUTH_GCM_SGL; job->key_len_in_bytes = UINT64_C(16); job->iv_len_in_bytes = UINT64_C(12); + job->sgl_state = IMB_SGL_UPDATE; break; #endif /* __aarch64__ */ default: @@ -2464,6 +2466,87 @@ test_job_invalid_misc_args(struct IMB_MGR *mb_mgr) print_progress(); } +#ifndef __aarch64__ + /* + * INVALID SGL PARAMS + */ + IMB_CIPHER_MODE sgl_cipher_modes[] = { IMB_CIPHER_GCM_SGL, + IMB_CIPHER_CHACHA20_POLY1305_SGL }; + IMB_HASH_ALG sgl_auth_modes[] = { IMB_AUTH_GCM_SGL, IMB_AUTH_CHACHA20_POLY1305_SGL }; + + for (order = IMB_ORDER_CIPHER_HASH; order <= IMB_ORDER_HASH_CIPHER; order++) + for (dir = IMB_DIR_ENCRYPT; dir <= IMB_DIR_DECRYPT; dir++) { + for (unsigned i = 0; i < DIM(sgl_cipher_modes); i++) { + cipher = sgl_cipher_modes[i]; + hash = sgl_auth_modes[i]; + + IMB_JOB *job = &template_job; + + fill_in_job(job, cipher, dir, hash, order, &chacha_ctx, &gcm_ctx); + + /* Invalid SGL state */ + job->sgl_state = IMB_SGL_ALL + 1; + + if (!is_submit_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_SGL_STATE)) + return 1; + + imb_set_session(mb_mgr, job); + if (!is_submit_burst_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_SGL_STATE)) + return 1; + + /* Invalid SGL segments */ + job->sgl_state = IMB_SGL_ALL; + job->num_sgl_io_segs = 2; + job->sgl_io_segs = NULL; + + if (!is_submit_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_NULL_SRC)) + return 1; + + imb_set_session(mb_mgr, job); + if (!is_submit_burst_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_NULL_SRC)) + return 1; + + /* Null source in non-zero length segment */ + struct IMB_SGL_IOV segs[2]; + uint8_t buf[50]; + + job->sgl_io_segs = segs; + + segs[0].in = NULL; + segs[0].out = buf; + segs[0].len = 50; + + if (!is_submit_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_NULL_SRC)) + return 1; + + imb_set_session(mb_mgr, job); + if (!is_submit_burst_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_NULL_SRC)) + return 1; + + segs[0].in = buf; + segs[0].out = NULL; + + if (!is_submit_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_NULL_DST)) + return 1; + + imb_set_session(mb_mgr, job); + if (!is_submit_burst_invalid(mb_mgr, job, TEST_INVALID_JOB, + IMB_ERR_JOB_NULL_DST)) + return 1; + + /* Null destination in non-zero length segment */ + print_progress(); + } + } +#endif + /* clean up */ while (IMB_FLUSH_JOB(mb_mgr) != NULL) ; -- GitLab From 7f65de6cbc4762916ce5271eda80b2dc4432af04 Mon Sep 17 00:00:00 2001 From: Marcel Cornu Date: Mon, 6 Nov 2023 10:01:18 +0000 Subject: [PATCH 201/204] test: [imb-fuzz-api] set ipad/opad for HMAC-SM3 --- test/fuzz-app/job_api_fuzz_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/fuzz-app/job_api_fuzz_test.c b/test/fuzz-app/job_api_fuzz_test.c index 114bc8ee..141b5368 100644 --- a/test/fuzz-app/job_api_fuzz_test.c +++ b/test/fuzz-app/job_api_fuzz_test.c @@ -182,6 +182,7 @@ fill_additional_hash_data(struct IMB_JOB *job, void *buff, uint64_t buffsize) case IMB_AUTH_HMAC_SHA_384: case IMB_AUTH_HMAC_SHA_512: case IMB_AUTH_MD5: + case IMB_AUTH_HMAC_SM3: if (job->u.HMAC._hashed_auth_key_xor_ipad != NULL) job->u.HMAC._hashed_auth_key_xor_ipad = (uint8_t *) buff; if (job->u.HMAC._hashed_auth_key_xor_opad != NULL) -- GitLab From d9fbb13b77e9e93d03d45c58026e9ef7f8b293de Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Mon, 6 Nov 2023 14:04:41 +0000 Subject: [PATCH 202/204] test: [kat-app] unified format of SNOW-V AEAD test vectors --- test/kat-app/Makefile | 2 +- test/kat-app/snow_v_aead.json.c | 76 +++++++++++++++ test/kat-app/snow_v_test.c | 163 +++++++------------------------- test/kat-app/win_x64.mak | 2 +- 4 files changed, 112 insertions(+), 131 deletions(-) create mode 100644 test/kat-app/snow_v_aead.json.c diff --git a/test/kat-app/Makefile b/test/kat-app/Makefile index c5b1c256..0729b40a 100644 --- a/test/kat-app/Makefile +++ b/test/kat-app/Makefile @@ -46,7 +46,7 @@ SOURCES := main.c gcm_test.c ctr_test.c customop_test.c des_test.c ccm_test.c \ chacha20_poly1305_test.json.c snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c \ sm4_ecb_test.c sm4_ecb_test.json.c sm4_cbc_test.c sm4_cbc_test.json.c sm3_test.c \ sm3_test.json.c zuc_eia3_128.json.c zuc_eia3_256.json.c zuc_eea3_128.json.c zuc_eea3_256.json.c \ - kasumi_f8.json.c kasumi_f9.json.c snow_v_test.json.c hmac_sm3_test.c hmac_sm3.json.c + kasumi_f8.json.c kasumi_f9.json.c snow_v_test.json.c hmac_sm3_test.c hmac_sm3.json.c snow_v_aead.json.c else # aarch64 SOURCES := main.c api_test.c zuc_eea3_test.c zuc_eia3_test.c snow3g_test.c direct_api_test.c \ snow3g_test_f8_vectors.json.c snow3g_test_f9_vectors.json.c clear_mem_test.c direct_api_param_test.c \ diff --git a/test/kat-app/snow_v_aead.json.c b/test/kat-app/snow_v_aead.json.c new file mode 100644 index 00000000..6f52ba94 --- /dev/null +++ b/test/kat-app/snow_v_aead.json.c @@ -0,0 +1,76 @@ +/***************************************************************************** + Copyright (c) 2023, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************************************************/ + +/* SNOW-V-AEAD, */ +#include "aead_test.h" + +/** + * Test vectors for SNOW-V-GCM from 'A new SNOW stream cipher called SNOW-V', + * Patrik Ekdahl1, Thomas Johansson2, Alexander Maximov1 and Jing Yang2 + */ + +const struct aead_test snow_v_aead_json[] = { + { 128, 256, 128, 1, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "", "", "", + "\x02\x9a\x62\x4c\xda\xa4\xd4\x6c\xb9\xa0\xef\x40\x46\x95\x6c\x9f", 1, 0, 0 }, + { 128, 256, 128, 2, + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x0a\x1a\x2a\x3a\x4a\x5a" + "\x6a\x7a\x8a\x9a\xaa\xba\xca\xda\xea\xfa", + "\x01\x23\x45\x67\x89\xab\xcd\xef\xfe\xdc\xba\x98\x76\x54\x32\x10", "", "", "", + "\xfc\x7c\xac\x57\x4c\x49\xfe\xae\x61\x50\x31\x5b\x96\x85\x42\x4c", 1, 0, 0 }, + { 128, 256, 128, 3, + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x61\x62\x63\x64\x65\x66", "", "", + "\x5a\x5a\xa5\xfb\xd6\x35\xef\x1a\xe1\x29\x61\x42\x03\xe1\x03\x84", 1, 128, 0 }, + { 128, 256, 128, 4, + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x0a\x1a\x2a\x3a\x4a\x5a" + "\x6a\x7a\x8a\x9a\xaa\xba\xca\xda\xea\xfa", + "\x01\x23\x45\x67\x89\xab\xcd\xef\xfe\xdc\xba\x98\x76\x54\x32\x10", + "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x61\x62\x63\x64\x65\x66", "", "", + "\x25\x0e\xc8\xd7\x7a\x02\x2c\x08\x7a\xdf\x08\xb6\x5a\xdc\xbb\x1a", 1, 128, 0 }, + { 128, 256, 128, 5, + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x0a\x1a\x2a\x3a\x4a\x5a" + "\x6a\x7a\x8a\x9a\xaa\xba\xca\xda\xea\xfa", + "\x01\x23\x45\x67\x89\xab\xcd\xef\xfe\xdc\xba\x98\x76\x54\x32\x10", "", + "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39", "\xdd\x7e\x01\xb2\xb4\x24\xa2\xef\x82\x50", + "\xdd\xfe\x4e\x31\xe7\xbf\xe6\x90\x23\x31\xec\x5c\xe3\x19\xd9\x0d", 1, 0, 80 }, + { 128, 256, 128, 6, + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x0a\x1a\x2a\x3a\x4a\x5a" + "\x6a\x7a\x8a\x9a\xaa\xba\xca\xda\xea\xfa", + "\x01\x23\x45\x67\x89\xab\xcd\xef\xfe\xdc\xba\x98\x76\x54\x32\x10", + "\x41\x41\x44\x20\x74\x65\x73\x74\x20\x76\x61\x6c\x75\x65\x21", + "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x61\x62\x63\x64\x65\x66\x20\x53\x6e\x6f\x77\x56" + "\x2d\x41\x45\x41\x44\x20\x6d\x6f\x64\x65\x21", + "\xdd\x7e\x01\xb2\xb4\x24\xa2\xef\x82\x50\x27\x07\xe8\x7a\x32\xc1\x52\xb0\xd0\x18\x18\xfd" + "\x7f\x12\x24\x3e\xb5\xa1\x56\x59\xe9\x1b\x4c", + "\x90\x7e\xa6\xa5\xb7\x3a\x51\xde\x74\x7c\x3e\x9a\xd9\xee\x02\x9b", 1, 120, 264 }, + { 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } +}; diff --git a/test/kat-app/snow_v_test.c b/test/kat-app/snow_v_test.c index 0479a3a7..3e28a0be 100644 --- a/test/kat-app/snow_v_test.c +++ b/test/kat-app/snow_v_test.c @@ -35,106 +35,18 @@ #include #include -#include "gcm_ctr_vectors_test.h" #include "utils.h" #include "cipher_test.h" +#include "aead_test.h" extern const struct cipher_test snow_v_test_json[]; +extern const struct aead_test snow_v_aead_json[]; int snow_v_test(IMB_MGR *p_mgr); -/** - * Test vectors for SNOW-V-GCM from 'A new SNOW stream cipher called SNOW-V', - * Patrik Ekdahl1, Thomas Johansson2, Alexander Maximov1 and Jing Yang2 - **/ -static const uint8_t ZERO_KEY[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const uint8_t ZERO_IV[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const uint8_t ZERO_PLAIN[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -static const uint8_t SPEC_SNOW_V_GCM_AUTH_TAGs[][16] = { - { 0x02, 0x9a, 0x62, 0x4c, 0xda, 0xa4, 0xd4, 0x6c, 0xb9, 0xa0, 0xef, 0x40, 0x46, 0x95, 0x6c, - 0x9f }, - { 0xfc, 0x7c, 0xac, 0x57, 0x4c, 0x49, 0xfe, 0xae, 0x61, 0x50, 0x31, 0x5b, 0x96, 0x85, 0x42, - 0x4c }, - { 0x5a, 0x5a, 0xa5, 0xfb, 0xd6, 0x35, 0xef, 0x1a, 0xe1, 0x29, 0x61, 0x42, 0x03, 0xe1, 0x03, - 0x84 }, - { 0x25, 0x0e, 0xc8, 0xd7, 0x7a, 0x02, 0x2c, 0x08, 0x7a, 0xdf, 0x08, 0xb6, 0x5a, 0xdc, 0xbb, - 0x1a }, -}; - -static const uint8_t SPEC_SNOW_V_GCM_CIPHER[] = { 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, - 0xef, 0x82, 0x50, 0xdd, 0xfe, 0x4e, 0x31, - 0xe7, 0xbf, 0xe6, 0x90, 0x23, 0x31, 0xec, - 0x5c, 0xe3, 0x19, 0xd9, 0x0d }; - -static const uint8_t SPEC_SNOW_V_GCM_KEY[] = { 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, - 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa }; - -static const uint8_t SPEC_SNOW_V_GCM_IV[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, - 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; - -static const uint8_t SPEC_SNOW_V_GCM_AAD[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66 }; - -static const uint8_t SPEC_SNOW_V_GCM_AAD_2[] = { 0x41, 0x41, 0x44, 0x20, 0x74, 0x65, 0x73, 0x74, - 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x21 }; - -static const uint8_t SPEC_SNOW_V_GCM_PLAIN[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, - 0x65, 0x66, 0x20, 0x53, 0x6e, 0x6f, 0x77, - 0x56, 0x2d, 0x41, 0x45, 0x41, 0x44, 0x20, - 0x6d, 0x6f, 0x64, 0x65, 0x21 }; - -static const uint8_t SPEC_SNOW_V_GCM_CIPHER_V6[] = { - 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, 0xef, 0x82, 0x50, 0x27, 0x07, 0xe8, - 0x7a, 0x32, 0xc1, 0x52, 0xb0, 0xd0, 0x18, 0x18, 0xfd, 0x7f, 0x12, 0x24, 0x3e, - 0xb5, 0xa1, 0x56, 0x59, 0xe9, 0x1b, 0x4c, 0x90, 0x7e, 0xa6, 0xa5, 0xb7, 0x3a, - 0x51, 0xde, 0x74, 0x7c, 0x3e, 0x9a, 0xd9, 0xee, 0x02, 0x9b -}; - -typedef struct snow_v_aead_test_vectors_s { - const uint8_t *KEY; - const uint8_t *IV; - const uint8_t *aad; - uint64_t aad_length_in_bytes; - uint64_t length_in_bytes; - const uint8_t *plaintext; - const uint8_t *ciphertext; -} snow_v_aead_test_vectors_t; - -static const snow_v_aead_test_vectors_t snow_v_aead_test_vectors[] = { - /* == SNOW-V-GCM test vectors from spec #1 - #6 */ - { ZERO_KEY, ZERO_IV, NULL, 0, 0, ZERO_PLAIN, SPEC_SNOW_V_GCM_AUTH_TAGs[0] }, - { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, NULL, 0, 0, ZERO_PLAIN, - SPEC_SNOW_V_GCM_AUTH_TAGs[1] }, - { ZERO_KEY, ZERO_IV, SPEC_SNOW_V_GCM_AAD, 16, 0, ZERO_PLAIN, SPEC_SNOW_V_GCM_AUTH_TAGs[2] }, - { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, SPEC_SNOW_V_GCM_AAD, 16, 0, ZERO_PLAIN, - SPEC_SNOW_V_GCM_AUTH_TAGs[3] }, - { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, NULL, 0, 10, SPEC_SNOW_V_GCM_AAD, - SPEC_SNOW_V_GCM_CIPHER }, - { SPEC_SNOW_V_GCM_KEY, SPEC_SNOW_V_GCM_IV, SPEC_SNOW_V_GCM_AAD_2, - sizeof(SPEC_SNOW_V_GCM_AAD_2), sizeof(SPEC_SNOW_V_GCM_PLAIN), SPEC_SNOW_V_GCM_PLAIN, - SPEC_SNOW_V_GCM_CIPHER_V6 } -}; static uint32_t -compare(const uint8_t *result, const uint8_t *expected, const size_t size) +compare(const void *result, const void *expected, const size_t size) { if (memcmp(result, expected, size) != 0) { hexdump(stderr, "expected", expected, size); @@ -239,11 +151,20 @@ snow_v_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const void *ke } static void -snow_v_aead_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const uint8_t *key, - const uint8_t *iv, const uint8_t *aad, const uint8_t *plain, - const size_t size, const size_t aad_len, const uint8_t *expected, - int dir_encrypt) /* 1-encrypt, 0-decrypt */ +snow_v_aead_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const struct aead_test *v, + const IMB_CIPHER_DIRECTION dir) { + assert(v != NULL); + assert(v->msg != NULL); + assert(v->keySize == (32 * CHAR_BIT)); + assert(v->ivSize == (16 * CHAR_BIT)); + assert(v->tagSize == (16 * CHAR_BIT)); + assert((v->msgSize % CHAR_BIT) == 0); + assert((v->aadSize % CHAR_BIT) == 0); + + const size_t size = v->msgSize / CHAR_BIT; + const size_t aad_len = v->aadSize / CHAR_BIT; + const size_t pad_size = 16; /* alloc space for auth tag after output */ const size_t alloc_size = size + 16 + (2 * pad_size); @@ -271,22 +192,19 @@ snow_v_aead_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const uin job->key_len_in_bytes = 32; job->iv_len_in_bytes = 16; job->cipher_start_src_offset_in_bytes = 0; - job->enc_keys = key; - job->iv = iv; - if (dir_encrypt) { - job->cipher_direction = IMB_DIR_ENCRYPT; - job->dst = dst_ptr; - job->src = plain; - } else { - job->cipher_direction = IMB_DIR_DECRYPT; - job->dst = dst_ptr; - job->src = expected; - } + job->enc_keys = (const void *) v->key; + job->iv = (const void *) v->iv; + job->dst = dst_ptr; + job->cipher_direction = dir; + if (dir == IMB_DIR_ENCRYPT) + job->src = (const void *) v->msg; + else + job->src = (const void *) v->ct; job->auth_tag_output = dst_ptr + size; job->auth_tag_output_len_in_bytes = 16; job->msg_len_to_cipher_in_bytes = size; - job->u.SNOW_V_AEAD.aad = aad; + job->u.SNOW_V_AEAD.aad = v->aad; job->u.SNOW_V_AEAD.aad_len_in_bytes = aad_len; job = IMB_SUBMIT_JOB(p_mgr); @@ -297,13 +215,13 @@ snow_v_aead_single_test(IMB_MGR *p_mgr, struct test_suite_context *ts, const uin printf("Error: %s!\n", imb_get_strerror(err)); fail++; } else { - int fail_found = compare(job->auth_tag_output, expected + size, 16); + int fail_found = compare(job->auth_tag_output, v->tag, v->tagSize / CHAR_BIT); /* check for vector match */ - if (dir_encrypt) - fail_found += compare(dst_ptr, expected, size); + if (dir == IMB_DIR_ENCRYPT) + fail_found += compare(dst_ptr, v->ct, size); else - fail_found += compare(dst_ptr, plain, size); + fail_found += compare(dst_ptr, v->msg, size); fail_found += check_buffer_over_under_write(output, pad_pattern, pad_size, alloc_size); @@ -323,7 +241,6 @@ snow_v_test(IMB_MGR *p_mgr) struct test_suite_context ts_snow_v; struct test_suite_context ts_snow_v_aead; int errors = 0; - uint64_t i; /* flush the scheduler */ while (IMB_FLUSH_JOB(p_mgr) != NULL) @@ -345,25 +262,13 @@ snow_v_test(IMB_MGR *p_mgr) /* Test SNOW-V-GCM */ printf("SNOW-V-AEAD test vectors - ENCRYPT\n"); test_suite_start(&ts_snow_v_aead, "SNOW-V-AEAD"); - - for (i = 0; i < DIM(snow_v_aead_test_vectors); i++) - snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, snow_v_aead_test_vectors[i].KEY, - snow_v_aead_test_vectors[i].IV, - snow_v_aead_test_vectors[i].aad, - snow_v_aead_test_vectors[i].plaintext, - snow_v_aead_test_vectors[i].length_in_bytes, - snow_v_aead_test_vectors[i].aad_length_in_bytes, - snow_v_aead_test_vectors[i].ciphertext, 1); + for (const struct aead_test *v = snow_v_aead_json; v->msg != NULL; v++) + snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, v, IMB_DIR_ENCRYPT); printf("SNOW-V-AEAD test vectors - DECRYPT\n"); - for (i = 0; i < DIM(snow_v_aead_test_vectors); i++) - snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, snow_v_aead_test_vectors[i].KEY, - snow_v_aead_test_vectors[i].IV, - snow_v_aead_test_vectors[i].aad, - snow_v_aead_test_vectors[i].plaintext, - snow_v_aead_test_vectors[i].length_in_bytes, - snow_v_aead_test_vectors[i].aad_length_in_bytes, - snow_v_aead_test_vectors[i].ciphertext, 0); + for (const struct aead_test *v = snow_v_aead_json; v->msg != NULL; v++) + snow_v_aead_single_test(p_mgr, &ts_snow_v_aead, v, IMB_DIR_DECRYPT); + errors += test_suite_end(&ts_snow_v_aead); return errors; diff --git a/test/kat-app/win_x64.mak b/test/kat-app/win_x64.mak index 445f1f4f..6156f7c0 100644 --- a/test/kat-app/win_x64.mak +++ b/test/kat-app/win_x64.mak @@ -29,7 +29,7 @@ APP = imb-kat include ..\common\win_x64_common.mk -TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj zuc_eea3_256.json.obj kasumi_f8.json.obj kasumi_f9.json.obj snow_v_test.json.obj hmac_sm3_test.obj hmac_sm3.json.obj +TEST_OBJS = utils.obj main.obj gcm_test.obj ctr_test.obj customop_test.obj des_test.obj ccm_test.obj cmac_test.obj hmac_sha1_test.obj hmac_sha256_sha512_test.obj hmac_md5_test.obj aes_test.obj sha_test.obj chained_test.obj api_test.obj pon_test.obj ecb_test.obj zuc_eea3_test.obj zuc_eia3_test.obj kasumi_test.obj snow3g_test.obj direct_api_test.obj clear_mem_test.obj hec_test.obj xcbc_test.obj aes_cbcs_test.obj crc_test.obj chacha_test.obj poly1305_test.obj chacha20_poly1305_test.obj null_test.obj snow_v_test.obj direct_api_param_test.obj quic_ecb_test.obj hmac_sha1.json.obj hmac_sha224.json.obj hmac_sha256.json.obj hmac_sha384.json.obj hmac_sha512.json.obj hmac_md5.json.obj gmac_test.obj gmac_test.json.obj ghash_test.obj ghash_test.json.obj poly1305_test.json.obj cmac_test.json.obj xcbc_test.json.obj sha_test.json.obj aes_cfb_test.obj aes_cfb_test.json.obj aes_cbcs_test.json.obj aes_cbc_test.obj aes_cbc_test.json.obj ecb_test.json.obj ctr_test.json.obj chacha_test.json.obj des_test.json.obj gcm_test.json.obj quic_chacha20_test.obj chacha20_poly1305_test.json.obj ccm_test.json.obj snow3g_test_f8_vectors.json.obj snow3g_test_f9_vectors.json.obj sm4_ecb_test.obj sm4_ecb_test.json.obj sm4_cbc_test.obj sm4_cbc_test.json.obj sm3_test.obj sm3_test.json.obj zuc_eia3_128.json.obj zuc_eia3_256.json.obj zuc_eea3_128.json.obj zuc_eea3_256.json.obj kasumi_f8.json.obj kasumi_f9.json.obj snow_v_test.json.obj hmac_sm3_test.obj hmac_sm3.json.obj snow_v_aead.json.obj TEST_LFLAGS = /out:$(APP).exe $(DLFLAGS) -- GitLab From 15b84e4c4afcd20e50fd606df12afb88aded493c Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 6 Nov 2023 12:09:19 +0000 Subject: [PATCH 203/204] Update release notes for v1.5 --- ReleaseNotes.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 57635d71..9eb0f4a4 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,9 +1,12 @@ ======================================================================== Release Notes for Intel(R) Multi-Buffer Crypto for IPsec Library -Unreleased +v1.5 November 2023 ======================================================================= +General +- CMake MinGW support added. + Library - QUIC CHACHA20-POLY1305 and CHACHA20 HP API added. - AVX2-VAES AES-CTR implementation added. @@ -11,6 +14,11 @@ Library - SM4-CBC SSE implementation added. - x86-64 SM3 and SM3-HMAC implementation added. - Self-Test callback functionality added with message corrupt option. +- Implemented AES-GCM with VAES AVX2. +- Implemented AES-CTR with VAES AVX2. +- Implemented a workaround for false load-block condition in SSE AES-CBC implementations. +- Optimized CRC32 algorithms. +- Optimized AES-GCM AVX2 and AVX512 implementations. Test Applications - QUIC CHACHA20-POLY1305 and CHACHA20 HP tests added. @@ -18,6 +26,8 @@ Test Applications - SM3 and SM3-HMAC tests added. - Self-Test callback support added to the KAT-APP. - Updated ACVP app (imb-acvp) to support libacvp v2.0+. +- Test vector standardized for various algorithms (CBC/CFB/CTR/ECB/DES/GCM/CCM/CHACHA20-POLY/SNOW3G/ZUC/KASUMI/SNOW-V). +- Extended xvalid app to test burst API. Performance Applications - New parameter added to benchmark QUIC `--quic-api`. -- GitLab From 8d456b619c97d08841e00082ee2b47ae805059f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Fri, 28 Jun 2024 12:46:20 +0100 Subject: [PATCH 204/204] Update .md files with links to our repository --- INSTALL.md | 4 ++-- README.md | 11 ++++------- SECURITY.md | 6 +++--- perf/README.md | 2 +- test/README.md | 2 +- test/acvp-app/README.md | 4 ++-- test/fuzz-app/README.md | 2 +- test/kat-app/README.md | 2 +- test/xvalid-app/README.md | 2 +- 9 files changed, 16 insertions(+), 19 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index fd2cc010..7ba1cb2a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,8 +2,8 @@ ## Contents -1. [Compilation](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#compilation) -2. [Installation](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) +1. [Compilation](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/INSTALL.md#compilation) +2. [Installation](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/INSTALL.md#installation) ## Compilation diff --git a/README.md b/README.md index 4a64af13..f74bd54a 100644 --- a/README.md +++ b/README.md @@ -304,9 +304,6 @@ security updates. There is just one branch used in the project. All development is done on the main branch. Code taken from the tip of the main branch should not be considered fit for production. -Refer to the releases tab for stable code versions: -https://github.com/intel/intel-ipsec-mb/releases - ## 5. Documentation Full documentation can be found at: https://intel.github.io/intel-ipsec-mb @@ -316,15 +313,15 @@ To generate documentation locally, run: ## 6. Compilation -Refer to the compilation section of the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#compilation) file for instructions. +Refer to the compilation section of the [INSTALL](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/INSTALL.md#compilation) file for instructions. ## 7. Installation -Refer to the installation section of the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) file for instructions. +Refer to the installation section of the [INSTALL](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/INSTALL.md#installation) file for instructions. ## 8. Security Considerations & Options for Increased Security -Refer to the [SECURITY](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#security-considerations--options-for-increased-security) file for security related information. +Refer to the [SECURITY](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/SECURITY.md?ref_type=heads#security-considerations--options-for-increased-security) file for security related information. ## 9. Backwards compatibility @@ -335,7 +332,7 @@ Applications are encouraged to use new symbol names introduced in version 0.54. If required, compatibility symbol mapping can be implemented in the application. See compatibility symbol mapping in v1.3 header file: -https://github.com/intel/intel-ipsec-mb/blob/v1.3/lib/intel-ipsec-mb.h#L246 +https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/v1.3/lib/intel-ipsec-mb.h?ref_type=tags#L247 ## 10. Disclaimer (ZUC, KASUMI, SNOW3G) diff --git a/SECURITY.md b/SECURITY.md index bfbfac09..58ba4359 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Overview -1. [Supported Versions](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#supported-versions) -2. [Reporting a Vulnerability](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#reporting-a-vulnerability) -3. [Security Considerations & Options for Increased Security](https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#security-considerations--options-for-increased-security) +1. [Supported Versions](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/SECURITY.md#supported-versions) +2. [Reporting a Vulnerability](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/SECURITY.md#reporting-a-vulnerability) +3. [Security Considerations & Options for Increased Security](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/SECURITY.md#security-considerations--options-for-increased-security) ## Supported Versions diff --git a/perf/README.md b/perf/README.md index bf9a459c..5efc773e 100644 --- a/perf/README.md +++ b/perf/README.md @@ -15,7 +15,7 @@ The perf directory also contains scripts to add extra functionality to the appli ### Performance Application Before running the application, ensure the library is installed by following the instructions -in the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) file. +in the [INSTALL](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/INSTALL.md#installation) file. To measure AES-GCM-128 encryption performance for all supported architectural implementations: `imb-perf --aead-algo aes-gcm-128 --cipher-dir encrypt > file.txt` diff --git a/test/README.md b/test/README.md index bc0d39c3..77a01722 100644 --- a/test/README.md +++ b/test/README.md @@ -15,4 +15,4 @@ For instructions to install the library, see the Library Installation section be ## Library Installation - On Linux, use standard OS installer to install the "intel-ipsec-mb" package (`apt`, `dnf` etc.) -- Alternatively, build and install the library from source by following the instructions in the [INSTALL](https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation) file. +- Alternatively, build and install the library from source by following the instructions in the [INSTALL](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/INSTALL.md#installation) file. diff --git a/test/acvp-app/README.md b/test/acvp-app/README.md index 2f11db7b..a920ffb4 100644 --- a/test/acvp-app/README.md +++ b/test/acvp-app/README.md @@ -14,12 +14,12 @@ validation of NIST-approved cryptographic algorithms as part of the [CAVP](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program) (Cryptographic Algorithm Validation Program). [libacvp](https://github.com/cisco/libacvp) is used as the client-side implementation [ACVP protocol](github.com/usnistgov/ACVP). -See intel-ipsec-mb [README](https://github.com/intel/intel-ipsec-mb/blob/main/README.md#12-fips-compliance) for details about exercised algorithms and their parameters. +See intel-ipsec-mb [README](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/README.md?ref_type=heads#12-fips-compliance) for details about exercised algorithms and their parameters. ## Usage Before running the application, ensure the library is installed by following the instructions -in the [README](https://github.com/intel/intel-ipsec-mb/tree/main/test#library-installation). +in the [README](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/test/README.md?ref_type=heads#library-installation). Installation of [libacvp](https://github.com/cisco/libacvp) is also required. Please follow its build and install instructions. Minimum version of libacvp is v2.0. diff --git a/test/fuzz-app/README.md b/test/fuzz-app/README.md index 657fdb25..4b10ce38 100644 --- a/test/fuzz-app/README.md +++ b/test/fuzz-app/README.md @@ -22,7 +22,7 @@ the direct API. ## Usage Before running the application, ensure the library is installed by following the instructions -in the [README](https://github.com/intel/intel-ipsec-mb/tree/main/test#library-installation). +in the [README](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/test/README.md#library-installation). **Note:** The library must be compiled with SAFE_PARAM option enabled (default setting). [CLANG/LLVM libFuzzer](https://llvm.org/docs/LibFuzzer.html) package is required for building and running the fuzz applications. ### Linux diff --git a/test/kat-app/README.md b/test/kat-app/README.md index c0be7ec6..257ea8a6 100644 --- a/test/kat-app/README.md +++ b/test/kat-app/README.md @@ -16,7 +16,7 @@ architectures e.g. SSE, AVX, AVX2, AVX512 and prints overall test result "PASS" ## Usage Before running the application, ensure the library is installed by following the instructions -in the [README](https://github.com/intel/intel-ipsec-mb/tree/main/test#library-installation). +in the [README](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/test/README.md#library-installation). ### Linux To test all algorithms across all architectures: diff --git a/test/xvalid-app/README.md b/test/xvalid-app/README.md index 644e913d..5eccb1bc 100644 --- a/test/xvalid-app/README.md +++ b/test/xvalid-app/README.md @@ -21,7 +21,7 @@ from processor registers and memory. ## Usage Before running the application, ensure the library is installed by following the instructions -in the [README](https://github.com/intel/intel-ipsec-mb/tree/main/test#library-installation). +in the [README](https://gitlab.arm.com/arm-reference-solutions/ipsec-mb/-/blob/main/test/README.md#library-installation). ### Linux To cross validate all algorithms across all architectures: -- GitLab