DLGroup

This class represents discrete logarithm groups. It holds a prime p, a prime q = (p-1)/2 and m_g = x^((p-1)/q) mod p.

Constructors

this
this(string name)

Construct a DL group that is registered in the configuration.

this
this(RandomNumberGenerator rng, PrimeType type, size_t pbits, size_t qbits)

Create a new group randomly.

this
this(RandomNumberGenerator rng, Vector!ubyte seed, size_t pbits, size_t qbits)

Create a DSA group with a given seed.

this
this(BigInt p1, BigInt g1)

Create a DL group. The prime q will be determined according to p.

this
this(BigInt p1, BigInt q1, BigInt g1)

Create a DL group.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

Format
alias Format = ubyte
Undocumented in source.
PrimeType
alias PrimeType = ubyte
Undocumented in source.

Enums

ANSI_X9_42
anonymousenum ANSI_X9_42

The DL group encoding format variants.

Strong
anonymousenum Strong

Determine the prime creation for DL groups.

Functions

BER_decode
void BER_decode(Vector!ubyte data, Format format)

Decode a DER/BER encoded group into this instance.

DER_encode
Vector!ubyte DER_encode(Format format)

Encode this group into a string using DER encoding.

PEM_decode
void PEM_decode(string pem)

Decode a PEM encoded group into this instance.

PEM_encode
string PEM_encode(Format format)

Encode this group into a string using PEM encoding.

getG
const(BigInt) getG()

Get the base m_g.

getP
const(BigInt) getP()

Get the prime m_p.

getQ
const(BigInt) getQ()

Get the prime q.

opAssign
void opAssign(DLGroup other)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
toVector
Vector!char toVector()
Undocumented in source. Be warned that the author may not have intended to support it.
verifyGroup
bool verifyGroup(RandomNumberGenerator rng, bool strong)

Perform validity checks on the group.

Properties

clone
DLGroup clone [@property getter]

Duplicate this object

move
DLGroup move [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

getPemForNamedGroup
string getPemForNamedGroup(string name)

Return PEM representation of named DL group

Meta