Path: blob/master/libs/tomcrypt/src/pk/dsa/dsa_make_key.c
4396 views
/* LibTomCrypt, modular cryptographic library -- Tom St Denis1*2* LibTomCrypt is a library that provides various cryptographic3* algorithms in a highly modular and flexible manner.4*5* The library is free for all purposes without any express6* guarantee it works.7*/8#include "tomcrypt.h"910/**11@file dsa_make_key.c12DSA implementation, generate a DSA key13*/1415#ifdef LTC_MDSA1617/**18Old-style creation of a DSA key19@param prng An active PRNG state20@param wprng The index of the PRNG desired21@param group_size Size of the multiplicative group (octets)22@param modulus_size Size of the modulus (octets)23@param key [out] Where to store the created key24@return CRYPT_OK if successful.25*/26int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key)27{28int err;2930if ((err = dsa_generate_pqg(prng, wprng, group_size, modulus_size, key)) != CRYPT_OK) { return err; }31if ((err = dsa_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; }3233return CRYPT_OK;34}3536#endif373839