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
Wim Lewis
nettle
Commits
e4d0f702
Commit
e4d0f702
authored
Jun 25, 2013
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_aead: Allow digest size smaller than the block size.
parent
ed10355f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
ChangeLog
ChangeLog
+3
-0
testsuite/testutils.c
testsuite/testutils.c
+5
-5
No files found.
ChangeLog
View file @
e4d0f702
2013-06-25 Niels Möller <nisse@lysator.liu.se>
* testsuite/testutils.c (test_aead): Allow digest size smaller
than the block size.
* tools/nettle-pbkdf2.c: New command line tool.
* tools/Makefile.in (TARGETS): Added nettle-pbkdf2.
(nettle-pbkdf2$(EXEEXT)): New target.
...
...
testsuite/testutils.c
View file @
e4d0f702
...
...
@@ -476,7 +476,7 @@ test_aead(const struct nettle_aead *aead,
ASSERT
(
cleartext
->
length
==
ciphertext
->
length
);
length
=
cleartext
->
length
;
ASSERT
(
digest
->
length
=
=
aead
->
block_size
);
ASSERT
(
digest
->
length
<
=
aead
->
block_size
);
data
=
xalloc
(
length
);
...
...
@@ -492,10 +492,10 @@ test_aead(const struct nettle_aead *aead,
if
(
length
)
aead
->
encrypt
(
ctx
,
length
,
data
,
cleartext
->
data
);
aead
->
digest
(
ctx
,
aead
->
block_size
,
buffer
);
aead
->
digest
(
ctx
,
digest
->
length
,
buffer
);
ASSERT
(
MEMEQ
(
length
,
data
,
ciphertext
->
data
));
ASSERT
(
MEMEQ
(
aead
->
block_size
,
buffer
,
digest
->
data
));
ASSERT
(
MEMEQ
(
digest
->
length
,
buffer
,
digest
->
data
));
/* decryption */
memset
(
buffer
,
0
,
aead
->
block_size
);
...
...
@@ -507,10 +507,10 @@ test_aead(const struct nettle_aead *aead,
if
(
length
)
aead
->
decrypt
(
ctx
,
length
,
data
,
data
);
aead
->
digest
(
ctx
,
aead
->
block_size
,
buffer
);
aead
->
digest
(
ctx
,
digest
->
length
,
buffer
);
ASSERT
(
MEMEQ
(
length
,
data
,
cleartext
->
data
));
ASSERT
(
MEMEQ
(
aead
->
block_size
,
buffer
,
digest
->
data
));
ASSERT
(
MEMEQ
(
digest
->
length
,
buffer
,
digest
->
data
));
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