Files: 402b1e3e1a62fb7d66e18edddf8959874d853d03 / docs / index.md
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Table of Contents
- onModuleInit
- MCLBN_CURVE_FP254BNB
- MCLBN_CURVE_FP382_1
- MCLBN_CURVE_FP382_2
- init
- secretKey
- publicKey
- signature
- free
- freeArray
- idSetInt
- sign
- verify
- publicKeyExport
- secretKeyExport
- signatureExport
- hashToSecretKey
- secretKeyDeserialize
- secretKeyImport
- publicKeyDeserialize
- publicKeyImport
- signatureDeserialize
- signatureImport
- secretKeyRecover
- publicKeyRecover
- signatureRecover
- secretKeyShare
- publicKeyShare
onModuleInit
takes a callback that is called once the module is setup
Parameters
cb
MCLBN_CURVE_FP254BNB
the FP254BNB curve
MCLBN_CURVE_FP382_1
the FP382_1 curve
MCLBN_CURVE_FP382_2
the FP382_2 curve
init
intailizes the libary to use a given curve
Parameters
curve
number the curves that can be used are MCLBN_CURVE_FP254BNB, MCLBN_CURVE_FP382_1 or MCLBN_CURVE_FP382_2 (optional, defaultexports.MCLBN_CURVE_FP254BNB
)
secretKey
allocates a secret key
Returns number the pointer to the key
publicKey
allocates a secret key
Returns number the pointer to the key
signature
allocates a signature
Returns number the pointer to the signture
free
frees a pointer
Parameters
x
freeArray
frees an array of pointers
Parameters
a
idSetInt
creates an ID to use in with threshold groups
Parameters
sk
number a pointer to the secret key, secret key stuct is used to hold the idn
number a int repsenting the ID. n cannot be zero.
sign
signs a message
Parameters
sig
number a pointer to the a signaturesk
number a pointer to the secret keymsg
(TypedArray | String) the message to sign
verify
verifies a signature
Parameters
sig
number a pointer to the a signaturepk
number a pointer to the secret keymsg
(TypedArray | String) the message that was signed
publicKeyExport
given a pointer to a public key this returns 64 byte Int8Array containing the key
Parameters
pk
number a pointer to the secret key
Returns TypedArray
secretKeyExport
given a pointer to a secret key this returns 32 byte Int8Array containing the key
Parameters
pk
number a pointer to the secret key
Returns TypedArray
signatureExport
given a pointer to a signature this returns 32 byte Int8Array containing the signature
Parameters
pk
number a pointer to the secret key
Returns TypedArray
hashToSecretKey
generates a secret key given a seed phrase.
Parameters
sk
number a pointer to a secret keyseed
(String | TypedArray) the seed phrase
secretKeyDeserialize
write a secretKey to memory
Parameters
sk
number a pointer to a secret keyarray
TypedArray the secret key as a 32 byte TypedArray
secretKeyImport
write a secretKey to memory and returns a pointer to it
Parameters
buf
sk
number a pointer to a secret keyarray
TypedArray the secret key as a 32 byte TypedArray
Returns Number
publicKeyDeserialize
write a publicKey to memory
Parameters
sk
number a pointer to a public keyarray
TypedArray the secret key as a 64 byte TypedArray
publicKeyImport
write a publicKey to memory and returns a pointer to it
Parameters
buf
array
TypedArray the secret key as a 64 byte TypedArray
Returns Number
signatureDeserialize
write a signature to memory
Parameters
sig
number a pointer to a signaturearray
TypedArray the signature as a 32 byte TypedArray
signatureImport
write a signature to memory and returns a pointer to it
Parameters
buf
array
TypedArray the signature as a 32 byte TypedArray
Returns Number
secretKeyRecover
Recovers a secret key for a group given the groups secret keys shares and the groups ids
Parameters
sk
number a pointer to a secret key that will be generatedsksArray
Array<number> an array of pointers to the groups secret key shares. The length of the array should be the threshold number for the groupidArrah
Array<numbers> an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
publicKeyRecover
Recovers a public key for a group given the groups public keys shares and the groups ids
Parameters
pk
number a pointer to a secret key that will be generatedpksArray
Array<number> an array of pointers to the groups public key shares. The length of the array should be the threshold number for the groupidArrah
Array<numbers> an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
signatureRecover
Recovers a signature for a group given the groups public keys shares and the groups ids
Parameters
sig
number a pointer to the signature that will be generatedsigArray
Array<number> an array of pointers to signature shares. The length of the array should be the threshold number for the groupidArrah
Array<numbers> an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
secretKeyShare
Creates a secket key share for a group member given the groups members id (which is a the secret key) and array of master secret keys
Parameters
skshare
number a pointer to a secret key that will be generatedmsk
Array<number> an array of master secret keys. The number of keys is the threshould of the group.id
number the id of the member
publicKeyShare
Creates a public key share for a group member given the groups members id (which is a the secret key) and array of master public keys
Parameters
Built with git-ssb-web