Re: Help with hashing and signatures

"Schanzenbach, Martin" <[email protected]> Tue, 4 Aug 2020 22:43:59 +0200
Newsgroups gmane.network.gnunet.general
Message-ID <[email protected]>

> On 4. Aug 2020, at 22:07, Alessio Vanni <[email protected]> wrote:
> 
> "Schanzenbach, Martin" <[email protected]> writes:
> 
>> Is your struct packed as specified in the comment?
> 
> I tried adding both GNUNET_NETWORK_STRUCT_BEGIN/END and GNUNET_PACKED
> and nothing happens.
> 
> The struct contains just two other structs inside.  It's similar to
> `struct GNUNET_REVOCATION_SignaturePurposePS' from the
> "gnunet_revocation_service.h" file, except instead of there being a key
> and a timestamp there is simply a hash generated from a hashing context.
> 
> I even tried swapping `htonl' with `ntohl' and still no luck.  Removing
> the call entirely generates an assertion error which I assume is the
> correct behaviour.
> 
> The error actually seems to stem from gcrypt, but we're now entering a
> field I have even less expertise on, so I can't investigate any further.
> 

Before you look into such low level calls you should double and triple check our
own code and data:

Is the data ("container") you are sending the same (output the hex) on both ends before hashing?
Is the hash of the data the same on both ends? (this one is easier to check as you can print the hash using GNUNET_h2s).
Is the public key received the one to expect when deriving it from the private key? (again print the key).

If you checked all of the above, and they ALL match, then we should consider looking at the crypto
in more detail.

BR
Martin

> Thanks,
> A.V.
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEPREGPBD5jRS9JNFHCwmY74b1m2oFAl8pyI8ACgkQCwmY74b1
m2rDFRAApNRIhUzRHbtGO2A+cLONkA5xHj2sK4hMMOapwi13Lnt9Jwa4wEoKOsWT
2h+i5tl7xguPeM1H1p8dYmh/DZEu7wSBfOKPyx9z6A0mkmtVmMX5meg8PRY7A4sW
o0+9jx2YjJcn/u/bzSAitcoojs/Fo9/3Q1IY2MSgJSEdbHiiKuJKyh/vnU5zYLqs
2aETFTAUR4dOFDQ/6ejfp8YST6/4cX5Pg0dErdScbV002b2v1sbQWLk7DYwVrvHw
ip+ol/CxKiLVUig/qpI02KjO9rg+R3lABtKQuEAlST94TeNUI/Yjer5rGznQSJTq
LvEjefhHMVL5HOndOKK1UsM+6FrQQ1rgz5uNqx6mYFUcC8GIAx1E0s2W8/cRNjnP
dxbdxpcaAt3sBpCPDkzTj270I4CmjFIokDityaF2WmSfg3Tv32r6EgiP/zeGTkWy
M6Z51yySUYpEC+URTXjyJXiNQv3KVazBgBIZjCG5l/OO0vethD4Ts/dSlX7jSBa9
jILV86fB2Y7jf/T73RjdXs7BGBPiL2tI3Bo6OryoIJbyXbANInHyIcdaLHoBQQeg
ZfMDPCafIaLPamPrm8oZBPsiRsWlCqwIF7MCg6pF5lF/C3Tp1+H5dMtOcRRyweZC
qr7/BBtr1Ewp3BpfVBTymcR0DFjSy11sv50NRcyb7ZXuGlZa5zI=
=nfP5
-----END PGP SIGNATURE-----