Skip to content
Snippets Groups Projects
Commit 7a79f7e3 authored by Brad King's avatar Brad King
Browse files

librhash: Activate SHA-3 implementation

parent 87584b5e
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@ set(librhash_sources
librhash/sha1.h
librhash/sha256.c
librhash/sha256.h
librhash/sha3.c
librhash/sha3.h
librhash/sha512.c
librhash/sha512.h
librhash/ustd.h
......
......@@ -39,8 +39,8 @@
#include "sha1.h"
#include "sha256.h"
#include "sha512.h"
#if 0
#include "sha3.h"
#if 0
#include "tiger.h"
#include "tth.h"
#include "whirlpool.h"
......@@ -104,11 +104,11 @@ rhash_info info_sha512 = { RHASH_SHA512, F_BE64, 64, "SHA-512", "sha512" };
#if 0
rhash_info info_edr256 = { RHASH_EDONR256, F_LE32, 32, "EDON-R256", "edon-r256" };
rhash_info info_edr512 = { RHASH_EDONR512, F_LE64, 64, "EDON-R512", "edon-r512" };
#endif
rhash_info info_sha3_224 = { RHASH_SHA3_224, F_LE64, 28, "SHA3-224", "sha3-224" };
rhash_info info_sha3_256 = { RHASH_SHA3_256, F_LE64, 32, "SHA3-256", "sha3-256" };
rhash_info info_sha3_384 = { RHASH_SHA3_384, F_LE64, 48, "SHA3-384", "sha3-384" };
rhash_info info_sha3_512 = { RHASH_SHA3_512, F_LE64, 64, "SHA3-512", "sha3-512" };
#endif
/* some helper macros */
#define dgshft(name) (((char*)&((name##_ctx*)0)->hash) - (char*)0)
......@@ -148,11 +148,11 @@ rhash_hash_info rhash_hash_info_default[RHASH_HASH_COUNT] =
#if 0
{ &info_edr256, sizeof(edonr_ctx), dgshft2(edonr, u.data256.hash) + 32, iuf(rhash_edonr256), 0 }, /* 256 bit */
{ &info_edr512, sizeof(edonr_ctx), dgshft2(edonr, u.data512.hash) + 64, iuf(rhash_edonr512), 0 }, /* 512 bit */
#endif
{ &info_sha3_224, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_224), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 224 bit */
{ &info_sha3_256, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_256), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 256 bit */
{ &info_sha3_384, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_384), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 384 bit */
{ &info_sha3_512, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_512), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 512 bit */
#endif
};
/**
......
......@@ -66,14 +66,22 @@ enum rhash_ids
RHASH_SHA256 = 0x08,
RHASH_SHA384 = 0x10,
RHASH_SHA512 = 0x20,
RHASH_SHA3_224 = 0x40,
RHASH_SHA3_256 = 0x80,
RHASH_SHA3_384 = 0x100,
RHASH_SHA3_512 = 0x200,
RHASH_ALL_HASHES =
RHASH_MD5 |
RHASH_SHA1 |
RHASH_SHA224 |
RHASH_SHA256 |
RHASH_SHA384 |
RHASH_SHA512,
RHASH_HASH_COUNT = 6
RHASH_SHA512 |
RHASH_SHA3_224 |
RHASH_SHA3_256 |
RHASH_SHA3_384 |
RHASH_SHA3_512,
RHASH_HASH_COUNT = 10
#endif
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment