drbg.h (bc0868c62bb13834b20a864f684cced1f84a2412) | drbg.h (355912852115cd8aa4ad02c25182ae615ce925fb) |
---|---|
1/* 2 * DRBG based on NIST SP800-90A 3 * 4 * Copyright Stephan Mueller <smueller@chronox.de>, 2014 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 39#ifndef _DRBG_H 40#define _DRBG_H 41 42 43#include <linux/random.h> 44#include <linux/scatterlist.h> 45#include <crypto/hash.h> | 1/* 2 * DRBG based on NIST SP800-90A 3 * 4 * Copyright Stephan Mueller <smueller@chronox.de>, 2014 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 39#ifndef _DRBG_H 40#define _DRBG_H 41 42 43#include <linux/random.h> 44#include <linux/scatterlist.h> 45#include <crypto/hash.h> |
46#include <crypto/skcipher.h> |
|
46#include <linux/module.h> 47#include <linux/crypto.h> 48#include <linux/slab.h> 49#include <crypto/internal/rng.h> 50#include <crypto/rng.h> 51#include <linux/fips.h> 52#include <linux/mutex.h> 53#include <linux/list.h> --- 56 unchanged lines hidden (view full) --- 110 /* hash: static value 10.1.1.1 1b) hmac / ctr: key */ 111 unsigned char *C; 112 /* Number of RNG requests since last reseed -- 10.1.1.1 1c) */ 113 size_t reseed_ctr; 114 size_t reseed_threshold; 115 /* some memory the DRBG can use for its operation */ 116 unsigned char *scratchpad; 117 void *priv_data; /* Cipher handle */ | 47#include <linux/module.h> 48#include <linux/crypto.h> 49#include <linux/slab.h> 50#include <crypto/internal/rng.h> 51#include <crypto/rng.h> 52#include <linux/fips.h> 53#include <linux/mutex.h> 54#include <linux/list.h> --- 56 unchanged lines hidden (view full) --- 111 /* hash: static value 10.1.1.1 1b) hmac / ctr: key */ 112 unsigned char *C; 113 /* Number of RNG requests since last reseed -- 10.1.1.1 1c) */ 114 size_t reseed_ctr; 115 size_t reseed_threshold; 116 /* some memory the DRBG can use for its operation */ 117 unsigned char *scratchpad; 118 void *priv_data; /* Cipher handle */ |
119 120 struct crypto_skcipher *ctr_handle; /* CTR mode cipher handle */ 121 struct skcipher_request *ctr_req; /* CTR mode request handle */ 122 __u8 *ctr_null_value_buf; /* CTR mode unaligned buffer */ 123 __u8 *ctr_null_value; /* CTR mode aligned zero buf */ 124 struct completion ctr_completion; /* CTR mode async handler */ 125 int ctr_async_err; /* CTR mode async error */ 126 |
|
118 bool seeded; /* DRBG fully seeded? */ 119 bool pr; /* Prediction resistance enabled? */ 120 struct work_struct seed_work; /* asynchronous seeding support */ 121 struct crypto_rng *jent; 122 const struct drbg_state_ops *d_ops; 123 const struct drbg_core *core; 124 struct drbg_string test_data; 125 struct random_ready_callback random_ready; --- 146 unchanged lines hidden --- | 127 bool seeded; /* DRBG fully seeded? */ 128 bool pr; /* Prediction resistance enabled? */ 129 struct work_struct seed_work; /* asynchronous seeding support */ 130 struct crypto_rng *jent; 131 const struct drbg_state_ops *d_ops; 132 const struct drbg_core *core; 133 struct drbg_string test_data; 134 struct random_ready_callback random_ready; --- 146 unchanged lines hidden --- |