Main Page Modules Data Structures File List Data Fields Globals Related Pages

# beecrypt/dldp.c File Reference

Discrete Logarithm Domain Parameters, code. More...

`#include "system.h"`
`#include "dldp.h"`
`#include "mp32.h"`
`#include "mp32prime.h"`
`#include "debug.h"`

Go to the source code of this file.

## Functions

int | dldp_pgoqGenerator_w (dldp_p *dp, randomGeneratorContext *rgc, uint32 *wksp)
int | dldp_pgonGenerator_w (dldp_p *dp, randomGeneratorContext *rgc, uint32 *wksp)
int | dldp_pPrivate (const dldp_p *dp, randomGeneratorContext *rgc, mp32number *x)
int | dldp_pPublic (const dldp_p *dp, const mp32number *x, mp32number *y)
int | dldp_pPair (const dldp_p *dp, randomGeneratorContext *rgc, mp32number *x, mp32number *y)
int | dldp_pEqual (const dldp_p *a, const dldp_p *b)
int | dldp_pValidate (const dldp_p *dp, randomGeneratorContext *rgc)
| needs to make workspace of 8*size+2. More...
int | dldp_pInit (dldp_p *dp)
int | dldp_pFree (dldp_p *dp)
int | dldp_pCopy (dldp_p *dst, const dldp_p *src)
int | dldp_pgoqMake (dldp_p *dp, randomGeneratorContext *rgc, uint32 psize, uint32 qsize, int cofactor)
int | dldp_pgoqMakeSafe (dldp_p *dp, randomGeneratorContext *rgc, uint32 psize)
int | dldp_pgoqGenerator (dldp_p *dp, randomGeneratorContext *rgc)
int | dldp_pgoqValidate (const dldp_p *dp, randomGeneratorContext *rgc, int cofactor)
int | dldp_pgonMake (dldp_p *dp, randomGeneratorContext *rgc, uint32 psize, uint32 qsize)
int | dldp_pgonMakeSafe (dldp_p *dp, randomGeneratorContext *rgc, uint32 psize)
int | dldp_pgonGenerator (dldp_p *dp, randomGeneratorContext *rgc)
int | dldp_pgonValidate (const dldp_p *dp, randomGeneratorContext *rgc)

## Detailed Description

Discrete Logarithm Domain Parameters, code.

Definition in file dldp.c.

## Function Documentation

int dldp_pCopy | ( | dldp_p * | dst,
|  | const dldp_p * | src
| ) |

| Definition at line 164 of file dldp.c. References dldp_p::g, mp32bcopy, mp32ncopy, dldp_p::n, dldp_p::p, dldp_p::q, and dldp_p::r.

int dldp_pEqual | ( | const dldp_p * | a,
|  | const dldp_p * | b
| ) |

| Definition at line 82 of file dldp.c. References mp32number::data, dldp_p::g, mp32barrett::modl, mp32eqx, dldp_p::p, dldp_p::q, mp32number::size, and mp32barrett::size.

int dldp_pFree | ( | dldp_p * | dp | ) |

| Definition at line 151 of file dldp.c. References dldp_p::g, mp32bfree, mp32nfree, dldp_p::n, dldp_p::p, dldp_p::q, and dldp_p::r.

int dldp_pgonGenerator | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc
| ) |

| Definition at line 441 of file dldp.c. References dldp_pgonGenerator_w, dldp_p::p, mp32barrett::size, and uint32.

int dldp_pgonGenerator_w | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | uint32 * | wksp
| ) | `[static]`

| Definition at line 376 of file dldp.c. References mp32number::data, dldp_p::g, mp32barrett::modl, mp32bpowmod_w, mp32brnd_w, mp32bsqrmod_w, mp32divtwo, mp32isone, mp32istwo, mp32nfree, mp32nsize, mp32setx, dldp_p::p, dldp_p::q, dldp_p::r, mp32number::size, mp32barrett::size, and uint32. Referenced by dldp_pgonGenerator, dldp_pgonMake, and dldp_pgonMakeSafe.

int dldp_pgonMake | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | uint32 | psize,
|  | uint32 | qsize
| ) |

| Definition at line 307 of file dldp.c. References dldp_pgonGenerator_w, mp32bset, mp32bsubone, mp32prnd_w, mp32prndconone_w, dldp_p::n, dldp_p::p, dldp_p::q, dldp_p::r, and uint32.

int dldp_pgonMakeSafe | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | uint32 | psize
| ) |

| Definition at line 340 of file dldp.c. References dldp_pgonGenerator_w, mp32barrett::modl, mp32bset, mp32bsubone, mp32copy, mp32divtwo, mp32nsetw, mp32prndsafe_w, dldp_p::n, dldp_p::p, dldp_p::q, dldp_p::r, and uint32.

int dldp_pgonValidate | ( | const dldp_p * | dp,
|  | randomGeneratorContext * | rgc
| ) |

| Definition at line 457 of file dldp.c. References dldp_pValidate.

int dldp_pgoqGenerator | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc
| ) |

| Definition at line 275 of file dldp.c. References dldp_pgoqGenerator_w, dldp_p::p, mp32barrett::size, and uint32.

int dldp_pgoqGenerator_w | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | uint32 * | wksp
| ) | `[static]`

| Definition at line 248 of file dldp.c. References mp32number::data, dldp_p::g, mp32bpowmod_w, mp32brnd_w, mp32isone, mp32nfree, mp32nsize, dldp_p::p, dldp_p::r, mp32number::size, mp32barrett::size, and uint32. Referenced by dldp_pgoqGenerator, dldp_pgoqMake, and dldp_pgoqMakeSafe.

int dldp_pgoqMake | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | uint32 | psize,
|  | uint32 | qsize,
|  | int | cofactor
| ) |

| Definition at line 175 of file dldp.c. References dldp_pgoqGenerator_w, dldp_p::g, mp32bzero, mp32nzero, mp32prnd_w, mp32prndconone_w, dldp_p::n, dldp_p::p, dldp_p::q, dldp_p::r, and uint32.

int dldp_pgoqMakeSafe | ( | dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | uint32 | psize
| ) |

| Definition at line 211 of file dldp.c. References dldp_pgoqGenerator_w, mp32barrett::modl, mp32bset, mp32bzero, mp32copy, mp32divtwo, mp32nsetw, mp32prndsafe_w, dldp_p::n, dldp_p::p, dldp_p::q, dldp_p::r, and uint32.

int dldp_pgoqValidate | ( | const dldp_p * | ,
|  | randomGeneratorContext * | rgc,
|  | int | cofactor
| ) |

| Definition at line 291 of file dldp.c. References dldp_pValidate.

int dldp_pInit | ( | dldp_p * | dp | ) |

| Definition at line 140 of file dldp.c. References dldp_p::g, mp32bzero, mp32nzero, dldp_p::n, dldp_p::p, dldp_p::q, and dldp_p::r.

int dldp_pPair | ( | const dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | mp32number * | x,
|  | mp32number * | y
| ) |

| Definition at line 70 of file dldp.c. References dldp_p::g, mp32bnpowmod, mp32bnrnd, dldp_p::p, and dldp_p::q.

int dldp_pPrivate | ( | const dldp_p * | dp,
|  | randomGeneratorContext * | rgc,
|  | mp32number * | x
| ) |

| Definition at line 46 of file dldp.c. References mp32bnrnd, and dldp_p::q.

int dldp_pPublic | ( | const dldp_p * | dp,
|  | const mp32number * | x,
|  | mp32number * | y
| ) |

| Definition at line 59 of file dldp.c. References dldp_p::g, mp32bnpowmod, and dldp_p::p.

int dldp_pValidate | ( | const dldp_p * | dp,
|  | randomGeneratorContext * | rgc
| ) | `[static]`

| needs to make workspace of 8*size+2. Definition at line 92 of file dldp.c. References mp32even, mp32gex, mp32leone, mp32pmilrab_w, and uint32. Referenced by dldp_pgonValidate, and dldp_pgoqValidate.