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
483a00e3
Commit
483a00e3
authored
Sep 30, 2010
by
Niels Möller
Browse files
(test_cipher_cbc): Print more info when failing.
Rev: nettle/testsuite/testutils.c:1.10
parent
7d838d50
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/testutils.c
View file @
483a00e3
...
...
@@ -225,8 +225,16 @@ test_cipher_cbc(const struct nettle_cipher *cipher,
length
,
data
,
cleartext
);
if
(
!
MEMEQ
(
length
,
data
,
ciphertext
))
FAIL
();
{
fprintf
(
stderr
,
"CBC encrypt failed:
\n
Input:"
);
print_hex
(
length
,
cleartext
);
fprintf
(
stderr
,
"
\n
Output: "
);
print_hex
(
length
,
data
);
fprintf
(
stderr
,
"
\n
Expected:"
);
print_hex
(
length
,
ciphertext
);
fprintf
(
stderr
,
"
\n
"
);
FAIL
();
}
cipher
->
set_decrypt_key
(
ctx
,
key_length
,
key
);
memcpy
(
iv
,
iiv
,
cipher
->
block_size
);
...
...
@@ -235,8 +243,16 @@ test_cipher_cbc(const struct nettle_cipher *cipher,
length
,
data
,
data
);
if
(
!
MEMEQ
(
length
,
data
,
cleartext
))
FAIL
();
{
fprintf
(
stderr
,
"CBC decrypt failed:
\n
Input:"
);
print_hex
(
length
,
ciphertext
);
fprintf
(
stderr
,
"
\n
Output: "
);
print_hex
(
length
,
data
);
fprintf
(
stderr
,
"
\n
Expected:"
);
print_hex
(
length
,
cleartext
);
fprintf
(
stderr
,
"
\n
"
);
FAIL
();
}
free
(
ctx
);
free
(
data
);
free
(
iv
);
...
...
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