Commit graph

253 commits

Author SHA1 Message Date
Daniel Liu
3fbbc9da9f crypto: fix typos in comments (#29186) 2024-12-09 17:49:00 +08:00
Daniel Liu
727855752c crypto: add support for blobs in eth_fillTransaction (#28839) 2024-12-09 17:49:00 +08:00
Daniel Liu
fabfcc7f6c crypto: fix docstring names (#28923) 2024-12-09 17:49:00 +08:00
Daniel Liu
cae53aa7fd crypto/kzg4844: add helpers for versioned blob hashes (#28827) 2024-12-09 17:49:00 +08:00
Daniel Liu
824dea669c crypto/kzg4844: use the new trusted setup file and format (#28383) 2024-12-09 17:49:00 +08:00
Daniel Liu
b5cc7e6fc0 crypto/blake2b: put architecture-dependent features behind build-tag (#28381)
This change to fixes a compilation-flaw on master, by putting architecture-specific functions behind corresponding build tags.
2024-12-09 17:49:00 +08:00
Daniel Liu
f7b6ad67a7 crypto, tests: update fuzzers to native go fuzzing (#28352) 2024-12-09 17:49:00 +08:00
Daniel Liu
247ebd6a6d crypto/kzg4844: do lazy init in all ckzg funcs (#27679)
* crypto/kzg4844: remove unnecessary init call & fix typo

* Fix kzg4844 tests/benchmarks

* Make init lazy & revert changes to tests
2024-12-09 17:49:00 +08:00
Daniel Liu
bd93c59bae crypto: replace noarg fmt.Errorf with errors.New (#27333) 2024-12-09 17:49:00 +08:00
Daniel Liu
ed03a99770 crypto/kzg4844: upgrade c-kzg-4844 to v0.2.0 (#27257) 2024-12-09 17:49:00 +08:00
Daniel Liu
bedd571091 crypto/kzg4844: pull in the C and Go libs for KZG cryptography (#27155) 2024-12-09 17:49:00 +08:00
Daniel Liu
797efe74af crypto: more linters and fix typo (#24783) 2024-12-09 17:49:00 +08:00
Daniel Liu
cb3edac2c7 crypto: use btcec/v2 for no-cgo (#24533) 2024-12-09 17:49:00 +08:00
Daniel Liu
949fa6358e crypto/ecies: use AES-192 for curve P384 (#24139)
Using curve P384 for encryption causes the error "ecies: shared key params
are too big". Also, readme.md says curve P384 should use AES192 not AES256.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2024-12-09 17:49:00 +08:00
Daniel Liu
146bc2be7b crypto: add go:build lines (#23468) 2024-12-09 17:49:00 +08:00
Daniel Liu
9dab065373 crypto: gofuzz build directives (#23137) 2024-12-09 17:49:00 +08:00
Daniel Liu
b1c719029c crypto: improve trie updates (#21047) 2024-12-09 17:49:00 +08:00
Daniel Liu
a64e42463a crypto/bn256: refine comments according to #19577, #21595, and #21836 (#21847) 2024-12-09 17:49:00 +08:00
Daniel Liu
a2eb8553e8 crypto/bn256: better comments for u, P and Order (#21836) 2024-12-09 17:49:00 +08:00
Daniel Liu
f948466976 crypto: less allocations when hashing and tx handling (#21265) 2024-12-09 17:49:00 +08:00
Daniel Liu
ee303c9f3d crypto/ecies: improve concatKDF (#20836) 2024-12-09 17:48:59 +08:00
Daniel Liu
b2be754647 crypto/bn256: fix import line (#20723) 2024-12-09 17:48:59 +08:00
Daniel Liu
6033722b72 crypto: use golangci-lint (#20295) 2024-12-09 17:48:59 +08:00
Daniel Liu
e1eb00ef99 crypto: make unit tests work with Go 1.13 (#20053) 2024-12-09 17:48:59 +08:00
Daniel Liu
ad5e7d6db3 crypto: add SignatureLength constant and use it everywhere (#19996) 2024-12-09 17:48:59 +08:00
Daniel Liu
8dcea8ddf8 crypto: replace t.Log(); t.FailNow() with t.Fatal() (#19849) 2024-12-09 17:48:59 +08:00
Daniel Liu
b9054b220c crypto: replace fmt.Println calls with t.Log in tests (#19670) 2024-12-09 17:48:59 +08:00
Daniel Liu
66dd846d46 crypto/bn256/cloudflare: fix comments to describe the updated curve parameters (#19577)
* Removed comment section referring to Cloudflare's bn curve parameters

* Added comment to clarify the nature of the parameters

* Changed value of xi to i+9
2024-12-09 17:48:59 +08:00
Daniel Liu
d2ac7d0987 crypto: fix build when CGO_ENABLED=0 (#19121)
Package crypto works with or without cgo, which is great. However, to make it
work without cgo required setting the build tag `nocgo`. It's common to disable
cgo by instead just setting the environment variable `CGO_ENABLED=0`. Setting
this environment variable does _not_ implicitly set the build tag `nocgo`. So
projects that try to build the crypto package with `CGO_ENABLED=0` will fail. I
have done this myself several times. Until today, I had just assumed that this
meant that this package requires cgo.

But a small build tag change will make this case work. Instead of using `nocgo`
and `!nocgo`, we can use `!cgo` and `cgo`, respectively. The `cgo` build tag is
automatically set if cgo is enabled, and unset if it is disabled.
2024-12-09 17:48:59 +08:00
Daniel Liu
9d9bd65a01 crypto/ecies: remove unused function (#19096) 2024-12-09 17:48:59 +08:00
Daniel Liu
92fc843683 crypto: switch over to upstream sha3 package (#18390) 2024-12-09 17:48:59 +08:00
Daniel Liu
95f8abb765 crypto/bn256: fix staticcheck warning SA9009: ineffectual compiler directive 2024-10-30 21:10:45 +08:00
Daniel Liu
c6e4e880ea all: fix staticcheck warning SA4006: never used value 2024-10-24 17:37:19 +08:00
JukLee0ira
47d27fed3b all: replace uses of ioutil with io and os (#24869) 2024-09-27 15:14:17 +08:00
Daniel Liu
4f9501f12c common, crypto: move fuzzers out of core (#22029) 2024-09-22 19:25:37 +08:00
JukLee0ira
2d89951e5b all: use errrors.New instead of empty fmt.Errorf 2024-06-14 19:19:21 +08:00
Daniel Liu
01e1728a94 all: add support for EIP-2718, EIP-2930 transactions (#21502) 2024-05-14 23:15:35 +08:00
Daniel Liu
48f9bbed50 core: types: less allocations when hashing and tx handling (#21265) 2024-05-13 22:07:03 +08:00
JukLee0ira
d6737b69e6 rpc:remove package ethereum/go-ethereum 2024-05-13 19:51:50 +08:00
Wanwiset Peerapatanapokin
30581274a1
RIN-08 RIN-10 RIN-11 Fix curve issues (#425)
* update secp256k1 library from go-eth code

* cast deprecated functions to use new BitCurve type

* add IsOnCurve checks and tests

* add test outcome check
2024-02-11 01:51:11 +04:00
Liam
513114dacf
Merge pull request #398 from XinFinOrg/XDC-01
XDC-01 | Potential Missed Fixings in `crypto` Module
2024-01-22 14:53:49 +08:00
Wanwiset Peerapatanapokin
aaa246f60e
PDF-01 (#397)
* replace deprecated ioutil lib calls

* fix for FileInfo type required

* fix for ioutil.Discard

* fix .Discard

* fix for go-bindata generated files
2024-01-19 15:05:03 +04:00
uji
d4b98063e8 crypto/bn256/cloudflare: fix asm for dynamic linking (#24476)
When using -buildmode=shared, R15 is clobbered by a global variable
access; use a different register instead.

Fixes: #24439
2024-01-18 21:59:02 +08:00
Guillaume Ballet
af8c4d4e85 crypto/cloudflare/bn256: fix in-place addition and unmarshalling (#23419) 2024-01-18 21:58:12 +08:00
Martin Holst Swende
3a6e26b844 crypto/bn256: improve bn256 fuzzer (#21815)
* crypto/cloudflare: fix nil deref in random G1/G2 reading

* crypto/bn256: improve fuzzer

* crypto/bn256: fix some flaws in fuzzer
2024-01-18 21:57:31 +08:00
Antoine Rondelet
c48e9873f3 crypto/bn256/cloudflare: checks for nil pointers in Marshal functions (#19609)
* Added checks for nil pointers in Marshal functions

* Set nil pointer to identity in GT before marshaling
2024-01-18 21:57:04 +08:00
Abd ar-Rahman Hamidi
3d635c544e crypto/secp256k1: add checking z sign in affineFromJacobian (#18419)
The z == 0 check is hit whenever we Add two points with the same x1/x2
coordinate. crypto/elliptic uses the same check in their affineFromJacobian
function. This change does not affect block processing or tx signature verification
in any way, because it does not use the Add or Double methods.
2024-01-18 21:56:28 +08:00
Wanwiset Peerapatanapokin
060d9ce26f
mac arm build fix ref: https://github.com/cloudflare/bn256/pull/4 (#278)
Co-authored-by: Wanwiset Peerapatanapokin <wanwiset25@gmail.com>
2023-06-12 23:46:55 +10:00
olumuyiwadad
b5abbfed79 new EVM Upgrade
- Solidity Upgraded up to v0.8.0
-  Fixed and Added eth_chainId
- Fix error in TransactionRecipet
- Reward halving issue fixed
2021-09-21 16:53:46 +05:30
olumuyiwadad
571c41f891 FIx Bad block error. 2021-09-17 17:59:06 +05:30