9srv Manual Collection/plan9/elgamal(2) | 9srv Manual Collection/plan9/elgamal(2) |
---|
EGpriv* eggen(int nlen, int nrep)
mpint* egencrypt(EGpub *k, mpint *in, mpint *out)
mpint* egdecrypt(EGpriv *k, mpint *in, mpint *out)
EGsig* egsign(EGpriv *k, mpint *m)
int egverify(EGpub *k, EGsig *sig, mpint *m)
EGpub* egpuballoc(void)
void egpubfree(EGpub*)
EGpriv* egprivalloc(void)
void egprivfree(EGpriv*)
EGsig* egsigalloc(void)
void egsigfree(EGsig*)
EGpub* egprivtopub(EGpriv*)
Keys are generated using eggen. Eggen takes both bit length of the modulus and the number of repetitions of the Miller-Rabin primality test to run. If the latter is 0, it does the default number of rounds. Egprivtopub returns a newly allocated copy of the public key corresponding to the private key.
The routines egpuballoc, egpubfree, egprivalloc, and egprivfree are provided to manage key storage.
Egsign
signs message
m
using a private key
k
yielding a
The routines egsigalloc and egsigfree are provided to manage signature storage.
9srv Manual Collection/plan9/elgamal(2) | Rev: Sun Dec 02 23:42:20 GMT 2007 |