Skip to content

Conversation

@michaelx11
Copy link
Contributor

Goal

@jazzz made the excellent suggestion to use RustCrypto libraries. NCC has audited most of their repos and:

  1. they're implemented in pure Rust => much easier toolchain down the line
  2. no-std support => better WASM support

I also think the APIs are simpler than ring

Changes

Swap out the Keystore::hkdf implementation to use RustCrypto's hkdf and sha2 crates. Confirm tests still pass.

Tests

Unit test vectors for hkdf still pass

@michaelx11 michaelx11 requested a review from jazzz February 7, 2023 19:59
} else {
Err(ring::error::Unspecified)
fn hkdf(secret: &[u8], salt: &[u8]) -> Result<[u8; 32], String> {
let hk = Hkdf::<Sha256>::new(Some(&salt[..]), &secret);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the range operator needed here on salt?

Michael Xu and others added 2 commits February 7, 2023 12:58
Co-authored-by: Jazz Turner-Baggs <473256+jazzz@users.noreply.github.com>
@claude claude bot mentioned this pull request Jan 8, 2026
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

Successfully merging this pull request may close these issues.

3 participants