Commit Graph

310 Commits

Author SHA1 Message Date
Justin Traglia d5bd326877 Update test names 2023-02-21 14:22:44 -06:00
Justin Traglia 0e6e23de65
Update csharp bindings (#146) 2023-02-21 09:57:25 -06:00
Justin Traglia 03b439ef2f
Update java bindings (#144) 2023-02-20 14:57:27 -06:00
Justin Traglia 9be420c0f1
Merge branch 'ethereum:main' into update-nodejs-bindings 2023-02-20 10:22:50 -06:00
Justin Traglia a231d5354b
Update go bindings (#142)
* Update go bindings

* Fix some nits
2023-02-20 16:01:31 +00:00
Justin Traglia daa5f79fe3
Update python bindings (#145) 2023-02-20 16:00:13 +00:00
Dmitrii Shmatko f87eee57d3
Fix getting SEGFAULT in Java with incorrect parameters (#148)
* Java bindings: Fix SEGFAULT on incorrect parameters/wrong file

* Prettify allocate KZGSettings
2023-02-20 12:02:34 +00:00
Justin Traglia 21b3139dc8 Update nodejs bindings 2023-02-18 15:49:52 -06:00
Stefan Bratanov 9a764de619
Add spotless to the java bindings (#136)
* Add spotless to the java bindings

* Use check task which includes test + all verification
2023-02-16 11:26:26 +00:00
Fabio Di Fabio 8c3dc2df41
Add method to load trusted setup from a resource (#135)
* Add method to load trusted setup from a resource
* Do not try to reuse the same temp dir
* Fix test, loading the correct trusted setup for the preset
2023-02-15 12:18:43 -06:00
Justin Traglia 8aa78231f2
Check UInt8Array lengths (#126) 2023-02-14 15:11:10 -06:00
Justin Traglia 1493f2bf2f
Fix rust bindings benchmarks (#132) 2023-02-13 07:14:09 +00:00
Justin Traglia 5c1128e380
Add profiling (#124)
* Start to add profiling

* Add include flags for macos

* Add profiling funcs for the other funcs

* Add profiling readme

* Move sentence

* Add warning section

* Make run_profiler phony

* Delete extra empty lines

* Add line about box size

* No more dropped nodes/edges

* Remove function focus

* Add sha256 benchmark

* Benchmark sha256 with different sizes

* Clean things up a little
2023-02-10 20:33:32 +00:00
Justin Traglia 5a3e294beb
Update go get instructions (#125) 2023-02-10 08:01:30 +00:00
Stefan Bratanov 5cfbc34135
Add java benchmarking for `compute_kzg_proof` (#122) 2023-02-08 17:36:40 +00:00
Justin Traglia dc28b03f9d
Cleanup the Makefile (#119)
* Cleanup the Makefile some

* Fix compiler error

* Fix compiler errors in tests

* Fix problems on Linux

* Add test_c_kzg_4844_cov to gitignore

* Add back closing brace for cpp

* Split clean rule into two lines

* Not echo commands when running them

* Allow other compilers to be used

* Update comment

* Only allow clang, actually
2023-02-08 17:35:33 +00:00
Justin Traglia fd029a7d00
Fix python bindings on macOS (#117)
* Fix python bindings on macOS

* Update workflow

* Remove unnecessary Makefile vars

* Add src dir to include dirs

* Fix phony
2023-02-07 22:13:54 +00:00
Daniel Coffman c6fa137cd4
Verify blobs count matches commitments count (#113) 2023-02-01 20:56:03 +00:00
Justin Traglia e4f280f17f
Add compute_kzg_proof to java bindings (#94) 2023-01-27 15:16:41 +00:00
Justin Traglia 9076280cd2
Add compute_kzg_proof to nodejs bindings (#92) 2023-01-27 15:15:17 +00:00
Justin Traglia 60ead4ee49
Add compute_kzg_proof to rust bindings (#91) 2023-01-27 15:14:13 +00:00
Justin Traglia 3ec2e9cdc2
Update go get command in instructions (#90) 2023-01-27 10:30:01 +00:00
Justin Traglia 877e6a43d3
Move go.mod & go.sum to repo root (#88)
* Move go.mod & go.sum to repo root

* Add note to README
2023-01-26 22:42:56 +00:00
Justin Traglia 71dd9574d6
Add go bindings (#77)
* Add go bindings

* Use Bytes32 type

* Update blst package

* Add binding for compute_kzg_proof

* Use bytes-only input (will fail)

* Fix go bindings tests

* Use better blobs for benchmarks

* Move rand* funcs to helpers & add comment

* Add headers check
2023-01-26 17:04:24 +00:00
Justin Traglia 03b90ef63f
Use Bytes48 for commitments/proofs (#86)
* Start to use bytes48 type

* Update java bindings

* Update variable names

* Update csharp bindings

* Update node.js bindings

* Update python bindings

* Fix mistake in python bindings

* Add new functions

* Fix nit in java bindings

* Update variable names in java bindings

* Compare to point at infinity

* Update bytes_to_bls_field doc

* Add todo

* Do key validation

* Remove bytes_to_g1

* Fix bug & add remark

* Fix memcmp mistake

* Fix nit in nodejs bindings

* Fix another nit

* Update nodejs parameter names

* Remove to_proof() and to_commitment()

* Fix bug
2023-01-26 14:53:30 +00:00
Justin Traglia 0a18868475
Upgrade blst & remove sha256 patch (#85) 2023-01-25 20:07:15 +00:00
Justin Traglia 8907fbcfe2
Expose `compute_kzg_proof` (#80)
* Expose computeKzgProof

* Revert changes to bytes_to/from_bls_field

* Update comments

* Revert changes to bytes_from_bls_field

* Revert change to parameter name

* Add compute_kzg_proof to readme

* Refactor in support of asn's PR

* Clean up a little

* Fix param name doc

* Introduce Bytes32 type

* Update bindings

* Replaces bytes with b to match spec
2023-01-24 18:23:42 +00:00
Simonas Kalpokas 4c115844e2
Add newline in nodejs trusted setup transformation (#78) 2023-01-20 16:37:38 +00:00
Justin Traglia ac3c829727
Minor rust bindings cleanup (#75)
* Minor rust bindings cleanup

* Use g2_bytes variable
2023-01-18 21:45:44 +00:00
Justin Traglia 9fbe40a5eb
Add length check to verify_aggregate_kzg_proof in rust bindings (#74)
* Add length check to verify_aggregate_kzg_proof in rust bindings

* Generate incorrect blob later

* Remove leftover parenthesis

* Move result var after check
2023-01-18 21:44:33 +00:00
Stefan Bratanov 75cd270ef4
[Java binding] Check there are `count` commitments present (#68)
* [Java binding] Check there are `count` commitments present

* remove unnecessary parameter in Java binding test pipeline
2023-01-17 17:47:46 +00:00
Justin Traglia 69f6155d75
Bytes-only interface (#62)
* Convert argument types to bytes

* Update java bindings

* Update python bindings

* Update node.js bindings

* Update c# bindings

* Fix java binding compile issues

* Fix incorrect memcpy in nodejs bindings

* Fix bug (called the wrong func)

* Fix issues with java bindings

* Fix issues with node.js bindings

* Remove unnecessary wrapped funcs for c#

* Rename struct member to bytes

* Use goto out for callocs

* Fix nit

* Make un-exported funcs static

* Fix python bindings

* Check commitment length in python bindings

* Update python error message

* Steal good ideas from #37

* Fix tests.py which didn't get copied over

* Convert remaining a[] to *a

* Add missing Py_DECREF

* Bytes only rust (#1)

* Make interface bytes only
* Fix benches
* Avoid newtypes for kzg types
* Fix benches again
* Make fields private
* tidy
* Address review comments

* Fix one small thing in rust bindings

* Use ckzg types where possible

* Remove null terminator from domain bytes in rust

* Update rust binding docs

* Use BYTES_PER_* where applicable

* Add extra check for calloc

Co-authored-by: Pawan Dhananjay <pawandhananjay@gmail.com>
2023-01-16 20:05:23 +00:00
George Kadianakis 158977085c
node bindings: Add some missing memory allocation checks (#64)
* node bindings: Add some memory allocation checks

* fixup! node bindings: Add some memory allocation checks
2023-01-13 08:24:25 -08:00
Justin Traglia c72ea8e1dc
Convert Blob type to struct (#61)
* Convert Blob type to struct

* Rename blob.data to blob.bytes
2023-01-12 10:10:23 -08:00
Pawan Dhananjay 2c151d7f7e
Rust bindings (#4)
* working build

* Move bindings.rs to root directory

* tidy build script

* Add initial rust safe bindings

* import fewer c stuff in bindings

* remove unnecessary blst definitions in bindings

* remove bindgen build dependency

* improve interface

* Remove more stuff from bindings

* Add a simple test

* Update error type

* Update verify_kzg_proof interface

* Return array instead of vec

* link with no-pie

* impl Send and Sync for KzgSettings; change mut pointers to const

* Remove no-pie linking

* Make FIELD_ELEMENTS_PER_BLOB a compile time variable

* Add load_trusted_setup method

* Cleanup

* Add failure case to bytes_to_bls_field

* Fix conditional compilation and ensure canonical blobs in test

* Add test vectors

* Remove blobk_commitment test case

* Change function signature

* Copy and delete instead of rename in build script

* Make consts public

* Add error conditions for invalid trusted setup

* Lowercase renamings

* Make blob public

* Add benchmarks

* Run test vectors only for mainnet spec

* Add README

* clippy

* Add rust CI checks

* actually add CI checks

* Fix CI

* Fix workflow again
2023-01-12 17:50:12 +00:00
Ramana Kumar ee2fb80d7c
Merge pull request #58 from jtraglia/csharp-check-ret-value
Check ret of blob_to_kzg_commitment in c# bindings
2023-01-10 20:47:12 -08:00
Ramana Kumar 45c4d3d3f2
Merge pull request #59 from jtraglia/nodejs-blob-to-comm-ret
Check ret of blob_to_kzg_commitment in nodejs bindings
2023-01-10 20:45:14 -08:00
Justin Traglia 57a9666f93 Check ret of blob_to_kzg_commitment in nodejs bindings 2023-01-10 15:52:24 -06:00
Justin Traglia b404758368 Update expectedProofComputed values 2023-01-09 16:26:00 -06:00
Justin Traglia b60e116ec5 Fix some more minor typos 2023-01-09 16:15:01 -06:00
Justin Traglia 658b43ec16 Check ret of blob_to_kzg_commitment in c# bindings 2023-01-09 15:22:13 -06:00
Justin Traglia 071bd6a704 Check blob_to_kzg_commitment ret in python binding 2023-01-09 11:51:05 -06:00
Stefan Bratanov 00ff3f0a78 [Java binding] return NULL instead of 0 for jbyteArray methods 2022-12-20 18:34:29 +02:00
Stefan Bratanov 5399336f6a [Java binding] Throw exception for an invalid blob size 2022-12-20 16:49:24 +02:00
Ramana Kumar b8d90a5080
Merge pull request #43 from jtraglia/unix-arm-builds
Add ARM support for Java bindings
2022-12-20 11:05:02 +00:00
Justin Traglia 142f9c5175 Call return after throw_exception 2022-12-19 12:22:45 -06:00
Justin Traglia 26c57c4444 Check that malloc'd settings isn't null 2022-12-19 10:53:04 -06:00
Justin Traglia 3a62ca018e Convert Linux x86_64 to amd64 2022-12-19 09:52:54 -06:00
Justin Traglia 4c5f88d828 Add support for Unix ARM builds 2022-12-19 09:41:02 -06:00
Stefan Bratanov b6c0beaf8b defensive if 2022-12-18 11:13:26 +02:00
Stefan Bratanov d06df97716 [Java binding] Release JNI arrays 2022-12-18 10:58:57 +02:00
Stefan Bratanov 46d64e231a [Java binding] Load trusted setup from params + custom exception 2022-12-16 13:42:53 +02:00
Stefan Bratanov 17fe743fa3 [Java binding] Add test vectors for `verifyKzgProof` 2022-12-15 09:38:41 +02:00
dancoffman 704cba8ea4
Bump version 2022-12-13 15:24:24 -08:00
Daniel Coffman ab12cef2fb
Merge branch 'ethereum:main' into dgc/fix-setting-field-element-var 2022-12-13 15:23:40 -08:00
dancoffman cc7f62fcf0
Correctly set FIELD_ELEMENTS_PER_BLOB for distributable build 2022-12-13 15:21:40 -08:00
dancoffman 21b74bd89c
Bump package version 2022-12-13 11:25:39 -08:00
dancoffman 42f3bcef14
Actually test 2022-12-13 11:24:55 -08:00
dancoffman 4ccc48cbff
Expose verifyKzgProof 2022-12-13 11:21:43 -08:00
Ramana Kumar e9b225f8e1
Merge pull request #28 from dgcoffman/dgc/fix-nodejs-test-blob-data
Do not allow blob fields to overflow
2022-12-13 07:28:06 +00:00
dancoffman e5338b771f
Do not allow blob fields to overflow 2022-12-12 14:48:05 -08:00
Alexey Osipov 86f9f5d2ec Align tests with the modulus check 2022-12-12 00:01:21 +03:00
Ramana Kumar 4101648253
Update python test for encoding checks
We ensure we are below the modulus by just using a zero final byte for
each field element encoding.

In the test, I do not understand why changing the final (zero) byte
causes verification to succeed instead of failing. But this is why the
change is now to the first byte.
2022-12-11 20:23:50 +00:00
Ramana Kumar 0f54189400
Merge pull request #24 from ethereum/no_file
Load trusted setup from arguments
2022-12-11 18:23:38 +00:00
Stefan Bratanov 4a0fed73b2 update gradle wrapper 2022-12-10 21:06:11 +02:00
Stefan Bratanov 971484f85c Use canonical random blobs in tests 2022-12-10 21:05:16 +02:00
Ramana Kumar 68f1d2dd7e
Rename load_trusted_setup to load_trusted_setup_file 2022-12-10 16:07:40 +00:00
Stefan Bratanov e59f8296e8 add a dot in README 2022-12-06 15:03:58 +00:00
Stefan Bratanov b086cfe9da Add hprof files to gitignore 2022-12-06 13:14:37 +00:00
Stefan Bratanov 0072efe70a Java binding - load library based on a preset 2022-12-06 12:58:56 +00:00
Ramana Kumar 78bf846f69
Merge pull request #16 from ethereum/configure_blob_size
Make FIELD_ELEMENTS_PER_BLOB compile-time configurable
2022-12-06 12:48:40 +00:00
Ramana Kumar 4a9a72bfbe
Also add new env variable to bindings.dist.gyp 2022-12-03 08:14:33 +00:00
Ramana Kumar 45ea45e48b
Make FIELD_ELEMENTS_PER_BLOB configurable in python 2022-12-01 20:31:59 +00:00
Ramana Kumar 151d6d1571
Merge pull request #18 from flcl42/main
Add automatic build increment
2022-11-30 18:08:13 +00:00
Alexey c0e6d8c3c2 Add automatic build increment 2022-11-30 11:35:32 +03:00
Ramana Kumar de36196184
Do not mess with java bindings CC_FLAGS 2022-11-29 21:19:03 +00:00
Ramana Kumar 070948d68f
Update bindings Makefiles with configurable blob size 2022-11-29 21:07:07 +00:00
Ramana Kumar f1a210dba4
Indent Makefile without spaces
Avoid using the recipe prefix for non-recipe code
2022-11-29 20:15:19 +00:00
Stefan Bratanov 26ac90da96 Add cross compile parameterization for the java binding 2022-11-29 10:56:31 +00:00
Stefan Bratanov b9777a6f67 Parameterize clang executable and the blst build script 2022-11-28 18:38:24 +00:00
Stefan Bratanov 68d7c69ffc rename and javadocs change 2022-11-26 13:07:13 +00:00
Stefan Bratanov fd9f16c9a9 fix readme 2022-11-25 15:53:22 +00:00
Stefan Bratanov b77bd70817 enhancing the performance test 2022-11-25 14:53:47 +00:00
Stefan Bratanov 73bba9ef91 change library output folder and make it configurable 2022-11-25 14:53:47 +00:00
Stefan Bratanov ec7eae4815 Java bindings improvements 2022-11-25 14:53:47 +00:00
Enrico Del Fante c823c9b577
indentation2 2022-11-25 11:21:57 +01:00
Enrico Del Fante 0e82300f8f
indentation 2022-11-25 11:20:47 +01:00
Enrico Del Fante b3224e5a2f
improvement 2022-11-25 11:14:49 +01:00
Enrico Del Fante 0caab36c0b
Java binding compilation improvement for macos
Tries to get `JAVA_HOME` automatically if not already set
2022-11-25 10:31:23 +01:00
Stefan Bratanov b9ff9d3309 small improvements 2022-11-24 21:53:15 +00:00
Stefan Bratanov f386e524c5 add fake proof test 2022-11-24 21:34:52 +00:00
Stefan Bratanov c944251ca6 revert back makefile change 2022-11-24 20:38:38 +00:00
Stefan Bratanov 74de86964c change in makefiles 2022-11-24 20:36:18 +00:00
Stefan Bratanov 3424f7c738 fixing pipeline 2022-11-24 20:03:30 +00:00
Stefan Bratanov 7b0db64a76 clean up + add pipeline 2022-11-24 19:46:47 +00:00
Stefan Bratanov 20bbd3c5fb don't print 2022-11-24 19:33:31 +00:00
Stefan Bratanov 9b09d6c966 adding more tests 2022-11-24 19:18:24 +00:00
Stefan Bratanov 4798c4b1e2 fix C header inconsistency 2022-11-24 18:15:26 +00:00
Stefan Bratanov e765142a57 add more OS handling in the Makefile 2022-11-24 18:05:12 +00:00
Stefan Bratanov 3025c882ea adding gradle, makefile and tests 2022-11-24 17:16:15 +00:00
Stefan Bratanov a7557be070 readme improvements 2022-11-24 12:32:03 +00:00
Stefan Bratanov 679cdd20ce make sure to exit c method when trusted setup is not loaded 2022-11-24 12:10:56 +00:00
Stefan Bratanov 606ad9fed8 implementing all methods 2022-11-24 11:50:37 +00:00
Stefan Bratanov a50671dfe8 handle exceptions 2022-11-24 09:14:12 +00:00
Stefan Bratanov a05211c23c revert to using c 2022-11-24 09:14:12 +00:00
Stefan Bratanov c6fc155060 change readme 2022-11-24 09:14:12 +00:00
Stefan Bratanov c50f52108d don't expose KZGSettings 2022-11-24 09:14:12 +00:00
Stefan Bratanov 3136083139 using jni instead of swig (still needs work) 2022-11-24 09:14:12 +00:00
Stefan Bratanov 2ad9433a2b adding the needed interface 2022-11-24 09:14:12 +00:00
Stefan Bratanov accc70c6cd java bindings initial try 2022-11-24 09:14:12 +00:00
Ramana Kumar 4b658698cc
Merge pull request #2 from flcl42/feature/kzg-test
Sync C# wrapper changes, update tests, minor changes for c-kzg
2022-11-22 20:53:38 +00:00
dancoffman 23ab03ec6a
Fix uint type for newer g++ 2022-11-22 12:27:32 -08:00
dancoffman cb55e4f2ab
NodeJS version 1.0.6 2022-11-22 12:11:05 -08:00
Alexey Osipov c5e42fdc82 Rename x to z in csharp bindings for verify_kzg_proof 2022-11-22 10:51:29 +03:00
Alexey Osipov 2761467490 Merge remote-tracking branch 'origin2/main' into feature/kzg-test 2022-11-22 10:50:05 +03:00
Alexey Osipov b7a4f7ccea Rollback hash usage, clean up code 2022-11-22 10:46:49 +03:00
Ramana Kumar 471319fd81
Rename x to z in csharp bindings for verify_kzg_proof
just for consistency
2022-11-21 17:33:59 +00:00
Alexey cccfc749db
Merge branch 'main' into feature/kzg-test 2022-11-19 23:53:03 +03:00
Alexey Osipov a582145755 Clean up tests 2022-11-19 23:46:38 +03:00
Ramana Kumar bcc138560a
Update interface for verify_kzg_proof 2022-11-19 09:35:55 +00:00
dancoffman 1d3282895d
Add contributing note 2022-11-17 16:47:47 -08:00
dancoffman 3bd84cfae6
Skip the tests which fails 2022-11-17 16:41:09 -08:00
dancoffman 0b019d6a67
Test verifying aggregate proof of nothing 2022-11-17 16:41:09 -08:00
dancoffman fe622a7171
Bump package version. npmignore testing_trusted_setups.json 2022-11-17 16:41:09 -08:00
dancoffman 242ba0adf9
Add ability to parse JSON trusted setup to text format expected by C-KZG 2022-11-17 16:41:09 -08:00
dancoffman c9ac623fe7
Turn CPP exceptions back off to see if that fixes the ELF problem 2022-11-16 16:23:06 -08:00
dancoffman afab8d9ea2
Revert conditions 2022-11-16 15:47:13 -08:00
dancoffman 5bf776f52a
Make C++ exceptions catchable in JS-land 2022-11-16 15:26:05 -08:00
Alexey Osipov e812599c2c Fix captions 2022-11-16 19:43:36 +03:00
Alexey Osipov 9fa293effc Add a program to generate outputs for a basic test 2022-11-16 19:31:41 +03:00
Alexey Osipov 3fdc6d37f5 Fix build again 2022-11-10 20:49:40 +03:00
Alexey Osipov 7db7616f2b Fix packaing and settings loading 2022-11-10 19:23:40 +03:00
dancoffman 75f544cdba
update test name 2022-11-09 12:14:48 -08:00
Alexey Osipov 9c29267d3e Fix build 2022-11-09 22:27:09 +03:00
Alexey Osipov fb0d03ff25 Change API to allow fixed effective ptrs 2022-11-09 22:16:00 +03:00
dancoffman 2232b02329
Update NodeJS unit test to expect zero element when computeAggregateKzgProof is supplied an empty array of blobs 2022-11-09 10:25:48 -08:00
Alexey Osipov 68897b375c Merge branch '4844' 2022-11-09 11:40:52 +03:00
Ramana Kumar c8fab42ac0
Fix node.js build - thanks to dgcoffman 2022-11-08 22:02:38 +00:00
dancoffman ef3f77be06
Ignore a couple more files that do not need to be published 2022-11-08 12:57:15 -08:00
dancoffman 6c50c40247
Update tests to cover blobs arrays of length zero and one 2022-11-08 12:53:36 -08:00
dancoffman 0e474e6ec4
Add test harness for building and running NodeJS tests on Linux 2022-11-08 12:47:19 -08:00
dancoffman 72f696e119
File order matters to the linker. GCC demands this order. 2022-11-08 12:47:19 -08:00
Alexey Osipov 94f4c91e1a Fix `make run-test` for newly cloned repo 2022-11-08 17:26:26 +03:00
Ramana Kumar dc6e43ae55
Merge pull request #4 from dgcoffman/dgc/publish-node-bindings-to-npm
Publish NodeJS bindings to npm
2022-11-07 23:10:46 +00:00
dancoffman e98ffa8c8e
Make publish less able to leave files in bad state 2022-11-07 14:37:46 -08:00
dancoffman 26f5178d06
git ignore xcode autogenerated file 2022-11-07 14:35:10 -08:00
dancoffman 5337f8d226
cc works on Linux 2022-11-07 11:45:36 -08:00
Alexey Osipov 08d7384465 Remove duplicate files, improve build, change test framework 2022-11-07 21:18:23 +03:00
Alexey Osipov f18f95c395 Add build, tests, nuget 2022-11-07 16:28:22 +03:00
dancoffman f3069d1ec9
Messy publish but it works 2022-11-05 00:46:26 -07:00