Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Use ciphersuite strings to select ciphers? #11

Open
tarcieri opened this issue Jan 5, 2018 · 3 comments
Open

Use ciphersuite strings to select ciphers? #11

tarcieri opened this issue Jan 5, 2018 · 3 comments

Comments

@tarcieri
Copy link
Contributor

tarcieri commented Jan 5, 2018

The test vectors presently use the following ciphersuite strings:

  • XSTREAM_X25519_HKDF_SHA256_AES128_SIV
    • Key Agreement: X25519
    • KDF: HMAC-SHA-256
    • Symmetric Cipher: AES-128-SIV
  • XSTREAM_X25519_HKDF_SHA256_AES128_PMAC_SIV
    • Key Agreement: X25519
    • KDF: HMAC-SHA-256
    • Symmetric Cipher: AES-128-PMAC-SIV

However, none of the existing XSTREAM implementations accept these as arguments, but instead take an AES-SIV versus AES-PMAC-SIV string which is passed directly to Miscreant (where applicable).

For the Rust implementation in particular, it would be nice to have object safe traits for STREAM which allow us to use either STREAM or XSTREAM via a trait object, and in particular to select the stream encryptor type to use based on a string.

@xorxornop
Copy link

In particular, these constructions could very well be made through a series of Decorator-pattern traits/impls. Stringly-typed parameters in Rust is just.... wrong!

@tarcieri
Copy link
Contributor Author

Selection of which cipher to use can often come from a string parameter, such as a command-line option or data read from a file.

I love types too, but there's a point where you have to interface with a user...

@eternaleye
Copy link

I'd argue that handling strings and converting them to a strongly-typed interface belongs in the frontend - in the commandline parser stage for handling CLI args; in the config file loading stage for handling configurations, etc.

There will certainly be cases where people know they only want one of these, or they have a system based on numeric or UUID identifiers, or other reasons why the particular strings miscreant and/or xstream expect are irrelevant. In those situations, they will have lost static validation of what they're passing for zero gain.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants