module SecP256K1
Defined in:
bitcoinutil/secp256k1.crConstant Summary
-
EC_A =
0
-
EC_B =
7
-
EC_FIELD_SIZE =
BigInt.new("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 16)
-
EC_GP =
Point.new(EC_GX, EC_GY)
-
EC_GX =
BigInt.new("55066263022277343669578718895168534326250603453777594175500187360389116729240")
-
EC_GY =
BigInt.new("32670510020758816978083085130507043184471273380659243275938904335757337482424")
-
EC_PRIME =
BigInt.new("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16)
-
EC_VERBOSE =
false
Class Method Summary
-
.coord_hex64(x : BigInt)
-------------------------------------------------------------- return hex string of bigint.
-
.jive(pointA, pointB)
-------------------------------------------------------------- jive() - Implementation of EC 'addition', which has nothing to do with addition.
-
.juke(point)
-------------------------------------------------------------- juke() - Implementation of EC 'point doubling', which is a special case of EC Addition, where pointA and pointB are same.
-
.modinv(a, n = EC_PRIME)
-------------------------------------------------------------- Extended Euclidean Algorithm/'division' in elliptic curves --------------------------------------------------------------
-
.pubkey_format(point)
-------------------------------------------------------------- returns compact public key format for point Consists of 2-char prefix '02' or '03' if odd followed by 64-char hex string of point.x --------------------------------------------------------------
-
.pubkey_format4(point)
-------------------------------------------------------------- long point format --------------------------------------------------------------
-
.rand
-------------------------------------------------------------- Return a random number up to 160 bits --------------------------------------------------------------
-
.sequence(gen_point, scalar)
-------------------------------------------------------------- sequence() - Implementation of 'EC Multiplication', which is really hopping around the elliptic curve N times.
-
.sign(datahash : BigInt, privKey : BigInt, rando : BigInt)
-------------------------------------------------------------- Returns BigInt signature of datahash Note: rando needs to be same value for sign() and verify() --------------------------------------------------------------
-
.verify(sig : BigInt, datahash : BigInt, pubkeyPoint : Point, rando : BigInt)
-------------------------------------------------------------- Verify that 'sig' was computed from datahash and rando using the private key that pubkeyPoint was derived from.