feistel

Apply the feistel routine to a given block of data. Used by processBlock.

pure
BitArray
feistel
(
const ref BitArray block
,
const ref BitArray subkey
)

Parameters

block BitArray

The block to apply the routine to

subkey BitArray

The subkey to use for this process

Return Value

Type: BitArray

The processed block

Examples

const ubyte[] message = [0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x0A, 0x0B];
const ubyte[] key = [0x0e, 0x32, 0x92, 0x32, 0xea, 0x6d, 0x0d, 0x73];
const ubyte[] encoded = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xAF, 0x73, 0x75, 0x18, 0xB3, 0xB4, 0xD2, 0x9D];

const ubyte[] actualEncoded = encrypt(message, key);
const ubyte[] actualDecoded = decrypt(encoded, key, message.length);

assert(actualEncoded == encoded);
assert(actualDecoded == message);

Meta