Commit Graph

81 Commits

Author SHA1 Message Date
Justin Traglia d637761a2e
Use official trusted setup (#377) 2023-10-18 13:31:55 -05:00
Justin Traglia 456c3d8fab
Enable pedantic warnings (#371)
* Enable pedantic warnings

* Make same change in other places

* Disable some warnings in java bindings
2023-10-10 15:21:14 +03:00
Stefan Bratanov 4d8ff3dcc5
Adding constants for bytes per g1/g2 points (#329) 2023-08-08 12:19:54 +01:00
Stefan Bratanov b030d9caae
Add java test for loading trusted setup not in Lagrange form (#316) 2023-06-09 12:07:27 +03:00
Justin Traglia 3adec442de
Switch to big-endian (#305) 2023-05-24 08:44:05 -05:00
Justin Traglia 6d21a0ea98
Speed up loading trusted setup (#299)
* Replace g1 points with g1 lagrange points

* Swap out validate_kzg_g1 with blst funcs

* Update minimal preset too

* Fix java & nodejs bindings

* Put variables in smaller scope

* Update some comments

* Remove FFTSettings (#2)

* Fix issue when expanding roots of unity

* Fix formatting

* Revert back to using intermediate array

* Add missing c_kzg_free

* Fix some nits

* Replace free_kzg_settings with free_trusted_setup

* Add parens to NUM_ELEMENTS

Co-authored-by: George Kadianakis <desnacked@riseup.net>

* Move memcpy to the end

* Revert "Move memcpy to the end"

This reverts commit 5331c7feadc92e4b5dd5d4e7512e4be563d7f386.

* Add comment about free_trusted_setup

* Move check before alloc

* Add remark

* Delete unnecessary blank line

* Fix asn's nits

* Update comment for roots_of_unity in header

Co-authored-by: Gottfried Herold <GottfriedHerold@users.noreply.github.com>

* Fix formatting

* Update comment about max_scale

Co-authored-by: Gottfried Herold <GottfriedHerold@users.noreply.github.com>

---------

Co-authored-by: Suphanat Chunhapanya <haxx.pop@gmail.com>
Co-authored-by: George Kadianakis <desnacked@riseup.net>
Co-authored-by: Gottfried Herold <GottfriedHerold@users.noreply.github.com>
2023-05-12 16:44:37 +03:00
Justin Traglia 8f43b2e3ca
[Java] Change sprintf to snprintf (#285) 2023-04-10 11:20:33 -05:00
Stefan Bratanov b022f30c24
[Java binding] Improve prerequisites instructions (#278) 2023-04-04 10:10:55 -05:00
Stefan Bratanov 88924c8aa7
[Java] Avoid unnecessary array copying in tests (#247) 2023-03-24 10:53:46 -05:00
Stefan Bratanov fd3500fe7b
Rename ByteArrayTuple to ProofAndY (#233) 2023-03-21 08:16:53 -05:00
Stefan Bratanov 0fb17c2063
[Java bindings] Improve javadoc + update dependencies (#213) 2023-03-15 11:20:04 -05:00
Justin Traglia 5580f355ae
Add ref test count checks for all bindings (#211) 2023-03-15 16:39:19 +02:00
Stefan Bratanov 9b91f3b832
Small cleanups (#202) 2023-03-10 11:32:13 -06:00
Justin Traglia 1883b79233
Update the java bindings header (#201) 2023-03-10 11:40:23 +02:00
Justin Traglia 6f3751d97b
Update Compute*KZGProof in java bindings (#182) 2023-03-08 15:31:20 -06:00
Justin Traglia 410eed4db6
Update java bindings to support YAML ref tests (#166)
* Update java bindings to support YAML ref tests

* Clean things up a little

* Fix some more nits

* Swap comparision to be expected/actual

* Add missing input length checks

* Move test formats to new directory
2023-03-06 15:58:49 +02:00
Stefan Bratanov 2e55967455
[Java binding] Validation of loadTrustedSetup parameters (#152) 2023-02-22 08:56:49 -06:00
Justin Traglia 03b439ef2f
Update java bindings (#144) 2023-02-20 14:57:27 -06: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
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
Stefan Bratanov 5cfbc34135
Add java benchmarking for `compute_kzg_proof` (#122) 2023-02-08 17:36:40 +00:00
Justin Traglia e4f280f17f
Add compute_kzg_proof to java bindings (#94) 2023-01-27 15:16:41 +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 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
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
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
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
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 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