include/beecrypt/dsa.h File Reference

Digital Signature Algorithm, as specified by NIST FIPS 186. More...

#include "beecrypt/dlkp.h"

Include dependency graph for dsa.h:

Go to the source code of this file.

Typedefs

typedef dldp_p dsaparam
typedef dlpk_p dsapub
typedef dlkp_p dsakp

Functions

BEECRYPTAPI int dsasign (const mpbarrett *p, const mpbarrett *q, const mpnumber *g, randomGeneratorContext *, const mpnumber *hm, const mpnumber *x, mpnumber *r, mpnumber *s)
 This function performs a raw DSA signature.
BEECRYPTAPI int dsavrfy (const mpbarrett *p, const mpbarrett *q, const mpnumber *g, const mpnumber *hm, const mpnumber *y, const mpnumber *r, const mpnumber *s)
 This function performs a raw DSA verification.
BEECRYPTAPI int dsaparamMake (dsaparam *, randomGeneratorContext *, size_t)
 This function generates a set of DSA parameters.


Detailed Description

Digital Signature Algorithm, as specified by NIST FIPS 186.

FIPS 186 specifies the DSA algorithm as having a large prime $p$, a cofactor $q$ and a generator $g$ of a subgroup of $\mathds{Z}^{*}_p$ with order $q$. The private and public key values are $x$ and $y$ respectively.

Author:
Bob Deblier <bob.deblier@telenet.be>

Typedef Documentation

typedef dlkp_p dsakp

typedef dldp_p dsaparam

typedef dlpk_p dsapub


Function Documentation

int dsaparamMake ( dsaparam dp,
randomGeneratorContext rgc,
size_t  psize 
)

This function generates a set of DSA parameters.

This function calls dldp_pgoqMake with appropriate parameters, i.e. qsize = 160 bits and cofactor = 1.

Parameters:
dp The parameters to be generated.
rgc The random generator context.
psize The size of prime parameter p; psize must be >= 512 and <= 1024, and be a multiple of 64.
Return values:
0 on success.
-1 on failure.

int dsasign ( const mpbarrett p,
const mpbarrett q,
const mpnumber g,
randomGeneratorContext rgc,
const mpnumber hm,
const mpnumber x,
mpnumber r,
mpnumber s 
)

This function performs a raw DSA signature.

Signing equations:

  • $r=(g^{k}\ \textrm{mod}\ p)\ \textrm{mod}\ q$
  • $s=k^{-1}(h(m)+xr)\ \textrm{mod}\ q$
Parameters:
p The prime.
q The cofactor.
g The generator.
rgc The pseudo-random generator context.
hm The hash to be signed.
x The private key value.
r The signature's r value.
s The signature's s value.
Return values:
0 on success.
-1 on failure.

int dsavrfy ( const mpbarrett p,
const mpbarrett q,
const mpnumber g,
const mpnumber hm,
const mpnumber y,
const mpnumber r,
const mpnumber s 
)

This function performs a raw DSA verification.

Verifying equations:

  • Check $0<r<q$ and $0<s<q$
  • $w=s^{-1}\ \textrm{mod}\ q$
  • $u_1=w \cdot h(m)\ \textrm{mod}\ q$
  • $u_2=rw\ \textrm{mod}\ q$
  • $v=(g^{u_1}y^{u_2}\ \textrm{mod}\ p)\ \textrm{mod}\ q$
  • Check $v=r$
Parameters:
p The prime.
q The cofactor.
g The generator.
hm The digest to be verified.
y The public key value.
r The signature's r value.
s The signature's s value.
Return values:
1 on success.
0 on failure.


Generated on Fri Jun 19 13:38:51 2009 for BeeCrypt by  doxygen 1.5.8