if (GNUNET_OK !=
GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING,
- &rs.purpose,
+ &rs,
&msg->signature,
&msg->caller_id))
{
e = GNUNET_MQ_msg (ring, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING);
GNUNET_CRYPTO_ecdsa_key_get_public (&msg->caller_id, &ring->caller_id);
ring->expiration_time = rs.expiration_time;
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_ecdsa_sign (&msg->caller_id,
- &rs.purpose,
- &ring->signature));
+ GNUNET_CRYPTO_ecdsa_sign (&msg->caller_id,
+ &rs,
+ &ring->signature);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending RING message via CADET\n");
GNUNET_MQ_send (ch->mq, e);
GNUNET_SERVICE_client_continue (line->client);
+ sizeof(struct GNUNET_CRYPTO_EddsaPublicKey)
+ sizeof(struct GNUNET_CRYPTO_EddsaPublicKey)) ||
(GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_SET_ECC_KEY,
- &m->purpose,
- &m->signature,
- &m->origin_identity.public_key)))
+ GNUNET_CRYPTO_eddsa_verify_ (GNUNET_SIGNATURE_PURPOSE_SET_ECC_KEY,
+ &m->purpose,
+ &m->signature,
+ &m->origin_identity.public_key)))
{
/* invalid signature */
GNUNET_break_op (0);
¤t_ekm.ephemeral_key);
current_ekm.origin_identity = GSC_my_identity;
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (my_private_key,
- ¤t_ekm.purpose,
- ¤t_ekm.signature));
+ GNUNET_CRYPTO_eddsa_sign_ (my_private_key,
+ ¤t_ekm.purpose,
+ ¤t_ekm.signature));
}
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_DNS_RECORD,
- &ad->purpose,
- &ad->signature,
- &ad->peer.public_key))
+ GNUNET_CRYPTO_eddsa_verify_ (GNUNET_SIGNATURE_PURPOSE_DNS_RECORD,
+ &ad->purpose,
+ &ad->signature,
+ &ad->peer.public_key))
{
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
expiration = GNUNET_TIME_relative_to_absolute (DNS_ADVERTISEMENT_TIMEOUT);
dns_advertisement.expiration_time = GNUNET_TIME_absolute_hton (expiration);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (peer_key,
- &dns_advertisement.purpose,
- &dns_advertisement.signature));
+ GNUNET_CRYPTO_eddsa_sign_ (peer_key,
+ &dns_advertisement.purpose,
+ &dns_advertisement.signature));
}
if (NULL != dht_put)
GNUNET_DHT_put_cancel (dht_put);
GNUNET_CRYPTO_ecdsa_key_get_public (nsd,
&ub_enc->verification_key);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_ecdsa_sign (nsd,
- &ub_enc->purpose,
- &ub_enc->signature));
+ GNUNET_CRYPTO_ecdsa_sign_ (nsd,
+ &ub_enc->purpose,
+ &ub_enc->signature));
GNUNET_CRYPTO_hash (&ub_enc->verification_key,
sizeof(ub_enc->verification_key),
&query);
ass.exptime = GNUNET_TIME_absolute_hton (et);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT,
- &ass.purpose,
+ &ass,
&sig,
&ass.peer.public_key))
{
uri->data.loc.fi = base_uri->data.chk;
uri->data.loc.expirationTime = et;
uri->data.loc.peer.public_key = my_public_key;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (sign_key,
- &ass.purpose,
- &uri->data.loc.contentSignature));
+ GNUNET_CRYPTO_eddsa_sign (sign_key,
+ &ass,
+ &uri->data.loc.contentSignature);
return uri;
}
}
if ((0 == (eo & GNUNET_BLOCK_EO_LOCAL_SKIP_CRYPTO)) &&
(GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK,
- &ub->purpose,
- &ub->signature,
- &ub->verification_key)))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK,
+ &ub->purpose,
+ &ub->signature,
+ &ub->verification_key)))
{
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
&block[1]));
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_sign (dkey,
- &block->purpose,
- &block->signature))
+ GNUNET_CRYPTO_ecdsa_sign_ (dkey,
+ &block->purpose,
+ &block->signature))
{
GNUNET_break (0);
GNUNET_free (dkey);
int
GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block)
{
- return GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN,
- &block->purpose,
- &block->signature,
- &block->derived_key);
+ return GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN,
+ &block->purpose,
+ &block->signature,
+ &block->derived_key);
}
sa.purpose.size = htonl (sizeof(sa));
sa.mono_time = GNUNET_TIME_absolute_hton (mono_time);
GNUNET_CRYPTO_hash (address, strlen (address), &sa.h_addr);
- GNUNET_assert (GNUNET_YES ==
- GNUNET_CRYPTO_eddsa_sign (private_key, &sa.purpose, &sig));
+ GNUNET_CRYPTO_eddsa_sign (private_key, &sa, &sig);
sig_str = NULL;
(void) GNUNET_STRINGS_base64_encode (&sig, sizeof(sig), &sig_str);
*result_size =
GNUNET_CRYPTO_hash (raw_addr, strlen (raw_addr), &sa.h_addr);
if (GNUNET_YES !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS,
- &sa.purpose,
+ &sa,
sig,
public_key))
{
/**
* @ingroup crypto
- * EdDSA sign a given block. The @a purpose data is the
- * beginning of the data of which the signature is to be
- * created. The `size` field in @a purpose must correctly
- * indicate the number of bytes of the data structure, including
- * its header.
+ * @brief EdDSA sign a given block.
+ *
+ * The @a purpose data is the beginning of the data of which the signature is
+ * to be created. The `size` field in @a purpose must correctly indicate the
+ * number of bytes of the data structure, including its header. If possible,
+ * use #GNUNET_CRYPTO_eddsa_sign() instead of this function (only if @a validate
+ * is not fixed-size, you must use this function directly).
*
* @param priv private key to use for the signing
* @param purpose what to sign (size, purpose)
- * @param sig where to write the signature
+ * @param[out] sig where to write the signature
* @return #GNUNET_SYSERR on error, #GNUNET_OK on success
*/
int
-GNUNET_CRYPTO_eddsa_sign (
+GNUNET_CRYPTO_eddsa_sign_ (
const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct GNUNET_CRYPTO_EddsaSignature *sig);
/**
* @ingroup crypto
- * ECDSA Sign a given block. The @a purpose data is the
- * beginning of the data of which the signature is to be
- * created. The `size` field in @a purpose must correctly
- * indicate the number of bytes of the data structure, including
- * its header.
+ * @brief EdDSA sign a given block.
+ *
+ * The @a ps data must be a fixed-size struct for which the signature is to be
+ * created. The `size` field in @a ps->purpose must correctly indicate the
+ * number of bytes of the data structure, including its header.
+ *
+ * @param priv private key to use for the signing
+ * @param ps packed struct with what to sign, MUST begin with a purpose
+ * @param[out] sig where to write the signature
+ */
+#define GNUNET_CRYPTO_eddsa_sign(priv,ps,sig) do { \
+ /* check size is set correctly */ \
+ GNUNET_assert (htonl ((ps)->purpose.size) == sizeof (*ps)); \
+ /* check 'ps' begins with the purpose */ \
+ GNUNET_static_assert (((void*) (ps)) == \
+ ((void*) &(ps)->purpose)); \
+ GNUNET_assert (GNUNET_OK == \
+ GNUNET_CRYPTO_eddsa_sign_ (priv, \
+ &(ps)->purpose, \
+ sig)); \
+} while (0)
+
+
+/**
+ * @ingroup crypto
+ * @brief ECDSA Sign a given block.
+ *
+ * The @a purpose data is the beginning of the data of which the signature is
+ * to be created. The `size` field in @a purpose must correctly indicate the
+ * number of bytes of the data structure, including its header. If possible,
+ * use #GNUNET_CRYPTO_ecdsa_sign() instead of this function (only if @a validate
+ * is not fixed-size, you must use this function directly).
*
* @param priv private key to use for the signing
* @param purpose what to sign (size, purpose)
- * @param sig where to write the signature
+ * @param[out] sig where to write the signature
* @return #GNUNET_SYSERR on error, #GNUNET_OK on success
*/
int
-GNUNET_CRYPTO_ecdsa_sign (
+GNUNET_CRYPTO_ecdsa_sign_ (
const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct GNUNET_CRYPTO_EcdsaSignature *sig);
+
+/**
+ * @ingroup crypto
+ * @brief ECDSA sign a given block.
+ *
+ * The @a ps data must be a fixed-size struct for which the signature is to be
+ * created. The `size` field in @a ps->purpose must correctly indicate the
+ * number of bytes of the data structure, including its header.
+ *
+ * @param priv private key to use for the signing
+ * @param ps packed struct with what to sign, MUST begin with a purpose
+ * @param[out] sig where to write the signature
+ */
+#define GNUNET_CRYPTO_ecdsa_sign(priv,ps,sig) do { \
+ /* check size is set correctly */ \
+ GNUNET_assert (htonl ((ps)->purpose.size) == sizeof (*(ps))); \
+ /* check 'ps' begins with the purpose */ \
+ GNUNET_static_assert (((void*) (ps)) == \
+ ((void*) &(ps)->purpose)); \
+ GNUNET_assert (GNUNET_OK == \
+ GNUNET_CRYPTO_ecdsa_sign_ (priv, \
+ &(ps)->purpose, \
+ sig)); \
+} while (0)
+
+
/**
* @ingroup crypto
- * Verify EdDSA signature. The @a validate data is the
- * beginning of the data of which the signature is to be
- * verified. The `size` field in @a validate must correctly
- * indicate the number of bytes of the data structure, including
- * its header. If @a purpose does not match the purpose given
- * in @a validate (the latter must be in big endian), signature
- * verification fails.
+ * @brief Verify EdDSA signature.
+ *
+ * The @a validate data is the beginning of the data of which the signature
+ * is to be verified. The `size` field in @a validate must correctly indicate
+ * the number of bytes of the data structure, including its header. If @a
+ * purpose does not match the purpose given in @a validate (the latter must be
+ * in big endian), signature verification fails. If possible,
+ * use #GNUNET_CRYPTO_eddsa_verify() instead of this function (only if @a validate
+ * is not fixed-size, you must use this function directly).
*
* @param purpose what is the purpose that the signature should have?
* @param validate block to validate (size, purpose, data)
* @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
*/
int
-GNUNET_CRYPTO_eddsa_verify (
+GNUNET_CRYPTO_eddsa_verify_ (
uint32_t purpose,
const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
const struct GNUNET_CRYPTO_EddsaSignature *sig,
/**
* @ingroup crypto
- * Verify ECDSA signature. The @a validate data is the
- * beginning of the data of which the signature is to be
- * verified. The `size` field in @a validate must correctly
- * indicate the number of bytes of the data structure, including
- * its header. If @a purpose does not match the purpose given
- * in @a validate (the latter must be in big endian), signature
- * verification fails.
+ * @brief Verify EdDSA signature.
+ *
+ * The @a ps data must be a fixed-size struct for which the signature is to be
+ * created. The `size` field in @a ps->purpose must correctly indicate the
+ * number of bytes of the data structure, including its header.
+ *
+ * @param purp purpose of the signature, must match 'ps->purpose.purpose'
+ * (except in host byte order)
+ * @param priv private key to use for the signing
+ * @param ps packed struct with what to sign, MUST begin with a purpose
+ * @param sig where to write the signature
+ */
+#define GNUNET_CRYPTO_eddsa_verify(purp,ps,sig,pub) ({ \
+ /* check size is set correctly */ \
+ GNUNET_assert (htonl ((ps)->purpose.size) == sizeof (*(ps))); \
+ /* check 'ps' begins with the purpose */ \
+ GNUNET_static_assert (((void*) (ps)) == \
+ ((void*) &(ps)->purpose)); \
+ GNUNET_CRYPTO_eddsa_verify_ (purp, \
+ &(ps)->purpose, \
+ sig, \
+ pub); \
+ })
+
+
+/**
+ * @ingroup crypto
+ * @brief Verify ECDSA signature.
+ *
+ * The @a validate data is the beginning of the data of which the signature is
+ * to be verified. The `size` field in @a validate must correctly indicate the
+ * number of bytes of the data structure, including its header. If @a purpose
+ * does not match the purpose given in @a validate (the latter must be in big
+ * endian), signature verification fails. If possible, use
+ * #GNUNET_CRYPTO_eddsa_verify() instead of this function (only if @a validate
+ * is not fixed-size, you must use this function directly).
*
* @param purpose what is the purpose that the signature should have?
* @param validate block to validate (size, purpose, data)
* @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
*/
int
-GNUNET_CRYPTO_ecdsa_verify (
+GNUNET_CRYPTO_ecdsa_verify_ (
uint32_t purpose,
const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
const struct GNUNET_CRYPTO_EcdsaSignature *sig,
const struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
+/**
+ * @ingroup crypto
+ * @brief Verify ECDSA signature.
+ *
+ * The @a ps data must be a fixed-size struct for which the signature is to be
+ * created. The `size` field in @a ps->purpose must correctly indicate the
+ * number of bytes of the data structure, including its header.
+ *
+ * @param purp purpose of the signature, must match 'ps->purpose.purpose'
+ * (except in host byte order)
+ * @param priv private key to use for the signing
+ * @param ps packed struct with what to sign, MUST begin with a purpose
+ * @param sig where to write the signature
+ */
+#define GNUNET_CRYPTO_ecdsa_verify(purp,ps,sig,pub) ({ \
+ /* check size is set correctly */ \
+ GNUNET_assert (htonl ((ps)->purpose.size) == sizeof (*(ps))); \
+ /* check 'ps' begins with the purpose */ \
+ GNUNET_static_assert (((void*) (ps)) == \
+ ((void*) &(ps)->purpose)); \
+ GNUNET_CRYPTO_ecdsa_verify_ (purp, \
+ &(ps)->purpose, \
+ sig, \
+ pub); \
+ })
+
/**
* @ingroup crypto
* Derive a private key from a given private key and a label.
fm->origin = my_identity;
fm->proof_of_work = my_proof;
if (nse_work_required > 0)
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (my_private_key,
- &fm->purpose,
- &fm->signature));
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CRYPTO_eddsa_sign_ (my_private_key,
+ &fm->purpose,
+ &fm->signature));
else
memset (&fm->signature, 0, sizeof(fm->signature));
}
}
if ((nse_work_required > 0) &&
(GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_NSE_SEND,
- &incoming_flood->purpose,
- &incoming_flood->signature,
- &incoming_flood->origin.public_key)))
+ GNUNET_CRYPTO_eddsa_verify_ (GNUNET_SIGNATURE_PURPOSE_NSE_SEND,
+ &incoming_flood->purpose,
+ &incoming_flood->signature,
+ &incoming_flood->origin.public_key)))
{
GNUNET_break_op (0);
return GNUNET_NO;
buf_ptr += payload_len;
// Sign and store signature
if (GNUNET_SYSERR ==
- GNUNET_CRYPTO_ecdsa_sign (issuer,
- purpose,
- (struct GNUNET_CRYPTO_EcdsaSignature *)
- buf_ptr))
+ GNUNET_CRYPTO_ecdsa_sign_ (issuer,
+ purpose,
+ (struct GNUNET_CRYPTO_EcdsaSignature *)
+ buf_ptr))
{
GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unable to sign code\n");
code_verifier,
strlen (code_verifier));
// encode code verifier
- GNUNET_STRINGS_base64url_encode (code_verifier_hash, 256 / 8, &expected_code_challenge);
+ GNUNET_STRINGS_base64url_encode (code_verifier_hash, 256 / 8,
+ &expected_code_challenge);
code_challenge = (char *) ¶ms[1];
GNUNET_free (code_verifier_hash);
if ((strlen (expected_code_challenge) != code_challenge_len) ||
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN,
- purpose,
- signature,
- &ticket->identity))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN,
+ purpose,
+ signature,
+ &ticket->identity))
{
GNUNET_free (code_payload);
GNUNET_free (plaintext);
return GNUNET_BLOCK_EVALUATION_OK_DUPLICATE;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT,
- &rba->purpose,
- &rba->signature,
- &rba->peer.public_key))
+ GNUNET_CRYPTO_eddsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT,
+ &rba->purpose,
+ &rba->signature,
+ &rba->peer.public_key))
{
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
GNUNET_CRYPTO_eddsa_key_get_public (h->priv,
&ab.peer.public_key);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (h->priv,
- &ab.purpose,
- &ab.signature));
+ GNUNET_CRYPTO_eddsa_sign_ (h->priv,
+ &ab.purpose,
+ &ab.signature));
GNUNET_STATISTICS_update (h->stats, "# regex accepting blocks stored",
1, GNUNET_NO);
return GNUNET_NO;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
- &rm->purpose,
- &rm->signature,
- &rm->public_key))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
+ &rm->purpose,
+ &rm->signature,
+ &rm->public_key))
{
GNUNET_break_op (0);
return GNUNET_NO;
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
- &rm->purpose,
- &rm->signature,
- &rm->public_key))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
+ &rm->purpose,
+ &rm->signature,
+ &rm->public_key))
{
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
+ sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey));
GNUNET_CRYPTO_ecdsa_key_get_public (key, &rm.public_key);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_ecdsa_sign (key,
- &rm.purpose,
- sig));
+ GNUNET_CRYPTO_ecdsa_sign_ (key,
+ &rm.purpose,
+ sig));
}
for (i = 0; i < ks->threshold; i++)
{
v = ks->presecret_polynomial[i] = gcry_mpi_new (
- GNUNET_SECRETSHARING_ELGAMAL_BITS);
+ GNUNET_SECRETSHARING_ELGAMAL_BITS);
GNUNET_assert (NULL != v);
// Randomize v such that 0 < v < elgamal_q.
// The '- 1' is necessary as bitlength(q) = bitlength(p) - 1.
return;
}
- if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify (
+ if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify_ (
GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1,
&d->purpose, &d->signature,
&d->peer.public_key))
purpose));
d->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG2);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (my_peer_private_key,
- &d->purpose,
- &d->signature));
+ GNUNET_CRYPTO_eddsa_sign_ (my_peer_private_key,
+ &d->purpose,
+ &d->signature));
GNUNET_CONSENSUS_insert (ks->consensus, element, NULL, NULL);
GNUNET_free (element); /* FIXME: maybe stack-allocate instead? */
return;
}
- if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify (
+ if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify_ (
GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG2,
&d->purpose, &d->signature,
&d->peer.public_key))
purpose));
d->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (my_peer_private_key,
- &d->purpose,
- &d->signature));
+ GNUNET_CRYPTO_eddsa_sign_ (my_peer_private_key,
+ &d->purpose,
+ &d->signature));
GNUNET_CONSENSUS_insert (ks->consensus, element, NULL, NULL);
d.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DECRYPTION);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (my_peer_private_key,
- &d.purpose,
- &d.signature));
+ GNUNET_CRYPTO_eddsa_sign_ (my_peer_private_key,
+ &d.purpose,
+ &d.signature));
GNUNET_CONSENSUS_insert (ds->consensus, &element, NULL, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
/* FIXME: check monotonic time is monotonic... */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY,
- &thp.purpose,
+ &thp,
&rekey->sender_sig,
&queue->target.public_key))
{
However, we have to take into account that the plaintext buffer may have
already contained data and not jumpt too far ahead in the ciphertext.
If there is no rekey and the last message is incomplete (max > total),
- it is safe to keep the decryption so we shift by 'max' */
- if (GNUNET_YES == queue->rekeyed)
+ it is safe to keep the decryption so we shift by 'max' */if (GNUNET_YES == queue->rekeyed)
{
max = total - old_pread_off;
queue->rekeyed = GNUNET_NO;
thp.receiver = queue->target;
thp.ephemeral = rekey.ephemeral;
thp.monotonic_time = rekey.monotonic_time;
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (my_private_key,
- &thp.purpose,
- &rekey.sender_sig));
+ GNUNET_CRYPTO_eddsa_sign (my_private_key,
+ &thp,
+ &rekey.sender_sig);
calculate_hmac (&queue->out_hmac, &rekey, sizeof(rekey), &rekey.hmac);
/* Encrypt rekey message with 'old' cipher */
GNUNET_assert (0 ==
ths.receiver = queue->target;
ths.ephemeral = *epub;
ths.monotonic_time = tc.monotonic_time;
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (my_private_key,
- &ths.purpose,
- &tc.sender_sig));
+ GNUNET_CRYPTO_eddsa_sign (my_private_key,
+ &ths,
+ &tc.sender_sig);
GNUNET_assert (0 ==
gcry_cipher_encrypt (queue->out_cipher,
&queue->cwrite_buf[queue->cwrite_off],
from this sender! */
return GNUNET_CRYPTO_eddsa_verify (
GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE,
- &ths.purpose,
+ &ths,
&tc->sender_sig,
&tc->sender.public_key);
}
queue->address_len = in_len;
queue->sock = sock;
boot_queue (queue, GNUNET_TRANSPORT_CS_OUTBOUND);
- //queue->mq_awaits_continue = GNUNET_YES;
+ // queue->mq_awaits_continue = GNUNET_YES;
queue->read_task =
GNUNET_SCHEDULER_add_read_net (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
queue->sock,
max_queue_length = DEFAULT_MAX_QUEUE_LENGTH;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg,
- COMMUNICATOR_CONFIG_SECTION,
- "REKEY_INTERVAL",
- &rekey_interval))
+ COMMUNICATOR_CONFIG_SECTION,
+ "REKEY_INTERVAL",
+ &rekey_interval))
rekey_interval = DEFAULT_REKEY_INTERVAL;
in = tcp_address_to_sockaddr (bindto, &in_len);
options,
&run,
NULL))
- ? 0
- : 1;
+ ? 0
+ : 1;
GNUNET_free ((void *) argv);
return ret;
}
uhs.monotonic_time = uc->monotonic_time;
return GNUNET_CRYPTO_eddsa_verify (
GNUNET_SIGNATURE_COMMUNICATOR_UDP_HANDSHAKE,
- &uhs.purpose,
+ &uhs,
&uc->sender_sig,
&uc->sender.public_key);
}
GNUNET_CRYPTO_hash (&sa, salen, &uhs.h_address);
if (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_COMMUNICATOR_UDP_BROADCAST,
- &uhs.purpose,
+ &uhs,
&ub->sender_sig,
&ub->sender.public_key))
{
uhs.receiver = receiver->target;
GNUNET_CRYPTO_ecdhe_key_get_public (&epriv, &uhs.ephemeral);
uhs.monotonic_time = uc.monotonic_time;
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (my_private_key,
- &uhs.purpose,
- &uc.sender_sig));
+ GNUNET_CRYPTO_eddsa_sign (my_private_key,
+ &uhs,
+ &uc.sender_sig);
/* Leave space for kx */
dpos = sizeof(kx);
/* Append encrypted uc to dgram */
ubs.purpose.size = htonl (sizeof(ubs));
ubs.sender = my_identity;
GNUNET_CRYPTO_hash (addr, addrlen, &ubs.h_address);
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (my_private_key,
- &ubs.purpose,
- &bi->bcm.sender_sig));
+ GNUNET_CRYPTO_eddsa_sign (my_private_key,
+ &ubs,
+ &bi->bcm.sender_sig);
if (NULL != broadcast_addr)
{
bi->broadcast_task = GNUNET_SCHEDULER_add_now (&ifc_broadcast, bi);
ec.purpose.size = htonl (sizeof(ec));
ec.target = dv->target;
ec.ephemeral_key = dv->ephemeral_key;
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
- &ec.purpose,
- &dv->sender_sig));
+ GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
+ &ec,
+ &dv->sender_sig);
}
GNUNET_memcpy (dhops, hops, sizeof(struct DVPathEntryP) * nhops);
dhops[nhops].hop = GST_my_identity;
{
- struct DvHopPS dhp = { .purpose.purpose =
- htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP),
- .purpose.size = htonl (sizeof(dhp)),
- .pred = dhops[nhops - 1].hop,
- .succ = *next_hop,
- .challenge = msg->challenge };
+ struct DvHopPS dhp = {
+ .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP),
+ .purpose.size = htonl (sizeof(dhp)),
+ .pred = dhops[nhops - 1].hop,
+ .succ = *next_hop,
+ .challenge = msg->challenge
+ };
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
- &dhp.purpose,
- &dhops[nhops].hop_sig));
+ GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
+ &dhp,
+ &dhops[nhops].hop_sig);
}
route_control_message_without_fc (next_hop,
&fwd->header,
if (
GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR,
- &ip.purpose,
+ &ip,
init_sig,
&init->public_key))
{
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_HOP,
- &dhp.purpose,
+ &dhp,
&hops[i].hop_sig,
&hops[i].hop.public_key))
{
GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
GNUNET_SIGNATURE_PURPOSE_TRANSPORT_EPHEMERAL,
- &ec.purpose,
+ &ec,
&ppay.sender_sig,
&ppay.sender.public_key))
{
tvr.validity_duration = validity_duration;
{
/* create signature */
- struct TransportValidationPS tvp =
- { .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE),
+ struct TransportValidationPS tvp = {
+ .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE),
.purpose.size = htonl (sizeof(tvp)),
.validity_duration = validity_duration,
- .challenge = tvc->challenge };
+ .challenge = tvc->challenge
+ };
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
- &tvp.purpose,
- &tvr.signature));
+ GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
+ &tvp,
+ &tvr.signature);
}
route_control_message_without_fc (&cmc->im.sender,
&tvr.header,
{
/* check signature */
- struct TransportValidationPS tvp =
- { .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE),
+ struct TransportValidationPS tvp = {
+ .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE),
.purpose.size = htonl (sizeof(tvp)),
.validity_duration = tvr->validity_duration,
- .challenge = tvr->challenge };
+ .challenge = tvr->challenge
+ };
if (
GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_CHALLENGE,
- &tvp.purpose,
+ &tvp,
&tvr->signature,
&cmc->im.sender.public_key))
{
dvl.monotonic_time =
GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (GST_cfg));
{
- struct DvInitPS dvip = { .purpose.purpose = htonl (
- GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR),
- .purpose.size = htonl (sizeof(dvip)),
- .monotonic_time = dvl.monotonic_time,
- .challenge = lle->challenge };
-
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
- &dvip.purpose,
- &dvl.init_sig));
+ struct DvInitPS dvip = {
+ .purpose.purpose = htonl (
+ GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DV_INITIATOR),
+ .purpose.size = htonl (sizeof(dvip)),
+ .monotonic_time = dvl.monotonic_time,
+ .challenge = lle->challenge
+ };
+
+ GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
+ &dvip,
+ &dvl.init_sig);
}
dvl.initiator = GST_my_identity;
dvl.challenge = lle->challenge;
GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
disconnect_msg.public_key = GST_my_identity.public_key;
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
- &disconnect_msg.purpose,
- &disconnect_msg.signature));
+ GNUNET_CRYPTO_eddsa_sign_ (GST_my_private_key,
+ &disconnect_msg.purpose,
+ &disconnect_msg.signature));
(void) send_with_session (n,
&disconnect_msg,
return;
}
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (
+ GNUNET_CRYPTO_eddsa_verify_ (
GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT,
&sdm->purpose,
&sdm->signature,
*sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME);
pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp);
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_sign (GST_my_private_key, &pong->purpose,
- sig_cache))
+ GNUNET_CRYPTO_eddsa_sign_ (GST_my_private_key,
+ &pong->purpose,
+ sig_cache))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_ ("Failed to create PONG signature for peer `%s'\n"),
if (GNUNET_YES == do_verify)
{
/* Do expensive verification */
- sig_res = GNUNET_CRYPTO_eddsa_verify (
+ sig_res = GNUNET_CRYPTO_eddsa_verify_ (
GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
&pong->purpose,
&pong->signature,
* @return #GNUNET_SYSERR on error, #GNUNET_OK on success
*/
int
-GNUNET_CRYPTO_ecdsa_sign (
+GNUNET_CRYPTO_ecdsa_sign_ (
const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct GNUNET_CRYPTO_EcdsaSignature *sig)
* @return #GNUNET_SYSERR on error, #GNUNET_OK on success
*/
int
-GNUNET_CRYPTO_eddsa_sign (
+GNUNET_CRYPTO_eddsa_sign_ (
const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct GNUNET_CRYPTO_EddsaSignature *sig)
* @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
*/
int
-GNUNET_CRYPTO_ecdsa_verify (
+GNUNET_CRYPTO_ecdsa_verify_ (
uint32_t purpose,
const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
const struct GNUNET_CRYPTO_EcdsaSignature *sig,
* @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
*/
int
-GNUNET_CRYPTO_eddsa_verify (
+GNUNET_CRYPTO_eddsa_verify_ (
uint32_t purpose,
const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
const struct GNUNET_CRYPTO_EddsaSignature *sig,
struct GNUNET_CRYPTO_EddsaPublicKey pub;
struct GNUNET_CRYPTO_EddsaSignature sig;
struct TestSignatureDataPS data = { 0 };
+
priv = GNUNET_CRYPTO_eddsa_key_create ();
GNUNET_CRYPTO_eddsa_key_get_public (priv, &pub);
- data.purpose.size = htonl (sizeof (struct TestSignatureDataPS));
- data.purpose.size = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (priv, &data.purpose,
- &sig));
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_verify (0,
- &data.purpose,
- &sig,
- &pub));
+ data.purpose.size = htonl (sizeof (data));
+ data.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
+ GNUNET_CRYPTO_eddsa_sign (priv,
+ &data,
+ &sig);
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST,
+ &data,
+ &sig,
+ &pub));
printf ("eddsa sig:\n");
display_data (" priv", priv, sizeof (struct
char *salt = "I'm very salty";
char *ctx = "I'm a context chunk, also known as 'info' in the RFC";
- GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_kdf (&out,
- out_len,
- salt,
- strlen (salt),
- ikm,
- strlen (ikm),
- ctx,
- strlen (ctx),
- NULL));
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CRYPTO_kdf (&out,
+ out_len,
+ salt,
+ strlen (salt),
+ ikm,
+ strlen (ikm),
+ ctx,
+ strlen (ctx),
+ NULL));
printf ("kdf:\n");
display_data (" salt", salt, strlen (salt));
size_t sig_enc_length;
skey = GNUNET_CRYPTO_rsa_private_key_create (2048);
pkey = GNUNET_CRYPTO_rsa_private_key_get_public (skey);
- GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &message_hash,
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ &message_hash,
sizeof (struct GNUNET_HashCode));
- GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &bks, sizeof (struct
- GNUNET_CRYPTO_RsaBlindingKeySecret));
- GNUNET_assert (GNUNET_YES == GNUNET_CRYPTO_rsa_blind (&message_hash,
- &bks,
- pkey,
- &blinded_data,
- &blinded_len));
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ &bks,
+ sizeof (struct
+ GNUNET_CRYPTO_RsaBlindingKeySecret));
+ GNUNET_assert (GNUNET_YES ==
+ GNUNET_CRYPTO_rsa_blind (&message_hash,
+ &bks,
+ pkey,
+ &blinded_data,
+ &blinded_len));
blinded_sig = GNUNET_CRYPTO_rsa_sign_blinded (skey, blinded_data,
blinded_len);
sig = GNUNET_CRYPTO_rsa_unblind (blinded_sig, &bks, pkey);
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < l; i++)
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (eddsa[i],
- &sig[i].purp,
- &sig[i].sig));
+ GNUNET_CRYPTO_eddsa_sign_ (eddsa[i],
+ &sig[i].purp,
+ &sig[i].sig));
log_duration ("EdDSA", "sign HashCode");
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < l; i++)
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_verify (0,
- &sig[i].purp,
- &sig[i].sig,
- &dspub[i]));
+ GNUNET_CRYPTO_eddsa_verify_ (0,
+ &sig[i].purp,
+ &sig[i].sig,
+ &dspub[i]));
log_duration ("EdDSA", "verify HashCode");
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
fprintf (stderr, "%s", "."); fflush (stderr);
- if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign (key, &purp, &sig))
+ if (GNUNET_SYSERR ==
+ GNUNET_CRYPTO_ecdsa_sign_ (key, &purp, &sig))
{
fprintf (stderr,
"%s",
continue;
}
if (GNUNET_SYSERR ==
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST, &purp, &sig,
- &pkey))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_TEST,
+ &purp, &sig,
+ &pkey))
{
printf ("GNUNET_CRYPTO_ecdsa_verify failed!\n");
ok = GNUNET_SYSERR;
continue;
}
if (GNUNET_SYSERR !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
- &purp, &sig, &pkey))
+ GNUNET_CRYPTO_ecdsa_verify_ (
+ GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
+ &purp, &sig, &pkey))
{
printf ("GNUNET_CRYPTO_ecdsa_verify failed to fail!\n");
ok = GNUNET_SYSERR;
purp.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose));
purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
- if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign (dpriv, &purp, &sig))
+ if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign_ (dpriv, &purp, &sig))
{
fprintf (stderr, "%s", "GNUNET_CRYPTO_ecdsa_sign returned SYSERR\n");
GNUNET_free (dpriv);
return GNUNET_SYSERR;
}
if (GNUNET_SYSERR ==
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST,
- &purp, &sig,
- &dpub))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_TEST,
+ &purp, &sig,
+ &dpub))
{
printf ("GNUNET_CRYPTO_ecdsa_verify failed!\n");
GNUNET_free (dpriv);
return GNUNET_SYSERR;
}
if (GNUNET_SYSERR !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST,
- &purp, &sig,
- &pkey))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_TEST,
+ &purp, &sig,
+ &pkey))
{
printf ("GNUNET_CRYPTO_ecdsa_verify failed to fail!\n");
GNUNET_free (dpriv);
return GNUNET_SYSERR;
}
if (GNUNET_SYSERR !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
- &purp, &sig, &dpub))
+ GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
+ &purp, &sig, &dpub))
{
printf ("GNUNET_CRYPTO_ecdsa_verify failed to fail!\n");
GNUNET_free (dpriv);
for (i = 0; i < ITER; i++)
{
fprintf (stderr, "%s", "."); fflush (stderr);
- if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign (key, &purp, &sig))
+ if (GNUNET_SYSERR == GNUNET_CRYPTO_ecdsa_sign_ (key, &purp, &sig))
{
fprintf (stderr, "%s",
"GNUNET_CRYPTO_ecdsa_sign returned SYSERR\n");
for (unsigned int i = 0; i < ITER; i++)
{
fprintf (stderr, "%s", "."); fflush (stderr);
- if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_sign (key, &purp, &sig))
+ if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_sign_ (key, &purp, &sig))
{
fprintf (stderr, "%s", "GNUNET_CRYPTO_eddsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;
continue;
}
if (GNUNET_SYSERR ==
- GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST, &purp, &sig,
- &pkey))
+ GNUNET_CRYPTO_eddsa_verify_ (GNUNET_SIGNATURE_PURPOSE_TEST, &purp, &sig,
+ &pkey))
{
printf ("GNUNET_CRYPTO_eddsa_verify failed!\n");
ok = GNUNET_SYSERR;
continue;
}
if (GNUNET_SYSERR !=
- GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
- &purp, &sig, &pkey))
+ GNUNET_CRYPTO_eddsa_verify_ (
+ GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
+ &purp, &sig, &pkey))
{
printf ("GNUNET_CRYPTO_eddsa_verify failed to fail!\n");
ok = GNUNET_SYSERR;
for (unsigned int i = 0; i < ITER; i++)
{
fprintf (stderr, "%s", "."); fflush (stderr);
- if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_sign (key, &purp, &sig))
+ if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_sign_ (key, &purp, &sig))
{
fprintf (stderr, "%s", "GNUNET_CRYPTO_eddsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;