[RFC] Extend bit/byte conversion RFC.

Add a paragraph clarifying what an adequate implementation strategy could be.
In any case, we are likely to go with methods on scalar types directly.
This commit is contained in:
Alessandro Coglio 2021-08-16 10:48:24 -07:00
parent 6e264b86ef
commit 6047886446

View File

@ -203,6 +203,14 @@ function i128_from_bytes_le(x: [u8; 16]) -> i128;
function i128_from_bytes_be(x: [u8; 16]) -> i128;
```
## Handling of the Native Functions
Given the relatively large number and regular structure of the functions above,
it makes sense to generate them programmatically (e.g. via Rust macros),
rather than enumerating all of them explicitly in the implementation.
It may also makes sense, at R1CS generation time,
to use generated or suitably parameterized code to recognize them and turn them into the corresponding gadgets.
## Transition to Methods
Once a separate proposal for adding methods to Leo scalar types is realized,