LTC_CHACHA vs. LTC_CHACHA20_PRNG

This commit is contained in:
Karel Miko
2017-03-30 20:44:39 +02:00
parent 2656a040e0
commit ff5b02d371
5 changed files with 15 additions and 5 deletions
+7
View File
@@ -294,6 +294,9 @@
/* The LTC_RC4 stream cipher */
#define LTC_RC4
/* The ChaCha20 stream cipher based PRNG */
#define LTC_CHACHA20_PRNG
/* Fortuna PRNG */
#define LTC_FORTUNA
@@ -512,6 +515,10 @@
#error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA + LTC_POLY1305
#endif
#if defined(LTC_CHACHA20_PRNG) && !defined(LTC_CHACHA)
#error LTC_CHACHA20_PRNG requires LTC_CHACHA
#endif
/* THREAD management */
#ifdef LTC_PTHREAD
+3 -3
View File
@@ -15,7 +15,7 @@ struct rc4_prng {
};
#endif
#ifdef LTC_CHACHA
#ifdef LTC_CHACHA20_PRNG
struct chacha20_prng {
chacha_state s; /* chacha state */
unsigned char ent[40]; /* entropy buffer */
@@ -64,7 +64,7 @@ typedef union Prng_state {
#ifdef LTC_RC4
struct rc4_prng rc4;
#endif
#ifdef LTC_CHACHA
#ifdef LTC_CHACHA20_PRNG
struct chacha20_prng chacha;
#endif
#ifdef LTC_FORTUNA
@@ -166,7 +166,7 @@ int rc4_test(void);
extern const struct ltc_prng_descriptor rc4_desc;
#endif
#ifdef LTC_CHACHA
#ifdef LTC_CHACHA20_PRNG
int chacha_prng_start(prng_state *prng);
int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng);
int chacha_prng_ready(prng_state *prng);
+3
View File
@@ -274,6 +274,9 @@ const char *crypt_build_settings =
#if defined(LTC_RC4)
" RC4\n"
#endif
#if defined(LTC_CHACHA20_PRNG)
" ChaCha20\n"
#endif
#if defined(LTC_FORTUNA)
" Fortuna (" NAME_VALUE(LTC_FORTUNA_POOLS) ", " NAME_VALUE(LTC_FORTUNA_WD) ")\n"
#endif
+1 -1
View File
@@ -223,7 +223,7 @@ static const crypt_size _crypt_sizes[] = {
#ifdef LTC_FORTUNA
_SZ_STRINGIFY_S(fortuna_prng),
#endif
#ifdef LTC_CHACHA
#ifdef LTC_CHACHA20_PRNG
_SZ_STRINGIFY_S(chacha20_prng),
#endif
#ifdef LTC_RC4
+1 -1
View File
@@ -9,7 +9,7 @@
#include "tomcrypt.h"
#ifdef LTC_CHACHA
#ifdef LTC_CHACHA20_PRNG
const struct ltc_prng_descriptor chacha_prng_desc =
{