solana_zk_sdk

Module encryption

Source
Expand description

Collection of encryption-related data structures and algorithms used in the Solana zk-token protocol.

The module contains implementations of the following cryptographic objects:

  • Pedersen commitments that uses the prime-order Ristretto representation of Curve25519. curve25519-dalek is used for the Ristretto group implementation.
  • The twisted ElGamal scheme, which converts Pedersen commitments into a public-key encryption scheme.
  • Basic type-wrapper around the AES-GCM-SIV symmetric authenticated encryption scheme implemented by aes-gcm-siv crate.

Modules§

auth_encryption
Authenticated encryption implementation.
discrete_log
The discrete log implementation for the twisted ElGamal decryption.
elgamal
The twisted ElGamal encryption implementation.
grouped_elgamal
The twisted ElGamal group encryption implementation.
pedersen
Pedersen commitment implementation using the Ristretto prime-order group.
pod

Constants§

AE_CIPHERTEXT_LEN
Byte length of a complete authenticated encryption ciphertext component that includes the ciphertext and nonce components
AE_KEY_LEN
Byte length of an authenticated encryption secret key
DECRYPT_HANDLE_LEN
Byte length of a decrypt handle
ELGAMAL_CIPHERTEXT_LEN
Byte length of an ElGamal ciphertext
ELGAMAL_KEYPAIR_LEN
Byte length of an ElGamal keypair
ELGAMAL_PUBKEY_LEN
Byte length of an ElGamal public key
ELGAMAL_SECRET_KEY_LEN
Byte length of an ElGamal secret key
PEDERSEN_COMMITMENT_LEN
Byte length of a Pedersen commitment.
PEDERSEN_OPENING_LEN
Byte length of a Pedersen opening.