Skip to content

Commit

Permalink
Merge pull request #359 from zk-passport/feat/secp224r1
Browse files Browse the repository at this point in the history
feat: add curve params for secp224r1
  • Loading branch information
remicolin authored Feb 4, 2025
2 parents 4f46f5e + ff4e337 commit b7c515a
Showing 1 changed file with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function get_a(signatureAlgorithm) {
];
}

if (signatureAlgorithm == 41) {
if (signatureAlgorithm == 41) { //p521
return [
73786976294838206460,
73786976294838206463,
Expand All @@ -141,6 +141,18 @@ function get_a(signatureAlgorithm) {
];
}

if (signatureAlgorithm == 44) { //p224
return [
4294967294,
4294967295,
4294967295,
4294967294,
4294967295,
4294967295,
4294967295
];
}

return [0];
}

Expand Down Expand Up @@ -207,7 +219,7 @@ function get_b(signatureAlgorithm) {
];
}

if (signatureAlgorithm == 41) {
if (signatureAlgorithm == 41) { //p521
return [
35687965819361312512,
33244719099633405244,
Expand All @@ -220,6 +232,18 @@ function get_b(signatureAlgorithm) {
];
}

if (signatureAlgorithm == 44) { //p224
return [
592838580,
655046979,
3619674298,
1346678967,
4114690646,
201634731,
3020229253
];
}

return [0];
}

Expand Down Expand Up @@ -286,7 +310,7 @@ function get_p(signatureAlgorithm) {
];
}

if (signatureAlgorithm == 41) {
if (signatureAlgorithm == 41) { //p521
return [
73786976294838206463,
73786976294838206463,
Expand All @@ -299,5 +323,17 @@ function get_p(signatureAlgorithm) {
];
}

if (signatureAlgorithm == 44) { // p224
return [
1,
0,
0,
4294967295,
4294967295,
4294967295,
4294967295
];
}

return [0];
}

0 comments on commit b7c515a

Please sign in to comment.