#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.
|
| 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.
|
| |
| 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 1, set *r equal to *a; if flag is 0, leave it.
|
| |
| 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) |
| |
◆ __has_builtin
◆ ALIGNMENT
◆ ASSERT_INT_CONST_AND_DO
Value:
\
default: ; \
} \
} while(0)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Assert statically that expr is an integer constant expression, and run stmt.
Useful for example to enforce that magnitude arguments are constant.
Definition at line 77 of file util.h.
◆ CEIL_DIV
| #define CEIL_DIV |
( |
| x, |
|
|
| y ) (1 + ((x) - 1) / (y)) |
◆ CHECK
Value:
Definition at line 148 of file util.h.
◆ DEBUG_CONFIG_DEF
◆ DEBUG_CONFIG_MSG
| #define DEBUG_CONFIG_MSG |
( |
| x | ) |
"DEBUG_CONFIG: " x |
◆ EXPECT
◆ PRINT_BUF
| #define PRINT_BUF |
( |
| buf, |
|
|
| len ) |
Value:
printf(
"%s[%lu] = ", #buf, (
unsigned long)len);
\
} while(0)
Definition at line 29 of file util.h.
◆ ROUND_TO_ALIGN
◆ SECP256K1_GNUC_EXT
◆ SECP256K1_INLINE
◆ SECP256K1_RESTRICT
◆ SECP256K1_WIDEMUL_INT64
| #define SECP256K1_WIDEMUL_INT64 1 |
◆ STATIC_ASSERT
Value:
case 0: \
\
; \
} \
} while(0)
Assert statically that expr is true.
This is a statement-like macro and can only be used inside functions.
Definition at line 64 of file util.h.
◆ STR
◆ STR_
◆ TEST_FAILURE
Value:
Definition at line 129 of file util.h.
◆ VERIFY_CHECK
◆ checked_malloc()
◆ print_buf_plain()
◆ secp256k1_callback_call()
◆ secp256k1_ctz32_var()
◆ secp256k1_ctz32_var_debruijn()
◆ secp256k1_ctz64_var()
◆ secp256k1_ctz64_var_debruijn()
◆ secp256k1_default_error_callback_fn()
◆ secp256k1_default_illegal_callback_fn()
◆ secp256k1_int_cmov()
If flag is 1, set *r equal to *a; if flag is 0, leave it.
Constant-time. Both *r and *a must be initialized and non-negative. Flag must be 0 or 1.
Definition at line 300 of file util.h.
◆ secp256k1_is_zero_array()
◆ secp256k1_memclear_explicit()
◆ secp256k1_memcmp_var()
◆ secp256k1_memczero()
◆ secp256k1_memzero_explicit()
◆ secp256k1_read_be32()
◆ secp256k1_read_be64()
◆ secp256k1_rotr32()
◆ secp256k1_write_be32()
◆ secp256k1_write_be64()
◆ default_error_callback
Initial value:= {
}
static void secp256k1_default_error_callback_fn(const char *str, void *data)
Definition at line 117 of file util.h.
◆ default_illegal_callback
Initial value:= {
}
static void secp256k1_default_illegal_callback_fn(const char *str, void *data)
Definition at line 112 of file util.h.