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

Commit 42c271c6 authored by Herbert Xu's avatar Herbert Xu
Browse files

[CRYPTO] scatterwalk: Move scatterwalk.h to linux/crypto



The scatterwalk infrastructure is used by algorithms so it needs to
move out of crypto for future users that may live in drivers/crypto
or asm/*/crypto.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fe70f5df
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@

#include <crypto/algapi.h>
#include <crypto/authenc.h>
#include <crypto/scatterwalk.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
@@ -20,8 +21,6 @@
#include <linux/slab.h>
#include <linux/spinlock.h>

#include "scatterwalk.h"

struct authenc_instance_ctx {
	struct crypto_spawn auth;
	struct crypto_spawn enc;
+1 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
 *
 */

#include <crypto/scatterwalk.h>
#include <linux/crypto.h>
#include <linux/errno.h>
#include <linux/hardirq.h>
@@ -25,7 +26,6 @@
#include <linux/string.h>

#include "internal.h"
#include "scatterwalk.h"

enum {
	BLKCIPHER_WALK_PHYS = 1 << 0,
+1 −2
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
 *
 */

#include <crypto/scatterwalk.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/hardirq.h>
@@ -20,8 +21,6 @@
#include <linux/module.h>
#include <linux/scatterlist.h>

#include "internal.h"

static int init(struct hash_desc *desc)
{
	struct crypto_tfm *tfm = crypto_hash_tfm(desc->tfm);
+2 −1
Original line number Diff line number Diff line
@@ -10,13 +10,14 @@

#include <crypto/algapi.h>
#include <crypto/gf128mul.h>
#include <crypto/scatterwalk.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>

#include "scatterwalk.h"
#include "internal.h"

struct gcm_instance_ctx {
	struct crypto_spawn ctr;
+0 −29
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include <linux/notifier.h>
#include <linux/rwsem.h>
#include <linux/slab.h>
#include <asm/kmap_types.h>

/* Crypto notification events. */
enum {
@@ -50,34 +49,6 @@ extern struct list_head crypto_alg_list;
extern struct rw_semaphore crypto_alg_sem;
extern struct blocking_notifier_head crypto_chain;

static inline enum km_type crypto_kmap_type(int out)
{
	enum km_type type;

	if (in_softirq())
		type = out * (KM_SOFTIRQ1 - KM_SOFTIRQ0) + KM_SOFTIRQ0;
	else
		type = out * (KM_USER1 - KM_USER0) + KM_USER0;

	return type;
}

static inline void *crypto_kmap(struct page *page, int out)
{
	return kmap_atomic(page, crypto_kmap_type(out));
}

static inline void crypto_kunmap(void *vaddr, int out)
{
	kunmap_atomic(vaddr, crypto_kmap_type(out));
}

static inline void crypto_yield(u32 flags)
{
	if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
		cond_resched();
}

#ifdef CONFIG_PROC_FS
void __init crypto_init_proc(void);
void __exit crypto_exit_proc(void);
Loading