A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/constant__time__impl_8h_source.html below:

NCBI C++ ToolKit: src/connect/mbedtls/constant_time_impl.h Source File

8 #ifndef MBEDTLS_CONSTANT_TIME_IMPL_H 9 #define MBEDTLS_CONSTANT_TIME_IMPL_H 15 #if defined(MBEDTLS_BIGNUM_C) 34 #if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4) 35  #pragma GCC diagnostic push 36  #pragma GCC diagnostic ignored "-Wredundant-decls" 40 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && (!defined(__ARMCC_VERSION) || \ 41  __ARMCC_VERSION >= 6000000) 42 #define MBEDTLS_CT_ASM 43 #if (defined(__arm__) || defined(__thumb__) || defined(__thumb2__)) 44 #define MBEDTLS_CT_ARM_ASM 45 #elif defined(__aarch64__) 46 #define MBEDTLS_CT_AARCH64_ASM 47 #elif defined(__amd64__) || defined(__x86_64__) 48 #define MBEDTLS_CT_X86_64_ASM 49 #elif defined(__i386__) 50 #define MBEDTLS_CT_X86_ASM 54 #define MBEDTLS_CT_SIZE (sizeof(mbedtls_ct_uint_t) * 8) 68 #if !defined(MBEDTLS_CT_ASM) 87 #if defined(MBEDTLS_CT_ASM) 88  asm volatile

(

""

: [x]

"+r"

(x) :);

112 #if defined(MBEDTLS_COMPILER_IS_GCC) && defined(__thumb__) && !defined(__thumb2__) && \ 113  (__GNUC__ < 11) && !defined(__ARM_ARCH_2__) 114 #define RESTORE_ASM_SYNTAX ".syntax divided \n\t" 116 #define RESTORE_ASM_SYNTAX 130 #if defined(MBEDTLS_CT_AARCH64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) 132  asm volatile

(

"neg %x[s], %x[x] \n\t" 133  "orr %x[x], %x[s], %x[x] \n\t" 134  "asr %x[x], %x[x], 63 \n\t" 142 #elif defined(MBEDTLS_CT_ARM_ASM) && defined(MBEDTLS_CT_SIZE_32) 144  asm volatile

(

".syntax unified \n\t" 145  "negs %[s], %[x] \n\t" 146  "orrs %[x], %[x], %[s] \n\t" 147  "asrs %[x], %[x], #31 \n\t" 157 #elif defined(MBEDTLS_CT_X86_64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) 159  asm volatile

(

"mov %[x], %[s] \n\t" 170 #elif defined(MBEDTLS_CT_X86_ASM) && defined(MBEDTLS_CT_SIZE_32) 172  asm volatile

(

"mov %[x], %[s] \n\t" 185 #if defined(_MSC_VER) 188 #pragma warning( push ) 189 #pragma warning( disable : 4146 ) 199 #if defined(_MSC_VER) 200 #pragma warning( pop ) 209 #if defined(MBEDTLS_CT_AARCH64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) 210  asm volatile

(

"and %x[if1], %x[if1], %x[condition] \n\t" 211  "mvn %x[condition], %x[condition] \n\t" 212  "and %x[condition], %x[condition], %x[if0] \n\t" 213  "orr %x[condition], %x[if1], %x[condition]" 215

[condition]

"+&r"

(condition),

222 #elif defined(MBEDTLS_CT_ARM_ASM) && defined(MBEDTLS_CT_SIZE_32) 223  asm volatile

(

".syntax unified \n\t" 224  "ands %[if1], %[if1], %[condition] \n\t" 225  "mvns %[condition], %[condition] \n\t" 226  "ands %[condition], %[condition], %[if0] \n\t" 227  "orrs %[condition], %[if1], %[condition] \n\t" 230

[condition]

"+&l"

(condition),

238 #elif defined(MBEDTLS_CT_X86_64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) 239  asm volatile

(

"and %[condition], %[if1] \n\t" 240  "not %[condition] \n\t" 241  "and %[condition], %[if0] \n\t" 242  "or %[if1], %[if0] \n\t" 244

[condition]

"+&D"

(condition),

251 #elif defined(MBEDTLS_CT_X86_ASM) && defined(MBEDTLS_CT_SIZE_32) 252  asm volatile

(

"and %[condition], %[if1] \n\t" 253  "not %[condition] \n\t" 254  "and %[if0], %[condition] \n\t" 255  "or %[condition], %[if1] \n\t" 257

[condition]

"+&c"

(condition),

273 #if defined(MBEDTLS_CT_AARCH64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) 275  asm volatile

(

"eor %x[s1], %x[y], %x[x] \n\t" 276  "sub %x[x], %x[x], %x[y] \n\t" 277  "bic %x[x], %x[x], %x[s1] \n\t" 278  "and %x[s1], %x[s1], %x[y] \n\t" 279  "orr %x[s1], %x[x], %x[s1] \n\t" 280  "asr %x[x], %x[s1], 63" 289 #elif defined(MBEDTLS_CT_ARM_ASM) && defined(MBEDTLS_CT_SIZE_32) 292  ".syntax unified \n\t" 293 #if defined(__thumb__) && !defined(__thumb2__) 294  "movs %[s1], %[x] \n\t" 295  "eors %[s1], %[s1], %[y] \n\t" 297  "eors %[s1], %[x], %[y] \n\t" 299  "subs %[x], %[x], %[y] \n\t" 300  "bics %[x], %[x], %[s1] \n\t" 301  "ands %[y], %[s1], %[y] \n\t" 302  "orrs %[x], %[x], %[y] \n\t" 303  "asrs %[x], %[x], #31 \n\t" 314 #elif defined(MBEDTLS_CT_X86_64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) 316  asm volatile

(

"mov %[x], %[s] \n\t" 317  "xor %[y], %[s] \n\t" 318  "sub %[y], %[x] \n\t" 319  "and %[s], %[y] \n\t" 321  "and %[s], %[x] \n\t" 332 #elif defined(MBEDTLS_CT_X86_ASM) && defined(MBEDTLS_CT_SIZE_32) 334  asm volatile

(

"mov %[x], %[s] \n\t" 335  "xor %[y], %[s] \n\t" 336  "sub %[y], %[x] \n\t" 337  "and %[s], %[y] \n\t" 339  "and %[s], %[x] \n\t" 400  unsigned

low_mask = ((unsigned) co - low) >> 8;

402  unsigned

high_mask = ((unsigned) high - co) >> 8;

404  return

(

unsigned char

) (~(low_mask | high_mask)) & to;

433 #if defined(MBEDTLS_BIGNUM_C) 448  return

(

size_t

) (condition & if1);

453  return

(

unsigned

) (condition & if1);

462 #if defined(MBEDTLS_BIGNUM_C) 486  return

-((

int

) (condition & (-if1)));

536 #if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4) 538  #pragma GCC diagnostic pop

Multi-precision integer library.

uint32_t mbedtls_mpi_uint

The type of machine digits in a bignum, called _limbs_.

static mbedtls_ct_condition_t mbedtls_ct_uint_ne(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y)

static mbedtls_ct_uint_t mbedtls_ct_compiler_opaque(mbedtls_ct_uint_t x)

Ensure that a value cannot be known at compile time.

static mbedtls_ct_condition_t mbedtls_ct_uint_ge(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y)

static mbedtls_ct_condition_t mbedtls_ct_bool(mbedtls_ct_uint_t x)

#define RESTORE_ASM_SYNTAX

static mbedtls_ct_condition_t mbedtls_ct_bool_or(mbedtls_ct_condition_t x, mbedtls_ct_condition_t y)

static mbedtls_ct_condition_t mbedtls_ct_bool_if(mbedtls_ct_condition_t condition, mbedtls_ct_condition_t if1, mbedtls_ct_condition_t if0)

static size_t mbedtls_ct_size_if(mbedtls_ct_condition_t condition, size_t if1, size_t if0)

#define MBEDTLS_CT_SIZE

Constant-time functions.

static unsigned char mbedtls_ct_uchar_in_range_if(unsigned char low, unsigned char high, unsigned char c, unsigned char t)

static mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t x)

static mbedtls_ct_condition_t mbedtls_ct_uint_lt(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y)

static int mbedtls_ct_error_if(mbedtls_ct_condition_t condition, int if1, int if0)

static mbedtls_ct_condition_t mbedtls_ct_bool_if_else_0(mbedtls_ct_condition_t condition, mbedtls_ct_condition_t if1)

volatile mbedtls_ct_uint_t mbedtls_ct_zero

Constant-time functions.

static mbedtls_ct_condition_t mbedtls_ct_uint_le(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y)

static mbedtls_ct_condition_t mbedtls_ct_bool_and(mbedtls_ct_condition_t x, mbedtls_ct_condition_t y)

static unsigned mbedtls_ct_uint_if(mbedtls_ct_condition_t condition, unsigned if1, unsigned if0)

static mbedtls_ct_condition_t mbedtls_ct_uint_gt(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y)

static int mbedtls_ct_error_if_else_0(mbedtls_ct_condition_t condition, int if1)

static mbedtls_ct_uint_t mbedtls_ct_if(mbedtls_ct_condition_t condition, mbedtls_ct_uint_t if1, mbedtls_ct_uint_t if0)

static mbedtls_ct_condition_t mbedtls_ct_uint_eq(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y)

static mbedtls_ct_condition_t mbedtls_ct_bool_ne(mbedtls_ct_condition_t x, mbedtls_ct_condition_t y)

static size_t mbedtls_ct_size_if_else_0(mbedtls_ct_condition_t condition, size_t if1)

static unsigned mbedtls_ct_uint_if_else_0(mbedtls_ct_condition_t condition, unsigned if1)

size_t mbedtls_ct_condition_t

Constant-time functions.

ptrdiff_t mbedtls_ct_int_t

unsigned int

A callback function used to compare two keys in a database.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4