From: "Wang, Shane" Subject: RE: [PATCH] to fix vmac test fails on s390 Date: Sun, 21 Feb 2010 13:32:49 +0800 Message-ID: <6CADD16F56BC954D8E28F3836FA7ED71282AC1E357@shzsmsx501.ccr.corp.intel.com> References: <1263477930.5880.22.camel@bender> <20100117110546.GA32690@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="_002_6CADD16F56BC954D8E28F3836FA7ED71282AC1E357shzsmsx501ccr_" Cc: linux-crypto To: Herbert Xu , Jan Glauber , "Cihula, Joseph" Return-path: Received: from mga11.intel.com ([192.55.52.93]:41495 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041Ab0BUFdc (ORCPT ); Sun, 21 Feb 2010 00:33:32 -0500 Content-Language: en-US Sender: linux-crypto-owner@vger.kernel.org List-ID: --_002_6CADD16F56BC954D8E28F3836FA7ED71282AC1E357shzsmsx501ccr_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is to fix the vmac algorithm, add more test cases for vmac, and = fix the test failure on some big endian system like s390. Signed-off-by: Shane Wang crypto/testmgr.h | 64 +++++++++++++++++++++++++++++++++++-- crypto/vmac.c | 77 ++++++++++++++++++++++----------------------- 2 files changed, 99 insertions(+), 42 deletions(-) diff -r 91636f5ce7a2 crypto/testmgr.h --- a/crypto/testmgr.h Thu Feb 11 00:45:57 2010 -0800 +++ b/crypto/testmgr.h Sun Feb 21 02:23:01 2010 -0800 @@ -1669,17 +1669,73 @@ static struct hash_testvec aes_xcbc128_t } }; =20 -#define VMAC_AES_TEST_VECTORS 1 -static char vmac_string[128] =3D {'\x01', '\x01', '\x01', '\x01', +#define VMAC_AES_TEST_VECTORS 8 +static char vmac_string1[128] =3D {'\x01', '\x01', '\x01', '\x01', '\x02', '\x03', '\x02', '\x02', '\x02', '\x04', '\x01', '\x07', '\x04', '\x01', '\x04', '\x03',}; +static char vmac_string2[128] =3D {'a', 'b', 'c',}; +static char vmac_string3[128] =3D {'a', 'b', 'c', 'a', 'b', 'c', + 'a', 'b', 'c', 'a', 'b', 'c', + 'a', 'b', 'c', 'a', 'b', 'c', + 'a', 'b', 'c', 'a', 'b', 'c', + 'a', 'b', 'c', 'a', 'b', 'c', + 'a', 'b', 'c', 'a', 'b', 'c', + 'a', 'b', 'c', 'a', 'b', 'c', + 'a', 'b', 'c', 'a', 'b', 'c', + }; + static struct hash_testvec aes_vmac128_tv_template[] =3D { { + .key =3D "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + .plaintext =3D NULL, + .digest =3D "\x07\x58\x80\x35\x77\xa4\x7b\x54", + .psize =3D 0, + .ksize =3D 16, + }, { .key =3D "\x00\x01\x02\x03\x04\x05\x06\x07" "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", - .plaintext =3D vmac_string, - .digest =3D "\xcb\xd7\x8a\xfd\xb7\x33\x79\xe7", + .plaintext =3D vmac_string1, + .digest =3D "\xce\xf5\x3c\xd3\xae\x68\x8c\xa1", + .psize =3D 128, + .ksize =3D 16, + }, { + .key =3D "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + .plaintext =3D vmac_string2, + .digest =3D "\xc9\x27\xb0\x73\x81\xbd\x14\x2d", + .psize =3D 128, + .ksize =3D 16, + }, { + .key =3D "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + .plaintext =3D vmac_string3, + .digest =3D "\x8d\x1a\x95\x8c\x98\x47\x0b\x19", + .psize =3D 128, + .ksize =3D 16, + }, { + .key =3D "abcdefghijklmnop", + .plaintext =3D NULL, + .digest =3D "\x3b\x89\xa1\x26\x9e\x55\x8f\x84", + .psize =3D 0, + .ksize =3D 16, + }, { + .key =3D "abcdefghijklmnop", + .plaintext =3D vmac_string1, + .digest =3D "\xab\x5e\xab\xb0\xf6\x8d\x74\xc2", + .psize =3D 128, + .ksize =3D 16, + }, { + .key =3D "abcdefghijklmnop", + .plaintext =3D vmac_string2, + .digest =3D "\x11\x15\x68\x42\x3d\x7b\x09\xdf", + .psize =3D 128, + .ksize =3D 16, + }, { + .key =3D "abcdefghijklmnop", + .plaintext =3D vmac_string3, + .digest =3D "\x8b\x32\x8f\xe1\xed\x8f\xfa\xd4", .psize =3D 128, .ksize =3D 16, }, diff -r 91636f5ce7a2 crypto/vmac.c --- a/crypto/vmac.c Thu Feb 11 00:45:57 2010 -0800 +++ b/crypto/vmac.c Sun Feb 21 02:23:01 2010 -0800 @@ -42,6 +42,8 @@ const u64 m63 =3D UINT64_C(0x7ffffffffff const u64 m63 =3D UINT64_C(0x7fffffffffffffff); /* 63-bit mask */ const u64 m64 =3D UINT64_C(0xffffffffffffffff); /* 64-bit mask */ const u64 mpoly =3D UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ + +#define pe64_to_cpup le64_to_cpup /* Prefer little endian */ =20 #ifdef __LITTLE_ENDIAN #define INDEX_HIGH 1 @@ -110,8 +112,8 @@ const u64 mpoly =3D UINT64_C(0x1fffffff1ff int i; u64 th, tl; \ rh =3D rl =3D 0; \ for (i =3D 0; i < nw; i +=3D 2) { \ - MUL64(th, tl, le64_to_cpup((mp)+i)+(kp)[i], \ - le64_to_cpup((mp)+i+1)+(kp)[i+1]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i)+(kp)[i], \ + pe64_to_cpup((mp)+i+1)+(kp)[i+1]); \ ADD128(rh, rl, th, tl); \ } \ } while (0) @@ -121,11 +123,11 @@ const u64 mpoly =3D UINT64_C(0x1fffffff1ff int i; u64 th, tl; \ rh1 =3D rl1 =3D rh =3D rl =3D 0; \ for (i =3D 0; i < nw; i +=3D 2) { \ - MUL64(th, tl, le64_to_cpup((mp)+i)+(kp)[i], \ - le64_to_cpup((mp)+i+1)+(kp)[i+1]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i)+(kp)[i], \ + pe64_to_cpup((mp)+i+1)+(kp)[i+1]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i)+(kp)[i+2], \ - le64_to_cpup((mp)+i+1)+(kp)[i+3]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i)+(kp)[i+2], \ + pe64_to_cpup((mp)+i+1)+(kp)[i+3]); \ ADD128(rh1, rl1, th, tl); \ } \ } while (0) @@ -136,17 +138,17 @@ const u64 mpoly =3D UINT64_C(0x1fffffff1ff int i; u64 th, tl; \ rh =3D rl =3D 0; \ for (i =3D 0; i < nw; i +=3D 8) { \ - MUL64(th, tl, le64_to_cpup((mp)+i)+(kp)[i], \ - le64_to_cpup((mp)+i+1)+(kp)[i+1]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i)+(kp)[i], \ + pe64_to_cpup((mp)+i+1)+(kp)[i+1]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+2)+(kp)[i+2], \ - le64_to_cpup((mp)+i+3)+(kp)[i+3]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+2)+(kp)[i+2], \ + pe64_to_cpup((mp)+i+3)+(kp)[i+3]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+4)+(kp)[i+4], \ - le64_to_cpup((mp)+i+5)+(kp)[i+5]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+4)+(kp)[i+4], \ + pe64_to_cpup((mp)+i+5)+(kp)[i+5]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+6)+(kp)[i+6], \ - le64_to_cpup((mp)+i+7)+(kp)[i+7]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+6)+(kp)[i+6], \ + pe64_to_cpup((mp)+i+7)+(kp)[i+7]); \ ADD128(rh, rl, th, tl); \ } \ } while (0) @@ -156,29 +158,29 @@ const u64 mpoly =3D UINT64_C(0x1fffffff1ff int i; u64 th, tl; \ rh1 =3D rl1 =3D rh =3D rl =3D 0; \ for (i =3D 0; i < nw; i +=3D 8) { \ - MUL64(th, tl, le64_to_cpup((mp)+i)+(kp)[i], \ - le64_to_cpup((mp)+i+1)+(kp)[i+1]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i)+(kp)[i], \ + pe64_to_cpup((mp)+i+1)+(kp)[i+1]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i)+(kp)[i+2], \ - le64_to_cpup((mp)+i+1)+(kp)[i+3]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i)+(kp)[i+2], \ + pe64_to_cpup((mp)+i+1)+(kp)[i+3]); \ ADD128(rh1, rl1, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+2)+(kp)[i+2], \ - le64_to_cpup((mp)+i+3)+(kp)[i+3]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+2)+(kp)[i+2], \ + pe64_to_cpup((mp)+i+3)+(kp)[i+3]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+2)+(kp)[i+4], \ - le64_to_cpup((mp)+i+3)+(kp)[i+5]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+2)+(kp)[i+4], \ + pe64_to_cpup((mp)+i+3)+(kp)[i+5]); \ ADD128(rh1, rl1, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+4)+(kp)[i+4], \ - le64_to_cpup((mp)+i+5)+(kp)[i+5]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+4)+(kp)[i+4], \ + pe64_to_cpup((mp)+i+5)+(kp)[i+5]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+4)+(kp)[i+6], \ - le64_to_cpup((mp)+i+5)+(kp)[i+7]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+4)+(kp)[i+6], \ + pe64_to_cpup((mp)+i+5)+(kp)[i+7]); \ ADD128(rh1, rl1, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+6)+(kp)[i+6], \ - le64_to_cpup((mp)+i+7)+(kp)[i+7]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+6)+(kp)[i+6], \ + pe64_to_cpup((mp)+i+7)+(kp)[i+7]); \ ADD128(rh, rl, th, tl); \ - MUL64(th, tl, le64_to_cpup((mp)+i+6)+(kp)[i+8], \ - le64_to_cpup((mp)+i+7)+(kp)[i+9]); \ + MUL64(th, tl, pe64_to_cpup((mp)+i+6)+(kp)[i+8], \ + pe64_to_cpup((mp)+i+7)+(kp)[i+9]); \ ADD128(rh1, rl1, th, tl); \ } \ } while (0) @@ -216,8 +218,8 @@ const u64 mpoly =3D UINT64_C(0x1fffffff1ff int i; \ rh =3D rl =3D t =3D 0; \ for (i =3D 0; i < nw; i +=3D 2) { \ - t1 =3D le64_to_cpup(mp+i) + kp[i]; \ - t2 =3D le64_to_cpup(mp+i+1) + kp[i+1]; \ + t1 =3D pe64_to_cpup(mp+i) + kp[i]; \ + t2 =3D pe64_to_cpup(mp+i+1) + kp[i+1]; \ m2 =3D MUL32(t1 >> 32, t2); \ m1 =3D MUL32(t1, t2 >> 32); \ ADD128(rh, rl, MUL32(t1 >> 32, t2 >> 32), \ @@ -322,8 +324,7 @@ static void vhash_abort(struct vmac_ctx=20 ctx->first_block_processed =3D 0; } =20 -static u64 l3hash(u64 p1, u64 p2, - u64 k1, u64 k2, u64 len) +static u64 l3hash(u64 p1, u64 p2, u64 k1, u64 k2, u64 len) { u64 rh, rl, t, z =3D 0; =20 @@ -549,10 +550,6 @@ static int vmac_setkey(struct crypto_sha =20 static int vmac_init(struct shash_desc *pdesc) { - struct crypto_shash *parent =3D pdesc->tfm; - struct vmac_ctx_t *ctx =3D crypto_shash_ctx(parent); - - memset(&ctx->__vmac_ctx, 0, sizeof(struct vmac_ctx)); return 0; } =20 @@ -575,6 +572,10 @@ static int vmac_final(struct shash_desc=20 u8 nonce[16] =3D {}; =20 mac =3D vmac(NULL, 0, nonce, NULL, ctx); + + /* set output invariant considering endianness */ + mac =3D le64_to_cpup(&mac); + memcpy(out, &mac, sizeof(vmac_t)); memset(&mac, 0, sizeof(vmac_t)); memset(&ctx->__vmac_ctx, 0, sizeof(struct vmac_ctx));= --_002_6CADD16F56BC954D8E28F3836FA7ED71282AC1E357shzsmsx501ccr_ Content-Type: application/octet-stream; name="vmac_fix.patch" Content-Description: vmac_fix.patch Content-Disposition: attachment; filename="vmac_fix.patch"; size=8564; creation-date="Sat, 21 Feb 2009 05:27:00 GMT"; modification-date="Sat, 21 Feb 2009 05:27:00 GMT" Content-Transfer-Encoding: base64 VGhpcyBwYXRjaCBpcyB0byBmaXggdGhlIHZtYWMgYWxnb3JpdGhtLCBhZGQgbW9yZSB0ZXN0IGNh c2VzIGZvciB2bWFjLCBhbmQgZml4IHRoZSB0ZXN0IGZhaWx1cmUgb24gc29tZSBiaWcgZW5kaWFu IHN5c3RlbSBsaWtlIHMzOTAuCgpTaWduZWQtb2ZmLWJ5OiBTaGFuZSBXYW5nIDxzaGFuZS53YW5n QGludGVsLmNvbT4KCmRpZmYgLXIgOTE2MzZmNWNlN2EyIGNyeXB0by90ZXN0bWdyLmgKLS0tIGEv Y3J5cHRvL3Rlc3RtZ3IuaAlUaHUgRmViIDExIDAwOjQ1OjU3IDIwMTAgLTA4MDAKKysrIGIvY3J5 cHRvL3Rlc3RtZ3IuaAlTdW4gRmViIDIxIDAyOjIzOjAxIDIwMTAgLTA4MDAKQEAgLTE2NjksMTcg KzE2NjksNzMgQEAgc3RhdGljIHN0cnVjdCBoYXNoX3Rlc3R2ZWMgYWVzX3hjYmMxMjhfdAogCX0K IH07CiAKLSNkZWZpbmUgVk1BQ19BRVNfVEVTVF9WRUNUT1JTCTEKLXN0YXRpYyBjaGFyIHZtYWNf c3RyaW5nWzEyOF0gPSB7J1x4MDEnLCAnXHgwMScsICdceDAxJywgJ1x4MDEnLAorI2RlZmluZSBW TUFDX0FFU19URVNUX1ZFQ1RPUlMJOAorc3RhdGljIGNoYXIgdm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