- 博客(16)
- 收藏
- 关注
原创 大小端
大小端CPU架构:PowerPC系列采用大端(big endian)的方式存储数据,X86系列则采用小端(little endian)方式存储数据。ARM芯片默认采用小端,但可以切换为大端;编译器:4. 在C语言中,默认是小端(但在一些对于单片机的实现中却是基于大端,比如Keil 51C)5. Java是平台无关的,默认是大端6. 在网络上传输数据普遍采用的都是大端。在计算机...
2020-07-28 18:02:41 1688
原创 技巧 01234567->02460000
在这里插入代码片MPRESS_BYTE_ARRAY(k, K0_o, K0_e);#define COMPRESS_BYTE_ARRAY(a,var_o,var_e) {\ var_e = U32BIG(((u32*)(a))[1]);\ var_o = var_e >> 1;\ COMPRESS_LONG(var_e);\ COMPRESS_LONG(v...
2020-07-28 18:01:27 139
原创 bit interleaving
原理#include"stdio.h"#include <time.h>#include <stdlib.h>typedef unsigned char u8;typedef unsigned int u32;typedef unsigned long long u64;#define ROTR64(x,n) (((x)>>(n))|((x...
2020-07-28 18:01:06 295 1
原创 ASCON-sbox
for (i = 0; i < 32; i++) { x0=0, x1 = 0, x2 = 0, x3 = 0, x4 = 0; temp = i; if (temp != 0) { x4 = temp % 2; temp = temp / 2; if (temp != 0) { x3 = temp % 2; temp = temp / 2; if (...
2020-07-28 18:00:45 1137
原创 BYTE and BIT
AEShttps://csrc.nist.gov/publications/detail/fips/197/finalhttps://www.nist.gov/publications/advanced-encryption-standard-aesthe element {01100011} can be represented as {63},b6=b5=b1=b0=1C...
2020-07-28 17:55:38 114
原创 01234567->0369
void zxfCOMPRESS_LONG(u32 t) { u32 x = t, t1, t2, t3, t4,t5; printBinary("x", (&x), 4); x &= 0x92492492; //x &= 0xff; printBinary("x: x &= 0x92492492", (u8*)(&x), 4); //pri...
2020-07-28 17:54:57 132
原创 比较 bit_interleaving
0123456789->036913*3=395+4+4=13//&:5 <<:4 |:4#define puckThree(x){\x &= 0x92492492;\t1 = (x | (x << 2));\x = t1 & 0xc30c30c3;\t2 = (x | (x << 4));\x = t2...
2020-07-28 17:54:22 250
原创 循环移位96
void shift1(u8 cycle_shift_Num) { printf("cycle_shift_Num=%d \n", cycle_shift_Num); u8 in[BYTELEN] = { 0 }, i, in2[BYTELEN] = { 0 }; for (i = 0; i < BYTELEN; i++) { in[i] = 0; } in[BYTELEN-1...
2020-07-28 17:53:51 137
原创 JAVA处理Excel
jxljava生成excel表格private static WritableSheet writeNumberToWs(WritableSheet ws,jxl.write.WritableCellFormat wcfN, int row, int j, double titlesDoubleValue) { jxl.write.Number labelNF = new jxl.write.Number(j, row, titlesDoubleValue, wcfN); // 格式化数值
2020-05-20 11:19:40 142
原创 JAVA txt文件操作
java項目根目錄 src文件夾目錄項目下面Txt_W_R(".\\src\\temp.txt",".\\src\\temp_result.txt"); public static void Txt_W_R(String read,String write) { File fileWrite = new File(write); File feileRead = new File(r...
2020-05-09 10:18:04 175
原创 DES
https://csrc.nist.gov/publications/detail/fips/46/3/archive/1999-10-25https://csrc.nist.gov/CSRC/media/Publications/fips/46/3/archive/1999-10-25/documents/fips46-3.pdf
2020-04-30 10:57:57 194
原创 常用c函数
void printBinaryU8(u8 t) { int j; printf("0x%02x : ", t); for (j = 0; j < 8; j++) { printf("%d ", t / 0x80);// 下标 ,取最高位 if(j%4==3)printf(" "); t = t * 2; } printf("\n");}void getU8Fo...
2020-03-19 15:24:39 188
原创 c语言输出二进制表示
//len:输出byte个数void printBinary(unsigned char * str, u8 *a,int len) { printf("%8s:\n", str); int i,j; u8 t; for (i = 0; i < len; i++) { t = a[i]; printf("0x%02x : ",t); for (j = 0; j <...
2020-03-14 16:51:01 1644
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人