📄 ipsec_request.h
字号:
#ifndef _IPSEC_REQUEST_H_
#define _IPSEC_REQUEST_H_
/*将所有的request集中到一个头文件中,以便LNDEC和8349加密芯片公用*/
#include "sec2Notify.h"
/* * Common request block for all request headers * This macro contains the common portion of all request blocks * It's composed as follows: * opId - Type of operation requested * scatterBufs - Map of scattered buffers, returned from MarkScatterBuffers() * notifyFlags - if bits set, notify pointers are actuall PIDs for a completion signal * channel - Obsolete for T2.x, holdover from 2.x * notify - Handler for normal completion * pNotifyCtx - Context for handler * notify_on_error - Handler for error completion * ctxNotifyOnErr - returned device context if error * status - Driver completion status * nextReq - Next request in list, if any */
#define COMMON_REQ_PREAMBLE \ unsigned long opId; \ unsigned char scatterBufs; \ unsigned char notifyFlags; \ unsigned char reserved; \ unsigned char channel; \
PSEC_NOTIFY_ROUTINE notify; \
PSEC_NOTIFY_CTX pNotifyCtx; \
PSEC_NOTIFY_ON_ERROR_ROUTINE notify_on_error; \
SEC_NOTIFY_ON_ERROR_CTX ctxNotifyOnErr; \
int status; \
void *nextReq;/* This gets used by driver functions that need access to just the request *//* header without knowing the remaining request-type-specific content */typedef struct { COMMON_REQ_PREAMBLE } GENERIC_REQ;
typedef struct{ COMMON_REQ_PREAMBLE unsigned long rngBytes; unsigned char *rngData;} RNG_REQ;
/* * DES_LOADCTX_CRYPT_REQ - DES request with context load * These are basically CBC (cipher-block-chain) operations * */ typedef struct{ COMMON_REQ_PREAMBLE unsigned long inIvBytes; /* 0 or 8 bytes */ unsigned char *inIvData; unsigned long keyBytes; /* 8, 16, or 24 bytes */ unsigned char *keyData; unsigned long inBytes; /* multiple of 8 bytes */ unsigned char *inData; unsigned char *outData; /* output length = input length */ unsigned long outIvBytes; /* 0 or 8 bytes */ unsigned char *outIvData;} DES_CBC_CRYPT_REQ;
/* * DES_CRYPT_REQ - non-context DES cipher operation * These are ECB-only operations * */ typedef struct{ COMMON_REQ_PREAMBLE unsigned long keyBytes; /* 8, 16, or 24 bytes */ unsigned char *keyData; unsigned long inBytes; /* multiple of 8 bytes */ unsigned char *inData; unsigned char *outData; /* output length = input length */} DES_CRYPT_REQ;
/* * AESA_CRYPT_REQ - AES ciphering operations * */ typedef struct{ COMMON_REQ_PREAMBLE unsigned long keyBytes; /* 8, 16, or 24 bytes */ unsigned char *keyData; unsigned long inIvBytes; /* 0 or 16 bytes */ unsigned char *inIvData; unsigned long inBytes; /* multiple of 8 bytes */ unsigned char *inData; unsigned char *outData; /* output length = input length */ unsigned long outCtxBytes; /* 0 or 16 bytes */ unsigned char *outCtxData;} AESA_CRYPT_REQ;
/* * KEA_CRYPT_REQ - Kasumi cipher operations * Not present in 2.0 * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long ivBytes; /* 0 or 8 bytes */ unsigned char *ivData; unsigned long keyBytes; /* 8, 16, or 24 bytes */ unsigned char *keyData; unsigned long inBytes; /* multiple of 8 bytes */ unsigned char *inData; unsigned char *outData; /* output length = input length */} KEA_CRYPT_REQ;
/* * ARC4_LOADCTX_CRYPT_REQ - ARC4 cipher operation with context load * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long inCtxBytes; /* 257 bytes */ unsigned char *inCtxData; unsigned long inBytes; unsigned char *inData; unsigned char *outData; /* output length = input length */ unsigned long outCtxBytes; /* 257 bytes */ unsigned char *outCtxData;} ARC4_LOADCTX_CRYPT_REQ;
/* * ARC4_LOADKEY_CRYPT_UNLOADCTX_REQ - ARC4 operation with key load * and context save * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long keyBytes; unsigned char *keyData; unsigned long inBytes; unsigned char *inData; unsigned char *outData; /* output length = input length */ unsigned long outCtxBytes; /* 257 bytes */ unsigned char *outCtxData;} ARC4_LOADKEY_CRYPT_UNLOADCTX_REQ;
/* * HASH_REQ - combined SHA/MD5 hash operations with context loads * and saves * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long ctxBytes; unsigned char *ctxData; unsigned long inBytes; unsigned char *inData; unsigned long outBytes; /* length is fixed by algorithm */ unsigned char *outData;} HASH_REQ;
typedef struct{ COMMON_REQ_PREAMBLE unsigned long keyBytes; unsigned char *keyData; unsigned long inBytes; unsigned char *inData; unsigned long outBytes; /* length is fixed by algorithm */ unsigned char *outData;} HMAC_PAD_REQ;
/* * MOD_EXP_REQ - integer public key (modular expo) operations * */ typedef struct{ COMMON_REQ_PREAMBLE unsigned long aDataBytes; unsigned char *aData; unsigned long expBytes; unsigned char *expData; unsigned long modBytes; unsigned char *modData; unsigned long outBytes; unsigned char *outData;} MOD_EXP_REQ;
/* * MOD_SS_EXP_REQ - single-stage RSA operations * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long expBytes; unsigned char *expData; unsigned long modBytes; unsigned char *modData; unsigned long aDataBytes; unsigned char *aData; unsigned long bDataBytes; unsigned char *bData;} MOD_SS_EXP_REQ;
/* * MOD_R2MODN_REQ - Modular R2 operations * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long modBytes; unsigned char *modData; unsigned long outBytes; unsigned char *outData;} MOD_R2MODN_REQ;
/* * MOD_RRMODP_REQ - montgomery precomputation operations * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long nBytes; unsigned long pBytes; unsigned char *pData; unsigned long outBytes; unsigned char *outData;} MOD_RRMODP_REQ;
/* * MOD_2OP_REQ * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long bDataBytes; unsigned char *bData; unsigned long aDataBytes; unsigned char *aData; unsigned long modBytes; unsigned char *modData; unsigned long outBytes; unsigned char *outData;} MOD_2OP_REQ;
/* * ECC_POINT_REQ - elliptic curve point processing * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long nDataBytes; unsigned char *nData; unsigned long eDataBytes; unsigned char *eData; unsigned long buildDataBytes; unsigned char *buildData; unsigned long b1DataBytes; unsigned char *b1Data; unsigned long b2DataBytes; unsigned char *b2Data; unsigned long b3DataBytes; unsigned char *b3Data;} ECC_POINT_REQ;
/* * ECC_2OP_REQ - F2M elliptic curve operations * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long bDataBytes; unsigned char *bData; unsigned long aDataBytes; unsigned char *aData; unsigned long modBytes; unsigned char *modData; unsigned long outBytes; unsigned char *outData;} ECC_2OP_REQ;
/* * ECC_SPKBUILD_REQ - elliptic curve request builder * */typedef struct{ COMMON_REQ_PREAMBLE unsigned long a0DataBytes; unsigned char *a0Data; unsigned long a1DataBytes; unsigned char *a1Data; unsigned long a2DataBytes; unsigned char *a2Data; unsigned long a3DataBytes;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -