drand / tlock-js

Timelock Encryption made practical. A Typescript library for encrypting for the future.
Other
94 stars 8 forks source link

tlock-js: special number values NaN and Infinity are not checked #21

Closed CluEleSsUK closed 1 year ago

AnomalRoil commented 1 year ago

Are they really not?

Using the point-at-infinity via npm test seems to detect it, no?

timelock
    encryption
        should pass for a valid roundNumber:
Error: No pairings at point of Infinity 
    at Object.pairing (node_modules/@noble/bls12-381/lib/index.js:559:15) 
    at Object.encrypt (src/crypto/ibe.ts:20:21)

I'm not sure about NaN.

CluEleSsUK commented 1 year ago

A fix for this was merged in drand-client: https://github.com/drand/drand-client/pull/59