From: Christian Grothoff Date: Mon, 28 May 2018 11:04:11 +0000 (+0200) Subject: add patch from Niibe Yutaka for X-Git-Tag: v0.11.0pre66~36^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a46fff931d631a176f56547692b16ae32c89299b;p=oweals%2Fgnunet.git add patch from Niibe Yutaka for #5328 --- diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index 1abf0fddc..8d9091b23 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c @@ -1281,6 +1281,16 @@ eddsa_d_to_a (gcry_mpi_t d) gcry_mpi_print (GCRYMPI_FMT_USG, rawmpi, rawmpilen, &rawmpilen, d)); + if (rawmpilen < 32) + { + memmove (rawmpi + 32 - rawmpilen, + rawmpi, + rawmpilen); + memset (rawmpi, + 0, + 32 - rawmpilen); + rawmpilen = 32; + } hvec[0].data = digest; hvec[0].off = 0; hvec[0].len = b > rawmpilen ? (b - rawmpilen) : 0;