hjugement-protocol-0.0.0.20190428: A cryptographic protocol for the Majority Judgment.

Safe HaskellNone
LanguageHaskell2010

Protocol.Credential

Contents

Synopsis

Type Credential

newtype Credential Source #

A Credential is a word of (tokenLength+1 == 15)-characters from a base alphabet of (tokenBase == 58) characters: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" (beware the absence of "0", "O", "I", and "l"). The last character is a checksum. The entropy is: (tokenLength * log tokenBase / log 2) == 82.01… bits.

Constructors

Credential Text 
Instances
Eq Credential Source # 
Instance details

Defined in Protocol.Credential

Show Credential Source # 
Instance details

Defined in Protocol.Credential

readCredential :: Text -> Either CredentialError Credential Source #

readCredential reads and check the well-formedness of a Credential from raw Text.

Type CredentialError

Type UUID

newtype UUID Source #

Constructors

UUID Text 
Instances
Eq UUID Source # 
Instance details

Defined in Protocol.Credential

Methods

(==) :: UUID -> UUID -> Bool #

(/=) :: UUID -> UUID -> Bool #

Ord UUID Source # 
Instance details

Defined in Protocol.Credential

Methods

compare :: UUID -> UUID -> Ordering #

(<) :: UUID -> UUID -> Bool #

(<=) :: UUID -> UUID -> Bool #

(>) :: UUID -> UUID -> Bool #

(>=) :: UUID -> UUID -> Bool #

max :: UUID -> UUID -> UUID #

min :: UUID -> UUID -> UUID #

Show UUID Source # 
Instance details

Defined in Protocol.Credential

Methods

showsPrec :: Int -> UUID -> ShowS #

show :: UUID -> String #

showList :: [UUID] -> ShowS #

randomUUID :: Monad m => RandomGen r => StateT r m UUID Source #

randomUUID generates a random UUID.

Type SecretKey

secretKey :: SubGroup q => UUID -> Credential -> SecretKey q Source #

(secretKey uuid cred) returns the SecretKey derived from given uuid and cred using fastPBKDF2_SHA256.

Type PublicKey

publicKey :: SubGroup q => SecretKey q -> PublicKey q Source #

(publicKey secKey) returns the PublicKey derived from given SecretKey.