![]() |
GNUnet
0.11.x
|
Chaum-style Blind signatures based on RSA. More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_CRYPTO_RsaPrivateKey |
The private information of an RSA key pair. More... | |
struct | GNUNET_CRYPTO_RsaPublicKey |
The public information of an RSA key pair. More... | |
struct | GNUNET_CRYPTO_RsaSignature |
an RSA signature More... | |
struct | RsaBlindingKey |
RSA blinding key. More... | |
struct | GNUNET_CRYPTO_RsaPublicKeyHeaderP |
Format of the header of a serialized RSA public key. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "util-crypto-rsa", __VA_ARGS__) |
Functions | |
static int | key_from_sexp (gcry_mpi_t *array, gcry_sexp_t sexp, const char *topname, const char *elems) |
Extract values from an S-expression. More... | |
struct GNUNET_CRYPTO_RsaPrivateKey * | GNUNET_CRYPTO_rsa_private_key_create (unsigned int len) |
Create a new private key. More... | |
void | GNUNET_CRYPTO_rsa_private_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *key) |
Free memory occupied by the private key. More... | |
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. More... | |
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. More... | |
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. More... | |
void | GNUNET_CRYPTO_rsa_public_key_free (struct GNUNET_CRYPTO_RsaPublicKey *key) |
Free memory occupied by the public key. More... | |
GNUNET_NETWORK_STRUCT_END 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. More... | |
void | GNUNET_CRYPTO_rsa_public_key_hash (const struct GNUNET_CRYPTO_RsaPublicKey *key, struct GNUNET_HashCode *hc) |
Compute hash over the public key. More... | |
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. More... | |
static int | rsa_gcd_validate (gcry_mpi_t r, gcry_mpi_t n) |
Test for malicious RSA key. More... | |
static struct RsaBlindingKey * | rsa_blinding_key_derive (const struct GNUNET_CRYPTO_RsaPublicKey *pkey, const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks) |
Create a blinding key. More... | |
int | GNUNET_CRYPTO_rsa_signature_cmp (const struct GNUNET_CRYPTO_RsaSignature *s1, const struct GNUNET_CRYPTO_RsaSignature *s2) |
Compare the values of two signatures. More... | |
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. More... | |
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. More... | |
unsigned int | GNUNET_CRYPTO_rsa_public_key_len (const struct GNUNET_CRYPTO_RsaPublicKey *key) |
Obtain the length of the RSA key in bits. More... | |
static void | rsa_blinding_key_free (struct RsaBlindingKey *bkey) |
Destroy a blinding key. More... | |
static size_t | numeric_mpi_alloc_n_print (gcry_mpi_t v, char **buffer) |
Print an MPI to a newly created buffer. More... | |
static gcry_mpi_t | rsa_full_domain_hash (const struct GNUNET_CRYPTO_RsaPublicKey *pkey, const struct GNUNET_HashCode *hash) |
Computes a full domain hash seeded by the given public key. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, struct GNUNET_CRYPTO_RsaPublicKey *pkey, void **buf, size_t *buf_size) |
Blinds the given message with the given blinding key. More... | |
static gcry_sexp_t | mpi_to_sexp (gcry_mpi_t value) |
Convert an MPI to an S-expression suitable for signature operations. More... | |
static struct GNUNET_CRYPTO_RsaSignature * | rsa_sign_mpi (const struct GNUNET_CRYPTO_RsaPrivateKey *key, gcry_mpi_t value) |
Sign the given MPI. More... | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, const void *msg, size_t msg_len) |
Sign a blinded value, which must be a full domain hash of a message. More... | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, const struct GNUNET_HashCode *hash) |
Create and sign a full domain hash of a message. More... | |
void | GNUNET_CRYPTO_rsa_signature_free (struct GNUNET_CRYPTO_RsaSignature *sig) |
Free memory occupied by signature. More... | |
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. More... | |
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. More... | |
struct GNUNET_CRYPTO_RsaPublicKey * | GNUNET_CRYPTO_rsa_public_key_dup (const struct GNUNET_CRYPTO_RsaPublicKey *key) |
Duplicate the given public key. More... | |
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. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_RsaSignature *sig, const struct GNUNET_CRYPTO_RsaPublicKey *pkey) |
Verify whether the given hash corresponds to the given signature and the signature is valid with respect to the given public key. More... | |
struct GNUNET_CRYPTO_RsaPrivateKey * | GNUNET_CRYPTO_rsa_private_key_dup (const struct GNUNET_CRYPTO_RsaPrivateKey *key) |
Duplicate the given private key. More... | |
struct GNUNET_CRYPTO_RsaSignature * | GNUNET_CRYPTO_rsa_signature_dup (const struct GNUNET_CRYPTO_RsaSignature *sig) |
Duplicate the given rsa signature. More... | |
Chaum-style Blind signatures based on RSA.
Definition in file crypto_rsa.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "util-crypto-rsa", __VA_ARGS__) |
Definition at line 33 of file crypto_rsa.c.
Referenced by GNUNET_CRYPTO_rsa_private_key_decode(), GNUNET_CRYPTO_rsa_verify(), and rsa_sign_mpi().
|
static |
Extract values from an S-expression.
array | where to store the result(s) |
sexp | S-expression to parse |
topname | top-level name in the S-expression that is of interest |
elems | names of the elements to extract |
Definition at line 94 of file crypto_rsa.c.
References list.
Referenced by GNUNET_CRYPTO_rsa_blind(), GNUNET_CRYPTO_rsa_private_key_get_public(), GNUNET_CRYPTO_rsa_public_key_encode(), GNUNET_CRYPTO_rsa_public_key_len(), GNUNET_CRYPTO_rsa_signature_dup(), GNUNET_CRYPTO_rsa_signature_encode(), GNUNET_CRYPTO_rsa_unblind(), rsa_blinding_key_derive(), and rsa_full_domain_hash().
struct GNUNET_CRYPTO_RsaPrivateKey* GNUNET_CRYPTO_rsa_private_key_create | ( | unsigned int | len | ) |
Create a new private key.
Caller must free return value.
len | length of the key in bits (i.e. 2048) |
Definition at line 143 of file crypto_rsa.c.
References BENCHMARK_END, BENCHMARK_START, GNUNET_assert, GNUNET_new, ret, and GNUNET_CRYPTO_RsaPrivateKey::sexp.
Referenced by output_vectors().
void GNUNET_CRYPTO_rsa_private_key_free | ( | struct GNUNET_CRYPTO_RsaPrivateKey * | key | ) |
Free memory occupied by the private key.
key | pointer to the memory to free |
Definition at line 172 of file crypto_rsa.c.
References GNUNET_free, and GNUNET_CRYPTO_RsaPrivateKey::sexp.
Referenced by GNUNET_CRYPTO_rsa_private_key_decode(), and output_vectors().
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.
key | the private key | |
[out] | buffer | set to a buffer with the encoded key |
Definition at line 180 of file crypto_rsa.c.
References testconfigure::b, GNUNET_assert, GNUNET_malloc, and GNUNET_CRYPTO_RsaPrivateKey::sexp.
Referenced by GNUNET_CRYPTO_rsa_private_key_cmp(), and output_vectors().
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.
buf | the buffer where the private key data is stored |
buf_size | the size of the data in buf |
Definition at line 203 of file crypto_rsa.c.
References GNUNET_CRYPTO_rsa_private_key_free(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_new, key, LOG, and GNUNET_CRYPTO_RsaPrivateKey::sexp.
Referenced by checkvec().
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.
priv | the private key |
Definition at line 232 of file crypto_rsa.c.
References BENCHMARK_END, BENCHMARK_START, GNUNET_break_op, GNUNET_new, key_from_sexp(), pub, result, GNUNET_CRYPTO_RsaPrivateKey::sexp, and GNUNET_CRYPTO_RsaPublicKey::sexp.
Referenced by GNUNET_CRYPTO_rsa_sign_fdh(), output_vectors(), and rsa_sign_mpi().
void GNUNET_CRYPTO_rsa_public_key_free | ( | struct GNUNET_CRYPTO_RsaPublicKey * | key | ) |
Free memory occupied by the public key.
key | pointer to the memory to free |
Definition at line 267 of file crypto_rsa.c.
References GNUNET_free, GNUNET_NETWORK_STRUCT_BEGIN, and GNUNET_CRYPTO_RsaPublicKey::sexp.
Referenced by clean_rsa_pub(), clean_rsa_public_key(), GNUNET_CRYPTO_rsa_sign_fdh(), output_vectors(), and rsa_sign_mpi().
GNUNET_NETWORK_STRUCT_END 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.
key | the private key | |
[out] | buffer | set to a buffer with the encoded key |
Definition at line 300 of file crypto_rsa.c.
References buf, GNUNET_assert, GNUNET_break, GNUNET_malloc, key_from_sexp(), GNUNET_CRYPTO_RsaPublicKeyHeaderP::modulus_length, GNUNET_CRYPTO_RsaPublicKeyHeaderP::public_exponent_length, ret, and GNUNET_CRYPTO_RsaPublicKey::sexp.
Referenced by bind_rsa_pub(), checkvec(), GNUNET_CRYPTO_rsa_public_key_cmp(), GNUNET_CRYPTO_rsa_public_key_hash(), GNUNET_JSON_from_rsa_public_key(), my_conv_rsa_public_key(), output_vectors(), qconv_rsa_public_key(), and rsa_full_domain_hash().
void GNUNET_CRYPTO_rsa_public_key_hash | ( | const struct GNUNET_CRYPTO_RsaPublicKey * | key, |
struct GNUNET_HashCode * | hc | ||
) |
Compute hash over the public key.
key | public key to hash |
hc | where to store the hash code |
Definition at line 367 of file crypto_rsa.c.
References buf, GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_rsa_public_key_encode(), and GNUNET_free.
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.
buf | the buffer where the public key data is stored |
len | the length of the data in buf |
Definition at line 383 of file crypto_rsa.c.
References data, e, GNUNET_break, GNUNET_break_op, GNUNET_new, key, GNUNET_CRYPTO_RsaPublicKeyHeaderP::modulus_length, GNUNET_CRYPTO_RsaPublicKeyHeaderP::public_exponent_length, and GNUNET_CRYPTO_RsaPublicKey::sexp.
Referenced by checkvec(), extract_rsa_pub(), extract_rsa_public_key(), parse_rsa_public_key(), and post_extract_rsa_public_key().
|
static |
Test for malicious RSA key.
Assuming n is an RSA modulous and r is generated using a call to GNUNET_CRYPTO_kdf_mod_mpi, if gcd(r,n) != 1 then n must be a malicious RSA key designed to deanomize the user.
r | KDF result |
n | RSA modulus |
Definition at line 461 of file crypto_rsa.c.
References t.
Referenced by rsa_blinding_key_derive(), and rsa_full_domain_hash().
|
static |
Create a blinding key.
len | length of the key in bits (i.e. 2048) |
bks | pre-secret to use to derive the blinding key |
Definition at line 481 of file crypto_rsa.c.
References GNUNET_assert, GNUNET_CRYPTO_kdf_mod_mpi(), GNUNET_free, GNUNET_new, key_from_sexp(), RsaBlindingKey::r, rsa_gcd_validate(), and GNUNET_CRYPTO_RsaPublicKey::sexp.
Referenced by GNUNET_CRYPTO_rsa_blind(), and GNUNET_CRYPTO_rsa_unblind().
int GNUNET_CRYPTO_rsa_signature_cmp | ( | const struct GNUNET_CRYPTO_RsaSignature * | s1, |
const struct GNUNET_CRYPTO_RsaSignature * | s2 | ||
) |
Compare the values of two signatures.
s1 | one signature |
s2 | the other signature |
Definition at line 556 of file crypto_rsa.c.
References GNUNET_CRYPTO_rsa_signature_encode(), GNUNET_free, and ret.
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.
p1 | one public key |
p2 | the other public key |
Definition at line 582 of file crypto_rsa.c.
References GNUNET_CRYPTO_rsa_public_key_encode(), GNUNET_free, and ret.
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.
p1 | one private key |
p2 | the other private key |
Definition at line 608 of file crypto_rsa.c.
References GNUNET_CRYPTO_rsa_private_key_encode(), GNUNET_free, and ret.
unsigned int GNUNET_CRYPTO_rsa_public_key_len | ( | const struct GNUNET_CRYPTO_RsaPublicKey * | key | ) |
Obtain the length of the RSA key in bits.
key | the public key to introspect |
Definition at line 634 of file crypto_rsa.c.
References GNUNET_break, key_from_sexp(), and GNUNET_CRYPTO_RsaPublicKey::sexp.
|
static |
Destroy a blinding key.
bkey | the blinding key to destroy |
Definition at line 656 of file crypto_rsa.c.
References GNUNET_free, and RsaBlindingKey::r.
Referenced by GNUNET_CRYPTO_rsa_blind(), and GNUNET_CRYPTO_rsa_unblind().
|
static |
Print an MPI to a newly created buffer.
v | MPI to print. | |
[out] | newly | allocated buffer containing the result |
Definition at line 671 of file crypto_rsa.c.
References testconfigure::b, GNUNET_assert, and GNUNET_malloc.
Referenced by GNUNET_CRYPTO_rsa_blind().
|
static |
Computes a full domain hash seeded by the given public key.
This gives a measure of provable security to the Taler exchange against one-more forgery attacks. See: https://eprint.iacr.org/2001/002.pdf http://www.di.ens.fr/~pointche/Documents/Papers/2001_fcA.pdf
hash | initial hash of the message to sign |
pkey | the public key of the signer |
rsize | If not NULL, the number of bytes actually stored in buffer |
Definition at line 708 of file crypto_rsa.c.
References GNUNET_assert, GNUNET_CRYPTO_kdf_mod_mpi(), GNUNET_CRYPTO_rsa_public_key_encode(), GNUNET_free, key_from_sexp(), ok, RsaBlindingKey::r, rsa_gcd_validate(), and GNUNET_CRYPTO_RsaPublicKey::sexp.
Referenced by GNUNET_CRYPTO_rsa_blind(), GNUNET_CRYPTO_rsa_sign_fdh(), and GNUNET_CRYPTO_rsa_verify().
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_rsa_blind | ( | const struct GNUNET_HashCode * | hash, |
const struct GNUNET_CRYPTO_RsaBlindingKeySecret * | bks, | ||
struct GNUNET_CRYPTO_RsaPublicKey * | pkey, | ||
void ** | buf, | ||
size_t * | buf_size | ||
) |
Blinds the given message with the given blinding key.
hash | hash of the message to sign | |
bkey | the blinding key | |
pkey | the public key of the signer | |
[out] | buf | set to a buffer with the blinded message to be signed |
[out] | buf_size | number of bytes stored in buf |
Definition at line 744 of file crypto_rsa.c.
References BENCHMARK_END, BENCHMARK_START, data, GNUNET_assert, GNUNET_break, GNUNET_NO, GNUNET_YES, key_from_sexp(), numeric_mpi_alloc_n_print(), RsaBlindingKey::r, ret, rsa_blinding_key_derive(), rsa_blinding_key_free(), rsa_full_domain_hash(), and GNUNET_CRYPTO_RsaPublicKey::sexp.
Referenced by checkvec(), and output_vectors().
|
static |
Convert an MPI to an S-expression suitable for signature operations.
value | pointer to the data to convert |
Definition at line 825 of file crypto_rsa.c.
References data, and GNUNET_assert.
Referenced by GNUNET_CRYPTO_rsa_verify(), and rsa_sign_mpi().
|
static |
Sign the given MPI.
key | private key to use for the signing |
value | the MPI to sign |
Definition at line 846 of file crypto_rsa.c.
References _, data, GNUNET_break, GNUNET_CRYPTO_rsa_private_key_get_public(), GNUNET_CRYPTO_rsa_public_key_free(), GNUNET_ERROR_TYPE_WARNING, GNUNET_new, LOG, mpi_to_sexp(), result, GNUNET_CRYPTO_RsaPrivateKey::sexp, GNUNET_CRYPTO_RsaPublicKey::sexp, and GNUNET_CRYPTO_RsaSignature::sexp.
Referenced by GNUNET_CRYPTO_rsa_sign_blinded(), and GNUNET_CRYPTO_rsa_sign_fdh().
struct GNUNET_CRYPTO_RsaSignature* GNUNET_CRYPTO_rsa_sign_blinded | ( | const struct GNUNET_CRYPTO_RsaPrivateKey * | key, |
const void * | msg, | ||
size_t | msg_len | ||
) |
Sign a blinded value, which must be a full domain hash of a message.
key | private key to use for the signing |
msg | the (blinded) message to sign |
msg_len | number of bytes in msg to sign |
Definition at line 900 of file crypto_rsa.c.
References BENCHMARK_END, BENCHMARK_START, GNUNET_assert, and rsa_sign_mpi().
Referenced by checkvec(), and output_vectors().
struct GNUNET_CRYPTO_RsaSignature* GNUNET_CRYPTO_rsa_sign_fdh | ( | const struct GNUNET_CRYPTO_RsaPrivateKey * | key, |
const struct GNUNET_HashCode * | hash | ||
) |
Create and sign a full domain hash of a message.
key | private key to use for the signing |
hash | the hash of the message to sign |
Definition at line 924 of file crypto_rsa.c.
References GNUNET_CRYPTO_rsa_private_key_get_public(), GNUNET_CRYPTO_rsa_public_key_free(), pkey, rsa_full_domain_hash(), and rsa_sign_mpi().
void GNUNET_CRYPTO_rsa_signature_free | ( | struct GNUNET_CRYPTO_RsaSignature * | sig | ) |
Free memory occupied by signature.
sig | memory to free |
Definition at line 944 of file crypto_rsa.c.
References GNUNET_free, and GNUNET_CRYPTO_RsaSignature::sexp.
Referenced by clean_rsa_sig(), clean_rsa_signature(), and output_vectors().
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.
sig | the signature | |
[out] | buffer | set to a buffer with the encoded key |
Definition at line 952 of file crypto_rsa.c.
References buf, GNUNET_assert, GNUNET_malloc, key_from_sexp(), ret, and GNUNET_CRYPTO_RsaSignature::sexp.
Referenced by bind_rsa_sig(), checkvec(), GNUNET_CRYPTO_rsa_signature_cmp(), GNUNET_JSON_from_rsa_signature(), my_conv_rsa_signature(), output_vectors(), and qconv_rsa_signature().
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.
buf | the buffer where the public key data is stored |
buf_size | the number of bytes of the data in buf |
Definition at line 992 of file crypto_rsa.c.
References data, GNUNET_break, GNUNET_break_op, GNUNET_new, and GNUNET_CRYPTO_RsaSignature::sexp.
Referenced by extract_rsa_sig(), extract_rsa_signature(), parse_rsa_signature(), and post_extract_rsa_signature().
struct GNUNET_CRYPTO_RsaPublicKey* GNUNET_CRYPTO_rsa_public_key_dup | ( | const struct GNUNET_CRYPTO_RsaPublicKey * | key | ) |
Duplicate the given public key.
key | the public key to duplicate |
Definition at line 1028 of file crypto_rsa.c.
References GNUNET_assert, GNUNET_new, and GNUNET_CRYPTO_RsaPublicKey::sexp.
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.
The signature should have been generated with #GNUNET_CRYPTO_rsa_sign() using a hash that was blinded with GNUNET_CRYPTO_rsa_blind().
sig | the signature made on the blinded signature purpose |
bks | the blinding key secret used to blind the signature purpose |
pkey | the public key of the signer |
Definition at line 1047 of file crypto_rsa.c.
References BENCHMARK_END, BENCHMARK_START, GNUNET_assert, GNUNET_break_op, GNUNET_new, key_from_sexp(), RsaBlindingKey::r, ret, rsa_blinding_key_derive(), rsa_blinding_key_free(), GNUNET_CRYPTO_RsaPublicKey::sexp, and GNUNET_CRYPTO_RsaSignature::sexp.
Referenced by checkvec(), and output_vectors().
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_rsa_verify | ( | const struct GNUNET_HashCode * | hash, |
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.
hash | the message to verify to match the sig |
sig | signature that is being validated |
public_key | public key of the signer |
Definition at line 1128 of file crypto_rsa.c.
References _, BENCHMARK_END, BENCHMARK_START, data, GNUNET_break_op, GNUNET_ERROR_TYPE_WARNING, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, LOG, mpi_to_sexp(), rsa_full_domain_hash(), GNUNET_CRYPTO_RsaPublicKey::sexp, and GNUNET_CRYPTO_RsaSignature::sexp.
Referenced by checkvec(), and output_vectors().
struct GNUNET_CRYPTO_RsaPrivateKey* GNUNET_CRYPTO_rsa_private_key_dup | ( | const struct GNUNET_CRYPTO_RsaPrivateKey * | key | ) |
Duplicate the given private key.
key | the private key to duplicate |
Definition at line 1174 of file crypto_rsa.c.
References GNUNET_assert, GNUNET_new, and GNUNET_CRYPTO_RsaPrivateKey::sexp.
struct GNUNET_CRYPTO_RsaSignature* GNUNET_CRYPTO_rsa_signature_dup | ( | const struct GNUNET_CRYPTO_RsaSignature * | sig | ) |
Duplicate the given rsa signature.
sig | the signature to duplicate |
Definition at line 1194 of file crypto_rsa.c.
References GNUNET_assert, GNUNET_new, key_from_sexp(), ret, and GNUNET_CRYPTO_RsaSignature::sexp.