Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Brian Smith
nettle
Commits
7f0c28dc
Commit
7f0c28dc
authored
Aug 13, 2013
by
Niels Möller
Browse files
Adapted yarrow code to use new aes256 interface.
parent
31a51477
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
7f0c28dc
2013-08-13 Niels Möller <nisse@lysator.liu.se>
* yarrow.h (struct yarrow256_ctx): Use aes256_ctx, not aes_ctx.
* yarrow256.c: Adapted to use new aes256 interface.
2013-08-07 Niels Möller <nisse@lysator.liu.se>
* umac.h (_UMAC_STATE): Use struct aes128_ctx, not aes_ctx.
...
...
yarrow.h
View file @
7f0c28dc
...
...
@@ -72,7 +72,7 @@ struct yarrow256_ctx
int
seeded
;
/* The current key and counter block */
struct
aes_ctx
key
;
struct
aes
256
_ctx
key
;
uint8_t
counter
[
AES_BLOCK_SIZE
];
/* The entropy sources */
...
...
yarrow256.c
View file @
7f0c28dc
...
...
@@ -118,7 +118,7 @@ yarrow_generate_block(struct yarrow256_ctx *ctx,
{
unsigned
i
;
aes_encrypt
(
&
ctx
->
key
,
sizeof
(
ctx
->
counter
),
block
,
ctx
->
counter
);
aes
256
_encrypt
(
&
ctx
->
key
,
sizeof
(
ctx
->
counter
),
block
,
ctx
->
counter
);
/* Increment counter, treating it as a big-endian number. This is
* machine independent, and follows appendix B of the NIST
...
...
@@ -190,12 +190,12 @@ yarrow256_fast_reseed(struct yarrow256_ctx *ctx)
/* Iterate */
yarrow_iterate
(
digest
);
aes_set_encrypt_key
(
&
ctx
->
key
,
sizeof
(
digest
),
digest
);
aes
256
_set_encrypt_key
(
&
ctx
->
key
,
digest
);
ctx
->
seeded
=
1
;
/* Derive new counter value */
memset
(
ctx
->
counter
,
0
,
sizeof
(
ctx
->
counter
));
aes_encrypt
(
&
ctx
->
key
,
sizeof
(
ctx
->
counter
),
ctx
->
counter
,
ctx
->
counter
);
aes
256
_encrypt
(
&
ctx
->
key
,
sizeof
(
ctx
->
counter
),
ctx
->
counter
,
ctx
->
counter
);
/* Reset estimates. */
for
(
i
=
0
;
i
<
ctx
->
nsources
;
i
++
)
...
...
@@ -305,13 +305,13 @@ yarrow256_update(struct yarrow256_ctx *ctx,
static
void
yarrow_gate
(
struct
yarrow256_ctx
*
ctx
)
{
uint8_t
key
[
AES
_MAX
_KEY_SIZE
];
uint8_t
key
[
AES
256
_KEY_SIZE
];
unsigned
i
;
for
(
i
=
0
;
i
<
sizeof
(
key
);
i
+=
AES_BLOCK_SIZE
)
yarrow_generate_block
(
ctx
,
key
+
i
);
aes_set_encrypt_key
(
&
ctx
->
key
,
sizeof
(
key
),
key
);
aes
256
_set_encrypt_key
(
&
ctx
->
key
,
key
);
}
void
...
...
Write
Preview
Supports
Markdown
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