Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a74e70a

Browse files
committedJun 8, 2021
elliptic-curve: add TODO for replacing UInt with an associated constant
Ideally instead of specifying a `Curve::UInt` associated type, we could instead specify a constant, and then pass that as a const generic parameter to `crypto_bigint::UInt`. Unfortunately that requires a lot more functionality than is implemented in `min_const_generics`: rust-lang/rust#60551 This commit makes a note of as much in the comments, calling it out as future work.
1 parent 5708e79 commit a74e70a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎elliptic-curve/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ pub const ALGORITHM_OID: pkcs8::ObjectIdentifier =
110110
/// curves (e.g. [`SecretKey`]).
111111
pub trait Curve: Clone + Debug + Default + Eq + Ord + Send + Sync {
112112
/// Integer type used to represent field elements of this elliptic curve.
113+
// TODO(tarcieri): replace this with an e.g. `const Curve::MODULUS: uint`.
114+
// Requires rust-lang/rust#60551, i.e. `const_evaluatable_checked`
113115
type UInt: AsRef<[bigint::Limb]>
114116
+ ArrayEncoding
115117
+ Copy

0 commit comments

Comments
 (0)
Failed to load comments.