Jump to content

The ISAAC cipher: Difference between revisions

Updated D entry
(Updated D entry)
Line 478:
Improved from the C# version. XOR with decryption check.
<lang d>import std.algorithm: min;
import std.algorithm: copy;
import std.typetuple: TypeTuple;
import std.algorithmtypecons: copystaticIota;
 
 
template Iota(uint stop) { // For manual loop unrolling.
static if (stop <= 0)
alias Iota = TypeTuple!();
else
alias Iota = TypeTuple!(Iota!(stop - 1), stop - 1);
}
 
 
struct ISAAC {
Line 542 ⟶ 534:
 
// Scramble it.
/*static*/ foreach (immutable i; IotastaticIota!(0, 4))
mix(a);
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.