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

📄 tables6.cpp

📁 基于WIN32的经典的AES算法
💻 CPP
字号:
// tables6.cpp : Defines the entry point for the console application.
//



//#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>

#define XTIME(b) (b<<1)^((b&0x80)?0x1B:0x00)
unsigned char a=0x0b;

void main()
{
	char * fn_out;
    fn_out=(char *)malloc(36);
    FILE * fp_out;
	printf("enter the filename .\n");
    scanf("%s",fn_out);
	fp_out=fopen(fn_out,"wb");//二进制格式打开文件
    if(fp_out==NULL)
    {
	    printf("This file %s can not open!\n",fn_out);
        exit(1);
    }

	unsigned char b;
	unsigned char c;
	int i;
	int j;
	unsigned char temp;
	for(b=0x00,j=1;(b<=0xff)&&(j<=256);b++,j++)
	{	
		temp=0x00;
		c=b;
		for(i=0x01;(i<=0x80)&&(i<=a);i=i<<1,c=XTIME(c))
		{
			if(a&i)
			{
				temp=temp^c;
			}
		}
		fprintf(fp_out,"0x%x, ",temp);
		if(j%16==0)
		{
			fprintf(fp_out,"\n");
		}
	}

}

⌨️ 快捷键说明

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