You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
crypto: x86/salsa20 - assembler cleanup, use ENTRY/ENDPROC for assember functions and rename ECRYPT_* to salsa20_*
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
b05d3f3756
commit
044438082c
@@ -2,11 +2,12 @@
|
|||||||
# D. J. Bernstein
|
# D. J. Bernstein
|
||||||
# Public domain.
|
# Public domain.
|
||||||
|
|
||||||
# enter ECRYPT_encrypt_bytes
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.p2align 5
|
|
||||||
.globl ECRYPT_encrypt_bytes
|
# enter salsa20_encrypt_bytes
|
||||||
ECRYPT_encrypt_bytes:
|
ENTRY(salsa20_encrypt_bytes)
|
||||||
mov %esp,%eax
|
mov %esp,%eax
|
||||||
and $31,%eax
|
and $31,%eax
|
||||||
add $256,%eax
|
add $256,%eax
|
||||||
@@ -933,11 +934,10 @@ ECRYPT_encrypt_bytes:
|
|||||||
add $64,%esi
|
add $64,%esi
|
||||||
# goto bytesatleast1
|
# goto bytesatleast1
|
||||||
jmp ._bytesatleast1
|
jmp ._bytesatleast1
|
||||||
# enter ECRYPT_keysetup
|
ENDPROC(salsa20_encrypt_bytes)
|
||||||
.text
|
|
||||||
.p2align 5
|
# enter salsa20_keysetup
|
||||||
.globl ECRYPT_keysetup
|
ENTRY(salsa20_keysetup)
|
||||||
ECRYPT_keysetup:
|
|
||||||
mov %esp,%eax
|
mov %esp,%eax
|
||||||
and $31,%eax
|
and $31,%eax
|
||||||
add $256,%eax
|
add $256,%eax
|
||||||
@@ -1060,11 +1060,10 @@ ECRYPT_keysetup:
|
|||||||
# leave
|
# leave
|
||||||
add %eax,%esp
|
add %eax,%esp
|
||||||
ret
|
ret
|
||||||
# enter ECRYPT_ivsetup
|
ENDPROC(salsa20_keysetup)
|
||||||
.text
|
|
||||||
.p2align 5
|
# enter salsa20_ivsetup
|
||||||
.globl ECRYPT_ivsetup
|
ENTRY(salsa20_ivsetup)
|
||||||
ECRYPT_ivsetup:
|
|
||||||
mov %esp,%eax
|
mov %esp,%eax
|
||||||
and $31,%eax
|
and $31,%eax
|
||||||
add $256,%eax
|
add $256,%eax
|
||||||
@@ -1112,3 +1111,4 @@ ECRYPT_ivsetup:
|
|||||||
# leave
|
# leave
|
||||||
add %eax,%esp
|
add %eax,%esp
|
||||||
ret
|
ret
|
||||||
|
ENDPROC(salsa20_ivsetup)
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# enter ECRYPT_encrypt_bytes
|
#include <linux/linkage.h>
|
||||||
.text
|
|
||||||
.p2align 5
|
# enter salsa20_encrypt_bytes
|
||||||
.globl ECRYPT_encrypt_bytes
|
ENTRY(salsa20_encrypt_bytes)
|
||||||
ECRYPT_encrypt_bytes:
|
|
||||||
mov %rsp,%r11
|
mov %rsp,%r11
|
||||||
and $31,%r11
|
and $31,%r11
|
||||||
add $256,%r11
|
add $256,%r11
|
||||||
@@ -802,11 +801,10 @@ ECRYPT_encrypt_bytes:
|
|||||||
# comment:fp stack unchanged by jump
|
# comment:fp stack unchanged by jump
|
||||||
# goto bytesatleast1
|
# goto bytesatleast1
|
||||||
jmp ._bytesatleast1
|
jmp ._bytesatleast1
|
||||||
# enter ECRYPT_keysetup
|
ENDPROC(salsa20_encrypt_bytes)
|
||||||
.text
|
|
||||||
.p2align 5
|
# enter salsa20_keysetup
|
||||||
.globl ECRYPT_keysetup
|
ENTRY(salsa20_keysetup)
|
||||||
ECRYPT_keysetup:
|
|
||||||
mov %rsp,%r11
|
mov %rsp,%r11
|
||||||
and $31,%r11
|
and $31,%r11
|
||||||
add $256,%r11
|
add $256,%r11
|
||||||
@@ -892,11 +890,10 @@ ECRYPT_keysetup:
|
|||||||
mov %rdi,%rax
|
mov %rdi,%rax
|
||||||
mov %rsi,%rdx
|
mov %rsi,%rdx
|
||||||
ret
|
ret
|
||||||
# enter ECRYPT_ivsetup
|
ENDPROC(salsa20_keysetup)
|
||||||
.text
|
|
||||||
.p2align 5
|
# enter salsa20_ivsetup
|
||||||
.globl ECRYPT_ivsetup
|
ENTRY(salsa20_ivsetup)
|
||||||
ECRYPT_ivsetup:
|
|
||||||
mov %rsp,%r11
|
mov %rsp,%r11
|
||||||
and $31,%r11
|
and $31,%r11
|
||||||
add $256,%r11
|
add $256,%r11
|
||||||
@@ -918,3 +915,4 @@ ECRYPT_ivsetup:
|
|||||||
mov %rdi,%rax
|
mov %rdi,%rax
|
||||||
mov %rsi,%rdx
|
mov %rsi,%rdx
|
||||||
ret
|
ret
|
||||||
|
ENDPROC(salsa20_ivsetup)
|
||||||
|
|||||||
@@ -26,11 +26,6 @@
|
|||||||
#define SALSA20_MIN_KEY_SIZE 16U
|
#define SALSA20_MIN_KEY_SIZE 16U
|
||||||
#define SALSA20_MAX_KEY_SIZE 32U
|
#define SALSA20_MAX_KEY_SIZE 32U
|
||||||
|
|
||||||
// use the ECRYPT_* function names
|
|
||||||
#define salsa20_keysetup ECRYPT_keysetup
|
|
||||||
#define salsa20_ivsetup ECRYPT_ivsetup
|
|
||||||
#define salsa20_encrypt_bytes ECRYPT_encrypt_bytes
|
|
||||||
|
|
||||||
struct salsa20_ctx
|
struct salsa20_ctx
|
||||||
{
|
{
|
||||||
u32 input[16];
|
u32 input[16];
|
||||||
|
|||||||
Reference in New Issue
Block a user