Documentation ¶
Index ¶
- Constants
- func CouldDecrypt(ciphertext []byte, a *Attributes) bool
- func DecryptCCA(ciphertext []byte, key *AttributesKey) ([]byte, error)
- func EncryptCCA(rand io.Reader, public *PublicParams, policy *Policy, msg []byte) ([]byte, error)
- func GenerateParams(rand io.Reader) (*PublicParams, *SecretParams, error)
- func HashStringToScalar(key []byte, value string) *pairing.Scalar
- func ToScalar(n int) *pairing.Scalar
- type Attribute
- type Attributes
- type AttributesKey
- type Formula
- type Gate
- type Policy
- func (p *Policy) Equal(p2 *Policy) bool
- func (p *Policy) ExtractFromCiphertext(ct []byte) error
- func (p *Policy) MarshalBinary() ([]byte, error)
- func (p *Policy) Satisfaction(attr *Attributes) (*Satisfaction, error)
- func (p *Policy) String() string
- func (p *Policy) UnmarshalBinary(data []byte) error
- type PublicParams
- type Satisfaction
- type SecretParams
- type Wire
Constants ¶
View Source
const ( Andgate = iota Orgate )
Variables ¶
This section is empty.
Functions ¶
func CouldDecrypt ¶
func CouldDecrypt(ciphertext []byte, a *Attributes) bool
func DecryptCCA ¶
func DecryptCCA(ciphertext []byte, key *AttributesKey) ([]byte, error)
func EncryptCCA ¶
func GenerateParams ¶
func GenerateParams(rand io.Reader) (*PublicParams, *SecretParams, error)
Types ¶
type Attributes ¶
func (*Attributes) Equal ¶
func (a *Attributes) Equal(b *Attributes) bool
type AttributesKey ¶
type AttributesKey struct {
// contains filtered or unexported fields
}
func DeriveAttributeKeysCCA ¶
func DeriveAttributeKeysCCA(rand io.Reader, sp *SecretParams, attrs *Attributes) (*AttributesKey, error)
func (*AttributesKey) Equal ¶
func (a *AttributesKey) Equal(b *AttributesKey) bool
func (*AttributesKey) MarshalBinary ¶
func (a *AttributesKey) MarshalBinary() ([]byte, error)
func (*AttributesKey) UnmarshalBinary ¶
func (a *AttributesKey) UnmarshalBinary(data []byte) error
type Formula ¶
type Formula struct {
Gates []Gate
}
Formula represents a monotone boolean circuit with Inputs not repeated. The representation is as follows: for n Gates there n+1 input wires, 1 output Wire, and n-1 intermediate wires. That's because there are 2n Inputs to all Gates and n outputs since every Gate is 2:1.
The wires are conceptually in an array. Wires 0 through n are the input wires, and Wire 2n is the output Wire. If there are wires between n and 2n they are intermediate wires.
All intermediate and input wires must be used exactly once as Inputs.
func (*Formula) MarshalBinary ¶
func (*Formula) UnmarshalBinary ¶
type Gate ¶
type Gate struct { Class int // either Andgate or Orgate In0 int // numbering of wires In1 int Out int }
Gate is a Gate in a monotone boolean formula.
type Policy ¶
func (*Policy) ExtractFromCiphertext ¶
func (*Policy) MarshalBinary ¶
func (*Policy) Satisfaction ¶
func (p *Policy) Satisfaction(attr *Attributes) (*Satisfaction, error)
func (*Policy) UnmarshalBinary ¶
type PublicParams ¶
type PublicParams struct {
// contains filtered or unexported fields
}
func (*PublicParams) Equal ¶
func (p *PublicParams) Equal(p2 *PublicParams) bool
func (*PublicParams) MarshalBinary ¶
func (p *PublicParams) MarshalBinary() ([]byte, error)
func (*PublicParams) UnmarshalBinary ¶
func (p *PublicParams) UnmarshalBinary(data []byte) error
type Satisfaction ¶
type Satisfaction struct {
// contains filtered or unexported fields
}
type SecretParams ¶
type SecretParams struct {
// contains filtered or unexported fields
}
func (*SecretParams) Equal ¶
func (s *SecretParams) Equal(s2 *SecretParams) bool
func (*SecretParams) MarshalBinary ¶
func (s *SecretParams) MarshalBinary() ([]byte, error)
func (*SecretParams) UnmarshalBinary ¶
func (s *SecretParams) UnmarshalBinary(data []byte) error
Click to show internal directories.
Click to hide internal directories.