Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
a56ede19
Commit
a56ede19
authored
Apr 16, 2013
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase umac block count to 64 bits. Some reordering of umac contexts.
parent
7eb18308
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
ChangeLog
ChangeLog
+5
-0
umac-l2.c
umac-l2.c
+2
-2
umac.h
umac.h
+17
-9
No files found.
ChangeLog
View file @
a56ede19
2013-04-16 Niels Möller <nisse@lysator.liu.se>
* umac.h (umac32_ctx, umac64_ctx, umac96_ctx, umac128_ctx): Make
block count an uint64_t. Reorder some elements to put short values
together.
* umac-l2.c (_umac_l2, _umac_l2_final): Make count argument an uint64_t.
* configure.ac: Changed version number to 2.7.
(LIBNETTLE_MINOR): Bumped library version, to 4.6
(LIBHOGWEED_MINOR): And to 2.4
...
...
umac-l2.c
View file @
a56ede19
...
...
@@ -57,7 +57,7 @@ _umac_l2_init (unsigned size, uint32_t *k)
void
_umac_l2
(
const
uint32_t
*
key
,
uint64_t
*
state
,
unsigned
n
,
u
nsigned
count
,
uint64_t
*
prev
,
const
uint64_t
*
m
)
u
int64_t
count
,
uint64_t
*
prev
,
const
uint64_t
*
m
)
{
unsigned
i
;
...
...
@@ -95,7 +95,7 @@ _umac_l2(const uint32_t *key, uint64_t *state, unsigned n,
void
_umac_l2_final
(
const
uint32_t
*
key
,
uint64_t
*
state
,
unsigned
n
,
u
nsigned
count
,
uint64_t
*
prev
)
u
int64_t
count
,
uint64_t
*
prev
)
{
unsigned
i
;
...
...
umac.h
View file @
a56ede19
...
...
@@ -81,39 +81,47 @@ extern "C" {
/* Input to the pdf_key, zero-padded and low bits \
cleared if appropriate. */
\
uint8_t nonce[AES_BLOCK_SIZE]; \
unsigned short nonce_length;
/* For incrementing */
\
/* Buffering */
\
unsigned short nonce_length
/* For incrementing */
/* Buffering */
#define _UMAC_BUFFER \
/* Complete blocks processed */
\
unsigned count; \
unsigned index; \
uint8_t block[UMAC_BLOCK_SIZE];
uint64_t count; \
uint8_t block[UMAC_BLOCK_SIZE]
#define _UMAC_NONCE_CACHED 0x80
struct
umac32_ctx
{
_UMAC_STATE
(
1
);
unsigned
short
nonce_low
;
/* Low bits, plus some flag for the pad cache. */
/* Low bits and cache flag. */
unsigned
short
nonce_low
;
/* Previous padding block */
uint32_t
pad_cache
[
AES_BLOCK_SIZE
/
4
];
_UMAC_BUFFER
;
};
struct
umac64_ctx
{
_UMAC_STATE
(
2
);
int
nonce_low
;
/* Low bits, plus some flag for the pad cache. */
/* Low bit and cache flag. */
unsigned
short
nonce_low
;
/* Previous padding block */
uint32_t
pad_cache
[
AES_BLOCK_SIZE
/
4
];
_UMAC_BUFFER
;
};
struct
umac96_ctx
{
_UMAC_STATE
(
3
);
_UMAC_BUFFER
;
};
struct
umac128_ctx
{
_UMAC_STATE
(
4
);
_UMAC_BUFFER
;
};
/* The _set_key function initialize the nonce to zero. */
...
...
@@ -211,11 +219,11 @@ _umac_l2_init (unsigned size, uint32_t *k);
void
_umac_l2
(
const
uint32_t
*
key
,
uint64_t
*
state
,
unsigned
n
,
u
nsigned
count
,
uint64_t
*
prev
,
const
uint64_t
*
m
);
u
int64_t
count
,
uint64_t
*
prev
,
const
uint64_t
*
m
);
void
_umac_l2_final
(
const
uint32_t
*
key
,
uint64_t
*
state
,
unsigned
n
,
u
nsigned
count
,
uint64_t
*
prev
);
u
int64_t
count
,
uint64_t
*
prev
);
void
_umac_l3_init
(
unsigned
size
,
uint64_t
*
k
);
...
...
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