Documentation
¶
Index ¶
- type Bigint
- type DJ_public_key
- func (pk DJ_public_key) Add(a, b interface{}) (sum interface{}, err error)
- func (pk DJ_public_key) Multiply(a, b interface{}) (interface{}, error)
- func (pk DJ_public_key) Scalarspace() bool
- func (pk DJ_public_key) Scale(ciphertext, factor interface{}) (product interface{}, err error)
- func (pk DJ_public_key) Subtract(a, b interface{}) (diff interface{}, err error)
- type Matrix
- func (a Matrix) Add(b Matrix) (c Matrix, err error)
- func (a Matrix) Apply(f func(interface{}) (interface{}, error)) (b Matrix, err error)
- func (m Matrix) At(row, col int) (interface{}, error)
- func (a Matrix) Concatenate(b Matrix) (Matrix, error)
- func (a Matrix) CropHorizontally(k int) Matrix
- func (a Matrix) Multiply(b Matrix) (c Matrix, err error)
- func (a Matrix) MultiplyScalar(scalar interface{}) (Matrix, error)
- func (a Matrix) Scale(factor interface{}) (Matrix, error)
- func (m Matrix) Set(row, col int, value interface{}) error
- func (a Matrix) Subtract(b Matrix) (c Matrix, err error)
- type Space
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DJ_public_key ¶
type DJ_public_key struct {
*tcpaillier.PubKey
}
func NewDJCryptosystem ¶
func NewDJCryptosystem() (public_key DJ_public_key, secret_keys []*tcpaillier.KeyShare, err error)
func (DJ_public_key) Add ¶
func (pk DJ_public_key) Add(a, b interface{}) (sum interface{}, err error)
func (DJ_public_key) Multiply ¶
func (pk DJ_public_key) Multiply(a, b interface{}) (interface{}, error)
func (DJ_public_key) Scalarspace ¶
func (pk DJ_public_key) Scalarspace() bool
func (DJ_public_key) Scale ¶
func (pk DJ_public_key) Scale(ciphertext, factor interface{}) (product interface{}, err error)
func (DJ_public_key) Subtract ¶
func (pk DJ_public_key) Subtract(a, b interface{}) (diff interface{}, err error)
type Matrix ¶
func NewMatrixFromInt ¶
create a new Matrix from int values
func (Matrix) Concatenate ¶
concatenate matrices as A|B
func (Matrix) CropHorizontally ¶
create a new matrix from last k columns of a
func (Matrix) Multiply ¶
multiply a * b also handles multiplication of scalar * non-scalar matrices and vice versa if a and b are non-scalar in different spaces, the space of a is used
func (Matrix) MultiplyScalar ¶
multiplication of a by a scalar assumes matrix and factor is in same space, otherwise use Scale
func (Matrix) Scale ¶
scale a according to scalar to be used if factor is in a scalar space wile a is not
type Space ¶
type Space interface {
// addition of two elements in the space
Add(interface{}, interface{}) (sum interface{}, err error)
// subtraction of two elements in the space
Subtract(interface{}, interface{}) (diff interface{}, err error)
// multiplication of two elements in the space
Multiply(interface{}, interface{}) (product interface{}, err error)
// scaling of an element by scalar factor
Scale(spaced interface{}, factor interface{}) (product interface{}, err error)
// return true if this space (matrix) consist of scalar factors
// e.i. if Scale are to be used in matrix multiplication
Scalarspace() bool
}
Click to show internal directories.
Click to hide internal directories.