X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/e5b61a8dec3586f96d25bd3ef454176526ff0f69..8f2287ef5c05d496fcb9b012629af007fe56f897:/symm/safer.c diff --git a/symm/safer.c b/symm/safer.c index 8dd31cbf..569eb839 100644 --- a/symm/safer.c +++ b/symm/safer.c @@ -59,8 +59,8 @@ extern const octet safer_s[256], safer_si[256]; * * Returns: --- * - * Use: Initializes an SAFER expanded key. A default number of - * rounds is chosen, based on the key length. + * Use: Initializes an SAFER expanded key, with lots of options + * controlling how to do it. */ struct ksched { @@ -252,7 +252,6 @@ void safersk_init(safer_ctx *k, const void *buf, size_t sz) KXS(k, a, b, c, d, e, f, g, h); \ } while (0) - void safer_eblk(const safer_ctx *k, const uint32 *src, uint32 *dst) { octet a, b, c, d, e, f, g, h; @@ -319,6 +318,29 @@ void safer_dblk(const safer_ctx *k, const uint32 *src, uint32 *dst) PACK(dst, a, b, c, d, e, f, g, h); } -BLKC_TEST(SAFER, safer) +/*----- Test rig ----------------------------------------------------------*/ + +#ifdef TEST_RIG + +#include + +#define CIPHERS(_) \ + _(SAFER, safer) \ + _(SAFERSK, safersk) + +CIPHERS(BLKC_VERIFY) + +static const test_chunk defs[] = { + CIPHERS(BLKC_TESTDEFS) + { 0, 0, { 0 } } +}; + +int main(int argc, char *argv[]) +{ + test_run(argc, argv, defs, SRCDIR "/t/safer"); + return (0); +} + +#endif /*----- That's all, folks -------------------------------------------------*/