-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor circuit #185
Refactor circuit #185
Conversation
a6bc26c
to
85f95a6
Compare
aa21650
to
d2256d9
Compare
d2256d9
to
4144289
Compare
4144289
to
84cad37
Compare
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/child_process@1.0.2, npm/circom_tester@0.0.19 |
// from nozee (emmaguo13, sehyunc, kaylee) | ||
// https://github.com/emmaguo13/zk-blind/blob/master/circuits/ascii.circom | ||
// only converts ascii to numbers from 0-9 | ||
template AsciiToNum (max_input) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is imported from Nozee so shouldn't be deleted, but moved to string utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ascii.circom was removed. Moved and renamed the similar circuit from email wallet to utils/bytes.circom (DigitBytesToInt)
We already had a similar circuit in email wallet which was imported here. So this one was deleted.
Description
EmailVerifier
: Renamed signal names; minor refactoring like rearranging variables, updating comments, etcin_padded
->emailHeader
in_len_padded_bytes
->emailHeaderLength
body_hash_idx
->bodyHashIndex
precomputed_sha
->precomputedSHA
in_body_padded
->emailBody
in_body_len_padded_bytes
->emailBodyLength
pubkey_hash
->pubkeyHash
VarShiftLeft
: Moved toutils/array.circom
;QuinSelector
: Moved toutils/array.circom
; renamed toItemAtIndex
; Removed the second parameter ofnumBits
and calculate it internally (log2Ceil(maxLength
))AssertZeroes
: Moved toutils/array.circom
; renamed toAssertZeroPadding
;Packed2Bytes
: Removed - it was not used anywhere;Bytes2Packed
andPackBytes
: Removed and replaced withBytes2Ints
from email wallet - single circuit that does int[] to bytes[] -Bytes2Packed
was doing "assign and then constrain later" which is not the case inBytes2Ints
; Renamed and added asPackBytes
inbytes.circom
.ShiftAndPack
: Moved toutils/bytes.circom
; Renamed toPackByteSubArray
; Added logic to set value after subarray length (new input) to zero as packing without this is not safe (using a new circuitSelectSubArray
inarray.circom
); we dont use these two circuits anywhere though; set packsize to 31VarShiftMaskedStr
: Moved toutils/regex.circom
; Renamed toExtractRegexReveal
; added assertions to check data after maxRevealLength is zero (old TODO); Renamedshift
tostartIndex
ShiftAndPackMaskedStr
: moved toutils/regex.circom
; Renamed toPackRegexReveal
; use 31 as pack size instead of template paramClearSubarrayAfterEndIndex
: Removed - it was not used anywhere; also seems to have off by one error.ascii.circom
was removed. Moved and renamed the similar circuit from email wallet toutils/bytes.circom
(DigitBytesToInt
)fp.circom
,base64.circom
, 'bigint.circom',bigint_func.circom
(changed_
to-
in filename) moved tolib
sha.circom
,sha256general.circom
,sha256partial.circom
merged to one filesha.circom
and moved tolib
; inputsin_padded
andin_len_padded_bytes
renamed topaddedIn
andpaddedInLength
in all sha circuits; removed unused/commented outSha256NBytes
circuitrsa.circom
moved tolib/rsa.circom
; renamed toRSAVerifier65537
(fromRSAVerify65537
);base_message
input renamed tomessage
log2
- removed as this was off by one; replaced usages withlog2Ceil
log2Ceil
- moved toutils/functions.circom
Some constants (field max bytes, max length for domain, email addr) from email wallet moved to
utils/constants.circom
Email nullifier from email wallet moved to
helpers/nullifier.circom
PoseidonLarge
circuit added toutils/hash.circom
to hash large number of inputs; This is used to hash pub key inEmailVerifier
and hash signature inEmailNullifier
circuitUpdate all circuits to
pragma 2.1.6
Update input generation helper to use new input names
Update tests to match new circuits
Type of Change
Please delete options that are not relevant.
Checklist: