[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Signing some data using CRYPTO
From: |
Alessio Vanni |
Subject: |
Signing some data using CRYPTO |
Date: |
Sat, 13 Jun 2020 18:47:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hello,
I have a service which sends some data to a remote peer via CADET to a
well known port. This data is preceded by a header with a bunch of
informations, including a signature to verify that nothing happened
while the data was being transmitted. I thought I could use CRYPTO to
sign this data, but it's a bit unclear how it works. The signature
should be performed using the keys of an ego.
The function to sign the data expects a "purpose", which is a structure
with two field: "size" and "purpose". It's not clear where the data to
sign goes, but I'll guess it goes after the structure, similarily to how
messages created with `GNUNET_MQ_msg_extra' have extra space at the end.
The "purpose" field has a problem though: the documentation says the
value has to be one from "gnunet_signatures.h", but none of them are a
"generic signature" value, only something specific to a certain
situation.
There is also another small problem, because the data can have a size
that can fit into a uint64_t (when sent through CADET, the data is
fragmented as needed) and the "size" field in the purpose is a uint32_t,
but since the service is still being developed the uint64_t can become a
uint32_t if needed.
With all that said, how can I sign some data using CRYPTO?
Thanks,
A.V.
- Signing some data using CRYPTO,
Alessio Vanni <=