Module rijndael

This module implements Rijndael(AES) crypto algorithm by Vincent Rijmen, Antoon Bosselaers and Paulo Barreto.

Code based on version 3.0 (December 2000) of Optimised ANSI C code for the Rijndael cipher [http://www.fastcrypto.org/front/misc/rijndael-alg-fst.c].

Tests made according to official test vectors (Appendix B and Appendix C) [http://csrc.nist.gov/groups/STM/cavp/documents/aes/AESAVS.pdf].

Types

rijndael128 = RijndaelContext[128]
rijndael192 = RijndaelContext[192]
rijndael256 = RijndaelContext[256]
aes128 = rijndael128
aes192 = rijndael192
aes256 = rijndael256
rijndael = rijndael128 | rijndael192 | rijndael256 | aes128 | aes192 | aes256

Procs

proc rijndaelEncrypt(ctx: var RijndaelContext; inp: ptr byte; oup: ptr byte)
"is greater" operator. This is the same as y < x.
proc rijndaelDecrypt(ctx: var RijndaelContext; inp: ptr byte; oup: ptr byte)
"is greater" operator. This is the same as y < x.
proc initRijndaelContext(ctx: var RijndaelContext; N: int; key: ptr byte)
proc init(ctx: var RijndaelContext; key: ptr byte; nkey: int = 0) {...}{.inline.}
proc init(ctx: var RijndaelContext; key: openArray[byte]) {...}{.inline.}
"is greater or equals" operator. This is the same as y <= x.
proc clear(ctx: var RijndaelContext) {...}{.inline.}
proc encrypt(ctx: var RijndaelContext; inbytes: ptr byte; outbytes: ptr byte) {...}{.inline.}
proc decrypt(ctx: var RijndaelContext; inbytes: ptr byte; outbytes: ptr byte) {...}{.inline.}
proc encrypt(ctx: var RijndaelContext; input: openArray[byte];
            output: var openArray[byte]) {...}{.inline.}
proc decrypt(ctx: var RijndaelContext; input: openArray[byte];
            output: var openArray[byte]) {...}{.inline.}

Templates

template sizeKey(ctx: RijndaelContext): int
template sizeBlock(ctx: RijndaelContext): int
template sizeKey(r: typedesc[rijndael]): int
template sizeBlock(r: typedesc[rijndael]): int