edhoc 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +170 -0
- package/binding.gyp +13 -11
- package/dist/bindings.d.ts +5 -0
- package/dist/bindings.d.ts.map +1 -0
- package/dist/bindings.js +10 -0
- package/dist/crypto.d.ts +29 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +205 -0
- package/dist/edhoc.d.ts +368 -0
- package/dist/edhoc.d.ts.map +1 -0
- package/dist/edhoc.js +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/x509credentials.d.ts +20 -0
- package/dist/x509credentials.d.ts.map +1 -0
- package/dist/x509credentials.js +140 -0
- package/external/libedhoc/backends/cbor/include/backend_cbor_bstr_type_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_bstr_type_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_bstr_type_types.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_ead_decode.h +2 -2
- package/external/libedhoc/backends/cbor/include/backend_cbor_ead_encode.h +2 -2
- package/external/libedhoc/backends/cbor/include/backend_cbor_edhoc_types.h +48 -43
- package/external/libedhoc/backends/cbor/include/backend_cbor_enc_structure_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_enc_structure_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_enc_structure_types.h +3 -3
- package/external/libedhoc/backends/cbor/include/backend_cbor_id_cred_x_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_id_cred_x_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_info_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_info_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_int_type_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_int_type_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_int_type_types.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_1_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_1_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_2_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_2_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_3_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_3_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_4_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_4_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_error_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_error_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_2_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_2_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_3_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_3_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_4_decode.h +3 -3
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_4_encode.h +3 -3
- package/external/libedhoc/backends/cbor/include/backend_cbor_sig_structure_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_sig_structure_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_sig_structure_types.h +4 -4
- package/external/libedhoc/backends/cbor/include/backend_cbor_x509_types.h +93 -83
- package/external/libedhoc/backends/cbor/src/backend_cbor_bstr_type_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_bstr_type_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_ead_decode.c +27 -32
- package/external/libedhoc/backends/cbor/src/backend_cbor_ead_encode.c +27 -32
- package/external/libedhoc/backends/cbor/src/backend_cbor_enc_structure_decode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_enc_structure_encode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_id_cred_x_decode.c +63 -52
- package/external/libedhoc/backends/cbor/src/backend_cbor_id_cred_x_encode.c +62 -51
- package/external/libedhoc/backends/cbor/src/backend_cbor_info_decode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_info_encode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_int_type_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_int_type_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_1_decode.c +54 -51
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_1_encode.c +54 -51
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_2_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_2_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_3_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_3_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_4_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_4_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_error_decode.c +36 -37
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_error_encode.c +36 -37
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_2_decode.c +103 -80
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_2_encode.c +102 -79
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_3_decode.c +99 -76
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_3_encode.c +98 -75
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_4_decode.c +40 -41
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_4_encode.c +40 -41
- package/external/libedhoc/backends/cbor/src/backend_cbor_sig_structure_decode.c +15 -24
- package/external/libedhoc/backends/cbor/src/backend_cbor_sig_structure_encode.c +15 -24
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/TestProductionCode.c +69 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/TestProductionCode2.c +38 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/TestProductionCode.c +71 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/TestProductionCode2.c +40 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +16 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/test_runners/all_tests.c +19 -0
- package/external/libedhoc/externals/Unity/examples/example_3/helper/UnityHelper.c +17 -0
- package/external/libedhoc/externals/Unity/examples/example_3/helper/UnityHelper.h +19 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_3/test/TestProductionCode.c +69 -0
- package/external/libedhoc/externals/Unity/examples/example_3/test/TestProductionCode2.c +38 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/TestProductionCode.c +70 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/TestProductionCode2.c +42 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c +53 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c +57 -0
- package/external/libedhoc/externals/Unity/examples/unity_config.h +251 -0
- package/external/libedhoc/externals/Unity/extras/bdd/src/unity_bdd.h +44 -0
- package/external/libedhoc/externals/Unity/extras/bdd/test/test_bdd.c +129 -0
- package/external/libedhoc/externals/Unity/extras/fixture/src/unity_fixture.c +310 -0
- package/external/libedhoc/externals/Unity/extras/fixture/src/unity_fixture.h +95 -0
- package/external/libedhoc/externals/Unity/extras/fixture/src/unity_fixture_internals.h +51 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/main/AllTests.c +20 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/template_fixture_tests.c +40 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/unity_fixture_Test.c +246 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/unity_fixture_TestRunner.c +33 -0
- package/external/libedhoc/externals/Unity/extras/memory/src/unity_memory.c +203 -0
- package/external/libedhoc/externals/Unity/extras/memory/src/unity_memory.h +61 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_memory_Test.c +326 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_memory_TestRunner.c +50 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_output_Spy.c +57 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_output_Spy.h +17 -0
- package/external/libedhoc/externals/Unity/src/unity.c +2501 -0
- package/external/libedhoc/externals/Unity/src/unity.h +698 -0
- package/external/libedhoc/externals/Unity/src/unity_internals.h +1183 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_cmd.c +61 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_def.c +57 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_head1.c +55 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_head1.h +15 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_cmd.c +80 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_def.c +76 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_head1.c +75 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_head1.h +13 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_new1.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_new2.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_param.c +77 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_run1.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_run2.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_yaml.c +90 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_new1.c +67 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_new2.c +70 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_param.c +58 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_run1.c +67 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_run2.c +70 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_yaml.c +71 -0
- package/external/libedhoc/externals/Unity/test/testdata/CException.h +18 -0
- package/external/libedhoc/externals/Unity/test/testdata/Defs.h +16 -0
- package/external/libedhoc/externals/Unity/test/testdata/cmock.h +21 -0
- package/external/libedhoc/externals/Unity/test/testdata/mockMock.h +20 -0
- package/external/libedhoc/externals/Unity/test/testdata/testRunnerGenerator.c +204 -0
- package/external/libedhoc/externals/Unity/test/testdata/testRunnerGeneratorSmall.c +73 -0
- package/external/libedhoc/externals/Unity/test/testdata/testRunnerGeneratorWithMocks.c +200 -0
- package/external/libedhoc/externals/Unity/test/tests/self_assessment_utils.h +151 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_arrays.c +2941 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_core.c +375 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_doubles.c +1285 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_floats.c +1395 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_integers.c +2863 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_integers_64.c +783 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_memory.c +82 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_parameterized.c +309 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_parameterizedDemo.c +28 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_strings.c +330 -0
- package/external/libedhoc/externals/Unity/test/tests/types_for_test.h +21 -0
- package/external/libedhoc/externals/zcbor/include/zcbor_common.h +147 -60
- package/external/libedhoc/externals/zcbor/include/zcbor_decode.h +291 -202
- package/external/libedhoc/externals/zcbor/include/zcbor_encode.h +100 -156
- package/external/libedhoc/externals/zcbor/include/zcbor_print.h +165 -0
- package/external/libedhoc/externals/zcbor/samples/hello_world/src/main.c +1 -1
- package/external/libedhoc/externals/zcbor/samples/pet/include/pet_decode.h +1 -1
- package/external/libedhoc/externals/zcbor/samples/pet/include/pet_encode.h +1 -1
- package/external/libedhoc/externals/zcbor/samples/pet/include/pet_types.h +4 -4
- package/external/libedhoc/externals/zcbor/samples/pet/src/main.c +4 -4
- package/external/libedhoc/externals/zcbor/samples/pet/src/pet_decode.c +15 -24
- package/external/libedhoc/externals/zcbor/samples/pet/src/pet_encode.c +14 -23
- package/external/libedhoc/externals/zcbor/src/zcbor_common.c +202 -29
- package/external/libedhoc/externals/zcbor/src/zcbor_decode.c +633 -173
- package/external/libedhoc/externals/zcbor/src/zcbor_encode.c +71 -184
- package/external/libedhoc/externals/zcbor/tests/decode/test1_suit_old_formats/src/main.c +152 -153
- package/external/libedhoc/externals/zcbor/tests/decode/test2_suit/src/main.c +64 -64
- package/external/libedhoc/externals/zcbor/tests/decode/test3_simple/src/main.c +15 -16
- package/external/libedhoc/externals/zcbor/tests/decode/test5_corner_cases/src/main.c +228 -84
- package/external/libedhoc/externals/zcbor/tests/decode/test7_suit9_simple/src/main.c +9 -9
- package/external/libedhoc/externals/zcbor/tests/decode/test8_suit12/src/main.c +0 -1
- package/external/libedhoc/externals/zcbor/tests/decode/test9_manifest14/src/main.c +172 -173
- package/external/libedhoc/externals/zcbor/tests/encode/test1_suit/src/main.c +73 -73
- package/external/libedhoc/externals/zcbor/tests/encode/test2_simple/src/main.c +1 -2
- package/external/libedhoc/externals/zcbor/tests/encode/test3_corner_cases/src/main.c +83 -56
- package/external/libedhoc/externals/zcbor/tests/encode/test4_senml/src/main.c +15 -16
- package/external/libedhoc/externals/zcbor/tests/fuzz/fuzz_everything.c +12 -0
- package/external/libedhoc/externals/zcbor/tests/fuzz/fuzz_manifest12.c +69 -69
- package/external/libedhoc/externals/zcbor/tests/unit/test1_unit_tests/src/main.c +448 -55
- package/external/libedhoc/externals/zcbor/tests/unit/test3_float16/src/main.c +49 -48
- package/external/libedhoc/include/edhoc.h +348 -54
- package/external/libedhoc/include/edhoc_common.h +289 -0
- package/external/libedhoc/include/edhoc_context.h +60 -35
- package/external/libedhoc/include/edhoc_credentials.h +55 -7
- package/external/libedhoc/include/edhoc_crypto.h +10 -10
- package/external/libedhoc/include/edhoc_ead.h +13 -10
- package/external/libedhoc/include/edhoc_macros.h +20 -11
- package/external/libedhoc/include/edhoc_values.h +2 -2
- package/external/libedhoc/library/edhoc.c +70 -36
- package/external/libedhoc/library/edhoc_common.c +1314 -0
- package/external/libedhoc/library/edhoc_exporter.c +45 -46
- package/external/libedhoc/library/edhoc_message_1.c +107 -72
- package/external/libedhoc/library/edhoc_message_2.c +396 -1693
- package/external/libedhoc/library/edhoc_message_3.c +465 -1656
- package/external/libedhoc/library/edhoc_message_4.c +93 -91
- package/external/libedhoc/library/edhoc_message_error.c +41 -41
- package/external/libedhoc/tests/include/{cipher_suites/cipher_suite_0.h → cipher_suite_0.h} +131 -134
- package/external/libedhoc/tests/include/{cipher_suites/cipher_suite_2.h → cipher_suite_2.h} +139 -140
- package/external/libedhoc/tests/include/{edhoc_trace_1/test_vector_1.h → test_vector_rfc9529_chapter_2.h} +786 -738
- package/external/libedhoc/tests/include/{edhoc_trace_2/test_vector_2.h → test_vector_rfc9529_chapter_3.h} +14 -10
- package/external/libedhoc/tests/include/{x509_chain_cs_0/test_vector_x5chain_cs_0.h → test_vector_x5chain_sign_keys_suite_0.h} +137 -140
- package/external/libedhoc/tests/include/{x509_chain_cs_2/test_vector_x5chain_cs_2.h → test_vector_x5chain_sign_keys_suite_2.h} +7 -8
- package/external/libedhoc/tests/include/{x509_chain_cs_2_static_dh/test_vector_x5chain_cs_2_static_dh.h → test_vector_x5chain_static_dh_keys_suite_2.h} +7 -8
- package/external/libedhoc/tests/include/{x509_hash_cs_2/test_vector_x5t_cs_2.h → test_vector_x5t_sign_keys_suite_2.h} +6 -7
- package/external/libedhoc/tests/src/{cipher_suites/cipher_suite_0.c → cipher_suite_0.c} +445 -447
- package/external/libedhoc/tests/src/{cipher_suites/cipher_suite_2.c → cipher_suite_2.c} +600 -600
- package/external/libedhoc/tests/src/module_test_api.c +430 -0
- package/external/libedhoc/tests/src/module_test_cipher_suite_0.c +395 -0
- package/external/libedhoc/tests/src/module_test_cipher_suite_2.c +392 -0
- package/external/libedhoc/tests/src/{error_message/test_edhoc_error_message.c → module_test_error_message.c} +94 -69
- package/external/libedhoc/tests/src/module_test_main.c +49 -0
- package/external/libedhoc/tests/src/{cipher_suite_negotiation/test_edhoc_cipher_suite_negotiation.c → module_test_rfc9528_suites_negotiation.c} +224 -227
- package/external/libedhoc/tests/src/module_test_rfc9529_chapter_2.c +2681 -0
- package/external/libedhoc/tests/src/module_test_rfc9529_chapter_3.c +1635 -0
- package/external/libedhoc/tests/src/module_test_x5chain_sign_keys_suite_0.c +1135 -0
- package/external/libedhoc/tests/src/module_test_x5chain_sign_keys_suite_2.c +1249 -0
- package/external/libedhoc/tests/src/module_test_x5chain_static_dh_keys_suite_2.c +798 -0
- package/external/libedhoc/tests/src/module_test_x5t_sign_keys_suite_2.c +956 -0
- package/include/EdhocComposeAsyncWorker.h +8 -6
- package/include/EdhocCredentialManager.h +16 -11
- package/include/EdhocCryptoManager.h +28 -21
- package/include/EdhocEadManager.h +3 -6
- package/include/{EdhocExportAsyncWorker.h → EdhocExportOscoreAsyncWorker.h} +20 -17
- package/include/EdhocKeyExporterAsyncWorker.h +76 -0
- package/include/EdhocKeyUpdateAsyncWorker.h +72 -0
- package/include/EdhocProcessAsyncWorker.h +14 -10
- package/include/LibEDHOC.h +44 -20
- package/include/UserContext.h +7 -9
- package/include/Utils.h +31 -27
- package/package.json +14 -3
- package/prebuilds/android-arm/edhoc.armv7.node +0 -0
- package/prebuilds/android-arm64/edhoc.armv8.node +0 -0
- package/prebuilds/darwin-arm64/edhoc.node +0 -0
- package/prebuilds/darwin-x64/edhoc.node +0 -0
- package/prebuilds/linux-arm/edhoc.armv6.node +0 -0
- package/prebuilds/linux-arm/edhoc.armv7.node +0 -0
- package/prebuilds/linux-arm64/edhoc.armv8.node +0 -0
- package/prebuilds/linux-x64/edhoc.glibc.node +0 -0
- package/prebuilds/linux-x64/edhoc.musl.node +0 -0
- package/prebuilds/win32-ia32/edhoc.node +0 -0
- package/prebuilds/win32-x64/edhoc.node +0 -0
- package/src/EdhocComposeAsyncWorker.cpp +18 -35
- package/src/EdhocCredentialManager.cpp +160 -187
- package/src/EdhocCryptoManager.cpp +386 -586
- package/src/EdhocEadManager.cpp +10 -18
- package/src/EdhocExportOscoreAsyncWorker.cpp +77 -0
- package/src/EdhocKeyExporterAsyncWorker.cpp +49 -0
- package/src/EdhocKeyUpdateAsyncWorker.cpp +41 -0
- package/src/EdhocProcessAsyncWorker.cpp +72 -19
- package/src/LibEDHOC.cpp +213 -174
- package/src/Suites.cpp +39 -72
- package/src/Utils.cpp +32 -56
- package/test/basic.test.ts +64 -0
- package/test/vectors.test.ts +111 -0
- package/external/libedhoc/externals/zcbor/include/zcbor_debug.h +0 -69
- package/external/libedhoc/tests/include/cipher_suite_negotiation/test_edhoc_cipher_suite_negotiation.h +0 -37
- package/external/libedhoc/tests/include/cipher_suites/test_cipher_suite_0.h +0 -48
- package/external/libedhoc/tests/include/cipher_suites/test_cipher_suite_2.h +0 -48
- package/external/libedhoc/tests/include/edhoc_trace_1/authentication_credentials_1.h +0 -60
- package/external/libedhoc/tests/include/edhoc_trace_1/test_edhoc_handshake_1.h +0 -208
- package/external/libedhoc/tests/include/edhoc_trace_1/test_edhoc_handshake_ead_1.h +0 -59
- package/external/libedhoc/tests/include/edhoc_trace_2/authentication_credentials_2.h +0 -60
- package/external/libedhoc/tests/include/edhoc_trace_2/test_edhoc_handshake_2.h +0 -199
- package/external/libedhoc/tests/include/error_message/test_edhoc_error_message.h +0 -48
- package/external/libedhoc/tests/include/x509_chain_cs_0/authentication_credentials_x5chain_cs_0.h +0 -92
- package/external/libedhoc/tests/include/x509_chain_cs_0/test_edhoc_handshake_x5chain_cs_0.h +0 -96
- package/external/libedhoc/tests/include/x509_chain_cs_2/authentication_credentials_x5chain_cs_2.h +0 -58
- package/external/libedhoc/tests/include/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2.h +0 -56
- package/external/libedhoc/tests/include/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2_ead.h +0 -57
- package/external/libedhoc/tests/include/x509_chain_cs_2_static_dh/authentication_credentials_x5chain_cs_2_static_dh.h +0 -59
- package/external/libedhoc/tests/include/x509_chain_cs_2_static_dh/test_edhoc_handshake_x5chain_cs_2_static_dh_ead.h +0 -57
- package/external/libedhoc/tests/include/x509_hash_cs_2/authentication_credentials_x5t_cs_2.h +0 -60
- package/external/libedhoc/tests/include/x509_hash_cs_2/test_edhoc_handshake_x5t_cs_2_ead.h +0 -57
- package/external/libedhoc/tests/src/cipher_suites/test_cipher_suite_0.c +0 -475
- package/external/libedhoc/tests/src/cipher_suites/test_cipher_suite_2.c +0 -473
- package/external/libedhoc/tests/src/edhoc_trace_1/authentication_credentials_1.c +0 -252
- package/external/libedhoc/tests/src/edhoc_trace_1/test_edhoc_handshake_1.c +0 -1829
- package/external/libedhoc/tests/src/edhoc_trace_1/test_edhoc_handshake_ead_1.c +0 -1247
- package/external/libedhoc/tests/src/edhoc_trace_2/authentication_credentials_2.c +0 -170
- package/external/libedhoc/tests/src/edhoc_trace_2/test_edhoc_handshake_2.c +0 -1783
- package/external/libedhoc/tests/src/tests.c +0 -228
- package/external/libedhoc/tests/src/x509_chain_cs_0/authentication_credentials_x5chain_cs_0.c +0 -332
- package/external/libedhoc/tests/src/x509_chain_cs_0/test_edhoc_handshake_x5chain_cs_0.c +0 -936
- package/external/libedhoc/tests/src/x509_chain_cs_2/authentication_credentials_x5chain_cs_2.c +0 -166
- package/external/libedhoc/tests/src/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2.c +0 -587
- package/external/libedhoc/tests/src/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2_ead.c +0 -917
- package/external/libedhoc/tests/src/x509_chain_cs_2_static_dh/authentication_credentials_x5chain_cs_2_static_dh.c +0 -186
- package/external/libedhoc/tests/src/x509_chain_cs_2_static_dh/test_edhoc_handshake_x5chain_cs_2_static_dh_ead.c +0 -743
- package/external/libedhoc/tests/src/x509_hash_cs_2/authentication_credentials_x5t_cs_2.c +0 -261
- package/external/libedhoc/tests/src/x509_hash_cs_2/test_edhoc_handshake_x5t_cs_2_ead.c +0 -854
- package/src/EdhocExportAsyncWorker.cpp +0 -82
package/src/Suites.cpp
CHANGED
|
@@ -5,13 +5,11 @@ static const struct edhoc_cipher_suite edhoc_cipher_suite_0 = {
|
|
|
5
5
|
.value = 0, // Suite identifier 0
|
|
6
6
|
.aead_key_length = 16, // Key length for AES-CCM-16-64-128 (16 bytes)
|
|
7
7
|
.aead_tag_length = 8, // Authentication tag length for AES-CCM (8 bytes)
|
|
8
|
-
.aead_iv_length =
|
|
9
|
-
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
.
|
|
13
|
-
.ecc_sign_length =
|
|
14
|
-
64, // Signature length for EdDSA using X25519 (64 bytes)
|
|
8
|
+
.aead_iv_length = 13, // Initialization vector length for AES-CCM (13 bytes)
|
|
9
|
+
.hash_length = 32, // Output length for SHA-256 (32 bytes)
|
|
10
|
+
.mac_length = 8, // MAC length (8 bytes)
|
|
11
|
+
.ecc_key_length = 32, // Elliptic curve key length for X25519 (32 bytes)
|
|
12
|
+
.ecc_sign_length = 64, // Signature length for EdDSA using X25519 (64 bytes)
|
|
15
13
|
};
|
|
16
14
|
|
|
17
15
|
// Cipher Suite 1
|
|
@@ -19,13 +17,11 @@ static const struct edhoc_cipher_suite edhoc_cipher_suite_1 = {
|
|
|
19
17
|
.value = 1, // Suite identifier 1
|
|
20
18
|
.aead_key_length = 16, // Key length for AES-CCM-16-128-128 (16 bytes)
|
|
21
19
|
.aead_tag_length = 16, // Authentication tag length for AES-CCM (16 bytes)
|
|
22
|
-
.aead_iv_length =
|
|
23
|
-
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.ecc_sign_length =
|
|
28
|
-
64, // Signature length for EdDSA using X25519 (64 bytes)
|
|
20
|
+
.aead_iv_length = 13, // Initialization vector length for AES-CCM (13 bytes)
|
|
21
|
+
.hash_length = 32, // Output length for SHA-256 (32 bytes)
|
|
22
|
+
.mac_length = 16, // MAC length (16 bytes)
|
|
23
|
+
.ecc_key_length = 32, // Elliptic curve key length for X25519 (32 bytes)
|
|
24
|
+
.ecc_sign_length = 64, // Signature length for EdDSA using X25519 (64 bytes)
|
|
29
25
|
};
|
|
30
26
|
|
|
31
27
|
// Cipher Suite 2
|
|
@@ -33,10 +29,9 @@ static const struct edhoc_cipher_suite edhoc_cipher_suite_2 = {
|
|
|
33
29
|
.value = 2, // Suite identifier 2
|
|
34
30
|
.aead_key_length = 16, // Key length for AES-CCM-16-64-128 (16 bytes)
|
|
35
31
|
.aead_tag_length = 8, // Authentication tag length for AES-CCM (8 bytes)
|
|
36
|
-
.aead_iv_length =
|
|
37
|
-
|
|
38
|
-
.
|
|
39
|
-
.mac_length = 8, // MAC length (8 bytes)
|
|
32
|
+
.aead_iv_length = 13, // Initialization vector length for AES-CCM (13 bytes)
|
|
33
|
+
.hash_length = 32, // Output length for SHA-256 (32 bytes)
|
|
34
|
+
.mac_length = 8, // MAC length (8 bytes)
|
|
40
35
|
.ecc_key_length = 32, // Elliptic curve key length for P-256 (32 bytes)
|
|
41
36
|
.ecc_sign_length = 64, // Signature length for ES256 using P-256 (64 bytes)
|
|
42
37
|
};
|
|
@@ -46,10 +41,9 @@ static const struct edhoc_cipher_suite edhoc_cipher_suite_3 = {
|
|
|
46
41
|
.value = 3, // Suite identifier 3
|
|
47
42
|
.aead_key_length = 16, // Key length for AES-CCM-16-128-128 (16 bytes)
|
|
48
43
|
.aead_tag_length = 16, // Authentication tag length for AES-CCM (16 bytes)
|
|
49
|
-
.aead_iv_length =
|
|
50
|
-
|
|
51
|
-
.
|
|
52
|
-
.mac_length = 16, // MAC length (16 bytes)
|
|
44
|
+
.aead_iv_length = 13, // Initialization vector length for AES-CCM (13 bytes)
|
|
45
|
+
.hash_length = 32, // Output length for SHA-256 (32 bytes)
|
|
46
|
+
.mac_length = 16, // MAC length (16 bytes)
|
|
53
47
|
.ecc_key_length = 32, // Elliptic curve key length for P-256 (32 bytes)
|
|
54
48
|
.ecc_sign_length = 64, // Signature length for ES256 using P-256 (64 bytes)
|
|
55
49
|
};
|
|
@@ -63,8 +57,7 @@ static const struct edhoc_cipher_suite edhoc_cipher_suite_4 = {
|
|
|
63
57
|
.hash_length = 32, // Output length for SHA-256 (32 bytes)
|
|
64
58
|
.mac_length = 16, // MAC length (16 bytes)
|
|
65
59
|
.ecc_key_length = 32, // Elliptic curve key length for X25519 (32 bytes)
|
|
66
|
-
.ecc_sign_length =
|
|
67
|
-
64, // Signature length for EdDSA using X25519 (64 bytes)
|
|
60
|
+
.ecc_sign_length = 64, // Signature length for EdDSA using X25519 (64 bytes)
|
|
68
61
|
};
|
|
69
62
|
|
|
70
63
|
// Cipher Suite 5
|
|
@@ -84,13 +77,11 @@ static const struct edhoc_cipher_suite edhoc_cipher_suite_6 = {
|
|
|
84
77
|
.value = 6, // Suite identifier 6
|
|
85
78
|
.aead_key_length = 16, // Key length for A128GCM (16 bytes)
|
|
86
79
|
.aead_tag_length = 16, // Authentication tag length for A128GCM (16 bytes)
|
|
87
|
-
.aead_iv_length =
|
|
88
|
-
|
|
89
|
-
.
|
|
90
|
-
.
|
|
91
|
-
.
|
|
92
|
-
.ecc_sign_length =
|
|
93
|
-
64, // Signature length for ES256 using X25519 (64 bytes)
|
|
80
|
+
.aead_iv_length = 12, // Initialization vector length for A128GCM (12 bytes)
|
|
81
|
+
.hash_length = 32, // Output length for SHA-256 (32 bytes)
|
|
82
|
+
.mac_length = 16, // MAC length (16 bytes)
|
|
83
|
+
.ecc_key_length = 32, // Elliptic curve key length for X25519 (32 bytes)
|
|
84
|
+
.ecc_sign_length = 64, // Signature length for ES256 using X25519 (64 bytes)
|
|
94
85
|
};
|
|
95
86
|
|
|
96
87
|
// Cipher Suite 24
|
|
@@ -98,56 +89,32 @@ static const struct edhoc_cipher_suite edhoc_cipher_suite_24 = {
|
|
|
98
89
|
.value = 24, // Suite identifier 24
|
|
99
90
|
.aead_key_length = 32, // Key length for A256GCM (32 bytes)
|
|
100
91
|
.aead_tag_length = 16, // Authentication tag length for A256GCM (16 bytes)
|
|
101
|
-
.aead_iv_length =
|
|
102
|
-
|
|
103
|
-
.
|
|
104
|
-
.mac_length = 16, // MAC length (16 bytes)
|
|
92
|
+
.aead_iv_length = 12, // Initialization vector length for A256GCM (12 bytes)
|
|
93
|
+
.hash_length = 48, // Output length for SHA-384 (48 bytes)
|
|
94
|
+
.mac_length = 16, // MAC length (16 bytes)
|
|
105
95
|
.ecc_key_length = 48, // Elliptic curve key length for P-384 (48 bytes)
|
|
106
96
|
.ecc_sign_length = 96, // Signature length for ES384 using P-384 (96 bytes)
|
|
107
97
|
};
|
|
108
98
|
|
|
109
99
|
// Cipher Suite 25
|
|
110
100
|
static const struct edhoc_cipher_suite edhoc_cipher_suite_25 = {
|
|
111
|
-
.value = 25,
|
|
112
|
-
.aead_key_length = 32,
|
|
113
|
-
.aead_tag_length = 16,
|
|
114
|
-
.aead_iv_length = 12,
|
|
115
|
-
.hash_length = 64,
|
|
116
|
-
.mac_length = 16,
|
|
117
|
-
.ecc_key_length = 56,
|
|
118
|
-
.ecc_sign_length =
|
|
119
|
-
114, // Signature length for EdDSA using X448 (114 bytes)
|
|
101
|
+
.value = 25, // Suite identifier 25
|
|
102
|
+
.aead_key_length = 32, // Key length for ChaCha20 (32 bytes)
|
|
103
|
+
.aead_tag_length = 16, // Authentication tag length for Poly1305 (16 bytes)
|
|
104
|
+
.aead_iv_length = 12, // Nonce length for ChaCha20 (12 bytes)
|
|
105
|
+
.hash_length = 64, // Output length for SHAKE256 (64 bytes)
|
|
106
|
+
.mac_length = 16, // MAC length (16 bytes)
|
|
107
|
+
.ecc_key_length = 56, // Elliptic curve key length for X448 (56 bytes)
|
|
108
|
+
.ecc_sign_length = 114, // Signature length for EdDSA using X448 (114 bytes)
|
|
120
109
|
};
|
|
121
110
|
|
|
122
111
|
const struct edhoc_cipher_suite* suite_pointers[] = {
|
|
123
|
-
&edhoc_cipher_suite_0,
|
|
124
|
-
&
|
|
125
|
-
&edhoc_cipher_suite_2,
|
|
126
|
-
&edhoc_cipher_suite_3,
|
|
127
|
-
&edhoc_cipher_suite_4,
|
|
128
|
-
&edhoc_cipher_suite_5,
|
|
129
|
-
&edhoc_cipher_suite_6,
|
|
112
|
+
&edhoc_cipher_suite_0, &edhoc_cipher_suite_1, &edhoc_cipher_suite_2, &edhoc_cipher_suite_3, &edhoc_cipher_suite_4,
|
|
113
|
+
&edhoc_cipher_suite_5, &edhoc_cipher_suite_6,
|
|
130
114
|
// 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
|
|
131
|
-
nullptr,
|
|
132
|
-
nullptr,
|
|
133
|
-
nullptr,
|
|
134
|
-
nullptr,
|
|
135
|
-
nullptr,
|
|
136
|
-
nullptr,
|
|
137
|
-
nullptr,
|
|
138
|
-
nullptr,
|
|
139
|
-
nullptr,
|
|
140
|
-
nullptr,
|
|
141
|
-
nullptr,
|
|
142
|
-
nullptr,
|
|
143
|
-
nullptr,
|
|
144
|
-
nullptr,
|
|
145
|
-
nullptr,
|
|
146
|
-
nullptr,
|
|
147
|
-
nullptr,
|
|
115
|
+
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
|
|
116
|
+
nullptr, nullptr, nullptr, nullptr,
|
|
148
117
|
// 24, 25
|
|
149
|
-
&edhoc_cipher_suite_24,
|
|
150
|
-
&edhoc_cipher_suite_25};
|
|
118
|
+
&edhoc_cipher_suite_24, &edhoc_cipher_suite_25};
|
|
151
119
|
|
|
152
|
-
const size_t suite_pointers_count =
|
|
153
|
-
sizeof(suite_pointers) / sizeof(suite_pointers[0]);
|
|
120
|
+
const size_t suite_pointers_count = sizeof(suite_pointers) / sizeof(suite_pointers[0]);
|
package/src/Utils.cpp
CHANGED
|
@@ -1,33 +1,22 @@
|
|
|
1
|
+
#include "Utils.h"
|
|
2
|
+
|
|
1
3
|
#include <condition_variable>
|
|
2
4
|
#include <cstring>
|
|
3
5
|
#include <mutex>
|
|
4
6
|
#include <thread>
|
|
5
7
|
|
|
6
|
-
#include "Utils.h"
|
|
7
|
-
|
|
8
8
|
static constexpr const char* kStringThen = "then";
|
|
9
9
|
static constexpr const char* kStringCatch = "catch";
|
|
10
|
-
static constexpr const char* kErrorInputValueMustBeANumberOrABuffer =
|
|
11
|
-
"Input value must be a number or a buffer";
|
|
12
|
-
|
|
13
|
-
void Utils::ResetAndRelease(Napi::FunctionReference& funcRef,
|
|
14
|
-
Napi::ThreadSafeFunction& tsfn) {
|
|
15
|
-
if (!funcRef.IsEmpty()) {
|
|
16
|
-
funcRef.Reset();
|
|
17
|
-
}
|
|
18
|
-
if (tsfn != nullptr) {
|
|
19
|
-
tsfn.Release();
|
|
20
|
-
tsfn = nullptr;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
10
|
+
static constexpr const char* kErrorInputValueMustBeANumberOrABuffer = "Input value must be a number or a buffer";
|
|
23
11
|
|
|
24
|
-
void Utils::InvokeJSFunctionWithPromiseHandling(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
void Utils::InvokeJSFunctionWithPromiseHandling(Napi::Env env,
|
|
13
|
+
Napi::Object jsObject,
|
|
14
|
+
Napi::Function jsCallback,
|
|
15
|
+
const std::vector<napi_value>& args,
|
|
16
|
+
SuccessHandler successLambda,
|
|
17
|
+
ErrorHandler errorLambda) {
|
|
30
18
|
auto deferred = Napi::Promise::Deferred::New(env);
|
|
19
|
+
|
|
31
20
|
try {
|
|
32
21
|
Napi::Value result = jsCallback.Call(jsObject, args);
|
|
33
22
|
deferred.Resolve(result);
|
|
@@ -35,36 +24,28 @@ void Utils::InvokeJSFunctionWithPromiseHandling(
|
|
|
35
24
|
deferred.Reject(e.Value());
|
|
36
25
|
}
|
|
37
26
|
|
|
38
|
-
Napi::
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
callbackLambda(env, result);
|
|
48
|
-
deferred.Resolve(result);
|
|
49
|
-
} catch (const Napi::Error& e) {
|
|
50
|
-
deferred.Reject(e.Value());
|
|
51
|
-
}
|
|
52
|
-
return deferred.Promise();
|
|
53
|
-
});
|
|
27
|
+
auto thenCallback = Napi::Function::New(env, [successLambda, errorLambda](const Napi::CallbackInfo& info) {
|
|
28
|
+
Napi::Env env = info.Env();
|
|
29
|
+
Napi::HandleScope scope(env);
|
|
30
|
+
try {
|
|
31
|
+
successLambda(env, info[0].As<Napi::Value>());
|
|
32
|
+
} catch (const std::exception& e) {
|
|
33
|
+
errorLambda(env, Napi::Error::New(env, e.what()));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
54
36
|
|
|
55
|
-
auto catchCallback =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
auto catchCallback = Napi::Function::New(env, [errorLambda](const Napi::CallbackInfo& info) {
|
|
38
|
+
Napi::Env env = info.Env();
|
|
39
|
+
Napi::HandleScope scope(env);
|
|
40
|
+
errorLambda(env, info[0].As<Napi::Error>());
|
|
41
|
+
});
|
|
60
42
|
|
|
61
|
-
|
|
43
|
+
Napi::Promise promise = deferred.Promise();
|
|
62
44
|
promise.Get(kStringCatch).As<Napi::Function>().Call(promise, {catchCallback});
|
|
45
|
+
promise.Get(kStringThen).As<Napi::Function>().Call(promise, {thenCallback});
|
|
63
46
|
}
|
|
64
47
|
|
|
65
|
-
void Utils::EncodeInt64ToBuffer(int64_t value,
|
|
66
|
-
uint8_t* buffer,
|
|
67
|
-
size_t* length) {
|
|
48
|
+
void Utils::EncodeInt64ToBuffer(int64_t value, uint8_t* buffer, size_t* length) {
|
|
68
49
|
size_t idx = 0;
|
|
69
50
|
if (value == 0) {
|
|
70
51
|
buffer[idx++] = 0;
|
|
@@ -81,10 +62,8 @@ struct edhoc_connection_id Utils::ConvertJsValueToEdhocCid(Napi::Value value) {
|
|
|
81
62
|
struct edhoc_connection_id cid = {};
|
|
82
63
|
if (value.IsNumber()) {
|
|
83
64
|
int64_t numeric = value.As<Napi::Number>().Int64Value();
|
|
84
|
-
if (numeric >= ONE_BYTE_CBOR_INT_MIN_VALUE &&
|
|
85
|
-
|
|
86
|
-
cid = {.encode_type = EDHOC_CID_TYPE_ONE_BYTE_INTEGER,
|
|
87
|
-
.int_value = (int8_t)numeric};
|
|
65
|
+
if (numeric >= ONE_BYTE_CBOR_INT_MIN_VALUE && numeric <= ONE_BYTE_CBOR_INT_MAX_VALUE) {
|
|
66
|
+
cid = {.encode_type = EDHOC_CID_TYPE_ONE_BYTE_INTEGER, .int_value = (int8_t)numeric};
|
|
88
67
|
} else {
|
|
89
68
|
size_t length = 0;
|
|
90
69
|
Utils::EncodeInt64ToBuffer(numeric, cid.bstr_value, &length);
|
|
@@ -97,19 +76,16 @@ struct edhoc_connection_id Utils::ConvertJsValueToEdhocCid(Napi::Value value) {
|
|
|
97
76
|
cid.bstr_length = buffer.Length();
|
|
98
77
|
memcpy(cid.bstr_value, buffer.Data(), cid.bstr_length);
|
|
99
78
|
} else {
|
|
100
|
-
throw Napi::TypeError::New(value.Env(),
|
|
101
|
-
kErrorInputValueMustBeANumberOrABuffer);
|
|
79
|
+
throw Napi::TypeError::New(value.Env(), kErrorInputValueMustBeANumberOrABuffer);
|
|
102
80
|
}
|
|
103
81
|
return cid;
|
|
104
82
|
}
|
|
105
83
|
|
|
106
|
-
Napi::Value Utils::CreateJsValueFromEdhocCid(Napi::Env env,
|
|
107
|
-
struct edhoc_connection_id value) {
|
|
84
|
+
Napi::Value Utils::CreateJsValueFromEdhocCid(Napi::Env env, struct edhoc_connection_id value) {
|
|
108
85
|
if (value.encode_type == EDHOC_CID_TYPE_ONE_BYTE_INTEGER) {
|
|
109
86
|
return Napi::Number::New(env, value.int_value);
|
|
110
87
|
} else if (value.encode_type == EDHOC_CID_TYPE_BYTE_STRING) {
|
|
111
|
-
return Napi::Buffer<char>::Copy(
|
|
112
|
-
env, (const char*)value.bstr_value, value.bstr_length);
|
|
88
|
+
return Napi::Buffer<char>::Copy(env, (const char*)value.bstr_value, value.bstr_length);
|
|
113
89
|
}
|
|
114
90
|
return env.Null();
|
|
115
91
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EDHOC, X509CertificateCredentialManager, DefaultEdhocCryptoManager, EdhocMethod, EdhocSuite } from '../dist/index'
|
|
2
|
+
|
|
3
|
+
describe('EDHOC Handshake', () => {
|
|
4
|
+
// Test setup variables
|
|
5
|
+
const trustedCA = Buffer.from('308201323081DAA003020102021478408C6EC18A1D452DAE70C726CB0192A6116DBB300A06082A8648CE3D040302301A3118301606035504030C0F5468697320697320434120526F6F74301E170D3234313031393138333635335A170D3235313031393138333635335A301A3118301606035504030C0F5468697320697320434120526F6F743059301306072A8648CE3D020106082A8648CE3D03010703420004B9348A8A267EF52CFDC30109A29008A2D99F6B8F78BA9EAF5D51578C06134E78CB90A073EDC2488A14174B4E2997C840C5DE7F8E35EB54A0DB6977E894D1B2CB300A06082A8648CE3D040302034700304402203B92BFEC770B0FA4E17F8F02A13CD945D914ED8123AC85C37C8C7BAA2BE3E0F102202CB2DC2EC295B5F4B7BB631ED751179C145D6B6E081559AEA38CE215369E9C31', 'hex');
|
|
6
|
+
let initiator: EDHOC;
|
|
7
|
+
let responder: EDHOC;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
// Initialize credentials and crypto managers for both parties
|
|
11
|
+
const initiatorKeyID = Buffer.from('00000001', 'hex');
|
|
12
|
+
const initiatorCredentialManager = new X509CertificateCredentialManager(
|
|
13
|
+
[Buffer.from('3082012E3081D4A003020102021453423D5145C767CDC29895C3DB590192A611EA50300A06082A8648CE3D040302301A3118301606035504030C0F5468697320697320434120526F6F74301E170D3234313031393138333732345A170D3235313031393138333732345A30143112301006035504030C09696E69746961746F723059301306072A8648CE3D020106082A8648CE3D03010703420004EB0EF585F3992A1653CF310BF0F0F8035267CDAB6989C8B02E7228FBD759EF6B56263259AADF087F9849E7B7651F74C3B4F144CCCF86BB6FE2FF0EF3AA5FB5DC300A06082A8648CE3D0403020349003046022100D8C3AA7C98A730B3D4862EDAB4C1474FCD9A17A9CA3FB078914A10978FE95CC40221009F5877DD4E2C635A04ED1F6F1854C87B58521BDDFF533B1076F53D456739764C', 'hex')],
|
|
14
|
+
initiatorKeyID
|
|
15
|
+
);
|
|
16
|
+
initiatorCredentialManager.addTrustedCA(trustedCA);
|
|
17
|
+
|
|
18
|
+
const initiatorCryptoManager = new DefaultEdhocCryptoManager();
|
|
19
|
+
initiatorCryptoManager.addKey(initiatorKeyID, Buffer.from('DC1FBB05B6B08360CE5B9EEA08EBFBFC6766A21340641863D4C8A3F68F096337', 'hex'));
|
|
20
|
+
|
|
21
|
+
const responderKeyID = Buffer.from('00000002', 'hex');
|
|
22
|
+
const responderCredentialManager = new X509CertificateCredentialManager(
|
|
23
|
+
[Buffer.from('3082012E3081D4A00302010202146648869E2608FC2E16D945C10E1F0192A6125CC0300A06082A8648CE3D040302301A3118301606035504030C0F5468697320697320434120526F6F74301E170D3234313031393138333735345A170D3235313031393138333735345A30143112301006035504030C09726573706F6E6465723059301306072A8648CE3D020106082A8648CE3D03010703420004161F76A7A106C9B79B7F651156B5B095E63A6101A39020F4E86DDACE61FB395E8AEF6CD9C444EE9A43DBD62DAD44FF50FE4146247D3AFD28F60DBC01FBFC573C300A06082A8648CE3D0403020349003046022100E8AD0926518CDB61E84D171700C7158FD0E72D03A117D40133ECD10F8B9F42CE022100E7E69B4C79100B3F0792F010AE11EE5DD2859C29EFC4DBCEFD41FA5CD4D3C3C9', 'hex')],
|
|
24
|
+
responderKeyID
|
|
25
|
+
);
|
|
26
|
+
responderCredentialManager.addTrustedCA(trustedCA);
|
|
27
|
+
|
|
28
|
+
const responderCryptoManager = new DefaultEdhocCryptoManager();
|
|
29
|
+
responderCryptoManager.addKey(responderKeyID, Buffer.from('EE6287116FE27CDC539629DC87E12BF8EAA2229E7773AA67BC4C0FBA96E7FBB2', 'hex'));
|
|
30
|
+
|
|
31
|
+
// Initialize EDHOC instances
|
|
32
|
+
initiator = new EDHOC(10, [EdhocMethod.Method1], [EdhocSuite.Suite2], initiatorCredentialManager, initiatorCryptoManager);
|
|
33
|
+
responder = new EDHOC(20, [EdhocMethod.Method2, EdhocMethod.Method0, EdhocMethod.Method1], [EdhocSuite.Suite2], responderCredentialManager, responderCryptoManager);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('should complete successful EDHOC handshake', async () => {
|
|
37
|
+
// Perform the three-message handshake
|
|
38
|
+
const message1 = await initiator.composeMessage1([{ label: 1, value: Buffer.from('Hello') }]);
|
|
39
|
+
const ead1 = await responder.processMessage1(message1);
|
|
40
|
+
expect(ead1[0].value.toString()).toBe('Hello');
|
|
41
|
+
|
|
42
|
+
const message2 = await responder.composeMessage2();
|
|
43
|
+
const ead2 = await initiator.processMessage2(message2);
|
|
44
|
+
expect(ead2).toEqual([]);
|
|
45
|
+
|
|
46
|
+
const message3 = await initiator.composeMessage3();
|
|
47
|
+
const ead3 = await responder.processMessage3(message3);
|
|
48
|
+
expect(ead3).toEqual([]);
|
|
49
|
+
|
|
50
|
+
// Verify that both parties derived the same OSCORE security context
|
|
51
|
+
const initiatorOSCORE = await initiator.exportOSCORE();
|
|
52
|
+
const responderOSCORE = await responder.exportOSCORE();
|
|
53
|
+
|
|
54
|
+
expect(initiatorOSCORE.masterSalt).toEqual(responderOSCORE.masterSalt);
|
|
55
|
+
expect(initiatorOSCORE.masterSecret).toEqual(responderOSCORE.masterSecret);
|
|
56
|
+
expect(initiatorOSCORE.senderId).toEqual(responderOSCORE.recipientId);
|
|
57
|
+
expect(initiatorOSCORE.recipientId).toEqual(responderOSCORE.senderId);
|
|
58
|
+
|
|
59
|
+
// Verify that both parties can derive the same application keys
|
|
60
|
+
const initiatorKey = await initiator.exportKey(40001, 32);
|
|
61
|
+
const responderKey = await responder.exportKey(40001, 32);
|
|
62
|
+
expect(initiatorKey).toEqual(responderKey);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { EDHOC, X509CertificateCredentialManager, DefaultEdhocCryptoManager, EdhocMethod, EdhocSuite, EdhocCredentialsFormat, EdhocKeyType } from '../dist/index'
|
|
2
|
+
|
|
3
|
+
class VectorsEdhocCryptoManager extends DefaultEdhocCryptoManager {
|
|
4
|
+
|
|
5
|
+
async importKey(edhoc: EDHOC, keyType: EdhocKeyType, key: Buffer) {
|
|
6
|
+
// Method 0, Suite 0, Connection ID -14 - Initiator
|
|
7
|
+
if (keyType === EdhocKeyType.MakeKeyPair && key && edhoc.connectionID === -14) {
|
|
8
|
+
key = Buffer.from('892EC28E5CB6669108470539500B705E60D008D347C5817EE9F3327C8A87BB03', 'hex');
|
|
9
|
+
}
|
|
10
|
+
// Method 0, Suite 0, Connection ID 0x18 - Responder
|
|
11
|
+
if (keyType === EdhocKeyType.MakeKeyPair && key && Buffer.isBuffer(edhoc.connectionID) && Buffer.compare(edhoc.connectionID, Buffer.from([0x18])) === 0) {
|
|
12
|
+
key = Buffer.from('E69C23FBF81BC435942446837FE827BF206C8FA10A39DB47449E5A813421E1E8', 'hex');
|
|
13
|
+
}
|
|
14
|
+
return super.importKey(edhoc, keyType, key);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe('EDHOC RFC9529 Test Vectors', () => {
|
|
19
|
+
// Test setup variables
|
|
20
|
+
const trustedCA = Buffer.from('3082010E3081C1A003020102020462319E74300506032B6570301D311B301906035504030C124544484F4320526F6F742045643235353139301E170D3232303331363038323331365A170D3239313233313233303030305A301D311B301906035504030C124544484F4320526F6F742045643235353139302A300506032B65700321002B7B3E8057C8642944D06AFE7A71D1C9BF961B6292BAC4B04F91669BBB713BE4A3233021300E0603551D0F0101FF040403020204300F0603551D130101FF040530030101FF300506032B65700341004BB52BBF1539B71A4AAF429778F29EDA7E814680698F16C48F2A6FA4DBE82541C58207BA1BC9CDB0C2FA947FFBF0F0EC0EE91A7FF37A94D9251FA5CDF1E67A0F', 'hex');
|
|
21
|
+
const keyUpdate = Buffer.from('d6be169602b8bceaa01158fdb820890c', 'hex');
|
|
22
|
+
|
|
23
|
+
const masterSecret = Buffer.from('1e1c6beac3a8a1cac435de7e2f9ae7ff', 'hex');
|
|
24
|
+
const masterSalt = Buffer.from('ce7ab844c0106d73', 'hex');
|
|
25
|
+
|
|
26
|
+
const masterSecret_Update = Buffer.from('ee0ff542c47eb0e09c69307649bdbbe5', 'hex');
|
|
27
|
+
const masterSalt_Update = Buffer.from('80cede2a1e5aab48', 'hex');
|
|
28
|
+
|
|
29
|
+
// Initiator Identity
|
|
30
|
+
const initiatorCert = Buffer.from('3081EE3081A1A003020102020462319EA0300506032B6570301D311B301906035504030C124544484F4320526F6F742045643235353139301E170D3232303331363038323430305A170D3239313233313233303030305A30223120301E06035504030C174544484F4320496E69746961746F722045643235353139302A300506032B6570032100ED06A8AE61A829BA5FA54525C9D07F48DD44A302F43E0F23D8CC20B73085141E300506032B6570034100521241D8B3A770996BCFC9B9EAD4E7E0A1C0DB353A3BDF2910B39275AE48B756015981850D27DB6734E37F67212267DD05EEFF27B9E7A813FA574B72A00B430B', 'hex');
|
|
31
|
+
const initiatorKey = Buffer.from('4C5B25878F507C6B9DAE68FBD4FD3FF997533DB0AF00B25D324EA28E6C213BC8', 'hex');
|
|
32
|
+
const initiatorKeyID = Buffer.from('00000001', 'hex');
|
|
33
|
+
|
|
34
|
+
// Responder Identity
|
|
35
|
+
const responderCert = Buffer.from('3081EE3081A1A003020102020462319EC4300506032B6570301D311B301906035504030C124544484F4320526F6F742045643235353139301E170D3232303331363038323433365A170D3239313233313233303030305A30223120301E06035504030C174544484F4320526573706F6E6465722045643235353139302A300506032B6570032100A1DB47B95184854AD12A0C1A354E418AACE33AA0F2C662C00B3AC55DE92F9359300506032B6570034100B723BC01EAB0928E8B2B6C98DE19CC3823D46E7D6987B032478FECFAF14537A1AF14CC8BE829C6B73044101837EB4ABC949565D86DCE51CFAE52AB82C152CB02', 'hex');
|
|
36
|
+
const responderKey = Buffer.from('EF140FF900B0AB03F0C08D879CBBD4B31EA71E6E7EE7FFCB7E7955777A332799', 'hex');
|
|
37
|
+
const responderKeyID = Buffer.from('00000002', 'hex');
|
|
38
|
+
|
|
39
|
+
let initiator: EDHOC;
|
|
40
|
+
let responder: EDHOC;
|
|
41
|
+
|
|
42
|
+
beforeEach(() => {
|
|
43
|
+
// Initiator Setup
|
|
44
|
+
const initiatorCredentialManager = new X509CertificateCredentialManager([initiatorCert], initiatorKeyID);
|
|
45
|
+
initiatorCredentialManager.addTrustedCA(trustedCA);
|
|
46
|
+
initiatorCredentialManager.addPeerCertificate(responderCert);
|
|
47
|
+
initiatorCredentialManager.fetchFormat = EdhocCredentialsFormat.x5t;
|
|
48
|
+
|
|
49
|
+
// Initiator Crypto Manager
|
|
50
|
+
const initiatorCryptoManager = new VectorsEdhocCryptoManager();
|
|
51
|
+
initiatorCryptoManager.addKey(initiatorKeyID, initiatorKey);
|
|
52
|
+
|
|
53
|
+
// Responder Setup
|
|
54
|
+
const responderCredentialManager = new X509CertificateCredentialManager([responderCert], responderKeyID);
|
|
55
|
+
responderCredentialManager.addTrustedCA(trustedCA);
|
|
56
|
+
responderCredentialManager.addPeerCertificate(initiatorCert);
|
|
57
|
+
responderCredentialManager.fetchFormat = EdhocCredentialsFormat.x5t;
|
|
58
|
+
|
|
59
|
+
// Responder Crypto Manager
|
|
60
|
+
const responderCryptoManager = new VectorsEdhocCryptoManager();
|
|
61
|
+
responderCryptoManager.addKey(responderKeyID, responderKey);
|
|
62
|
+
|
|
63
|
+
// Initialize EDHOC instances
|
|
64
|
+
initiator = new EDHOC(-14, [EdhocMethod.Method0], [EdhocSuite.Suite0], initiatorCredentialManager, initiatorCryptoManager);
|
|
65
|
+
responder = new EDHOC(Buffer.from([0x18]), [EdhocMethod.Method0], [EdhocSuite.Suite0], responderCredentialManager, responderCryptoManager);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('should complete successful EDHOC handshake', async () => {
|
|
69
|
+
// Perform the three-message handshake
|
|
70
|
+
const message1 = await initiator.composeMessage1();
|
|
71
|
+
const ead1 = await responder.processMessage1(message1);
|
|
72
|
+
expect(ead1).toEqual([]);
|
|
73
|
+
|
|
74
|
+
const message2 = await responder.composeMessage2();
|
|
75
|
+
const ead2 = await initiator.processMessage2(message2);
|
|
76
|
+
expect(ead2).toEqual([]);
|
|
77
|
+
|
|
78
|
+
const message3 = await initiator.composeMessage3();
|
|
79
|
+
const ead3 = await responder.processMessage3(message3);
|
|
80
|
+
expect(ead3).toEqual([]);
|
|
81
|
+
|
|
82
|
+
const message4 = await initiator.composeMessage4();
|
|
83
|
+
const ead4 = await responder.processMessage4(message4);
|
|
84
|
+
expect(ead4).toEqual([]);
|
|
85
|
+
|
|
86
|
+
const initiatorOSCORE = await initiator.exportOSCORE();
|
|
87
|
+
const responderOSCORE = await responder.exportOSCORE();
|
|
88
|
+
|
|
89
|
+
expect(initiatorOSCORE.masterSalt).toEqual(responderOSCORE.masterSalt);
|
|
90
|
+
expect(initiatorOSCORE.masterSecret).toEqual(responderOSCORE.masterSecret);
|
|
91
|
+
expect(initiatorOSCORE.senderId).toEqual(responderOSCORE.recipientId);
|
|
92
|
+
expect(initiatorOSCORE.recipientId).toEqual(responderOSCORE.senderId);
|
|
93
|
+
|
|
94
|
+
expect(initiatorOSCORE.masterSalt).toEqual(masterSalt);
|
|
95
|
+
expect(initiatorOSCORE.masterSecret).toEqual(masterSecret);
|
|
96
|
+
|
|
97
|
+
await initiator.keyUpdate(keyUpdate);
|
|
98
|
+
await responder.keyUpdate(keyUpdate);
|
|
99
|
+
|
|
100
|
+
const initiatorOSCORE_Update = await initiator.exportOSCORE();
|
|
101
|
+
const responderOSCORE_Update = await responder.exportOSCORE();
|
|
102
|
+
|
|
103
|
+
expect(initiatorOSCORE_Update.masterSalt).toEqual(responderOSCORE_Update.masterSalt);
|
|
104
|
+
expect(initiatorOSCORE_Update.masterSecret).toEqual(responderOSCORE_Update.masterSecret);
|
|
105
|
+
expect(initiatorOSCORE_Update.senderId).toEqual(responderOSCORE_Update.recipientId);
|
|
106
|
+
expect(initiatorOSCORE_Update.recipientId).toEqual(responderOSCORE_Update.senderId);
|
|
107
|
+
|
|
108
|
+
expect(initiatorOSCORE_Update.masterSecret).toEqual(masterSecret_Update);
|
|
109
|
+
expect(initiatorOSCORE_Update.masterSalt).toEqual(masterSalt_Update);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2020 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#ifndef ZCBOR_DEBUG_H__
|
|
8
|
-
#define ZCBOR_DEBUG_H__
|
|
9
|
-
|
|
10
|
-
#include <stdint.h>
|
|
11
|
-
#include <stdbool.h>
|
|
12
|
-
#include <stddef.h>
|
|
13
|
-
#include "zcbor_common.h"
|
|
14
|
-
|
|
15
|
-
#ifdef __cplusplus
|
|
16
|
-
extern "C" {
|
|
17
|
-
#endif
|
|
18
|
-
|
|
19
|
-
__attribute__((used))
|
|
20
|
-
static void zcbor_print_compare_lines(const uint8_t *str1, const uint8_t *str2, uint32_t size)
|
|
21
|
-
{
|
|
22
|
-
for (uint32_t j = 0; j < size; j++) {
|
|
23
|
-
printk ("%x ", str1[j]);
|
|
24
|
-
}
|
|
25
|
-
printk("\r\n");
|
|
26
|
-
for (uint32_t j = 0; j < size; j++) {
|
|
27
|
-
printk ("%x ", str2[j]);
|
|
28
|
-
}
|
|
29
|
-
printk("\r\n");
|
|
30
|
-
for (uint32_t j = 0; j < size; j++) {
|
|
31
|
-
printk ("%x ", str1[j] != str2[j]);
|
|
32
|
-
}
|
|
33
|
-
printk("\r\n");
|
|
34
|
-
printk("\r\n");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
__attribute__((used))
|
|
38
|
-
static void zcbor_print_compare_strings(const uint8_t *str1, const uint8_t *str2, uint32_t size)
|
|
39
|
-
{
|
|
40
|
-
for (uint32_t i = 0; i <= size / 16; i++) {
|
|
41
|
-
printk("line %d (char %d)\r\n", i, i*16);
|
|
42
|
-
zcbor_print_compare_lines(&str1[i*16], &str2[i*16],
|
|
43
|
-
MIN(16, (size - i*16)));
|
|
44
|
-
}
|
|
45
|
-
printk("\r\n");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
__attribute__((used))
|
|
49
|
-
static void zcbor_print_compare_strings_diff(const uint8_t *str1, const uint8_t *str2, uint32_t size)
|
|
50
|
-
{
|
|
51
|
-
bool printed = false;
|
|
52
|
-
for (uint32_t i = 0; i <= size / 16; i++) {
|
|
53
|
-
if (memcmp(&str1[i*16], &str2[i*16], MIN(16, (size - i*16)) != 0)) {
|
|
54
|
-
printk("line %d (char %d)\r\n", i, i*16);
|
|
55
|
-
zcbor_print_compare_lines(&str1[i*16], &str2[i*16],
|
|
56
|
-
MIN(16, (size - i*16)));
|
|
57
|
-
printed = true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (printed) {
|
|
61
|
-
printk("\r\n");
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
#ifdef __cplusplus
|
|
66
|
-
}
|
|
67
|
-
#endif
|
|
68
|
-
|
|
69
|
-
#endif /* ZCBOR_DEBUG_H__ */
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* \file test_edhoc_cipher_suite_negotiation.h
|
|
3
|
-
* \author Kamil Kielbasa
|
|
4
|
-
* \brief Test scenarios for cipher suite negotiation.
|
|
5
|
-
* \version 0.4
|
|
6
|
-
* \date 2024-01-01
|
|
7
|
-
*
|
|
8
|
-
* \copyright Copyright (c) 2024
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/* Header guard ------------------------------------------------------------ */
|
|
13
|
-
#ifndef TEST_EDHOC_CIPHER_SUITE_NEGOTIATION_H
|
|
14
|
-
#define TEST_EDHOC_CIPHER_SUITE_NEGOTIATION_H
|
|
15
|
-
|
|
16
|
-
/* Include files ----------------------------------------------------------- */
|
|
17
|
-
/* Defines ----------------------------------------------------------------- */
|
|
18
|
-
/* Types and type definitions ---------------------------------------------- */
|
|
19
|
-
/* Module interface variables and constants -------------------------------- */
|
|
20
|
-
/* Extern variables and constant declarations ------------------------------ */
|
|
21
|
-
/* Module interface function declarations ---------------------------------- */
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* \brief Cipher suite negotiation for scenario:
|
|
25
|
-
* - RFC 9528: 6.3.2. Examples:
|
|
26
|
-
* - Figure 8: Cipher Suite Negotiation Example 1.
|
|
27
|
-
*/
|
|
28
|
-
void test_edhoc_cipher_suites_negotiation_scenario_1(void);
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* \brief Cipher suite negotiation for scenario:
|
|
32
|
-
* - RFC 9528: 6.3.2. Examples:
|
|
33
|
-
* - Figure 9: Cipher Suite Negotiation Example 2.
|
|
34
|
-
*/
|
|
35
|
-
void test_edhoc_cipher_suites_negotiation_scenario_2(void);
|
|
36
|
-
|
|
37
|
-
#endif /* TEST_EDHOC_CIPHER_SUITE_NEGOTIATION_H */
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* \file test_cipher_suite_0.h
|
|
3
|
-
* \author Kamil Kielbasa
|
|
4
|
-
* \brief Unit tests for cipher suite 0.
|
|
5
|
-
* \version 0.4
|
|
6
|
-
* \date 2024-01-01
|
|
7
|
-
*
|
|
8
|
-
* \copyright Copyright (c) 2024
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/* Header guard ------------------------------------------------------------ */
|
|
13
|
-
#ifndef TEST_CIPHER_SUITE_0_H
|
|
14
|
-
#define TEST_CIPHER_SUITE_0_H
|
|
15
|
-
|
|
16
|
-
/* Include files ----------------------------------------------------------- */
|
|
17
|
-
/* Defines ----------------------------------------------------------------- */
|
|
18
|
-
/* Types and type definitions ---------------------------------------------- */
|
|
19
|
-
/* Module interface variables and constants -------------------------------- */
|
|
20
|
-
/* Extern variables and constant declarations ------------------------------ */
|
|
21
|
-
/* Module interface function declarations ---------------------------------- */
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* \brief Unit test for ECDSA (EdDSA).
|
|
25
|
-
*/
|
|
26
|
-
void test_cipher_suite_0_ecdsa(void);
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* \brief Unit test for ECDH (X25519).
|
|
30
|
-
*/
|
|
31
|
-
void test_cipher_suite_0_ecdh(void);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* \brief Unit test for HKDF extract & expand (HMAC-SHA-256).
|
|
35
|
-
*/
|
|
36
|
-
void test_cipher_suite_0_hkdf(void);
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* \brief Unit test for AEAD (AES-CCM-16-64-128).
|
|
40
|
-
*/
|
|
41
|
-
void test_cipher_suite_0_aead(void);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* \brief Unit test for hash (SHA-256).
|
|
45
|
-
*/
|
|
46
|
-
void test_cipher_suite_0_hash(void);
|
|
47
|
-
|
|
48
|
-
#endif /* TEST_CIPHER_SUITE_0_H */
|