elliptic-curve: fields with lazy reduction
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- rust
- 领域
- cryptography
调研方向
首先审查链接的 curve25519-dalek PR 787 和 813,以及此处描述的 LazyField、EagerField 和 LazyFieldWithCapacity 提案。确定这些 traits 应归属于 ff、primefield、elliptic-curve,还是新的 RustCrypto crate;在就 upstream 位置达成一致并完成设计审查后,任务才算完成。
由索引模型根据 Issue 内容生成。
描述
When exposing FieldElement from curve25519-dalek (https://github.com/dalek-cryptography/curve25519-dalek/pull/787), it was noted how curve25519-dalek only reduces its field element occasionally and how the proposed PR fails to model that in the name of safety. https://github.com/dalek-cryptography/curve25519-dalek/pull/813 resolved this by introducing LazyField, a trait for a field which only occasionally performs reductions, using typenum to track capacity consumption via the Rust type system. This allows reducing when reductions occur, while ensuring operations remain well-defined.
In practice, for performance, there's no reason not to use LazyFieldWithCapacity<U1>. Any existing field can be wrapped with EagerField to achieve API compatibility. Any field with any capacity is benefited. It is suboptimal for fields with even greater capacity, yet those would already lose their benefit if Field alone was used (which would mandate performing a reduction after every single operation to remain well-defined in a constant-time context).
Ideally, these traits do not permanently reside in curve25519-dalek yet are upstreamed somewhere they can achieve wider adoption from. This would mean ff(which so far hasn't adopted typenum) or somewhere in the RustCrypto ecosystem (primefield, elliptic-curve, or a new crate). I wanted to create this issue to discuss the traits and where would be optimal for them. I'd also like to invite review over them. While I believe my prototype accomplishes its goals, and is fine to be published under curve25519_dalek::hazmat for now to accomplish the goals of finally exposing the curve25519_dalek FieldElement type, I also believe they could benefit from further review and fine-tuning.
- 主要语言
- Rust
- 星标
- 756
- 派生
- 256
- 平均合并
- 1 小时 27 分钟
- 30 天内合并 PR
- 2
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustCrypto/traits 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 52/100
RustCrypto/traits#2487 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
RustCrypto/traits#2482 · 5 条评论 ·
-
难度 5/5 一周以上 新手友好度 32/100
RustCrypto/traits#2478 · 5 条评论 ·
-
cipher
难度 4/5 3-5 天 新手友好度 38/100
RustCrypto/traits#2424 ·
-
难度 5/5 一周以上 新手友好度 25/100
RustCrypto/traits#2401 ·
查看 RustCrypto/traits 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2413 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
难度 2/5 1-3 小时 新手友好度 75/100
-
todo:ticket
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
taikoxyz/taiko-mono#22168 · 1 条评论 ·