Commit Graph

698 Commits

Author SHA1 Message Date
Justin Traglia 9059ba5ae2
Add new NUM_G1_POINTS var for consistency (#257) 2023-03-29 16:01:24 +09:00
Justin Traglia 2913b5ab31
Fix rust benchmarks (#258)
* Fix rust benchmarks

* Use iter_batched_ref for true benchmarks

* Remove unused import

* Update BatchSize & add throughput measurements

* Remove "cargo clean" from CI checks

* Run release tests after minimal tests
2023-03-29 15:59:52 +09:00
Matthew Keil db8f42507a
close file descriptor (#248) 2023-03-28 15:23:17 -05:00
Justin Traglia c5920c4ef4
Multi-platform nodejs bindings (#242) 2023-03-28 11:01:07 -05:00
Justin Traglia 3c6b9346b3
`make` inits submodule & builds blst (#250)
* Make inits submodule & builds blst

* Update the README

* Clean up C workflow
2023-03-28 22:26:51 +09:00
Gottfried Herold 8de0aa54ce
Only support FIELD_ELEMENTS_PER_BLOB values that are a power of 2. (#249)
* Intentionally fail to compile with a FIELD_ELEMENTS_PER_BLOB value that is not a power of 2.
We do not want to support or maintain this case, so let us be explicit about it.

* Update src/c_kzg_4844.h

Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>

* Update src/c_kzg_4844.h

Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>

---------

Co-authored-by: George Kadianakis <desnacked@riseup.net>
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
2023-03-28 00:02:01 +09:00
Divma f384175810
Reproducible rust bindings (#243)
* modify directory structure to isolate the generated bindings

* add a lib.rs file

* move deref impls to the extension file

* remove unused types from generated bindings

* cleanup new lines to reduce diff noise

* reorder definitions to reduce diff noise

* move sync and send impls to the extension file

* generate bindings

* blacklist used bindings; create snapshots dir to ensure freshness in the future

* fix typo. Ty @pawanjay176

* run cargo build after merge

* custom impl for KZGCommitment and KZGProof

* final touches
2023-03-27 23:47:24 +09:00
Stefan Bratanov 88924c8aa7
[Java] Avoid unnecessary array copying in tests (#247) 2023-03-24 10:53:46 -05:00
Justin Traglia 7695db3330
Use do {} while(0) for c_kzg_free macro (#245) 2023-03-25 00:42:08 +09:00
Justin Traglia 9fbe75f392
Move Polynomial type from header to impl (#244) 2023-03-24 22:51:42 +09:00
Justin Traglia c448e9bfcc
Fix minor memleak in Go bindings (#241)
* Fix minor memleak in Go bindings

* Move fclose back to after nil check

* Move it to correct spot, ugh
2023-03-24 22:50:15 +09:00
andri lim 9a93c75e23
Add support for nimble package (#232) 2023-03-24 08:02:38 -05:00
George Kadianakis 015e043475
Short circuit batch verification if n==1 (#234) 2023-03-23 07:50:36 -05:00
Justin Traglia 861371629e
Rename CKzgRet to CKZGRet for consistency (#240) 2023-03-22 19:38:14 +02:00
Justin Traglia ee218752c0
Add example for go bindings (#238)
* Add example for go bindings

* Remove clean cmd & do go mod tidy
2023-03-22 12:28:42 +02:00
Justin Traglia c3c150f31e
Run Go tests with portable blst (#237) 2023-03-22 12:27:10 +02:00
Gottfried Herold 577d146c0a
c_kzg_4844.c: In verify_blog_kzg_proof_batch, reuse temporary variable. (#235) 2023-03-21 15:44:56 -05:00
Matthew Keil da5a644781
Update node README (#228) 2023-03-21 09:53:27 -05:00
Stefan Bratanov fd3500fe7b
Rename ByteArrayTuple to ProofAndY (#233) 2023-03-21 08:16:53 -05:00
George Kadianakis cc10ef024d
Some misc minor codebase improvements (#229) 2023-03-20 21:31:53 -05:00
andri lim bf99ed5b91
Nim: better handling of trusted setup (#231) 2023-03-20 21:30:50 -05:00
Gottfried Herold b7902b2300
More verbose documentation for KZGSettings struct. (#222) 2023-03-20 11:14:18 +02:00
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