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

Add unidentified access key derivation method #508

Closed
wants to merge 1 commit into from

Conversation

rubdos
Copy link
Contributor

@rubdos rubdos commented Feb 8, 2023

We've been implementing our own access key derivation function for a while now in libsignal-service, currently as an extention trait, but it feels a bit weird not to have it in here.

Things up for discussion:

  • I assume you probably want a wrapper struct around it.
  • I think you maybe want to expose this to iOS/Android/TS too, such that you can drop the individual implementations in Java/Swift/TS.
  • For the known-answer tests, I've generated a few using our own pre-existing (and working) implementation, but feel free to add some of your own to make sure.
  • This makes zkgroup dependent on signal-crypto, because of the GCM implementation. It might be worth dropping that in favour of the pre-existing aes-gcm crate, or something entirely different.

This is a suggestion PR, so feel free to suggest alternative approaches :)

@rubdos
Copy link
Contributor Author

rubdos commented Feb 8, 2023

For the known-answer tests, I've generated a few using our own pre-existing (and working) implementation, but feel free to add some of your own to make sure.

Generated using:

use libsignal_service::push_service::ProfileKeyExt;
use rand::Rng;
use zkgroup::profiles::ProfileKey;

fn main() {
    let profile_key = ProfileKey::generate(rand::thread_rng().gen());
    let access_key = profile_key.derive_access_key();
    println!("({:#x?}, {access_key:#x?})", profile_key.get_bytes());
}

@jrose-signal jrose-signal added acknowledged awaiting release Will be in the next release of libsignal and removed acknowledged labels Apr 26, 2023
@jrose-signal
Copy link
Contributor

Pulled into v0.23.0. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release Will be in the next release of libsignal
Development

Successfully merging this pull request may close these issues.

2 participants