A block cipher is a cipher (E,D)
which (given a key) takes n
bits of PT as input and outputs n
bits of CT.
Examples include:
- 3DES: n = 64 bits, k = 168 bits
- AES: n = 128 bits, k = 128, 192, 256 bits
using Winston | |
x = Int[] | |
y = Int[] | |
for i = 2:20, j = 2:20 | |
if (rem(i,j) != 0) && (rem(BigInt(i)^i,BigInt(j)^j) == 0) | |
push!(x,i) | |
push!(y,j) | |
end |
var algorithms = require("algorithms"), | |
fs = require("fs"); | |
var dynamicLowMem = function(capacity, values, weights){ | |
var max = function(x, y){ | |
return x ^ ((x ^ y) & -(x < y)); | |
} | |
var items = values.length, | |
value = 0, |
from sys import argv | |
import math | |
N = int(argv[1]) | |
S = set(); | |
k = N | |
for j in range(1,N+1): | |
S.add(j) |
from sys import argv | |
import re | |
# open the file and get read to read data | |
file = open(argv[1], "r"); | |
p = re.compile("\d+"); | |
# initialize the graph | |
vertices, edges = map(int, p.findall(file.readline())) | |
graph = [[0]*vertices for _ in range(vertices)] |
int maxiter = 500; | |
//float zoom = 0.005; | |
//float fx = -0.745; | |
//float fy = 0.1; | |
float zoom = 4; | |
float fx = 0; | |
float fy = 0; |
# factorization algorithm based on gcd | |
# | |
# could be vastly improved, this is barely better than | |
# naive | |
function fac(n::BigInt) | |
factors = Dict{BigInt,BigInt}() | |
while !isprime(n::BigInt) |
/* | |
* Keeps a portion of the array sorted at all time, | |
* called the invariant. | |
* | |
* Every time you try to sort a new element, you cmpare | |
* against all the elems in the invariant, and put it in | |
* its right place. | |
* | |
* Keep doing this until the size invariant array = size orginal | |
* array. |
A polytope is the convex hull of a set of points. Can see immeadately how it would be useful to know if a set of points in Rd form a polytope, linear programming!
How can we formalize this definition?
If we're only thinking about convex polytopes, we could construct a set based on the intersection of the product spaces of the multiplication of each plane through three points and the plane orthogonal to this plane.
P = \cap_{a,b,c \in S} (ab x ac) x (the normal of that plane through a or b or c)