Skip to content

Commit

Permalink
crypto-bigint: add UInt::new (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Jun 22, 2021
1 parent e955688 commit ccfb552
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crypto-bigint/src/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ impl<const LIMBS: usize> UInt<LIMBS> {
limbs: [Limb::MAX; LIMBS],
};

/// Const-friendly [`UInt`] constructor.
pub const fn new(limbs: [Limb; LIMBS]) -> Self {
Self { limbs }
}

/// Borrow the limbs of this [`UInt`].
// TODO(tarcieri): eventually phase this out?
pub const fn limbs(&self) -> &[Limb; LIMBS] {
Expand Down

0 comments on commit ccfb552

Please sign in to comment.