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
bf3390de
Commit
bf3390de
authored
Jun 29, 2011
by
Niels Möller
Browse files
(test_cipher_ctr): Display more info on failure.
Rev: nettle/testsuite/testutils.c:1.15
parent
a520be22
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/testutils.c
View file @
bf3390de
...
...
@@ -280,7 +280,16 @@ test_cipher_ctr(const struct nettle_cipher *cipher,
length
,
data
,
cleartext
);
if
(
!
MEMEQ
(
length
,
data
,
ciphertext
))
FAIL
();
{
fprintf
(
stderr
,
"CTR 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
();
}
memcpy
(
ctr
,
ictr
,
cipher
->
block_size
);
...
...
@@ -289,7 +298,16 @@ test_cipher_ctr(const struct nettle_cipher *cipher,
length
,
data
,
data
);
if
(
!
MEMEQ
(
length
,
data
,
cleartext
))
FAIL
();
{
fprintf
(
stderr
,
"CTR 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
);
...
...
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