Module: crypto/public_key/elliptic/eddsa

Implementation of EdDSA following RFC4880bis-03 for OpenPGP

Source:

Methods

(static) generate(algo) → {Promise.<{A: Uint8Array, seed: Uint8Array}>}

Generate (non-legacy) EdDSA key

Parameters:
Name Type Description
algo module:enums.publicKey

Algorithm identifier

Source:
Returns:
Type
Promise.<{A: Uint8Array, seed: Uint8Array}>

(async, static) sign(algo, hashAlgo, message, publicKey, privateKey, hashed) → {Promise.<{RS: Uint8Array}>}

Sign a message using the provided key

Parameters:
Name Type Description
algo module:enums.publicKey

Algorithm identifier

hashAlgo module:enums.hash

Hash algorithm used to sign (must be sha256 or stronger)

message Uint8Array

Message to sign

publicKey Uint8Array

Public key

privateKey Uint8Array

Private key used to sign the message

hashed Uint8Array

The hashed message

Source:
Returns:

Signature of the message

Type
Promise.<{RS: Uint8Array}>

(async, static) validateParams(algo, A, seed, oid) → {Promise.<Boolean>}

Validate (non-legacy) EdDSA parameters

Parameters:
Name Type Description
algo module:enums.publicKey

Algorithm identifier

A Uint8Array

EdDSA public point

seed Uint8Array

EdDSA secret seed

oid Uint8Array

(legacy only) EdDSA OID

Source:
Returns:

Whether params are valid.

Type
Promise.<Boolean>

(async, static) verify(algo, hashAlgo, signature, m, publicKey, hashed) → {Boolean}

Verifies if a signature is valid for a message

Parameters:
Name Type Description
algo module:enums.publicKey

Algorithm identifier

hashAlgo module:enums.hash

Hash algorithm used in the signature

signature Object

Signature to verify the message

m Uint8Array

Message to verify

publicKey Uint8Array

Public key used to verify the message

hashed Uint8Array

The hashed message

Source:
Returns:
Type
Boolean