Commit Graph

726 Commits

Author SHA1 Message Date
Gottfried Herold 20ad6fca5e
Document that bit_reversal_permutation does not work for n==1 (#224) 2023-03-17 15:30:47 -05:00
Gottfried Herold 6d75c674ab
Check that FIELD_ELEMENTS_PER_BLOB is defined. (#225) 2023-03-17 15:30:06 -05:00
Ruben Buniatyan 0b6791bbce
Revise NuGet packaging (#221) 2023-03-17 10:59:32 -05:00
Gottfried Herold 93714c2a8c
changed VLA to an explicit c_kzg_malloc - call. (#223)
VLA's are prone to cause (silent!) stack overflows and a potential cause of security vulns.
While the usage pattern is probably safe in our context, changing to a more robust solution seems prudent.
2023-03-17 06:11:45 -05:00
Justin Traglia 7e755d7280
Fix a mistake in python bindings makefile (#218) 2023-03-17 11:56:37 +02:00
Justin Traglia 5e34bc0232
Fix some nits with nodejs (#219) 2023-03-17 11:55:24 +02:00
Gottfried Herold 51d15222c6
Documentation fix. (#227) 2023-03-17 11:54:19 +02:00
Justin Traglia b3291f9bf1
Speed up rust build just a little (#220) 2023-03-17 11:52:07 +02:00
Justin Traglia a6be00db3d
Link readme in C# project file (#217) 2023-03-16 14:33:46 -05:00
Alexey 23d92e5c12
Automate publishing for C# (#207) 2023-03-16 12:59:48 -05:00
George Kadianakis 903a13fb98
Simplify `fr_batch_inv` and reject zero inputs (#215) 2023-03-16 12:52:59 -05:00
Justin Traglia 2ba8f35dc4
Simplify and cleanup C code (#212) 2023-03-16 08:35:22 -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
George Kadianakis a1b52ac9e1
Add c_kzg_free() helper free-and-null macro (#210) 2023-03-14 09:44:03 -05:00
Gottfried Herold b4eb8d003e
Documentation updates (#208)
* Documentation update

* Documentation for division. Note that the doc says that the behaviour for a/0 is unspecified. Feel free to change.

* Add some Documentation. This fixes item #3 in https://hackmd.io/@6iQDuIePQjyYBqDChYw_jg/ByXAsi21h

* Moved documentation remark for doxygen @remark to in-code remark. The remark is not useful for API-documentation (it refers to a macro that is not part of the API).

* More verbose comment for bit_reversal_permutation.

* doxygen comment parameter name did not match variable name. Fix this.

* Remove parameter n from doxygen comment of compute_challenge, as there is no such argument.
This fixes #4 in https://hackmd.io/@6iQDuIePQjyYBqDChYw_jg/ByXAsi21h

* In compute_kzg_proof_impl, document the role of the m variable that is used to indicate whether the evaluation point is one of the interpolation points.

* Run  `make format`

* Improve multiline comments from `make format` in middle of the code

---------

Co-authored-by: George Kadianakis <desnacked@riseup.net>
2023-03-14 11:40:06 +02:00
Pawan Dhananjay 549739fcb3
Add an into_inner method for Bytes48 (#206) 2023-03-13 13:38:02 +02:00
Justin Traglia 7d170f9939
Add coverage-guided C fuzzers (#203)
* Start to add fuzzers

* Update path to trusted setup in gen_corpus

* Update path one more time

* Add support for two more targets

* Add fuzzers for remaining targets

* Clean up a little

* Add README

* Fix typos

* De-dup fuzzing files

* Add newline at the end of base_fuzz

* Make generic rule for displaying targets

* Use regular make command

* Remove duplicate targets

* Update .gitignore file
2023-03-13 12:45:02 +02:00
Justin Traglia 4f0546af81
Run clang sanitizers in CI + workflow cleanup (#196)
* Run clang sanitizers in CI + workflow cleanup

* Update makefile

* Update workflow names

* Simplify more

* Run go benchmarks in CI

* Fix indentation nits

* Initialize variable in fr_is_one

* Revert "Initialize variable in fr_is_one"

This reverts commit f4c2749e410c68479f83d78c9a1780efe191c7fe.

* Move .PHONY outside of condition
2023-03-13 12:42:12 +02:00
Stefan Bratanov 9b91f3b832
Small cleanups (#202) 2023-03-10 11:32:13 -06:00
Justin Traglia da83e45e9c
Cleanup some rust tests (#195) 2023-03-10 11:42:17 +02:00
Justin Traglia 4211d4b427
Update profiling funcs to new interface (#198) 2023-03-10 11:41:16 +02:00
Justin Traglia 1883b79233
Update the java bindings header (#201) 2023-03-10 11:40:23 +02:00
andri lim edb1274b70
Reduce boilerplate in nim tests (#197) 2023-03-09 14:15:05 -06:00
George Kadianakis ef82131be6
Fix rust benches to work with the new compute API (#194) 2023-03-09 10:30:46 -06:00
Gottfried Herold fa851f1b2c
fr_batch_inv() now fails if output and input pointers alias (#185)
instead of giving wrong result with no error

Co-authored-by: George Kadianakis <desnacked@riseup.net>
2023-03-09 18:24:49 +02:00
Matthew Keil 2642595e39
Reorganize/Clean-Up Node Bindings (#189)
* refactor(node-bindings): create src/lib/test folders

* feat(node-bindings): update bundle/publish commands

* refactor(node-bindings): remove unused files and dependencies

* refactor(node-bindings): move fixtures to __fixtures__

* fix(node-bindings): revert format of fixture json file

* fix(node-bindings): prettierignore and gitignore

* feat(node-bindings): add bindings package

* fix(node-bindings): fix test setup path

* fix(node-bindings): remove post-build copy action in bindings.gyp

* fix(node-bindings): package.json keys

* Update contributors

---------

Co-authored-by: George Kadianakis <desnacked@riseup.net>
2023-03-09 18:21:28 +02:00
Gottfried Herold 2548d489a6
Documentation fix: (#193)
The previous statement was slightly wrong. Being a primite root does not mean r^( (q-1)/2) != 1.
If q=1 == 2^s * t, the latter is satisfied by e.g. t'th roots of unity, but those are not primitive roots by the usual definition.
Fortunately, the actual computation of 2^i'th roots of unity does not require a primitve root to start with, only a non-square.
2023-03-09 18:11:48 +02:00
Matthew Keil 5ebf750a1e
Update Compute*KZGProof in node bindings (#188)
* feat(node-bindings): update Compute*KZGProof

* ComputationProof -> ProofResult

---------

Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
Co-authored-by: George Kadianakis <desnacked@riseup.net>
2023-03-09 16:40:57 +02:00
Matthew Keil 87a3e4148d
Move setup handle to C in node bindings (#177)
* feat(node-bindings): move KzgSettings to c

* fix(node-bindings): typo in comment

* fix(node-bindings): remove unnecessary SetInstanceData

* feat(node-bindings): use C for setting instance data

* docs(node-bindings): fix comment on struct

* refactor(node-bindings): revert export order to minimize diff
2023-03-09 16:00:15 +02:00
George Kadianakis 599ae2fe21
Update Compute*KZGProof in rust bindings (#183)
* Update Compute*KZGProof in rust bindings

* Remove the boxing from the blobs

and implement get_blobs() a bit less promiscuously

* Improve pattern matching style

* Run `cargo fmt`

* Remove a println

* No need to clone commitments
2023-03-09 13:00:17 +02:00
Justin Traglia c295688099
Add invalid length tests (#186) 2023-03-09 12:44:31 +02:00
andri lim ad6e258694
Improve nim bindings conciseness (#191) 2023-03-08 22:05:25 -06:00
andri lim fc11addf50
Allow invalid length inputs in nim tests (#190) 2023-03-08 22:04:23 -06:00
Justin Traglia ff4e99579d
Update Compute*KZGProof in c# bindings (#187) 2023-03-08 16:13:48 -06:00
Justin Traglia 6f3751d97b
Update Compute*KZGProof in java bindings (#182) 2023-03-08 15:31:20 -06:00
George Kadianakis 02b7855eb7
Make verify_*() functions pessimistic by default (#184) 2023-03-08 11:00:12 -06:00
Justin Traglia db2fa8dcdb
Run each reference test individually in Go (#180)
* Run each reference test individually in Go

* Fix other merge conflict issues
2023-03-08 16:14:39 +02:00
Justin Traglia 9e72862198
Allow invalid length inputs in go tests (#175)
* Allow invalid length inputs in go tests

* Revert output type to original
2023-03-08 15:30:09 +02:00
andri lim e8ed621dc8
Add Nim bindings (#176) 2023-03-08 07:04:30 -06:00
Justin Traglia b71746df74
Update Compute*KZGProof in go bindings (#181) 2023-03-08 13:45:54 +02:00
Suphanat Chunhapanya ccf1a4fdf0
Change on compute_[blob_]kzg_proof function signatures (#174) 2023-03-07 13:51:43 -06:00
George Kadianakis 088b062d36
Simplify g1_mul() and make it look like g2_mul() (#179) 2023-03-07 07:54:38 -07:00
Matthew Keil ecc668bbe7
Node binding argument and return type updates (#170) 2023-03-06 19:28:30 -06:00
Alexey 7c0bd867d5
Add C# wrapper & YAML tests (#46) 2023-03-06 15:46:00 -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
Justin Traglia 54ab82c93b
Update nodejs bindings to support YAML ref tests (#167)
* Update nodejs bindings to support YAML ref tests

* Remove c-kzg from deps

* Fix test checks

* Add return statements in error checks

* Fix uint8array comparisons

* Revert test_dir to original value
2023-03-06 12:08:59 +02:00
Justin Traglia aaaacf7432
Update go bindings to support YAML ref tests (#163)
* Update go bindings to support YAML reference tests

* Remove refs to inputValue/claimedValue

* Do not panic if given different length lists
2023-03-06 12:04:29 +02:00
Justin Traglia 572507ce77
Allow invalid length inputs in rust tests (#171)
* Allow bad input values in rust tests

* Clean up a little

* Re-enable feature checks & consolidate

* Use more pattern matching

* Consolidate imports

* Split some long lines into shorter ones

* Clean up test loops

* Simplify get_output() for some funcs
2023-03-06 11:52:36 +02:00
Justin Traglia 8ade71a137
Update python bindings to support YAML ref tests (#161) 2023-03-04 11:24:03 -07:00