linux/include/crypto/scatterwalk.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Cryptographic scatter and gather helpers.
 *
 * Copyright (c) 2002 James Morris <[email protected]>
 * Copyright (c) 2002 Adam J. Richter <[email protected]>
 * Copyright (c) 2004 Jean-Luc Cooke <[email protected]>
 * Copyright (c) 2007 Herbert Xu <[email protected]>
 */

#ifndef _CRYPTO_SCATTERWALK_H
#define _CRYPTO_SCATTERWALK_H

#include <crypto/algapi.h>

#include <linux/highmem.h>
#include <linux/mm.h>
#include <linux/scatterlist.h>

static inline void scatterwalk_crypto_chain(struct scatterlist *head,
					    struct scatterlist *sg, int num)
{}

static inline unsigned int scatterwalk_pagelen(struct scatter_walk *walk)
{}

static inline unsigned int scatterwalk_clamp(struct scatter_walk *walk,
					     unsigned int nbytes)
{}

static inline void scatterwalk_advance(struct scatter_walk *walk,
				       unsigned int nbytes)
{}

static inline struct page *scatterwalk_page(struct scatter_walk *walk)
{}

static inline void scatterwalk_unmap(void *vaddr)
{}

static inline void scatterwalk_start(struct scatter_walk *walk,
				     struct scatterlist *sg)
{}

static inline void *scatterwalk_map(struct scatter_walk *walk)
{}

static inline void scatterwalk_pagedone(struct scatter_walk *walk, int out,
					unsigned int more)
{}

static inline void scatterwalk_done(struct scatter_walk *walk, int out,
				    int more)
{}

void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
			    size_t nbytes, int out);

void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
			      unsigned int start, unsigned int nbytes, int out);

struct scatterlist *scatterwalk_ffwd(struct scatterlist dst[2],
				     struct scatterlist *src,
				     unsigned int len);

#endif  /* _CRYPTO_SCATTERWALK_H */