add only rsa test

This commit is contained in:
motemotech
2024-12-10 18:04:55 +09:00
parent 163128d139
commit 5dd5344729
11 changed files with 179 additions and 54 deletions

View File

@@ -100,6 +100,7 @@ export const circuitToSelectorMode = {
export const MAX_DATAHASHES_LEN = 320; // max formatted and concatenated datagroup hashes length in bytes
export const n_dsc = 64;
export const n_dsc_3072 = 96;
export const k_dsc = 32;
export const k_dsc_3072 = 48;
export const n_csca = 120;

View File

@@ -6,6 +6,7 @@ import { SMT } from '@openpassport/zk-kit-smt';
import forge from 'node-forge';
import {
n_dsc,
n_dsc_3072,
k_dsc,
k_dsc_3072,
n_dsc_ecdsa,
@@ -30,7 +31,7 @@ export function formatMrz(mrz: string) {
export function getNAndK(sigAlg: SignatureAlgorithm) {
if (sigAlg === 'rsa_sha256_65537_3072') {
return { n: n_dsc, k: k_dsc_3072 }; // 3072/32 = 96
return { n: n_dsc_3072, k: k_dsc }; // 3072/32 = 96
}
if (sigAlg.startsWith('ecdsa_')) {