Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this crate implement RFC3394? #2

Closed
hwiorn opened this issue Dec 25, 2020 · 1 comment
Closed

Does this crate implement RFC3394? #2

hwiorn opened this issue Dec 25, 2020 · 1 comment

Comments

@hwiorn
Copy link

hwiorn commented Dec 25, 2020

This is an AES-KW (RFC 3394 / RFC 5649) implementation for Rust.

I thought this crate had implemented RFC3394. I tested RFC3394 test-vectors, but the test got always AuthenticationFailed.
I compared this crate and the aes_keywrap module of Python. And I found out this crate implemented only RFC5649.

    let mut kek: [u8; 16] = [0; 16];
    hex::decode_to_slice("000102030405060708090A0B0C0D0E0F", &mut kek).expect("");
    let cipher = hex::decode("1FA68B0A8112B447AEF34BD8FB5A7B829D3E862371D2CFE5").expect("");
    let plain = hex::decode("00112233445566778899AABBCCDDEEFF").expect("");
    let aes_kw = Aes128KeyWrap::new(&kek);
    assert_eq!(cipher, aes_kw.encapsulate(&plain).unwrap()); // Got assertion failed.
    assert_eq!(plain, aes_kw.decapsulate(&cipher, kek.len()).unwrap()); // Got authentication failed.

Could you check this out?

@jedisct1
Copy link
Owner

The reference to RFC3394 has been removed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants