public key cryptography (ECC) for GNS records (LSD0001) More...
Go to the source code of this file.
Macros | |
#define | CURVE "Ed25519" |
Functions | |
static void | derive_h (const void *pub, size_t pubsize, const char *label, const char *context, struct GNUNET_HashCode *hc) |
Derive the 'h' value for key derivation, where 'h = H(l,P)'. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_sign_derived (const struct GNUNET_CRYPTO_EddsaPrivateKey *pkey, const char *label, const char *context, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig) |
This is a signature function for EdDSA which takes a private key and derives it using the label and context before signing. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdsa_sign_derived (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, const char *label, const char *context, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EcdsaSignature *sig) |
This is a signature function for ECDSA which takes a private key, derives/blinds it and signs the message. More... | |
struct GNUNET_CRYPTO_EcdsaPrivateKey * | GNUNET_CRYPTO_ecdsa_private_key_derive (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, const char *label, const char *context) |
Derive a private key from a given private key and a label. More... | |
void | GNUNET_CRYPTO_ecdsa_public_key_derive (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EcdsaPublicKey *result) |
Derive a public key from a given public key and a label. More... | |
void | GNUNET_CRYPTO_eddsa_private_key_derive (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const char *label, const char *context, struct GNUNET_CRYPTO_EddsaPrivateScalar *result) |
Derive a private scalar from a given private key and a label. More... | |
void | GNUNET_CRYPTO_eddsa_public_key_derive (const struct GNUNET_CRYPTO_EddsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EddsaPublicKey *result) |
Derive a public key from a given public key and a label. More... | |
void | GNUNET_CRYPTO_eddsa_key_get_public_from_scalar (const struct GNUNET_CRYPTO_EddsaPrivateScalar *priv, struct GNUNET_CRYPTO_EddsaPublicKey *pkey) |
Extract the public key of the given private scalar. More... | |
public key cryptography (ECC) for GNS records (LSD0001)
Definition in file crypto_ecc_gnsrecord.c.
#define CURVE "Ed25519" |
Definition at line 34 of file crypto_ecc_gnsrecord.c.
|
static |
Derive the 'h' value for key derivation, where 'h = H(l,P)'.
pub | public key for deriviation |
pubsize | the size of the public key |
label | label for deriviation |
context | additional context to use for HKDF of 'h'; typically the name of the subsystem/application |
hc | where to write the result |
NOTE: While (H)KDF calls this value a salt it is not necessary for it to be a random value. It is more common to use a NULL value here (https://www.rfc-editor.org/rfc/rfc8446#section-7.1) But it is safe either way (See RFC 5869)
Definition at line 48 of file crypto_ecc_gnsrecord.c.
References context, GNUNET_CRYPTO_kdf(), pub, and salt.
Referenced by GNUNET_CRYPTO_ecdsa_private_key_derive(), GNUNET_CRYPTO_ecdsa_public_key_derive(), GNUNET_CRYPTO_eddsa_private_key_derive(), and GNUNET_CRYPTO_eddsa_public_key_derive().