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
Dmitry Baryshkov
nettle
Commits
b2a6b03a
Commit
b2a6b03a
authored
23 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Added debug some output.
Rev: src/nettle/yarrow256.c:1.8
parent
047fc937
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
yarrow256.c
+28
-0
28 additions, 0 deletions
yarrow256.c
with
28 additions
and
0 deletions
yarrow256.c
+
28
−
0
View file @
b2a6b03a
...
...
@@ -28,6 +28,11 @@
#include
<assert.h>
#include
<string.h>
/* #define YARROW_DEBUG */
#ifdef YARROW_DEBUG
#include
<stdio.h>
#endif
/* Parameters */
/* An upper limit on the entropy (in bits) in one octet of sample
...
...
@@ -102,6 +107,10 @@ yarrow_fast_reseed(struct yarrow256_ctx *ctx)
uint8_t
digest
[
SHA256_DIGEST_SIZE
];
unsigned
i
;
#ifdef YARROW_DEBUG
fprintf
(
stderr
,
"yarrow_fast_reseed
\n
"
);
#endif
/* We feed two block of output using the current key into the pool
* before emptying it. */
if
(
ctx
->
seeded
)
...
...
@@ -134,6 +143,10 @@ yarrow_slow_reseed(struct yarrow256_ctx *ctx)
uint8_t
digest
[
SHA256_DIGEST_SIZE
];
unsigned
i
;
#ifdef YARROW_DEBUG
fprintf
(
stderr
,
"yarrow_slow_reseed
\n
"
);
#endif
/* Get digest of the slow pool*/
sha256_final
(
&
ctx
->
pools
[
YARROW_SLOW
]);
...
...
@@ -203,6 +216,13 @@ yarrow256_update(struct yarrow256_ctx *ctx,
case
YARROW_FAST
:
if
(
source
->
estimate
[
YARROW_FAST
]
>=
YARROW_FAST_THRESHOLD
)
yarrow_fast_reseed
(
ctx
);
#ifdef YARROW_DEBUG
fprintf
(
stderr
,
"yarrow256_update: source_index = %d,
\n
"
" fast pool estimate = %d
\n
"
,
source_index
,
source
->
estimate
[
YARROW_FAST
]);
#endif
break
;
case
YARROW_SLOW
:
{
...
...
@@ -214,6 +234,14 @@ yarrow256_update(struct yarrow256_ctx *ctx,
if
(
ctx
->
sources
[
i
].
estimate
[
YARROW_SLOW
]
>=
YARROW_SLOW_THRESHOLD
)
k
++
;
#ifdef YARROW_DEBUG
fprintf
(
stderr
,
"yarrow256_update: source_index = %d,
\n
"
" slow pool estimate = %d,
\n
"
" number of sources above threshold = %d
\n
"
,
source_index
,
source
->
estimate
[
YARROW_SLOW
],
k
);
#endif
if
(
k
>=
YARROW_SLOW_K
)
{
yarrow_slow_reseed
(
ctx
);
...
...
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