Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nettle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Nettle
nettle
Commits
2152b303
Commit
2152b303
authored
Mar 11, 2013
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test different alignment for hash input.
parent
4ac1b5f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
ChangeLog
ChangeLog
+5
-0
testsuite/testutils.c
testsuite/testutils.c
+19
-0
No files found.
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
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