tkn20

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package tkn20 implements a ciphertext-policy ABE by Tomida, Kawahara, Nishimaki.

This is an implementation of an IND-CCA2 secure variant of the Ciphertext-Policy Attribute Based Encryption (CP-ABE) scheme by J. Tomida, Y. Kawahara, and R. Nishimaki. Fast, compact, and expressive attribute-based encryption. In A. Kiayias, M. Kohlweiss, P. Wallden, and V. Zikas, editors, PKC, volume 12110 of Lecture Notes in Computer Science, pages 3–33. Springer, 2020. https://eprint.iacr.org/2019/966

Example
Output:

(occupation:doctor and country:US)
Successfully recovered plaintext

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(rand io.Reader) (PublicKey, SystemSecretKey, error)

Types

type AttributeKey

type AttributeKey struct {
	// contains filtered or unexported fields
}

func (*AttributeKey) Decrypt

func (s *AttributeKey) Decrypt(ct []byte) ([]byte, error)

func (*AttributeKey) Equal

func (s *AttributeKey) Equal(s2 *AttributeKey) bool

func (*AttributeKey) MarshalBinary

func (s *AttributeKey) MarshalBinary() ([]byte, error)

func (*AttributeKey) UnmarshalBinary

func (s *AttributeKey) UnmarshalBinary(data []byte) error

type Attributes

type Attributes struct {
	// contains filtered or unexported fields
}

func (*Attributes) CouldDecrypt

func (a *Attributes) CouldDecrypt(ciphertext []byte) bool

func (*Attributes) Equal

func (a *Attributes) Equal(a2 *Attributes) bool

func (*Attributes) FromMap

func (a *Attributes) FromMap(in map[string]string)

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

func (*Policy) Equal

func (p *Policy) Equal(p2 *Policy) bool

func (*Policy) ExtractAttributeValuePairs

func (p *Policy) ExtractAttributeValuePairs() map[string][]string

func (*Policy) ExtractFromCiphertext

func (p *Policy) ExtractFromCiphertext(ct []byte) error

func (*Policy) FromString

func (p *Policy) FromString(str string) error

func (*Policy) Satisfaction

func (p *Policy) Satisfaction(a Attributes) bool

func (*Policy) String

func (p *Policy) String() string

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func (*PublicKey) Encrypt

func (p *PublicKey) Encrypt(rand io.Reader, policy Policy, msg []byte) ([]byte, error)

func (*PublicKey) Equal

func (p *PublicKey) Equal(p2 *PublicKey) bool

func (*PublicKey) MarshalBinary

func (p *PublicKey) MarshalBinary() ([]byte, error)

func (*PublicKey) UnmarshalBinary

func (p *PublicKey) UnmarshalBinary(data []byte) error

type SystemSecretKey

type SystemSecretKey struct {
	// contains filtered or unexported fields
}

func (*SystemSecretKey) Equal

func (msk *SystemSecretKey) Equal(msk2 *SystemSecretKey) bool

func (*SystemSecretKey) KeyGen

func (msk *SystemSecretKey) KeyGen(rand io.Reader, attrs Attributes) (AttributeKey, error)

func (*SystemSecretKey) MarshalBinary

func (msk *SystemSecretKey) MarshalBinary() ([]byte, error)

func (*SystemSecretKey) UnmarshalBinary

func (msk *SystemSecretKey) UnmarshalBinary(data []byte) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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