chore: remove unused code

This commit is contained in:
vishal
2025-10-01 12:43:09 +05:30
parent b7c5bc7aa7
commit ed841d7589
3 changed files with 3 additions and 37 deletions

View File

@@ -104,7 +104,7 @@ template VC_AND_DISCLOSE(
}
id_num[SMILE_ID_PADDED() - 1] <== 160; // 20 * 8 = 160 bits
// component id_num_hasher = Sha256Bytes(SMILE_ID_PADDED());
component id_num_hasher = Sha256Bytes(SMILE_ID_PADDED());
id_num_hasher.paddedIn <== id_num;
id_num_hasher.paddedInLength <== SMILE_ID_PADDED();

View File

@@ -1,34 +0,0 @@
pragma circom 2.1.9;
include "circomlib/circuits/comparators.circom";
include "@openpassport/zk-email-circuits/utils/bytes.circom";
/// @notice CountryNotInList template — used to prove that the user is not from a list of forbidden countries
/// @param MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH Maximum number of countries present in the forbidden countries list
/// @param COUNTRY_LENGTH Length of the country (can be an alpha-2 code or alpha-3 code)
/// @input country Country of the user
/// @input forbidden_countries_list Forbidden countries list user wants to prove he is not from
/// @output forbidden_countries_list_packed Packed forbidden countries list — gas optimized
template CountryNotInList(MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH, COUNTRY_LENGTH) {
signal input country[COUNTRY_LENGTH];
signal input forbidden_countries_list[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH * COUNTRY_LENGTH];
//Range-check for forbidden_countries_list
AssertBytes(MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH * COUNTRY_LENGTH)(forbidden_countries_list);
signal equality_result[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH][COUNTRY_LENGTH + 1];
signal is_equal[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH][COUNTRY_LENGTH];
for (var i = 0; i < MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH; i++) {
equality_result[i][0] <== 1;
for (var j = 1; j < COUNTRY_LENGTH + 1; j++) {
is_equal[i][j - 1] <== IsEqual()([country[j - 1], forbidden_countries_list[i * COUNTRY_LENGTH + j - 1]]);
equality_result[i][j] <== is_equal[i][j - 1] * equality_result[i][j - 1];
}
0 === equality_result[i][COUNTRY_LENGTH];
}
var chunkLength = computeIntChunkLength(MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH * COUNTRY_LENGTH);
signal output forbidden_countries_list_packed[chunkLength] <== PackBytes(MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH * COUNTRY_LENGTH)(forbidden_countries_list);
}

View File

@@ -2,7 +2,7 @@ pragma circom 2.1.9;
include "./ofac/ofac_name_dob_selfrica.circom";
include "./ofac/ofac_name_yob_selfrica.circom";
include "./country_not_in_list.circom";
include "../../aadhaar/disclose/country_not_in_list.circom";
include "../date/isValid.circom";
include "../date/isOlderThan.circom";
include "../constants.circom";
@@ -81,7 +81,7 @@ template DISCLOSE_SELFRICA(
revealed_data[selfrica_max_length + 3] <== older_than_verified[1] * selector_older_than;
revealed_data[selfrica_max_length + 4] <== older_than_verified[2] * selector_older_than;
component country_not_in_list_circuit = CountryNotInList(MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH, country_length);
component country_not_in_list_circuit = CountryNotInList(MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH);
for (var i = 0; i < country_length; i++) {
country_not_in_list_circuit.country[i] <== smile_data[country_index + i];