csecp256k1

Haskell FFI bindings to bitcoin-core/secp256k1 (docs.ppad.tech/csecp256k1).
git clone git://git.ppad.tech/csecp256k1.git
Log | Files | Refs | README | LICENSE

ecmult_const.h (1494B)


      1 /***********************************************************************
      2  * Copyright (c) 2015 Andrew Poelstra                                  *
      3  * Distributed under the MIT software license, see the accompanying    *
      4  * file COPYING or https://www.opensource.org/licenses/mit-license.php.*
      5  ***********************************************************************/
      6 
      7 #ifndef SECP256K1_ECMULT_CONST_H
      8 #define SECP256K1_ECMULT_CONST_H
      9 
     10 #include "scalar.h"
     11 #include "group.h"
     12 
     13 /**
     14  * Multiply: R = q*A (in constant-time for q)
     15  */
     16 static void haskellsecp256k1_v0_1_0_ecmult_const(haskellsecp256k1_v0_1_0_gej *r, const haskellsecp256k1_v0_1_0_ge *a, const haskellsecp256k1_v0_1_0_scalar *q);
     17 
     18 /**
     19  * Same as haskellsecp256k1_v0_1_0_ecmult_const, but takes in an x coordinate of the base point
     20  * only, specified as fraction n/d (numerator/denominator). Only the x coordinate of the result is
     21  * returned.
     22  *
     23  * If known_on_curve is 0, a verification is performed that n/d is a valid X
     24  * coordinate, and 0 is returned if not. Otherwise, 1 is returned.
     25  *
     26  * d being NULL is interpreted as d=1. If non-NULL, d must not be zero. q must not be zero.
     27  *
     28  * Constant time in the value of q, but not any other inputs.
     29  */
     30 static int haskellsecp256k1_v0_1_0_ecmult_const_xonly(
     31     haskellsecp256k1_v0_1_0_fe *r,
     32     const haskellsecp256k1_v0_1_0_fe *n,
     33     const haskellsecp256k1_v0_1_0_fe *d,
     34     const haskellsecp256k1_v0_1_0_scalar *q,
     35     int known_on_curve
     36 );
     37 
     38 #endif /* SECP256K1_ECMULT_CONST_H */