.privateKeyVerify(Buffer privateKey)
.privateKeyExport(Buffer privateKey [, Boolean compressed = true])
.privateKeyImport(Buffer privateKey)
.privateKeyNegate(Buffer privateKey)
.privateKeyModInverse(Buffer privateKey)
.privateKeyTweakAdd(Buffer privateKey, Buffer tweak)
.privateKeyTweakMul(Buffer privateKey, Buffer tweak)
.publicKeyCreate(Buffer privateKey [, Boolean compressed = true])
.publicKeyConvert(Buffer publicKey [, Boolean compressed = true])
.publicKeyVerify(Buffer publicKey)
.publicKeyTweakAdd(Buffer publicKey, Buffer tweak [, Boolean compressed = true])
.publicKeyTweakMul(Buffer publicKey, Buffer tweak [, Boolean compressed = true])
.publicKeyCombine(Array<Buffer> publicKeys [, Boolean compressed = true])
.signatureNormalize(Buffer signature)
.signatureExport(Buffer signature)
.signatureImport(Buffer signature)
.signatureImportLax(Buffer signature)
.sign(Buffer message, Buffer privateKey [, Object options])
.verify(Buffer message, Buffer signature, Buffer publicKey)
.recover(Buffer message, Buffer signature, Number recovery [, Boolean compressed = true])
.ecdh(Buffer publicKey, Buffer privateKey)
.ecdhUnsafe(Buffer publicKey, Buffer privateKey [, Boolean compressed = true])
Verify an ECDSA privateKey.
Export a privateKey in DER format.
Import a privateKey in DER format.
Negate a privateKey by subtracting it from the order of the curve's base point.
Compute the inverse of a privateKey (modulo the order of the curve's base point).
Tweak a privateKey by adding tweak to it.
Tweak a privateKey by multiplying it by a tweak.
Compute the public key for a privateKey.
Convert a publicKey to compressed or uncompressed form.
Verify an ECDSA publicKey.
Tweak a publicKey by adding tweak times the generator to it.
Tweak a publicKey by multiplying it by a tweak value.
Add a given publicKeys together.
Convert a signature to a normalized lower-S form.
Serialize an ECDSA signature in DER format.
Parse a DER ECDSA signature (follow by BIP66).
Same as signatureImport but not follow by BIP66.
.sign(Buffer message, Buffer privateKey [, Object options]) -> {signature: Buffer, recovery: number}
Create an ECDSA signature. Always return low-S signature.
Inputs: 32-byte message m, 32-byte scalar key d, 32-byte scalar nonce k.
- Compute point R = k * G. Reject nonce if R's x coordinate is zero.
- Compute 32-byte scalar r, the serialization of R's x coordinate.
- Compose 32-byte scalar s = k^-1 * (r * d + m). Reject nonce if s is zero.
- The signature is (r, s).
Nonce generator. By default it is rfc6979.
Function signature:
Additional data for noncefn (RFC 6979 3.6) (32 bytes). By default is null
.
Verify an ECDSA signature.
Note: return false for high signatures!
Inputs: 32-byte message m, public key point Q, signature: (32-byte r, scalar s).
- Signature is invalid if r is zero.
- Signature is invalid if s is zero.
- Compute point R = (s^-1 * m * G + s^-1 * r * Q). Reject if R is infinity.
- Signature is valid if R's x coordinate equals to r.
Recover an ECDSA public key from a signature.
Compute an EC Diffie-Hellman secret and applied sha256 to compressed public key.
Compute an EC Diffie-Hellman secret and return public key as result.