コード例 #1
0
ファイル: bes.go プロジェクト: OpenWhiteBox/AES
// subBytes rewrites each byte of the state with the S-Box. unSubBytes and subBytes are the same.
func (constr *Construction) subBytes(in gfmatrix.Row) gfmatrix.Row {
	out := gfmatrix.NewRow(in.Size())

	for pos := 0; pos < in.Size(); pos++ {
		out[pos] = in[pos].Invert()
	}

	return out
}