* allow pedantic invalid cast lint
* allow lint with false-positive triggered by `test-case` crate
* nightly `fmt` correction
* adapt to rust layout changes
* remove dubious test
* Use transmute instead of pointer cast and de/ref when check_aligned is false.
* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.
* bump rust nightly to 2023-08-25
* Upgrades Rust to 1.72.0
---------
Co-authored-by: Trent Nelson <trent@solana.com>
* function docs to focus on the action they perform
* update docs for fee sigma proof
* add link to zk token proof doc
* Apply suggestions from code review
Co-authored-by: Tyera <tyera@solana.com>
---------
Co-authored-by: Tyera <tyera@solana.com>
* make `ElGamalKeypair` fields private
* update the rest of `zk-token-sdk` for the visibility update
* update `zk-token-proof-tests` for the visibility update
* update `zk-keygen` for the visibility update
* update `zk-token-proof` benches for the updated visibility
* cargo fmt
* rename `ElGamalKeypair::new` to `ElGamalKeypair::new_for_tests`
* add docs for the proof program instructions
* add docs for the zk token proof program
* add docs for the instruction data types
* add brief description of the proofs for each of the proof instructions
* Apply suggestions from code review
Co-authored-by: Tyera <teulberg@gmail.com>
* change `pubkey` or `public-key` in the docs to `public key`
---------
Co-authored-by: Tyera <teulberg@gmail.com>
* remove decoded `TransferWithFeePubkeys`
* remove decoded `TransferPubkey`
* rename `TransferPubkeys` and `TransferWithFeePubkeys` fields
* relocate `TransferPubkeys` and `TransferWithFeePubkeys`
* reorder proof verify parameters for transfer and transfer with fee
* clippy
* replace `decoded::TransferAmountCiphertext` to `DecodedTransferAmountCiphertext`
* refactor pod convert logic for fee parameters
* remove manual byte conversions for `FeeParameters`
* fix error from rebase
* define `FeeEncryption` as a wrapper around `GroupedElGamalCiphertext`
* define pod `FeeEncryption` as a wrapper around `GroupedElGamalCiphertext2Handles`
* update proof data computation
* add comments about unwraps
* fully specify transcript function names `sep` to `separator`
* update names in `sigma_proofs`
* update names in `range_proof`
* update grouped ciphertext validity proofs with new full name
* define `TransferAmountEncryption` as a wrapper around `GroupedElGamalCiphertext`
* implement `From<GroupedElGamalCiphertext<3>>` for `GroupedElGamalCiphertext3Handles`
* define pod `TransferAmountEncryption` as a wrapper around pod `GroupedElGamalCiphertext3Handles`
* derive `Copy`, `Debug`, `Eq`, and `PartialEq` traits for `TransferAmountEncryption`
* rename `TransferAmountEncryption` to `TransferAmountCiphertext`
* clippy
* fix target arch
* add comment on why it is safe to unwrap
* refactor `instruction::transfer` and `instruction::transfer_with_fee` into separate submodule
* rename `transfer.rs` to `transfer_without_fee.rs` to satisfy clippy
* refactor transfer encryptions into separate submodule
* refactor `FeeParameters` to parent transfer module
* refactor `Role` and ciphertext arithmetic specific to transfer instruction into transfer submodule
* fix visibility
* cargo fmt
* change `transfer_with_fee` and `transfer_without_fee` to `with_fee` and `without_fee`
* fix rebase errors
* refactor `DecryptHandle` into `pod::elgamal` from `pod::pedersen`
* refactor conversion for elgamal
* refactor conversion for pedersen
* change variable names
* add brief description of the types
* fix variable names in comments
* rename `sigma_proof::ctxt_comm_equality_proof` to non-abbreviated name
* rename `sigma_proof::ctxt_ctxt_equality_proof` to non-abbreviated name
* rename `instruction::ctxt_ctxt_equality` to non-abbreviated name
* add aggregate range proof instructions data
* add aggregate range proof instruction
* update proof program processor for aggregate range proof instructions
* cargo fmt
* Update zk-token-sdk/src/instruction/aggregate_range_proof/aggregate_range_proof_256.rs
Co-authored-by: mvines <mvines@gmail.com>
* add remark in instruction description that context state account must be pre-allocated
* use `u64::BITS` and `u128::BITS`
* add proof description in `zk_token_proof_instruction.rs`
* rename instruction names to `VerifyBatchedRangeProofU{N}`
* rename module names from `aggregate` to `batched`
* add `tokio::test` that was lost in rebase
---------
Co-authored-by: mvines <mvines@gmail.com>
* move `pod.rs` to separate submodule
* refactor `ElGamalCiphertext` and `ElGamalPubkey` to separate submodule
* refactor `PedersenCommitment` and `DecryptHandle` to separate submodule
* refactor pod sigma proof types to separate submodule
* refactor pod range proof types to separate submodule
* refactor `AeCiphertext` into a separate submodule
* refactor instruction-related pod types to separate submodule
* Apply suggestions from code review
Co-authored-by: Tyera <teulberg@gmail.com>
---------
Co-authored-by: Tyera <teulberg@gmail.com>
* add `VerifyRangeProof` instruction
* update proof program processor for `VerifyRangeProof64`
* specify target arch for `RANGEPROOF64_BIT_LENGTH
* rename `transcript_new` to `new_transcript`
* add constructor for `VerifyRangeProof64`
* add remark in the instruction description that context state account must be pre-allocated
* add proof description in `zk_token_proof_instruction.rs`
* rename `VerifyRangeProof64` to `VerifyRangeProofU64`
* use `u64::BITS`
* Update zk-token-sdk/src/zk_token_proof_instruction.rs
Co-authored-by: Tyera <teulberg@gmail.com>
* Apply suggestions from code review
Co-authored-by: Tyera <teulberg@gmail.com>
* fix range proof test
---------
Co-authored-by: Tyera <teulberg@gmail.com>
* generate transcript directly from proof contexts
* Update zk-token-sdk/src/instruction/transfer.rs
Co-authored-by: Jon Cinque <joncinque@pm.me>
* Update zk-token-sdk/src/instruction/transfer.rs
Co-authored-by: Jon Cinque <joncinque@pm.me>
---------
Co-authored-by: Jon Cinque <joncinque@pm.me>
* rename and restruct ProofInstruction::VerifyCloseAccount to ProofInstruction::VerifyZeroBalance
* rename `PubkeySigmaProof` to `PubkeyValidityProof`
* refactor equality proofs into separate modules
* rename and restructure ProofInstruction::VerifyWithdrawWithheld to ProofInstruction::VerifyCiphertextCiphertextEquality
* add and reorg documentation for the proof instructions
* generalize ciphertext-ciphertext equality proof data constructor
* Update zk-token-sdk/src/instruction/ctxt_ctxt_equality.rs
Co-authored-by: Jon Cinque <joncinque@pm.me>
---------
Co-authored-by: Jon Cinque <joncinque@pm.me>
Changes:
marshallpierce/rust-base64@v0.13.1...v0.21.0
`base64::{encode,decode}` are now deprecated in favor of an API that
explicitly selects an `Engine`. Migrated all calls to the new API.
* implement EncodableKey for ElGamalKeypair
* implement EncodableKey for AeKey
* add keypair_from_path and keypair_from_seed support for encryption keys
* remove duplicate methods from traits
* reorganize error using DRY principle
* rename error `Format` to `Deserialization`
* Rename `EncryptionError` to `DiscreteLogError`
* resolve errors from rebase
* resolve clippy
* change `ProofInstructionError` to `ProofError`