1
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
3
* LibTomCrypt is a library that provides various cryptographic
4
* algorithms in a highly modular and flexible manner.
6
* The library is free for all purposes without any express
9
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org
14
@file crypt_prng_is_valid.c
15
Determine if PRNG is valid, Tom St Denis
19
Test if a PRNG index is valid
20
@param idx The index of the PRNG to search for
21
@return CRYPT_OK if valid
23
int prng_is_valid(int idx)
25
LTC_MUTEX_LOCK(<c_prng_mutex);
26
if (idx < 0 || idx >= TAB_SIZE || prng_descriptor[idx].name == NULL) {
27
LTC_MUTEX_UNLOCK(<c_prng_mutex);
28
return CRYPT_INVALID_PRNG;
30
LTC_MUTEX_UNLOCK(<c_prng_mutex);
34
/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_prng_is_valid.c,v $ */
35
/* $Revision: 1.4 $ */
36
/* $Date: 2005/06/19 18:00:28 $ */