Skip to content

Latest commit

 

History

History
94 lines (76 loc) · 3.16 KB

README.md

File metadata and controls

94 lines (76 loc) · 3.16 KB

Klyshko Fake Correlated Randomness Generator

Provides a Klyshko Correlated Randomness Generator (CRG) that uses the MP-SPDZ ability to generate fake tuples.

For a high-level description of the Klyshko subsystem, its components, and how these interact, please see the README at the root of this repository.

Configuration

The MP-SPDZ fake tuple CRG expects the following configuration resources.

Public Parameters

The only required public configuration parameter is the prime (<<PRIME>> placeholder below) used for generating tuples for the prime field arithmetic. It is specified using a config map as follows:

apiVersion: v1
kind: ConfigMap
metadata:
  name: io.carbynestack.engine.params
data:
  prime: <<PRIME>>

Secret Parameters

The required secret parameters are the MAC key shares for the prime field (<<MAC_KEY_SHARE_P>> placeholder below) and for the field of characteristic 2 (<<MAC_KEY_SHARE_2>> below). They are specified using a K8s secret as follows:

apiVersion: v1
kind: Secret
metadata:
  name: io.carbynestack.engine.params.secret
type: Opaque
data:
  mac_key_share_p: |
    <<MAC_KEY_SHARE_P>>
  mac_key_share_2: |
    <<MAC_KEY_SHARE_2>>

Additional Parameters

The MP-SPDZ fake tuple generator requires all MAC key shares to be available to all parties. They are expected to be made available using the KII mechanism for providing extra parameters using a config map like the following:

apiVersion: v1
kind: ConfigMap
metadata:
  name: io.carbynestack.engine.params.extra
data:
  1_mac_key_share_p: |
    ...
  1_mac_key_share_2: |
   ...
  2_mac_key_share_p: |
    ...
  2_mac_key_share_2: |
    ...

There must be entries for all VCPs except the local one (although it doesn't hurt if that is also provided). The numeric prefix of the key specifies the number (zero-based) of the VCP this key is for.

KII Tuple Type Mapping

The mapping from KII tuple types to the flags required for invoking the Fake-Offline.x executable is as follows:

KII Tuple Type Flag Folder Header Length
BIT_GFP --nbits 0,n 2-p-128/Bits-p-P0 37
BIT_GF2N --nbits n,0 2-2-40/Bits-2-P0 34
INPUT_MASK_GFP --ntriples 0,n 2-p-128/Triples-p-P0 37
INPUT_MASK_GF2N --ntriples n,0 2-2-40/Triples-2-P0 34
INVERSE_TUPLE_GFP --ninverses n 2-p-128/Inverses-p-P0 37
INVERSE_TUPLE_GF2N --ninverses n 2-2-40/Inverses-2-P0 34
SQUARE_TUPLE_GFP --nsquares 0,n 2-p-128/Squares-p-P0 37
SQUARE_TUPLE_GF2N --nsquares n,0 2-2-40/Squares-2-P0 34
MULTIPLICATION_TRIPLE_GFP --ntriples 0,n 2-p-128/Triples-p-P0 37
MULTIPLICATION_TRIPLE_GF2N --ntriples n,0 2-2-40/Triples-2-P0 34