summaryrefslogtreecommitdiff
path: root/ed448-shake256.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2020-01-02 22:58:07 +0100
committerNiels Möller <nisse@lysator.liu.se>2020-01-02 22:58:07 +0100
commit1e3410359ec202203abbc2cf06f774c5ff88e82f (patch)
tree4907c2da5a91931abf19e921de6adfc9591e6554 /ed448-shake256.c
parenta148ed32b381a6294d0fcbd58e7198532c1bc709 (diff)
downloadnettle-1e3410359ec202203abbc2cf06f774c5ff88e82f.tar.gz
Use function pointer to represent eddsa dom prefix.
Diffstat (limited to 'ed448-shake256.c')
-rw-r--r--ed448-shake256.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ed448-shake256.c b/ed448-shake256.c
index 4e54b2c6..25d878f0 100644
--- a/ed448-shake256.c
+++ b/ed448-shake256.c
@@ -39,14 +39,22 @@
#include "sha3.h"
#define DOM_SIZE 10
-static const uint8_t ed448_dom[DOM_SIZE] =
- { 'S', 'i', 'g', 'E', 'd', '4', '4', '8', 0, 0};
+
+static nettle_eddsa_dom_func ed448_dom;
+
+static void
+ed448_dom(void *ctx)
+{
+ static const uint8_t dom[DOM_SIZE] =
+ { 'S', 'i', 'g', 'E', 'd', '4', '4', '8', 0, 0};
+ sha3_256_update (ctx, DOM_SIZE, dom);
+}
const struct ecc_eddsa _nettle_ed448_shake256 =
{
(nettle_hash_update_func *) sha3_256_update,
(nettle_hash_digest_func *) sha3_256_shake,
- ed448_dom, DOM_SIZE,
+ ed448_dom,
~(mp_limb_t) 3,
(mp_limb_t) 1 << (447 % GMP_NUMB_BITS),
};