MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / verify

Method verify

modules/crypt/etc/ecdsa.js:95–109  ·  view source on GitHub ↗
(H, sig, asn1)

Source from the content-addressed store, hash-verified

93 return R.X === r;
94 }
95 verify(H, sig, asn1) {
96 var r, s;
97 if (asn1) {
98 let ber = new BER(sig);
99 let seq = new BER(ber.getSequence());
100 r = seq.getInteger();
101 s = seq.getInteger();
102 }
103 else {
104 let l = this.orderSize;
105 r = PKCS1.OS2IP(sig.slice(0, l));
106 s = PKCS1.OS2IP(sig.slice(l, l*2));
107 }
108 return this._verify(H, r, s);
109 }
110 static randint(max) {
111 var i = BigInt.fromArrayBuffer(RNG.get(BigInt.bitLength(max) >>> 3));
112 while (i >= max)

Callers

nothing calls this directly

Calls 5

getSequenceMethod · 0.95
getIntegerMethod · 0.95
_verifyMethod · 0.95
OS2IPMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected