Module: crypto/schnorr

Members

(static, constant) alg :Buffer

Schnorr personalization string.

Type:
  • Buffer
Source:

Methods

(private, static) _sign(msg, priv, k, hash, pubnonce) → {Signature|null}

Sign message.

Parameters:
Name Type Description
msg Buffer
priv BN
k BN
hash function | null
pubnonce Buffer
Source:
Returns:
Type
Signature | null

(static) combineKeys(keys) → {Buffer}

Combine public keys.

Parameters:
Name Type Description
keys Array:.<Buffer:>
Source:
Returns:
Type
Buffer

(static) combineSigs(sigs) → {Signature}

Combine signatures.

Parameters:
Name Type Description
sigs Array:.<Buffer:>
Source:
Returns:
Type
Signature

(static) drbg(msg, priv, data) → {HmacDRBG}

Instantiate an HMAC-DRBG.

Parameters:
Name Type Description
msg Buffer
priv Buffer
data Buffer
Source:
Returns:
Type
HmacDRBG

(static) generateNoncePair(msg, priv, data, ncbnullable) → {Buffer}

Generate pub+priv nonce pair.

Parameters:
Name Type Attributes Description
msg Buffer
priv Buffer
data Buffer
ncb function <nullable>
Source:
Returns:
Type
Buffer

(static) hash(msg, r, hashnullable) → {Buffer}

Hash (r | M).

Parameters:
Name Type Attributes Description
msg Buffer
r BN
hash function <nullable>
Source:
Returns:
Type
Buffer

(static) nonce(msg, priv, data, ncbnullable) → {BN}

Create a schnorr nonce with a nonce callback.

Parameters:
Name Type Attributes Description
msg Buffer
priv Buffer
data Buffer
ncb function <nullable>
Source:
Returns:
Type
BN

(static) partialSign(msg, priv, privnonce, pubs, hashnullable) → {Buffer}

Partially sign.

Parameters:
Name Type Attributes Description
msg Buffer
priv Buffer
privnonce Buffer
pubs Buffer
hash function <nullable>
Source:
Returns:
Type
Buffer

(static) recover(msg, signature, hashnullable) → {Buffer}

Recover public key.

Parameters:
Name Type Attributes Description
msg Buffer
signature Buffer
hash function <nullable>
Source:
Returns:
Type
Buffer

(static) rfc6979(msg, priv, data) → {Buffer}

Perform hmac drbg according to rfc6979.

Parameters:
Name Type Description
msg Buffer
priv Buffer
data Buffer
Source:
Returns:
Type
Buffer

(static) sign(msg, key, hashnullable, pubnonce) → {Signature}

Sign message.

Parameters:
Name Type Attributes Description
msg Buffer
key Buffer
hash function <nullable>
pubnonce Buffer
Source:
Returns:
Type
Signature

(static) verify(msg, signature, key, hashnullable) → {Buffer}

Verify signature.

Parameters:
Name Type Attributes Description
msg Buffer
signature Buffer
key Buffer
hash function <nullable>
Source:
Returns:
Type
Buffer