Commit Graph

29 Commits

Author SHA1 Message Date
Jon C 9bb532abcc
deps: Use bytemuck_derive explicitly instead of "derive" feature on bytemuck (#1799)
* deps: Use bytemuck_derive explicitly

* Missed a couple in zk-token-sdk

* Fix last few bits

* Fixup a re-export

* Use re-exports properly
2024-06-21 12:50:36 +02:00
Kevin Heavey 6cf32250ee
use bytemuck_derive 1.7.0 explicitly in sdk and program (#1793)
* use bytemuck_derive 1.7.0 explicitly in sdk and program

* explicitly activate the derive feature of bytemuck in zk-sdk
2024-06-20 09:42:37 +02:00
samkim-crypto 174f241cbe
[zk-sdk] Expose function to convert a grouped ElGamal ciphertext to a regular ciphertext (#1715) 2024-06-13 21:08:15 +09:00
samkim-crypto b5b4c007e5
[zk-sdk] Add functions to derive `ElGamalKeypair` and `AeKey` from `Signature` (#1717) 2024-06-13 21:08:01 +09:00
samkim-crypto 5ff764d9e4
[zk-sdk] Rename `elgamal_program` to `zk_elgamal_proof_program` module (#1698)
* rename `elgamal_program` to `zk_elgamal_proof_program`

* update dependencies outside of `zk-sdk`
2024-06-13 06:15:34 +09:00
samkim-crypto d11dd828cf
[zk-sdk] Re-export grouped ciphertext validity proof data and context (#1550)
re-export grouped ciphertext validity proof data and context
2024-06-04 08:23:35 +09:00
samkim-crypto ff7c59ef16
[zk-sdk] Remove `source`, `destination`, and `auditor` variable names (#1533)
* replace `source`, `destination`, and `auditor` variable names in sigma proofs

* replace `source`, `destination`, and `auditor` variable names in elgamal program
2024-05-31 06:33:07 +09:00
samkim-crypto 16433dcd60
[zk-sdk] Rename pubkey validity proof data and re-export proof data (#1532)
* update `PubkeyValidityData` to `PubkeyValidityProofData`

* update module name `pubkey` to `pubkey_validity`

* re-export proof data and context
2024-05-30 18:24:41 +09:00
Yihau Chen 3ea11e0498
chore: bump aes-gcm-siv from 0.10.3 to 0.11.1 (#1521) 2024-05-30 00:17:31 +00:00
samkim-crypto da74d4b705
[zk-sdk] Add ciphertext validity instructions (#1482)
* add ciphertext validity proof instructions verbatim

* clean up grouped ciphertext validity proof data

* clean up batched grouped ciphertext validity proof data

* add ciphertext validity proof instructions

* cargo clippy

* remove comments referring to spl token program
2024-05-30 09:04:27 +09:00
samkim-crypto 29d898838a
[zk-sdk] Add batched range proof instructions (#1481) 2024-05-28 19:44:01 +09:00
samkim-crypto 9dd01f5518
[zk-sdk] Add equality, pubkey validity, and percentage-with-cap instruction data (#1467)
* add proof data from zk-token-sdk verbatim

* clean up ciphertext-ciphertext equality proof data

* clean up ciphertext-commitment equality proof data

* clean up pubkey validity proof data

* clean up percentage-with-cap proof data
2024-05-23 21:36:04 +09:00
samkim-crypto 9035690e40
[zk-sdk] Add error types and zero ciphertext instruction (#1453)
* add `ProofGenerationError` and `ProofVerificationError`

* add `zero_ciphertext` proof data module from zk-token-sdk verbatim

* clean up `zero_ciphertext` proof data module

* add `VerifyZeroCiphertext` instruction

* cargo fmt

* remove `ProofGenerationError::FeeCalculation`

* remove `ProofGenerationError::NotEnoughFunds`
2024-05-23 10:06:24 +09:00
fsgegs 57f4c85189
Fix typos (#1377)
Co-authored-by: fsgegs <169638890+fsgegs@users.noreply.github.com>
2024-05-15 21:46:23 -06:00
Yihau Chen ec9bd79849
clippy: fix legacy_numeric_constants (#1314)
clippy: legacy_numeric_constants
2024-05-15 11:29:19 +08:00
Kevin Heavey 59e3eaafb5
Prefer explicitly using serde_derive instead of the "derive" feature of serde (#1329)
* use serde_derive instead of the derive feature of serde

* make serde_derive version match serde version

* remove serde dep entirely from programs/address-lookup-table

* replace remaining usage of serde "derive" feature

* update lock files

* explicitly use serde_derive in svm and frozen-abi

* add comments about serde and serde_derive versions matching
2024-05-15 01:11:31 +02:00
samkim-crypto d54e808ebc
[zk-sdk] Add `pod` modules for sigma and range proofs (#1281)
* add sigma `pod` module

* clean up pod sigma proofs

* add rangeproof `pod` module

* clean up pod range proofs

* update old constant names

* update outdated comments

* Update zk-sdk/src/sigma_proofs/pod.rs

Co-authored-by: Jon C <me@jonc.dev>

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-05-15 06:32:52 +09:00
samkim-crypto e621336aca
[zk-sdk] Add `pod` module (#1169) 2024-05-10 20:00:51 +09:00
samkim-crypto be73f30846
[zk-sdk] Clean up `(target_os = "solana")` (#1257)
* remove unnecessary `cfg(not(target_os = ...))` in `encryption` module

* move `encryption` constants out of the submodules

* clean up solana target in `sigma` module

* clean up solana target in `transcript` module

* cargo fmt
2024-05-10 07:43:01 +09:00
samkim-crypto a2af4caab1
[zk-sdk] Add the `program` module (#1188)
* add `program` module

* add `instruction` module

* add `proof_data` module

* add `state` module

* update program id to `ZkE1Gama1Proof11111111111111111111111111111`

* rename `program` module to `elgamal-program`

* move `ProofVerificationError` to `elgamal-program` module
2024-05-08 20:38:52 +09:00
samkim-crypto e593e67124
[zk-sdk] Rename and remove `transcript` functions for new zk-sdk structure (#1160)
* unify transcript range proof domain separator

* remove transcript domain separator for close account proof

* remove withdraw and transfer domain separator

* add `ciphertext_{ciphertext,commitment}_equality_proof_domain_separator`

* rename to `zero_ciphertext_proof_domain_separator`

* add `handles` parameter to grouped ciphertext validity domain separators

* rename to `percentage_with_cap_proof_domain_separator`

* re-order transcript functions for readability
2024-05-08 07:37:46 +09:00
samkim-crypto 7fc1a47376
[zk-sdk] Flatten out arguments for ciphertext validity proofs (#1134)
* flatten out arguments for ciphertext validity proofs

* Update zk-sdk/src/sigma_proofs/grouped_ciphertext_validity/handles_2.rs

Co-authored-by: Jon C <me@jonc.dev>

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-05-03 07:54:07 +09:00
samkim-crypto 69064c10c6
[zk-sdk] Add `range_proof` module (#1091)
* add range proof module

* allow `dead_code` until the `instruction` module is added

* minor update to the comments

* remove unnecessary `cfg(not(target_os = ...))`

* change `BulletproofsGens` to `RangeProofGens`
2024-05-03 07:53:51 +09:00
samkim-crypto 5dd85193b1
[zk-sdk] Change `FeeSigmaProof` to `PercentageWithCapProof` (#1084)
* rename submodule `fee` with `percentage_with_cap`

* rename `FeeSigmaProof` type to `PercentageWithCapProof`

* rename `FeeMaxProof` and `FeeEqualityProof` with `PercentageMaxProof` and `PercentageEqualityProof`

* remove `fee` from the variable names

* remove `fee` from function names

* rename `FeeSigmaProofVerificationError` to `PercentageWithCapVerificationError`

* flatten out function arguments

* update docs/comments

* update test names

* clippy
2024-04-30 20:59:40 +09:00
samkim-crypto 7fcd8c03fd
[zk-sdk] Change `ZeroBalanceProof` to `ZeroCiphertextProof` (#1085)
* rename module `zero_balance` to `zero_ciphertext`

* update `ZeroBalanceProof` to `ZeroCiphertextProof`

* update constant `ZERO_BALANCE_PROOF_LEN` to `ZERO_CIPHERTEXT_PROOF_LEN`

* update `ZeroBalanceProofVerificationError` to `ZeroCiphertextProofVerificationError`

* update comments

* update test function names
2024-04-29 20:32:18 +09:00
samkim-crypto 1bd7406083
[zk-sdk] Add `sigma_proofs` and `transcript` modules (#1065)
* add `sigma_proofs` and `transcript` modules

* remove `_proof` suffix from sigma proof module names

* remove the `sigma_proofs` and `transcript` modules from sbf target

* allow `dead_code` and `unused_imports` until the `instruction` module is added
2024-04-27 04:59:31 +09:00
samkim-crypto d9d52beeb9
[zk-sdk] Remove unnecessary exclusion of solana target (#1064) 2024-04-26 20:11:28 +09:00
samkim-crypto 18dc436ebe
[zk-sdk] Add `errors`, `macros`, and `encryption` modules (#1019)
* add `errors`, `macros`, and `encryption` modules

* remove deprecated functions

* remove `[macro-export]`

* move `macros` into the `encryption` module
2024-04-26 09:27:07 +09:00
samkim-crypto bf041ce6dd
[zk-sdk] Create `zk-sdk` crate (#988)
create `zk-sdk` crate
2024-04-24 06:36:32 +09:00