types: enforce consistent type checking
This commit is contained in:
parent
166053a3e5
commit
35542e115d
10 changed files with 99 additions and 44 deletions
|
@ -1,9 +1,12 @@
|
|||
var assert = require('assert')
|
||||
var enforceType = require('./types')
|
||||
|
||||
var BigInteger = require('bigi')
|
||||
|
||||
function ECSignature(r, s) {
|
||||
assert(r instanceof BigInteger, 'Expected BigInteger, got ' + r)
|
||||
assert(s instanceof BigInteger, 'Expected BigInteger, got ' + s)
|
||||
enforceType(BigInteger, r)
|
||||
enforceType(BigInteger, s)
|
||||
|
||||
this.r = r
|
||||
this.s = s
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue