import nimcrypto/twofish, nimcrypto/utils import unittest when defined(nimHasUsed): {.used.} ## Tests made according to official test vectors ## [https://www.schneier.com/code/ecb_ival.txt]. proc test[T](n: int): seq[uint8] = var keysize = n div 8 var blocksize = 128 div 8 var list = newSeq[seq[uint8]](60) var key: seq[uint8] list[0] = newSeq[uint8](keysize) list[1] = newSeq[uint8](keysize) var k = 0 for i in 0..48: var ctx = T() key = list[k] var data = list[k + 1][0..