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

Draft: initial cryptography implementation #1

Closed
wants to merge 18 commits into from
Closed

Draft: initial cryptography implementation #1

wants to merge 18 commits into from

Conversation

maurges
Copy link
Contributor

@maurges maurges commented Oct 7, 2024

Please check that it's sane and there are no silly errors

@maurges maurges requested a review from survived October 7, 2024 09:27
Copy link

@survived survived left a comment

Choose a reason for hiding this comment

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

Would you consider moving all parameters into separate trait Ciphersuite? Something like:

pub trait Ciphersuite {
    type Curve: generic_ec::Curve;
    type Mac: digest::Mac + cipher::KeyInit;
    type Enc: cipher::KeyIvInit + cipher::StreamCipher;
    type HmacDigest: digest::Digest;
    type SecretKey;
    
    fn secret_key_to_scalar(sk: &Self::SecretKey) -> NonZero<SecretScalar<Self::Curve>>;
}

then everything can be parametrized just by this one trait.

Cargo.toml Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@survived
Copy link

@maurges btw I can't actually review the PR / mark threads as resolved. Can you add research group as admins?

src/curve25519xsalsa20hmac.rs Outdated Show resolved Hide resolved
src/curve25519xsalsa20hmac.rs Outdated Show resolved Hide resolved
@maurges maurges requested a review from a team October 11, 2024 12:02
@survived
Copy link

@maurges what do you think about ciphersuite trait?

@maurges
Copy link
Contributor Author

maurges commented Oct 11, 2024

I think it's a neat idea, although my vision for this library was to be monomorphic: the primary interface should be generic_ecies::some_ciphersuite_module. Kind of similar to the nacl library.

@maurges maurges closed this Oct 17, 2024
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.

2 participants