/* * Intel IXP4xx NPE-C crypto driver * * Copyright (C) 2008 Christian Hohnstaedt <chohnstaedt@innominate.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License * as published by the Free Software Foundation. * */#include<linux/platform_device.h>#include<linux/dma-mapping.h>#include<linux/dmapool.h>#include<linux/crypto.h>#include<linux/kernel.h>#include<linux/rtnetlink.h>#include<linux/interrupt.h>#include<linux/spinlock.h>#include<linux/gfp.h>#include<linux/module.h>#include<crypto/ctr.h>#include<crypto/des.h>#include<crypto/aes.h>#include<crypto/sha.h>#include<crypto/algapi.h>#include<crypto/aead.h>#include<crypto/authenc.h>#include<crypto/scatterwalk.h>#include<mach/npe.h>#include<mach/qmgr.h>#define MAX_KEYLEN 32/* hash: cfgword + 2 * digestlen; crypt: keylen + cfgword */#define NPE_CTX_LEN 80#define AES_BLOCK128 16#define NPE_OP_HASH_VERIFY 0x01#define NPE_OP_CCM_ENABLE 0x04#define NPE_OP_CRYPT_ENABLE 0x08#define NPE_OP_HASH_ENABLE 0x10#define NPE_OP_NOT_IN_PLACE 0x20#define NPE_OP_HMAC_DISABLE 0x40#define NPE_OP_CRYPT_ENCRYPT 0x80#define NPE_OP_CCM_GEN_MIC 0xcc#define NPE_OP_HASH_GEN_ICV 0x50#define NPE_OP_ENC_GEN_KEY 0xc9#define MOD_ECB 0x0000#define MOD_CTR 0x1000#define MOD_CBC_ENC 0x2000#define MOD_CBC_DEC 0x3000#define MOD_CCM_ENC 0x4000#define MOD_CCM_DEC 0x5000#define KEYLEN_128 4#define KEYLEN_192 6