-
Notifications
You must be signed in to change notification settings - Fork 8
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
ML-DSA: Add bit packing functions #183
Comments
marsella
added a commit
that referenced
this issue
Dec 4, 2024
Also modifies simple unpack to use a paradigm I've decided is nicer.
marsella
added a commit
that referenced
this issue
Dec 4, 2024
Also modifies simple unpack to use a paradigm I've decided is nicer.
marsella
added a commit
that referenced
this issue
Dec 4, 2024
marsella
added a commit
that referenced
this issue
Dec 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are 4 functions for packing and unpacking between byte strings and elements in
R
that fall into a restricted range.In all of them, the parameters
a
andb
I think can be encoded as types -- I looked through and they're all fully defined in terms of constants and parameters, and the parameters can easily be encoded as types. For the non-simple functions, the polynomial's coefficients are supposed to be in the range[-a, b]
; we can't represent a negative number using a type but sincea
itself is passed as the positive value and we don't actually do any checking in the functions, I think it's ok.Most of the functionality already exists in the IPD version; we should be able to pull much of it in. A few changes I anticipate:
SimpleBitPack
, the IPD version usesb
as a parameter, but it actually representsbitlen b
. I think we should try to match the spec more exactly -- either by calling that parameterbitlen_b
or passingb
and usingwidth b
inline. I suspect this pattern is true across all the functions, and we should be consistent whatever we choose.BitPack
andBitUnpack
use the productab
as a type parameter. I think we should takea
andb
separately.Step 2.
) and any extra notes that might be helpful for someone trying to compare the two.These are followed by the
HintPack
andHintUnpack
functions, but I think those will be harder to express in Cryptol so I am punting them to a separate issue & PR.SimpleBitPack
SimpleBitUnpack
BitPack
BitUnpack
BitUnpack
is the inverse ofBitPack
. Maybe check that all the coefficients are in the correct range, too (unless that's given by the choice of input). Add docstrings with valid parameter choices.The text was updated successfully, but these errors were encountered: