summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2015-01-25 21:16:37 +0100
committerNiels Möller <nisse@lysator.liu.se>2015-01-25 21:16:37 +0100
commita98c30c3f2737dbfd401eab2c3444c8369bd1271 (patch)
tree57a0aa1e2c0b3e09d4403974d01941e1a9a5506c
parentc06fb6d4607646bd36d1234a302a49994e976c24 (diff)
downloadnettle-a98c30c3f2737dbfd401eab2c3444c8369bd1271.tar.gz
In arm fat build, hook in sha1 and sha256 armv6 assembly.
-rw-r--r--ChangeLog5
-rw-r--r--arm/fat/sha1-compress-2.asm37
-rw-r--r--arm/fat/sha256-compress-2.asm37
-rw-r--r--fat-arm.c20
4 files changed, 99 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f56bd56a..c6e22a43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2015-01-25 Niels Möller <nisse@lysator.liu.se>
+ * arm/fat/sha1-compress-2.asm: New file.
+ * arm/fat/sha256-compress-2.asm: Likewise.
+ * fat-arm.c (fat_init): Setup for use of additional v6 assembly
+ functions.
+
* sha1-compress.c: Prepare for fat build with C and assembly
implementations.
* sha256-compress.c: Likewise.
diff --git a/arm/fat/sha1-compress-2.asm b/arm/fat/sha1-compress-2.asm
new file mode 100644
index 00000000..c326befd
--- /dev/null
+++ b/arm/fat/sha1-compress-2.asm
@@ -0,0 +1,37 @@
+C arm/fat/sha1-compress-2.asm
+
+
+ifelse(<
+ Copyright (C) 2015 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/.
+>)
+
+dnl PROLOGUE(_nettle_sha1_compress) picked up by configure
+
+define(<fat_transform>, <$1_armv6>)
+include_src(<arm/v6/sha1-compress.asm>)
diff --git a/arm/fat/sha256-compress-2.asm b/arm/fat/sha256-compress-2.asm
new file mode 100644
index 00000000..e1babb37
--- /dev/null
+++ b/arm/fat/sha256-compress-2.asm
@@ -0,0 +1,37 @@
+C arm/fat/sha256-compress-2.asm
+
+
+ifelse(<
+ Copyright (C) 2015 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/.
+>)
+
+dnl PROLOGUE(_nettle_sha256_compress) picked up by configure
+
+define(<fat_transform>, <$1_armv6>)
+include_src(<arm/v6/sha256-compress.asm>)
diff --git a/fat-arm.c b/fat-arm.c
index 6d6accfa..1156499d 100644
--- a/fat-arm.c
+++ b/fat-arm.c
@@ -145,6 +145,14 @@ DECLARE_FAT_FUNC(_nettle_salsa20_core, salsa20_core_func)
DECLARE_FAT_FUNC_VAR(salsa20_core, salsa20_core_func, c)
DECLARE_FAT_FUNC_VAR(salsa20_core, salsa20_core_func, neon)
+DECLARE_FAT_FUNC(_nettle_sha1_compress, sha1_compress_func)
+DECLARE_FAT_FUNC_VAR(sha1_compress, sha1_compress_func, c)
+DECLARE_FAT_FUNC_VAR(sha1_compress, sha1_compress_func, armv6)
+
+DECLARE_FAT_FUNC(_nettle_sha256_compress, sha256_compress_func)
+DECLARE_FAT_FUNC_VAR(sha256_compress, sha256_compress_func, c)
+DECLARE_FAT_FUNC_VAR(sha256_compress, sha256_compress_func, armv6)
+
DECLARE_FAT_FUNC(_nettle_sha512_compress, sha512_compress_func)
DECLARE_FAT_FUNC_VAR(sha512_compress, sha512_compress_func, c)
DECLARE_FAT_FUNC_VAR(sha512_compress, sha512_compress_func, neon)
@@ -181,6 +189,8 @@ fat_init (void)
fprintf (stderr, "libnettle: enabling armv6 code.\n");
_nettle_aes_encrypt_vec = _nettle_aes_encrypt_armv6;
_nettle_aes_decrypt_vec = _nettle_aes_decrypt_armv6;
+ _nettle_sha1_compress_vec = _nettle_sha1_compress_armv6;
+ _nettle_sha256_compress_vec = _nettle_sha256_compress_armv6;
}
else
{
@@ -188,6 +198,8 @@ fat_init (void)
fprintf (stderr, "libnettle: not enabling armv6 code.\n");
_nettle_aes_encrypt_vec = _nettle_aes_encrypt_arm;
_nettle_aes_decrypt_vec = _nettle_aes_decrypt_arm;
+ _nettle_sha1_compress_vec = _nettle_sha1_compress_c;
+ _nettle_sha256_compress_vec = _nettle_sha256_compress_c;
}
if (features.have_neon)
{
@@ -229,6 +241,14 @@ DEFINE_FAT_FUNC(_nettle_salsa20_core, void,
(uint32_t *dst, const uint32_t *src, unsigned rounds),
(dst, src, rounds))
+DEFINE_FAT_FUNC(_nettle_sha1_compress, void,
+ (uint32_t *state, const uint8_t *input),
+ (state, input))
+
+DEFINE_FAT_FUNC(_nettle_sha256_compress, void,
+ (uint32_t *state, const uint8_t *input, const uint32_t *k),
+ (state, input, k))
+
DEFINE_FAT_FUNC(_nettle_sha512_compress, void,
(uint64_t *state, const uint8_t *input, const uint64_t *k),
(state, input, k))