Mercurial > dropbear
diff libtomcrypt/src/modes/lrw/lrw_test.c @ 1471:6dba84798cd5
Update to libtomcrypt 1.18.1, merged with Dropbear changes
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 09 Feb 2018 21:44:05 +0800 |
parents | f849a5ca2efc |
children |
line wrap: on
line diff
--- a/libtomcrypt/src/modes/lrw/lrw_test.c Thu Feb 08 23:11:40 2018 +0800 +++ b/libtomcrypt/src/modes/lrw/lrw_test.c Fri Feb 09 21:44:05 2018 +0800 @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, [email protected], http://libtom.org */ #include "tomcrypt.h" @@ -88,7 +86,7 @@ } /* check pad against expected tweak */ - if (XMEMCMP(tests[x].expected_tweak, lrw.pad, 16)) { + if (compare_testvector(tests[x].expected_tweak, 16, lrw.pad, 16, "LRW Tweak", x)) { lrw_done(&lrw); return CRYPT_FAIL_TESTVECTOR; } @@ -99,13 +97,13 @@ return err; } - if (XMEMCMP(buf[0], tests[x].C, 16)) { + if (compare_testvector(buf[0], 16, tests[x].C, 16, "LRW Encrypt", x)) { lrw_done(&lrw); return CRYPT_FAIL_TESTVECTOR; } /* process block */ - if ((err = lrw_setiv(tests[x].IV, 16, &lrw)) != CRYPT_OK) { + if ((err = lrw_setiv(tests[x].IV, 16, &lrw)) != CRYPT_OK) { lrw_done(&lrw); return err; } @@ -115,15 +113,15 @@ return err; } - if (XMEMCMP(buf[1], tests[x].P, 16)) { + if (compare_testvector(buf[1], 16, tests[x].P, 16, "LRW Decrypt", x)) { lrw_done(&lrw); return CRYPT_FAIL_TESTVECTOR; } if ((err = lrw_done(&lrw)) != CRYPT_OK) { return err; } - } - return CRYPT_OK; + } + return CRYPT_OK; #endif } @@ -131,6 +129,6 @@ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */