Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Brian Smith
nettle
Commits
2152b303
Commit
2152b303
authored
Mar 11, 2013
by
Niels Möller
Browse files
Test different alignment for hash input.
parent
4ac1b5f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
2152b303
2013-03-11 Niels Möller <nisse@lysator.liu.se>
* testsuite/testutils.c (test_hash): Test different alignments for
the hash input.
2013-03-08 Niels Möller <nisse@lysator.liu.se>
* armv7/aes-decrypt-internal.asm: New file, 15% speedup.
...
...
testsuite/testutils.c
View file @
2152b303
...
...
@@ -523,6 +523,8 @@ test_hash(const struct nettle_hash *hash,
{
void
*
ctx
=
xalloc
(
hash
->
context_size
);
uint8_t
*
buffer
=
xalloc
(
hash
->
digest_size
);
uint8_t
*
input
;
unsigned
offset
;
ASSERT
(
digest
->
length
==
hash
->
digest_size
);
...
...
@@ -549,8 +551,25 @@ test_hash(const struct nettle_hash *hash,
ASSERT
(
buffer
[
hash
->
digest_size
-
1
]
==
0
);
input
=
xalloc
(
msg
->
length
+
16
);
for
(
offset
=
0
;
offset
<
16
;
offset
++
)
{
memset
(
input
,
0
,
msg
->
length
+
16
);
memcpy
(
input
+
offset
,
msg
->
data
,
msg
->
length
);
hash
->
update
(
ctx
,
msg
->
length
,
input
+
offset
);
hash
->
digest
(
ctx
,
hash
->
digest_size
,
buffer
);
if
(
MEMEQ
(
hash
->
digest_size
,
digest
->
data
,
buffer
)
==
0
)
{
fprintf
(
stdout
,
"hash input address: %p
\n
Got:
\n
"
,
input
+
offset
);
print_hex
(
hash
->
digest_size
,
buffer
);
fprintf
(
stdout
,
"
\n
Expected:
\n
"
);
print_hex
(
hash
->
digest_size
,
digest
->
data
);
abort
();
}
}
free
(
ctx
);
free
(
buffer
);
free
(
input
);
}
void
...
...
Write
Preview
Supports
Markdown
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