Skip to content

Commit

Permalink
Generate ASM
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jul 8, 2024
1 parent e378bff commit dc167d0
Show file tree
Hide file tree
Showing 61 changed files with 362 additions and 0 deletions.
1 change: 1 addition & 0 deletions generated-src/linux-x86_64/crypto/chacha/chacha-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
.align 64
ChaCha20_ctr32:
.cfi_startproc
_CET_ENDBR
cmpq $0,%rdx
je .Lno_data
movq OPENSSL_ia32cap_P+4(%rip),%r10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ GFMUL:
.align 16
aesgcmsiv_htable_init:
.cfi_startproc
_CET_ENDBR
vmovdqa (%rsi),%xmm0
vmovdqa %xmm0,%xmm1
vmovdqa %xmm0,(%rdi)
Expand All @@ -97,6 +98,7 @@ aesgcmsiv_htable_init:
.align 16
aesgcmsiv_htable6_init:
.cfi_startproc
_CET_ENDBR
vmovdqa (%rsi),%xmm0
vmovdqa %xmm0,%xmm1
vmovdqa %xmm0,(%rdi)
Expand All @@ -119,6 +121,7 @@ aesgcmsiv_htable6_init:
.align 16
aesgcmsiv_htable_polyval:
.cfi_startproc
_CET_ENDBR
testq %rdx,%rdx
jnz .Lhtable_polyval_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -336,6 +339,7 @@ aesgcmsiv_htable_polyval:
.align 16
aesgcmsiv_polyval_horner:
.cfi_startproc
_CET_ENDBR
testq %rcx,%rcx
jnz .Lpolyval_horner_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -369,6 +373,7 @@ aesgcmsiv_polyval_horner:
.align 16
aes128gcmsiv_aes_ks:
.cfi_startproc
_CET_ENDBR
vmovdqu (%rdi),%xmm1
vmovdqa %xmm1,(%rsi)

Expand Down Expand Up @@ -425,6 +430,7 @@ aes128gcmsiv_aes_ks:
.align 16
aes256gcmsiv_aes_ks:
.cfi_startproc
_CET_ENDBR
vmovdqu (%rdi),%xmm1
vmovdqu 16(%rdi),%xmm3
vmovdqa %xmm1,(%rsi)
Expand Down Expand Up @@ -472,6 +478,7 @@ aes256gcmsiv_aes_ks:
.align 16
aes128gcmsiv_aes_ks_enc_x1:
.cfi_startproc
_CET_ENDBR
vmovdqa (%rcx),%xmm1
vmovdqa 0(%rdi),%xmm4

Expand Down Expand Up @@ -614,6 +621,7 @@ aes128gcmsiv_aes_ks_enc_x1:
.align 16
aes128gcmsiv_kdf:
.cfi_startproc
_CET_ENDBR



Expand Down Expand Up @@ -707,6 +715,7 @@ aes128gcmsiv_kdf:
.align 16
aes128gcmsiv_enc_msg_x4:
.cfi_startproc
_CET_ENDBR
testq %r8,%r8
jnz .L128_enc_msg_x4_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -886,6 +895,7 @@ aes128gcmsiv_enc_msg_x4:
.align 16
aes128gcmsiv_enc_msg_x8:
.cfi_startproc
_CET_ENDBR
testq %r8,%r8
jnz .L128_enc_msg_x8_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -1147,6 +1157,7 @@ aes128gcmsiv_enc_msg_x8:
.align 16
aes128gcmsiv_dec:
.cfi_startproc
_CET_ENDBR
testq $~15,%r9
jnz .L128_dec_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -1639,6 +1650,7 @@ aes128gcmsiv_dec:
.align 16
aes128gcmsiv_ecb_enc_block:
.cfi_startproc
_CET_ENDBR
vmovdqa (%rdi),%xmm1

vpxor (%rdx),%xmm1,%xmm1
Expand All @@ -1664,6 +1676,7 @@ aes128gcmsiv_ecb_enc_block:
.align 16
aes256gcmsiv_aes_ks_enc_x1:
.cfi_startproc
_CET_ENDBR
vmovdqa con1(%rip),%xmm0
vmovdqa mask(%rip),%xmm15
vmovdqa (%rdi),%xmm8
Expand Down Expand Up @@ -1847,6 +1860,7 @@ aes256gcmsiv_aes_ks_enc_x1:
.align 16
aes256gcmsiv_ecb_enc_block:
.cfi_startproc
_CET_ENDBR
vmovdqa (%rdi),%xmm1
vpxor (%rdx),%xmm1,%xmm1
vaesenc 16(%rdx),%xmm1,%xmm1
Expand All @@ -1873,6 +1887,7 @@ aes256gcmsiv_ecb_enc_block:
.align 16
aes256gcmsiv_enc_msg_x4:
.cfi_startproc
_CET_ENDBR
testq %r8,%r8
jnz .L256_enc_msg_x4_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -2074,6 +2089,7 @@ aes256gcmsiv_enc_msg_x4:
.align 16
aes256gcmsiv_enc_msg_x8:
.cfi_startproc
_CET_ENDBR
testq %r8,%r8
jnz .L256_enc_msg_x8_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -2363,6 +2379,7 @@ aes256gcmsiv_enc_msg_x8:
.align 16
aes256gcmsiv_dec:
.cfi_startproc
_CET_ENDBR
testq $~15,%r9
jnz .L256_dec_start
.byte 0xf3,0xc3
Expand Down Expand Up @@ -2923,6 +2940,7 @@ aes256gcmsiv_dec:
.align 16
aes256gcmsiv_kdf:
.cfi_startproc
_CET_ENDBR



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ poly_hash_ad_internal:
.align 64
chacha20_poly1305_open:
.cfi_startproc
_CET_ENDBR
pushq %rbp
.cfi_adjust_cfa_offset 8
.cfi_offset %rbp,-16
Expand Down Expand Up @@ -2108,6 +2109,7 @@ chacha20_poly1305_open:
.align 64
chacha20_poly1305_seal:
.cfi_startproc
_CET_ENDBR
pushq %rbp
.cfi_adjust_cfa_offset 8
.cfi_offset %rbp,-16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ _aesni_ctr32_ghash_6x:
aesni_gcm_decrypt:
.cfi_startproc

_CET_ENDBR
xorq %rax,%rax


Expand Down Expand Up @@ -569,6 +570,7 @@ _aesni_ctr32_6x:
aesni_gcm_encrypt:
.cfi_startproc

_CET_ENDBR
#ifdef BORINGSSL_DISPATCH_TEST
.extern BORINGSSL_function_hit
.hidden BORINGSSL_function_hit
Expand Down
9 changes: 9 additions & 0 deletions generated-src/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.align 16
aes_hw_encrypt:
.cfi_startproc
_CET_ENDBR
#ifdef BORINGSSL_DISPATCH_TEST
.extern BORINGSSL_function_hit
.hidden BORINGSSL_function_hit
Expand Down Expand Up @@ -45,6 +46,7 @@ aes_hw_encrypt:
.align 16
aes_hw_decrypt:
.cfi_startproc
_CET_ENDBR
movups (%rdi),%xmm2
movl 240(%rdx),%eax
movups (%rdx),%xmm0
Expand Down Expand Up @@ -533,6 +535,7 @@ _aesni_decrypt8:
.align 16
aes_hw_ecb_encrypt:
.cfi_startproc
_CET_ENDBR
andq $-16,%rdx
jz .Lecb_ret

Expand Down Expand Up @@ -878,6 +881,7 @@ aes_hw_ecb_encrypt:
.align 16
aes_hw_ctr32_encrypt_blocks:
.cfi_startproc
_CET_ENDBR
#ifdef BORINGSSL_DISPATCH_TEST
movb $1,BORINGSSL_function_hit(%rip)
#endif
Expand Down Expand Up @@ -1463,6 +1467,7 @@ aes_hw_ctr32_encrypt_blocks:
.align 16
aes_hw_xts_encrypt:
.cfi_startproc
_CET_ENDBR
leaq (%rsp),%r11
.cfi_def_cfa_register %r11
pushq %rbp
Expand Down Expand Up @@ -1934,6 +1939,7 @@ aes_hw_xts_encrypt:
.align 16
aes_hw_xts_decrypt:
.cfi_startproc
_CET_ENDBR
leaq (%rsp),%r11
.cfi_def_cfa_register %r11
pushq %rbp
Expand Down Expand Up @@ -2442,6 +2448,7 @@ aes_hw_xts_decrypt:
.align 16
aes_hw_cbc_encrypt:
.cfi_startproc
_CET_ENDBR
testq %rdx,%rdx
jz .Lcbc_ret

Expand Down Expand Up @@ -3035,6 +3042,7 @@ aes_hw_cbc_encrypt:
.align 16
aes_hw_set_decrypt_key:
.cfi_startproc
_CET_ENDBR
.byte 0x48,0x83,0xEC,0x08
.cfi_adjust_cfa_offset 8
call __aesni_set_encrypt_key
Expand Down Expand Up @@ -3081,6 +3089,7 @@ aes_hw_set_decrypt_key:
aes_hw_set_encrypt_key:
__aesni_set_encrypt_key:
.cfi_startproc
_CET_ENDBR
#ifdef BORINGSSL_DISPATCH_TEST
movb $1,BORINGSSL_function_hit+3(%rip)
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
gcm_gmult_ssse3:
.cfi_startproc

_CET_ENDBR
movdqu (%rdi),%xmm0
movdqa .Lreverse_bytes(%rip),%xmm10
movdqa .Llow4_mask(%rip),%xmm2
Expand Down Expand Up @@ -207,6 +208,7 @@ gcm_gmult_ssse3:
gcm_ghash_ssse3:
.cfi_startproc

_CET_ENDBR
movdqu (%rdi),%xmm0
movdqa .Lreverse_bytes(%rip),%xmm10
movdqa .Llow4_mask(%rip),%xmm11
Expand Down
6 changes: 6 additions & 0 deletions generated-src/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
gcm_init_clmul:
.cfi_startproc

_CET_ENDBR
.L_init_clmul:
movdqu (%rsi),%xmm2
pshufd $78,%xmm2,%xmm2
Expand Down Expand Up @@ -174,6 +175,7 @@ gcm_init_clmul:
.align 16
gcm_gmult_clmul:
.cfi_startproc
_CET_ENDBR
.L_gmult_clmul:
movdqu (%rdi),%xmm0
movdqa .Lbswap_mask(%rip),%xmm5
Expand Down Expand Up @@ -229,6 +231,7 @@ gcm_gmult_clmul:
gcm_ghash_clmul:
.cfi_startproc

_CET_ENDBR
.L_ghash_clmul:
movdqa .Lbswap_mask(%rip),%xmm10

Expand Down Expand Up @@ -617,6 +620,7 @@ gcm_ghash_clmul:
.align 32
gcm_init_avx:
.cfi_startproc
_CET_ENDBR
vzeroupper

vmovdqu (%rsi),%xmm2
Expand Down Expand Up @@ -728,6 +732,7 @@ gcm_init_avx:
.align 32
gcm_gmult_avx:
.cfi_startproc
_CET_ENDBR
jmp .L_gmult_clmul
.cfi_endproc
.size gcm_gmult_avx,.-gcm_gmult_avx
Expand All @@ -737,6 +742,7 @@ gcm_gmult_avx:
.align 32
gcm_ghash_avx:
.cfi_startproc
_CET_ENDBR
vzeroupper

vmovdqu (%rdi),%xmm10
Expand Down
1 change: 1 addition & 0 deletions generated-src/linux-x86_64/crypto/fipsmodule/md5-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
.type md5_block_asm_data_order,@function
md5_block_asm_data_order:
.cfi_startproc
_CET_ENDBR
pushq %rbp
.cfi_adjust_cfa_offset 8
.cfi_offset rbp,-16
Expand Down
Loading

0 comments on commit dc167d0

Please sign in to comment.