@typeberry/native 0.3.0-5dae93e → 0.4.0-942910c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +18 -0
- package/index.js +19 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -181,6 +181,24 @@ declare function verifySeal(signerKey: Uint8Array, sealData: Uint8Array, payload
|
|
|
181
181
|
declare function generateSeal(secretSeed: Uint8Array, input: Uint8Array, auxData: Uint8Array): Uint8Array;
|
|
182
182
|
declare function vrfOutputHash(secretSeed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
183
183
|
declare function batchGenerateRingVrf(ringKeys: Uint8Array, proverKeyIndex: number, secretSeed: Uint8Array, inputsData: Uint8Array, vrfInputDataLen: number): Uint8Array;
|
|
184
|
+
/**
|
|
185
|
+
* Batch-verify ring VRF tickets against a single ring commitment.
|
|
186
|
+
*
|
|
187
|
+
* Verification is all-or-nothing: every ticket is aggregated into one batched
|
|
188
|
+
* pairing check, so the result reports a single pass/fail for the whole batch
|
|
189
|
+
* (an individual failing ticket cannot be identified).
|
|
190
|
+
*
|
|
191
|
+
* `ticketsData` is the concatenation of `signature (784 bytes) || vrfInput
|
|
192
|
+
* (vrfInputDataLen bytes)` per ticket. The returned buffer is:
|
|
193
|
+
*
|
|
194
|
+
* - On success: `[0x00, entropyHash_0 (32B), entropyHash_1 (32B), ...]` — the
|
|
195
|
+
* status byte followed by one VRF output hash per ticket, in input order.
|
|
196
|
+
* - On failure: `[0x01, 0x00 * (numTickets * 32)]` — the status byte followed
|
|
197
|
+
* by a zero-filled region of the same length; the hashes must be ignored.
|
|
198
|
+
*
|
|
199
|
+
* `numTickets` equals `ticketsData.length / (vrfInputDataLen + 784)`, so the
|
|
200
|
+
* response length is identical for success and failure.
|
|
201
|
+
*/
|
|
184
202
|
declare function batchVerifyTickets(ringSize: number, commitment: Uint8Array, ticketsData: Uint8Array, vrfInputDataLen: number): Uint8Array;
|
|
185
203
|
//#endregion
|
|
186
204
|
//#region native/index.d.ts
|