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

code generation support #94

Closed
mmcloughlin opened this issue May 3, 2021 · 2 comments
Closed

code generation support #94

mmcloughlin opened this issue May 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@mmcloughlin
Copy link
Owner

People use this package for code generation support #93. The current output is intended to be as concise as possible, similar to the descriptions in The Most Efficient Known Addition Chains for Field Element & Scalar Inversion for the Most Popular & Most Unpopular Elliptic Curves. However this format can be a little annoying to convert into code. See for example the decoding_AddChains.py script.

The ec3 project has code to output a Go program for a given addition chain:

https://github.com/mmcloughlin/ec3/blob/3948e750fa5e745b6f160c22d5b8fab3dc6436e7/gen/fp/api.go#L219-L282

Providing access to this logic would be helpful. Specifically, temporary variable allocation and the sequence of add, double and shift operations.

@mmcloughlin mmcloughlin added the enhancement New feature or request label May 3, 2021
This was referenced Oct 5, 2021
mmcloughlin added a commit that referenced this issue Oct 27, 2021
We intend to expose package metadata through the code generation interface
#94. If so, it seems wrong to publically expose an internal package. Instead
of duplicating data we'll just make it public instead.
mmcloughlin added a commit that referenced this issue Oct 27, 2021
Expand the metadata properties with additional fields, intended for use in
code generation (see #94).
@mmcloughlin
Copy link
Owner Author

mmcloughlin commented Oct 27, 2021

@jedisct1 @mratsim @armfazh I've just landed initial support for templated output generation. I suspect this would have made your lives a lot easier when using addchain in your projects. It would be great to get your thoughts.

https://github.com/mmcloughlin/addchain/blob/master/doc/gen.md

(Note I know of some limitations already #128.)

@jedisct1
Copy link

Thank you for this addition. This is going to be super useful!

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

No branches or pull requests

2 participants