bc_bf448.h

来自「BestCrypt开源加密原代码」· C头文件 代码 · 共 86 行

H
86
字号
#ifndef __BC_BFISH
#define __BC_BFISH

#define SERVICE_NAME	"BC_BF448"
#define DISPLAY_NAME    "BLOWFISH-448"
#define ALGORITHM_ID     0xB0

// Key length in bits
#define KEY_LENGTH          (448)
#define KEY_LENGTH_EXTENDED (4168*8)
#define BLOCK_LENGTH 8#define DRIVER_MAJOR_VERSION	1
#define DRIVER_MINOR_VERSION	1


/******* Hardware dependences *******/

// Currently we choose Intel processor
#define ORDER_DCBA 

/* DCBA - little endian - Intel */
#ifdef ORDER_DCBA
union unionDWORD 
 { DWORD Dword;
   struct
	{ BYTE Byte3;
      BYTE Byte2;
      BYTE Byte1;
      BYTE Byte0;
    } Byte;
 };
#endif	/* ORDER_DCBA */

/* ABCD - big endian - Motorola */
#ifdef ORDER_ABCD
union unionDWORD 
 { DWORD Dword;
   struct
	{ BYTE Byte0;
      BYTE Byte1;
      BYTE Byte2;
      BYTE Byte3;
    } Byte;
 };
#endif	/* ORDER_ABCD */

/* BADC - VAX */
#ifdef ORDER_BADC
union unionDWORD 
 { DWORD Dword;
   struct
	{ BYTE Byte1;
      BYTE Byte0;
      BYTE Byte3;
      BYTE Byte2;
    } Byte;
 };
#endif	/* ORDER_BADC */


/******* Exported functions *********/

#define IN

BOOL
KeyExtend( PUCHAR KeySource,          // 56       8-bit  uchars
           PDWORD KeyDestination );   // (4168/4) 32-bit dwords

VOID
Encrypt( DWORD *IVector, 
         DWORD *KeyAdress,
         DWORD *SrcBuffer,
         DWORD *DstBuffer,
         DWORD Length );    // in bytes

VOID
Decrypt( DWORD *IVector, 
         DWORD *KeyAdress,
         DWORD *SrcBuffer,
         DWORD *DstBuffer,
         DWORD Length );    // in bytes

#endif

⌨️ 快捷键说明

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