cryptographic primitives for GNUnet More...
#include <stdbool.h>
#include <sodium.h>
#include <gcrypt.h>
Go to the source code of this file.
Data Structures | |
struct | GNUNET_CRYPTO_HashAsciiEncoded |
0-terminated ASCII encoding of a struct GNUNET_HashCode. More... | |
struct | GNUNET_CRYPTO_EccSignaturePurpose |
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed data More... | |
struct | GNUNET_CRYPTO_EddsaSignature |
an ECC signature using EdDSA. More... | |
struct | GNUNET_CRYPTO_EcdsaSignature |
an ECC signature using ECDSA More... | |
struct | GNUNET_CRYPTO_EddsaPublicKey |
Public ECC key (always for curve Ed25519) encoded in a format suitable for network transmission and EdDSA signatures. More... | |
struct | GNUNET_CRYPTO_EcdsaPublicKey |
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDSA signatures. More... | |
struct | GNUNET_PeerIdentity |
The identity of the host (wraps the signing key of the peer). More... | |
struct | GNUNET_CRYPTO_EcdhePublicKey |
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encryption (ECDH), See http://cr.yp.to/ecdh.html. More... | |
struct | GNUNET_CRYPTO_EcdhePrivateKey |
Private ECC key encoded for transmission. More... | |
struct | GNUNET_CRYPTO_EcdsaPrivateKey |
Private ECC key encoded for transmission. More... | |
struct | GNUNET_CRYPTO_EddsaPrivateKey |
Private ECC key encoded for transmission. More... | |
struct | GNUNET_CRYPTO_EddsaPrivateScalar |
Private ECC scalar encoded for transmission. More... | |
struct | GNUNET_CRYPTO_Edx25519PrivateKey |
Private ECC key material encoded for transmission. More... | |
struct | GNUNET_CRYPTO_Edx25519PublicKey |
Public ECC key (always for curve Ed25519) encoded in a format suitable for network transmission and Edx25519 (same as EdDSA) signatures. More... | |
struct | GNUNET_CRYPTO_Edx25519Signature |
an ECC signature using Edx25519 (same as in EdDSA). More... | |
struct | GNUNET_CRYPTO_ElligatorEcdhePrivateKey |
Special private ECC key generated by GNUNET_CRYPTO_ecdhe_elligator_key_create. More... | |
struct | GNUNET_CRYPTO_ElligatorRepresentative |
Elligator representative (always for Curve25519) More... | |
struct | GNUNET_CRYPTO_PrivateKey |
A private key for an identity as per LSD0001. More... | |
struct | GNUNET_CRYPTO_PublicKey |
An identity key as per LSD0001. More... | |
struct | GNUNET_CRYPTO_Signature |
An identity signature as per LSD0001. More... | |
struct | GNUNET_CRYPTO_SymmetricSessionKey |
type for session keys More... | |
struct | GNUNET_CRYPTO_ChallengeNonceP |
Type of a nonce used for challenges. More... | |
struct | GNUNET_CRYPTO_SymmetricInitializationVector |
IV for sym cipher. More... | |
struct | GNUNET_CRYPTO_AuthKey |
type for (message) authentication keys More... | |
struct | GNUNET_CRYPTO_PaillierPublicKey |
Paillier public key. More... | |
struct | GNUNET_CRYPTO_PaillierPrivateKey |
Paillier private key. More... | |
struct | GNUNET_CRYPTO_PaillierCiphertext |
Paillier ciphertext. More... | |
struct | GNUNET_CRYPTO_Cs25519Scalar |
Curve25519 Scalar. More... | |
struct | GNUNET_CRYPTO_Cs25519Point |
Curve25519 point. More... | |
struct | GNUNET_CRYPTO_CsPrivateKey |
The private information of an Schnorr key pair. More... | |
struct | GNUNET_CRYPTO_CsPublicKey |
The public information of an Schnorr key pair. More... | |
struct | GNUNET_CRYPTO_CsBlindingSecret |
Secret used for blinding (alpha and beta). More... | |
struct | GNUNET_CRYPTO_CsRSecret |
the private r used in the signature More... | |
struct | GNUNET_CRYPTO_CsRPublic |
the public R (derived from r) used in c More... | |
struct | GNUNET_CRYPTO_CsC |
Schnorr c to be signed. More... | |
struct | GNUNET_CRYPTO_CsS |
s in the signature More... | |
struct | GNUNET_CRYPTO_CsBlindS |
blinded s in the signature More... | |
struct | GNUNET_CRYPTO_CsSignature |
CS Signtature containing scalar s and point R. More... | |
struct | GNUNET_CRYPTO_CsSessionNonce |
Nonce for the session, picked by client, shared with the signer. More... | |
struct | GNUNET_CRYPTO_CsBlindingNonce |
Nonce for computing blinding factors. More... | |
struct | GNUNET_CRYPTO_PowSalt |
Value for a salt for GNUNET_CRYPTO_pow_hash(). More... | |
struct | GNUNET_CRYPTO_EccPoint |
Point on a curve (always for Curve25519) encoded in a format suitable for network transmission (ECDH), see http://cr.yp.to/ecdh.html. More... | |
struct | GNUNET_CRYPTO_EccScalar |
A ECC scalar for use in point multiplications. More... | |
struct | GNUNET_CRYPTO_HpkeContext |
HPKE crypto context. More... | |
struct | GNUNET_CRYPTO_HpkeEncapsulation |
HPKE DHKEM encapsulation (X25519) See RFC 9180. More... | |
struct | GNUNET_CRYPTO_RsaBlindingKeySecret |
Constant-size pre-secret for blinding key generation. More... | |
struct | GNUNET_CRYPTO_RsaBlindedMessage |
RSA Parameters to create blinded signature. More... | |
struct | GNUNET_CRYPTO_CsBlindedMessage |
CS Parameters derived from the message during blinding to create blinded signature. More... | |
struct | GNUNET_CRYPTO_CSPublicRPairP |
Pair of Public R values for Cs denominations. More... | |
struct | GNUNET_CRYPTO_CsBlindSignature |
The Sign Answer for Clause Blind Schnorr signature. More... | |
struct | GNUNET_CRYPTO_UnblindedSignature |
Type of (unblinded) signatures. More... | |
struct | GNUNET_CRYPTO_BlindedSignature |
Type for blinded signatures. More... | |
struct | GNUNET_CRYPTO_BlindSignPublicKey |
Type of public signing keys for blind signatures. More... | |
struct | GNUNET_CRYPTO_BlindSignPrivateKey |
Type of private signing keys for blind signing. More... | |
struct | GNUNET_CRYPTO_BlindedMessage |
Blinded message ready for blind signing. More... | |
struct | GNUNET_CRYPTO_CSPrivateRPairP |
Secret r for Cs denominations. More... | |
struct | GNUNET_CRYPTO_BlindingInputValues |
Input needed for blinding a message. More... | |
union | GNUNET_CRYPTO_BlindSessionNonce |
Nonce used to deterministiacally derive input values used in multi-round blind signature protocols. More... | |
union | GNUNET_CRYPTO_BlindingSecretP |
Type of blinding secrets. More... | |
Macros | |
#define | GNUNET_CRYPTO_ECC_SIGNATURE_DATA_ENCODING_LENGTH 126 |
Maximum length of an ECC signature. | |
#define | GNUNET_CRYPTO_AES_KEY_LENGTH (256 / 8) |
length of the sessionkey in bytes (256 BIT sessionkey) | |
#define | GNUNET_CRYPTO_HASH_LENGTH (512 / 8) |
Length of a hash value. | |
#define | GNUNET_CRYPTO_PKEY_ASCII_LENGTH 52 |
How many characters (without 0-terminator) are our ASCII-encoded public keys (ECDSA/EDDSA/ECDHE). | |
#define | GNUNET_CRYPTO_PAILLIER_BITS 2048 |
Size of paillier plain texts and public keys. | |
#define | GNUNET_CRYPTO_hash_from_string(enc, result) GNUNET_CRYPTO_hash_from_string2 (enc, strlen (enc), result) |
Convert ASCII encoding back to struct GNUNET_HashCode | |
#define | GNUNET_CRYPTO_HPKE_AEAD_ID 0x0003 |
#define | GNUNET_CRYPTO_HPKE_NONCE_LEN 12 |
#define | GNUNET_CRYPTO_HPKE_KEY_LEN 32 |
#define | GNUNET_CRYPTO_HPKE_TAG_LEN 16 |
#define | GNUNET_CRYPTO_HPKE_SEAL_OVERHEAD_BYTES GNUNET_CRYPTO_HPKE_TAG_LEN |
#define | GNUNET_CRYPTO_HPKE_SEAL_ONESHOT_OVERHEAD_BYTES |
#define | GNUNET_CRYPTO_eddsa_sign(priv, ps, sig) |
EdDSA sign a given block. | |
#define | GNUNET_CRYPTO_ecdsa_sign(priv, ps, sig) |
ECDSA sign a given block. | |
#define | GNUNET_CRYPTO_edx25519_sign(priv, ps, sig) |
Edx25519 sign a given block. | |
#define | GNUNET_CRYPTO_eddsa_verify(purp, ps, sig, pub) |
Verify EdDSA signature. | |
#define | GNUNET_CRYPTO_ecdsa_verify(purp, ps, sig, pub) |
Verify ECDSA signature. | |
#define | GNUNET_CRYPTO_edx25519_verify(purp, ps, sig, pub) |
Verify Edx25519 signature. | |
#define | GNUNET_CRYPTO_sign(priv, ps, sig) |
Sign a given block with GNUNET_CRYPTO_PrivateKey. | |
#define | GNUNET_CRYPTO_signature_verify(purp, ps, sig, pub) |
Verify a given signature with GNUNET_CRYPTO_PublicKey. | |
Typedefs | |
typedef void(* | GNUNET_CRYPTO_HashCompletedCallback) (void *cls, const struct GNUNET_HashCode *res) |
Function called once the hash computation over the specified file has completed. | |
Functions | |
void | GNUNET_CRYPTO_seed_weak_random (int32_t seed) |
Seed a weak random generator. | |
uint8_t | GNUNET_CRYPTO_crc8_n (const void *buf, size_t len) |
Calculate the checksum of a buffer in one step. | |
uint32_t | GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len) |
Perform an incremental step in a CRC16 (for TCP/IP) calculation. | |
uint16_t | GNUNET_CRYPTO_crc16_finish (uint32_t sum) |
Convert results from GNUNET_CRYPTO_crc16_step to final crc16. | |
uint16_t | GNUNET_CRYPTO_crc16_n (const void *buf, size_t len) |
Calculate the checksum of a buffer in one step. | |
int32_t | GNUNET_CRYPTO_crc32_n (const void *buf, size_t len) |
Compute the CRC32 checksum for the first len bytes of the buffer. | |
void | GNUNET_CRYPTO_zero_keys (void *buffer, size_t length) |
Zero out buffer, securely against compiler optimizations. | |
void | GNUNET_CRYPTO_random_block (enum GNUNET_CRYPTO_Quality mode, void *buffer, size_t length) |
Fill block with a random values. | |
void | GNUNET_CRYPTO_random_timeflake (enum GNUNET_CRYPTO_Quality mode, struct GNUNET_Uuid *uuid) |
Fill UUID with a timeflake pseudo-random value. | |
uint32_t | GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i) |
Produce a random value. | |
uint64_t | GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max) |
Generate a random unsigned 64-bit value. | |
unsigned int * | GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n) |
Get an array with a random permutation of the numbers 0...n-1. | |
void | GNUNET_CRYPTO_symmetric_create_session_key (struct GNUNET_CRYPTO_SymmetricSessionKey *key) |
Create a new random session key. | |
ssize_t | GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t size, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, void *result) |
Encrypt a block using a symmetric sessionkey. | |
ssize_t | GNUNET_CRYPTO_symmetric_decrypt (const void *block, size_t size, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, void *result) |
Decrypt a given block using a symmetric sessionkey. | |
void | GNUNET_CRYPTO_symmetric_derive_iv (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, const void *salt, size_t salt_len,...) |
Derive an IV. | |
void | GNUNET_CRYPTO_symmetric_derive_iv_v (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, const void *salt, size_t salt_len, va_list argp) |
Derive an IV. | |
void | GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode *block, struct GNUNET_CRYPTO_HashAsciiEncoded *result) |
Convert hash to ASCII encoding. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, struct GNUNET_HashCode *result) |
Convert ASCII encoding back to a 'struct GNUNET_HashCode'. | |
uint32_t | GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b) |
Compute the distance between 2 hashcodes. | |
void | GNUNET_CRYPTO_hash (const void *block, size_t size, struct GNUNET_HashCode *ret) |
Compute hash of a given block. | |
void | GNUNET_CRYPTO_pow_hash (const struct GNUNET_CRYPTO_PowSalt *salt, const void *buf, size_t buf_len, struct GNUNET_HashCode *result) |
Calculate the 'proof-of-work' hash (an expensive hash). | |
struct GNUNET_HashContext * | GNUNET_CRYPTO_hash_context_start (void) |
Start incremental hashing operation. | |
struct GNUNET_HashContext * | GNUNET_CRYPTO_hash_context_copy (const struct GNUNET_HashContext *hc) |
Make a copy of the hash computation. | |
void | GNUNET_CRYPTO_hash_context_read (struct GNUNET_HashContext *hc, const void *buf, size_t size) |
Add data to be hashed. | |
void | GNUNET_CRYPTO_hash_context_finish (struct GNUNET_HashContext *hc, struct GNUNET_HashCode *r_hash) |
Finish the hash computation. | |
void | GNUNET_CRYPTO_hash_context_abort (struct GNUNET_HashContext *hc) |
Abort hashing, do not bother calculating final result. | |
void | GNUNET_CRYPTO_hmac_raw (const void *key, size_t key_len, const void *plaintext, size_t plaintext_len, struct GNUNET_HashCode *hmac) |
Calculate HMAC of a message (RFC 2104) TODO: Shouldn't this be the standard hmac function and the above be renamed? | |
void | GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, const void *plaintext, size_t plaintext_len, struct GNUNET_HashCode *hmac) |
Calculate HMAC of a message (RFC 2104) | |
struct GNUNET_CRYPTO_FileHashContext * | GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, const char *filename, size_t blocksize, GNUNET_CRYPTO_HashCompletedCallback callback, void *callback_cls) |
Compute the hash of an entire file. | |
void | GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc) |
Cancel a file hashing operation. | |
void | GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, struct GNUNET_HashCode *result) |
Create a random hash code. | |
void | GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b, struct GNUNET_HashCode *result) |
compute result = b - a | |
void | GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *delta, struct GNUNET_HashCode *result) |
compute result = a + delta | |
void | GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b, struct GNUNET_HashCode *result) |
compute result = a ^ b | |
unsigned int | GNUNET_CRYPTO_hash_count_leading_zeros (const struct GNUNET_HashCode *h) |
Count the number of leading 0 bits in h. | |
unsigned int | GNUNET_CRYPTO_hash_count_tailing_zeros (const struct GNUNET_HashCode *h) |
Count the number of tailing 0 bits in h. | |
void | GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode *hc, struct GNUNET_CRYPTO_SymmetricSessionKey *skey, struct GNUNET_CRYPTO_SymmetricInitializationVector *iv) |
Convert a hashcode into a key. | |
int | GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2) |
Compare function for HashCodes, producing a total ordering of all hashcodes. | |
int | GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2, const struct GNUNET_HashCode *target) |
Find out which of the two GNUNET_CRYPTO_hash codes is closer to target in the XOR metric (Kademlia). | |
void | GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, const void *salt, size_t salt_len, va_list argp) |
Derive an authentication key. | |
void | GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, const void *salt, size_t salt_len,...) |
Derive an authentication key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hkdf_extract (struct GNUNET_ShortHashCode *prk, const void *salt, size_t salt_len, const void *ikm, size_t ikm_len) |
HKDF-Extract using SHA256. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hkdf_expand (void *result, size_t out_len, const struct GNUNET_ShortHashCode *prk,...) |
HKDF-Expand using SHA256. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hkdf_expand_v (void *result, size_t out_len, const struct GNUNET_ShortHashCode *prk, va_list argp) |
HKDF-Expand using SHA256. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hkdf_gnunet (void *result, size_t out_len, const void *xts, size_t xts_len, const void *skm, size_t skm_len,...) |
A peculiar HKDF instantiation that tried to mimic Truncated NMAC. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hkdf_gnunet_v (void *result, size_t out_len, const void *xts, size_t xts_len, const void *skm, size_t skm_len, va_list argp) |
Derive key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, size_t xts_len, const void *skm, size_t skm_len, va_list argp) |
Derive key. | |
void | GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r, gcry_mpi_t n, const void *xts, size_t xts_len, const void *skm, size_t skm_len, const char *ctx) |
Deterministically generate a pseudo-random number uniformly from the integers modulo a libgcrypt mpi. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, size_t xts_len, const void *skm, size_t skm_len,...) |
Derive 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_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_edx25519_key_get_public (const struct GNUNET_CRYPTO_Edx25519PrivateKey *priv, struct GNUNET_CRYPTO_Edx25519PublicKey *pub) |
Extract the public key for the given private key. | |
void | GNUNET_CRYPTO_ecdhe_key_get_public (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, struct GNUNET_CRYPTO_EcdhePublicKey *pub) |
Extract the public key for the given private key. | |
char * | GNUNET_CRYPTO_ecdsa_public_key_to_string (const struct GNUNET_CRYPTO_EcdsaPublicKey *pub) |
Convert a public key to a string. | |
char * | GNUNET_CRYPTO_ecdsa_private_key_to_string (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv) |
Convert a private key to a string. | |
char * | GNUNET_CRYPTO_eddsa_private_key_to_string (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv) |
Convert a private key to a string. | |
char * | GNUNET_CRYPTO_eddsa_public_key_to_string (const struct GNUNET_CRYPTO_EddsaPublicKey *pub) |
Convert a public key to a string. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdsa_public_key_from_string (const char *enc, size_t enclen, struct GNUNET_CRYPTO_EcdsaPublicKey *pub) |
Convert a string representing a public key to a public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_private_key_from_string (const char *enc, size_t enclen, struct GNUNET_CRYPTO_EddsaPrivateKey *priv) |
Convert a string representing a private key to a private key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_public_key_from_string (const char *enc, size_t enclen, struct GNUNET_CRYPTO_EddsaPublicKey *pub) |
Convert a string representing a public key to a public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdsa_key_from_file (const char *filename, int do_create, struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey) |
Create a new private key by reading it from a file. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_key_from_file (const char *filename, int do_create, struct GNUNET_CRYPTO_EddsaPrivateKey *pkey) |
Create a new private key by reading it from a file. | |
struct GNUNET_CRYPTO_EddsaPrivateKey * | GNUNET_CRYPTO_eddsa_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Create a new private key by reading our peer's key from the file specified in the configuration. | |
void | GNUNET_CRYPTO_ecdsa_key_create (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk) |
Create a new private key. | |
void | GNUNET_CRYPTO_eddsa_key_create (struct GNUNET_CRYPTO_EddsaPrivateKey *pk) |
Create a new private key. | |
void | GNUNET_CRYPTO_edx25519_key_create (struct GNUNET_CRYPTO_Edx25519PrivateKey *pk) |
Create a new private key. | |
void | GNUNET_CRYPTO_edx25519_key_create_from_seed (const void *seed, size_t seedsize, struct GNUNET_CRYPTO_Edx25519PrivateKey *pk) |
Create a new private key for Edx25519 from a given seed. | |
void | GNUNET_CRYPTO_ecdhe_key_create (struct GNUNET_CRYPTO_EcdhePrivateKey *pk) |
Create a new private key. | |
void | GNUNET_CRYPTO_eddsa_key_clear (struct GNUNET_CRYPTO_EddsaPrivateKey *pk) |
Clear memory that was used to store a private key. | |
void | GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk) |
Clear memory that was used to store a private key. | |
void | GNUNET_CRYPTO_edx25519_key_clear (struct GNUNET_CRYPTO_Edx25519PrivateKey *pk) |
Clear memory that was used to store a private key. | |
void | GNUNET_CRYPTO_ecdhe_key_clear (struct GNUNET_CRYPTO_EcdhePrivateKey *pk) |
Clear memory that was used to store a private key. | |
void | GNUNET_CRYPTO_private_key_clear (struct GNUNET_CRYPTO_PrivateKey *pk) |
Clear memory that was used to store a private key. | |
const struct GNUNET_CRYPTO_EcdsaPrivateKey * | GNUNET_CRYPTO_ecdsa_key_get_anonymous (void) |
Get the shared private key we use for anonymous users. | |
void | GNUNET_CRYPTO_eddsa_setup_hostkey (const char *cfg_name) |
Setup a hostkey file for a peer given the name of the configuration file (!). | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst) |
Retrieve the identity of the host's peer. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_sign_by_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig) |
Sign a given block with a specific purpose using the host's peer identity. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_verify_peer_identity (uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_PeerIdentity *identity) |
Verify a given signature with a peer's identity. | |
struct GNUNET_CRYPTO_EccDlogContext * | GNUNET_CRYPTO_ecc_dlog_prepare (unsigned int max, unsigned int mem) |
Do pre-calculation for ECC discrete logarithm for small factors. | |
int | GNUNET_CRYPTO_ecc_dlog (struct GNUNET_CRYPTO_EccDlogContext *edc, const struct GNUNET_CRYPTO_EccPoint *input) |
Calculate ECC discrete logarithm for small factors. | |
void | GNUNET_CRYPTO_ecc_dexp (int val, struct GNUNET_CRYPTO_EccPoint *r) |
Multiply the generator g of the elliptic curve by val to obtain the point on the curve representing val. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecc_dexp_mpi (const struct GNUNET_CRYPTO_EccScalar *val, struct GNUNET_CRYPTO_EccPoint *r) |
Multiply the generator g of the elliptic curve by val to obtain the point on the curve representing val. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecc_pmul_mpi (const struct GNUNET_CRYPTO_EccPoint *p, const struct GNUNET_CRYPTO_EccScalar *val, struct GNUNET_CRYPTO_EccPoint *r) |
Multiply the point p on the elliptic curve by val. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecc_add (const struct GNUNET_CRYPTO_EccPoint *a, const struct GNUNET_CRYPTO_EccPoint *b, struct GNUNET_CRYPTO_EccPoint *r) |
Add two points on the elliptic curve. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecc_rnd (struct GNUNET_CRYPTO_EccPoint *r, struct GNUNET_CRYPTO_EccPoint *r_inv) |
Obtain a random point on the curve and its additive inverse. | |
void | GNUNET_CRYPTO_ecc_rnd_mpi (struct GNUNET_CRYPTO_EccScalar *r, struct GNUNET_CRYPTO_EccScalar *r_neg) |
Obtain a random scalar for point multiplication on the curve and its additive inverse. | |
void | GNUNET_CRYPTO_ecc_random_mod_n (struct GNUNET_CRYPTO_EccScalar *r) |
Generate a random value mod n. | |
void | GNUNET_CRYPTO_ecc_dlog_release (struct GNUNET_CRYPTO_EccDlogContext *dlc) |
Release precalculated values. | |
void | GNUNET_CRYPTO_ecc_scalar_from_int (int64_t val, struct GNUNET_CRYPTO_EccScalar *r) |
Create a scalar from int value. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, const struct GNUNET_CRYPTO_EcdhePublicKey *pub, struct GNUNET_HashCode *key_material) |
Derive key material from a public and a private ECC key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_ecdh (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_EcdhePublicKey *pub, struct GNUNET_HashCode *key_material) |
Derive key material from a ECDH public key and a private EdDSA key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_x25519_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *sk, const struct GNUNET_CRYPTO_EcdhePublicKey *pk, struct GNUNET_CRYPTO_EcdhePublicKey *dh) |
Derive key material from a ECDH public key and a private X25519 key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_sk_to_x25519 (const struct GNUNET_CRYPTO_PrivateKey *sk, struct GNUNET_CRYPTO_EcdhePrivateKey *x25519) |
Convert a GNUnet identity key to a key sutiable for HPKE (X25519) | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_pk_to_x25519 (const struct GNUNET_CRYPTO_PublicKey *pk, struct GNUNET_CRYPTO_EcdhePublicKey *x25519) |
Convert a GNUnet identity key to a key sutiable for HPKE (X25519) | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_kem_decaps (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk) |
Decapsulate a key for a private X25519 key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_kem_encaps (const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk) |
Encapsulate key material for a X25519 public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_kem_encaps_norand (const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, struct GNUNET_CRYPTO_HpkeEncapsulation *c, const struct GNUNET_CRYPTO_EcdhePrivateKey *skE, struct GNUNET_ShortHashCode *prk) |
Deterministic variant of GNUNET_CRYPTO_hpke_kem_encaps. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_authkem_encaps_norand (const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, const struct GNUNET_CRYPTO_EcdhePrivateKey *skS, struct GNUNET_CRYPTO_HpkeEncapsulation *c, const struct GNUNET_CRYPTO_EcdhePrivateKey *skE, struct GNUNET_ShortHashCode *shared_secret) |
Encapsulate authenticated key material for a X25519 public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_authkem_encaps (const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, const struct GNUNET_CRYPTO_EcdhePrivateKey *skS, struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *shared_secret) |
Encapsulate authenticated key material for a X25519 public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_authkem_decaps (const struct GNUNET_CRYPTO_EcdhePrivateKey *skR, const struct GNUNET_CRYPTO_EcdhePublicKey *pkS, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *shared_secret) |
Decapsulate a key for a private X25519 key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_elligator_kem_encaps_norand (uint8_t random_tweak, const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, struct GNUNET_CRYPTO_HpkeEncapsulation *c, const struct GNUNET_CRYPTO_ElligatorEcdhePrivateKey *skE, struct GNUNET_ShortHashCode *shared_secret) |
Carries out ecdh encapsulation with given public key and the private key from a freshly created ephemeral key pair. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_elligator_kem_encaps (const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *shared_secret) |
Carries out ecdh encapsulation with given public key and the private key from a freshly created ephemeral key pair. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_elligator_kem_decaps (const struct GNUNET_CRYPTO_EcdhePrivateKey *skR, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *shared_secret) |
Carries out ecdh decapsulation with own private key and the representative of the received public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_elligator_authkem_decaps (const struct GNUNET_CRYPTO_EcdhePrivateKey *skR, const struct GNUNET_CRYPTO_EcdhePublicKey *pkS, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *shared_secret) |
Decapsulate a key for a private X25519 key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_kem_decaps (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk) |
Decapsulate a key for a private EdDSA key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_kem_encaps (const struct GNUNET_CRYPTO_EddsaPublicKey *pub, struct GNUNET_CRYPTO_HpkeEncapsulation *c, struct GNUNET_ShortHashCode *prk) |
Encapsulate key material for a EdDSA public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_sender_setup (const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, const uint8_t *info, size_t info_len, struct GNUNET_CRYPTO_HpkeEncapsulation *enc, struct GNUNET_CRYPTO_HpkeContext *ctx) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_sender_setup2 (enum GNUNET_CRYPTO_HpkeKem kem, enum GNUNET_CRYPTO_HpkeMode mode, struct GNUNET_CRYPTO_EcdhePrivateKey *skE, struct GNUNET_CRYPTO_EcdhePrivateKey *skS, const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, const uint8_t *info, size_t info_len, const uint8_t *psk, size_t psk_len, const uint8_t *psk_id, size_t psk_id_len, struct GNUNET_CRYPTO_HpkeEncapsulation *enc, struct GNUNET_CRYPTO_HpkeContext *ctx) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_receiver_setup2 (enum GNUNET_CRYPTO_HpkeKem kem, enum GNUNET_CRYPTO_HpkeMode mode, const struct GNUNET_CRYPTO_HpkeEncapsulation *enc, const struct GNUNET_CRYPTO_EcdhePrivateKey *skR, const struct GNUNET_CRYPTO_EcdhePublicKey *pkS, const uint8_t *info, size_t info_len, const uint8_t *psk, size_t psk_len, const uint8_t *psk_id, size_t psk_id_len, struct GNUNET_CRYPTO_HpkeContext *ctx) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_receiver_setup (const struct GNUNET_CRYPTO_HpkeEncapsulation *enc, const struct GNUNET_CRYPTO_EcdhePrivateKey *skR, const uint8_t *info, size_t info_len, struct GNUNET_CRYPTO_HpkeContext *ctx) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_seal (struct GNUNET_CRYPTO_HpkeContext *ctx, const uint8_t *aad, size_t aad_len, const uint8_t *pt, size_t pt_len, uint8_t *ct, unsigned long long *ct_len) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_seal_oneshot (const struct GNUNET_CRYPTO_EcdhePublicKey *pkR, const uint8_t *info, size_t info_len, const uint8_t *aad, size_t aad_len, const uint8_t *pt, size_t pt_len, uint8_t *ct, unsigned long long *ct_len) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_open (struct GNUNET_CRYPTO_HpkeContext *ctx, const uint8_t *aad, size_t aad_len, const uint8_t *ct, size_t ct_len, uint8_t *pt, unsigned long long *pt_len_p) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hpke_open_oneshot (const struct GNUNET_CRYPTO_EcdhePrivateKey *skR, const uint8_t *info, size_t info_len, const uint8_t *aad, size_t aad_len, const uint8_t *ct, size_t ct_len, uint8_t *pt, unsigned long long *pt_len) |
RFC9180 HPKE encryption. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdsa_ecdh (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, const struct GNUNET_CRYPTO_EcdhePublicKey *pub, struct GNUNET_HashCode *key_material) |
HPKE END. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, const struct GNUNET_CRYPTO_EddsaPublicKey *pub, struct GNUNET_HashCode *key_material) |
Derive key material from a EdDSA public key and a private ECDH key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdh_x25519 (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, const struct GNUNET_CRYPTO_EcdhePublicKey *pub, struct GNUNET_CRYPTO_EcdhePublicKey *dh) |
Derive key material from a EdDSA public key and a private ECDH key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdh_ecdsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, struct GNUNET_HashCode *key_material) |
Derive key material from a EcDSA public key and a private ECDH key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_sign_ (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *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_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EcdsaSignature *sig) |
ECDSA Sign a given block. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_sign_raw (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, void *data, size_t size, struct GNUNET_CRYPTO_EddsaSignature *sig) |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_edx25519_sign_ (const struct GNUNET_CRYPTO_Edx25519PrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_Edx25519Signature *sig) |
Edx25519 sign a given block. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_verify_ (uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_CRYPTO_EddsaPublicKey *pub) |
Verify EdDSA signature. | |
enum GNUNET_GenericReturnValue | 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) |
Verify ECDSA signature. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_edx25519_verify_ (uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_Edx25519Signature *sig, const struct GNUNET_CRYPTO_Edx25519PublicKey *pub) |
Verify Edx25519 signature. | |
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. | |
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. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdsa_sign_derived (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 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. | |
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. | |
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. | |
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. | |
void | GNUNET_CRYPTO_eddsa_key_get_public_from_scalar (const struct GNUNET_CRYPTO_EddsaPrivateScalar *s, struct GNUNET_CRYPTO_EddsaPublicKey *pkey) |
Extract the public key of the given private scalar. | |
void | GNUNET_CRYPTO_edx25519_private_key_derive (const struct GNUNET_CRYPTO_Edx25519PrivateKey *priv, const void *seed, size_t seedsize, struct GNUNET_CRYPTO_Edx25519PrivateKey *result) |
Derive a private scalar from a given private key and a label. | |
void | GNUNET_CRYPTO_edx25519_public_key_derive (const struct GNUNET_CRYPTO_Edx25519PublicKey *pub, const void *seed, size_t seedsize, struct GNUNET_CRYPTO_Edx25519PublicKey *result) |
Derive a public key from a given public key and a label. | |
void | GNUNET_CRYPTO_ecdhe_elligator_decoding (struct GNUNET_CRYPTO_EcdhePublicKey *point, bool *high_y, const struct GNUNET_CRYPTO_ElligatorRepresentative *representative) |
Clears the most significant bit and second most significant bit of the serialized representaive before applying elligator direct map. | |
bool | GNUNET_CRYPTO_ecdhe_elligator_encoding (uint8_t random_tweak, struct GNUNET_CRYPTO_ElligatorRepresentative *r, const struct GNUNET_CRYPTO_EcdhePublicKey *pub) |
Encodes a point on Curve25519 to a an element of the underlying finite field. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdhe_elligator_key_get_public_norand (uint8_t random_tweak, const struct GNUNET_CRYPTO_ElligatorEcdhePrivateKey *sk, struct GNUNET_CRYPTO_EcdhePublicKey *pub, struct GNUNET_CRYPTO_ElligatorRepresentative *repr) |
Generates a valid public key for elligator's inverse map by adding a lower order point to a prime order point. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdhe_elligator_key_get_public (const struct GNUNET_CRYPTO_ElligatorEcdhePrivateKey *sk, struct GNUNET_CRYPTO_EcdhePublicKey *pub, struct GNUNET_CRYPTO_ElligatorRepresentative *repr) |
Generates a valid public key for elligator's inverse map by adding a lower order point to a prime order point. | |
void | GNUNET_CRYPTO_ecdhe_elligator_key_create (struct GNUNET_CRYPTO_ElligatorEcdhePrivateKey *sk) |
Generates a private key for Curve25519. | |
void | GNUNET_CRYPTO_mpi_print_unsigned (void *buf, size_t size, gcry_mpi_t val) |
Output the given MPI value to the given buffer in network byte order. | |
void | GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result, const void *data, size_t size) |
Convert data buffer into MPI value. | |
void | GNUNET_CRYPTO_paillier_create (struct GNUNET_CRYPTO_PaillierPublicKey *public_key, struct GNUNET_CRYPTO_PaillierPrivateKey *private_key) |
Create a freshly generated paillier public key. | |
int | GNUNET_CRYPTO_paillier_encrypt (const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, const gcry_mpi_t m, int desired_ops, struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext) |
Encrypt a plaintext with a paillier public key. | |
void | GNUNET_CRYPTO_paillier_decrypt (const struct GNUNET_CRYPTO_PaillierPrivateKey *private_key, const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, const struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext, gcry_mpi_t m) |
Decrypt a paillier ciphertext with a private key. | |
int | GNUNET_CRYPTO_paillier_hom_add (const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, const struct GNUNET_CRYPTO_PaillierCiphertext *c1, const struct GNUNET_CRYPTO_PaillierCiphertext *c2, struct GNUNET_CRYPTO_PaillierCiphertext *result) |
Compute a ciphertext that represents the sum of the plaintext in c1 and c2. | |
int | GNUNET_CRYPTO_paillier_hom_get_remaining (const struct GNUNET_CRYPTO_PaillierCiphertext *c) |
Get the number of remaining supported homomorphic operations. | |
struct GNUNET_CRYPTO_RsaPrivateKey * | GNUNET_CRYPTO_rsa_private_key_create (unsigned int len) |
Create a new private key. | |
void | GNUNET_CRYPTO_rsa_private_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *key) |
Free memory occupied by the private key. | |
size_t | GNUNET_CRYPTO_rsa_private_key_encode (const struct GNUNET_CRYPTO_RsaPrivateKey *key, void **buffer) |
Encode the private key in a format suitable for storing it into a file. | |
struct GNUNET_CRYPTO_RsaPrivateKey * | GNUNET_CRYPTO_rsa_private_key_decode (const void *buf, size_t buf_size) |
Decode the private key from the data-format back to the "normal", internal format. | |
struct GNUNET_CRYPTO_RsaPrivateKey * | GNUNET_CRYPTO_rsa_private_key_dup (const struct GNUNET_CRYPTO_RsaPrivateKey *key) |
Duplicate the given private key. | |
struct GNUNET_CRYPTO_RsaPublicKey * | GNUNET_CRYPTO_rsa_private_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey *priv) |
Extract the public key of the given private key. | |
void | GNUNET_CRYPTO_rsa_public_key_hash (const struct GNUNET_CRYPTO_RsaPublicKey *key, struct GNUNET_HashCode *hc) |
Compute hash over the public key. | |
bool | GNUNET_CRYPTO_rsa_public_key_check (const struct GNUNET_CRYPTO_RsaPublicKey *key) |
Check if key is well-formed. | |
unsigned int | GNUNET_CRYPTO_rsa_public_key_len (const struct GNUNET_CRYPTO_RsaPublicKey *key) |
Obtain the length of the RSA key in bits. | |
void | GNUNET_CRYPTO_rsa_public_key_free (struct GNUNET_CRYPTO_RsaPublicKey *key) |
Free memory occupied by the public key. | |
size_t | GNUNET_CRYPTO_rsa_public_key_encode (const struct GNUNET_CRYPTO_RsaPublicKey *key, void **buffer) |
Encode the public key in a format suitable for storing it into a file. | |
struct GNUNET_CRYPTO_RsaPublicKey * | GNUNET_CRYPTO_rsa_public_key_decode (const char *buf, size_t len) |
Decode the public key from the data-format back to the "normal", internal format. | |
struct GNUNET_CRYPTO_RsaPublicKey * | GNUNET_CRYPTO_rsa_public_key_dup (const struct GNUNET_CRYPTO_RsaPublicKey *key) |
Duplicate the given public key. | |
int | GNUNET_CRYPTO_rsa_signature_cmp (const struct GNUNET_CRYPTO_RsaSignature *s1, const struct GNUNET_CRYPTO_RsaSignature *s2) |
Compare the values of two signatures. | |
int | GNUNET_CRYPTO_rsa_private_key_cmp (const struct GNUNET_CRYPTO_RsaPrivateKey *p1, const struct GNUNET_CRYPTO_RsaPrivateKey *p2) |
Compare the values of two private keys. | |
int | GNUNET_CRYPTO_rsa_public_key_cmp (const struct GNUNET_CRYPTO_RsaPublicKey *p1, const struct GNUNET_CRYPTO_RsaPublicKey *p2) |
Compare the values of two public keys. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_rsa_blind (const void *message, size_t message_size, const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, struct GNUNET_CRYPTO_RsaPublicKey *pkey, struct GNUNET_CRYPTO_RsaBlindedMessage *bm) |
Blinds the given message with the given blinding key. | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, const struct GNUNET_CRYPTO_RsaBlindedMessage *bm) |
Sign a blinded value, which must be a full domain hash of a message. | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, const void *message, size_t message_size) |
Create and sign a full domain hash of a message. | |
void | GNUNET_CRYPTO_rsa_blinded_message_free (struct GNUNET_CRYPTO_RsaBlindedMessage *bm) |
Free memory occupied by blinded message. | |
void | GNUNET_CRYPTO_rsa_signature_free (struct GNUNET_CRYPTO_RsaSignature *sig) |
Free memory occupied by signature. | |
size_t | GNUNET_CRYPTO_rsa_signature_encode (const struct GNUNET_CRYPTO_RsaSignature *sig, void **buffer) |
Encode the given signature in a format suitable for storing it into a file. | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_signature_decode (const void *buf, size_t buf_size) |
Decode the signature from the data-format back to the "normal", internal format. | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_signature_dup (const struct GNUNET_CRYPTO_RsaSignature *sig) |
Duplicate the given rsa signature. | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_unblind (const struct GNUNET_CRYPTO_RsaSignature *sig, const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, struct GNUNET_CRYPTO_RsaPublicKey *pkey) |
Unblind a blind-signed signature. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_rsa_verify (const void *message, size_t message_size, const struct GNUNET_CRYPTO_RsaSignature *sig, const struct GNUNET_CRYPTO_RsaPublicKey *public_key) |
Verify whether the given hash corresponds to the given signature and the signature is valid with respect to the given public key. | |
void | GNUNET_CRYPTO_cs_private_key_generate (struct GNUNET_CRYPTO_CsPrivateKey *priv) |
Create a new random private key. | |
void | GNUNET_CRYPTO_cs_private_key_get_public (const struct GNUNET_CRYPTO_CsPrivateKey *priv, struct GNUNET_CRYPTO_CsPublicKey *pub) |
Extract the public key of the given private key. | |
void | GNUNET_CRYPTO_cs_r_derive (const struct GNUNET_CRYPTO_CsSessionNonce *nonce, const char *seed, const struct GNUNET_CRYPTO_CsPrivateKey *lts, struct GNUNET_CRYPTO_CsRSecret r[2]) |
Derive a new secret r pair r0 and r1. | |
void | GNUNET_CRYPTO_cs_r_get_public (const struct GNUNET_CRYPTO_CsRSecret *r_priv, struct GNUNET_CRYPTO_CsRPublic *r_pub) |
Extract the public R of the given secret r. | |
void | GNUNET_CRYPTO_cs_blinding_secrets_derive (const struct GNUNET_CRYPTO_CsBlindingNonce *blind_seed, struct GNUNET_CRYPTO_CsBlindingSecret bs[2]) |
Derives new random blinding factors. | |
void | GNUNET_CRYPTO_cs_calc_blinded_c (const struct GNUNET_CRYPTO_CsBlindingSecret bs[2], const struct GNUNET_CRYPTO_CsRPublic r_pub[2], const struct GNUNET_CRYPTO_CsPublicKey *pub, const void *msg, size_t msg_len, struct GNUNET_CRYPTO_CsC blinded_c[2], struct GNUNET_CRYPTO_CSPublicRPairP *r_pub_blind) |
Calculate two blinded c's. | |
void | GNUNET_CRYPTO_cs_sign_derive (const struct GNUNET_CRYPTO_CsPrivateKey *priv, const struct GNUNET_CRYPTO_CsRSecret r[2], const struct GNUNET_CRYPTO_CsBlindedMessage *bm, struct GNUNET_CRYPTO_CsBlindSignature *cs_blind_sig) |
Sign a blinded c. | |
void | GNUNET_CRYPTO_cs_unblind (const struct GNUNET_CRYPTO_CsBlindS *blinded_signature_scalar, const struct GNUNET_CRYPTO_CsBlindingSecret *bs, struct GNUNET_CRYPTO_CsS *signature_scalar) |
Unblind a blind-signed signature using a c that was blinded. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_cs_verify (const struct GNUNET_CRYPTO_CsSignature *sig, const struct GNUNET_CRYPTO_CsPublicKey *pub, const void *msg, size_t msg_len) |
Verify whether the given message corresponds to the given signature and the signature is valid with respect to the given public key. | |
struct GNUNET_CRYPTO_BlindingInputValues * | GNUNET_CRYPTO_get_blinding_input_values (const struct GNUNET_CRYPTO_BlindSignPrivateKey *bsign_priv, const union GNUNET_CRYPTO_BlindSessionNonce *nonce, const char *salt) |
Compute blinding input values for a given nonce and salt. | |
void | GNUNET_CRYPTO_blind_sign_pub_decref (struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub) |
Decrement reference counter of a bsign_pub, and free it if it reaches zero. | |
void | GNUNET_CRYPTO_blind_sign_priv_decref (struct GNUNET_CRYPTO_BlindSignPrivateKey *bsign_priv) |
Decrement reference counter of a bsign_priv, and free it if it reaches zero. | |
void | GNUNET_CRYPTO_unblinded_sig_decref (struct GNUNET_CRYPTO_UnblindedSignature *ub_sig) |
Decrement reference counter of a ub_sig, and free it if it reaches zero. | |
void | GNUNET_CRYPTO_blinded_sig_decref (struct GNUNET_CRYPTO_BlindedSignature *blind_sig) |
Decrement reference counter of a blind_sig, and free it if it reaches zero. | |
void | GNUNET_CRYPTO_blinded_message_decref (struct GNUNET_CRYPTO_BlindedMessage *bm) |
Decrement reference counter of a bm, and free it if it reaches zero. | |
struct GNUNET_CRYPTO_BlindedMessage * | GNUNET_CRYPTO_blinded_message_incref (struct GNUNET_CRYPTO_BlindedMessage *bm) |
Increment reference counter of the given bm. | |
struct GNUNET_CRYPTO_BlindingInputValues * | GNUNET_CRYPTO_blinding_input_values_incref (struct GNUNET_CRYPTO_BlindingInputValues *bm) |
Increment reference counter of the given bi. | |
void | GNUNET_CRYPTO_blinding_input_values_decref (struct GNUNET_CRYPTO_BlindingInputValues *bm) |
Decrement reference counter of the given bi, and free it if it reaches zero. | |
struct GNUNET_CRYPTO_BlindSignPublicKey * | GNUNET_CRYPTO_bsign_pub_incref (struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub) |
Increment reference counter of the given bsign_pub. | |
struct GNUNET_CRYPTO_BlindSignPrivateKey * | GNUNET_CRYPTO_bsign_priv_incref (struct GNUNET_CRYPTO_BlindSignPrivateKey *bsign_priv) |
Increment reference counter of the given bsign_priv. | |
struct GNUNET_CRYPTO_UnblindedSignature * | GNUNET_CRYPTO_ub_sig_incref (struct GNUNET_CRYPTO_UnblindedSignature *ub_sig) |
Increment reference counter of the given ub_sig. | |
struct GNUNET_CRYPTO_BlindedSignature * | GNUNET_CRYPTO_blind_sig_incref (struct GNUNET_CRYPTO_BlindedSignature *blind_sig) |
Increment reference counter of the given blind_sig. | |
int | GNUNET_CRYPTO_bsign_pub_cmp (const struct GNUNET_CRYPTO_BlindSignPublicKey *bp1, const struct GNUNET_CRYPTO_BlindSignPublicKey *bp2) |
Compare two denomination public keys. | |
int | GNUNET_CRYPTO_ub_sig_cmp (const struct GNUNET_CRYPTO_UnblindedSignature *sig1, const struct GNUNET_CRYPTO_UnblindedSignature *sig2) |
Compare two denomination signatures. | |
int | GNUNET_CRYPTO_blind_sig_cmp (const struct GNUNET_CRYPTO_BlindedSignature *sig1, const struct GNUNET_CRYPTO_BlindedSignature *sig2) |
Compare two blinded denomination signatures. | |
int | GNUNET_CRYPTO_blinded_message_cmp (const struct GNUNET_CRYPTO_BlindedMessage *bp1, const struct GNUNET_CRYPTO_BlindedMessage *bp2) |
Compare two blinded messages. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_blind_sign_keys_create (struct GNUNET_CRYPTO_BlindSignPrivateKey **bsign_priv, struct GNUNET_CRYPTO_BlindSignPublicKey **bsign_pub, enum GNUNET_CRYPTO_BlindSignatureAlgorithm cipher,...) |
Initialize public-private key pair for blind signatures. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_blind_sign_keys_create_va (struct GNUNET_CRYPTO_BlindSignPrivateKey **bsign_priv, struct GNUNET_CRYPTO_BlindSignPublicKey **bsign_pub, enum GNUNET_CRYPTO_BlindSignatureAlgorithm cipher, va_list ap) |
Initialize public-private key pair for blind signatures. | |
struct GNUNET_CRYPTO_BlindedMessage * | GNUNET_CRYPTO_message_blind_to_sign (const struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub, const union GNUNET_CRYPTO_BlindingSecretP *bks, const union GNUNET_CRYPTO_BlindSessionNonce *nonce, const void *message, size_t message_size, const struct GNUNET_CRYPTO_BlindingInputValues *alg_values) |
Blind message for blind signing with dk using blinding secret coin_bks. | |
struct GNUNET_CRYPTO_BlindedSignature * | GNUNET_CRYPTO_blind_sign (const struct GNUNET_CRYPTO_BlindSignPrivateKey *bsign_priv, const char *salt, const struct GNUNET_CRYPTO_BlindedMessage *blinded_message) |
Create blind signature. | |
struct GNUNET_CRYPTO_UnblindedSignature * | GNUNET_CRYPTO_blind_sig_unblind (const struct GNUNET_CRYPTO_BlindedSignature *blinded_sig, const union GNUNET_CRYPTO_BlindingSecretP *bks, const void *message, size_t message_size, const struct GNUNET_CRYPTO_BlindingInputValues *alg_values, const struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub) |
Unblind blind signature. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_blind_sig_verify (const struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub, const struct GNUNET_CRYPTO_UnblindedSignature *ub_sig, const void *message, size_t message_size) |
Verify signature made blindly. | |
ssize_t | GNUNET_CRYPTO_public_key_get_length (const struct GNUNET_CRYPTO_PublicKey *key) |
Get the compacted length of a GNUNET_CRYPTO_PublicKey. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, size_t len, struct GNUNET_CRYPTO_PublicKey *key, size_t *read) |
Reads a GNUNET_CRYPTO_PublicKey from a compact buffer. | |
ssize_t | GNUNET_CRYPTO_private_key_get_length (const struct GNUNET_CRYPTO_PrivateKey *key) |
Get the compacted length of a GNUNET_CRYPTO_PrivateKey. | |
ssize_t | GNUNET_CRYPTO_write_public_key_to_buffer (const struct GNUNET_CRYPTO_PublicKey *key, void *buffer, size_t len) |
Writes a GNUNET_CRYPTO_PublicKey to a compact buffer. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_read_private_key_from_buffer (const void *buffer, size_t len, struct GNUNET_CRYPTO_PrivateKey *key, size_t *read) |
Reads a GNUNET_CRYPTO_PrivateKey from a compact buffer. | |
ssize_t | GNUNET_CRYPTO_write_private_key_to_buffer (const struct GNUNET_CRYPTO_PrivateKey *key, void *buffer, size_t len) |
Writes a GNUNET_CRYPTO_PrivateKey to a compact buffer. | |
ssize_t | GNUNET_CRYPTO_signature_get_length (const struct GNUNET_CRYPTO_Signature *sig) |
Get the compacted length of a GNUNET_CRYPTO_Signature. | |
ssize_t | GNUNET_CRYPTO_signature_get_raw_length_by_type (uint32_t type) |
Get the compacted length of a signature by type. | |
ssize_t | GNUNET_CRYPTO_read_signature_from_buffer (struct GNUNET_CRYPTO_Signature *sig, const void *buffer, size_t len) |
Reads a GNUNET_CRYPTO_Signature from a compact buffer. | |
ssize_t | GNUNET_CRYPTO_write_signature_to_buffer (const struct GNUNET_CRYPTO_Signature *sig, void *buffer, size_t len) |
Writes a GNUNET_CRYPTO_Signature to a compact buffer. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_sign_ (const struct GNUNET_CRYPTO_PrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_Signature *sig) |
Sign a given block. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_sign_raw_ (const struct GNUNET_CRYPTO_PrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, unsigned char *sig) |
Sign a given block. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_signature_verify_ (uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_Signature *sig, const struct GNUNET_CRYPTO_PublicKey *pub) |
Verify a given signature. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_signature_verify_raw_ (uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const unsigned char *sig, const struct GNUNET_CRYPTO_PublicKey *pub) |
Verify a given signature. | |
char * | GNUNET_CRYPTO_public_key_to_string (const struct GNUNET_CRYPTO_PublicKey *key) |
Creates a (Base32) string representation of the public key. | |
char * | GNUNET_CRYPTO_private_key_to_string (const struct GNUNET_CRYPTO_PrivateKey *key) |
Creates a (Base32) string representation of the private key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_public_key_from_string (const char *str, struct GNUNET_CRYPTO_PublicKey *key) |
Parses a (Base32) string representation of the public key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_private_key_from_string (const char *str, struct GNUNET_CRYPTO_PrivateKey *key) |
Parses a (Base32) string representation of the private key. | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_key_get_public (const struct GNUNET_CRYPTO_PrivateKey *privkey, struct GNUNET_CRYPTO_PublicKey *key) |
Retrieves the public key representation of a private key. | |
cryptographic primitives for GNUnet
Definition in file gnunet_crypto_lib.h.