Optimize ShiftRows() and InvShiftRows()
authorIra W. Snyder <devel@irasnyder.com>
Sun, 21 Oct 2007 23:36:05 +0000 (16:36 -0700)
committerIra W. Snyder <devel@irasnyder.com>
Sun, 21 Oct 2007 23:36:05 +0000 (16:36 -0700)
commit4bfbc559f6d8e186f8b95b48ae9603ee32dbb17d
treea9653b1891e3c97952dbc8cf1edc0e08a1617f36
parentb2d5f155713d1d55d125153b45fb059b4429f6b3
Optimize ShiftRows() and InvShiftRows()

This switches the code so that it stores the state matrix in the same
column-wise fashion that the FIPS document specifies. This makes it
possible to optimize ShiftRows() and InvShiftRows() by accessing the bytes
inside it as words instead of as bytes. This is guaranteed to work because
the storage allocated by std::vector is guaranteed to be continuous, so
that pointer arithmetic works like normal arrays.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
aes.cpp