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
dcb4eb36
Commit
dcb4eb36
authored
Jan 07, 2011
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(test_cipher_stream): More debug output on failure.
Rev: nettle/testsuite/testutils.c:1.11
parent
eca24336
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
testsuite/testutils.c
testsuite/testutils.c
+21
-2
No files found.
testsuite/testutils.c
View file @
dcb4eb36
...
...
@@ -321,13 +321,23 @@ test_cipher_stream(const struct nettle_cipher *cipher,
if
(
data
[
i
+
block
]
!=
0x17
)
FAIL
();
}
cipher
->
encrypt
(
ctx
,
length
-
i
,
data
+
i
,
cleartext
+
i
);
if
(
data
[
length
]
!=
0x17
)
FAIL
();
if
(
!
MEMEQ
(
length
,
data
,
ciphertext
))
{
fprintf
(
stderr
,
"Encrypt failed, block size %d
\n
Input:"
,
block
);
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
);
cipher
->
decrypt
(
ctx
,
length
,
data
,
data
);
...
...
@@ -336,7 +346,16 @@ test_cipher_stream(const struct nettle_cipher *cipher,
FAIL
();
if
(
!
MEMEQ
(
length
,
data
,
cleartext
))
{
fprintf
(
stderr
,
"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
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