forked from tornado-packages/noble-curves
readme
This commit is contained in:
parent
80edb3323a
commit
31f780027a
10
README.md
10
README.md
@ -70,14 +70,17 @@ const someonesPubkey = secp256k1.getPublicKey(secp256k1.utils.randomPrivateKey()
|
||||
const shared = secp256k1.getSharedSecret(key, someonesPubkey);
|
||||
```
|
||||
|
||||
### Overview
|
||||
## API
|
||||
|
||||
- [Overview](#overview)
|
||||
- [edwards: Twisted Edwards curve](#edwards-twisted-edwards-curve)
|
||||
- [montgomery: Montgomery curve](#montgomery-montgomery-curve)
|
||||
- [weierstrass: Short Weistrass curve](#weierstrass-short-weistrass-curve)
|
||||
- [modular](#modular)
|
||||
- [utils](#utils)
|
||||
|
||||
### Overview
|
||||
|
||||
* All arithmetics is done with JS bigints in finite fields
|
||||
* Curve variables, order (number of points on curve), field prime (over which the modular division would be done)
|
||||
are required
|
||||
@ -101,9 +104,10 @@ const shared = secp256k1.getSharedSecret(key, someonesPubkey);
|
||||
- `add()`, `subtract()`, `equals()`
|
||||
- `multiply()`
|
||||
Every group also has `BASE` (generator) and `ZERO` (infinity) static properties.
|
||||
* Every curve exports `CURVE` object
|
||||
* Every curve exports `utils`:
|
||||
* `randomPrivateKey()`
|
||||
* `mod` & `invert` methods: basically utilities from `modular` with default `P`
|
||||
* `randomPrivateKey()` specific for the curve, avoiding modulo bias
|
||||
* `mod()` & `invert()` methods: function from `modular` with default `P` set to CURVE
|
||||
|
||||
### edwards: Twisted Edwards curve
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user