Bitcoin ABC 0.30.5
P2P Digital Currency
Functions
main_impl.h File Reference
#include "include/secp256k1_multiset.h"
#include "hash.h"
#include "field.h"
#include "group.h"
Include dependency graph for main_impl.h:

Go to the source code of this file.

Functions

static void multiset_from_gej_var (secp256k1_multiset *target, const secp256k1_gej *input)
 Converts a group element (Jacobian) to a multiset. More...
 
static void gej_from_multiset_var (secp256k1_gej *target, const secp256k1_multiset *input)
 Converts a multiset to group element (Jacobian) Infinite uses special value, z = 0. More...
 
static void ge_from_data_var (secp256k1_ge *target, const unsigned char *input, size_t inputLen, int inverse)
 Converts a data element to a group element (affine) More...
 
static int multiset_add_remove (const secp256k1_context *ctx, secp256k1_multiset *multiset, const unsigned char *input, size_t inputLen, int remove)
 Adds or removes a data element. More...
 
int secp256k1_multiset_add (const secp256k1_context *ctx, secp256k1_multiset *multiset, const unsigned char *input, size_t inputLen)
 Adds a data element to the multiset. More...
 
int secp256k1_multiset_remove (const secp256k1_context *ctx, secp256k1_multiset *multiset, const unsigned char *input, size_t inputLen)
 Removes a data element from the multiset. More...
 
int secp256k1_multiset_combine (const secp256k1_context *ctx, secp256k1_multiset *multiset, const secp256k1_multiset *input)
 Adds input multiset to multiset. More...
 
int secp256k1_multiset_finalize (const secp256k1_context *ctx, unsigned char *resultHash, const secp256k1_multiset *multiset)
 Hash the multiset into resultHash. More...
 
int secp256k1_multiset_init (const secp256k1_context *ctx, secp256k1_multiset *multiset)
 Inits the multiset with the constant for empty data, represented by the Jacobian GE infinite. More...
 

Function Documentation

◆ ge_from_data_var()

static void ge_from_data_var ( secp256k1_ge target,
const unsigned char *  input,
size_t  inputLen,
int  inverse 
)
static

Converts a data element to a group element (affine)

We use trial-and-rehash which is fast but non-constant time. Though constant time algo's exist we are not concerned with timing attacks as we make no attempt to hide the underlying data

Pass inverse=0 to generate the group element, or inverse=1 to generate its inverse

Definition at line 50 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gej_from_multiset_var()

static void gej_from_multiset_var ( secp256k1_gej target,
const secp256k1_multiset input 
)
static

Converts a multiset to group element (Jacobian) Infinite uses special value, z = 0.

Definition at line 34 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multiset_add_remove()

static int multiset_add_remove ( const secp256k1_context ctx,
secp256k1_multiset multiset,
const unsigned char *  input,
size_t  inputLen,
int  remove 
)
static

Adds or removes a data element.

Definition at line 98 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multiset_from_gej_var()

static void multiset_from_gej_var ( secp256k1_multiset target,
const secp256k1_gej input 
)
static

Converts a group element (Jacobian) to a multiset.

Requires the field elements to be normalized Infinite uses special value, z = 0

Definition at line 21 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_multiset_add()

int secp256k1_multiset_add ( const secp256k1_context ctx,
secp256k1_multiset multiset,
const unsigned char *  input,
size_t  inputLen 
)

Adds a data element to the multiset.

Adds an element to a multiset from single data element.

Definition at line 127 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_multiset_combine()

int secp256k1_multiset_combine ( const secp256k1_context ctx,
secp256k1_multiset multiset,
const secp256k1_multiset input 
)

Adds input multiset to multiset.

Combines two multisets.

Definition at line 137 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_multiset_finalize()

int secp256k1_multiset_finalize ( const secp256k1_context ctx,
unsigned char *  resultHash,
const secp256k1_multiset multiset 
)

Hash the multiset into resultHash.

Converts a multiset to a hash.

Definition at line 165 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_multiset_init()

int secp256k1_multiset_init ( const secp256k1_context ctx,
secp256k1_multiset multiset 
)

Inits the multiset with the constant for empty data, represented by the Jacobian GE infinite.

Initialize a multiset The resulting multiset the multiset for no data elements.

Definition at line 200 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_multiset_remove()

int secp256k1_multiset_remove ( const secp256k1_context ctx,
secp256k1_multiset multiset,
const unsigned char *  input,
size_t  inputLen 
)

Removes a data element from the multiset.

Removes an element from a multiset.

Definition at line 132 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function: