Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
536beb7b
Commit
536beb7b
authored
Jun 15, 2001
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added one test, from GNUPG.
Rev: src/nettle/testsuite/blowfish-test.m4:1.2
parent
3f1a196e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
testsuite/blowfish-test.m4
testsuite/blowfish-test.m4
+14
-1
No files found.
testsuite/blowfish-test.m4
View file @
536beb7b
...
...
@@ -2,13 +2,25 @@
BEGIN_TEST
/* FIXME: All values below are bogus. */
struct blowfish_ctx ctx;
uint8_t msg[BLOWFISH_BLOCK_SIZE];
uint8_t cipher[BLOWFISH_BLOCK_SIZE];
uint8_t clear[BLOWFISH_BLOCK_SIZE];
/* 128 bit key. Test from GNUPG. */
blowfish_set_key(&ctx, 16, "abcdefghijklmnopqrstuvwxyz"));
blowfish_encrypt(&ctx, BLOWFISH_BLOCK_SIZE, cipher, "BLOWFISH");
if (!MEMEQ(BLOWFISH_BLOCK_SIZE, cipher, H("32 4E D0 FE F4 13 A2 03")))
FAIL;
blowfish_decrypt(&ctx, BLOWFISH_BLOCK_SIZE, clear, cipher);
if (!MEMEQ(16, "BLOWFISH", clear))
FAIL;
/* FIXME: All values below are bogus. */
#if 0
/* 128 bit keys */
H(msg, "506812A45F08C889 B97F5980038B8359");
...
...
@@ -79,3 +91,4 @@ if (!MEMEQ(16, cipher, H("1946DABF6A03A2A2 C3D0B05080AED6FC")))
blowfish_decrypt(&ctx, BLOWFISH_BLOCK_SIZE, clear, cipher);
if (!MEMEQ(16, msg, clear))
FAIL;
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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