A Digital signature algorithm implementation
- Source:
Members
(inner) x
Re-derive public key y' = g ** x mod p Expect y == y'
Blinded exponentiation computes g**{rq + x} to compare to y
- Source:
Methods
(async, static) sign(hashAlgo, hashed, g, p, q, x) → {Promise.<{r: Uint8Array, s: Uint8Array}>}
DSA Sign function
Parameters:
Name | Type | Description |
---|---|---|
hashAlgo |
Integer | |
hashed |
Uint8Array | |
g |
Uint8Array | |
p |
Uint8Array | |
q |
Uint8Array | |
x |
Uint8Array |
- Source:
Returns:
- Type
- Promise.<{r: Uint8Array, s: Uint8Array}>
(async, static) validateParams(p, q, g, y, x) → {Promise.<Boolean>}
Validate DSA parameters
Parameters:
Name | Type | Description |
---|---|---|
p |
Uint8Array | DSA prime |
q |
Uint8Array | DSA group order |
g |
Uint8Array | DSA sub-group generator |
y |
Uint8Array | DSA public key |
x |
Uint8Array | DSA private key |
- Source:
Returns:
Whether params are valid.
- Type
- Promise.<Boolean>
(async, static) verify(hashAlgo, r, s, hashed, g, p, q, y) → {boolean}
DSA Verify function
Parameters:
Name | Type | Description |
---|---|---|
hashAlgo |
Integer | |
r |
Uint8Array | |
s |
Uint8Array | |
hashed |
Uint8Array | |
g |
Uint8Array | |
p |
Uint8Array | |
q |
Uint8Array | |
y |
Uint8Array |
- Source:
Returns:
- Type
- boolean