Liking cljdoc? Tell your friends :D

io.sixtant.rfc6979


dsak-calculatorclj

(dsak-calculator k-seq)

Create a org.bouncycastle.crypto.signers.DSAKCalculator which returns the given k values in order.

Useful to supply custom k values to Bouncy Castle's DSA/ECDSA algorithms.

Create a `org.bouncycastle.crypto.signers.DSAKCalculator` which returns the
given `k` values in order.

Useful to supply custom `k` values to Bouncy Castle's DSA/ECDSA algorithms.
sourceraw docstring

ec-signclj

(ec-sign {:keys [data private-key hash-digest curve extra-entropy] :as x})

Sign the data and return the [r s] pair as BigIntegers.

Required

  • data The final, hashed bytes to sign.
  • private-key Private key as a BigInteger.
  • hash-digest An instance of org.bouncycastle.crypto.Digest specifying the hash function to use (see sha-256-digest in this ns).
  • curve The Bouncy Castle representation of the elliptic curve, e.g. (org.bouncycastle.asn1.nist.NISTNamedCurves/getByName "P-192")

Optional

  • extra-entropy A k' value as described in section 3.6 of rfc6979.
Sign the `data` and return the [r s] pair as BigIntegers.

Required
  - data        The final, hashed bytes to sign.
  - private-key Private key as a BigInteger.
  - hash-digest An instance of org.bouncycastle.crypto.Digest specifying the
                hash function to use (see `sha-256-digest` in this ns).
  - curve       The Bouncy Castle representation of the elliptic curve, e.g.
                (org.bouncycastle.asn1.nist.NISTNamedCurves/getByName "P-192")

Optional
  - extra-entropy A k' value as described in section 3.6 of rfc6979.
sourceraw docstring

ec-verifyclj

(ec-verify {:keys [data public-key private-key curve] :as x} r s)

Verify the signature (r and s values) against the unsigned data bytes and the public-key on the given curve, returning a boolean.

Provide either a public-key in Bouncy Castle's ECPoint format, or a BigInteger private key. See the public-key function for building an ECPoint from affine public key coordinates.

Verify the signature (`r` and `s` values) against the unsigned `data` bytes
and the `public-key` on the given `curve`, returning a boolean.

Provide either a `public-key` in Bouncy Castle's ECPoint format, or a
BigInteger private key. See the `public-key` function for building an
ECPoint from affine public key coordinates.
sourceraw docstring

generate-ksclj

(generate-ks {:keys [curve-order private-key data hash-digest extra-entropy]})

Generate an infinite sequence of k values for ECDSA deterministically from data.

Required

  • curve-order Order of the curve (e.g. 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 for secp256k1).
  • private-key Private key as a BigInteger.
  • data Byte array of hashed message data (for signing).
  • hash-digest An instance of org.bouncycastle.crypto.Digest specifying the hash function to use (see sha-256-digest in this ns). Optional
  • extra-entropy A k' value as described in section 3.6 of rfc6979.
Generate an infinite sequence of `k` values for ECDSA deterministically from
`data`.

Required
  - curve-order   Order of the curve (e.g. 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
                  for secp256k1).
  - private-key   Private key as a BigInteger.
  - data          Byte array of hashed message data (for signing).
  - hash-digest   An instance of org.bouncycastle.crypto.Digest specifying the
                  hash function to use (see `sha-256-digest` in this ns).
Optional
  - extra-entropy A k' value as described in section 3.6 of rfc6979.
sourceraw docstring

hash-with-digestclj

(hash-with-digest digest msg-bytes)

Helper to hash bytes -> bytes with some digest.

Helper to hash bytes -> bytes with some digest.
sourceraw docstring

public-keyclj

(public-key curve x y)

Convert the affine coordinates to a public key on the given curve.

Convert the affine coordinates to a public key on the given `curve`.
sourceraw docstring

sha-256-digestclj

(sha-256-digest)

A SHA256 digest suitable for the :hash-digest parameter of generate-ks.

A SHA256 digest suitable for the :hash-digest parameter of `generate-ks`.
sourceraw docstring

sha-384-digestclj

(sha-384-digest)

A SHA384 digest suitable for the :hash-digest parameter of generate-ks.

A SHA384 digest suitable for the :hash-digest parameter of `generate-ks`.
sourceraw docstring

sha-512-digestclj

(sha-512-digest)

A SHA512 digest suitable for the :hash-digest parameter of generate-ks.

A SHA512 digest suitable for the :hash-digest parameter of `generate-ks`.
sourceraw docstring

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

× close