Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wim Lewis
nettle
Commits
6f1bc64d
Commit
6f1bc64d
authored
23 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Updated expected_output. Check the seed
file contents at the end. Rev: src/nettle/testsuite/yarrow-test.c:1.6
parent
607095de
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/yarrow-test.c
+27
-6
27 additions, 6 deletions
testsuite/yarrow-test.c
with
27 additions
and
6 deletions
testsuite/yarrow-test.c
+
27
−
6
View file @
6f1bc64d
...
...
@@ -135,11 +135,11 @@ get_event(FILE *f, struct sha256_ctx *hash,
}
static
void
print_
digest
(
uint8_t
*
digest
)
print_
hex
(
unsigned
length
,
uint8_t
*
digest
)
{
unsigned
i
;
for
(
i
=
0
;
i
<
SHA256_DIGEST_SIZE
;
i
++
)
for
(
i
=
0
;
i
<
length
;
i
++
)
{
if
(
!
(
i
%
8
))
fprintf
(
stderr
,
" "
);
...
...
@@ -180,13 +180,17 @@ main(int argc, char **argv)
uint8_t
digest
[
SHA256_DIGEST_SIZE
];
const
uint8_t
*
expected_output
=
decode_hex_dup
(
"
51126a67cac6dff1 1d2ee4fe67cefa7e
"
"
151f1f8deec69d71 000eb6c6fb3fc65f
"
);
=
decode_hex_dup
(
"
6af27fa0a2751256 a17b64df80838abb
"
"
76a84038d98fadd7 e79b619b3e1d8b18
"
);
const
uint8_t
*
expected_input
=
decode_hex_dup
(
"fec4c0767434a8a3 22d6d5d0c9f49c42"
"988ce8c159b1a806 29d51aa40c2e99aa"
);
const
uint8_t
*
expected_seed_file
=
decode_hex_dup
(
"b3674735824f6504 edcb07a883f16482"
"a2b1855992441ced 812d8ffda99af0e0"
);
unsigned
c
;
unsigned
t
;
unsigned
processed
=
0
;
...
...
@@ -202,6 +206,8 @@ main(int argc, char **argv)
verbose
=
1
;
yarrow256_init
(
&
yarrow
,
2
,
sources
);
memset
(
&
yarrow
.
seed_file
,
0
,
sizeof
(
yarrow
.
seed_file
));
yarrow_key_event_init
(
&
estimator
);
sha256_init
(
&
input_hash
);
sha256_init
(
&
output_hash
);
...
...
@@ -267,6 +273,8 @@ main(int argc, char **argv)
if
(
verbose
)
{
fprintf
(
stderr
,
"
\n
"
);
for
(
i
=
0
;
i
<
2
;
i
++
)
fprintf
(
stderr
,
"source %d, (fast, slow) entropy: (%d, %d)
\n
"
,
i
,
...
...
@@ -281,7 +289,7 @@ main(int argc, char **argv)
if
(
verbose
)
{
print_digest
(
digest
);
print_
hex
(
sizeof
(
digest
),
digest
);
fprintf
(
stderr
,
"
\n
"
);
}
...
...
@@ -291,6 +299,19 @@ main(int argc, char **argv)
return
EXIT_FAILURE
;
}
if
(
verbose
)
{
fprintf
(
stderr
,
"New seed file: "
);
print_hex
(
sizeof
(
yarrow
.
seed_file
),
yarrow
.
seed_file
);
fprintf
(
stderr
,
"
\n
"
);
}
if
(
memcmp
(
yarrow
.
seed_file
,
expected_seed_file
,
sizeof
(
yarrow
.
seed_file
)))
{
fprintf
(
stderr
,
"Failed.
\n
"
);
return
EXIT_FAILURE
;
}
if
(
verbose
)
{
fprintf
(
stderr
,
"Generated output: %d octets
\n
"
,
output
);
...
...
@@ -302,7 +323,7 @@ main(int argc, char **argv)
if
(
verbose
)
{
print_digest
(
digest
);
print_
hex
(
sizeof
(
digest
),
digest
);
fprintf
(
stderr
,
"
\n
"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment