Maintainer | John Galt <jgalt@centromere.net> |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- class Curve c where
- data PublicKey c :: *
- data SecretKey c :: *
- curveName :: proxy c -> ScrubbedBytes
- curveLength :: proxy c -> Int
- curveGenKey :: IO (KeyPair c)
- curveDH :: SecretKey c -> PublicKey c -> ScrubbedBytes
- curvePubToBytes :: PublicKey c -> ScrubbedBytes
- curveBytesToPub :: ScrubbedBytes -> PublicKey c
- curveSecToBytes :: SecretKey c -> ScrubbedBytes
- curveBytesToPair :: ScrubbedBytes -> KeyPair c
- type KeyPair c = (SecretKey c, PublicKey c)
Classes
Typeclass for EC curves.
Represents a public key.
Represents a secret key.
curveName :: proxy c -> ScrubbedBytes Source
Returns the name of the curve. This is used when generating the handshake name.
curveLength :: proxy c -> Int Source
Returns the length of public keys for this Curve in bytes.
curveGenKey :: IO (KeyPair c) Source
Generates a KeyPair.
curveDH :: SecretKey c -> PublicKey c -> ScrubbedBytes Source
Performs ECDH.
curvePubToBytes :: PublicKey c -> ScrubbedBytes Source
Exports a PublicKey.
curveBytesToPub :: ScrubbedBytes -> PublicKey c Source
Imports a PublicKey.
curveSecToBytes :: SecretKey c -> ScrubbedBytes Source
Exports a SecretKey.
curveBytesToPair :: ScrubbedBytes -> KeyPair c Source
Imports a SecretKey.