Skip to content

Commit

Permalink
Split constant_time::Word into a submodule.
Browse files Browse the repository at this point in the history
```
git difftool HEAD^1:src/constant_time.rs src/constant_time/word.rs
```
  • Loading branch information
briansmith committed Dec 7, 2024
1 parent 8eee469 commit a704f57
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/constant_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@
use crate::{c, error};

mod boolmask;
mod word;

#[cfg(target_pointer_width = "64")]
pub(crate) type Word = u64;

#[cfg(target_pointer_width = "32")]
pub(crate) type Word = u32;

pub(crate) use self::boolmask::BoolMask;
pub(crate) use self::{boolmask::BoolMask, word::Word};

/// Returns `Ok(())` if `a == b` and `Err(error::Unspecified)` otherwise.
/// The comparison of `a` and `b` is done in constant time with respect to the
Expand Down
19 changes: 19 additions & 0 deletions src/constant_time/word.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2015-2016 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

#[cfg(target_pointer_width = "64")]
pub(crate) type Word = u64;

#[cfg(target_pointer_width = "32")]
pub(crate) type Word = u32;

0 comments on commit a704f57

Please sign in to comment.