Skip to content

Commit

Permalink
curve25519: Remove dead fiat_25519_selectznz.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed May 23, 2024
1 parent 6b105f2 commit be4ba83
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 112 deletions.
4 changes: 0 additions & 4 deletions crypto/curve25519/curve25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,8 @@ static void fe_neg(fe_loose *h, const fe *f) {
//
// Preconditions: b in {0,1}.
static void fe_cmov(fe_loose *f, const fe_loose *g, fe_limb_t b) {
// Silence an unused function warning. |fiat_25519_selectznz| isn't quite the
// calling convention the rest of this code wants, so implement it by hand.
//
// TODO(davidben): Switch to fiat's calling convention, or ask fiat to emit a
// different one.
(void)fiat_25519_selectznz;

b = 0-b;
for (unsigned i = 0; i < FE_NUM_LIMBS; i++) {
Expand Down
46 changes: 0 additions & 46 deletions third_party/fiat/curve25519_32.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 0 additions & 31 deletions third_party/fiat/curve25519_64.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 0 additions & 31 deletions third_party/fiat/curve25519_64_msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,37 +763,6 @@ static FIAT_25519_FIAT_INLINE void fiat_25519_opp(fiat_25519_loose_field_element
out1[4] = x5;
}

/*
* The function fiat_25519_selectznz is a multi-limb conditional select.
*
* Postconditions:
* out1 = (if arg1 = 0 then arg2 else arg3)
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
* arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
* Output Bounds:
* out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
*/
static FIAT_25519_FIAT_INLINE void fiat_25519_selectznz(uint64_t out1[5], fiat_25519_uint1 arg1, const uint64_t arg2[5], const uint64_t arg3[5]) {
uint64_t x1;
uint64_t x2;
uint64_t x3;
uint64_t x4;
uint64_t x5;
fiat_25519_cmovznz_u64(&x1, arg1, (arg2[0]), (arg3[0]));
fiat_25519_cmovznz_u64(&x2, arg1, (arg2[1]), (arg3[1]));
fiat_25519_cmovznz_u64(&x3, arg1, (arg2[2]), (arg3[2]));
fiat_25519_cmovznz_u64(&x4, arg1, (arg2[3]), (arg3[3]));
fiat_25519_cmovznz_u64(&x5, arg1, (arg2[4]), (arg3[4]));
out1[0] = x1;
out1[1] = x2;
out1[2] = x3;
out1[3] = x4;
out1[4] = x5;
}

/*
* The function fiat_25519_to_bytes serializes a field element to bytes in little-endian order.
*
Expand Down

0 comments on commit be4ba83

Please sign in to comment.