摘要: 之前写过SBOX的构造,后来看到别人的优秀思路,借鉴过来重新改了一点。原文地址:http://www.cnblogs.com/7hat/p/3383546.html主要是将矩阵运算改为列运算之和,提高了效率。#include#include#include using namespace std;unsigned char exp[256], log[256], inv[256];unsigned char GFmul(unsigned char a, unsigned char b){ //GF(2^8) 乘法 unsigned char result = 0; if((b... 阅读全文
posted @ 2013-10-29 21:00 7hat 阅读(511) 评论(0) 推荐(0) 编辑
摘要: 分治的经典算法。import java.util.Random;import java.util.Arrays;public class BinarySearch{ public static int binarySearch(int[] A, int x){ return binarySearchDo(A, x, 0, A.length-1); } private static int binarySearchDo(int[] A, int x, int low, int high){ if(low > high) retu... 阅读全文
posted @ 2013-10-29 08:50 7hat 阅读(188) 评论(0) 推荐(0) 编辑