Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4d5b79c authored by Herbert Xu's avatar Herbert Xu
Browse files

[CRYPTO] users: Use crypto_comp and crypto_has_*



This patch converts all users to use the new crypto_comp type and the
crypto_has_* functions.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fce32d70
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -749,7 +749,7 @@ static void test_deflate(void)
{
	unsigned int i;
	char result[COMP_BUF_SIZE];
	struct crypto_tfm *tfm;
	struct crypto_comp *tfm;
	struct comp_testvec *tv;
	unsigned int tsize;

@@ -821,7 +821,7 @@ static void test_deflate(void)
		       ilen, dlen);
	}
out:
	crypto_free_tfm(tfm);
	crypto_free_comp(tfm);
}

static void test_available(void)
@@ -830,7 +830,7 @@ static void test_available(void)

	while (*name) {
		printk("alg %s ", *name);
		printk((crypto_alg_available(*name, 0)) ?
		printk(crypto_has_alg(*name, 0, CRYPTO_ALG_ASYNC) ?
		       "found\n" : "not found\n");
		name++;
	}
+3 −3
Original line number Diff line number Diff line
@@ -26,13 +26,13 @@ static int __init padlock_init(void)
{
	int success = 0;

	if (crypto_alg_available("aes-padlock", 0))
	if (crypto_has_cipher("aes-padlock", 0, 0))
		success++;

	if (crypto_alg_available("sha1-padlock", 0))
	if (crypto_has_hash("sha1-padlock", 0, 0))
		success++;

	if (crypto_alg_available("sha256-padlock", 0))
	if (crypto_has_hash("sha256-padlock", 0, 0))
		success++;

	if (!success) {
+2 −2
Original line number Diff line number Diff line
@@ -710,8 +710,8 @@ static struct compressor ppp_mppe = {
static int __init ppp_mppe_init(void)
{
	int answer;
	if (!(crypto_alg_available("ecb(arc4)", 0) &&
	      crypto_alg_available("sha1", 0)))
	if (!(crypto_has_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC) &&
	      crypto_has_hash("sha1", 0, CRYPTO_ALG_ASYNC)))
		return -ENODEV;

	sha_pad = kmalloc(sizeof(struct sha_pad), GFP_KERNEL);
+5 −0
Original line number Diff line number Diff line
@@ -928,6 +928,11 @@ static inline int crypto_has_comp(const char *alg_name, u32 type, u32 mask)
	return crypto_has_alg(alg_name, type, mask);
}

static inline const char *crypto_comp_name(struct crypto_comp *tfm)
{
	return crypto_tfm_alg_name(crypto_comp_tfm(tfm));
}

static inline struct compress_tfm *crypto_comp_crt(struct crypto_comp *tfm)
{
	return &crypto_comp_tfm(tfm)->crt_compress;
+2 −3
Original line number Diff line number Diff line
#ifndef _NET_IPCOMP_H
#define _NET_IPCOMP_H

#include <linux/crypto.h>
#include <linux/types.h>

#define IPCOMP_SCRATCH_SIZE     65400

struct crypto_tfm;

struct ipcomp_data {
	u16 threshold;
	struct crypto_tfm **tfms;
	struct crypto_comp **tfms;
};

#endif
Loading