Documentation
¶
Overview ¶
Package encryption defines generic interfaces for encryption schemes, including key generation, encryption/decryption, and homomorphic variants.
Index ¶
- Variables
- type AEADBasedHybridScheme
- type Capsule
- type Ciphertext
- type DEM
- type DEMOption
- type Decrypter
- type DecrypterOption
- type Encrypter
- type EncrypterOption
- type ExtendedKeyGenerator
- type GroupHomomorphicScheme
- type HomomorphicCiphertext
- type HomomorphicPlaintext
- type HomomorphicScheme
- type HybridDecrypter
- type HybridEncrypter
- type HybridScheme
- type KEM
- type KEMOption
- type KeyGenerator
- type KeyGeneratorOption
- type LinearlyRandomisedEncrypter
- type LinearlyRandomisedSelfEncrypter
- type Name
- type Nonce
- type Plaintext
- type PrivateKey
- type PublicKey
- type ReRandomisableCiphertext
- type Scheme
- type SelfEncrypter
- type ShiftTypeCiphertext
- type SymmetricKey
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidKey = errs.New("invalid key")
)
Functions ¶
This section is empty.
Types ¶
type AEADBasedHybridScheme ¶
type AEADBasedHybridScheme[ SK PrivateKey[SK], PK PublicKey[PK], M ~[]byte, C interface { ~[]byte base.Equatable[C] }, U Capsule, KG KeyGenerator[SK, PK], KM KEM[PK, U], DM DEM[U], ENC HybridEncrypter[PK, M, C, U], DEC HybridDecrypter[M, C], ] interface { HybridScheme[SK, PK, M, C, U, KG, KM, DM, ENC, DEC] AEAD(*SymmetricKey) (cipher.AEAD, error) }
type Ciphertext ¶
type DEM ¶
type DEM[C Capsule] interface { Decapsulate(capsule C) (*SymmetricKey, error) IsAuthenticated() bool }
type Decrypter ¶
type Decrypter[M Plaintext, C Ciphertext[C]] interface {
Decrypt(ciphertext C) (plaintext M, err error)
}
type DecrypterOption ¶
type EncrypterOption ¶
type ExtendedKeyGenerator ¶
type ExtendedKeyGenerator[SK PrivateKey[SK], PK PublicKey[PK]] interface { KeyGenerator[SK, PK] GenerateWithSeed(ikm []byte) (SK, PK, error) }
type GroupHomomorphicScheme ¶
type GroupHomomorphicScheme[ SK PrivateKey[SK], PK PublicKey[PK], M HomomorphicPlaintext[M, MV], MV algebra.GroupElement[MV], C ShiftTypeCiphertext[C, CV, M, PK, N, S], CV algebra.GroupElement[CV], N interface { Nonce algebra.HomomorphicLike[N, NV] }, NV algebra.GroupElement[NV], KG KeyGenerator[SK, PK], ENC LinearlyRandomisedEncrypter[PK, M, C, N], DEC Decrypter[M, C], S algebra.NatLike[S], ] HomomorphicScheme[SK, PK, M, MV, C, CV, N, NV, KG, ENC, DEC, S]
type HomomorphicCiphertext ¶
type HomomorphicCiphertext[C Ciphertext[C], CV algebra.MonoidElement[CV], S algebra.NatLike[S]] interface { Ciphertext[C] algebra.HomomorphicLike[C, CV] algebra.Actable[C, S] }
type HomomorphicPlaintext ¶
type HomomorphicPlaintext[M Plaintext, MV algebra.SemiGroupElement[MV]] interface { Plaintext algebra.HomomorphicLike[M, MV] }
type HomomorphicScheme ¶
type HomomorphicScheme[ SK PrivateKey[SK], PK PublicKey[PK], M HomomorphicPlaintext[M, MV], MV algebra.SemiGroupElement[MV], C HomomorphicCiphertext[C, CV, S], CV algebra.MonoidElement[CV], N interface { Nonce algebra.HomomorphicLike[N, NV] }, NV algebra.SemiGroupElement[NV], KG KeyGenerator[SK, PK], ENC Encrypter[PK, M, C, N], DEC Decrypter[M, C], S algebra.NatLike[S], ] Scheme[SK, PK, M, C, N, KG, ENC, DEC]
type HybridDecrypter ¶
type HybridEncrypter ¶
type HybridScheme ¶
type HybridScheme[ SK PrivateKey[SK], PK PublicKey[PK], M Plaintext, C Ciphertext[C], U Capsule, KG KeyGenerator[SK, PK], KM KEM[PK, U], DM DEM[U], ENC HybridEncrypter[PK, M, C, U], DEC HybridDecrypter[M, C], ] interface { Scheme[SK, PK, M, C, U, KG, ENC, DEC] KEM(...KEMOption[KM, PK, U]) (KM, error) DEM(SK, ...DEMOption[DM, U]) (DM, error) }
type KeyGenerator ¶
type KeyGenerator[SK PrivateKey[SK], PK PublicKey[PK]] interface { Generate(prng io.Reader) (SK, PK, error) }
type KeyGeneratorOption ¶
type KeyGeneratorOption[ KG KeyGenerator[SK, PK], SK PrivateKey[SK], PK PublicKey[PK], ] = func(KG) error
type LinearlyRandomisedEncrypter ¶
type LinearlyRandomisedEncrypter[PK PublicKey[PK], M Plaintext, C ReRandomisableCiphertext[C, N, PK], N interface { Nonce algebra.Operand[N] }] interface { Encrypter[PK, M, C, N] EncryptWithNonce(plaintext M, receiver PK, nonce N) (ciphertext C, err error) }
type LinearlyRandomisedSelfEncrypter ¶
type LinearlyRandomisedSelfEncrypter[SK PrivateKey[SK], PK PublicKey[PK], M Plaintext, C ReRandomisableCiphertext[C, N, PK], N interface { Nonce algebra.Operand[N] }] interface { SelfEncrypter[SK, M, C, N] SelfEncryptWithNonce(plaintext M, nonce N) (ciphertext C, err error) }
type PrivateKey ¶
type Scheme ¶
type Scheme[ SK PrivateKey[SK], PK PublicKey[PK], M Plaintext, C Ciphertext[C], N Nonce, KG KeyGenerator[SK, PK], ENC Encrypter[PK, M, C, N], DEC Decrypter[M, C], ] interface { Name() Name Keygen(...KeyGeneratorOption[KG, SK, PK]) (KG, error) Encrypter(...EncrypterOption[ENC, PK, M, C, N]) (ENC, error) Decrypter(SK, ...DecrypterOption[DEC, M, C]) (DEC, error) }
type SelfEncrypter ¶
type SelfEncrypter[SK PrivateKey[SK], M Plaintext, C Ciphertext[C], X any] interface { PrivateKey() SK SelfEncrypt(plaintext M, prng io.Reader) (ciphertext C, nonceOrCapsuleEtc X, err error) }
type ShiftTypeCiphertext ¶
type ShiftTypeCiphertext[ C Ciphertext[C], CV algebra.GroupElement[CV], M Plaintext, PK PublicKey[PK], N interface { Nonce algebra.Operand[N] }, S algebra.NatLike[S], ] interface { HomomorphicCiphertext[C, CV, S] ReRandomisableCiphertext[C, N, PK] Shift(PK, M) (C, error) }
type SymmetricKey ¶
type SymmetricKey struct {
// contains filtered or unexported fields
}
func NewSymmetricKey ¶
func NewSymmetricKey(v []byte) (*SymmetricKey, error)
func (*SymmetricKey) Bytes ¶
func (k *SymmetricKey) Bytes() []byte
func (*SymmetricKey) Clone ¶
func (k *SymmetricKey) Clone() *SymmetricKey
func (*SymmetricKey) Equal ¶
func (k *SymmetricKey) Equal(other *SymmetricKey) bool
Directories
¶
| Path | Synopsis |
|---|---|
|
Package hpke implements Hybrid Public Key Encryption as specified in RFC 9180.
|
Package hpke implements Hybrid Public Key Encryption as specified in RFC 9180. |
|
Package paillier implements the Paillier cryptosystem, an additive homomorphic public-key encryption scheme.
|
Package paillier implements the Paillier cryptosystem, an additive homomorphic public-key encryption scheme. |
Click to show internal directories.
Click to hide internal directories.