Skip to content

Commit

Permalink
Define U224 and U544 on 32-bit platforms (#179)
Browse files Browse the repository at this point in the history
These are useful for P-224 and P-521 respectively.

They're gated on the target using 32-bit limbs (since neither is a
multiple of 64).

fiat-crypto provides P-224 field arithmetic for 32-bit platforms that
uses 7 limbs, for example.
  • Loading branch information
tarcieri authored Feb 5, 2023
1 parent a68fe3b commit 3814e86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ impl_uint_aliases! {
(U8192, 8192, "8192-bit")
}

#[cfg(target_pointer_width = "32")]
impl_uint_aliases! {
(U224, 224, "224-bit"), // For NIST P-224
(U544, 544, "544-bit") // For NIST P-521
}

// TODO(tarcieri): use `const_evaluatable_checked` when stable to make generic around bits.
impl_concat! {
(U64, 64),
Expand Down

0 comments on commit 3814e86

Please sign in to comment.