symm/*-def.h: Overhaul encryption mode testing.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 29 Oct 2018 22:48:49 +0000 (22:48 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 25 Nov 2018 11:38:04 +0000 (11:38 +0000)
Introduce a new source file (not part of the library proper) containing
the main code.  The old version only checked that the modes supported
round trips.  This is an improvement in several respects:

  * The per-mode code is now nearly trivial, and specific to the mode in
    question.

  * The new code checks that block-aligned (at least, in the case of ECB
    and CBC) or arbitrarily misaligned (in the case of CFB, OFB,
    counter, and MGF1, which are resumable) splits result in identical
    ciphertexts.

  * The new code can generate and/or check against regression-test
    data (in a binary format, because these can be big for non-resumable
    modes) to prevent cross-version interoperability bugs.  This data is
    generated automatically by `make distdir', and version controlled.


No differences found