⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 endistbuffer.h

📁 aes的原代码
💻 H
字号:
#pragma once
#include "GenDistKey.h"
#include "BigInt.h"
#ifndef KBL			//块密钥长
#define KBL 16
#endif
#ifndef PRM1		//素数
#define PRM1 541781
#endif
#ifndef PRM2		//素数
#define PRM2 127
#endif
#ifndef PRM3		//素数
#define PRM3 680441
#endif
#ifndef DECI
#define DECI 10
#endif
#ifndef ID_LEN
#define ID_LEN 16
#endif
/**
 * 协定:本类为解扰类,与加扰相对应,解扰时,把文件分为均匀大的N段(除最后一段)分别用不同的种子进
 * 行解扰,段长由文件大小决定,可以通过本类的getSectionLength方法取得指定文件大小的段长;
 * 其中每段又分为若干小块分别产生密钥进行解扰,每块长度为密钥的长度128bit,也就是16byte;用户浏览
 * 流媒体时会快进或者后退,于是,此时须把文件指针定在指定的段和对应的块,当指针在两个块之间时,须
 * 向前移到上块的末尾,由于每段只有16byte;所以不会影响观看效果。
 * 标识 段随机数种子为R1...Ri...Rn,由bbs算法得出;块加密随机数为r1...ri...rn;
 */
class EnDistBuffer
{
public:
	EnDistBuffer(unsigned char* pcID,int secLen,int secNum);
	~EnDistBuffer(void);
	unsigned char * EnBuffer(unsigned char * buf,int len);
private:
	void initialKey(BigInt Rx);
	void nextKey();
	void iniPK();
	GenDistKey *gdk;
	BigInt Ri;
	unsigned char *pcID;
	int secLen;
	int secNum;
	int tosclen;
	unsigned char blckKey[KBL];
	char * pR,*qR,*xR;
};

⌨️ 快捷键说明

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