keylength
.
# Returns a rearranged format of the ciphertext where every byte of a slot will be XORed with the same offset of a key of length `keylength`.
private fun transpose_ciphertext(keylength: Int): Array[Bytes] do
var transposed = new Array[Bytes]
for i in [0 .. keylength[ do
transposed.add(new Bytes.empty)
end
for byte_idx in [0 .. ciphertext.length[ do
transposed[byte_idx % keylength].add(ciphertext[byte_idx])
end
return transposed
end
lib/crapto/xor.nit:137,2--149,4