
_lodsd_		proc

	mov     esi, offset _buffor16
	lodsd
	mov     edi, eax
	lodsd
	mov     ebx, eax
	lodsd
	mov     ecx, eax
	lodsd
	mov     edx, eax
	mov     eax, edi
	ret

_lodsd_		endp


_stosd_		proc

	;mov     edi, offset _buffor16			;8 bajtow
	stosd
	mov     eax, ebx
	stosd
	mov     eax, ecx
	stosd
	mov     eax, edx
	stosd
	ret

_stosd_		endp

camellia_en		proc

	
	push	ebx
	call	Camellia_SetKey

	mov	esi, offset _buffor16
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Camellia_Encrypt

	call	Camellia_Clear
	ret
camellia_en		endp
;==========================================================
camellia_de		proc

	push	ebx
	call	Camellia_SetKey

	mov	esi, offset _buffor16
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Camellia_Decrypt

	call	Camellia_Clear
	ret
camellia_de		endp
;==========================================================
khazad_de_en		proc

	

	push	ebx
	call	Khazad_SetKey

	mov	esi, offset _buffor16

	push	KHAZAD_DECRYPT
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Khazad_Crypt

	mov	esi, offset _buffor16
	add	esi, 8

	push	KHAZAD_ENCRYPT
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Khazad_Crypt

	call	Khazad_Clear
	ret
khazad_de_en		endp
;==========================================================
khazad_en_de		proc

	

	push	ebx
	call	Khazad_SetKey
	
	mov	esi, offset _buffor16

	push	KHAZAD_ENCRYPT
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Khazad_Crypt

	mov	esi, offset _buffor16
	add	esi, 8

	push	KHAZAD_DECRYPT
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Khazad_Crypt

	call	Khazad_Clear
	ret
khazad_en_de		endp
;==========================================================
anubis_en		proc

	push	ebx
	call	Anubis_SetKey

	mov	esi, offset _buffor16

	push	ANUBIS_ENCRYPT
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Anubis_Crypt

	call	Anubis_Clear
	ret
anubis_en		endp
;===========================================
anubis_de		proc

	push	ebx
	call	Anubis_SetKey

	mov	esi, offset _buffor16

	push	ANUBIS_DECRYPT
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Anubis_Crypt

	call	Anubis_Clear
	ret
anubis_de		endp

anubis_en		proc

	push	ebx
	call	Anubis_SetKey

	mov	esi, offset _buffor16

	push	ANUBIS_ENCRYPT
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Anubis_Crypt

	call	Anubis_Clear
	ret
anubis_en		endp

;===========================================
e2_encrypt		proc

	push	ebx
	call	E2_SetKey

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	E2_Encrypt

	call	E2_Clear
	ret
e2_encrypt		endp

e2_decrypt		proc

	push	ebx
	call	E2_SetKey

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	E2_Decrypt

	call	E2_Clear
	ret
e2_decrypt		endp
;===========================================
nimbus_de_en		proc

	push	ebx		;ptr to 16 bytes user key
	call	Nimbus_SetKey

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Nimbus_Decrypt

	mov	esi, offset _buffor16
	add	esi, 8

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Nimbus_Encrypt

	call	Nimbus_Clear
	ret
nimbus_de_en		endp

nimbus_en_de		proc

	push	ebx		;ptr to 16 bytes user key
	call	Nimbus_SetKey

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Nimbus_Encrypt

	mov	esi, offset _buffor16
	add	esi, 8
	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	Nimbus_Decrypt

	call	Nimbus_Clear
	ret
nimbus_en_de		endp

;===========================================
magenda_en		proc

	push	ebx
	call	MAGENTA_SetKey			;set the password

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	MAGENTA_Encrypt

	call	MAGENTA_Clear			;clear internal data
	ret
magenda_en		endp

magenda_de		proc

	push	ebx
	call	MAGENTA_SetKey			;set the password

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	MAGENTA_Decrypt

	call	MAGENTA_Clear			;clear internal data
	ret
magenda_de		endp

;===========================================
newdes_en		proc

	mov	esi, offset _buffor16
mov edi,esi
add esi,10h
mov ecx,4
rep movsd
ret
newdes_en		endp

newdes_de		proc

	mov	esi, offset _buffor16
mov edi,esi
add esi,10h
mov ecx,4
rep movsd
ret
newdes_de		endp

;===========================================
nush_decrypt		proc

	push	ebx		;ptr to 16 bytes key
	call	NUSH_SetKey

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	NUSH_Decrypt

	call	NUSH_Clear
	ret
nush_decrypt		endp

nush_encrypt		proc

	push	ebx		;ptr to 16 bytes key
	call	NUSH_SetKey

	mov	esi, offset _buffor16

	add	esi, 10h
	push	esi
	sub	esi, 10h
	push	esi
	call	NUSH_Encrypt

	call	NUSH_Clear
	ret
nush_encrypt		endp

;===========================================
noekeon_de		proc

	mov	esi, offset _buffor16
mov edi,esi
add esi,10h
mov ecx,4
rep movsd
ret
noekeon_de		endp

noekeon_en		proc

	mov	esi, offset _buffor16
mov edi,esi
add esi,10h
mov ecx,4
rep movsd
ret
noekeon_en		endp
;===========================================
rc4_en		proc

	push	8
	push	ebx
	call	_rc4_setkey

	push	10h
	push	offset _buffor16+16
	call	_rc4_crypt
	mov	esi, offset _buffor16
mov edi,esi
add esi,10h
mov ecx,4
rep movsd
ret
rc4_en		endp
;===============================================================================








