From 6e264b86ef9b05ef6a09869567cef6b55fde2e23 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 16 Aug 2021 10:44:10 -0700 Subject: [PATCH] [RFC] Extend bit/byte conversion RFC. Add an alternative in which we go to methods directly. This seems more likely at this point, given that we seem to have a fairly simple and quick way to support methods on scalar types that does not involve turning scalar types into circuit types. --- docs/rfc/009-bit-byte-conversions.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/rfc/009-bit-byte-conversions.md b/docs/rfc/009-bit-byte-conversions.md index 513b408b94..586b6c40f8 100644 --- a/docs/rfc/009-bit-byte-conversions.md +++ b/docs/rfc/009-bit-byte-conversions.md @@ -263,3 +263,14 @@ such as `u64_to_u16s_le`, which would turn a `u64` into a `[u16; 4]`. In general, it makes sense to convert between `uN` or `iN` and `[uM; P]` when `N == M * P`. If Leo were extended with types `uN` and `iN` for all positive `N` as proposed elsewhere, there could be a family of all such conversions. + +## Methods Directly + +Given that we eventually plan to use methods on scalar types for these conversions, +it may make sense to do that right away. +This is predicated on having support for methods on scalar types, +for which a separate RFC is in the works. + +If we decide for this approach, we will revise the above proposal to reflect that. +The concepts and (essential) names and input/output types remain unchanged, +but the conversions are packaged in slightly different form.