#include "beecrypt/mpbarrett.h"
Go to the source code of this file.
Functions | |
BEECRYPTAPI int | elgv1sign (const mpbarrett *p, const mpbarrett *n, const mpnumber *g, randomGeneratorContext *, const mpnumber *hm, const mpnumber *x, mpnumber *r, mpnumber *s) |
This function performs raw ElGamal signing, variant 1. | |
BEECRYPTAPI int | elgv3sign (const mpbarrett *p, const mpbarrett *n, const mpnumber *g, randomGeneratorContext *, const mpnumber *hm, const mpnumber *x, mpnumber *r, mpnumber *s) |
This function performs raw ElGamal signing, variant 3. | |
BEECRYPTAPI int | elgv1vrfy (const mpbarrett *p, const mpbarrett *n, const mpnumber *g, const mpnumber *hm, const mpnumber *y, const mpnumber *r, const mpnumber *s) |
This function performs raw ElGamal verification, variant 1. | |
BEECRYPTAPI int | elgv3vrfy (const mpbarrett *p, const mpbarrett *n, const mpnumber *g, const mpnumber *hm, const mpnumber *y, const mpnumber *r, const mpnumber *s) |
This function performs raw ElGamal verification, variant 3. |
For more information on this algorithm, see: "Handbook of Applied Cryptography", 11.5.2: "The ElGamal signature scheme", p. 454-459
Two of the signature variants in Note 11.70 are implemented.
int elgv1sign | ( | const mpbarrett * | p, | |
const mpbarrett * | n, | |||
const mpnumber * | g, | |||
randomGeneratorContext * | rgc, | |||
const mpnumber * | hm, | |||
const mpnumber * | x, | |||
mpnumber * | r, | |||
mpnumber * | s | |||
) |
This function performs raw ElGamal signing, variant 1.
Signing equations:
p | The prime. | |
n | The reducer mod (p-1). | |
g | The generator. | |
rgc | The pseudo-random generat | |
hm | The hash to be signed. | |
x | The private key value. | |
r | The signature's r value. | |
s | The signature's s value. |
0 | on success. | |
-1 | on failure. |
int elgv1vrfy | ( | const mpbarrett * | p, | |
const mpbarrett * | n, | |||
const mpnumber * | g, | |||
const mpnumber * | hm, | |||
const mpnumber * | y, | |||
const mpnumber * | r, | |||
const mpnumber * | s | |||
) |
This function performs raw ElGamal verification, variant 1.
Verifying equations:
p | The prime. | |
n | The reducer mod (p-1). | |
g | The generator. | |
hm | The hash to be signed. | |
y | The public key value. | |
r | The signature's r value. | |
s | The signature's s value. |
1 | on success. | |
0 | on failure. |
int elgv3sign | ( | const mpbarrett * | p, | |
const mpbarrett * | n, | |||
const mpnumber * | g, | |||
randomGeneratorContext * | rgc, | |||
const mpnumber * | hm, | |||
const mpnumber * | x, | |||
mpnumber * | r, | |||
mpnumber * | s | |||
) |
This function performs raw ElGamal signing, variant 3.
Signing equations:
p | The prime. | |
n | The reducer mod (p-1). | |
g | The generator. | |
rgc | The pseudo-random generat | |
hm | The hash to be signed. | |
x | The private key value. | |
r | The signature's r value. | |
s | The signature's s value. |
0 | on success. | |
-1 | on failure. |
int elgv3vrfy | ( | const mpbarrett * | p, | |
const mpbarrett * | n, | |||
const mpnumber * | g, | |||
const mpnumber * | hm, | |||
const mpnumber * | y, | |||
const mpnumber * | r, | |||
const mpnumber * | s | |||
) |
This function performs raw ElGamal verification, variant 3.
Verifying equations:
p | The prime. | |
n | The reducer mod (p-1). | |
g | The generator. | |
hm | The hash to be signed. | |
y | The public key value. | |
r | The signature's r value. | |
s | The signature's s value. |
1 | on success. | |
0 | on failure. |