Key Exchanges

class siotls.crypto.key_exchanges.TLSKeyExchange

Abstract base class and registry for siotls.iana.NamedGroup.

classmethod install(*, duplicate='raise')

Install this key exchange algorithm in the registry.

Called by siotls.crypto.install() which is the preferred way of installing key exchange algorithms.

class siotls.crypto.key_exchanges.IKeyExchange

Interface that must be implemented by every concrete key exchange algorithm.

abstractmethod classmethod init()

Create a new private key and public key pair.

Return type:

tuple[bytes, bytes]

abstractmethod classmethod resume(private_key, peer_key_share)

Compute a secret shared key using our private key and the public key of the peer.

Parameters:
  • private_key (bytes) – Our private key.

  • peer_key_share (bytes) – Their public key.

Return type:

bytes

Backend

class siotls.crypto.key_exchanges.X25519Mixin

Mixin for ECDHE x25519.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to x25519.

Specifically, this mixin has values for: iana_id.

class siotls.crypto.key_exchanges.X448Mixin

Mixin for ECDHE x448.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to x448.

Specifically, this mixin has values for: iana_id.

class siotls.crypto.key_exchanges.Secp256R1Mixin

Mixin for ECDHE SEC P-256 R1.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to secp256r1.

Specifically, this mixin has values for: iana_id.

class siotls.crypto.key_exchanges.Secp384R1Mixin

Mixin for ECDHE SEC P-384 R1.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to secp384r1.

Specifically, this mixin has values for: iana_id.

class siotls.crypto.key_exchanges.Secp521R1Mixin

Mixin for ECDHE SEC P-521 R1.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to secp521r1.

Specifically, this mixin has values for: iana_id.

class siotls.crypto.key_exchanges.Ffdhe2048Mixin

Mixin for FFDHE 2048.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to ffdhe2048.

Specifically, this mixin has values for: iana_id, p, q, g, p_length, and min_key_length.

class siotls.crypto.key_exchanges.Ffdhe3072Mixin

Mixin for FFDHE 3072.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to ffdhe3072.

Specifically, this mixin has values for: iana_id, p, q, g, p_length, and min_key_length.

class siotls.crypto.key_exchanges.Ffdhe4096Mixin

Mixin for FFDHE 4096.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to ffdhe4096.

Specifically, this mixin has values for: iana_id, p, q, g, p_length, and min_key_length.

class siotls.crypto.key_exchanges.Ffdhe6144Mixin

Mixin for FFDHE 6144.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to ffdhe6144.

Specifically, this mixin has values for: iana_id, p, q, g, p_length, and min_key_length.

class siotls.crypto.key_exchanges.Ffdhe8192Mixin

Mixin for FFDHE 8192.

This mixin can be inherited by crypto backends to feed all the attributes required by TLSKeyExchange that are specific to ffdhe8192.

Specifically, this mixin has values for: iana_id, p, q, g, p_length, and min_key_length.