Skip to content
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

Rename ak to ak_P in the circuit impl #260

Closed
str4d opened this issue Dec 13, 2021 · 0 comments
Closed

Rename ak to ak_P in the circuit impl #260

str4d opened this issue Dec 13, 2021 · 0 comments
Assignees
Milestone

Comments

@str4d
Copy link
Contributor

str4d commented Dec 13, 2021

The SpendValidatingKey type is designed such that by construction, the byte encodings of ak and ak_P are identical. However, once we expose the underlying point representation, we should use the names of the individual types to match the protocol spec. So the following places in the circuit code should use ak_P:

orchard/src/circuit.rs

Lines 365 to 371 in 99b767a

// Witness ak.
let ak: Option<pallas::Point> = self.ak.as_ref().map(|ak| ak.into());
let ak = NonIdentityPoint::new(
ecc_chip.clone(),
layouter.namespace(|| "ak"),
ak.map(|ak| ak.to_affine()),
)?;

orchard/src/circuit.rs

Lines 593 to 594 in 99b767a

// [alpha] SpendAuthG + ak
let rk = alpha_commitment.add(layouter.namespace(|| "rk"), &ak)?;

And then here, instead of implicitly creating ak from ak_P, we should add a let ak = ... above the rivk definition:

orchard/src/circuit.rs

Lines 606 to 612 in 99b767a

let rivk = self.rivk.map(|rivk| rivk.inner());
commit_ivk_config.assign_region(
config.sinsemilla_chip_1(),
ecc_chip.clone(),
layouter.namespace(|| "CommitIvk"),
*ak.extract_p().inner(),

@str4d str4d self-assigned this Apr 28, 2022
str4d added a commit that referenced this issue Apr 29, 2022
@str4d str4d added this to the Release 5.0.0 milestone Apr 29, 2022
@ebfull ebfull closed this as completed in f08a2a3 May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant