module Secp256k1::Util
Overview
a collection of utilities for secp256k1 key management
Defined in:
util.crClass Method Summary
-
.decode_compressed_public_key(pub : String, prime = EC_PARAM_PRIME)
decodes a public key as ec point from a compressed public key string
-
.new_private_key
a helper to generate 32 pseudo-random bytes
-
.public_key_compressed_prefix(p : EC_Point)
exports the compressed public key from an ec point with prefix 02 or 03
-
.public_key_from_private(priv : BigInt)
wrapper function to perform an ec multiplication with the generator point and a provided private key
-
.public_key_uncompressed(p : EC_Point)
exports the uncompressed public key from an ec point without prefix
-
.public_key_uncompressed_prefix(p : EC_Point)
exports the uncompressed public key from an ec point with prefix 04
-
.restore_public_key(pub : String)
detects public key type and tries to restore the ec point from it
-
.to_padded_hex_01(i : Int32)
generic tool to encode single hex bytes as strings, e.g., "07"
-
.to_padded_hex_32(i : BigInt)
utility tool to ensure hex keys are always 32 bytes it pads the number with leading zeros if not
Class Method Detail
decodes a public key as ec point from a compressed public key string
exports the compressed public key from an ec point with prefix 02 or 03
wrapper function to perform an ec multiplication with the generator point and a provided private key
exports the uncompressed public key from an ec point without prefix
exports the uncompressed public key from an ec point with prefix 04
detects public key type and tries to restore the ec point from it
generic tool to encode single hex bytes as strings, e.g., "07"
utility tool to ensure hex keys are always 32 bytes it pads the number with leading zeros if not