forked from u3forge/AES-Encryption
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuxillaryFunctions.inc
More file actions
51 lines (48 loc) · 854 Bytes
/
AuxillaryFunctions.inc
File metadata and controls
51 lines (48 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
section .text
; Takes:
; esi: matrix 1
; edi: matrix 2
; XORs the matrices and places them in matrix 2
XOR4x4Matrices:
push eax
push ecx
mov ecx, 16
._xor:
mov al, BYTE [esi]
xor BYTE [edi], al
inc edi
inc esi
loop ._xor
pop ecx
pop eax
ret
; Takes:
; eax: Hex Value
; Returns:
; edx: Decimal Value with the same digits
GetDecimalValueFromHex:
xor edx, edx
xor ebx, ebx
mov ebx, 1
.cont:
mov cl, al
and cl, 0x0F
push eax
push edx
movzx eax, cl
mul ebx
pop edx
add edx, eax
pop eax
shr eax, 4
push eax
xchg eax, ebx
mov ebx, 10
push edx
mul ebx
pop edx
xchg eax, ebx
pop eax
cmp eax, 0
jne .cont
ret