Journal of Applied Mathematics / 2014 / Article / Alg 3

Research Article

A Matrix PRNG with S-Box Output Filtering

Algorithm 3

offs:= 0
for r = 0 to 63 {
if r is 0 or r is 63 {
v:= 0x55AA55AA55AA55AA
}
else {
v:= S0[(r + key[offs  % 16]) % 256]
offs:= offs + 1
v:= v   S1[(offs + key[offs % 16]) % 256]
offs:= offs + 1
v:= v << 32
v:= v    S2[(r + key[offs % 16]) % 256]
offs:= offs + 1
v:= v    S3[(offs + key[offs % 16]) % 256]
offs:= offs + 1
}
for c:= 0 to 47
X[r*48+c]:= (v>>c) % 2
}