资源简介
2007年欧洲提出的轻型分组密码算法PRESENT的VC代码

代码片段和文件信息
// Present.cpp : Defines the entry point for the console application.
//
/*
* Copyright (c) 2010 Department of Computer Engineering Ordnance Engineering College
* All rights reserved.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* - Neither the name of the Department of Computer Engineering
* Ordnance Engineering College nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT
* INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING
* BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT
* LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* The core function of PRESENT block cipher.
*
* @author Xinjie ZHAO
* @Email zhaoxinjieem@163.com
* @date May 20 2010
*/
#include “stdafx.h“
#include “stdlib.h“
#include
#include
typedef unsigned char Byte;
static const Byte Sbox[16] = {
0x0c 0x05 0x06 0x0b
0x09 0x00 0x0a 0x0d
0x03 0x0e 0x0f 0x08
0x04 0x07 0x01 0x02
};
static const Byte DSbox[16] = {
0x050x0e 0x0f 0x08
0x0c0x01 0x02 0x0d
0x0b0x04 0x06 0x03
0x000x07 0x09 0x0a
};
static Byte Px[64]={
0163248117334921834503193551
4203652521375362238547233955
824405692541571026425811274359
12284460132945611430466215314763
};
static Byte rPx[64]={
04812162024283236404448525660
15913172125293337414549535761
261014182226303438424650545862
371115192327313539434751555963
};
static Byte testPx[8]={
76543210
};
void printblock(const Byte *bint nlenth)
{
for(int i=0;i printf(“%2x “ b[i]);
}
//S盒
void Sub_bytes(Byte *s)
{
Byte t[16];
int i;
memset(t016);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6249 2011-05-02 22:01 PRESENT.cpp
- 上一篇:SWMM51014代码编译及扩展案例
- 下一篇:4篇程序员年终工作总结
相关资源
- bp神经网络源代码,可直接运行
- 随机森林R语言代码
- 计算机图形学 边填充算法实现代码
- 直流无刷电机方波驱动 stm32 例程代码
- 仿知乎界面小程序源代码
- 贪吃蛇源代码.fla
- 周立功开发板ProASIC3实验-syn_FIFO代码
- IMX385驱动代码.zip
- dotnet 写字板 实验 源代码 不好请要不
- 图像二维小波变换的实现源代码
- 八三编码器设计 VHDL代码 简单,包附
- linux应用层的华容道游戏源代码
- 交通咨询模拟系统完整代码
- http请求状态代码
- 数值分析所有实验代码
- 网上拍卖系统完整源代码
- 音乐代码转换软件 单片机编程时用
- CSMA/CD等动画演示加源代码
- silicon lab公司的收音IC SI47XX全套开发工
- 用51单片机实现G代码翻译
- 合同管理系统的源代码(附数据库)
- 用VC 编写的仿QQ聊天室程序源代码
- web班级网站设计代码
- 38k单片机红外发送代码、keil
- STM32F103 串口程序(完整版)
- 网络唤醒代码
- VPC3_DPV1源代码,Profibus
- PB做的托盘程序(最小化后在左下角显
- RSA算法源码
- ubuntu9.10 可加载内核模块和字符设备驱
评论
共有 条评论