Skip to content
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

Conversation

wjuan-mob
Copy link
Contributor

Adding a bit reverse utility function. This is useful for things like CircuitOram picking branches to evict.

…b/mc-oblivious into CircuitOram/AddingLinearityTest
…c-oblivious into CircuitOram/RefactorPathOram
…c-oblivious into CircuitOram/RefactorPathOram
@wjuan-mob wjuan-mob changed the base branch from feature/CircuitOram to master May 12, 2022 16:37
@wjuan-mob wjuan-mob changed the base branch from master to feature/CircuitOram May 12, 2022 16:37
mc-oblivious-traits/src/lib.rs Outdated Show resolved Hide resolved
mc-oblivious-traits/src/lib.rs Outdated Show resolved Hide resolved
wjuan-mob and others added 2 commits May 13, 2022 01:53
@wjuan-mob wjuan-mob requested a review from remoun May 13, 2022 06:41
/// 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
Copy link
Contributor

@cbeck88 cbeck88 May 13, 2022

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)

Copy link
Contributor Author

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.

Copy link
Contributor

@cbeck88 cbeck88 left a 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

@wjuan-mob wjuan-mob closed this May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants