aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2014-06-28 15:58:24 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2014-07-04 09:09:20 -0400
commit8c98716601bc05091ff49aa8ebf5299a0c6604a0 (patch)
treeab302f2028b8616cdc666b5a6689e636c1003fa6 /include/crypto
parent8fecaad77fb9e076daa462ac1596330a604e23ad (diff)
crypto: drbg - use of kernel linked list
The DRBG-style linked list to manage input data that is fed into the cipher invocations is replaced with the kernel linked list implementation. The change is transparent to users of the interfaces offered by the DRBG. Therefore, no changes to the testmgr code is needed. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/drbg.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h
index b507c5b6020a..4065dfca146a 100644
--- a/include/crypto/drbg.h
+++ b/include/crypto/drbg.h
@@ -50,6 +50,7 @@
50#include <crypto/rng.h> 50#include <crypto/rng.h>
51#include <linux/fips.h> 51#include <linux/fips.h>
52#include <linux/spinlock.h> 52#include <linux/spinlock.h>
53#include <linux/list.h>
53 54
54/* 55/*
55 * Concatenation Helper and string operation helper 56 * Concatenation Helper and string operation helper
@@ -64,7 +65,7 @@
64struct drbg_string { 65struct drbg_string {
65 const unsigned char *buf; 66 const unsigned char *buf;
66 size_t len; 67 size_t len;
67 struct drbg_string *next; 68 struct list_head list;
68}; 69};
69 70
70static inline void drbg_string_fill(struct drbg_string *string, 71static inline void drbg_string_fill(struct drbg_string *string,
@@ -72,7 +73,7 @@ static inline void drbg_string_fill(struct drbg_string *string,
72{ 73{
73 string->buf = buf; 74 string->buf = buf;
74 string->len = len; 75 string->len = len;
75 string->next = NULL; 76 INIT_LIST_HEAD(&string->list);
76} 77}
77 78
78struct drbg_state; 79struct drbg_state;
@@ -97,7 +98,7 @@ struct drbg_core {
97}; 98};
98 99
99struct drbg_state_ops { 100struct drbg_state_ops {
100 int (*update)(struct drbg_state *drbg, struct drbg_string *seed, 101 int (*update)(struct drbg_state *drbg, struct list_head *seed,
101 int reseed); 102 int reseed);
102 int (*generate)(struct drbg_state *drbg, 103 int (*generate)(struct drbg_state *drbg,
103 unsigned char *buf, unsigned int buflen, 104 unsigned char *buf, unsigned int buflen,