Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Abstract digital signatures.
Synopsis
- class (Typeable v, Show (VerKeyDSIGN v), Eq (VerKeyDSIGN v), Show (SignKeyDSIGN v), Show (SigDSIGN v), Eq (SigDSIGN v), NoThunks (SigDSIGN v), NoThunks (SignKeyDSIGN v), NoThunks (VerKeyDSIGN v), KnownNat (SeedSizeDSIGN v), KnownNat (SizeVerKeyDSIGN v), KnownNat (SizeSignKeyDSIGN v), KnownNat (SizeSigDSIGN v)) => DSIGNAlgorithm v where
- type SeedSizeDSIGN v :: Nat
- type SizeVerKeyDSIGN v :: Nat
- type SizeSignKeyDSIGN v :: Nat
- type SizeSigDSIGN v :: Nat
- data VerKeyDSIGN v :: Type
- data SignKeyDSIGN v :: Type
- data SigDSIGN v :: Type
- type ContextDSIGN v :: Type
- type Signable v :: Type -> Constraint
- algorithmNameDSIGN :: proxy v -> String
- deriveVerKeyDSIGN :: SignKeyDSIGN v -> VerKeyDSIGN v
- hashVerKeyDSIGN :: HashAlgorithm h => VerKeyDSIGN v -> Hash h (VerKeyDSIGN v)
- signDSIGN :: (Signable v a, HasCallStack) => ContextDSIGN v -> a -> SignKeyDSIGN v -> SigDSIGN v
- verifyDSIGN :: (Signable v a, HasCallStack) => ContextDSIGN v -> VerKeyDSIGN v -> a -> SigDSIGN v -> Either String ()
- genKeyDSIGN :: Seed -> SignKeyDSIGN v
- rawSerialiseVerKeyDSIGN :: VerKeyDSIGN v -> ByteString
- rawSerialiseSignKeyDSIGN :: SignKeyDSIGN v -> ByteString
- rawSerialiseSigDSIGN :: SigDSIGN v -> ByteString
- rawDeserialiseVerKeyDSIGN :: ByteString -> Maybe (VerKeyDSIGN v)
- rawDeserialiseSignKeyDSIGN :: ByteString -> Maybe (SignKeyDSIGN v)
- rawDeserialiseSigDSIGN :: ByteString -> Maybe (SigDSIGN v)
- data Seed
- seedSizeDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word
- sizeVerKeyDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word
- sizeSignKeyDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word
- sizeSigDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word
- newtype SignedDSIGN v a = SignedDSIGN (SigDSIGN v)
- signedDSIGN :: (DSIGNAlgorithm v, Signable v a) => ContextDSIGN v -> a -> SignKeyDSIGN v -> SignedDSIGN v a
- verifySignedDSIGN :: (DSIGNAlgorithm v, Signable v a, HasCallStack) => ContextDSIGN v -> VerKeyDSIGN v -> a -> SignedDSIGN v a -> Either String ()
- encodeVerKeyDSIGN :: DSIGNAlgorithm v => VerKeyDSIGN v -> Encoding
- decodeVerKeyDSIGN :: forall v s. DSIGNAlgorithm v => Decoder s (VerKeyDSIGN v)
- encodeSignKeyDSIGN :: DSIGNAlgorithm v => SignKeyDSIGN v -> Encoding
- decodeSignKeyDSIGN :: forall v s. DSIGNAlgorithm v => Decoder s (SignKeyDSIGN v)
- encodeSigDSIGN :: DSIGNAlgorithm v => SigDSIGN v -> Encoding
- decodeSigDSIGN :: forall v s. DSIGNAlgorithm v => Decoder s (SigDSIGN v)
- encodeSignedDSIGN :: DSIGNAlgorithm v => SignedDSIGN v a -> Encoding
- decodeSignedDSIGN :: DSIGNAlgorithm v => Decoder s (SignedDSIGN v a)
- encodedVerKeyDSIGNSizeExpr :: forall v. DSIGNAlgorithm v => Proxy (VerKeyDSIGN v) -> Size
- encodedSignKeyDESIGNSizeExpr :: forall v. DSIGNAlgorithm v => Proxy (SignKeyDSIGN v) -> Size
- encodedSigDSIGNSizeExpr :: forall v. DSIGNAlgorithm v => Proxy (SigDSIGN v) -> Size
DSIGN algorithm class
class (Typeable v, Show (VerKeyDSIGN v), Eq (VerKeyDSIGN v), Show (SignKeyDSIGN v), Show (SigDSIGN v), Eq (SigDSIGN v), NoThunks (SigDSIGN v), NoThunks (SignKeyDSIGN v), NoThunks (VerKeyDSIGN v), KnownNat (SeedSizeDSIGN v), KnownNat (SizeVerKeyDSIGN v), KnownNat (SizeSignKeyDSIGN v), KnownNat (SizeSigDSIGN v)) => DSIGNAlgorithm v where Source #
algorithmNameDSIGN, deriveVerKeyDSIGN, signDSIGN, verifyDSIGN, genKeyDSIGN, rawSerialiseVerKeyDSIGN, rawSerialiseSignKeyDSIGN, rawSerialiseSigDSIGN, rawDeserialiseVerKeyDSIGN, rawDeserialiseSignKeyDSIGN, rawDeserialiseSigDSIGN
type SeedSizeDSIGN v :: Nat Source #
type SizeVerKeyDSIGN v :: Nat Source #
type SizeSignKeyDSIGN v :: Nat Source #
type SizeSigDSIGN v :: Nat Source #
data VerKeyDSIGN v :: Type Source #
data SignKeyDSIGN v :: Type Source #
data SigDSIGN v :: Type Source #
type ContextDSIGN v :: Type Source #
Context required to run the DSIGN algorithm
Unit by default (no context required)
type ContextDSIGN v = ()
type Signable v :: Type -> Constraint Source #
algorithmNameDSIGN :: proxy v -> String Source #
deriveVerKeyDSIGN :: SignKeyDSIGN v -> VerKeyDSIGN v Source #
hashVerKeyDSIGN :: HashAlgorithm h => VerKeyDSIGN v -> Hash h (VerKeyDSIGN v) Source #
signDSIGN :: (Signable v a, HasCallStack) => ContextDSIGN v -> a -> SignKeyDSIGN v -> SigDSIGN v Source #
verifyDSIGN :: (Signable v a, HasCallStack) => ContextDSIGN v -> VerKeyDSIGN v -> a -> SigDSIGN v -> Either String () Source #
genKeyDSIGN :: Seed -> SignKeyDSIGN v Source #
Note that this function may error (with SeedBytesExhausted
) if the
provided seed is not long enough. Callers should ensure that the seed has
is at least seedSizeDSIGN
bytes long.
rawSerialiseVerKeyDSIGN :: VerKeyDSIGN v -> ByteString Source #
rawSerialiseSignKeyDSIGN :: SignKeyDSIGN v -> ByteString Source #
rawSerialiseSigDSIGN :: SigDSIGN v -> ByteString Source #
rawDeserialiseVerKeyDSIGN :: ByteString -> Maybe (VerKeyDSIGN v) Source #
rawDeserialiseSignKeyDSIGN :: ByteString -> Maybe (SignKeyDSIGN v) Source #
rawDeserialiseSigDSIGN :: ByteString -> Maybe (SigDSIGN v) Source #
Instances
A seed contains a finite number of bytes, and is used for seeding cryptographic algorithms including key generation.
This is not itself a PRNG, but can be used to seed a PRNG.
seedSizeDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word Source #
The upper bound on the Seed
size needed by genKeyDSIGN
sizeVerKeyDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word Source #
sizeSignKeyDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word Source #
sizeSigDSIGN :: forall v proxy. DSIGNAlgorithm v => proxy v -> Word Source #
SignedDSIGN
wrapper
newtype SignedDSIGN v a Source #
SignedDSIGN (SigDSIGN v) |
Instances
signedDSIGN :: (DSIGNAlgorithm v, Signable v a) => ContextDSIGN v -> a -> SignKeyDSIGN v -> SignedDSIGN v a Source #
verifySignedDSIGN :: (DSIGNAlgorithm v, Signable v a, HasCallStack) => ContextDSIGN v -> VerKeyDSIGN v -> a -> SignedDSIGN v a -> Either String () Source #
CBOR encoding and decoding
encodeVerKeyDSIGN :: DSIGNAlgorithm v => VerKeyDSIGN v -> Encoding Source #
decodeVerKeyDSIGN :: forall v s. DSIGNAlgorithm v => Decoder s (VerKeyDSIGN v) Source #
encodeSignKeyDSIGN :: DSIGNAlgorithm v => SignKeyDSIGN v -> Encoding Source #
decodeSignKeyDSIGN :: forall v s. DSIGNAlgorithm v => Decoder s (SignKeyDSIGN v) Source #
encodeSigDSIGN :: DSIGNAlgorithm v => SigDSIGN v -> Encoding Source #
decodeSigDSIGN :: forall v s. DSIGNAlgorithm v => Decoder s (SigDSIGN v) Source #
encodeSignedDSIGN :: DSIGNAlgorithm v => SignedDSIGN v a -> Encoding Source #
decodeSignedDSIGN :: DSIGNAlgorithm v => Decoder s (SignedDSIGN v a) Source #
Encoded Size
expresssions
encodedVerKeyDSIGNSizeExpr :: forall v. DSIGNAlgorithm v => Proxy (VerKeyDSIGN v) -> Size Source #
Size
expression for VerKeyDSIGN
which is using sizeVerKeyDSIGN
encoded as Size
.
encodedSignKeyDESIGNSizeExpr :: forall v. DSIGNAlgorithm v => Proxy (SignKeyDSIGN v) -> Size Source #
Size
expression for SignKeyDSIGN
which is using sizeSignKeyDSIGN
encoded as Size
.
encodedSigDSIGNSizeExpr :: forall v. DSIGNAlgorithm v => Proxy (SigDSIGN v) -> Size Source #
Size
expression for SigDSIGN
which is using sizeSigDSIGN
encoded as
Size
.