From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/elgamal.html | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 man/man3/elgamal.html (limited to 'man/man3/elgamal.html') diff --git a/man/man3/elgamal.html b/man/man3/elgamal.html new file mode 100644 index 00000000..a6518468 --- /dev/null +++ b/man/man3/elgamal.html @@ -0,0 +1,174 @@ + +elgamal(3) - Plan 9 from User Space + + + + +
+
+
ELGAMAL(3)ELGAMAL(3) +
+
+

NAME
+ +
+ + eggen, egencrypt, egdecrypt, egsign, egverify, egpuballoc, egpubfree, + egprivalloc, egprivfree, egsigalloc, egsigfree, egprivtopub - + elgamal encryption
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h>
+ #include <mp.h>
+ #include <libsec.h> +
+
+ 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*)
+
+
+

DESCRIPTION
+ +
+ + +
+ + Elgamal is a public key encryption and signature algorithm. The + owner of a key publishes the public part of the key:
+ +
+ + struct EGpub
+ {
+ +
+ + mpint       *p;    // modulus
+ mpint       *alpha;     // generator
+ mpint       *key;       // (encryption key) alpha**secret mod p
+ +
+ };
+
+
+ This part can be used for encrypting data (with egencrypt) to + be sent to the owner. The owner decrypts (with egdecrypt) using + his private key:
+ +
+ + struct EGpriv
+ {
+ +
+ + EGpub       pub;
+ mpint       *secret; // (decryption key)
+ +
+ };
+ +
+
+ +
+ 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
+ +
+ + struct EGsig
+ {
+ +
+ + mpint       *r, *s;
+ +
+ };
+
+
+ Egverify returns 0 if the signature is valid and –1 if not. +
+ + The routines egsigalloc and egsigfree are provided to manage signature + storage.
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/libsec
+
+
+

SEE ALSO
+ +
+ + mp(3), aes(3), blowfish(3), des(3), dsa(3), rc4(3), rsa(3), sechash(3), + prime(3), rand(3)
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3