]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
In arm fat build, hook in sha1 and sha256 armv6 assembly.
authorNiels Möller <nisse@lysator.liu.se>
Sun, 25 Jan 2015 20:16:37 +0000 (21:16 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Sun, 25 Jan 2015 20:16:37 +0000 (21:16 +0100)
ChangeLog
arm/fat/sha1-compress-2.asm [new file with mode: 0644]
arm/fat/sha256-compress-2.asm [new file with mode: 0644]
fat-arm.c

index f56bd56afb518747d91264d1ca009866c52f5d47..c6e22a43a9aefa0fa08fd21cb4bba21571df85e1 100644 (file)
--- 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 (file)
index 0000000..c326bef
--- /dev/null
@@ -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 (file)
index 0000000..e1babb3
--- /dev/null
@@ -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>)
index 6d6accfafc53791b341477a105cee29761b68b45..1156499d6e908f107501607ecb99c7a769d9e822 100644 (file)
--- 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))