License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Elliptic Curve Cryptography
- data Curve_P256R1 = Curve_P256R1
- data Curve_P384R1 = Curve_P384R1
- data Curve_P521R1 = Curve_P521R1
- data Curve_X25519 = Curve_X25519
- data Curve_X448 = Curve_X448
- class EllipticCurve curve where
- class EllipticCurve curve => EllipticCurveDH curve where
- class EllipticCurve curve => EllipticCurveArith curve where
- data KeyPair curve = KeyPair {
- keypairGetPublic :: !(Point curve)
- keypairGetPrivate :: !(Scalar curve)
- newtype SharedSecret = SharedSecret ScrubbedBytes
Documentation
data Curve_P256R1 Source #
P256 Curve
also known as P256
data Curve_P384R1 Source #
data Curve_P521R1 Source #
data Curve_X25519 Source #
data Curve_X448 Source #
class EllipticCurve curve where Source #
type Point curve :: * Source #
Point on an Elliptic Curve
type Scalar curve :: * Source #
Scalar in the Elliptic Curve domain
curveGenerateScalar :: MonadRandom randomly => proxy curve -> randomly (Scalar curve) Source #
Generate a new random scalar on the curve. The scalar will represent a number between 1 and the order of the curve non included
curveGenerateKeyPair :: MonadRandom randomly => proxy curve -> randomly (KeyPair curve) Source #
Generate a new random keypair
curveSizeBits :: proxy curve -> Int Source #
Get the curve size in bits
encodePoint :: ByteArray bs => proxy curve -> Point curve -> bs Source #
Encode a elliptic curve point into binary form
decodePoint :: ByteArray bs => proxy curve -> bs -> CryptoFailable (Point curve) Source #
Try to decode the binary form of an elliptic curve point
class EllipticCurve curve => EllipticCurveDH curve where Source #
class EllipticCurve curve => EllipticCurveArith curve where Source #
An elliptic curve key pair composed of the private part (a scalar), and the associated point.
KeyPair | |
|