[PATCH 04/11] crypto: geniv - Use crypto_stdrng_get_bytes()

Eric Biggers posted 11 patches 1 week ago
[PATCH 04/11] crypto: geniv - Use crypto_stdrng_get_bytes()
Posted by Eric Biggers 1 week ago
Replace the sequence of crypto_get_default_rng(),
crypto_rng_get_bytes(), and crypto_put_default_rng() with the equivalent
helper function crypto_stdrng_get_bytes().

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
 crypto/geniv.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/crypto/geniv.c b/crypto/geniv.c
index 42eff6a7387c..c619a5ad2fc1 100644
--- a/crypto/geniv.c
+++ b/crypto/geniv.c
@@ -112,17 +112,11 @@ int aead_init_geniv(struct crypto_aead *aead)
 	struct crypto_aead *child;
 	int err;
 
 	spin_lock_init(&ctx->lock);
 
-	err = crypto_get_default_rng();
-	if (err)
-		goto out;
-
-	err = crypto_rng_get_bytes(crypto_default_rng, ctx->salt,
-				   crypto_aead_ivsize(aead));
-	crypto_put_default_rng();
+	err = crypto_stdrng_get_bytes(ctx->salt, crypto_aead_ivsize(aead));
 	if (err)
 		goto out;
 
 	child = crypto_spawn_aead(aead_instance_ctx(inst));
 	err = PTR_ERR(child);
-- 
2.53.0