aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/elgamal.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cipher/elgamal.h34
1 files changed, 9 insertions, 25 deletions
diff --git a/cipher/elgamal.h b/cipher/elgamal.h
index d253fbd92..a4668ff9d 100644
--- a/cipher/elgamal.h
+++ b/cipher/elgamal.h
@@ -20,31 +20,15 @@
#ifndef G10_ELGAMAL_H
#define G10_ELGAMAL_H
-#include "mpi.h"
+int elg_generate( int algo, unsigned nbits, MPI *skey, MPI **retfactors );
+int elg_check_secret_key( int algo, MPI *skey );
+int elg_encrypt( int algo, MPI *resarr, MPI data, MPI *pkey );
+int elg_decrypt( int algo, MPI *result, MPI *data, MPI *skey );
+int elg_sign( int algo, MPI *resarr, MPI data, MPI *skey );
+int elg_verify( int algo, MPI hash, MPI *data, MPI *pkey );
+unsigned elg_get_nbits( int algo, MPI *pkey );
+const char *elg_get_info( int algo, int *npkey, int *nskey,
+ int *nenc, int *nsig, int *usage );
-typedef struct {
- MPI p; /* prime */
- MPI g; /* group generator */
- MPI y; /* g^x mod p */
-} ELG_public_key;
-
-
-typedef struct {
- MPI p; /* prime */
- MPI g; /* group generator */
- MPI y; /* g^x mod p */
- MPI x; /* secret exponent */
-} ELG_secret_key;
-
-
-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, MPI **factors );
-int elg_check_secret_key( ELG_secret_key *sk );
-void elg_encrypt(MPI a, MPI b, MPI input, ELG_public_key *pkey );
-void elg_decrypt(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*/