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
Deploy
Releases
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
Brian Smith
nettle
Commits
237d1fc7
Commit
237d1fc7
authored
16 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
(test_main): Updated for seed file changes.
Rev: nettle/testsuite/yarrow-test.c:1.2
parent
5831f51a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/yarrow-test.c
+9
-7
9 additions, 7 deletions
testsuite/yarrow-test.c
with
9 additions
and
7 deletions
testsuite/yarrow-test.c
+
9
−
7
View file @
237d1fc7
...
...
@@ -69,17 +69,19 @@ test_main(void)
struct
sha256_ctx
input_hash
;
uint8_t
digest
[
SHA256_DIGEST_SIZE
];
uint8_t
seed_file
[
YARROW256_SEED_FILE_SIZE
];
const
uint8_t
*
expected_output
=
decode_hex_dup
(
"
85fe6afb5bd627f3 ea20a6127038d3da
"
"
69e880a6ecbbb7d8 3514d967a2c4c0d4
"
);
=
decode_hex_dup
(
"
dd304aacac3dc95e 70d684a642967c89
"
"
58501f7c8eb88b79 43b2ffccde6f0f79
"
);
const
uint8_t
*
expected_input
=
decode_hex_dup
(
"e0596cf006025506 65d1195f32a87e4a"
"5c354910dfbd0a31 e2105b262f5ce3d8"
);
const
uint8_t
*
expected_seed_file
=
decode_hex_dup
(
"
3b7ad33dcd577048 b9e0cbc70b5ca12d
"
"
5882be29c964a3a6 ea79fdbfa06299dc
"
);
=
decode_hex_dup
(
"
b03518f32b1084dd 983e6a445d47bb6f
"
"
13bb7b998740d570 503d6aaa62e28901
"
);
unsigned
c
;
unsigned
t
;
...
...
@@ -91,7 +93,6 @@ test_main(void)
static
const
char
zeroes
[
100
];
yarrow256_init
(
&
yarrow
,
2
,
sources
);
memset
(
&
yarrow
.
seed_file
,
0
,
sizeof
(
yarrow
.
seed_file
));
yarrow_key_event_init
(
&
estimator
);
sha256_init
(
&
input_hash
);
...
...
@@ -182,14 +183,15 @@ test_main(void)
return
EXIT_FAILURE
;
}
yarrow256_random
(
&
yarrow
,
sizeof
(
seed_file
),
seed_file
);
if
(
verbose
)
{
printf
(
"New seed file: "
);
print_hex
(
sizeof
(
yarrow
.
seed_file
),
yarrow
.
seed_file
);
print_hex
(
sizeof
(
seed_file
),
seed_file
);
printf
(
"
\n
"
);
}
if
(
memcmp
(
yarrow
.
seed_file
,
expected_seed_file
,
sizeof
(
yarrow
.
seed_file
)))
if
(
memcmp
(
seed_file
,
expected_seed_file
,
sizeof
(
seed_file
)))
{
fprintf
(
stderr
,
"Failed.
\n
"
);
return
EXIT_FAILURE
;
...
...
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