diff --git a/circuits/circuits/register/instances/register_sha1_sha256_sha256_rsa_65537_4096.circom b/circuits/circuits/register/instances/register_sha1_sha256_sha256_rsa_65537_4096.circom index 197ef52af..4c6bd0fd5 100644 --- a/circuits/circuits/register/instances/register_sha1_sha256_sha256_rsa_65537_4096.circom +++ b/circuits/circuits/register/instances/register_sha1_sha256_sha256_rsa_65537_4096.circom @@ -2,4 +2,4 @@ pragma circom 2.1.9; include "../register.circom"; -component main { public [ merkle_root ] } = REGISTER(160, 256, 1, 120, 35, 512, 128); \ No newline at end of file +component main { public [ merkle_root ] } = REGISTER(160, 256, 1, 120, 35, 384, 128); \ No newline at end of file diff --git a/circuits/circuits/utils/crypto/signature/rsapss/rsapss65537.circom b/circuits/circuits/utils/crypto/signature/rsapss/rsapss65537.circom index f5e425612..11a3602b9 100644 --- a/circuits/circuits/utils/crypto/signature/rsapss/rsapss65537.circom +++ b/circuits/circuits/utils/crypto/signature/rsapss/rsapss65537.circom @@ -57,7 +57,7 @@ include "../FpPowMod.circom"; /// @input signature The RSA signature split into chunks /// @input hashed The hash of the original message template VerifyRsaPss65537Sig(CHUNK_SIZE, CHUNK_NUMBER, SALT_LEN, HASH_TYPE, KEY_LENGTH) { - assert((HASH_TYPE == 384 && SALT_LEN == 48) || (HASH_TYPE == 256 && SALT_LEN == 64) || (HASH_TYPE == 256 && SALT_LEN == 32)); + assert((HASH_TYPE == 384 && SALT_LEN == 48) || (HASH_TYPE == 256 && SALT_LEN == 64) || (HASH_TYPE == 256 && SALT_LEN == 32) || (HASH_TYPE == 512 && SALT_LEN == 64)); signal input pubkey[CHUNK_NUMBER]; signal input signature[CHUNK_NUMBER]; diff --git a/circuits/circuits/utils/passport/signatureVerifier.circom b/circuits/circuits/utils/passport/signatureVerifier.circom index d7fbea0b9..4edd4780e 100644 --- a/circuits/circuits/utils/passport/signatureVerifier.circom +++ b/circuits/circuits/utils/passport/signatureVerifier.circom @@ -49,8 +49,7 @@ template SignatureVerifier(signatureAlgorithm, n, k) { rsa65537.modulus <== pubKey; rsa65537.signature <== signature; - } - if ( + } else if ( signatureAlgorithm == 13 || signatureAlgorithm == 32 || signatureAlgorithm == 33 @@ -64,13 +63,14 @@ template SignatureVerifier(signatureAlgorithm, n, k) { } rsa3.modulus <== pubKey; rsa3.signature <== signature; - } - if ( + } else if ( signatureAlgorithm == 4 || signatureAlgorithm == 12 || signatureAlgorithm == 18 || signatureAlgorithm == 19 || signatureAlgorithm == 35 + || signatureAlgorithm == 39 + || signatureAlgorithm == 42 ) { var pubKeyBitsLength = getMinKeyLength(signatureAlgorithm); var SALT_LEN = HASH_LEN_BITS / 8; @@ -80,10 +80,10 @@ template SignatureVerifier(signatureAlgorithm, n, k) { rsaPss65537ShaVerification.signature <== signature; rsaPss65537ShaVerification.hashed <== hash; // send the raw hash - } - if ( + } else if ( signatureAlgorithm == 16 || signatureAlgorithm == 17 + || signatureAlgorithm == 43 ) { var pubKeyBitsLength = getMinKeyLength(signatureAlgorithm); var SALT_LEN = HASH_LEN_BITS / 8; @@ -94,8 +94,8 @@ template SignatureVerifier(signatureAlgorithm, n, k) { rsaPss3ShaVerification.signature <== signature; rsaPss3ShaVerification.hashed <== hash; // send the raw hash - } - if (signatureAlgorithm == 9 + } else if ( + signatureAlgorithm == 9 || signatureAlgorithm == 7 || signatureAlgorithm == 8 || signatureAlgorithm == 9 @@ -116,6 +116,8 @@ template SignatureVerifier(signatureAlgorithm, n, k) { || signatureAlgorithm == 44 ) { EcdsaVerifier (signatureAlgorithm, n, k)(signature, pubKey, hash); + } else { + assert(1==0); } }