(deterministic-generate-k hash-ba priv-key curve)
Deterministically generate a random number in accordance with RFC 6979. Provided hash should have 256 bits to align with secp256k1 curve.
Deterministically generate a random number in accordance with RFC 6979. Provided hash should have 256 bits to align with secp256k1 curve.
(ecrecover hash recovery-byte r s)
Given the components of a signature and a recovery value, recover and return the public key that generated the signature according to the algorithm in SEC1v2 section 4.1.6
recovery-byte should be an integer byte.
Given the components of a signature and a recovery value, recover and return the public key that generated the signature according to the algorithm in SEC1v2 section 4.1.6 recovery-byte should be an integer byte.
(format-key-pair pair)
Takes internal representation of a key-pair and returns X9.62 compressed encoded public key and private key as a map, with each value hex encoded.
Takes internal representation of a key-pair and returns X9.62 compressed encoded public key and private key as a map, with each value hex encoded.
(format-public-key public)
Takes internal representation of a public key and returns X9.62 compressed encoded public key, hex encoded.
Takes internal representation of a public key and returns X9.62 compressed encoded public key, hex encoded.
(generate-key-pair)
(generate-key-pair private)
Returns key pair in hex format using X9.62 compressed encoding for public key.
Returns key pair in hex format using X9.62 compressed encoding for public key.
(generate-key-pair*)
(generate-key-pair* private)
Generates an internal representation of key pair from a secure random seed or provided private key. Returns map/object with two keys:
If a private key is provided, must be in either hex string or BigInteger (clj) bignumber (cljs).
Generates an internal representation of key pair from a secure random seed or provided private key. Returns map/object with two keys: - private - a big number/integer - public - a curve point If a private key is provided, must be in either hex string or BigInteger (clj) bignumber (cljs).
(get-sin-from-public-key pub-key
&
{:keys [output-format] :or {output-format :base58}})
Generate a SIN from a public key
Generate a SIN from a public key
(new-private-key)
Generates a new random private key.
Generates a new random private key.
(recover-public-key input signature)
Recover a public key from original message and signature (hex) of the message's sha2-256 hash.
Recover a public key from original message and signature (hex) of the message's sha2-256 hash.
(recover-public-key-from-hash hash signature)
Recover a public key from a hash byte-array and signature (hex).
Recover a public key from a hash byte-array and signature (hex).
(sign message private-key)
Sign some message with provided private key. Message must be a byte-array or string. Private key must be hex-encoded or a BigInteger(clj)/bignumber(cljs).
Sign some message with provided private key. Message must be a byte-array or string. Private key must be hex-encoded or a BigInteger(clj)/bignumber(cljs).
(valid-private? private)
Returns true if private key, as big number/integer, is valid. Private key must be >= 1 and <= curve modulus.
Returns true if private key, as big number/integer, is valid. Private key must be >= 1 and <= curve modulus.
(verify pub-key message signature)
Verifies a message given a signature (in hex). Assumes signature is DER-encoded with a recovery byte.
Verifies a message given a signature (in hex). Assumes signature is DER-encoded with a recovery byte.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close