mirror of
https://github.com/selfxyz/self.git
synced 2026-02-19 02:24:25 -05:00
Ci/kyc (#1658)
* ci: add kyc to the workflow and rm new aadhaar nullifier logic * fix: true spelling
This commit is contained in:
1
.github/workflows/circuits-build.yml
vendored
1
.github/workflows/circuits-build.yml
vendored
@@ -208,6 +208,7 @@ jobs:
|
||||
./circuits/scripts/build/build_cpp.sh register
|
||||
./circuits/scripts/build/build_cpp.sh register_id
|
||||
./circuits/scripts/build/build_cpp.sh register_aadhaar
|
||||
./circuits/scripts/build/build_cpp.sh register_kyc
|
||||
./circuits/scripts/build/build_cpp.sh disclose
|
||||
./circuits/scripts/build/build_cpp.sh dsc
|
||||
fi
|
||||
|
||||
@@ -114,15 +114,16 @@ template REGISTER_AADHAAR(n, k, maxDataLength){
|
||||
|
||||
|
||||
component qrDataHasher = PackBytesAndPoseidon(maxDataLength);
|
||||
for (var i = 0; i < 9; i++){
|
||||
qrDataHasher.in[i] <== qrDataPadded[i];
|
||||
}
|
||||
for (var i = 9; i < 26; i++) {
|
||||
qrDataHasher.in[i] <== 0;
|
||||
}
|
||||
for (var i = 26; i < maxDataLength; i++){
|
||||
qrDataHasher.in[i] <== qrDataPadded[i];
|
||||
}
|
||||
qrDataHasher.in <== qrDataPadded;
|
||||
// for (var i = 0; i < 9; i++){
|
||||
// qrDataHasher.in[i] <== qrDataPadded[i];
|
||||
// }
|
||||
// for (var i = 9; i < 26; i++) {
|
||||
// qrDataHasher.in[i] <== 0;
|
||||
// }
|
||||
// for (var i = 26; i < maxDataLength; i++){
|
||||
// qrDataHasher.in[i] <== qrDataPadded[i];
|
||||
// }
|
||||
|
||||
// Generate commitment
|
||||
component packedCommitment = PackBytesAndPoseidon(42 + 62);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# run from root
|
||||
# first argument should register | dsc | disclose
|
||||
if [[ $1 != "register" && $1 != "dsc" && $1 != "disclose" && $1 != "register_id" && $1 != "register_aadhaar" ]]; then
|
||||
if [[ $1 != "register" && $1 != "dsc" && $1 != "disclose" && $1 != "register_id" && $1 != "register_aadhaar" && $1 != "register_kyc" ]]; then
|
||||
echo "first argument should be register | dsc | disclose | register_id | register_aadhaar"
|
||||
exit 1
|
||||
fi
|
||||
@@ -76,10 +76,15 @@ REGISTER_AADHAAR_CIRCUITS=(
|
||||
"register_aadhaar:true"
|
||||
)
|
||||
|
||||
REGISTER_KYC_CIRCUITS=(
|
||||
"register_kyc:true"
|
||||
)
|
||||
|
||||
DISCLOSE_CIRCUITS=(
|
||||
"vc_and_disclose:true"
|
||||
"vc_and_disclose_id:true"
|
||||
"vc_and_disclose_aadhaar:true"
|
||||
"vc_and_disclose_kyc:true"
|
||||
)
|
||||
|
||||
DSC_CIRCUITS=(
|
||||
@@ -124,6 +129,11 @@ elif [[ $1 == "register_aadhaar" ]]; then
|
||||
output="output/register"
|
||||
mkdir -p $output
|
||||
basepath="./circuits/circuits/register/instances"
|
||||
elif [[ $1 == "register_kyc" ]]; then
|
||||
allowed_circuits=("${REGISTER_KYC_CIRCUITS[@]}")
|
||||
output="output/register"
|
||||
mkdir -p $output
|
||||
basepath="./circuits/circuits/register/instances"
|
||||
elif [[ $1 == "dsc" ]]; then
|
||||
allowed_circuits=("${DSC_CIRCUITS[@]}")
|
||||
output="output/dsc"
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('REGISTER AADHAAR Circuit Tests', function () {
|
||||
const w = await circuit.calculateWitness(inputs);
|
||||
await circuit.checkConstraints(w);
|
||||
});
|
||||
it.skip('should pass constrain and output correct nullifier and commitment', async function () {
|
||||
it('should pass constrain and output correct nullifier and commitment', async function () {
|
||||
this.timeout(0);
|
||||
const { inputs, nullifier, commitment } = prepareAadhaarRegisterTestData(
|
||||
privateKeyPem,
|
||||
|
||||
Reference in New Issue
Block a user