aes.h

来自「IBE是一种非对称密码技术」· C头文件 代码 · 共 91 行

H
91
字号
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */

#include "vibecrypto.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "algobj.h"
#include "keyobj.h"

#ifndef _AES_H
#define _AES_H

#ifdef __cplusplus
extern "C" {
#endif

/* Implements VEncryptInit.
 */
int VOLT_CALLING_CONV AESEncryptInit VOLT_PROTO_LIST ((
   VoltAlgorithmObject *algObj,
   VoltKeyObject *keyObj
));

/* Implements VEncryptUpdate.
 */
int VOLT_CALLING_CONV AESEncryptUpdate VOLT_PROTO_LIST ((
   VoltAlgorithmObject *algObj,
   VtRandomObject random,
   unsigned char *dataToEncrypt,
   unsigned int dataToEncryptLen,
   unsigned char *encryptedData
));

/* Implments VDecryptInit.
 */
int VOLT_CALLING_CONV AESDecryptInit VOLT_PROTO_LIST ((
   VoltAlgorithmObject *algObj,
   VoltKeyObject *keyObj
));

/* Implements VDecryptUpdate.
 */
int VOLT_CALLING_CONV AESDecryptUpdate VOLT_PROTO_LIST ((
   VoltAlgorithmObject *algObj,
   VtRandomObject random,
   unsigned char *dataToDecrypt,
   unsigned int dataToDecryptLen,
   unsigned char *decryptedData
));

/* Implements VCtxDestroy.
 */
void VOLT_CALLING_CONV AESAlgCtxDestroy VOLT_PROTO_LIST ((
   Pointer obj,
   Pointer ctx
));

/* The algCtx for AES looks like this.
 */
typedef struct
{
  unsigned int rounds;
  UInt32 keyTable[64];
} VoltAESCtx;

/* Implements VCtxDestroy.
 */
void VOLT_CALLING_CONV AESKeyDataDestroy VOLT_PROTO_LIST ((
   Pointer obj,
   Pointer ctx
));

void VOLT_CALLING_CONV AESInit VOLT_PROTO_LIST ((
   VoltLibCtx *libCtx,
   VoltAESCtx *aesCtx,
   unsigned int encryptFlag,
   VtItem *keyData
));

/* The following are the possible values for the encryptFlag.
 */
#define VOLT_AES_ENCRYPT   1
#define VOLT_AES_DECRYPT   2

#ifdef __cplusplus
}
#endif

#endif /* _AES_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?