forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add safegcd based modular inverse modules
Refactored by: Pieter Wuille <pieter@wuille.net>
- Loading branch information
1 parent
de0a643
commit 8e415ac
Showing
5 changed files
with
801 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/*********************************************************************** | ||
* Copyright (c) 2020 Peter Dettman * | ||
* Distributed under the MIT software license, see the accompanying * | ||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.* | ||
**********************************************************************/ | ||
|
||
#ifndef SECP256K1_MODINV32_H | ||
#define SECP256K1_MODINV32_H | ||
|
||
#if defined HAVE_CONFIG_H | ||
#include "libsecp256k1-config.h" | ||
#endif | ||
|
||
#include "util.h" | ||
|
||
typedef struct { | ||
int32_t v[9]; | ||
} secp256k1_modinv32_signed30; | ||
|
||
typedef struct { | ||
/* The modulus in signed30 notation. */ | ||
secp256k1_modinv32_signed30 modulus; | ||
|
||
/* modulus^{-1} mod 2^30 */ | ||
uint32_t modulus_inv30; | ||
} secp256k1_modinv32_modinfo; | ||
|
||
static void secp256k1_modinv32(secp256k1_modinv32_signed30 *x, const secp256k1_modinv32_modinfo *modinfo); | ||
static void secp256k1_modinv32_var(secp256k1_modinv32_signed30 *x, const secp256k1_modinv32_modinfo *modinfo); | ||
|
||
#endif /* SECP256K1_MODINV32_H */ |
Oops, something went wrong.