[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 28/31: purge scrypt; add argon2
From: |
gnunet |
Subject: |
[gnunet] 28/31: purge scrypt; add argon2 |
Date: |
Wed, 22 Apr 2020 21:53:19 +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 091f411cc91975e43d7d994a981b82d45bbc9bcb
Author: Martin Schanzenbach <address@hidden>
AuthorDate: Tue Apr 21 18:37:28 2020 +0200
purge scrypt; add argon2
---
README | 2 ++
configure.ac | 2 ++
src/util/crypto_pow.c | 40 ----------------------------------------
3 files changed, 4 insertions(+), 40 deletions(-)
diff --git a/README b/README
index f8fd811f8..5c4648b8e 100644
--- a/README
+++ b/README
@@ -96,6 +96,8 @@ These are the direct dependencies for running GNUnet:
- which (contrib/apparmor(?), gnunet-bugreport,
and possibly more)
- zlib
+- argon2 >= 20190702 (for proof-of-work calculations in
+ revocation)
These are the dependencies for GNUnet's testsuite:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/configure.ac b/configure.ac
index 3b3c9cbe9..b6e44f90e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1033,6 +1033,8 @@ AS_IF([test x$nss = xfalse],
AC_CHECK_LIB([kvm],[kvm_open])
AC_CHECK_LIB([kstat],[kstat_open])
+# test for argon2 (for POW)
+AC_CHECK_LIB([argon2],[argon2d_hash_raw])
# test for libextractor
extractor=0
diff --git a/src/util/crypto_pow.c b/src/util/crypto_pow.c
index 1ab4443d1..35511a130 100644
--- a/src/util/crypto_pow.c
+++ b/src/util/crypto_pow.c
@@ -25,11 +25,8 @@
*/
#include "platform.h"
#include "gnunet_crypto_lib.h"
-#include <gcrypt.h>
#include <argon2.h>
-#define LSD0001
-
/**
* Calculate the 'proof-of-work' hash (an expensive hash).
* We're using a non-standard formula to avoid issues with
@@ -46,7 +43,6 @@ GNUNET_CRYPTO_pow_hash (const char *salt,
size_t buf_len,
struct GNUNET_HashCode *result)
{
-#ifdef LSD0001
GNUNET_break (ARGON2_OK == argon2d_hash_raw (3, /* iterations */
1024, /* memory (1 MiB) */
1, /* threads */
@@ -58,42 +54,6 @@ GNUNET_CRYPTO_pow_hash (const char *salt,
sizeof (struct
GNUNET_HashCode)));
-#else
- struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
- struct GNUNET_CRYPTO_SymmetricSessionKey skey;
- char rbuf[buf_len];
-
- 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",
- strlen ("gnunet-proof-of-work-iv"),
- salt,
- strlen (salt),
- NULL, 0);
- GNUNET_CRYPTO_symmetric_encrypt (buf,
- buf_len,
- &skey,
- &iv,
- &rbuf);
- GNUNET_break (0 == gcry_kdf_derive (rbuf,
- buf_len,
- GCRY_KDF_SCRYPT,
- 1 /* subalgo */,
- salt,
- strlen (salt),
- 2 /* iterations; keep cost of individual
op small */,
- sizeof(struct GNUNET_HashCode),
- result));
-#endif
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnunet] 11/31: uncrustify, (continued)
- [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
- [gnunet] 25/31: packed makes no sense there, gnunet, 2020/04/22
- [gnunet] 19/31: check signature in check_pow, gnunet, 2020/04/22
- [gnunet] 14/31: evaluate epochs, gnunet, 2020/04/22
- [gnunet] 24/31: remove pow_get, gnunet, 2020/04/22
- [gnunet] 21/31: predate validity time on creation; extent ttl on validation, gnunet, 2020/04/22
- [gnunet] 28/31: purge scrypt; add argon2,
gnunet <=
- [gnunet] 16/31: remove sign API call, gnunet, 2020/04/22
- [gnunet] 17/31: update API comments, gnunet, 2020/04/22
- [gnunet] 30/31: add epochs CLI parameter, gnunet, 2020/04/22
- [gnunet] 29/31: remova binary file commited by accident, gnunet, 2020/04/22
- [gnunet] 08/31: towards less variance, gnunet, 2020/04/22
- [gnunet] 22/31: new pass API, gnunet, 2020/04/22
- [gnunet] 27/31: update API for cleanup of handle, gnunet, 2020/04/22
- [gnunet] 26/31: update revocation config, gnunet, 2020/04/22
- [gnunet] 23/31: rename, fix, gnunet, 2020/04/22
- [gnunet] 20/31: include buffer of 10& of epoch, gnunet, 2020/04/22