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

Method verify

modules/crypt/etc/dsa.js:91–105  ·  view source on GitHub ↗
(H, sig, asn1)

Source from the content-addressed store, hash-verified

89 return this.comp(v, r) == 0;
90 };
91 verify(H, sig, asn1) {
92 var r, s;
93 if (asn1) {
94 let ber = new BER(sig);
95 let seq = new BER(ber.getSequence());
96 r = seq.getInteger();
97 s = seq.getInteger();
98 }
99 else {
100 // "20" is specified in the xmldsig-core spec.
101 r = Crypt.PKCS1.OS2IP(sig.slice(0, 20));
102 s = Crypt.PKCS1.OS2IP(sig.slice(20, 40));
103 }
104 return(this._verify(H, r, s));
105 };
106};
107

Callers 2

testvectors.jsFile · 0.45
main.jsFile · 0.45

Calls 5

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

Tested by

no test coverage detected