![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
#include "../include/secp256k1.h"#include "checkmem.h"#include <string.h>#include <stdlib.h>#include <stdint.h>#include <stdio.h>#include <limits.h>Go to the source code of this file.
Classes | |
| struct | secp256k1_callback |
Macros | |
| #define | STR_(x) #x |
| #define | STR(x) STR_(x) |
| #define | DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x |
| #define | DEBUG_CONFIG_DEF(x) DEBUG_CONFIG_MSG(#x "=" STR(x)) |
| #define | PRINT_BUF(buf, len) |
| #define | SECP256K1_INLINE |
| #define | STATIC_ASSERT(expr) |
| Assert statically that expr is true. More... | |
| #define | ASSERT_INT_CONST_AND_DO(expr, stmt) |
| Assert statically that expr is an integer constant expression, and run stmt. More... | |
| #define | TEST_FAILURE(msg) |
| #define | EXPECT(x, c) (x) |
| #define | CHECK(cond) |
| #define | VERIFY_CHECK(cond) |
| #define | ALIGNMENT 16 |
| #define | CEIL_DIV(x, y) (1 + ((x) - 1) / (y)) |
| #define | ROUND_TO_ALIGN(size) (CEIL_DIV(size, ALIGNMENT) * ALIGNMENT) |
| #define | SECP256K1_RESTRICT |
| #define | SECP256K1_GNUC_EXT |
| #define | SECP256K1_WIDEMUL_INT64 1 |
| #define | __has_builtin(x) 0 |
Functions | |
| static void | print_buf_plain (const unsigned char *buf, size_t len) |
| static SECP256K1_INLINE void | secp256k1_callback_call (const secp256k1_callback *const cb, const char *const text) |
| static void | secp256k1_default_illegal_callback_fn (const char *str, void *data) |
| static void | secp256k1_default_error_callback_fn (const char *str, void *data) |
| static SECP256K1_INLINE void * | checked_malloc (const secp256k1_callback *cb, size_t size) |
| static SECP256K1_INLINE void | secp256k1_memczero (void *s, size_t len, int flag) |
| static SECP256K1_INLINE void | secp256k1_memzero_explicit (void *ptr, size_t len) |
| static SECP256K1_INLINE void | secp256k1_memclear_explicit (void *ptr, size_t len) |
| static SECP256K1_INLINE int | secp256k1_memcmp_var (const void *s1, const void *s2, size_t n) |
| Semantics like memcmp. More... | |
| static SECP256K1_INLINE int | secp256k1_is_zero_array (const unsigned char *s, size_t len) |
| static SECP256K1_INLINE void | secp256k1_int_cmov (int *r, const int *a, int flag) |
| If flag is true, set *r equal to *a; otherwise leave it. More... | |
| static SECP256K1_INLINE int | secp256k1_ctz32_var_debruijn (uint32_t x) |
| static SECP256K1_INLINE int | secp256k1_ctz64_var_debruijn (uint64_t x) |
| static SECP256K1_INLINE int | secp256k1_ctz32_var (uint32_t x) |
| static SECP256K1_INLINE int | secp256k1_ctz64_var (uint64_t x) |
| static SECP256K1_INLINE uint32_t | secp256k1_read_be32 (const unsigned char *p) |
| static SECP256K1_INLINE void | secp256k1_write_be32 (unsigned char *p, uint32_t x) |
| static SECP256K1_INLINE uint64_t | secp256k1_read_be64 (const unsigned char *p) |
| static SECP256K1_INLINE void | secp256k1_write_be64 (unsigned char *p, uint64_t x) |
| static SECP256K1_INLINE uint32_t | secp256k1_rotr32 (const uint32_t x, const unsigned int by) |
Variables | |
| static const secp256k1_callback | default_illegal_callback |
| static const secp256k1_callback | default_error_callback |
| #define ASSERT_INT_CONST_AND_DO | ( | expr, | |
| stmt | |||
| ) |
Assert statically that expr is an integer constant expression, and run stmt.
Useful for example to enforce that magnitude arguments are constant.
| #define CHECK | ( | cond | ) |
| #define DEBUG_CONFIG_DEF | ( | x | ) | DEBUG_CONFIG_MSG(#x "=" STR(x)) |
| #define PRINT_BUF | ( | buf, | |
| len | |||
| ) |
| #define STATIC_ASSERT | ( | expr | ) |
Assert statically that expr is true.
This is a statement-like macro and can only be used inside functions.
| #define TEST_FAILURE | ( | msg | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Semantics like memcmp.
Variable-time.
We use this to avoid possible compiler bugs with memcmp, e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |