]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
nettle_hash instances for sha512_224 and sha512_256.
authorNiels Möller <nisse@lysator.liu.se>
Wed, 9 Apr 2014 12:53:20 +0000 (14:53 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 9 Apr 2014 12:53:20 +0000 (14:53 +0200)
ChangeLog
Makefile.in
nettle-meta.h
sha512-224-meta.c [new file with mode: 0644]
sha512-256-meta.c [new file with mode: 0644]

index dfa97ebcd16e304f3f0276f7f85ee3f71b0966f7..27cec7acc89426b150fe7bc69fef853d3f3c4e39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-04-09  Niels Möller  <nisse@lysator.liu.se>
 
+       * nettle-meta.h (nettle_sha512_224, nettle_sha512_256): Declare.
+       * sha512-224-meta.c (nettle_sha512_224): New file, new nettle_hash.
+       * sha512-256-meta.c (nettle_sha512_256): New file, new nettle_hash.
+
        * sha2.h (SHA512_224_DIGEST_SIZE, SHA512_224_DATA_SIZE)
        (SHA512_256_DIGEST_SIZE, SHA512_256_DATA_SIZE): New constants.
 
index 5fbc1eee043946fbb9060674a881013b1871986e..c25cf19075847ce02ce619cb320263cc6e939843 100644 (file)
@@ -119,6 +119,7 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \
                 sha1.c sha1-compress.c sha1-meta.c \
                 sha256.c sha256-compress.c sha224-meta.c sha256-meta.c \
                 sha512.c sha512-compress.c sha384-meta.c sha512-meta.c \
+                sha512-224-meta.c sha512-256-meta.c \
                 sha3.c sha3-permute.c \
                 sha3-224.c sha3-224-meta.c sha3-256.c sha3-256-meta.c \
                 sha3-384.c sha3-384-meta.c sha3-512.c sha3-512-meta.c\
index 15a5b22ccc7cb8980cc6c7e0992dc66b05d2e745..cd46ee46fa982c757058d1000cee39efc810912b 100644 (file)
@@ -119,6 +119,8 @@ extern const struct nettle_hash nettle_sha224;
 extern const struct nettle_hash nettle_sha256;
 extern const struct nettle_hash nettle_sha384;
 extern const struct nettle_hash nettle_sha512;
+extern const struct nettle_hash nettle_sha512_224;
+extern const struct nettle_hash nettle_sha512_256;
 extern const struct nettle_hash nettle_sha3_224;
 extern const struct nettle_hash nettle_sha3_256;
 extern const struct nettle_hash nettle_sha3_384;
diff --git a/sha512-224-meta.c b/sha512-224-meta.c
new file mode 100644 (file)
index 0000000..eee1bd5
--- /dev/null
@@ -0,0 +1,40 @@
+/* sha512-224-meta.c */
+
+/* nettle, low-level cryptographics library
+ *
+ * Copyright (C) 2014 Niels Möller
+ *  
+ * The nettle library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ * 
+ * The nettle library 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 Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the nettle library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02111-1301, USA.
+ */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "nettle-meta.h"
+
+#include "sha2.h"
+
+const struct nettle_hash nettle_sha512_224 =
+  {
+    "sha512-224", sizeof(struct sha512_ctx),
+    SHA512_224_DIGEST_SIZE,
+    SHA512_224_DATA_SIZE,
+    (nettle_hash_init_func *) sha512_224_init,
+    (nettle_hash_update_func *) sha512_224_update,
+    (nettle_hash_digest_func *) sha512_224_digest
+  };
+
diff --git a/sha512-256-meta.c b/sha512-256-meta.c
new file mode 100644 (file)
index 0000000..f3ff548
--- /dev/null
@@ -0,0 +1,40 @@
+/* sha512-256-meta.c */
+
+/* nettle, low-level cryptographics library
+ *
+ * Copyright (C) 2014 Niels Möller
+ *  
+ * The nettle library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ * 
+ * The nettle library 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 Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the nettle library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02111-1301, USA.
+ */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "nettle-meta.h"
+
+#include "sha2.h"
+
+const struct nettle_hash nettle_sha512_256 =
+  {
+    "sha512-256", sizeof(struct sha512_ctx),
+    SHA512_256_DIGEST_SIZE,
+    SHA512_256_DATA_SIZE,
+    (nettle_hash_init_func *) sha512_256_init,
+    (nettle_hash_update_func *) sha512_256_update,
+    (nettle_hash_digest_func *) sha512_256_digest
+  };
+