Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
SecTypes
Description
This module collects basic secure (secret-shared) types for hMPC.
Secure number types all use common base classes, which ensures that operators such as +,* are defined by operator overloading.
Synopsis
- data SecureTypes
- = SecFld {
- field :: FiniteField
- share :: MVar FiniteField
- bitLength :: Int
- | SecInt {
- field :: FiniteField
- share :: MVar FiniteField
- bitLength :: Int
- | Literal {
- share :: MVar FiniteField
- = SecFld {
- secIntGen :: Int -> SIO (Integer -> SIO SecureTypes)
- secFldGen :: Integer -> Integer -> SIO SecureTypes
- setShare :: SecureTypes -> Integer -> SIO SecureTypes
Documentation
data SecureTypes Source #
A secret-shared object.
An MPC protocol operates on secret-shared objects of type SecureObject. The basic Haskell operators are overloaded instances by SecureTypes classes. An expression like a * b will create a new SecureObject, which will eventually contain the product of a and b. The product is computed asynchronously, using an instance of a specific cryptographic protocol.
Constructors
SecFld | Base class for secure (secret-shared) numbers. |
Fields
| |
SecInt | Base class for secure (secret-shared) finite field elements. |
Fields
| |
Literal | |
Fields
|
Instances
secFldGen :: Integer -> Integer -> SIO SecureTypes Source #
Secure finite field (SecFld
) of order q = p
where p is a prime number
setShare :: SecureTypes -> Integer -> SIO SecureTypes Source #