|
|
@ -193,17 +193,17 @@ function secp256r1() { |
|
|
|
return new X9ECParameters(curve, G, n, h); |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: make this into a proper hashtable
|
|
|
|
function getSECCurveByName(name) { |
|
|
|
if(name == "secp128r1") return secp128r1(); |
|
|
|
if(name == "secp160k1") return secp160k1(); |
|
|
|
if(name == "secp160r1") return secp160r1(); |
|
|
|
if(name == "secp192k1") return secp192k1(); |
|
|
|
if(name == "secp192r1") return secp192r1(); |
|
|
|
if(name == "secp224r1") return secp224r1(); |
|
|
|
if(name == "secp256k1") return secp256k1(); |
|
|
|
if(name == "secp256r1") return secp256r1(); |
|
|
|
return null; |
|
|
|
return ({ |
|
|
|
"secp128r1": secp128r1, |
|
|
|
"secp160k1": secp160k1, |
|
|
|
"secp160r1": secp160r1, |
|
|
|
"secp192k1": secp192k1, |
|
|
|
"secp192r1": secp192r1, |
|
|
|
"secp224r1": secp224r1, |
|
|
|
"secp256k1": secp256k1, |
|
|
|
"secp256r1": secp256r1 |
|
|
|
}[name])() |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = getSECCurveByName; |
|
|
|
module.exports = getSECCurveByName |
|
|
|