Classes | Macros | Typedefs | Enumerations | Functions
third_party/boringssl-with-bazel/src/crypto/internal.h File Reference
#include <openssl/crypto.h>
#include <openssl/ex_data.h>
#include <openssl/stack.h>
#include <openssl/thread.h>
#include <assert.h>
#include <string.h>
#include <stdalign.h>
Include dependency graph for third_party/boringssl-with-bazel/src/crypto/internal.h:

Go to the source code of this file.

Classes

struct  CRYPTO_EX_DATA_CLASS
 
struct  CRYPTO_STATIC_MUTEX
 

Macros

#define CONSTTIME_DECLASSIFY(x, y)
 
#define CONSTTIME_FALSE_8   ((uint8_t)0)
 
#define CONSTTIME_FALSE_W   ((crypto_word_t)0)
 
#define CONSTTIME_SECRET(x, y)
 
#define CONSTTIME_TRUE_8   ((uint8_t)0xff)
 
#define CONSTTIME_TRUE_W   ~((crypto_word_t)0)
 
#define CRYPTO_EX_DATA_CLASS_INIT   {CRYPTO_STATIC_MUTEX_INIT, NULL, 0}
 
#define CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA   {CRYPTO_STATIC_MUTEX_INIT, NULL, 1}
 
#define CRYPTO_ONCE_INIT   0
 
#define CRYPTO_REFCOUNT_MAX   0xffffffff
 
#define CRYPTO_STATIC_MUTEX_INIT   { 0 }
 
#define OPENSSL_ARRAY_SIZE(array)   (sizeof(array) / sizeof((array)[0]))
 
#define OPENSSL_FALLTHROUGH
 

Typedefs

typedef struct crypto_ex_data_func_st CRYPTO_EX_DATA_FUNCS
 
typedef uint32_t CRYPTO_once_t
 
typedef void(* thread_local_destructor_t) (void *)
 

Enumerations

enum  thread_local_data_t {
  OPENSSL_THREAD_LOCAL_ERR = 0, OPENSSL_THREAD_LOCAL_RAND, OPENSSL_THREAD_LOCAL_FIPS_COUNTERS, OPENSSL_THREAD_LOCAL_TEST,
  NUM_OPENSSL_THREAD_LOCALS
}
 

Functions

static void * align_pointer (void *ptr, size_t alignment)
 
OPENSSL_INLINE void boringssl_fips_inc_counter (enum fips_counter_t counter)
 
int boringssl_fips_self_test (const uint8_t *module_hash, size_t module_hash_len)
 
static int buffers_alias (const uint8_t *a, size_t a_len, const uint8_t *b, size_t b_len)
 
static uint8_t constant_time_eq_8 (crypto_word_t a, crypto_word_t b)
 
static crypto_word_t constant_time_eq_int (int a, int b)
 
static uint8_t constant_time_eq_int_8 (int a, int b)
 
static crypto_word_t constant_time_eq_w (crypto_word_t a, crypto_word_t b)
 
static uint8_t constant_time_ge_8 (crypto_word_t a, crypto_word_t b)
 
static crypto_word_t constant_time_ge_w (crypto_word_t a, crypto_word_t b)
 
static uint8_t constant_time_is_zero_8 (crypto_word_t a)
 
static crypto_word_t constant_time_is_zero_w (crypto_word_t a)
 
static uint8_t constant_time_lt_8 (crypto_word_t a, crypto_word_t b)
 
static crypto_word_t constant_time_lt_w (crypto_word_t a, crypto_word_t b)
 
static crypto_word_t constant_time_msb_w (crypto_word_t a)
 
static uint8_t constant_time_select_8 (uint8_t mask, uint8_t a, uint8_t b)
 
static int constant_time_select_int (crypto_word_t mask, int a, int b)
 
static crypto_word_t constant_time_select_w (crypto_word_t mask, crypto_word_t a, crypto_word_t b)
 
static uint16_t CRYPTO_bswap2 (uint16_t x)
 
static uint32_t CRYPTO_bswap4 (uint32_t x)
 
static uint64_t CRYPTO_bswap8 (uint64_t x)
 
OPENSSL_EXPORT void CRYPTO_free_ex_data (CRYPTO_EX_DATA_CLASS *ex_data_class, void *obj, CRYPTO_EX_DATA *ad)
 
OPENSSL_EXPORT void * CRYPTO_get_ex_data (const CRYPTO_EX_DATA *ad, int index)
 
OPENSSL_EXPORT int CRYPTO_get_ex_new_index (CRYPTO_EX_DATA_CLASS *ex_data_class, int *out_index, long argl, void *argp, CRYPTO_EX_free *free_func)
 
OPENSSL_EXPORT void * CRYPTO_get_thread_local (thread_local_data_t value)
 
static uint32_t CRYPTO_load_u32_be (const void *in)
 
static uint32_t CRYPTO_load_u32_le (const void *in)
 
static uint64_t CRYPTO_load_u64_be (const void *ptr)
 
static crypto_word_t CRYPTO_load_word_le (const void *in)
 
OPENSSL_EXPORT void CRYPTO_MUTEX_cleanup (CRYPTO_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_MUTEX_init (CRYPTO_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_MUTEX_lock_read (CRYPTO_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_MUTEX_lock_write (CRYPTO_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_read (CRYPTO_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_write (CRYPTO_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_new_ex_data (CRYPTO_EX_DATA *ad)
 
OPENSSL_EXPORT void CRYPTO_once (CRYPTO_once_t *once, void(*init)(void))
 
OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero (CRYPTO_refcount_t *count)
 
OPENSSL_EXPORT void CRYPTO_refcount_inc (CRYPTO_refcount_t *count)
 
static uint32_t CRYPTO_rotl_u32 (uint32_t value, int shift)
 
static uint64_t CRYPTO_rotl_u64 (uint64_t value, int shift)
 
static uint32_t CRYPTO_rotr_u32 (uint32_t value, int shift)
 
static uint64_t CRYPTO_rotr_u64 (uint64_t value, int shift)
 
OPENSSL_EXPORT int CRYPTO_set_ex_data (CRYPTO_EX_DATA *ad, int index, void *val)
 
OPENSSL_EXPORT int CRYPTO_set_thread_local (thread_local_data_t index, void *value, thread_local_destructor_t destructor)
 
OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_read (struct CRYPTO_STATIC_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_write (struct CRYPTO_STATIC_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_read (struct CRYPTO_STATIC_MUTEX *lock)
 
OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_write (struct CRYPTO_STATIC_MUTEX *lock)
 
static void CRYPTO_store_u32_be (void *out, uint32_t v)
 
static void CRYPTO_store_u32_le (void *out, uint32_t v)
 
static void CRYPTO_store_u64_be (void *out, uint64_t v)
 
static void CRYPTO_store_word_le (void *out, crypto_word_t v)
 
static void * OPENSSL_memchr (const void *s, int c, size_t n)
 
static int OPENSSL_memcmp (const void *s1, const void *s2, size_t n)
 
static void * OPENSSL_memcpy (void *dst, const void *src, size_t n)
 
static void * OPENSSL_memmove (void *dst, const void *src, size_t n)
 
static void * OPENSSL_memset (void *dst, int c, size_t n)
 
static uint32_t value_barrier_u32 (uint32_t a)
 
static uint64_t value_barrier_u64 (uint64_t a)
 
static crypto_word_t value_barrier_w (crypto_word_t a)
 

Macro Definition Documentation

◆ CONSTTIME_DECLASSIFY

#define CONSTTIME_DECLASSIFY (   x,
  y 
)

◆ CONSTTIME_FALSE_8

#define CONSTTIME_FALSE_8   ((uint8_t)0)

◆ CONSTTIME_FALSE_W

#define CONSTTIME_FALSE_W   ((crypto_word_t)0)

◆ CONSTTIME_SECRET

#define CONSTTIME_SECRET (   x,
  y 
)

◆ CONSTTIME_TRUE_8

#define CONSTTIME_TRUE_8   ((uint8_t)0xff)

◆ CONSTTIME_TRUE_W

#define CONSTTIME_TRUE_W   ~((crypto_word_t)0)

◆ CRYPTO_EX_DATA_CLASS_INIT

#define CRYPTO_EX_DATA_CLASS_INIT   {CRYPTO_STATIC_MUTEX_INIT, NULL, 0}

◆ CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA

#define CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA   {CRYPTO_STATIC_MUTEX_INIT, NULL, 1}

◆ CRYPTO_ONCE_INIT

#define CRYPTO_ONCE_INIT   0

◆ CRYPTO_REFCOUNT_MAX

#define CRYPTO_REFCOUNT_MAX   0xffffffff

◆ CRYPTO_STATIC_MUTEX_INIT

#define CRYPTO_STATIC_MUTEX_INIT   { 0 }

◆ OPENSSL_ARRAY_SIZE

#define OPENSSL_ARRAY_SIZE (   array)    (sizeof(array) / sizeof((array)[0]))

◆ OPENSSL_FALLTHROUGH

#define OPENSSL_FALLTHROUGH

Typedef Documentation

◆ CRYPTO_EX_DATA_FUNCS

◆ CRYPTO_once_t

◆ thread_local_destructor_t

typedef void(* thread_local_destructor_t) (void *)

Enumeration Type Documentation

◆ thread_local_data_t

Enumerator
OPENSSL_THREAD_LOCAL_ERR 
OPENSSL_THREAD_LOCAL_RAND 
OPENSSL_THREAD_LOCAL_FIPS_COUNTERS 
OPENSSL_THREAD_LOCAL_TEST 
NUM_OPENSSL_THREAD_LOCALS 

Definition at line 635 of file third_party/boringssl-with-bazel/src/crypto/internal.h.

Function Documentation

◆ align_pointer()

static void* align_pointer ( void *  ptr,
size_t  alignment 
)
inlinestatic

◆ boringssl_fips_inc_counter()

OPENSSL_INLINE void boringssl_fips_inc_counter ( enum fips_counter_t  counter)

◆ boringssl_fips_self_test()

int boringssl_fips_self_test ( const uint8_t module_hash,
size_t  module_hash_len 
)

Definition at line 298 of file self_check.c.

◆ buffers_alias()

static int buffers_alias ( const uint8_t a,
size_t  a_len,
const uint8_t b,
size_t  b_len 
)
inlinestatic

◆ constant_time_eq_8()

static uint8_t constant_time_eq_8 ( crypto_word_t  a,
crypto_word_t  b 
)
inlinestatic

◆ constant_time_eq_int()

static crypto_word_t constant_time_eq_int ( int  a,
int  b 
)
inlinestatic

◆ constant_time_eq_int_8()

static uint8_t constant_time_eq_int_8 ( int  a,
int  b 
)
inlinestatic

◆ constant_time_eq_w()

static crypto_word_t constant_time_eq_w ( crypto_word_t  a,
crypto_word_t  b 
)
inlinestatic

◆ constant_time_ge_8()

static uint8_t constant_time_ge_8 ( crypto_word_t  a,
crypto_word_t  b 
)
inlinestatic

◆ constant_time_ge_w()

static crypto_word_t constant_time_ge_w ( crypto_word_t  a,
crypto_word_t  b 
)
inlinestatic

◆ constant_time_is_zero_8()

static uint8_t constant_time_is_zero_8 ( crypto_word_t  a)
inlinestatic

◆ constant_time_is_zero_w()

static crypto_word_t constant_time_is_zero_w ( crypto_word_t  a)
inlinestatic

◆ constant_time_lt_8()

static uint8_t constant_time_lt_8 ( crypto_word_t  a,
crypto_word_t  b 
)
inlinestatic

◆ constant_time_lt_w()

static crypto_word_t constant_time_lt_w ( crypto_word_t  a,
crypto_word_t  b 
)
inlinestatic

◆ constant_time_msb_w()

static crypto_word_t constant_time_msb_w ( crypto_word_t  a)
inlinestatic

◆ constant_time_select_8()

static uint8_t constant_time_select_8 ( uint8_t  mask,
uint8_t  a,
uint8_t  b 
)
inlinestatic

◆ constant_time_select_int()

static int constant_time_select_int ( crypto_word_t  mask,
int  a,
int  b 
)
inlinestatic

◆ constant_time_select_w()

static crypto_word_t constant_time_select_w ( crypto_word_t  mask,
crypto_word_t  a,
crypto_word_t  b 
)
inlinestatic

◆ CRYPTO_bswap2()

static uint16_t CRYPTO_bswap2 ( uint16_t  x)
inlinestatic

◆ CRYPTO_bswap4()

static uint32_t CRYPTO_bswap4 ( uint32_t  x)
inlinestatic

◆ CRYPTO_bswap8()

static uint64_t CRYPTO_bswap8 ( uint64_t  x)
inlinestatic

◆ CRYPTO_free_ex_data()

OPENSSL_EXPORT void CRYPTO_free_ex_data ( CRYPTO_EX_DATA_CLASS ex_data_class,
void *  obj,
CRYPTO_EX_DATA ad 
)

Definition at line 232 of file ex_data.c.

◆ CRYPTO_get_ex_data()

OPENSSL_EXPORT void* CRYPTO_get_ex_data ( const CRYPTO_EX_DATA ad,
int  index 
)

Definition at line 193 of file ex_data.c.

◆ CRYPTO_get_ex_new_index()

OPENSSL_EXPORT int CRYPTO_get_ex_new_index ( CRYPTO_EX_DATA_CLASS ex_data_class,
int out_index,
long  argl,
void *  argp,
CRYPTO_EX_free free_func 
)

Definition at line 131 of file ex_data.c.

◆ CRYPTO_get_thread_local()

OPENSSL_EXPORT void* CRYPTO_get_thread_local ( thread_local_data_t  value)

Definition at line 49 of file thread_none.c.

◆ CRYPTO_load_u32_be()

static uint32_t CRYPTO_load_u32_be ( const void *  in)
inlinestatic

◆ CRYPTO_load_u32_le()

static uint32_t CRYPTO_load_u32_le ( const void *  in)
inlinestatic

◆ CRYPTO_load_u64_be()

static uint64_t CRYPTO_load_u64_be ( const void *  ptr)
inlinestatic

◆ CRYPTO_load_word_le()

static crypto_word_t CRYPTO_load_word_le ( const void *  in)
inlinestatic

◆ CRYPTO_MUTEX_cleanup()

OPENSSL_EXPORT void CRYPTO_MUTEX_cleanup ( CRYPTO_MUTEX lock)

Definition at line 29 of file thread_none.c.

◆ CRYPTO_MUTEX_init()

OPENSSL_EXPORT void CRYPTO_MUTEX_init ( CRYPTO_MUTEX lock)

Definition at line 19 of file thread_none.c.

◆ CRYPTO_MUTEX_lock_read()

OPENSSL_EXPORT void CRYPTO_MUTEX_lock_read ( CRYPTO_MUTEX lock)

Definition at line 21 of file thread_none.c.

◆ CRYPTO_MUTEX_lock_write()

OPENSSL_EXPORT void CRYPTO_MUTEX_lock_write ( CRYPTO_MUTEX lock)

Definition at line 23 of file thread_none.c.

◆ CRYPTO_MUTEX_unlock_read()

OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_read ( CRYPTO_MUTEX lock)

Definition at line 25 of file thread_none.c.

◆ CRYPTO_MUTEX_unlock_write()

OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_write ( CRYPTO_MUTEX lock)

Definition at line 27 of file thread_none.c.

◆ CRYPTO_new_ex_data()

OPENSSL_EXPORT void CRYPTO_new_ex_data ( CRYPTO_EX_DATA ad)

Definition at line 228 of file ex_data.c.

◆ CRYPTO_once()

OPENSSL_EXPORT void CRYPTO_once ( CRYPTO_once_t once,
void(*)(void)  init 
)

Definition at line 39 of file thread_none.c.

◆ CRYPTO_refcount_dec_and_test_zero()

OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero ( CRYPTO_refcount_t count)

Definition at line 37 of file refcount_lock.c.

◆ CRYPTO_refcount_inc()

OPENSSL_EXPORT void CRYPTO_refcount_inc ( CRYPTO_refcount_t count)

Definition at line 29 of file refcount_lock.c.

◆ CRYPTO_rotl_u32()

static uint32_t CRYPTO_rotl_u32 ( uint32_t  value,
int  shift 
)
inlinestatic

◆ CRYPTO_rotl_u64()

static uint64_t CRYPTO_rotl_u64 ( uint64_t  value,
int  shift 
)
inlinestatic

◆ CRYPTO_rotr_u32()

static uint32_t CRYPTO_rotr_u32 ( uint32_t  value,
int  shift 
)
inlinestatic

◆ CRYPTO_rotr_u64()

static uint64_t CRYPTO_rotr_u64 ( uint64_t  value,
int  shift 
)
inlinestatic

◆ CRYPTO_set_ex_data()

OPENSSL_EXPORT int CRYPTO_set_ex_data ( CRYPTO_EX_DATA ad,
int  index,
void *  val 
)

Definition at line 168 of file ex_data.c.

◆ CRYPTO_set_thread_local()

OPENSSL_EXPORT int CRYPTO_set_thread_local ( thread_local_data_t  index,
void *  value,
thread_local_destructor_t  destructor 
)

Definition at line 53 of file thread_none.c.

◆ CRYPTO_STATIC_MUTEX_lock_read()

OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_read ( struct CRYPTO_STATIC_MUTEX lock)

Definition at line 31 of file thread_none.c.

◆ CRYPTO_STATIC_MUTEX_lock_write()

OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_write ( struct CRYPTO_STATIC_MUTEX lock)

Definition at line 33 of file thread_none.c.

◆ CRYPTO_STATIC_MUTEX_unlock_read()

OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_read ( struct CRYPTO_STATIC_MUTEX lock)

Definition at line 35 of file thread_none.c.

◆ CRYPTO_STATIC_MUTEX_unlock_write()

OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_write ( struct CRYPTO_STATIC_MUTEX lock)

Definition at line 37 of file thread_none.c.

◆ CRYPTO_store_u32_be()

static void CRYPTO_store_u32_be ( void *  out,
uint32_t  v 
)
inlinestatic

◆ CRYPTO_store_u32_le()

static void CRYPTO_store_u32_le ( void *  out,
uint32_t  v 
)
inlinestatic

◆ CRYPTO_store_u64_be()

static void CRYPTO_store_u64_be ( void *  out,
uint64_t  v 
)
inlinestatic

◆ CRYPTO_store_word_le()

static void CRYPTO_store_word_le ( void *  out,
crypto_word_t  v 
)
inlinestatic

◆ OPENSSL_memchr()

static void* OPENSSL_memchr ( const void *  s,
int  c,
size_t  n 
)
inlinestatic

◆ OPENSSL_memcmp()

static int OPENSSL_memcmp ( const void *  s1,
const void *  s2,
size_t  n 
)
inlinestatic

◆ OPENSSL_memcpy()

static void* OPENSSL_memcpy ( void *  dst,
const void *  src,
size_t  n 
)
inlinestatic

◆ OPENSSL_memmove()

static void* OPENSSL_memmove ( void *  dst,
const void *  src,
size_t  n 
)
inlinestatic

◆ OPENSSL_memset()

static void* OPENSSL_memset ( void *  dst,
int  c,
size_t  n 
)
inlinestatic

◆ value_barrier_u32()

static uint32_t value_barrier_u32 ( uint32_t  a)
inlinestatic

◆ value_barrier_u64()

static uint64_t value_barrier_u64 ( uint64_t  a)
inlinestatic

◆ value_barrier_w()

static crypto_word_t value_barrier_w ( crypto_word_t  a)
inlinestatic


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:20