(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.
(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
sha-256-digest in this ns).Optional
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.(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.
(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
sha-256-digest in this ns).
OptionalGenerate 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.(hash-with-digest digest msg-bytes)Helper to hash bytes -> bytes with some digest.
Helper to hash bytes -> bytes with some digest.
(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`.
(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`.
(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`.
(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`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |