mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 00:20:52 -05:00
crypto: drbg - remove unnecessary (void*) conversions
remove unnecessary void* type casting v2: Turn assignments less than 75 characters into one line. Signed-off-by: Dong Chuanjian <chuanjian@nfschina.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
b3b9fdf1a9
commit
66c8137f75
1 changed files with 5 additions and 7 deletions
|
@ -1703,7 +1703,7 @@ static int drbg_init_hash_kernel(struct drbg_state *drbg)
|
||||||
|
|
||||||
static int drbg_fini_hash_kernel(struct drbg_state *drbg)
|
static int drbg_fini_hash_kernel(struct drbg_state *drbg)
|
||||||
{
|
{
|
||||||
struct sdesc *sdesc = (struct sdesc *)drbg->priv_data;
|
struct sdesc *sdesc = drbg->priv_data;
|
||||||
if (sdesc) {
|
if (sdesc) {
|
||||||
crypto_free_shash(sdesc->shash.tfm);
|
crypto_free_shash(sdesc->shash.tfm);
|
||||||
kfree_sensitive(sdesc);
|
kfree_sensitive(sdesc);
|
||||||
|
@ -1715,7 +1715,7 @@ static int drbg_fini_hash_kernel(struct drbg_state *drbg)
|
||||||
static void drbg_kcapi_hmacsetkey(struct drbg_state *drbg,
|
static void drbg_kcapi_hmacsetkey(struct drbg_state *drbg,
|
||||||
const unsigned char *key)
|
const unsigned char *key)
|
||||||
{
|
{
|
||||||
struct sdesc *sdesc = (struct sdesc *)drbg->priv_data;
|
struct sdesc *sdesc = drbg->priv_data;
|
||||||
|
|
||||||
crypto_shash_setkey(sdesc->shash.tfm, key, drbg_statelen(drbg));
|
crypto_shash_setkey(sdesc->shash.tfm, key, drbg_statelen(drbg));
|
||||||
}
|
}
|
||||||
|
@ -1723,7 +1723,7 @@ static void drbg_kcapi_hmacsetkey(struct drbg_state *drbg,
|
||||||
static int drbg_kcapi_hash(struct drbg_state *drbg, unsigned char *outval,
|
static int drbg_kcapi_hash(struct drbg_state *drbg, unsigned char *outval,
|
||||||
const struct list_head *in)
|
const struct list_head *in)
|
||||||
{
|
{
|
||||||
struct sdesc *sdesc = (struct sdesc *)drbg->priv_data;
|
struct sdesc *sdesc = drbg->priv_data;
|
||||||
struct drbg_string *input = NULL;
|
struct drbg_string *input = NULL;
|
||||||
|
|
||||||
crypto_shash_init(&sdesc->shash);
|
crypto_shash_init(&sdesc->shash);
|
||||||
|
@ -1818,8 +1818,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg)
|
||||||
static void drbg_kcapi_symsetkey(struct drbg_state *drbg,
|
static void drbg_kcapi_symsetkey(struct drbg_state *drbg,
|
||||||
const unsigned char *key)
|
const unsigned char *key)
|
||||||
{
|
{
|
||||||
struct crypto_cipher *tfm =
|
struct crypto_cipher *tfm = drbg->priv_data;
|
||||||
(struct crypto_cipher *)drbg->priv_data;
|
|
||||||
|
|
||||||
crypto_cipher_setkey(tfm, key, (drbg_keylen(drbg)));
|
crypto_cipher_setkey(tfm, key, (drbg_keylen(drbg)));
|
||||||
}
|
}
|
||||||
|
@ -1827,8 +1826,7 @@ static void drbg_kcapi_symsetkey(struct drbg_state *drbg,
|
||||||
static int drbg_kcapi_sym(struct drbg_state *drbg, unsigned char *outval,
|
static int drbg_kcapi_sym(struct drbg_state *drbg, unsigned char *outval,
|
||||||
const struct drbg_string *in)
|
const struct drbg_string *in)
|
||||||
{
|
{
|
||||||
struct crypto_cipher *tfm =
|
struct crypto_cipher *tfm = drbg->priv_data;
|
||||||
(struct crypto_cipher *)drbg->priv_data;
|
|
||||||
|
|
||||||
/* there is only component in *in */
|
/* there is only component in *in */
|
||||||
BUG_ON(in->len < drbg_blocklen(drbg));
|
BUG_ON(in->len < drbg_blocklen(drbg));
|
||||||
|
|
Loading…
Reference in a new issue