Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
b8965571
Commit
b8965571
authored
Oct 14, 2001
by
Niels Möller
Browse files
* testsuite/des-test.m4: Added testcase taken from applied
cryptography. Rev: src/nettle/testsuite/des-test.m4:1.2
parent
7f04df73
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/des-test.m4
View file @
b8965571
...
...
@@ -8,6 +8,23 @@ uint8_t msg[DES_BLOCK_SIZE];
uint8_t cipher[DES_BLOCK_SIZE];
uint8_t clear[DES_BLOCK_SIZE];
/* From Applied Cryptography */
H(msg, "01234567 89ABCDE7");
if (!des_set_key(&ctx, H("01234567 89ABCDEF")))
FAIL;
des_encrypt(&ctx, DES_BLOCK_SIZE, cipher, msg);
if (!MEMEQ(DES_BLOCK_SIZE, cipher,
H("C9574425 6A5ED31D")))
FAIL;
des_decrypt(&ctx, DES_BLOCK_SIZE, clear, cipher);
if (!MEMEQ(DES_BLOCK_SIZE, msg, clear))
FAIL;
H(msg, "00 00 00 00 00 00 00 00");
if (!des_set_key(&ctx, H("01 01 01 01 01 01 01 80")))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment