crypto: rng - Convert low-level crypto_rng to new style

This patch converts the low-level crypto_rng interface to the
"new" style.

This allows existing implementations to be converted over one-
by-one.  Once that is complete we can then remove the old rng
interface.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Herbert Xu 2015-04-21 10:46:38 +08:00
parent 3c5d8fa9f5
commit acec27ff35
4 changed files with 96 additions and 11 deletions

View file

@ -427,7 +427,7 @@ struct compress_alg {
};
/**
* struct rng_alg - random number generator definition
* struct old_rng_alg - random number generator definition
* @rng_make_random: The function defined by this variable obtains a random
* number. The random number generator transform must generate
* the random number out of the context provided with this
@ -445,7 +445,7 @@ struct compress_alg {
* seeding is implemented internally without the need of support by
* the consumer. In this case, the seed size is set to zero.
*/
struct rng_alg {
struct old_rng_alg {
int (*rng_make_random)(struct crypto_rng *tfm, u8 *rdata,
unsigned int dlen);
int (*rng_reset)(struct crypto_rng *tfm, u8 *seed, unsigned int slen);
@ -559,7 +559,7 @@ struct crypto_alg {
struct blkcipher_alg blkcipher;
struct cipher_alg cipher;
struct compress_alg compress;
struct rng_alg rng;
struct old_rng_alg rng;
} cra_u;
int (*cra_init)(struct crypto_tfm *tfm);