export const addRoundKey = (state: number[][], roundKey: number[][]): number[][] => { const result: number[][] = [ [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0] ] for (let row = 0;row < 4;row++) { for (let col = 0;col < 4;col++) { result[row][col] = state[row][col] ^ roundKey[row][col] } } return result }