-
Notifications
You must be signed in to change notification settings - Fork 120
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
VID dispersal, commitment should take an iterator over u8
instead of &[u8]
#375
Comments
Problem
jellyfish/utilities/src/conversion.rs Lines 129 to 131 in f6866c5
Unfortunately, current impls of these functions need to know the size up front. We could do it if we require the iterator to be Thus, any solution to this issue requires a change to |
duplicate of #300 . But the above comment is new. |
Candidate solutionAs described in #300, Currently we prefix the output with a field element that encodes the byte length of the input. Don't do this because it requires knowing the byte length at the beginning. Instead, append an additional field element at the end of the iterator that encodes the number of bytes to discard from the final field element. Example: Field elements take 32 bytes, but the input byte length is 14 mod 32, so we append an additional field element that encodes the number 14, indicating that only the first 14 bytes of the final field element are part of the input and so the remaining 18 bytes should be discarded. This solution requires |
jellyfish/primitives/src/vid/mod.rs
Lines 56 to 59 in f6866c5
This forces the caller to marshal its data as a contiguous
u8
slice, which is a waste of time and memory.The text was updated successfully, but these errors were encountered: