-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #205: Bulletproofs++: Norm argument
d7fb25c Make sure that bppp_log2 isn't called with value 0 (Jonas Nick) e5a01d1 Rename buletproof_pp* to bppp* (sanket1729) c983186 transcript: add tests (Jonas Nick) 73edc75 norm arg: add verification vectors (Jonas Nick) 13ad32e norm arg: add tests for zero length and zero vectors (Jonas Nick) 34c4847 ci: add bulletproofs (Jonas Nick) 2574516 Add testcases for bulletproofs++ norm arugment (sanket1729) 46c7391 Add norm argument verify API (sanket1729) d914545 Add bulletproofs++ norm argument prove API (sanket1729) 8638f0e Add internal BP++ commit API (sanket1729) 412f8f6 Add utility functions required in norm argument (sanket1729) 420353d Add utilities for log2 (sanket1729) 17417d4 Add utilities from uncompressed Bulletproofs PR (sanket1729) 48563c8 bulletproofs: add API functionality to generate a large set of generators (Andrew Poelstra) 048f9f8 bulletproofs: add new empty module (Andrew Poelstra) 6162d57 generator: cleanups in Pedersen/generator code (Andrew Poelstra) 0a60069 Revert "Remove unused scalar_sqr" (Andrew Poelstra) 87373f5 MOVE ONLY: move Pedersen commitment stuff to generator module from rangeproof module (Andrew Poelstra) Pull request description: ACKs for top commit: Liam-Eagen: ACK d7fb25c jonasnick: ACK d7fb25c Tree-SHA512: 0a51e2b404ab594e4ce6c4a65a35f6bbf870d718e0a3cdf7ddd085ed37a0e0c0db55dabca8fe9d8b8beb3f7e60280aa46a2951408c18942dd6ad1c9a71bab5cd
- Loading branch information
Showing
33 changed files
with
2,429 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#ifndef _SECP256K1_BPPP_ | ||
# define _SECP256K1_BPPP_ | ||
|
||
# include "secp256k1.h" | ||
|
||
# ifdef __cplusplus | ||
extern "C" { | ||
# endif | ||
|
||
#include <stdint.h> | ||
|
||
/** Opaque structure representing a large number of NUMS generators */ | ||
typedef struct secp256k1_bppp_generators secp256k1_bppp_generators; | ||
|
||
/** Allocates and initializes a list of NUMS generators. | ||
* Returns a list of generators, or calls the error callback if the allocation fails. | ||
* Args: ctx: pointer to a context object | ||
* n: number of NUMS generators to produce. | ||
* | ||
* TODO: In a followup range-proof PR, this is would still require 16 + 8 = 24 NUMS | ||
* points. We will later use G = H0(required for compatibility with pedersen_commitment DS) | ||
* in a separate commit to make review easier. | ||
*/ | ||
SECP256K1_API secp256k1_bppp_generators *secp256k1_bppp_generators_create( | ||
const secp256k1_context* ctx, | ||
size_t n | ||
) SECP256K1_ARG_NONNULL(1); | ||
|
||
/** Allocates a list of generators from a static array | ||
* Returns a list of generators or NULL in case of failure. | ||
* Args: ctx: pointer to a context object | ||
* In: data: data that came from `secp256k1_bppp_generators_serialize` | ||
* data_len: the length of the `data` buffer | ||
*/ | ||
SECP256K1_API secp256k1_bppp_generators* secp256k1_bppp_generators_parse( | ||
const secp256k1_context* ctx, | ||
const unsigned char* data, | ||
size_t data_len | ||
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2); | ||
|
||
/** Serializes a list of generators to an array | ||
* Returns 1 on success, 0 if the provided array was not large enough | ||
* Args: ctx: pointer to a context object | ||
* gen: pointer to the generator set to be serialized | ||
* Out: data: pointer to buffer into which the generators will be serialized | ||
* In/Out: data_len: the length of the `data` buffer. Should be at least | ||
* k = 33 * num_gens. Will be set to k on successful return | ||
* | ||
* TODO: For ease of review, this setting G = H0 is not included in this commit. We will | ||
* add it in the follow-up rangeproof PR. | ||
*/ | ||
SECP256K1_API int secp256k1_bppp_generators_serialize( | ||
const secp256k1_context* ctx, | ||
const secp256k1_bppp_generators* gen, | ||
unsigned char* data, | ||
size_t *data_len | ||
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4); | ||
|
||
/** Destroys a list of NUMS generators, freeing allocated memory | ||
* Args: ctx: pointer to a context object | ||
* gen: pointer to the generator set to be destroyed | ||
* (can be NULL, in which case this function is a no-op) | ||
*/ | ||
SECP256K1_API void secp256k1_bppp_generators_destroy( | ||
const secp256k1_context* ctx, | ||
secp256k1_bppp_generators* gen | ||
) SECP256K1_ARG_NONNULL(1); | ||
|
||
# ifdef __cplusplus | ||
} | ||
# endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.