资源简介
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代码编译及扩展案例182387
- 下一篇:4篇程序员年终工作总结
相关资源
- SWMM51014代码编译及扩展案例182387
- verilog实现含FIFO的RS232串口收发程序源
- 模糊神经网络实现代码
- 推箱子源代码——QT的便捷
- 温度测试代码加仿真图protues
- labview检测系统程序源码
- 数据结构公交车最优线路问题完整代
- 操作Excel的DDE函数[操作Excel的DDE函数
- STM32HAL库使用NTC热敏电阻读取温度代码
- 1024点FFT快速傅立叶变换,16位数据输
- B样条曲线的实现代码
- (超级高清版经典Verilog100多个经典代
- Delphi纸牌游戏:争上游跑得快源代码
- 电子贺卡生成器源代码
- 广告管理系统 v1.0
- D3D11初始化代码
- 基于fpga的4ppm编码调制verilog代码
- 压缩感知CS的DOA代码
- QT登陆页面跳转到主界面的源代码
- 完全开源的gis地图发布代码
- 9个DSP图像处理实验程序图像处理源代
- VS2017下纯代码生成二维码,不需要动
- DFA的最小化 完整可运行代码
- 正规文法转正规式+正规式NFA完整可运
- Faster-RCNN 代码
- cocos 扫雷代码工程,编译
- VTI介质逆时偏移与角道集提取源代码
- 串口通信实验报告 含代码
- STM32F407 步进电机含角度输出Keil代码
- 经典教材 神经网络设计 书配代码 N
评论
共有 条评论