Skip to content
GitLab
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
09f2af0b
Commit
09f2af0b
authored
Mar 02, 2003
by
Niels Möller
Browse files
(time_cipher): Don't use GNU C
non-constant initializers. Rev: src/nettle/examples/nettle-benchmark.c:1.7
parent
0069ff9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/nettle-benchmark.c
View file @
09f2af0b
...
...
@@ -173,8 +173,11 @@ time_cipher(const struct nettle_cipher *cipher)
init_data
(
data
);
{
struct
bench_cipher_info
info
=
{
ctx
,
cipher
->
encrypt
,
data
};
/* Decent initializers are a GNU extension, so don't use it here. */
struct
bench_cipher_info
info
;
info
.
ctx
=
ctx
;
info
.
crypt
=
cipher
->
encrypt
;
info
.
data
=
data
;
init_key
(
cipher
->
key_size
,
key
);
cipher
->
set_encrypt_key
(
ctx
,
cipher
->
key_size
,
key
);
...
...
@@ -184,8 +187,10 @@ time_cipher(const struct nettle_cipher *cipher)
}
{
struct
bench_cipher_info
info
=
{
ctx
,
cipher
->
decrypt
,
data
};
struct
bench_cipher_info
info
;
info
.
ctx
=
ctx
;
info
.
crypt
=
cipher
->
decrypt
;
info
.
data
=
data
;
init_key
(
cipher
->
key_size
,
key
);
cipher
->
set_decrypt_key
(
ctx
,
cipher
->
key_size
,
key
);
...
...
@@ -200,8 +205,12 @@ time_cipher(const struct nettle_cipher *cipher)
/* Do CBC mode */
{
struct
bench_cbc_info
info
=
{
ctx
,
cipher
->
encrypt
,
data
,
cipher
->
block_size
,
iv
};
struct
bench_cbc_info
info
;
info
.
ctx
=
ctx
;
info
.
crypt
=
cipher
->
encrypt
;
info
.
data
=
data
;
info
.
block_size
=
cipher
->
block_size
;
info
.
iv
=
iv
;
memset
(
iv
,
0
,
sizeof
(
iv
));
...
...
@@ -212,8 +221,12 @@ time_cipher(const struct nettle_cipher *cipher)
}
{
struct
bench_cbc_info
info
=
{
ctx
,
cipher
->
decrypt
,
data
,
cipher
->
block_size
,
iv
};
struct
bench_cbc_info
info
;
info
.
ctx
=
ctx
;
info
.
crypt
=
cipher
->
decrypt
;
info
.
data
=
data
;
info
.
block_size
=
cipher
->
block_size
;
info
.
iv
=
iv
;
memset
(
iv
,
0
,
sizeof
(
iv
));
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment