tea.h

来自「Tiny Encrytion Algorithm压缩速度快」· C头文件 代码 · 共 31 行

H
31
字号
// The TEA encryption algorithm was invented by 
// David Wheeler & Roger Needham at Cambridge 
// University Computer Lab
//   http://www.cl.cam.ac.uk/ftp/papers/djw-rmn/djw-rmn-tea.html (1994)
//   http://www.cl.cam.ac.uk/ftp/users/djw3/xtea.ps (1997)
//   http://www.cl.cam.ac.uk/ftp/users/djw3/xxtea.ps (1998)
//
// This code was originally written in JavaScript by 
// Chris Veness at Movable Type Ltd
//   http://www.movable-type.co.uk
//
// It was adapted to C++ by Andreas Jonsson 
//   http://www.angelcode.com

#ifndef TEA_H
#define TEA_H

typedef unsigned int UINT;

// The length of the data should be at least 8 
// bytes, else the algorithm will not work.

// The key should be 128 bit, or 16 bytes

// The memory pointed to by data will be modified by 
// the functions.

int TeaEncrypt(UINT *data, UINT dataLen, UINT *key);
int TeaDecrypt(UINT *data, UINT dataLen, UINT *key);

#endif

⌨️ 快捷键说明

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