49 switch (ntohl (
key->type))
67 switch (ntohl (
key->type))
70 return sizeof (
key->type) +
sizeof (
key->ecdsa_key);
73 return sizeof (
key->type) +
sizeof (
key->eddsa_key);
77 "Got key type %u\n", ntohl (
key->type));
88 switch (ntohl (
key->type))
91 return sizeof (
key->type) +
sizeof (
key->ecdsa_key);
93 return sizeof (
key->type) +
sizeof (
key->eddsa_key);
110 if (len <
sizeof (
key->type))
121 buffer + sizeof (
key->type),
122 length - sizeof (
key->type));
142 - sizeof (
key->type));
156 if (len <
sizeof (
key->type))
167 buffer + sizeof (
key->type),
168 length - sizeof (
key->type));
188 - sizeof (
key->type));
198 switch (ntohl (sig->
type))
216 switch (ntohl (
type))
239 if (len <
sizeof (sig->
type))
248 - sizeof (sig->
type));
267 - sizeof (sig->
type));
279 switch (ntohl (priv->
type))
308 switch (ntohl (priv->
type))
340 switch (ntohl (
pub->type))
366 const unsigned char *sig,
371 switch (ntohl (
pub->type))
458 switch (ntohl (privkey->
type))
static enum GNUNET_GenericReturnValue check_key_type(uint32_t type)
static int ret
Final status code.
struct GNUNET_HashCode key
The key used in the DHT.
static uint32_t type
Type string converted to DNS type value.
static struct GNUNET_CRYPTO_EddsaPublicKey pub
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_verify_(uint32_t purpose, const struct GNUNET_CRYPTO_SignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Verify EdDSA signature.
void GNUNET_CRYPTO_eddsa_key_get_public(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Extract the public key for the given private key.
void GNUNET_CRYPTO_eddsa_key_clear(struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
Clear memory that was used to store a private key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_sign_(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
EdDSA sign a given block.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_ecdsa_sign_(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_EcdsaSignature *sig)
ECDSA Sign a given block.
void GNUNET_CRYPTO_ecdsa_key_clear(struct GNUNET_CRYPTO_EcdsaPrivateKey *pk)
Clear memory that was used to store a private key.
void GNUNET_CRYPTO_ecdsa_key_get_public(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Extract the public key for the given private key.
void GNUNET_CRYPTO_private_key_clear(struct GNUNET_CRYPTO_BlindablePrivateKey *key)
Clear memory that was used to store a private key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_ecdsa_verify_(uint32_t purpose, const struct GNUNET_CRYPTO_SignaturePurpose *validate, const struct GNUNET_CRYPTO_EcdsaSignature *sig, const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Verify ECDSA signature.
ssize_t GNUNET_CRYPTO_public_key_get_length(const struct GNUNET_CRYPTO_BlindablePublicKey *key)
Get the compacted length of a GNUNET_CRYPTO_BlindablePublicKey.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_key_get_public(const struct GNUNET_CRYPTO_BlindablePrivateKey *privkey, struct GNUNET_CRYPTO_BlindablePublicKey *key)
Retrieves the public key representation of a private key.
#define GNUNET_log(kind,...)
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_sign_(const struct GNUNET_CRYPTO_BlindablePrivateKey *priv, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_BlindableKeySignature *sig)
Sign a given block.
char * GNUNET_CRYPTO_blindable_public_key_to_string(const struct GNUNET_CRYPTO_BlindablePublicKey *key)
Creates a (Base32) string representation of the public key.
ssize_t GNUNET_CRYPTO_blinded_key_signature_get_length_by_type(uint32_t type)
Get the compacted length of a signature by type.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_public_key_from_string(const char *str, struct GNUNET_CRYPTO_BlindablePublicKey *key)
Parses a (Base32) string representation of the public key.
ssize_t GNUNET_CRYPTO_write_blindable_sk_to_buffer(const struct GNUNET_CRYPTO_BlindablePrivateKey *key, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_BlindablePrivateKey to a compact buffer.
ssize_t GNUNET_CRYPTO_write_blinded_key_signature_to_buffer(const struct GNUNET_CRYPTO_BlindableKeySignature *sig, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_BlindableKeySignature to a compact buffer.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_signature_verify_(uint32_t purpose, const struct GNUNET_CRYPTO_SignaturePurpose *validate, const struct GNUNET_CRYPTO_BlindableKeySignature *sig, const struct GNUNET_CRYPTO_BlindablePublicKey *pub)
Verify a given signature.
char * GNUNET_CRYPTO_blindable_private_key_to_string(const struct GNUNET_CRYPTO_BlindablePrivateKey *key)
Creates a (Base32) string representation of the private key.
ssize_t GNUNET_CRYPTO_blinded_key_signature_get_length(const struct GNUNET_CRYPTO_BlindableKeySignature *sig)
Get the compacted length of a #GNUNET_CRYPTO_Signature.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_public_key_from_buffer(const void *buffer, size_t len, struct GNUNET_CRYPTO_BlindablePublicKey *key, size_t *kb_read)
Reads a GNUNET_CRYPTO_BlindablePublicKey from a compact buffer.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_signature_verify_raw_(uint32_t purpose, const struct GNUNET_CRYPTO_SignaturePurpose *validate, const unsigned char *sig, const struct GNUNET_CRYPTO_BlindablePublicKey *pub)
Verify a given signature.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_private_key_from_buffer(const void *buffer, size_t len, struct GNUNET_CRYPTO_BlindablePrivateKey *key, size_t *kb_read)
Reads a GNUNET_CRYPTO_BlindablePrivateKey from a compact buffer.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_private_key_from_string(const char *str, struct GNUNET_CRYPTO_BlindablePrivateKey *key)
Parses a (Base32) string representation of the private key.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_sign_raw_(const struct GNUNET_CRYPTO_BlindablePrivateKey *priv, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, unsigned char *sig)
Sign a given block.
ssize_t GNUNET_CRYPTO_write_blindable_pk_to_buffer(const struct GNUNET_CRYPTO_BlindablePublicKey *key, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_BlindablePublicKey to a compact buffer.
ssize_t GNUNET_CRYPTO_blindable_sk_get_length(const struct GNUNET_CRYPTO_BlindablePrivateKey *key)
Get the compacted length of a GNUNET_CRYPTO_BlindablePrivateKey.
GNUNET_GenericReturnValue
Named constants for return values.
ssize_t GNUNET_CRYPTO_read_blinded_key_signature_from_buffer(struct GNUNET_CRYPTO_BlindableKeySignature *sig, const void *buffer, size_t len)
Reads a GNUNET_CRYPTO_BlindableKeySignature from a compact buffer.
@ GNUNET_PUBLIC_KEY_TYPE_EDDSA
EDDSA identity.
@ GNUNET_PUBLIC_KEY_TYPE_ECDSA
The identity type.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_ERROR
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_string_to_data(const char *enc, size_t enclen, void *out, size_t out_size)
Convert CrockfordBase32 encoding back to data.
static unsigned int size
Size of the "table".
An identity signature as per LSD0001.
uint32_t type
Type of signature.
struct GNUNET_CRYPTO_EddsaSignature eddsa_signature
AN EdDSA signature.
struct GNUNET_CRYPTO_EcdsaSignature ecdsa_signature
An ECDSA signature.
A private key for an identity as per LSD0001.
struct GNUNET_CRYPTO_EcdsaPrivateKey ecdsa_key
An ECDSA identity key.
uint32_t type
Type of public key.
struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_key
AN EdDSA identtiy key.
An identity key as per LSD0001.
an ECC signature using ECDSA
an ECC signature using EdDSA.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...