Error: red works only with positives
at assert (//bn.js/lib/bn.js:6:21)
at BN.toRed (//bn.js/lib/bn.js:2849:5)
at new Point (//elliptic/lib/elliptic/curve/short.js:268:23)
at ShortCurve.point (//elliptic/lib/elliptic/curve/short.js:275:10)
at KeyPair._importPublic (//elliptic/lib/elliptic/ec/key.js:95:30)
at new KeyPair (//elliptic/lib/elliptic/ec/key.js:16:10)
at Function.fromPublic (//elliptic/lib/elliptic/ec/key.js:24:10)
at EC.keyFromPublic (//elliptic/lib/elliptic/ec/index.js:52:18)
This will happen with about every 5th of the covid certificate keys.
This code does not seem to work with some official keys. I.e. this key issued by the german authorities:
Will lead to the error
This will happen with about every 5th of the covid certificate keys.