webcrypto: implement raw hmac export (#39059)

Implement raw export of HMAC keys. JWT export of HMAC keys will come in
a separate PR.

Testing: WPT
Fixes: Partially #39060

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
Ashwin Naren 2025-08-31 22:34:29 -07:00 committed by GitHub
parent 6e92e1d7d5
commit 9d5aa9973a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 2890 deletions

View file

@ -829,12 +829,13 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
}
let exported_key = match alg_name.as_str() {
ALG_AES_CBC | ALG_AES_CTR | ALG_AES_KW | ALG_AES_GCM => subtle.export_key_aes(format, &key),
ALG_HMAC => subtle.export_key_hmac(format, &key),
_ => Err(Error::NotSupported),
};
match exported_key {
Ok(k) => {
match k {
AesExportedKey::Raw(k) => {
ExportedKey::Raw(k) => {
let cx = GlobalScope::get_cx();
rooted!(in(*cx) let mut array_buffer_ptr = ptr::null_mut::<JSObject>());
create_buffer_source::<ArrayBufferU8>(cx, &k, array_buffer_ptr.handle_mut(),
@ -842,7 +843,7 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
.expect("failed to create buffer source for exported key.");
promise.resolve_native(&array_buffer_ptr.get(), CanGc::note())
},
AesExportedKey::Jwk(k) => {
ExportedKey::Jwk(k) => {
promise.resolve_native(&k, CanGc::note())
},
}
@ -911,8 +912,8 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
};
let bytes = match exported_key {
AesExportedKey::Raw(k) => k,
AesExportedKey::Jwk(key) => {
ExportedKey::Raw(k) => k,
ExportedKey::Jwk(key) => {
// The spec states to convert this to an ECMAscript object and stringify it, but since we know
// that the output will be a string of JSON we can just construct it manually
// TODO: Support more than just a subset of the JWK dict, or find a way to
@ -2254,12 +2255,12 @@ impl SubtleCrypto {
/// <https://w3c.github.io/webcrypto/#aes-cbc-operations>
/// <https://w3c.github.io/webcrypto/#aes-ctr-operations>
fn export_key_aes(&self, format: KeyFormat, key: &CryptoKey) -> Result<AesExportedKey, Error> {
fn export_key_aes(&self, format: KeyFormat, key: &CryptoKey) -> Result<ExportedKey, Error> {
match format {
KeyFormat::Raw => match key.handle() {
Handle::Aes128(key_data) => Ok(AesExportedKey::Raw(key_data.as_slice().to_vec())),
Handle::Aes192(key_data) => Ok(AesExportedKey::Raw(key_data.as_slice().to_vec())),
Handle::Aes256(key_data) => Ok(AesExportedKey::Raw(key_data.as_slice().to_vec())),
Handle::Aes128(key_data) => Ok(ExportedKey::Raw(key_data.as_slice().to_vec())),
Handle::Aes192(key_data) => Ok(ExportedKey::Raw(key_data.as_slice().to_vec())),
Handle::Aes256(key_data) => Ok(ExportedKey::Raw(key_data.as_slice().to_vec())),
_ => Err(Error::Data),
},
KeyFormat::Jwk => {
@ -2300,7 +2301,7 @@ impl SubtleCrypto {
x: None,
y: None,
};
Ok(AesExportedKey::Jwk(Box::new(jwk)))
Ok(ExportedKey::Jwk(Box::new(jwk)))
},
_ => Err(Error::NotSupported),
}
@ -2458,6 +2459,18 @@ impl SubtleCrypto {
Ok(key)
}
/// <https://w3c.github.io/webcrypto/#hmac-operations-export-key>
fn export_key_hmac(&self, format: KeyFormat, key: &CryptoKey) -> Result<ExportedKey, Error> {
match format {
KeyFormat::Raw => match key.handle() {
Handle::Hmac(key_data) => Ok(ExportedKey::Raw(key_data.as_slice().to_vec())),
_ => Err(Error::Operation),
},
// FIXME: Implement JWK export for HMAC keys
_ => Err(Error::NotSupported),
}
}
/// <https://w3c.github.io/webcrypto/#aes-kw-operations>
fn wrap_key_aes_kw(
&self,
@ -2614,7 +2627,7 @@ impl SubtleCrypto {
}
}
pub(crate) enum AesExportedKey {
pub(crate) enum ExportedKey {
Raw(Vec<u8>),
Jwk(Box<JsonWebKey>),
}

View file

@ -2,15 +2,9 @@
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -755,27 +749,15 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -854,27 +836,15 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -1645,27 +1615,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -1744,27 +1702,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -2418,15 +2364,9 @@
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -3171,27 +3111,15 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -3270,27 +3198,15 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -3461,27 +3377,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -3560,27 +3464,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -4325,27 +4217,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -4424,27 +4304,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -5491,27 +5359,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -5590,27 +5446,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -6399,27 +6243,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -6498,27 +6330,15 @@
[Derived key of type name: AES-KW length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using short derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -7263,27 +7083,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -7362,27 +7170,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -8168,27 +7964,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -8267,27 +8051,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -9032,27 +8804,15 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -9131,15 +8891,9 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[long derivedKey, empty salt, SHA-512, with empty info with 0 length]
expected: FAIL
@ -9658,27 +9412,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -9757,27 +9499,15 @@
[Derived key of type name: AES-KW length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using long derivedKey, empty salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
@ -10522,27 +10252,15 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-384 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-512 length: 256 using empty derivedKey, normal salt, SHA-256, with normal info with wrong (ECDH) key]
expected: FAIL
@ -10621,15 +10339,9 @@
[Derived key of type name: AES-KW length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-1 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info with wrong (ECDH) key]
expected: FAIL
[Derived key of type name: HMAC hash: SHA-256 length: 256 using empty derivedKey, normal salt, SHA-256, with empty info]
expected: FAIL
[long derivedKey, empty salt, SHA-512, with empty info with 0 length]
expected: FAIL

File diff suppressed because it is too large Load diff