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
Wim Lewis
nettle
Commits
c6b4dce5
Commit
c6b4dce5
authored
Sep 09, 2001
by
Niels Möller
Browse files
* testsuite/des3-test.m4: New testcase.
Rev: src/nettle/testsuite/des3-test.m4:1.1
parent
250c4c17
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/des3-test.m4
0 → 100644
View file @
c6b4dce5
#include "des.h"
BEGIN_TEST
struct des3_ctx ctx;
uint8_t msg[DES3_BLOCK_SIZE] = "Now is t";
uint8_t cipher[DES3_BLOCK_SIZE];
uint8_t clear[DES3_BLOCK_SIZE];
/* Intermediate values: "cd ea 2a 20 c2 e0 9e 48"
* "69 52 6e 95 8b ea 49 bd"
*/
if (!des3_set_key(&ctx, H("3e 0b 10 b0 5d 49 c2 54"
"6b 46 e0 75 8a 91 61 85"
"cb 04 07 d3 20 16 cb a2")))
FAIL;
des3_encrypt(&ctx, DES_BLOCK_SIZE, cipher, msg);
if (!MEMEQ(DES_BLOCK_SIZE, cipher,
H("0a 5d b5 2d 85 74 d1 c9")))
FAIL;
des3_decrypt(&ctx, DES_BLOCK_SIZE, clear, cipher);
if (!MEMEQ(DES_BLOCK_SIZE, msg, clear))
FAIL;
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