-
Notifications
You must be signed in to change notification settings - Fork 13
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
Circuit oram/bit reverse #27
Circuit oram/bit reverse #27
Conversation
…b/mc-oblivious into CircuitOram/AddingLinearityTest
…c-oblivious into CircuitOram/RefactorPathOram
…c-oblivious into CircuitOram/RefactorPathOram
…tOram/RefactorPathOram
Co-authored-by: Remoun Metyas <remoun.metyas@gmail.com>
/// num_bits_needed. s.t. bit_reverse(0001, 3) returns 0100. | ||
#[inline] | ||
pub const fn bit_reverse(num: u64, num_bits_needed: u32) -> u64 { | ||
// Build up the result in reversed by appending least significant bits and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust stabilized a bit reverse built-in function: rust-lang/rust#48763
It's probably much faster than this, do we actually need this function?
It seems like we could make this a one liner instead e.g. arg.reverse() >> (64-num_bits_needed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh neat. Didn't know about this. Let me look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify, possibly don't do this at all
Adding a bit reverse utility function. This is useful for things like CircuitOram picking branches to evict.