diff options
author | Werner Koch <wk@gnupg.org> | 1997-11-24 23:24:04 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1997-11-24 23:24:04 +0100 |
commit | 46900fbd437a134bd16e5030182fb3a219cd370e (patch) | |
tree | f13063a7c4896b189c7a3d09791d5464241174c7 /cipher/elgamal.h | |
parent | IDEA removed, signing works (diff) | |
download | gnupg2-46900fbd437a134bd16e5030182fb3a219cd370e.tar.xz gnupg2-46900fbd437a134bd16e5030182fb3a219cd370e.zip |
ElGamal funktioniert und ist default
Diffstat (limited to 'cipher/elgamal.h')
-rw-r--r-- | cipher/elgamal.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/cipher/elgamal.h b/cipher/elgamal.h index 3b6317599..e93b49e59 100644 --- a/cipher/elgamal.h +++ b/cipher/elgamal.h @@ -23,23 +23,27 @@ #include "mpi.h" typedef struct { - MPI e; /* exponent */ - MPI n; /* modulus */ + MPI p; /* prime */ + MPI g; /* group generator */ + MPI y; /* g^x mod p */ } ELG_public_key; typedef struct { - MPI e; /* public exponent */ - MPI n; /* public modulus */ - MPI p; /* prime p. */ - MPI q; /* prime q. */ - MPI d; /* exponent */ - MPI u; /* inverse of p mod q. */ + MPI p; /* prime */ + MPI g; /* group generator */ + MPI y; /* g^x mod p */ + MPI x; /* secret exponent */ } ELG_secret_key; -void elg_public(MPI output, MPI input, ELG_public_key *skey ); -void elg_secret(MPI output, MPI input, ELG_secret_key *skey ); - +void elg_free_public_key( ELG_public_key *pk ); +void elg_free_secret_key( ELG_secret_key *sk ); +void elg_generate( ELG_public_key *pk, ELG_secret_key *sk, unsigned nbits ); +int elg_check_secret_key( ELG_secret_key *sk ); +void elg_encipher(MPI a, MPI b, MPI input, ELG_public_key *pkey ); +void elg_decipher(MPI output, MPI a, MPI b, ELG_secret_key *skey ); +void elg_sign(MPI a, MPI b, MPI input, ELG_secret_key *skey); +int elg_verify(MPI a, MPI b, MPI input, ELG_public_key *pkey); #endif /*G10_ELGAMAL_H*/ |