nettle  3.7.3
About: Nettle is a low-level cryptographic library.
  Fossies Dox: nettle-3.7.3.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rsa.h File Reference
#include "nettle-types.h"
#include "bignum.h"
#include "md5.h"
#include "sha1.h"
#include "sha2.h"
Include dependency graph for rsa.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rsa_public_key
 
struct  rsa_private_key
 

Macros

#define rsa_public_key_init   nettle_rsa_public_key_init
 
#define rsa_public_key_clear   nettle_rsa_public_key_clear
 
#define rsa_public_key_prepare   nettle_rsa_public_key_prepare
 
#define rsa_private_key_init   nettle_rsa_private_key_init
 
#define rsa_private_key_clear   nettle_rsa_private_key_clear
 
#define rsa_private_key_prepare   nettle_rsa_private_key_prepare
 
#define rsa_pkcs1_verify   nettle_rsa_pkcs1_verify
 
#define rsa_pkcs1_sign   nettle_rsa_pkcs1_sign
 
#define rsa_pkcs1_sign_tr   nettle_rsa_pkcs1_sign_tr
 
#define rsa_md5_sign   nettle_rsa_md5_sign
 
#define rsa_md5_sign_tr   nettle_rsa_md5_sign_tr
 
#define rsa_md5_verify   nettle_rsa_md5_verify
 
#define rsa_sha1_sign   nettle_rsa_sha1_sign
 
#define rsa_sha1_sign_tr   nettle_rsa_sha1_sign_tr
 
#define rsa_sha1_verify   nettle_rsa_sha1_verify
 
#define rsa_sha256_sign   nettle_rsa_sha256_sign
 
#define rsa_sha256_sign_tr   nettle_rsa_sha256_sign_tr
 
#define rsa_sha256_verify   nettle_rsa_sha256_verify
 
#define rsa_sha512_sign   nettle_rsa_sha512_sign
 
#define rsa_sha512_sign_tr   nettle_rsa_sha512_sign_tr
 
#define rsa_sha512_verify   nettle_rsa_sha512_verify
 
#define rsa_md5_sign_digest   nettle_rsa_md5_sign_digest
 
#define rsa_md5_sign_digest_tr   nettle_rsa_md5_sign_digest_tr
 
#define rsa_md5_verify_digest   nettle_rsa_md5_verify_digest
 
#define rsa_sha1_sign_digest   nettle_rsa_sha1_sign_digest
 
#define rsa_sha1_sign_digest_tr   nettle_rsa_sha1_sign_digest_tr
 
#define rsa_sha1_verify_digest   nettle_rsa_sha1_verify_digest
 
#define rsa_sha256_sign_digest   nettle_rsa_sha256_sign_digest
 
#define rsa_sha256_sign_digest_tr   nettle_rsa_sha256_sign_digest_tr
 
#define rsa_sha256_verify_digest   nettle_rsa_sha256_verify_digest
 
#define rsa_sha512_sign_digest   nettle_rsa_sha512_sign_digest
 
#define rsa_sha512_sign_digest_tr   nettle_rsa_sha512_sign_digest_tr
 
#define rsa_sha512_verify_digest   nettle_rsa_sha512_verify_digest
 
#define rsa_pss_sha256_sign_digest_tr   nettle_rsa_pss_sha256_sign_digest_tr
 
#define rsa_pss_sha256_verify_digest   nettle_rsa_pss_sha256_verify_digest
 
#define rsa_pss_sha384_sign_digest_tr   nettle_rsa_pss_sha384_sign_digest_tr
 
#define rsa_pss_sha384_verify_digest   nettle_rsa_pss_sha384_verify_digest
 
#define rsa_pss_sha512_sign_digest_tr   nettle_rsa_pss_sha512_sign_digest_tr
 
#define rsa_pss_sha512_verify_digest   nettle_rsa_pss_sha512_verify_digest
 
#define rsa_encrypt   nettle_rsa_encrypt
 
#define rsa_decrypt   nettle_rsa_decrypt
 
#define rsa_decrypt_tr   nettle_rsa_decrypt_tr
 
#define rsa_sec_decrypt   nettle_rsa_sec_decrypt
 
#define rsa_compute_root   nettle_rsa_compute_root
 
#define rsa_compute_root_tr   nettle_rsa_compute_root_tr
 
#define rsa_generate_keypair   nettle_rsa_generate_keypair
 
#define rsa_keypair_to_sexp   nettle_rsa_keypair_to_sexp
 
#define rsa_keypair_from_sexp_alist   nettle_rsa_keypair_from_sexp_alist
 
#define rsa_keypair_from_sexp   nettle_rsa_keypair_from_sexp
 
#define rsa_public_key_from_der_iterator   nettle_rsa_public_key_from_der_iterator
 
#define rsa_private_key_from_der_iterator   nettle_rsa_private_key_from_der_iterator
 
#define rsa_keypair_from_der   nettle_rsa_keypair_from_der
 
#define rsa_keypair_to_openpgp   nettle_rsa_keypair_to_openpgp
 
#define RSA_MINIMUM_N_OCTETS   12
 
#define RSA_MINIMUM_N_BITS   (8*RSA_MINIMUM_N_OCTETS - 7)
 
#define RSA_SIGN(key, algorithm, ctx, length, data, signature)
 
#define RSA_VERIFY(key, algorithm, ctx, length, data, signature)
 

Functions

void nettle_rsa_public_key_init (struct rsa_public_key *key)
 
void nettle_rsa_public_key_clear (struct rsa_public_key *key)
 
int nettle_rsa_public_key_prepare (struct rsa_public_key *key)
 
void nettle_rsa_private_key_init (struct rsa_private_key *key)
 
void nettle_rsa_private_key_clear (struct rsa_private_key *key)
 
int nettle_rsa_private_key_prepare (struct rsa_private_key *key)
 
int nettle_rsa_pkcs1_sign (const struct rsa_private_key *key, size_t length, const uint8_t *digest_info, mpz_t s)
 
int nettle_rsa_pkcs1_sign_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, size_t length, const uint8_t *digest_info, mpz_t s)
 
int nettle_rsa_pkcs1_verify (const struct rsa_public_key *key, size_t length, const uint8_t *digest_info, const mpz_t signature)
 
int nettle_rsa_md5_sign (const struct rsa_private_key *key, struct md5_ctx *hash, mpz_t signature)
 
int nettle_rsa_md5_sign_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, struct md5_ctx *hash, mpz_t s)
 
int nettle_rsa_md5_verify (const struct rsa_public_key *key, struct md5_ctx *hash, const mpz_t signature)
 
int nettle_rsa_sha1_sign (const struct rsa_private_key *key, struct sha1_ctx *hash, mpz_t signature)
 
int nettle_rsa_sha1_sign_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, struct sha1_ctx *hash, mpz_t s)
 
int nettle_rsa_sha1_verify (const struct rsa_public_key *key, struct sha1_ctx *hash, const mpz_t signature)
 
int nettle_rsa_sha256_sign (const struct rsa_private_key *key, struct sha256_ctx *hash, mpz_t signature)
 
int nettle_rsa_sha256_sign_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, struct sha256_ctx *hash, mpz_t s)
 
int nettle_rsa_sha256_verify (const struct rsa_public_key *key, struct sha256_ctx *hash, const mpz_t signature)
 
int nettle_rsa_sha512_sign (const struct rsa_private_key *key, struct sha512_ctx *hash, mpz_t signature)
 
int nettle_rsa_sha512_sign_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, struct sha512_ctx *hash, mpz_t s)
 
int nettle_rsa_sha512_verify (const struct rsa_public_key *key, struct sha512_ctx *hash, const mpz_t signature)
 
int nettle_rsa_md5_sign_digest (const struct rsa_private_key *key, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_md5_sign_digest_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_md5_verify_digest (const struct rsa_public_key *key, const uint8_t *digest, const mpz_t signature)
 
int nettle_rsa_sha1_sign_digest (const struct rsa_private_key *key, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_sha1_sign_digest_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_sha1_verify_digest (const struct rsa_public_key *key, const uint8_t *digest, const mpz_t signature)
 
int nettle_rsa_sha256_sign_digest (const struct rsa_private_key *key, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_sha256_sign_digest_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_sha256_verify_digest (const struct rsa_public_key *key, const uint8_t *digest, const mpz_t signature)
 
int nettle_rsa_sha512_sign_digest (const struct rsa_private_key *key, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_sha512_sign_digest_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_sha512_verify_digest (const struct rsa_public_key *key, const uint8_t *digest, const mpz_t signature)
 
int nettle_rsa_pss_sha256_sign_digest_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, size_t salt_length, const uint8_t *salt, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_pss_sha256_verify_digest (const struct rsa_public_key *key, size_t salt_length, const uint8_t *digest, const mpz_t signature)
 
int nettle_rsa_pss_sha384_sign_digest_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, size_t salt_length, const uint8_t *salt, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_pss_sha384_verify_digest (const struct rsa_public_key *key, size_t salt_length, const uint8_t *digest, const mpz_t signature)
 
int nettle_rsa_pss_sha512_sign_digest_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, size_t salt_length, const uint8_t *salt, const uint8_t *digest, mpz_t s)
 
int nettle_rsa_pss_sha512_verify_digest (const struct rsa_public_key *key, size_t salt_length, const uint8_t *digest, const mpz_t signature)
 
int nettle_rsa_encrypt (const struct rsa_public_key *key, void *random_ctx, nettle_random_func *random, size_t length, const uint8_t *cleartext, mpz_t cipher)
 
int nettle_rsa_decrypt (const struct rsa_private_key *key, size_t *length, uint8_t *cleartext, const mpz_t ciphertext)
 
int nettle_rsa_decrypt_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, size_t *length, uint8_t *message, const mpz_t gibberish)
 
int nettle_rsa_sec_decrypt (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, size_t length, uint8_t *message, const mpz_t gibberish)
 
void nettle_rsa_compute_root (const struct rsa_private_key *key, mpz_t x, const mpz_t m)
 
int nettle_rsa_compute_root_tr (const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, mpz_t x, const mpz_t m)
 
int nettle_rsa_generate_keypair (struct rsa_public_key *pub, struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, void *progress_ctx, nettle_progress_func *progress, unsigned n_size, unsigned e_size)
 
int nettle_rsa_keypair_to_sexp (struct nettle_buffer *buffer, const char *algorithm_name, const struct rsa_public_key *pub, const struct rsa_private_key *priv)
 
int nettle_rsa_keypair_from_sexp_alist (struct rsa_public_key *pub, struct rsa_private_key *priv, unsigned limit, struct sexp_iterator *i)
 
int nettle_rsa_keypair_from_sexp (struct rsa_public_key *pub, struct rsa_private_key *priv, unsigned limit, size_t length, const uint8_t *expr)
 
int nettle_rsa_public_key_from_der_iterator (struct rsa_public_key *pub, unsigned limit, struct asn1_der_iterator *i)
 
int nettle_rsa_private_key_from_der_iterator (struct rsa_public_key *pub, struct rsa_private_key *priv, unsigned limit, struct asn1_der_iterator *i)
 
int nettle_rsa_keypair_from_der (struct rsa_public_key *pub, struct rsa_private_key *priv, unsigned limit, size_t length, const uint8_t *data)
 
int nettle_rsa_keypair_to_openpgp (struct nettle_buffer *buffer, const struct rsa_public_key *pub, const struct rsa_private_key *priv, const char *userid)
 

Macro Definition Documentation

◆ rsa_compute_root

#define rsa_compute_root   nettle_rsa_compute_root

Definition at line 92 of file rsa.h.

◆ rsa_compute_root_tr

#define rsa_compute_root_tr   nettle_rsa_compute_root_tr

Definition at line 93 of file rsa.h.

◆ rsa_decrypt

#define rsa_decrypt   nettle_rsa_decrypt

Definition at line 89 of file rsa.h.

◆ rsa_decrypt_tr

#define rsa_decrypt_tr   nettle_rsa_decrypt_tr

Definition at line 90 of file rsa.h.

◆ rsa_encrypt

#define rsa_encrypt   nettle_rsa_encrypt

Definition at line 88 of file rsa.h.

◆ rsa_generate_keypair

#define rsa_generate_keypair   nettle_rsa_generate_keypair

Definition at line 94 of file rsa.h.

◆ rsa_keypair_from_der

#define rsa_keypair_from_der   nettle_rsa_keypair_from_der

Definition at line 100 of file rsa.h.

◆ rsa_keypair_from_sexp

#define rsa_keypair_from_sexp   nettle_rsa_keypair_from_sexp

Definition at line 97 of file rsa.h.

◆ rsa_keypair_from_sexp_alist

#define rsa_keypair_from_sexp_alist   nettle_rsa_keypair_from_sexp_alist

Definition at line 96 of file rsa.h.

◆ rsa_keypair_to_openpgp

#define rsa_keypair_to_openpgp   nettle_rsa_keypair_to_openpgp

Definition at line 101 of file rsa.h.

◆ rsa_keypair_to_sexp

#define rsa_keypair_to_sexp   nettle_rsa_keypair_to_sexp

Definition at line 95 of file rsa.h.

◆ rsa_md5_sign

#define rsa_md5_sign   nettle_rsa_md5_sign

Definition at line 58 of file rsa.h.

◆ rsa_md5_sign_digest

#define rsa_md5_sign_digest   nettle_rsa_md5_sign_digest

Definition at line 70 of file rsa.h.

◆ rsa_md5_sign_digest_tr

#define rsa_md5_sign_digest_tr   nettle_rsa_md5_sign_digest_tr

Definition at line 71 of file rsa.h.

◆ rsa_md5_sign_tr

#define rsa_md5_sign_tr   nettle_rsa_md5_sign_tr

Definition at line 59 of file rsa.h.

◆ rsa_md5_verify

#define rsa_md5_verify   nettle_rsa_md5_verify

Definition at line 60 of file rsa.h.

◆ rsa_md5_verify_digest

#define rsa_md5_verify_digest   nettle_rsa_md5_verify_digest

Definition at line 72 of file rsa.h.

◆ RSA_MINIMUM_N_BITS

#define RSA_MINIMUM_N_BITS   (8*RSA_MINIMUM_N_OCTETS - 7)

Definition at line 112 of file rsa.h.

◆ RSA_MINIMUM_N_OCTETS

#define RSA_MINIMUM_N_OCTETS   12

Definition at line 111 of file rsa.h.

◆ rsa_pkcs1_sign

#define rsa_pkcs1_sign   nettle_rsa_pkcs1_sign

Definition at line 56 of file rsa.h.

◆ rsa_pkcs1_sign_tr

#define rsa_pkcs1_sign_tr   nettle_rsa_pkcs1_sign_tr

Definition at line 57 of file rsa.h.

◆ rsa_pkcs1_verify

#define rsa_pkcs1_verify   nettle_rsa_pkcs1_verify

Definition at line 55 of file rsa.h.

◆ rsa_private_key_clear

#define rsa_private_key_clear   nettle_rsa_private_key_clear

Definition at line 53 of file rsa.h.

◆ rsa_private_key_from_der_iterator

#define rsa_private_key_from_der_iterator   nettle_rsa_private_key_from_der_iterator

Definition at line 99 of file rsa.h.

◆ rsa_private_key_init

#define rsa_private_key_init   nettle_rsa_private_key_init

Definition at line 52 of file rsa.h.

◆ rsa_private_key_prepare

#define rsa_private_key_prepare   nettle_rsa_private_key_prepare

Definition at line 54 of file rsa.h.

◆ rsa_pss_sha256_sign_digest_tr

#define rsa_pss_sha256_sign_digest_tr   nettle_rsa_pss_sha256_sign_digest_tr

Definition at line 82 of file rsa.h.

◆ rsa_pss_sha256_verify_digest

#define rsa_pss_sha256_verify_digest   nettle_rsa_pss_sha256_verify_digest

Definition at line 83 of file rsa.h.

◆ rsa_pss_sha384_sign_digest_tr

#define rsa_pss_sha384_sign_digest_tr   nettle_rsa_pss_sha384_sign_digest_tr

Definition at line 84 of file rsa.h.

◆ rsa_pss_sha384_verify_digest

#define rsa_pss_sha384_verify_digest   nettle_rsa_pss_sha384_verify_digest

Definition at line 85 of file rsa.h.

◆ rsa_pss_sha512_sign_digest_tr

#define rsa_pss_sha512_sign_digest_tr   nettle_rsa_pss_sha512_sign_digest_tr

Definition at line 86 of file rsa.h.

◆ rsa_pss_sha512_verify_digest

#define rsa_pss_sha512_verify_digest   nettle_rsa_pss_sha512_verify_digest

Definition at line 87 of file rsa.h.

◆ rsa_public_key_clear

#define rsa_public_key_clear   nettle_rsa_public_key_clear

Definition at line 50 of file rsa.h.

◆ rsa_public_key_from_der_iterator

#define rsa_public_key_from_der_iterator   nettle_rsa_public_key_from_der_iterator

Definition at line 98 of file rsa.h.

◆ rsa_public_key_init

#define rsa_public_key_init   nettle_rsa_public_key_init

Definition at line 49 of file rsa.h.

◆ rsa_public_key_prepare

#define rsa_public_key_prepare   nettle_rsa_public_key_prepare

Definition at line 51 of file rsa.h.

◆ rsa_sec_decrypt

#define rsa_sec_decrypt   nettle_rsa_sec_decrypt

Definition at line 91 of file rsa.h.

◆ rsa_sha1_sign

#define rsa_sha1_sign   nettle_rsa_sha1_sign

Definition at line 61 of file rsa.h.

◆ rsa_sha1_sign_digest

#define rsa_sha1_sign_digest   nettle_rsa_sha1_sign_digest

Definition at line 73 of file rsa.h.

◆ rsa_sha1_sign_digest_tr

#define rsa_sha1_sign_digest_tr   nettle_rsa_sha1_sign_digest_tr

Definition at line 74 of file rsa.h.

◆ rsa_sha1_sign_tr

#define rsa_sha1_sign_tr   nettle_rsa_sha1_sign_tr

Definition at line 62 of file rsa.h.

◆ rsa_sha1_verify

#define rsa_sha1_verify   nettle_rsa_sha1_verify

Definition at line 63 of file rsa.h.

◆ rsa_sha1_verify_digest

#define rsa_sha1_verify_digest   nettle_rsa_sha1_verify_digest

Definition at line 75 of file rsa.h.

◆ rsa_sha256_sign

#define rsa_sha256_sign   nettle_rsa_sha256_sign

Definition at line 64 of file rsa.h.

◆ rsa_sha256_sign_digest

#define rsa_sha256_sign_digest   nettle_rsa_sha256_sign_digest

Definition at line 76 of file rsa.h.

◆ rsa_sha256_sign_digest_tr

#define rsa_sha256_sign_digest_tr   nettle_rsa_sha256_sign_digest_tr

Definition at line 77 of file rsa.h.

◆ rsa_sha256_sign_tr

#define rsa_sha256_sign_tr   nettle_rsa_sha256_sign_tr

Definition at line 65 of file rsa.h.

◆ rsa_sha256_verify

#define rsa_sha256_verify   nettle_rsa_sha256_verify

Definition at line 66 of file rsa.h.

◆ rsa_sha256_verify_digest

#define rsa_sha256_verify_digest   nettle_rsa_sha256_verify_digest

Definition at line 78 of file rsa.h.

◆ rsa_sha512_sign

#define rsa_sha512_sign   nettle_rsa_sha512_sign

Definition at line 67 of file rsa.h.

◆ rsa_sha512_sign_digest

#define rsa_sha512_sign_digest   nettle_rsa_sha512_sign_digest

Definition at line 79 of file rsa.h.

◆ rsa_sha512_sign_digest_tr

#define rsa_sha512_sign_digest_tr   nettle_rsa_sha512_sign_digest_tr

Definition at line 80 of file rsa.h.

◆ rsa_sha512_sign_tr

#define rsa_sha512_sign_tr   nettle_rsa_sha512_sign_tr

Definition at line 68 of file rsa.h.

◆ rsa_sha512_verify

#define rsa_sha512_verify   nettle_rsa_sha512_verify

Definition at line 69 of file rsa.h.

◆ rsa_sha512_verify_digest

#define rsa_sha512_verify_digest   nettle_rsa_sha512_verify_digest

Definition at line 81 of file rsa.h.

◆ RSA_SIGN

#define RSA_SIGN (   key,
  algorithm,
  ctx,
  length,
  data,
  signature 
)
Value:
( \
algorithm##_update(ctx, length, data), \
rsa_##algorithm##_sign(key, ctx, signature) \
)

Definition at line 463 of file rsa.h.

◆ RSA_VERIFY

#define RSA_VERIFY (   key,
  algorithm,
  ctx,
  length,
  data,
  signature 
)
Value:
( \
algorithm##_update(ctx, length, data), \
rsa_##algorithm##_verify(key, ctx, signature) \
)

Definition at line 468 of file rsa.h.

Function Documentation

◆ nettle_rsa_compute_root()

◆ nettle_rsa_compute_root_tr()

int nettle_rsa_compute_root_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
mpz_t  x,
const mpz_t  m 
)

◆ nettle_rsa_decrypt()

int nettle_rsa_decrypt ( const struct rsa_private_key key,
size_t *  length,
uint8_t *  cleartext,
const mpz_t  ciphertext 
)

◆ nettle_rsa_decrypt_tr()

int nettle_rsa_decrypt_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
size_t *  length,
uint8_t *  message,
const mpz_t  gibberish 
)

◆ nettle_rsa_encrypt()

int nettle_rsa_encrypt ( const struct rsa_public_key key,
void *  random_ctx,
nettle_random_func random,
size_t  length,
const uint8_t *  cleartext,
mpz_t  cipher 
)

◆ nettle_rsa_generate_keypair()

◆ nettle_rsa_keypair_from_der()

int nettle_rsa_keypair_from_der ( struct rsa_public_key pub,
struct rsa_private_key priv,
unsigned  limit,
size_t  length,
const uint8_t *  data 
)

◆ nettle_rsa_keypair_from_sexp()

int nettle_rsa_keypair_from_sexp ( struct rsa_public_key pub,
struct rsa_private_key priv,
unsigned  limit,
size_t  length,
const uint8_t *  expr 
)

◆ nettle_rsa_keypair_from_sexp_alist()

int nettle_rsa_keypair_from_sexp_alist ( struct rsa_public_key pub,
struct rsa_private_key priv,
unsigned  limit,
struct sexp_iterator i 
)

◆ nettle_rsa_keypair_to_openpgp()

int nettle_rsa_keypair_to_openpgp ( struct nettle_buffer buffer,
const struct rsa_public_key pub,
const struct rsa_private_key priv,
const char *  userid 
)

◆ nettle_rsa_keypair_to_sexp()

int nettle_rsa_keypair_to_sexp ( struct nettle_buffer buffer,
const char *  algorithm_name,
const struct rsa_public_key pub,
const struct rsa_private_key priv 
)

◆ nettle_rsa_md5_sign()

int nettle_rsa_md5_sign ( const struct rsa_private_key key,
struct md5_ctx hash,
mpz_t  signature 
)

◆ nettle_rsa_md5_sign_digest()

int nettle_rsa_md5_sign_digest ( const struct rsa_private_key key,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_md5_sign_digest_tr()

int nettle_rsa_md5_sign_digest_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_md5_sign_tr()

int nettle_rsa_md5_sign_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
struct md5_ctx hash,
mpz_t  s 
)

◆ nettle_rsa_md5_verify()

int nettle_rsa_md5_verify ( const struct rsa_public_key key,
struct md5_ctx hash,
const mpz_t  signature 
)

◆ nettle_rsa_md5_verify_digest()

int nettle_rsa_md5_verify_digest ( const struct rsa_public_key key,
const uint8_t *  digest,
const mpz_t  signature 
)

◆ nettle_rsa_pkcs1_sign()

int nettle_rsa_pkcs1_sign ( const struct rsa_private_key key,
size_t  length,
const uint8_t *  digest_info,
mpz_t  s 
)

◆ nettle_rsa_pkcs1_sign_tr()

int nettle_rsa_pkcs1_sign_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
size_t  length,
const uint8_t *  digest_info,
mpz_t  s 
)

◆ nettle_rsa_pkcs1_verify()

int nettle_rsa_pkcs1_verify ( const struct rsa_public_key key,
size_t  length,
const uint8_t *  digest_info,
const mpz_t  signature 
)

◆ nettle_rsa_private_key_clear()

void nettle_rsa_private_key_clear ( struct rsa_private_key key)

◆ nettle_rsa_private_key_from_der_iterator()

◆ nettle_rsa_private_key_init()

void nettle_rsa_private_key_init ( struct rsa_private_key key)

◆ nettle_rsa_private_key_prepare()

int nettle_rsa_private_key_prepare ( struct rsa_private_key key)

◆ nettle_rsa_pss_sha256_sign_digest_tr()

int nettle_rsa_pss_sha256_sign_digest_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
size_t  salt_length,
const uint8_t *  salt,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_pss_sha256_verify_digest()

int nettle_rsa_pss_sha256_verify_digest ( const struct rsa_public_key key,
size_t  salt_length,
const uint8_t *  digest,
const mpz_t  signature 
)

◆ nettle_rsa_pss_sha384_sign_digest_tr()

int nettle_rsa_pss_sha384_sign_digest_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
size_t  salt_length,
const uint8_t *  salt,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_pss_sha384_verify_digest()

int nettle_rsa_pss_sha384_verify_digest ( const struct rsa_public_key key,
size_t  salt_length,
const uint8_t *  digest,
const mpz_t  signature 
)

◆ nettle_rsa_pss_sha512_sign_digest_tr()

int nettle_rsa_pss_sha512_sign_digest_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
size_t  salt_length,
const uint8_t *  salt,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_pss_sha512_verify_digest()

int nettle_rsa_pss_sha512_verify_digest ( const struct rsa_public_key key,
size_t  salt_length,
const uint8_t *  digest,
const mpz_t  signature 
)

◆ nettle_rsa_public_key_clear()

void nettle_rsa_public_key_clear ( struct rsa_public_key key)

Definition at line 55 of file rsa.c.

References rsa_public_key::e, mpz_clear(), and rsa_public_key::n.

◆ nettle_rsa_public_key_from_der_iterator()

int nettle_rsa_public_key_from_der_iterator ( struct rsa_public_key pub,
unsigned  limit,
struct asn1_der_iterator i 
)

◆ nettle_rsa_public_key_init()

void nettle_rsa_public_key_init ( struct rsa_public_key key)

Definition at line 44 of file rsa.c.

References rsa_public_key::e, mpz_init(), rsa_public_key::n, and rsa_public_key::size.

◆ nettle_rsa_public_key_prepare()

int nettle_rsa_public_key_prepare ( struct rsa_public_key key)

Definition at line 82 of file rsa.c.

References _rsa_check_size, rsa_public_key::n, and rsa_public_key::size.

◆ nettle_rsa_sec_decrypt()

int nettle_rsa_sec_decrypt ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
size_t  length,
uint8_t *  message,
const mpz_t  gibberish 
)

◆ nettle_rsa_sha1_sign()

int nettle_rsa_sha1_sign ( const struct rsa_private_key key,
struct sha1_ctx hash,
mpz_t  signature 
)

◆ nettle_rsa_sha1_sign_digest()

int nettle_rsa_sha1_sign_digest ( const struct rsa_private_key key,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_sha1_sign_digest_tr()

int nettle_rsa_sha1_sign_digest_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_sha1_sign_tr()

int nettle_rsa_sha1_sign_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
struct sha1_ctx hash,
mpz_t  s 
)

◆ nettle_rsa_sha1_verify()

int nettle_rsa_sha1_verify ( const struct rsa_public_key key,
struct sha1_ctx hash,
const mpz_t  signature 
)

◆ nettle_rsa_sha1_verify_digest()

int nettle_rsa_sha1_verify_digest ( const struct rsa_public_key key,
const uint8_t *  digest,
const mpz_t  signature 
)

◆ nettle_rsa_sha256_sign()

int nettle_rsa_sha256_sign ( const struct rsa_private_key key,
struct sha256_ctx hash,
mpz_t  signature 
)

◆ nettle_rsa_sha256_sign_digest()

int nettle_rsa_sha256_sign_digest ( const struct rsa_private_key key,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_sha256_sign_digest_tr()

int nettle_rsa_sha256_sign_digest_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_sha256_sign_tr()

int nettle_rsa_sha256_sign_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
struct sha256_ctx hash,
mpz_t  s 
)

◆ nettle_rsa_sha256_verify()

int nettle_rsa_sha256_verify ( const struct rsa_public_key key,
struct sha256_ctx hash,
const mpz_t  signature 
)

◆ nettle_rsa_sha256_verify_digest()

int nettle_rsa_sha256_verify_digest ( const struct rsa_public_key key,
const uint8_t *  digest,
const mpz_t  signature 
)

◆ nettle_rsa_sha512_sign()

int nettle_rsa_sha512_sign ( const struct rsa_private_key key,
struct sha512_ctx hash,
mpz_t  signature 
)

◆ nettle_rsa_sha512_sign_digest()

int nettle_rsa_sha512_sign_digest ( const struct rsa_private_key key,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_sha512_sign_digest_tr()

int nettle_rsa_sha512_sign_digest_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
const uint8_t *  digest,
mpz_t  s 
)

◆ nettle_rsa_sha512_sign_tr()

int nettle_rsa_sha512_sign_tr ( const struct rsa_public_key pub,
const struct rsa_private_key key,
void *  random_ctx,
nettle_random_func random,
struct sha512_ctx hash,
mpz_t  s 
)

◆ nettle_rsa_sha512_verify()

int nettle_rsa_sha512_verify ( const struct rsa_public_key key,
struct sha512_ctx hash,
const mpz_t  signature 
)

◆ nettle_rsa_sha512_verify_digest()

int nettle_rsa_sha512_verify_digest ( const struct rsa_public_key key,
const uint8_t *  digest,
const mpz_t  signature 
)