Documentation
¶
Overview ¶
Package fhe provides Fully Homomorphic Encryption interfaces for private messaging. This enables processing encrypted messages without decryption, preserving privacy across chain boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIncompatibleCiphertexts = errors.New("incompatible ciphertexts")
ErrIncompatibleCiphertexts is returned when ciphertexts can't be combined
View Source
var ErrInvalidCiphertext = errors.New("invalid ciphertext")
ErrInvalidCiphertext is returned when ciphertext is malformed
Functions ¶
This section is empty.
Types ¶
type Ciphertext ¶
type Ciphertext interface {
// Bytes returns the serialized ciphertext
Bytes() []byte
// Add performs homomorphic addition with another ciphertext
Add(other Ciphertext) (Ciphertext, error)
// Multiply performs homomorphic multiplication with another ciphertext
Multiply(other Ciphertext) (Ciphertext, error)
}
Ciphertext represents encrypted data that supports homomorphic operations
type PrivateMessage ¶
type PrivateMessage struct {
// Encrypted source chain ID
SourceChain Ciphertext
// Encrypted destination chain ID
DestChain Ciphertext
// Encrypted payload
Payload Ciphertext
// Public metadata (for routing)
Metadata []byte
}
PrivateMessage represents an FHE-encrypted cross-chain message
type Scheme ¶
type Scheme interface {
// Encrypt encrypts a plaintext message
Encrypt(plaintext []byte, publicKey PublicKey) (Ciphertext, error)
// Decrypt decrypts a ciphertext
Decrypt(ciphertext Ciphertext, privateKey PrivateKey) ([]byte, error)
// Evaluate performs homomorphic evaluation on encrypted data
Evaluate(op Operation, ciphertexts ...Ciphertext) (Ciphertext, error)
// GenerateKeys generates a new public/private key pair
GenerateKeys() (PublicKey, PrivateKey, error)
}
Scheme represents an FHE encryption scheme
Click to show internal directories.
Click to hide internal directories.