Skip to content

Commit

Permalink
Switch edwards25519 operations to divstep-based modular inverse
Browse files Browse the repository at this point in the history
This replaces the inlined variant of "bignum_modinv" with code from
"bignum_inv_p25519" in all "edwards25519_scalarmul*" functions.
Again, there are consequential changes related to the slightly
different amount of temporary storage needed by bignum_inv_p25519.
  • Loading branch information
jargh committed Nov 2, 2023
1 parent 73ec55a commit 7e7b18e
Show file tree
Hide file tree
Showing 23 changed files with 31,416 additions and 13,754 deletions.
8 changes: 4 additions & 4 deletions arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ curve25519/curve25519_x25519base.correct: curve25519/bignum_inv_p25519.o proofs/
curve25519/curve25519_x25519base_alt.correct: curve25519/bignum_inv_p25519.o proofs/curve25519_x25519base_alt.ml curve25519/curve25519_x25519base_alt.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/curve25519_x25519base_alt.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/curve25519_x25519base_byte.correct: curve25519/bignum_inv_p25519.o proofs/curve25519_x25519base_byte.ml curve25519/curve25519_x25519base_byte.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/curve25519_x25519base_byte.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/curve25519_x25519base_byte_alt.correct: curve25519/bignum_inv_p25519.o proofs/curve25519_x25519base_byte_alt.ml curve25519/curve25519_x25519base_byte_alt.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/curve25519_x25519base_byte_alt.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmulbase.correct: generic/bignum_modinv.o proofs/edwards25519_scalarmulbase.ml curve25519/edwards25519_scalarmulbase.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmulbase.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmulbase_alt.correct: generic/bignum_modinv.o proofs/edwards25519_scalarmulbase_alt.ml curve25519/edwards25519_scalarmulbase_alt.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmulbase_alt.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmuldouble.correct: generic/bignum_modinv.o proofs/edwards25519_scalarmuldouble.ml curve25519/edwards25519_scalarmuldouble.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmuldouble.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmuldouble_alt.correct: generic/bignum_modinv.o proofs/edwards25519_scalarmuldouble_alt.ml curve25519/edwards25519_scalarmuldouble_alt.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmuldouble_alt.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmulbase.correct: curve25519/bignum_inv_p25519.o proofs/edwards25519_scalarmulbase.ml curve25519/edwards25519_scalarmulbase.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmulbase.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmulbase_alt.correct: curve25519/bignum_inv_p25519.o proofs/edwards25519_scalarmulbase_alt.ml curve25519/edwards25519_scalarmulbase_alt.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmulbase_alt.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmuldouble.correct: curve25519/bignum_inv_p25519.o proofs/edwards25519_scalarmuldouble.ml curve25519/edwards25519_scalarmuldouble.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmuldouble.ml";;') | $(HOLLIGHT) 2>&1) >$@
curve25519/edwards25519_scalarmuldouble_alt.correct: curve25519/bignum_inv_p25519.o proofs/edwards25519_scalarmuldouble_alt.ml curve25519/edwards25519_scalarmuldouble_alt.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/edwards25519_scalarmuldouble_alt.ml";;') | $(HOLLIGHT) 2>&1) >$@
generic/bignum_modexp.correct: generic/bignum_amontifier.correct generic/bignum_amontmul.correct generic/bignum_demont.correct generic/bignum_mux.correct proofs/bignum_modexp.ml generic/bignum_modexp.o ; (cd ..; (echo 'loadt "arm/proofs/base.ml";;'; echo 'loadt "arm/proofs/bignum_modexp.ml";;') | $(HOLLIGHT) 2>&1) >$@

# All other other instances are standalone
Expand Down
Loading

0 comments on commit 7e7b18e

Please sign in to comment.