Liking cljdoc? Tell your friends :D

fluree.crypto.secp256k1


deterministic-generate-kclj/s

(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.
sourceraw docstring

ecrecoverclj/s

(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.
sourceraw docstring

format-key-pairclj/s

(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.
sourceraw docstring

format-public-keyclj/s

(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.
sourceraw docstring

generate-key-pairclj/s

(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.
sourceraw docstring

generate-key-pair*clj/s

(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:

  • 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).

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).
sourceraw docstring

get-sin-from-public-keyclj/s

(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
sourceraw docstring

modulusclj/s

source

new-private-keyclj/s

(new-private-key)

Generates a new random private key.

Generates a new random private key.
sourceraw docstring

public-key-from-privateclj/s

(public-key-from-private private)
source

recover-public-keyclj/s

(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.
sourceraw docstring

recover-public-key-from-hashclj/s

(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).
sourceraw docstring

signclj/s

(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).
sourceraw docstring

sign-hashclj/s

(sign-hash hash-ba private-bn recovery-byte?)
source

valid-private?clj/s

(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.
sourceraw docstring

verifyclj/s

(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.
sourceraw docstring

verify-signature-from-hashclj/s

(verify-signature-from-hash key hash signature)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close