Skip to content

Commit

Permalink
build: update relic autoconf annotations and make definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Oct 4, 2024
1 parent 6a0332d commit e6c65c3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
16 changes: 13 additions & 3 deletions Makefile.relic.include
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ BN_SOURCES = \
depends/relic/src/bn/relic_bn_factor.c \
depends/relic/src/bn/relic_bn_gcd.c \
depends/relic/src/bn/relic_bn_inv.c \
depends/relic/src/bn/relic_bn_lag.c \
depends/relic/src/bn/relic_bn_lcm.c \
depends/relic/src/bn/relic_bn_mem.c \
depends/relic/src/bn/relic_bn_mod.c \
Expand All @@ -83,6 +84,7 @@ FP_SOURCES = \
depends/relic/src/fp/relic_fp_mul.c \
depends/relic/src/fp/relic_fp_param.c \
depends/relic/src/fp/relic_fp_prime.c \
depends/relic/src/fp/relic_fp_smb.c \
depends/relic/src/fp/relic_fp_rdc.c \
depends/relic/src/fp/relic_fp_shift.c \
depends/relic/src/fp/relic_fp_sqr.c \
Expand Down Expand Up @@ -271,6 +273,7 @@ MD_SOURCES = \

EXTRA_DIST += \
depends/relic/src/arch/relic_arch_arm.c \
depends/relic/src/arch/relic_arch_a64.c \
depends/relic/src/arch/relic_arch_none.c \
depends/relic/src/arch/relic_arch_x64.c \
depends/relic/src/arch/relic_arch_x86.c
Expand All @@ -296,7 +299,8 @@ RELIC_SOURCES += $(BN_SOURCES) \
depends/relic/src/low/easy/relic_bn_mod_low.c \
depends/relic/src/low/easy/relic_bn_mul_low.c \
depends/relic/src/low/easy/relic_bn_shift_low.c \
depends/relic/src/low/easy/relic_bn_sqr_low.c
depends/relic/src/low/easy/relic_bn_sqr_low.c \
depends/relic/src/low/easy/relic_fp_smb_low.c
endif

if WITH_FP
Expand Down Expand Up @@ -427,12 +431,17 @@ RELIC_SOURCES += \
depends/relic/src/cp/relic_cp_ibe.c \
depends/relic/src/cp/relic_cp_mklhs.c \
depends/relic/src/cp/relic_cp_mpss.c \
depends/relic/src/cp/relic_cp_pbpsi.c \
depends/relic/src/cp/relic_cp_pcdel.c \
depends/relic/src/cp/relic_cp_phpe.c \
depends/relic/src/cp/relic_cp_pok.c \
depends/relic/src/cp/relic_cp_pss.c \
depends/relic/src/cp/relic_cp_rabin.c \
depends/relic/src/cp/relic_cp_rsa.c \
depends/relic/src/cp/relic_cp_rsapsi.c \
depends/relic/src/cp/relic_cp_shipsi.c \
depends/relic/src/cp/relic_cp_shpe.c \
depends/relic/src/cp/relic_cp_smlers.c \
depends/relic/src/cp/relic_cp_sok.c \
depends/relic/src/cp/relic_cp_sokaka.c \
depends/relic/src/cp/relic_cp_vbnn.c \
Expand All @@ -454,8 +463,9 @@ endif

if WITH_MPC
RELIC_SOURCES += \
depends/relic/src/mpc/relic_mt_mpc.c \
depends/relic/src/mpc/relic_pc_mpc.c
depends/relic/src/mpc/relic_mpc_sss.c \
depends/relic/src/mpc/relic_mpc_mt.c \
depends/relic/src/mpc/relic_mpc_pc.c
endif

librelic_la_SOURCES = \
Expand Down
24 changes: 13 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ fi
dnl Define enum mappings for relic config
AC_DEFINE([RLC_VERSION], ["0.5.0"], [Relic Version])

dnl dashbls: Library processor architecture
dnl Relic: Library processor architecture
AC_DEFINE([AVR], [1], [Atmel AVR ATMega128 8-bit architecture.])
AC_DEFINE([MSP], [2], [MSP430 16-bit architecture.])
AC_DEFINE([ARM], [3], [ARM 32-bit architecture.])
AC_DEFINE([X86], [4], [Intel x86-compatible 32-bit architecture.])
AC_DEFINE([X64], [5], [AMD64-compatible 64-bit architecture.])
AC_DEFINE([A64], [4], [ARM 64-bit architecture.])
AC_DEFINE([X86], [5], [Intel x86-compatible 32-bit architecture.])
AC_DEFINE([X64], [6], [AMD64-compatible 64-bit architecture.])

dnl Relic: Generic options
AC_DEFINE([RELIC_NONE], [0], [Unknown or unrecognized parameter.])
Expand Down Expand Up @@ -247,11 +248,11 @@ AC_DEFINE([PTHREAD], [2], [POSIX multithreading support.])
dnl Relic: Supported operating systems
AC_DEFINE([LINUX], [1], [GNU/Linux operating system.])
AC_DEFINE([FREEBSD], [2], [FreeBSD operating system.])
AC_DEFINE([MACOSX], [3], [MacOS operating system.])
AC_DEFINE([WINDOWS], [4], [Windows operating system.])
AC_DEFINE([DROID], [5], [Android operating system.])
AC_DEFINE([DUINO], [6], [Arduino platform.])
dnl AC_DEFINE([OPENBSD], [7], [OpenBSD operating system.])
AC_DEFINE([NETBSD], [3], [NetBSD operating system.])
AC_DEFINE([MACOSX], [4], [MacOS operating system.])
AC_DEFINE([WINDOWS], [5], [Windows operating system.])
AC_DEFINE([DROID], [6], [Android operating system.])
AC_DEFINE([DUINO], [7], [Arduino platform.])

dnl Relic: Supported timers
AC_DEFINE([HREAL], [1], [Per-process high-resolution timer.])
Expand All @@ -273,8 +274,8 @@ AC_DEFINE([DOUBLE], [3], [A multiple precision integer can store the result of

dnl Relic (BN): Greatest Common Divisor
dnl AC_DEFINE([BASIC], [1], [Euclid's standard GCD algorithm.])
AC_DEFINE([LEHME], [2], [Lehmer's fast GCD Algorithm.])
AC_DEFINE([STEIN], [3], [Stein's binary GCD Algorithm.])
dnl AC_DEFINE([BINAR], [2], [Binary GCD algorithm.])
AC_DEFINE([LEHME], [3], [Lehmer's fast GCD Algorithm.])

dnl Relic (BN): Integer multiplication
dnl AC_DEFINE([BASIC], [1], [Schoolbook multiplication.])
Expand Down Expand Up @@ -654,14 +655,15 @@ AC_DEFINE(BN_GCD, BASIC, Chosen multiple precision greatest common divisor metho
AC_DEFINE(BN_GEN, BASIC, Chosen prime generation algorithm.)

AC_DEFINE(FP_PRIME, 381, Prime field size in bits.)
AC_DEFINE(FP_METHD, "INTEG;INTEG;INTEG;MONTY;LOWER;SLIDE", Prime field arithmetic method.)
AC_DEFINE(FP_METHD, "INTEG;INTEG;INTEG;MONTY;MONTY;JMPDS;SLIDE", Prime field arithmetic method.)
AC_DEFINE(FP_KARAT, 0, Number of Karatsuba steps.)
AC_DEFINE(FP_WIDTH, 4, Width of window processing for exponentiation methods.)
AC_DEFINE(FP_ADD, INTEG, Chosen prime field multiplication method.)
AC_DEFINE(FP_MUL, INTEG, Chosen prime field multiplication method.)
AC_DEFINE(FP_SQR, INTEG, Chosen prime field multiplication method.)
AC_DEFINE(FP_RDC, MONTY, Chosen prime field reduction method.)
AC_DEFINE(FP_INV, LOWER, Chosen prime field inversion method.)
AC_DEFINE(FP_SMB, JMPDS, Chosen prime field Legendre symbol.)
AC_DEFINE(FP_EXP, SLIDE, Chosen multiple precision modular exponentiation method.)

AC_DEFINE(FPX_METHD, "INTEG;INTEG;LAZYR", Prime extension field arithmetic method.)
Expand Down

0 comments on commit e6c65c3

Please sign in to comment.