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
4b7d469f
Commit
4b7d469f
authored
11 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Benchmarking of chacha.
parent
93fc1d14
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
examples/nettle-benchmark.c
+1
-1
1 addition, 1 deletion
examples/nettle-benchmark.c
nettle-internal.c
+20
-0
20 additions, 0 deletions
nettle-internal.c
nettle-internal.h
+1
-0
1 addition, 0 deletions
nettle-internal.h
with
26 additions
and
1 deletion
ChangeLog
+
4
−
0
View file @
4b7d469f
2014-01-27 Niels Möller <nisse@lysator.liu.se>
2014-01-27 Niels Möller <nisse@lysator.liu.se>
* examples/nettle-benchmark.c (main): Add benchmarking of chacha.
* nettle-internal.c (nettle_chacha): New const struct, for the
benchmark.
Chacha implementation, based on contribution by Joachim
Chacha implementation, based on contribution by Joachim
Strömbergson.
Strömbergson.
* chacha.h: New file.
* chacha.h: New file.
...
...
This diff is collapsed.
Click to expand it.
examples/nettle-benchmark.c
+
1
−
1
View file @
4b7d469f
...
@@ -680,7 +680,7 @@ main(int argc, char **argv)
...
@@ -680,7 +680,7 @@ main(int argc, char **argv)
&
nettle_des3
,
&
nettle_des3
,
&
nettle_serpent256
,
&
nettle_serpent256
,
&
nettle_twofish128
,
&
nettle_twofish192
,
&
nettle_twofish256
,
&
nettle_twofish128
,
&
nettle_twofish192
,
&
nettle_twofish256
,
&
nettle_salsa20
,
&
nettle_salsa20r12
,
&
nettle_salsa20
,
&
nettle_salsa20r12
,
&
nettle_chacha
,
NULL
NULL
};
};
...
...
This diff is collapsed.
Click to expand it.
nettle-internal.c
+
20
−
0
View file @
4b7d469f
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include
"des.h"
#include
"des.h"
#include
"eax.h"
#include
"eax.h"
#include
"gcm.h"
#include
"gcm.h"
#include
"chacha.h"
#include
"salsa20.h"
#include
"salsa20.h"
/* DES uses a different signature for the key set function. We ignore
/* DES uses a different signature for the key set function. We ignore
...
@@ -79,6 +80,25 @@ nettle_des3 = {
...
@@ -79,6 +80,25 @@ nettle_des3 = {
const
struct
nettle_cipher
const
struct
nettle_cipher
nettle_blowfish128
=
_NETTLE_CIPHER
(
blowfish
,
BLOWFISH
,
128
);
nettle_blowfish128
=
_NETTLE_CIPHER
(
blowfish
,
BLOWFISH
,
128
);
/* Sets a fix zero iv. For benchmarking only. */
static
void
chacha_set_key_hack
(
void
*
ctx
,
size_t
length
,
const
uint8_t
*
key
)
{
static
const
uint8_t
iv
[
CHACHA_IV_SIZE
];
chacha_set_key
(
ctx
,
length
,
key
);
chacha_set_iv
(
ctx
,
iv
);
}
/* Claim zero block size, to classify as a stream cipher. */
const
struct
nettle_cipher
nettle_chacha
=
{
"chacha"
,
sizeof
(
struct
chacha_ctx
),
0
,
CHACHA_KEY_SIZE
,
chacha_set_key_hack
,
chacha_set_key_hack
,
(
nettle_crypt_func
*
)
chacha_crypt
,
(
nettle_crypt_func
*
)
chacha_crypt
};
/* Sets a fix zero iv. For benchmarking only. */
/* Sets a fix zero iv. For benchmarking only. */
static
void
static
void
salsa20_set_key_hack
(
void
*
ctx
,
size_t
length
,
const
uint8_t
*
key
)
salsa20_set_key_hack
(
void
*
ctx
,
size_t
length
,
const
uint8_t
*
key
)
...
...
This diff is collapsed.
Click to expand it.
nettle-internal.h
+
1
−
0
View file @
4b7d469f
...
@@ -61,6 +61,7 @@ extern const struct nettle_cipher nettle_des3;
...
@@ -61,6 +61,7 @@ extern const struct nettle_cipher nettle_des3;
extern
const
struct
nettle_cipher
nettle_blowfish128
;
extern
const
struct
nettle_cipher
nettle_blowfish128
;
/* For benchmarking only, sets no iv and lies about the block size. */
/* For benchmarking only, sets no iv and lies about the block size. */
extern
const
struct
nettle_cipher
nettle_chacha
;
extern
const
struct
nettle_cipher
nettle_salsa20
;
extern
const
struct
nettle_cipher
nettle_salsa20
;
extern
const
struct
nettle_cipher
nettle_salsa20r12
;
extern
const
struct
nettle_cipher
nettle_salsa20r12
;
...
...
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