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

Remove unused construct_tag_hash and Ciphertext.check() #144

Closed
cygnusv opened this issue Jul 20, 2023 · 0 comments · Fixed by #149
Closed

Remove unused construct_tag_hash and Ciphertext.check() #144

cygnusv opened this issue Jul 20, 2023 · 0 comments · Fixed by #149
Labels
enhancement New feature or request

Comments

@cygnusv
Copy link
Member

cygnusv commented Jul 20, 2023

There's currently 2 versions of construct_tag_hash(), and on of them seems incorrect:

fn construct_tag_hash(&self) -> Result<E::G2Affine> {
let mut hash_input = Vec::<u8>::new();
self.commitment.serialize_compressed(&mut hash_input)?;
hash_input.extend_from_slice(&self.ciphertext);
hash_to_g2(&hash_input)
}

As you can see, the AAD is not there. It's also just used here:

let hash_g2 = E::G2Prepared::from(self.construct_tag_hash()?);

This is part the function Ciphertext.check(), which is unused.

I propose removing both.

@cygnusv cygnusv added the enhancement New feature or request label Jul 20, 2023
piotr-roslaniec pushed a commit that referenced this issue Aug 16, 2023
* Remove unused Ciphertext.construct_tag_hash()
* Refactor Ciphertext.check() to take the functionality of check_ciphertext_validity() function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant