Skip to content

Commit

Permalink
Merge branch 'main' into kss16
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Aug 22, 2023
2 parents b6d0c2f + 38737da commit 38ba1f5
Show file tree
Hide file tree
Showing 12 changed files with 13,625 additions and 12 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
=====

[![Project stats](https://www.openhub.net/p/relic-toolkit/widgets/project_thin_badge.gif)](https://www.openhub.net/p/relic-toolkit)
[![Travis Status](https://travis-ci.org/relic-toolkit/relic.svg?branch=main)](https://travis-ci.org/relic-toolkit/relic)
[![GHA Status](https://github.com/relic-toolkit/relic/actions/workflows/easy.yml/badge.svg)](https://github.com/relic-toolkit/relic/actions/workflows/easy.yml)
[![GHA Status](https://github.com/relic-toolkit/relic/actions/workflows/gmp.yml/badge.svg)](https://github.com/relic-toolkit/relic/actions/workflows/gmp.yml)
[![GHA Status](https://github.com/relic-toolkit/relic/actions/workflows/bls12-381.yml/badge.svg)](https://github.com/relic-toolkit/relic/actions/workflows/bls12-381.yml)
Expand Down
13 changes: 9 additions & 4 deletions cmake/arch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ if(WORD AND NOT WSIZE)
endif()

if(NOT WSIZE)
if(ARCH STREQUAL X86 OR ARCH STREQUAL "ARM")
set(AFLAGS "-m32")
set(WSIZE 32)
endif()
# Default is 64 bits.
set(WSIZE 64)
if(ARCH STREQUAL "X64" OR ARCH STREQUAL "A64")
set(AFLAGS "-m64")
set(WSIZE 64)
elseif(ARCH STREQUAL X86 OR ARCH STREQUAL "ARM")
set(AFLAGS "-m32")
set(WSIZE 32)
elseif(ARCH STREQUAL "MSP")
set(WSIZE 16)
elseif(ARCH STREQUAL "AVR")
set(WSIZE 8)
endif()
endif()

Expand Down
2 changes: 2 additions & 0 deletions include/relic_fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ enum {
NIST_409,
/** Hankerson's trinomial for genus 2 curves. */
TRINO_439,
/** Custom 511-bit fast reduction polynomial. */
TRINO_511,
/** NIST 571-bit fast reduction polynomial. */
NIST_571,
/** Square-root friendly 571-bit polynomial. */
Expand Down
6 changes: 6 additions & 0 deletions src/fb/relic_fb_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ void fb_param_set(int param) {
case TRINO_439:
fb_poly_set_trino(49);
break;
case TRINO_511:
fb_poly_set_trino(10);
break;
case SQRT_571:
fb_poly_set_penta(193, 185, 5);
break;
Expand Down Expand Up @@ -220,6 +223,9 @@ void fb_param_set_any(void) {
#elif FB_POLYN == 439
fb_param_set(TRINO_439);

#elif FB_POLYN == 511
fb_param_set(TRINO_511);

#elif FB_POLYN == 571
#ifdef FB_SQRTF
fb_param_set(SQRT_571);
Expand Down
19 changes: 12 additions & 7 deletions src/low/x64-asm-7l/relic_fp_add_low.s
Original file line number Diff line number Diff line change
Expand Up @@ -358,32 +358,37 @@ fp_negm_low:
or 32(%rsi), %r8
or 40(%rsi), %r8
or 48(%rsi), %r8
or 56(%rsi), %r8
or 64(%rsi), %r8
test %r8, %r8
cmovnz p0(%rip), %r8
cmovnz p1(%rip), %r9
cmovnz p2(%rip), %r10
cmovnz p3(%rip), %r11
cmovnz p4(%rip), %rbx
cmovnz p5(%rip), %rax
cmovnz p6(%rip), %rcx
cmovnz p1(%rip), %r9
cmovnz p2(%rip), %r10
cmovnz p3(%rip), %r11
cmovnz p4(%rip), %rbx
cmovnz p5(%rip),%rax
cmovnz p6(%rip),%rcx
subq 0(%rsi) , %r8
movq %r8 , 0(%rdi)
sbbq 8(%rsi) , %r9
movq %r9 , 8(%rdi)
sbbq 16(%rsi), %r10
movq %r10 , 16(%rdi)
movq %r10 , 16(%rdi)
sbbq 24(%rsi), %r11
movq %r11 , 24(%rdi)
movq %r11 , 24(%rdi)
sbbq 32(%rsi), %rbx
movq %rbx , 32(%rdi)
movq %rbx , 32(%rdi)
sbbq 40(%rsi), %rax
movq %rax , 40(%rdi)
movq %rax , 40(%rdi)
sbbq 48(%rsi), %rcx
movq %rcx , 48(%rdi)
movq %rcx , 48(%rdi)

pop %rbx
ret

fp_dbln_low:
movq 0(%rsi), %r8
Expand Down
Loading

0 comments on commit 38ba1f5

Please sign in to comment.