desx.cpp

来自「含有多种公开密钥算法、多种块加密、多种数据流加密、多种HASH函数、多种Chec」· C++ 代码 · 共 41 行

CPP
41
字号
/************************************************** DESX Source File                               ** (C) 1999-2002 The Botan Project                **************************************************/#include <botan/desx.h>namespace Botan {/************************************************** DESX Encryption                                **************************************************/void DESX::enc(const byte in[], byte out[]) const   {   xor_buf(out, in, K1, BLOCK_SIZE);   des.encrypt(out);   xor_buf(out, K2, BLOCK_SIZE);   }/************************************************** DESX Decryption                                **************************************************/void DESX::dec(const byte in[], byte out[]) const   {   xor_buf(out, in, K2, BLOCK_SIZE);   des.decrypt(out);   xor_buf(out, K1, BLOCK_SIZE);   }/************************************************** DESX Key Schedule                              **************************************************/void DESX::key(const byte key[], u32bit)   {   K1.copy(key, 8);   des.set_key(key + 8, 8);   K2.copy(key + 16, 8);   }}

⌨️ 快捷键说明

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