You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without the compiler supporting const fns, we are limited in the contexts in which we can use BitLength. @samscott89 noted that we may be able to make BitLength a newtype struct BitLength(usize), which might be able to let us use it in more contexts before const fns are available. That sounds good to me, but we should add some TODO comments about reversing that once we have const fns.
Similarly, we have code like this for converting from bits to bytes:
Also, it's a good idea to update STYLE.md to mention the conventions for using BitLength, assuming usize-typed lengths are in bytes, using the _len/_LEN suffix for byte-delineated lengths, and using the _bits/_BITS suffix for lengths delineated in bits.
In order to do this completely we'd need to handle non-usize types, especually u64 for SHA-256/SHA-384/SHA-512, and unsigned for GFp_AES_set_encrypt_key`.
Activity
briansmith commentedon Nov 15, 2016
Searching for "8 ", " 8", "+ 7", and "/ 8" is a good way to find relevant code.
briansmith commentedon Nov 15, 2016
Also, it's a good idea to update STYLE.md to mention the conventions for using
BitLength, assumingusize-typed lengths are in bytes, using the_len/_LENsuffix for byte-delineated lengths, and using the_bits/_BITSsuffix for lengths delineated in bits.pietro commentedon Jan 15, 2019
Some work done on the branch mentioned on #346. If you're ok with that I'll go after the "/ 8" left in the codebase.
briansmith commentedon Mar 25, 2019
In order to do this completely we'd need to handle non-usize types, especually
u64for SHA-256/SHA-384/SHA-512, andunsigned forGFp_AES_set_encrypt_key`.