aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/prng.h
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2008-07-07 10:41:31 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-10 08:35:18 -0400
commitb8454eebe380677789735fd6bad368af2e6b2d1e (patch)
treed1deffadf86c3292e51bde06bf8d2a00c20da697 /crypto/prng.h
parent166247f46a9c866e6f7f7d2212be875fb82212a1 (diff)
crypto: prng - Deterministic CPRNG
This patch adds a cryptographic pseudo-random number generator based on CTR(AES-128). It is meant to be used in cases where a deterministic CPRNG is required. One of the first applications will be as an input in the IPsec IV generation process. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/prng.h')
-rw-r--r--crypto/prng.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/crypto/prng.h b/crypto/prng.h
new file mode 100644
index 000000000000..1ac9be5009b7
--- /dev/null
+++ b/crypto/prng.h
@@ -0,0 +1,27 @@
1/*
2 * PRNG: Pseudo Random Number Generator
3 *
4 * (C) Neil Horman <nhorman@tuxdriver.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * any later version.
10 *
11 *
12 */
13
14#ifndef _PRNG_H_
15#define _PRNG_H_
16struct prng_context;
17
18int get_prng_bytes(char *buf, int nbytes, struct prng_context *ctx);
19struct prng_context *alloc_prng_context(void);
20int reset_prng_context(struct prng_context *ctx,
21 unsigned char *key, unsigned char *iv,
22 unsigned char *V,
23 unsigned char *DT);
24void free_prng_context(struct prng_context *ctx);
25
26#endif
27