Commit Graph

30 Commits

Author SHA1 Message Date
Illia Bobyr 43c0f05ca0
Bumps base64 from 0.13.1 to 0.21.0. (#31522)
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.
2023-05-11 11:34:58 -07:00
samkim-crypto 2d58bb287d
[zk-token-sdk] Add option to create proof context state in the proof verification program (#29996)
* extend verifiable trait

* add PodBool

* implement ZkProofData trait

* add proof context program to zk-token-proof program

* update tests  for close account

* add close account instruction

* reorganize tests

* complete tests

* clean up and add docs

* clean up pod

* add proof program state

* update tests

* move proof program tests as separate module

* clippy

* cargo sort

* cargo fmt

* re-organize visibility

* add context state description

* update maintainer reference

* change `VerifyProofData` and `ProofContextState` to pod

* add tests for mixing proof types

* add tests for self owned context state accounts

* cargo fmt

* remove unnecessary scoping and add comments on scopes

* re-organize proof instructions

* clippy

* update zk-token-proof-test to 1.16.0

* upgrade spl-token-2022 to 0.6.1

* reoganize proof type

* cargo lock

* remove ZkProofContext trait
2023-03-16 07:35:20 +09:00
samkim-crypto bc927097ce
[zk-token-sdk] add pubkey proof (#28392)
* add pubkey proof

* add pubkey sigma proof

* add docs for the sigma proof functions

* add pod public key sigma proof

* add public-key validity proof instruction

* add public-key validity proof instruction

* add VerifyPubkeyValidity instruction

* cargo fmt
2022-10-14 20:15:20 +09:00
Tyera Eulberg 2114136e59
Add Display implementations for various ConfidentialTransfer pod structs (#26783) 2022-07-25 21:09:41 -06:00
samkim-crypto 930fe8ad10
Zk token ops using curve25519 syscalls (#25935)
* zk-token-sdk: use curve25519 syscalls for ElGamal arithmetic

* zk-token-sdk: clippy

* adjust curve25519 syscall costs

* cargo fmt
2022-06-13 22:39:07 +09:00
Michael Vines b05c7d91ed Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
samkim-crypto 8d53ea81e9
zk-token-sdk: change variable names to use suffix rather than prefix (#23474)
* zk-token-sdk: change variable names to use suffix rather than prefix for type

* zk-token-sdk: cargo fmt
2022-03-03 15:07:27 -05:00
samkim-crypto b4100a9b5d
Add additional zkp for fee (#23112)
* zk-token-sdk: add equality proof for fee

* zk-token-sdk: tweak some naming conventions for readability

* zk-token-sdk: add verify withdraw withheld instruction

* zk-token-sdk: add test for withdraw withheld verification

* zk-token-sdk: more renaming of variables for readability

* zk-token-sdk: cargo fmt

* zk-token-sdk: minor

* zk-token-sdk: resolve bpf compilation warnings

* zk-token-sdk: minor update to doc
2022-02-17 12:45:07 -05:00
samkim-crypto 7873175764
zk-token-sdk: fix pod for zk-token transfer (#22957) 2022-02-08 12:09:50 -05:00
samkim-crypto 65f8f43665
Zk instructions pass (#22851)
* zk-token-sdk: re-organize transcript

* zk-token-sdk: add pod ElGamal group encryption

* zk-token-sdk: add transcript domain separators for sigma proofs

* zk-token-sdk: clean up transfer tx decryption

* zk-token-sdk: resolve encoding issues for transfer

* zk-token-sdk: fix transfer test

* zk-token-sdk: clean up transcript for close account and withdraw instructions

* zk-token-sdk: add transfer with fee instruction

* zk-token-sdk: add transfer with fee instruction

* zk-token-sdk: add pod for cryptographic structs needed for fee

* zk-token-sdk: add pod for fee sigma proof

* zk-token-sdk: fix test for transfer with fee instruction

* zk-token-sdk: add range proof verification for transfer with fee

* zk-token-sdk: add transfer amount decryption for transfer-with-fee

* zk-token-sdk: add proof generation error for instruction

* zk-token-sdk: cargo fmt and clippy

* zk-token-sdk: fix bpf build
2022-02-01 14:11:28 -05:00
samkim-crypto 5cef4c0a4c
Sigma pass (#22801)
* zk-token-sdk: add zeroize and reference arithmetic to zero-balance proof

* zk-token-sdk: add zeroize and reference arithmetic to equality proof

* zk-token-sdk: add zeroize and reference arithmetic to validity proof

* zk-token-sdk: add aggregated validity proof

* zk-token-sdk: use subtle choice for fee

* zk-token-sdk: add test for fee proof

* zk-token-sdk: add documentation for sigma protocols

* zk-token-sdk: add edge case tests for equality proof

* zk-token-sdk: add edge case tests for zero-balance proof

* zk-token-sdk: add edge case tests for validity proof

* zk-token-sdk: add some docs for fee sigma proof

* zk-token-sdk: clippy
2022-01-27 19:53:15 -05:00
samkim-crypto d8cbb2a952
Elgamal pass (#22632)
* zk-token-sdk: change G and H to static and optimize pedersen arithmetic

* zk-token-sdk: remove unnecessary copy in elgamal arithmetic

* zk-token-sdk: fix elgamal tests for new syntax

* zk-token-sdk: use lazy-static for pedersen base

* zk-token-sdk: add dlog test for elgamal decryption

* zk-token-sdk: reflect changes in elgamal in the rest of the sdk

* zk-token-sdk: rustfmt and clippy

* zk-token-sdk: some documentation for elgamal and pedersen

* zk-token-sdk: minor remove whitespace

* zk-token-sdk: update lock files

* zk-token-sdk: change random() to new_rand()

* zk-token-sdk: add explanation for suppressing clippy::op_ref
2022-01-21 20:56:27 -05:00
Tyera Eulberg 7be533a770
Add zeroed default for ElGamalCiphertext (#22639) 2022-01-21 19:52:36 +00:00
samkim-crypto 41fb98c771
zk-token_sdk: define defaults for pod ElGamal/AES ciphertexts (#22532) 2022-01-20 16:27:31 -05:00
Sam Kim 584c63bcc4 refactor: CloseAccount now uses zero-balance-proof 2022-01-05 08:51:18 -08:00
Sam Kim c26fa1d0e9 refactor: create pod struct for ZeroBalanceProof 2022-01-05 08:51:18 -08:00
Sam Kim 9a43fbe3b2 clean up authenticated encryption implementation and also rename aes to auth_encryption 2022-01-05 08:51:18 -08:00
Sam Kim 7a568482de cargo fmt and fix clippy 2022-01-05 08:51:18 -08:00
Sam Kim 30871784e4 incorporate validity proof into transfer proof 2022-01-05 08:51:18 -08:00
Sam Kim 6c329e2431 add equality proof struct 2022-01-05 08:51:18 -08:00
Michael Vines aba8c2f4af reformat imports 2022-01-05 08:51:18 -08:00
Sam Kim defdf8da72 change AESCiphertext to AesCiphertext 2022-01-05 08:51:18 -08:00
Sam Kim 173d88d514 remove `OptionAESCiphertext` 2022-01-05 08:51:18 -08:00
Sam Kim 6749c45c63 merge 2022-01-05 08:51:18 -08:00
Sam Kim 57103c515b update applying pending balance for aes ciphertext 2022-01-05 08:51:18 -08:00
samkim-crypto 2d225de48c pod for AESCiphertext 2022-01-05 08:51:18 -08:00
Michael Vines 20c6001836 derive Debug for pods for BPF target as well 2022-01-05 08:51:18 -08:00
Sam Kim a40e7fc59b Rename Pedersen related structs and methods for consistency 2022-01-05 08:51:18 -08:00
Michael Vines 78799640ea Rename ElGamalCT to ElGamalCiphertext, ElGamalPK to ElGamalPubkey 2022-01-05 08:51:18 -08:00
Michael Vines f3e7e62813 Refactor sdk/src/pod.rs 2022-01-05 08:51:18 -08:00