EME2 Mode (wide-block mode)
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- rust
- 领域
- cryptography
调研方向
首先审查现有的 eme2 crate 及其基于 IEEE P1619.2 的设计,然后将其 API 与 RustCrypto block-modes 生态系统进行比较。检查报告中的 AES 和 Serpent 测试以及 ciphertext-stealing 行为。完成的标准是确定一致认可的 upstream 集成路径、兼容的公共 API 和合适的测试向量。
由索引模型根据 Issue 内容生成。
描述
Hi everyone!
I would like to propose adding the EME2 (Encrypt-Mix-Encrypt Version 2) mode of operation to the RustCrypto workspace. I've implemented it in pure Rust based on the IEEE P1619.2 specification, and it is currently published independently on crates.io as eme2.
If merged, this would introduce the first truly wide-block encryption mode to the RustCrypto block-modes ecosystem.
Implementation Details
- Pure Rust: The current crate is written entirely in Rust.
- It is EME2, not EME: It implements the ciphertext stealing logic described in the "EME*" which is standard for the EME2. No padding required.
- Cipher Agnostic: It is successfully tested against RustCrypto's
aesandserpentbackends. - Testing: Verified against self-computed test vectors. (Note: I can integrate the official IEEE 1619.2 test vectors during the PR process, IF any of you have the IEEE PDF or test vectors for EME2 which are hidden behind paywall).
API Design & Trait Compatibility
I have designed the API to be as compatible as possible with the broader RustCrypto ecosystem, but there is one necessary architectural divergence:
Because EME2 is a two-pass wide-block cipher mode, it inherently requires different logic for encryption and decryption. Therefore, it cannot implement the StreamCipher trait's .apply_keystream() method (where encryption and decryption are identical XOR operations). Instead, the crate currently exposes explicit .encrypt() and .decrypt() methods to handle the distinct multi-pass operations. There is simply NO way to squeeze EME2 into a single .apply_keystream operation per it's design.
It is documented in the crate descriptions as well as edge case with the threefish cipher.
Next Steps
I would love to upstream this into the RustCrypto organization so others can easily access a modern, wide-block mode.
Are the maintainers open to a Pull Request for this? If so, I am more than happy to open PR request or hear recommendation before submitting.
- 主要语言
- Rust
- 星标
- 99
- 派生
- 23
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustCrypto/block-modes 的其他 Issue
-
XTS mode未关闭
难度 5/5 一周以上 新手友好度 20/100
RustCrypto/block-modes#73 · 3 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
RustCrypto/block-modes#31 · 5 条评论 ·
-
help wanted
难度 5/5 一周以上 新手友好度 25/100
RustCrypto/block-modes#1 · 8 条评论 ·
查看 RustCrypto/block-modes 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
home-assistant/installer#308 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ProvableHQ/leo#29657 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
swc-project/swc-next#1053 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nautechsystems/nautilus_trader#5387 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
NomicFoundation/edr#1872 ·
维护者通常 2 天内回复