[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 03/31: update params
From: |
gnunet |
Subject: |
[gnunet] 03/31: update params |
Date: |
Wed, 22 Apr 2020 21:52:54 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 7055edb1ab58c1968d647db7e2bf7a19226066bb
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Fri Apr 17 22:52:28 2020 +0200
update params
---
src/util/crypto_pow.c | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/util/crypto_pow.c b/src/util/crypto_pow.c
index d3e4dbc43..5e225f244 100644
--- a/src/util/crypto_pow.c
+++ b/src/util/crypto_pow.c
@@ -25,9 +25,10 @@
*/
#include "platform.h"
#include "gnunet_crypto_lib.h"
+#include <gcrypt.h>
#include <argon2.h>
-#define LSD001
+#define LSD0001
/**
* Calculate the 'proof-of-work' hash (an expensive hash).
@@ -45,15 +46,15 @@ GNUNET_CRYPTO_pow_hash (const char *salt,
size_t buf_len,
struct GNUNET_HashCode *result)
{
-#ifdef LSD001
+#ifdef LSD0001
char twofish_iv[128 / 8]; // 128 bit IV
char twofish_key[256 / 8]; // 256 bit Key
char rbuf[buf_len];
int rc;
gcry_cipher_hd_t handle;
- GNUNET_break (ARGON2_OK == argon2d_hash_raw (2, /* iterations */
- 100000, /* memory (kb) */
+ GNUNET_break (ARGON2_OK == argon2d_hash_raw (3, /* iterations */
+ 1024, /* memory (1 MiB) */
1, /* threads */
buf,
buf_len,
@@ -85,30 +86,31 @@ GNUNET_CRYPTO_pow_hash (const char *salt,
GNUNET_assert (0 == gcry_cipher_encrypt (handle, &rbuf, buf_len, buf,
buf_len));
gcry_cipher_close (handle);
- GNUNET_break (ARGON2_OK == argon2d_hash_raw (2, /* iterations */
- 100000, /* memory */
+ GNUNET_break (ARGON2_OK == argon2d_hash_raw (3, /* iterations */
+ 1024, /* memory (1 MiB) */
1, /* threads */
rbuf,
buf_len,
salt,
strlen (salt),
result,
- sizeof (struct
GNUNET_HashCode)));
+ sizeof (struct
+ GNUNET_HashCode)));
#else
struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
struct GNUNET_CRYPTO_SymmetricSessionKey skey;
char rbuf[buf_len];
- GNUNET_break (ARGON2_OK == argon2d_hash_raw (buf,
- buf_len,
- GCRY_KDF_SCRYPT,
- 1 /* subalgo */,
- salt,
- strlen (salt),
- 2 /* iterations; keep cost of
individual op small */,
- sizeof(skey),
- &skey));
+ GNUNET_break (0 == gcry_kdf_derive (buf,
+ buf_len,
+ GCRY_KDF_SCRYPT,
+ 1 /* subalgo */,
+ salt,
+ strlen (salt),
+ 2 /* iterations; keep cost of individual
op small */,
+ sizeof(skey),
+ &skey));
GNUNET_CRYPTO_symmetric_derive_iv (&iv,
&skey,
"gnunet-proof-of-work-iv",
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnunet] branch master updated (bf99d2243 -> f225e5688), gnunet, 2020/04/22
- [gnunet] 04/31: merge, gnunet, 2020/04/22
- [gnunet] 01/31: add argon2 for LSD0001, gnunet, 2020/04/22
- [gnunet] 03/31: update params,
gnunet <=
- [gnunet] 02/31: add argon2 for LSD0001, gnunet, 2020/04/22
- [gnunet] 07/31: towards more expirations, gnunet, 2020/04/22
- [gnunet] 05/31: revert, gnunet, 2020/04/22
- [gnunet] 06/31: simplify pow even more; add timestamp to revocation pow, gnunet, 2020/04/22
- [gnunet] 09/31: no diplicate nonces, gnunet, 2020/04/22
- [gnunet] 11/31: uncrustify, gnunet, 2020/04/22
- [gnunet] 12/31: those are actually debug messages, gnunet, 2020/04/22
- [gnunet] 13/31: more comments, allow to pick up pow later, gnunet, 2020/04/22
- [gnunet] 18/31: fix, gnunet, 2020/04/22
- [gnunet] 10/31: some comments, gnunet, 2020/04/22