Skip to content

Commit

Permalink
Merge bitcoin-core/secp256k1#1366: field: Use restrict consistently…
Browse files Browse the repository at this point in the history
… in fe_sqrt

b79ba8a field: Use `restrict` consistently in fe_sqrt (Tim Ruffing)

Pull request description:

  That is, use it also in the definition and not only the declaration.

  I believe this was the intention of commit
  bitcoin-core/secp256k1@be82bd8, but it was omitted there.

  edit: Changed the description. I'm not entirely sure but after looking at the standard, I tend to think this is more than a cosmetic change, and only this change actually makes the parameters `restrict`. Anyway, I believe making them `restrict` was simply forgotten in be82bd8.

ACKs for top commit:
  sipa:
    utACK b79ba8a

Tree-SHA512: eecec7674d8cef7833d50f4041b87241ca8de4839aa8027df1c422b89f5a1bcef3916ac785057a596c459ce1aa9d41e5a21ecb6fed9c5d15a1d9f588c7ee208e
  • Loading branch information
real-or-random committed Jul 11, 2023
2 parents cc55757 + b79ba8a commit 0f7657d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/field_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SECP256K1_INLINE static int secp256k1_fe_equal_var(const secp256k1_fe *a, const
return secp256k1_fe_normalizes_to_zero_var(&na);
}

static int secp256k1_fe_sqrt(secp256k1_fe *r, const secp256k1_fe *a) {
static int secp256k1_fe_sqrt(secp256k1_fe * SECP256K1_RESTRICT r, const secp256k1_fe * SECP256K1_RESTRICT a) {
/** Given that p is congruent to 3 mod 4, we can compute the square root of
* a mod p as the (p+1)/4'th power of a.
*
Expand Down

0 comments on commit 0f7657d

Please sign in to comment.