API Gap: KeyWrapper, KeyUwrapper
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
These are also on the OpenSSL list with the driving specifications being SP 800-38F "Recommendation for Block Cipher Modes of Operation: Methods for Key Wrapping" and RFC 5649.
Primarily the algorithms described are for AES and TDES, however Aria and Camellia (and I think SM4, not 100% sure....) support the same algorithms.
The algorithms require the full material being wrapped to be passed in.
Typing all this into Opus resulted in a suggestion looking like this:
pub trait KeyWrapper<const KEK_LEN: usize>: Algorithm {
/// Half the underlying block cipher's block size, in bytes -- "semiblock", Sec. 4.1.
/// 8 for KW and KWP (128-bit block); 4 for TKW (TDEA, 64-bit block).
const SEMIBLOCK_LEN: usize;
/// Wraps `key` under `kek`. `CT_LEN` is determined by `KEY_LEN` and checked at compile time.
///
/// # Errors
/// Rejects a KEK whose [`KeyType`] is not [`KeyType::SymmetricCipherKey`], and one whose
/// security strength is below that of the key being wrapped (Appendix A.2), both as
/// [`KeyWrapError::KeyMaterialError`].
fn wrap_key<const KEY_LEN: usize, const CT_LEN: usize>(
kek: &KeyMaterial<KEK_LEN>,
key: &KeyMaterial<KEY_LEN>,
) -> Result<[u8; CT_LEN], KeyWrapError>;
/// As [`wrap_key`](Self::wrap_key), writing into a caller-provided buffer. Returns the number
/// of bytes written, which is always `CT_LEN`.
fn wrap_key_out<const KEY_LEN: usize, const CT_LEN: usize>(
kek: &KeyMaterial<KEK_LEN>,
key: &KeyMaterial<KEY_LEN>,
ciphertext: &mut [u8; CT_LEN],
) -> Result<usize, KeyWrapError> {
*ciphertext = Self::wrap_key(kek, key)?;
Ok(CT_LEN)
}
}
With an equivalent trait for KeyUnwrapper. I note KeyWrapErrror is also new.
Also of note is that these algorithms (especially the KWP (padded) format), get used for things other than symmetric and private keys. So while the suggestion above shows KeyMaterial going in (mostly correct) input as [u8] might be better.
- Lingua principale
- Rust
- Stelle
- 25
- Fork
- 18
- Merge medio
- 7g 13m
- PR unite (30g)
- 3
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bcgit/bc-rust
-
Improve docs in FactoriesForse già presa @pollychen-lab l’ha presa 13 giorni fa. Apertadocumentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
bcgit/bc-rust#161 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
Framework for asmForse già presa @mwcw l’ha presa 2 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
bcgit/bc-rust#168 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di bcgit/bc-rust
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bytecodealliance/rustix#1703 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
linux build warningAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Pomax/vst-plugins#24 ·
I maintainer di solito rispondono entro 1 giorno
-
V1 manifest lists written by Java lose added/existing/deleted file countsForse già presa @kacper-li-airspace-intelligence l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/iceberg-rust#3445 ·
I maintainer di solito rispondono entro 4 giorni
-
Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)Forse già presa @mangeshraut712 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
CapSoftware/Cap#2546 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno