ckksMath

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CkksEvalkey rlwe.EvaluationKey
View Source
var CkksEvaluator ckks.Evaluator
View Source
var CkksParams ckks.Parameters

Functions

func AddConst

func AddConst(encryptedData []byte, addValue float64) ([]byte, error)

AddConst Adds a float64 addValue to encrypted data, producing []byte of encrypted data containing a sum of encryptedData data and addValue when decrypted

func ArithmeticProgressionElementN

func ArithmeticProgressionElementN(firstMember []byte, dif []byte, n []byte) ([]byte, error)

ArithmeticProgressionElementN Calculates the N element of arithmetic progression in []byte. Requires the first element of progression and the difference between two members of progression

func ArithmeticProgressionSum

func ArithmeticProgressionSum(firstMember []byte, dif []byte, numberOfMembers []byte) ([]byte, error)

ArithmeticProgressionSum Calculates sum of arithmetic progression in []byte. Requires the first element of progression, the difference between two members of progression and number of elements in progression

func ArrayMean

func ArrayMean(encryptedDataArray [][]byte) ([]byte, error)

ArrayMean Calculates the encrypted mean of all elements of passed array in []byte

func ArraySum

func ArraySum(encryptedDataArray [][]byte) ([]byte, error)

ArraySum Returns the encrypted sum of all elements of passed array in []byte

func Covariance

func Covariance(encryptedDataArray1 [][]byte, encryptedDataArray2 [][]byte) ([]byte, error)

Covariance Calculates covariance coefficient between two encrypted arrays in []byte

func DivByConst

func DivByConst(encryptedDataDividend []byte, encryptedDataDivisor float64) ([]byte, error)

DivByConst Divides encryptedDataDividend by float64 encryptedDataDivisor, producing []byte of encrypted data containing a quotient of encryptedDataDividend and encryptedDataDivisor when decrypted

func MovingAverage

func MovingAverage(encryptedDataArray [][]byte, windowSize int) ([][]byte, error)

MovingAverage Returns an array, containing len(encryptedDataArray) - windowSize elements, each representing a calculated mean of numbers within a shifting window of size windowSize

func Mult

func Mult(encryptedData []byte, encryptedData2 []byte) ([]byte, error)

Mult Multiplies encryptedData by encryptedData2, producing []byte of encrypted data containing a product of encryptedData and encryptedData2 when decrypted

func MultByConst

func MultByConst(encryptedData []byte, multValue float64) ([]byte, error)

MultByConst Multiplies encryptedData by float64 multValue, producing []byte of encrypted data containing a product of encryptedData and multValue when decrypted

func Pow2

func Pow2(encryptedData []byte) ([]byte, error)

Pow2 raises encryptedData to the power of 2 by multiplying it to itself, producing []byte of encrypted data containing a power of 2 of encryptedData when decrypted

func Subtract

func Subtract(encryptedData []byte, encryptedData2 []byte) ([]byte, error)

Subtract Subtracts encryptedData2 from encryptedData, producing []byte of encrypted data containing a difference of encryptedData data and encryptedData2 when decrypted

func SubtractConst

func SubtractConst(encryptedData []byte, subValue float64) ([]byte, error)

SubtractConst Subtracts a float64 subValue from encrypted data, producing []byte of encrypted data containing a difference of encryptedData data and subValue when decrypted

func Sum

func Sum(encryptedData []byte, encryptedData2 []byte) ([]byte, error)

Sum Adds encryptedData to encryptedData2, producing []byte of encrypted data containing a sum of encryptedData data and encryptedData2 when decrypted

func Variance

func Variance(encryptedDataArray [][]byte) ([]byte, error)

Variance Calculates variance of a passed array in []bytes

Types

type ArrayOperation

type ArrayOperation func([][]byte) ([]byte, error)

type ArrayOperation2

type ArrayOperation2 func([][]byte, [][]byte) ([]byte, error)

type ArrayOperationWithParamReturningArray

type ArrayOperationWithParamReturningArray func([][]byte, int) ([][]byte, error)

type ConstOperation

type ConstOperation func([]byte, float64) ([]byte, error)

type Operation1

type Operation1 func([]byte) ([]byte, error)

type Operation2

type Operation2 func([]byte, []byte) ([]byte, error)

type Operation3

type Operation3 func([]byte, []byte, []byte) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL