summaryrefslogtreecommitdiffstats
path: root/lib/aes.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/aes.go')
-rw-r--r--lib/aes.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/aes.go b/lib/aes.go
index a388db8..bd0a86b 100644
--- a/lib/aes.go
+++ b/lib/aes.go
@@ -85,6 +85,19 @@ func aesInvMixColumns(state [][]byte) [][]byte {
return n_state
}
+func aesSubBytes(state [][]byte) [][]byte {
+ nb := 4
+ for r := 0; r < 4; r++ {
+ for c := 0; c < nb; c++ {
+ x := state[r][c] >> 4
+ y := state[r][c] & 0x0f
+
+ state[r][c] = sbox[x][y]
+ }
+ }
+ return state
+}
+
func aesInvSubBytes(state [][]byte) [][]byte {
nb := 4
for r := 0; r < 4; r++ {