Commit 08a51624 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Roll src/third_party/boringssl/src 384d0eaf1..e6eef1ca1

https://boringssl.googlesource.com/boringssl/+log/384d0eaf1930af1ebc47eda751f0c78dfcba1c03..e6eef1ca16a022e476bbaedffef044597cfc8f4b

Bug: none
Change-Id: I5bab6b11ebe76cf162d8b8ed6eeccd0f10d6c818
Reviewed-on: https://chromium-review.googlesource.com/c/1336209
Commit-Queue: Steven Valdez <svaldez@chromium.org>
Reviewed-by: default avatarSteven Valdez <svaldez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608805}
parent b9baaacd
......@@ -143,7 +143,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling BoringSSL
# and whatever else without interference from each other.
'boringssl_revision': '384d0eaf1930af1ebc47eda751f0c78dfcba1c03',
'boringssl_revision': 'e6eef1ca16a022e476bbaedffef044597cfc8f4b',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling google-toolbox-for-mac
# and whatever else without interference from each other.
......
......@@ -465,6 +465,7 @@ crypto_sources_linux_x86_64 = [
"linux-x86_64/crypto/fipsmodule/ghash-x86_64.S",
"linux-x86_64/crypto/fipsmodule/md5-x86_64.S",
"linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S",
"linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S",
"linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S",
"linux-x86_64/crypto/fipsmodule/rsaz-avx2.S",
"linux-x86_64/crypto/fipsmodule/sha1-x86_64.S",
......@@ -501,6 +502,7 @@ crypto_sources_mac_x86_64 = [
"mac-x86_64/crypto/fipsmodule/ghash-x86_64.S",
"mac-x86_64/crypto/fipsmodule/md5-x86_64.S",
"mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S",
"mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S",
"mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S",
"mac-x86_64/crypto/fipsmodule/rsaz-avx2.S",
"mac-x86_64/crypto/fipsmodule/sha1-x86_64.S",
......@@ -537,6 +539,7 @@ crypto_sources_win_x86_64 = [
"win-x86_64/crypto/fipsmodule/ghash-x86_64.asm",
"win-x86_64/crypto/fipsmodule/md5-x86_64.asm",
"win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm",
"win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm",
"win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm",
"win-x86_64/crypto/fipsmodule/rsaz-avx2.asm",
"win-x86_64/crypto/fipsmodule/sha1-x86_64.asm",
......
This diff is collapsed.
......@@ -19,39 +19,39 @@
#include <openssl/type_check.h>
OPENSSL_COMPILE_ASSERT(ERR_LIB_NONE == 1, library_values_changed_1);
OPENSSL_COMPILE_ASSERT(ERR_LIB_SYS == 2, library_values_changed_2);
OPENSSL_COMPILE_ASSERT(ERR_LIB_BN == 3, library_values_changed_3);
OPENSSL_COMPILE_ASSERT(ERR_LIB_RSA == 4, library_values_changed_4);
OPENSSL_COMPILE_ASSERT(ERR_LIB_DH == 5, library_values_changed_5);
OPENSSL_COMPILE_ASSERT(ERR_LIB_EVP == 6, library_values_changed_6);
OPENSSL_COMPILE_ASSERT(ERR_LIB_BUF == 7, library_values_changed_7);
OPENSSL_COMPILE_ASSERT(ERR_LIB_OBJ == 8, library_values_changed_8);
OPENSSL_COMPILE_ASSERT(ERR_LIB_PEM == 9, library_values_changed_9);
OPENSSL_COMPILE_ASSERT(ERR_LIB_DSA == 10, library_values_changed_10);
OPENSSL_COMPILE_ASSERT(ERR_LIB_X509 == 11, library_values_changed_11);
OPENSSL_COMPILE_ASSERT(ERR_LIB_ASN1 == 12, library_values_changed_12);
OPENSSL_COMPILE_ASSERT(ERR_LIB_CONF == 13, library_values_changed_13);
OPENSSL_COMPILE_ASSERT(ERR_LIB_CRYPTO == 14, library_values_changed_14);
OPENSSL_COMPILE_ASSERT(ERR_LIB_EC == 15, library_values_changed_15);
OPENSSL_COMPILE_ASSERT(ERR_LIB_SSL == 16, library_values_changed_16);
OPENSSL_COMPILE_ASSERT(ERR_LIB_BIO == 17, library_values_changed_17);
OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS7 == 18, library_values_changed_18);
OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS8 == 19, library_values_changed_19);
OPENSSL_COMPILE_ASSERT(ERR_LIB_X509V3 == 20, library_values_changed_20);
OPENSSL_COMPILE_ASSERT(ERR_LIB_RAND == 21, library_values_changed_21);
OPENSSL_COMPILE_ASSERT(ERR_LIB_ENGINE == 22, library_values_changed_22);
OPENSSL_COMPILE_ASSERT(ERR_LIB_OCSP == 23, library_values_changed_23);
OPENSSL_COMPILE_ASSERT(ERR_LIB_UI == 24, library_values_changed_24);
OPENSSL_COMPILE_ASSERT(ERR_LIB_COMP == 25, library_values_changed_25);
OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDSA == 26, library_values_changed_26);
OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDH == 27, library_values_changed_27);
OPENSSL_COMPILE_ASSERT(ERR_LIB_HMAC == 28, library_values_changed_28);
OPENSSL_COMPILE_ASSERT(ERR_LIB_DIGEST == 29, library_values_changed_29);
OPENSSL_COMPILE_ASSERT(ERR_LIB_CIPHER == 30, library_values_changed_30);
OPENSSL_COMPILE_ASSERT(ERR_LIB_HKDF == 31, library_values_changed_31);
OPENSSL_COMPILE_ASSERT(ERR_LIB_USER == 32, library_values_changed_32);
OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == 33, library_values_changed_num);
OPENSSL_STATIC_ASSERT(ERR_LIB_NONE == 1, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_SYS == 2, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_BN == 3, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_RSA == 4, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_DH == 5, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_EVP == 6, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_BUF == 7, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_OBJ == 8, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_PEM == 9, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_DSA == 10, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_X509 == 11, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_ASN1 == 12, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_CONF == 13, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_CRYPTO == 14, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_EC == 15, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_SSL == 16, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_BIO == 17, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS7 == 18, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS8 == 19, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_X509V3 == 20, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_RAND == 21, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_ENGINE == 22, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_OCSP == 23, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_UI == 24, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_COMP == 25, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_ECDSA == 26, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_ECDH == 27, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_HMAC == 28, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_DIGEST == 29, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_CIPHER == 30, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_HKDF == 31, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_LIB_USER == 32, "library value changed");
OPENSSL_STATIC_ASSERT(ERR_NUM_LIBS == 33, "number of libraries changed");
const uint32_t kOpenSSLReasonValues[] = {
0xc32083a,
......
#if defined(__has_feature)
#if __has_feature(memory_sanitizer) && !defined(OPENSSL_NO_ASM)
#define OPENSSL_NO_ASM
#endif
#endif
#if defined(__x86_64__) && !defined(OPENSSL_NO_ASM)
#if defined(BORINGSSL_PREFIX)
#include <boringssl_prefix_symbols_asm.h>
#endif
.text
.type beeu_mod_inverse_vartime,@function
.hidden beeu_mod_inverse_vartime
.globl beeu_mod_inverse_vartime
.hidden beeu_mod_inverse_vartime
.align 32
beeu_mod_inverse_vartime:
.cfi_startproc
pushq %rbp
.cfi_adjust_cfa_offset 8
.cfi_offset rbp,-16
movq %rsp,%rbp
.cfi_def_cfa_register rbp
pushq %r12
.cfi_offset r12,-24
pushq %r13
.cfi_offset r13,-32
pushq %r14
.cfi_offset r14,-40
pushq %r15
.cfi_offset r15,-48
pushq %rbx
.cfi_offset rbx,-56
pushq %rsi
.cfi_offset rsi,-64
subq $80,%rsp
movq %rdi,0(%rsp)
movq $1,%r8
xorq %r9,%r9
xorq %r10,%r10
xorq %r11,%r11
xorq %rdi,%rdi
xorq %r12,%r12
xorq %r13,%r13
xorq %r14,%r14
xorq %r15,%r15
xorq %rbp,%rbp
vmovdqu 0(%rsi),%xmm0
vmovdqu 16(%rsi),%xmm1
vmovdqu %xmm0,48(%rsp)
vmovdqu %xmm1,64(%rsp)
vmovdqu 0(%rdx),%xmm0
vmovdqu 16(%rdx),%xmm1
vmovdqu %xmm0,16(%rsp)
vmovdqu %xmm1,32(%rsp)
.Lbeeu_loop:
xorq %rbx,%rbx
orq 48(%rsp),%rbx
orq 56(%rsp),%rbx
orq 64(%rsp),%rbx
orq 72(%rsp),%rbx
jz .Lbeeu_loop_end
movq $1,%rcx
.Lbeeu_shift_loop_XB:
movq %rcx,%rbx
andq 48(%rsp),%rbx
jnz .Lbeeu_shift_loop_end_XB
movq $1,%rbx
andq %r8,%rbx
jz .Lshift1_0
addq 0(%rdx),%r8
adcq 8(%rdx),%r9
adcq 16(%rdx),%r10
adcq 24(%rdx),%r11
adcq $0,%rdi
.Lshift1_0:
shrdq $1,%r9,%r8
shrdq $1,%r10,%r9
shrdq $1,%r11,%r10
shrdq $1,%rdi,%r11
shrq $1,%rdi
shlq $1,%rcx
cmpq $0x8000000,%rcx
jne .Lbeeu_shift_loop_XB
.Lbeeu_shift_loop_end_XB:
bsfq %rcx,%rcx
testq %rcx,%rcx
jz .Lbeeu_no_shift_XB
movq 8+48(%rsp),%rax
movq 16+48(%rsp),%rbx
movq 24+48(%rsp),%rsi
shrdq %cl,%rax,0+48(%rsp)
shrdq %cl,%rbx,8+48(%rsp)
shrdq %cl,%rsi,16+48(%rsp)
shrq %cl,%rsi
movq %rsi,24+48(%rsp)
.Lbeeu_no_shift_XB:
movq $1,%rcx
.Lbeeu_shift_loop_YA:
movq %rcx,%rbx
andq 16(%rsp),%rbx
jnz .Lbeeu_shift_loop_end_YA
movq $1,%rbx
andq %r12,%rbx
jz .Lshift1_1
addq 0(%rdx),%r12
adcq 8(%rdx),%r13
adcq 16(%rdx),%r14
adcq 24(%rdx),%r15
adcq $0,%rbp
.Lshift1_1:
shrdq $1,%r13,%r12
shrdq $1,%r14,%r13
shrdq $1,%r15,%r14
shrdq $1,%rbp,%r15
shrq $1,%rbp
shlq $1,%rcx
cmpq $0x8000000,%rcx
jne .Lbeeu_shift_loop_YA
.Lbeeu_shift_loop_end_YA:
bsfq %rcx,%rcx
testq %rcx,%rcx
jz .Lbeeu_no_shift_YA
movq 8+16(%rsp),%rax
movq 16+16(%rsp),%rbx
movq 24+16(%rsp),%rsi
shrdq %cl,%rax,0+16(%rsp)
shrdq %cl,%rbx,8+16(%rsp)
shrdq %cl,%rsi,16+16(%rsp)
shrq %cl,%rsi
movq %rsi,24+16(%rsp)
.Lbeeu_no_shift_YA:
movq 48(%rsp),%rax
movq 56(%rsp),%rbx
movq 64(%rsp),%rsi
movq 72(%rsp),%rcx
subq 16(%rsp),%rax
sbbq 24(%rsp),%rbx
sbbq 32(%rsp),%rsi
sbbq 40(%rsp),%rcx
jnc .Lbeeu_B_bigger_than_A
movq 16(%rsp),%rax
movq 24(%rsp),%rbx
movq 32(%rsp),%rsi
movq 40(%rsp),%rcx
subq 48(%rsp),%rax
sbbq 56(%rsp),%rbx
sbbq 64(%rsp),%rsi
sbbq 72(%rsp),%rcx
movq %rax,16(%rsp)
movq %rbx,24(%rsp)
movq %rsi,32(%rsp)
movq %rcx,40(%rsp)
addq %r8,%r12
adcq %r9,%r13
adcq %r10,%r14
adcq %r11,%r15
adcq %rdi,%rbp
jmp .Lbeeu_loop
.Lbeeu_B_bigger_than_A:
movq %rax,48(%rsp)
movq %rbx,56(%rsp)
movq %rsi,64(%rsp)
movq %rcx,72(%rsp)
addq %r12,%r8
adcq %r13,%r9
adcq %r14,%r10
adcq %r15,%r11
adcq %rbp,%rdi
jmp .Lbeeu_loop
.Lbeeu_loop_end:
movq 16(%rsp),%rbx
subq $1,%rbx
orq 24(%rsp),%rbx
orq 32(%rsp),%rbx
orq 40(%rsp),%rbx
jnz .Lbeeu_err
movq 0(%rdx),%r8
movq 8(%rdx),%r9
movq 16(%rdx),%r10
movq 24(%rdx),%r11
xorq %rdi,%rdi
.Lbeeu_reduction_loop:
movq %r12,16(%rsp)
movq %r13,24(%rsp)
movq %r14,32(%rsp)
movq %r15,40(%rsp)
movq %rbp,48(%rsp)
subq %r8,%r12
sbbq %r9,%r13
sbbq %r10,%r14
sbbq %r11,%r15
sbbq $0,%rbp
cmovcq 16(%rsp),%r12
cmovcq 24(%rsp),%r13
cmovcq 32(%rsp),%r14
cmovcq 40(%rsp),%r15
jnc .Lbeeu_reduction_loop
subq %r12,%r8
sbbq %r13,%r9
sbbq %r14,%r10
sbbq %r15,%r11
.Lbeeu_save:
movq 0(%rsp),%rdi
movq %r8,0(%rdi)
movq %r9,8(%rdi)
movq %r10,16(%rdi)
movq %r11,24(%rdi)
movq $1,%rax
jmp .Lbeeu_finish
.Lbeeu_err:
xorq %rax,%rax
.Lbeeu_finish:
addq $80,%rsp
popq %rsi
.cfi_restore rsi
popq %rbx
.cfi_restore rbx
popq %r15
.cfi_restore r15
popq %r14
.cfi_restore r14
popq %r13
.cfi_restore r13
popq %r12
.cfi_restore r12
popq %rbp
.cfi_restore rbp
.cfi_def_cfa rsp, 8
.cfi_endproc
.byte 0xf3,0xc3
.size beeu_mod_inverse_vartime, .-beeu_mod_inverse_vartime
#endif
#if defined(__has_feature)
#if __has_feature(memory_sanitizer) && !defined(OPENSSL_NO_ASM)
#define OPENSSL_NO_ASM
#endif
#endif
#if defined(__x86_64__) && !defined(OPENSSL_NO_ASM)
#if defined(BORINGSSL_PREFIX)
#include <boringssl_prefix_symbols_asm.h>
#endif
.text
.private_extern _beeu_mod_inverse_vartime
.globl _beeu_mod_inverse_vartime
.private_extern _beeu_mod_inverse_vartime
.p2align 5
_beeu_mod_inverse_vartime:
pushq %rbp
movq %rsp,%rbp
pushq %r12
pushq %r13
pushq %r14
pushq %r15
pushq %rbx
pushq %rsi
subq $80,%rsp
movq %rdi,0(%rsp)
movq $1,%r8
xorq %r9,%r9
xorq %r10,%r10
xorq %r11,%r11
xorq %rdi,%rdi
xorq %r12,%r12
xorq %r13,%r13
xorq %r14,%r14
xorq %r15,%r15
xorq %rbp,%rbp
vmovdqu 0(%rsi),%xmm0
vmovdqu 16(%rsi),%xmm1
vmovdqu %xmm0,48(%rsp)
vmovdqu %xmm1,64(%rsp)
vmovdqu 0(%rdx),%xmm0
vmovdqu 16(%rdx),%xmm1
vmovdqu %xmm0,16(%rsp)
vmovdqu %xmm1,32(%rsp)
L$beeu_loop:
xorq %rbx,%rbx
orq 48(%rsp),%rbx
orq 56(%rsp),%rbx
orq 64(%rsp),%rbx
orq 72(%rsp),%rbx
jz L$beeu_loop_end
movq $1,%rcx
L$beeu_shift_loop_XB:
movq %rcx,%rbx
andq 48(%rsp),%rbx
jnz L$beeu_shift_loop_end_XB
movq $1,%rbx
andq %r8,%rbx
jz L$shift1_0
addq 0(%rdx),%r8
adcq 8(%rdx),%r9
adcq 16(%rdx),%r10
adcq 24(%rdx),%r11
adcq $0,%rdi
L$shift1_0:
shrdq $1,%r9,%r8
shrdq $1,%r10,%r9
shrdq $1,%r11,%r10
shrdq $1,%rdi,%r11
shrq $1,%rdi
shlq $1,%rcx
cmpq $0x8000000,%rcx
jne L$beeu_shift_loop_XB
L$beeu_shift_loop_end_XB:
bsfq %rcx,%rcx
testq %rcx,%rcx
jz L$beeu_no_shift_XB
movq 8+48(%rsp),%rax
movq 16+48(%rsp),%rbx
movq 24+48(%rsp),%rsi
shrdq %cl,%rax,0+48(%rsp)
shrdq %cl,%rbx,8+48(%rsp)
shrdq %cl,%rsi,16+48(%rsp)
shrq %cl,%rsi
movq %rsi,24+48(%rsp)
L$beeu_no_shift_XB:
movq $1,%rcx
L$beeu_shift_loop_YA:
movq %rcx,%rbx
andq 16(%rsp),%rbx
jnz L$beeu_shift_loop_end_YA
movq $1,%rbx
andq %r12,%rbx
jz L$shift1_1
addq 0(%rdx),%r12
adcq 8(%rdx),%r13
adcq 16(%rdx),%r14
adcq 24(%rdx),%r15
adcq $0,%rbp
L$shift1_1:
shrdq $1,%r13,%r12
shrdq $1,%r14,%r13
shrdq $1,%r15,%r14
shrdq $1,%rbp,%r15
shrq $1,%rbp
shlq $1,%rcx
cmpq $0x8000000,%rcx
jne L$beeu_shift_loop_YA
L$beeu_shift_loop_end_YA:
bsfq %rcx,%rcx
testq %rcx,%rcx
jz L$beeu_no_shift_YA
movq 8+16(%rsp),%rax
movq 16+16(%rsp),%rbx
movq 24+16(%rsp),%rsi
shrdq %cl,%rax,0+16(%rsp)
shrdq %cl,%rbx,8+16(%rsp)
shrdq %cl,%rsi,16+16(%rsp)
shrq %cl,%rsi
movq %rsi,24+16(%rsp)
L$beeu_no_shift_YA:
movq 48(%rsp),%rax
movq 56(%rsp),%rbx
movq 64(%rsp),%rsi
movq 72(%rsp),%rcx
subq 16(%rsp),%rax
sbbq 24(%rsp),%rbx
sbbq 32(%rsp),%rsi
sbbq 40(%rsp),%rcx
jnc L$beeu_B_bigger_than_A
movq 16(%rsp),%rax
movq 24(%rsp),%rbx
movq 32(%rsp),%rsi
movq 40(%rsp),%rcx
subq 48(%rsp),%rax
sbbq 56(%rsp),%rbx
sbbq 64(%rsp),%rsi
sbbq 72(%rsp),%rcx
movq %rax,16(%rsp)
movq %rbx,24(%rsp)
movq %rsi,32(%rsp)
movq %rcx,40(%rsp)
addq %r8,%r12
adcq %r9,%r13
adcq %r10,%r14
adcq %r11,%r15
adcq %rdi,%rbp
jmp L$beeu_loop
L$beeu_B_bigger_than_A:
movq %rax,48(%rsp)
movq %rbx,56(%rsp)
movq %rsi,64(%rsp)
movq %rcx,72(%rsp)
addq %r12,%r8
adcq %r13,%r9
adcq %r14,%r10
adcq %r15,%r11
adcq %rbp,%rdi
jmp L$beeu_loop
L$beeu_loop_end:
movq 16(%rsp),%rbx
subq $1,%rbx
orq 24(%rsp),%rbx
orq 32(%rsp),%rbx
orq 40(%rsp),%rbx
jnz L$beeu_err
movq 0(%rdx),%r8
movq 8(%rdx),%r9
movq 16(%rdx),%r10
movq 24(%rdx),%r11
xorq %rdi,%rdi
L$beeu_reduction_loop:
movq %r12,16(%rsp)
movq %r13,24(%rsp)
movq %r14,32(%rsp)
movq %r15,40(%rsp)
movq %rbp,48(%rsp)
subq %r8,%r12
sbbq %r9,%r13
sbbq %r10,%r14
sbbq %r11,%r15
sbbq $0,%rbp
cmovcq 16(%rsp),%r12
cmovcq 24(%rsp),%r13
cmovcq 32(%rsp),%r14
cmovcq 40(%rsp),%r15
jnc L$beeu_reduction_loop
subq %r12,%r8
sbbq %r13,%r9
sbbq %r14,%r10
sbbq %r15,%r11
L$beeu_save:
movq 0(%rsp),%rdi
movq %r8,0(%rdi)
movq %r9,8(%rdi)
movq %r10,16(%rdi)
movq %r11,24(%rdi)
movq $1,%rax
jmp L$beeu_finish
L$beeu_err:
xorq %rax,%rax
L$beeu_finish:
addq $80,%rsp
popq %rsi
popq %rbx
popq %r15
popq %r14
popq %r13
popq %r12
popq %rbp
.byte 0xf3,0xc3
#endif
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
%ifdef BORINGSSL_PREFIX
%include "boringssl_prefix_symbols_nasm.inc"
%endif
section .text code align=64
global beeu_mod_inverse_vartime
ALIGN 32
beeu_mod_inverse_vartime:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_beeu_mod_inverse_vartime:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
push rbp
mov rbp,rsp
push r12
push r13
push r14
push r15
push rbx
push rsi
sub rsp,80
mov QWORD[rsp],rdi
mov r8,1
xor r9,r9
xor r10,r10
xor r11,r11
xor rdi,rdi
xor r12,r12
xor r13,r13
xor r14,r14
xor r15,r15
xor rbp,rbp
vmovdqu xmm0,XMMWORD[rsi]
vmovdqu xmm1,XMMWORD[16+rsi]
vmovdqu XMMWORD[48+rsp],xmm0
vmovdqu XMMWORD[64+rsp],xmm1
vmovdqu xmm0,XMMWORD[rdx]
vmovdqu xmm1,XMMWORD[16+rdx]
vmovdqu XMMWORD[16+rsp],xmm0
vmovdqu XMMWORD[32+rsp],xmm1
$L$beeu_loop:
xor rbx,rbx
or rbx,QWORD[48+rsp]
or rbx,QWORD[56+rsp]
or rbx,QWORD[64+rsp]
or rbx,QWORD[72+rsp]
jz NEAR $L$beeu_loop_end
mov rcx,1
$L$beeu_shift_loop_XB:
mov rbx,rcx
and rbx,QWORD[48+rsp]
jnz NEAR $L$beeu_shift_loop_end_XB
mov rbx,1
and rbx,r8
jz NEAR $L$shift1_0
add r8,QWORD[rdx]
adc r9,QWORD[8+rdx]
adc r10,QWORD[16+rdx]
adc r11,QWORD[24+rdx]
adc rdi,0
$L$shift1_0:
shrd r8,r9,1
shrd r9,r10,1
shrd r10,r11,1
shrd r11,rdi,1
shr rdi,1
shl rcx,1
cmp rcx,0x8000000
jne NEAR $L$beeu_shift_loop_XB
$L$beeu_shift_loop_end_XB:
bsf rcx,rcx
test rcx,rcx
jz NEAR $L$beeu_no_shift_XB
mov rax,QWORD[((8+48))+rsp]
mov rbx,QWORD[((16+48))+rsp]
mov rsi,QWORD[((24+48))+rsp]
shrd QWORD[((0+48))+rsp],rax,cl
shrd QWORD[((8+48))+rsp],rbx,cl
shrd QWORD[((16+48))+rsp],rsi,cl
shr rsi,cl
mov QWORD[((24+48))+rsp],rsi
$L$beeu_no_shift_XB:
mov rcx,1
$L$beeu_shift_loop_YA:
mov rbx,rcx
and rbx,QWORD[16+rsp]
jnz NEAR $L$beeu_shift_loop_end_YA
mov rbx,1
and rbx,r12
jz NEAR $L$shift1_1
add r12,QWORD[rdx]
adc r13,QWORD[8+rdx]
adc r14,QWORD[16+rdx]
adc r15,QWORD[24+rdx]
adc rbp,0
$L$shift1_1:
shrd r12,r13,1
shrd r13,r14,1
shrd r14,r15,1
shrd r15,rbp,1
shr rbp,1
shl rcx,1
cmp rcx,0x8000000
jne NEAR $L$beeu_shift_loop_YA
$L$beeu_shift_loop_end_YA:
bsf rcx,rcx
test rcx,rcx
jz NEAR $L$beeu_no_shift_YA
mov rax,QWORD[((8+16))+rsp]
mov rbx,QWORD[((16+16))+rsp]
mov rsi,QWORD[((24+16))+rsp]
shrd QWORD[((0+16))+rsp],rax,cl
shrd QWORD[((8+16))+rsp],rbx,cl
shrd QWORD[((16+16))+rsp],rsi,cl
shr rsi,cl
mov QWORD[((24+16))+rsp],rsi
$L$beeu_no_shift_YA:
mov rax,QWORD[48+rsp]
mov rbx,QWORD[56+rsp]
mov rsi,QWORD[64+rsp]
mov rcx,QWORD[72+rsp]
sub rax,QWORD[16+rsp]
sbb rbx,QWORD[24+rsp]
sbb rsi,QWORD[32+rsp]
sbb rcx,QWORD[40+rsp]
jnc NEAR $L$beeu_B_bigger_than_A
mov rax,QWORD[16+rsp]
mov rbx,QWORD[24+rsp]
mov rsi,QWORD[32+rsp]
mov rcx,QWORD[40+rsp]
sub rax,QWORD[48+rsp]
sbb rbx,QWORD[56+rsp]
sbb rsi,QWORD[64+rsp]
sbb rcx,QWORD[72+rsp]
mov QWORD[16+rsp],rax
mov QWORD[24+rsp],rbx
mov QWORD[32+rsp],rsi
mov QWORD[40+rsp],rcx
add r12,r8
adc r13,r9
adc r14,r10
adc r15,r11
adc rbp,rdi
jmp NEAR $L$beeu_loop
$L$beeu_B_bigger_than_A:
mov QWORD[48+rsp],rax
mov QWORD[56+rsp],rbx
mov QWORD[64+rsp],rsi
mov QWORD[72+rsp],rcx
add r8,r12
adc r9,r13
adc r10,r14
adc r11,r15
adc rdi,rbp
jmp NEAR $L$beeu_loop
$L$beeu_loop_end:
mov rbx,QWORD[16+rsp]
sub rbx,1
or rbx,QWORD[24+rsp]
or rbx,QWORD[32+rsp]
or rbx,QWORD[40+rsp]
jnz NEAR $L$beeu_err
mov r8,QWORD[rdx]
mov r9,QWORD[8+rdx]
mov r10,QWORD[16+rdx]
mov r11,QWORD[24+rdx]
xor rdi,rdi
$L$beeu_reduction_loop:
mov QWORD[16+rsp],r12
mov QWORD[24+rsp],r13
mov QWORD[32+rsp],r14
mov QWORD[40+rsp],r15
mov QWORD[48+rsp],rbp
sub r12,r8
sbb r13,r9
sbb r14,r10
sbb r15,r11
sbb rbp,0
cmovc r12,QWORD[16+rsp]
cmovc r13,QWORD[24+rsp]
cmovc r14,QWORD[32+rsp]
cmovc r15,QWORD[40+rsp]
jnc NEAR $L$beeu_reduction_loop
sub r8,r12
sbb r9,r13
sbb r10,r14
sbb r11,r15
$L$beeu_save:
mov rdi,QWORD[rsp]
mov QWORD[rdi],r8
mov QWORD[8+rdi],r9
mov QWORD[16+rdi],r10
mov QWORD[24+rdi],r11
mov rax,1
jmp NEAR $L$beeu_finish
$L$beeu_err:
xor rax,rax
$L$beeu_finish:
add rsp,80
pop rsi
pop rbx
pop r15
pop r14
pop r13
pop r12
pop rbp
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_beeu_mod_inverse_vartime:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment