Documentation
¶
Index ¶
- Variables
- func GCD(a, b *big.Int) int
- func RandomElementInZMod(q *big.Int) *big.Int
- func TestString(name string, t TestContext) string
- type SPADE
- func (spade *SPADE) Decrypt(dk []*big.Int, value int, ciphertexts [][]*big.Int) []*big.Int
- func (spade *SPADE) Encrypt(pks []*big.Int, alpha *big.Int, data []int) [][]*big.Int
- func (spade *SPADE) KeyDerivation(id, value int, sks []*big.Int, regKey *big.Int) []*big.Int
- func (spade *SPADE) Register(alpha *big.Int) *big.Int
- func (spade *SPADE) Setup() ([]*big.Int, []*big.Int)
- type TestCase
- type TestContext
- type Vanilla
Constants ¶
This section is empty.
Variables ¶
var TestVector = []TestContext{ { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, }
Functions ¶
func GCD ¶
GCD check if a and b are relatively prime to each other or not, if a and b are relatively prime returns 1, otherwise returns 0
func RandomElementInZMod ¶
RandomElementInZMod generates a random element from "Zq" correspond to q
func TestString ¶
func TestString(name string, t TestContext) string
Types ¶
type SPADE ¶
type SPADE struct {
// contains filtered or unexported fields
}
func (*SPADE) Decrypt ¶
Decrypt decrypts the "ciphertexts" using decryption keys "dk" and value query "v", note: the value "v" must be the same value where the "dk" generated for (check KeyDerivation)
func (*SPADE) Encrypt ¶
Encrypt encrypts a vector of integers "data" using master public key "pks" and user's "alpha", returns Elgamal style ciphertext vector c = [[C0, C1], ..., [C0, C1]]
func (*SPADE) KeyDerivation ¶
KeyDerivation generates the decryption keys for specific query value "v", where the query is to be executed for a specific user "id", by using master secret key vector "sks", user's registration key "regKey" returns decryption keys "dk"
func (*SPADE) Register ¶
Register accepts user's token "alpha" as input and generate user's registration key "regKey", which later on will be used by Curator for generating the decryption keys per query (check KeyDerivation), returns "regKey"
type TestContext ¶
type TestContext struct {
// contains filtered or unexported fields
}
type Vanilla ¶
type Vanilla struct {
}
func NewVanilla ¶
func NewVanilla() *Vanilla
NewVanilla returns new instantiation of vanilla initialized with "nil"
func (*Vanilla) QueryNumRep ¶
QueryNumRep count the number of repeat for a value in a sequence shows the duration of the query value and the number of Transition to that value