-
Notifications
You must be signed in to change notification settings - Fork 38
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
shared secret #237
shared secret #237
Changes from 15 commits
f9f7359
c64c0f4
c42542a
fb60b1d
928f50f
c0b4bd8
ae3462c
466e4f8
f59759e
746a342
c9507e6
7e4678f
6a15e7e
4ba6651
edfb8ba
0cf072f
ab430f2
2544928
e865303
8d08e54
3454678
9a650f8
6f68371
8631c0c
5ebfc6b
6f4dbed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,24 +166,27 @@ class BoilerplateGenerator { | |
]; | ||
}, | ||
|
||
parameters({ name: x, typeName }): string[] { | ||
parameters({ name: x, typeName, reinitialisable }): string[] { | ||
// prettier-ignore | ||
if(!reinitialisable) | ||
return [ | ||
`private ${typeName ? typeName : 'field'} ${x}_oldCommitment_value`, | ||
`private field ${x}_oldCommitment_salt`, | ||
]; | ||
}, | ||
|
||
preStatements({ name: x, typeName }): string[] { | ||
preStatements({ name: x, typeName, reinitialisable }): string[] { | ||
// For a state variable, we'll have passed in `${x}_oldCommitment_value` as a parameter. But our AST nodes will be using `${x}`. This line resolves the two. | ||
if (reinitialisable) | ||
return [ `${typeName ? typeName : 'field'} ${x} = 0`]; | ||
kKahina marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ${x}=0, because commitment are not nullified ? |
||
return [ | ||
` | ||
${typeName ? typeName : 'field'} ${x} = ${x}_oldCommitment_value`, | ||
]; | ||
}, | ||
|
||
postStatements({ name: x, structProperties }): string[] { | ||
if (structProperties) | ||
postStatements({ name: x, structProperties, reinitialisable }): string[] { | ||
if (structProperties && !reinitialisable) | ||
return [ | ||
` | ||
// ${x}_oldCommitment_commitment: preimage check | ||
|
@@ -195,6 +198,7 @@ class BoilerplateGenerator { | |
${x}_oldCommitment_salt\\ | ||
])`, | ||
]; | ||
if(!reinitialisable) | ||
return [ | ||
` | ||
// ${x}_oldCommitment_commitment: preimage check | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the changes on line 110 and lines 139-141 related to this pull request or are they from when the nullifier checking was being changed? |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is line 63 one of the nullifier changes? |
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.
Is the containsAccessedOnlyStates relevant to this pull request?