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

Where to find Argon2? #317

Closed
EntityinArray opened this issue Mar 14, 2023 · 6 comments
Closed

Where to find Argon2? #317

EntityinArray opened this issue Mar 14, 2023 · 6 comments

Comments

@EntityinArray
Copy link

Wiki suggests using Argon2 KDF instead of Identity. I enabled argon2 feature, but can't seem to find it.

use opaque_ke::CipherSuite;

struct Default;
impl CipherSuite for Default {
    type OprfCs = opaque_ke::Ristretto255;
    type KeGroup = opaque_ke::Ristretto255;
    type KeyExchange = opaque_ke::key_exchange::tripledh::TripleDh;
    type Ksf = opaque_ke::ksf::Argon2;
}
error[E0412]: cannot find type `Argon2` in module `opaque_ke::ksf`
 --> src/main.rs:8:32
  |
8 |     type Ksf = opaque_ke::ksf::Argon2;
  |                                ^^^^^^ not found in `opaque_ke::ksf`
@kevinlewi
Copy link
Contributor

Can you try mirroring the simple_login.rs example:

https://github.com/facebook/opaque-ke/blob/main/examples/simple_login.rs#L46-L53

That should work.

@EntityinArray
Copy link
Author

Hi, thank you for such quick response. It still doesn't seem to work:

use opaque_ke::CipherSuite;
use argon2::Argon2;

struct Default;

impl CipherSuite for Default {
    type OprfCs = opaque_ke::Ristretto255;
    type KeGroup = opaque_ke::Ristretto255;
    type KeyExchange = opaque_ke::key_exchange::tripledh::TripleDh;

    type Ksf = Argon2<'static>;
}
error[E0277]: the trait bound `Argon2<'static>: Ksf` is not satisfied
  --> src/main.rs:11:16
   |
11 |     type Ksf = Argon2<'static>;
   |                ^^^^^^^^^^^^^^^ the trait `Ksf` is not implemented for `Argon2<'static>`
   |
   = help: the following other types implement trait `Ksf`:
             Identity
             argon2::Argon2<'_>
note: required by a bound in `opaque_ke::CipherSuite::Ksf`
  --> /home/entityinarray/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/opaque-ke-2.0.0/src/ciphersuite.rs:42:15
   |
42 |     type Ksf: Ksf;
   |               ^^^ required by this bound in `CipherSuite::Ksf`

@kevinlewi
Copy link
Contributor

kevinlewi commented Mar 14, 2023

Hmm, what version of opaque-ke are you trying this with, and do you have the argon2 feature enabled? When I clone off of the main branch and run:

cargo run --features argon2 --example simple_login

It works just fine...

@daxpedda
Copy link
Contributor

The error seems to imply that the crate feature is actually enabled:

   = help: the following other types implement trait `Ksf`:
             Identity
             argon2::Argon2<'_>

So probably the version of argon2 @EntityinArray uses differs from the one required by opaque-ke, this is probably related to the bump we had here: #314. opaque-ke on crates.io requires argon2 v0.4, but the newest one is v0.5.

@kevinlewi I think it would be useful to have a new pre-release for opaque-ke, that would also correspond to the new one for voprf.

@kevinlewi
Copy link
Contributor

I see, thanks @daxpedda! Addressing this with #318.

@EntityinArray
Copy link
Author

EntityinArray commented Mar 15, 2023

Thank you very much for addressing this so quickly!
I'm going to use argon2 0.4 for now. When #318 is going to make its way into the crate?

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

3 participants