| eggen, egencrypt, egdecrypt, egsign, egverify, egpuballoc, egpubfree, egprivalloc, egprivfree, egsigalloc, egsigfree, egprivtopub - elgamal encryption |
| 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) |
| EGpriv* egprivalloc(void) |
| EGpub* egprivtopub(EGpriv*) |
| Elgamal is a public key encryption and signature algorithm. The owner of a key publishes |
| the public part of the key: |
| mpint *alpha; // generator |
| mpint *key; // (encryption key) alpha**secret mod p |
| This part can be used for encrypting data (with |
| mpint *secret; // (decryption key) |
| 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 |
| returns a newly allocated copy of the public key |
| corresponding to the private key. |
| are provided to manage key storage. |
| returns 0 if the signature is valid and \-1 if not. |
| are provided to manage signature storage. |
| .B /usr/local/plan9/src/libsec |