Synopsis
#define FLUX_ELGAMAL_KEY (key)
#define FLUX_ELGAMAL_PUBLIC_KEY (key)
#define FLUX_ELGAMAL_SECRET_KEY (key)
struct FluxElgamalKey;
struct FluxElgamalPublicKey;
struct FluxElgamalSecretKey;
gboolean flux_elgamal_generate_keypair (guint key_length,
FluxElgamalPublicKey **public_key,
FluxElgamalSecretKey **secret_key);
FluxElgamalKey* flux_elgamal_dup_key (FluxElgamalKey *key);
void flux_elgamal_finalize_secret_key
(FluxElgamalSecretKey *skey);
void flux_elgamal_finalize_public_key
(FluxElgamalPublicKey *pkey);
FluxElgamalPublicKey* flux_elgamal_import_public_key
(const guchar *in,
guint in_len);
FluxElgamalSecretKey* flux_elgamal_import_secret_key
(const guchar *in,
guint in_len);
void flux_elgamal_export_public_key (FluxElgamalPublicKey *public_key,
guchar **out,
guint *out_len);
void flux_elgamal_export_secret_key (FluxElgamalSecretKey *secret_key,
guchar **out,
guint *out_len);
guint flux_elgamal_get_key_length (FluxElgamalKey *key);
guint flux_elgamal_get_block_size (FluxElgamalKey *key);
void flux_elgamal_encrypt (FluxElgamalPublicKey *pkey,
guchar **ciphertext,
guint *ciphertext_len,
const guchar *plaintext,
guint plaintext_len);
void flux_elgamal_decrypt (FluxElgamalSecretKey *skey,
guchar **plaintext,
guint *plaintext_len,
const guchar *ciphertext,
guint ciphertext_len);
void flux_elgamal_sign (FluxElgamalSecretKey *skey,
guchar **signature,
guint *signature_len,
const guchar *hash,
guint hash_len);
gboolean flux_elgamal_verify (FluxElgamalPublicKey *pkey,
const guchar *signature,
guint signature_len,
const guchar *hash,
guint hash_len);
Details
FLUX_ELGAMAL_KEY()
#define FLUX_ELGAMAL_KEY(key) ((FluxElgamalKey *) key)
FLUX_ELGAMAL_PUBLIC_KEY()
#define FLUX_ELGAMAL_PUBLIC_KEY(key) ((FluxElgamalPublicKey *) key)
FLUX_ELGAMAL_SECRET_KEY()
#define FLUX_ELGAMAL_SECRET_KEY(key) ((FluxElgamalSecretKey *) key)
struct FluxElgamalKey
struct FluxElgamalKey {
FluxObject object;
mpz_t p;
mpz_t g;
mpz_t y;
};
struct FluxElgamalPublicKey
struct FluxElgamalPublicKey {
FluxElgamalKey key;
};
struct FluxElgamalSecretKey
struct FluxElgamalSecretKey {
FluxElgamalKey key;
mpz_t x;
};
flux_elgamal_generate_keypair ()
gboolean flux_elgamal_generate_keypair (guint key_length,
FluxElgamalPublicKey **public_key,
FluxElgamalSecretKey **secret_key);
key_length : |
|
public_key : |
|
secret_key : |
|
Returns : |
|
flux_elgamal_finalize_secret_key ()
void flux_elgamal_finalize_secret_key
(FluxElgamalSecretKey *skey);
flux_elgamal_finalize_public_key ()
void flux_elgamal_finalize_public_key
(FluxElgamalPublicKey *pkey);
flux_elgamal_import_public_key ()
FluxElgamalPublicKey* flux_elgamal_import_public_key
(const guchar *in,
guint in_len);
flux_elgamal_import_secret_key ()
FluxElgamalSecretKey* flux_elgamal_import_secret_key
(const guchar *in,
guint in_len);
flux_elgamal_export_public_key ()
void flux_elgamal_export_public_key (FluxElgamalPublicKey *public_key,
guchar **out,
guint *out_len);
public_key : |
|
out : |
|
out_len : |
|
flux_elgamal_export_secret_key ()
void flux_elgamal_export_secret_key (FluxElgamalSecretKey *secret_key,
guchar **out,
guint *out_len);
secret_key : |
|
out : |
|
out_len : |
|
flux_elgamal_get_key_length ()
guint flux_elgamal_get_key_length (FluxElgamalKey *key);
flux_elgamal_get_block_size ()
guint flux_elgamal_get_block_size (FluxElgamalKey *key);
flux_elgamal_encrypt ()
void flux_elgamal_encrypt (FluxElgamalPublicKey *pkey,
guchar **ciphertext,
guint *ciphertext_len,
const guchar *plaintext,
guint plaintext_len);
pkey : |
|
ciphertext : |
|
ciphertext_len : |
|
plaintext : |
|
plaintext_len : |
|
flux_elgamal_decrypt ()
void flux_elgamal_decrypt (FluxElgamalSecretKey *skey,
guchar **plaintext,
guint *plaintext_len,
const guchar *ciphertext,
guint ciphertext_len);
skey : |
|
plaintext : |
|
plaintext_len : |
|
ciphertext : |
|
ciphertext_len : |
|
flux_elgamal_sign ()
void flux_elgamal_sign (FluxElgamalSecretKey *skey,
guchar **signature,
guint *signature_len,
const guchar *hash,
guint hash_len);
skey : |
|
signature : |
|
signature_len : |
|
hash : |
|
hash_len : |
|
flux_elgamal_verify ()
gboolean flux_elgamal_verify (FluxElgamalPublicKey *pkey,
const guchar *signature,
guint signature_len,
const guchar *hash,
guint hash_len);
pkey : |
|
signature : |
|
signature_len : |
|
hash : |
|
hash_len : |
|
Returns : |
|