Linux Kernel
3.7.1
|
#include <crypto/internal/hash.h>
#include <crypto/hash.h>
#include <crypto/aes.h>
#include <crypto/sha.h>
#include <crypto/algapi.h>
#include <crypto/scatterwalk.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/crypto.h>
#include <linux/scatterlist.h>
#include <linux/device.h>
#include <linux/of.h>
#include <asm/pSeries_reconfig.h>
#include <asm/hvcall.h>
#include <asm/vio.h>
#include "nx_csbcpb.h"
#include "nx.h"
Go to the source code of this file.
Variables | |
struct nx_crypto_driver | nx_driver |
MODULE_AUTHOR | ( | "Kent Yoder <[email protected]>" | ) |
MODULE_DESCRIPTION | ( | NX_STRING | ) |
MODULE_DEVICE_TABLE | ( | vio | , |
nx_crypto_driver_ids | |||
) |
module_exit | ( | nx_fini | ) |
module_init | ( | nx_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
MODULE_VERSION | ( | NX_VERSION | ) |
|
read |
nx_build_sg_list - build an NX scatter list describing a single buffer
: pointer to the first scatter list element to build : pointer to the linear buffer : length of the data at : the largest number of scatter list elements we're allowed to create
This function will start writing nx_sg elements at and keep writing them until all of the data from is described or until sgmax elements have been written. Scatter list elements will be created such that none of the elements describes a buffer that crosses a 4K boundary.
int nx_build_sg_lists | ( | struct nx_crypto_ctx * | nx_ctx, |
struct blkcipher_desc * | desc, | ||
struct scatterlist * | dst, | ||
struct scatterlist * | src, | ||
unsigned int | nbytes, | ||
u8 * | iv | ||
) |
nx_build_sg_lists - walk the input scatterlists and build arrays of NX scatterlists based on them.
: NX crypto context for the lists we're building : the block cipher descriptor for the operation : destination scatterlist : source scatterlist : length of data described in the scatterlists : destination for the iv data, if the algorithm requires it
This is common code shared by all the AES algorithms. It uses the block cipher walk routines to traverse input and output scatterlists, building corresponding NX scatterlists
int nx_crypto_ctx_aes_cbc_init | ( | struct crypto_tfm * | tfm | ) |
int nx_crypto_ctx_aes_ccm_init | ( | struct crypto_tfm * | tfm | ) |
int nx_crypto_ctx_aes_ctr_init | ( | struct crypto_tfm * | tfm | ) |
int nx_crypto_ctx_aes_ecb_init | ( | struct crypto_tfm * | tfm | ) |
int nx_crypto_ctx_aes_gcm_init | ( | struct crypto_tfm * | tfm | ) |
int nx_crypto_ctx_aes_xcbc_init | ( | struct crypto_tfm * | tfm | ) |
void nx_crypto_ctx_exit | ( | struct crypto_tfm * | tfm | ) |
int nx_crypto_ctx_sha_init | ( | struct crypto_tfm * | tfm | ) |
void nx_ctx_init | ( | struct nx_crypto_ctx * | nx_ctx, |
unsigned int | function | ||
) |
int nx_hcall_sync | ( | struct nx_crypto_ctx * | nx_ctx, |
struct vio_pfo_op * | op, | ||
u32 | may_sleep | ||
) |
Routines supporting the Power 7+ Nest Accelerators driver
Copyright (C) 2011-2012 International Business Machines Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 only.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Author: Kent Yoder yoder nx_hcall_sync - make an H_COP_OP hcall for 1@us .ibm. comthe passed in op structure
: the crypto context handle : PFO operation struct to pass in : flag indicating the request can sleep
Make the hcall, retrying while the hardware is busy. If we cannot yield the thread, limit the number of retries to 10 here.
|
read |
nx_walk_and_build - walk a linux scatterlist and build an nx scatterlist
: pointer to the first nx_sg element to write : max number of nx_sg entries we're allowed to write : pointer to the source linux scatterlist to walk : number of bytes to fast-forward past at the beginning of : number of bytes to walk in
struct nx_crypto_driver nx_driver |