diff options
author | René Korthaus <[email protected]> | 2016-07-07 15:14:28 +0200 |
---|---|---|
committer | René Korthaus <[email protected]> | 2016-07-11 10:43:04 +0200 |
commit | 5fb452e9045cf8179faca5c76e7fa8c0fcd815cc (patch) | |
tree | 6b6d11defac283f88dea540edb89e91257c709a1 /src/tests/data/pad.vec | |
parent | 2b3f4270371d376e1500b68f4955548b659d2011 (diff) |
Add test vectors for block cipher padding modes
Exports get_bc_pad() to be used from tests. Adds separate handcrafted
tests for block cipher padding modes. They were previously only tested
implicitly during the block cipher modes of operation tests, though not
all padding modes were covered. And in case a mode of operation is
not part of the enabled modules, the previously tested padding modes
are not covered at all. Fixes an off-by-one bug in the previously
untested ANSI X9.23 padding mode, where the number of zero bytes
in the pad was one more than allowed by the standard.
Diffstat (limited to 'src/tests/data/pad.vec')
-rw-r--r-- | src/tests/data/pad.vec | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/tests/data/pad.vec b/src/tests/data/pad.vec new file mode 100644 index 000000000..3c47959c9 --- /dev/null +++ b/src/tests/data/pad.vec @@ -0,0 +1,83 @@ +[NoPadding] +In = FFFFFF +Out = FFFFFF +Blocksize = 16 + +In = FFFFFFFF +Out = FFFFFFFF +Blocksize = 32 + +In = FFFFFFFFFFFF +Out = FFFFFFFFFFFF +Blocksize = 64 + +In = FFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFF +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFF +Blocksize = 8 + +[PKCS7] +In = FFFFFF +Out = FFFFFF0D0D0D0D0D0D0D0D0D0D0D0D0D +Blocksize = 16 + +In = FFFFFFFF +Out = FFFFFFFF1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C +Blocksize = 32 + +In = FFFFFFFFFFFF +Out = FFFFFFFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +Blocksize = 64 + +In = FFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFF0808080808080808 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFF07070707070707 +Blocksize = 8 + +[OneAndZeros] +In = FFFFFF +Out = FFFFFF80000000000000000000000000 +Blocksize = 16 + +In = FFFFFFFF +Out = FFFFFFFF80000000000000000000000000000000000000000000000000000000 +Blocksize = 32 + +In = FFFFFFFFFFFF +Out = FFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Blocksize = 64 + +In = FFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFF8000000000000000 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFF80000000000000 +Blocksize = 8 + +[X9.23] +In = FFFFFF +Out = FFFFFF0000000000000000000000000D +Blocksize = 16 + +In = FFFFFFFF +Out = FFFFFFFF0000000000000000000000000000000000000000000000000000001C +Blocksize = 32 + +In = FFFFFFFFFFFF +Out = FFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003A +Blocksize = 64 + +In = FFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFF0000000000000008 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFF00000000000007 +Blocksize = 8
\ No newline at end of file |