mirror of
https://github.com/selfxyz/self.git
synced 2026-04-27 03:01:15 -04:00
fix packBytes import path
This commit is contained in:
@@ -6,6 +6,7 @@ import { poseidon1, poseidon6 } from "poseidon-lite";
|
||||
import { mockPassportData_sha256WithRSAEncryption_65537 } from "../../common/src/utils/mockPassportData";
|
||||
import { generateCircuitInputsRegister } from '../../common/src/utils/generateInputs';
|
||||
import { getLeaf } from '../../common/src/utils/pubkeyTree';
|
||||
import { packBytes } from '../../common/src/utils/utils';
|
||||
|
||||
describe("Proof of Passport - Circuits - Register flow", function () {
|
||||
this.timeout(0);
|
||||
@@ -121,20 +122,4 @@ describe("Proof of Passport - Circuits - Register flow", function () {
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function packBytes(unpacked) {
|
||||
const bytesCount = [31, 31, 31];
|
||||
let packed = [0n, 0n, 0n];
|
||||
|
||||
let byteIndex = 0;
|
||||
for (let i = 0; i < bytesCount.length; i++) {
|
||||
for (let j = 0; j < bytesCount[i]; j++) {
|
||||
if (byteIndex < unpacked.length) {
|
||||
packed[i] |= BigInt(unpacked[byteIndex]) << (BigInt(j) * 8n);
|
||||
}
|
||||
byteIndex++;
|
||||
}
|
||||
}
|
||||
return packed;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user