Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "include/secp256k1.h"
#include "group.h"
#include "secp256k1.c"
#include "testrand_impl.h"
Go to the source code of this file.
Classes | |
struct | ecmult_multi_data |
Macros | |
#define | EXHAUSTIVE_TEST_ORDER 13 |
#define | EXHAUSTIVE_TEST_LAMBDA 9 /* cube root of 1 mod 13 */ |
Functions | |
void | ge_equals_ge (const secp256k1_ge *a, const secp256k1_ge *b) |
stolen from tests.c More... | |
void | ge_equals_gej (const secp256k1_ge *a, const secp256k1_gej *b) |
void | random_fe (secp256k1_fe *x) |
int | secp256k1_nonce_function_smallint (unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int attempt) |
END stolen from tests.c. More... | |
void | test_exhaustive_addition (const secp256k1_ge *group, const secp256k1_gej *groupj, int order) |
void | test_exhaustive_ecmult (const secp256k1_context *ctx, const secp256k1_ge *group, const secp256k1_gej *groupj, int order) |
static int | ecmult_multi_callback (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *cbdata) |
void | test_exhaustive_ecmult_multi (const secp256k1_context *ctx, const secp256k1_ge *group, int order) |
void | r_from_k (secp256k1_scalar *r, const secp256k1_ge *group, int k) |
void | test_exhaustive_verify (const secp256k1_context *ctx, const secp256k1_ge *group, int order) |
void | test_exhaustive_sign (const secp256k1_context *ctx, const secp256k1_ge *group, int order) |
int | main (void) |
Macro Definition Documentation
◆ EXHAUSTIVE_TEST_LAMBDA
#define EXHAUSTIVE_TEST_LAMBDA 9 /* cube root of 1 mod 13 */ |
Definition at line 21 of file tests_exhaustive.c.
◆ EXHAUSTIVE_TEST_ORDER
#define EXHAUSTIVE_TEST_ORDER 13 |
Definition at line 20 of file tests_exhaustive.c.
Referenced by main(), r_from_k(), secp256k1_nonce_function_smallint(), secp256k1_scalar_add(), secp256k1_scalar_check_overflow(), secp256k1_scalar_inverse(), secp256k1_scalar_is_high(), secp256k1_scalar_mul(), secp256k1_scalar_negate(), secp256k1_scalar_order_get_num(), secp256k1_scalar_set_b32(), secp256k1_scalar_sqr(), and test_exhaustive_sign().
Function Documentation
◆ ecmult_multi_callback()
|
static |
Definition at line 190 of file tests_exhaustive.c.
References ecmult_multi_data::pt, and ecmult_multi_data::sc.
Referenced by test_exhaustive_ecmult_multi().
◆ ge_equals_ge()
void ge_equals_ge | ( | const secp256k1_ge * | a, |
const secp256k1_ge * | b | ||
) |
stolen from tests.c
Definition at line 35 of file tests_exhaustive.c.
References CHECK, secp256k1_ge::infinity, secp256k1_fe_equal_var(), secp256k1_ge::x, and secp256k1_ge::y.
Referenced by test_exhaustive_addition().
◆ ge_equals_gej()
void ge_equals_gej | ( | const secp256k1_ge * | a, |
const secp256k1_gej * | b | ||
) |
Definition at line 44 of file tests_exhaustive.c.
References CHECK, secp256k1_ge::infinity, secp256k1_gej::infinity, secp256k1_fe_equal_var(), secp256k1_fe_mul(), secp256k1_fe_normalize_weak(), secp256k1_fe_sqr(), secp256k1_ge::x, secp256k1_gej::x, secp256k1_ge::y, secp256k1_gej::y, and secp256k1_gej::z.
Referenced by test_exhaustive_addition(), test_exhaustive_ecmult(), and test_exhaustive_ecmult_multi().
◆ main()
int main | ( | void | ) |
Definition at line 454 of file tests_exhaustive.c.
References CHECK, ctx, secp256k1_context_struct::ecmult_gen_ctx, EXHAUSTIVE_TEST_ORDER, secp256k1_ge::infinity, random_fe(), secp256k1_context_create(), secp256k1_context_destroy(), SECP256K1_CONTEXT_SIGN, SECP256K1_CONTEXT_VERIFY, secp256k1_ecmult_gen(), secp256k1_fe_equal_var(), secp256k1_ge_const_g, secp256k1_ge_set_gej(), secp256k1_gej_add_ge(), secp256k1_gej_rescale(), secp256k1_gej_set_infinity(), secp256k1_scalar_set_int(), test_exhaustive_addition(), test_exhaustive_ecmult(), test_exhaustive_ecmult_multi(), test_exhaustive_sign(), test_exhaustive_verify(), secp256k1_ge::x, and secp256k1_ge::y.
◆ r_from_k()
void r_from_k | ( | secp256k1_scalar * | r, |
const secp256k1_ge * | group, | ||
int | k | ||
) |
Definition at line 225 of file tests_exhaustive.c.
References EXHAUSTIVE_TEST_ORDER, secp256k1_fe_get_b32(), secp256k1_fe_normalize(), secp256k1_scalar_set_b32(), and secp256k1_ge::x.
Referenced by test_exhaustive_sign(), and test_exhaustive_verify().
◆ random_fe()
void random_fe | ( | secp256k1_fe * | x | ) |
Definition at line 61 of file tests_exhaustive.c.
References secp256k1_fe_set_b32(), and secp256k1_rand256().
Referenced by main().
◆ secp256k1_nonce_function_smallint()
int secp256k1_nonce_function_smallint | ( | unsigned char * | nonce32, |
const unsigned char * | msg32, | ||
const unsigned char * | key32, | ||
const unsigned char * | algo16, | ||
void * | data, | ||
unsigned int | attempt | ||
) |
END stolen from tests.c.
Definition at line 72 of file tests_exhaustive.c.
References EXHAUSTIVE_TEST_ORDER, secp256k1_scalar_get_b32(), and secp256k1_scalar_set_int().
Referenced by test_exhaustive_sign().
◆ test_exhaustive_addition()
void test_exhaustive_addition | ( | const secp256k1_ge * | group, |
const secp256k1_gej * | groupj, | ||
int | order | ||
) |
Definition at line 103 of file tests_exhaustive.c.
References CHECK, ge_equals_ge(), ge_equals_gej(), secp256k1_ge::infinity, secp256k1_gej::infinity, secp256k1_fe_inv(), secp256k1_ge_is_infinity(), secp256k1_ge_neg(), secp256k1_gej_add_ge(), secp256k1_gej_add_ge_var(), secp256k1_gej_add_var(), secp256k1_gej_add_zinv_var(), secp256k1_gej_double_nonzero(), secp256k1_gej_double_var(), secp256k1_gej_is_infinity(), secp256k1_gej_neg(), secp256k1_ge::x, secp256k1_gej::x, secp256k1_ge::y, and secp256k1_gej::y.
Referenced by main().
◆ test_exhaustive_ecmult()
void test_exhaustive_ecmult | ( | const secp256k1_context * | ctx, |
const secp256k1_ge * | group, | ||
const secp256k1_gej * | groupj, | ||
int | order | ||
) |
Definition at line 163 of file tests_exhaustive.c.
References ctx, secp256k1_context_struct::ecmult_ctx, ge_equals_gej(), secp256k1_ecmult(), secp256k1_ecmult_const(), and secp256k1_scalar_set_int().
Referenced by main().
◆ test_exhaustive_ecmult_multi()
void test_exhaustive_ecmult_multi | ( | const secp256k1_context * | ctx, |
const secp256k1_ge * | group, | ||
int | order | ||
) |
Definition at line 197 of file tests_exhaustive.c.
References ctx, secp256k1_context_struct::ecmult_ctx, ecmult_multi_callback(), secp256k1_context_struct::error_callback, ge_equals_gej(), ecmult_multi_data::pt, ecmult_multi_data::sc, secp256k1_ecmult_multi_var(), secp256k1_scalar_set_int(), secp256k1_scratch_create(), and secp256k1_scratch_destroy().
Referenced by main().
◆ test_exhaustive_sign()
void test_exhaustive_sign | ( | const secp256k1_context * | ctx, |
const secp256k1_ge * | group, | ||
int | order | ||
) |
Definition at line 285 of file tests_exhaustive.c.
References CHECK, ctx, EXHAUSTIVE_TEST_ORDER, r_from_k(), secp256k1_ecdsa_sign(), secp256k1_ecdsa_signature_load(), secp256k1_nonce_function_smallint(), secp256k1_scalar_get_b32(), and secp256k1_scalar_set_int().
Referenced by main().
◆ test_exhaustive_verify()
void test_exhaustive_verify | ( | const secp256k1_context * | ctx, |
const secp256k1_ge * | group, | ||
int | order | ||
) |
Definition at line 235 of file tests_exhaustive.c.
References CHECK, ctx, memcpy(), r_from_k(), secp256k1_ecdsa_signature_save(), secp256k1_ecdsa_verify(), secp256k1_pubkey_save(), secp256k1_scalar_add(), secp256k1_scalar_eq(), secp256k1_scalar_get_b32(), secp256k1_scalar_is_high(), secp256k1_scalar_mul(), and secp256k1_scalar_set_int().
Referenced by main().