Commit Graph

21 Commits

Author SHA1 Message Date
behzad nouri 12da2da389
fixes errors from clippy::redundant_clone (#29536)
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
2023-01-05 18:42:19 +00:00
samkim-crypto ae57a14ef6
[zk-token-sdk] reorganize errors (#29005)
* reorganize error using DRY principle

* rename error `Format` to `Deserialization`

* Rename `EncryptionError` to `DiscreteLogError`

* resolve errors from rebase

* resolve clippy

* change `ProofInstructionError` to `ProofError`
2022-12-01 20:29:14 +09:00
samkim-crypto bac6ebcd88
zk-token-sdk: update errors in comments (#27602)
update errors in comments
2022-09-15 17:11:14 +09:00
samkim-crypto 19fc4fcbf8
zk-token-sdk: use constant-time msm for inner product proof generation (#27355) 2022-08-24 14:56:21 +09:00
Dmitri Makarov 569b00025c fix: replace rust cfg annotations that use bpf by target_os solana 2022-05-18 20:39:43 -07:00
samkim-crypto d2b23da9ea
Zk token sdk clean decryption (#23478)
* zk-token-sdk: add decryption for pod elgamal ciphertexts

* zk-token-sdk: add decryption for pod elgamal ciphertexts

* zk-token-sdk: cargo fmt

* zk-token-sdk: minor update to docs

* zk-token-sdk: minor

* zk-token-sdk: fix bpf build error

* zk-token-sdk: more simplifying discrete log

* zk-token-sdk: fmt

* zk-token-sdk: minor update to doc
2022-03-04 15:57:19 -04:00
buffalu 70ebab2c82
Add rustfmt.toml and `cargo fmt` (#23238)
* fmt

* formatted

Co-authored-by: Lucas B <buffalu@jito.network>
2022-02-19 13:32:29 +08: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 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
Michael Vines 005ca7759e Remove stray printlns 2022-01-05 16:49:47 -08:00
Sam Kim 1a254ec098 feat: use proper constructor syntax for inner product 2022-01-05 08:51:18 -08:00
Sam Kim 5b41d62f8a feat: fix clippy for new error types 2022-01-05 08:51:18 -08:00
Sam Kim 0944abc0e2 feat: update error types for sdk 2022-01-05 08:51:18 -08:00
Sam Kim 1cbcda71cb feat: add separate error types for sigma proofs 2022-01-05 08:51:18 -08:00
Sam Kim 7439d2424b feat: add a separate TranscriptError 2022-01-05 08:51:18 -08:00
Sam Kim a211fe1cf4 feat: add errors for range proof module 2022-01-05 08:51:18 -08:00
Sam Kim e1d3883893 feat: clean up range proof constructor 2022-01-05 08:51:18 -08:00
Michael Vines aba8c2f4af reformat imports 2022-01-05 08:51:18 -08:00
Sam Kim db69128825 Simplify range proof verification syntax for merged transfer 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 d01d425e4b Rename crypto crate to sdk 2022-01-05 08:51:18 -08:00