Method Nettle.dsa_generate_keypair()


Method dsa_generate_keypair

array(Gmp.mpz) dsa_generate_keypair(int p_bits, int q_bits, function(int(0..):string(8bit)) rnd)

Description

Generates a DSA key pair with p_bits number of bits (sometimes referred to as L) for p, and q_bits number of bits (sometimes referred to as N) for q, using the random function rnd.

Valid combinations as per FIPS 186-3 are

   p_bits  q_bits
   1024    160
   2048    224 (rejected by some versions of Hogweed)
   2048    256
   3072    256
 

Returns
Array
Gmp.mpz 0

The value p, the modulo.

Gmp.mpz 1

The value q, the group order.

Gmp.mpz 2

The value g, the generator.

Gmp.mpz 3

The value y, the public value.

Gmp.mpz 4

The value x, the private value.