Safe Haskell | None |
---|---|
Language | Haskell2010 |
LSAG
Description
Implementation of Linkable Spontaneus Anonymous Group (LSAG) Signature over elliptic curve cryptography.
>>>
(pubKey, privKey) <- ECC.generate curve -- Generate public and private keys
>>>
extPubKeys <- genNPubKeys curve nParticipants -- Generate random foreign participants
>>>
k <- fromInteger <$> generateBetween 0 (toInteger $ length extPubKeys - 1) -- Position of the signer's key in the public keys list (k)
>>>
let pubKeys = insert k pubKey extPubKeys -- Insert signer's public key into the list of public keys
>>>
signature <- sign pubKeys (pubKey, privKey) msg -- Sign message with list of public keys and signer's key pair
>>>
verify pubKeys signature msg -- Verify signature
True
Synopsis
- sign :: (MonadRandom m, MonadFail m) => [PublicKey] -> (PublicKey, PrivateKey) -> ByteString -> m (Integer, [Integer], Point)
- verify :: [PublicKey] -> (Integer, [Integer], Point) -> ByteString -> Bool
- genNPubKeys :: MonadRandom m => Curve -> Int -> m [PublicKey]
Documentation
Arguments
:: (MonadRandom m, MonadFail m) | |
=> [PublicKey] | List of public keys |
-> (PublicKey, PrivateKey) | Signer's public and private keys |
-> ByteString | Message |
-> m (Integer, [Integer], Point) |
Generates a ring signature for a message given a specific set of public keys and a signing key belonging to one of the public keys in the set
It returns a signature (c0, ss, y) :
- c0: Initial value to reconstruct signature.
- ss: vector of randomly generated values with encrypted secret to reconstruct signature {s0 ... sn-1}.
- y: Link for current signer.
Arguments
:: [PublicKey] | List of participants public keys |
-> (Integer, [Integer], Point) | Signature |
-> ByteString | Message |
-> Bool |
Verify if a valid signature was made by any public key in the set of public keys L.
Return a boolean value indicating if signature is valid.
genNPubKeys :: MonadRandom m => Curve -> Int -> m [PublicKey] Source #
Generate N different public keys. L = {y1, ..., yn}