/openthread-latest/tests/unit/ |
D | test_dns.cpp | 73 uint16_t offset; in TestDnsName() local 369 offset = 0; in TestDnsName() 370 SuccessOrQuit(Dns::Name::ParseName(*message, offset)); in TestDnsName() 371 VerifyOrQuit(offset == len, "Name::ParseName() returned incorrect offset"); in TestDnsName() 374 offset = 0; in TestDnsName() 379 SuccessOrQuit(Dns::Name::ReadLabel(*message, offset, label, labelLength)); in TestDnsName() 388 VerifyOrQuit(Dns::Name::ReadLabel(*message, offset, label, labelLength) == kErrorNotFound, in TestDnsName() 392 offset = 0; in TestDnsName() 393 SuccessOrQuit(Dns::Name::ReadName(*message, offset, name)); in TestDnsName() 398 VerifyOrQuit(offset == len, "Name::ReadName() returned incorrect offset"); in TestDnsName() [all …]
|
D | test_tlv.cpp | 47 uint16_t offset; in TestTlv() local 65 offset = message->GetLength(); in TestTlv() 74 SuccessOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 0)); in TestTlv() 75 VerifyOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 1) == kErrorParse); in TestTlv() 79 offset = message->GetLength(); in TestTlv() 86 VerifyOrQuit(offsetRange.GetOffset() == offset + sizeof(ExtendedTlv)); in TestTlv() 88 SuccessOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 0)); in TestTlv() 89 VerifyOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 1) == kErrorParse); in TestTlv() 93 offset = message->GetLength(); in TestTlv() 101 VerifyOrQuit(offsetRange.GetOffset() == offset + sizeof(Tlv)); in TestTlv() [all …]
|
D | test_message.cpp | 104 for (uint16_t offset = 0; offset < kMaxSize; offset++) in TestMessage() local 106 for (uint16_t length = 0; length <= kMaxSize - offset; length++) in TestMessage() 110 writeBuffer[offset + i]++; in TestMessage() 113 message->WriteBytes(offset, &writeBuffer[offset], length); in TestMessage() 120 SuccessOrQuit(message->Read(offset, readBuffer, length)); in TestMessage() 121 VerifyOrQuit(memcmp(readBuffer, &writeBuffer[offset], length) == 0); in TestMessage() 124 VerifyOrQuit(message->CompareBytes(offset, &writeBuffer[offset], length)); in TestMessage() 134 writeBuffer[offset]++; in TestMessage() 135 VerifyOrQuit(!message->CompareBytes(offset, &writeBuffer[offset], length)); in TestMessage() 136 writeBuffer[offset]--; in TestMessage() [all …]
|
D | test_frame_builder.cpp | 48 uint16_t offset; in TestFrameBuilder() local 116 offset = sizeof(kData1); in TestFrameBuilder() 117 SuccessOrQuit(frameBuilder.AppendBytesFromMessage(*message, offset, sizeof(kData2))); in TestFrameBuilder() 144 offset = sizeof(kData1); in TestFrameBuilder() 145 frameBuilder.Write(offset, kData2); in TestFrameBuilder() 157 offset = 0; in TestFrameBuilder() 158 SuccessOrQuit(frameBuilder.Insert(offset, kData1)); in TestFrameBuilder() 163 offset = 0; in TestFrameBuilder() 164 SuccessOrQuit(frameBuilder.Insert(offset, kData2)); in TestFrameBuilder() 170 offset = sizeof(kData2); in TestFrameBuilder() [all …]
|
/openthread-latest/third_party/mbedtls/repo/library/ |
D | alignment.h | 412 #define MBEDTLS_GET_UINT32_BE(data, offset) \ argument 414 ? mbedtls_get_unaligned_uint32((data) + (offset)) \ 415 : MBEDTLS_BSWAP32(mbedtls_get_unaligned_uint32((data) + (offset))) \ 427 #define MBEDTLS_PUT_UINT32_BE(n, data, offset) \ argument 431 mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n)); \ 435 mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \ 448 #define MBEDTLS_GET_UINT32_LE(data, offset) \ argument 450 ? MBEDTLS_BSWAP32(mbedtls_get_unaligned_uint32((data) + (offset))) \ 451 : mbedtls_get_unaligned_uint32((data) + (offset)) \ 464 #define MBEDTLS_PUT_UINT32_LE(n, data, offset) \ argument [all …]
|
D | chacha20.c | 135 size_t offset = i * 4U; in chacha20_block() local 137 MBEDTLS_PUT_UINT32_LE(working_state[i], keystream, offset); in chacha20_block() 206 size_t offset = 0U; in mbedtls_chacha20_update() local 210 output[offset] = input[offset] in mbedtls_chacha20_update() 214 offset++; in mbedtls_chacha20_update() 224 mbedtls_xor(output + offset, input + offset, ctx->keystream8, 64U); in mbedtls_chacha20_update() 226 offset += CHACHA20_BLOCK_SIZE_BYTES; in mbedtls_chacha20_update() 236 mbedtls_xor(output + offset, input + offset, ctx->keystream8, size); in mbedtls_chacha20_update()
|
D | ccm.c | 124 size_t offset, size_t use_len, in mbedtls_ccm_crypt() argument 143 mbedtls_xor(output, input, tmp_buf + offset, use_len); in mbedtls_ccm_crypt() 294 size_t use_len, offset; in mbedtls_ccm_update_ad() local 322 offset = (ctx->processed + 2) % 16; /* account for y[0] and y[1] in mbedtls_ccm_update_ad() 324 use_len = 16 - offset; in mbedtls_ccm_update_ad() 330 mbedtls_xor(ctx->y + offset, ctx->y + offset, add, use_len); in mbedtls_ccm_update_ad() 336 if (use_len + offset == 16 || ctx->processed == ctx->add_len) { in mbedtls_ccm_update_ad() 365 size_t use_len, offset; in mbedtls_ccm_update() local 391 offset = ctx->processed % 16; in mbedtls_ccm_update() 393 use_len = 16 - offset; in mbedtls_ccm_update() [all …]
|
D | poly1305.c | 73 size_t offset = 0U; in poly1305_process() local 94 d0 = MBEDTLS_GET_UINT32_LE(input, offset + 0); in poly1305_process() 95 d1 = MBEDTLS_GET_UINT32_LE(input, offset + 4); in poly1305_process() 96 d2 = MBEDTLS_GET_UINT32_LE(input, offset + 8); in poly1305_process() 97 d3 = MBEDTLS_GET_UINT32_LE(input, offset + 12); in poly1305_process() 154 offset += POLY1305_BLOCK_SIZE_BYTES; in poly1305_process() 274 size_t offset = 0U; in mbedtls_poly1305_update() local 303 offset += queue_free_len; in mbedtls_poly1305_update() 311 poly1305_process(ctx, nblocks, &input[offset], 1U); in mbedtls_poly1305_update() 313 offset += nblocks * POLY1305_BLOCK_SIZE_BYTES; in mbedtls_poly1305_update() [all …]
|
/openthread-latest/third_party/mbedtls/repo/tests/suites/ |
D | test_suite_alignment.data | 10 Unaligned 16-bit access offset=1 13 Unaligned 32-bit access offset=1 16 Unaligned 64-bit access offset=1 19 Unaligned 16-bit access offset=4 22 Unaligned 32-bit access offset=4 25 Unaligned 64-bit access offset=4 28 Unaligned 16-bit access offset=7 31 Unaligned 32-bit access offset=7 34 Unaligned 64-bit access offset=7 37 Unaligned 16-bit access offset=8 [all …]
|
D | test_suite_constant_time.function | 216 for (size_t offset = 0; offset < size; offset++) { 218 /* Set a single bit to be different at given offset, to test that we 220 a[offset] = 1 << bit_offset; 231 a[offset] = 0; 243 void mbedtls_ct_memcmp(int same, int size, int offset) 246 TEST_CALLOC(a, size + offset); 247 TEST_CALLOC(b, size + offset); 250 * same gives the number of bytes (after the initial offset) 253 for (int i = 0; i < size + offset; i++) { 255 if (same == -1 || (i - offset) < same) { [all …]
|
D | test_suite_test_helpers.data | 1 Memory poison+unpoison: offset=0 len=42 4 Memory poison+unpoison: offset=0 len=1 7 Memory poison+unpoison: offset=0 len=2 10 Memory poison+unpoison: offset=1 len=1 13 Memory poison+unpoison: offset=1 len=2 16 Memory poison+unpoison: offset=7 len=1 19 Memory poison+unpoison: offset=7 len=2 22 Memory poison+unpoison: offset=0 len=0
|
D | test_suite_alignment.function | 31 void mbedtls_unaligned_access(int size, int offset) 47 r = mbedtls_get_unaligned_uint16(x + offset); 50 r = mbedtls_get_unaligned_uint32(x + offset); 53 r = mbedtls_get_unaligned_uint64(x + offset); 62 memcpy(&raw_aligned_64, ((uint8_t *) &raw) + offset, size / 8); 81 x[i + offset] = 0xff; 89 mbedtls_put_unaligned_uint16(x + offset, r); 92 mbedtls_put_unaligned_uint32(x + offset, r); 95 mbedtls_put_unaligned_uint64(x + offset, r); 243 void unaligned_access_endian_aware(int size, int offset, int big_endian) [all …]
|
D | test_suite_constant_time.data | 2 Constant-flow memcpy from offset: small 6 Constant-flow memcpy from offset: medium 10 Constant-flow memcpy from offset: large 55 mbedtls_ct_memcmp len 1 offset 1 different 58 mbedtls_ct_memcmp len 17 offset 1 different 61 mbedtls_ct_memcmp len 17 offset 1 different 1 64 mbedtls_ct_memcmp len 17 offset 1 different 5 67 mbedtls_ct_memcmp len 1 offset 1 70 mbedtls_ct_memcmp len 1 offset 2 73 mbedtls_ct_memcmp len 1 offset 3 [all …]
|
D | test_suite_dhm.function | 27 size_t *offset) 36 TEST_ASSERT(size >= *offset + 2); 37 n = (buffer[*offset] << 8) | buffer[*offset + 1]; 38 *offset += 2; 42 TEST_ASSERT(size >= *offset + n); 43 TEST_EQUAL(0, mbedtls_mpi_read_binary(&actual, buffer + *offset, n)); 45 *offset += n; 59 size_t offset = 0; 70 if (!check_dhm_param_output(&ctx->P, ske, ske_len, &offset)) { 73 if (!check_dhm_param_output(&ctx->G, ske, ske_len, &offset)) { [all …]
|
/openthread-latest/src/core/utils/ |
D | flash.cpp | 98 for (uint32_t offset = mSwapUsed; offset < mSwapSize; offset += sizeof(temp)) in SanitizeFreeSpace() local 100 otPlatFlashRead(&GetInstance(), mSwapIndex, offset, &temp, sizeof(temp)); in SanitizeFreeSpace() 119 uint32_t offset; in Get() local 122 for (offset = kSwapMarkerSize; offset < mSwapUsed; offset += record.GetSize()) in Get() 124 otPlatFlashRead(&GetInstance(), mSwapIndex, offset, &record, sizeof(record)); in Get() 147 … otPlatFlashRead(&GetInstance(), mSwapIndex, offset + sizeof(record), aValue, readLength); in Get() 261 for (uint32_t offset = kSwapMarkerSize; offset < mSwapUsed; offset += record.GetSize()) in Delete() local 263 otPlatFlashRead(&GetInstance(), mSwapIndex, offset, &record, sizeof(record)); in Delete() 278 otPlatFlashWrite(&GetInstance(), mSwapIndex, offset, &record, sizeof(record)); in Delete() 289 otPlatFlashWrite(&GetInstance(), mSwapIndex, offset, &record, sizeof(record)); in Delete()
|
/openthread-latest/src/posix/platform/ |
D | settings_file.cpp | 78 …for (off_t size = lseek(mSettingsFd, 0, SEEK_END), offset = lseek(mSettingsFd, 0, SEEK_SET); offse… in Init() local 90 offset += sizeof(key) + sizeof(length) + length; in Init() 91 VerifyOrExit(offset == lseek(mSettingsFd, length, SEEK_CUR), error = OT_ERROR_PARSE); in Init() 117 off_t offset; in Get() local 122 offset = lseek(mSettingsFd, 0, SEEK_SET); in Get() 123 VerifyOrExit(offset == 0 && size >= 0, error = OT_ERROR_PARSE); in Get() 125 while (offset < size) in Get() 163 offset += sizeof(key) + sizeof(length) + length; in Get() 164 VerifyOrExit(offset == lseek(mSettingsFd, length, SEEK_CUR), error = OT_ERROR_PARSE); in Get() 226 off_t offset; in Delete() local [all …]
|
/openthread-latest/examples/platforms/simulation/ |
D | flash.c | 59 const char *offset = getenv("PORT_OFFSET"); in otPlatFlashInit() local 68 if (offset == NULL) in otPlatFlashInit() 70 offset = "0"; in otPlatFlashInit() 73 snprintf(fileName, sizeof(fileName), "%s/%s_%d.flash", path, offset, gNodeId); in otPlatFlashInit() 146 for (uint32_t offset = 0; offset < aSize; offset++) in otPlatFlashWrite() local 148 rval = pread(sFlashFd, &byte, sizeof(byte), (off_t)(address + offset)); in otPlatFlashWrite() 152 byte &= ((uint8_t *)aData)[offset]; in otPlatFlashWrite() 154 rval = pwrite(sFlashFd, &byte, sizeof(byte), (off_t)(address + offset)); in otPlatFlashWrite()
|
D | logging.c | 105 int offset; in otPlatLog() local 107 offset = snprintf(logString, sizeof(logString), "[%lu]", (unsigned long)gNodeId); in otPlatLog() 109 vsnprintf(&logString[offset], sizeof(logString) - (uint16_t)offset, aFormat, args); in otPlatLog()
|
/openthread-latest/third_party/tcplp/lib/ |
D | lbuf.c | 45 buffer->offset = 0; in lbuf_append() 64 size_t curroffset = buffer->offset; in lbuf_pop() 75 buffer->offset = 0; in lbuf_pop() 83 buffer->offset = curroffset + bytesleft; in lbuf_pop() 88 int lbuf_getrange(struct lbufhead* buffer, size_t offset, size_t numbytes, in lbuf_getrange() argument 92 size_t offsetleft = offset + buffer->offset; in lbuf_getrange() 94 if (buffer->length < offset + numbytes) { in lbuf_getrange()
|
D | cbuf.c | 155 … cbufhead* chdr, void* data, size_t data_offset, size_t numbytes, size_t offset, cbuf_copier_t cop… in cbuf_read_offset() argument 158 if (used_space <= offset) { in cbuf_read_offset() 160 } else if (used_space < offset + numbytes) { in cbuf_read_offset() 161 numbytes = used_space - offset; in cbuf_read_offset() 164 chdr->r_index = (chdr->r_index + offset) % chdr->size; in cbuf_read_offset() 286 size_t cbuf_reass_write(struct cbufhead* chdr, size_t offset, const void* data, size_t data_offset,… in cbuf_reass_write() argument 292 if (offset > free_space) { in cbuf_reass_write() 294 } else if (offset + numbytes > free_space) { in cbuf_reass_write() 295 numbytes = free_space - offset; in cbuf_reass_write() 297 start_index = (cbuf_get_w_index(chdr) + offset) % chdr->size; in cbuf_reass_write() [all …]
|
/openthread-latest/src/core/net/ |
D | dns_client.cpp | 149 uint16_t offset = kNameOffsetInQuery; in GetName() local 151 return Name::ReadName(*mQuery, offset, aNameBuffer, aNameBufferSize); in GetName() 164 uint16_t offset; in CheckForHostNameAlias() local 172 SelectSection(aSection, offset, numRecords); in CheckForHostNameAlias() 173 …error = ResourceRecord::FindRecord(*mMessage, offset, numRecords, /* aIndex */ 0, aHostName, cname… in CheckForHostNameAlias() 187 aHostName.SetFromMessage(*mMessage, offset); in CheckForHostNameAlias() 188 SuccessOrExit(error = Name::ParseName(*mMessage, offset)); in CheckForHostNameAlias() 207 uint16_t offset; in FindHostAddress() local 214 SelectSection(aSection, offset, numRecords); in FindHostAddress() 215 …SuccessOrExit(error = ResourceRecord::FindRecord(*mMessage, offset, numRecords, aIndex, name, aaaa… in FindHostAddress() [all …]
|
/openthread-latest/tests/scripts/thread-cert/ |
D | wpan.py | 128 offset = 4 131 offset += 2 134 dst_short = struct.unpack('<H', frame[offset:offset + 2])[0] 136 dst_extaddr = '%016x' % struct.unpack('<Q', frame[offset:offset + 8])[0]
|
/openthread-latest/third_party/mbedtls/repo/programs/aes/ |
D | crypt_and_hash.c | 83 long filesize, offset; in main() local 86 __int64 filesize, offset; in main() local 88 off_t filesize, offset; in main() local 330 for (offset = 0; offset < filesize; offset += cipher_block_size) { in main() 331 ilen = ((unsigned int) filesize - offset > cipher_block_size) ? in main() 332 cipher_block_size : (unsigned int) (filesize - offset); in main() 484 for (offset = 0; offset < filesize; offset += cipher_block_size) { in main() 485 ilen = ((unsigned int) filesize - offset > cipher_block_size) ? in main() 486 cipher_block_size : (unsigned int) (filesize - offset); in main()
|
/openthread-latest/src/lib/spinel/ |
D | spinel_driver.cpp | 185 uint16_t offset; in SendCommand() local 193 offset = static_cast<uint16_t>(packed); in SendCommand() 195 SuccessOrExit(error = mSpinelInterface->SendFrame(buffer, offset)); in SendCommand() 196 LogSpinelFrame(buffer, offset, true /* aTx */); in SendCommand() 211 uint16_t offset; in SendCommand() local 219 offset = static_cast<uint16_t>(packed); in SendCommand() 224 packed = spinel_datatype_vpack(buffer + offset, sizeof(buffer) - offset, aFormat, aArgs); in SendCommand() 225 …VerifyOrExit(packed > 0 && static_cast<size_t>(packed + offset) <= sizeof(buffer), error = OT_ERRO… in SendCommand() 227 offset += static_cast<uint16_t>(packed); in SendCommand() 230 SuccessOrExit(error = mSpinelInterface->SendFrame(buffer, offset)); in SendCommand() [all …]
|
/openthread-latest/src/core/thread/ |
D | mle_tlvs.hpp | 494 int offset = ((aRouterIndex & 1) ? kOddEntryOffset : 0); in GetLinkQualityIn() local 496 (mRouteData[aRouterIndex + aRouterIndex / 2] & (kLinkQualityInMask >> offset)) >> in GetLinkQualityIn() 497 (kLinkQualityInOffset - offset)); in GetLinkQualityIn() 509 int offset = ((aRouterIndex & 1) ? kOddEntryOffset : 0); in GetLinkQualityOut() local 511 (mRouteData[aRouterIndex + aRouterIndex / 2] & (kLinkQualityOutMask >> offset)) >> in GetLinkQualityOut() 512 (kLinkQualityOutOffset - offset)); in GetLinkQualityOut() 558 int offset = ((aRouterIndex & 1) ? kOddEntryOffset : 0); in SetLinkQualityIn() local 560 (mRouteData[aRouterIndex + aRouterIndex / 2] & ~(kLinkQualityInMask >> offset)) | in SetLinkQualityIn() 561 ((aLinkQuality << (kLinkQualityInOffset - offset)) & (kLinkQualityInMask >> offset)); in SetLinkQualityIn() 566 int offset = ((aRouterIndex & 1) ? kOddEntryOffset : 0); in SetLinkQualityOut() local [all …]
|