Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 126) sorted by relevance

123456

/openthread-3.5.0/third_party/mbedtls/repo/programs/psa/
Dpsa_constant_names_generated.c92 static int psa_snprint_key_type(char *buffer, size_t buffer_size, in psa_snprint_key_type() argument
97 …case PSA_KEY_TYPE_AES: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_AES", 16); break; in psa_snprint_key_type()
98 …case PSA_KEY_TYPE_ARC4: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_ARC4", 17); bre… in psa_snprint_key_type()
99 …case PSA_KEY_TYPE_ARIA: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_ARIA", 17); bre… in psa_snprint_key_type()
100 …case PSA_KEY_TYPE_CAMELLIA: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_CAMELLIA", … in psa_snprint_key_type()
101 …case PSA_KEY_TYPE_CATEGORY_FLAG_PAIR: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_C… in psa_snprint_key_type()
102 …case PSA_KEY_TYPE_CATEGORY_KEY_PAIR: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_CA… in psa_snprint_key_type()
103 …case PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_… in psa_snprint_key_type()
104 …case PSA_KEY_TYPE_CATEGORY_RAW: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_CATEGOR… in psa_snprint_key_type()
105 …case PSA_KEY_TYPE_CATEGORY_SYMMETRIC: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_C… in psa_snprint_key_type()
[all …]
Dpsa_constant_names.c61 static void append(char **buffer, size_t buffer_size, in append() argument
67 memcpy(*buffer, string, length); in append()
68 *buffer += length; in append()
72 static void append_integer(char **buffer, size_t buffer_size, in append_integer() argument
77 size_t n = snprintf(*buffer, buffer_size - *required_size, format, value); in append_integer()
78 if (n < buffer_size - *required_size) *buffer += n; in append_integer()
87 static void append_with_curve(char **buffer, size_t buffer_size, in append_with_curve() argument
93 append(buffer, buffer_size, required_size, string, length); in append_with_curve()
94 append(buffer, buffer_size, required_size, "(", 1); in append_with_curve()
96 append(buffer, buffer_size, required_size, in append_with_curve()
[all …]
Dkey_ladder_demo.c373 unsigned char *buffer = NULL; in wrap_data() local
404 SYS_CHECK( ( buffer = calloc( 1, buffer_size ) ) != NULL ); in wrap_data()
405 SYS_CHECK( fread( buffer, 1, input_size, input_file ) == input_size ); in wrap_data()
419 buffer, input_size, in wrap_data()
420 buffer, buffer_size, in wrap_data()
427 SYS_CHECK( fwrite( buffer, 1, ciphertext_size, in wrap_data()
437 if( buffer != NULL ) in wrap_data()
438 mbedtls_platform_zeroize( buffer, buffer_size ); in wrap_data()
439 free( buffer ); in wrap_data()
452 unsigned char *buffer = NULL; in unwrap_data() local
[all …]
/openthread-3.5.0/tests/unit/
Dtest_frame_builder.cpp49 uint8_t buffer[kMaxBufferSize]; in TestFrameBuilder() local
64 memset(buffer, 0, sizeof(buffer)); in TestFrameBuilder()
67 frameBuilder.Init(buffer, sizeof(buffer)); in TestFrameBuilder()
69 VerifyOrQuit(frameBuilder.GetBytes() == buffer); in TestFrameBuilder()
71 VerifyOrQuit(frameBuilder.GetMaxLength() == sizeof(buffer)); in TestFrameBuilder()
72 VerifyOrQuit(memcmp(buffer, zeroBuffer, sizeof(buffer)) == 0); in TestFrameBuilder()
73 VerifyOrQuit(frameBuilder.CanAppend(sizeof(buffer))); in TestFrameBuilder()
74 VerifyOrQuit(!frameBuilder.CanAppend(sizeof(buffer) + 1)); in TestFrameBuilder()
77 VerifyOrQuit(frameBuilder.GetBytes() == buffer); in TestFrameBuilder()
80 VerifyOrQuit(memcmp(buffer, zeroBuffer, sizeof(buffer)) == 0); in TestFrameBuilder()
[all …]
Dtest_data.cpp47 uint8_t buffer[sizeof(kData) + 1]; in TestData() local
65 memset(buffer, 0, sizeof(buffer)); in TestData()
66 data.CopyBytesTo(buffer); in TestData()
67 VerifyOrQuit(memcmp(buffer, kData, sizeof(kData)) == 0); in TestData()
68 VerifyOrQuit(buffer[sizeof(kData)] == 0); in TestData()
69 VerifyOrQuit(data.MatchesBytesIn(buffer)); in TestData()
103 memset(buffer, 0xaa, sizeof(buffer)); in TestData()
104 data.CopyBytesTo(buffer); in TestData()
105 VerifyOrQuit(buffer[0] == 0xaa); in TestData()
130 uint8_t buffer[kMaxSize]; in TestMutableData() local
[all …]
Dtest_network_name.cpp55 char buffer[sizeof(kTooLongName) + 2]; in TestNetworkName() local
91 memset(buffer, 'a', sizeof(buffer)); in TestNetworkName()
92 len = networkName.GetAsData().CopyTo(buffer, 1); in TestNetworkName()
94 VerifyOrQuit(buffer[0] == kName1[0], "NameData::CopyTo() failed"); in TestNetworkName()
95 VerifyOrQuit(buffer[1] == 'a', "NameData::CopyTo() failed"); in TestNetworkName()
97 memset(buffer, 'a', sizeof(buffer)); in TestNetworkName()
98 len = networkName.GetAsData().CopyTo(buffer, sizeof(kName1) - 1); in TestNetworkName()
100 VerifyOrQuit(memcmp(buffer, kName1, sizeof(kName1) - 1) == 0, "NameData::CopyTo() failed"); in TestNetworkName()
101 VerifyOrQuit(buffer[sizeof(kName1)] == 'a', "NameData::CopyTo() failed"); in TestNetworkName()
103 memset(buffer, 'a', sizeof(buffer)); in TestNetworkName()
[all …]
Dtest_tlv.cpp50 uint8_t buffer[4]; in TestTlv() local
61 VerifyOrQuit(Tlv::ReadTlvValue(*message, 0, buffer, 1) == kErrorParse); in TestTlv()
74 SuccessOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 0)); in TestTlv()
75 VerifyOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 1) == kErrorParse); in TestTlv()
88 SuccessOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 0)); in TestTlv()
89 VerifyOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 1) == kErrorParse); in TestTlv()
103 SuccessOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 1)); in TestTlv()
104 VerifyOrQuit(buffer[0] == 0x0ff); in TestTlv()
105 VerifyOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 2) == kErrorParse); in TestTlv()
120 SuccessOrQuit(Tlv::ReadTlvValue(*message, offset, buffer, 1)); in TestTlv()
[all …]
Dtest_cmd_line_parser.cpp252 uint8_t buffer[sizeof(kEvenParsedArray)]; in TestParsingHexStrings() local
260 buffer[0] = 0xff; in TestParsingHexStrings()
261 SuccessOrQuit(ParseAsHexString("0", buffer, 1)); in TestParsingHexStrings()
262 VerifyOrQuit(buffer[0] == 0, "ParseAsHexString() parsed incorrectly"); in TestParsingHexStrings()
264 buffer[0] = 0; in TestParsingHexStrings()
265 SuccessOrQuit(ParseAsHexString("7e", buffer, 1)); in TestParsingHexStrings()
266 VerifyOrQuit(buffer[0] == 0x7e, "ParseAsHexString() parsed incorrectly"); in TestParsingHexStrings()
268 …VerifyOrQuit(ParseAsHexString("123", buffer, 1) != OT_ERROR_NONE, "ParseAsHexString() passed with … in TestParsingHexStrings()
269 SuccessOrQuit(ParseAsHexString("123", buffer, 2)); in TestParsingHexStrings()
270 VerifyOrQuit(buffer[0] == 1 && buffer[1] == 0x23, "ParseAsHexString() parsed incorrectly"); in TestParsingHexStrings()
[all …]
Dtest_message.cpp321 uint8_t buffer[kMaxBufferSize]; in TestAppender() local
323 Appender bufAppender(buffer, sizeof(buffer)); in TestAppender()
334 memset(buffer, 0, sizeof(buffer)); in TestAppender()
339 VerifyOrQuit(bufAppender.GetBufferStart() == buffer); in TestAppender()
343 DumpBuffer("Data1", buffer, sizeof(buffer)); in TestAppender()
345 VerifyOrQuit(bufAppender.GetBufferStart() == buffer); in TestAppender()
346 VerifyOrQuit(memcmp(buffer, kData1, sizeof(kData1)) == 0); in TestAppender()
347 VerifyOrQuit(memcmp(buffer + sizeof(kData1), zeroBuffer, sizeof(buffer) - sizeof(kData1)) == 0); in TestAppender()
350 DumpBuffer("Data1+Data2", buffer, sizeof(buffer)); in TestAppender()
352 VerifyOrQuit(bufAppender.GetBufferStart() == buffer); in TestAppender()
[all …]
Dtest_toolchain.cpp127 uint8_t buffer[sizeof(PackedStruct) * 2 + 1]; in test_packed_alignment() local
137 uint8_t *ptr = &buffer[start]; in test_packed_alignment()
139 memset(buffer, 0, sizeof(buffer)); in test_packed_alignment()
145 VerifyOrQuit(buffer[i] == 0, "OT_TOOL_PACKED alignment failed - pre-size write"); in test_packed_alignment()
150 for (size_t i = start + sizeof(packedStruct); i < sizeof(buffer); i++) in test_packed_alignment()
152 VerifyOrQuit(buffer[i] == 0, "OT_TOOL_PACKED alignment failed - post-size write"); in test_packed_alignment()
Dtest_spinel_decoder.cpp45 uint8_t buffer[kTestBufferSize]; in TestDecoder() local
102 memset(buffer, 0, sizeof(buffer)); in TestDecoder()
108 buffer, sizeof(buffer), in TestDecoder()
119 DumpBuffer("Packed Spinel Frame", buffer, static_cast<uint16_t>(frameLen)); in TestDecoder()
121 decoder.Init(buffer, static_cast<uint16_t>(frameLen)); in TestDecoder()
123 VerifyOrQuit(decoder.GetFrame() == &buffer[0]); in TestDecoder()
197 VerifyOrQuit(decoder.GetFrame() == &buffer[0]); in TestDecoder()
289 decoder.Init(buffer, static_cast<uint16_t>(frameLen)); in TestDecoder()
297 frameLen = spinel_datatype_pack(buffer, sizeof(buffer), in TestDecoder()
305 DumpBuffer("Packed Spinel Frame (single struct)", buffer, static_cast<uint16_t>(frameLen)); in TestDecoder()
[all …]
/openthread-3.5.0/third_party/tcplp/lib/
Dlbuf.c36 void lbuf_init(struct lbufhead* buffer) { in lbuf_init() argument
37 memset(buffer, 0x00, sizeof(struct lbufhead)); in lbuf_init()
40 void lbuf_append(struct lbufhead* buffer, otLinkedBuffer* newentry) { in lbuf_append() argument
41 otLinkedBuffer* tail = buffer->tail; in lbuf_append()
43 buffer->head = newentry; in lbuf_append()
44 buffer->tail = newentry; in lbuf_append()
45 buffer->offset = 0; in lbuf_append()
46 buffer->length = newentry->mLength; in lbuf_append()
50 buffer->tail = newentry; in lbuf_append()
51 buffer->length += newentry->mLength; in lbuf_append()
[all …]
Dlbuf.h48 void lbuf_init(struct lbufhead* buffer);
52 static inline struct otLinkedBuffer* lbuf_head(struct lbufhead* buffer) { in lbuf_head() argument
53 return buffer->head; in lbuf_head()
58 void lbuf_append(struct lbufhead* buffer, struct otLinkedBuffer* newentry);
61 void lbuf_extend(struct lbufhead* buffer, size_t numbytes);
68 size_t lbuf_pop(struct lbufhead* buffer, size_t numbytes, uint32_t* ntraversed);
81 int lbuf_getrange(struct lbufhead* buffer, size_t offset, size_t numbytes,
86 size_t lbuf_used_space(const struct lbufhead* buffer);
/openthread-3.5.0/third_party/mbedtls/repo/tests/suites/
Dtest_suite_debug.function13 struct buffer_data *buffer = (struct buffer_data *) data;
14 char *p = buffer->ptr;
41 buffer->ptr = p;
56 struct buffer_data buffer;
60 memset( buffer.buf, 0, 2000 );
61 buffer.ptr = buffer.buf;
66 mbedtls_ssl_conf_dbg( &conf, string_debug, &buffer);
71 TEST_ASSERT( strcmp( buffer.buf, result_str ) == 0 );
85 struct buffer_data buffer;
89 memset( buffer.buf, 0, 2000 );
[all …]
Dtest_suite_memory_buffer_alloc.data1 Memory buffer alloc self test
4 Memory buffer alloc - free in middle, alloc at end
7 Memory buffer alloc - free in middle, realloc
10 Memory buffer alloc - free in middle, merge, realloc
13 Memory buffer alloc - free at end, merge, realloc
16 Memory buffer alloc - Out of Memory test
19 Memory buffer: heap too small (header verification should fail)
22 Memory buffer: attempt to allocate SIZE_MAX
Dtest_suite_psa_its.function87 unsigned char *buffer = NULL;
90 ASSERT_ALLOC( buffer, data->len );
97 PSA_ASSERT( psa_its_get( uid, 0, data->len, buffer, &ret_len ) );
98 ASSERT_COMPARE( data->x, data->len, buffer, ret_len );
103 mbedtls_free( buffer );
117 unsigned char *buffer = NULL;
120 ASSERT_ALLOC( buffer, MAX( data1->len, data2->len ) );
126 PSA_ASSERT( psa_its_get( uid, 0, data1->len, buffer, &ret_len ) );
127 ASSERT_COMPARE( data1->x, data1->len, buffer, ret_len );
134 PSA_ASSERT( psa_its_get( uid, 0, data2->len, buffer, &ret_len ) );
[all …]
Dtest_suite_base64.data31 Test case mbedtls_base64_encode #1 buffer just right
34 Test case mbedtls_base64_encode #2 buffer just right
37 Test case mbedtls_base64_encode #2 buffer too small
40 Test case mbedtls_base64_encode #3 buffer just right
43 Test case mbedtls_base64_encode #3 buffer too small
46 Test case mbedtls_base64_encode #4 buffer just right
49 Test case mbedtls_base64_encode #4 buffer too small
52 Test case mbedtls_base64_encode #5 buffer just right
55 Test case mbedtls_base64_encode #5 buffer too small
58 Test case mbedtls_base64_encode #6 buffer just right
[all …]
/openthread-3.5.0/third_party/tcplp/lib/test/
Dtest_all.c48 uint8_t buffer[test_bmp_size]; in test_bmp() local
50 bmp_init(buffer, test_bmp_size); in test_bmp()
51 bmp_test("bmp_init", buffer, test_bmp_size, "0000000000000000"); in test_bmp()
53 bmp_setrange(buffer, 11, 7); in test_bmp()
54 bmp_test("bmp_setrange 1", buffer, test_bmp_size, "001FC00000000000"); in test_bmp()
56 bmp_setrange(buffer, 35, 3); in test_bmp()
57 bmp_test("bmp_setrange 2", buffer, test_bmp_size, "001FC0001C000000"); in test_bmp()
59 bmp_setrange(buffer, 47, 4); in test_bmp()
60 bmp_test("bmp_setrange 3", buffer, test_bmp_size, "001FC0001C01E000"); in test_bmp()
62 bmp_swap(buffer, 3, 36, 1); in test_bmp()
[all …]
/openthread-3.5.0/src/posix/
Dclient.cpp285 char buffer[kLineBufferSize]; in main() local
290 for (const char *c = argv[i]; *c && count < sizeof(buffer);) in main()
294 buffer[count++] = '\\'; in main()
296 VerifyOrExit(count < sizeof(buffer), ret = OT_EXIT_INVALID_ARGUMENTS); in main()
299 buffer[count++] = *c++; in main()
302 VerifyOrExit(count < sizeof(buffer), ret = OT_EXIT_INVALID_ARGUMENTS); in main()
303 buffer[count++] = ' '; in main()
309 VerifyOrExit(DoWrite(sSessionFd, buffer, count), ret = OT_EXIT_FAILURE); in main()
327 char buffer[kLineBufferSize]; in main() local
358 VerifyOrExit(fgets(buffer, sizeof(buffer), stdin) != nullptr, ret = OT_EXIT_FAILURE); in main()
[all …]
Dcli_stdio.cpp85 char buffer[OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH]; in otAppCliProcess() local
87 if (fgets(buffer, sizeof(buffer), stdin) != nullptr) in otAppCliProcess()
89 otCliInputLine(buffer); in otAppCliProcess()
/openthread-3.5.0/third_party/jlink/SEGGER_RTT_V640/Syscalls/
DSEGGER_RTT_Syscalls_IAR.c83 size_t __write(int handle, const unsigned char * buffer, size_t size);
101 size_t __write(int handle, const unsigned char * buffer, size_t size) { in __write() argument
103 SEGGER_RTT_Write(0, (const char*)buffer, size); in __write()
117 size_t __write_buffered(int handle, const unsigned char * buffer, size_t size) { in __write_buffered() argument
119 SEGGER_RTT_Write(0, (const char*)buffer, size); in __write_buffered()
/openthread-3.5.0/src/core/api/
Dtcp_ext_api.cpp113 const otLinkedBuffer *buffer; in otTcpMbedTlsSslRecvCallback() local
117 error = otTcpReceiveByReference(endpoint, &buffer); in otTcpMbedTlsSslRecvCallback()
119 while (bytes_read != aLen && buffer != nullptr) in otTcpMbedTlsSslRecvCallback()
121 size_t to_copy = OT_MIN(aLen - bytes_read, buffer->mLength); in otTcpMbedTlsSslRecvCallback()
122 memcpy(&aBuf[bytes_read], buffer->mData, to_copy); in otTcpMbedTlsSslRecvCallback()
124 buffer = buffer->mNext; in otTcpMbedTlsSslRecvCallback()
/openthread-3.5.0/third_party/mbedtls/repo/library/
Dbase64.c239 unsigned char buffer[128]; in mbedtls_base64_self_test() local
246 if( mbedtls_base64_encode( buffer, sizeof( buffer ), &len, src, 64 ) != 0 || in mbedtls_base64_self_test()
247 memcmp( base64_test_enc, buffer, 88 ) != 0 ) in mbedtls_base64_self_test()
260 if( mbedtls_base64_decode( buffer, sizeof( buffer ), &len, src, 88 ) != 0 || in mbedtls_base64_self_test()
261 memcmp( base64_test_dec, buffer, 64 ) != 0 ) in mbedtls_base64_self_test()
/openthread-3.5.0/tools/ot-fct/
Dmain.cpp86 char buffer[kBufferSize]; in main() local
88 if (fgets(buffer, sizeof(buffer), stdin) != nullptr) in main()
90 sCli.ProcessLine(buffer); in main()
/openthread-3.5.0/third_party/mbedtls/repo/programs/aes/
Dcrypt_and_hash.c97 unsigned char buffer[1024]; in main() local
280 buffer[i] = (unsigned char)( filesize >> ( i << 3 ) ); in main()
289 if( mbedtls_md_update( &md_ctx, buffer, 8 ) != 0 ) in main()
384 if( fread( buffer, 1, ilen, fin ) != ilen ) in main()
390 if( mbedtls_cipher_update( &cipher_ctx, buffer, ilen, output, &olen ) != 0 ) in main()
485 if( fread( buffer, 1, 16, fin ) != 16 ) in main()
491 memcpy( IV, buffer, 16 ); in main()
557 if( fread( buffer, 1, ilen, fin ) != ilen ) in main()
564 if( mbedtls_md_hmac_update( &md_ctx, buffer, ilen ) != 0 ) in main()
569 if( mbedtls_cipher_update( &cipher_ctx, buffer, ilen, output, in main()
[all …]

123456