Skip to content

X25519 support #3590

Closed
Closed

Description

@alex

This is separate from #2968 so I can put it in it's own milestone.

Proposed API:

class X25519PublicKey(object):
    @classmethod
    def from_public_bytes(cls, bytes: bytes) -> X25519PublicKey:
        pass

    def public_bytes(self) -> bytes:
        pass
    

class X25519PrivateKey(object):
    @classmethod
    def generate(cls) -> X25519PrivateKey:
        pass

    def public_key(self) -> X25519PublicKey:
        pass

    @classmethod
    def _from_private_bytes(cls, bytes: bytes) -> X25519PrivateKey:
        pass

    def private_bytes(self) -> bytes:
        pass

    def exchange(self, public_key: X25519PublicKey) -> bytes:
        pass

Activity

  1. reaperhulk commented on Jun 5, 2017

    @reaperhulk
    Member

    The plot thickens a bit. OpenSSL is using https://tools.ietf.org/html/draft-ietf-curdle-pkix-03#section-3 for serialization. Do we want to just have the bytes or do we want to support this model? If we want the bytes we'll have to parse the ASN.1 and extract the bare key.

  2. reaperhulk commented on Jun 5, 2017

    @reaperhulk
    Member

    I'd also appreciate some assistance in tracking down whether we can load a bare key or if we need to wrap the key in ASN.1 and use d2i_PrivateKey_bio/d2i_PUBKEY_bio to load them.

  3. reaperhulk commented on Jun 5, 2017

    @reaperhulk
    Member

    For reference, here's some early work: master...reaperhulk:x25519

  4. Badg commented on Jun 5, 2017

    @Badg
    Contributor

    Re: just bytes vs ASN.1: I'm fairly sure that all of the Python x25519 libraries I'm aware of (which is a pretty small sample size -- I only know of 3! -- and two of them wrap AGL's Donna 25519) expose some variation on "raw bytes" (or perhaps ascii-armored ones). So, exposing a raw-bytes de/serialization would be useful, at least to support drop-in compatibility with preexisting libraries (I'm biased though; I personally have a use case for this).

  5. reaperhulk commented on Jun 6, 2017

    @reaperhulk
    Member

    There was some back channel conversation today and the decision is to move forward with a raw bytes API.

  6. reaperhulk commented on Jun 6, 2017

    @reaperhulk
    Member

    Okay, public key serialization to bytes is working and I think there's a path to loading a public key via EVP_PKEY_type and EVP_PKEY_set1_tls_encodedpoint, but I have been unable to figure out how to load a private key (which we need for testing purposes) except via PKCS8.

  7. evilaliv3 commented on Aug 28, 2018

    @evilaliv3
    Contributor

    @alex: is there a reason why serialization functions for the private key are missing for X25519?

  8. locked as resolved and limited conversation to collaborators on Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions