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
Labels
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Nettle
nettle
Commits
aa52330e
Commit
aa52330e
authored
May 08, 2014
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented algorithm array nettle_aeads.
parent
b672e553
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
3 deletions
+99
-3
ChangeLog
ChangeLog
+7
-0
Makefile.in
Makefile.in
+2
-2
nettle-meta-aeads.c
nettle-meta-aeads.c
+49
-0
nettle-meta.h
nettle-meta.h
+4
-0
testsuite/.test-rules.make
testsuite/.test-rules.make
+3
-0
testsuite/Makefile.in
testsuite/Makefile.in
+2
-1
testsuite/meta-aead-test.c
testsuite/meta-aead-test.c
+32
-0
No files found.
ChangeLog
View file @
aa52330e
2014-05-08 Niels Möller <nisse@lysator.liu.se>
* Makefile.in (nettle_SOURCES): Added nettle-meta-aeads.c.
* nettle-meta.h (nettle_aeads): Declare array.
* nettle-meta-aeads.c (nettle_aeads): New file, new array.
* testsuite/meta-aead-test.c: New test case.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
meta-aead-test.c.
* aclocal.m4 (GMP_PROG_CC_FOR_BUILD): If CC_FOR_BUILD is gcc, add
-O option. This makes eccdata twice as fast.
...
...
Makefile.in
View file @
aa52330e
...
...
@@ -106,8 +106,8 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \
md2.c md2-meta.c md4.c md4-meta.c
\
md5.c md5-compress.c md5-compat.c md5-meta.c
\
memxor.c
\
nettle-meta-a
rmors.c nettle-meta-ciphe
rs.c
\
nettle-meta-hashes.c
\
nettle-meta-a
eads.c nettle-meta-armo
rs.c
\
nettle-meta-
ciphers.c nettle-meta-
hashes.c
\
pbkdf2.c pbkdf2-hmac-sha1.c pbkdf2-hmac-sha256.c
\
poly1305-aes.c poly1305-internal.c
\
realloc.c
\
...
...
nettle-meta-aeads.c
0 → 100644
View file @
aa52330e
/* nettle-meta-aeads.c
Copyright (C) 2014 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
or both in parallel, as here.
GNU Nettle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stddef.h>
#include "nettle-meta.h"
const
struct
nettle_aead
*
const
nettle_aeads
[]
=
{
&
nettle_gcm_aes128
,
&
nettle_gcm_aes192
,
&
nettle_gcm_aes256
,
&
nettle_gcm_camellia128
,
&
nettle_gcm_camellia256
,
&
nettle_eax_aes128
,
&
nettle_chacha_poly1305
,
NULL
};
nettle-meta.h
View file @
aa52330e
...
...
@@ -155,6 +155,10 @@ struct nettle_aead
nettle_hash_digest_func
*
digest
;
};
/* null-terminated list of aead constructions implemented by this
version of nettle */
extern
const
struct
nettle_aead
*
const
nettle_aeads
[];
extern
const
struct
nettle_aead
nettle_gcm_aes128
;
extern
const
struct
nettle_aead
nettle_gcm_aes192
;
extern
const
struct
nettle_aead
nettle_gcm_aes256
;
...
...
testsuite/.test-rules.make
View file @
aa52330e
...
...
@@ -136,6 +136,9 @@ meta-hash-test$(EXEEXT): meta-hash-test.$(OBJEXT)
meta-cipher-test$(EXEEXT)
:
meta-cipher-test.$(OBJEXT)
$(LINK)
meta-cipher-test.
$(OBJEXT)
$(TEST_OBJS)
-o
meta-cipher-test
$(EXEEXT)
meta-aead-test$(EXEEXT)
:
meta-aead-test.$(OBJEXT)
$(LINK)
meta-aead-test.
$(OBJEXT)
$(TEST_OBJS)
-o
meta-aead-test
$(EXEEXT)
meta-armor-test$(EXEEXT)
:
meta-armor-test.$(OBJEXT)
$(LINK)
meta-armor-test.
$(OBJEXT)
$(TEST_OBJS)
-o
meta-armor-test
$(EXEEXT)
...
...
testsuite/Makefile.in
View file @
aa52330e
...
...
@@ -28,7 +28,8 @@ TS_NETTLE_SOURCES = aes-test.c arcfour-test.c arctwo-test.c \
cbc-test.c ctr-test.c gcm-test.c eax-test.c ccm-test.c
\
poly1305-test.c chacha-poly1305-test.c
\
hmac-test.c umac-test.c
\
meta-hash-test.c meta-cipher-test.c meta-armor-test.c
\
meta-hash-test.c meta-cipher-test.c
\
meta-aead-test.c meta-armor-test.c
\
buffer-test.c yarrow-test.c pbkdf2-test.c
TS_HOGWEED_SOURCES
=
sexp-test.c sexp-format-test.c
\
...
...
testsuite/meta-aead-test.c
0 → 100644
View file @
aa52330e
#include "testutils.h"
#include "nettle-internal.h"
#include "nettle-meta.h"
const
char
*
aeads
[]
=
{
"gcm_aes128"
,
"gcm_aes192"
,
"gcm_aes256"
,
"gcm_camellia128"
,
"gcm_camellia256"
,
"eax_aes128"
,
"chacha_poly1305"
,
};
void
test_main
(
void
)
{
int
i
,
j
;
int
count
=
sizeof
(
aeads
)
/
sizeof
(
*
aeads
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
j
=
0
;
NULL
!=
nettle_aeads
[
j
];
j
++
)
{
if
(
0
==
strcmp
(
aeads
[
i
],
nettle_aeads
[
j
]
->
name
))
break
;
}
ASSERT
(
NULL
!=
nettle_aeads
[
j
]);
/* make sure we found a matching aead */
}
j
=
0
;
while
(
NULL
!=
nettle_aeads
[
j
])
j
++
;
ASSERT
(
j
==
count
);
/* we are not missing testing any aeads */
}
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