diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S index fabdf5b8..41c30548 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S @@ -41,6 +41,8 @@ movq %r9,16(%rdi) movq %rax,24(%rdi) movq %rsi,32(%rdi) mov %rdx,%rsi + +.p2align 4 ._loop: sub $1,%rsi mov %rcx,%rax @@ -154,6 +156,7 @@ and %rdx,%r10 movq %r10,32(%rdi) cmp $0,%rsi jne ._loop + movq %rcx,0(%rdi) movq %r8,8(%rdi) movq 0(%rsp),%r11 diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S index cf5d2c5c..500c8584 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S @@ -35,6 +35,8 @@ movq 32(%rsi),%rsi movq REDMASK51(%rip),%rax lea -18(%rax),%r10 mov $3,%r11 + +.p2align 4 ._reduceloop: mov %rdx,%r12 shr $51,%r12 @@ -59,6 +61,7 @@ imulq $19, %r12,%r12 add %r12,%rdx sub $1,%r11 ja ._reduceloop + mov $1,%r12 cmp %r10,%rdx cmovl %r11,%r12 diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S index 92ecac9b..00461b00 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S @@ -110,6 +110,8 @@ xorq 16(%rsi),%r8 xorq 24(%rsi),%r9 leaq 800(%rsp),%rsi mov $64,%rax + +.p2align 4 ._ladder_small_loop: mov %rdx,%r10 mov %rcx,%r11 @@ -136,6 +138,8 @@ sub $1,%rax jne ._ladder_small_loop mov $255,%rdx add $760,%rsi + +.p2align 4 ._ladder_loop: sub $1,%rdx vbroadcastss 0(%rsi),%xmm10 diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S index a400b2aa..c3094185 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S @@ -61,6 +61,8 @@ xorq 16(%rsi),%r8 xorq 24(%rsi),%r9 leaq 512(%rsp),%rsi mov $64,%rax + +.p2align 4 ._ladder_base_small_loop: mov %rdx,%r10 mov %rcx,%r11 @@ -87,6 +89,8 @@ sub $1,%rax jne ._ladder_base_small_loop mov $255,%rdx add $760,%rsi + +.p2align 4 ._ladder_base_loop: sub $1,%rdx vbroadcastss 0(%rsi),%xmm10