/openthread-3.4.0/third_party/mbedtls/repo/library/ |
D | des.c | 323 int i; in mbedtls_des_key_set_parity() local 325 for( i = 0; i < MBEDTLS_DES_KEY_SIZE; i++ ) in mbedtls_des_key_set_parity() 326 key[i] = odd_parity_table[key[i] / 2]; in mbedtls_des_key_set_parity() 334 int i; in mbedtls_des_key_check_key_parity() local 336 for( i = 0; i < MBEDTLS_DES_KEY_SIZE; i++ ) in mbedtls_des_key_check_key_parity() 337 if( key[i] != odd_parity_table[key[i] / 2] ) in mbedtls_des_key_check_key_parity() 389 int i; in mbedtls_des_key_check_weak() local 391 for( i = 0; i < WEAK_KEY_COUNT; i++ ) in mbedtls_des_key_check_weak() 392 if( memcmp( weak_key_table[i], key, MBEDTLS_DES_KEY_SIZE) == 0 ) in mbedtls_des_key_check_weak() 401 int i; in mbedtls_des_setkey() local [all …]
|
D | gcm.c | 80 int ret, i, j; in gcm_gen_table() local 113 for( i = 4; i > 0; i >>= 1 ) in gcm_gen_table() 119 ctx->HL[i] = vl; in gcm_gen_table() 120 ctx->HH[i] = vh; in gcm_gen_table() 123 for( i = 2; i <= 8; i *= 2 ) in gcm_gen_table() 125 uint64_t *HiL = ctx->HL + i, *HiH = ctx->HH + i; in gcm_gen_table() 128 for( j = 1; j < i; j++ ) in gcm_gen_table() 195 int i = 0; in gcm_mult() local 218 for( i = 15; i >= 0; i-- ) in gcm_mult() 220 lo = x[i] & 0xf; in gcm_mult() [all …]
|
D | xtea.c | 58 int i; in mbedtls_xtea_setup() local 62 for( i = 0; i < 4; i++ ) in mbedtls_xtea_setup() 64 ctx->k[i] = MBEDTLS_GET_UINT32_BE( key, i << 2 ); in mbedtls_xtea_setup() 74 uint32_t *k, v0, v1, i; in mbedtls_xtea_crypt_ecb() local 85 for( i = 0; i < 32; i++ ) in mbedtls_xtea_crypt_ecb() 96 for( i = 0; i < 32; i++ ) in mbedtls_xtea_crypt_ecb() 118 int i; in mbedtls_xtea_crypt_cbc() local 131 for( i = 0; i < 8; i++ ) in mbedtls_xtea_crypt_cbc() 132 output[i] = (unsigned char)( output[i] ^ iv[i] ); in mbedtls_xtea_crypt_cbc() 145 for( i = 0; i < 8; i++ ) in mbedtls_xtea_crypt_cbc() [all …]
|
D | aria.c | 394 uint8_t i, j; in aria_rot128() local 402 for( i = 0; i < 4; i++ ) in aria_rot128() 409 r[i] = a[i] ^ t; // store in aria_rot128() 428 int i; in mbedtls_aria_setkey_enc() local 454 i = ( keybits - 128 ) >> 6; // index: 0, 1, 2 in mbedtls_aria_setkey_enc() 455 ctx->nr = 12 + 2 * i; // no. rounds: 12, 14, 16 in mbedtls_aria_setkey_enc() 457 aria_fo_xor( w[1], w[0], rc[i], w[1] ); // W1 = FO(W0, CK1) ^ KR in mbedtls_aria_setkey_enc() 458 i = i < 2 ? i + 1 : 0; in mbedtls_aria_setkey_enc() 459 aria_fe_xor( w[2], w[1], rc[i], w[0] ); // W2 = FE(W1, CK2) ^ W0 in mbedtls_aria_setkey_enc() 460 i = i < 2 ? i + 1 : 0; in mbedtls_aria_setkey_enc() [all …]
|
D | camellia.c | 264 for( i = 1; i <= 4; i++ ) \ 265 if( shifts[(INDEX)][(OFFSET)][i -1] ) \ 266 ROTL(TK + i * 4, TK, ( 15 * i ) % 32); \ 268 for( i = 0; i < 20; i++ ) \ 269 if( indexes[(INDEX)][(OFFSET)][i] != -1 ) { \ 270 RK[indexes[(INDEX)][(OFFSET)][i]] = TK[ i ]; \ 321 size_t i; in mbedtls_camellia_setkey_enc() local 344 for( i = 0; i < keybits / 8; ++i ) in mbedtls_camellia_setkey_enc() 345 t[i] = key[i]; in mbedtls_camellia_setkey_enc() 348 for( i = 0; i < 8; i++ ) in mbedtls_camellia_setkey_enc() [all …]
|
D | chacha20.c | 137 size_t i; in chacha20_block() local 143 for( i = 0U; i < 10U; i++ ) in chacha20_block() 163 for( i = 0U; i < 16; i++ ) in chacha20_block() 165 size_t offset = i * 4U; in chacha20_block() 167 MBEDTLS_PUT_UINT32_LE(working_state[i], keystream, offset); in chacha20_block() 246 size_t i; in mbedtls_chacha20_update() local 270 for( i = 0U; i < 64U; i += 8U ) in mbedtls_chacha20_update() 272 output[offset + i ] = input[offset + i ] ^ ctx->keystream8[i ]; in mbedtls_chacha20_update() 273 output[offset + i+1] = input[offset + i+1] ^ ctx->keystream8[i+1]; in mbedtls_chacha20_update() 274 output[offset + i+2] = input[offset + i+2] ^ ctx->keystream8[i+2]; in mbedtls_chacha20_update() [all …]
|
D | arc4.c | 64 int i, j, a; in mbedtls_arc4_setup() local 72 for( i = 0; i < 256; i++ ) in mbedtls_arc4_setup() 73 m[i] = (unsigned char) i; in mbedtls_arc4_setup() 77 for( i = 0; i < 256; i++, k++ ) in mbedtls_arc4_setup() 81 a = m[i]; in mbedtls_arc4_setup() 83 m[i] = m[j]; in mbedtls_arc4_setup() 95 size_t i; in mbedtls_arc4_crypt() local 102 for( i = 0; i < length; i++ ) in mbedtls_arc4_crypt() 110 output[i] = (unsigned char) in mbedtls_arc4_crypt() 111 ( input[i] ^ m[(unsigned char)( a + b )] ); in mbedtls_arc4_crypt() [all …]
|
D | md2.c | 119 int i, j; in mbedtls_internal_md2_process() local 122 for( i = 0; i < 16; i++ ) in mbedtls_internal_md2_process() 124 ctx->state[i + 16] = ctx->buffer[i]; in mbedtls_internal_md2_process() 125 ctx->state[i + 32] = in mbedtls_internal_md2_process() 126 (unsigned char)( ctx->buffer[i] ^ ctx->state[i]); in mbedtls_internal_md2_process() 129 for( i = 0; i < 18; i++ ) in mbedtls_internal_md2_process() 138 t = (unsigned char)( t + i ); in mbedtls_internal_md2_process() 143 for( i = 0; i < 16; i++ ) in mbedtls_internal_md2_process() 145 ctx->cksum[i] = (unsigned char) in mbedtls_internal_md2_process() 146 ( ctx->cksum[i] ^ PI_SUBST[ctx->buffer[i] ^ t] ); in mbedtls_internal_md2_process() [all …]
|
D | blowfish.c | 76 short i; in blowfish_enc() local 81 for( i = 0; i < MBEDTLS_BLOWFISH_ROUNDS; ++i ) in blowfish_enc() 83 Xl = Xl ^ ctx->P[i]; in blowfish_enc() 105 short i; in blowfish_dec() local 110 for( i = MBEDTLS_BLOWFISH_ROUNDS + 1; i > 1; --i ) in blowfish_dec() 112 Xl = Xl ^ ctx->P[i]; in blowfish_dec() 152 unsigned int i, j, k; in mbedtls_blowfish_setkey() local 166 for( i = 0; i < 4; i++ ) in mbedtls_blowfish_setkey() 169 ctx->S[i][j] = S[i][j]; in mbedtls_blowfish_setkey() 173 for( i = 0; i < MBEDTLS_BLOWFISH_ROUNDS + 2; ++i ) in mbedtls_blowfish_setkey() [all …]
|
D | ccm.c | 121 for( i = 0; i < 16; i++ ) \ 122 y[i] ^= b[i]; \ 141 for( i = 0; i < (len); i++ ) \ 142 (dst)[i] = (src)[i] ^ b[i]; \ 155 unsigned char i; in ccm_auth_crypt() local 202 for( i = 0, len_left = length; i < q; i++, len_left >>= 8 ) in ccm_auth_crypt() 203 b[15-i] = MBEDTLS_BYTE_0( len_left ); in ccm_auth_crypt() 299 for( i = 0; i < q; i++ ) in ccm_auth_crypt() 300 if( ++ctr[15-i] != 0 ) in ccm_auth_crypt() 307 for( i = 0; i < q; i++ ) in ccm_auth_crypt() [all …]
|
D | constant_time.c | 53 size_t i; in mbedtls_ct_memcmp() local 58 for( i = 0; i < n; i++ ) in mbedtls_ct_memcmp() 63 unsigned char x = A[i], y = B[i]; in mbedtls_ct_memcmp() 306 size_t i; in mbedtls_ct_mpi_uint_cond_assign() local 322 for( i = 0; i < n; i++ ) in mbedtls_ct_mpi_uint_cond_assign() 323 dest[i] = ( src[i] & mask ) | ( dest[i] & ~mask ); in mbedtls_ct_mpi_uint_cond_assign() 386 size_t i, n; in mbedtls_ct_mem_move_to_left() local 389 for( i = 0; i < total; i++ ) in mbedtls_ct_mem_move_to_left() 391 unsigned no_op = mbedtls_ct_size_gt( total - offset, i ); in mbedtls_ct_mem_move_to_left() 420 for( size_t i = 0; i < len; i++ ) in mbedtls_ct_memcpy_if_eq() local [all …]
|
D | base64.c | 47 size_t i, n; in mbedtls_base64_encode() local 75 for( i = 0, p = dst; i < n; i += 3 ) in mbedtls_base64_encode() 89 if( i < slen ) in mbedtls_base64_encode() 92 C2 = ( ( i + 1 ) < slen ) ? *src++ : 0; in mbedtls_base64_encode() 98 if( ( i + 1 ) < slen ) in mbedtls_base64_encode() 117 size_t i; /* index in source */ in mbedtls_base64_decode() local 126 for( i = n = 0; i < slen; i++ ) in mbedtls_base64_decode() 130 while( i < slen && src[i] == ' ' ) in mbedtls_base64_decode() 132 ++i; in mbedtls_base64_decode() 137 if( i == slen ) in mbedtls_base64_decode() [all …]
|
D | bignum.c | 74 #define BITS_TO_LIMBS(i) ( (i) / biL + ( (i) % biL != 0 ) ) argument 75 #define CHARS_TO_LIMBS(i) ( (i) / ciL + ( (i) % ciL != 0 ) ) argument 151 size_t i; in mbedtls_mpi_shrink() local 162 for( i = X->n - 1; i > 0; i-- ) in mbedtls_mpi_shrink() 163 if( X->p[i] != 0 ) in mbedtls_mpi_shrink() 165 i++; in mbedtls_mpi_shrink() 167 if( i < nblimbs ) in mbedtls_mpi_shrink() 168 i = nblimbs; in mbedtls_mpi_shrink() 170 if( ( p = (mbedtls_mpi_uint*)mbedtls_calloc( i, ciL ) ) == NULL ) in mbedtls_mpi_shrink() 175 memcpy( p, X->p, i * ciL ); in mbedtls_mpi_shrink() [all …]
|
D | sha512.c | 60 static void sha512_put_uint64_be( uint64_t n, unsigned char *b, uint8_t i ) in sha512_put_uint64_be() argument 62 MBEDTLS_PUT_UINT64_BE(n, b, i); in sha512_put_uint64_be() 203 int i; in mbedtls_internal_sha512_process() local 233 for( i = 0; i < 8; i++ ) in mbedtls_internal_sha512_process() 234 local.A[i] = ctx->state[i]; in mbedtls_internal_sha512_process() 237 for( i = 0; i < 80; i++ ) in mbedtls_internal_sha512_process() 239 if( i < 16 ) in mbedtls_internal_sha512_process() 241 local.W[i] = MBEDTLS_GET_UINT64_BE( data, i << 3 ); in mbedtls_internal_sha512_process() 245 local.W[i] = S1(local.W[i - 2]) + local.W[i - 7] + in mbedtls_internal_sha512_process() 246 S0(local.W[i - 15]) + local.W[i - 16]; in mbedtls_internal_sha512_process() [all …]
|
D | sha256.c | 182 unsigned int i; in mbedtls_internal_sha256_process() local 187 for( i = 0; i < 8; i++ ) in mbedtls_internal_sha256_process() 188 local.A[i] = ctx->state[i]; in mbedtls_internal_sha256_process() 191 for( i = 0; i < 64; i++ ) in mbedtls_internal_sha256_process() 193 if( i < 16 ) in mbedtls_internal_sha256_process() 194 local.W[i] = MBEDTLS_GET_UINT32_BE( data, 4 * i ); in mbedtls_internal_sha256_process() 196 R( i ); in mbedtls_internal_sha256_process() 199 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); in mbedtls_internal_sha256_process() 208 for( i = 0; i < 16; i++ ) in mbedtls_internal_sha256_process() 209 local.W[i] = MBEDTLS_GET_UINT32_BE( data, 4 * i ); in mbedtls_internal_sha256_process() [all …]
|
D | psa_crypto_se.c | 78 size_t i; in psa_get_se_driver_entry() local 86 for( i = 0; i < PSA_MAX_SE_DRIVERS; i++ ) in psa_get_se_driver_entry() 88 if( driver_table[i].location == location ) in psa_get_se_driver_entry() 89 return( &driver_table[i] ); in psa_get_se_driver_entry() 275 size_t i; in psa_init_all_se_drivers() local 276 for( i = 0; i < PSA_MAX_SE_DRIVERS; i++ ) in psa_init_all_se_drivers() 278 psa_se_drv_table_entry_t *driver = &driver_table[i]; in psa_init_all_se_drivers() 308 size_t i; in psa_register_se_driver() local 324 for( i = 0; i < PSA_MAX_SE_DRIVERS; i++ ) in psa_register_se_driver() 326 if( driver_table[i].location == 0 ) in psa_register_se_driver() [all …]
|
D | nist_kw.c | 130 size_t i = 0; in calc_a_xor_t() local 131 for( i = 0; i < sizeof( t ); i++ ) in calc_a_xor_t() 133 A[i] ^= ( t >> ( ( sizeof( t ) - 1 - i ) * 8 ) ) & 0xff; in calc_a_xor_t() 351 size_t i, olen; in mbedtls_nist_kw_unwrap() local 453 for( diff = 0, i = 0; i < KW_SEMIBLOCK_LENGTH; i++ ) in mbedtls_nist_kw_unwrap() 455 if( i >= KW_SEMIBLOCK_LENGTH - padlen ) in mbedtls_nist_kw_unwrap() 456 diff |= output[*out_len - KW_SEMIBLOCK_LENGTH + i]; in mbedtls_nist_kw_unwrap() 458 bad_padding |= output[*out_len - KW_SEMIBLOCK_LENGTH + i]; in mbedtls_nist_kw_unwrap() 590 int i; in mbedtls_nist_kw_self_test() local 594 for( i = 0; i < KW_TESTS; i++ ) in mbedtls_nist_kw_self_test() [all …]
|
D | havege.c | 77 i = 0; \ 78 A = &WALK[PT1 ]; RES[i++] ^= *A; \ 79 B = &WALK[PT2 ]; RES[i++] ^= *B; \ 80 C = &WALK[PT1 ^ 1]; RES[i++] ^= *C; \ 81 D = &WALK[PT2 ^ 4]; RES[i++] ^= *D; \ 89 A = &WALK[PT1 ^ 2]; RES[i++] ^= *A; \ 90 B = &WALK[PT2 ^ 2]; RES[i++] ^= *B; \ 91 C = &WALK[PT1 ^ 3]; RES[i++] ^= *C; \ 92 D = &WALK[PT2 ^ 6]; RES[i++] ^= *D; \ 107 PT2 = (RES[(i - 8) ^ PTY] ^ WALK[PT2 ^ PTY ^ 7]); \ [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/tests/src/ |
D | psa_crypto_helpers.c | 41 size_t i; in mbedtls_test_uses_key_id() local 48 for( i = 0; i < num_key_ids_used ; i++ ) in mbedtls_test_uses_key_id() 50 if( mbedtls_svc_key_id_equal( key_id, key_ids_used_in_test[i] ) ) in mbedtls_test_uses_key_id() 62 size_t i; in mbedtls_test_psa_purge_key_storage() local 63 for( i = 0; i < num_key_ids_used; i++ ) in mbedtls_test_psa_purge_key_storage() 64 psa_destroy_persistent_key( key_ids_used_in_test[i] ); in mbedtls_test_psa_purge_key_storage() 70 size_t i; in mbedtls_test_psa_purge_key_cache() local 71 for( i = 0; i < num_key_ids_used; i++ ) in mbedtls_test_psa_purge_key_cache() 72 psa_purge_key( key_ids_used_in_test[i] ); in mbedtls_test_psa_purge_key_cache()
|
/openthread-3.4.0/third_party/mbedtls/repo/programs/hash/ |
D | generic_sum.c | 69 int i; in generic_print() local 75 for( i = 0; i < mbedtls_md_get_size( md_info ); i++ ) in generic_print() 76 mbedtls_printf( "%02x", sum[i] ); in generic_print() 84 int i; in generic_check() local 140 for( i = 0; i < mbedtls_md_get_size( md_info ); i++ ) in generic_check() 141 sprintf( buf + i * 2, "%02x", sum[i] ); in generic_check() 145 for( i = 0; i < 2 * mbedtls_md_get_size( md_info ); i++ ) in generic_check() 146 diff |= line[i] ^ buf[i]; in generic_check() 176 int ret = 1, i; in main() local 229 for( i = 2; i < argc; i++ ) in main() [all …]
|
/openthread-3.4.0/src/core/common/ |
D | log.cpp | 178 for (uint8_t i = 0; i < kDumpBytesPerLine; i++) in DumpLine() local 180 if (i < aDataLength) in DumpLine() 182 string.Append(" %02X", aData[i]); in DumpLine() 189 if (!((i + 1) % 8)) in DumpLine() 197 for (uint8_t i = 0; i < kDumpBytesPerLine; i++) in DumpLine() local 201 if (i < aDataLength) in DumpLine() 203 char byteAsChar = static_cast<char>(0x7f & aData[i]); in DumpLine() 231 for (uint16_t i = 0; i < static_cast<uint16_t>((kWidth - txtLen) / 2); i++) in DumpInModule() local 238 for (uint16_t i = 0; i < static_cast<uint16_t>(kWidth - txtLen - (kWidth - txtLen) / 2); i++) in DumpInModule() local 245 for (uint16_t i = 0; i < aDataLength; i += kDumpBytesPerLine) in DumpInModule() local [all …]
|
/openthread-3.4.0/src/posix/platform/ |
D | backtrace.cpp | 124 for (int i = 0; i < depth; i++) in dumpStack() local 126 demangleSymbol(i, symbols[i]); in dumpStack() 141 for (uint8_t i = 0; i < kNumSignals; i++) in resetSignalActions() local 143 sigaction(kSignals[i], &sSigActions[i], (struct sigaction *)nullptr); in resetSignalActions() 170 for (uint8_t i = 0; i < kNumSignals; i++) in platformBacktraceInit() local 172 sigaction(kSignals[i], &sigact, &sSigActions[i]); in platformBacktraceInit()
|
/openthread-3.4.0/src/core/crypto/ |
D | aes_ccm.cpp | 71 uint8_t i; in Init() local 117 for (i = sizeof(mBlock) - 1; i > aNonceLength; i--) in Init() 119 mBlock[i] = len & 0xff; in Init() 168 for (unsigned i = 0; i < aHeaderLength; i++) in Header() local 176 mBlock[mBlockLength++] ^= headerBytes[i]; in Header() 201 for (unsigned i = 0; i < aLength; i++) in Payload() local 219 byte = plaintextBytes[i]; in Payload() 220 ciphertextBytes[i] = byte ^ mCtrPad[mCtrLength++]; in Payload() 224 byte = ciphertextBytes[i] ^ mCtrPad[mCtrLength++]; in Payload() 225 plaintextBytes[i] = byte; in Payload() [all …]
|
/openthread-3.4.0/examples/platforms/utils/ |
D | soft_source_match_table.c | 66 for (int16_t i = 0; i < RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM; i++) in utilsSoftSrcMatchShortFindEntry() local 68 if (checksum == srcMatchShortEntry[i].checksum && srcMatchShortEntry[i].allocated) in utilsSoftSrcMatchShortFindEntry() 70 entry = i; in utilsSoftSrcMatchShortFindEntry() 82 for (int16_t i = 0; i < RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM; i++) in findSrcMatchShortAvailEntry() local 84 if (!srcMatchShortEntry[i].allocated) in findSrcMatchShortAvailEntry() 86 entry = i; in findSrcMatchShortAvailEntry() 173 for (int16_t i = 0; i < RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM; i++) in utilsSoftSrcMatchExtFindEntry() local 175 if (checksum == srcMatchExtEntry[i].checksum && srcMatchExtEntry[i].allocated) in utilsSoftSrcMatchExtFindEntry() 177 entry = i; in utilsSoftSrcMatchExtFindEntry() 189 for (int16_t i = 0; i < RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM; i++) in findSrcMatchExtAvailEntry() local [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/programs/ |
D | wince_main.c | 29 int i; in _tmain() local 33 for ( i = 0; i < argc; i++ ) { in _tmain() 35 len = _tcslen( targv[i] ) + 1; in _tmain() 36 argv[i] = ( char * ) calloc( len, sizeof( char ) ); in _tmain() 37 wcstombs( argv[i], targv[i], len ); in _tmain()
|