mirror of
https://github.com/sheumann/65816-crypto.git
synced 2025-02-16 13:30:25 +00:00
Add support for AES-256 decryption.
This commit is contained in:
parent
0e3e511ba8
commit
46fcb3badc
18
aes.asm
18
aes.asm
@ -345,17 +345,27 @@ aes192_decrypt start
|
||||
CFunction AES192_DECRYPT
|
||||
end
|
||||
|
||||
AES192_DECRYPT start
|
||||
aes256_decrypt start
|
||||
CFunction AES256_DECRYPT
|
||||
end
|
||||
|
||||
AES256_DECRYPT start
|
||||
using tables
|
||||
|
||||
InvFinalRound 14
|
||||
InvNormalRound 13
|
||||
InvNormalRound 12
|
||||
jmp cont1
|
||||
|
||||
AES192_DECRYPT entry
|
||||
InvFinalRound 12
|
||||
cont1 anop
|
||||
InvNormalRound 11
|
||||
InvNormalRound 10
|
||||
jmp cont
|
||||
jmp cont2
|
||||
|
||||
AES128_DECRYPT entry
|
||||
InvFinalRound 10
|
||||
cont anop
|
||||
cont2 anop
|
||||
InvNormalRound 9
|
||||
InvNormalRound 8
|
||||
InvNormalRound 7
|
||||
|
1
aes.h
1
aes.h
@ -14,3 +14,4 @@ void aes_encrypt(struct aes_state *state);
|
||||
|
||||
void aes128_decrypt(struct aes_state *state);
|
||||
void aes192_decrypt(struct aes_state *state);
|
||||
void aes256_decrypt(struct aes_state *state);
|
||||
|
12
aes.macros
12
aes.macros
@ -246,7 +246,13 @@
|
||||
|
||||
.loop
|
||||
lda &state+&i
|
||||
aif (rk+&round*16+&i)>255,.bigindex
|
||||
eor rk+&round*16+&i
|
||||
ago .cont
|
||||
.bigindex
|
||||
ldx #&round*16+&i
|
||||
eor rk,X
|
||||
.cont
|
||||
sta &state+&i
|
||||
&i seta &i+2
|
||||
aif &i<16,.loop
|
||||
@ -319,7 +325,13 @@
|
||||
InvFinalRoundStep &to,&from
|
||||
|
||||
lda state1+&from
|
||||
aif (rk+&round*16+&from)>255,.bigindex
|
||||
eor rk+&round*16+&from
|
||||
ago .cont
|
||||
.bigindex
|
||||
ldx #&round*16+&from
|
||||
eor rk,X
|
||||
.cont
|
||||
tay
|
||||
lda InvSbox,Y
|
||||
sta state2+&to
|
||||
|
Loading…
x
Reference in New Issue
Block a user