shared3p_oblivious.sc

shared3p_oblivious.sc

Module with functions for oblivious tasks (shared3p protection domain)

Functions:

choose

Function for obliviously choosing one of the inputs.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64 / fix32 / fix64

Parameters

cond

- a boolean array

first

- values for true case

second

- values for false case

one of the input arrays that was obliviously chosen with the condition. if true, array first is returned else second is returned

None

Function Overloads

D float32 choose(D bool[[N]] cond, D float32[[N]] first, D float32[[N]] second)

D float64 choose(D bool[[N]] cond, D float64[[N]] first, D float64[[N]] second)

D fix32 choose(D bool[[N]] cond, D fix32[[N]] first, D fix32[[N]] second)

D fix64 choose(D bool[[N]] cond, D fix64[[N]] first, D fix64[[N]] second)

matrixUpdate

Function for obliviously updating a value in the input matrix.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

Parameters

mat

- a matrix of supported type

rowIndex

- an uint type scalar for specifying the row in the input matrix

colIndex

- an uint type scalar for specifying the column in the input matrix

newValue

- a new scalar value

returns a matrix where the element at row rowIndex and column colIndex has been replaced with newValue

None

Function Overloads

D float32 matrixUpdate(D float32[[2]] mat, D uint rowIndex, D uint columnIndex, D float32 newValue)

D float64 matrixUpdate(D float64[[2]] mat, D uint rowIndex, D uint columnIndex, D float64 newValue)

matrixUpdateColumn

Function for obliviously updating a column in the input matrix.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

Parameters

mat

- a matrix of supported type

colIndex

- an uint type scalar for specifying the column to replace

newCol

- a vector with new values

returns a matrix where the column at colIndex has been replaced with newCol

None

Function Overloads

D float32 matrixUpdateColumn(D float32[[2]] mat, D uint colIndex, D float32[[1]] newCol)

D float64 matrixUpdateColumn(D float64[[2]] mat, D uint colIndex, D float64[[1]] newCol)

matrixUpdateRow

Function for obliviously updating a row in the input matrix.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

Parameters

mat

- a matrix of supported type

rowIndex

- an uint type scalar for specifying the row to replace

newRow

- a vector with new values

returns a matrix where the row at rowIndex has been replaced with newRow

None

Function Overloads

D float32 matrixUpdateRow(D float32[[2]] mat, D uint rowIndex, D float32[[1]] newRow)

D float64 matrixUpdateRow(D float64[[2]] mat, D uint rowIndex, D float64[[1]] newRow)

vectorUpdate

Function for obliviously updating an element in the input vector.

Detailed Description

D - shared3p protection domain

Supported types - float64 / float32

Parameters

vec

- a 1-dimensional vector of supported type

index

- an uint type scalar for specifying the element to replace

newValue

- a scalar value of the same type as the input vector

returns a vector with the value at position index replaced by newValue

None

Function Overloads

D float32 vectorUpdate(D float32[[1]] vec, D uint index, D float32 newValue)

D float64 vectorUpdate(D float64[[1]] vec, D uint index, D float64 newValue)