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

Simplify creating types from bytes (remove default()/copy_from_slice()/from_repr()) #2

Open
conradoplg opened this issue Nov 19, 2021 · 0 comments

Comments

@conradoplg
Copy link
Contributor

To create certain types from bytes we need to go through a bunch of steps, e.g.

let mut repr = <S::Scalar as PrimeField>::Repr::default();
repr.as_mut().copy_from_slice(&s_bytes);
let maybe_scalar = S::Scalar::from_repr(repr);

It seems this could be improved by const_evaluatable_checked which has not stabilized yet. Check if that is the best solution or if there is an alternative, and implement it if possible.

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