Documentation ¶
Index ¶
- Constants
- Variables
- type Ciphertext
- type ElGamalPower2
- func (el *ElGamalPower2) Extract(numKeys int, priv *SecKey) (dsk *SecKey)
- func (el *ElGamalPower2) Flag(curve elliptic.Curve, rand io.Reader, pk *PubKey) []byte
- func (el *ElGamalPower2) JsonifySK(sk *SecKey) []byte
- func (el *ElGamalPower2) KeyGen(curve elliptic.Curve, numKeys int, rand io.Reader) (priv *SecKey, pub *PubKey)
- func (el *ElGamalPower2) MarshalSK(fname string) *SecKey
- func (el *ElGamalPower2) Test(curve elliptic.Curve, ctBytes []byte, priv *SecKey) bool
- func (el *ElGamalPower2) TheoreticalFlag(curve elliptic.Curve, rand io.Reader, pk *PubKey) *Ciphertext
- type Fractional
- func (frac *Fractional) Extract(numerator int, priv *SecKey) (dsk *SecKey)
- func (frac *Fractional) Flag(curve elliptic.Curve, random io.Reader, pk *PubKey) []byte
- func (frac *Fractional) JsonifySK(sk *SecKey) []byte
- func (frac *Fractional) KeyGen(curve elliptic.Curve, gamma int, rand io.Reader) (priv *SecKey, pub *PubKey)
- func (frac *Fractional) MarshalSK(fname string) *SecKey
- func (frac *Fractional) Test(curve elliptic.Curve, ctBytes []byte, priv *SecKey) bool
- type FuzzyScheme
- type GroupElement
- type PubKey
- type SecKey
Constants ¶
View Source
const SECURITYPARAM int = 40
kappa (statistical param)
Variables ¶
View Source
var CIRCUITFILES []string = []string{"48Num8Mod.circ", "64Num24Mod.circ"}
Functions ¶
This section is empty.
Types ¶
type Ciphertext ¶
type Ciphertext struct { U GroupElement BitVec []byte Y *big.Int }
type ElGamalPower2 ¶
type ElGamalPower2 struct { }
func (*ElGamalPower2) Extract ¶
func (el *ElGamalPower2) Extract(numKeys int, priv *SecKey) (dsk *SecKey)
Extract a dsk from a secret key. In practice this just involves making a copy of the same structure, but it contains only a subset of the private keys.
func (*ElGamalPower2) JsonifySK ¶
func (el *ElGamalPower2) JsonifySK(sk *SecKey) []byte
func (*ElGamalPower2) KeyGen ¶
func (el *ElGamalPower2) KeyGen(curve elliptic.Curve, numKeys int, rand io.Reader) (priv *SecKey, pub *PubKey)
Generate a full keypair for an n-bit ciphertext
func (*ElGamalPower2) MarshalSK ¶
func (el *ElGamalPower2) MarshalSK(fname string) *SecKey
func (*ElGamalPower2) Test ¶
Test a ciphertext given a dsk, and return true/false. Note that if the number of subkeys in dsk is 0, this will always return "true".
func (*ElGamalPower2) TheoreticalFlag ¶
func (el *ElGamalPower2) TheoreticalFlag(curve elliptic.Curve, rand io.Reader, pk *PubKey) *Ciphertext
Encrypt a ciphertext
type Fractional ¶
type Fractional struct { }
func (*Fractional) Extract ¶
func (frac *Fractional) Extract(numerator int, priv *SecKey) (dsk *SecKey)
the interface here is a little mixed up between types and not intuitive....
func (*Fractional) JsonifySK ¶
func (frac *Fractional) JsonifySK(sk *SecKey) []byte
func (*Fractional) KeyGen ¶
func (frac *Fractional) KeyGen(curve elliptic.Curve, gamma int, rand io.Reader) (priv *SecKey, pub *PubKey)
Implementing the fuzzy scheme interface
func (*Fractional) MarshalSK ¶
func (frac *Fractional) MarshalSK(fname string) *SecKey
type FuzzyScheme ¶
type FuzzyScheme interface { // a public key algorithm that takes in an int representing the constant param gamma, // outputs a public and private key pair KeyGen(elliptic.Curve, int, io.Reader) (*SecKey, *PubKey) // an algorithm that takes in a secret key and produces detection key with // probability p / q if possible, nil otherwise Extract(int, int, *SecKey) *SecKey // self-explanatory, flagging alg. // io.Reader is the source you're using for randomness so MAKE SURE IT's GOOD Flag(elliptic.Curve, io.Reader, *PubKey) []byte // tests whether or not a ciphertext was addressed to a particular individ. Test(elliptic.Curve, []byte, *SecKey) bool }
type PubKey ¶
type PubKey struct { NumKeys int PubKeys []*GroupElement }
Click to show internal directories.
Click to hide internal directories.