diff --git a/src/constant_time.rs b/src/constant_time.rs index 3b033a8b28..52a44d6bdd 100644 --- a/src/constant_time.rs +++ b/src/constant_time.rs @@ -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 diff --git a/src/constant_time/word.rs b/src/constant_time/word.rs new file mode 100644 index 0000000000..614cda569e --- /dev/null +++ b/src/constant_time/word.rs @@ -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;