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

Re-work u5 to be a field element in GF32 #94

Closed
tcharding opened this issue Mar 22, 2023 · 2 comments
Closed

Re-work u5 to be a field element in GF32 #94

tcharding opened this issue Mar 22, 2023 · 2 comments

Comments

@tcharding
Copy link
Member

All the while working on this crate I have mistook the u5 type to be a general purpose integer type. To improve the API and help the next non-mathematician reading the code we could re-work the u5 type to make its purpose more explicit.

I think of u5 as a field element in GF32, definitely not as a standalone integer type. We could rename it if this is confusing.

Do we have Add and Mul implemented on this type, and do they respect field operations or "mod 32" operatons?

To be clearer: this crate has no use for integers mod 32, and I can't think of any crate that does.

ref: #89 (comment)

Consider fixing #80 at the same time.

@apoelstra
Copy link
Member

codex32 https://github.com/BlockstreamResearch/codex32/tree/master/reference/rust-codex32 has a Fe type which is the same as u5 in this library.

It's not obvious that either lib should depend on the other though so actually sharing a type doesn't seem clear.

@tcharding
Copy link
Member Author

Closing as this was implicitly resolved by the recent crate re-write.

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

2 participants