MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / yarrow_test

Function yarrow_test

extern/libtomcrypt/src/prngs/yarrow.c:321–345  ·  view source on GitHub ↗

PRNG self-test @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled */

Source from the content-addressed store, hash-verified

319 @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled
320*/
321int yarrow_test(void)
322{
323#ifndef LTC_TEST
324 return CRYPT_NOP;
325#else
326 int err;
327 prng_state prng;
328
329 if ((err = yarrow_start(&prng)) != CRYPT_OK) {
330 return err;
331 }
332
333 /* now let's test the hash/cipher that was chosen */
334 if (cipher_descriptor[prng.yarrow.cipher].test &&
335 ((err = cipher_descriptor[prng.yarrow.cipher].test()) != CRYPT_OK)) {
336 return err;
337 }
338 if (hash_descriptor[prng.yarrow.hash].test &&
339 ((err = hash_descriptor[prng.yarrow.hash].test()) != CRYPT_OK)) {
340 return err;
341 }
342
343 return CRYPT_OK;
344#endif
345}
346
347#endif
348

Callers

nothing calls this directly

Calls 2

yarrow_startFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected