Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nettle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Wim Lewis
nettle
Commits
00e21029
Commit
00e21029
authored
Jan 27, 2014
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add benchmarking for eax.
parent
91376fed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
ChangeLog
ChangeLog
+3
-0
examples/nettle-benchmark.c
examples/nettle-benchmark.c
+41
-1
No files found.
ChangeLog
View file @
00e21029
2014-01-27 Niels Möller <nisse@lysator.liu.se>
* examples/nettle-benchmark.c (time_eax): New function.
(main): Use it.
* x86_64/chacha-core-internal.asm: Use pshufhw + pshuflw for the
16-bit rotate.
...
...
examples/nettle-benchmark.c
View file @
00e21029
...
...
@@ -6,7 +6,7 @@
/* nettle, low-level cryptographics library
*
* Copyright (C) 2001, 2010 Niels Möller
* Copyright (C) 2001, 2010
, 2014
Niels Möller
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
...
...
@@ -450,6 +450,40 @@ time_gcm(void)
time_function
(
bench_cipher
,
&
cinfo
));
}
static
void
time_eax
(
void
)
{
static
uint8_t
data
[
BENCH_BLOCK
];
struct
bench_hash_info
hinfo
;
struct
bench_cipher_info
cinfo
;
struct
eax_aes128_ctx
ctx
;
uint8_t
key
[
AES128_KEY_SIZE
];
uint8_t
iv
[
EAX_BLOCK_SIZE
];
eax_aes128_set_key
(
&
ctx
,
sizeof
(
key
),
key
);
eax_aes128_set_nonce
(
&
ctx
,
sizeof
(
iv
),
iv
);
hinfo
.
ctx
=
&
ctx
;
hinfo
.
update
=
(
nettle_hash_update_func
*
)
eax_aes128_update
;
hinfo
.
data
=
data
;
display
(
"eax-aes128"
,
"update"
,
GCM_BLOCK_SIZE
,
time_function
(
bench_hash
,
&
hinfo
));
cinfo
.
ctx
=
&
ctx
;
cinfo
.
crypt
=
(
nettle_crypt_func
*
)
eax_aes128_encrypt
;
cinfo
.
data
=
data
;
display
(
"eax-aes128"
,
"encrypt"
,
GCM_BLOCK_SIZE
,
time_function
(
bench_cipher
,
&
cinfo
));
cinfo
.
crypt
=
(
nettle_crypt_func
*
)
eax_aes128_decrypt
;
display
(
"eax-aes128"
,
"decrypt"
,
GCM_BLOCK_SIZE
,
time_function
(
bench_cipher
,
&
cinfo
));
}
static
int
prefix_p
(
const
char
*
prefix
,
const
char
*
s
)
{
...
...
@@ -749,5 +783,11 @@ main(int argc, char **argv)
time_gcm
();
}
if
(
!
alg
||
strstr
(
"eax"
,
alg
))
{
printf
(
"
\n
"
);
time_eax
();
}
return
0
;
}
Write
Preview
Markdown
is supported
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