Skip to content

Commit

Permalink
Remove secp256k1_scalar_print
Browse files Browse the repository at this point in the history
  • Loading branch information
k06a committed Feb 7, 2022
1 parent 879ecba commit 2737a61
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 22 deletions.
8 changes: 0 additions & 8 deletions src/modinv64_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,6 @@ static unsigned int _secp256k1_scalar_msb_signed(const secp256k1_scalar *x, unsi
return secp256k1_scalar_msb_hint(x, hint);
}

#define PRINT_SCALAR_IF(condition, pre, scalar) \
if (condition) { printf(pre);secp256k1_scalar_print(scalar);printf("\n"); }

/*
* Original algorithm borrowed from this paper:
* https://www.researchgate.net/publication/304417579_Modular_Inverse_Algorithms_Without_Multiplications_for_Cryptographic_Applications (LS3)
Expand Down Expand Up @@ -664,11 +661,6 @@ static void secp256k1_modinv64_scalar(secp256k1_scalar *ret, const secp256k1_sca
VERIFY_CHECK(secp256k1_scalar_eq(&six, &twelve));
#endif

#define LIMIT 0

PRINT_SCALAR_IF(LIMIT, "a=", a);
PRINT_SCALAR_IF(LIMIT, "m=", m);

/* if (a < m) { u = m; v = a; r = 0; s = 1; } */
/* else { v = m; u = a; s = 0; r = 1; } */
if (secp256k1_scalar_cmp(a, m) < 0) { *u = *m; *v = *a; *r = zero; *s = one; }
Expand Down
2 changes: 0 additions & 2 deletions src/scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,4 @@ static void secp256k1_scalar_mul_shift_var(secp256k1_scalar *r, const secp256k1_
/** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. Both *r and *a must be initialized.*/
static void secp256k1_scalar_cmov(secp256k1_scalar *r, const secp256k1_scalar *a, int flag);

static void secp256k1_scalar_print(const secp256k1_scalar *a);

#endif /* SECP256K1_SCALAR_H */
4 changes: 0 additions & 4 deletions src/scalar_4x64_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,4 @@ SECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a)
return !(a->d[0] & 1);
}

static void secp256k1_scalar_print(const secp256k1_scalar *a) {
printf("%016llx%016llx%016llx%016llx", a->d[3], a->d[2], a->d[1], a->d[0]);
}

#endif /* SECP256K1_SCALAR_REPR_IMPL_H */
4 changes: 0 additions & 4 deletions src/scalar_8x32_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,4 @@ SECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a)
return !(a->d[0] & 1);
}

static void secp256k1_scalar_print(const secp256k1_scalar *a) {
printf("%08llx%08llx%08llx%08llx%08llx%08llx%08llx%08llx", a->d[7], a->d[6], a->d[5], a->d[4], a->d[3], a->d[2], a->d[1], a->d[0]);
}

#endif /* SECP256K1_SCALAR_REPR_IMPL_H */
4 changes: 0 additions & 4 deletions src/scalar_low_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,4 @@ static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_sc
secp256k1_scalar_inverse(r, x);
}

static void secp256k1_scalar_print(const secp256k1_scalar *a) {
printf("%08x", *a);
}

#endif /* SECP256K1_SCALAR_REPR_IMPL_H */

0 comments on commit 2737a61

Please sign in to comment.