diff options
Diffstat (limited to 'src/util/payto.c')
-rw-r--r-- | src/util/payto.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/payto.c b/src/util/payto.c index bfc8eb1ba..c596f8d3f 100644 --- a/src/util/payto.c +++ b/src/util/payto.c @@ -228,9 +228,16 @@ void TALER_payto_hash (const char *payto, struct TALER_PaytoHashP *h_payto) { + struct GNUNET_HashCode sha512; + GNUNET_CRYPTO_hash (payto, strlen (payto) + 1, - &h_payto->hash); + &sha512); + GNUNET_static_assert (sizeof (sha512) > sizeof (*h_payto)); + /* truncate */ + memcpy (h_payto, + &sha512, + sizeof (*h_payto)); } |