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
Dmitry Baryshkov
nettle
Commits
c06fb6d4
Commit
c06fb6d4
authored
Jan 25, 2015
by
Niels Möller
Browse files
Prepare for additional fat functions.
parent
c4ae6233
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
c06fb6d4
2015-01-25 Niels Möller <nisse@lysator.liu.se>
* sha1-compress.c: Prepare for fat build with C and assembly
implementations.
* sha256-compress.c: Likewise.
* fat-setup.h (sha1_compress_func, sha256_compress_func): New typedefs.
* configure.ac (asm_nettle_optional_list): Added
sha1-compress-2.asm and sha256-compress-2.asm, and corresponding
HAVE_NATIVE_*.
From Martin Storsjö:
* arm: Add .arch directives for armv6. This allows building these
files as part of a fat build, even if the assembler by default
...
...
configure.ac
View file @
c06fb6d4
...
...
@@ -307,7 +307,8 @@ asm_replace_list="aes-encrypt-internal.asm aes-decrypt-internal.asm \
# Assembler files which generate additional object files if they are used.
asm_nettle_optional_list="gcm-hash8.asm cpuid.asm \
aes-encrypt-internal-2.asm aes-decrypt-internal-2.asm memxor-2.asm \
salsa20-core-internal-2.asm sha3-permute-2.asm sha512-compress-2.asm \
salsa20-core-internal-2.asm sha1-compress-2.asm sha256-compress-2.asm \
sha3-permute-2.asm sha512-compress-2.asm \
umac-nh-n-2.asm umac-nh-2.asm"
asm_hogweed_optional_list=""
...
...
@@ -413,6 +414,8 @@ AH_VERBATIM([HAVE_NATIVE],
#undef HAVE_NATIVE_ecc_521_redc
#undef HAVE_NATIVE_gcm_hash8
#undef HAVE_NATIVE_salsa20_core
#undef HAVE_NATIVE_sha1_compress
#undef HAVE_NATIVE_sha256_compress
#undef HAVE_NATIVE_sha512_compress
#undef HAVE_NATIVE_sha3_permute
#undef HAVE_NATIVE_umac_nh
...
...
fat-setup.h
View file @
c06fb6d4
...
...
@@ -154,6 +154,9 @@ typedef void *(memxor_func)(void *dst, const void *src, size_t n);
typedef
void
salsa20_core_func
(
uint32_t
*
dst
,
const
uint32_t
*
src
,
unsigned
rounds
);
typedef
void
sha1_compress_func
(
uint32_t
*
state
,
const
uint8_t
*
input
);
typedef
void
sha256_compress_func
(
uint32_t
*
state
,
const
uint8_t
*
input
,
const
uint32_t
*
k
);
struct
sha3_state
;
typedef
void
sha3_permute_func
(
struct
sha3_state
*
state
);
...
...
sha1-compress.c
View file @
c06fb6d4
...
...
@@ -129,6 +129,13 @@
#define subRound(a, b, c, d, e, f, k, data) \
( e += ROTL32( 5, a ) + f( b, c, d ) + k + data, b = ROTL32( 30, b ) )
/* For fat builds */
#if HAVE_NATIVE_sha1_compress
void
_nettle_sha1_compress_c
(
uint32_t
*
state
,
const
uint8_t
*
input
);
#define _nettle_sha1_compress _nettle_sha1_compress_c
#endif
/* Perform the SHA transformation. Note that this code, like MD5, seems to
break some optimizing compilers due to the complexity of the expressions
and the size of the basic block. It may be necessary to split it into
...
...
sha256-compress.c
View file @
c06fb6d4
...
...
@@ -116,6 +116,13 @@
h += S0(a) + Majority(a,b,c); \
} while (0)
/* For fat builds */
#if HAVE_NATIVE_sha256_compress
void
_nettle_sha256_compress_c
(
uint32_t
*
state
,
const
uint8_t
*
input
,
const
uint32_t
*
k
);
#define _nettle_sha256_compress _nettle_sha256_compress_c
#endif
void
_nettle_sha256_compress
(
uint32_t
*
state
,
const
uint8_t
*
input
,
const
uint32_t
*
k
)
{
...
...
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