There was an error while loading. Please reload this page.
1 parent e3bdeee commit 92dcb36Copy full SHA for 92dcb36
staging/host/commands/secure_env/rust/tpm.rs
@@ -60,7 +60,7 @@ impl TpmHmac {
60
61
fn hkdf_expand(&self, info: &[u8], out_len: usize) -> Result<Vec<u8>, Error> {
62
// HKDF expand: feed the derivation info into HMAC (using the TPM key) repeatedly.
63
- let n = (out_len + SHA256_DIGEST_LEN - 1) / SHA256_DIGEST_LEN;
+ let n = out_len.div_ceil(SHA256_DIGEST_LEN);
64
if n > 256 {
65
return Err(km_err!(UnknownError, "overflow in hkdf"));
66
}
0 commit comments